For the past two or three weeks, I’ve been reading Neal Stephenson’s Cryptonomicon, a novel published in 1999. Much of the story in the novel concerns cryptography, and page 480 contains a Perl script that can be used to encrypt and decrypt messages using the Solitaire cryptosystem.
As published in the novel, the Perl script is gibberish, impossible to read and understand. Fortunately, the “verbose version” of the script is available on Bruce Schneier’s web site at www.schneier.com/code/sol.pl. Bruce Schneier provides an explanation of the Solitaire Encryption System at www.schneier.com/solitaire.html. And Neal Stephenson himself discusses the novel and the Perl script at web.mac.com/nealstephenson/Neal_Stephensons_Site/cypherFAQ.html.
Cryptonomicon is a brilliant novel, and it reminds me in many ways of Gravity’s Rainbow by Thomas Pynchon, one of my favorite books. It is a book I know I’ll have to read more than once, because I’m certain I’m missing important clues and subtexts in the story that will become apparent only on a rereading.
January 09 2010 | Books and Computing | No Comments »
Web Database Applications with PHP and MySQL, 2nd Edition, was written by Hugh E. Williams and David Lane and published by O’Reilly in May, 2004.
I purchased this book in 2005 when I was doing some consulting for a microarray company in Massachusetts, where I was adapting the BioArray Software Environment (BASE 1.2), which was written in PHP, to their process. I had set the book aside until recently, when I was motivated to review PHP so I could modify the WordPress theme that I use for this blog.
PHP is the programming language usually referred to by the P in the acronym LAMP, which stands for Linux Apache MySQL PHP. PHP was designed from the beginning to work closely with the Apache httpd web server and with the MySQL database management system. PHP code is easily embedded into HTML, and this makes it easy for relative novices to use a three-tier architecture for their web sites.
I found Web Database Applications with PHP and MySQL an excellent introduction to PHP and MySQL for someone who is skilled at programming using another language. The introductory material on PHP was just enough to get me started, and I quickly learned to refer to the PHP documentation (which is also excellent) when I needed enlightenment. The book also provides several chapters that provide a solid introduction to MySQL 4.1.
The last five chapters of the book are devoted to a complete working example of an online wine store. All source code is available at the authors’ web site, http://www.webdatabasebook.com/. This is an invaluable resource that can serve as the basis for many other PHP projects.
In my opinion, this book is not appropriate for someone who is learning to program or use databases for the first time. Good alternatives might be Learning PHP & MySQL, 2nd Edition, by Michele E. Davis and Jon A. Phillips (published August, 2007, by O’Reilly), and Learning SQL, by Alan Beaulieu (published August, 2005, by O’Reilly). (I read Learning SQL recently, and I recommend it highly. Watch for a review at a later date.)
Since the book was published nearly four years ago, some of the material is dated. In 2004, PHP 5.0 was still in beta; PHP has reached 5.2 by now, and support for PHP 4 is about to end. Similarly, the book recommends using MySQL 4.0 or 4.1, whereas today MySQL 5.0 is very stable. The book provides an excellent set of appendices that explain how to install and configure Apache httpd, MySQL, and PHP for Linux, Windows, and Mac OS X. Again, these instructions are now dated, but they should still provide a useful guide.
I found the index somewhat frustrating to use; some items I was interested in are not found there. These include:
@, the error control operator
-
& and =&, operators used for working with references to variables
- reference, the term referring to a variable that is not passed by value
define, the function used to create constants
- magic constants, such as
__FILE__, __LINE__, __FUNCTION__, __CLASS__, and __METHOD__
I don’t use PHP in my daily work; rather, I use Perl. (Python is the next language I plan to learn, but that’s another story.) I like how PHP has combined arrays and hashes into a single array type. I like PHP’s Boolean values, true and false. And I like how easy it is to embed PHP into HTML; it makes creating a web page dynamically more intuitive than Perl CGI does. But I dislike the inconsistent and ugly naming of many standard functions (for example, strtoupper, the PHP equivalent of Perl’s uc), and this seems to be a common complaint about PHP. I also don’t like the large number of global variables and constants that PHP uses.
There is a BioPHP project (PHP for Bioinformatics), at http://biophp.org/, but it is not as well developed as the BioPerl or BioPython projects. The only large bioinformatics project that I’m aware of that uses PHP is the BioArray Software Environment (BASE) 1.2. Version 2.0 of BASE has been completely rewritten in Java.
March 23 2008 | Bioinformatics and Books and Computing | Comments Off
In the February 24, 2008, edition of the New York Times Book Review, James Kaplan reviews Beginner’s Greek by James Collins.
Part comedy of manners, part chick lit in male drag, James Collins’s “Beginner’s Greek” is a great big sunny lemon chiffon pie of a novel, set, for good measure and our sociological titillation, among the WASP ruling classes, people who work at white-shoe investment firms and own villas in southwestern France and can instantly tell the difference between fine Bordeaux and plonk.
I had missed the review, but tonight I listened to the New York Times Book Review Podcast, in which Sam Tanenhaus interviews James Collins. Mr. Collins turns out to be an experienced journalist who decided finally that he had a story to tell in Beginner’s Greek, his first novel.
One of the amusing parts of the interview comes when Mr. Tanenhaus asks Mr. Collins if he is happy living in Virginia. It sounds to me like Mr. Collins (although he doesn’t say so) would much rather be back in New York, but his wife prefers Virginia. Mr. Collins admits, however, that living in Virginia made it easier to write Beginner’s Greek.
This book is going on my wish list.
February 24 2008 | Books | Comments Off