Monday, 30 April 2007

A guys day

My brothers took me out yesterday to the "Guy Show" at Lansdowne. Pretty cool... lots and lots of expensive toys like jet skis, boats, trucks, bikes, and 4 wheelers. I took a picture of a dinner room table that you can remove the top and it's a pool table. Awesome. I always find that those shows are more about dreams than reality, but they are cool none the less.

After that we went over to top karting in hull. I can still smell the gas fumes when I think of it. I had no idea how physically hard it is. My muscles are killing me today. Not that I am a super good driver, my brothers lapped me twice. Then for dinner I got yummy ribs as we reviewed how to drive the track.

So, it was a good day. ;-)

Saturday, 28 April 2007

Can I wait?

My computer is driving me nuts. It's sooooooooo slow. Really, all that I can do with it is use firefox. If that's all I'm doing, it's okay. I was waiting for leopard to come out so that I wouldn't have to pay for the upgrade. I'm not sure that I can wait till September. Is my sanity worth the cost of just getting a new computer now and eating the cost of the upgrade?

Right now I am scanning some old family photos... it's very slow going. A lot of time just waiting for the computer to respond back. For example, in windows explorer, right clicking, I have to wait 15-20 seconds for the menu to show up. Never mind the time it takes to scan the photo.

*sigh* I may break down in the next while and just buy a mac. I don't think I'm going to go cheap either. Lots of memory, lots of disk space. We'll see.

Friday, 27 April 2007

Social networking

Lately I've been getting a lot of invites from friends for me to join crackbook and LinkedIn. So far I have resisted joining the "social networking scene" for fear that it would eat up more of my free time. Granted, I always find ways to use up time when I should be doing other things (eg. blogging instead of making dinner). Am I missing out on why these sites are so good? Probably.

Currently my online presence is email, this blog, and flickr. No more icq or msn for me. I just sort of lost interest. Am I being antisocial? Perhaps. At this point I figure that I'll just break down one day and make an account... probably in the summer sometime.

Damn kids and their new fangled social networking...

Thursday, 26 April 2007

Exercise prevents crazy

In higher stress times, exercise is a great way to reduce the amount of crazy. No exercise? More than enough crazy to go around...

On an unrelated note, I get married one month from today.

Wednesday, 25 April 2007

i18n in a java web app

There are at least a few strategies for supporting different languages (i18n) in a web app. These strategies are for non-constant data the the user controls which could change from request to request. For text that doesn't really change, it's best to use whatever i18n strategy that the MVC you are using recommends (ResourceBundles). I'm going to outline a few with the pro's and con's of each.

1) Walk the model
When you are passing the model to the view, you "walk" all of the objects, telling them what language they are supposed to display. The jsp is simple because you have just one "write" tag that is language agnostic. The bad part is that for every request you have to make sure you walk everything that's in every scope and make sure the model knows what language the request is. Not easy, and very error prone.

2) View knows what what it speaks
The objects have methods for every language it supports. This means that the jsp's know what language the request is, and for every language that it supports there is a if / else clause to print out the correct text. This isn't so bad if you are supporting 2 languages. It's not something that you could use if you were supporting many languages though. It leads to messy jsp's and having to test the view for every language to ensure that it is rendering correctly.

3) Threading? Keep it local.
Using a static member is out since that would be shared across the jvm, not something you want for a multi threaded app. However, there is something that allows you to use static-like access while still being thread safe: ThreadLocal. This means that you can leave your view clean, and you don't have the complicated task of of walking the model. Through a filter, you can set what the language is and then you are just coupling the model to a "language helper" that has a ThreadLocal member. One downside is that each model object will have logic for every language to support, for every field. Not too bad, since you have to put it somewhere, and with this method you only do it in one place.

I've always used #2, but have never really been happy with it. I have not used #3 yet, but I have seen it used. When I saw it I had one of those "why didn't I think of that!" type of moments. I'm looking forward to making my code cleaner. ;-)

Dry humour

I don't think that I would have been so cool if my performance was interrupted like Mike Daisey's was. I think that it's funny that he asked the protesters to stay and discuss why they were not happy. Well, it looks like those protesters just helped make him famous. What's the line: "I don't care what you write about me, just spell my name right"?

Tuesday, 24 April 2007

The Machine is Us/ing Us

The other day at work I saw a really cool video and thought that I would share. It's worth 5 minutes.

Monday, 23 April 2007

Windy enough for ya?

Ya, the wind is pretty strong. A street light was blown down on my path home and the wind almost blew me off my bike a couple of times. It's a weird thing biking on flat grown, braking at a medium pace and actually accelerating. I didn't know if I would be able to stop at the intersection. Yay spring storms. :-/

Sunday, 22 April 2007

Sudden Spring

You know that spring has come up suddenly when you have winter boots and sandals by the front door, and you're not sure if you should put either away.

Sunday, 15 April 2007

Wedding dress vs. a Tux

One thing that I find really funny is how different the experience shopping for clothes is for me and for Laura for the wedding. Men rent their outfit, women have to buy it. Cost for a guy, less than 150 $ for everything: shirt, pants, jacket, shoes, ... A wedding dress (just the dress) is hundreds, if not thousands of dollars.

When Laura picked out a dress, they ordered the dress and I think that she's gone in for like 3 fittings with more to come. For a guy, one measurement, try on an outfit with the same size and the assumption that when you an order something of a size, that's what you will get. And it's not like you can see the whole piece of clothing. For a vest: you get a bunch of 1/4 vests on a binder ring and you pick them out like you'd pick out a paint colour for a room.

For a woman, the wedding dress is supposed to be the most important part of the wedding. The man is supposed to show up in something clean. Well, honestly, the guy is supposed to be in whatever the the woman wants him to be in. I was told "no" to wearing jeans, that's how I know that.

I'm just amused by the huge difference between what is expected of a man and a woman for a wedding.

Friday, 13 April 2007

This is Why You Shouldn't Clean Your HDTV with Windex

Wow. I never knew how much you could screw up your tv by using a liquid cleaner on it until I saw this. Sucks to be that guy. I think that I'll follow his lead and just yell at anyone who gets too close to the tv. As it is, I'm not using the power button on the tv itself for fear of zapping it (again).

Next thing you know I'll be yelling at those damn kids to stay off my lawn!

Thursday, 12 April 2007

Is it too late?

Sometimes /. has some pretty powerful comments. I like this one and someone's follow up.

Governments lately are scaring me more and more. With them being able to report on every aspect of our lives, does that really prevent terrorism or just increases people in power's ability to stay in power. Was Orwell just off by 20 or 30 years?

Orwell's London neighborhood covered in spy-cameras
Korean War hero branded a terrorist

Update: another interesting link: what Lee Iacocca thinks about what's happening in the states now.

Friday, 6 April 2007

I can't hunt ducks anymore

I'm a bit sad since I can no longer hunt ducks, using duck hunt of course. Our old crt tv bit the dust close to 2 months ago and we got a lcd tv. I'm not sure what makes it unusable, if the tv's response time is too slow or what, but it doesn't work. I guess that I'll just have to keep on playing Dr. Mario on the NES. If I want to play duck hunt again I guess that I'll have to pick up wii play. But Super Paper Mario will come first. ;-)

Wednesday, 4 April 2007

Getting back into the spin of things

Yesterday was the first day of my biking commute season. Wow, it's a lot harder than how I left it off last season. It's remarkable how fast you can get out of shape. Ah well. Pretty soon I'll get back up to where I was and it'll be all good.

No biking today as it's like 6 degrees C and pouring rain. Ah, spring...