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.

WaterWaiver , (edited ) in Floating-point arithmetic

In Kerbal Space Program your ships sometimes catch the NaN virus. If one fuel tank level is reading NaN then whatever you do DON’T try and fill it from another (full) tank. I’m not sure if it can spread to physics (thrust, mass, etc) EDIT: Yes it can happen to physics, oh dear.

I wonder what would happen if you landed a NaN-infected spaceship on a planet.

Mesa ,
@Mesa@programming.dev avatar

That’s both really cool and very concerning at the same time. I’d be scared to play lol.

Mango , in Tough break, kid...

Making middle management do everything is not ‘running a business’.

fidodo ,

If middle management is doing everything aren’t they no longer middle management?

Mango ,

They get middle paychecks.

Pyr_Pressure ,

And vetoed on sensible decisions in favour of non-sensible ones that make the upper management larger bonuses.

genfood , in It's not DNS
Mesa ,
@Mesa@programming.dev avatar

Is it working? -> (Yes) --> Fix DNS

Daxtron2 , in Tough break, kid...

Made by someone who doesn’t utilize LLMs effectively

merc , in What's stopping you from coding like this ?

Note: © Hilaria Baldwin.

You may remember Hilaria from such controversies as “how do you say in English, cu–cucumber?”. Born Hillary Lynn Hayward-Thomas in Boston, she somehow developed a Spanish accent once her parents retired to Spain in 2011.

EnderMB ,

Is this a thing? In MMA, a pro fighter from America called Mackenzie Dern married a Brazilian and adopted both the accent and the need for an English translator. There is also an English football manager called Steve McClaren that managed in the Netherlands, and infamously did an interview in broken English because “he thought locals would understand better”.

merc ,

Mostly it’s not a real thing. Most people who speak multiple languages don’t get worse at one of them. Europe is full of multilingual people who speak like native speakers in their first language, and then near native in a bunch of other ones. There are times when you can’t tell what someone’s first language is.

On the other hand, it can happen a bit if you never use your native language, especially in the first few minutes of trying to switch. One famous example of that is Arnold Schwarzenegger who has spent so long in the US speaking English exclusively that his German has a slight American accent (though mostly it’s a heavy Styrian Austrian accent). Also, it is true that you can temporarily forget words, even in your native language. It’s not so much that you’re forgetting the word, just that your brain insists the object is a “pepino” (the Spanish word for cucumber) and for a moment you can’t say “ok, yeah, I know it’s pepino in Spanish, but what is it in English?”

But, “code switching” is a real thing. If an American moves to Australia, it’s really helpful to adopt some Australian pronunciations just to get by. If you ask for a “wah-der” in Australia, they’ll have to think for a second, if you ask for a “whoa-tah” they get what you want right away. Someone who speaks English fluently but is always among Brazilians who only speak a bit of English might use a subset of English to talk to them, use local phrasing that isn’t proper English but is Portuguese idioms or expressions moved into English word for word, and use Brazilian pronunciations so they’re understood more easily, even if those are mispronunciations under most English accents. But, it would be surprising if they couldn’t revert to normal English in an English-only setting.

Awkwardparticle , in Me after I got fired

A lot of you have a lot of faith in people reviewing PRs. I know a few Sr. developers, that if shit was too busy, would skim it and say 'fuck it, it will be QAs problem. If you put this in the correct sub-system in file that would only be executed once a month, for example a maintenance class, It would be really hard to notice something is wrong if it didn’t cause issues seen immediately. Maybe this is the story of an intern that added something that also fucked up boolean comparisons in a subsystem used once a month. Where there is a 2 week lag between the execution and operations noticing something wrong.

CosmicCleric ,
@CosmicCleric@lemmy.world avatar

{devs} would skim it and say 'fuck it, it will be QAs problem.

And then delays until code complete would eat up all of QA’s time so they have no real time left to test before app release into production.

kratoz29 , in FLOSS communities right now

What is a better alternative then?

I use Discord mostly for arranging matches in Wiimmfi, but yesterday I used it to get help about an issue I had running Knightcrawler (selfhosted Torrentio for Stremio) with my specific setup and some kind people helped me out real quick.

Spider89 ,

Matrix

EngineerGaming ,
@EngineerGaming@feddit.nl avatar

XMPP

0x00cl ,
JoeKrogan , in FLOSS communities right now
@JoeKrogan@lemmy.world avatar

I refuse to use discord.

0x2d ,

