programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

pastelmind, in GitHub Desktop or Git CLI?

Fork is much better than GitHub Desktop, you can use it without paying indefinitely

Alph4d0g, in Programmer tries to explain binary search to the police

I’m sure it didn’t go well. If it was somehow framed in a sycophantic way where the police were led to believe it was their idea, I’m sure it would have gone better. Wait that might not be too difficult to do.

tocopherol, (edited )
@tocopherol@lemmy.dbzer0.com avatar

You just have to say there was a weird technique the Nazi’s liked to use.

pressanykeynow,

They probably already know all Nazi techniques.

andthenthreemore,

Na. If it’s British police it’s just an excuse. All they’re there for after all these years of Tory cuts is to give you a reference number so you can make an insurance claim.

LUHG_HANI, in Programmer tries to explain binary search to the police
@LUHG_HANI@lemmy.world avatar

This sparked something magical OP.

The_Picard_Maneuver,
@The_Picard_Maneuver@startrek.website avatar

And I had worried about it being a picture of text.

uis, (edited ) in Programmer tries to explain binary search to the police
@uis@lemmy.world avatar

This student should never go to xitter. Or will be canceled instantly.

fl42v,

Sure, fuck xorg knockoff. What’s the connection here, tho?

uis,
@uis@lemmy.world avatar

Binary search. They don’t like it.

ntzm,

Wtf are you talking about?

uis,
@uis@lemmy.world avatar

Binary search

ILikeBoobies, in GitHub Desktop or Git CLI?

Gitlab/Azure Repo

HawlSera, in Programmer tries to explain binary search to the police

Jesus fucking Christ, I know police are dumb, in fact if your IQ is too high you can actually be legally barred from employment as a police officer in the United States of america. Look it up. But fuck incompetence of these Jokers continue to tickle my asshole in a negative way

adrian783,

I did look it up and there is only 1 case from 2000 that set the high bar at 125. it’s not really representative of the whole.

GiveMemes, (edited )

125 ain’t even that high like wut. That’s like 3+% of the population lmao

adrian783,

it’s top 5%…

cobra89,

I fuckin hate cops as much as the next person but people love to spout this fact, but there is literally only 1 police department ever that has been documented doing this, and it was the one police department in Connecticut.

However the court did in fact rule it was legal, yes.

But the way everyone talks about it you’d think this was some super widespread policy that many departments use. And as far as I can tell there’s only ever been the 1 example. It’s the same case that every single article about it refers to.

Kalkaline, (edited ) in Programmer tries to explain binary search to the police
@Kalkaline@leminal.space avatar

God damn, whoever came up with that is clever. I would have never come up with that on my own.

glibg10b,

Without binary search, we would not have search engines today

jmcs,

What if you had to guess a number between 0 and 100 and the other person (or an application) only told you if the number is bigger or smaller? That’s the form that’s usually presented to CS students and most people end up figuring it out on their own. Then the trick is knowing how to generalize it.

fsxylo,

waves magic wand computer science!

systemglitch,

Honestly you probably do it already without thinking about it when trying to figure out where you left off a video that you never paused.

Or if you ever had VHS tapes, or so e from of disc media… perhaps a cassette when looking for a particular part of a song.

Maybe not as methodical as perfectly breaking it down into halves of halves, but xlos enough to help you pin point what part you are looking for.

Pamasich,
@Pamasich@kbin.social avatar

I'm pretty sure they were using sarcasm.

Kalkaline,
@Kalkaline@leminal.space avatar

I’m pretty sure I was serious. I don’t know how people can be that clever. It seems simple once it’s explained, sure, but I wouldn’t be able to come up with that on my own without someone else giving me a problem that points me in that direction.

khannie,
@khannie@lemmy.world avatar

Studied this in computer science algorithms class waaaaayyy back in 1996 and by golly this one stuck with me. It’s so simple and so effective.

CmdrShepard,

Works the same for finding a burned out bulb on a string of Christmas lights too.

acceptable_pumpkin, (edited )

Some security camera systems have this built in. They show snapshots of various times where you choose the total period, say 24 hours. Then you glance through the snapshots that are all displayed at once on the screen and click on the last one where your bike was still there. That will then “zoom in” the timeline and show another set of snapshots, though this time within a smaller total time window. Keep clicking on the last panel with the bike, and it will soon show you the clip of the bike being stolen.

Really helpful to find out when something changed.

dudinax,

Yeah, there’s no reason it should take an hour no matter how long the tape is.

justJanne, (edited )

