Archive for October, 2004

Tux Jammies

Posted 10/27/2004 By Jason

This is a picture of my son in his favorite pajamas, the “Tux Jammies”. Ever since he ask which jammies were my favorite, and I answered the Tux jammies, they are now his favorite (sometimes even to the point of demanding that Mommy wash them during the day so that he can wear them twice in a row :) ).
Caleb in Tux jammies

Anyway, a shot of Caleb in his Tux jammies for posterity, before they get too threadbare, or he outgrows them :(

WordPress 1.2.1

Posted 10/12/2004 By Jason

See this announcement regarding the newest version of WordPress. This release patches some recently announced security holes. The upgrade was a reasonably pain free process, just had to hunt for the few tweaks I threw in on the fly.

Update: Don’t forget your plugins. Posts using the syntax highlighter plugin from Scott Yang really look ugly without it 😉

PHP Case Studies Needed

Posted 10/12/2004 By Jason

Marco is looking for PHP success stories to be used for the creation of a web site dedicated to promoting PHP as an “Enterprise Ready” solution. I think this is a very worthy cause. The fact is the numerous “Enterprise” class operation are using PHP and other open source projects, often without management in these operations even knowing (or caring :( ). Any project that seeks to stengthen the awareness of PHP strengthen gets thumbs up 😎 in my book.

So… go read his post, and send ’em in if you got ’em. 😉

How many lines?

Posted 10/8/2004 By Jason

I read Size of phpDocumentor on Joshua Eichorn’s blog and questioned the methodology of simply passing all the *.php and *.inc files through wc -l to count the lines. It does not seem reasonable to me to count whitespace and comments as lines of code.

I though perhaps I could use the whitespace/comment stripping ablity of the php cli binary (the php -w option) in the middle of a shell command to get a more accurate count. Something like:

find . -type f | grep -e 'php$\|inc$' | xargs -n 1 php -w | wc -l

But is seems that this option is somewhat more aggresive with removing new lines that I would have prefered. My next thought was to convert every instance of a ; to ;\n, which you can easily do with sed.

Here was the resulting output from running
find . -type f | grep -e 'php$\|inc$' | xargs -n 1 php -w | sed -e 's/;/;\n/g' | wc -l

This is better, but still leaves you vunerable to ; embeded in stings and counts the <?php and ?> delimiters, etc. Not perfect, but a reasonable shot for a one liner shell command.

A little googling turned up SLOCCount, which professes to count multiple languages and strips comments, etc. It also passes those line count through some interesting statisical manipulation and summarizes the results.

Here is output of sloccount on some of my favorite php projects:
Read the remainder of this entry »