Process Throttling for Windows

While I was looking over Beta News the other day, I came across a handy freeware utility called Process Tamer. It implements an idea which I've had for a few years but didn't have the programming skills to implement ;). Essentially, it runs in the tray and keeps watch on the currently running process (your web browser, your word processor, and so on) and if any of them starts becoming greedy and eating up all your CPU cycles, Process Tamer puts the hammer down and lowers that app’s priority until it gets back under control.

“There are many times when a process will hog your cpu, such as when converting audio/video files, or working with compressed archives. Because these processes completely consume the cpu, your system becomes sluggish to respond and using the computer for other tasks becomes impossible while these processes are running.” “Process Tamer solves this problem by identifying such these degenerate conditions and temporarily reducing the priority of the offending processes in order to allow your system to respond to other requests. Stop being a victim to an overloaded cpu — let Process Tamer keep your system responsive no matter what you're doing. […] ”

If all this talk of “processes” and “scheduling” is Greek to you, I’ll try to go over the general idea. As you’re likely aware, modern operating systems can multi-task which allows them to run multiple programs at the same time (such as viewing a web page while your e-mail client runs in the background). But, at the micro-level, your CPU can only pay attention to one application (“process”) at a time. So, it cycles through each application, doing a few calculations for one of them, switching to the next one, doing a few more calculations, and so on.

And, each process can also have a priority assigned to it which means that higher priority processes are given a preference if there’s a mad grab for CPU cycles. One example of priorities is your mouse cursor which, if I recall correctly, has nearly infinite priority — that is, even under heavy load, your mouse cursor is always supposed to remain responsive. So, what happens if two applications have the same priority but one of them becomes greedy? Well, the meek app just loses out.

And that’s where Process Tamer comes in. Say you're ripping some CDs and the ripping application is hogging the CPU, making your e-mail client sluggish; well, Process Tamer notices that and temporarily lowers the ripper’s priority, leveling the playing field for the other applications.

Netflix’ Recommendations Don’t Always Work

I signed up for Netflix earlier in the week and my first set of movies — Hero, Anchorman and Napoleon Dynamite — arrived on Friday. And, I watched them this weekend:

  • Napoleon Dynamite — I hadn’t seen this one yet and felt that I couldn’t hold out for much longer as there were too many pop culture references to it among my friends that were whizzing right by me (not that I was really avoiding it in the first place). And I now know the response in case someone asks “So, you got my back and everything, right?” ;).

  • Anchorman: The Legend of Ron Burgundy — This is a spoof of 70s newscasts which stars Will Ferrell and Christina Applegate. Well, that’s how the studio would bill it — to me, Fred Willard is more of a draw than Applegate these days (and I mean that as a complement to Willard). Oh, if only Willard could have had the starring role — while I think Ferrell can hilarious, he amplified the role from mere parody into caricature. I really wanted to like this one, but I didn’t really.

  • Hero — This is an epic martial arts flick set in pre-unified China. As IMDB puts it, “A series of Rashomon-like flashback accounts shape the story of how one man defeated three assassins who sought to murder the most powerful warlord in pre-unified China.” Now, don’t get me wrong — the movie was beautifully shot and the martial arts were exceptional. And, the sword fight within the falling autumn leaves was stunning and has some fabulous use of color between the adversaries’ red cloaks and the falling yellow leaves. However, I ended up bored by this one; there’s a good dose of martial arts but the non-martial-arts segments just plodded along for me.

I went to the gym this afternoon and, while I was pedaling along on the elliptical machine, it occurred to me that I should check for World Rally documentaries on Netflix.com later this evening. For those who aren’t aware of it, World Rally is a driving sport where drivers don’t race on a track:

Rallying is a form of motorsports that is run over ordinary roads rather than in specialized circuits used in Formula One or off-road environment used in endurance events like Paris-Dakar. In distinction to rallycross in rallying drivers compete against the clock, not directly against the other drivers. And in distinction to rally-sprints, stages used in rallying are much longer (up to 40 to 50 km, average being 10 to 30 km) and special co-drivers are used to call pace notes. […]

