- 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
bool validateStrings(string s1, string s2) { h1 = createHash(); h2 = createHash();
if(h1.equals(h2)) { emailManagement("We have a problem"); } else { emailManagement("Brillant"); } }
Admin
Everybody knows that Hashes can be used for reasonably efficient data retrieval. The benefit of using a random hash is that hash generation is a simple process, and random access is phenomenally improved. As we will access the items at random, a random hash is the best option to use.
Admin
Ooh yeah, didn't notice the '%1' this makes the algorithm that much more efficient. We will always be looking up the hashvalue '0' in our data structure. This means we can simplify it by simply storing a linked list at the 0 hash, and we save the look up time we would otherwise have into the hash.
Admin
What use does a hash have if you never need to regenerate the same hash from the same source.
Admin
Damn it all, Poe's law has totally overwhelmed this site. I can't tell who's trolling and who isn't.
Admin
[hive mind voice] Come, join us. It is, beautiful... Morons and geniuses frolic together each thinking that they are smarter than the other... [/hive mind voice]
captcha: decet => How appropriate... :)
Admin
That hash algorithm is ridiculous. It will never detect any duplicates until the (2^32 + 1)th item. Give or take.
Admin
Or to put it another way: <futurama> "Thus solving the problem forever." "But--" "FOREVER!" </futurama>
Admin
Wow. My question really made some impact.
Admin
It's very simple: given the pseudo-randomization, as data was assigned new "hashes", the probability that two data sets were given the same hash is pretty low. Ergo: no more duplicate entries. (sure, it didn't mean that the data was actually unique, but it looks as there are no duplicates - after all, if one considers the hash as part of the data set, then everything else could be identical but since the hash is different ... then ... they're different).
Sure, it's stupid and has no practical value, thus it's good for management.
Admin
Admin
My eyes, my eyes, the goggles they do nothing!
Admin
Well this is an interesting one...
Admin
But Math.random() % 1 is always zero right? So all the entries got the same hash?
I love the brilliance of pushing it client side :P
Admin
Wow, I've googled Poe's Law and learned something interesting. Thank you WTF.
By Poe's Law, someone will interpret the above as an attempt sarcastic. It wasn't, I'm genuinely pleased at learning this.
Admin
As pointed out before: javascript:alert(Math.random() % 1)
Message from webpage
0.5821414473500872
OK
Admin
multiversalisation does not need support: my physics friend tells me that universes are non-communicative with each other...
Admin
Of course duplicates were reduced - the "hash" was stored with the rest of the data so the number of duplicate data sets was reduced by a factor of 10^39 (or whatever - I can't be bothered to do / check the maths)
Admin
OW!!!
ow ow ow ow ow ow ow ow
Admin
Given that it's Javascript, why don't you just <a rel="nofollow" href="javascript:alert("It's " + (Math.random() % 1))" target="_blank" title="javascript:alert("It's " + (Math.random() % 1))">try it out yourself?
Admin
In many-worlds interpretation of quantum mechanics every light interference is result of communication between multiple universes.
Admin
Ah-ha ! I was referrring to multiverse M-Theory, not your common garden quantum multiverse. Of course you realise that in M-Theory, objects in each universe are essentially confined to the D-brane of their universe, but may be able to interact with other universes via gravity, a force which is not restricted to D-branes. Now although our noble friend's hashing technique, although having the appearance of being very WTF heavy, in fact has no mass and is therefore excluded from interactions.
Admin
Well that's a short-sighted approach! They are non-communicative now, but have you future-proofed it? No of course you haven't. Go back into your cubicle and finish the job properly.
Admin
Hey Chutya, Still missing me?
Admin
No strike, probably just another power outage...
Admin
For this paper, inspired me, feeling this author words into my heart.By the way,I have here sell coalitions jerseys:Our product price concessions, quality is excellent. also u can go here shopping,I hope you have a good time.(http://www.cheapjerseyslink.com)
Admin
For crying out loud, fcking drop akismet because it doesn't fcking work. Put in a real captcha and stop hassling regular posters.
Take a look at recaptcha; it's dead easy to drop in.
Admin
"For this paper, inspired me, feeling this author words into my heart." Whatever happens, don't nobody treat this as a new joke paradigm.
Ah, er, perhaps I shouldn't put ideas into the heads of potential trolls ...
Admin
What's your favourite color? Does anyone else in China have that same favourite? Of course not.. different sources of data guarantees uniqueness.. right?
Admin
You cheap Jersey slink! Have at thee!
Admin
Let me try and understand this...
You would deliberately disable javascript on your web browser at work, so that you could intentionally submit data multiple times to pollute your companies data pool, presumably giving yourself extra work to do and putting your career at risk - and you think client side validation is the WTF.
Not all code needs to be written to protect against malicious aholes
Admin
Most likely, it will never detect any actual duplicates. Collisions are just collisions. They only mean that the hash function has resulted in a duplicate value. It's up to the hash table implementation to determine how to handle it. A good implementation would maintain collision lists. A bad implementation would break without examining the data.
Admin
Take it easy there little fella'. I'm sure your "programming" prof once told you something about this, didn't he? Look, I have nothing against juniors (everyone has to start somewhere), but I do hate the thinking that if you yell loud enough, no one will call you on it, no matter how stupid it was what they said.
If anything, it highlights your lack of experience and/or understanding...
Admin
I have this feeling that there are no more legitimate questions or answers on this site any more. I think this forum is entirely populated by trolls. Nothing you say can possibly shake this belief from me, either, because my yomi is so high your attempt at trolling by subtly trolling in a manner to make it look like you're a troll trolling pretending you're troll trolling as a non-troll just to give me something to latch onto would truly be a troll in and of itself. But I'm too good for that, just try to prove me wrong.
loltrololzorlol
Admin
Admin
... and another WTF meme is born...
Admin
i can haz new wtf?
Admin
Admin
Then again, randomness like this lets you mark 'unable to reproduce' on all of your bug tickets.
Admin
you're the first asshole. why do I have to read your junk? if you don't have anything smart to say, then shut up.
I guess this goes for me to.
Admin
Meant for the "frist" guy:
What the??? It said 0 comments at the first attempt. Akismet, I'll kill you!
Admin
Yeah, sure you are.
</eyeroll>I bet next you'll suggest that someone will interpret my sarcastic reply as a serious one, huh?
Admin
See you have to seed your hash or it fails to grow, bloom, and provide buds of information. Without proper seeding all hash grows into unpredictable random messes that just leaves you feeling like you have a bunch of weeds.
Admin
Haha, yup, and the duplicate warnings were likely prompted by completely unrelated (non-duplicate) data entries.