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.

BradleyUffner , in Pure Evil

Any remotely capable IDE will immediately show you what, and where, the problem is.

stebo02 ,
@stebo02@sopuli.xyz avatar

it would still be confusing why all semicolons are highlighted

qaz ,

VSCode has a special case for this

etler ,

That means that detection was added explicitly because this prank was done enough that it was worth it to add.

Quik ,

The reason is in fact not only because of this exact symbol, but because people tried to change program’s behavior in a malicious way by replacing legitimate code with same looking symbols.

dylanTheDeveloper ,
@dylanTheDeveloper@lemmy.world avatar

We do a little trolling

itsraining , (edited ) in Pure Evil

Technically I don’t think any Greek layout uses a different Unicode codepoint for the question mark. In fact, the ordinary semicolon symbol is used, so what the meme describes would probably not happen IRL.

Does all this make it any less funnier? No. It’s still brilliant.

luciferofastora ,

In Unicode, it is separately encoded as U+037E ; GREEK QUESTION MARK, but the similarity is so great that the code point is normalised to U+003B ; SEMICOLON, making the marks identical in practice.

Source: en.wikipedia.org/wiki/Question_mark

I’m still curious whether it would be accepted by the code interpreters / compilers of various languages. I’m not bold enough to assume they all normalise properly.

itsraining ,

Wow, thank you, didn’t know of that.

nxfsi ,

Unicode should have enforced the principle of using the same encoding for similar looking characters like they did with CJK instead of allowing bullshit like the Cyrillic “o” or the Greek question mark.

yum13241 ,

1,000% percent.

mojo , in call the doctor, the CS doctor

You count one finger up as the same as no fingers up? Counting is not the same as an index.

BorgDrone , in call the doctor, the CS doctor

Are you indexing your fingers or counting them ?

Indexing starts ar 0 but counting starts at 1.

FriendOfElphaba ,

This.

One of the reasons indexing starts at zero is because back when we used to use pointers and memory addresses, the first byte(s) of an array were at the address where the array was stored. Let’s say it is at 1234. If it was an array of bytes, the first data element was at 1234, or 1234 + 0. The second element would be at 1235, or 1234 + 1. So the first element is at location 0 and the second at location 1, where the index is actually just an offset from the base address. There may be other/better reasons, but that’s what I was taught back in the 90s.

Counting always starts at 1 (if we’re only using integers). You don’t eat a hamburger and say you ate zero hamburgers.

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

I do say I ate zero hamburgers if I just started counting and I have yet to eat one

FriendOfElphaba ,

When you’ve eaten more than 50% of the hamburger, do you claim to have eaten one, or do you claim zero? Are you useing standard founding or are you using floor()?

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

I create a Vulkan instance, a device, a compute pipeline then use an image sampler with VK_FILTER_LINEAR on a single-texel image in order to interpolate the two adjacent values of hamburger eatage, simple as.

Haus ,
@Haus@kbin.social avatar

There was a time when I had to switch back and forth between Fortran90 and C several times a day, and it messed me up so bad that doing simple tasks like counting apples at the grocery gave me anxiety.

BatmanAoD ,

“used to”?

FriendOfElphaba ,

Perchance programming with pointers has plunged as a percentage of programmers.

But thank you. I was hoping someone would notice that.

dukk , (edited )

Well, you don’t really see many people accessing lists with pointers directly. Also 0-indexing does give us an extra number to index with(say 1-255 vs 0-255)

Edit: 0-255, not 0-256

FriendOfElphaba ,

It’s 0-255 when you’re indexing like that. 11111111b = 255.

dukk ,

Oh sorry, you’re right. Amended my comment.

drathvedro , in How the IT guys see the users

I once asked some of my friends what they were up to at work.

An accountant friend said “I’m making a VBA macro to restructure and convert our customer’s XML data into an SQL transaction so that we can import it into our accounting system”.

A car mechanic friend said: “I’m trying to find the pinout for this obscure ECU so that I can flash in this profile that I’ve tweaked with hex editor”

A teacher friend said: “I’m setting up integration between moodle and shopify so that we wouldn’t have to enroll our students manually”.

And every time my response was “YOU WHAT NOW? You should work in IT”

And they always responded with something along the lines of “Yeah, nah, I’m not that smart”

And here I am, slapping webpages and forms together, earning more than all of them combined. That’s really unfair, but I’m not in a position to complain.

teamonkey , in call the doctor, the CS doctor

Lua crew represent

darcy ,
@darcy@sh.itjust.works avatar

rare lua L

RacoonVegetable , in call the doctor, the CS doctor

Jokes on you, I use my fingers as bits for a total of 1024 numbers (0-1023). Or I can sacrifice 1 finger time be a sign bit and count negative numbers too.

opensourcedeeznuts ,

Sacrifice a few extra bits and you can do floating point arithmetic on your fingers too

QuazarOmega ,

If we figure out a clever trick with phalanges we can go even further

ikapoz ,

I’ve tried this a few times and my fingers always get really Fucking confused after about four bits.

vithigar ,

I like this idea in theory, but some combinations of fingers are very awkward to extend without the others, and one particular combination is very rude.

nickhammes ,

Maybe that’s just because 132 is a rude number.

