Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
The Picard Maneuver ( The_Picard_Maneuver@startrek.website )  to Programmer Humor@programming.dev · il y a 3 ans

Programmer tries to explain binary search to the police

startrek.website

message-square
59
link
fedilink
1.37K

Programmer tries to explain binary search to the police

startrek.website

The Picard Maneuver ( The_Picard_Maneuver@startrek.website )  to Programmer Humor@programming.dev · il y a 3 ans
message-square
59
link
fedilink
alert-triangle
You must log in or # to comment.
  • teft ( teft@startrek.website ) 
    link
    fedilink
    arrow-up
    261
    ·
    il y a 3 ans

    Yeah, pigs don’t like to be corrected. Or made to look like they don’t know what they’re doing.

    • tquid ( tquid@kbin.social ) 
      link
      fedilink
      arrow-up
      168
      ·
      il y a 3 ans

      And they absolutely hate ever doing anything about bicycle theft in particular.

      • lars ( lars@programming.dev ) 
        link
        fedilink
        arrow-up
        22
        ·
        il y a 3 ans

        I reported my bike stolen in college and I got a call the next day that they had found it parked in front of a nearby church.

        It was stolen on a Sunday. I guess someone didn’t want to be late to service.

        • thebuoyancyofcitrus ( thebuoyancyofcitrus@beehaw.org ) 
          link
          fedilink
          arrow-up
          18
          ·
          il y a 3 ans

          What you’re entering the third act of your love story and you have to get to the church in time to break up the wedding and declare your love, what’s a little bike theft? The universe will take care of it.

        • Honytawk ( Honytawk@lemmy.zip ) 
          link
          fedilink
          arrow-up
          7
          ·
          il y a 3 ans

          Probably added the theft to the sins they were confessing that day as well.

        • TheBlue22 ( TheBlue22@lemmy.blahaj.zone ) 
          link
          fedilink
          arrow-up
          4
          ·
          il y a 3 ans

          God made them do it!

  • Pazuzu ( Pazuzu@midwest.social ) 
    link
    fedilink
    English
    arrow-up
    116
    ·
    edit-2
    il y a 3 ans

    I thought this had to be hyperbole, so I did the math myself. I’m assuming human history is 200,000 years as google says, and we want to narrow this down to the second the bike disappeared. also that the bike instantly vanished so there’s no partially existing bike.

    each operation divides the time left in half, so to get from 200k years (6.311×10^12 seconds) to 1 would take ~42.58 divisions, call it 43. even if we take a minute on average to seek and decide whether the bike is there or not it would still be less than an hour of manual sorting

    hell, at 60fps it would only take another 6 divisions to narrow it down to a single frame, still under an hour

    edit: to use the entire hour we’d need a couple more universes worth of video time to sort through, 36.5 billion years worth to be exact. or a measly 609 million years if we need to find that single frame at 60fps

    • rckclmbr ( rckclmbr@lemm.ee ) 
      link
      fedilink
      arrow-up
      35
      ·
      il y a 3 ans

      I regularly bisect commits in the range of 200k (on the low end) for finding causes of bugs. It takes me minutes. Pretty crazy

    • psud ( psud@aussie.zone ) 
      link
      fedilink
      arrow-up
      17
      ·
      il y a 3 ans

      History is about 10k years, the 200k years is mostly pre-history. People didn’t write stuff down until they invented agriculture and needed to track trade between owners, workers, etc

    • rekabis ( rekabis@lemmy.ca ) 
      link
      fedilink
      arrow-up
      4
      ·
      il y a 3 ans

      Combine AI image/visual-pattern recognition and quantum computing, and this search could be completed before it was even started.

    • MagnoliaMayhem ( MagnoliaMayhem@programming.dev ) 
      link
      fedilink
      arrow-up
      4
      ·
      il y a 3 ans

      Just watch at 3X!

    • Syldon ( Syldon@feddit.uk ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      il y a 3 ans

      A minute to decide if there is a bike in the picture really ?

      • Pazuzu ( Pazuzu@midwest.social ) 
        link
        fedilink
        English
        arrow-up
        7
        ·
        il y a 3 ans

        Takes time to precisely seek to each timestamp, but really I just meant that an hour was reasonable even with a lazy cop doing the search

      • lad ( sukhmel@programming.dev ) 
        link
        fedilink
        arrow-up
        2
        ·
        il y a 3 ans

        They must be really bad at solving CAPTCHA

  • Melllvar ( charonn0@startrek.website ) 
    link
    fedilink
    English
    arrow-up
    75
    ·
    il y a 3 ans

    Part of my job is to review security footage for reported incidents.

    If there is a long-lasting visual cue that the event has or has not happened yet (e.g. a window is either broken or not), then a binary search is very useful.

    If the event lasts only a moment and leaves no visual cue (e.g. an assault), then binary search is practically useless.

  • DarkThoughts ( DarkThoughts@kbin.social ) 
    link
    fedilink
    arrow-up
    72
    ·
    il y a 3 ans

    That’s how I look for broken mods too. Move half of them into a temp folder, launch the game. If it works, put half of the sorted out ones back. if it doesn’t work, remove another half and try again.

    • Haus ( Haus@kbin.social ) 
      link
      fedilink
      arrow-up
      7
      ·
      il y a 3 ans

      When I want to see a broken mod, I just surf over to Reddit.

    • MonkderZweite ( MonkderZweite@feddit.ch ) 
      link
      fedilink
      arrow-up
      4
      ·
      il y a 3 ans

      Btw, this is why i have given up on Early Access on Steam; can’t disable updates and have to fix your 100 mods then.

      • DarkThoughts ( DarkThoughts@kbin.social ) 
        link
        fedilink
        arrow-up
        2
        ·
        il y a 3 ans

        I love Steam, but the fact that you cannot permanently disable auto updates for specific titles is definitely infuriating.

    • KSP Atlas ( KSPAtlas@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      2
      ·
      il y a 3 ans

      Yeah, pretty great in my minecraft modding experience

  • frezik ( frezik@midwest.social ) 
    link
    fedilink
    arrow-up
    70
    ·
    il y a 3 ans

    I’m a little surprised the police didn’t already know about that method. Seems like they’d encounter enough CCTV footage that’d it’d be standard training.

    I once again overestimate the training levels of the police.

    • Laticauda ( Laticauda@lemmy.ca ) 
      link
      fedilink
      arrow-up
      12
      ·
      il y a 3 ans

      I imagine it’s utilized in more “serious” investigations and they just can’t be arsed for theft.

  • TheBlue22 ( TheBlue22@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    67
    ·
    il y a 3 ans

    Police try to understand anything challenge (100% impossible) (gone sexual) (gone violent)

    • doctorcrimson ( doctorcrimson@lemmy.today ) 
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      il y a 3 ans

      deleted by creator

  • Localhorst86 ( Localhorst86@feddit.de ) 
    link
    fedilink
    arrow-up
    40
    ·
    il y a 3 ans

    “Exactly my point. We will not be investing an hour looking at the footage to pinpoint the time of theft, now get out!”

  • rekabis ( rekabis@lemmy.ca ) 
    link
    fedilink
    arrow-up
    34
    ·
    il y a 3 ans

    “This argument didn’t go down well.”

    🤣🤣🤣 LMAO

    What an awesome punchline, should have been on its own line for more impact.

  • NullPointer ( nullPointer@programming.dev ) 
    link
    fedilink
    arrow-up
    31
    ·
    il y a 3 ans

    just tell them there is a black man at the moment of theft, they will get on it lickety split!

    • cannache ( Cannacheques@slrpnk.net ) 
      link
      fedilink
      arrow-up
      3
      ·
      il y a 3 ans

      Sad meme very relevant

  • Alph4d0g ( Alph4d0g@discuss.tchncs.de ) 
    link
    fedilink
    arrow-up
    31
    ·
    il y a 3 ans

    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.

    • ThenThreeMore ( andthenthreemore@startrek.website ) 
      link
      fedilink
      English
      arrow-up
      12
      ·
      il y a 3 ans

      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.

    • tocopherol ( tocopherol@lemmy.dbzer0.com ) 
      link
      fedilink
      arrow-up
      9
      ·
      il y a 3 ans

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

      • pressanykeynow ( pressanykeynow@iusearchlinux.fyi ) 
        link
        fedilink
        arrow-up
        7
        ·
        il y a 3 ans

        They probably already know all Nazi techniques.

  • groucho ( groucho@lemmy.sdf.org ) 
    link
    fedilink
    English
    arrow-up
    31
    ·
    il y a 3 ans

    The final project in my instrumentation class was to tune a PID controller for a hot/cold mixing valve. I (CS/ENG) was paired up with an engineering student and a lot of it was throwing parameters in, seeing if weird shit happened, and then turning down or up based on the result. I had a programming final and something else I was supposed to be studying for, so I just started doing a binary search with the knobs. We got the thing tuned relatively fast and my partner acted like I was a wizard.

    • clericc ( clericc@feddit.de ) 
      link
      fedilink
      arrow-up
      2
      ·
      il y a 3 ans

      How do you do a binary search for an open-end scale (are PID params open-end?) and three knobs at the same time when they interdepend in their influence? I need to know since i have a PID tuning on my personal projects plate

      • groucho ( groucho@lemmy.sdf.org ) 
        link
        fedilink
        English
        arrow-up
        3
        ·
        il y a 3 ans

        It’s been ages, but we’d done rough calculations for the three controls so we roughly knew what we needed. Our teacher was big on manually tuning instead of just using formulas since he thought just running numbers “lacked artfulness.”

        So we grabbed a point and started searching around manually. I think we were just tuning the derivative portion at that point, trying to get a fast response without the system without it going chaotic and noisy.

  • Kalkaline  ( Kalkaline@leminal.space ) 
    link
    fedilink
    arrow-up
    29
    ·
    il y a 3 ans

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

    • jmcs ( jmcs@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      25
      ·
      il y a 3 ans

      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.

    • CmdrShepard ( CmdrShepard@lemmy.one ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      il y a 3 ans

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

    • glibg10b ( glibg10b@lemmy.ml ) 
      link
      fedilink
      arrow-up
      2
      ·
      il y a 3 ans

      Without binary search, we would not have search engines today

  • ElectricVocalist ( Mubelotix@jlai.lu ) 
    link
    fedilink
    arrow-up
    29
    ·
    il y a 3 ans

    It would have taken 5 minutes at most

    • heimchen ( heimchen@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      7
      ·
      il y a 3 ans

      My Graphics card/ssd wouldn’t be able to handle the skipping of such big files

    • I_am_10_squirrels ( I_am_10_squirrels@beehaw.org ) 
      link
      fedilink
      arrow-up
      1
      ·
      il y a 3 ans

      On my site’s security nvr, it takes five minutes just to convince it that you want to search a particular camera

  • Queen HawlSera ( HawlSera@lemm.ee ) 
    link
    fedilink
    English
    arrow-up
    26
    ·
    il y a 3 ans

    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

    • cobra89 ( cobra89@beehaw.org ) 
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      il y a 2 mois

      deleted by creator

  • T1000 ( T1000@lemm.ee ) 
    link
    fedilink
    arrow-up
    25
    ·
    il y a 3 ans

    Sounds about right. Cops have low iqs

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 444 users / day
  • 1.84K users / week
  • 3.3K users / month
  • 7.28K users / 6 months
  • 463 local subscribers
  • 33.6K subscribers
  • 1.53K Posts
  • 25.1K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code