- 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
function getRandomChar(temp) dim c c= "S" select case temp mod 36 case 0 c="F" case 1 c="I" case 2 c="R" case 3 c="S" case 4 c="T" case 5 c=" " case 6 c="P" case 7 c="O" case 8 c="S" case 9 c="T" case 10 c="!" end select getRandomChar=c end function
Admin
Frist Haha
Admin
TRWTF, is that there isn't a comment instructing the user to invoke RandDouble() a random number of times to ensure that the randomly selected index of the randomized array of random numbers is random. Otherwise, you risk pseudorandomness.
Admin
Not being familiar with VB, I assume that no "break" statements are needed?
Admin
Cleanliness is close to godliness.
That code is NOT clean. Quite the opposite.
So: that code must be EVIL.
Admin
TRWTF is VB
Admin
Why didn't he shuffle it random number of times?
Admin
I'd be willing to bet the myth that this is a biblical proverb has its roots in the large scale marketing of soaps by companies like Unilever, P&G, and J&J during the industrial revolution. Or something.
Admin
I did it that way once. Then I wrote my second program and never did it again.
Admin
The phrase dates to John Wesley in 1791. So "biblical proverb" isn't a bad guess.
Admin
Reminds me of this XKCD comic:
http://imgs.xkcd.com/comics/random_number.png
Admin
This is a random comment.
Oh wait, it isn't...
Admin
99% of our daily WTF situations can be found in either XKCD or Dilbert.
Admin
"As a student, I don't really feel qualified to what good and bad code is"
Also not qualified to what good and bad English is.
Admin
I will never for the life of me understand why people feel that they will get a "better" random number by calling a rand() function a rand() number of times, or some variation of that idea.
For 99% of what you are doing, the built in rand() functions of most languages are fine. If you are working in the 1%, you probably already know what you are doing and your code wont wind up here anyway.
//Captcha: praesent - is it Christmas already?
Admin
1778, John Wesley was a dying old man in the few months of 1791 he was alive for and no longer preaching. But that's the first recorded usage of the exact phrase, the basic idea predates Christianity.
Admin
Based on that xkcd comic, surely this is how the first example should have been written:
Captcha acsi... how appropriate.
Admin
Just remember to put your money on '7' and wait it out. And never bet on 'S'
Admin
So...we are the 99%?
Admin
I am no VB expert, but doesn't Asc return the Integer value of a given character. How would that do anything remotely like what the first function is doing? Doesn't he want Chr or ChrW?
Admin
I didn't even click on the link and knew it was some fag linking xkcd. It's not clever. It's not funny. Just the word "random_number" with a link under it and the short, useless, one sentence post shows the kind of unoriginal, uninspired, idiot is making the post.
It was funny to read when it came out. It's even funny when clicking on the Random button on the site and seeing it. It's NOT funny when someone links to it from a one-sentence post and thinks they're so fucking clever to have discovered xkcd.
You probably still use lmgtfy and think you're so damn clever.
It means in real life, you're an unoriginal hipster doofus.
Got anything to do with sanitizing inputs to a SQL database, etc.? Link to Bobby Tables. Got a nerd-project slow-ass turing machine? Like a minecraft logic circuit from redstone? Link to the one where it's some guy alone in the world making a computer out of rocks. Got a story about password security or encryption? Link to the one where they beat the password out of the guy with a wrench.
Fuck off. You're not clever.
Admin
I'd like to see the implementation for shuffle()... it must be an extension method since Array does not have a shuffle method.
I also like how the Randomize function is called with a seed from Rnd... another level of randomization!
Admin
Admin
Admin
Admin
Did anyone notice that he fills the array with 10 copies of the same randomly-generated value?
So no matter how much you distrust the random number generator, shuffling the array and then selecting a random index is completely pointless, because all entries are identical anyway.
Admin
Admin
Admin
Admin
To ensure deterministic response time, I guess this is part of a real time application.
Captcha: plaga, spanish for plague, just as VB programs
Admin
Admin
someones not happy today..!
Admin
Unless by "the link" you meant "the link to the comments page", and by "it" you meant "there was".
Woah dude, you don't find people as incredibly butthurt as you often. You should go to the xkcd forums and meet a guy called "SirMustapha", you'd become friends. I'd post a link, but I'm not sure if that would make me a hipster doofus.
In fact I shouldn't have posted anything at all. Everyone who posts here thinks they're so damn clever to have discovered that you can write a comment. They probably use stuff like "GMail" or "Facebook" or "Windows" and think they're so fucking clever.
Admin
Admin
Yes, well done. It's not like he explicitly said "Reminds me of this XKCD comic". You must be very proud of that deduction.
Did you consider that perhaps it was intended not for you, but for people who have yet to read that particular xkcd comic?
I'm surprised that such a simple statement ("this reminds me of ...") would provoke such vitriol. Maybe avoiding the comments section altogether would make you happier.
Admin
FTFY
Admin
Well, at least this attempt at better randomness is "just" pointless and not doing the opposite of what it is supposed to do like in this article: http://thedailywtf.com/Articles/SuperRand.aspx
Admin
Admin
Reminds me of this XKCD comic:
http://imgs.xkcd.com/comics/trolling.png
Admin
#OccupyTheDailyWTF then.
Admin
Oh, go seed yourself.
Admin
That's not God's fault. That's all the work of the devil. Thought that was obvious.
Admin
Admin
Cool down, fellows. This is an old "meme" which someone gets out and dusts down whenever xkcd is invoked. It catches loads of people.
Admin
Hmm..let's see here..violent overreaction.. homophobic slurs.. use of "hipster" without knowing what it even means.. unnecessary profanity.. ah, I get it. You're on the wrong web site. Slashdot is the next one down in your bookmarks. Try that one next time.
Admin
f- you. What makes you think I'm not dead damn serious? It's a retarded practice and it needs to stop!
Admin
Admin
Same thing goes for evolution, really. If evolution were true, how come we haven't evolved to not having to wipe our ass?
Big, toothy animal: "I smell shit! Someone must be around!" Smart-ass at stinky shitbutt: "If only you could shit cleanly!"
Admin
Fuck off, Bob.
Admin
Whee! It's like watching a drunkard fall downstairs. You know it's going to happen as soon as the cat winds itself between his legs, and from that very first moment of teeter, you can predict practically the entire process.