Category → Programming RSS
How to create a spell checking web spider
Recently I found out my employer was paying a third-party company to regularly check the spelling on their website and send them a monthly report. So I thought I would write a simple spider that could to do the same thing and save them money. Read more →
Validate an ISSN using Perl or JavaScript
Last week I wrote about validating an ISBN, so this week I thought I would post the code to validate an ISSN. Read more →
How to check if an ISBN is valid in Perl or JavaScript
The cool thing about an ISBN is that its last digit is a "check digit", which validates the rest of the number. How does it work? "It is calculated on a modulus 11 with weights 10-2, using X in lieu of 10 where ten would occur as a check digit." More info. Read more →
Generating a calendar using XSLT
Recently I was tasked to build an interactive calendar in XSLT. I wanted the calendar to always start on a Sunday as well as have clean markup. I couldn't find any good examples on the web while I was building it, so I decided to post the base of my solution. Read more →
Converting seconds into a readable format in Perl
Here is a short and easy Perl function to convert the difference between two time stamps, into something that is more human readable. There are Perl modules that can do this as well, however I thought I would share what I wrote incase someone finds it useful. Read more →
Title case names in perl
While I was at work today I came across a script I wrote a couple of years ago to title case names in perl. This script will transform names to a nice, readable title case equivalent. E.g. "JOHN SMITH" to "John Smith", "JOHN O'BRIAN" to "John O'Brian" and "JOHN MCCOOL" to "John McCool" etc. Read more →
Dynamically set network location in Mac OS X
I love macs, but sometimes things could have been implemented better. In particular, I hate having to set the network location on my laptop when I go between work and home every day. I have put together a small shell script which can do this. I run this script on startup and it just checks what day and time it is so it can switch between two profiles (work or home). Read more →
PHP: Explore your server through a PHP file browser
In the past I've had to delete files from my server where the file permissions were set to apache and I could not override them because the host did not alllow terminal or shell access. So I quickly put together a PHP script that allowed me to navigate through the file system and unlink (or delete) files as the apache user. I haven't had to use the script for a while but I still think its pretty nifty to use when you want to explore a servers file system. Read more →
Sockets problem with MySQL/PHP and Mac OS X
After installing MySQL 5 on OS X 10.4, you may have noticed that the install package has placed 'mysql.sock' in '/tmp/mysql.sock' instead of '/var/mysql/mysql.sock'. This will cause the following error when you attempt to access MySQL through PHP: Read more →
PHP: Sending HTML Emails
Just like the general nature of PHP, the PHP mailing functions are simple to use as well. The easiest way to send an email is to use the mail function built into PHP 3, PHP 4 and PHP 5. However, to send HTML based emails (or any other content-type for that matter), you will need to alter the header values of the email. The following is a short example on how to do this with PHP. Read more →
Commenting is still enabled on these entries, so feel free to leave me a message.