Archive for August, 2006

Trying out Zooomr for blog photo hosting

August 27, 2006 3:10 pm

Zooomr has an offer to upgrade bloggers to free pro accounts. I’m wondering how practical that is. So here’s my test post for a photo I took recently while making a visit to Microsoft (and doing some Seattle sightseeing). It’s a reflection of the Space Needle in the Experience Music Project building.

IMG_7470IMG_7470 Hosted on Zooomr

CompositionTarget.Rendering can be a CPU hog

August 23, 2006 9:12 pm

I ran into an issue where my WPF application would consume about 20% of CPU time just sitting idle on a Page. A question from Tim Sneath led me to investigate an aspect of the app that uses the CompositionTarget.Rendering callback to do some animations that can’t be done in other ways in WPF right now.

I had several UIElements that each had the Rendering event hooked up, and the code in the event handler would do next to nothing most of the time, since the animation only was kicked off on a mouse up event. I modified the code, so that the event hookup doesn’t happen until the mouse up event comes in, and also so that an unhook happens when the animation is finished. This promptly took down the CPU load to the typical intermittent 1-2%.

Boeing shuts down in-flight Internet access division

August 17, 2006 9:49 pm

According to this news.com story, Boeing is shutting down the division that built the in-flight Internet service Connexion by Boeing.

One of the airlines that picked up the service was Scandinavian Airlines. They charged $29.95 for Internet access during transatlantic flights.

Gee, let’s do some math: The flight from Seattle to Copenhagen probably takes about 12 hours. So that’s about $30/12 hours = $2.50 per hour. If you pay $46 for high-speed access at home per month (an expensive average, perhaps?) that’s $46/720 hours = $0.063888 per hour, or about 6 cents per hour (taking a month as 30 days, 24 hours a day). Even if you make the comparison a bit fairer by admitting that you don’t use the service 24 hours a day, but perhaps only four, that still is $46/120 hours = $0.38333 per hour.

Who at Boeing thought that people would be so hungry after in-flight Internet access that they would pay between six and forty times more than they do at home?

This quote tells you there seems to not have been much thought behind the whole thing: “Over the last six years, we have invested substantial time, resources and technology in Connexion by Boeing,” said Boeing Chairman and Chief Executive Jim McNerney. “Regrettably, the market for this service has not materialized as had been expected.”

Remember to unhook those event handlers!

August 7, 2006 3:13 pm

I thought I’d make my first post not just a “hello out there”, but something that’s marginally useful to some people. 

If you’re writing a Windows Presentation Foundation app that has just a little bit of complexity to it, you may do things like hook up UI Elements to event handlers. This could be for navigation, reacting to data changes, timers etc.

An important thing to remember is to unhoook those event handlers when your UI Element is unloaded. Otherwise the event handler hangs on to the visual tree and the garbage collector will not let go of it. This results in memory consumption “problems”, which is a nice word for a “managed memory leak”.

So if you do something like this:

public MyElement()
{
  InitializeComponent();
  Loaded += new EventHandler(OnLoaded);
}

public void OnLoaded(object sender, EventArgs e)
{
  myTimer.Tick += new EventHandler(OnTick);
}

Don’t forget to also hook the Unloaded event and do this in it:

public void Unloaded(object sender, EventArgs e)
{
  myTimer.Tick -= new EventHandler(OnTick);
}