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.

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

I prefer using a whole wall of lava lamps for a random number.

MNByChoice ,

Seems like the place to share. Ages ago a group epoxied a webcam and used the random flashes (from cosmic rays?) as their source of randomness.

rmuk ,

I think what they’re referring to is a company - I think it’s CloudFlare - who use a bunch of physical randomness generators to seed their commercial random number generator. One of those seeds is a webcam pointed at a load of lava lamps.

youtu.be/1cUUfMeOijg

luckybipedal , to xkcd in xkcd #1597: Git

IME, to use git effectively, and make sense of the man-pages, you have to know a lot of the internals of how git works. I found it helpful to read “Git from the bottom up” when I had to start using it professionally: jwiegley.github.io/git-from-the-bottom-up/

clay_pidgin ,

That looks helpful, thank you.

Thorry84 , to xkcd in xkcd #221: Random Number (9 Nov 2007)

Just update the code once a year to a different number, given long enough time the output will have a perfectly flat distribution.

veroxii ,

I mean, how many random numbers can there even be?

cron ,

Not more than six, at least if you use a standard dice.

dog_ , to xkcd in xkcd #221: Random Number (9 Nov 2007)

Thanks PS3!

pantyhosewimp , to xkcd in xkcd #221: Random Number (9 Nov 2007)

And it’s indempotent!

lamabop , to xkcd in xkcd #221: Random Number (9 Nov 2007)

Incredible, cracked the pseudorandomness problem with this simple code that guarantees a random whole number greater than 3 and less than 5.

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

There’s no way that I’d believe e^π^−π to be an integer without seeing a proof

blargerer ,

e^iπ tricks you into thinking e is magic.

piecat ,

It… Kinda is?

marcos ,

Nature has quite a special place for the basis of the natural logarithm.

celeste , to xkcd in xkcd #173: Movie Seating (20 Oct 2006)
@celeste@kbin.social avatar

You also need to account for where the really tall people are in the row in front of you. Social optimization be damned, I want to see!

sanguinepar ,
@sanguinepar@lemmy.world avatar

Yeah, well we want to have enough space to sit lower, but it’s not always an option unfortunately! :-)

Spzi ,

And group people based on how loud their snacks are.

Also, am I the only one hating that person who keeps talking how the seating is suboptimal while everyone else tries to watch the movie?

Jorgelino ,

Those ones you group outside the movie theater.

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

Makes me think that if there is a God, this would be an easter egg.

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.

Oka , to xkcd in xkcd #173: Movie Seating (20 Oct 2006)

Optimal seating for this group would probable be this graph left to right, except for one-way crush person, they go on the very right.

First couple > bottom friend > top friend > second couple > top right friend > 1-way crusher

Friends are within 1 seat of each other.

Potatos_are_not_friends , to xkcd in xkcd #173: Movie Seating (20 Oct 2006)

My biggest pet peeve was working in a restaurant and trying to seat a large group. That hatred has been with me for decades, that I actively refuse to involve myself in dinners larger than 6 people. It’s noisy. It’s too much management. There’s multiple conversations. It’s awful.

Even during family outings in public areas, I assemble little groups and pretend like we don’t know each other.

And before anybody even asks, I absolutely segmented my wedding into different 6-person teams when we went out in public.

rambaroo , to xkcd in xkcd #173: Movie Seating (20 Oct 2006)

Cringe

xor ,

Thanks for your input

eksb ,
@eksb@programming.dev avatar

It is cringe because the XKCD guy does not know when to stop. The second part of the comic (the white on black part) makes it worse. The graph is the punchline. But then he keeps drawing, and ruins it.

Aatube ,
@Aatube@kbin.social avatar

What’s wrong about it? It makes it clearer why 1. The seating is ridiculous 2. Such frustration is ridiculous. How is the graph the punchline? The idea is the punchline.

MentalEdge , to xkcd in xkcd #173: Movie Seating (20 Oct 2006)
@MentalEdge@sopuli.xyz avatar

Good thing I don’t know enough people for me to ever go to the movies in that big a group.

knorke3 ,

the problem here is technically not you knowing people but that the people you know can also know people that you don’t know, expanding the graph beyond the first layer that you personally observe.

tl;dr: don’t allow recursive invites

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