i still use it since it’s very useful to join technical communities and such

but, i use it with aliucord on mobile and vencord on my computer(which blocks all telemetry, has some useful plugins)

GBU_28 ,

I use discord for chatting with friends, and voice chatting for games. Nothing important should happen there

OofN ,

Very well said - opsec is definitely important.

GBU_28 ,

Honestly I think the burden of context rests with the user. This is unfriendly, of course, but this is one of the times you are reminded the world doesn’t care. Nothing is “nice”. Security/privacy/ad intrusion is the individual’s burden.

OofN ,

I’d even argue that most platforms are directly adversarial to a users individual privacy. User data is such a hot commodity these days that it’s even beyond planning your own privacy, but you’re essentially farming out your data for free.

Disclosure: I use Discord and plenty of similar apps, but it’s important to protect yourself.

GBU_28 ,

Very true

EngineerGaming ,
@EngineerGaming@feddit.nl avatar

I’d prefer Mumble for voice chat when gaming.

Randelung ,

Rolling your own ts3 server with old client gang.

uis ,
@uis@lemmy.world avatar

Mumble

Randelung ,

Oooh I forgot about mumble!

DeepGradientAscent , in Tough break, kid...
@DeepGradientAscent@programming.dev avatar

As a professional in the field of artificial neural networks, I endorse this meme wholeheartedly and will figuratively slake my thirst for schadenfreude on the tears of this child with joy.

executivechimp , in Should I cancel?
@executivechimp@discuss.tchncs.de avatar

I would, yeah.

perviouslyiner , in Me after I got fired

define it as ( LINE % 10) so that the problem goes away when you add a debug statement

CodexArcanum ,

Makes the error a little too frequent, but does obscure any performance penalty and is some truly evil genius work!

perviouslyiner ,
jettrscga , (edited )
Mad_Punda ,

Or just both

Prunebutt ,

Can someone ELI5 what this does?

AdlachGyfiawn ,
@AdlachGyfiawn@lemmygrad.ml avatar

Every tenth line, this would evaluate to False, while on lines that aren’t multiples of ten, it would evaluate to True.

yggdar ,

That exact version will end up making “true” false any time it appears on a line number that is divisible by 10.

During the compilation, “true” would be replaced by that statement and within the statement, “LINE” would be replaced by the line number of the current line. So at runtime, you end up witb the line number modulo 10 (%10). In C, something is true if its value is not 0. So for e.g., lines 4, 17, 116, 39, it ends up being true. For line numbers that can be divided by 10, the result is zero, and thus false.

In reality the compiler would optimise that modulo operation away and pre-calculate the result during compilation.

The original version constantly behaves differently at runtime, this version would always give the same result… Unless you change any line and recompile.

The original version is also super likely to be actually true. This version would be false very often. You could reduce the likelihood by increasing the 10, but you can’t make it too high or it will never be triggered.

One downside compared to the original version is that the value of “true” can be 10 different things (anything between 0 and 9), so you would get a lot more weird behaviour since “1 == true” would not always be true.

A slightly more consistent version would be


<span style="color:#323232;">((__LINE__ % 10) > 0)
</span>
BananaOnionJuice ,
@BananaOnionJuice@lemmy.dbzer0.com avatar

If the error is too frequent it will be hunted down very fast, what you want is errors that happen no more than once every month, maybe add another level that ensures this only triggers based on the running time.

BaumGeist ,

The original version constantly behaves differently at runtime

It actually doesn’t, since rand() is deterministic.

When no seed value is specified, rand() is automatically seeded with 1 at the initial call within any program It then uses the previous output as seed for the next, so it will always have the same output sequence

yggdar ,

That is true, but from a human perspective it can still seem non-deterministic! The behaviour of the program as a whole will be deterministic, if all inputs are always the same, in the same order, and without multithreading. On the other hand, a specific function call that is executed multiple times with the same input may occasionally give a different result.

Most programs also have input that changes between executions. Hence you may get the same input record, but at a different place in the execution. Thus you can get a different result for the same record as well.

ImplyingImplications ,

__ LINE __ is a preprocessor macro. It will be replaced with the line number it is written on when the code is compiled. Macros aren’t processed when debugging. So the code will be skipped during debug but appear in the compiled program, meaning the program will work fine during debug but occasionally not work after compile.

“__ LINE __ % 10” returns 0 if the line number is divisible by 10 and non-zero if not. 0 is considered false and non-zero is considered true.

