• Numeromancer (unregistered) in reply to Manni
    Manni:
    Anonymous:

    Funny enough, your Social Security Number is not a number either, and neither is my Social Insurance Number.

    Have an unnecessarily literal day, folks

    Actually yes, my SSN is a number. The hyphens are separators. You can take out the hyphens and still have a valid SSN. The same is true for phone numbers. (123) 456-7890 is the same as 1234567890 (I can't seem to find the dash button on my phone).

    The difference is that if you take out the separators, you still have the original value, and voila it's a valid number. If you try taking out the non-numeric values from "A3D-TRC", you clearly will lose almost all valid data.

    Which non-numeric values?  'A' is 65, 'D' is 68, even '-' is a number.  If it's ASCII, it's base 128, if latin1, base 256, and if Unicode, uh, base 2^21 or something like that.

    Manni:

    Speaking of taking things literally...

    "I wanna see a forklift lift a crate of forks...it would be so damn literal for me!" -Mitch Hedberg



    Requiescat in pace, Mitch Hedberg.

    A superfluous beach is an unnecessary littoral.

    This message has been brought to you by the letter '5' and the number C.
  • Numeromancer (unregistered)
    johnl:

    So what happens when the user types his number...?


    He gets a busy signal (because he's on the phone!)
  • (cs) in reply to Numeromancer
  • (cs) in reply to Numeromancer
    Anonymous:
    Manni:
    Anonymous:

    Funny enough, your Social Security Number is not a number either, and neither is my Social Insurance Number.

    Have an unnecessarily literal day, folks

    Actually yes, my SSN is a number. The hyphens are separators. You can take out the hyphens and still have a valid SSN. The same is true for phone numbers. (123) 456-7890 is the same as 1234567890 (I can't seem to find the dash button on my phone).

    The difference is that if you take out the separators, you still have the original value, and voila it's a valid number. If you try taking out the non-numeric values from "A3D-TRC", you clearly will lose almost all valid data.

    Which non-numeric values?  'A' is 65, 'D' is 68, even '-' is a number.  If it's ASCII, it's base 128, if latin1, base 256, and if Unicode, uh, base 2^21 or something like that.



    '-' is not a number you idiot. Congrats on knowing what ASCII is but in your quest to show your great knowledge of ASCII, you lost sight of what you were saying.

    If '-' is a number, how about I write a check to you for - dollars. P is a letter. There is a numeric code for it that is how A is stored but that is quite different than P being a number.

    Go back to the woodshed and wait. Your stupidity is running rampant.
  • (cs) in reply to Richard Nixon
    Richard Nixon:
    Anonymous:
    Manni:
    Anonymous:

    Funny enough, your Social Security Number is not a number either, and neither is my Social Insurance Number.

    Have an unnecessarily literal day, folks

    Actually yes, my SSN is a number. The hyphens are separators. You can take out the hyphens and still have a valid SSN. The same is true for phone numbers. (123) 456-7890 is the same as 1234567890 (I can't seem to find the dash button on my phone).

    The difference is that if you take out the separators, you still have the original value, and voila it's a valid number. If you try taking out the non-numeric values from "A3D-TRC", you clearly will lose almost all valid data.

    Which non-numeric values?  'A' is 65, 'D' is 68, even '-' is a number.  If it's ASCII, it's base 128, if latin1, base 256, and if Unicode, uh, base 2^21 or something like that.



    '-' is not a number you idiot. Congrats on knowing what ASCII is but in your quest to show your great knowledge of ASCII, you lost sight of what you were saying.

    If '-' is a number, how about I write a check to you for - dollars. P is a letter. There is a numeric code for it that is how A is stored but that is quite different than P being a number.

    Go back to the woodshed and wait. Your stupidity is running rampant.

    I am a human. (021)260-6781 is a phone number. My natural trait of cognition allows me to realise that I should ignore the brackets and the dash when dialling.

    It also allows me to realise that while (021)260-6781 is actually a sequence of numbers and non-numeric characters, referring it to as a "phone sequence of numbers and non-numeric characters" makes me sound like an ass who can only think in binary.

    And, when I refer to it as a phone number, and speak it aloud, I do not tell my friends that my phone number is Left Ellipisis, Oh Two One, Right Ellipsis, because I realise that for a human, the non-numeric character merely aid memorisation and comprehension of a sequence of numbers by introducing logical breaks.

    And I sincerely hope I never get into a conversation with anyone pedantic as a certain poster at any parties I attend.

  • Steve (unregistered)

    Oh my god. Is that CLARION code? TPS - the Topspeed file format. Oh god, how I remember that. Now I've got to go somewhere and scrub my brain.

  • Chris (unregistered) in reply to Ytram

    " Someone mentioned earlier in this thread a good general rule:  If you are not performing any mathematical operations on the "number", then you should probably store it as a string.  There is no case where you would be performing math on SSNs and phone numbers(except perhaps comparison).  "

    This is a good general rule that I live by.  The only good exception is if storage space is a concern and you are confident the value will never become alphanumeric in the future.

    SSN:
    Char:  11 bytes - unsigned integer: 4 bytes

    Phone number:
    Char 12 bytes - unsigned integer: 4 bytes

    In todays world, storage is not much of a concern so really there  is not much of a reason in most cases to follow that rule.

  • (cs) in reply to Cyresse
    Cyresse:
    And, when I refer to it as a phone number, and speak it aloud, I do not tell my friends that my phone number is Left Ellipisis, Oh Two One, Right Ellipsis, because I realise that for a human, the non-numeric character merely aid memorisation and comprehension of a sequence of numbers by introducing logical breaks.


    And I sincerely hope I never get into a conversation with anyone pedantic as a certain poster at any parties I attend.



    Well of course you wouldn't say "left ellipisis" (sic) since there's not an ellipsis in a phone number. Here's some help chief: http://dictionary.reference.com/search?r=2&q=ellipsis

  • 15615 (unregistered) in reply to brazzy
    brazzy:
    OneFactor:
    This way my major beef with the Java version which used the private constructor and the static instances to restrict - some joker could pass my method a null instead.


    That "typesafe enum pattern" was what Java programmers were advised to use before Java got real enums with 1.5 - but everyone used plain ints instead since that was done all over the standard API too, and the typesafe enums required a LOT of work to get right if you wanted to have them serializable.

    But concerning you complaint, that's not "fixed" with the real enums, and I actually think it's not really valid. When you deal with objects in Java, a null value is ALWAYS possible, there's no way around it other than making enums a primitive type, which would require major changes to the VM.

    At least it's only a single "unexpected" value you have to test for...

Leave a comment on “Enumerating The Possibilities”

Log In or post as a guest

Replying to comment #:

« Return to Article