• 23 Posts
  • 243 Comments
Joined 2 years ago
cake
Cake day: July 22nd, 2023

help-circle
  • First, imagine a number in JavaScript. (Bit of a nail biter here, huh?)

    let i = 5
    

    Then, we will construct an incrementor. This is really simple: here is the method.

    1. Make a bracket-string-centric version of eval().
    []["filter"]["constructor"]("return i+1")()
    
    1. Reconstruct stringy eval() by using +[] as 0, +!+[] as 1, and implicit conversions as ways to create strings. For example, ‘false’ is (![]+[]), so ‘f’ is (![]+[])[+[]].
    [][
      (![] + [])[+[]] + // f
      ([![]] + [][[]])[+!+[] + [+[]]] + // i
      (![] + [])[!+[] + !+[]] + // l
      (!![] + [])[+[]] + // t
      (!![] + [])[!+[] + !+[] + !+[]] + // e
      (!![] + [])[+!+[]] // r
    ][
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      ([][[]]+[])[+!+[]]+ // n
      (![]+[])[!+[]+!+[]+!+[]]+ // s
      (!![]+[])[+[]]+ // t
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+[]]+ // u
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[])[+[]]+ // t
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      (!![]+[])[+!+[]] // r
    ]("return i+1")()
    
    1. Draw the rest of the fucking owl. Final code:
    let i = 5; // haha yay
    
    [][
      (![] + [])[+[]] + // f
      ([![]] + [][[]])[+!+[] + [+[]]] + // i
      (![] + [])[!+[] + !+[]] + // l
      (!![] + [])[+[]] + // t
      (!![] + [])[!+[] + !+[] + !+[]] + // e
      (!![] + [])[+!+[]] // r
    ][
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      ([][[]]+[])[+!+[]]+ // n
      (![]+[])[!+[]+!+[]+!+[]]+ // s
      (!![]+[])[+[]]+ // t
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+[]]+ // u
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[])[+[]]+ // t
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      (!![]+[])[+!+[]] // r
    ](
      (!![]+[])[+!+[]]+ // r
      (!![]+[])[!+[]+!+[]+!+[]]+ // e
      (!![]+[])[+[]]+ // t
      ([][[]]+[])[+[]]+ // u
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+!+[]]+ // n
      (+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+ // ' '
      ([![]]+[][[]])[+!+[]+[+[]]]+ // i
      (+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[!+[]+!+[]]+ // +
      +!+[] // 1
    )()
    // no virus i swear. execute arbitrary code in your browser console.
    

    Anyway, that’s just everyday JS work. It’s like step 5 after resizing the button, but a bit before centering the div.

    based on this. some translation methods done differently.








  • Work at the tip of your “paygrade” and try to make immersion as fun as possible. Maybe consider using a different disk for Linux, since mistakes are the best way to learn. (Don’t reinstall just because something broke).

    Here are some fantastic ways to make mistakes:

    1. Install a more involved, but typical, CLI-centric, DIY-friendly distro – from today’s order of difficulty, that’s EndeavourOS, (install is easy, then you can learn one package at a time), Arch Linux (install is hard iff you have trouble with understanding wiki structure, and you’ll want familiarity with what packages you need), and Gentoo (the installation guide is incredible).
    2. Try out new CLI software. The terminal is your friend! Are you gonna back up videos with yt-dlp? Perhaps make a shell script for something? Maybe search the AUR for something cool to try out (underrated function of the AUR: test-driving!). With a terminal, who needs file explorer?
    3. Play a game. Linux games exist… they’re called CTFs ;). Bandit is pretty fun for beginners (try to keep notes! Maybe use Git?): https://overthewire.org/wargames/bandit/
    4. Make unnecessary customizations (“rices”). Your shell can be made sexy (ohmyzsh?). Your lockscreen can be made sexy. Your windows can be made sexy. (And if you break something, don’t reinstall :3). Remember: if you build something pretty and see it every day… absolute sex.
    5. And of course, flex your hands, get your apron on, have fun popping the engine and fixing! How does one ask questions, put in due diligence, Google, read logs (like journalctl or dmesg or --verbose or whatever)? This is a skill you don’t lose – and we’ll be happy to answer a good question.

    Of course all of this depends on where you are (the tip of your paygrade). For pasting commands specifically, as you said… do 'em one at a time – and understand each one.
    Like, what is piping |? Why is xargs after it? Why can one stop ping with CTRL+C? What does man curl say about this weird curl command? How does one even read a manpage well, anyway (and is curl cheat.sh/SOME_COMMAND better)? Why is there so much gpg?

    And at the end of the day… remember how fun this shit is. The engine is open; we’re allowed to look inside. Woohoo!




  • Interesting, 18 up and 16 down as of this comment. Because this started with ~2 downvotes (the first image had terrible jpeg for a few minutes), we either have

    1. my taste did not land
    2. early downvotes beget more downvotes

    this comment is here for notetaking. let’s see if i’m a moron or if iambs are stronger than herds.




  • That’s an interesting perspective actually

    Maybe it’s because of who’s giving them? If my little cousin gave me an AI Christmas card, I’d be happier than if a stranger gave me one on the street. (Though I’d feel bummed if they didn’t even marker in a single custom sentence)

    i.e. higher standards of creativity/effort from a stranger than from a family member.

    Also the stranger isn’t stuffing a tenner in the card lmao




  • fool@programming.devtoSelfhosted@lemmy.worldhow much power does your system need?
    link
    fedilink
    English
    arrow-up
    31
    arrow-down
    3
    ·
    edit-2
    3 months ago

    I forgive 'em cuz watt hours are a disgusting unit in general

    idea what unit
    speed change in position over time meters per second m/s
    acceleration change in speed over time meters per second, per second m/s/s=m/s²
    force acceleration applied to each of unit of mass kg * m/s²
    work acceleration applied along a distance, which transfers energy kg * m/s² * m = kg * m²/s²
    power work over time kg * m² / s³
    energy expenditure power level during units of time (kg * m² / s³) * s = kg * m²/s²

    Work over time, × time, is just work! kWh are just joules (J) with extra steps! Screw kWh, I will die on this hill!!! Raaah





  • edit: updated accordingly for clarity

    Ah, I mean proper grammar as in formal, largely riskless grammar. For example, AI wouldn’t connect

    monolingual + educated + have access to technology

    with pluses, like a human would.

    Not sure how I’d phrase that though. Maybe “perfect, risklessly formal grammar” as I just tried to call it? (i.e. if AI trainers consider using +‘es a “risk”, as opposed to staying formal and spick n’ span clean).

    Perfect grammar is humanly possible but there is some scrutiny that can be applied to GPT-style grammar, especially in the context of the casually-toned web (where 100%ed grammar isn’t strictly necessary!).