06 Sep 2010

Making Money with CodedUI

Saturday was Microsoft’s Dev4Dev’s event, where each presenter gets 20min to cover one topic. It is fantastic fun and a great way to learn.

For the event I decided to tackle CodedUI, which is just a great testing technology and in 20min I showed off a number of features using it. Below is the slides, which are not valuable - unless you jump to the hidden content where you find my demo script and some extra information!

If you are wanting to play with the demo’s you will also need my pre-constructed demo bits:

For those who attended and saw my second demo not go according to plan, I apologise again Crying face I’ve since run it again and it works every time, I guess the massive audience scared CodedUI into breaking Winking smile

Package icon BreakWPF original.zip12.74 KB
File TestValues.xml270 bytes
26 Aug 2010

South African ID Number Checker in Excel version 2

18 February 2016: Fixed a bug in the multiple checks with the date display. Thanks to John Sole for pointing it out.
8 August 2014 - Just a quick note that the spreadsheet has been updated with better checking if the date is valid (including leap years), plus has been cleaned up a lot and finally will show you both years if we can not be certain which century the person was born in. Tested with Excel 2013 - your mileage may vary on other versions.
Want this as an app for your smartphone? Click here

A long time ago I built a simple Excel spread sheet which worked out if an ID number was valid or not. Since I released it, I have received a lot of feedback about the spreadsheet. Most of the feedback was around how it worked, but a week ago Riaan contacted me and pointed out a bug in it so I took this as an opportunity to rebuild it.

Not only does the new version check the validity of the ID number, it also tells you where the person was born, gender and birth date.


Something else that I wanted to do was clean up the calculations. So now they have been moved to their own (hidden) tab and are documented.


For those who need to do a bulk checking, the second sheet of the Excel spreadsheet contains the ability to check multiple ID numbers.


I want to extend a massive thanks to Riaan Pretorius, not only for pointing out the bug but also running the new version through it’s paces and finding some issues in it. The fact this one is much better is owed to him, I just typed the code Open-mouthed smile

You can download the Excel file below!

26 Aug 2010

Pulled Apart - Part X: Visual Studio Rulesets


Note: This is part of a series, you can find the rest of the parts in the series index.

Microsoft has offered a great tool called fxCop for a number of years now. This free tool takes your compiled .NET code and runs it against a number of rules to check things like security, compatibility, globalisation and so on.

imageSome of the higher SKU’s of Visual Studio have included fxCop directly in the IDE, via the Code Analysis option. In previous versions of Visual Studio this just ran the fxCop command line and returned the results. There was not much else happening except a shortcut to having to run a separate tool.

In Visual Studio 2010 the fxCop integration has had a major improvement, with the addition of a dedicated interface for the management of what rules are run and the ability for you to create a bespoke collection of the rules that you care about by ignoring the rules you do not care about. The other great feature is that you can set if a rule throws a warning or an error in Visual Studio. Very useful for enforcing rules!


For Pull, I took the opportunity to create a dedicated rule set.

Step One – Theft

The first thing I did was to take the Microsoft All Rules rule set and copy it to my project and rename it to pull.ruleset. You can find the Microsoft All Rule rule set file at: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\Rule Sets\AllRules.ruleset

Step Two – Minor Tweak

Next I opened the pull.ruleset file in a text editor (it is just XML) and changed the rule set name and description.


Step Three – Associate

Next I used the Browse option in the rule set selector to select my pull.ruleset file.

Step Four – Adjust Rules

Now I can use the Visual Studio rules editor (click the Open button) to adjust what rules I want to keep and what severity level I want them at. As I started with the Microsoft All Rules, I have all the rules listed initially and so this took a little bit of time to adjust.


Step Five – Source Control

Make sure you check in your custom rule set file so that everyone in the team can enjoy it’s powerful magic. If I was using a fully featured ALM tool (like TFS) and not just a source control tool, then I could also include the rules in my check-in policies which ensure that code that is checked in comply and also in my build server.

24 Aug 2010

Tech·Ed Africa 2010: Want to go for free?

Win 1 of 4 Tickets to Microsoft Tech·Ed Africa 2010 worth R6 150 each!!!

Venue:    ICC Durban

Date:       17th - 20th October 2010

All you need to do is take a photo of a Microsoft Tag in a really cool/funny/practical place and upload the picture to the Facebook competition page.

More details in the competition animated video here.

Full Competition Rules on our Facebook page.

Dates for Submissions & Announcements of Winners:

  • 25 Aug 2010    -    Last Date For Submissions (week 1) (5pm)
  • 27 Aug 2010    -    Week 1 Winner Announced
  • 01 Sep 2010    -    Last Date For Submissions (week 2) (5pm)
  • 03 Sep 2010    -    Week 2 Winner Announced
  • 08 Sep 2010    -    Last Date For Submissions (week 3) (5pm)
  • 10 Sep 2010    -    Week 3 Winner Announced
  • 15 Sep 2010    -    Last Date For Submissions (week 4) (5pm)
  • 17 Sep 2010    -    Week 4 Winner Announced

Submissions & Announcements of Winners:

  • A new winner will be selected weekly.
  • Last date for submissions for a particular week is 5pm Wednesday of that week.
  • Winner for that week will be announced on the Friday.
  • Submissions after 5pm will count towards the following week.
  • Submissions which did not win in a previous week will still be considered in following weeks and need not be re-submitted.
  • A person can only win once, thereafter all his other submissions will be ignored.
  • You cannot submit on behalf of another person.
  • Submissions are done by posting a photo to the Facebook page wall.

Terms and Conditions apply:

This competition is limited to Tech·Ed Africa 2010 entrance and does not include Travel, hotel or any other expenses. You will be required to help out at the Developers Community Lounge at Tech·Ed Africa 2010 for 3 hours a day if you do win. For Full list of rules please consult the Facebook page.

20 Aug 2010

It's Dev4Dev's time again!

My favourite gathering of developers happens 2 or 3 times a year, it’s called Dev4Devs. This is a free event which Microsoft runs, where ANYONE can present a topic but they only have 20min! This means that in a morning you see 7 topics and rather than getting swamped in all the details you dive directly to the really important parts.

The topic list is below, and there is some exciting topics there and even some non-MS technology is covered too!

I am also really glad that the entire ATC team at BB&D, which is the team I work in, is presenting – they are highlighted in the list below!

The next one comes on the 4th September 2010 and it occurs at Microsoft’s offices in Johannesburg and you can register at https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032456806&Culture=en-ZA

Session List for Dev4Devs

Windows Phone 7 - Getting Started

A high level introduction to getting started with Windows Phone 7 development including: where to begin, options for developers, thinking about design and a demonstration application.

Presenter: Johannes van Schalkwyk

Making MVVM easy

Starting with WPF, Silverlight or WP7? Heard of MVVM but think it’s WAY too complex for your simple application? Join me for a crash course using the easiest MVVM framework available… Caliburn.Micro!
Presenter: Rudi Grobler (ATC Team Member)

Why you should care about Google Closure

Closure is a modularised set of JavaScript libraries that can assist you in building rich internet applications.

It's been battle-tested by Google on sites like: Gmail, Google Docs and Google Maps.

Attend this short intro to get an understanding of how important these libraries are and why you should consider using them in your next big internet app.

Presenter: Simon Stewart

Introducing NHibernate 3

The daddy of .NET ORM is back with a new release, in this session you'll see a few of the newest features - such as a full IQueryable LINQ provider - that makes NHibernate 3 the best release yet!
Presenter: Kevin McKelvin

Branding SharePoint 2010 with MasterPages, Layouts and CSS

One of the largest limitations of WSS3.0 and MOSS2007 is the ability to brand SharePoint without intricate knowledge of the platform and in some cases breaking a few rules and modifying out of the box system files to get the desired look and feel. Come and see how the theming engine in SharePoint 2010 together with CSS, Master Pages and Layouts can be used to brand your SharePoint site using the amazing new SharePoint Designer 2010.
Presenter: Brent Samodien

Unit Testing - Code Coverage & Mocking

In this presentation William will demonstrate how code coverage tools help measure the effectiveness of your unit tests.  He will also show how Mocking tools can help to add value to your unit tests and ensure that all edge-case logic is properly checked.
Presenter: William Brander (ATC Team Member)

Getting ready for Windows Azure development

Heard about the cloud? Excited about the possibilities? In this session we have a 1000-mile introduction to Microsoft’s operating system for the cloud, Windows Azure, how it compares to the other cloud offerings that are out there and how to get your hands dirty with the skill-up process. Endless possibilities + new tech = fun stuff.
Presenter: Ryno Rijnsburger

An introduction to Mercurial Source Control

Want a quick introduction into a Distributed Version Control System (DVCS)? Meet Mercurial it is a cross-platform, fast, lightweight source control management system designed for easy and efficient handling of distributed projects.
Presenter: Zayd Kara (ATC Team Member)

Making money with Coded UI

Coded UI is a brand new feature of Visual Studio 2010 which enables you to quickly build automated user interface tests for your application and run them as if they were unit tests. In the talk we will look at how Coded UI can change your life, one UI at a time!
Presenter: ME! (ATC Team Member)

Hack .Net in 10 Seconds - Why obfuscation is critical

Hacking 101 – I demonstrate how to bypass basic copy protection in an unobfusctaed .Net application through reverse engineering and show how obfuscation adds a layer of protection. I also demonstrate additional techniques for protecting your applications from hacking once they are released in the wild.
Presenter: Mark Pearl

Composite Applications with PRISM

In this session Stephan will demonstrate how to leverage the Composite Application Libraries to create modularized applications for WPF and Silverlight. He will also show you how to do multi-targeted development by sharing lots of code between the web and desktop applications.
Presenter: Stephan Johnson

An Introduction to Pex and Moles

An introduction into Pex and Moles, covering the basics of Mole Types and Mole Stubs and Parameterised Testing.
Presenter: Dave Russell

ASP.NET Dynamic Data

I will briefly introduce ASP.NET Dynamic Data by showing how to build a complete data maintenance web application with almost zero code.

Moving on, I will demonstrate some standard ways of customising a Dynamic Data application, and some more advanced non-standard customisation techniques. I will finish off by illustrating how Dynamic Data libraries and controls can be leveraged in other applications that don't normally use dynamic data.

Presenter: Brady Kelly


As you probably already surmised, ASP.NET MVC 3 is the next major release of ASP.NET MVC. Join us as we highlight the upcoming features and modifications to this popular framework.
Presenters: Jaco Pretorius and Kobus Brummer

13 Aug 2010

Pulled Apart - Part II: What? You're not using TFS!

Note: This is part of a series, you can find the rest of the parts in the series index.

onebit_26Some people see learning as a side effect of software development and others believe that all must be known upfront and so no learning occurs. The reality is that it learning during software development is a core part and you should be embracing it. One of the the things I have done with Pull is to host the code with CodePlex. CodePlex offers two ways to store source code – you can use TFS/SVN or you can use Mercurial. 

In the past I have always used TFS because I am comfortable there – it’s a tool I know well and I like to use it. However to embrace the learning for Pull, I decided it could be a Mercurial project. Which brought me to my first issue, I didn’t have any Mercurial tools so I went off to find a set I liked.

Being that I didn’t want to install anything, because my machine is so light and fast, a lot of the packages out there were not an option (TortoiseHG, I’m looking at you). In the end I choose the Mercurial Cmd Portable from PortableApps.com which gave me a light option, but did mean no GUI which really isn’t a bad thing.

Comparing it to TFS is a two part compare.

  1. If I compare to the full GUI TFS inside Visual Studio then I prefer the Mercurial experience because working disconnected from the server and coming online is easier.
  2. There are TFS Power Tools which provides a command prompt tool called tfpt.exe and that has an online option which makes the whole experience just as good what Mercurial offers.

One of the big areas of difference between how TFS and Mercurial work is branching/merging/labels/forks etc… which I have not experienced yet.

Some of the things I did in my Mercurial setup which may help other people.


My ignore file for C# projects done in Visual Studio, with CodeRush installed.

syntax: glob



My config was fairly straightforward, I have an auth setup so that my CodePlex details are remembered and I created an alias called codeplex. This lets me just type hg codeplex and it prompts for my password and that’s it – one line gets the repro pushed to CodePlex. I also setup WinMerge as the diff tool, because I am a WinMerge fan and this just lets me keep using it easily.


codeplex=push https://hg01.codeplex.com/pull

username=Robert MacLean <robert@sadev.co.za>

; must uncomment this line
extdiff =

cmd.winmerge = E:\PortableApps\WinMergePortable\App\WinMerge\WinMergeU.exe
opts.winmerge = /r /e /x /u /wl
12 Aug 2010

Pulled Apart - Part I: Introduction

Note: This is part of a series, you can find the rest of the parts in the series index.

onebit_26I have needed software which the available implementations of that type of software doesn’t solve (due to cost, features, experience etc…) thankfully I like to write code and I like to share. This means I am often writing small applications to solve problems. My current one is a podcatcher, it is a program which downloads podcasts, called Pull.


Pull is designed with the idea of being just a podcatcher, because all the media players out there with bundled podcatchers are either VERY heavy or just crap, so my solution to that is just be a tool which does one thing, and does it well.

The second major design feature is that it must be portable – assuming .NET 4 is installed then it should just run without an install. Smile

Lastly it should be quiet and just get on with the job of pulling down podcasts. I do not need to be annoyed with pop-ups and sounds all the time. My view is that I will deal with you when I have the time, else sit in the corner and do your job.

I thought I would blog a series of some aspects of the development both code and technology as I have learnt a ridiculous amount during the initial development. Check the series index at the top for a preview of what I have in mind or to find more parts in this.

11 Aug 2010

Visual Studio and/or Test Manager corrupt licensing?

Blue Male Doctor In A Lab Coat, Sitting On A Stool And Bandaging A Blue Person That Has Been Hurt On The Head, Arm And Ankle Clipart GraphicAt the Visual Studio & TFS event we had a few machines complaining that the Test Manager license was invalid and a new one was needed. Those same machines also said Visual Studio’s license was corrupted and that Visual Studio needed a re-install.

To make this more odd, we were using virtual machines so every machine was identical yet only some machines had this problem.

The cause was the host OS date was wrong (the year was 2008) and so the virtual machines were set to 2008. In the eyes of the virtual machine this meant that the license was installed magically in the future.

We turned off the VM, deleted the state, fixed the date and started again and it was solved!