The Belfry
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@infosec.pub to Programmer Humor@programming.dev · 3 months ago

Clock, but its ORDER BY Hour DESC

infosec.pub

message-square
23
fedilink
46

Clock, but its ORDER BY Hour DESC

infosec.pub

cm0002@infosec.pub to Programmer Humor@programming.dev · 3 months ago
message-square
23
fedilink
alert-triangle
You must log in or register to comment.
  • Sunoc@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    3 months ago

    Still way better than the best LLMs can do

  • Australis13@fedia.io
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    Somebody used the wrong data type for the Hour column…

    • AnotherPenguin@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      There are no wrong data types in javascript :D

      • YellowTraveller@lemmy.zip
        link
        fedilink
        arrow-up
        4
        ·
        2 months ago

        There are no right data type in javascript*

  • wischi@programming.dev
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    3 months ago

    Because an image is a bit to lazy IMHO for “prgrammer” humor. I programmed a clock that actually works. Have fun 🤣

    https://jsfiddle.net/gjpwf5oq/2/

    Btw: you can change the order of the clock-face if you want.

    Update: Supports arbitrary text now (example roman numerals): https://jsfiddle.net/2o97k6vz/6/

    Update: And with Months because why not 🤣 https://jsfiddle.net/2o97k6vz/7/

    • RiQuY@lemmy.zip
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      3 months ago

      Your clock goes backwards.

      • wischi@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        3 months ago

        That’s intended. Look at the second hand for a minute. It goes 1, 2, 3, etc. like on a real clock but the numbers are distributed differently. That’s also why the hands sometimes have to move faster to reach their target in time. It goes (backwards) if it’s closer.

  • RogueBanana@piefed.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    Isn’t it ascending? Alphabetically I mean.

  • Senseless@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Thanks, I hate it.

  • Jeeve65@ttrpg.network
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    You mean I, II, III, IV, IX, V, VI, VII, VIII, X, XI, XII

    • smeg@feddit.uk
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      It’s usually IIII on clocks

      • ChaoticNeutralCzech@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        3 months ago

        Depends on where and when it’s from, it’s rare where I live. Also, makes no difference in terms of alphabetical sorting.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          3 months ago

          It would, if it were:
          I II III IIII IIIII IIIIII IIIIIII IIIIIIII IIIIIIIII IIIIIIIIII IIIIIIIIIII IIIIIIIIIIII


          Also, if IX ended up being VIIII, it would end up sorting in numerical order.

  • zr0@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    3 months ago

    Order by string desc would be Z-A ordering, or 9-0

    ORDER BY str(Hour) DESC: 9, 8, 7, 6, 5, 4, 3, 2, 12, 11, 10, 1

    ORDER BY int(Hour) DESC: 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

    • gwl [he/him]@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      That depends on language

      • optissima@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Finally a truly localised time

        • gwl [he/him]@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          I meant programming language, but yeah also true

  • jet@hackertalks.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    This is why the military uses 03 hundred hours… Makes things clear, and sortable regardless of your algorithm

    • zr0@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      3 months ago

      Sure. No one ever in this entire world ever did a int(“0200”), because it is insane to represent numbers as actual numbers. I am so glad that military invented a standard working with any algorithm.

  • gwl [he/him]@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    3 months ago

    Makes me wonder if there’s an equivalent of /r/BadUXBattles loved that Reddit

    Edit: couldn’t find one, made one

    !baduibattles@lemmy.blahaj.zone

    • ForeverComical@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Then you’ll love this video https://youtu.be/TOzEnwl7LkA

      • gwl [he/him]@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        Makes me think of the https://neal.fun/ one for passwords

        • ramjambamalam@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 months ago

          Kitboga has some videos where he integrates Neal’s password game into a fake bank password reset UI, and gets the scammers to play the game. It’s one of the GOAT scambait videos.

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.

  • 139 users / day
  • 411 users / week
  • 862 users / month
  • 19.4K users / 6 months
  • 1 local subscriber
  • 28.5K subscribers
  • 1.89K Posts
  • 48.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org