RFC 7168: Hypertext Coffee Pot Control Protocol for Tea Efflux Appliances An update to HTCPCP (RFC 2324) to allow for the connection of networked tea-brewing devices. Published under the RFC Informational series. Articles Tue, 01 Apr 2014 09:15:00 GMT Let's Build a JPEG Decoder: Frames and Bitstreams Continuing a series exploring the concepts behind JPEG image compression, this part begins delving into the relationship between the image, its colour constituents and the encoded data by breaking open the Start of Frame segment. Articles Sun, 05 May 2013 22:18:50 GMT Let's Build a JPEG Decoder: Huffman Tables Various levels of compression and encoding are employed in the production of a JPEG file. The first step in decompressing an image is decoding the data, which is compressed with a variant of Huffman encoding. This article looks at the data attached to a JPEG file which allows the Huffman decoding to proceed. Articles Sun, 24 Feb 2013 22:06:00 GMT Let's Build a JPEG Decoder: File Structure Aside from the concepts explored in the previous part of this series, the JPEG file format is composed of segments which encode the various portions of information needed to decode an image. This article implements a simple method of traversing the segments of a JPEG file. Articles Sun, 20 Jan 2013 11:30:18 GMT Let's Build a JPEG Decoder: Concepts The JPEG image format is a bit of a black box for many: files go in and images come out. Looking inside the box reveals a bunch of interesting algorithms and ideas, so writing a JPEG decoder makes for an interesting exercise. This article explores the concepts behind the compression techniques used by JPEG. Articles Sat, 05 Jan 2013 00:03:48 GMT svn branchlist: Print branch name for multiple repos Ever run into a codebase with multiple Subversion repositories, where you just wanted to find out which branch they were all on without tediously cd'ing into each working copy? Try this script today, and make your life easier. Sub-articles Wed, 03 Oct 2012 11:06:47 GMT How Emulators Work: a presentation At deviantART's technology team meetup in France ('Breadlands 2012'), I gave a short Ignite talk distilling the first three articles in the <a href=''>Gameboy Emulation in Javascript</a> series. The slides from that talk are now available here. Programming Wed, 27 Jun 2012 10:38:40 GMT Behind the Mirror The day after the night before, a hungover flatmate notices that the wall mirror looks a bit strange. Speculative flash fiction. Fiction Tue, 24 Jan 2012 15:02:50 GMT Steganography with Brainfuck There are a number of techniques for encrypting or hiding information within an image, including the concept of hiding a program within the image which itself prints the secret information. This article explores the feasibility of encoding a Brainfuck program within the bitmap data of an image, with a detailed run-through of a simple example. Articles Sat, 12 Nov 2011 18:16:58 GMT Betel Written on the theme of "thirty". On the far edge of the galaxy, a planet where only thirty stars are visible notices that one of the thirty has disappeared. Flash sci-fi. Fiction Wed, 17 Aug 2011 19:06:20 GMT Printable Opcodes in x86 Real Mode Procedures for transmission of files over ASCII-text networks generally involve some form of encoding such as uuencode. When program executable files are being encoded for transmission, extra steps are required at the receiver before the program can be run. This article explores the concept of a program which has been encoded for an ASCII-text network, but can also be run directly without decoding; in this case, the article is limited to MS-DOS programs. Programming Sat, 18 Jun 2011 21:30:30 GMT Augmented Reality with the Android NDK: Part 2 Concluding an introduction to the development of augmented reality software, this part looks at implementing an edge detection algorithm overlaid on an Android smartphone's camera preview, and how the process can be optimised through use of the Android Native Development Kit. Articles Sat, 21 May 2011 22:40:13 GMT Augmented Reality with the Android NDK: Part 1 One of the major current trends in smartphone applications is augmented reality: a view of reality with information laid on top. This can be as simple as a view of what the camera is currently seeing, with calculations based on position and direction. In the first of a two-part article series on Android development, this article looks at how to set up a camera view and access a canvas for the rendering of overlay information. Articles Thu, 21 Apr 2011 19:07:47 GMT GameBoy Emulation in JavaScript: Timers Like most computer and console systems, the GameBoy offers a hardware timer for use by games, if they wish to keep time more accurately than at the rate of vertical blanking refresh. In addition to a controllable timer, the GameBoy provides a facility for directly examining a fixed divisor of the system clock; in this article, both aspects of the timer are investigated, and the use of the timer for generating random numbers is also looked at, using the example of Tetris. Articles Fri, 25 Feb 2011 00:43:38 GMT The Harness The tide of an interplanetary war is turned when a rogue black hole enters the solar system, and is captured by Earth forces. First published in <a href="">IFWG Story Quest magazine</a>, hard sci-fi. Fiction Wed, 02 Feb 2011 09:55:13 GMT GameBoy Emulation in JavaScript: Memory Banking Continuing a series on the implementation of a GameBoy emulator, this part looks at how the basic memory map of the GameBoy can be expanded, to accommodate games that are larger than 32kB. The GameBoy uses a system of virtual memory banking to perform this expansion; the concepts of the banking controller are looked at, and an implementation offered. Articles Fri, 03 Dec 2010 19:20:30 GMT Power A spaceship crewman is faced with a Catch-22 while maintaining the engines. Flash sci-fi. Fiction Tue, 09 Nov 2010 19:39:48 GMT GameBoy Emulation in JavaScript: Interrupts Game consoles, like all computers, offer the facility to break off execution of a program and handle events or triggers. The GameBoy is no exception, and most games utilise the vertical blanking interrupt as one of their primary tools for keeping time and refreshing the screen. In part 8 of the series on emulator development, I look at the concepts behind, and the implementation of interrupts. Articles Fri, 05 Nov 2010 21:03:20 GMT GameBoy Emulation in JavaScript: Sprites The basis of most games is the movement of objects over a background landscape. In this part of the series on emulation development, I take a look at how the GameBoy produces movable objects, and how the process can be emulated in JavaScript. Articles Sun, 10 Oct 2010 22:34:05 GMT GameBoy Emulation in JavaScript: Input Part six of the series examines the issue of how a player interacts with the GameBoy, taking a look at the hardware layout of the keypad, and how the layout can be implemented as part of an emulator. The particular issues thrown up by a JavaScript emulation are looked at, including basic event handling and how events can be passed to the keypad handler. Articles Sun, 19 Sep 2010 21:41:40 GMT GameBoy Emulation in JavaScript: Integration In the fifth part of the series, the graphics subsystem of the GameBoy emulator is tied to the memory handler, and a rudimentary interface provided for the activation of the emulator. This part includes a working demo of the emulator so far, as will subsequent parts. Articles Sun, 05 Sep 2010 19:11:40 GMT GameBoy Emulation in JavaScript: Graphics The exploration of system emulation in JavaScript continues, with a detailed look at the GameBoy graphics system, and how graphics are rendered by the GameBoy hardware; a simulation of the process is then put in place for use by the wider graphics engine. Articles Wed, 25 Aug 2010 12:21:45 GMT GameBoy Emulation in JavaScript: GPU Timings In the third part of a series regarding system emulation in JavaScript, the GameBoy as an example of a raster graphics system is looked at, and the timings established for passing of control between CPU and graphics. Also examined is the issue of where the emulated graphics code will be rendering its output, and the HTML5 canvas is introduced as a solution. Articles Sat, 14 Aug 2010 22:14:31 GMT GameBoy Emulation in JavaScript: Memory Continuing a series examining system emulation in JavaScript, this article examines how the GameBoy memories are mapped onto the CPU's address bus, and how such a mapping can be emulated. Also covered is the dynamic loading of program ROM images after initialisation, through asynchronous file requests. Articles Mon, 02 Aug 2010 12:03:45 GMT GameBoy Emulation in JavaScript: The CPU JavaScript is often perceived as a Web scripting language, with a specialist purpose of manipulating HTML pages. JavaScript is, however, a general-purpose Turing-complete language: the best way to illustrate this is to emulate another system through JavaScript. In the first of a series of articles, I'll look at how a CPU can be emulated through JS, and start building an emulation core for the GameBoy console. Articles Thu, 22 Jul 2010 18:11:40 GMT Memory Usage of Constants in PHP PHP provides two methods of defining constants: global-scope constants and class constants. A friend of mine, while discussing the issue with Derick Rethans, was informed that class constants are more memory efficient; this article documents my investigation into the reasons behind that assertion. Programming Thu, 24 Jun 2010 21:11:30 GMT Venn Diagrams in PHP and imagick Visualising the overlap between two sets of data is often achieved through Venn diagrams, but such diagrams can be difficult to render in a web development environment. This article covers the mathematics and geometry behind the Venn diagram, and a simple implementation of the algorithms involved in calculating the appropriate dimensions. Articles Thu, 20 May 2010 08:26:00 GMT Light A curious trespasser investigates the nuclear fallout zone around Cheyenne Mountain. First published in the <a href="">My Writers Circle "Rascals" anthology</a>; flash fiction. Fiction Sun, 02 May 2010 17:39:32 GMT New Science Winning entry for a writing contest, with the length stipulation of exactly 100 words. First published by <a href=''>My Writers Circle</a>; flash fiction. Fiction Mon, 15 Mar 2010 16:28:20 GMT Discordian Date Handling in Java Date handling, and especially conversion between different calendars, can be a complex issue to deal with. This article introduces the concept of calendar conversion in Java, and the issues that need to be dealt with when performing such conversions, by building a handler for the Discordian calendar and investigating the mappings between months in the Gregorian calendar and the Discordian seasons. Articles Mon, 08 Mar 2010 18:03:28 GMT Rule based Line Coloring in irssi The irssi IRC client has a built-in capability for rule-based highlighting of nicknames, but does not allow for the full line to be highlighted; nor does irssi allow arbitrary colours to be set against different rules. linecolor is an extension script for irssi that allows for this functionality to be added, in an intuitive fashion. Articles Mon, 01 Feb 2010 14:27:30 GMT Audio Captchas in PHP The major compromise made when a website uses Captcha images is that between accessibility and security; those with bad eyesight or colour-blindness may have trouble viewing a Captcha image. One way around that is to provide an MP3 download option for the Captcha text, which gives another path of accessibility to the process. This article looks at how an audio Captcha can be generated, using common tools. Articles Sat, 09 Jan 2010 17:43:48 GMT Binary Coded Decimal Addition on Atmel AVR The AVR instruction set manual mentions binary-coded decimal exactly once, and provides no instructions for easily working with BCD values, despite the utility of BCD in embedded applications. This article explores the issues involved in working with BCD values, especially in incrementing and adding such values, and introduces an algorithm for resolving the discrepancies that arise. Programming Sat, 19 Dec 2009 18:04:45 GMT GameBoy Z80 Opcode Map The CPU used by the Nintendo GameBoy is a specially modified version of the Z80, with various functions removed to make the CPU cheaper to manufacture. Documentation for this CPU is often lacking; the most common opcode maps are written down as a standard Z80 map with addenda for the Nintendo modifications. This opcode map collates the references into a coherent opcode map for the Nintendo GB-Z80. Programming Mon, 16 Nov 2009 20:56:50 GMT Implementing PayPal Website Payments Pro UK PayPal is used across the world to authorise payments online, and a seamless credit card payment service is available through Website Payments Pro. Unfortunately, the documentation for implementing this can be confusing and contradictory, and getting your code working can take some time. In this article I've brought together the documentation and my experience with it, to provide a coherent source of information on Website Payments Pro. Articles Tue, 15 Sep 2009 17:52:31 GMT Prime Point A spacecraft is sent to the Earth-Sun L5 Lagrange point, where it undergoes testing. Vignette, sci-fi. Fiction Wed, 19 Aug 2009 08:39:22 GMT Parsing the DIME Message Format If a SOAP web service requests in a complex response, where more than one file has to be returned, an encoding format has to be used to fit the files into one message. One of the more common formats is Microsoft DIME, used by Jasper Reports and other services. This article looks into how a DIME message can be parsed, and the files pulled out to work with. Programming Wed, 29 Jul 2009 19:22:40 GMT Shooting Yourself in the Foot Part Two At some point, most developers have come across 'Shooting yourself in the foot', the comparison of how different programming languages would implement the process of firing a gun at your foot. This article assumes success, and the lack of a significant portion of your leg; Part Two looks at how to rebuild your leg, in various languages. Articles Thu, 04 Jun 2009 14:02:19 GMT JavaScript Slideshows Many developers state that modern JavaScript effects, such as slide-shows and news tickers, can only be viably achieved using frameworks such as jQuery and Dojo. This article sets out to demonstrate that it is in fact a simple affair to construct a slideshow using JavaScript and DOM manipulation, without the need for such frameworks. Programming Wed, 03 Jun 2009 19:18:57 GMT Highrise A man is sealed into an apartment for four days. Short story, science-fiction. Fiction Thu, 09 Apr 2009 20:32:21 GMT Go Northeast A man finds himself standing in an open field west of a white house, with a boarded front door. (There is a small mailbox here.) First published by <a href=''></a>; flash sci-fi. Fiction Sun, 05 Apr 2009 19:52:57 GMT JavaScript Tab Controls Tabs have always been one of the most useful elements of a user interface, allowing an interface designer to pack a lot of information into a small space by only showing a section at a time. This article explores the implementation of a tabbing interface using HTML and JavaScript, and goes on to look at pages where more than one set of tabs is used at the same time. Articles Sun, 08 Mar 2009 23:10:21 GMT NotPDO: Wrapping MySQL to look like PDO It doesn't happen very often, but it does happen: you're deploying a PDO-based PHP application to a shared host, and they don't run PDO. If you can't reconfigure the server, you can always wrap MySQL to look like PDO; that's what NotPDO does. Sub-articles Sat, 14 Feb 2009 19:39:20 GMT Modified Preorder Tree Traversal Exploring the MPTT algorithm, and how it can be used for hierarchical data storage. Includes algorithms for addition to and removal from the tree. Sub-articles Mon, 09 Feb 2009 14:53:00 GMT CRC32 Calculation in 256 Bytes A quick look at a 256-byte program capable of calculating the CRC32 checksum of a file. Sub-articles Mon, 09 Feb 2009 14:22:44 GMT List of Countries and Dependent Territories If you've ever needed to know which country is at UTC+3.5 (it's Iran), or who is responsible for administrating the Western Sahara (that's Morocco), it's all in here. List is also available in SQL, for such situations as a 'select your country' dropdown on an e-commerce Website. Programming Wed, 31 Dec 2008 20:36:20 GMT Asynchronous JavaScript and JSON The most common problem that people encounter when using AJAX is that they can't update more than one region of a Web page at the same time, since the request only comes back to fill one region. Using JSON, it's possible to update multiple regions at once, and it's even possible to run inline JavaScript in the AJAX response, automatically. The magic behind it is explained here. Programming Tue, 30 Dec 2008 18:59:08 GMT Using Pointers in C# The current crop of programming languages tend to frown upon the use of pointers, deeming them to be unsafe for everyday work; indeed, many languages ban their use altogether. C# is different: it is possible for a C# program to delve into pointers, but there are caveats. An example is given in this article, using a graphical bitmap effect driven by pointer arithmetic. Programming Sat, 01 Nov 2008 01:30:19 GMT Automated Deployment with Subversion Version control systems and development testing servers go hand in hand; you work on your local working copy, and test on the development server. But what happens when you want to take your work live: to deploy the developments you've completed? This article presents one way to solve that problem, by using the scripting facilities provided by Subversion. Articles Tue, 21 Oct 2008 21:37:43 GMT Building Complex Emails with PHP The first script that a budding PHP developer builds is often a tool to send simple email messages from a website, with a couple of paragraphs of text inside. What these scripts lack is the ability to send HTML-formatted emails, or to attach documents and other files to the message. In this article, I cover the MIME standard for building complex emails, and how to format and send a MIME-compliant email message in PHP. Articles Sun, 10 Aug 2008 15:17:50 GMT Extended Text Mode on the C64 When you mention the Commodore 64, most people think that it's an obsolete computer from the 80s which no-one could ever use nowadays. One of the major problems is that you can't fit enough information onto a C64's screen: the standard size of a work terminal is 80 characters by 25 lines, and 40x25 just isn't enough. In the first part of a series (which may take some time to complete), I look into rendering an 80x25 text screen on the Commodore 64, and how it can be done. Articles Sun, 03 Aug 2008 00:00:00 GMT The Structure Pattern Reading and manipulating binary files can be troublesome in PHP, primarily because the language doesn't have a native type to represent structures of encoded data. Using the Structure pattern allows PHP to load and work with these files, by providing a method of decoding the data into a class and performing calculations. Examples are given in this article of the Windows BMP and TrueType file formats. Programming Sun, 20 Jul 2008 00:00:00 GMT Intranet DNS Resolution with BIND Views When you're working on a web site that's hosted in the same office, it can be a problem to see the fruits of your labour: the web site's domain resolves to the external IP of the office, and can't be routed from inside. It's quite easy to overcome this problem, by using the 'view' facility of BIND to provide two different views of the domain: one for the office LAN, and one for the outside world. Articles Mon, 02 Jun 2008 12:01:48 GMT An Introduction to Compression An exploration of the different types of compression, looking at the workings of lossless compression methods such as RLE and Huffman encoding, and taking an overview of perceptive compression and why it works. If you've ever wondered how a CD can be shrunk down from 650MB of sound to 65MB, this article tells you how it's done. Articles Thu, 22 May 2008 21:24:30 GMT Whitelist SSH Access with OpenWRT If you're tired of constant login attacks against your SSH server, you can use your OpenWRT router to implement a whitelisting firewall, allowing the people you know and trust to connect to your shell, and blocking everything else. It's even possible to automatically modify the whitelist from an intranet Web page, through the use of extensions to PHP; this article will show you how it's done. Articles Fri, 09 May 2008 18:29:17 GMT Interfacing ADODB to PDO Many developers who come to PHP from ASP bring their experience of using ActiveX Data Objects (ADO) to interface with databases; however, existing solutions to allow ADO usage from PHP suffer from performance and support issues. Using PHP's native Data Objects (PDO) library can be infeasible for legacy applications: with the code provided here, PDO can be used with no redevelopment of the application. Programming Mon, 21 Apr 2008 20:56:38 GMT Booting Linux from Flash For those who build home theatre PCs and other computers which need to be quiet in operation, most of the noise from computer hardware can be eliminated: fans can be removed, heatsinks and smaller power supplies can be used. The largest remaining source of noise is the hard disk containing the operating system. If the HTPC is running Linux, it's possible to move that operating system from hard disk to a USB flash drive, and boot it from there; this article shows you how. Articles Sun, 07 Oct 2007 21:25:47 GMT ARM Opcode Map There are many places in which you can look if you want an explanation of the instructions available on the ARM series of processor cores. However, there is no overview of the instruction set in the form of a table or map; not even the official ARM instruction reference provides this anywhere in its 811 pages. I produced an opcode map in 2006, in an attempt to rectify this problem: it provides a mapping of all the instructions and addressing modes for cores up to ARM version 4, with version 5 extensions highlighted in blue and the DSP extensions in green. Programming Thu, 04 Oct 2007 20:13:03 GMT JavaScript Tetris It's often said by some that JavaScript isn't a real programming language, that it can't provide the full range of development possibilities that a more complex language would be able to give. It's quite easy to prove this argument wrong: JavaScript is a full-blown language, with some very interesting features that conventional languages fail to bring to the table. It's also quite easy to write programs with, and I put this example together to prove the point: an implementation of Tetris in HTML and JavaScript, playable right in your browser. Programming Thu, 04 Oct 2007 19:27:49 GMT Running a Windows Partition in VMware Virtualisation of operating systems is a big trend at the moment: running multiple servers on one physical box allows a hosting company to save space and power costs, and running different operating systems lets a Web developer test their work on various browsers and hosts. The problem with setting up a virtual machine is the loss of disk space on the host, to hold a disk image for the guest; what if you've already got an installation on another partition? This article shows how to use that physical installation in VMware, using the example of Linux as the host and Windows XP as the guest. Articles Sat, 20 Jan 2007 21:54:02 GMT Trainf*ck One of the most widely-known esoteric programming languages is Brainf*ck, which attempts to break computing operations down into the simplest possible steps: just eight operations are provided, along with a small buffer of memory to work with. The problem with Brainf*ck is that it only provides the most basic I/O, interfacing with the console. Trainf*ck is an extension of the language, which endeavours to provide the ability to read and write files, and communicate over a TCP/IP network. Programming Tue, 26 Sep 2006 15:45:23 GMT Hideout Two hackers must destroy their evidence when a team of armed police show up outside their apartment. Screenplay. Fiction Fri, 22 Sep 2006 22:49:30 GMT Thirteen Terrorists use a distributed computer system to model the destruction of a continent by multiple warhead detonations. Book prologue. Fiction Fri, 22 Sep 2006 22:49:19 GMT Tau A physics researcher is alerted to a contact who can help him realise his theories. Book prologue. Fiction Fri, 22 Sep 2006 22:49:05 GMT Microwave Description of a system for generation and distribution of electrical power from orbiting nuclear power plants. Novel introduction. Fiction Fri, 22 Sep 2006 22:48:53 GMT Sand A man reflects on the detonation of a compressed antimatter bomb in his city. Short story. Fiction Fri, 22 Sep 2006 22:48:41 GMT A Change of Clothing A chase and murder by a trained serial killer, as described from the killer\'s point of view. Short story. Fiction Fri, 22 Sep 2006 22:43:10 GMT DOM Manipulation and CSS Trees Details regarding the implementation of a collapsible tree-style nested list using standards-compliant HTML and CSS, utilising JavaScript and the Document Object Model. Articles Fri, 22 Sep 2006 21:40:53 GMT Bitwise Operators For almost as long as the computer has existed, programmers and developers have had to deal with the computer's representation of numbers, the binary numbering system. The unique properties of binary allow the application of Boolean mathematics to common manipulations. This article provides a run-down of the common Boolean operations, including their syntax in C-derived programming languages, and provides examples of where such operations might be used in everyday development. Articles Fri, 22 Sep 2006 21:39:57 GMT Virus Detection with Message Digests One day in 2006, I was set a short challenge: write an article of around 500 words on the topic of MD5 digests. This article was the result: an explanation of what it means when a computer generates a digest of a message, and a look at where message digests can be used. In particular, focus is given to automatic generation of digests for executable files, and how this can be used to detect possible manipulations of the files by viruses. Articles Fri, 22 Sep 2006 21:38:53 GMT The Smallest NDS File Embedded development is often focused on the size of the resultant binary, especially on platforms where this factor is important. On the Nintendo GBA and DS, the homebrew toolchain is able to generate well-optimised binaries, but programs with equivalent functionality tend to have very different sizes. This article looks into why that is the case, and explores the format of a Nintendo DS binary file in an attempt to make the smallest DS binary possible. Articles Fri, 22 Sep 2006 21:37:38 GMT