Page 40 of full list of posts


PCPlus 294: Learn to solve pentominoes

This article was just a great deal of fun to write. I wanted to talk about Knuth’s DLX algorithm (“Dancing Links”) as a solution to the exact cover problem. I’d already talked about Sudoku (a great demo of DLX) recently as an article in the mag, so there was nothing for it but to go for pentominoes, one of the other examples Knuth gave. And it gave me a great reason to bring out my old pentomino set that I was given as a teenager and futz around with it. Needless to say I’m still just as bad at solving it as I was then. […]

READ MORE

JavaScript: Unit testing asynchronous functions

In a previous blog post, I talked about the QUnit unit testing library for JavaScript. In that post, I showed how to use it with a date library I was messing around with. If I were you I would review that previous blog post; it will help in what’s to come. […]

READ MORE

Implementing MarkDown for comments

I haven’t been too happy about the facilities for commenting in GraffitiCMS ever since I started using it. Great for minor feedback, but awful for pasting code when crafting an implementation detail as an example. Since StackOverflow uses MarkDown for its comments and I’ve grown used to that, I decided to experiment adding it to my blog here as well. […]

READ MORE

JavaScript: Using the shift method on the arguments array

In my webinar today on reading jQuery source code, I was talking about the extend method. I started out by talking about what a typical extend method would do before going onto the jQuery-specific one. […]

READ MORE

PCPlus 293: Building an efficient dictionary

I think this is pretty much the last article I’ve written for PCPlus that discusses algorithms in a fairly formal sense. As I said last time, my editors and I have slowly been moving my articles towards more “how it works” topics than the traditional “layman’s guide to algorithms” subjects I’m perhaps better known for. […]

READ MORE

Minor changes to look-and-feel

I’ve been meaning to do a bit of housework on this site to clean up the CSS and to add a bit of interactivity. After all, I write a lot about JavaScript, so I might as well start adding some to my blog. […]

READ MORE

JavaScript for C# developers: callbacks (part III)

In the previous two installments (one, two) we explored the use of callbacks through creating a mapp function for arrays (so called because the latest JavaScripts have a native map method already), and through creating a mapAsync function where the work is done asynchronously rather than serially. The reason for this was so that we could avoid triggering the browser’s “script running a long time” warning and, also, more importantly, provide the user with a responsive UI. […]

READ MORE

JavaScript for C# developers: callbacks (part II)

Last time, we wrote a map method for arrays (which I had to call mapp, so that we didn’t clash with the native version present in many browsers). To use the map method, you have to provide a callback function that would be called for every element in the array. […]

READ MORE

JavaScript for C# developers: callbacks (part I)

As I’ve said pretty much from the very start of this series: functions are objects. You can pass them around in variables, pass them into functions as parameters, return them from functions, the whole nine yards. When you pass a function into another where it will be called, it’s generally known as a callback. […]

READ MORE

PCPlus 292: The science of route planning

By March 2010, I was starting to move to a more “how it works” style of article to go along with changes in the magazine, rather than a “layman’s guide to algorithms” article which I’d traditionally done. This article on GPS systems (or sat-nav, if you’re in England) was my first real attempt at such an article: select some technology and explain its underpinnings for the lay audience. […]

READ MORE