Varchar(30) ought to be enough for anybody


  • ♿ (Parody)

    @The_Assimilator said:

    @boomzilla said:
    @The_Assimilator said:
    This key is a GUID, which for everyone's reference is 36 characters in length.

    TRWTF is storing the dashes as part of your key.

    Either you fail at trolling or at basic math.

    Or, you are TRWTF.

    GUIDs are usually stored as 128-bit values, and are commonly displayed as 32 hexadecimal digits with groups separated by hyphens, such as {21EC2020-3AEA-1069-A2DD-08002B30309D}

    What sort of basic math are you using? Because when I divide 128 by 8, I get 16, which can be represented as a hexadecimal number using 32 characters.


  • Discourse touched me in a no-no place

    @boomzilla said:

    @The_Assimilator said:
    @boomzilla said:
    @The_Assimilator said:
    This key is a GUID, which for everyone's reference is 36 characters in length.

    TRWTF is storing the dashes as part of your key.

    Either you fail at trolling or at basic math.

    Or, you are TRWTF.

    GUIDs are usually stored as 128-bit values, and are commonly displayed as 32 hexadecimal digits with groups separated by hyphens, such as {21EC2020-3AEA-1069-A2DD-08002B30309D}

    What sort of basic math are you using? Because when I divide 128 by 8, I get 16, which can be represented as a hexadecimal number using 32 characters.

    .. .which appears to be greater than 30 so still won't fit. Or am I missing something here?


  • ♿ (Parody)

    @PJH said:

    @boomzilla said:
    @The_Assimilator said:
    @boomzilla said:
    @The_Assimilator said:
    This key is a GUID, which for everyone's reference is 36 characters in length.

    TRWTF is storing the dashes as part of your key.

    Either you fail at trolling or at basic math.

    Or, you are TRWTF.

    GUIDs are usually stored as 128-bit values, and are commonly displayed as 32 hexadecimal digits with groups separated by hyphens, such as {21EC2020-3AEA-1069-A2DD-08002B30309D}

    What sort of basic math are you using? Because when I divide 128 by 8, I get 16, which can be represented as a hexadecimal number using 32 characters.

    .. .which appears to be greater than 30 so still won't fit. Or am I missing something here?

    Yes, it obviously still won't fit. I was just amused that they store extra characters (we know this because 36 > 32). Maybe it was just a typo, and the OP couldn't see it because he wrote it. Or maybe they store their GUIDs in some new and interesting way. If that's true, it should be a nice WTF all by itself.



  • I can't believe it took until the second page for someone to point out that it's only a 128-bit value. I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars. (Any base higher than 19 will work, although base64 has the advantage of being well-known and already implemented by many libraries).



  • @The_Assimilator said:

    @Qwerty said:
    But how does the application know that the field is 30 chars? If you changed the database to varchar(30000) would the application code see the difference? I know you could write an app that looks at the column definitions but then it would be using that information in its max-length check.

    Welcome to Delphi 3, where field lengths are stored as part of the columnset definition, and hence changing the field lengths in the returned data causes the application to break. Badly. Horribly.

    No it doesn't.  You just change the columset definition to match the new data and you're done.  Long strings had been introduced by Delphi 3, so if this change affects anything at all beyond the data access layer, the problem isn't the language; it's that it was written by someone who didn't know what they were doing.  Bad coders can write crap in any language.

    Oh, and my favourite part of developing in Delphi: the mother. fucking. BDE. Good luck profiling SQL statements with that POS.

    Yeah, the BDE is a mess and a half, because it dates back to before SQL and relational databases were mainstream.  But given the fact that it's been deprecated for well over a decade now, and given the plethora of drop-in BDE replacements available that allow for trivial migration to modern SQL systems, TRWTF is you if you're still using it.

     



  • @pjt33 said:

    I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars.

    You can't believe? You must be new here..



  • @morbiuswilters said:

    @pjt33 said:
    I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars.

    You can't believe? You must be new here..

    I'm surprised the last post in this topic is still about characters, and even more surprised that it's about thirty of them.



  • @Ben L. said:

    I'm surprised the last post in this topic is still about characters, and even more surprised that it's about thirty of them.

    It's like a Russian novel!



  • @Ben L. said:

    @morbiuswilters said:
    @pjt33 said:
    I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars.

    You can't believe? You must be new here..

    I'm surprised the last post in this topic is still about characters, and even more surprised that it's about thirty of them.

    Are we starting a pool on what this thread devolves into?  I'm thinking "the merits and drawbacks of how fucking awesome America is" or some shit.



  • @drurowin said:

    "the merits and drawbacks of how fucking awesome America is"

    Merits: SO MANY I CANNOT LIST

    Drawbacks: Listening to whiny, pathetic Yuropeans whine. The everlasting stain of shame that is the Obamas.



  • @morbiuswilters said:

    @drurowin said:
    "the merits and drawbacks of how fucking awesome America is"

    Merits: MURKAH

    Drawbacks: There are other, significantly less cool countries

    FTFY



  • @morbiuswilters said:

    @pjt33 said:
    I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars.

    You can't believe? You must be new here..


    Normally people are racing to propose workarounds even though the OP didn't ask for them.



  • @boomzilla said:

    @PJH said:
    @boomzilla said:
    @The_Assimilator said:
    @boomzilla said:
    @The_Assimilator said:
    This key is a GUID, which for everyone's reference is 36 characters in length.

    TRWTF is storing the dashes as part of your key.

    Either you fail at trolling or at basic math.

    Or, you are TRWTF.

    GUIDs are usually stored as 128-bit values, and are commonly displayed as 32 hexadecimal digits with groups separated by hyphens, such as {21EC2020-3AEA-1069-A2DD-08002B30309D}

    What sort of basic math are you using? Because when I divide 128 by 8, I get 16, which can be represented as a hexadecimal number using 32 characters.

    .. .which appears to be greater than 30 so still won't fit. Or am I missing something here?

    Yes, it obviously still won't fit. I was just amused that they store extra characters (we know this because 36 > 32). Maybe it was just a typo, and the OP couldn't see it because he wrote it. Or maybe they store their GUIDs in some new and interesting way. If that's true, it should be a nice WTF all by itself.

    I'm sorry, here's the corrected version:

    "This key is a GUID, which for everyone's reference is 36 characters in length (32 if you exclude the dashes, which is still longer than 30 and hence irrelevant to the story unless you are a moron like boomzilla)."

    @pjt33 said:

    I can't believe it took until the second page for someone to point out that it's only a 128-bit value. I can't believe that still no-one has pointed out that by not using hex-encoding in ASCII it can fit in 30 chars. (Any base higher than 19 will work, although base64 has the advantage of being well-known and already implemented by many libraries).

    I know full well that base64 can fit that into 22 chars, or base95 into 20 chars. As was already pointed out, I'm not looking for a solution. (Although it amuses me that the math major who was also working on this code didn't think about encoding it to a different base, while me who barely passed high school maths thought that as soon as I realised the column length limit.)

    @Mason Wheeler said:

    @The_Assimilator said:

    @Qwerty said:
    But how does the application know that the field is 30 chars? If you changed the database to varchar(30000) would the application code see the difference? I know you could write an app that looks at the column definitions but then it would be using that information in its max-length check.

    Welcome to Delphi 3, where field lengths are stored as part of the columnset definition, and hence changing the field lengths in the returned data causes the application to break. Badly. Horribly.

    No it doesn't.  You just change the columset definition to match the new data and you're done.  Long strings had been introduced by Delphi 3, so if this change affects anything at all beyond the data access layer, the problem isn't the language; it's that it was written by someone who didn't know what they were doing.  Bad coders can write crap in any language.

    Oh, and my favourite part of developing in Delphi: the mother. fucking. BDE. Good luck profiling SQL statements with that POS.

    Yeah, the BDE is a mess and a half, because it dates back to before SQL and relational databases were mainstream.  But given the fact that it's been deprecated for well over a decade now, and given the plethora of drop-in BDE replacements available that allow for trivial migration to modern SQL systems, TRWTF is you if you're still using it.

     

    You're right that it's not a Delphi issue; FlagshipApplication uses a home-grown validation system that somehow depends on correct field lengths. "that it was written by someone who didn't know what they were doing" is about right.

    As for the BDE... deprecated you say? Our boyos are still installing it on 64-bit systems. Why bother to find a simpler, better solution when you can use a half-assed workaround?


  • ♿ (Parody)

    @The_Assimilator said:

    "This key is a GUID, which for everyone's reference is 36 characters in length (32 if you exclude the dashes, which is still longer than 30 and hence irrelevant to the story unless you are a moron like boomzilla)."

    Sheesh, you try to enjoy the finer points of a WTF, and somehow you're the bad guy. In a place like the sidebar, how could a minor WTF like this ever be irrelevant? I can't understand why you'd have this angry, defensive response. Was it your choice to have the dashes in there or something? It just doesn't make sense why you'd be so happy to throw your coworkers under the bus for everything else but not this.

    Alternatively, you have blakeyrat disease, which is a form of OCD where you can't stand anyone deviating from your train of thought. Come to think of it, you post a lot of angry stuff, so this is probably it. Here, I binged some pony images for you.



  • @boomzilla said:

    binged
     

    I totally read "bindzj'd".


Log in to reply