Or, put another way, have you ever flipped through the channels and come across a race featuring cars which resemble the Subaru WRX and Mitsubishi Lancer Evo flying along dirt roads? That would be World Rally. In any case, I searched Netflix for “rally” and came across “World’s Greatest Rally Cars”. Well, I was pleased to find that; granted, it was from 2001, but I don’t get Speed Channel on my cable system (the only network which carries World Rally) and I was eager to find anything.

I then clicked through to the category for that disc’s genre (“Motor Sports & Biking”) to see what else I could find. There, I also found Skip Barber’s film “Going Faster”, a film about (you guessed it) how to drive faster. I already have the book by the same name and I found it very useful for improving my times in autocross. I added that to my queue — so far, so good — and Netflix presented me with a list of “Other Movies You Might Enjoy”… one of which was “Kathy Smith’s Pregnancy Workout”. Bwhah?

I suppose that Netflix’ recommendation system tries awfully hard but I guess it has an off-day every now and then ;). I’m not even really sure how it would think those two films are related. I mean, it's not that pregnant women would be autocrossing (as I would imagine that the G-forces could be disruptive to the baby). All I can figure is that a lot of guys that go autocrossing also have pregnant wives… or something?

Pretty URLs in WordPress

If you’re a new WordPress user, you may have noticed that some WordPress blogs have “pretty URLs” with the date and the name of the post in the path. It’s not hard to set it up and you can have URLs such as “yourdomain.com/archives/2005/04/21/post-name/” . (In addition to the aesthetics, this also lends to higher search engines rankings as search engines consider a link’s path relevant.)

So, how does it work? Well, “permalinks” are set up through the options in WordPress and all the magic happen behind-the-scenes through virtual URLs on the server (so don’t worry about having to create all those directories manually). But before setting the options, you’ll first need to prep a file which is called “.htaccess” (yeah, it’s a a filename with only an extension, which probably seems weird if you're running Windows). You’ll need to make sure that it exists on your web host and, if not, you’ll need to create a blank version first…

To do that, log in to your web host (such as with ftp or ssh) and check to see if a file called .htaccess exists in your web root (which is the directory on your web host corresponding to the root directory of your domain). And, if the file is already there, you can skip the next sentence. But, if not, no worries — just create a blank version of the file (such as by opening Notepad or TextEdit and immediately saving it without typing anything) and upload that to your web root. And, with the file in place, you’ll need to set its permissions to 666 (which is probably done through the context menu of your ftp client with an option called “permissions” or “chmod”).

After that, you'll need to load the WordPress admin interface (at www.yourdomain.com/wp-admin/) and go to Options -> Permalinks (or just go directly to the URL www.yourdomain.com/wp-admin/options-permalink.php). There, you’ll need to enter what structure you’d like for your permalinks, which most people set to include the link’s date and post name along with an optional prefix directory such as “archives”. That’s a format that I like and if you’d like to use that, just enter this in the Structure field on that page:

/archives/%year%/%monthnum%/%day%/%postname%/

Then, it's just a matter of clicking the submit button on that screen (which, on my WordPress setup reads “Update Permalinks”, but it might read slightly differently on yours). And, if you're running WordPress 1.5, that should be all there is to it. However, if you’re using WordPress 1.2, you may be presented with a block of text for your .htaccess file; in that case, just copy-n-paste that into the empty .htaccess file on your hard drive and upload that to your web root. Either way, WordPress will let you know if this step is necessary — so, if you hit the submit button and you’re not presented with a block of text, then you don’t need to worry about it.

If this didn’t work out for you, I’d first recommend checking that the permissions on your .htaccess file were set correctly. And, if that looks good, I’d check to make sure that your web host offers mod_rewrite (which is the Apache that provides all this permalink goodness). There’s also a section on permalink troubleshooting in the WordPress wiki. But, don’t let this paragraph scare you — chances are, it’ll work just fine :).

Music: Greetings from Johannesburg

My brother Adrian and his friend David are in a band and they're getting ready to release an EP which they're tentatively calling Greetings from Johannesburg. Adrian has always been into music and I know that he and Dave have been working on some tracks for a couple years now but, I hadn’t heard any of it until this today.

