programming.dev

captainjaneway , to xkcd in xkcd #221: Random Number (9 Nov 2007)
@captainjaneway@lemmy.world avatar

I generate a random number and then use that number as a seed. I then generate a random number. Then I use that number as a seed. I then generate a random number. I divide that number by a random prime number picked in a similar fashion. I take the last n-digits of the remainder and that’s the random number I give to a user.

Trabic ,

Was it 4?

captainjaneway ,
@captainjaneway@lemmy.world avatar

maybe

Crashumbc ,

42

Spzi ,

That’s already pretty cool! It surely does generate very random numbers. I still think you can take it a step – or a random number of steps, hah! – further by repeating the process a random number of times! Maybe this way we can reach maximum randomness. Probably need to reroll the number until it’s big enough for that.

I would also check if the result is 4. If it’s 4, it should be discarded. 4 is not an actual random number but a joke random number from a comic.

palordrolap , to xkcd in xkcd #156: Commented

Write if(0){ on the back of your left hand and } on the back of your right. Use perspective - or whatever - to put the person between your hands.

This, of course, assumes a person is executable, but as circumstances not limited to but including the French Revolution proved, people are definitely executable.

Curiously, this trick makes the person not be executed, but it also means they can't execute you. Theoretically.

tal , to TrueNAS in At what point should I start worrying about my hard drive temps?/s
@tal@lemmy.today avatar

en.wikipedia.org/wiki/Chronology_of_the_universe

According to this, that is about as hot as the temperatures that existed during the Hadron epoch, or the time period when the universe was between 20 microseconds and 1 second old.

In physical cosmology, the hadron epoch started 20 microseconds after the Big Bang.[1] The temperature of the universe had fallen sufficiently to allow the quarks from the preceding quark epoch to bind together into hadrons. Initially, the temperature was high enough to allow the formation of hadron/anti-hadron pairs, which kept matter and anti-matter in thermal equilibrium. Following the annihilation of matter and antimatter, a nano-asymmetry of matter remains to the present day. Most of the hadrons and anti-hadrons were eliminated in annihilation reactions, leaving a small residue of hadrons. Upon elimination of anti-hadrons, the Universe was dominated by photons, neutrinos and electron-positron pairs.

I don’t want to start making assertions without knowing the specific manufacturer and model of the drive involved, but given that hard drives generally rely upon the existence of electrons to function, which don’t exist at that temperature, one might want to keep an eye out for any other potential signs of trouble showing up, like slower access times or unusual noises.

cestvrai , to Home Improvement in Called Bugout for a bug inpection, and the guy said i have mice in my attic. Told me this is a mouse pee stain. Is that right?

You should be able to smell the pee (and, as others said, see the poo).

Unless the mice showed up yesterday, it should be fairly obvious.

CatTrickery , to Work Reform in Every damn day

A friend of mine had a job where she worked remotely most of the time. She would never interact with any other of her colleagues unless if she went offline on Slack for too long or didn't get her work done. She managed to make some pretty nifty Selenium scripts to do the whole thing for her and delayed it to her usual working speed. I'm pretty sure she spent most of her time working there playing OSRS instead and I think she did actually go away on an extended holiday too.

UmeU , to Home Improvement in How do I fix this?

It’s hopeless, just burn your house down

Pandantic , to Work Reform in Every damn day
@Pandantic@midwest.social avatar

I'm sorry, but a mental health day is a sick day, and if my mental health is helped by going to the beach, that's my business.

Metz , to KDE in Do you also configure the feedback to send everything?

Yes, I like KDE and am happy to help. And I really like the fact that it shows an example of what data is being sent. If more software did this, I would be willing to do it more often.

Anamnesis , to TrueNAS in At what point should I start worrying about my hard drive temps?/s

Right around the time your hard drive becomes a functional Tokomak device.

moonsnotreal , to aww in A brief break from the >100°F heat
@moonsnotreal@lemmy.blahaj.zone avatar

I love goats so much. At work I have to take care of two of them and one keeps bleating until I pet it. They’re like big dogs that like food even more.

penquin , to KDE in Do you also configure the feedback to send everything?
@penquin@lemm.ee avatar

I put these slides to the max everywhere. There is one in dolphin and one in discover? I think? Wherever I see these, they're going to the max.

