Wednesday, March 7, 2012
Job for a intermediate .NET Web technology type person –Auckland, New Zealand


We are looking to hire someone with (but not necessarily all of!) :-

- Good web skills   Javascript / Html / CSS  + any javascript frameworks Jquery / Knockout etc

- ASP.NET MVC 4  (or earlier)

- ASP.NET Webforms  ( any exposure )

- SQL Server / NHibernate  ( or other ORMs )

- Webservices

-WPF ( we do a number of inhouse windows apps )

- A love of software development and good development techniques!

You can see what we do at

Drop me an email at keith dot nicholas AT

with either a CV or questions!

Posted On Wednesday, March 7, 2012 4:45 PM | Comments (0)
Monday, February 27, 2012
Bret Victor - Inventing on Principle (a must watch!)


Just in case any of you missed this  :-

The main idea is about having a ‘principle’ which drives all your actions.  But more interesting is Brets particular principle which drives him. It’s a great watch.  Some really good ideas on how we need to close the gap between ‘thinking’ ideas and being able to see the reality of those ideas.    

It’s mainly programming focused, but it also explores this idea in general!

Posted On Monday, February 27, 2012 11:39 AM | Comments (0)
Wednesday, September 14, 2011
Metro, oh no! Windows 8….


So I’ve played with the developer preview of windows 8 today.   I’m trying to like Metro.  But, at least on the desktop, it feels wrong.  

In fact, its not really windows anymore.  In the sense “windows” are less in favour compared to full screen apps.   It really should be called Boxes 1.0 Smile

I played around a bit with the new visual studio with metro templates….. great tools as usual.  But…designing metro apps feels like a subset.  The variety of apps in the windows world would find it hard to translate into a metro style.  Some would benefit.  So why is this “subset” becoming so dominant?

Blending these two things together seems, at least for the moment, a bad plan.  They are forced to do it because they want a touch experience mixed with a desktop experience.   Which means the UI has to cater to the LOWEST common denominator.  Touch interaction.   So microsoft are being sheep and follow in the steps of apple and google and try and design something alternative since the market is buying big on tablets.   Microsoft is calling it “re-imagining” windows.  But it seems to lack imagination from my perspective.  Boxes that can show info in them and represent applications all done in a cartoon style? pfffft Smile  smacking ribbon bars on things? speeding stuff up? pffft.

come on, be honest with yourself Microsoft. You are not doing anything innovative, you’ve just got a bunch of UX designers having a crack at windows and mish mashing tablet support in.  That’s not imagination!

So far I’m really less than impressed by it.  I do like some of the improvements to the *real* windows though.

At least, win 7 is great. Its the final version of getting windows 95 near enough to being *right*.  So if win8 does turn out to be a mish mash of UX designer “goodness” that no one likes, then they can have another crack at it while relying on win 7 to hold the fort.

Posted On Wednesday, September 14, 2011 8:00 PM | Comments (3)
Friday, August 26, 2011
Hotkey for creating a new folder in windows 7 explorer


This blog post is entirely trivial, but I just discovered it!

As a keyboard centric guy I like to drive most of windows through the keyboard.   One thing that’s always annoyed me in explorer is the difficulty of making a new folder.   It used to be   ALT-F  W F   ( and if you have tortisesvn is installed sometimes craziness will happen on certain folders).    Basically just driving the folder creating by the menu keyboard shortcuts.    Of course the “New” menu takes a while to populate as it works out all the “new” things you can create.

Anyways, to the point….

To make a new folder in explorer under Windows 7 -   CNTRL-SHIFT-N

Posted On Friday, August 26, 2011 2:11 PM | Comments (3)
Friday, June 10, 2011
Code snippets on blogs, are you allowed to use them in your own work? No you can not!!

I think mostly people do intend that snippets they publish on their blogs get used by people for their own purposes.  However, unless you explicitly say otherwise, in many countries, your blog posts are automatically copyrighted.   Which normally is a good thing, it means you can’t accidently forget to protect your work!    But it does mean that you need to explicitly give away the rights to anything you publish that you intend for anyone else to use freely.

So if that is your intention,  I think somewhere on your blog you need to state what the deal is with your code snippets you publish.   So I was having a look at what are my options.

It seems like it’s a bit of a thorny issue.

I thought it would be a simple case of saying it’s released into the public domain, however, some advice out there seems to say that releasing things into the “public domain” has problems in places like the US. 

Some discussion about it can be found here :-

and here

The accepted answer (which also seems consistent with other things I’ve read) is that you have to explicitly license your code to be free to use.

It seems a popular choice is the Creative Commons has CC0 license, which you can read about here :-

Which is the path I think I will go down!

