Color Me Stupid

« Return to Article
  • mike5 2013-01-08 08:09
    param = "";
    if(comment.count == Comments.FRIST) {
    param = "&1st&";
    }

    if(param == "&1st&") {
    return Comments.FRIST;
    }
  • Leo 2013-01-08 08:19
    All this deserves is a flat "what.", but I can't just put that in a comment because Akismet doesn't like it.
  • Warren 2013-01-08 08:26
    This might seem over-engineered but how else could you implement an "error" case of white at one stage and purple at another....
  • ZPedro 2013-01-08 08:30
    Well, so much for trying to understand the "logic" behind the "color string"…

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.
  • Umm 2013-01-08 08:31
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...
  • Joe 2013-01-08 08:34
    OMG snoofle???

    {bows respectfully}

    OK guys enough of that. Time to start ripping him apart.
  • dkf 2013-01-08 08:36
    Umm:
    This was written in the early nineties but the code is in SVN???
    Doesn't mean that the code was originally committed to SVN, just that someone has committed it since. (It could have been originally in CVS or RCS or even — $DEITY help us — SCCS; there are tools for migrating.)
  • eVil 2013-01-08 08:36
    The thought of that code just made me turn #1AC898
  • QJo 2013-01-08 08:44
    Call me Mister Slowcoach, but is it not the case that 65535 and FFFF return different colours? I'm also a little confused at the -2147483633 and &H80000005 and &H8000000F ...
  • Arnold Judas Rimmer 2013-01-08 08:44
    eVil:
    The thought of that code just made me turn #1AC898


    What, purple?
  • lscharen 2013-01-08 08:48
    ZPedro:

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.


    Considering that I spend more time searching the Side Bar for snoofle stories than reading the Feature Articles, I'd say the debut was long overdue.
  • Zach 2013-01-08 08:52
    Did I miss something or is the color just in BGR format with leading zeroes? So "FF" is parsed as hex 0x000000FF and so is (1,0,0) in the 0..1 RGB color space. "FF00" is 0x0000FF00 and so is (0,1,0): green (or "lime"). Orange then seems to be high red, medium-high green, and high blue, which makes sense.

    Admittedly, there are still a few WTFs in there. The dark vs. light grey values seem to have been reversed. It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency (which we're going to quietly call grey 'cause argh).

    Then again: if this is how the color management works, I can't wait to see the widget layout system.
  • Zach 2013-01-08 08:59
    (I meant to say that orange includes a medium blue component. Whoops.)
  • Ben Jammin 2013-01-08 09:04
    Zach:
    Did I miss something or is the color just in BGR format with leading zeroes? So "FF" is parsed as hex 0x000000FF and so is (1,0,0) in the 0..1 RGB color space. "FF00" is 0x0000FF00 and so is (0,1,0): green (or "lime"). Orange then seems to be high red, medium-high green, and high blue, which makes sense.

    Admittedly, there are still a few WTFs in there. The dark vs. light grey values seem to have been reversed. It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency (which we're going to quietly call grey 'cause argh).

    Then again: if this is how the color management works, I can't wait to see the widget layout system.

    I believe what you missed is that the colors are serializable, and don't really need to be strings.
  • epv 2013-01-08 09:04
    I'll give you a hint. Those values aren't hex or ints.
  • eVil 2013-01-08 09:07
    Arnold Judas Rimmer:
    eVil:
    The thought of that code just made me turn #1AC898


    What, purple?


    Under either RGB or BGR that doesn't look even slightly purple.

    Do you operate in RBG or BRG?
  • Ben Jammin 2013-01-08 09:08
    I like that the thin client code is VB while the server is C#. I don't know the reason behind it. Maybe the company switched to C# and the thin client survived in VB, or maybe they use the different languages to really let the programmers know which side they are coding for. Either way, I still find it amusing.
  • Damien 2013-01-08 09:15
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?
  • Anketam 2013-01-08 09:17
    lscharen:
    ZPedro:

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.


    Considering that I spend more time searching the Side Bar for snoofle stories than reading the Feature Articles, I'd say the debut was long overdue.
    Aye. I am surprised that some of his more recent stories have not been posted as "The Best of the Side Bar".
  • dgvid 2013-01-08 09:24
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...

    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?

    If it were the 1890s would one use a Difference Engine to see what was modified on that last commit?
  • Remy Porter 2013-01-08 09:28
    Well, how can people just assume that? I mean, why don't they just get off their lazy butts and say "1990s"? I mean, I don't know shinola about the stupid 1990's. Dumb stupid era

    What is wrong with people? How can they be so sloppy? I mean, why don't we just throw out the damn, stupid calendar If no one's going to use it? I mean geez, a bunch of ninies and feebs. Morons, morons, all of you, man!

    //How can I let that comment pass without a MST3K reference?
  • jonkenson 2013-01-08 09:29
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?



    I'm interested in this answer as well
  • snoofle 2013-01-08 09:29
    Anketam:
    lscharen:
    ZPedro:

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.


    Considering that I spend more time searching the Side Bar for snoofle stories than reading the Feature Articles, I'd say the debut was long overdue.
    Aye. I am surprised that some of his more recent stories have not been posted as "The Best of the Side Bar".

    ...coming soon ;)
  • Anketam 2013-01-08 09:47
    snoofle:
    Anketam:
    lscharen:
    ZPedro:

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.
    Considering that I spend more time searching the Side Bar for snoofle stories than reading the Feature Articles, I'd say the debut was long overdue.
    Aye. I am surprised that some of his more recent stories have not been posted as "The Best of the Side Bar".
    ...coming soon ;)
    w00t!
  • Overly Attentive Gizzard 2013-01-08 10:13
    "The fuck?" is all I could muster at this one.

    Maybe at some point it did translate to a proper color and that was factored out when a stupid intern tried to "fix" something he didn't understand?
  • RichP 2013-01-08 10:26
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?


    Groan. Here we go again... It's exactly that kind of thinking that created the Y2K mess. Please think of the poor slobs wasting time by trolling dailyWTF archives in 2099 and fully qualify your dates, people!
  • Maltz 2013-01-08 10:28
    Overly Attentive Gizzard:
    "The fuck?" is all I could muster at this one.

    Maybe at some point it did translate to a proper color and that was factored out when a stupid intern tried to "fix" something he didn't understand?


    This.

    If this was written in the early 90's, the clients probably couldn't even display more than 256 colors, and maybe less depending on how new the hardware was at the time. It's hard to imagine the original program used 24bit values for color.
  • Maltz 2013-01-08 10:31
    Arnold Judas Rimmer:
    eVil:
    The thought of that code just made me turn #1AC898


    What, purple?


    Leave Mr. Gloop alone. Even on a good day, he's #A2C8BF
  • operagost 2013-01-08 10:38
    Ben Jammin:
    I like that the thin client code is VB while the server is C#. I don't know the reason behind it. Maybe the company switched to C# and the thin client survived in VB, or maybe they use the different languages to really let the programmers know which side they are coding for. Either way, I still find it amusing.
    Your answer is in the first paragraph.
  • pezpunk 2013-01-08 10:41
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
  • ronpaii 2013-01-08 10:59
    I don't see a WTF; I see evolution of the client code.

    Considering that Industrial devices without a file system in the 1990s, followed some strange standards. Looking back you may find that the codes directly set both color and some other attribute, like blink. There may even be another function that takes the color codes and sets this attribute. If the original developer discovered the color object and fixed the code on the devices; it would require all the deployed server code to be updated to eliminate the color codes.
  • Umm 2013-01-08 11:00
    RichP:
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?


    Groan. Here we go again... It's exactly that kind of thinking that created the Y2K mess. Please think of the poor slobs wasting time by trolling dailyWTF archives in 2099 and fully qualify your dates, people!
    Exactly. Those of us who were not in diapers or nursery school in the nineteen-nineties learned through prolonged torture to be precise with dates. (Searching old musty code for Y2K errors is slightly less fun than self-applying a full body tattoo with a dull fountain pen. Also, it takes longer, is more error-prone, and causes greater pain when things go wrong.)

    And for those poor slobs in 2099, we probably ought to specify Earth calendar, unadjusted for relativistic effects, just to be sure.
  • guest 2013-01-08 11:05
    It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency

    It could well be that the upper 0x80 is an indication that its a system-defined color (as opposed to an RGB one), and the 0x00000F the index (IIRC VisualBasic did it that way). If so its the value for COLOR_BTNFACE (which is a gray shade) as used with (for example) GetSysColor (in User32.DLL).

    In that case the translation makes sort of sense, as the values are not colors, and need to be converted.
  • HowItWorks 2013-01-08 11:21
    Ben Jammin:
    I like that the thin client code is VB while the server is C#.
    Being from "the early nineties" most likely VB3 or VB4, definitely before VB.Net.

    Is part of the WTF that they continue to use '"Industrial" handheld devices' for the client that are now* approximately 20 years** old?
    * 8 January, 2023 Gregorian calander, 1615 UTC, for those who want precise
    ** outer rim Milky Way, Solar System, Earth standard years
  • Dan 2013-01-08 11:26
    HowItWorks:
    * 8 January, 2023 Gregorian calander, 1615 UTC, for those who want precise
    You did that on purpose, right?

    The One True Date Format for today is 2013-01-08.
  • Alfred 2013-01-08 11:37
    Umm:
    Those of us who were not in diapers or nursery school in the nineteen-nineties learned through prolonged torture to be precise with dates.
    Those of us who were in diapers in the eighteen-nineties have always kno...

    Nurse!

    Have you seen my cane?
  • Mark 2013-01-08 11:40
    Case "65535"
    Return Color.Orange 'bright yellow

    "Ah, now I get it".
  • HowItWorks 2013-01-08 11:41
    Dan:
    HowItWorks:
    * 8 January, 2023 Gregorian calander, 1615 UTC, for those who want precise
    You did that on purpose, right?
    No, but it's more fun that I did.

    The One True Date Format for today is 2013-01-08.
    Additional trivia, it's known the Gregorian monk trying to calculate the birth of Jesus for his calander made an error of at least 5 years. Plus he started at year 1 rather than 0 because the concept of zero was not understood. Only emphasizing that dates and times systems are arbitrary human constructs.
  • Zylon 2013-01-08 11:45
    Umm:
    Exactly. Those of us who were not in diapers or nursery school in the nineteen-nineties learned through prolonged torture to be precise with dates.

    You are dumb. Anyone reading this 80 years or more from now would see the date stamps and automatically know that of course we're not discussing a WTF that occurred in the future, or predating the existence of digital computers. Dummy.
  • Jack 2013-01-08 11:51
    HowItWorks:
    The Gregorian monk trying to calculate the birth of Jesus for his calander made an error of at least 5 years. Plus he started at year 1 rather than 0 because the concept of zero was not understood. Only emphasizing that dates and times systems are arbitrary human constructs.
    Yet more proof that we really need to convert over to counting Planck-times since the Big Bang, and none of this local-planetary-orbits-since-a-mythological-event nonsense.
  • lmm 2013-01-08 11:59
    Jack:
    HowItWorks:
    The Gregorian monk trying to calculate the birth of Jesus for his calander made an error of at least 5 years. Plus he started at year 1 rather than 0 because the concept of zero was not understood. Only emphasizing that dates and times systems are arbitrary human constructs.
    Yet more proof that we really need to convert over to counting Planck-times since the Big Bang, and none of this local-planetary-orbits-since-a-mythological-event nonsense.


    Seconds are well-defined (caesium-133 hyperfine transitions IIRC), so really one just needs to count the number of seconds since the beginning of time (1970-01-01 01:00:00 British Standard Time).

    Sadly POSIX gets this almost-but-not-quite correct; it screws up royally wrt leap seconds.
  • F 2013-01-08 12:01
    HowItWorks:
    Dan:
    HowItWorks:
    * 8 January, 2023 Gregorian calander, 1615 UTC, for those who want precise
    You did that on purpose, right?
    No, but it's more fun that I did.

    The One True Date Format for today is 2013-01-08.
    Additional trivia, it's known the Gregorian monk trying to calculate the birth of Jesus for his calander made an error of at least 5 years. Plus he started at year 1 rather than 0 because the concept of zero was not understood. Only emphasizing that dates and times systems are arbitrary human constructs.


    No, he started at 1 because that was the accepted style of counting years. Dates were frequently cited as (e.g.) "... the first year of the reign of King Xyzzy ...". So the first year after the birth of Jesus would naturally be labelled year 1.
  • Steve The Cynic 2013-01-08 12:04
    lmm:
    [Seconds are well-defined (caesium-133 hyperfine transitions IIRC), so really one just needs to count the number of seconds since the beginning of time (1970-01-01 01:00:00 British Standard Time).

    Sadly POSIX gets this almost-but-not-quite correct; it screws up royally wrt leap seconds.

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.
  • chubertdev 2013-01-08 12:05
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.


    We're going to party like it's AD 99. But the developer of this WTF isn't invited.
  • da Doctah 2013-01-08 12:06
    Mark:
    Case "65535"
    Return Color.Orange 'bright yellow

    "Ah, now I get it".
    TRWTF, as this detail illustrates, is that "Color" is actually "Flavor". Notice also the consistent use of "Lime" instead of green.

    (And from past experience with the Slush Puppy dispensers at Snappy Mart in Silver City, New Mexico, "Blue" should actually be "Coconut".)
  • urza9814 2013-01-08 12:07
    ....in what frame of reference? As soon as you have motion, you lose any hope of a universal, non-arbitrary time standard.
  • urza9814 2013-01-08 12:08
    Steve The Cynic:
    lmm:
    [Seconds are well-defined (caesium-133 hyperfine transitions IIRC), so really one just needs to count the number of seconds since the beginning of time (1970-01-01 01:00:00 British Standard Time).

    Sadly POSIX gets this almost-but-not-quite correct; it screws up royally wrt leap seconds.

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    ....in what frame of reference? As soon as you have motion, you lose any hope of a universal, non-arbitrary time standard.

    [Sorry -- forgot to quote!]
  • urza9814 2013-01-08 12:09
    lmm:
    Jack:
    HowItWorks:
    The Gregorian monk trying to calculate the birth of Jesus for his calander made an error of at least 5 years. Plus he started at year 1 rather than 0 because the concept of zero was not understood. Only emphasizing that dates and times systems are arbitrary human constructs.
    Yet more proof that we really need to convert over to counting Planck-times since the Big Bang, and none of this local-planetary-orbits-since-a-mythological-event nonsense.


    Seconds are well-defined (caesium-133 hyperfine transitions IIRC), so really one just needs to count the number of seconds since the beginning of time (1970-01-01 01:00:00 British Standard Time).

    Sadly POSIX gets this almost-but-not-quite correct; it screws up royally wrt leap seconds.


    Aaand I quoted the wrong one. You people add posts too fast! ;)

    Anyway, this is what the following comment was supposed to be referencing, heavy apologies for reposting again:

    ....in what frame of reference? As soon as you have motion, you lose any hope of a universal, non-arbitrary time standard.
  • matthewr81 2013-01-08 12:11
    lscharen:
    ZPedro:

    Anyway, I, for one, would like to formally and wholeheartedly congratulate snoofle for his first article as a TDWTF writer.


    Considering that I spend more time searching the Side Bar for snoofle stories than reading the Feature Articles, I'd say the debut was long overdue.


    This. (and why I wish I could just +1 your comment)
  • Tristram 2013-01-08 12:14
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?


    In ninety-two, Columbus sailed the ocean blue...
  • lmm 2013-01-08 12:28
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.
  • Ben Jammin 2013-01-08 12:55
    Tristram:
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?


    In ninety-two, Columbus sailed the ocean blue...

    Oddly enough, there are historical documents around 1513 with a discussion pretty similar to this one, as they were coming up with that rhyme. It is a good thing they needed "14" in there to make the rhyme fill the meter, or the actual century of Columbus' voyage would be lost to the annals of history.
  • Hmmmm 2013-01-08 13:00
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders - The most famous of which is "never get involved in a land war in Asia" - but only slightly less well-known is this: British January is indeed usually UTC, but that particular January was on British Standard Time.

    FTFY
  • Soviut 2013-01-08 13:01
    Maltz:
    Overly Attentive Gizzard:
    "The fuck?" is all I could muster at this one.

    Maybe at some point it did translate to a proper color and that was factored out when a stupid intern tried to "fix" something he didn't understand?


    This.

    If this was written in the early 90's, the clients probably couldn't even display more than 256 colors, and maybe less depending on how new the hardware was at the time. It's hard to imagine the original program used 24bit values for color.


    24bit colour wasn't invented after 2000. Given that the client application is written in VB, there's a good chance they are Windows CE devices. Those supported bit depths higher than 8-bit (256 colours) and so did the languages running on them; Even VB.
  • Tom 2013-01-08 13:31
    F:
    Dates were frequently cited as (e.g.) "... the first year of the reign of King Xyzzy ...". So the first year after the birth of Jesus would naturally be labelled year 1.
    And what about the year of this alleged birth? The zeroth year would naturally be labeled year zero, would it not?
  • Plugh 2013-01-08 13:33
    F:
    the first year of the reign of King Xyzzy
    He's a king? I always figured he was the spirit of some long-dead wizard, trapped in a cave. With knife-throwing dwarfs, a snake, and more treasure than you can carry out in 10 trips.
  • Joey 2013-01-08 13:37
    Soviut:
    24bit colour wasn't invented after 2000.
    I had a box of 24 crayons in 1980. One bit for each crayon used or not used, and presto you have a highly specific color. Pixel size was a bit lame however.

    Oh, and "colour"? Get with the tens already. The two thousand tens.
  • Soviut 2013-01-08 13:59
    Joey:
    Oh, and "colour"? Get with the tens already. The two thousand tens.


    As I recall, from 2010 to present, we Canadians still spell it with a U.
  • Matt Westwood 2013-01-08 14:25
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.
  • 5urd 2013-01-08 15:18
    Arnold Judas Rimmer:
    eVil:
    The thought of that code just made me turn #1AC898


    What, purple?


    Sorry, but that's definently white. At least according to the code...

    Captcha: enim - like enum - they should have used an enum
  • 71 2013-01-08 15:25
    Mister Slowcoach:
    Is it not the case that 65535 and FFFF return different colours? I'm also a little confused at the -2147483633 and &H80000005 and &H8000000F ...


    That's the whole point. Those are strings; the numerical values have no real meaning.
  • OhNoDevelopment 2013-01-08 15:44
    It's happening, thedailysnoofle is becoming reality
  • Zylon 2013-01-08 15:45
    I'm surprised that nobody has pointed out that the only colors supported by the client code are a subset of the CGA colors. This would explain the "Return Color.Orange 'bright yellow" line. CGA only supported red, green, blue, cyan, magenta, yellow, and white and black, in high and low intensities.
  • gar37bic 2013-01-08 15:49
    I may be a pessimist, but I wouldn't be surprised if the same problem cropped up in 2090! :P
  • D'oh 2013-01-08 16:04
    urza9814:
    ....in what frame of reference? As soon as you have motion, you lose any hope of a universal, non-arbitrary time standard.
    So don't move then. Gee, was that so hard?
  • ThePants999 2013-01-08 16:31
    Overly Attentive Gizzard:
    "The fuck?" is all I could muster at this one.

    Since the second post could only muster "what", I'm glad you've completed it between you :-)
  • Tractor 2013-01-08 18:31
    Ben Jammin:
    Zach:
    Did I miss something or is the color just in BGR format with leading zeroes? So "FF" is parsed as hex 0x000000FF and so is (1,0,0) in the 0..1 RGB color space. "FF00" is 0x0000FF00 and so is (0,1,0): green (or "lime"). Orange then seems to be high red, medium-high green, and high blue, which makes sense.

    Admittedly, there are still a few WTFs in there. The dark vs. light grey values seem to have been reversed. It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency (which we're going to quietly call grey 'cause argh).

    Then again: if this is how the color management works, I can't wait to see the widget layout system.

    I believe what you missed is that the colors are serializable, and don't really need to be strings.


    Ah that's good then. We'll not convert colours to strings, we'll just serialize them into sequences of bytes that represent characters.
  • Bill C. 2013-01-08 19:02
    Damien:
    If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?
    The eighteen-nineties were the gay ones. The nineteen-nineties were mine.
  • Bill C. 2013-01-08 19:05
    Zach:
    Admittedly, there are still a few WTFs in there. The dark vs. light grey values seem to have been reversed. It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency (which we're going to quietly call grey 'cause argh).
    This, and this, and where are the other 48 shades?
  • Bill 2013-01-08 19:23
    Bill C.:
    Zach:
    Admittedly, there are still a few WTFs in there. The dark vs. light grey values seem to have been reversed. It also seems that "8000000F" is treated as light grey, although I'm guessing the value is in aBGR format and the "80" refers to transparency (which we're going to quietly call grey 'cause argh).
    This, and this, and where are the other 48 shades?


    Ha, you had me checking the HTML there.
  • mog 2013-01-08 19:24
    RichP:
    Damien:
    Umm:
    This was written in the early nineties but the code is in SVN???

    OK maybe you meant nineteen-nineties but still...


    I'm puzzled by what distinction you're trying to draw by introducing the nineteen- prefix. If someone says nineties to you, what year, decade or time period do you assume, if it's not the nineteen-nineties?


    Groan. Here we go again... It's exactly that kind of thinking that created the Y2K mess. Please think of the poor slobs wasting time by trolling dailyWTF archives in 2099 and fully qualify your dates, people!
    Qualify dates certainly. Record things specifically - gotcha. Be specific when you make a vague reference to a rough time period - Get Fucked, Fuckhead!
  • mog 2013-01-08 19:28
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....

    Language is always vague and fucksticks misinterpret things (usually deliberately) while pedants pick holes in the factuality of possible interpretations.
    If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive)....<insert finish to the sentence>
  • jones 2013-01-08 19:40
    Soviut:
    Joey:
    Oh, and "colour"? Get with the tens already. The two thousand tens.


    As I recall, from 2010 to present, we Canadians still spell it with a U.
    I think all of the English speaking world does. Sadly, the United States is not part of the English-speaking world.
  • Aussie 2013-01-08 19:46
    Matt Westwood:
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.

    That would be great - in the middle of summer here it gets light around 5AM and we're lucky if it's dark by 9PM. When I was a kid it was GREAT - long days to go swimming. Now that I have kids, it SUCKS. Try getting a one year old to go to sleep at 7PM when it's still broad daylight!
  • Silverhill 2013-01-08 20:02
    Tom:
    And what about the year of this alleged birth? The zeroth year would naturally be labeled year zero, would it not?
    It would not. Zero-based indexing was still a little way into the future.
    Years are labeled when they begin (unlike hours, which are labeled when they end), so the first day following the (alleged) birth was the first day of AD 1 -- the first year of Dionysius Exiguus's reckoning.
  • Average Dickweed 2013-01-08 20:48
    mog:
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....

    Language is always vague and fucksticks misinterpret things (usually deliberately) while pedants pick holes in the factuality of possible interpretations.
    If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive)....<insert finish to the sentence>

    ...they're talking about 60AD to 69AD...
  • D'oh 2013-01-08 21:01
    jones:
    Soviut:
    Joey:
    Oh, and "colour"? Get with the tens already. The two thousand tens.


    As I recall, from 2010 to present, we Canadians still spell it with a U.
    I think all of the English speaking world does. Sadly, the United States is not part of the world.
    FTFY.
  • D'oh 2013-01-08 21:03
    Aussie:
    Matt Westwood:
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.

    That would be great - in the middle of summer here it gets light around 5AM and we're lucky if it's dark by 9PM. When I was a kid it was GREAT - long days to go swimming. Now that I have kids, it SUCKS. Try getting a one year old to go to sleep at 7PM when it's still broad daylight!
    So you want to turn back the clock 1-2 hours in summer? (Otherwise it's still bright at 7, even without DST.)
  • D'oh 2013-01-08 21:05
    Average Dickweed:
    mog:
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD..... is clearly inferred.

    Language is always vague and fucksticks misinterpret things (usually deliberately) while pedants pick holes in the factuality of possible interpretations.
    If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive)....<insert finish to the sentence>

    ...they're talking about 60AD to 69AD...
    No.
  • Aussie 2013-01-08 21:37
    D'oh:
    Aussie:
    Matt Westwood:
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.

    That would be great - in the middle of summer here it gets light around 5AM and we're lucky if it's dark by 9PM. When I was a kid it was GREAT - long days to go swimming. Now that I have kids, it SUCKS. Try getting a one year old to go to sleep at 7PM when it's still broad daylight!
    So you want to turn back the clock 1-2 hours in summer? (Otherwise it's still bright at 7, even without DST.)
    I meant getting light by 9AM sounds like a great plan....We have too many daylight hours here, and I think we should swap some of our daytime for some night time from somewhere where there's too much - maybe Greenland will be interested - although it might be more fun to make deals with the Scandinavians - they seem to have a lot of other stuff I'd like to trade....
  • Slickk 2013-01-08 21:38
    Average Dickweed:
    mog:
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....

    Language is always vague and fucksticks misinterpret things (usually deliberately) while pedants pick holes in the factuality of possible interpretations.
    If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive)....<insert finish to the sentence>

    ...they're talking about 60AD to 69AD...

    Not sure how much sense that makes....

    "If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive).... ...they're talking about 60AD to 69AD..."
  • da Doctah 2013-01-09 01:30
    jones:
    Soviut:
    Joey:
    Oh, and "colour"? Get with the tens already. The two thousand tens.


    As I recall, from 2010 to present, we Canadians still spell it with a U.
    I think all of the English speaking world does. Sadly, the United States is not part of the English-speaking world.


    I don't know why this is so hard for people to understand. Listen closely:

    Gray is a color.
    Grey is a colour.


  • QJo 2013-01-09 05:08
    Aussie:
    Matt Westwood:
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.

    That would be great - in the middle of summer here it gets light around 5AM and we're lucky if it's dark by 9PM. When I was a kid it was GREAT - long days to go swimming. Now that I have kids, it SUCKS. Try getting a one year old to go to sleep at 7PM when it's still broad daylight!


    Where I live we use this invention called a "curtain" which does an adequate task of ensuring that any room to which it is fitted can be made significantly darker than that of the ambient light-level outside. I've heard they're quite easy to make, although we also have places where you can exchange moderate quantities of money for a ready-made product, and you might even be able to get someone to help you install it, if for any reason it proves too difficult for you to do yourself.
  • Paul 2013-01-09 07:32
    Soviut:
    24bit colour wasn't invented after 2000. Given that the client application is written in VB, there's a good chance they are Windows CE devices. Those supported bit depths higher than 8-bit (256 colours) and so did the languages running on them; Even VB.


    'Early 1990s' is pre-Windows 95.

    Windows CE was initially released in 1996, so not really 'early 1990s'

    There were colour handheld devices in the early 1990s, but they weren't common or cheap and didn't have big screens. Most things were B&W (eg Apple Newton, PalmPilot etc) with later ones advancing to greyscale towards the end of the 1990s. For specialised situations you may have had colour, but for most handheld applications the cost wasn't worth it.

  • Gumbull 2013-01-09 07:50
    Soviut:

    24bit colour wasn't invented after 2000.


    No, but it was rare in the early 1990s.

    I remember seeing a VGA display for the first time (in around 1989 IIRC) - in a university computer lab. We all stood around admiring the quality of rendering of a scantily clad woman (including the professors)...

    But, remember that VGA was not 24 bit colour. It was only 18 bit colour (3 x 6 bits) and that was from a 256 colour palette.

    We had to wait a few more years before "true colour" (24 bit) became available as a standard feature on a desktop PC, and even then it was rare - and not on handheld devices until MUCH later.
  • Cbuttius 2013-01-09 10:47
    The real WTF (from the comments not the article) is that people think they can get more hours of daylight by adjusting their clocks (rather than setting their alarm clocks in summer time to get up an hour earlier).

    I do know though that it is a very psychological thing. When I worked in Belgium for the whole summer of 1998, whenever I returned to England I kept my clocks in Central European Time (1 hour ahead of what it was in England). In particular it made getting up for early flights back much easier as my clock had its time an hour later than it really was. I did have to know to order the cab for the time it really was, not the time my clock said it was.
  • Cbuttius 2013-01-09 10:48
    By the way I'd file this article as a CodeSOD not a feature article which means we've had 3 CodeSODs this week.
  • pezpunk 2013-01-09 12:24
    mog:
    pezpunk:
    i fail to see a viable case for the term "90s" referring to any decade other than the one spanning AD 90 to AD 99, at least by default. any other interpretation would be unnecessarily arbitrary and unintuitive. of course, prefacing all comments with a set of default assumptions, in xml format for human readability, would clear up these kinds of misunderstandings and allow greater flexibility in the long run.
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....

    Language is always vague and fucksticks misinterpret things (usually deliberately) while pedants pick holes in the factuality of possible interpretations.
    If anyone reading this site was unable to decipher that nineties referred to the years between 1990 and 1999 (inclusive)....<insert finish to the sentence>


    i appreciate the seriousness with which you treated my comments. next i expect a sincere appraisal of my suggestion that we all preface our comments with XML of global assumptions in the future.
  • jay 2013-01-09 12:57
    I don't see why it's necessary to specify a century on the date in this case. As the story involves computer, clearly it could not have been referring to the 1890s or any earlier century, as electronic computers had not been invented yet. And it cannot be referring to any century after the 1990s, as the world ended on December 21, 2012, so there are no future centuries.
  • jay 2013-01-09 13:02
    Tom:
    F:
    Dates were frequently cited as (e.g.) "... the first year of the reign of King Xyzzy ...". So the first year after the birth of Jesus would naturally be labelled year 1.
    And what about the year of this alleged birth? The zeroth year would naturally be labeled year zero, would it not?


    That's hardly some ancient, obsolete convention. When, for example, you start a new job, don't you typically refer to the time from when you start to 12 months later as "my first year at this job"? Or do you really call it "my zeroth year at this job"? If the latter, I think you're in a decided minority.
  • jay 2013-01-09 13:15
    mog:
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....


    Wow, you must have different memories of the 60s than I do. As I recall the decade started with Nero in power, and he was a terrible emperor! Then we went through Galba, Otho, and Vitellius in rapid succession. They were turbulent and violent times, full of uncertainty. I, for one, was glad when the 60s ended.
  • AN AMAZING CODER 2013-01-09 13:51
    Cbuttius:
    The real WTF (from the comments not the article) is that people think they can get more hours of daylight by adjusting their clocks (rather than setting their alarm clocks in summer time to get up an hour earlier).

    I do know though that it is a very psychological thing. When I worked in Belgium for the whole summer of 1998, whenever I returned to England I kept my clocks in Central European Time (1 hour ahead of what it was in England). In particular it made getting up for early flights back much easier as my clock had its time an hour later than it really was. I did have to know to order the cab for the time it really was, not the time my clock said it was.


    It has to do with coordinating that effort with everyone around the world as well.

    Sure, you can get up an hour earlier... but then what? Do you go to work earlier and leave earlier? What if you can't?

    As developers and tech folk, that doesn't have a huge impact to us. But if your job depends on having an optimal amount of daylight (or lack there of), it sure as hell does.
  • BlueKnot 2013-01-09 14:15
    The first error case creates a valid input for the second function. If it ever gets to Purple something has definately gone out of plumb.
  • BlueKnot 2013-01-09 14:17
    Warren:
    This might seem over-engineered but how else could you implement an "error" case of white at one stage and purple at another....
    The first error case creates a valid input for the second function. If it ever gets to Purple something has definately gone out of plumb.

    I'm more baffled by
    Return Color.Black 'color
    and
    Return Color.Orange 'bright yellow
  • JJ 2013-01-09 17:15
    Return Color.White ' bright black
  • Bill C. 2013-01-09 18:31
    Gumbull:
    I remember seeing a VGA display for the first time (in around 1989 IIRC) - in a university computer lab. We all stood around admiring the quality of rendering of a scantily clad woman (including the professors)...
    So there's a well established tradition of women in computer science? I should change professions.
  • moz 2013-01-10 05:59
    jay:
    mog:
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....


    Wow, you must have different memories of the 60s than I do. As I recall the decade started with Nero in power, and he was a terrible emperor! Then we went through Galba, Otho, and Vitellius in rapid succession. They were turbulent and violent times, full of uncertainty. I, for one, was glad when the 60s ended.

    Are you part of one of those seditious cults, by any chance? I can see no other excuse for referring to the reigns of those emperors with such strange numbers.
  • no laughing matter 2013-01-10 06:57
    Soviut:
    24bit colour wasn't invented after 2000.
    24bit colour was invented in 1977:

    "1977 Alvy Ray Smith implements first 24-bit red, green, blue (RGB) paint system Paint3 at the NYIT, for three E&S or Genisco frame buffers in parallel."
  • jay 2013-01-10 12:54
    moz:
    jay:
    mog:
    Yes, because when everyone talks about the sixties (only decade worth a damn) their talking about 60AD to 69AD.....


    Wow, you must have different memories of the 60s than I do. As I recall the decade started with Nero in power, and he was a terrible emperor! Then we went through Galba, Otho, and Vitellius in rapid succession. They were turbulent and violent times, full of uncertainty. I, for one, was glad when the 60s ended.

    Are you part of one of those seditious cults, by any chance? I can see no other excuse for referring to the reigns of those emperors with such strange numbers.


    Well, yes, of course at the time we called it the 800s (Anno Urbis). I was speaking proleptically.

  • Pedant 2013-01-10 20:25
    no laughing matter:
    Soviut:
    24bit colour wasn't invented after 2000.
    24bit colour was invented in 1977:

    "1977 Alvy Ray Smith implements first 24-bit red, green, blue (RGB) paint system Paint3 at the NYIT, for three E&S or Genisco frame buffers in parallel."

    Interestingly, 1977 isn't after 2000.
  • foxyshadis 2013-01-11 04:13
    QJo:
    Call me Mister Slowcoach, but is it not the case that 65535 and FFFF return different colours?

    The "&" at the end probably makes all the difference in the world. Hell if I know what, vendor-specific shit always sucks.
  • Paul 2013-01-11 04:27
    AN AMAZING CODER:

    It has to do with coordinating that effort with everyone around the world as well.

    Sure, you can get up an hour earlier... but then what? Do you go to work earlier and leave earlier? What if you can't?


    Actually, the sort of jobs where you need to coordinate with people around the world are generally the sort of jobs where you don't need daylight that much. They're mainly office jobs.

    (Things like travel don't count, as while they're coordinated around the world, and daylight helps, they normally just happen in their own time anyway, not related to a '9 to 5' life)

    The sort of jobs where daylight will be a real benefit tend to only have timing relationships locally - eg farming, building, road maintenance, schools etc.

    As long as there's an overlapping time period (eg for shops, government services etc), it doesn't really matter if some work on a different 'work day' to others. In fact, having, for instance, schools run from 7am to 1pm and office workers work from 9 to 5 may actually help with traffic congestion etc.

  • Gibbon1 2013-01-11 23:57
    dkf:
    Umm:
    This was written in the early nineties but the code is in SVN???
    Doesn't mean that the code was originally committed to SVN, just that someone has committed it since. (It could have been originally in CVS or RCS or even — $DEITY help us — SCCS; there are tools for migrating.)


    Back in my day when we wanted to do diffs we'd take the new punch card and put it on top of the old punch card and hold it up to the light.

    And we were happy.
  • Some Damn Yank 2013-01-14 17:10
    dkf:
    Umm:
    This was written in the early nineties but the code is in SVN???
    Doesn't mean that the code was originally committed to SVN, just that someone has committed it since. (It could have been originally in CVS or RCS or even — $DEITY help us — SCCS; there are tools for migrating.)

    I've worked places where source code was "archived" by putting a paper printout in a filing cabinet, as backup for the punch cards/mag tapes. Don't laugh - they don't crash during power failures and they're impervious to magnetic fields. Fire, however, can be problematic.
  • TortoiseWrath 2013-01-15 00:38
    Matt Westwood:
    lmm:
    Steve The Cynic:

    I think you'll find that "BST" is abbreviationese for "British Summer Time". And the UNIX epoch is normally quoted as 1970-01-01 00:00:00 UTC, even if that isn't necessarily the right time zone/standard.

    And the British don't use BST in the middle of January, even if it is sometimes hard to tell British summer and winter apart.


    You've fallen for one of the classic blunders. British January is indeed usually UTC, but that particular January was on British Standard Time.


    "British Standard Time" - no, no, no - British Summer Time. It was an experiment to see whether it was better to have darker mornings and lighter evenings. It was just about getting light by 9 a.m. It was great.


    ...and this is why everyone should operate on UTC.