Thursday, September 27, 2007

Why you should get a dog

The folks at Four (or Five!) Reasons Why have a list of why you should get a dog. Briefly:

1. A dog could save your life.
2. Having a dog is a great way to get some exercise.
3. Dogs are good company.
4. Dogs come in all shapes and sizes.

I have no argument with the list, but like everything else, you have to take the good with the bad.

Like when they lock you out of the house on New Year's Eve. In the snow.

Or when they catch and eat (most of) a rabbit in the backyard.

Or when they get a violent case of stomach problems, and nobody's home to let them out.

Or in the spring, when the melting snow reveals a winter's worth of "treasures".

And I haven't even told you about the time my dog nearly caught a skunk in the backyard. She sure got close enough to discover how skunks protect themselves though...

A peaceful morning

Those of you with no children, or with only one child, don't know what enjoyment you're missing.

This morning, the girls are sitting beside each other at the dining room table eating breakfast. The six-year-old moves to a different seat, to get away from the three-year-old.

V: I'm moving over here - she's bugging me!

F: I'm not bugging her!

V: Yes you are! Stop bugging me!


And with that, I ran to the basement to hide out with the dog.

Tuesday, September 25, 2007

Exciting product announcement

Our recently announced ShockBerries product has been selling beyond expectations. Hot on the heels comes this week's exciting product announcement - the "SquawkBox 2007". A must-have for every manager, the SquawkBox will translate your every word into management-speak.

For example, you say:

"When this fucking company finally decides what we're supposed to work on..."

the SquawkBox intercepts this career limiting verbage and instead your colleagues hear:

"When we gel our roadmap..."

or, you're in a meeting where all hell is breaking loose. Everyone is panicking and looking for someone to take the blame. You say:

"Hold on a fucking minute. Give me a chance to get my people to fix the damn product."

the SquawkBox says:

"We need to come up for a breath of fresh air, smell the numbers, and actualize our Tiger Team."

On sale now. Shipping guaranteed by Christmas! Order today to ensure your choice of colour.

Monday, September 24, 2007

A chill in the air

It's been a little chilly for the 6:00am dog walks lately. The leaves are turning. That must mean one thing - it's time for curling season. (OK, it's going to be 30 degrees tomorrow, but cooler later in the week).

New pants? Check.

New gripper? Check.

Instructional material from the CCA? Check. My daughter is starting to curl this year, and I'm going to help out on the ice with the instruction. At least I hope I am more help than hindrance...

I'm hitting the ice next week for the first time this season. Hopefully the summer of 12oz. bicep curls has made me ready for action.

Wednesday, September 19, 2007

Welcome to The Google

Google officially moved to Waterloo today, with the announcement that they're taking some space in the University of Waterloo's TechTown office. Of course, Google has been here for a couple of years, but now they've got their logo plastered on the wall. Rumour has it that a Google building is in the works.

Today's announcement was quite splashy. Lots of UW folks and politicians of all stripes (not surprising, given the fact there's an election campaign underway). I think I looked a little out of place, hiding at the back of the room in my T-shirt and shorts. I was told it was a low-key announcement. Ahem, not so much.

Anyway, I for one welcome our new Google neighbours. Just stop hiring all my smart colleagues.

Did you mean 'Search for something?'

Someone's asking if we're building with the /3GB switch. I don't know if there's an option for building a C# application using that, so I head to the MSDN website and try a search.

And people wonder why Google is kicking the shit out of Microsoft?

Feature or creature?

I sadly claimed at some point that this blog would feature the occasional snippet of software development. It's been a little lacking. Here's what I've been up to lately.

Let's play a little game called "Feature or creature?" It works like this - I'll describe a software problem and we'll try to decide if the behaviour was intentional (a feature) or a bug (a creature).

We have the ability to associate a scanned image to a radiology request. This is frequently used when a paper-based system collides with a computer-based system. For instance, Dr. Haywood writes up a request and sends the patient into the hospital. The hospital scans the piece of paper and it becomes available in the PACS client.