It’s even more interesting to me as I’m building up an open source library of various useful C# snippets and “glue” type code, some of which is my code, some of which are derivatives of other peoples snippets.  So I’m going to have to be quite careful to make sure I’m allowed to put various bits of code into a library and then license it under a MIT type license.

Posted On Friday, June 10, 2011 11:38 AM | Comments (2)
Friday, May 27, 2011
Code Review–Becoming a better programmer


I love stackoverflow, its great for finding answers for questions you need answered right away!  Or its good to be able to help others get over annoying speed bumps.


Code Review ( ) is a lot more interesting in terms of actually becoming a better programmer.   You get to reflect on other peoples code, offer up alternative ways of coding, and see other peoples alternatives. 

The only problem at the moment is there’s just not quite enough code to review!

Posted On Friday, May 27, 2011 2:23 PM | Comments (2)
Friday, May 20, 2011
Seatest v0.04 Released! Simple Unit Testing for C code.


I’ve released a new version of seatest which fixes some little bugs / flaws and also introduces global setup / teardowns.

It can be found at

I’ve found it really useful for the C based projects I’m working on.  The only thing I think might be useful is some tools to help generate new tests / test fixtures / suites.   In Visual studio I have both Visual Assist and Resharper which provide templating capabilities.  But it might be nice to build my own custom tools specifically for seatest.

Most of my projects are for embedded systems but I tend to cross compile.   So I develop everything in visual studio and stub out the hardware layer.  Unit test the heck out of it, then compile for the target device.  Tends to be a very quick way to develop.

Posted On Friday, May 20, 2011 4:02 PM | Comments (0)
Monday, January 17, 2011
Bruce Lee Software development.

"Styles tend to not only separate men - because they have their own doctrines and then the doctrine became the gospel truth that you cannot change. But if you do not have a style, if you just say: Well, here I am as a human being, how can I express myself totally and completely? Now, that way you won't create a style, because style is a crystallization. That way, it's a process of continuing growth."- Bruce Lee

This is kind of how I see software development.

What I enjoyed in the the early days of Agile, things seemed very dynamic, people were working out all manner of ways of doing things. It was technique oriented, it was very fluid and people were finding all kinds of good ways of doing things. 

Now when I look at the world of “Agile” it seems more crystalized.  In fact that seemed to be a goal, to crystalize the goodness so everyone can share.   I think mainly because it seems a heck of a lot easier to market.  People are more willing to accept a well defined doctrine and drink the Kool Aid.   Its more “corporate” or “professional”.

But the process of crystalizing the goodness actually makes it bad.  

But luckily in the world of software development there are still many people who are more focused on “how can I express myself totally and completely”.   We are seeing expressive languages, expressive frameworks, tooling that helps you to better express yourself, design techniques that allow you to better express your intent.    I love that stuff!

So beware, be very cautious of anyone offering you new age wisdom based on crystals!

Posted On Monday, January 17, 2011 2:30 PM | Comments (0)
Friday, November 19, 2010
Refactoring C


I’ve recently begun working on an embedded C project where the code has got pretty out of hand and I’m tasked with bringing some sanity to the code.

It quickly reaffirms my main focus of good software development.  Nice simple composable functions.  Everything about good design boils down to writing good functions. 

Refactoring bad C to good C is a bit of a mission.   But my first whack at doing it is always “Extract Method”  (well, other than removing the million warnings that the C compiler helpfully told you about but let you carry on anyways…..0 warnings should be a C coders mantra) .  

