You and I

Submitted by davidc on Tue, 04/28/2009 - 04:33

I explain quietly. You
hear me shouting. You
try a new tack. I
feel old wounds reopen.

You see both sides. I
see your blinkers. I
am placatory. You
sense a new selfishness.

I am a dove. You
recognize the hawk. You
offer an olive branch. I
feel the thorns.

You bleed. I
see crocodile tears. I
withdraw. You
reel from the impact.

- Roger McGough

Browsing URLs and opening files

Submitted by davidc on Wed, 04/22/2009 - 16:50

Java 1.6 added a new class, java.awt.Desktop, that provides handy methods to launch a web browser to a given URL, or open a given file. However these methods are not available under earlier JREs. This article provides a cross-platform surrogate class that uses the Desktop methods where possible, and falls back to platform-dependent methods if not. It uses reflection extensively to avoid linking problems. It also provides additional *AndWarn() methods to show a JOptionPane error message upon failure.

From Dawn to Dusk

Submitted by davidc on Mon, 04/20/2009 - 05:55

That was it, he knew, the damn job. You went along doing the best you could, and one day you realized that you were wasting time and not doing anything at all. There were so many things you had wanted to do, so many you still wanted, and you saw clearly that you weren't doing any of them and never would, and you grew so frantic thinking about it, you could feel the panic forming inside you. You saw how immense the world was, and you realized that you were so limited it was all going to waste around you, and you felt that you had to do something quick before it was too late.

ayTemplates released, 7 years too late

Submitted by davidc on Sat, 04/18/2009 - 01:44

So I'm celebrating the 5-year anniversary of my leaving the 99dogs crapfest by finally releasing ayTemplates. ayTemplates is a PHP extension written in C, designed for lightning-fast execution of standard template operations. At 99dogs, we were using a derivative of FastTemplate for some very heavy templating, as we had a team of web designers working independently from the programmers. Doing all this in PHP with regular expressions was insanely slow and inappropriate, so ayTemplates was born.

Dynamic bitmap fonts

Submitted by davidc on Tue, 04/14/2009 - 18:48

For the recent April Fool's joke at, I wanted to exactly reproduce the look and feel of the in-game computer in World of Goo. This included reproducing the font used with some clever CSS/DHTML. This article describes a reusable, efficient, client-side DHTML bitmapped font library.

Since I put in a tremendous amount of work for an April Fool's prank, I decided to publish this code here in case anyone else has a need for bitmapped fonts. It is released under the MIT license.

Oh look, I made a blog

Submitted by davidc on Wed, 04/01/2009 - 16:16

Right, don't even think about mocking me, but I'm starting a blog. Not to talk about the futility of life and how pretty girls hate me (unless I get really drunk), but because I'm sick of all my wasted work. I seem to be constantly writing code or fiddling with things where the result is either only used in one place, or is used once and thrown away, or simply never gets finished. Some of this I'm convinced will be useful to others, or even to myself in the future.


Submitted by davidc on Fri, 03/18/2005 - 09:23

"" was a website I wrote to poke fun of the infamous "da-drew", who would always come on IRC and spout a bunch of nonsensical pseudo-ebonics. It generates the kind of sentences that he might have said.

This was actually an interesting experiment in first-order Markov chains, where a sentence is constructed using word-sequence probabilities - the next word is based taking the preceding word and choosing a word based on its probability of appearing next in the sample corpus (around 4,500 lines of "sanitised" da-drew quotes from IRC).

Root nameserver check

Submitted by davidc on Wed, 09/10/2003 - 02:43

This form queries all the nameservers for the root you've specified to find out what their records show for the NS of the domain in question. This is useful if you have submitted nameserver changes and you don't know whether they are yet in any or all roots. It returns a list of what each root (gtld, cctld etc) nameserver is serving as NS records. Repetitive, automated or abusive use of this page is strictly prohibited. If you want to run this yourself, download the source.