January 28, 2004

bad habits

I just love it when research justifies what you thought was a bad habit.

Personally, I drink about 24-30oz of strong coffee per day, which I find keeps me alert during the day, but doesn't snowball into a pattern of escalating consumption[0], especially if I don't drink any at least one day on the weekend.

--

[0] 60oz of coffee is a bit more than I want to be consuming before lunch.

Posted by matt at 11:38 AM | Comments (0)

January 23, 2004

M is for memory

The number one thing I hate about hash tables is that they eat memory. Especially when people include an oversized hash table as a speedup in a commonly used datatype. And even more so when it turns out that the average case for the datatype contains a single entry in the hash table.

*clickety-click*

Woo! 400K of savings.

Posted by matt at 12:49 PM | Comments (0)

January 21, 2004

Fire drills and the human condition

We had a fire drill today. Apparently our building management company is required to have one per year. The odd thing is that we don't have to go all the way down to the lobby (which is kind of nice, given that we're rather a long way up). The reason why we're only required to go down 4 floors is that (according to the fire marshals) if people are required to walk that far, they refuse to participate in the fire drill.

It's kind off pathetic when you think about it. Just like the people who spend 15 minutes trying to find that perfect parking space so they don't have to walk 200 feet in order to get to their gym where they're going to spend an hour running on a treadmill.

Of course the creepiest part of the fire drill is where we found out that the speakers in the fire alarms are hooked to a microphone somewhere and a weirdly distorted voice thanked us for participating. It felt very Orwellian for some reason.

Posted by matt at 02:05 PM | Comments (0)

January 19, 2004

MLK day

I've decided that MLK day is now one of my favorite holidays. Not because I get an extra day off work (because I don't), or because of my deep and abiding respect for Dr. King and his efforts to expunge the stupidity of racism and bigotry from our culture (which is why it should be one of my favorite holidays), but because so many other people get the day off that I got to drive at 75mph on the 405 on the way to work.

Posted by matt at 12:17 PM | Comments (0)

January 13, 2004

Stupidity, thy name is Coder

Jeremy Zawodny posted an entry extolling the virtues of a sanity check.

I have spent a lot of time learning to start asking stupid questions the moment that things get weird. So here are 10 stupid questions to ask.

  1. Does code that shouldn't compile still compile?

  2. One of my coworkers used to refer to #if 0 statements as ninja operators as they could stealthily assassinate your debugging techniques. A similar effect can be achieved by editing files that you had backed up instead of your real files.
  3. Does code that should crash still run?

  4. Sometimes I use printline debugging to assess the general behavior of a program and I accidentally introduce two print statements that are a little too similar. Adding code that should halt the program (either an assert(0) or something like dereferencing a NULL pointer) usually points out that you've done something really wrong.
  5. Did the executable actually compile?

  6. Check that file modification date and the output of your build process. Back in college a friend and I were working on implementing the Boids flocking algorithm and he had chained the compile command to the command to run the program. This worked fine until sometime around 3:45am when we introduced a syntax error and were so intent on the runtime behavior of the program that we totally ignored the fact that the executable wasn't actually compiling. More often this happens due to a permissions problem on the executable.
  7. Are you running the right executable?

  8. One of my first programming problems in college drove me insane because I couldn't get it to work incorrectly no matter what crap I put in the code. It turned out that the sample program provided by the TAs was named exactly the same as my program and was in a path that was listed before the current directory in my PATH variable.
  9. Was it supposed to do that?

  10. Every once in a very long while you'll see a program act in an absolutely obscene (and possibly pathological) manner that you will swear must be absolutely wrong... but it will, in fact, be the correct behavior no matter how much you wish it wasn't.
  11. Is your porn collection too big?

  12. Software doesn't always deal well with running out of disk space.
  13. Did you apply the -15 to-hit modifier for a moving target?

  14. If you have a data set and a piece of software that are both being developed and you don't synchronize between the two of them you are chasing a moving target which may make debugging impossible.
  15. Did you explain the problem to your coworker?

  16. A friend of mine refers this as letting someone else play "Captain Obvious". Apparently someone he went to college with took this roll a bit too seriously and would wear a hat emblazoned with the letter O while doing this. 90% of the time the problem becomes obvious when you explain the situation to your coworker. The other 10% of the time the coworker usually tells you exactly where you are doing something stupid.
  17. Did you demonstrate the problem to someone who can do something about it?

  18. Murphy says the problem will go away just in time to make you look like a total idiot.
  19. Have you considered cosmic rays, wormholes, and the dark side of The Force?

  20. Sometimes things just get messed up inside your computer. Reboot the damn thing. Even if it doesn't fix the problem you often get this flash of insight about what's really wrong just after you realize you're past the point where you could abort the reboot.
Posted by matt at 03:51 AM | Comments (1)

January 12, 2004

Skiing

I went skiing on Saturday. I had gone skiing once before, but it was 12 years ago, and the mountains in Wisconsin are a bit on the small side, so this was effectively my first ski trip.

I had a blast, but I have two new rules:
1. Get enough sleep the night before
and
2. Don't believe your friends when they tell you that you'll be fine on that slope that goes all the way to the top of the mountain. "You made it down that other blue trail just fine, you can do this one, just be sure to go down the blue trails instead of the black diamonds. Oh, and avoid the jumps, half pipes, icy patches, snowboarders, and don't forget to make wide turns on the near vertical surface. Oh, and the snow's all slushy now so you'll have to turn harder"

On the bright side I got lots of practice learning to stand up after I'd fallen down.

Posted by matt at 06:03 PM | Comments (3)

January 09, 2004

win 2k

I miss win 2k.

There seems to be a significant difference between using an operating system for day to day office tasks and using an operating system for development work. I'm sure that XP is a wonderful platform for writing email and playing games. I've also noticed that Win XP boots much faster (and after my 5th reboot today I'm glad it does) but I'd really rather have a computer that just didn't crash so often[0].

Right now I dislike Microsoft. Not because they have a stranglehold on the market, did very bad things to developers in the 80s and 90s, and probably sacrificed really cute animals to some evil god-thing, but because my company can't get a license to let me use win2k and dev studio 6.

I'm sure that DevStudio .NET is really really great for 99% of the developers out there[1], but for my purposes it just crashes a whole lot. I don't care if hyperlinks work in my editor. I don't like cutesy rounded buttons. I don't like spending two hours downloading magic utilities in order to turn off helpful features. I just want the goddamn thing to work in a reliable and consistent manner so that I don't have to spend lots of time watching my computer reboot.

--
[0] It would also be kinda nice if the recycle bin didn't (sometimes) take 5 minutes to delete one small file.

[1] Ok, I'm not sure about that.

------------

Update
Ok I've been called on it and this entry isn't entirely fair. it's mostly VS.Net that crashes and seems to destabilize other things. When I'm not running VS.Net XP has been stable (aside from annoyances like the recycle bin occasionally taking 5 minutes to empty 1 file). I still think that Win2k was a little bit more stable and less prone to occasional annoyances.

Posted by matt at 04:47 PM | Comments (2)

January 05, 2004

New Year's Resolutions

I've been somewhat distracted since Christmas[0]. So, here's the obligatory new year's resolutions:

1. Avoid eating out.
2. (Re)Establish a regular gym routine.
3. Learn to estimate time to completion correctly.
4. Stop wasting money on overpriced coffee and useless toys.
5. Reduce my debt by half by the end of the year.

--
[0] Very pleasantly distracted. No, I won't tell you the details, you probably wouldn't believe me if I told you.

Posted by matt at 12:45 AM | Comments (0)