In the beginning...



  • So we were talking about a poem that basically paraphrased the Christian story of creation in English class today, when my English teacher asked, 'So if God separated the light and the dark, what was there before?'

    The answer, of course (though I didn't say it out loud), is FILENOTFOUND.
     



  • /dev/null

    :D



  • It's said that there is a hotel in Boston in which the conference rooms are named after Massachusetts counties, so when you walk down the hall you see three doors:  "Men", "Women", "Middlesex".

    So I'd say go to the light switch and hold it halfway between the "light" and "dark" positions.

    The best line ever from "All in the Family":  Archie has ruined the laundry by washing everything together.  Now all the white shirts are pink and green.  Meathead says, "I can't believe Archie Bunker didn't separate the whites from the coloreds!"

    I'd better stop typing before I try to come up with something about positive zero and negative zero.



  • @newfweiler said:

    I'd better stop typing before I try to come up with something about positive zero and negative zero.

    Speaking of going into the dark past (of the computing industry at least).... a few years ago I had to write a small integration package to keep an insurance company mainframe synced up with data coming out of a modern (albiet horrible) Oracle db.

    The mainframe, of course, spoke EBCDIC, which is a different encoding for characters than ASCII.  In ascii, the numeric value for the numbers 0-9 are 0x30-0x39.  In EBCDIC, it's 0xF0-0xF9...or at least it is supposed to be.   Instead, this system used 0xC0-0xC9 (the letters A-I) if the number was positive (C for Credit); and, you guessed it, 0xD0-0xD9 (J-R) for negative numbers (D for Debit).  So:  123 = "BCD" (0xC1 0xC2 0xC3) and -123 = "KLM" (0xD1 0xD2 0xD3).   This, of course, led directly to the question, "is zero positive or negative?" 

    For the record, it was positive.

    -cw



  • @CodeWhisperer said:

    The mainframe, of course, spoke EBCDIC, which is a different encoding for characters than ASCII.  In ascii, the numeric value for the numbers 0-9 are 0x30-0x39.  In EBCDIC, it's 0xF0-0xF9...or at least it is supposed to be.   Instead, this system used 0xC0-0xC9 (the letters A-I) if the number was positive (C for Credit); and, you guessed it, 0xD0-0xD9 (J-R) for negative numbers (D for Debit).  So:  123 = "BCD" (0xC1 0xC2 0xC3) and -123 = "KLM" (0xD1 0xD2 0xD3).   This, of course, led directly to the question, "is zero positive or negative?" 

    -cw

    That's awesome, you can have half negative numbers like that: "BLC" (+1-2+3?, or 83?) or "KCD" (-1+2+3? or -77?)

    (Oh, and everybody knows that god created the binary "0" and "1" first. Ofcourse to piss of hardware engineers he also created Metastability after that http://en.wikipedia.org/wiki/Metastability_in_electronics )



  • Is true and false not an abstraction?



  • @Ice^^Heat said:

    Is true and false not an abstraction?

     

    FILE_NOT_FOUND



  • if(null)

    {

      doNothing();

    }



  • @Daid said:

    That's awesome, you can have half negative numbers like that: "BLC" (+1-2+3?, or 83?) or "KCD" (-1+2+3? or -77?)

    I asked them about that, they just sort of gave me a blank look.  (Well, it was all over the phone, so more of a blank sound).  As WTFish as that was, the real WTF was that their specification didn't mention this at all.  It was all fixed length fields, and the structure was documented, but it didn't mention that it was EBCDIC, it didn't mention that they then violated the ebcdic rules for numbers, it didn't mention whether zero was positive or negative, etc. 

    Each of those had to be worked out in trial-and-error fashion as we sent nightly tests back and forth. 

    Don't miss that job one bit.

    -cw



  • @CodeWhisperer said:

    Speaking of going into the dark past (of the computing industry at least).... a few years ago I had to write a small integration package to keep an insurance company mainframe synced up with data coming out of a modern (albiet horrible) Oracle db.

    The mainframe, of course, spoke EBCDIC, which is a different encoding for characters than ASCII.  In ascii, the numeric value for the numbers 0-9 are 0x30-0x39.  In EBCDIC, it's 0xF0-0xF9...or at least it is supposed to be.   Instead, this system used 0xC0-0xC9 (the letters A-I) if the number was positive (C for Credit); and, you guessed it, 0xD0-0xD9 (J-R) for negative numbers (D for Debit).  So:  123 = "BCD" (0xC1 0xC2 0xC3) and -123 = "KLM" (0xD1 0xD2 0xD3).   This, of course, led directly to the question, "is zero positive or negative?" 

    For the record, it was positive.

    -cw

    No, this is absolutely normal behavior for EBCDIC.  Take a look at a punch card.  Each digit is a single punch in rows 0 through 9.  The last column of the number can have an overpunch in row 11 (for a negative number) or row 12 (for a positive number).  (You'll note that a single punch in row 11 is '-' and a single punch in row 12 is '&' (because the IBM 026 keypunch didn't have a plus sign).)  But 12 + 1 = 'A', 12 + 2 = 'B', etc., and 11 +  1 = "J", 11 + 2 = "K", etc.

    So if you've got your IBM 409 accounting machine wired up to your IBM 514 reproducing punch and you have it punch the total on a card, if the answer were -123 then the first column would have 1 punched out, the second would have 2 punched out, and the third would have 3 and 11 punched out (11 to indicate a negative number).  If you interpreted this card on the 409, it would appear as "12L".  +123 would appear as "12C" and unsigned 123 would be "123".  So you can have three zeros: positive zero, negative zero and FILENOTFOUND, I mean unsigned zero.

    This was the way things were before IBM started building computers.  IBM adapted the punch card equipment as input-output devices for the computers, so the BCD and EBCDIC character sets were designed around the punched card code.  0xC1 through 0xC9 became "A" through "I", 0xD1 through 0xD9 became "J" through "R", and 0xE2 through 0xE9 became "S" through "Z".

    Arithmetic on the business-oriented computers (702, 1401, 360 etc.) was also made compatible with punched cards.  Unpacked decimal for -123 was 0xF1F2D3, which punches or prints as "12L".  The arithmetic operations would only work on packed decimal operands, so you had to pack the data into four bits for each digit plus four bits for the sign:  0xC for positive, 0xD for negative and 0xF for unsigned.  Thus -123 became 0x123D.

    COBOL was designed based on several different machines, including IBM's machines, so that COBOL language elements generally map to the hardware.  Here are 123, +123 and -123 in different COBOL formats:

      77  PAULA PICTURE 999 USAGE COMPUTATIONAL-3.    0x123F

      77  PAULA PICTURE S999 USAGE COMPUTATIONAL-3   0x123C,  0x123D

      77  PAULA PICTURE 999 USAGE DISPLAY.  0xF1F2F3  or "123".

      77  PAULA PICTURE S999 USAGE DISPLAY.  0xF1F2C3 or "12C", 0xF1F2D3" or "12L".

      77 PAULA PICTURE S999 USAGE DISPLAY  SIGN IS SEPARATE LEADING. 0x4EF1F2F3 or "+123", 0x60F1F2F3 or "-123".

      77 PAULA PICTURE S999 USAGE DISPLAY SIGN IS SEPARATE TRAILING.  0xF1F2F34E or "123+", 0xF1F2F360 or "123-".

    See, it makes perfect sense.

     

     



  • @newfweiler said:

    See, it makes perfect sense.

    Brillant!

    Did I mention that I don't miss that job? :)  Interesting that was more standard than I assumed; finding an EBCDIC char map didn't really prepare me for that.

    -cw


Log in to reply