Adrian has released the tracks as mp3s and I downloaded them earlier this evening. I wasn’t really sure what to expect — well I kinda had an idea since Adrian loves indie music (you know, Elephant Six and all that). I piled them into a playlist in Quintessential Player and took a listen. And, I really enjoyed it — I think it’s the kind of music I might buy in a store, if it was for sale.

The part that’s troubling me, as I write this, is that I’m not sure what genre it would fall into. I’m guessing “indie”, somehow, but I would suppose that there’re sub-genres within “indie” much like there’re sub-genres within (say) metal (such as melodic death metal, power metal, and black metal, if you’re curious). But, after some brain wracking, I can see some resemblances to The Postal Service and maybe Barcelona in some ways.

I would have hosted some of the tracks here in order to save Adrian some bandwidth but I didn't see a license specified and I didn’t want to guess wrongly. Perhaps he’d be open to one of the Creative Commons audio licenses; then again, though I could hazard a guess that Adrian might be open to that, I’m not sure how Dave would feel.

Alternate DNS Servers

The other day, my Internet connection went down — well, I didn’t see it go down but, when I got back from work that day, I couldn't browse anywhere. And, what would often help in the past would be to reboot my cable modem; so, I tried that about three or four times (and, really, I should have caught on after the second time). Comcast hasn’t been incredibly reliable for me — they tend to go down every couple months — and I just chalked this up to their usual ineptness.

I then noticed a curiosity — my IM client was still online. And I could still read my mail. But I couldn't browse the web (whaa?). I wondered for a moment whether Firefox was acting up and so I tried loading an ftp client to test my connection. (You thought I might load IE for that? Not if I can help it ;).) Sure enough, FileZilla couldn't connect anywhere either. Then it hit me: my DNS had probably gone wonky. That would explain why I couldn't browse anywhere but my most common Internet apps still held up — those ip addresses were cached by my OS.

At that point, I ran “ipconfig /all” and then pinged the DNS servers to which I was assigned. To no surprise, they both timed out. Then, on a hunch, I tried loading Google and I was actually able to make it there (since I suppose its ip address was one of those in my cache). I then tried searching for “alternate DNS servers”. There were quite a few hits but, of course, I couldn’t see any of them since those sites weren’t in my existing DNS cache (d’oh!). It then dawned on me that I could view the Google Cache of those pages; and, while the pages probably wouldn't look pretty, that would hopefully allow me to get the info I needed.

Indeed, Google Cache worked nicely and I found some alternate DNS servers that I could use. I popped those in my settings and I was up and running again. However, I realize now that I could have made things easier on myself by keeping a few spare DNS servers on hand — before they actually went down. In any case, while there are dozens of DNS servers which are suitable, some that were mentioned consistently were the 4.2.2.x series (4.2.2.1 through 4.2.2.6).

I did an nslookup on those ip addresses and they came back as Genuity.net and GTEI.net servers. Perhaps ironically, I can’t load either of those domains right now, otherwise I’d include a sentence about who each of those companies are ;). But, with such low-numbered ip addresses, I presume they’re of some importance within the InterWeb. In any case, one of the comments on Digg.com [*] offers these instructions for adding DNS servers in case you haven’t done that kind of thing before:

Click on “My Computer”. Click on “My Network Places”. Click on “View Connections”. Right click on the connection that supports your Internet connection and go to “Properties”. Double click on the Internet Protocol TCP/IP option. Make sure “Use the following DNS server address” is selected, and input the above recommended DNS.

To check go to “Start > Run > “cmd” ”. Type in “ipconfig /all” and you should see the DNS you input where it says “DNS”.

[*] On a side note, what is Digg, anyway? Pages within digg.com have been coming up in my search results more frequently recently but I can't quite wrap my head around what the site is about. Something about folksonomies, I’m guessing.

Anyway, before adding those DNS servers, you may as well ping each of them to see which of them are fastest for you. If you go through all six of them, just pick (say) the two with the lowest ping times. Granted, it’s all a matter of milliseconds but every little bit helps ;).