PDA

View Full Version : Scary alert popup!



Krupski
04-17-2011, 10:51 PM
Oh boy...

I was writing a little random string generator in JS to use as a temporary ID for span elements that I insert then remove. I also stuck the function into the source code for TinyMCE to supplement it's "UniqueID" function.

I was testing it with a string length of 5 characters (which can be a-z and A-Z).

Needless to say, I was a bit shocked by what came up in one "random" run:

http://three-dog.homelinux.com/images/alert.jpg

What are the odds???? http://www.codingforums.com/images/smilies/eek.gif

This is the code:



uniqueId : function(p) {
return (!p ? 'mce_' : p) + this.randomString(5);
},

randomString : function(n) {
n = (n ? n : 8);
var str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz';
var uid = '';
var sl = str.length;
var x = 0, idx = 0;
for (x = 0; x < n; x++) {
idx = parseInt(Math.random() * sl);
uid += str.charAt(idx);
}
return uid;
},
I'm a little bit freaked out right now.........

recon
04-17-2011, 11:13 PM
So in english this means.... :oh:

Krupski
04-17-2011, 11:15 PM
So in english this means.... :oh:

In English this means that somehow a program that's supposed to generate 5 TOTALLY RANDOM letters managed to come up with the word "Death".

jojo
04-18-2011, 12:06 AM
In English this means that somehow a program that's supposed to generate 5 TOTALLY RANDOM letters managed to come up with the word "Death".

Can I get first dibs on your firearms if shit goes south for you.

mriddick
04-18-2011, 05:43 AM
Whats the quote of a thousand monkeys working at a thousand typewriters...

filthy phil
04-18-2011, 05:45 AM
obviously crapsnitch has hacked your shit.
watch your 6 buddy

recon
04-18-2011, 04:18 PM
Can I get first dibs on your firearms if shit goes south for you.

:thumbspbig:

Full Otto
04-18-2011, 05:01 PM
Have you checked outside lately?

http://i54.tinypic.com/4j048l.jpg

filthy phil
04-18-2011, 05:35 PM
the end is near
http://i246.photobucket.com/albums/gg88/uzimon/Pictures_taken_at_the_right_time38.jpg

raxar
04-18-2011, 06:13 PM
the end is near


the signs are everywhere......

http://www.gunsnet.net/photopost/data/500/medium/endss.JPG

FunkyPertwee
04-18-2011, 06:39 PM
What are the odds????

1 in 7,893,600. If I did it correctly. And if chosen letters remain on the list of possible choices for each place.

We better call you Mr. Lucky. I'd say keep the 1911 strapped but this time stick a cell phone in your pocket too. You may not be able to change your fate but at least you can make sure you go out the same way you came in, kicking and screaming.

raxar
04-18-2011, 06:59 PM
1 in 7,893,600. If I did it correctly. And if chosen letters remain on the list of possible choices for each place.

We better call you Mr. Lucky. I'd say keep the 1911 strapped but this time stick a cell phone in your pocket too. You may not be able to change your fate but at least you can make sure you go out the same way you came in, kicking and screaming.

just keep in mind that the chances of it saying "death" are exactly the same as it saying anything else, it could have just as easily said "Eorby" or "Pwkqx" or "Barak". We just understand "Death" as meaning to die, if "Eorby" came up, and it meant "let a copper thief go without shooting him" I'd be a little more concerned.....

FunkyPertwee
04-18-2011, 07:10 PM
just keep in mind that the chances of it saying "death" are exactly the same as it saying anything else, it could have just as easily said "Eorby" or "Pwkqx" or "Barak". We just understand "Death" as meaning to die, if "Eorby" came up, and it meant "let a copper thief go without shooting him" I'd be a little more concerned.....

I'm just kidding around about taking it seriously. However, having the same chance of showing up as any other random variation of letters is what makes it noteworthy. Theres a whole lot of alternate combinations.

Krupski
04-18-2011, 07:35 PM
Whats the quote of a thousand monkeys working at a thousand typewriters...

I also posted this on another forum (a programming forum). One of the people there wrote a program to see how many tries it would take the random code to come up with the word "Death". Surprisingly, it doesn't take all that long...

http://www.codingforums.com/showpost.php?p=1079916&postcount=16

Krupski
04-18-2011, 07:37 PM
Can I get first dibs on your firearms if shit goes south for you.

I thought "west" was the direction a person didn't want to go...?

roaddog
04-18-2011, 08:33 PM
You immoral degenrates trying to get first dibs on Krups weapons! Don't you guy's have any cooth or class???.
That said....Krup.I will give them a good home and treat them as one of my own...Buddy!.

Ha! Ha!

cowdawg
04-19-2011, 05:31 PM
Your doomed Krup doomed. :mouse2:

Krupski
04-20-2011, 12:16 AM
You immoral degenrates trying to get first dibs on Krups weapons! Don't you guy's have any cooth or class???.
That said....Krup.I will give them a good home and treat them as one of my own...Buddy!.

Ha! Ha!

There's enough to go around. Losta ammo too. :)