Comment On Thirty X's

In today's fast-paced world of cell phones, Sega Nomads, and turn signals, we don't have time for anything. That's why we have acronyms. Just try to read until the end of this: International Business Machines Corporation. Congratulations if you're still awake – the rest of us non-MENSA types will keep referring to it as IBM. [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Re: Thirty X's

2008-12-08 09:05 • by snoofle
I don't get the last acronym...

What The F***!?

Worse Than Failure

I.... am... confused...

Re: Thirty X's

2008-12-08 09:08 • by Addison (unregistered)
is it bad that I just realized "worse then failure" works as an alternate meaning for WTF? I should "wake the f***" up!

Re: Thirty X's

2008-12-08 09:09 • by Ray (unregistered)
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"?

Re: Thirty X's

2008-12-08 09:09 • by Hans (unregistered)
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*!?

Re: Thirty X's

2008-12-08 09:11 • by snoofle
233456 in reply to 233454
Ray:
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"?

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...

Re: Thirty X's

2008-12-08 09:13 • by Scott (unregistered)
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.

Re: Thirty X's

2008-12-08 09:13 • by Jeroen (unregistered)
233458 in reply to 233454
Ray:
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"?

I think the third person, who decided to use a brilliant delimeter to make it 'easier' to seperate different acronyms in the table

Re: Thirty X's

2008-12-08 09:14 • by HypocriteWorld
Surprisingly, there's no comment of this form yet:
8799 TIAC THIS
8800 TIAC IS
8801 TIAC A
8802 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Re: Thirty X's

2008-12-08 09:16 • by Mr B
233460 in reply to 233458
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.

Re: Thirty X's

2008-12-08 09:19 • by IT Girl (unregistered)
233461 in reply to 233452
snoofle:
I don't get the last acronym...

What The F***!?

Worse Than Failure

I.... am... confused...


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.

Re: Thirty X's

2008-12-08 09:20 • by XXXXXXXXXXXXXXXXXXXXXXXXXX (unregistered)
8799 TIAC THIS
8800 TIAC IS
8801 TIAC A
8802 TIAC COMMENT
8803 TIAC XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Re: Thirty X's

2008-12-08 09:21 • by Anonymous (unregistered)
233463 in reply to 233460
Mr B:
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.

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!

Re: Thirty X's

2008-12-08 09:33 • by Voodoo Coder
Not one to buy into that whole normalization thing, he created a table like the following:


You obviously aren't familiar with -2nd Normal Form.

Re: Thirty X's

2008-12-08 09:34 • by JimM
233467 in reply to 233458
Jeroen:
Ray:
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"?
I think the third person, who decided to use a brilliant delimeter to make it 'easier' to seperate different acronyms in the table
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...

Re: Thirty X's

2008-12-08 09:40 • by NoAstronomer (unregistered)
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.

Mensa

2008-12-08 09:44 • by DaveAronson
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>

Re: Thirty X's

2008-12-08 09:46 • by Bob (unregistered)
233470 in reply to 233466
Voodoo Coder:
Not one to buy into that whole normalization thing, he created a table like the following:


You obviously aren't familiar with -2nd Normal Form.


Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.

Re: Thirty X's

2008-12-08 09:53 • by Bot (unregistered)
TRWTF is that there's a delimiter at all -- The ABBR_IDX changes when it goes to the next acronym anyway.

Re: Thirty X's

2008-12-08 09:53 • by synp (unregistered)
233472 in reply to 233455
Hans:
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*!?



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)
233473 in reply to 233469
DaveAronson:
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>

<pedantry>You didn't open the pedantry tag. Validation fails.</pedantry>

Re: Thirty X's

2008-12-08 09:55 • by Death (unregistered)
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...

Re: Thirty X's

2008-12-08 09:57 • by Anonymous (unregistered)
<so_very_gay>
Geek tags.
</so_very_gay>

Re: Thirty X's

2008-12-08 09:59 • by GalacticCowboy
233476 in reply to 233470
Bob:
Voodoo Coder:
Not one to buy into that whole normalization thing, he created a table like the following:


You obviously aren't familiar with -2nd Normal Form.


Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.


Your humour detector is clearly epic fail.

What do you call a man with no arms or legs, floating in the ocean?

Re: Thirty X's

2008-12-08 10:03 • by Anonymous (unregistered)
233478 in reply to 233476
GalacticCowboy:
What do you call a man with no arms or legs, floating in the ocean?

Trevor the Floating Ocean Man?

Re: Thirty X's

2008-12-08 10:03 • by Donal (unregistered)
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

Re: Thirty X's

2008-12-08 10:04 • by Donal (unregistered)
233480 in reply to 233476
F*****d.

Re: Thirty X's

2008-12-08 10:05 • by Donal (unregistered)
233481 in reply to 233476
GalacticCowboy:

What do you call a man with no arms or legs, floating in the ocean?


F****d. (Disregard last)

Re: Thirty X's

2008-12-08 10:06 • by Pony Gumbo (unregistered)
Best SQL WTF ever.

Re: Thirty X's

2008-12-08 10:08 • by Anonymous Coward (unregistered)
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.

Re: Thirty X's

2008-12-08 10:13 • by Anonymous (unregistered)
233484 in reply to 233479
Donal:
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

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.

Re: Thirty X's

2008-12-08 10:15 • by Amateur (unregistered)
233485 in reply to 233479
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.

Re: Thirty X's

2008-12-08 10:16 • by QHS (unregistered)
A separator when the items are already distinguished by an index? Brilliant!

Re: Thirty X's

2008-12-08 10:18 • by Voodoo Coder
233487 in reply to 233470
Bob:
Voodoo Coder:
Not one to buy into that whole normalization thing, he created a table like the following:


You obviously aren't familiar with -2nd Normal Form.


Irrelevant; he's not talking about Normalisation (capital N) but normalisation in the sense of storing the data in a consistent manner.


I bet you're just the life of the party. Do you always poop on people's jokes?

Re: Thirty X's

2008-12-08 10:18 • by method1
233488 in reply to 233476
GalacticCowboy:
What do you call a man with no arms or legs, floating in the ocean?


Bob

Re: Thirty X's

2008-12-08 10:19 • by Nis (unregistered)
233489 in reply to 233479
Donal:
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

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.

Re: Thirty X's

2008-12-08 10:23 • by Quango
The real WTF:

"At Chris N.'s employer, they needed the ability to look up acronyms' meanings"

It's called Google.

Re: Thirty X's

2008-12-08 10:24 • by Ben (unregistered)
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.

Re: Thirty X's

2008-12-08 10:25 • by Mike (unregistered)
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?

Re: Thirty X's

2008-12-08 10:28 • by rbonvall
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)
233494 in reply to 233492
It's hardcore XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Re: Thirty X's

2008-12-08 10:31 • by rmz (unregistered)
233495 in reply to 233492
Mike:
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?

You probably missed the three months in which they were on sale.

Re: Thirty X's

2008-12-08 10:37 • by Voodoo Coder
233496 in reply to 233493
rbonvall:
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.


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...

Re: Thirty X's

2008-12-08 10:41 • by Mike Seth (unregistered)
233497 in reply to 233466
You obviously aren't familiar with -2nd Normal Form.


You win the debate.

Re: Thirty X's

2008-12-08 10:43 • by welshie1988 (unregistered)
233498 in reply to 233491
Ben:
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.


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)
233499 in reply to 233490
Quango:
The real WTF:

"At Chris N.'s employer, they needed the ability to look up acronyms' meanings"

It's called Google.


In today's fast-paced world of cell phones, Sega Nomads, and turn signals, we don't have time for anything.


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.)

Re: Thirty X's

2008-12-08 10:48 • by Ben (unregistered)
233500 in reply to 233498
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..

Re: Thirty X's

2008-12-08 10:48 • by Nath3an (unregistered)
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)
233502 in reply to 233457
Scott:
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.


Dad, is that you?

Re: Thirty X's

2008-12-08 10:49 • by JPhi
233503 in reply to 233491
Ben:
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.


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:


private static boolean isNotAllXs( String s )
{
StringBuffer test = new StringBuffer( s.trim() );

for ( int i = 0; i < test.length(); i++ )
{
if ( test.charAt( i ) != 'X' )
{
return true;
}
}
return false;
}


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)
233504 in reply to 233496
Voodoo Coder:
rbonvall:
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.


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...


Ok, let's got step by step: first row gets "Association", second row gets "of", third row gets "XXX" - oops!
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Add Comment