Tuesday, 26 June 2007

Google Apps IMAP Importer

I just received this notification from the folks at Google about a new Google Apps feature :

Email migration

We know that some organizations have been reluctant to switch to Google Apps because they did not want to make the transition and leave valuable data behind. If you've yet to fully deploy Google Apps in your organization, the switch just got a lot easier.

As of today, Google Apps domains on the Premier and Education Editions have access to a new migration tool that makes it easy for administrators to transfer all their users’ email data from an IMAP server to Google Apps. Using the new migration tool is easy. Just click here and follow the instructions (this link points to the 'Advanced Settings' tab of the control panel). After migrating your email, each message displays the original sender, recipient, and date. The folder structure of your old mailbox is translated to Gmail labels.

Super cool! I use Google Apps to host my email on my headsphere.net domain and was always quite keen to have all my services out on the GoogleCloud, but since about 2001 all my email was on an IMAP server at fastmail.fm. Up to now there was no (easy) way of importing my mail archive from Fastmail into Gmail. Now all I need to do is upgrage my Google Apps account to a premium account($50USD) and import away!

Monday, 25 June 2007

Dramatic Chipmunk

Just to ensure that everyone that I care about has seen this video (otherwise I would be being remiss in my duties ) here is the funniest five second video you will ever see on the internet:

You're welcome :-)

Monday, 18 June 2007

Ohakune Hoonery


Decided last week at kinda the last minute to head up to Ohakune for the weekend. Jenny and others were all amped about the Ohakune Mardi Gras, although because I had been before I knew just how tacky the whole affair is and was less than enthusiastic about it. But basically describing a chain-link fence enclosed street, death trap carnival rides, hot dog stands, quality youth music like 48 May (??), and five hundred drunken delinquents from Raetehi a 'mardi gras' is a bit of a stretch in my opinion.

Anyway, a fun time was had by all, and we did at least get to go for a bit of a hoon on the bikes out in Erua Forest. Click on the pic for the rest of the photos:

Erua Forest Biking

Thursday, 14 June 2007

Disabling Cell Broadcast on the MC70

There appears to be a 'fault' on the Symbol MC70 where when you setup a GSM connection on the device, the OS will decide to incessantly alert you the current cell the device is connected. Suffice to say, this gets very old very quickly. Apparently this is not the default behaviour, however there is a workaround.

Setting the following registry key on the device will disable these messages:

[HKEY_LOCAL_MACHINE\Software\Microsoft\RIL]
"EnableCBM"=dword:0 ;## enable/disable : 1/0

And don't forget to do a soft reset on the device so it picks up the new registry value.

Even better, what you can do on on your app's CAB installer is configure it so this registry key is set up every time you deploy your app to a new device:












Voila! This way you don't even need to think about it.

Friday, 8 June 2007

The Robot War

I know I'm probably the last person to discover this web comic, but XKCD is my new favourite:



Awesome :-)

I think this guy may have actually trumped Ryan North from Dinosaur Comic fame as my new favourite nerdy web comic artiste.

Sorry Ryan.

Flight Mode with Low Battery

A frustrating and seemingly undocumented (well I can find the documentation anywhere) aspect of Windows Mobile 5 is to do with the flight mode. We had a user that reported a whole bunch of transactions that never got sent to the server at the end of a day's work. He had been working for six hours or so, and all previous transactions had been successfully transmitted to the web server, yet all of a sudden, the last transactions of the day ended up sitting on a queue in the device.

After much investigation it turned out that as the device battery got to a certain level, it decided to activate Flight Mode, and obviously deactivating the GPRS connection, putting our app into offline mode. The only notification the user received (so he says) was the little Flight Mode icon on the top of the screen.

Obviously this is a 'feature' as the WM team must have decided that after the battery gets depleted to a certain state, the device does what it can to conserve juice, the first thing being switching off all battery-sucking network activity. Nice feature, but what if this is the last thing you want?

My question to the Internets is, is it possible to switch this feature off? Is there a registry setting or a P/invoke or a a utility somewhere I can use?

Thanks Internets.

Controls not disposing causing memory leaks

Well in line with my last post one of the reasons for one of the many (many) memory leaks we encountered was due to controls being added to a form programmatically, and then being 'cleared' but not disposed e.g. Controls.Clear(). Turns out this *doesn't* actually free up the memory that these controls use, all it seems to do is remove the objects from the collection. To ensure those controls do actually get removed and GC'd you've got to individually Dispose() them as well, which led to this helper method:

private void disposeControls(ControlCollection controls)
{
for (int i = controls.Count - 1; i >= 0; i--)
{
Control control = controls[i];
control.Dispose();
}
controls.Clear();
}


You'll notice we do a reverse iteration of the controls in the collection, because if you started at the beginning, every time you dispose a control it actually shifts the other controls in the collection down one index, causing only about half of the controls to be successfully disposed.

Thanks to this guy for the tip.

Remote Process Monitoring on the Symbol MC70

When doing some memory leak hunting on a Compact Framework 2.0 application my team has developed, I decided to use some of the stuff that I learned at MEDC last month. Specifically using the Remote Performance Monitor tool (RPM) that was shipped with CF2.0 SP1. I'm not going to explain how to use RPM as there is a pretty good explanation of it here, however there was one gotcha I discovered when trying to profile our app on the Symbol MC70.

The issue comes down to the security configuration of the device that you are trying to profile on. Typically operator-supplied devices will be locked down to a certain degree, preventing what you can and can't do on them. However devices supplied from vendors such as Symbol, Intermec or TDS typically are not locked down, letting the developers do what they want with them.

The issue I encountered was when following Steve Pratscher's instructions to get RPM running, one of the steps for WM5 devices is to use the rapiconfig utility to provision the appropriate security settings. However when executing 'rapiconfig /p rpmprov.xml' as per his instructions all I ever got was:

Config failed (0x80070005): Access is denied.

Some googling determined that the reason for this is the security policy of the device was preventing rapiconfig from functioning. The way to fix this is to enable RAPI by manually editing the policy in the device registry (thanks Stuart Preston).

To do this, cradle and ActiveSync the device, use RemoteRegEdit edit the following values:

HKLM\Security\Policies\Policies\ Values\00001001 = 1 (decimal)
HKLM\Security\Policies\Policies\ Values\00001005 = 40(decimal)

And do a soft-reset.

At this point I was able to provision the rpmprov file using rapiconfig, use RPM to start up and profile my app, find the memory leak, boost the performance of my app, and then eventually showered in praise and gifts from the users.

Warning: Results may vary

:-)