Saturday, 31 March 2007

Right foot in, right foot out...

Do things ever seem like the hokey pokey to anyone else? There is a lot happening to keep people busy, but nothing is actually getting done?

*sigh*

And that's all I have to say about that.

Wednesday, 28 March 2007

You just don't get it, do you Scott?

A couple of times lately I have felt like Dr. Evil in that scene where he puts Austin in a room with a slow death machine and will just assume that he will be killed. His son Scott wants to get a gun and just kill him to make sure he doesn't get away.

"You just don't get it, do you Scott?"

There is a difference between being able to do something and understanding why you should be doing it.

This is why I think that people who make design choices should be made to implement them. It's like a developer that doesn't move into a maintainer role on their code: you don't ever learn how what you did at the start effects the end of the project.

I'm sure that I'm guilty of a lack on comprehension from time to time but I like it when someone helps me see the light. It makes me better. ;-)

Saturday, 24 March 2007

Red cape and goggles!

Man, I knew that I was missing something. All this time I was missing my red cape and goggles!

Wednesday, 21 March 2007

Hibernate 3.2.2 GA

I tried to upgrade an app I am working on from using Hibernate 3.1.3 to 3.2.2. It didn't go nearly as smoothly as I thought that it would. First thing is that they no longer default a cache impl. If you had not specified a hibernate.cache.provider_class property before, it will just die. Shocking, but not difficult to get around when I found the problem. Cool. So I changed that and ran my tests to see all these NPE's. *sigh* Apparently I found another unfixed bug.

Short story: I reverted back. I'll figure out another way to get the feature that I was looking for when I upgraded. :-(

Monday, 19 March 2007

Effective <del>lying</del> storytelling

A couple of weeks back I was talking to a guy and he was telling that there is a simple formula for lying. Personally I think that it's better suited to "creative storytelling", but it's all how you look at it.

His theory was that you had to ensure that your lie contained a: who, what, where, when, and why. If you're able to quickly put 5 facts that seem to link up, that's a lot more convincing than just one. Here's an example:
During the American civil war (when), Colonel Sanders (who) was able to have his troops march faster on the hard road from Alabama to Kentucky (where) by relying on fried chicken for rations instead of beef (what). The frying process allowed the food to keep longer since the grease sealed the meat from the air and bacteria which would cause it to go bad (why).


This is clearly bs and just something that I made up on the spot (perhaps because I am hungry). However, if you are able to quickly throw linked facts at someone, all of a sudden your argument seems more credible. Why? Probably because coming up with 5 linked lies is harder than coming up with one. I have found that this technique works well in combination with holding a straight face. If you can do those 2 things, those will help you on the way to being sneaky. So very sneaky. :-)

Friday, 16 March 2007

Bloodletting and Miraculous Cures

I just finished Bloodletting and Miraculous Cures and I'm not sure how I feel about it. It is totally different than I expected it to be. I thought that it was a med student going though 4 years of school. It's more like pulses of some people's lives and how they interconnect. I think of it in terms of a heart pumping: a couple of days in the life of a character... pulse pulse... years pass... pulse pulse... a few weeks in the life of another character, pulse pulse... and so on.

It's interesting how the author kept on the connections loose while still tying the characters together with the same ribbon. Disjoint and connected. Strange.

It felt like what I imagine it's like to be a doctor: intensely involved with a small group of people's lives for a brief period of time, and then a long stretch before you interact with them again. Years pass. Then again that brief furry of activity without knowing what has happened to the people to get them into your life again. All you know is that they are different. It's definably an interesting way to tell a story.

Other pro's: fast read, light language, fluid writing style.

Go read it. ;-)

Wednesday, 14 March 2007

Match result: Ottawa

Woo-freaking-hoo!!! Laura matched to U of O for her program so we're staying in Ottawa. We're very happy. :-D YAY!!!!!!!!

Tuesday, 13 March 2007

Can't... turn... brain... off....

Uggg... Usually I'm able to fall asleep okay after a while, but no luck tonight. I should have planned on staying up and cooking that chicken soup for tomorrow. I'm not sure that I'll be able to get up at 5:15 with Laura tomorrow and do it then like I planned. *sigh*

On a completely different note for anyone using a good browser (firefox), with the spell checker finally included for text areas, it underlines all the misspelled words in red. Stupid me, but I didn't realize that it gives you suggestions if you right click on it. I used the plugin before FF 2.0 and I don't remember it allowing you to do that. My next step is trying to figure out where this dictionary is so that I can remove the misspelled words that I mistakenly added to the dictionary...

Using the computer in the dark reminds me of school... I am instantly more tired. I think that I'll use this opportunity to try and fall asleep...

Saturday, 10 March 2007

The reason why I can't have nice things

Specifically cars. I just don't treat them with a lot of respect and care. It's a metal and plastic thing, nothing more. Today I didn't take into account the freezing rain and crunched into a icy snowbank. I bent up the bumper and messed up some plastic, but I was able to bend it all back so you won't know when you look at it.

I'm ticked at myself for not being prepared for the icy conditions, for breaking like my car has ABS (my last car did) instead of threshold breaking. I'm ticked, but not angry. Meh. I don't see myself as a good driver, so this doesn't hurt my self image. My car isn't "my baby". Because I don't put a ton of value on the car, I have not put a lot of effort in keeping it nice. If I got a really nice car, I think that the same thing would happen and the guys in my family would weep at my lack of appreciation for having something so nice.

Thursday, 8 March 2007

Focus man focus!!

I just got 2 pairs of new glasses yesterday. I think that the last time I got glasses was in 2000 or 2001, so it was probably time. My 'script has not changed much which is a good thing, but new glasses still mess me up. Headaches, dizziness, nausea, the full range. Ya, it's wonderful.

My second pair of glasses are sunglasses, which I was very much looking forward to. They are polarized, which is not something that I have had before. It's somewhat freaky when I see tinted glass because I see all kinds of colours that you can't see normally. Trippy.

Tuesday, 6 March 2007

Implement to the spec - Being too defensive

I am all for writing code that is defensive. There are lots of little tricks as well as tools to check for mistakes. However, like most things you can take it too far.

I feel that I work best with examples, so here we go. Let's say we've got a method (in our code) with a signature as follows:
/** Returns a collection of Users. */
public Collection getUsers();

Here's code that I don't agree with:
Collection users = getUsers();
if (null != users) {
foreach(User user : users) {
if (null != user)
// do something
}
}

If we follow Item 27 from chapter 6 of Effective Java (wonderful book), then we're going to just return an empty collection so we don't need the first check for null. Since we control the code for the method getUsers(), we can make it part of the spec that it will not return null user objects, so the second check for null is also unneeded.

It's good when code guards against weird things, but in this case the code is potentially hiding wrong behaviour. Instead of putting guards in the client code, beef up the tests for the getUsers() to ensure that it will operate to whatever spec you create for it. The client code would cleaner and easier to read.