Comment On Color Me Stupid

Andy's company develops solutions for "Industrial" handheld devices. To make deployment and updates easier, they each run a thin client so only the server is different from project to project. This client was written by a long-gone employee in the early nineties, and had barely changed since because it "just worked". Updating it was discouraged for fear of breaking backward-compatibility. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Color Me Stupid

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

if(param == "&1st&") {
return Comments.FRIST;
}

Re: Color Me Stupid

2013-01-08 08:19 • by Leo (unregistered)
All this deserves is a flat "what.", but I can't just put that in a comment because Akismet doesn't like it.

Re: Color Me Stupid

2013-01-08 08:26 • by Warren (unregistered)
This might seem over-engineered but how else could you implement an "error" case of white at one stage and purple at another....

Re: Color Me Stupid

2013-01-08 08:30 • by ZPedro
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.

Re: Color Me Stupid

2013-01-08 08:31 • by Umm (unregistered)
This was written in the early nineties but the code is in SVN???

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

Re: Color Me Stupid

2013-01-08 08:34 • by Joe (unregistered)
OMG snoofle???

{bows respectfully}

OK guys enough of that. Time to start ripping him apart.

Re: Color Me Stupid

2013-01-08 08:36 • by dkf
398679 in reply to 398677
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.)

Re: Color Me Stupid

2013-01-08 08:36 • by eVil (unregistered)
The thought of that code just made me turn #1AC898

Re: Color Me Stupid

2013-01-08 08:44 • by QJo (unregistered)
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 ...

Re: Color Me Stupid

2013-01-08 08:44 • by Arnold Judas Rimmer (unregistered)
398682 in reply to 398680
eVil:
The thought of that code just made me turn #1AC898


What, purple?

Re: Color Me Stupid

2013-01-08 08:48 • by lscharen
398683 in reply to 398676
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.

BGR?

2013-01-08 08:52 • by Zach (unregistered)
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.

Re: BGR?

2013-01-08 08:59 • by Zach (unregistered)
398685 in reply to 398684
(I meant to say that orange includes a medium blue component. Whoops.)

Re: BGR?

2013-01-08 09:04 • by Ben Jammin (unregistered)
398686 in reply to 398684
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.

Re: BGR?

2013-01-08 09:04 • by epv (unregistered)
398687 in reply to 398684
I'll give you a hint. Those values aren't hex or ints.

Re: Color Me Stupid

2013-01-08 09:07 • by eVil (unregistered)
398688 in reply to 398682
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?

Re: Color Me Stupid

2013-01-08 09:08 • by Ben Jammin (unregistered)
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.

Re: Color Me Stupid

2013-01-08 09:15 • by Damien (unregistered)
398690 in reply to 398677
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?

Re: Color Me Stupid

2013-01-08 09:17 • by Anketam
398691 in reply to 398683
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".

Re: Color Me Stupid

2013-01-08 09:24 • by dgvid
398692 in reply to 398690
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?

Re: Color Me Stupid

2013-01-08 09:28 • by Remy Porter
398693 in reply to 398690
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?

Re: Color Me Stupid

2013-01-08 09:29 • by jonkenson (unregistered)
398694 in reply to 398690
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

Re: Color Me Stupid

2013-01-08 09:29 • by snoofle
398695 in reply to 398691
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 ;)

Re: Color Me Stupid

2013-01-08 09:47 • by Anketam
398696 in reply to 398695
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!

Re: Color Me Stupid

2013-01-08 10:13 • by Overly Attentive Gizzard (unregistered)
"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?

Re: Color Me Stupid

2013-01-08 10:26 • by RichP
398700 in reply to 398690
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!

Re: Color Me Stupid

2013-01-08 10:28 • by Maltz (unregistered)
398701 in reply to 398698
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.

Re: Color Me Stupid

2013-01-08 10:31 • by Maltz (unregistered)
398703 in reply to 398682
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

Re: Color Me Stupid

2013-01-08 10:38 • by operagost
398704 in reply to 398689
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.

Re: Color Me Stupid

2013-01-08 10:41 • by pezpunk (unregistered)
398705 in reply to 398690
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.

Re: Color Me Stupid

2013-01-08 10:59 • by ronpaii (unregistered)
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.

Re: Color Me Stupid

2013-01-08 11:00 • by Umm (unregistered)
398710 in reply to 398700
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.

Re: BGR?

2013-01-08 11:05 • by guest (unregistered)
398711 in reply to 398684
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.

Re: Color Me Stupid

2013-01-08 11:21 • by HowItWorks (unregistered)
398712 in reply to 398689
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

Re: Color Me Stupid

2013-01-08 11:26 • by Dan (unregistered)
398713 in reply to 398712
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.

Re: Color Me Stupid

2013-01-08 11:37 • by Alfred (unregistered)
398714 in reply to 398710
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?

Re: Color Me Stupid

2013-01-08 11:40 • by Mark (unregistered)
Case "65535"
Return Color.Orange 'bright yellow

"Ah, now I get it".

Re: Color Me Stupid

2013-01-08 11:41 • by HowItWorks (unregistered)
398716 in reply to 398713
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.

Re: Color Me Stupid

2013-01-08 11:45 • by Zylon
398717 in reply to 398710
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.

Re: Color Me Stupid

2013-01-08 11:51 • by Jack (unregistered)
398718 in reply to 398716
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.

Re: Color Me Stupid

2013-01-08 11:59 • by lmm (unregistered)
398719 in reply to 398718
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.

Re: Color Me Stupid

2013-01-08 12:01 • by F (unregistered)
398720 in reply to 398716
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.

Re: Color Me Stupid

2013-01-08 12:04 • by Steve The Cynic
398721 in reply to 398719
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.

Re: Color Me Stupid

2013-01-08 12:05 • by chubertdev
398722 in reply to 398705
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.

Re: Color Me Stupid

2013-01-08 12:06 • by da Doctah
398723 in reply to 398715
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".)

Re: Color Me Stupid

2013-01-08 12:07 • by urza9814 (unregistered)
398724 in reply to 398719
....in what frame of reference? As soon as you have motion, you lose any hope of a universal, non-arbitrary time standard.

Re: Color Me Stupid

2013-01-08 12:08 • by urza9814 (unregistered)
398725 in reply to 398721
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!]

Re: Color Me Stupid

2013-01-08 12:09 • by urza9814 (unregistered)
398726 in reply to 398719
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.

Re: Color Me Stupid

2013-01-08 12:11 • by matthewr81
398727 in reply to 398683
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)

Re: Color Me Stupid

2013-01-08 12:14 • by Tristram (unregistered)
398728 in reply to 398690
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...
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment