There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

UndercoverUlrikHD , in Someone escaped the Matrix

Surprised it wasn’t woodworking

Skullgrid ,
@Skullgrid@lemmy.world avatar

nah, brings back memories from the Pragmatic Programmer cover

reboot6675 ,

“I no longer build software; I now make furniture out of wood”

Legendary

blindbunny , in Someone escaped the Matrix

Based

zqwzzle , in Someone escaped the Matrix

Was woodworking another common one?

nifty , in It's easier to remember the IPs of good DNSes, too.
@nifty@lemmy.world avatar

I feel like I could learn Dutch, my English is already broken

cypherpunks , (edited ) in How to write Hello World
@cypherpunks@lemmy.ml avatar

python -c ‘print((61966753*385408813*916167677<<2).to_bytes(11).decode())’

how?$ python >>> b"Hello World".hex() ‘48656c6c6f20576f726c64’ >>> 0x48656c6c6f20576f726c64 87521618088882533792115812 $ factor 87521618088882533792115812 87521618088882533792115812: 2 2 61966753 385408813 916167677

palordrolap ,

perl -le 'use bignum;print+pack"H22",(61966753*385408813*916167677<<2)->to_hex()'

Alas, Perl doesn't bignum by default

CaptDust , in Someone escaped the Matrix

Man is actually living the dream, the crazy son of a bitch did it.

variants ,

He has become a battery for AI

Rentlar , in Someone escaped the Matrix
haulyard ,
@haulyard@lemmy.world avatar

Wait is he still on the Azure Performance team?

TrickDacy ,

Nope. If he hadn’t quit, it would say “present” instead of July 2024

ArcaneSlime ,

But…it says “august 2017-present” on the screenshot I’m looking at? Right? Also, isn’t July 2024 like, next month?

tyler ,

It says 2023, not 24. Commenter typo’d. and the top number is correct. Bottom one is probably custom filled out, not based on actual work history.

SqueakyBeaver ,

Look under “Principal Software Development Engineer.” It says “2017-present”

TrickDacy ,

That’s the basis for my claim actually. The other position has a date not the word “present”. Which I now realize includes 2023 not this year, so I don’t know what the original question was getting at.

Rentlar ,

Azure needs him to care for Microsoft’s Golden Goose at his farm.

s12 , in How to write Hello World

Umm… someone explain this code please?

magic_lobster_party , (edited )

Bit shift magic.

My guess is that all the individual characters of Hello World are found inside the 0xC894 number. Every 4 bits of x shows where in this number we can find the characters for Hello World.

You can read x right to left. (Skip the rightmost 0 as it’s immediately bit shifted away in first iteration)

3 becomes H
2 becomes e
1 becomes l
5 becomes o

etc.

I guess when we’ve exhausted all bits of x only 0 will be remaining for one final iteration, which translates to !

CanadaPlus , (edited )

Too readable. You’ve gotta encode the characters as the solutions of a polynomial over a finite field, implemented with linear feedback on the bit shifts. /s

s12 ,

I understand that the characters are probably encoded into that number, but I’m struggling to understand that C/C++ code.

EmptySlime ,

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

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.

s12 ,

Thank you.

barsoap ,

32 is ASCII space, the highest number you need is 114 for r (or 122 for z if you want to be generic), that’s a range of 82 or 90 values.

The target string has 13 characters, a long long has 8 bytes or 16 nibbles – 13 fits into 16 so nibbles (the (x >>= 4) & 15) it is. Also the initial x happens to have 13 nibbles in it so that makes sense. But a nibble only has 16 values, not 82, so you need some kind of compression and that’s the rest of the math, no idea how it was derived.

If I were to write that thing I’d throw PAQ at it it can probably spit out an arithmetic coding that works, and look even more arcane as you wouldn’t have the obvious nibble steps. Or, wait, throw NEAT at it: Train it to, given a specific initial seed, produce a second seed and a character, score by edit distance. The problem space is small enough for the approach to be feasible even though it’s actually a terrible use of the technique, but using evolution will produce something that’s utterly, utterly inscrutable.

numberfour002 , in Someone escaped the Matrix

I feel this in my soul. If I were independently wealthy or had a sizeable amount of passive income, I probably would give up the corporate life and just do something like farming.

But in reality, most of the farmers in my area either have to make do with very little or they end up having to work a full time job to supplement the farm income, build a retirement fund, and to have decent health insurance. Kind of takes the joy out of it if I know I’m either going to have to compromise further on healthcare & retirement, or if I’m going to have to continue working another job either way.

KISSmyOSFeddit ,

Highly skilled people want to become farmers but can’t afford it.
Capitalism has come full circle.

JCreazy , in Someone escaped the Matrix

As I get older, farming seems more enjoyable than dealing with technology. Sometimes it’s nice to just slow down.

azertyfun ,

The kind of farming that makes any money isn’t slow work.

It is, however, tangible work with tangible results. Unlike spending months changing the polarity of nanoscopic silicon structure for the non-appreciation of an utterly clueless salesperson whose braindead ideas will have left the world in a worse state than you found it despite anyone’s best efforts.

I should seriously get into woodworking. Kidding. Sorta.

match ,
@match@pawb.social avatar

remember when you would type a few lines of code and then a widget would appear immediately and you’d feel a tiny spark of emotion?

ultrahamster64 , in Someone escaped the Matrix
@ultrahamster64@lemmy.world avatar
fibojoly , in Someone escaped the Matrix

One of my colleague is leader of the team managing our internal software systems, but also a potato farmer. Somehow.

abbadon420 ,

I have some chickens and some cows. It’s easy to combine small scale with wfh. Just need to move soemwhere with land and wifi.

uis ,
underscore_ , (edited ) in How to write Hello World

LGTM. Though do people really code with ligatures turned on?

Edit: Ok so there are some big advocates of ligatures, I’m going to have to give them a second chance. I’ll try for a week, and either way that Fira Code font looks great.

Luvon ,

I always do, I love having ligatures

Having ≠ looks much nicer then !=

kasuaaliucceli ,

Ah! You see, in my mind != looks nicer than ≠. Haha

maniel ,

That’s why those exist

ilovededyoupiggy ,
@ilovededyoupiggy@sh.itjust.works avatar

I was skeptical of ligatures at first, too, it took me awhile to warm up to it. But yeah, love me some Fira Code now.

underscore_ ,

That’s neat, so TIL ligature in code do actually have a strong following

qaz ,

Yes, I use Fira Code myself

kogasa ,
@kogasa@programming.dev avatar

Yes, with Iosevka font

tyler ,

Ligatures make code way easier to read, especially if you’re using lambdas or a language with different comparison operators than “normal”.

red ,

When you realize 90% of programming is reading, then you’ll end up embarking on a journey to make code more readable. At some point you fall in love with ligatures.

Kojichan ,
@Kojichan@lemmy.world avatar

Long live Fixedsys! My favourite font since before time.

I found a version with ligatures. Love the thick equally spaced characters. Makes stuff so nice to read.

variants , in Someone escaped the Matrix
Beetschnapps , (edited ) in much profits, just 5 people on team, imagine sweet sweet bonuses

Historically it’s blamed on UX. PMs don’t create products they run MS Excel.

The gators are everyone that interacts with your code.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines