okr765
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Agent641@lemmy.world to Programmer Humor@programming.dev · 22 hours ago

Clock but we saved DB space by just returning the index of the array of DigitNames

lemmy.world

message-square
23
fedilink
206

Clock but we saved DB space by just returning the index of the array of DigitNames

lemmy.world

Agent641@lemmy.world to Programmer Humor@programming.dev · 22 hours ago
message-square
23
fedilink
alert-triangle
You must log in or register to comment.
  • OpenStars@piefed.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    11 hours ago

    This clock starts at both one and at zero!

    img

  • Philip Goto@discuss.tchncs.de
    link
    fedilink
    arrow-up
    37
    ·
    19 hours ago

    Clock but it’s made by an LLM:

    https://clocks.brianmoore.com/

    • Southern Wolf@pawb.social
      link
      fedilink
      arrow-up
      11
      ·
      16 hours ago

      Lol, this both shows how bad most models are… But also how damn good the two big OSS models are, DeepSeek and Kimi.

    • satanmat@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 hours ago

      Oh my god. I love that so much.

      Now I need to do that but randomize which one is displayed ….

    • Whelks_chance@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      19 hours ago

      Amazing

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    7
    ·
    14 hours ago

    Wait until you learn how months are numbered in some programming languages.

    The clever documentation calls it “months since January”.

    • optional@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      7 hours ago

      JavaScript: Hold my Date!

      new Date().getYear() == 125

      • palordrolap@fedia.io
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        JavaScript is in that set of “some” languages. Most of it ties back to C’s struct tm which zero-indexes months (0-11), weekdays (0-6), and the rarely used day of year (0-365), as well as offsetting years by 1900.

        The odd man out, so to speak, is the date (or “mday” as it’s called there), which is in the range 1-31. One (Perl) book I own suggests that the zero-based ones are used to index arrays of strings and implies this one is different because it generally isn’t used that way.

        But anyway, these are decisions made 50 years ago that still haunt us.

  • coreray00@discuss.online
    link
    fedilink
    English
    arrow-up
    2
    ·
    11 hours ago

    Everything’s an entity if you really think about it 😔

  • davidgro@lemmy.world
    link
    fedilink
    arrow-up
    31
    arrow-down
    1
    ·
    22 hours ago

    That really is more logical. (Except that the initial element generally goes in the top slot of the clock. Note that 12 is the first hour both of AM and of PM.)

    • NateNate60@lemmy.world
      link
      fedilink
      arrow-up
      18
      ·
      20 hours ago

      A strictly logical clock for a 24-hour day would have 0 at the top with 1 on the right and 23 on the left. And it would be only ever set to UTC.

      • ooterness@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        13 hours ago

        UTC has leap seconds. We can do better. PTP/TAI for lyfe.

        A perfectly logical clock would use a radio broadcast to count off seconds since a predefined epoch. Put a few of them way up high, so more people can see it, and make them so astonishingly precise that you could tell where you are just by listening.

      • bdonvr@thelemmy.club
        link
        fedilink
        arrow-up
        7
        ·
        19 hours ago

        A strictly logical 24 hour clock would just display the digits tbh.

        • InnerScientist@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          18 hours ago

          In binary

          • bdonvr@thelemmy.club
            link
            fedilink
            arrow-up
            3
            ·
            13 hours ago

            I’m not sure I’d argue binary is more or less “logical”. A number is a number.

    • Deebster@infosec.pub
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      22 hours ago

      @Agent641@lemmy.world right now

      man in a red t-shirt screaming I can't win

      (image proxy seems broken, it’s this gif)

      • Agent641@lemmy.worldOP
        link
        fedilink
        arrow-up
        2
        ·
        19 hours ago

        Look away, I don’t want you to see me cry

  • Routhinator@startrek.website
    link
    fedilink
    English
    arrow-up
    6
    ·
    16 hours ago

    And then you added 1, right?

    …right?

  • Australis13@fedia.io
    link
    fedilink
    arrow-up
    8
    ·
    20 hours ago

    Well, if we’re saving DB space, why not just use the generate_series function (assuming you’re running PostgreSQL…)?

    • Agent641@lemmy.worldOP
      link
      fedilink
      arrow-up
      9
      ·
      19 hours ago

      Hey man, shoulda coulda woulda, was it in the spec?

      • Australis13@fedia.io
        link
        fedilink
        arrow-up
        6
        ·
        19 hours ago

        What’s a little scope creep between friends?

        • Rikudou_Sage@lemmings.world
          link
          fedilink
          arrow-up
          4
          ·
          18 hours ago

          Why limit it to friends? In my company, we do scope creep for everyone!

          • Australis13@fedia.io
            link
            fedilink
            arrow-up
            3
            ·
            18 hours ago

            There’s something to be said for consistency!

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
Visibility: Public
globe

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

  • 1.7K users / day
  • 4.14K users / week
  • 8.75K users / month
  • 19K users / 6 months
  • 1 local subscriber
  • 27.2K subscribers
  • 1.67K Posts
  • 53.9K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org