No Dogs Please Sign

Archive for the 'How To' Category

Here’s a super great tip I learned from an article at Lifehacker.

My laptop here at work, a Lenovo ThinkPad, has a tremendously loud beep (through headphones, it will nearly blow your ears out). This beep occurs every so often when I’m typing faster than the computer thinks I should, and I end up pressing several keys on the keyboard at once. Thankfully, there’s now a way to disable this annoying sound!

To temporarily disable the beep: net stop beep
To permanently disable the beep: sc config beep start= disabled

In the latter command, note the space between the equals and the word ‘disabled.’ I’m not sure if that’s necessary or not, but including it worked for me. The space is indeed required (thanks Dustin). I had no idea that a Windows service was responsible for this annoyance!

1 Comment Filed under: How To

I recently ran into a problem on my system where all the HTML document icons had been reset to the generic default icon: Default Windows Icon

Apparently, the Minefield build of Firefox had at some point corrupted this icon. I found that I was unable to change or reset the icon through the Folder Options » File Types dialog in Windows Explorer. No matter what I tried, I couldn’t restore the icon, and it drove me nuts. Then I figured out what to do, thanks to this forum post at MozillaZine:

  1. Open RegEdit.
  2. Browse to the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML registry branch.
  3. Delete the ShellEx\IconHandler registry key entry.
  4. Close RegEdit.
  5. In Windows Explorer, browse to the Documents and Settings\{username}\Local Settings\Application Data folder.
  6. Delete the iconcache.db file. It’s hidden, so you may need to tweak your Windows Explorer settings to see it.
  7. Reboot.

Problem solved!

22 Comments Filed under: Firefox, How To

I bought a Linksys WRT54GL today, to replace our aging DLink DI-624 (it had been acting pretty flaky as of late). The Linksys router supports open-source firmware, and our first course of action was to flash the highly recommended DD-WRT distribution. I have to say that I am very impressed with this firmware. There are lots of options available and it reports lots of interesting information.

Setting up the router wasn’t difficult, but my dad and I ran into problems getting our IBM laptops connected wirelessly. All of our other machines were able to connect without any problems, so it was clearly a problem with either the ThinkVantage Access Connections application or the IBM wireless adapter. We spent quite a while trying to get things working, and finally found the issue. We had originally set the Wireless Network Mode option in the router basic setup to “G-Only” mode since we intended to use 802.11g only around our house. But for whatever reason, the IBM laptops didn’t like that. Switching the option back to “Mixed Mode” cleared up the problem immediately, much to our delight. Hopefully this little tidbit will help out someone else facing the same problem.

1 Comment Filed under: Hardware, How To
August 18, 2007

A Perl Module Primer

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.

Read the rest of this entry »

7 Comments Filed under: How To, Programming

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.

Read the rest of this entry »

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

2 Comments Filed under: How To, Software

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:

  1. Browse to the BugZilla keywords description page (the link to this page is also available on the advanced search form).
  2. Look for the “fixed[versionNumberHere]” and “verified[versionNumberHere]” keywords. Note that the [versionNumberHere] bit refers to the Gecko version number, not the Firefox version number. For example, Firefox 2.0.0.5 uses Gecko version 1.8.1.5 (as you might guess, the 2.0 release used 1.8.1). Firefox 3 will use Gecko 1.9.
  3. Out to the right of each keyword, you should see a count of the total bugs that particular keyword corresponds to. Click that number, and you will see all of the bugs that use the specified keyword.

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:

  1. These queries are looking at fixes in the Gecko engine. As such, bug fixes for Thunderbird and Seamonkey will also show up.
  2. You may not see everything, particularly high-risk security fixes. For all security changes, see the known vulnerabilities page.
4 Comments Filed under: Firefox, How To

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.

No Comments Filed under: Blogging, How To

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!

  1. Hold the Alt key down and press the corresponding access key to open the desired menu.
  2. Keep the Alt key pressed!
  3. Move the menu selection (using the arrow keys on the keyboard) to the desired menu item.
  4. Press the Print Screen key.

Voila! An active-window screenshot with a highlighted menu item, using no third-party application. Here’s an example:

Menu Screenshot Example

2 Comments Filed under: How To

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:

  • ID
  • Name

And the files table has the following columns:

  • ID
  • Parent_ID
  • Name

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.

Comments Off Filed under: How To, Programming
« Newer Posts Older Posts »