Category Archives: Uncategorized

Lego Millennium Falcon – Buy or Build?

soloStar Wars has been very much in my thoughts lately. Like pretty much everyone in the world, probably, given the huge marketing push behind The Force Awakens. So I couldn’t help but stop and stare when, in the window of a sleepy toy shop in a quiet corner of the UK where my Dad lives, I saw a large, impressive-looking Lego Millennium Falcon. I peered closer, then recoiled in horror at the price tag: £189.99! Whoa.

So like any sensible person, I turned to the internet to see if this beauty was available anywhere else at a more reasonable price. And that’s when I fell into the rabbit hole of Lego Millennium Falcons: rare ultimate collector editions, custom-builds, retired models, 10179s, BrickLinks and MOCs. Oh my.
Continue reading Lego Millennium Falcon – Buy or Build?

Heisenmemory

I am sick of non-deterministic memory management. So sick. This was the big promise of .NET wasn’t it, way back in the 00s? No more having to worry about reference counting, double-frees or leaks. Well all we’ve done is switched it for worrying about event handlers, garbage collector pauses and weak dictionaries.

If you don’t have to worry about memory in .NET applications, then why are there so many commercial tools for solving memory-related problems? I’m starting to yearn for the days of being able to put an instance on the stack for the length of a curly-bracketed scope, and knowing that after that, it’s gone.
Continue reading Heisenmemory

SpriteKit for Cocos2D developers

spritekit logoOn my recent iOS puzzler Wordz, I decided not to reinvent the wheel, and instead use an off-the-shelf 2d game framework. I settled on Cocos2d. It makes it very easy to put together sprite-based games or apps by providing all the basic pieces like a scene graph, animations and integration with a couple of physics engines. It’s built on OpenGL but, happily, hides all that away from you – unless you need it.

No sooner had I released it, than Apple came out and announced a new framework for 2d games: SpriteKit. And it’s remarkably similar to Cocos2d. Here I’ll take a look at a few places where they differ, so you know what to look out for if you’re considering migrating to SpriteKit.
Continue reading SpriteKit for Cocos2D developers

Holiday

If you’ve been wondering where I’ve got to over the past few weeks, rest assured I’ve not given it all up, but I’m taking 6 weeks out to travel round the west coast of the USA with my family in an RV (a motorhome). If you need any more detail than that (really?), head over to bigtrip.voyce.com.

Fanboy, moi?
Fanboy? Moi...?
Of course, being an oft-accused Apple fanboy, I took the opportunity to stop at the Cupertino mothership on the way through.

See you back here in September!

Too busy to blog…!?

Yes I know, shocking isn’t it? Too busy doing work that pays the bills to blog about random things I find interesting or amusing.

So what’s been keeping me away from WordPress?

  • Spending too much time in WinDbg tracking down .NET and COM memory issues.
  • Wanting to have a good look at Visual Studio 2010 and .NET 4.0 (though not as much as I’d like, yet)
  • Playing lots of Bayonetta, and some Heavy Rain.
  • Doing lots of internal demos of the WPF\F# GUI-building toolset we’ve been working on. Should be interesting, specially now Luca’s coming on board.
  • Experimenting with iPad development

Hopefully I’ll get the chance to write something about all of this soon.

Don’t do anything in DllMain… Please

Novice Windows programmers can often think that DllMain is a good place to get that one-time set-up and tear-down work done. It seems to offer an ideal opportunity to know when your DLL has just been loaded, and when it’s about to be unloaded. What better place to add all that expensive, complicated initialisation…? STOP! WAIT! Before you add anything in DllMain, make sure you understand what state the process will be in when it gets called. Once you know that, you may well change your mind…
Continue reading Don’t do anything in DllMain… Please

FormatException in WPF DataBinding

While working on some F#/C# WPF code the other day, I kept hitting a fatal FormatException when running under the debugger. Annoyingly, the app would quit with:

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.

But it worked fine when started from Expression Blend, or when run using Start Without Debugging in Visual Studio. Let’s take a closer look…
Continue reading FormatException in WPF DataBinding

What a response!

Wow. I’ve been totally overwhelmed by the response to the 7 signs your UI was created by a programmer: 40,000 readers and counting, and that was just over a couple of days! I’m expecting some seriously good programmer-created user interfaces after this. And if I spot one more typo in a dialog box, I promise I’ll raise an army of UI pedants to hunt you down and put your users out of their misery.

A couple of apologies are in order. Firstly, sorry if you tried to hit the site and found it down. I totally wasn’t prepared for the traffic; my bad. Secondly, sorry if you’ve posted a comment on the article here or elsewhere and I haven’t responded. I’m been swamped and the day job always seems to get in the way, dammit.

Anyway, thanks for reading, keep in touch, and I’ll try and get over that ‘difficult second album’ period I seem to be having.

Missing content in long WordPress posts

wordpress_iconI’ve just spent several hours struggling with an annoying WordPress problem: when I edited a post to make some additions, it suddenly stopped displaying any content. The title, header and footer were still visible, only the post body itself was missing.

After a bit of poking around, I came across this post. It points out the root cause of the problem is the PHP regular expression engine (PCRE) that WordPress uses.

The easiest way to fix the problem is to ignore the advice in that post about modifying formatting.php, and instead make the fix to PHP.INI which is mentioned in the comments. I edited my copy to include the following line, which increases the backtracking limit from the default of 100000:

pcre.backtrack_limit = 1000000

After getting IIS to pick up the changes (iisreset) my missing content appeared again.