Wrapping up a contract

This is my last week at my current employer. I’ve been spending most of my time updating the Wiki, doing some last minute branding changes, commenting code and general housekeeping.

The project I’ve been working on for the last 18 months was called “Automation of Movements” – nicknamed to AoM. I came across the little gem that Dave posted to the project Wiki very early in the development cycle.

The AoM Team

Ten years ago, a crack IT-commando unit was sent to prison by a static code analyser for a bug they didn’t create. These men promptly escaped from a Triple-DES security stockade to the Adelaide underground. Today, still wanted by the government/higher education and private sectors, they survive as developers of fortune. If you have a software problem, if no one else can help, and if you can find them, maybe you can hire… The AoM-Team.

Gold Dave, pure gold.

New Opportunities

I’ve lived and worked in Adelaide for my entire professional career. I’m lucky enough never to have been without interesting work to do. In fact I look back on some of the positions that I’ve had and I feel very lucky. There is no doubt within my mind that the Adelaide job market has been very kind to me over the years.

However, I feel that maybe the time has finally come that I need to look further afield to make the next progression in my career path.

With my current contract coming to the end its been time to think about what may lie ahead. This contract lasted 18 months and all the feedback we’ve had (dev team, business stakeholders and end users) has indicated that the project was a resounding success. I can vouch for the fact that this unanimous approval is more unusual than common and hence makes the feedback even more rewarding.

Something else that I can take away from this project is that I thoroughly enjoy working with a team of high calibre developers. It would be true to say that I have learnt a lot from them over the course of this project. When the team was originally formed I had some concerns about how effectively we could work together given that the team structure was so “top heavy”. We had four guys that would normally have held lead developer/architect positions and only two “juniors”. It turned out that my fears were unfounded and we managed to work very well together – each of us seemingly effortlessly taking charge of one component of the project and managing the resource pool of juniors among us. There were plenty of constructive discussions too. Almost every architectural decision was challenged, which led not just to a more robust product but also enabled a great deal of knowledge sharing.

So was it a perfectly executed project? Of course not. In hind-sight we still made plenty of mistakes and a number of compromises – but then again that’s probably a very healthy sign. With only 4 months to roll out version 1 of the product we couldn’t afford the luxury of too much prototyping, nor could we procrastinate on decisions that had to be made. Make an informed choice – move on.

Given the outcome of my current role its clear to me that I need to be looking for the next new challenge that’s going to progress my development. So I need to consider what that role should include right?

  • Surround myself with great developers
  • Look for an inspiring leadership team
  • Work for a software company – everyone’s mileage (kilometreage?) will vary on this one, but my experience is that a software company treats their developers well – they are the “talent”, in most other businesses they are sometimes considered just an overhead.
  • The work is challenging – almost left this one off because its just so obvious – why would anyone want to work on something that is easy – what would keep you coming to work?
  • It pays well. Sounds evil right? Well sorry but I’m a realist – if I had unlimited funds I’d write free software for a living because that’s what I love doing. Unfortunately my funds are most definitely limited.

Hmm… reading this back its probably the most philosophical blog post I’ve written to date. Not sure if its simply me getting older, or it has something to do with me writing this 11 km above sea level whilst travelling to another continent. And no it’s not a holiday – its a job interview.

Lego Mindstorms NXT 2.0

Unlike Andrew Coates I have a legitimate reason for buying a Lego Mindstorms NXT 2.0 Robotics kit. I have a young son who’s very keen on Lego and has been building his own robots out of cardboard and Sellotape for the last three months.

I must admit that I had expected to be building and programming the first few robots myself whilst my son got the hang of it all. However, that was not the case.

Here’s the robot that is currently built with our kit.


Not very impressive I hear you say? Well take the following into consideration:

  1. It was built in just over 1 hour with no instructions – including the programming

  2. It can crawl quite effectively – moving forward and backward with no wheels

  3. It is programmed to stop when it nears a wall (using Ultrasonic sensor)

  4. It has two touch sensors that operate the linked fan as programmed with two speed settings

  5. I wasn’t involved at all

It is a real testament to the Mindstorms kit that a child who has yet to learn multiplication at school (several years under the kits “official” minimum age) could put all this together himself. The bundled software for programming the robot really is that easy to use.

My only involvement was to write a simple Window Mobile application that could be used to control the robot. This is done via an exposed Direct Command API supported by the NXT 2.0 block’s Bluetooth interface.

This kit is already a winner in our house. There’s even a good blog for it here.

A New Aussie Flavoured Podcast

I’ve just started listened to the new Frankly Speaking podcast created by Australian Microsoft DPEs Andrew Coates and Michael Kordahi. The guys are new to podcasting – and in the early episodes it shows – the sound levels are all over the place. What is great about the podcast however, is that it has a really Aussie flavour – for instance did you know:

  • Australia currently has around 115 MVPs
  • Azure will be officially launched in Australia in March
  • Shane Morris (UX guy) has career aspirations

What’s great about the podcast

  • The Aussie bent – Australian guests, what’s happening in Microsoft Australia etc.
  • Laid back, conversational style – I class it an “easy listening” podcast as compared to something like Software Engineering Radio.
  • The funny Australian accents – hey its a change from most other podcasts I listen to.
  • The album art – damn why can’t I come up with that stuff? Wonder if ShaneMo had a hand in that?

What can be improved

  • Sounds levels – seriously guys – within a single show the sound levels are all over the place. Even within a single conversation the levels vary widely – presumably as people move their heads instead of talking into the mic. The second show was so quiet I couldn’t hear it over the bus even with the volume turned to full!
    Only fair to say though that each shows sound quality seems to be an improvement on the last, so the guys are learning fast.
  • Missing property metadata, they’ve got Track number, Year and Artists but I’d also like to see:
    Genre: Podcast (not “Other”)
    Album: Frankly Speaking

Developing for Windows Mobile – XAML for Win Forms

Many years ago (2004/5?) I was given the task of writing a XAML engine for System.Windows.Forms. It was a great experience and to do the job properly (I hope) it took quite some time. It had support for most of what’s available in WPF’s XAML – namespaces, markup extensions, attached properites (IExtenderProviders in WinForms speak), type converters, late bound binding, styles, triggers etc. plus a bunch of stuff that isn’t – #include, using parameterized constructors, simplified referencing etc.

In my Windows Mobile UI Framework the idea of having the capability of defining screens in XAML was kind of an afterthought. I had truly forgotten how painful it is to define UI’s programmatically. I’ve also never been a fan of form designers – I think they are slow, in-accurate and generate hard to maintain code/XAML. To this day I do 90% of my XAML using an XML editor (VS or Kaxaml).

So as per my last post I whipped up a very simplified XAML parser/renderer to use with my Mobile UI Framework. However, the latest control that I added to the framework was FormHost which allows a System.Windows.Forms control to be hosted within a DrawingElement (my UI base class). Of course when I say “hosted” the FormHost is really just acting as a placeholder so that the hosted control can be positioned during the render pass.

Here’s the code I had to add for FormHost:

using System;
using System.Drawing;
using System.Windows.Forms;
using Spencen.Mobile.UI.Primitives;
namespace Spencen.Mobile.UI.Controls
public class FormHost : DrawingContainer
private Control _hostControl;
public FormHost( IDrawingHost host ) : base( host )
_hostControl = host as Control;
if ( _hostControl == null )
throw new ArgumentException(
"FormHost must have an IDrawingHost that is a Windows.Forms.Control.", "host");
// By default we have no background or border Background = new SolidBrush( Color.Transparent ); Stroke = null; } public Control HostedControl { get; set; } public override bool SupportsRotation { get { return false; } } protected override void OnRender( GraphicsContext context ) { base.OnRender( context ); var transformedBounds = TransformedBounds( context ); if ( !_hostControl.Controls.Contains( HostedControl ) ) _hostControl.Controls.Add( HostedControl ); var newLocation = new Point( transformedBounds.Left, transformedBounds.Top ); if ( newLocation != HostedControl.Location ) HostedControl.Location = newLocation; var newSize = new Size( transformedBounds.Width + 1, transformedBounds.Height + 1); if ( newSize != HostedControl.Size ) HostedControl.Size = newSize; } } }

