| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Next » |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:03
•
by
Chris
(unregistered)
|
|
This reminds me of this time I was in this place and was doing something. It did or didn't' work out that time. I had bad dreams about inserting a tape or drive that same night.
Captcha: commoveo: BYOO - Bring your own oreos. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:05
•
by
anon
(unregistered)
|
Wha? :| |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:07
•
by
NickR
(unregistered)
|
|
From here on all my code is going to implement ISelfAware. A new project called "SkyNet" or something just came through.
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:08
•
by
CJ
(unregistered)
|
|
Can someone explain the wtf with the hashmap to me?
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:08
•
by
Chris
(unregistered)
|
Yeah, I don't know either. I thought it was related, but I haven't slept in 28 hours, and hurting a bit from it. Incassum. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:12
•
by
cie3
(unregistered)
|
|
Oh crap - we are not commenting in the correct Universe
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:14
•
by
swedish tard
(unregistered)
|
http://en.wikipedia.org/wiki/Prime_number#Primality_of_one No, it is not. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:19
•
by
Bert Glanstron
(unregistered)
|
You are an idiot, and should be banned from using your mommy and daddy's modem. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:20
•
by
00Davo
|
Could one not write zero in Roman numerals like this: " "? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:20
•
by
anonymous
(unregistered)
|
|
Obviously this is from an embedded system without a file system. Why would you need a file pointer there?
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:21
•
by
Anonymous
(unregistered)
|
To be honest it's not possible to verify whether this is a WTF or not. Java has a HashMap class that is empty when instantiated, so if this were Java it would be a WTF because he is explicitly clearing an empty map. But in actuality, this isn't Java at all because it is using the .NET generics syntax (HashMap<T,T>). This is not a built-in .NET class, someone has written this from scratch and they were probably trying to replicate the Java functionality. So really, we have no idea what's going on with this home-made HashMap class. The comment says that "HashMaps are crazy" and for all we know their custom implementation IS a bit crazy. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:24
•
by
Andy P
(unregistered)
|
The guy had put in a "clear" statement to force a newly created HashMap to be empty. The gag, of course, is that newly created containers (...in any sane implementation, who knows what half-assed home-baked version of HashMap this guy might have been lumbered with) are always created empty because anything else is madness. So he was (we are led to presume) doing something completely pointless, *and* adding a comment explaining it which really only highlighted his own lack of understanding. Or so we must assume. Maybe in his codebase HashMaps really are created containing random garbage. Seems unlikely, though. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:26
•
by
Flabbergasterisk
(unregistered)
|
|
Only if you implement ISelfConscious.
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:28
•
by
Larry
(unregistered)
|
TRWTF is that Java 1.5 came out 6 years ago. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:28
•
by
Kuli
(unregistered)
|
|
The code with the cleared new HashMap is absolutely correct.
Probably somewhere in later code, the author implemented some GOTO functionality by changing the address register of the CPU. Then you could jump directly behind the newly created HashMap! Of course you need to clear it then, to be sure that no elements are left. |
|
Hi Honey! Did you miss me? *kisses*
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:30
•
by
Severity One
|
Er, what? Map<TransactionId, List<BillingTransaction>> workMap = Unless 1 == 0, that's Java. Java has had generics since 1.5, which is already getting geriatric. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:32
•
by
Uncle Al
(unregistered)
|
And the 1 = 0 test also clearly comes from an embedded system -- who knows what universe a user might carry the system to? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:43
•
by
Fenris
(unregistered)
|
Broken? now you are not putting the needed </div> |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:44
•
by
aepryus
(unregistered)
|
public interface ISelfAware {
This exposes self for a JavaBean; allowing access to the self pointer by token. Off hand, I don't know of any other way to accomplish this directly. In my own code, I check for the "self" token explicitly and just return the self pointer in that case instead of passing the token on to the JavaBean itself. But, this solution works also. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:44
•
by
Anonymous
(unregistered)
|
Holy shit, has it been that long since I did Java? Sorry, it was still a proposal awaiting ratification the last time I wrote anything in Java. We all know how long it takes for JSRs to go anywhere but I really had no idea it had been that long. Apologies, I should have double checked that one. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:47
•
by
vyznev
|
Why are you mixing those newfangled chicken scratches with your proper good ol' Roman numerals? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:50
•
by
JamesQMurphy
|
He should have put 3 calls to clear(). Once to clear out the random garbage, once to clean out the rest of the garbage, and once again for lucky. |
Re: Do we get to have a discussion about whether or not 1 is a prime number?
2010-09-29 10:52
•
by
Nutster
|
|
0 and 1 are neither composite nor prime. Non-whole numbers do not qualify either. A prime is a number with by only two integer factors: 1 and itself. A composite number is the product of several primes. 1 does not qualify for either, because 1 has only one factor, which is 1, so it not prime. Also it has no prime factors, therefore it is not composite.
0 is divisible by every number (0/x = 0, for all x | x != 0). 0/0 is handled by limits in calculus class. Therefore, 0 is not prime. That said, 0 is not composite because one of its factors is not prime, as 0 is a factor and, as just shown, 0 is not prime. Therefore, 0 and 1 are each considered neither prime nor composite. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:53
•
by
sep332
(unregistered)
|
|
/* This program will only run if the laws of mathematics hold */
if(1 == 0) { fprintf("Oh crap - we are not running in the correct Universe\n"); exit(17); } weird, I'm listening to a Pronobozo album right now called Zero=One=Everything ! |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:53
•
by
Whatever
(unregistered)
|
|
The random, prime number being set to 215 is PERFECT!
Nobody trying to crack the encryption would EVER try 215, as it's not random and it's not prime. PS., Hey frits, maybe you could just change your sig to be the Bert Glanstron thing; that would save your secret admirer a lot of time. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:53
•
by
Anonymous
(unregistered)
|
So I appreciate that Java supports generics now, as per my previous comment, but I have to take exception at the above statement which is patently false. The code provided is valid C# syntax, assuming one had written a custom class called HashMap<T,T>. So your assertion is false because 1 != 0 but it is still possible for that code to be C#. </pendantry> |
Re: Do we get to have a discussion about whether or not 1 is a prime number?
2010-09-29 10:54
•
by
anon
(unregistered)
|
*golf clap* |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:56
•
by
THG
(unregistered)
|
That works ... NOT! x OR y ≡ ¬(¬x AND ¬y) [[ http://en.wikipedia.org/wiki/De_Morgan%27s_laws ]] |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 10:57
•
by
boog
(unregistered)
|
I always get a laugh out of comments like this. It's like the comment is just daring me to do it. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:00
•
by
Mark
(unregistered)
|
|
1) TRWTF in the first code fragment is that the submitter can't read comments. I don't know MBeans, but based on this comment I'm willing to bet that they impose some kind of proxy, and this method is used to trick the proxy into letting you bypass it. On second thought, TRWTF is that their framework assumes you might have a need to bypass a proxy...
2) 1 is not prime; look it up. 215 is neither prime nor random, but then again a lot of people say "random" when they mean "arbitrary". My guess is they needed an arbitrary prime for something obscure (like a home-brew hash table), and the value was later changed by someone who had no clue why it needed to be prime. Or maybe it didn't need to be prime any more, but it was too much work to change the constant name (since the whole point with named constants is to isolate change). 3) Bad joke != WTF. The (1 == 0) test is a developer having a laugh. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:00
•
by
ion435
(unregistered)
|
|
wtf??? what does that mean? get me outta here!!!!!!!!
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:02
•
by
boog
(unregistered)
|
Important stuff to know. Consider the following real-world application: Rocky V + Rocky II = ? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:06
•
by
boog
(unregistered)
|
I'd certainly wonder "WTF?" if I found it in production code. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:12
•
by
DCRoss
|
No, you are a free man. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:17
•
by
DCRoss
|
I recently inherited a system with these lines in the crontab: # DO NOT uncomment this next line under penalty of death! Some days I wonder just what happened to the last person who had to work on that server. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:22
•
by
Steven
(unregistered)
|
That's also the standard Java generics syntax. I suspect both Java and full WTFness, but cannot prove it. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:23
•
by
nibh
(unregistered)
|
Fail |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:26
•
by
icebrain
(unregistered)
|
|
To those saying that 215 and 1 aren't random numbers: go study statistics.
A random number is "a number generated for or part of a set exhibiting statistical randomness". Since you have no idea about what generated such number, you can't say if the numbers are random or not. It's not an intrinsic property of the number, but of where it came from. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:26
•
by
דותן כהן
(unregistered)
|
|
סליחה?
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:27
•
by
דותן כהן
(unregistered)
|
סליחה? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:32
•
by
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(unregistered)
|
Of course it's prime. Just not in base 10, or anything else you might reasonably expect. (Try 6, or 36). |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:34
•
by
amischiefr
|
Hell no, I like an audience! |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:34
•
by
Caeruleus
(unregistered)
|
The answer is "II". In ancient Roman numerals, the value is the sum of the digits. "IV" = 1 + 5. The representation for 4 was "IIII"; the convention of writing "IV" did not come until the middle ages. On the other hand, you want to know how to represent zero, and the answer is "NULLUM" or "NIL". ( Ancient Romans did not have lower case letters. ) |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:34
•
by
ted
(unregistered)
|
Yea, but surely any optimizing compiler would remove the code at compile time? |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:53
•
by
ShatteredArm
(unregistered)
|
if (_tblItem.getTable().getModel() != null I had a coworker do this. He was absolutely nonplussed as to why his code was throwing object reference exceptions when the field wasn't even required. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 11:59
•
by
Bob
(unregistered)
|
Welcome to the 21st century. News Flash: Judaism is no longer funny. |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 12:03
•
by
Hitler
(unregistered)
|
Really? Because it was hilarious in the 20th century! |
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 12:03
•
by
shimon
|
|
Sup dawg, I heard you like references, so we've put a reference in your reference so you can get self while you have self!
|
Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More
2010-09-29 12:04
•
by
The Judge
(unregistered)
|
I DEMAND THAT THIS IMMEDIATELY BE MADE A FEATURED COMMENT |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Next » |