If you’ve got 14 billion years, a theft takes a minute, then you need 53 recursion levels of binary search to find the moment of the theft. (14 billion years can be split into about 7.3e15 1-minute segments, 53 levels of binary search allow you to search through 9e15 segments)

That means OP assumed that it’d take 1 minute to decide whether at a certain still frame the theft had already occured or not, to compute the new offset to seek to, and the time it’d take to actually seek the tape to that point.

Not an unreasonable assumption, but a very conservative estimate. Assuming the footage is on an HDD and you’ve got an automated system for binary search, I’d actually assume it’d take 5 seconds for each step, meaning finding a 1min theft on 14 billion years of footage would take 5 minutes.

Anemia,

According to my napkin math it would take longer than an hour if the tape was ~3.3*10^218 sec long (or three million trillion trillion… (18 trillions) …trillion years). Assuming you have only have two options to choose between but can pick which alternative in in 5 seconds (2^720) and you want to get down to a 1 minute intervall.

So i mean its not impossible to find a tape long enough though it seems unlikely that we would be so off in our estimates of the age of the universe.

ODuffer,
@ODuffer@lemmy.world avatar

Enhance…

ReplicantBatty,
SmoothLiquidation,
Cannacheques,

Covert zorb ball carrying remote control toy racecar through the HRV system

beefsquatch, in GitHub Desktop or Git CLI?
@beefsquatch@programming.dev avatar

Sublime Merge, for most items in the UI it tells you the git command it will use

T1000, in Programmer tries to explain binary search to the police

Sounds about right. Cops have low iqs

buzz,
@buzz@lemmy.world avatar

Its likely just a fake story, omitting key details to make the web assembler feel better about his CSS skills.

spark947,

Yeah, seriously. What is even the context of this? We have no idea. The cops might have been like “We need a warrant to look at that footage you idiot.”

kablammy,

Whoever owns the camera presumably has an interest in reducing/solving crime in the area (why else have cameras?), so they would likely be happy to make the footage available to police if asked nicely, with no warrant required.

spark947,

Yeah, in general, but not necessarily in that circumstance. A lot of time talking to tech people (I’m a softwar engineer) they can can be smug about this while leaving out important context.

DroneRights,

No, I’ve been in this situation as a victim. My bike was stolen and they said it would take hours to search the CCTV. I told them about binary search, they didn’t understand.

usernamesaredifficul,

more importantly cops don’t actually give a shit about solving crime.

In England the police primarily exist to keep noise down in middle class areas. I assume it’s even worse in America

tocopherol, (edited )
@tocopherol@lemmy.dbzer0.com avatar

That is their primary purpose here too but it just requires more violence and subjection, Americans are extra noisy.

comrade_pibb, in GitHub Desktop or Git CLI?
@comrade_pibb@hexbear.net avatar

sublime merge

space_comrade, (edited ) in GitHub Desktop or Git CLI?

Gitgui is pretty great too if you need a bit of interactivity. It’s bare bones and no bullshit but can still do like 90% of what all the other fancy tools can do.

potterman28wxcv, in Programmer tries to explain binary search to the police

I do not get why it would work in that case. I assume the scenario is someone with a bike coming, doing theft, then leaving with the same bike.

Therefore there will be a period without bike, then a period with bike, then a period without bike again.

Let’s assume there is no bike on the particular moment viewed. How do you know whether it occured before or after the theft? If you make the wrong decision, you get stuck on an endless binary search… Unless you take note at each timestamp where you made the decision, draw a tree of timestamps, and go back the tree if your search is fruitless but that’s much more complicated than what this post says.

Aatube,
@Aatube@kbin.social avatar

To me it sounds like they stole the bike.

potterman28wxcv,

Thanks indeed I misunderstood the problem

SexualPolytope,
@SexualPolytope@lemmy.sdf.org avatar

You’re making this way more complicated than it actually is. The guy definitely can give estimates for when he parked the bike and when he found out that it was stolen. It’s not that complicated.

potterman28wxcv,

I misunderstood the problem. I thought the thieve came on bike to steal something. I did not get that the bike itself was what got stolen.

lemmesay, in Manager: This task only takes 30 minutes. Why did it take you the whole day?
@lemmesay@discuss.tchncs.de avatar

[conventional commits] (www.conventionalcommits.org/en/v1.0.0/) will save you.
or maybe commitizen if you’d like not to write them by hand.
and maybe commit and tag version, which will create changelogs for you of you follow semver

eluvatar, in GitHub Desktop or Git CLI?

I only use it to clone projects via the Open in GitHub desktop link.

vsh, in GitHub Desktop or Git CLI?
@vsh@lemm.ee avatar

GitHub desktop for life

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #