Friday, 3 April 2015

Digital Drawing–#1 Benny from Lego Movie

The first one is Benny from the Lego movie.


Not bad for a first attempt!

Digital Drawing

I use to enjoy drawing when I was younger although I was told by my art teacher I wasn’t very good so only did it for fun and not that often once proper educational subjects kicked in. I have decided I’m going to learn to draw again but with a digital medium using my Surface Pro 2 and pen and will share what I do …

Saturday, 13 December 2014

Microsoft Arc Touch Bluetooth mouse and Surface Pro 2 not working

I purchased a Microsoft Arc Bluetooth mouse to use with my Surface Pro 2 and after it arrived it connected with the Bluetooth straight away and worked fine however there was an annoying sound on the scroll wheel which had to go.

After a search it was recommended to download the Microsoft Keyboard and Mouse centre to configure the mouse. I downloaded the appropriate installation and was promptly told mouse could not be recognised. This was an issue …

Some further investigation revealed there was an issue with the Arc Touch Bluetooth and Arch Touch Surface mice with the Surface Pro 2., To remedy this you need to download the configuration tool from the app store.


If you search for “Arch Touch Bluetooth Mouse” in the Windows Store and install the free app from Microsoft you can now turn off the “Vibration/Sound” and use the mouse without the annoying scroll sound effects.

Tuesday, 22 July 2014

Enums in C#; Doing More Than You Thought!

I have been developing for a while now and use Enums on a daily basis (nearly) and was quite happy in my understanding an Enum definition had a set number of values and of those values they could be cast to the related integer value (or another under-lying type) and back again.

And then I saw the following piece of code (condensed down for example):

System.Net.HttpStatusCode value = (System.Net.HttpStatusCode)429;
var result = (429 == (int)value);

There is no corresponding value in System.Net.HttpStatusCode which relates to 429 and the value of result variable was true when when the enum value was cast to an int!

So why is this possible? Enter the C# specification!

Quick side note; no need to search the internet for the C# language specification if you have Visual Studio 2013 installed locally you already have it. It can be found:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC#\Specifications\1033

A quick browse to section 1.10 Enums answered, high level, why it is possible straight away.

“The set of values that an enum type can take on is not limited by its enum members.”

The rest of the section is quite interesting as well with regards to the underlying type of the enum type. On further reading of chapter 14 – Enums there are a lot of bits which as a developer you take for granted and use without really thinking it about. It’s actually quite interesting.

Makes me wonder what else I’m missing out on, maybe I should read more of the specification? Maybe the whole specification?

Thursday, 6 February 2014

Updated Json.Net and now OWIN errors

I took the step on an Asp.Net MVC 5 application last night to update all of the nuget packages in the entire application to be the latest. The main reason for this was I added SignlR to the solution and it required a newer version of OWIN which is fine. With the update of all packages came the update to Json.Net to the newly released version 6 and on fire up of the application I got the following error:

Could not load file or assembly 'Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Using the information in the error message I added the following snippet into the runtime element in the web.config to resolve the issue:

        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />

I think nuget is a great concept but I still think there is a bit of an issue when it comes to multi packages which rely on a specific package which then is updated later if you update all. In the future I will be more selective on which packages to update.