Tuesday, 30 May 2006

Dangers of biking to work

The biggest danger biking to work isn't biking in traffic. It isn't the cars, vans, dilivery trucks, buses, or other bikers. It's the people walking along listing to their music. I try not to bike on the side walk, but there are a few places where I have to (along the transit way). Now, I understand why if you're listening to music you might not hear someone ringing a bell. But for frigging sakes stay at one side of the path! And I don't care which one, just pick one!

I think that it would be easier to avoid drunks in the market on Saturday night than "normal" people walking along not paying any attention to the world around them. *sigh*

Monday, 29 May 2006

Happy Year 3!!

It's been 3 years so far... I guess this is the last year that this anniversary will be important... ;-)

Sunday, 28 May 2006

T minus 363 d

We just passed our negitive one year anniversary. Weee!! Needless to say, wedding planning is on our minds. I just find it so weird though... some of the traditions of a "typical" wedding don't feel applicable to us. I guess we're part of the "new norm" of couples living together for a couple of years before tying the knot.

Examples? Well, like not seeing the bride before (or on) the wedding day. Or picking out gift suggestions for "our new life" together when we've already bought everything that we need or use for day to day. What about invitation's? Most communication I have about parties is done with email or by phone. What's so bad about sending out an e-invite for people to come? *sigh* I think that I just don't get it. I know it's a very important day, but sometimes I feel that we're asking the barber if we need a haircut: they'll always say yes.

Thursday, 25 May 2006

You can't compare two Booleans...

I've been tracking down a problem with the CompareToBuilder that's part of commons lang. If I had a boolean in my class, and if used the reflectionCompare method it was throwing a ClassCastException. It didn't make any sense to me.

Then I took at look at the source (soooo useful!) and I finally figured it out I think. (btw, a great site for seeing source of OS projects is this one).

At one point in the commons lang project they have this line:
comparison = ((Comparable) lhs).compareTo(rhs);
which was throwing a ClassCastException. Both lhs and rhs are "Objects". Can you see the problem?

When doing something reflexivly Java casts primitive types to their wrapper types (boolean become Boolean and int becomes Integer). I'm using Java 1.4.2 and Boolean doesn't implement Comparable. Doh!

Sometimes I really wish that they just made compareTo part of the Object class...

Friday, 19 May 2006

Thursday, 18 May 2006

There's always an excuse...

I can always find an excuse for not running, biking, going for a walk, ... just about anything. My excuse this week? I don't want to bike in thunder showers. And every day this week they have said that it will!! Grrr.... arrggg... I should just suck it up. *sigh*

Tuesday, 16 May 2006

Nice

I gotta get me one of these... it's more than meets the eye. ;-)

Monday, 15 May 2006

Sorting it all out

One of the things that I learned in the last month or so is that sorting in different languages, with accented characters, isn't the same. :-( I'm going to outline a case-insensitive example in Java and Oracle and my experience with that.

With Oracle as a back-end, if I wanted to order by a String column I would call the upper (or lower) method on the field to return a sorted list. I knew that this was a bit of a hack because some (European?) languages have strange conversions from upper to lower case. I remember reading that's why they made XML case sensitive...

So, with the work that I was doing I run some sql (or hql) with something like "... order by (UPPER(col_name))" and in my test suite I would check that it was sorting correctly by using a case insensitive comparator. Now, to find out that it will not work you just have to read the documentation. But course I never thought that it applied to what I was doing.

Here's an example: if you have the names "BÈretta" and "Butler", the default in Java and using upper in the db are both to return "BÈretta" after "Butler". Not correct in a French locale.

To sort it correctly in Oracle, you should do something like:
"order by nlssort(col_name, 'NLS_SORT = FRENCH')"

To sort it correctly in Java, you would have to use a collator like the RuleBasedCollator. Example:
Collator collator = Collator.getInstance(Locale.CANADA_FRENCH);
// make the ordering case-insensitive
collator.setStrength(Collator.SECONDARY);

The Collator is actually very interesting because you can put different emphasis on different parts of the sorter. Really kind of cool.

Friday, 12 May 2006

Security over Freedom

Pretty much this whole /. thread is a good read, with the following being the best part:

"The masses almost always value security over freedom until they have so little of either a revolution is born."

WotD: wonks

New word for me: wonks. It's not what I thought it would be...

Sunday, 7 May 2006

Why use an applet?

Okay, I don't get why the census 2006 requires you to have the Java JRE with specific browsers and OS's. I don't get why they can't do this kind of thing with just the browser. What's not good enough with the encryption that the banks and just about every online presence uses? Why do I have to run an applet to fill out a form with radio buttons and text fields? PITA.

Maybe there's a great technical reason for it, but from my point of view it's just inconvenient, annoying and makes me think that it was a "lazy" decision. Stupid heads...

Saturday, 6 May 2006

Serenity

I was out in the Ottawa River today paddling around in a kayak in the rain. Only for like 5 minutes, but I felt such a sense of serenity just to be out in the water for a couple of minutes. *sigh* That's something that I'll have to work in my daily routine. I could do with the peace.

Btw, it looks like Serenity is a popular boat name...

Thursday, 4 May 2006

Happy Star Wars Day!!!

Everyone loves Star Wars Day, which of course is May the Fourth. hahhaha... God, I love that joke.

Another interesting fact:
This morning, at precisely one hour, two minutes, and three seconds after midnight, it is the last time in 1000 years that the time and date can be written as:
01:02:03 04/05/06.

Wednesday, 3 May 2006

For those Amazing Race fans...

I think that they would like this quote from Carissa Gaghan (from TAR 8)
Monica is a big sissy pants because she is afraid of a little crayfish. Maybe when she was little some big bad crayfish stole her lunch money.
hahahaha.... gotta love the 10 year old making fun of the 20 (?) something chick... too funny.

Tuesday, 2 May 2006

hee hee...

Ah, someone that hit the nail on the head commented on /. about the Nintendo changing it's new console's name from "Revolution" to "Wii"... too funny...

Taking at day off...

It looks like it is an awesome day to run, but I'm skipping it today. Biking into / out-of work is a bit of exercise, but adding a run everyday to that might be too much at first. I think that I'll run tomorrow after I have given my legs some time to rest up.

Next step: to get some cycling panniers so I don't have to wear a backpack which is hard on the shoulders and makes things a bit more difficult. I'm looking at a couple at mec: option 1, option 2. They are going to be about the cost of one month's bus pass, so I think that I am okay with the cost. ;-) What I'll try and do this weekend (at the latest) is some general bike fix-up including putting on the kickstand that I bought last year. Only time will tell if I get my ass in gear and get this stuff done. The possibilities are endless now that I have paid my taxes.... :-P