November 2nd, 2003


Also, remember that Al Gore invented the internet.

Bill Gates: "Until we had this concept of Web services, software on the Internet couldn’t talk to other software on the Internet. The only thing that worked was you could move bits — that's TCP/IP — or you could put up screens — that's HTML — but software couldn't talk to software."

Hahahahaaa! (COsmtpUGH!)

I think someone also said recently that Bill Gates was caught publicly doubting why anyone would need more than 4 gigs of RAM. (Holy resurgence of everything from the 80's, Batman!)

[Nerdage] The Embedded C Programmer Test.

I put this up on Ben's Irregular a while back, but I never had time to go back and actually take the test myself until now.

A couple of notes...

Questions 1 and 2: Really excellent points here. Casting to long for the answer to the year worth of seconds constant is particularly insightful. And you wouldn't believe the weird-ass, untraceable bugs that come about due to weird order of ops in macros. Parenthesize ALWAYS!

Question 3: I actually didn't know this one off the top of my head. I was pretty sure it caused the preprocessor to throw an error, but didn't know the exacts.

Question 4: There are a lot of correct answers to this one. You could also use a do/while. I personally like "#define FOREVER 1 while(FOREVER)". It's a little more obfuscated if you try and puzzle it out, but on a quick scan of the code I think it's actually more readable and the intent is clearer.

Q 5: I couldn't get the last one. Pointers to functions I can do fine, but throw that array in there and I'm history...

Q 6: I knew all three uses of static, AND I've used both of the last two in production code. (Oddly, I can't remember ever using "static" in the sense of making a variable that keeps its value between function calls!)

Q 7: As soon as the interviewee says "const means constant," I know I'm dealing with an amateur. Uh, not really. I do indeed like the definition of "const" as "read-only" but even that fails somewhat later on when he gets to talking about volatiles. Const just means const - it has its own conditions and semantics.

Q 8: Up to the "additional questions" part of this, I'm fine with it. But then he goes and does something really, REALLY dumb that betrays a lack of understanding of how C passes parameters to functions.

Remember how C makes a copy of variables passed to functions? Remember that from C 101? Por exemplo:

    n = 3;


someFunc(int i)
    i = i + 1;

Okay now, the $64k question: What is the value of main()'s variable "n" after someFunc() has been called?

The answer is: "n is unchanged. It remains 3."

Now, why? Because, the compiler passes a copy of each parameter to the function, not the actual param itself. Which means changes you make inside the function don't effect the outside variable. Hence all the silly contortions C programmers have to go through with passing and returning pointers, etc.

The author goes through a completely unnecessary series of steps here to do what the compiler will do for him automatically. And if you let the compiler do it, it will make more intuitive sense, and be easier to read and maintain to boot.

The author fails this question, although he wrote it himself, for not understanding what the compiler is doing behind his back. In embedded systems, you need to always understand what the compiler is doing behind your back. (This is even more crucial if you write C++ for embedded.)

The only reason I can think of to ever do it his way is if you have to wait for a certain moment in the computer's internal state before doing the math on the volatile variable. In that case, it would make sense to encapsulate the waiting and the calculation inside the function. But for normal cases...

Q 14: This is an utterly excellent question, and tests if you've really, really slogged through the nasty, evil guts of compilers (or at least the K&R book) and really truly understand deep down how the arena and memory allocation works in most all C compilers.

Q 16: I'm not actually sure if this defaults to pre-increment b or post-increment a. The point of the question is excellent, though: Don't do this! You're not saving yourself anything, and you're probably going to cause the person who maintains your code a big headache. Yes Virginia, good style can be important!

New pattern: "The LJ tease".

Based on the behavior of certain livejournal users over the past couple of months, I have abstracted a new pattern of LJ poster behavior, suitable for discussion on sites such as

It is called "The LiveJournal Tease." It is not a poster as you might think, rather it is a series of events. To whit:

- Person posts about some fairly dramatic to their LJ, but with very little detail.

- Other people see it and post questioning comments.

- Person fails to answer the questions, fails update again with more info, or in extreme cases even goes back and, in a retro-active revision of history worthy of 1984, deletes the original post.

- Nothing is ever heard of the event again.

Whether they realize it or not, people engaging in such behavior are attention whoring and/or teasing. This is no different than the 4th grader who runs around and smugly says to everyone they meet: "Guess what?" "What?" "I've got a secret!" "What is it?" "I'm nooooot telling!!"


I've seen several people do this over the last couple of months. The last time it happened, when pugzie posted about having to meet the Louisville police to talk about something, I was even suckered into posting a comment.

But no more. I see the trick being played. ;] It's a fun one, to be sure... look for it to happen on my LJ... right when you're least expecting it!! ;]

[Fark] Toasters!!!!

This page features pictures of adults in sexual situations with kitchen appliances. If you are under the age of 87 (142 in Estonia, Khazakstan, Kyrgyzstan, Australia and the US states of Utah and Texas) and or are offended by pictures of Rotherham / Shirebrook / Woodhouse / Terrace Road slags with kitchen appliances, please LEAVE NOW. The author takes no responsibility for genital burns caused by attempts to reproduce the acts shown here.