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 :)