« First Post, Finally | Main | iPhone visits incompetech »

International Graph Paper Day

In an event not much heralded around the world, Kevin declared April 22nd to be "International Graph Paper Day". The reason for this declaration was the unveiling of the newly revitalized graph paper section for Incompetech.com.

I've been working on the project for quite a while, so here's my behind the scenes view of things.

By "revitalized", I mean in the sense of "Bulldoze the old run down tenement buildings and build new high rise condos". All the old graph paper generators had evolved over the years, starting from the first one that Kevin made the night he needed some graph paper, but it was late and all the office supply stores were closed. Since then, as people asked for other formats, they were added by copying one of the existing scripts and making the needed changes. This resulted in a lot of duplicated code, not just in the scripts, but several copies of the perl based PDF library they used.

With the rewrite, all the scripts are using PDF::API2, along with a module for many of the functions that used to be duplicated in all the scripts. Now the graph paper scripts are a little bit smaller, with better error checking, and even smaller output PDFs since PDF::API2 does compression ( the old Pdf library didn't ). To make things faster, everything is running inside Apache with mod_perl, vs. the old ones running as CGI scripts.

To the user, the pages look largely unchanged, with the exception of the new javascript based color picker. In the past when I pointed people to the graph paper generators, the complaint I heard most often was about the odd way of selecting a color. The old way ( specifying the Red/Green/Blue as numbers between 0 and 1 ) was not intuitive, unless you really knew (0.9,0.8,0.125) was that right shade of golden yellow. It was this way because that was how the old PDF library took its color input, and was quick and easy to code back on that night when Kevin just needed a couple sheets of lined graph paper.

The new color picker is based off of the ColorJack DHTML Color Picker, with some minor changes and a couple bug fixes I caught while figuring out it worked. I'll take a look at my changes and see about getting them back to the author, but I just looked at the site while making this post, and see it's been updated with a newer version.

The final key to making everything a smooth transition was making sure that people coming to the old URLs would end up at the new URL. That was just a bunch of work, digging through Apache's access_log, digging up all the URLs that people were using, and redirecting them from the old to the new location. In the end, the list ended up with 90 paths to redirect, using "301 Moved Permanently" so search engines will pick up on the new path.

Now that the big update is complete, that section of the site will easier to manage in the future, and adding new graph paper formats should be a lot easier than it had been. I know Kevin has a couple requests in the queue that he'd been holding off on until this was all done.

About

This page contains a single entry from the blog posted on April 25, 2007 12:19 AM.

The previous post in this blog was First Post, Finally.

The next post in this blog is iPhone visits incompetech.

Many more can be found on the main index page or by looking through the archives.