is also macro. In this case, it will replace all instances of “true” with something that will only sometimes evaluate to true when the program is compiled.

tunawasherepoo ,
@tunawasherepoo@iusearchlinux.fyi avatar

__LINE__ returns the line of code its on, and % 10 means “remainder 10.” Examples:


<span style="color:#323232;">1 % 10 == 1
</span><span style="color:#323232;">...
</span><span style="color:#323232;">8 % 10 == 8
</span><span style="color:#323232;">9 % 10 == 9
</span><span style="color:#323232;">10 % 10 == 0 <-- loops back to 0
</span><span style="color:#323232;">11 % 10 == 1
</span><span style="color:#323232;">12 % 10 == 2
</span><span style="color:#323232;">...
</span><span style="color:#323232;">19 % 10 == 9
</span><span style="color:#323232;">20 % 10 == 0
</span><span style="color:#323232;">21 % 10 == 1
</span>

In code, 0 means false and 1 (and 2, 3, 4, …) means true.

So, if on line 10, you say:


<span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> dont_delete_database </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">true</span><span style="color:#323232;">;
</span>

then it will expand to:


<span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> dont_delete_database </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">( </span><span style="color:#0086b3;">10 </span><span style="font-weight:bold;color:#a71d5d;">% </span><span style="color:#0086b3;">10 </span><span style="color:#323232;">);
</span><span style="font-style:italic;color:#969896;">// 10 % 10 == 0 which means false
</span><span style="font-style:italic;color:#969896;">// database dies...
</span>

if you add a line before it, so that the code moves to line 11, then suddenly it works:


<span style="font-style:italic;color:#969896;">// THIS COMMENT PREVENTS DATABASE FROM DYING
</span><span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> dont_delete_database </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">( </span><span style="color:#0086b3;">11 </span><span style="font-weight:bold;color:#a71d5d;">% </span><span style="color:#0086b3;">10 </span><span style="color:#323232;">);
</span><span style="font-style:italic;color:#969896;">// 11 % 10 == 1, which means true
</span>
BaumGeist ,

A lot of these replies have high hopes for 5 year olds

IphtashuFitz ,

Decades ago I had to debug a random crash. It only happened on Wednesdays. On Wednesdays in September. On Wednesdays in September after the 10th…

perviouslyiner ,

only when your coordinates were within a train depot in Poland?

www.youtube.com/watch?v=XrlrbfGZo2k

dbilitated , in FLOSS communities right now
@dbilitated@aussie.zone avatar

yeah I’ve really noticed it’s hard to find info and therefore use any project that does this.

and it must suck because anyone new, instead of finding the answer to their question in a forum archive from when it was first asked, has to log in and ask it again.

whenever I have dumb noob questions on setup and I see a discord link I give up a little.

jol ,

And then to top it off users get annoying and angrily point at sticked posts, wikis and whatnot when people ask the same questions for the nth time.

Gestrid ,

This. I literally just joined. I have no idea what the server layout is or where all the important links are.

jol ,

My biggest pet peeve is when you join a new server and you have 15 different steps you have to do before you can ask a question. Verify with a bot or two, send picture drinking verification can, send emoji here, ask for emoji there, introduce yourself, publish your whole biography, wait for the pope to bless your account, and then, maybe, you are allowed to use the channel. I’m not a discord user, I don’t know what this all means ffs!

EngineerGaming ,
@EngineerGaming@feddit.nl avatar

…And in addition, Discord itself can randomly nuke your account by asking for a phone number.

KillingTimeItself ,

dude i give up completely, you think im joining a random discord full of a bunch of people i dont know with a culture of who knows what dialect?

Nah fuck that i’ll just go use some dudes random piece of scrapped together software that’s actually pretty based instead. To that guy who wrote the bash script for flashing windows ISOs under linux. Thank you.

pewgar_seemsimandroid , in Tough break, kid...

mm yes ai

Dasnap , in Tough break, kid...
@Dasnap@lemmy.world avatar

I only program with LBP2 microchips.

spikespaz , in FLOSS communities right now

All you idiots telling FOSS maintainers to do something else, know that we don’t want to maintain yet another server. Aside from Discord, Zulip is the next best thing.

po_tay_toes ,
@po_tay_toes@lemmy.sambands.net avatar

You sound like a frustrated maintainer, have you considered doing what I do with open source projects using discord as their means of communication?

Don’t take it seriously and move on.

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