ghostblackout , to Home Improvement in How do I fix this?

Looks like there was glue on there before so you can try sanding and re glueing it or glue it and nail or screw it back in

AbidingOhmsLaw , to Home Improvement in How do I fix this?

I had the same thing happen the chipboard just gave way because it could not hold up to the weight of the flatware and eventually just crumbled and pulled off. I fixed it by re making the the sides back and front out of a piece of trex decking I has left over and just cut it to the same size with the same rabbits, etc then assembled it with brad nails and gorilla glue. I reused the bottom as it was still in good shape.

Also, what is that on your counter, ice breaker? Motorcycle peg?

nieceandtows OP Mod ,

Thanks for the advice. It’s a coconut cracker.

sharkwellington , to xkcd in xkcd #217: e to the pi Minus pi (31 Jan 2007)

I get that it’s a comic but this doesn’t feel like a conversation that would ever occur in real life. Granted I don’t hang out with programmers or mathematicians so maybe it’s more plausible than you would think.

Wodge ,
@Wodge@lemmy.world avatar

My kid is studying physics in university, and she comes home and tells me physics anecdotes which I don’t understand, so I always reply “That’s Numberwang!”.

So I can see these types of conversations happening between math and programming types.

vinylshrapnel ,

Spin the board!

voracitude ,

That is a truly excellent response! Anyone in this thread who hasn’t seen “That Mitchell & Webb Look” should go watch it - you’re in for a treat.

kbal ,
@kbal@fedia.io avatar

It seems plausible enough to me. Many comp sci undergrads would be dimly aware that floating point arithmetic is notoriously difficult to get right and can often lead to surprising errors if you get it slightly wrong, and also dumb enough to believe that e^π^−π is exactly 20.

Jakylla OP ,
@Jakylla@sh.itjust.works avatar

Comics are not only meant to present something that can happen IRL :P

That kind of trolls happen occasionally in IT, where not everybody know well about maths and physics, they may easily fall into these kind of traps by taking granted that the maths you gave is more trustful than computer code they wrote (usual kind of joke to make your friend understand that he what was doing something wrong or without understanding)

Also, in Uni, we were all little Satans, trying more to break others students works instead of trying to improve self (that was a true war among IT students). All means were used, this kind of troll (as depicted in this comics) to make the other loose time is truly expected

Classical “type Alt+F4 before saving your code to automatically fix bugs” kind of joke

MajorHavoc ,

would ever occur in real life

That’s sort of part of the joke. ACM is the “Association for Computing Machinery” one of the biggest and oldest and nerdiest computer clubs.

ACM hosts all kinds of SIGs (special interest groups) - clubs dedicated to interest in (sometimes deeply esoteric) aspects of computer science. For a few of them, hand-coding a new specialized fast floating point calculation code during a contest could easily come up.

And ACM has a code of ethics, so it is technically possible to get kicked out.

So there’s technically a situation where lying to a peer, on purpose, in a particularly mean context (such as a competition) about a floating point number computation - could actually get someone kicked out of ACM.

Edit: Additonal context that helps the joke - my experiences with ACM have all been super chill , relaxed and friendly. So “I got kicked out of ACM” is also a “you did what?!” setup for the joke.

Ultragramps ,
@Ultragramps@lemmy.blahaj.zone avatar

Thanks for the context on ACM saving me a search. I would like to add that I wouldn’t characterize it as ‘mean’ but moreso trolling them for being unaware of Gelfond’s Constant.

cynar ,

I did a physics degree. The start is the sort of random stuff that would come up down the pub (in the evenings). I could easily see a conversation like this happening (at least the start).

DrBob ,

Oh grad school man. Yes it would. I was also amazed that there would be people sitting at the bar who could read hieroglyphics. And random shit like that.

Thoth19 ,

This is totally a conversation that would happen in real life. I’ve watched a friend of mine try to convince someone who had a bit much to drink that the primes are closed under multiplication for an hour. Absolutely hysterical

Shurimal , to xkcd in xkcd #217: e to the pi Minus pi (31 Jan 2007)

Not gonna lie, had to test it for myself, using emulated MK 61/54 calculator: https://f-droid.org/en/packages/com.cax.pmk.ext/

Got 19.999097. Rounding errors or a bug in the microcode, who knows.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • All magazines