• M-x org-mode (unregistered)

    C6 C9 D9 E2 E3 4F 5A

  • Mainframer (unregistered)

    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.

  • (cs)

    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.

  • Black Bart (unregistered)

    The compiler handled the '2t' correctly, but blew up when encountering '(sic)'

  • Anon (unregistered)

    +1 respect for the Princess Bride reference :)

  • Sal Undy (unregistered) in reply to Paddles
    Paddles:

    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?

  • Causa (unregistered) in reply to Sal Undy

    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?

  • (cs)

    So that means HANZO is actually a negative Hans?

    I can get behind(!) that idea!

  • faoileag (unregistered) in reply to Sal Undy
    Sal Undy:
    Paddles:

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

    If I understand the system correctly, you can use "{" to "I" to indicate a positive number, but it's not mandatory. If you use the digit instead, the number is automatically assumed to be positive.

    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.

    Sal Undy:
    Not to mention the fact that the odds of every negative number ending in 6 are pretty long.
    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.

  • anonymous (unregistered) in reply to Black Bart
    Donald:
    "Oh that. Don't you know? ..."
    That's the TRWTF!

    "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!"

  • faoileag (unregistered) in reply to no laughing matter
    no laughing matter:
    So that means HANZO is actually a negative Hanz6?

    I can get behind(!) that idea!

    There. FTFY

  • (cs) in reply to Causa
    Causa:
    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?

    Well, here it is: "In a slight departure from the standard, they use signed overpunch for negative numbers only."

  • ANON (unregistered)

    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.

  • Oppo (unregistered) in reply to Anon
    lack of an opposable thumb (you trying using the space key without out and you'll understand).
    Does this mean a lack of a set of thumbs/5th fingers (which would at least make some sense) or a unability to oppose them (which wouldn't)?

    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?

  • Bob (unregistered) in reply to faoileag
    faoileag:
    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".
    I think that's their point? There should have been N's and P's and R's all over the numeric data unless every negative number ended in a 6.
    TDWTF:
    ...company that Alicia worked for... ...Alicia was one of their leading consultants... ...there were few in the industry who were better... ...she was often used where no one else could cut it...
    Alicia's total lack of modesty is TRWTF.
  • faoileag (unregistered) in reply to ANON
    ANON:
    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.
    The "t" stands for "typo".
  • (cs) in reply to ANON
    ANON:
    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.
    0 = TRUE
    1 = FALSE
    2t = FILE_NOT_FOUND
    
  • ANON (unregistered) in reply to faoileag
    faoileag:
    ANON:
    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.
    The "t" stands for "typo".

    Why does it compile than?

  • (cs) in reply to faoileag
    faoileag:
    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".

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

  • Augue (unregistered) in reply to no laughing matter

    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.

  • anon (unregistered)

    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.

  • (cs) in reply to JimM
    JimM:
    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....

    "This is how we record negative numbers. They are so rare that we usually don't worry about them."

  • faoileag (unregistered) in reply to Bob
    Bob:
    faoileag:
    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".
    I think that's their point? There should have been N's and P's and R's all over the numeric data unless every negative number ended in a 6.
    Donald from the article:
    Oh that. Don't you know? This is how we record negative numbers. They are so rare that we usually don't worry about them.
    Seems as if negative numbers were indeed a rare specimen in those datasets.

    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.

  • Anonymous Coward (unregistered)
    Original Article:
    monkeys who were annoyed at their lack of an opposable thumb
    Awwww... now I feel really sorry for the monkeys in this story - did they lose their thumbs in an industrial accident or something?

    Poor monkeys!

  • (cs) in reply to Augue
    Augue:
    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.

    So an unsigned number is neither positive nor negative? TRWTF!

  • John (unregistered) in reply to JimM

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

  • faoileag (unregistered) in reply to ANON
    ANON:
    faoileag:
    ANON:
    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.
    The "t" stands for "typo".
    Why does it compile than?
    Why not? I don't know the language the snippet provided is coded in, but for all I know they might extract the last digit of a number as a string and compare that to a string. And why should something like
    my $last_digit = "2";
    if ($last_digit eq "2t") {
    ...
    
    break the compile?
  • Andrea (unregistered)

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

    1. 0
    2. O
    3. o
    4. Russian O (similar to latin)
    5. Russian o (also similar to latin)

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

  • Euripides (unregistered)

    NewSoft Associates (NSA), Intelligence Business - is Alicias real name Edward, living currently in Russia?

  • ANON (unregistered) in reply to faoileag
    faoileag:
    Why not? I don't know the language the snippet provided is coded in, but for all I know they might extract the last digit of a number as a string and compare that to a string. And why should something like
    my $last_digit = "2";
    if ($last_digit eq "2t") {
    ...
    
    break the compile?

    This would mean that you don't need quotation marks for string literals in the code. Such a language would be a WTF indeed.

  • Kevin (unregistered) in reply to Anonymous Coward

    I was thinking the same thing. Monkeys have the advantage of 4 opposable phalanges. The should be able to code twice as fast, no?

  • Sal Undy (unregistered) in reply to faoileag
    faoileag:
    Sal Undy:
    Not to mention the fact that the odds of every negative number ending in 6 are pretty long.
    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.

    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.

  • faoileag (unregistered) in reply to ANON
    ANON:
    This would mean that you don't need quotation marks for string literals in the code. Such a language would be a WTF indeed.
    Ok, having googled the EVALUATE ... END-EVALUATE syntax, I know this is (IBM) COBOL. Without digging too deep into the documentation, it could be that the compiler treats 2t as an "identifier" (or variable). But I don't want to rule out that I'm wrong and that you are right in that it shouldn't compile.

    Be that as it may, right now I'm happy that I'm not coding in COBOL :-)

  • Sal Undy (unregistered) in reply to Sal Undy

    Meh, everyone else covered it all. That's what I get for closing a tab for a half hour.

  • (cs) in reply to faoileag
    faoileag:
    ANON:
    This would mean that you don't need quotation marks for string literals in the code. Such a language would be a WTF indeed.
    Ok, having googled the EVALUATE ... END-EVALUATE syntax, I know this is (IBM) COBOL. Without digging too deep into the documentation, it could be that the compiler treats 2t as an "identifier" (or variable). But I don't want to rule out that I'm wrong and that you are right in that it shouldn't compile.

    Be that as it may, right now I'm happy that I'm not coding in COBOL :-)

    My reading of the docs is that an identifier can indeed begin with a digit, or with a letter. More fully:

    An identifier is a series of letters, digits, and hyphens with the following restrictions:

    • Has at least one letter
    • Does not begin with hyphen
    • Does not end with hyphen
    • Is not a COBOL reserved word
    • Is at most 30 characters

    So, by this definition, 2t is indeed an identifier.

    But -2t is not.

    But 2-t IS an identifier.

  • (cs)

    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.

  • (cs) in reply to faoileag
    faoileag:
    Seems as if negative numbers were indeed a rare specimen in those datasets.

    Bad luck, of course, if there is only one negative number in the dataset and that number even ends in a 6!

    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? ;)

  • EvilSnack (unregistered)

    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.

  • anonymous (unregistered) in reply to Mainframer
    Mainframer:
    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.

    Want to be "clever"? Why not use base 36 or something?

  • Shawn H Corey (unregistered)

    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

  • Former SQR developer (unregistered)

    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.

  • Will W. (unregistered)

    This used to be really, really common. See http://en.wikipedia.org/wiki/Signed_overpunch

  • Valued Service (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    Original Article:
    monkeys who were annoyed at their lack of an opposable thumb
    Awwww... now I feel really sorry for the monkeys in this story - did they lose their thumbs in an industrial accident or something?

    Poor monkeys!

    Yeah, they also have opposable toes. Which gives them an advantage over us.

  • ReyRey (unregistered) in reply to EvilSnack
    EvilSnack:
    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.

    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.

    • ReyRey
  • Inigo Montoya (unregistered)
    Disparate data sources using different working definitions of the same word (Inigo Montoya would have a field day).

    My name Inigo Montoya, you changed the working definition of this word. Prepare to die.

  • (cs) in reply to Will W.
    Will W.:
    This used to be really, really common. See http://en.wikipedia.org/wiki/Signed_overpunch
    On mainframe systems, with non-hierarchical filesystems...
  • anonymous (unregistered) in reply to Mainframer
    Mainframer:
    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.

    EBCDIC FTW!

    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

  • (cs)

    I liked this system. we can call it Plain ingenous simple system.

  • Oh THAT Brian (unregistered) in reply to Mainframer

    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.

  • (cs) in reply to Nagesh
    Nagesh:
    I liked this system. we can call it Plain ingenous simple system.

    Plain Ingenious Simple System Optimized For Faxing

Leave a comment on “'O'-Convertible”

Log In or post as a guest

Replying to comment #:

« Return to Article