The sheets of paper are occasionally scanned sideways, or upside down, so we have the ability to rotate and flip them. We can also zoom them to fit the width or height of the display area, and we can invert them to make it easier to read.

Zooming in and out beyond the width/height of the display area is also supported. Except when it crashes. One of our testers reported that he was able to zoom in four times, but on the fifth zoom the application crashed. I tried it here, and of course it worked. When I tried it on his server, it crashed. I took a closer look at the request he was zooming. It was a jpeg image, 1760 x 2800 pixels. Quite large.

The stack trace from the crash was not much help.

Exception: System.ComponentModel.Win32Exception
Message: Not enough storage is available to process this command
Source: System.Windows.Forms
at System.Windows.Forms.DibGraphicsBufferManager.CreateCompatibleDIB(
IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
at System.Windows.Forms.DibGraphicsBufferManager.CreateBuffer(IntPtr src,
Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
at System.Windows.Forms.DibGraphicsBufferManager.AllocBuffer(
Graphics targetGraphics, IntPtr targetDC, Rectangle targetBounds)
at System.Windows.Forms.DibGraphicsBufferManager.AllocBufferInTempManager(
Graphics targetGraphics, IntPtr targetDC, Rectangle targetBounds)
at System.Windows.Forms.DibGraphicsBufferManager.AllocBuffer(
IntPtr target, Rectangle targetBounds)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(
IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Looking at the code, I found something a little odd. We're showing the image in a PictureBox. Harkening back to my Visual Basic days, I remember that PictureBoxes are nasty little things, but sometimes you have no choice but to use them. Now, in the brave new .NET world, there really is no need. Why not just paint the image on a UserControl?

I quickly changed the zooming class to derive from UserControl instead of PictureBox, and the crash disappeared. All I was left with was a bit of flicker. That's easy to fix, I thought. I added these lines:
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint, true);


and boom! The crash was back. Now I head to Reflector, to see what the PictureBox is doing. Aha!

The PictureBox constructor is setting the DoubleBuffer style. I removed the style setting, and to get rid of the flicker, I added this to eat the background paint message:
protected override void OnPaintBackground(PaintEventArgs pevent)

Problem solved. I vote "creature" - a bug in the DoubleBuffer handling, down in the .NET code.

We now return to camping, curling and sick humour.


Thursday, September 13, 2007

Electrifying BlackBerry add-on

Do you ever find yourself in a meeting, when all of a sudden you are uncontrollably drawn to the vibrating BlackBerry on your hip?

Or maybe you're at a movie? Or in the grocery store? In school? At a funeral? In church?

Announcing the product that will let you reclaim your life - the ShockBerries behaviour modification system.

Simply attach one end of the ShockBerries system to your BlackBerry, plug in the tiny battery pack, weave the wire through your pocket into your trousers and attach the alligator clips firmly to your, er, berries.

Now when your BlackBerry begins to chirp or vibrate, you will resist the urge to do a "Quick Draw McGraw". If you do happen to give in to the call of the BlackBerry and remove it from the holster, you will receive a gentle 18 volt shock.

When you get up off the ground, replace the BlackBerry in the holster, and carry on with your day.

Simple, effective, and now new and improved, with no more lasting damage.

The ShockBerries behaviour modification system - available at finer electronic stores everywhere.

Weekend to End Breast Cancer Photos

As promised, here are the photos from the 2007 Toronto Weekend to End Breast Cancer.

The full set is available here.

Opening ceremonies

The starting line

End of Day One

Hitting the road on a soggy Day Two

Princess Margaret Hospital


The finish line!

Lotus Notes error message of the day

Here's the Lotus Notes error message of the day.


Wednesday, September 12, 2007

I hear that train a comin'

I have a new management technique to share with you. It's called the "head in the sand" approach. It doesn't work so well for actually getting software shipped, but it's remarkable for the positive effect it can have on your career. While others around you are spiraling downwards, you will be receiving accolades for your "take action" manner.

Here's how it works. Bad news is not acceptable. Telling the truth is not good for your career. Nobody wants to hear bad news, because their boss doesn't want to hear bad news.

So the trick is to refuse to hear bad news. When your development team leads start warning you about an impending train wreck, just tell them to stop being so negative. Lay a "dude, you're harshing my mellow" on them. Tell them to go away and just make it work. If they get annoyed, tell them they need to work on their teamwork skills.

Later on, when the impossible schedule finally slips, or the buggy software explodes embarrassingly in front of an important customer, you can pretend this is the first time you've heard of this. Start jumping up and down, yelling "THIS IS UNACCEPTABLE!" Make sure the powers-that-be know you're in total control of the situation, and that you'll make sure heads roll for this awful sandbagging you just took. Management will nod approvingly, and you'll go up a notch in their books.

Trust me, I've seen this one work for years. It's foolproof.


Monday, September 10, 2007

Weekend to End Breast Cancer - recap

The 2007 Toronto Weekend to End Breast Cancer wrapped up on Sunday afternoon at the Direct Energy Centre. That was a fitting place to hold the closing ceremonies, as the building was shaking with energy.

The final block of the walk was lined with supporters and other walkers, cheering on the participants as they crossed the finish line. Several walkers were in obvious pain as they came to the end of the 60km route, but every one of them flashed a smile at the cheering crowd and there were lots of high-fives and hugs from family and friends.

Once everyone had finished, the action moved inside, where the supporters were seated in bleachers around the outside of the hall. Everyone was on their feet as 5,521 walkers came in to wild cheering and applause. The last group in were the survivors who were walking this weekend. There were many more than I expected, and there wasn't a dry eye in the house as they made their way into the crowd. Jennifer told me that in the arrival area outside the hall all of the walkers were lined up to congratulate the survivors, and it was an extremely emotional scene. It's one thing to walk 60km, but it's even more impressive to have beaten cancer, or be coping with it, and still finish the walk.

This year's walk raised 17.3 million dollars, which will be used by the Princess Margaret Hospital to carry on their world-class research, treatment and support programs.

CityTV was on the scene to cover the action at the kickoff on Saturday, and the finish on Sunday.

I will post some photos in the next couple of days as they make their way off the camera to the digital world.

Thursday, September 06, 2007

Weekend to End Breast Cancer - It's here!

This is the big weekend. After a long spring and summer of training, my wife Jennifer is walking 60km in the Toronto Weekend to End Breast Cancer, in support of Princess Margaret Hospital.

Jennifer's original goal was $2,000. With the help of lots of friends, family and coworkers, she's raised nearly $3,000.

There are thunderstorms in the forecast for Saturday, but that won't deter the 5000 walkers. The girls and I will be cheering at the finish line on Sunday afternoon. If you're in the Toronto area on the weekend, come on down to the Direct Energy Centre (CNE grounds) and be a part of this fantastic event.


Wednesday, September 05, 2007

The fastest four years of my life

My youngest daughter went to "big kid" school today. She's in Junior Kindergarten this year. How did I miss the last four years? I feel like Rip Van freakin' Winkle. Seems like one day I'm watching her birth, and the next day I'm walking her to school.

I think that time accelerates as you have more kids. My older daughter is in Grade Two this year, but that seems about right. Although, she's starting to count how many more years it will be until she's old enough to drive...

Long Point Provincial Park

We spent the Labour Day weekend at Long Point Provincial Park, on Lake Erie. Long Point is a huge sand spit that pokes out into the lake. The campground is nothing special - the trailer sites are wide open, with a few tall poplars for shade. The tent sites are in the dunes, which would be cool, as long as you don't get stuck trying to get in or out of the site.

The weather was spectacular all weekend. Sunny and warm, with warm water. Monday was windy, and we were all body surfing for about an hour.

Tonight, I winterize the trailer. Sad sad sad. We camped for four full weeks this summer, plus a couple of weekends. 34 nights in all. I guess that's alright.