Archive for August 2009

Useful Tool: File Monitor

Published on August 31, 2009

I’m going to start a new occasional series of articles covering helpful software tools that I find. To start out this series, I’m going to focus today on FileMon from Sysinternals (now owned by Microsoft). Several of the tools I’ll be profiling in the coming weeks are from SysInternals, so I recommend checking them out if you’re unfamiliar with them.

FileMon allows you to see file system activity on your computer in real time. It helped me to track down the slow startup bug in Firefox, and it has also helped me track down other issues (particularly during various application startup periods). Wondering why your disk is randomly thrashing about for no apparent reason? FileMon will tell you why! After firing up this tool for the first time, I was simply amazed at how often the file system got touched in one way or another.

It should be noted that FileMon is now a legacy tool. A newer tool, by the name of Process Monitor has replaced FileMon. Although I haven’t yet used it, Process Monitor looks very promising. Not only does it allow you to view file system activity, but you can also see Windows registry activity, as well as process, thread, and DLL activity, all in real time. These are very handy tools that every software developer or power computer user should know about. I’ll highlight more like this in the coming weeks.

Site htaccess Problem

Published on August 28, 2009

I accidentally blew away the .htaccess file used here at Born Geek. If you spot any links or pages that don’t resolve properly, please let me know.

User Defined Messages in Visual C++

Published on August 27, 2009

Before we get to the meat of this article, here’s a quick introductory story. The next release of Paper Plus will only allow one instance of the application to run at a time. One strange bug I ran into during the testing phase of this new feature, was the case where the application was minimized to the system tray. If a previous instance is already running (and minimized), I wanted the action of trying to start a new instance to restore the old one. For a number of reasons which I won’t go into, I couldn’t get the level of control I needed to restore things properly. So, to get things working, I turned to user defined messages which, happily, solved my problem. Here’s a quick guide to getting custom messages up and running in a Visual C++ application.

Step 1: Define the Message ID

This is straightforward, but you’ll need to make sure your definition appears in the appropriate place. I put mine in stdafx.h, which is included by nearly every file in the project.

#define WM_MYCUSTOMMESSAGE WM_USER+1

Step 2: Add the Message to a Message Map

Next, your custom message needs to be added to the appropriate message map. I added mine to the message map down in my CFrameWnd derived class. Here’s how the entry looks in my case:

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
...
ON_MESSAGE(WM_MYCUSTOMMESSAGE, MyCustomCallback)
...
END_MESSAGE_MAP()

Step 3: Implement the Custom Callback

Your callback function declaration must adhere to the appropriate form, as shown below:

LRESULT MyCustomCallback(WPARAM wParam, LPARAM lParam);

Custom message callbacks must always return an LRESULT, and must accept two parameters: a WPARAM and an LPARAM (down under the covers, both are simply pointers of varying types).

Once you’ve got the declaration in place, it’s time for the definition:

LRESULT CMainFrame::MyCustomCallback(WPARAM wParam, LPARAM lParam)
{
    // Do something clever here
    return 0; // Make sure to return some value
}

Step 4: Post Your Custom Message

Now that we’ve got our custom message callback installed, we need to post our new message in the appropriate place. I decided to use the SendMessageTimeout function, based on some code I saw which used this function to prevent the application from hanging. Here’s a variant of the code I used:

DWORD_PTR dwResult = 0;
// The hWnd parameter below is a handle to the window this message
// should be posted to. Setting this up is not shown, in order to keep
// this article as short as possible.
SendMessageTimeout(hWnd, WM_MYCUSTOMMESSAGE, 0, 0,
                   SMTO_ABORTIFHUNG, 5000, &dwResult);

And that’s it! Being able to post your own messages can help you out of some sticky situations, and lets you take control of your application in some interesting new ways.

Baseball Game Photos

Published on August 23, 2009

I just posted a new photo album from a recent outing to a Durham Bulls baseball game against the Charlotte Knights. As always, the game was fun, the food tasty, and the crowd lively. The Bulls won the game 10 to 2. Go Bulls!

Broken Links Fixed

Published on August 19, 2009

I have fixed a number of broken links in Chapter 3 of the Firefox Toolbar Tutorial. Many thanks to Jens for pointing them out. If you happen to spot any more broken links anywhere around the site, please let me know.

Mint.com Updates

Published on August 18, 2009

I have yet to check these out, but it looks like the folks over at Mint.com (which I recently wrote about) have made things easier in various places around the site. The biggest improvement for me is that you can now view a detailed time line of your net income, with way more stats than before. I am very excited about this new feature, and am looking forward to checking it out this evening.

