Wtf, MS?

May 5, 2008

When you see this line of code in your source window, how does your brain read it?

My brain says “There’s a hex number, with a couple of 1’s in it.”

Guess what? WRONG. It has one ‘1′. The end character is a secret hidden lowercase “L”. Thanks, Microsoft. Lucida console has literally a one pixel difference between it’s ‘1′ and ‘l’, which is fairly typical. These things are speckled all over mmsystem.h. Personally I never use ‘L’ at the end of a hex digit, and if I was feeling clinically insane enough to do it, I’d at least use a capital ‘L’.


ǝubıuǝǝɹıub

November 7, 2007

.sıɥʇ ǝʞı1 ʇxǝʇ sǝʇɐɹǝuǝb ɥɔıɥʍ ǝʇıs ǝɥʇ punoɟ ʎpɐǝɹ1ɐ ǝʌɐɥ noʎ ɹo ‘ʇɐq ɐ ǝɹɐ noʎ ‘ɹǝʌǝ1ɔ ʎʇʇǝɹd ɹǝɥʇıǝ ǝɹɐ noʎ uǝɥʇ ’sıɥʇ pɐǝɹ uɐɔ noʎ ɟı


Chumby Antics

September 15, 2007

I have been working at Chumby for a few months now. If you have never heard about Chumby - basically, it is a small squishy wifi-internet connected device with a touchscreen and some other nifty hardware features. So, I am around Chumby devices pretty often, obviously, since it is my full time job.

Sometime’s I goof off a little..

This is a video of a small application I made on the Chumby. You touch the screen, and a small blob of “lava” follows your finger around. You basically get the sense of smearing the blobs around the touch screen.

And this is a funny video of a Chumby with two USB dogs humping it.


Instant Classic

February 6, 2007

Most people have probably seen this by now, but if not - it is the best thing I’ve ever seen.


Ignignokt / Megaman Laser Etches

February 3, 2007

Hehe. Last night we used bunnie’s laser etcher to put Ignignokt on a Treo cell phone. Classy. Also, I got megaman on mine.

Here is a video of the etching of Ignignokt in progress:


Bacon McFlurry

October 14, 2006

McDonalds officially unveiled yet another new flavor of McFlurry this weekend. The latest addition to the McDonalds menu combines the popular McFlurry dessert with the salted and smoked meat from the back and sides of a pig.

Executive Vice President Claire Babrowski says “We were just looking for something new. We wanted to combine dessert and breakfast, and I think we accomplished that.”

mcflurry


Bunnie is MonGyver

September 25, 2006

Just got back from some travel with bunnie, adrian and hb+pana. To chronicle our goofy adventures, adrian put together a DivX video. The video is called “Mongyver” (spoofing Macgyver, the best TV show ever created), and bunnie is the main character.

We came up with the idea when bunnie started fixing a broken sound card on my laptop using a lighter and aluminum foil. Bunnie is the Mongolian Macgyver :)

I do all my own stunts! (see the lawn chair scene).

stunt

You can watch the video online, or download it (right click, Save As).


Ridiculous C-code

August 17, 2006

For no particular reason I decided to write the following confusing line of C code today…

const _=0;do;while(0?0,1:!_,_);

Might make an interesting interview question. Can you parse it in your head?

Here are some reasons why this seems very confusing:

  1. const _=0;This is not much different than “const int a = 0;”… It is just using the implied “int” type, and rudely using the single underscore character, which is acceptable (but taboo) as a variable name.
  2. do;whileThis looks odd, but is actually valid. Typically, people implement a do/while as “do{}while(…);” - however, it is equally valid to replace the {}’s with a single statement, even an empty do-nothing statement (”;”).
  3. a?b:cI am tempted to fail somebody in an interview immediately if they have no clue what this operator does. It isn’t that it’s particularly critical or anything -but if you’re a C coder and you’ve been around the block - it would be very odd for you to not be familiar with the conditional operator. Still, it is rare enough to be difficult to brain-parse.All this does is evaluate “a”, and if the result is true, evaluates “b”. If the result if false, it evaluates “c”. Simple.
  4. !_,_ Okay so this one is nasty. I might not expect everybody to be familiar with this guy. What happens here is the variable “_” is being evaluated as negated, then the variable “_” itself is being evaluated. The trick is, only the right side of the comma is actually used as the value of the expression. Huh?

    This is primarily useful in things like a “for” loop. Since the general syntax of a for loop is “for(a;b;c)”, you at first may feel a little limited. How can I increment two variables on each step? Easy. “for(a;b;d++,e++)” - note the comma operator allows you to squeeze two subexpressions into “c”. In this case, nobody knows or cares that the expression value is, in the end, defined only by e++. The result is not being used at all.

    I’d be interested to hear some real world valueable uses for the comma operator, aside from a “for” loop.