Superfluous Matter
Nerd Handbook

For anyone who has to deal with a "nerdish" individual, The Nerd Handbook is great reading and totally describes some key aspects of nerdish personalities. Obviously it doesn't apply 100% to any one individual, but a lot of it is surprisingly accurate. If you are close to me or another nerd, I highly recommend reading it.

On my first read, I took exception to two things in particular. The article suggested that nerds don't like to travel and that nerds don't have any interest in food. As a Computer Science major I can hardly deny nerdish leanings, but travel and food are two of my favourite things. Upon reading further though I realized that in my case I internalize both of those things as "projects." Although I enjoy them thoroughly, I'm pretty sure I enjoy them because of my desire to understand them and to "do them right." When I do things I really like to do them correctly. I often refrain from doing things because I know that I don't have time to do them properly and thus I would be unhappy doing them. At least that's how I justify my procrastination.

Random C++ Fact

I thought I would mention a random C++ programming thinger I came across at work the other day. If you don't work with C++ or don't care about programming you probably want to stop reading now.

Let's say you have a base class, A, which overloads the method "foo" in several ways, like this:

class A
{
public:
    A();
    virtual ~A();

    void foo(int a);
    void foo(int a, int b);
};

Further suppose you have a class B which derives from A, and you'd like to overload "foo" in a new way in the derived class, but also maintain the implementations of the base class A, like this:

class B : public A
{
public:
    B();
    virtual ~B();

    void foo(int a, int b, float c);
};

Due to the way C++ does name resolution, the definition of "foo" in B actually hides the other definitions from A. So if you do this:

B* b = new B();
b->foo(3);

the compiler will fail because it can't find a matching method for foo(int). The problem is that as the compiler walks up the class hierarchy looking for a match for "foo" it will stop at the first class that defines a method with the name "foo" regardless of whether or not there is a suitable match for the specified parameters.

I've actually read about this name resolution rule before, but I never thought about it in this context and so I spent a frustrating half hour trying to figure out why my code wouldn't compile. There are several ways to get around the behaviour. You can redefine the methods of A in B, or you can add a "using" statement to the class definition of B, like this:

class B : public A
{
public:
    B();
    virtual ~B();

    using A::foo;
    void foo(int a, int b, float c);
};

It's important to add the "using" statement before any new definitions of "foo" though.

Anyway, this learning experience turned out to be not immediately applicable because I ended up having to write the code in an entirely different manner anyway. I'm blogging about it so that the experience wasn't a complete loss. Also, this blog post is the first use of the a new feature I just added to my blog to show code in a blog post. Good times!

World Nutella Day!

Today is World Nutella Day and holy crap that's awesome!!! Well Nutella is awesome at least. I eat it on crackers, bread, crepes or just straight out of the jar. Also, for people selling food items, adding the word Nutella to the name of the food is a good way to get me to buy it. Anyway, I'll have to have a bunch tonight in celebration. I'm thinking of heating some up slightly so it gets runny and then drizzling it over some of the Ben & Jerry's "Half-Baked" ice cream I have sitting in my freezer. MMMMMM!!!

Short Update

Well, things can certainly change at work. Not for me apparently but for lots of other people I work with.

Last weekend as full! Like there was no more stuff I could have done because I used up all of the non-asleep time. Friday night was dinner at Weezies for Patrick's birthday (mmm...delicious) followed by looking at Patrick's Iceland photos. Saturday I did some chores in the morning including making my muesli, and then Kim and I went to see the classic Euripides play Medea at the Canon theatre. It was pretty good, but as it was a tragedy it didn't exactly have a happy ending. After the play we headed to Chris's house where he and John made us homemade pizza and then we watched the Bourne Ultimatum on BluRay. Sunday I helped Patrick and Toni for the whole day with their wedding website. It was fun, and it taught me a lot of stuff about Ireland, but it was also a very long day.

In climbing news, I'm finally lead climbing again on Wednesdays. I've been pretty lazy the last few months and just doing plain top-rope. But someone at the gym told me that every time you top-rope something you could have lead, God kills a kitten.

2009-01 | 2009-03