- 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
C6 C9 D9 E2 E3 4F 5A
Admin
For the record, that's a type of zoned decimal format. It's used when your flat file dataset has fixed width columns and you want to be able to represent a negative number without losing a digit.
It was somewhat clever for 1979, but it should be avoided at all costs now.
Admin
Surely if Alicia was that much of a hot shot, she would have seen signed overpunch numbers before. Not uncommon if you've had to wrangle data from a COBOL system.
Yes, the bug in the code snippet is a WTF. But the fact that the conversion table wasn't part of her toolset already is a bigger WTF, given the context.
And yes, COBOL itself is an even bigger WTF.
Admin
The compiler handled the '2t' correctly, but blew up when encountering '(sic)'
Admin
+1 respect for the Princess Bride reference :)
Admin
If the system in that link was the standard (originating, I'm assuming, in some quirk of punchcard design), no number would've ended in a numeric digit, and "the vast majority of cases" would not have "worked just fine". Not to mention the fact that the odds of every negative number ending in 6 are pretty long.
C'mon, enough with the embellishment. Whatever happened to truth being stranger than fiction?
Admin
In a slight departure from the standard, they use signed overpunch for negative numbers only. It's unambiguous and it works.
Where's the WTF in this WTF?
Admin
So that means HANZO is actually a negative Hans?
I can get behind(!) that idea!
Admin
However, the "2t" is a major WTF, since all negative numbers ending in 2 will never have their last digit changed to the mandatory "K" and so will be treated as positive numbers. And treating a negative number as a positive one can seriously mess up your calculations.
I think you must have misunderstood something. To denote a negative number, a trailing "6" is replaced by an "O". For a negative number ending in, say, 5, the letter would be "N".So the number "2196O" that's mentioned in the text is equal to "-21966" (note the second six) in a non-signed-overpunch world.
Admin
"Of course, sorry! How couldn't it be obvious that it is part of a custom scheme of yours? I should have looked at the documentation you never gave me... not your fault, because it probably doesn't exist!"
Admin
Admin
Admin
What does 2t mean? I only know from C the prefixes 0 for octal 0x for hexadecimal and the suffixes l for long and f for float. But t? Never heard.
Admin
If the frist, why does the sentence try tricking me into believing it's the second by mention the unability to oppose them at all?
Admin
Admin
Admin
Admin
Why does it compile than?
Admin
But if there were any other negative numbers with the last digit != 6, they would've been immediately obvious in the dataset and Alicia would've known this was some kind of character replacement coding and have asked for the key. The fact that it wasn't obvious suggests a lack of values like, say, '5483}' or '1274R'. This quite strongly implies that every negative number in the dataset ended in 6, so all last digit replacements were Os that could more easily get lost.
Something here is not as it appears....
Admin
Actually it's not a departure from the standard at all. Signed overpunch can encode positive, negative, and unsigned numbers.
2196O = -21966 2196F = +21966 21966 = 21966
Unsigned numbers just look like regular numbers.
There is no RWTF.
Admin
This really isn't that bad. It's a decades old system written in COBOL, it had probably been hanging around since they were using punchcards for stuff. The numbers were stored in a common punchcard format, albeit with a bug for digit 2.
Of course, COBOL is a WTF in itself.
Admin
Admin
Bad luck, of course, if there is only one negative number in the dataset and that number even ends in a 6!
Then again: at the time that system had been devised, monitors usually used slashed zeroes (like Ø, only with a zero) to avoid exactly that ambiguity.
Admin
Poor monkeys!
Admin
Admin
"This is how we record negative numbers. They are so rare..." She probably didn't run into a lot of }- and R-ending values because, due to the problem domain, negative numbers were extremely rare. It's easy for every negative number to end in 6 if there's only one or maybe two of them.
Admin
Admin
It can be worse, guys...
I worked with Russian military blueprints, which were "digitized" by hand, and then should be processed and put to the DB. In those times we had FIVE variations of zero character (based on the sight quality of encoding granny):
And code groups separators... Normal case is AAA.BBB.CCC-XX.
I've seen marvelous transciever item, filed under different locations under following names(don't forget that some cyrillic letters are similar to latin):
AAA.BBB CCC -XX AAABBBCCC-XX AAA,BBB,CCC- XX AAA.BBB,CCC - XX
So legacy data is always WTF...
Admin
NewSoft Associates (NSA), Intelligence Business - is Alicias real name Edward, living currently in Russia?
Admin
This would mean that you don't need quotation marks for string literals in the code. Such a language would be a WTF indeed.
Admin
I was thinking the same thing. Monkeys have the advantage of 4 opposable phalanges. The should be able to code twice as fast, no?
Admin
Right, that's exactly the point. The whole story hinges on the negative numbers being all camouflaged because they end with "O" instead of "0". It falls apart unless somehow every negative number ends in 6.
Admin
Be that as it may, right now I'm happy that I'm not coding in COBOL :-)
Admin
Meh, everyone else covered it all. That's what I get for closing a tab for a half hour.
Admin
An identifier is a series of letters, digits, and hyphens with the following restrictions:
So, by this definition, 2t is indeed an identifier.
But -2t is not.
But 2-t IS an identifier.
Admin
TRWTF is Business Intelligence;
In general, a rather expensive way to provide large amounts of data incorrectly, to add spurious tables and charts into 600 page reports for upper management to print off, carry to meetings, and then completely ignore.
At my last company, I was tasked with providing some web-based reports for our customers, as cut-down versions of the quarterly BI reports they received. BI was such a mess that it was much easier, faster, and more efficient for me to write custom queries rather than trying to tie their aging systems into my nice new ones.
However, try as I might, I simply couldn't get the values in my reports to match those calculated by BI. After checking, and rechecking, multiple times, we realized that my reports were actually correct... BI's were out.
And not just out by a bit... for over a decade, that department had been producing reports which had systematic errors of anywhere between %10 and %50 across the board. This data was the basis of how we billed customers.
The solution?
"We want our customers to be able to compare their spending this year to last year, and they wont be able to compare like with like if we fix all the reports now... please introduce the same systematic errors into your new reports."
(Which means... "We've been defrauding these guys for over 15 years (albeit unintentionally), so we probably shouldn't tell them about it now.")
I refused, and said I'm happy to do any other work they require, but I will only deliver these web reports AS IS, and do not wish to be made to communicate with (e.g. lie to) these customers any more, because that would make me complicit in fraud.
Admin
Given the article describes it as a "sea" of numbers I would find it highly suspicious if the field accepts/expects negative numbers but there is only one. But then we already know that any negative numbers ending in 2 would fail to be recoded, so we already know the data is pretty much guaranteed to be bunk.
OTOH, this has given me a whole new perspective on my career - I didn't realise it before, but apparently I'm a Business Intelligence expert! They make good money, right? ;)
Admin
The only WTF is the '2t'. As others have stated, the converted final character is indeed a way to depict signed numbers, and it isn't really a big surprise that someone can work for long enough to become the go-to person without encountering this.
As for COBOL being a WTF, one of our department codes primarily in COBOL. Today they will be adding features to our flagship product, in COBOL, just like they've been doing since before some TDWTF readers were born.
There is an old saying, "If it isn't broken, don't try to fix it." An application is not broken merely because it was implemented with old technology.
Admin
Admin
Perl has a value "0 but true". It is used to return true status from a system call that would return zero for success. See http://perldoc.perl.org/functions/ioctl.html
Admin
I can't believe I saw a snippet of SQR code on here. That just made my day. I'm surprised that evaluate block doesn't have a WHEN-OTHERS....
Captcha: capio - I can't believe he had the nerve to capio after she told him she liked his style.
Admin
This used to be really, really common. See http://en.wikipedia.org/wiki/Signed_overpunch
Admin
Yeah, they also have opposable toes. Which gives them an advantage over us.
Admin
no.... there TDWTF is using the same old technology to add NEW stuff.
Like creating a new internal product using MFC because the rewrite is from a code-base using MFC, and you want to reuse as much code as possible.
Rewrite => Copy-pasty.
"Don't fix what isn't broken" doesn't apply to making new stuff.
Admin
My name Inigo Montoya, you changed the working definition of this word. Prepare to die.
Admin
Admin
Positive numbers were indicated by XORing the last digit's code with 00110000; negative numbers by XORing the last digit's code with 00100000. http://en.wikipedia.org/wiki/EBCDIC
Admin
I liked this system. we can call it Plain ingenous simple system.
Admin
I remember those! You would create them on a keypunch, by holding down a key to prevent the card from advancing, so that you could overpunch the number and the sign.
Admin
Plain Ingenious Simple System Optimized For Faxing