Jonathan Cardy

Jonathan Cardy


Scott Logic Pool Competition

on 04 Aug 2011

Simon & Ian Tense semi-final as spectators look on, enthralled The inaugural Scott Logic pool competition took place last night, kicking off with 12 brave entrants comprising 6 developers, 5 new graduates and our...

JavaScript Anonymous Functions

on 10 Jun 2011

Up until now I have found the term "anonymous" pretty confusing in the context of JavaScript. In this post I'll explain how to define anonymous functions, what "anonymous" means, and what uses these functions have. The ECMAScript specification does not have any mention of the term anonymous, so in a...

Undocumented changes to jQuery "andSelf"

on 02 Jun 2011

OK, this is a little behind the times since I'm talking about jQuery 1.3.2 - but it may be useful to someone. Today I was working on a project which had some time ago been upgraded from jQuery 1.3.2 to the latest version, and shortly after, a bug was raised....

Converting between jQuery Deferred and Rx Observable

on 10 May 2011

In this post I am going to look at the similarities between jQuery Deferred and Microsoft Reactive Extensions, and supply code which will convert between the two. Although Deferred and Rx have vast differences, there are some similarities which one may wish to take advantage of. For those who have...

CodeProject article on JavaScript strangeness

on 18 Apr 2011

At the weekend I published a CodeProject article titled "A Collection of JavaScript Gotchas". The target audience is JavaScript developers and also any other developer who might have an interest in JavaScript. I think it covers pretty much all of the wacky features that give JavaScript a bad name. [caption...

Web Workers Part 4: Wrapping it Up

on 25 Feb 2011

Update: I have summarised this series of blog posts in a CodeProject article, available here. In this series of posts I showed a sweet way to use Web Workers to improve performance on browsers that support them, without impacting performance on browsers that don't, by using jQuery 1.5 Deferred...

Web Workers Part 3: Creating a Generic Worker

on 24 Feb 2011

In the previous post we set up a Web Worker helper function that allowed us to create a worker file, and call it using code like this: $.work({file: 'primes.js', args: { from: 1

Web Workers Part 2: Using jQuery Deferred

on 18 Feb 2011

The .NET Task Parallel Library is a great advance in parallel programming for the .NET framework. It lets us easily run an anonymous method in another thread without any worries about the actual thread creation. A Task object wraps up a piece of parallel code, and provides a notification of...

Web Workers Part 1: Performance

on 18 Feb 2011

The Web Workers API is currently a draft HTML5 specification which defines an API for running JavaScript in a background thread. In this series of blog posts I am going to investigate the practical use of Web Workers. In this first blog post I want to look at the performance...

Introduction to Parallelism in .NET 4.0

on 16 Nov 2010

Back in the day, processors had a single core and clock speeds increased steadily every year. This meant that although writing multi-threaded code for a single CPU gave some performance improvements (since single-core CPUs usually try to execute multiple threads), it was hardly the top of any developer's list of...