Code Listings from John Resig and Bear Bibeaults book.