RH

My JSFiddles

I like to use JSFiddle for sketching out ideas and playing with technologies. Here I present some of the Fiddles on my account which I consider a bit more interesting.

CPU simulation

As a web developer, I realise that I bear about the same relation to the inner workings of the CPU as a sociologist does to quantum mechanics. Nonetheless I have an urge to try and comprehend how it works. This Fiddle is a simple simulation of processes run in an operating system. The components comprise a CPU, a clock, a scheduler, an instruction set, and a ready queue. The scheduler takes processes from the ready queue and dispatches them to the CPU which runs the instructions comprising their program. The instructions are rendered in a list as they are executed.

CPU Adder

This was based on a YouTube video which explained how a full adder in a CPU worked. The add() function simply takes two binary numbers as input and adds them together printing out the result to the console. There isn't a huge amount to see here but the example shows how logic gates can be hooked up to facilitate binary arithmetic. I am still considering expanding the example to simulate an entire computer system in Javascript.

Book Reader

A small prototype of an article widget which animates the transition from one page to another.

CSS Grid

A highly simplified version of CSSWizardry

Command Pattern

I'm a big fan of design patterns and this is a simple implementation of the command pattern. The idea behind the command pattern is to store all the data required to call a function at a later time including its name and its parameters. It is useful for implementing history systems which is what I have done here.

Featured writings