So pretty simple – but what was extra nice was the fact that it meant I could immediately declare my hosted System.Windows.Forms controls using XAML without any changes to the XAML parser/renderer at all.

<?xml version="1.0" encoding="utf-8" ?>

<DrawingPanel x:Name="container" DesiredSize="Unbound" Background="{null}">
<TextElement Text="Text" DesiredSize="150,60" AutoSize="True"/> 
<RectangleElement DesiredSize="50,80"/>
    <EllipseElement DesiredSize="40,70"/>
<RegularPolygonElement NumberOfSides="6" DesiredSize="80,80"/>
<RegularPolygonElement NumberOfSides="3" DesiredSize="90,70"/>
<RegularPolygonElement NumberOfSides="8" DesiredSize="80,80"/> <Star NumberOfPoints="5" DesiredSize="80,80"/> <!-- Just to spice things up - here's some WinForms controls - just don't expect them to rotate! --> <FormHost DesiredSize="240,40"> <FormHost.HostedControl> <WinForms:TextBox Text="Hello WinForms" Multiline="True" BackColor="240,255,240"/> </FormHost.HostedControl> </FormHost> <FormHost DesiredSize="240,80"> <FormHost.HostedControl> <WinFormsanel> <WinFormsanel.Controls> <WinForms:RadioButton Checked="True" Text="Is WinForms?" BackColor="255,255,223"
Dock="Top" Height="20"
/> <WinForms:RadioButton Checked="True" Text="Is MobileUI?" BackColor="255,255,223"
/> </WinFormsanel.Controls> </WinFormsanel> </FormHost.HostedControl> </FormHost> </DrawingPanel> </View>

MobileUI_Screenshot 5

Windows Mobile 6.5 Update for HTC Touch Diamond 2 (SE Asia)

Tonight I downloaded and installed the official Windows Mobile 6.5 ROM (SE Asia) on my HTC Touch Diamond 2. I’d previously used Microsoft My Phone software to back up all my personal data (excluding SD card) to the cloud. The re-install process worked flawlessly putting ringtones, contacts, favourites, text message history etc. back just the way they were prior to flashing the ROM – very nice.

However, I’d like to see My Phone do more, specifically:

  • Backup/restore mail settings (most importantly POP)
  • Backup/restore bookmarks for Opera Browser (default on HTC device) – even if converted to IE8 favourites
  • Merge duplicate contacts – the option is there on the website – but it seems to just check for exact duplicates. I want it to merge details for entries that have the same name, e.g. contact listing with IM details, another with phone, yet another with email – merged into a single contact.
  • Less obnoxious advertisements on the website.

Developing for Windows Mobile – Mobile XAML?

I’ve now included a “first cut” XAML parser (ultra simplistic) within v0.2 of my Mobile UI Framework.

Allows me to convert:

<?xml version="1.0" encoding="utf-8" ?>
<GradientRectangleElement DesiredSize="Unbound" StartColor="240,240,240" EndColor="200,80,0"/>
<TextElement DesiredSize="400,500" Foreground="200,200,200" Text="Demo" Angle="315" AutoSize="True" 
HorizontalAlignment="Center" VerticalAlignment="Center"
/> <DrawingPanel DesiredSize="Unbound" Background="{null}"> <DrawingPanel.LayoutEngine> <StackLayout Margin="8,4" Padding="4"/> </DrawingPanel.LayoutEngine> <ButtonBar Text="Animations" SecondaryText="Animate properties of graph primitives"
DesiredSize="UnboundAxis, 80" Background="{null}"
/> <ButtonBar Text="Trasitions" SecondaryText="Optimized bitmap animations"
DesiredSize="UnboundAxis, 80" Background="{null}"
/> <ButtonBar Text="Primitives" SecondaryText="Polygon, Ellipse, Image, Text"
DesiredSize="UnboundAxis, 80" Background="{null}"
/> <ButtonBar Text="Behaviours" SecondaryText="Drag with slide"
DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding DragDemoCommand}"
/> <ButtonBar Text="Layout" SecondaryText="Stack, Wrap and Radial"
DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding LayoutDemoCommand}"
/> </DrawingPanel> </DrawingPanel>