thor12022 ,
@thor12022@kbin.social avatar

Jokes on you, fingers are tri-state (fully extended, fully closed, bent at middle knuckle) not binary, so I can count to 59049.

Someone with better finger control should be able to treat them as quad-state, granting the ability to count to 1048576 by bending just the outer knuckle.

amanaftermidnight ,

Let’s just keep multi level cells to just flash memory.

TechieDamien ,

3^10-1=59048.

BluesF ,

I can’t imagine a scenario when you need to be able to do BOTH positive and negative numbers at the same time 😂

al177 , in call the doctor, the CS doctor

Ffs. 16, 8, 4, 2, 1.

Lodra ,
@Lodra@programming.dev avatar

I’m glad I’m not the only one. My son is a year and half old. I’ve been teaching to count on his hand in binary since day 0. He goes wild and celebrates when we reach 31 🙂

Tippon ,

I’m in my mid 40s, and I’ve never thought to count in binary on my fingers. I haven’t needed to use binary for about 30 years, and I’m easily the geekiest of my friends, so I’ve never had an excuse to do it for fun.

You’ve just put a huge smile on my face.

Guess what I’m teaching my kid this week 😁

obosob ,
@obosob@feddit.uk avatar

Most of the time it’s not exactly useful and some of the positions are awkward (e.g. 8, 9, 10), counting to 31 on one hand is maybe useful.

More useful IMO is counting in base 6 and treating each hand as a single digit. i.e counting to 35 on 2 hands without awkward fingerings. Better than 10, less awkward than binary.

Tippon ,

We’re about to start learning how to program, probably with Python, so it could be a good way to start thinking about how computers work. I never would have thought to try other systems though, so I’ll look into base 6. Thanks for the suggestion :)

without awkward fingerings

Oh, the fun I would have had with that phrasing if we weren’t talking about teaching kids… :D

Lodra ,
@Lodra@programming.dev avatar

It does take s little practice but not too much. The awkward positions are easy enough after a few weeks.

I chose binary for two reasons. First, it is occasionally useful to count that high on one hand. Second, the education when he’s older. I hope this will give him a note intuitive understanding of different bases. And binary is specifically useful for understanding comported and software development. I dont intend to push him toward a career in software but I think there’s a fair chance he chooses that anyways.

Plus we’ve made it into something fun 🙂

radix ,
@radix@lemm.ee avatar

My siblings and I always loved the number 4 because our puritanical mother was so casual about sticking her middle finger out at only that moment. That was just about the most taboo thing we could imagine, and it was as a result hilarious.

conditional_soup , in call the doctor, the CS doctor

<span style="color:#323232;">def count_fingers(hand: list): 
</span><span style="color:#323232;">    count = len(hand)
</span><span style="color:#323232;">    if count != 5:
</span><span style="color:#323232;">        if count &lt; 5:
</span><span style="color:#323232;">            raise Exception("Check if fingers missing, or just smart ass")
</span><span style="color:#323232;">        else:
</span><span style="color:#323232;">            raise Exception("Oh... oh no.")
</span><span style="color:#323232;">    return count
</span>
HurgletOfficial ,

You can do


<span style="color:#323232;">if (count := len(hand)) != 5:
</span><span style="color:#323232;">    # do something with "count"
</span>

Btw, looks much nicer

conditional_soup ,

I’ll use ternary operators when you force them into my cold, dead hands

HurgletOfficial ,

It’s not the ternary operator, it is the walrus operator introduced in Python 3.8 if I’m correct

conditional_soup ,

You are correct. I came back to say that I’ll use the walrus operator when it’s pushed into my cold, dead hands, but… I might actually use it, now that I’ve refreshed myself on it.

pythonoob , in It's a mass extinction event

How does she look like a different person in every pane?

Cethin ,

I’m pretty sure there are two different people. Look at their clothes.

jjjalljs , in How the IT guys see the users

Most people are fine.

One time I had a boss receive a spreadsheet I sent, print it out, and ask the team to verify the sums by hand.

But most of the people I work with are fine.

Pyr_Pressure ,

My current boss will print out Excel sheets and use a calculator to sum things and then write in sharpie on the page the changes that he wants me to make to the sheet.

Anticorp , in Pure Evil

I knew a guy who used the Unicode character for a space in his password. He figured if anyone ever saw his password they’d think it was a space and still not be able to use it. It’s silly, but it was a fun thing to learn about him.

bc001 ,

Which character. Does it need Combination of keys or a Single key.

Anticorp ,

A combination of keys. I don’t remember the code anymore.

quinkin ,

Alt-255 was the old-school method.

Cow_says_moo ,

I use alt 0160 for a non-line breaking space.

CanadianCarl ,

I can’t type alt codes with my keyboard.

shasta ,

That’s pretty neat, but also means he will never be able to log into things on mobile

elint ,

Bitwarden has no problem filling passwords containing unicode characters on Andorid.

Jpwanabe , in NaN Cat wallpaper [artist unknown]

Would love a higher rez then this so I can use it as a wall paper.

csolisr , in kesiYaNgamia

Also: certain Latin transliterations of Hebrew

orl0pl , in NaN Cat wallpaper [artist unknown]

javascript moment

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