Tuesday, 22 April 2008

Automatic Properties and Structs

I was merrily creating my first struct since the advent of automatic properties and figured it would be nice and easy, so continued and created the following:

public struct UserNamePasswordPair
public string UserName { get; set; }
public string Password { get; set; }

public UserNamePasswordPair(string userName, string password)
UserName = userName;
Password = password;

To my disappointment I got a compiler error:

"The 'this' object cannot be used before all of its fields are assigned to"

This was very disappointing and I thought surely Microsoft wouldn't have forgotten to allow automatic properties on structs and it turns out they haven't, looking further down the error list I see a useful message:

"Backing field for automatically implemented property 'UserNamePasswordPair.UserName' must be fully assigned before control is returned to the caller. Consider calling the default constructor from a constructor initializer."

Ah ha, fair enough, so I simply added the call to the default constructor and bobs you uncle it compiled, yeh!

public struct UserNamePasswordPair
public string UserName { get; set; }
public string Password { get; set; }

public UserNamePasswordPair(string userName, string password)
: this()
UserName = userName;
Password = password;

Silverlight Assault Course - Bournemouth

Us guys at NxtGenUG - Southampton have been putting our heads together to create a complete day of Silverlight, we figured the best way to learn all this new technology is to get your hands on it and play with it whilst in the presence of people that know and can help answer your questions.  The great thing for me is that this event will be based in Bournemouth which is my home town!

Keep your eye on the NxtGenUG event list for more details on the final date of this. We are thinking that the day will consist of a bunch of hands on labs that give you some typical walk through scenarios allowing you to understand how things happen in Silverlight. There will also be key speakers that will deliver talks on the different aspects of Silverlight and how they fit within the current development world.

This is still in the planning stages but we are looking to get this all together within the next couple of months, I was just wondering whether anybody has some suggestions on the kind of content you would like in an event like this, please feel free to add comments with your suggestions.


DDD7 - Date Released

I've now been given the nod that the date for DDD7 has been officially released, it is going to be Saturday 22nd November 2008 although the website hasn't been updated yet.

Saturday, 19 April 2008

Cool desktop switcher application

After the recent arrival of my new son Jacob, the inevitable huge amount of photos have been taken and my library has started to grow and grow. Now, it has always bugged me that the Windows desktop background image is static and you have to manually change it to something different when you 'feel the need', well this is no longer the case.

A friend pointed me in the direction of this handy little piece of software called John's Background Switcher by a guy called John Conners. It's got functionality to hook up to all sorts of online photo albums such as Flickr, Picasa, Phanfare etc and its really easy to use. Just point it at the albums you want to include, choose the type of background image you want (I really like the snap shot which creates a bunch of random polaroid looking images).


The following images I stole from John's site, which I am sure he won't mind because I am promoting his application, but they give you a good example of what the application does.

Make your wallpaper interesting!With John’s Background Switcher!

Anyone enjoy!

Friday, 18 April 2008

Now that was Entity-tainment

Last night saw another cracking NxtGenUG - Southampton user group session with a grand total of 36 attendees, the support we are receiving for the group is phenomenal and its going from strength to strength.

This was our first session after the arrival of British summer time and highlighted a small flaw in our venue which has glass walls on both sides which had the effect of bleaching out the early part of the session, but as the sun went down life was good again. If anyone knows where I can get hold of a large black cloth to drape over the windows I would be most grateful.

Neil Robbins, NxtGenUG Southampton member, kicked off the evening with a quick 10 minute walk through IIS 7.0 and permission controls, something useful to know about to let your local IT pro hand over permission to you as a developer when managing the IIS server remotely.

Mike Taulty then did a brilliant presentation, as we have come to expect from him, on ADO .NET Entity Framework. I always enjoy talks by Mike, he seems to have a way about him that keeps your interest all the way through the talk and continually provides the right level of technical content and humour ensuring an enjoyable session. For anyone that wants to check out the resources Mike mentioned in his talk have a look here.

I am personally really interested in the Entity Framework and I think it is going to have a big place in the development world in the future, I can't wait for future releases and to finally get my hands on the real thing.

Mid-way through the session we broke for the usual pizza and a quick chat. It was nice to see some new faces. 

Finally, the obligatory swag was distributed to the attendees, with swag ranging from a Tech Net baseball cap, Microsoft socks, a funky travel adapter, a really cool MSDN tool kit (it's a mini screw driver set that I personally think is really, really useful), the kind guys at JetBrains gave us another Resharper license to handout and last but by absolutely no means least a bunch of Visual Studio 2008 Standard Editions packs that were left over from our Install Fest Launch event last month, finally a whole bunch of T-Shirts were thrown out to the screaming masses.

All in all I think it was another successful event, many thanks to both Neil and Mike for the technical content and thanks to all the attendees for helping make Southampton the fastest growing NxtGenUG region!

P.S. If you did attend the event any feedback you have would be greatly appreciated, please go here to fill out your comments.

Thursday, 17 April 2008

Running WatiN with Cruise Control .Net

I've been doing a bit more work with WatiN lately to get some decent automated test coverage for our web application and everything was running all fine and dandy on my local machine (famous last words) but when the time came to move the tests into our continuous integration build environment I came across a bit of a problem, our cruise control runs as a service but WatiN launches IE, mmm a bit of a problem I think. Kicking off a cruise control build simply resulted in the build hanging for an extraordinary amount of time when the build previously took approximately 15 minutes.

So I did a bit of digging on the web and quickly came across a couple of people having similar issues, the first suggesting to simply set the "Allow interaction with the desktop" flag on the service, so I did this and tried again.


I restarted the service and kicked off another build and low and behold the tests started working, nice one.


Wednesday, 16 April 2008

That's Entity-tainment

Mike Taulty, has decided he needs a bit of sea air, and so is heading for the South Coast to mix it up with us guys at NxtGenUG Southampton. It looks like Mike and Daniel Moth are trying to collect the full set of NxtGenUG regions! Mike will be talking about the new Microsoft Entity Framework.

Here's the blurb:

"ADO.NET Version 3.0 raises the level of abstraction at which we deal with relational data in applications by adding a new managed provider which uses a conceptual model which it maps to the actual tables and views of your database schema. This has the advantage of providing the Entity Relationship model that application developers want to code against whilst isolating the application code from the specific language (e.g. T-SQL, PL/SQL) and engine (e.g. SQL Server, Oracle) of the store. In this session we’ll take a good look at the Entity Framework from its mapping layer through to its EntitySQL language and on to its Object Relational Mapping capabilities and LINQ."

We will also have NxtGenUG member and MS Launch Event Ready Steady Speak! 'Hero' Neil Robbins delivers his second nugget this time on IIS 7.0.

So don't forget to sign up to avoid disappointment, get your hands on some decent swag and have some pizza while you are at it!


Monday, 14 April 2008

Power Commands for Visual Studio

For those of you who don't have the budget for some of the more luxurious refactoring tools such as CodeRush or Resharper the kind fellows on the Visual Studio Extensibility team have released some new power commands.

I've not had a chance to look at these in depth but there are some basic commands that you would expect to be in VS2008 by default such clear all panes, format a document on save, copy path and email code snippet. Check them out here.

Monday, 7 April 2008

Successful delivery of some "New Born Baby Technology"

So I've reinstalled windows multiple times, I've programmed loads of software applications, written hundreds of lines of code but I am now facing my toughest technological challenge yet: a new born baby.

For those of you that don't know as of 26th March 2008 at 23:02 I became the proud owner of "Jacob Richard Allen" a wonderful bouncing baby boy and I have got to say I am pretty chuffed.Jacob 4 days 018 Now I must admit the delivery was 4 days late and definitely over budget but hey it's worth it when the result is something this cute.

I've completed the necessary preparation and home installation steps and also ensured that I have sufficient essential transportation accessories such as car seat and travel system.

So all that remains is for me to:

  1. Understand the baby's power supply mechanism (with the help of mum in that department)
  2. Get to grips with programming sleep mode - my model seems to have some minor bugs in this area at the moment so hopefully a new firmware update might fix that
  3. Monitor sensory applications such as visual sensors, auditory sensors and propulsion apparatus
  4. Track the baby's waste function - I must admit I never thought I would be so interested in the colour of a bowel function
  5. Read the rest of the manual to get a better understanding of how on earth I am going to cope in the coming years :-).

I can't wait for the challenges that lie ahead and hopefully I will have fun learning new things about my new baby. For anyone that is interested, the baby owner's manual is pretty good, it is done with a bit of tongue in cheek but has some useful information about how to deal with a baby in "bloke" speak, nice and simple and straight to the point.