A neat MySQL hack to create a VIEW with subquery in the FROM clause…

I’ve grown to love MySQL, but every now and then it has some strange restriction that temporarily stumps me. Then I discover a marvelous workaround and fall in love with it all over again. This hack lets you overcome the restriction that you’re not allowed to have a subquery in FROM clause of a VIEW.  The trick is toContinue reading “A neat MySQL hack to create a VIEW with subquery in the FROM clause…”

Writing games in HTML5 and CoffeeScript combining Box2D and EaselJS in an OOP/MVC architecture

Crap. That was a mouthful. There seems to be a huge amount of stuff on Her Majesty’s Interwebs about all of these topics, but very little explaining how to pull them all together into something coherent. There’s a shit-ton of bad code to copy to get something bouncing around on screen, but none of it cares about scaling wellContinue reading “Writing games in HTML5 and CoffeeScript combining Box2D and EaselJS in an OOP/MVC architecture”

How to write DRY SQL in MySQL – Part 2: Stored Procedure Hacks

In Part 1 we looked at using VIEWS to keep our SQL DRY. Unfortunately, there are cases when VIEWS are either not allowed or perform terribly and can’t be optimised.  Stored Procedures are, of course, the mainstay of writing DRY SQL, and optimisation.  Unfortunately, you can’t treat the result set of Stored Procedure as a query; therefore you can’t join storedContinue reading “How to write DRY SQL in MySQL – Part 2: Stored Procedure Hacks”

How to write DRY SQL in MySQL – Part 1: Views

Writing DRY code is a fundamental principle of software development.  DRY, or Don’t Repeat Yourself, was popularised by the 1999 Pragmatic Programmer coding practices book (the alternative being WET code, meaning Write Everything Twice, or possibly “We Enjoy Typing”). DRY code is optimal, not just because it’s less typing, but because when you come to refactor code (make changes to it), it’s much easier if there’s aContinue reading “How to write DRY SQL in MySQL – Part 1: Views”

How to add a WordPress Blog to a Moonfruit website

Moonfruit websites (a.k.a. Sitemaker) offer a rich set of very easy to use features for beginners. The built-in blog looks nice and is fully integrated with your site and design but it’s very limited. If you want real blogging power and you want to add WordPress to your moonfruit site, here’s how to do it. NB: I will use SitemakerContinue reading “How to add a WordPress Blog to a Moonfruit website”

%d bloggers like this: