programming, coding »

[5 Feb 2013 | 216 Comments]

One of the things that I have found when doing work at home recently is that I don’t get into a ‘flow’ which means I don’t seem to get as much work done as I think I should. I put the main reason for this down to my work area not being particularly conducive to coding and since I now have 3 kids there is a lot of their things around and they are always interrupting me. So with this in mind about 6 months ago I started to design how I would convert my shed (which is pretty big (4.5m x 6.8m) into a place where I could get into a good ‘flow’ for work.

I’ve put a little photo gallery of the work at the bottom of the blog post.

The Goal

To create an area where it is possible to create excellent software

Requirements

Temperature

When I ran my start-up a few years ago from home I did it out of a room in my house that had been converted from a garage by the previous owners. It converted badly with no central heating. I found it was hard to regulate the temperature, it got really hot in the summer and very cold in the winter. This was a real issue for productivity and was one of the issues identified as a bad experience when I recently caught up with some of the guys involved.

Lighting

As part of the overall environment for writing code I was very interested in finding if there was some kind of lighting configuration that good for coding.

Space versatility

I am not 100% sure what this space is going to be used for. Perhaps me just writing code, perhaps having a team of people in there designing and making software, perhaps hold some training courses, I just don’t know. With this in mind I want to keep all options open and make it easy to re-configure the space accordingly.

Others

  • Collaboration
  • Colouring
  • Connectivity

Limitations

The shed has no utilities attached to it - mains water, gas or electricity.

Design Decisions

Utilities

  • Connect electricity. This was the minimum number of utilities I needed to enable the implementation of the other requirements I had.

Temperature

  • Insulation – put 50mm Celotex insulation on all the walls and ceiling of the shed. Insulation is proven to be the most effective part of temperature control.
  • Under floor heating – this is planned to be the primary heating source. It is quiet and easy to control. It also works well even when it is very cold outside and most importantly it is discreet which is part of the space versatility requirement.
  • Air-conditioning unit with inverter – this can keep the room cool in the hot summer and with the inverter it can also produce hot air when it is cold, although when it get really cold it is not very effective.

Lighting

  • Indirect light for writing code. During my research on a good coding environment I found out it was to reduce eye strain you must not to have things that draw your eye away from the screen such as lights in the ceiling.
  • No windows – this eliminated a source of light that might cause eye strain, improves the insulation and security properties of the building as well as improves the Space Versatility of the room.
  • Day light bulbs – having lights that mimics daylight helps with concentration and energy levels. I will be using daylight bulbs for my indirect light.
  • Standard bulbs – while the indirect light is good for coding it might not be good for all possible uses. So I have also installed track lighting so I can clip in and out up to 16 GU10 bulbs anywhere in the room maximising the Space Versatility.

Space versatility

  • Items already covered is that there are not visible radiators on the walls or things in the floor, no windows so there are not limitations created by the walls or floor.
  • Power and network points are located on the cross beams of the ceiling. This makes it easy to plugin anywhere in the room

Collaboration

  • I love whiteboards and find it the best way to knock around ideas. With this in mind I have dedicated one long wall to be painted with dry wipe paint which will make it a 6.8m x 2m whiteboard!

Colouring

  • I’ve gone for a green colour on the walls as this is supposed to help relax and help concentration.
  • The floor is a white wood floor, as there is only artificial light I wanted to try and keep it as light as possible
  • Ceiling is white with special paint which is supposed to help reflect light.

Connectivity

  • There is CAT6 cable throughout the room for people to connect to.
  • To connect to the house broadband I will start with some Ethernet Powerline adapters but might have to get a proper external CAT6 cable installed if this is not fast or reliable enough. External direct burial CAT6 is quiet expensive so I’m just postponing that expense at the moment..

Does it work?

I’ve been in there a few times now and it is a very nice space to work. The whiteboard wall is awesome and is my favourite feature. I’ve ordered some desks that should arrive in a couple of weeks so i’m working off some pasting tables at the moment! Everything else seem to just work as I hoped, the temperature is nice, lighting is good and I always feel I can concentrate on work. So far so good :).

Credits

I must credit Rich Bartlett for the high quality work he has put into making this happen. His attention to detail and building skills has made my vision come true. If you need a good all round tradesman you can contact him via twitter: @richiethebass (https://twitter.com/richiethebass)

Photos

There are various photos from what the shed looked like before work started, the work Rich Bartlett (the guy in the nice woolly hat as it was about –5 outside!) did to renovate it showing the various things that we did along the way.

 

charity, Windows Phone 7, programming, paypal, WP7, hacking »

[23 Sep 2010 | 3 Comments]

So I went to Charity Hack and as promised have put together a video of the event.

The Event

It was a great event (again) with the standard of apps even better than last year. John Lunn has done a write up of the event with videos of all the winning hacks.

There is also a great write up by Ben Matthews about all 18 entries which is well worth a read to get a overall feel of the event. http://benrmatthews.posterous.com/28520434

There is also a great photo stream here of the event: http://www.flickr.com/photos/martin_88/with/5004083392/

Our App

We created a Windows Phone 7 app which used a number of API’s provided by JustGiving and PayPal to collect the donations from users. We only had a limited time to learn what the development tools for Windows Phone 7 could do but it was really easy to pickup and get something doing pretty complex api calls in a very short time. It does an number of restful web service calls in the background which was made even easier with the http://restsharp.org/ library. We were really pleased with the outcome so please enjoy the video!

MS CRM4, MS CRM, C#, programming, Software Developement »

[17 Sep 2010 | 0 Comments]

Now this might seem like something that would be easy to do but I’ve just spent 2 days struggling to do just this because of what I consider a bug in one of the SDK wrappers. I have now found a work around to enable unit testing which I will share with you now.

The Error message

Test method XrmEntityWrappers.Tests.CaseEntity.GetCaseByTicketNumber threw exception:  System.TypeInitializationException: The type initializer for 'Microsoft.Xrm.Client.Caching.Cache' threw an exception. --->  System.IO.DirectoryNotFoundException: Could not find a part of the path 'appDomain=UnitTestAdapterDomain_ForC:\Projects\Thg.Ohov.Crm\SourceCode\Thg.Ohov.Crm\TestResults\dh27_WIN-51UPWVCUQ6V 2010-09-16 18_21_40\Out\XrmEntityWrappers.Tests.dll:key=Microsoft.Xrm.Client.Caching.InMemoryCacheProvider'..

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
b__0(Object userData)
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
Microsoft.Xrm.Client.Caching.InMemoryCacheProvider.GetExtendedCache()
Microsoft.Xrm.Client.Caching.CacheManager.GetExtendedCache()
Microsoft.Xrm.Client.Caching.Cache..cctor()
Microsoft.Xrm.Client.Caching.Cache.Get[T](String label, Func`2 load)
Microsoft.Xrm.Client.CrmConnection..ctor(String connectionStringName, String connectionString)
Microsoft.Xrm.Client.CrmConnection.Parse(String connectionString)
Thg.Ohov.Crm.Core.XrmEntityWrappers.XrmAdapter..ctor() in C:\Projects\Thg.Ohov.Crm\SourceCode\Thg.Ohov.Crm\Core\XrmEntityWrappers\XrmAdapter.cs: line 28
Thg.Ohov.Crm.Core.XrmEntityWrappers.incident.get_XrmAdapter() in C:\Projects\Thg.Ohov.Crm\SourceCode\Thg.Ohov.Crm\Core\XrmEntityWrappers\incident.cs: line 25
Thg.Ohov.Crm.Core.XrmEntityWrappers.incident.GetIncident(String caseId) in C:\Projects\Thg.Ohov.Crm\SourceCode\Thg.Ohov.Crm\Core\XrmEntityWrappers\incident.cs: line 44
XrmEntityWrappers.Tests.CaseEntity.GetCaseByTicketNumber() in C:\Projects\Thg.Ohov.Crm\SourceCode\Thg.Ohov.Crm\XrmEntityWrappers.Tests\CaseEntity.cs: line 23

The reason for the error

The Microsoft.Xrm.Client.dll tries to create a Mutex object with the

Thread.GetDomain().FriendlyName;

When running ordinary in a console app or web app this is not a problem as the FriendlyName does not contain any ‘\’ characters. However UnitTest frameworks do put ‘\’ characters in the GetDomain().FriendlyName which then causes the Mutex object to throw a ‘System.IO.DirectoryNotFoundException’.

The fix

The real fix is for Microsoft to update the Microsoft.Xrm.Client.dll so that it doesn’t put any ‘\’ characters into the Mutex constructor. However my work around for this is thanks to Nick Watkins who found this article on how to change the GetDomain().FriendlyName

http://www.timvasil.com/blog14/post/2008/11/Fixing-Instance-names-used-for-writing-to-custom-counters-must-be-127-characters-or-less.aspx

The key bit of code being this if you want to set the FriendlyName to ‘Test’ (which doesn’t have any ‘\’ characters!):

typeof(AppDomain).GetMethod("nSetupFriendlyName", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(AppDomain.CurrentDomain, new object[] { "Test" });

To rename the GetDomain().FriendlyName before calling any of the wrapper code in the unit tests. So the test might look a bit like this:

[TestMethod()]
        public void GetIncidentTest()
        {

typeof(AppDomain).GetMethod("nSetupFriendlyName", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(AppDomain.CurrentDomain, new object[] { "Test" });

            string caseId = "1234"; // TODO: Initialize to an appropriate value
            incident expected = null; // TODO: Initialize to an appropriate value
            incident actual;
            actual = incident.GetIncident(caseId);
            Assert.AreEqual(expected, actual);

}

Summary

I’m happy now I can unit test my custom code that uses the xRM Wrappers and I hope that my support call with Microsoft will result in the SDK dll being updated.

WP7, Software Developement, programming, Windows Phone 7 »

[29 Jul 2010 | 1 Comments]

Just writing a quick article about going to the first Windows Phone 7 User Group @wpug last night. With the device release within touching distance I get a feeling there is more and more excitement growing about the device and what developers will be able to do with it.

First off a bit thank you to Matt Lacey for organising the event, EMC Consulting (especially Michelle Flynn)hosting the event and Microsoft for great information about what is happening, buying beer and showing off some prototype phones.

It was a great format, an opening presentation then 5 demo’s from participants an a closing presentation.

Is Microsoft doing any thing new?

Personally I don’t think that there is anything particularly new in what Microsoft is offering. What is new is how it has been packaged up and delivered to the end user with a lovely new handsets and OS. The core components of building applications on Windows Phone 7 are:

  • Visual Studio
  • Expression Blend
  • Silverlight
  • Xna

wpug All these tools are tried and tested, they are well known, they have excellent support from both Microsoft and the development community. I think this is fantastic, it really lowers the risk of developing an app for this device. Microsoft are just leveraging these existing technologies to make development easy.

 

 

 

Is Microsoft doing anything differently?

I think this is a big YES. Microsoft know that it is them ‘on the hook’ for the user’s experience so they are taking ownership of a lot of what controls this.

The devices are new but Microsoft have set a very high minimum specification for the hardware manufacturers. This is again excellent news, I feel that a number of the Windows Mobile handsets were underpowered and gave a poor user experience.

The Marketplace is the only way that you can get apps onto your handset (unless you have unlocked your phone via a Marketplace developer account). Again this is excellent news for two reasons.

  • Before finding an app was hard. They were very distributed with a few 3rd party market places or vendors selling their apps on their own websites. The new Marketplace means that there will only be one place to look and one way to purchase which puts this important part of the user experience right in Microsoft’s control
  • Microsoft can ensure the quality of the apps that are put on the Marketplace. This should mean that people don’t pay for or have to wade through 1000’s of sub quality apps that would reduce that all important user experience.

The last thing which I think will make a difference is how controlled 3rd party software is on the device. While the device is multi-tasking 3rd party apps are not allowed to leverage this. The reason being that badly behaving applications running in the background could drain the battery, use cpu and generally slow down the device. Making 3rd party software exit when a phone call is received for example is a sensible approach but a little frustrating for us developers.

A big thanks to Microsoft’s Paul Foster for his very interesting session about what’s going on with Windows Phone 7 and an even giving me the chance to use his prototype phone.

It is easy to create an application

Yes it is very easy. The development tools are free and can be downloaded from http://developer.windowsphone.com/ .

There are some excellent tutorial labs to follow which are very clear and easy to follow. They touch on all the key points of development using the development tools and the Windows Phone 7 os. I blogged about my attempt to create an iPhone app back in January which was a horrendous experience, I found this process much clearer and painless. I have been a .Net developer for 10 years which probably helped but I’m sure that the Microsoft tools are far superior to Apple’s XCode IDE.

Rob Fonseca-Ensor showed how easy it was to create an Xna game on the phone, and it was surprisingly easy. Create a picture, load it in the app and then pop it on the screen and that was about it.

At the user group there were 5 demo’s of apps that people had created. The app which I thought was the best (although I naturally voted for myself!) was Hosain’s tube app. It was a beautify clean design with lots of useful information being displayed from a data feed on the TFL website. I spoke to him afterwards and he had only spent about a week on the app, very impressive.

Other slick apps that were shown where UkTree’s CryoDefense which was a Tower Defence game. This was a very nice game created by seasoned mobile developers.

 KeyboardP had created a really nice app to store information that can be used In Case of Emergency (ICE) he also had the best line of the night:

“I hope you buy my app and never use it” KeyboardP

 

I didn’t spend much time on my app at all It was a client to read and display skillbooks from my www.skillbook.co.uk website. I spent a day doing the labs I downloaded and then a day writing the bulk of my app and it was really really easy. I had another few hours to do a few tweaks on the app but in total probably about 12 hours, plus it was the first time I had used Silverlight. I didn’t win the X-Box but I hope people found the concept useful, here is a video of my demo:

A video of me demoing my Skillbook App

 

 

 

 

 

 

 

 

 

 

 

Summary

I really enjoyed the event, it was great to see Microsoft engaging with the development community and to also see what other developers are doing on the platform.

I was pretty sceptical about the ‘new windows phone’ when I first heard about it because of the previous pain I have had with Windows Mobile. However Windows Phone 7 is a completely different beast and looks fantastic, and I for one am getting very excited about it’s launch in the not too distance future!

Software Developement, programming, Scrum »

[5 Mar 2010 | 2 Comments]

I have been following a new blog by Tim McOwan called www.devballs.com and it focuses on delivering software using a Scrum Process.

His latest article, Guess What? Scrum Developers should be cutting code, period! has provoked some interesting comments and my comment turned out to be so long I decided it should become an article in it’s own right. The comment I was replying to was from Jason Gorman, in a nutshell it was that Business Analysts are not required developers should work directly with the customer.

While I understood what was being said I could not agree with that point of view and it seems that it would be throwing the baby out with the bath water. It sounded very Us and Them which is a bad place to be and seemed to be describing problems associated with a waterfall approach rather than scrum.


I'm a developer and have learnt some very hard and expensive lessons over the last 2 years about the holistic success of software projects, not just More...