• 0 Posts
  • 12 Comments
Joined 11 months ago
cake
Cake day: August 7th, 2023

help-circle

  • #include <stdio.h>
    
    int main() {
    
    Long long x = 0x7165498511230;
    
    while (x) putchar(32 + ((0xC894A7875116601 >> ((x >>= 4) & 15) * 7) & 0x7F));
    
    return 0;
    }
    

    Might be wrong on a few things here as I haven’t done C++ in a while, but my understanding is this. I’m sure you can guess that this is just a very cheekily written while loop to print the characters of “Hello, World!” but how does it work? So first off, all ASCII characters have an integer value. That 32 there is the value for the space character. So depending on what ((0xC894A7875116601 >> ((x >>= 4) & 15) * 7) & 0x7F)) evaluates down into you’ll get different characters. The value for “H” for example is 72 so that first iteration we know that term somehow evaluated to the number 40 as 72 - 32 = 40.

    So how do we get there? That big number, 0xC894A7875116601 is getting shifted right some number of bits. Let’s start evaluating the parenthesis. (X >>= 4) means set x to be itself after bit shifting it right by 4 bits then whatever that number is we bitwise AND it with 15 or 1111 in binary. This essentially just means each iteration we discard the rightmost digit of 0x7165498511230, then pull out the new right most digit. So the first iteration the ((x >>= 4) & 15) term will evaluate to 3, then 2, then 1, then 1, etc until we run out of digits and the loop ends since effectively we’re just looking for x to be 0.

    Next we take that number and multiply it by 7. Simple enough, now for that first iteration we have 21. So we shift that 0xC894A7875116601 right 21 bits, then bitwise AND that against 0x7F or 0111 1111 in binary. Just like the last time this means we’re just pulling out the last 7 bits of whatever that ends up being. Meaning our final value for that expression is gonna be some number between 0 and 127 that is finally added to 32 to tell us our character to print.

    There are only 10 unique characters in “Hello, World!” So they just assigned each one a digit 0-9, making 0x7165498511230 essentially “0xdlroW ,olleH!” The first assignment happens before the first read, and the loop has a final iteration with x = 0 before it terminates. Which is how the “!” gets from one end to the other. So they took the decimal values for all those ASCII characters, subtracted 32 then smushed them all together in 7 bit chunks to make 0xC894A7875116601 the space is kinda hidden in the encoding since it was assigned 9 putting it right at the end which with the expression being 32 + stuff makes it 0 and there’s an infinitely assumed parade of 0s to the left of the C.



  • Most likely just awkward rounding when the screenshot was taken. A lot of the time those post age indicator tags just count the number of hours between it and you then each multiple of 24 is a day without caring about when the actual date changes. So the first could easily have been at like 7pm one day and the second like 11am the next day and they’d both get abbreviated at 6 days ago if you were looking at it at like 4pm when you haven’t quite hit the next multiple of 24 hours.



  • I wish I could have learned about nonbinary identity much earlier. Like back when I was having a crisis about my gender in high school I only knew the full binary MtF and FtM existed. But whenever I thought about it being a girl felt just as wrong as being a boy to me. Just for different reasons. No matter how hard I tried I couldn’t reconcile not wanting to be a boy, periodically wishing I had been born a girl, but not actually wanting to be a girl.

    Wasn’t until about 12 years later at like 26 when I met my now wife and she told me all that sounded like nonbinary and I suddenly had things to Google. I wish I could have had a chance to actually transition before fully growing into being 6’2" and built like a fridge in a fursuit. But like now I’m 33, I had other medical issues that I didn’t want to try piling a potential transition on top of, and I’m not even sure what realistic transition goals I could even have let alone have a chance of attaining.




  • EmptySlime@lemmy.blahaj.zoneto196@lemmy.blahaj.zonerule
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    That would be fantastic, I’d love it if the Democrats would stop doing what they’ve been doing the last 30+ years of punching left and chasing the “Moderates” rightward. But let’s think about this logically for a minute. What are the possible outcomes of what you’re proposing?

    • Coalition Victory. We install an actual leftist in the White House. Fantastic. No more Genocide. We have a little socialism as a treat maybe? No notes. I love it. But that means we have right now about 7 months to produce or align behind a 3rd party candidate, one who likely won’t be allowed on the ballot in several states, Then that candidate has to get enough votes to beat BOTH Biden and Trump meaning they basically have to pull at least like 18% of the vote from both sides in enough states to win the Electoral College.
    • Trump Victory. Considerably less fantastic. Democrats blame the Leftists for Biden’s loss as usual. Okay, we threatened their power and now maybe we can convince them that they need us to win in 2028 rather than them moving even further right as they have since Clinton. But meanwhile we still haven’t stopped the Genocide, Donnie’s probably gonna attempt to speedrun it in fact, we’ve got Project 2025 to worry about. I don’t know about you, but I don’t think Gaza’s going to last until 2028.
    • Biden Victory. Not as bad as Trump winning. Genocide is still happening in Gaza, unlike Trump he at least might be able to be convinced to end the genocide in a sense other than the Completionist one. Only now we’ve proven to the Democrats that they don’t need the leftists at all actually and they’re free to move as far right as they wish. So maybe we even lose that.

    Maybe we get incredibly lucky and Trump gets screwed over by these prosecutions and splits the GOP thus lowering the threshold for us to get an actual Leftist in? I’m not sure we can count on it with how the Judiciary is bending over backwards to try to delay these prosecutions until the election where presumably they’d all “have to get put on hold because it’s looks bad to be putting a presidential candidate on trial.” Y’know, that old chestnut.

    Realistically, we have to reckon with the fact that First Past the Post Winner Take All Voting and the Electoral College screws us here. There’s a reason these systems mathematically tend towards a 2 party system. It’s incredibly frustratingly difficult, nigh on mathematically impossible to break through the tendency for Strategic Voting that this system breeds. It’s the Prisoner’s Dilemma, but on a massive scale. A scale where we can only afford what, maybe a hundred thousand people getting scared and bailing on the plan at most for us all to get the worst possible outcome?


  • EmptySlime@lemmy.blahaj.zoneto196@lemmy.blahaj.zonerule
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Nah, I’m good. I’ll continue to vote for Biden because he’s infinitely more likely to be swayed to stop the genocide than Trump who if I’m not mistaken has literally expressed a desire to accelerate the genocide on top of all the other heinous shit in Project 2025.

    You can hate me all you want for not lining my family up to starve to death in “muh glorious revolution” or to lose our means of continuing to live when Trump tries to gut the Social Security that my family lives off of, or the SNAP benefits that feed us, or however they decide they want to eradicate my disabled trans ass from public life. Call me selfish for wanting myself and my family to continue living in addition to doing what I can to stop the genocide. I really don’t care. LARP away my dude.



  • EmptySlime@lemmy.blahaj.zoneto196@lemmy.blahaj.zonerule
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Way too many of these chucklefucks just want to LARP as pure and radical revolutionaries. My wife and I are disabled and live on a fixed income of her disability payments and the SNAP program. If this “revolution” they want so bad does come, then we’re among the most likely to just fucking starve in the disruption. I’m also one of the people the GOP declared they want to “Eradicate from Public Life” with Project 2025.

    Now, I’m not much of a Genocide Enjoyer. I think it’s one of the worst things you can do in fact. But I also don’t take too kindly to being effectively told that I specifically should just die because these wannabe revolutionaries refuse to entertain a world where we both vote for Biden to keep Trump from destroying democracy more than the GOP already has (harm reduction), AND engage in direct action to push Biden away from blindly supporting Israel.