Archive for January, 2007

News Flash

Sunday, January 28th, 2007

“Databases more interesting than previously thought. Film at 11.”

Well, way back in the distant hazy past (or, a month ago), I was getting ready to teach a new database systems course here at Caltech. I was going to be thrilled if I got 10 students - to me that would be a big success.

Turns out that I ended up with 18 instead!

I don’t know what will happen when Drop Day rolls around, but so far I have been having a lot of fun teaching the course. It’s hideous amounts of work, but that’s just one-time cost. Once it’s all nailed down, I think it will be a nice little course.

The Long Arm of the Law

Wednesday, January 24th, 2007

I got my first traffic ticket today. But it’s not like you think. It’s a speeding ticket for going 86 in a 60 zone. But, that’s Kilometres per Houre, which works out to something like 53MPH in a 37MPH zone. That’s not so bad. Going 86 in a 60 sounds a lot more impressive.

Anyway, I was actually caught speeding back in October of last year, the 15th to be exact! I was in Australia at the time, and New South Wales has speed cameras all over the place. I guess that one of them nabbed me. I was a little surprised by that; I thought I had done a good job of obeying the speed limits last trip. (OK, I thought I had done a good job of spotting all the speed cameras in time… whatever.) But I was wrong!

It took them about five months to track me down. The letter showed up today from the Australian government, asking for their fine. Fortunately they take credit cards, so I don’t have to appear in person!

Stupid Reference Tricks, Part 2

Friday, January 19th, 2007

The last post I wrote about C++ was about an unfortunately too-common programming practice of writing a class so that it provides a direct reference to an internal data-member. Here is the offending code, yet again:

class Widget {
private:
  double m_distance;

public:
  double & distance() { return m_distance; }
  const double & distance() const { return m_distance; }
};

I showed this kind of approach in my Advanced C++ track last night, and here is something that one of my students thought of: Can you grab a reference to Widget’s m_distance data-member, and hang on to it?

In other words, what does this code print:

  Widget w;
  w.distance() = 5;

  double &evil = w.distance();
  evil = -2;

  cout << w.distance();

(more…)

Mountain Bike

Tuesday, January 9th, 2007

I finally got my mountain bike fixed last week. It’s been two years since I rode that thing; ever since the heavy rains a couple of years ago, which washed out some of my favorite trails. But I discovered some new favorites, so I got the bike all fixed up.

Of course, the first ride was painful… At first I thought I was going to die, and then after a while, I thought that maybe dying wouldn’t be so bad. But I made it as far as I intended to go, and the views were great! The only real hitch was that I got a flat tire on the way down the mountain, but I was close enough to the bottom that it wasn’t a big deal.

I can’t wait to get back out there…

Books!

Tuesday, January 2nd, 2007

I just got back from the Caltech Bookstore, and they already got in the Database System Concepts book for my course. What a relief. The only drawback is that it weighs in at $137… It’s only $129 through amazon.com, and $113 through bookpool.com.

Anyway, this should be an interesting term. I’m still not 100% sure that I’ll stick with that book next year, but at least for this year it should do pretty well.