| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
I don't get the last acronym...
What The F***!? Worse Than Failure I.... am... confused... |
|
is it bad that I just realized "worse then failure" works as an alternate meaning for WTF? I should "wake the f***" up!
|
|
Which is worse? The person who hatched this demon spawn, or the next person who looked at it and said "good idea, I'm going to add a bunch more entries"?
|
|
Uhh... Why are the entries in separate fields? Yes, yes, otherwise it wouldn't feature on this website, but apart from that? It looks like the designer wanted to implement a flat file, and is using the primary key to order a separate collection of 'lines'. But why? What business (or mental) case could cause him to split the data up in this form?
"I'd like to figure out what 'IBM' means. So I will just read the table, in order of primary key, until I find 'IBM', and then I will keep reading until I find an entry that consists purely of X'es. The results up until that point I will concatenate to give the right result." Hard to imagine how this happens. But congratulations anyway. It truly is a W.T.*F*!? |
Without more details, it's hard to know. Sometimes, you inherit code you aren't allowed to change. In that case, adding more entries is sad but understandable. Otherwise... |
|
Testing each character one by one to see whether it is an "X" or not might seem odd at first until you realize that's how the machine code does it anyway.
By explicitly calling out the logic you make it more obvious to future readers what's going on, and you also provide opportunities for the compiler to optimize. |
I think the third person, who decided to use a brilliant delimeter to make it 'easier' to seperate different acronyms in the table |
|
Surprisingly, there's no comment of this form yet:
8799 TIAC THIS 8800 TIAC IS 8801 TIAC A 8802 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
|
The data design wtf is somewhat countered (by about 0.2%) by the fact that the designer realised that he was dealing with abbreviations (ABBR), and not acronyms.
|
Where I work, someone once commented on a client's file with WTF. I submitted it could have meant "Where's the Form" and argued that this kid was pretty innocent (knowing full well he knew what he was saying). When he was called on it by the manager of his department, he answered that it meant "Where's the Followup". The manager bought it. |
|
8799 TIAC THIS
8800 TIAC IS 8801 TIAC A 8802 TIAC COMMENT 8803 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
Having a basic grasp on English is absolutely no counter for this abomination. This guy is supposed to be a developer, not an English major! |
You obviously aren't familiar with -2nd Normal Form. |
Maybe the person who p[ut the Xx30 line in weas actually just completing a normal row of Data Entry. How do we know that the original, business defined meaning of LA wasn't "Los Angeles XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"? OK, I'll give you that would be a WTF in itself, but who knows... |
|
IMHO The "Real WTF" here is why anyone would bother typing in thirty X's when an empty string works just as well as far as the return value from isNotAllXs(...) is concerned.
|
|
Normally, I wouldn't be so picky, but since it deals with the topic of the WTF: Mensa is not an acronym, nor an abbreviation, initialism, etc. So, it should be in Title Case, not ALL UPPERCASE.
</pedantry> |
Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner. |
|
TRWTF is that there's a delimiter at all -- The ABBR_IDX changes when it goes to the next acronym anyway.
|
Dah! select ABBR_CDE from table where ABBR_TXT="BUSINESS" Gives you all the abbreviations that contain the word business. select ABBR_CDE from table where ABBR_TXT="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" Gives you all the abbreviations that have more than one meaning, and don't get me started with select count + 1 The possibilites are endless! |
Re: Mensa
2008-12-08 09:54
•
by
Peter P. Pedantic
(unregistered)
|
<pedantry>You didn't open the pedantry tag. Validation fails.</pedantry> |
|
Owww... My head hurts. This is retarded beyond repair. Never mind normalization, this structure fails at simplest sanity.
a) Why on earth are all the elements of the acronyms in separate rows? b) A separator in a database? There are no rules on natural order of a relational db. Anything that uses this "separator" needs to do ORDER BY row_id to work for sure... c) Checking/storing the "X"-s is retarded waste of space, because you can check if ABBR_IDX is even to get the same info. a causes b, b causes c. And they all are solved in a WTF way... Cant believe the massiveness of this stupidity... |
|
<so_very_gay>
Geek tags. </so_very_gay> |
Your humour detector is clearly epic fail. What do you call a man with no arms or legs, floating in the ocean? |
Trevor the Floating Ocean Man? |
|
In the isThisAllXs function, as it is "retVal = true;", and not "retVal = retval && true;", doesn't it just check to see if the last character in the string is X, or am I having a brain fart?
Donal |
|
F*****d.
|
F****d. (Disregard last) |
|
Best SQL WTF ever.
|
|
Wow...this is one of the most mindboggling codeSODs I've read in awhile. Well formatted and cleverly written too.
Captcha: appellatio - Rejected name and premise for the sequel to American Pie. |
retVal will remain false unless any char in the string is not 'X', at which point it is set to true. Therefore, if the loop exits and retVal is true, it must be the case that one or more characters in the string was not 'X' (we don't know which ones or how many, but we know that it was one or more). So the function works, not that it makes today's code any less of a WTF. |
|
No, it works correctly. The assignment triggers if and only if a character which is not an 'X' is encountered, so "false" if returned if no such character exists, and "true" if any does, just as the (somewhat confusing) name of the function indicates.
|
|
A separator when the items are already distinguished by an index? Brilliant!
|
I bet you're just the life of the party. Do you always poop on people's jokes? |
Bob |
It checks whether the string contains any non-X characters. However, instead of break;ing on the first match it continues looking through the rest of the string as well. Which is yet another WTF, since retVal can't change to false anyway. |
|
The real WTF:
"At Chris N.'s employer, they needed the ability to look up acronyms' meanings" It's called Google. |
|
Wait a second.. Isn't that wrong anyway?
private static boolean isNotAllXs( String s ) { StringBuffer test = new StringBuffer( s.trim() ); boolean retVal = false; for ( int i = 0; i < test.length(); i++ ) { if ( test.charAt( i ) != 'X' ) { retVal = true; } } return retVal; } Wouldn't that mean that a String s which ends with an X would return false too? (which means that it's all Xes) so isNotAllXs("ASDFX"); would return false, just as isNotAllXs("XX[...]XXXX"); Sorry if i'm wrong about that. |
|
The Real WTF for me is that I didn't even know the Sega Nomad existed! Seriously, a handheld that can take Genesis/Megadrive carts direct? WTF? Where the hell was I in the mid 90s and why didn't I get a memo about this?
|
|
The codez will fail for the AXMD (Association of XXX Movie Directors).
A workaround for this would be to check whether the delimiter has an even ABBR_IDX. |
Re: Thirty X's
2008-12-08 10:29
•
by
Anonymouse
(unregistered)
|
|
It's hardcore XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
You probably missed the three months in which they were on sale. |
It wouldn't fail on AXMD. Take a closer look at it...it actually works pretty well for to check for an all-x string. Even if the last character were X it would work fine... |
You win the debate. |
Re: Thirty X's
2008-12-08 10:43
•
by
welshie1988
(unregistered)
|
You are wrong. The loop starts, the first character is 'A', which != 'X', so retval = true. |
Re: Thirty X's
2008-12-08 10:46
•
by
evilspoons
(unregistered)
|
I took this to mean that this article was supposed to take place some time around 1995, which really made the whole 'internet' thing kind of a disaster. I'd have considered an offline acronym database a useful tool (if I wasn't ten years old at the time.) |
|
But retval is not being returned at that point. The loop continues, checks a few more letters which will keep retval being true. Then the last letter, which is an X. So retval becomes false, the loop ends and retval is returned..
|
|
The real WTF is that IBM, LA, WCAB and WTF are not acronyms. They are abbreviations.
|
Re: Thirty X's
2008-12-08 10:48
•
by
Topcod3r Jr
(unregistered)
|
Dad, is that you? |
If you're trolling, then way to go, but otherwise, yes, you are wrong about that. retVal is initialized to false, and as soon as any one character is NOT AN X, it is set to true. No where in the code does retVal get set back to false if there is an X. The only WTF is that the code should look more like this:
That way as soon as a non-X is found, the comparison is done instead of checking a bunch of chars that don't matter anymore... Addendum (2008-12-08 11:03): EDIT: Oh yea, one more thing, before ANY characters are checked, there should be a check to see if length == delimiter length, but since the rest of the code is so great, and this function is named "isNotAllXs" I'm assuming that the length check was done before this function is even called... (The post after this reminded me...) |
Re: Thirty X's
2008-12-08 10:53
•
by
AXMD Director
(unregistered)
|
Ok, let's got step by step: first row gets "Association", second row gets "of", third row gets "XXX" - oops! |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |