Thursday, 26 May 2011

XP2011 International Agile Conference (Madrid)

I'm lucky I work for an employer that recognises the value in sending the development team members to conferences ever year. Since I started at Esendex, I've been to a number of conferences over the years, most of them focused on the coding aspect of development; new frameworks, IDEs, tools etc. This year I was hungry for something more focused on the management practices and processes in agile software development, something that I felt I need to add to my skillset as an aging developer (I may not look it, but I'm 27!).

The team at work had been discussing conferences and XP2011 came up, when I investigated the conference program it sounded promising; just what I'd been looking for infact. Add to the mix that it was in beautiful Madrid and I was sold.

Conference format

The conference is designed to bring agile researchers and practitioners together. The first and last days are dedicated workshops and tutorials for discussing hot topics in the world of agile. The 2 days between are the core conference days and the programme offers 5 parallel sessions; 3 focused sessions plus invited talks and reports from industry. They also offer time for OpenSpace on the Thursday, for attendees to create their own sessions/discussions.

What was it like?

Good, very good. I wasn't sure what to expect to be honest, but the venue and food was great, people were friendly and everything seemed well organised. The session and workshop speakers were generally very good and knew their subject material well. You'd see the speakers attending lots of other sessions and discussions as attendees, they were approachable too, giving the conference that bit more of a community feel to it. Everyone seemed friendly, approachable and open to discussing their own agile perspectives and challenges they've faced; which I particularly found value in. One of the most enjoyable aspects of the conference were the sessions with lightning talks (10-20 min condensed talks). The speakers that I found particularly interesting were Ken Power, Esther Derby, Emily Bache, David Anderson, Mike Hill and Liz Keogh. Expect to see some posts related to the more interesting topics I attended at the conference over the coming weeks.

The social events were also well organised and there were plenty of complimentary drinks and food for everyone. The Wednesday night geek disco was a particular highlight :)

Any complaints? Well, a few of the sessions based on research papers were presented by the researchers themselves, who seemed a little inexperienced at presenting and as a result the session wasn't enjoyable. You can have the most interesting material in the world but if you don't deliver it well, you don't engage me or the rest of the attendees and it's a bit of a waste of time.

Conclusion

I enjoyed it and I'd recommend it to others looking for a conference of this type. The attendees are  passionate about the subject matter and it's infectious. If the subject material for XP2012 (Sweden) grabs me, I may well return to satisfy my agile appetite.

Monday, 16 May 2011

Getting to grips with Git

Git is a world apart from Team Foundaation Server and people seem to be frightened at a first attempts with it, as it can seem complex. Stick with it though and you'll soon see past that and how simple it can be. Git is a distributed source control system, so it allows you to work disconnected from the main repository and still commit. This 'commit' is to your local repository. You should commit often. Once happy that all your tests pass should you push to the remote repository.
  1. clone - get the source code from your remote git repository
  2. Make your changes
  3. commit - commits your changes LOCALLY (not the remote git repository)
  4. push - commits your changes to the REMOTE repository
For me, working disconnected is the number one advantage for Git over TFS. Number 2 is the ability to create branches. Essentially just a seperate work stream you can use for working on seperate features. Once happy, you then merge your branch into the master branch (which is the main repository).
  1. clone - get the source code from the remote git repository
  2. branch branch-name - create a branch branch-name
  3. Make your changes on your branch
  4. commit - commits your changes LOCALLY (not the remote git repository)
  5. push origin branch-name - commits your changes to the REMOTE repository
  6. checkout master - switch to the master branch
  7. merge branch-name - merge the feature branch into the master
  8. commit and push !!!
I'd strongly recommend that you use the git bash until you get to grips with the git comands, then you can make use of the helper tools.
At the moment I'm still working with the bash but I occasionally use TortoiseGit for windows explorer integration and Git Source Control Provider for Visual Studio GUI integration.

Sunday, 20 March 2011

jQuery Document Ready Shorthand

You should always start your jQuery using the ready() function. The handler passed to .ready() function is guaranteed to be executed after the DOM is ready.

There are a few ways to start your jQuery function, but all are equivalent:

$(document).ready(function() {
  // Do some magic
});

$().ready(function() {
  // A bit quicker to write
});

$(function() {
  // Nice shorthand that I prefer to use
});

Tuesday, 15 March 2011

jQuery Sytax Error - Unrecognized Expression

A recent upgrade to jQuery 1.5 from 1.2 highlighted a problem with jQuery expressions which resulted in a number of javascript errors...

Syntax error, unrecognized expression: [@attributename=value]' when calling ...

Some digging highlighted that attribute selectors, since jQuery 1.3 and above no longer use the @ syntax. This actually had been deprecated since version 1.1.4, but only from version 1.3 is it no longer supported.

Old way (pre jQuery 1.3)...

$("#holder input[@value=contacts2]");

New way (post jQuery 1.3)...

$("#holder input[value=contacts2]")

Wednesday, 23 February 2011

Git First Impressions

So far, so good :) Took me just under half a day to set up a git repository, import the existing project source and update our CI server. GitHub works well for creating your repositories and walks you through the process. It's very quick, especially when you comapare it to TFS - it's knocked 40% off our build time for a fairly hefty web app. It's not just the speed thats impressive though, having a complete history and full revision tracking capabilities, not dependent on network access or a central server is something as a TFS slave user, I've been longing for. I still think there's lots to get my head round, which will make things interesting next week when I have some real work to do on this project; so watch this space.

Here are some useful resources if you are just getting to grips with Git:

Git Bandwagon

I've being feeling the peer pressure of late to try out Git as source code repository for our the app team's projects. Today I'm going to give it a try with one of our bigger web apps. I'm hoping that it won't take me too long to get my head round the way Git works and that it results in the project build time dropping on our CI server. Well it had better - time is money!

Git is an extremely fast, efficient, distributed version control system ideal for the collaborative development of software.

Wednesday, 16 February 2011

Removing XmlDocument Whitespace C#

I've recently been working on matching certain API calls with XML data pulled from an XML file for testing purposes. I noticed there was a large amount of white space left in the XML when pulled from the resourced XML file; which is something I didn't want.

I thought setting the XmlDocument.PreserveWhitespace property to false would remove this for me, but it just seems to remove the preceding and trailing white space; making it similar to the string.Trim() method. I needed to use something akin to string.Replace() (this replaces a specific substring with another substring), but more powerful. Here comes the Regex.Replace function to the rescue, which is a bit like string.Replace() on steroids! Regex.Replace() allows replacement of text using regular expressions, something which can make make complex replacements a piece of cake.

Here is the code to replace white space in XML or any XML dialect (such as HTML - or XHTML):

// Remove inner Xml whitespace
Regex regex = new Regex(@">\s*<");
string cleanedXml = regex.Replace(dirtyXml, "><");

Thursday, 3 February 2011

Team Foundation Server Admin for Dummies

Occasionally I'll need to administer my team's users and projects in TFS, which usually results in me having to annoy Jonathan our TFS guru at Esendex and beg him to help me. It's not just me that finds it difficult to administer TFS users and projects though; Microsoft don't make it easy for us developers at all.

Luckily, some nice people over at Attrice Corp have made it easy. Introducting Team Foundation Server Sidekicks, a GUI tool for TFS admin tasks.

You're welcome :)

Wednesday, 26 January 2011

Memory stream is not expandable

An upgrade to .Net 4 for an MVC app highlighted an issue with the MemoryStream class we were using in the framework. Seems that unless you use the default constructor, the stream cannot be expandable. If the stream expands you'll get a lovely System.NotSupportedException: Memory stream is not expandable error thrown at you like a ninja star.

var ninjaStarStream = new MemoryStream(buffer); // Potential error
var fluffyStream = new MemoryStream(); // Stream is expandable :)

Consider yourself warned!