When I extract methods Its usually at the BIG and tiny level of the code….. either I’m taking a huge bunch of code and wrapping it in a function, or taking a really tiny piece and wrapping it   (like if  a common piece of checking code is scattered all over the place

eg I’d take :-  if(strnicmp(blah,”MAGICPREFIX:”,12))

and make it :- if(has_magic_prefix(blah))

it slowly declutters the code….and in the end the “has_magic_prefix” may even get totally refactored out of the system.   But for starters, micro decluttering makes a world of difference.

From there I start to focus on what the code is really really really doing.   Then start designing a system of functions that allow you to easily express that idea. 

Also its important to group C functions into .c files  ( treat .c files as a “class”)

That group of C functions should work on a set of common structures ( just like classes ). 

Simply by wrapping common packets of data often gets rid of the “millions of parameters” functions. 

All of a sudden things get a LOT simpler, A LOT easier to extend and a lot more composable!

Add in a nice system of callbacks to be able to inject variations for special cases rather than having masses of if/elses or switch statements, you are well on your way to writing some pretty nice C code.

Posted On Friday, November 19, 2010 2:45 PM | Comments (3)
Thursday, August 5, 2010

One of the new languages floating around….  Frink ( )

Really interesting what you can do with this language in terms of calculating “real world” things.

The sample calculations section I found really interesting and quite humorous with classics like :-

Movie Magic

In the movie Independence Day, the alien mother ship is said to be 500 km in diameter and have a mass 1/4 that of earth's moon. If the mother ship were a sphere, what would its density be? (The volume of a sphere is 4/3 pi radius3)

1/4 moonmass / (4/3 pi (500/2 km)^3) -> water

This makes the ship 280 times denser than water. This is 36 times denser than iron and more than 12 times denser than any known element! As the ship is actually more a thin disc than a sphere, it would actually be even denser. Since it contains lots of empty space, parts of it would have to be much, much denser.

If the object is this dense and has such a large mass, what is its surface gravity? Surface gravity is given by G mass / radius2, where G is the gravitational constant (which Frink knows about):

G 1/4 moonmass / (500/2 km)^2 -> gravity

The surface gravity of the spaceship is thus at least twice earth's gravity--and that's on the rim where gravity is weakest. It would actually be much higher since it's much, much flatter than a sphere. I hope you're not the alien that has to go outside and paint it.

Posted On Thursday, August 5, 2010 9:02 AM | Comments (1)
Monday, June 21, 2010
SeaTest - C Unit Testing Framework

Today I released an open source project for doing xUnit style unit testing.

Recently I got roped into doing some embedded C code for a project and I wanted to TDD it.   On investigating my unit testing framework options I ended up rolling my own as many frameworks were either too simple or trying to be too smart.

While I’m generally happy with the general style of how to write tests with it, there’s a number of things to cleanup and it probably needs a bit more rounding out for other peoples needs.  Also I will add some ‘asserts’ that represent typical things C programmers tend to do.

Anyways, if anyone is interested you can find it at :-

Posted On Monday, June 21, 2010 5:15 PM | Comments (6)
Friday, May 7, 2010
Useful Extension Method for ICloneable


In the past, I’ve had to put a type specific clone in each cloneable class, but with extension methods you can write a generic T specific clone

class Program
        static void Main(string[] args)
            var b = new Blah() {X = 1, Y = 2};
            var bb = b.Clone();
            Console.WriteLine(string.Format("{0} {1}", bb.X, bb.Y));
    public class Blah : ICloneable
        public int X;
        public int Y;
        object ICloneable.Clone()
            return MemberwiseClone();
    public static class CloneExtension
        public static T Clone<T>(this T o) where T : ICloneable 
            return (T)o.Clone();
Posted On Friday, May 7, 2010 3:02 PM | Comments (2)
Friday, April 30, 2010
NHibernate 3.0 and FluentNHibernate, how to get up and running….

First up. Its actually really easy.

I’m not very religious about my DB tech, I don’t really care, I just want something that works.  So I’m happy to consider all options if they provide an advantage, and recently I was considering jumping from NHibernate to EF 4.0.  However before ditching NHibernate and jumping to EF 4.0 I thought I should try the head version of NHibernates trunk and the Head version of FluentNHibernate.

I currently have a “Repository / Unit of Work” Framework built up around these two techs.  All up it makes my life pretty simple for dealing with databases.   The problem is the current release of NHibernate + the Linq provider wasn’t too hot for our purposes.  Especially trying to plug it into older VB.NET code.   The Linq provider spat the dummy with VB.NET lambdas.  Mainly because in C#

Query().Where(l => l.Name.Contains("x") || l.Name.Contains("y")).ToList();

is not the same as the VB.NET

Query().Where(Function(l) l.Name.Contains("x") Or l.Name.Contains("y")).ToList

VB.NET seems to spit out … well…. something different :-)

so anyways… Compiling your own version of NHibernate and FluentNHibernate.  It’s actually pretty easy!

First you’ll need to install tortisesvn NAnt and Git if you don’t already have them. 


first step, get the subversion trunk

into a directory somewhere.  eg \thirdparty\nhibernate

Then use NAnt to build it.   (if you open the .sln it will show errors in that  AssemblyInfo.cs doesn’t exist )

to build it, there is a .txt document with sample command line build instructions,  I simply used :-

NAnt -D:project.config=release clean build >output-release-build.log

*wait* *wait* *wait* and ta da, you will have a bin directory with all the release dlls.


This was pretty simple.

there’s instructions here :-

basically, with git, create a directory, and you issue the command

git clone git://

and wait, and soon enough you have the source.

Now, from the bin directory that NHibernate spit out, take everything and dump it into the subdirectory “fluent-nhibernate\tools\NHibernate”

Now, to build, you can use rake….which a ruby build system, however you can also just open the solution and build.   Which is what I did.  I had a few problems with the references which I simply re-added using the new ones. 

Once built, I just took all the NHibnerate dlls, and the fluent ones and replaced my existing NHibernate / Fluent and killed off the old linq project.

All I had to change is the places that used  .Linq<T>  and replace them with .Query<T>  (which was easy as I had wrapped it already to isolate my code from such changes)

and hey presto, everything worked.  Even the VB.NET linq calls.

I need to do some more testing as I’ve only done basic smoke tests, but its all looking pretty good, so for now, I will stick to NHibernate! 

Posted On Friday, April 30, 2010 11:37 AM | Comments (4)
Thursday, April 29, 2010
Swapping from NHibernate to Entity Framework – Sanity Check

Now I’m not an expert in either of these techs.  I have a nice framework for unit of work / repository built with NHibernate.  Works pretty well.  I use FluentNhibernate to do the mappings.  Works well.  Takes very little code to get going with a DB back OO model.

So why swap?

Linq.  In Entity Framework you get much better linq support. 

Visibility. I have no idea what's really happening with NHibernate….its a cloud of mystery most of the time.  You have to read all the blogs, mailing lists, etc to know what's going on.

So, EF 4.0 looks like pretty good….  it has reasonably good support for mapping POCOs.  Wrapping UnitOfWork and Repository around it seems ok.

Only thing I haven’t liked too much is having to explicitly load lazy loading entities.

So…. am I sane?  is EF the way to go?  or is NHibernate going to suddenly release the next generation of coolness?  Is there any other major gotchas of using EF over NHibernate?

Posted On Thursday, April 29, 2010 2:11 PM | Comments (2)
Monday, April 19, 2010
File Transfer using RDP

I often use RDP to log into servers.   A couple of issues I have had is that its a pain to get files onto the server from my PC at times, and, if there is something missing from the servers windows install, I can’t simply pop the DVD into remote server in some unknown location on the internet somewhere.

The other day I was curious if RDP actually had anything…since it did support shared clipboards, so I went for a look through the options and low and behold, *hidden* away…..

Select Options…


Go to the “Local Resources” Tab, then where it has “Local devices and resources” it sneakily has a “More…” button.


Which then displays a drive selection box.  Select the drive you want ….


Then on your server you will get…..


Nice.  That is useful.

Posted On Monday, April 19, 2010 10:06 PM | Comments (13)

I was wanting to play around with something in a VM the other day.  I was curious what was available for free, if anything, for windows.   I quickly came across Virtual Box  ( ).   Downloaded, Installed. No Problem!  Works really nicely.  

It was commercial software (by sun (now oracle)) that turned open source.  

In terms of a license it says :-

In summary, the VirtualBox PUEL allows you to use VirtualBox free of charge

  • for personal use or, alternatively,
  • for product evaluation.

An interesting feature it has is built in RDP.   Which is useful if you have a guest OS that doesn’t support RDP.  

Speaking of RDP…..  which I will in my next blog post… I learnt something REALLY useful the other day.

Posted On Monday, April 19, 2010 9:52 PM | Comments (0)
Speech Recognition

Today I was asked to write a wee application for someone so that they could turn pages on their ebooks without having to reach for their keyboard or mouse… that way they could do craft or knit or whatever they are doing while they are reading.

I vaguely remember that windows has something built in, but have never really played with it before.   I have in the past turned on the screen reader and impressed my kids by making the computer saying “amusing” phrases along the lines of “Zac has a smelly bum”.

So instead of firing up Visual Studio and getting stuck into the juciy task of writing a speech recognition program…. I typed “speech recognition” into the start menu of my windows 7 computer.   And wow!  I’ve been playing with it for the last 40 minutes or so and have been most impressed.   Dictation wise it certainly misses stuff or gets the wrong words, but I did the training and it certainly improved.

But what I’m enjoying is controlling windows.

for instance, to start this blog entry  I said “Open Writer”  and it worked no problem.    In fact after I muddled my way through getting going with speech recognition I enjoyed saying “Open notepad” … “close”  over and over again.

It allows you to click anywhere on the screen, just say “mousegrid”   and a 1-9 numbered grid comes up,  say a number and it puts a smaller 1-9 numbered grid, and you hone in, till the middle square is on a place you want to click, then you say “click” or “double click”. 

if you want to enter a key, say “Press Tab”  for example.  

inside programs it understands menu entries.  In fact, while writing this I just said “File”  “Save” and it happily saved.

I think I will play around with this for a while more and try it out in visual studio.   Might be quite good for being able to do menu entries instead of grabbing for my mouse…. can keep my hands on the keyboard.

ok, wasn’t the first post I wanted to do on geeks with blogs! but hey…   will do some techy posts soon.

Posted On Monday, April 19, 2010 3:48 AM | Comments (2)