Update: The new updates to Mint are outstanding! Everything I’ve wanted in the tool, plus more, is here. An already great tool has just gotten even better.

Comments Disabled

WTF?

Published on August 17, 2009

I got the following catalog in the mail today, addressed to me:

Black Women's Fashion Catalog

I am neither female, nor am I African-American, nor do I plan on becoming either at any point in my life. Any ideas on why I received this?

Comments Disabled

Replacing GFS

Published on August 14, 2009

The Register recently had an an interesting article on GFS2: the replacement for the Google File System. It offers insight on the problems Google is facing with the aging GFS. In today’s world of video streaming, GMail account checking, and more, the GFS model doesn’t hold up as it once did. According to the article, the new Caffeine search engine that Google is rolling out supposedly uses this new back end, resulting in faster search results. It should be interesting to see what other benefits come our way as Google tinkers with their engine.

Valve and Deaf Gamers

Published on August 13, 2009

Gabe Newell, from Valve software, recently conducted a focus group session with deaf gamers. Three videos are available of this event: Part One, Part Two, and Part Three. Note that the audio quality is, ironically, pretty bad in each video.

One of the most interesting tidbits from these videos involves Valve’s desire to introduce a deaf character into a future game (possibly in the Half Life universe). An idea is floated where Alyx has taught Dog sign language, based on a past crush she had with a deaf individual. In essence, it would be an excuse for Valve to develop the necessary technology for characters to sign. Pretty cool.

I think it’s great that Valve is doing this. In the accessibility world, blind people get nearly all of the focus. For a gaming company to branch out into this realm is really quite remarkable. I’m looking forward to see how Valve implements this new technology, and I’m excited to see where the Half Life story goes with this (assuming, of course, that Half Life is the intended universe for this work).

Thoughts on Mint.com

Published on August 12, 2009

Way back in January, I bit the bullet and signed up for an account at Mint.com, a free, web-based personal finance tool. Moving into a new house had brought with it a substantial amount of financial responsibility, and I wanted an easy way to track where my money was going. Now that I’ve been using it for 7 months or so, I thought I’d post a few thoughts on the service.

Read the rest of this entry »

Zeldman on URL Shortening

Published on August 10, 2009

Jeffrey Zeldman has written an interesting article on URL shortening and, more specifically, how he rolled his own using a plugin for WordPress. He also points to an excellent article written by Joshua Schachter, describing the benefits and pitfalls of link shortening utilities. Both articles are worthy reads. I suggest reading Joshua’s article before Jeffrey’s.

Do you use URL shortening services? I mainly use bit.ly at Twitter, mostly because that’s what everyone else seemed to use. Have you found some services to be better than others?

Washing Machine Vibration Reduction

Published on August 9, 2009

When I moved into my house last year, I bought an LG front-load washing machine. Having never owned or operated a front-load washer, I didn’t quite know what to expect. For those who don’t already know, front-load washing machines typically spin clothes at a very high rate of speed (mine tops out at 1050 RPM), removing a large amount of excess water in the process. This high speed spin process usually results in substantial vibration. The problem is compounded when the washer is located in an upstairs room (as mine is), and not on a solid, ground level floor (I’ve read that concrete floors are ideal).

Not knowing about this at the time, I was really surprised to see that my entire house vibrated when I washed a load of laundry. The shaking and noise got bad enough that I decided to look into solutions to the problem. I read some about vibration reducing pads online, and picked up a set at a local home improvement store (for about $30, if I remember correctly). After installing the pads with the help of my dad, I noted an improvement in the amount of vibration in the floor. However, the vibration was still bad enough to cause some sympathetic vibrations in my dryer (a major source of noise, oddly enough). Also, these pads were flat on top, so the washer tended to ‘walk’ off of them when a load was particularly unbalanced. Like before, the problem became bad enough to look for another solution.

I found another pair of pads online that had good reviews, and picked up a set (here’s a link: Good Vibrations Washing Machine Pads). These pads are round, not square like the others I had bought, and have a recessed area for the foot of the washing machine.

Wow! Not only does the washer no longer walk off of the pads (thanks to that recessed area), but the vibration in the floor has been reduced by what seems like an order of magnitude! My dryer no longer suffers from “sympathetic-vibration-syndrome,” and the entire wash cycle is noticeably quieter. A set of four pads are $36.95 as of this writing (plus shipping). The sellers accept PayPal, so if you’ve got some money stored up (like I did, thanks to a recent donation to Born Geek), you can pick up a set pretty easily.

If you’ve got a front-load washer and have issues with large vibrations, I recommend the “Good Vibrations” pads. They work remarkably well.

Copyright © 2004-2018 Jonah Bishop. Hosted by DreamHost.