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.
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. There was the job and the girl. It was the job, of course, writing copy when you should be writing plays, but you couldn't get rid of the job because the job was bread and alcohol, so you got rid of the girl instead. When you added it up later you saw that you had gained nothing but had lost a great deal instead.
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.
There never was a public release of ayTemplates, despite being written in 2002 and being improved through 2004. Around that time 99dogs finally gave up the ghost, and I stopped writing PHP professionally, so it never saw production. I occasionally still get enquiries about it though, so here in 2009, I'm finally releasing it. It's over there, along with its documentation.
For the recent April Fool's joke at goofans.com, 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.
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.
"niggadogg.com" 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).
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.
This page describes how to set up Windows Messenger to communicate
with an Asterisk server using SIP. It assumes Messenger version 4.7
(available here) and a working installation of Asterisk. This page was written in 2003 and some content may not be relevant to more recent versions of either software.
Some notes on Cisco IP phones (specifically the 7940/7960s I have).
This article examines the construction of a scroller control, enabling selection from a group of items where the currently selected element is visible and new elements are scrolled in to replace it. It makes use of the CSS clip property to control the scrolling. This code could also be used as a basis for other scrolling transitions, such as in a slideshow.