2015 in Review

A substantial amount of my free time at the start of the year was spent freelancing on a health and fitness recommendation system which ended up getting canned. The general idea was for health and fitness gurus, personal trainers etc. to create profiles which could be searched by a variety of different filters; once you found a match you could reach out and arrange a session. The primary difficult with the business plan was how you drive repeat use, once I find a personal trainer I would contact them directly to arrange another session. Without implementing a full scheduling system and payment options which was well beyond the scope of the project I can't see it working and this is why the founder called it a day. Unfortunately for me the project was about 90% complete and would have been a really good portfolio piece. The experience wasn't a complete loss I defiantly learned a lot along the way. It was great to work with a clean slate and try out some things I had no experience with previously such as spatial search in Entity Framework. I've also got a few neat reusable solutions to common boilerplate in MVC applications that will possibly make it into a future post.

I started the year with the intention of learning Clojue but actually ended up settling on F#; which I'm really enjoying. Being able to use the .NET framework has been a massive help. The thing I've found with F# is it's very easy to write procedural OO style code which makes familiarising with the syntax easy and allows you to move towards writing idiomatic functional code at your own pace. If you're interested in learning F# I'd recommend looking at this Microsoft course on edX. The content covered is quite basic but it's a gentle introduction to the concepts of the language. Once you've got that down, head over to the awesome F# for fun and profit and have a look at the following series Why use F# and Thinking functional. The following talk on Railway Oriented Programming also helped a lot.

Professionally, my team at See moved toward standardising our front end methodology. Previously we were using jQuery with various plugins, having experience with Knockout.js and knowing what a godsend client side templating can be I knew it was defiantly worth pushing for. We ended up settling on Angular.js which although it isn't prefect.... has improved things substantially. I wonder if Angular would still be popular if it didn't have Google's logo on it; I'll leave my criticisms for another time as it could be a post in itself. SASS (SCSS) with Bootstrap and BEM has been our adopted CSS strategy. BEM although verbose is great as it forces styles to be modular and prevents unintended side effects that are all too common in CSS; if you haven't looked into it I suggest you do.

On the back end we finally moved from Postgres 9.0 to 9.4, CTEs with INSERT, UPDATE and DELETE have really changed the way I write SQL making it more modular and easy to test. Our server side structure has remained fairly static over the course of the year, not to say nothings been done, a lot has! I suppose it’s just a consequence of the codebase being fairly mature with established conventions. C# 6.0 delivered some welcome features but nothing that merits a shift in architecture. With ASP.NET 5 just out I would expect a bit more movement here in the coming year.

2015 was the year I really started getting more involved in London's own tech scene regularly attending meetups which I wish I had started sooner. It's easy to stay confined in the bubble of your company. Seeing what other people in the wider world are using and working is a great way to inspire you to try new things; at least it has been for me. Thanks to the following groups for organising the talks London .NET User Group, F#unctional Londoners Meetup Group and London Software Craftsmanship Community. Also Thanks to Skills Matter for creating such a great space and hosting so many talks.

Microsoft's future decoded was also a really great day with talks from Mads Torgersen, Don Syme and Brian Cox. They even had a fully automated robot bar!

Bar of the future #futuredecoded #microsoft

A photo posted by James Spencer (@jpspenc) on

Right at the end of the year I started advent of code in F#. I'm still slowly plodding along with these brainteasers when I get a bit of free time, you can check out my solutions here.

In 2016 I'm going to continue focusing on F# and functional programming in general. I've also enrolled in a MongoDB course with a view to migrating the fabled Sentimentor. I'm yet to decide on Suave with ReactJS or WebSharper regardless it will be refreshing to try out a different web stack.

Hope you had a good 2015 and wishing you the best in 2016!

Created On: 07/01/2016 14:51
Visual Studio irks and PowerShell delete old file functions

One of our client’s applications compiles a bespoke widget for users which they can then install on their machines. This process has been in place for years until it suddenly stopped working.

So begins the usual debugging process, however everything seems to be working fine locally and nothing appears to have changed on the machine, permissions issue? Give the application user full permission nothing.. days go by following the same lines of investigation and still nothing. So as a last ditch attempt after getting nothing other than an exit code of 1 from visual studio which helpfully states "Partial success; this means at least something, or possibly everything, failed to succeed...." It's decided that this may be some kind of strange windows permissions issues the build process is refactored out into a separate windows service. This worked! Reaffirming the belief that it was a permissions issue.

So Several months later the newly deployed service stops working and so the head scratching begins, a few more days looking for the solution and nothing, I propose trying a different version of visual studio on the server in question unfortunately it doesn't have all to much space on the drive. Then I find it, temporary files, temporary files everywhere! Well 65,536 temporary files in two places to be precise. One set for the application user and one set for the windows service user...

So as it happens when compiling with visual studio a 4 digit hex value is appended to a file named tmp in C:\Users\[User]\AppData\Local\Temp so for instance tmp81A3.tmp. I never came across this when trying to compile the application on the sever as I was logged in under my account...

In my eyes this is something Microsoft should fix, 32 bit would be nice Microsoft it is 2014 after all... but it's also a good opportunity to try writing some Powershell.

The above script contains three functions the first function will delete all files withing a given directory with the supplied file type created less than the supplied date time.

The second function is very similarly except it deletes old folders recursively.

The third function is a little more specialized in it's use, it will delete all visual studio project files that satisfy the given regex, obviously this can be easily adapted to individual requirements if need be.

Created On: 06/05/2014 22:50
Persistant Cache for ASP.NET MVC and FluentNHibernate

In ASP.NET MVC it is possible to cache the output of controller method simply by attaching the following attribute to the method

This is great if we want to store and output that isn't changing much, this blog for instance caches results in such a way.

However in Sentimentor our needs became a little more specific and we needed to be able to cache certain values that are computed at run time. In our specific use case we could have just stored the values in a hash table that is initialized on application start up or when it is first called but wanted something more reusable and that offered persistence in the event the application is reset

To do this we first need to create a new table that will be our persistent store in the database

Using this scheme we create the following class for the model note that I have an active entity template which just adds useful methods to the model such as save, update and delete.

An finally we have our application cache helper which is implemented as a singleton

Created On: 11/06/2013 21:18
Playing With Blender's Fluid Simulation

The following video was produced on my final year of undergrad as part of my 3D animation module, The video shows a fluid simulation based loosely off the elevator scene in Stanley Kubrick's masterpiece The Shining. One of the main challenged presented in making this scene was dealing with such a large volume of fluid, this generally made the process of testing the scenes parameters cumbersome. Overall I am fairly happy with how this video has turned out. However there are clear errors, with particles escaping before the doors have opened. Time permitted I would like to give this another rendering pass, add wet maps to the scene, investigate buoyancy and spend more time on Video editing.

Rendering and baking the scene tool around a week on Intel i7 Sandbridge 3.4 GHz 16GB RAM GTX460 and this was completed using the Cycles engine on a CUDA + Open MP build of blender 2.6 .

Created On: 15/10/2012 08:33
Flight Simulator

After much delay I'm finally releasing my flight simulator that I built in Unity for my final year module of 3d dynamic modelling and simulation. The goal of the game is to fly the fighter jet and bomb the base as indicated by the way point, It can be a bit glitchy and the physics could do with some tweaking however it is playable and quite fun.

I'm going to be looking at porting this to android and IOS in the coming months.


Created On: 07/06/2012 15:40

I've been toying with the idea of "giving up" Windows for a while now and I've very recently started to make this transition after reading about diversifying my knowledge portfolio in The Pragmatic Programmer. I'm also away I am still going to use Windows for several things such as games and development in a professional context, however this extra exposure can only be a positive thing.

Why? There are several reasons one of the most prominent is the lack of challenge Windows presents, sure that is a selling point if I want to teach someone how to use a computer but I'm a software engineer and I shouldn't be afraid of getting my hands dirty, many Linux distros offers this in a very clean and pure way without the intrusion of too many safeguards.

The second issue is heavily related to having just finished a degree in Computer Science I am all to familiar with the practices used to get students hooked on certain software and it is clearly visible in individuals attitudes towards how they decide to fulfil assignments. The rational is simple, give students free software so that they become adept at it and then wherever they end up working will have to fork out the cash for the licenses. Microsoft have gotten very good at this (all free for students).

Now, I don't have a problem with people purchasing software however this model is destroying the whole ecosystem because it leads bodies to maintain the belief that their investment in a particular product make it the best to for the job regardless of the situation, reducing the ability to pragmatically adapt to the situation at hand. For instance consider we are building a web application that will require it's own dedicated sever and we are deciding what database to use postgreSQL is mentioned however this is an "unknown technology" despite the fact that it is supported by the ADO layer and the database scripts will work on it just as well, so instead a great deal of money is wasted on a MSQL license when it isn't of any perceivable benefit. I'm aware this is a simplified example and could go both ways but it is intended to highlight the issue that is all too common when a developer is confined to a given ecosystem.

Overall my intention is to learn new skills in a different environment allowing me to make better overall decisions when making design choices, this should also ensure that I don't get pigeonholed.

Created On: 07/06/2012 11:14
New Blog
I present my new clean ultramodern minimal blog which I must say has turned out very nicely, however be careful as it is a bit feature light at the moment! I will be using this site to present my work, any research I have undertaken and anything that is of general interest. I have some posts on sentiment analysis, web development and web-gl in the pipeline, however there will be much more variety once I get into the full swing of things. 

I also must state that with this new blog comes great responsibility there are a couple of ground rules which I will be making myself follow! The first is no more redesigns, which is allot easier said than done as the developer in me just want's to experiment all the time, and it has taken far longer than it should have to get this blog to it's current state. This leads me to the second rule update frequently which again is hard as I would much rather be coding than writing!

Anyhow that's all for this smackerel of content, more is on it's way I promise and because I said it on the internet it must be true. 
Created On: 24/05/2012 12:14