
I’ve recently been wrangling with some Perl code for a project at work, and have been putting together a Perl module that includes a number of common functions that I need. As such, I had to remind myself how to create a Perl module. During my initial development, I ran into a number of problems, but I eventually worked through all of them. In the hopes of helping myself remember how to do this, and to help any other burgeoning Perl developers, I’ve written the following little guide. Hopefully it will help shed some light on this subject.
I was touching up some of my photographs recently when I noticed that one shot in particular had substantial vignetting. Wishing to use this photograph as a desktop wallpaper, I set out to try and remove this effect from the photograph. All of the standard Photoshop tools failed to do the trick. Both the clone tool and healing tool produced poor results. Disappointed, I searched the web for help. Thankfully, I found the answer I was looking for: a new filter introduced in Photoshop CS2.
I recently installed Apple iTunes for the first time (the QuickTime install on my laptop was having lots of problems). One of the first things I tried out was subscribing to a video podcast (specifically The Totally Rad Show), which was fairly easy to do. As soon as I started to play the latest episode, I noted that playback performance was horrible. I never had this kind of performance problem with QuickTime, so I was a little surprised that iTunes would be so different.
A quick Google search turned up a support article from Apple on iTunes performance in Windows XP and 2000. All of the standard suggestions are there (make sure you’re computer is fast enough, download the latest version, etc.), but one suggestion caught my eye: “Disable Direct3D video acceleration in QuickTime.”
I ventured to the Windows Control Panel, opened the QuickTime item, and turned off the Direct3D video acceleration. To my surprise, performance was restored! Who knew that a simple toggle could solve such an annoying problem?
In loosely related news, I’m getting closer to actually buying an iPod (something I thought I’d never do). More on this later.
You don’t know the power of the Dark Side; I must obey my master. — Darth Vader
MozillaZine has announced that Firefox 2.0.0.5 has been released (though, as of this writing, I still don’t see it via auto-update). I enjoy looking through change logs (weird as that may seem), so for every new Firefox release, I take a look at Bugzilla to figure out what has been fixed and what is new. Here’s how I do it:
Here are the fixed bugs and verified bugs for 2.0.0.5. If you really want to get clever, you can combine these keywords together (separated by a comma) on the advanced BugZilla search page. You’ll need to tweak some of the default settings on that form to get it to work, but it can be done (as this query for Firefox 1.5.0.5 indicates).
There are two special notes about doing things this way:
I’ve come across a few articles on how to optimize WordPress performance (all of the following links come from the first linked story in the list below):
WordPress is by far my favorite content management system, but I opted to use Movable Type over at Born Geek, mainly because it uses static HTML pages (which load faster). Considering the content in the above guides, I may eventually switch from Movable Type to WordPress.
Taking a screenshot of an application is a simple task: the “Print Screen” key can be used alone (to grab the entire screen), or one can use the “Alt + Print Screen” key combination to take a snapshot of only the active window. But taking a screenshot of the active window, while an application menu is opened, is a little tougher. Sure you could use a third-party solution to do it, but suppose you don’t want to (or cannot) use such a tool. What is one to do?
One option, which isn’t very appealing, is to take a screenshot of the entire screen (using the “Print Screen” key) and then crop out the active window using some image editor. Again, this involves using a third-party application to do the cropping (although Microsoft Paint can be used to some minimal effect).
The better answer, as I accidentally discovered myself, is very simple. Any application worth its salt uses keyboard accelerators (access keys, to be exact) to allow keyboard users to access application menus. The problem is that most applications make use of the “Alt” key to invoke these access keys. For example, “Alt + F” in Windows Explorer will open the File menu. Suppose I want to take a screenshot of a highlighted menu item within the File menu. If I open the menu and press “Alt + Print Screen” to take the screenshot, the menu is dismissed, since the application thinks I’m trying to invoke another menu. But we can work around this limitation!
Voila! An active-window screenshot with a highlighted menu item, using no third-party application. Here’s an example:

While working on my photo album software, I ran into an interesting SQL problem. I wanted to be able to display information about my photo albums, along with the number of images in each album. The problem is that my data is broken up into two tables: an albums table and an images table. My goal was to use exactly one SQL query to access all of the data, including the count of images. And I wanted empty albums (no images) to also show up in the query’s results. But try as I might, I couldn’t get the query to return the data I wanted. I finally found a solution that works, and I present an example below.
Let’s suppose we have two MySQL tables: one that represents directories, and another that represents files. The directories table has the following columns:
And the files table has the following columns:
The Parent_ID field in the files table corresponds to the ID field in the directories table. In order to select both the count of files in each directory, as well as all of the directory information, we do a simple join. But here’s the trick: the order of your tables matters! Here’s the query that works for this scenario:
SELECT d.*, Count(f.ID) AS Count FROM directories d LEFT JOIN files f ON f.Parent_ID = d.ID GROUP BY d.ID
When the tables are reversed in the JOIN, only tables with 1 or more entries show up in the results. What a subtle change! Hopefully someone will find this tip useful. It sure took me a while to get this working.