How do they do it – the right way to write software

[Concrete / Interesting] Sitting at my desk and looking at the plans for the next scheduled release of our enterprise application and, oh boy, this looks like it’s gonna take forever. Not an unusual thought to pass through the mind of a development manager. But wait, does it really have to be this difficult? Is there a better way. How do they do it?On another subject, one of the guys in the team shows me Trello ( – 5 minutes in and it looks like the right tool for the job.It’s a line of business application and it does what it says on the tin. Then my mind wanders and I find myself asking “how do these guys make any money? how do they write this stuff and sell it for nothing? how do they do it?”. So I dig a little deeper and the clue to how is to be found at the following URL:, behind the web client, iOS, Android and Windows 8 clients, there is a business level REST API. And take a look at the structure, API nouns based on key business entitie…

Performance Boost for XML Stored Procedures

[Concrete / Mildly Interesting] Sometimes SQL Server makes you want to pull your hair out. If you are using XML types in your stored procedures and seeing some  very poor performance, I may have an answer for you in this post. XML is working, but maybe a little too hardToday I was looking at the performance profile of one of our applications and after a little digging I noticed that a stored procedure was performing rather poorly. We pass a lot of parameters to some of our stored procedures and when we do this we use XML. This technique allows you build parameters using LINQ XElement types and with LINQ to SQL, simply pass the XElement as a parameter to the stored procedure. It’s a great technique so it’s even more disappointing to see it perform so badly. And what’s worse, it seems it’s the simple operation of fetching out the data using nodes() that causes all the problems.To illustrate this, take a look at the following XML:<Transaction>

Sending Email Landscape style in Cocos2D

[Concrete/Interesting] You know when sometimes a piece of code seems really simple, but it just won’t go right? The code just won’t behave properly. Fix one problem and another one pops up...Well, all I wanted was to use MFMailComposeViewController in my Cocos2d application. I’ve done it before so thought it would be a quick job. After many, many hours, I got it working, so to save you all the effort, here is what I did.Landscape and MFMailComposeViewControllerThe problem was the game is in Landscape mode and it seems the mail view controller doesn’t like landscape. Works beautifully on the iPad, but the iPhone sees the world in Portrait. The standard method to launch email is to call presentModelViewController. Here’s the sort of thing that works well in Portrait://Create the mail view controller
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"The Title"];

// Email Body
NSMutableString *ema…

LINQ to SQL Dynamic Stored Procedures

[Concrete/Little bit interesting] I wanted to call stored procedures by name using a string parameter. Sounds simple and with ADO it's a breeze. But with LINQ to SQL, life is a little more complicated. Here is how I cracked the problem.LINQ to SQLIn Visual Studio, when you add LINQ to SQL Classes to you project, you are creating a class that provides a convenient set of classes for managing tables, views, functions and stored procedures:When you add LINQ to SQL Classes to your project, Visual Studio creates a .DBML file set. These files describe the managed entities with partial class definitions. The main class is derived from System.Data.Linq.DataContext and provides the link between your code and the database connection. LINQ to SQL works through defining class members that maps LINQ onto the entity and makes use of attributes to map columns, parameters and returns to .Net classes. LINQ to SQL Classes takes a lot of code out of your application and is easy to use. For example, …

Using IActiveAware and INavigationAware

[Concrete/Little bit interesting] The Microsoft Prism framework provides a couple of very useful interfaces for managing awareness of view activation and navigation.IActiveAwareIActiveAware is a simple interface you can implement on your views to indicate that you want the view to be notified when it is made active or inactive. It looks like this:publicinterface IActiveAware { /// <summary>/// Gets or sets a value indicating whether the object is active./// </summary>/// <value><see langword="true" /> if the object is active; otherwise <see langword="false" />.</value>bool IsActive { get; set; } /// <summary>/// Notifies that the value for <see cref="IsActive"/> property has changed./// </summary>event EventHandler IsActiveChanged; }The IsActive flag lets you know if your view is active, and the IsActiveChanged event will fire when that state changes.If you implement this on your view class, t…

This is a test Article on the blog

[Concrete/Interesting]Here is a pictureLike it?Actually, this is a test for using Windows Live Writer to publish to SharePoint Wiki. Which sounds easy, but you guessed it, it’s not.I’ll let you know how I get on.Frankly, it’s all rather disappointing. I guess someone at Microsoft, looking to make SharePoint a little more useful thought “well it’s good at lists and HTML docs, if you add a template with an on-page editor, hey presto, you’ve got a Wiki”. Only, it’s not that simple and the editor is far too lightweight. Windows Live Write (WLW) on the other hand is a well thought out, powerful tool. Clearly the best Blog editor in my mind. It’s the reason I have a Windows VM on my Mac. So I gave it a go and WLW doesn’t want to talk to the Wiki because it’s not a blog, doesn’t support the APIs, just a list with an editor. However, it was suggested that I could author my pages against my SharePoint blog. Great. It worked brilliantly. WLW talks to SharePoint blogs and does an excellent job o…

Fermat’s Last Theorem

[Concrete/Interesting] A while back I saw a BBC Horizon programme about Fermat’s Last Theorem and the mathematically heroic work by Andrew Wiles in raising the Taniyama-Shimura conjecture from a mere conjecture to a theorem and using this to show a contradiction between the predictions of the epsilon conjecture and Wiles’ proof that all such elliptic curves must be modular. This contraction implies there are no solutions to Fermat’s equation, hence Fermat’s equation is true.Like many, I was excited about this proof and although difficult to follow (Elliptic Curves are hard to understand, no kidding), the proof was without a doubt a clever piece of late 20th century mathematical wizardry, full of deep insight and imagination. But something was wrong. It was all to clever, all too complex, all to contemporary. So to mark the birth of my new baby boy, Khaliq, I decided to provide a simple proof, maybe not complete in mathematical rigor and probably nowhere near robust enough for Cambridg…