When someone makes a comment on my site, I like to see it in the visitor’s action list on Clicky. If you’re using Disqus with WordPress, here’s an easy way to log comments.
Posts Tagged ‘PHP’
Filtering Out the Noise with Regex
Tuesday, July 13th, 2010
I rely heavily on regular expressions when processing old data. Like my post about cleaning phone numbers, I’ll demonstrate another example of how useful regex can be when dealing with unruly data.
IMDB Episode Scraper
Sunday, October 18th, 2009
I like to keep my TV rips well-organized, and labeled with the correct episode title. I’ve been using the excellent Bulk Rename Utility to quickly rename with proper series title, season and episode numbers—but the individual episode titles were always a pain. Begrudgingly, I’d just copy-paste the titles from Wikipedia, always wanting a way to automate that process.
Picasa XML Generator
Friday, September 11th, 2009
Two years ago I found myself writing a photo gallery application for a custom CMS that allowed you to upload, crop, caption, group and sort your photos for the site’s online galleries. I remember thinking to myself what a chore it was to be reinventing the wheel—there are already excellent free services available that provide this functionality. I wanted the ability to have my client use Picasa to manage his galleries, and view them via SlideShowPro (SSP) on his site. At that time however, support for Picasa’s RSS feeds was not available in SSP.
Cleaning Phone Numbers with Regular Expressions
Sunday, August 30th, 2009
I’ve been in the position of having to take an unnormalized database that had virtually no data validation or standardization in place, and migrating it to a completely different, normalized schema. I wielded the power of regular expressions (regex) to help me through the process.
Dealing with NULL Inserts in PHP
Sunday, August 23rd, 2009
In the past, I hadn’t given much thought to NULL vs. empty string when dealing with blank fields in my database. If something was empty, I would just set it to $field = ''; and insert it. This is bad for a few reasons—but most importantly the database doesn’t see an empty string as an empty field, but rather a string with no length. When using COUNT, it sees empty strings and other data as one and the same.
Once I started using NULL values in my DBs, I found the PHP more cumbersome when doing inserts.