I was getting really sick of doing it the “old fashioned way”

So far I support simple value type converters (float, bool), pen and brush converters, size and padding converters, resource naming (x:Name), complex properties (DrawingPanel.LayoutEngine) and loading types from other CLR namespaces via XML namespace (xmlns:sysDrawing).

Developing for Windows Mobile – Guru Meditation

I’ve been working away for a few nights now trying to put together a simple framework for building user interfaces on a Windows Mobile device. It’s only taken a few nights to build something that I’m pretty happy with… and I was thinking of maybe even posting some source code.

It was at this moment of course that I had a visit from my Inner Guru. You know the one… that little voice in your head that sniggers impolitely whenever you struggle to convert a loop into a LINQ expression. Or when you’re hacking out some prototype code and you need to new up an instance. You know that really its going to need an IOC container, you look around, no-ones watching… in goes the explicit “new Foo()”. Immediately your Inner Guru can be heard muttering to themselves, “tut… tut.. will he never learn…”.

Anyhow, my Inner Guru popped in for a visit just the other day and we had a quick chat about the work I’d been doing on my mobile framework. The conversation went something like this:

Me: Hey – check out this framework I’ve been building for Windows Mobile – pretty cool huh?

Guru: Hmm… yes it appears you’ve made quite some progress.

Me: Yeah – look it can do animations.

Guru: Very impressive. Did you have trouble using the DirectX libraries?

Me: Ah well, err no it’s just using GDI.

Guru: Ah, I see. Does that give you full hardware acceleration on the device?

Me: Um… no I don’t think so.

Guru: Ah, I see. Commendable that you have support for an opacity on each element.

Me: Yeah, well I mean no. It seemed like a good idea at the time but I haven’t done that yet.

Guru: Ah, I see. It appears all objects support using a RotateTransform?

Me: Yeah, well I mean no. I couldn’t figure out how to rotate images an arbitrary amount with decent performance.

Guru: Ah, I see. I notice that your transforms all inherit from a base class which of course must perform the Matrix calculations.

Me: Yeah, well actually no. I mean there is a base class but I haven’t bothered implementing the transforms using Matrix math – they’re just, you-know, hard coded.

Guru: Ah, I see. It seems you’ve done some work building the framework for a layout engine that can be plugged into any container control. Seems a bit WinForms’ish to me, not very WPF like.

Me: Well I didn’t think it was so bad, although I haven’t actually written that bit yet.

Guru: Ah, I see. So no actual layout panels yet, not even the most simple stack panel?

Me: Err, well no – but it wouldn’t be hard to add.

Guru: But you haven’t done it – even though it wouldn’t be hard.

Me: Well no.

Guru: Hmm.

Me: I was thinking of posting the source code.

Guru: I see. So despite the obvious architectural flaws, the missing classes, the lacklustre performance, the questionable code formatting you feel it adequate for public viewing, or perhaps that may be ridicule? I see you’re still using foreach loops – can’t quite seem to wrap your head around LINQ can you dear boy?

Me: Umm…

Fortunately it was at this point that my Inner Guru hit an untrapped exception deep in his runtime. The following image began blinking away in my head.

I suppressed an evil chuckle and posted the code: http://mobileui.codeplex.com

Developing for Windows Mobile – Marketplace Sign-up (Part 2)

Contacted GeoTrust again and got an immediate verification over the phone. Was told that the Microsoft website would update the verified status within a few minutes. Several hours later… still waiting…

Decided to fill in the Payment section of the User Profile. Got to learning about banking Routing Numbers (not applicable within Australia) and banking Swift Codes. Have no idea whether the details are filled in correctly, but I’m guessing any income will be forwarded on to some lucky individual.

Tried asking the local Microsoft Mobile contact for some assistance. Took a week to reply and told me nothing. They do have a lovely web site though – no original content mind – but it is pretty.

Maybe its time to face that fact that Windows Mobile 6.5 is a “lipstick on a pig” release and I should just hold out for Silverlight on Windows Phone 7? At least by that stage (mid 2010?) I may have managed to complete the registration process…