• 5 Posts
  • 159 Comments
Joined 2 years ago
cake
Cake day: July 4th, 2023

help-circle

  • Beautiful jank layout:

    Image description

    Depicted: Some delightful lemmy jankiness, above messages were only sinlge years followed by a colon, which for whatever reason gets rendered far far too left, outside of the normal “draw box” for a comment.


    My best guess: It treats any number followed by a colon at start of line as a list item, which has a hard x position for the colon, and since years are quite wide it overflows.

    EDIT: Guess looks partially right, guilty css (nested in flex boxes):

    ol, ul { 
      padding-left: 2rem;
    }
    




  • Warmiest memory is our dad reading to me and my sisters (until we were quite old I think) , the Chronicles of Narnia, really going for the voice acting.

    After wracking my brain trying to remember novels I read as kid and coming up blank, I finally remembered most of my early sci-fi books were in French, mostly aimed at middle-school aged kids but, gave me an early taste for sci-fi, and neat cover art to boot: https://www.noosfere.org/livres/collection.asp?NumCollection=-10246504&numediteur=3902

    A few choice picks:

    Les Abîmes d’Autremer: (rough translation: The Abysses of Othersea)

    About a young journalist investigating the planet (Autremer) with the best spaceships (the Abîmes), which turn out to be retro-fitted space whales, that the pilot bonds to, and the journalist herself ends up as a pilot.

    L’ Œuil des Dieux: (The eye of the gods)

    About a group of 29 kids who were left behind at a lunar station after a serious accident while there were still in kindergarten, (nobody knows they are still alive), told many years later the oldest ones now teenagers, when they don’t really remember this (having been raised by a now defunct nanny robot) , and for them the station is the whole world, and they don’t really understand technology, and are separated into three semi-hostile tribes tribes the Wolves, the Bears, and the Craze.

    (Generation Ship sci-fi is still one of ny favorite genre, if I ever write a sci-fi book it would probably be in that setting)

    L’Or Bleu: (Blue gold)

    This one I don’t remember that well and don’t have at hand, but it follows a young man from saturn visiting Earth for the first time, in a world where water has become scarce, specifically in the Atlanpolis capital city of the now dry Mediterranean sea, Paris with a now dry Seine river, making his living by being very good at arcade virtual reality videogames with leaderboards (the book is originally from 1989), and uncovering machinations of those of have power and control of water.

    Bonus Mention:

    From a short story, from a collection I don’t remember, but it follows a girl who is interupted in her life [while vacationing with her parents], is interrupted by the “Player” trying to complete his quest, and finding out that she’s acutally an NPC, she’s disturbingly realistic, and falling in love they do eventually complete the quest with a teary goodbye, and hopes that the virtual reality software the boy is using is actually tapping into parallel universes somehow. Cue the reveal, the girl was the Player all along, with slightly modified memories, for “enhanced” “immersion” and “excitement”, she does not mourn or worry about the boy much at all, realizing he was the NPC after all.

    L’imparfait du futur, une épatante aventure de Jules: (Future Imperfect, A spiffing adventure of Jules)

    This one is a whole French comic book series (Bande-déssinée), which tells the story of Jules an unremarkable young man with average grades, who is selected for a space program for no greatly explained reason (It later turns out the chief scientist is a crazed eugenicist with really flawed software, trying to create “ideal” pairs), which actually explores the concept and consequence of light speed travel, and time dilation, something not properly explained to Jules, until “take off”, cue a horrified face. When he does come back from alpha centauri in later installements, his younger brother is indeed now older than him. This book actually prompted me to ask in class in 2nd Grade for the teacher to please explain Relativity (in front of the whole class), and to his credit he actually gave it a fair shot, and didn’t dismiss the question as not being context or age-appropriate.

    [There’s actually also lot of high quality french sci-fi comic books, generally intented for a more grown up audience.]



  • 24! - Crossed Wires - Leaderboard time 01h01m13s (and a close personal time of 01h09m51s)

    Spoilers

    I liked this one! It was faster the solve part 2 semi-manually before doing it “programmaticly”, which feels fun.

    Way too many lines follow (but gives the option to finding swaps “manually”):

    #!/usr/bin/env jq -n -crR -f
    
    ( # If solving manually input need --arg swaps
      # Expected format --arg swaps 'n01-n02,n03-n04'
      # Trigger start with --arg swaps '0-0'
      if $ARGS.named.swaps then $ARGS.named.swaps |
        split(",") | map(split("-") | {(.[0]):.[1]}, {(.[1]):.[0]}) | add
      else {} end
    ) as $swaps |
    
    [ inputs | select(test("->")) / " " | del(.[3]) ] as $gates |
    
    [ # Defining Target Adder Circuit #
      def pad: "0\(.)"[-2:];
      (
        [ "x00", "AND", "y00", "c00" ],
        [ "x00", "XOR", "y00", "z00" ],
        (
          (range(1;45)|pad) as $i |
          [ "x\($i)", "AND", "y\($i)", "c\($i)" ],
          [ "x\($i)", "XOR", "y\($i)", "a\($i)" ]
        )
      ),
      (
        ["a01", "AND", "c00", "e01"],
        ["a01", "XOR", "c00", "z01"],
        (
          (range(2;45) | [. , . -1 | pad]) as [$i,$j] |
          ["a\($i)", "AND", "s\($j)", "e\($i)"],
          ["a\($i)", "XOR", "s\($j)", "z\($i)"]
        )
      ),
      (
        (
          (range(1;44)|pad) as $i |
          ["c\($i)", "OR", "e\($i)", "s\($i)"]
        ),
        ["c44", "OR", "e44", "z45"]
      )
    ] as $target_circuit |
    
    ( #        Re-order xi XOR yi wires so that xi comes first        #
      $gates | map(if .[0][0:1] == "y" then  [.[2],.[1],.[0],.[3]] end)
    ) as $gates |
    
    #  Find swaps, mode=0 is automatic, mode>0 is manual  #
    def find_swaps($gates; $swaps; $mode): $gates as $old |
      #                   Swap output wires                #
      ( $gates | map(.[3] |= ($swaps[.] // .)) ) as $gates |
    
      # First level: 'x0i AND y0i -> c0i' and 'x0i XOR y0i -> a0i' #
      #      Get candidate wire dict F, with reverse dict R        #
      ( [ $gates[]
          | select(.[0][0:1] == "x" )
          | select(.[0:2] != ["x00", "XOR"] )
          | if .[1] == "AND" then { "\(.[3])": "c\(.[0][1:])"  }
          elif .[1] == "XOR" then { "\(.[3])": "a\(.[0][1:])"  }
          else "Unexpected firt level op" | halt_error end
        ] | add
      ) as $F | ($F | with_entries({key:.value,value:.key})) as $R |
    
      #       Replace input and output wires with candidates      #
      ( [ $gates[]  | map($F[.] // .)
          | if .[2] | test("c\\d") then [ .[2],.[1],.[0],.[3] ] end
          | if .[2] | test("a\\d") then [ .[2],.[1],.[0],.[3] ] end
        ] # Makes sure that when possible a0i comes 1st, then c0i #
      ) as $gates |
    
      # Second level:   use info rich 'c0i OR e0i -> s0i' gates   #
      #      Get candidate wire dict S, with reverse dict T       #
      ( [ $gates[]
          | select((.[0] | test("c\\d")) and .[1] == "OR" )
          | {"\(.[2])": "e\(.[0][1:])"}, {"\(.[3])": "s\(.[0][1:])"}
        ] | add | with_entries(select(.key[0:1] != "z"))
      ) as $S | ($S | with_entries({key:.value,value:.key})) as $T |
    
      ( #      Replace input and output wires with candidates     #
        [ $gates[] | map($S[.] // .) ] | sort_by(.[0][0:1]!="x",.)
      ) as $gates  | #                   Ensure "canonical" order #
    
      [ # Diff - our input gates only
        $gates - $target_circuit
        | .[] | [ . , map($R[.] // $T[.] // .) ]
      ] as $g |
      [ # Diff +  target circuit only
        $target_circuit - $gates
        | .[] | [ . , map($R[.] // $T[.] // .) ]
      ] as $c |
    
      if $mode > 0 then
        #    Manual mode print current difference    #
        debug("gates", $g[], "target_circuit", $c[]) |
    
        if $gates == $target_circuit then
          $swaps | keys | join(",") #   Output successful swaps  #
        else
          "Difference remaining with target circuit!" | halt_error
        end
      else
        # Automatic mode, recursion end #
        if $gates == $target_circuit then
          $swaps | keys | join(",") #   Output successful swaps  #
        else
          [
            first(
              # First case when only output wire is different
              first(
                [$g,$c|map(last)]
                | combinations
                | select(first[0:3] == last[0:3])
                | map(last)
                | select(all(.[]; test("e\\d")|not))
                | select(.[0] != .[1])
                | { (.[0]): .[1], (.[1]): .[0] }
              ),
              # "Only" case where candidate a0i and c0i are in an
              # incorrect input location.
              # Might be more than one for other inputs.
              first(
                [
                  $g[] | select(
                    ((.[0][0]  | test("a\\d")) and .[0][1] == "OR") or
                    ((.[0][0]  | test("c\\d")) and .[0][1] == "XOR")
                  ) | map(first)
                ]
                | if length != 2 then
                    "More a0i-c0i swaps required" | halt_error
                  end
                | map(last)
                | select(.[0] != .[1])
                | { (.[0]): .[1], (.[1]): .[0] }
              )
            )
          ] as [$pair] |
          if $pair | not then
            "Unexpected pair match failure!" | halt_error
          else
            find_swaps($old; $pair+$swaps; 0)
          end
        end
      end
    ;
    
    find_swaps($gates;$swaps;$swaps|length)
    




  • I was also a Elon skeptic back-then, but I’ll admit I did get a kick out of the “don’t panic” dashboard.

    But golly does he read H2G2 completely wrong (transcript):

    I think and it highlighted an important point which is that a lot of times the question is harder than the answer. And if you can properly phrase the question, then the answer is the easy part. So, to the degree that we can better understand the universe, then we can better know what questions to ask. Then whatever the question is that most approximates: what’s the meaning of life? That’s the question we can ultimately get closer to understanding. And so I thought to the degree that we can expand the scope and scale of consciousness and knowledge, then that would be a good thing.

    It’s backwards! It misses the joke! It took thousands of years and they got a nonsensical answer before any question! It took a thousand more and they got a nonsensical—incompatible—question! It has been theorized that should someone understand the universe it would be replaced by something more complicated! It has also been theorized this has already happened! Also regarding scale of knowledge, Trin Tragula definetly showed that the One thing you can’t afford to have in this universe, is a sense of perspective!

    Surely his reading comprehension isn’t actually this bad, and he only got a bad meme-cliffnotes version of the radio-series/books/movies!?!




  • How nice it must be to never ponder how large humanity is, and how each and every person you see outside has a full and rich interior and exterior world, and you that only see a tiny fraction of the people outside.

    Personally one of my “oh other people are real!” moment, was when our parents (along with my sisters) took us on a surprise ferry trip to England (from France) and our grandparents that—at least as far as kid me remembered—we only ever saw in their home city, were waiting for us in Portsmouth, and we visited the city together (Portsmouth Historic Dockyard is quite nice btw).

    I knew they were real, but realizing that they weren’t geo-locked, made me more fully internalize that they had full and independent lives, and therefore that everyone had.


    How about people here? When did you realize people are real?