Sergey's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Jaromil@fed.dyne.org to Programmer Humor@lemmy.ml · 8 months ago

Off by one solitude

fed.dyne.org

external-link
message-square
145
link
fedilink
1.49K
external-link

Off by one solitude

fed.dyne.org

Jaromil@fed.dyne.org to Programmer Humor@lemmy.ml · 8 months ago
message-square
145
link
fedilink
alert-triangle
You must log in or register to comment.
  • lefixxx@lemmy.world
    link
    fedilink
    arrow-up
    122
    arrow-down
    2
    ·
    8 months ago

    She is right, using 0 index for physical stuff is stupid.

    • jmcs@discuss.tchncs.de
      link
      fedilink
      arrow-up
      51
      arrow-down
      5
      ·
      8 months ago

      Your rulers start at 1? That sounds annoying.

      • NateNate60@lemmy.world
        link
        fedilink
        arrow-up
        20
        ·
        8 months ago

        Rulers measure cardinal quantities and not ordinal ones. There is no cardinal numbering scheme that starts at 1, all of them “start” at 0. For ordinal numbering schemes, the symbols are arbitrary anyway and you can start with whatever you want. It’s equally valid to start with 1, 0, -1, A, or “aardvark”. The only benefit to picking 1 as the start is to make it easier to count with your fingers while picking 0 lets you easily convert an ordinal quantity to a cardinal one.

      • Godnroc@lemmy.world
        link
        fedilink
        English
        arrow-up
        20
        ·
        8 months ago

        I’ve seen a lot of rulers that actually don’t have a mark at 0 and instead go right to the edge as 0. Typically they are worn down, being made of wood, so the accuracy of the first inch is dubious. To ensure the distance is correct, sliding the ruler down one unit is a good idea. So, my ruler starts at 0 but my measurements start at 1.

        • jmcs@discuss.tchncs.de
          link
          fedilink
          arrow-up
          25
          arrow-down
          2
          ·
          8 months ago

          That’s why decent rulers have a 0 and a margin:

          plastic ruler starting at 0 cm

          • xthexder@l.sw0.com
            link
            fedilink
            arrow-up
            22
            ·
            8 months ago

            It really depends on what you’re measuring. Good luck measuring the distance from a corner if you can’t get 0 to touch the end.

            Tape measures are almost always designed with this in mind, so you can hook the end over an edge, or butt it up against something and the measurement will be accurate both ways, since the metal end can slide in or out by just the right amount.

            • Juniper (she/her) 🫐@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              8
              ·
              8 months ago

              since the metal end can slide in or out by just the right amount.

              OMG! I genuinely thought all the tape measures I have handled were a little broken.

            • kurwa@lemmy.world
              link
              fedilink
              arrow-up
              5
              ·
              8 months ago

              Just shave down the rulers margin!

      • gallopingsnail@lemmy.sdf.org
        link
        fedilink
        arrow-up
        10
        ·
        edit-2
        8 months ago

        Your job is to move apples from one bin to another. You pick up the first one and set it in the other bin, and say “zero.”?

        • spikespaz@programming.dev
          link
          fedilink
          arrow-up
          10
          arrow-down
          1
          ·
          8 months ago

          There’s another way to think about it which I actually use. Look in the empty bin and say “zero”, then move an apple and say “one”.

        • absGeekNZ@lemmy.nz
          link
          fedilink
          English
          arrow-up
          6
          ·
          8 months ago

          When playing games with the kids, we start at 0 being the position you are currently in, then count from there.

          e.g. in snakes and ladders, if you are on spot 30 and roll a 5, tap spot 30 and say “zero”, then spot 31 is “one” etc… till you are at spot 35 saying “five”.

          Teaches the kids about zero and avoids miss counts from the younger ones counting their current position as “one”

      • lefixxx@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        8 months ago

        Touchè

        • AnUnusualRelic@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          8 months ago

          é

          • xmunk@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            ë

            • AnUnusualRelic@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              No, it’s still touché.

    • Barbarian@sh.itjust.works
      link
      fedilink
      arrow-up
      31
      arrow-down
      6
      ·
      8 months ago

      Works for floors!

      • AngryCommieKender@lemmy.world
        link
        fedilink
        arrow-up
        30
        arrow-down
        2
        ·
        8 months ago

        Not on this side of the pond. We typically don’t have a ground floor, that’s just the first floor.

      • affiliate@lemmy.world
        link
        fedilink
        arrow-up
        13
        ·
        8 months ago

        i wish the people making buildings around here knew that. some start at floor 3, others at 5. some start at 0. others at 2. every building has its own story. you need to understand the building before you can understand your position in it.

        • HeyThisIsntTheYMCA@lemmy.world
          link
          fedilink
          English
          arrow-up
          9
          ·
          8 months ago

          if a building is built into a hillside in the uk and has exits on floors 2 and 5, which would be the ground floor?

          • Juniper (she/her) 🫐@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            4
            ·
            8 months ago

            My intuition would be floor 2, as it is the lowest floor to the ground that isn’t underground

          • affiliate@lemmy.world
            link
            fedilink
            arrow-up
            5
            arrow-down
            1
            ·
            8 months ago

            it’s floor 5 from monday to wednesday, and floor 2 from thursday to sunday

    • psud@aussie.zone
      link
      fedilink
      arrow-up
      9
      ·
      8 months ago

      Blame the restaurant for having a table identified as zero

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      10
      arrow-down
      2
      ·
      8 months ago

      Why? It seems exactly as valid to me, and more valid if you like positional numberings of your physical stuff.

      You just count the number of times you departed from an item in order, rather than the times you arrived.

    • ulterno@lemmy.kde.socialBanned
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      8 months ago

      Guy is wrong. Went to 0th table. She asked for 1st table.

  • drunkpostdisaster@lemmy.world
    cake
    link
    fedilink
    arrow-up
    70
    arrow-down
    1
    ·
    8 months ago

    And then he texts back ‘where are you?’ And then she texts back ‘the first table’ and he replies ‘umm I’m here too. But I don’t see you’ confused she asks him ’ table 0p?’ And then ‘01*?’ He says ‘no, 00.’ Releaved she says ‘lol I am at table 01’ he chuckles ‘I am at 00, I’ll go find you’

    Later they get married and have kids. But relationship collapses and it ruins both of them and they cannot find the heart to love anyone again. Their children grow up broken and struggle through life. Some get arrested end up in prison, all of them repeatedly fall into a series of toxic relationships for the rest of their lives.

    • where_am_i@sh.itjust.works
      link
      fedilink
      arrow-up
      6
      ·
      8 months ago

      username checks out

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      Or… or… hear me out… one of them turns around on their chair, and says “hey there”.

      • drunkpostdisaster@lemmy.world
        cake
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        They were at the corner

  • pelya@lemmy.world
    link
    fedilink
    arrow-up
    61
    ·
    8 months ago

    In the UK it’s called a ground table.

    • AngryCommieKender@lemmy.world
      link
      fedilink
      arrow-up
      20
      ·
      8 months ago

      So it was a spelling mistake? They’re actually The Knights of The Ground Table!

      • Klear@lemmy.world
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        8 months ago

        They dance whenever they’re gable?

    • dejected_warp_core@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      8 months ago

    • affiliate@lemmy.world
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      8 months ago

      do you also have minced tables there?

    • undergroundoverground@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      8 months ago

      When you get off an airplane, do you say

      “Its great to be back on solid first floor of the earth.”

      ?

      • pelya@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        2
        ·
        8 months ago

        If the walkway goes inside the building, then yes. And the walkway usually leads directly to the second floor, because the airplane door is 3 metres above the ground.

        • undergroundoverground@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          8 months ago

          OK but what about going onto the ground?

          Like, in your garden, is that the first floor of the planet?

          • pelya@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            Inside the building it’s the first floor, even if it’s exactly at the sea level altitude. Outside the building it’s the ground. Basement levels start at minus one, there is no zeroth floor.

            • undergroundoverground@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              Exactly, the idea that you go up a floor because there’s a roof over your head is very silly.

  • aluminium@lemmy.world
    link
    fedilink
    arrow-up
    60
    ·
    8 months ago

    She was a lua girl, he was every other programming language guy. It was not ment to happen.

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      11
      ·
      8 months ago

      She liked embeddded apps
      And he liked desktop displays
      What more can I say?

    • bob_lemon@feddit.org
      link
      fedilink
      arrow-up
      10
      ·
      8 months ago

      Hey, don’t forget the Matlab people

      • TyrantTW@lemmy.ml
        link
        fedilink
        arrow-up
        7
        ·
        8 months ago

        And R!

        • szczuroarturo@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          8 months ago

          And abap

          • gerryflap@feddit.nl
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            And Julia!

  • netvor@lemmy.world
    link
    fedilink
    arrow-up
    54
    ·
    8 months ago

    Don’t wanna state the obvious, but it looks like they still ended up staring at each other for the rest of the evening.

    They have shown that they still love each other, so hope they can work with their one irreconcilable difference.

    • 👍Maximum Derek👍@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      39
      ·
      8 months ago

      I love the idea that they’re at two adjacent tables, each one staring at the other wondering why they hate them.

      • KellysNokia@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        8 months ago

        They hate each other because they are intolerant to one another’s index choices

  • lustyargonian@lemm.ee
    link
    fedilink
    arrow-up
    49
    ·
    8 months ago

    If you love me meet me at first floor

    Americans 😢 British 🤷‍♂️

    • TriflingToad@lemmy.world
      link
      fedilink
      arrow-up
      40
      ·
      8 months ago

      explanation

      • SLVRDRGN@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        8 months ago

        Exactly what this reminded me of. Thanks.

    • Agent641@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      The Major: “Fighting retreat at first light”

      Me alone in the trench the morning after next, woken by German voices: “Oh no!”

  • ddh@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    46
    ·
    8 months ago

    It’s for the best

  • yonder@sh.itjust.works
    link
    fedilink
    arrow-up
    42
    ·
    8 months ago

    That is why my restaurant will number tables by UUID.

    • OneCardboardBox@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      8
      ·
      8 months ago

      A much better idea than when I tried to organize my restaurant with hashtables.

      It was too much for the waitstaff, who had to reindex the floor plan every time they added or removed a plate.

      On the plus side, delivering the right food was always O(1).

  • iAvicenna@lemmy.world
    link
    fedilink
    arrow-up
    35
    ·
    8 months ago

    they were never meant to be together, they would confuse the hell out of each other. Imagine they have two kids and she says pick kid[1] from the school, then what?

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      18
      ·
      edit-2
      8 months ago
      Child Overflow Error
      

      Edit: oh wait you said two kids, nvm

      • Andrew@mander.xyz
        link
        fedilink
        arrow-up
        4
        ·
        8 months ago

        Hol’ up!

    • TechieDamien@lemmy.ml
      link
      fedilink
      arrow-up
      15
      ·
      8 months ago

      I think children go in dictionaries so you can look them to via name (key).

    • BluesF@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      8 months ago

      One kid’s getting garbage collected either way

  • yesman@lemmy.world
    link
    fedilink
    arrow-up
    30
    ·
    8 months ago

    The real punch line is that in a cafe run by programmers, esoteric rules are in full force, but tables 0 and 1 are no where near each other.

  • PeriodicallyPedantic@lemmy.ca
    link
    fedilink
    arrow-up
    29
    arrow-down
    1
    ·
    8 months ago

    🙅 zeroth, first, second, third
    👉 Zerost, onest, twost, threest

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      I’m the twost two that’s ever twoed.

    • psud@aussie.zone
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      Good luck standardizing English

      • PeriodicallyPedantic@lemmy.ca
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        8 months ago

        Englist*

        • Tlaloc_Temporal@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          8 months ago

          Northern England just got a new nickname.

  • Anna@lemmy.ml
    link
    fedilink
    arrow-up
    27
    ·
    edit-2
    8 months ago

    Hey, if she thinks 1 is 1st index then you dogged dodged a bullet and deserve better.

    Happy now all you English majors.

    • Bob@feddit.nl
      link
      fedilink
      arrow-up
      33
      ·
      8 months ago

      you dogged a bullet

      😳

    • MobileDecay@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      🐕🐕🐕

  • sasquash@sopuli.xyz
    link
    fedilink
    arrow-up
    27
    ·
    8 months ago

    maybe she’s a lua developer

  • LillyPip@lemmy.ca
    link
    fedilink
    arrow-up
    17
    ·
    8 months ago

    DROP TABLE 01;

    • HeyThisIsntTheYMCA@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      8 months ago

      • KellysNokia@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        8 months ago

        Dangit Bobby!

  • sgibson5150@slrpnk.net
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    8 months ago

    Wouldn’t it be nice if documentation used the words index and offset consistently?

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      arrow-down
      1
      ·
      8 months ago

      The problem is that they both are contextual and can mean any position in a list/array. The starting index or starting offset is generally zero, but could be one, depending on the language used.

      • affiliate@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        8 months ago

        i wonder why people haven’t made a language that starts indexing at 2 yet. maybe some day

        • jaybone@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          8 months ago

          Maybe this could be a feature in brainfuck or COBOL.

          • affiliate@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            8 months ago

            god i hope so

        • Vorthas@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 months ago

          Dreamberd starts array indexing at -1 instead of 0 or 1.

          https://github.com/TodePond/DreamBerd

          • affiliate@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            what a beautiful language

    • Zagorath@aussie.zone
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Aren’t those two the same thing? At least in C-style arrays, which might not be how they’re handled under the hood, but is at least how most languages present it to the programmer.

      • lefixxx@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        8 months ago

        Yes they are presented in the programmer wrong. The first thing in memory should have offset 0 and index 1

      • ReversalHatchery@beehaw.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 months ago

        in my understanding offset is technically the “relative index”, or how much you have to go further

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

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

  • 189 users / day
  • 537 users / week
  • 1.8K users / month
  • 10.3K users / 6 months
  • 1 local subscriber
  • 35.6K subscribers
  • 1.7K Posts
  • 37.6K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org