- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Do you also turn the TV off when you see a trailer for another program? Actually I can see you now, with your woolly blanket over your knees as your carer hands you your eggnog, carefully making sure that your walking-stick is placed safely in its holder behind your auto-relax armchair, and the remote control placed just within reach of your arthritic, liver-spotted right hand (GOLDARN IT, TANEIYSHIA! I'M LEFT-HANDED! HOW MANY MORE TIMES?) ...
Admin
Not sure but I think it's 8 out-shuffles or 52 in-shuffles. Martin Gardner knew, but we can't ask him, the fucker's dead.
Admin
Fuck, this weed is strong.
Admin
What? You voted a nieblank for a boss? Get away! That proves you're trolling.
Admin
Admin
...and absolutely, singlely random. Directly replaceable by:
Admin
And don't call him Shirley.
Admin
Yo, ted! Get thee posthaste to www.Get-A-Goddamned-Life.com.
(Although I must admit to being, to some degree, amused by your pathetic screeds, they also grow quickly tiresome. Just keep telling yourself, "I can do better. I really can. I believe in myself; and, someday, I just know that I'll no longer be the laughingstock of TDWTF.")
Admin
XKCD, Dilbert and Daily WTF - the daily habit of successful programmers.
Admin
Hmm ... wondered where I was going wrong. I use xkcd as an occasional treat, hitting "random" a few times when I do.
Admin
Admin
Fuck you too, British cunt!
Admin
array.shuffle
I wonder if this is an extension method to random order the array.
Admin
Admin
So few programmers know how to actually use a random number generator properly. It's kinda sad really.
Admin
We evolved a different method for dealing with big, toothy animals: namely, we evolved clever brains that enable us to make weapons that can kill them.
(A lifetime of ass-wiping is just the price we have to pay for choosing the alternate route)
Admin
Admin
The seed goes through a cycle of some length. If you were in a uniformly random position in that sequence before calling rand() a rand() number of times, then you will no longer be in uniformly random position afterwards. The reason is that there will be some starting positions that will end up in the same end position, and due to the pigeon hole principle, that means certain positions will no longer be possible.
I'm not sure how much entropy you lose this way, but I estimate that if you lose 1 bit of entropy.
And then there is Debian.Admin
Admin
Hey! I have a son who watches Seinfeld too, and let me assure you it is no laughing matter.
Admin
Because in the evolutionary sense we are "Big, toothy animal" well, rock-tied-to-a-sticky. As evidence - I challenge you to name an animal man has not killed and eaten.
Admin
Oh, and a cockroach. Throw a nuke on it and they'll still live!
Admin
Yes, and the point of XKCD is to read the rollover text. Linking to the image is only half a link at best.
Admin
Coral Reef
Admin
Admin
Admin
Admin
OK, so I tried wading through the flame war and the quoting super happy fun party to find out if someone had actually commented on this yet, but a cursory glance revealed nothing, so here goes. Feel free to flame and/or super happy fun party quote me.
The Rnd function in VB returns the same number sequence if you do not call Randomize first. I don't remember the exact sequence now, but the sequence is fixed.
This means if neither Randomize nor Rnd has been called before we enter this method, the call to Randomize will effectively use the first number of the Rnd sequence to randomize. The first number of the fixed sequence is of course constant. So calling Randomize(Rnd) is equal to Randomize(0.5), if 0.5 were the first number in the sequence.
Having seeded the randomizer with a constant, our programmer probably discovered that simply returning Rnd was also constant. No big surprise there. So how does a resourceful programmer enforce some randomness, apparently believing in earnest that he has already exhausted the seeding option?
He proceeds by taking the next 10 (still constant) values of the Rnd sequence, shuffling them (perhaps using the 12th constant random value) and picking one "randomly" based on the 12th/13th constant value.
So every time you start the application, the function will return the same number on first invocation. It will return the same second number on second invocation. And so on.
Admin
The "Random article" feature in http://thedailywtf.com is implemented pretty the same way...
Admin
Are you saying Murroe is a lousy cartoonist who can't get the job done with his chosen medium and needs to explain his jokes to make them "funny"?
Admin
Admin
Admin
If you are using random numbers in the guts of a monte carlo simulation of a real-world process, it makes sense to be able to reproduce the precise series of random numbers for any paricular run of the simulation, in order to be able to repeat a run for the purposes of validation / QA / etc. So the use of a fixed seed to commence a run with is a standard practice. However, I don't think this is the way to do it...
Admin
If you think that's sad, ask everyone in your team, how quickly can they code Fizz-Buzz.
The industry is filled with wankers who think all you need to develop a programming skill is a reliable search engine.
Admin
Admin
Admin
Admin
Admin
Admin
Admin
Admin
Gee, Zunesis, how many genitals do you have anyway?
Admin
Admin
They must have done, otherwise how would we know they're poisonous?
Admin
It does matter, and don't call me Shirley
Deck of 8 cards, 1-8 1, 2, 3, 4, 5, 6, 7, 8 In Shuffle 1: 5, 1, 6, 2, 7, 3, 8, 4 In Shuffle 2: 7, 5, 3, 1, 8, 6, 4, 2 In Shuffle 3: 8, 7, 6, 5, 4, 3, 2, 1 In Shuffle 4: 4, 8, 3, 7, 2, 6, 1, 5 In Shuffle 5: 2, 4, 6, 8, 1, 3, 5, 7 In Shuffle 6: 1, 2, 3, 4, 5, 6, 7, 8
6 in shuffles required
Out Shuffle 1: 1, 5, 2, 6, 3, 7, 4, 8 Out Shuffle 2: 1, 3, 5, 7, 2, 4, 6, 8 Out Shuffle 3: 1, 2, 3, 4, 5, 6, 7, 8
3 out shuffles required
Admin
For those wanting the shuffle extension method.
Admin
You confuse VB with C. break is a low-level control transfer, like asm JuMP or such.
C: A low-level language with high-level features. VB: A high-level language with low-level features.
Admin
Just because WE can't eat them doesn't mean they have no predators.
Super Poisonous: http://en.wikipedia.org/wiki/Rough-skinned_newt
This Oregon animal is eaten by local garter snakes, who are full for weeks (if not months) after eating one. The snake just slows down, but doesn't die.
Admin
SCIENCE!
Admin
My guess is that the extra randomization was added to rectify the fact that by seeding Rnd with a call to Rnd, calls to this function will produce the same series of numbers. Having ten possible values for each call is an amazing improvement.