Archive for the ‘Features’ Category

On Charity

Tuesday, August 23rd, 2011

Tonight Carrie and I went to a Reddit Board Game Night on Capitol Hill. Apparently there was a power outage, so the place it was going to be at, B&O Espresso, was closed for the evening. The gaming got moved to Caffé Vita at the last minute, so it was a tinier, more intimate crowd. Unfortunately, we’d already parked once and it was Capitol Hill, Hades of Parking, so we had to walk a fair distance to get to the coffee shop. It was worth it, though — we played Elixer and Cosmic Encounter, and everybody had a blast.

Things wrapped up around 10:30 or so, and we packed up our games and took our leave. Since the venue had been moved, we had quite a ways to walk to our car (don’t get me started on the horrendous parking in Capitol Hill; we’d be here all night!). A few blocks down Pike we were stopped by a disheveled-looking young woman. She looked about twenty to twenty-five years of age.

“I’m sorry to bother you,” she said. “My car is out of gas and my purse was stolen, and I need to get back to Bellevue. Could you give me a few dollars for gas money?”

I’d heard about this type of scam before. The best grifts depend on either greed or compassion, two opposite sides of the same shiny coin. What cold and indifferent monster wouldn’t want to help out in this situation? We’ve all run out of gas or nervously eyed the needle hovering over the “E”, so it’s a common enough vector for attack. You simply play on the victim’s own fear. Throw in the fact that you don’t have the money to buy a couple of gallons, and you can play on the victim’s sympathies, too. Who could resist such a sob story?

Well, it turns out I can. One of the first things I developed after moving into Seattle was a calloused sense of sympathy for people asking for money on the street. When you work downtown it’s not really a choice, unless you want to give cash for dubious causes every single day. This was especially true for me, as I got on my bus at Third and James, which was absolutely crawling with folk asking for handouts. I want to emphasize that I’m only unyielding to those who ask me for money and money alone. I’m just too skeptical to believe that you need a few bucks for the bus, or to buy some food. In fact, this skepticism led me to my stock response for such inquiries. “I don’t carry cash,” I say (I don’t), “but I can buy you what you need.” If they’re asking for money for food, I’ll offer to buy them a sandwich. If they want money for bus fare, I offer to swipe my Orca Card for them on the bus of their choice. Every time I’ve been approached downtown this way and I’ve offered to buy my solicitor what they need, they’ve turned me down.

So at this point I told this poor young woman that I didn’t have any cash, but I could buy her gas. If you are being scammed and things go this way, the grifter usually makes an excuse and bails out quickly, if not gracefully. But not this particular woman. “I’ll need to go get some gas cans from my friend,” she told us. This to me seems to be either her exit line or her please-don’t-inconvenience-me-I’m-already-out-of-gas line, but before we could start down either path she ran off across the street and disappeared into the shadows of the night growing from the QFC. Carrie and I waited around a while, board game boxes rumbling as we shifted them in our hands. We waited partially out of politeness and partially out of genuine concern. Carrie was becoming nervous that she was getting her “friend”, a 6-foot-3 rogue with an anchor tattoo, an eye patch, and grapefruit-sized biceps. Afterwards she told me that she was facing the opposite direction to me to get my back. It makes me feel better to know I wasn’t the only skeptical person involved.

[I’d like to make a digression and tell a related story from many years ago, right after Carrie and I started dating. We were crossing the footbridge from campus in Missoula to the Albertson’s on Broadway. This bridge was a notorious hangout for vagrants and vagabonds. As we stepped off the bridge, a man approached on a low-riding bicycle. He swerved from side to side in loping, teetering undulations. Each unsure turn brought him closer and closer to one of the concrete barriers lining either side of the bridge’s approach until with a sickrning thud he crashed into one and collapsed in a heap, bike on top. Carrie wanted to stop and help but I was convinced it was some sort of scheme and wanted to leave him there. It’s a good thing I listened and we stopped; he was really hurt. We called an ambulance and Carrie with her CNA training tended to his wounds. I had been certain that it was something they cooked up to elicit sympathy. I’m an optimist on paper but am pretty cynical when it comes to human interaction. Luckily he got the attention he needed, but it turned out he had Hepatitis C, so that was a little scary.]

After a short delay the young woman came running back with a gas can in each hand. She’d either called my bluff or she really needed the help. I was a little shocked because I didn’t expect to see her again. She met up with us on the corner, the light to cross the street the other way was mercifully short, and we headed to the Shell station to fill what she had brought. They must have been 1.5 – 2 gallon cans, because as I was filling them she told me to only put four dollars’ worth of gas into each can (which honestly is enough to get you across Lake Washington and back home in Bellevue). She thanked us two or three times as the cans were filling, then as I handed them to her. With some final words of gratitude she waked off with her eight dollars’ worth of gasoline, presumably to her exhausted car, and we turned back north on Broadway, the way we’d been going. It hadn’t taken more than five minutes.

Now usually I would have been feeling pretty good about all this. I’ve convinced myself that she really did need it. Maybe her purse wasn’t stolen, maybe she was destitute, or maybe she had misplaced it. Maybe she wasn’t trying to get back to Bellevue and she just needed it to get to work in the morning (or school, or wherever). But I’m pretty sure she wasn’t after a couple gallons of free gas. What would she do, re-sell it? Who would buy that? Weighing what I know, it looked as if we’d helped someone in need.

The only problem is that I lied. I was carrying cash. Enough of it in varying bills to give her what she needed, to the dollar. Now I’m usually a proponent of telling the truth, even if it’s unpleasant. But I always lie about not having cash whenever I offer my stock response to requests on the street. I could have a hundred dollars in my wallet, or a single one dollar bill. I’ll always say I don’t have any and offer to buy what they need. I started thinking about this as we walked the half-mile or so to where we’d parked our car. I can only offer one defense: my concern for our safety. After all, we may have grown up in Montana but we still know better than to blindly dig cash out of our wallets for anybody who asks. Things turned out okay, regardless. If I’d given her cash and she was a meth head then it wouldn’t have done any good. I can think of very few detrimental things she could do with the gas (okay, I suppose that’s not true. She could use it to burn down a building, for example). It’s not like she could have fenced at most three dollars’ worth of gasoline, though.

This is what it takes. In the best case, we helped a hapless if irresponsible woman get back home. In the worst case, we helped her drive to that next party. Either way I’m okay with it. When another human being asks, you’ve just got to help, whatever way you can.

Home Theater Without Breaking the Bank – Part 2

Wednesday, January 13th, 2010

One Remote to Rule Them All

This is part two of a multi-part story on upgrading my home stereo. Part 1 was about finding the right solution for video playback.

After getting video sorted out, the next step was to find some way to reduce the jumble of remote controls I was currently using. At this point, I had all sorts of crap to remotely control the devices: a wireless keyboard for the HTPC; remotes for the cable box / DVR, the receiver, and the TV, Playstation 3 em Playstation 2 remotes, and Wii remotes. Surely, I could do something to reduce this remote madness?

My first idea was to use the remote that came with my receiver. It could control up to nine devices, and from reading the manual I gathered that it could control many different types. The litmus test would be whether or not my receiver’s remote could control my cable box / DVR. It’s a Pace box, which is one brand I’d never heard of before. I was quite pleased to see the company name even listed in my remote’s manual. It was worth a shot.

One neat thing my receiver does (it’s an Onkyo HT-RC160) is on-screen configuration of remote codes for controlling other devices. That means it displays instructions and the codes themselves right on the TV. It sure beats the heck out of flipping the remote over (to read the instructions) for the first few codes, or (even worse) digging out the manual and looking up the codes. This made it easier to try the codes — there were about ten of them — but it turned out to be for nought, because none of the codes worked. Back to the drawing board.

A couple of years ago I got my dad a Logitech Harmony 659 remote for Christmas. The Harmony series allows you to define ‘activities’ that are essentially macros for the devices it controls. You can define one called “Watch a Movie” that turns on your receiver, TV, and DVD player, and switches everything to the right inputs. This was a great gift because it was something he could tinker with and it would make things a lot easier for my mom, who doesn’t want to deal with all the devices, inputs, and buttons. I thought this might be the perfect solution for my problem.

So I went to Target and made the most impulsive purchase of my home theater-upgrading spree. Luckily, they had one Harmony 620, which is precisely the remote I needed. I could have ordered it online (that’s how I got most of the equipment I needed for this upgrade), but didn’t want to have to wait. It was a Saturday, which meant that the earliest I would have gotten the thing would have been Wednesday. Logitech also sells other Harmony remote models, but anything below the 620 was too little for what I needed and anything above is, frankly, overkill. The Harmony One, for example, costs almost twice as much and all it adds are a touch screen with color and a rechargeable battery. I like the idea of being able to recharge my remote, but it’s not worth the extra $79. I think the color touch screen is essentially a throwaway feature. I like my remote controls to have tactile feedback, and usually touch screens that small are terribly inaccurate. There’s also another model, the Harmony 1100, which is roughly the size of a sheet of paper and is almost entirely touchscreen-based, which means it would be even less useful to me than the Harmony One. I honestly don’t understand why somebody would purchase an accessory for their home theater that potentially costs more than the components themselves!

It was a snap to enter in the codes for all my devices, but I ran into a few snags:

  • My HTPC didn’t have an IR receiver, so I couldn’t control the Harmony with it.
  • The PlayStation 3 uses BlueTooth for its wireless devices, and doesn’t have an IR port, either.
  • The Wii doesn’t support IR.

The Wii turned out to be a moot point. You pretty much have to get up to get a Wiimote. If you turn on the Wii, you’re going to want to play a game, not watch a movie (Netflix rumors notwithstanding). So I added an activity (‘Play Wii’), and all it can do is turn on the TV and the receiver.

The PS3 presented more of a challenge. There are two items that could have worked here. Nyko makes a PS3 Remote, and Logitech sells a Blutooth->IR adapter. The Nyko device plugs into the PS3 via a USB port, which means it takes up on of the ports and can’t turn the unit on (because it draws its power from USB). The Logitech Harmony adapter actually translates IR commands to BlueTooth (meaning it can turn on the PS3), but it costs almost four times as much as the Nyko remote.

I finally decided to go with the Logitech one, because I wanted to keep a USB port free and for some reason the ability to turn the PS3 off and on was really, really important to me. Sometimes I’m obsessive about this sort of thing, and I decided I wanted as much control over my devices as possible. In hindsight, this purchase may have been the most impulsive one in my home theater-upgrading spree. Nevertheless, I ordered the thing and it worked right away. The most complicated thing I had to do was register it with the PlayStation 3’s OS.

With that problem solved, I turned to the matter of my HTPC. The bulk of my home theater viewing is done on this. I had search for something like this before, but couldn’t really find anything that matched what I wanted to do. Part of the problem is that my playback software of choice is MediaPortal, and lots of remotes didn’t work with it. Ideally, I wanted an IR receiver that could process remote commands and turn them into arbitrary keystrokes.

I don’t know if there’s anything that does precisely that, but I found something that’s close. It’s a PC remote that’s interpreted as a USB keyboard by your computer. I wasn’t 100% sure of what keystrokes the remote buttons translated into, but I saw enough (after doing some Google image searches) to realize that it included the four arrow keys, escape, and enter. These were the necessary keys for navigating the MediaPortal menus. The rest would be window dressing. And — bonus — somebody posted the remote’s codes to the Logitech database, which meant I would only have to do minimal tweaking to get it to work with MediaPortal. Another thing worth mentioning is that the PC remote itself has the ability to control the mouse. Unfortunately, it has its own pad for this and there’s no direct equivalent on the Harmony remote, but I still managed to get it programmed in, thanks to the customizable menus available on the Logitech remote.

Mapping the remote took some effort and a bit of ingenuity on my part. First I had to figure out what keys each of the PC remote’s buttons corresponded to. One approach would have been to open Notepad, press the remote buttons, and see what gets typed. I decided to do it another wayL I used another (unrelated) Logitech program. I sometimes use my HTPC to play emulators for old video game consoles, and had bought a couple of Logitech USB gamepads a while back. They came with a program that allows you to configure them. This program has a ‘record keystroke’ feature which tells you exactly which buttons are being pressed. So I can push each button on the PC remote in turn, and see on screen exactly what keystrokes are sent to the computer. This allowed me to easily map those same commands to the Harmony Remote’s buttons.

Interestingly, the commands I had the most trouble with were the transport buttons: play, pause, and stop. MediaPortal uses the space bar (in line with other media programs like VLC and QuickTime) to pause or play a video. This was not triggered directly by any button on the PC remote. The closest that remote came to pressing spacebar was via a clumsy numlock button, which turned the 0-9 digits into letters (kind of like a telephone pad). It was even worse for the stop functionality, which is triggered in MediaPortal by the ‘b’ key. As far as I could tell, I couldn’t reconfigure MediaPortal’s default controls to match one of the keycodes triggered by the PC remote.

But the remote did have four commands reserved for macros or program launching. It had A, B, C, and D buttons that triggered alt+shift+a, alt+shift+b,… and so on. So I downloaded AutoHotKey onto my HTPC. This is an open-source macro program that allows you to create scripts to control your PC automatically. I created a script that simply presses ‘B’, compiled it to an application (AutoHotKey can do that), created a shortcut to said application, and gave it the trigger alt+shift+a. Now the ‘A’ button on the PC remote (or its equivalent on the Harmony Remote) triggered this macro, which pressed ‘b’ and stopped whatever was playing via MediaPortal. Awesome!

I programmed the other hotkeys to do other things. ‘B’ presses the spacebar, which I assigned to the Harmony Remote’s play and pause buttons. ‘C’ opens MediaPortal itself (in case I boot the PC or otherwise need to run MediaPortal).

The most fun I had was programming the ‘D’ hotkey. I ran into a problem that I still haven’t been able to solve, but have developed a band-aid workaround. Sometimes, when I turn on the HTPC, it ‘forgets’ that it’s plugged into my TV via HDMI and no signal is sent. Luckily, I have another output from the HTPC to the TV via a VGA (or D-Sub) connector, and this one is never forgotten. So if I turn on the HTPC and for some reason it doesn’t know about the DVI port connected to the TV, I can use the VGA port and switch the monitors. But boy, what a pain! I wound up creating another AutoHotKey script that switches to the desktop, right-click it, chooses ‘Display Properties’, and tabs/toggles its way through the display dialog, changing over to the DVI output and applying the changes. It works like magic! If I turn on the HTPC and don’t get any video, I simply press the ‘D’ hotkey on the Harmony remote (which has been programmed into the customizable menu as ‘Fix Displays’), and everything is fixed!

I also programmed some other stuff into the Harmony remote’s custom menus. There are mouse control command, ctrl+esc for showing the start menu, Windows Key-D for showing the desktop, alt-tab for switching programs, and tab for configuring dialog boxes. The remote also had commands for my laptop (which came with an IR remote control) and a digital photo frame my parents had given my wife and me for our wedding. True, I don’t do much to control the frame, but it’s reassuring to know that I have the power.

This was the last step, and now I’m in complete control. Every command is at my fingertips. I had a total of nine devices and eight activities. I have One Remote to Rule Them All. I’m almost drunk off my own power. Too bad I can’t convince my wife to use the remote to control the PC (getting that to work I viewed as my crowning achievement) — she still uses the wireless keyboard.

Home Theater Without Breaking the Bank – Part 1

Monday, January 11th, 2010

A few months ago my home theater suffered a nearly-fatal blow: my receiver died. I was obligated to remove it and put in an old friend to hold down the fort until I could replace my fallen soldier. A couple of weeks ago I finally got a replacement, and started the process of planning, configuring, and upgrading my home theater. This weekend I put in the final piece of the puzzle, and can now say that I have a home theater to be proud of. And the best part is that I didn’t have to pay through the nose to get something I’m proud of. Until very recently, I worried I would have to build a whole new HTPC. Thankfully, a solution arose in the most unlikely of places.

With all of that work (some might even call it fun) out of the way, I can around to describing the thing, and hopefully sharing some tips so that others attempting something similar to what I did can get it done without quite as much hassle. This subject is kind of hard for me to write about, for two opposing reasons. The reason I am apt to write this all down is because I love technical things, and I especially love stereo (and home theater setup). However, I’m wary about writing about it because when I see others do so it often feels to me almost like bragging, as in, “look at how much neat stuff I have!” I realize that the fault probably lies with me and the way I perceive people talking about this stuff, but at the same time it makes me want to avoid that sort of thing, so I’ll try. I want to make this about the technology, not how much it costs. That’s why I’m focusing on the “without breaking the bank” part.

I’m going to divide this up into several articles, because I could write quite a lot about it. This first part will be about the solution I went with on my HTPC, and my search for a video player. I will also cover my remote control configuration and receiver setup later.

Part 1: Finding a Video Player

One of my chief goals was to find a way to play HD video without having to go too far out of my way. I knew this was likely to be a tough nut to crack. None of my computers are what you would call cutting-edge. I’m a web programmer, so I don’t really have to have a beefy CPU for compiling, and I’m not some knee-jerk gamer who dumps cash on the biggest, meanest graphics card. That means I’m never on the cutting edge of hardware: I wouldn’t utilize the bleeding edge anyway. At the same time, I realize that HD video is permeating many parts of our lives and it’s just going to become more prevalent, so I wanted to focus on future-proofing (or at least future-preparing) my setup.

My home theater is a modest Compaq box I got when I was in college and switched majors to Computer Science about five years ago. It has an AMD Athalon x64 processor, 2GB of RAM, and a decent video card I got a couple of years later (I think it’s an nVidia GeForce 7000 series card, and I know it has 128 MB RAM). I’ve got it hooked up to my receiver via a DVI-to-HDMI adapter and digital coaxial output. It can show 1080p (and that’s the way it runs), but I knew that it would take a miracle to get actual 1080p video running on it.

About a year and a half ago, I decided to use MediaPortal as the media library/playback app. I also looked at XBMC, but at the time it was too buggy to consider. There are yet other options, but MediaPortal is the one I settled on because of how configurable it is, and how suited it is to what I need (playback of video on Windows shares, and occasional music, too). I could have gone with a whole different Operating System, but settled on Windows XP as it is stable and lean compared to Vista. I considered Linux briefly, but decided that my hardware requirements would make getting it to work into a chore instead of a hobby. Things may have changed in the last eighteen months, but I’ve kind of settled upon Windows for now.

720p video worked right out the door via MediaPortal. I’m not 100% certain, but I’m confident that it wouldn’t play smoothly on this box without a little something called DVXA. DXVA is a Microsoft API that uses your graphics card to help decode demanding video (like H.264-encoded stuff, which is primarily what HD video uses these days). My confirmation of this is that the 720p video doesn’t run smoothly on this box in VLC, which as far as I know doesn’t use hardware acceleration at all.

1080p video flat out didn’t work. I figured it wouldn’t on this box. Betting on a long shot, I gave it a try anyway using both MediaPortal (which crashed) and Media Player Classic Home Cinema, which also uses DXVA but probably doesn’t have as much overhead as MediaPortal. No luck with either, which is exactly what I expected.

I decided to try out my laptop. It was marketed and sold as a ‘media center laptop.’ I got this one about two and a half years ago to replace an aging Dell Latitudes I’d inherited from my father. It came with Vista Home Premium (which I replaced with Business). It’s got a speedier CPU: a Core 2 Duo. It’s also got 4GB of RAM and an 8000-series GeForce. I figured this should be more than enough to play 1080p video.

Wrong! VLC couldn’t hack it. It looked like VLC didn’t even use use both cores while decompressing. I tried MPC HC and it sort of worked after I tweaked the settings. Some 1080p video, like animation, would play just fine. The beefiest files I threw at it worked, too. But other 1080p files which should have required less decoding muscle were stuttering and had terrible lip synch. In all other respects, the laptop would have been a golden solution: it had an HDMI output which carried both HD video and sound, and I had a free port on my receiver and a decent-sized cable. I finally managed to configure MPC HC to send the digital audio straight out over the HDMI instead of decoding it stereo, so I had 5.1 surround, too. But when I sat down to do a test run, it still had some problems. Video would stutter and lip synch would often drift, sometimes being correct and other times being just enough off to be frustrating.

At this point, I thought maybe my network was to blame. My server is downstairs in the basement. I had first tried a pair of Ethernet-over-power (also known as Powerlink) bridges, but I think my house’s wiring is too old and noisy to privde reliable throughput. It couldn’t even deliver reduced-size DVD rips from the server. I upgraded to a wireless bridge with 802.11n, and this was at least able to deliver a 4GB DVD rip in the time it took to watch it. I figured maybe my laptop was decoding video just fine, but not receiving content quickly enough. A quick copy of a 6.5 GB, hour-long 1080p video took about 43 minutes, which should have been enough to do it. But I tried watching the copied video direct from my hard drive, and it was still displaying the same behavior.

This is when things started to veer of into crazy land. I tried my wife’s PC, which is in the same room as the TV and has a slightly beefier processor and a much beefier graphics card than my laptop. It could play some video my laptop couldn’t, but bizarrely it couldn’t handle the video my laptop could.. At this point, I considered either building a new, extremely beefy HTPC or dropping some cash to run an HDMI cable the approximately 25 feet that would be necessary to connect my wife’s PC to the TV. Neither of these were ideal solutions, because I’d have to test a new 1080p video on both machines and screw around with display settings.

Strangely enough, my first-generation Intel iMac (just a Core Duo, not a Core 2) could play the same video my wife’s much newer PC could and could almost play the video that worked on my laptop — in VLC, no less. I had no idea why.

At this point I tried a couple of Linux LiveCDs on my laptop, figuring that Vista’s overhead may have been the problem, but ran into hardware configuration problems. This would also have required even more work than mentioned above. To watch 1080p video, I’d have to reboot with the LiveCD or install in onto my hard drive.

Is it clear I was close to madness at this point? Why could my 3.5 year-old iMac play most HD video just fine, while my newer laptop and my wife’s computer could only handle some of it? Why was MPC HC behaving so differently on different boxes when it was configured the same?

The solution came in the form of XBMC. I downloaded it on a whim, just to test it out. Not only could it play all my 1080p content at full resolution, but it could also do crazy things like fullscreen overlays and subtitles (just moving the mouse was enough to make playback jittery in MPC HC)! I even got it configured to output 5.1 digital audio without too much fiddling. So far, it’s played everything I’ve thrown at it.

The only problem I’ve seen is in some 1080 buffering issues. I think I know why. Today’s video codecs don’t encode information at the same bitrate all the time. A file has an average bitrate, which can roughly be calculated by dividing its size by its length. But the bitrate varies considerably. From 1:00:00 1:01:00, for example, it might play at 2 Mb / sec, but from 1:01:00 to 1:02:00, it might play at 3 Mb / sec or more. A smart codec squeezes as much extraneous data out of a scene as it can. This is easy in scenes with little motion. But a scene with a lot of action might have a much higher instantaneous bitrate. So even though my wireless N network can download the whole video in less time than is required to play it, it could be that certain parts have such a high bitrate that they can’t be played at my network’s transmission speed, while most of the rest of the video falls well below the average.

There’s not much I can do about this, aside from ‘pre-buffering’ HD video by copying it to the laptop first. I can’t lay cable in my house because it’s rented. My wife wouldn’t approve of stringing long ethernet cables down the stairs, either. Maybe there’s an option to increase XBMC’s video buffer. It definitely seems smarter than, for example, Amazon’s video-on-demand buffer or YouTube, but it’s hard to gauge these things. I might wind up getting a big hard drive exclusively for my HD content, attached to the network upstairs. Maybe I’ll look into a NAS solution.

So, here’s an overview of what I use the computers for:

  • HTPC Box — SD video, DVD rips, HD video up to 720p. Also, I run various emulators off it, and play music from my server. This is all done via MediaPortal. Video is via HDMI out, audio is via digital coax up to 5.1 surround.
  • Laptop — 1080p video played in XBMC. Video and audio via HDMI, up to 5.1 surround.

Not so complicated when it’s put that simply. The best part is that I didn’t have to build (and pay for) a new computer just to get full HD playback. The only drawback is that I can’t do anything else (like browse the web) on that laptop. I’ve still got the old Dell Latitude, so I could do it that way, but usually if I’m watching 1080p video, it’s got my full attention.

For Part II, I’ll go through what it took to get everything controlled by one remote.

How to Win (Or Maybe Not) on Wheel of Fortune

Wednesday, August 19th, 2009

Wheel! Of! Fortune!One nice thing about being a programmer is that you can automate certain calculations that you’d have to be crazy to attempt any other way. While some would see a non-programmer attempting to figure out some of this stuff as borderline insane, we coders just come across as eccentric with a lot of time on our hands. If people ask a question fairly frequently, and said question involves lots of number-crunching, you can bet some coder somewhere has taken a crack at trying to crunch those numbers.

Case in point: Wheel of Fortune. Now, I’ve never really been a huge fan of the show, but I see it a lot anyway. It’s on after Jeopardy!, which I really do enjoy and try to watch fairly frequently, so I’ve seen my fair share of episodes of Wheel. One thing that always got me was the final puzzle. For those of you who don’t know, this is how it works: the winning contestant from all the previous rounds must solve a shorter, harder puzzle by himself in a small span of time. He is given a (usually unhelpful) hint in the form a category, and some of the most common letters in the English language (R, S, T, L, N, and E) are already shown. Then the contestant must choose three more consonants and one more vowel. If any of these letters occur in the puzzle Vanna White shows them, and the players has ten seconds to guess what the word or phrase is.

There are other factors at play here, but they don’t relate to what I’m interested in most, namely: What are the best letters to pick? Can we do an analysis of the letter frequency of a whole bunch of these puzzles? Can we determine whether or not the producers of the show pay attention to these frequencies? Thanks to the Internet and some spare time in the hands of a programmer, the answer is a (qualified) yes, we can. Please note that while I do enjoy math, I am most certainly not a mathematician, so this is just an armchair analysis, and not a scholar’s take.

First, I needed a set of data. As interested as I was in determining the letter frequencies, I wasn’t about to spend six months collecting data by actually watching the end of each show. I have the Internet to do that sort of stuff for me! In this case, I found this forum, whose residents had already done the hard work. I was able to grab the final puzzles from a couple of threads on this site, and store them in some text files, one puzzle to a line. Then, I wrote a short Python script to parse through the results and generate links to a Google Charts representation of the data. If you’re going to screw around on the Internet, why waste time inputting data into Excel?

The Code

Below is the code. Please note that while I have commented it, it’s task-oriented code. I did not sit down and think things through for hours on end; I was more interested in the results produced by the code than the process of making it. To that end it may be a bit rough around the edges. If you’re a Python programmer you might even think it un-Pythonic.

Show/Hide Source Code

from operator import itemgetter # for sorting
import sys # for command-line arguments
 
# makes sorting dictionaries prettier
def sortDictionary (s):
    return sorted(s.items(), key = itemgetter(1), reverse = True)
 
hexColors = ["F05DCF", "F4B213", "7BB5FE", "19B915",
       "C913E4", "E38080", "4891EB", "DCF725", "E02EB0",
       "EE7D18", "16D949", "73E0C9", "22F1DB", "1460A1",
       "CF8040", "FFFFFF", "CF8054", "204E00", "2B1160",
       "87513C", "DECEE9", "C913E4", "83B892", "597D4C",
       "DACA5D", "2F486B", "D79E17", "826889", "359DA1",
       "DE7A43", "568C51", "FBF786"]
 
 
if __name__ == "__main__":
    # set up command line arguments
    # thumb:   creates a smaller file, with shorter (or no, depending on letter count) labels
    # verbose: prints out each list of letters and frequencies, too
 
    if (len(sys.argv) < 2 or len(sys.argv) > 4):
        print "Usage: wof.py [filename] [t|f] [v]"
        exit()
 
    thumb = False
    verbose = False
    fileName = sys.argv[1]
    if len(sys.argv) > 2 and sys.argv[2].lower() == "t":
        thumb = True
    if len(sys.argv) > 3 and sys.argv[3].lower() == "v":
        verbose = True
 
 
    # set up lists of letters
    letters = ["a", "b", "c", "d", "e", "f", "g", "h",
               "i", "j", "k", "l", "m", "n", "o", "p",
               "q", "r", "s", "t", "u", "v", "w", "x",
               "y", "z"]
    consonants = ["b", "c", "d", "f", "g", "h",
                "j", "k", "l", "m", "n", "p",
               "q", "r", "s", "t", "v", "w", "x",
               "y", "z"]
    vowels = ["a", "e", "i", "o", "u"]
 
    # letters to exclude (already given to you on game show)
    already = ["r", "s", "t", "l", "n", "e"]
 
 
    # set up frequency dictionaries {leter : number of occurences}
    allFrequencies = dict((letter, 0) for letter in letters)
    vowelFrequencies = dict((letter, 0) for letter in vowels)
    consonantFrequencies = dict((letter, 0) for letter in consonants);
 
    # Read the data file. Should consist of one final puzzle
    # solution per line, optionally lines can start with "#" for a comment
    file = open(fileName)
    while True:
        line = file.readline()
        if not line: break #end of loop
        if line[0] == "#": continue # skip comments
        for letter in line:
            lower = letter.lower()
            if lower in allFrequencies:
                allFrequencies[lower] = allFrequencies[lower] + 1
            if lower in already: # exclude RSTLNE from vowels and consonants
                break
            if lower in vowelFrequencies:
                vowelFrequencies[lower] = vowelFrequencies[lower] + 1
            if lower in consonantFrequencies:
                consonantFrequencies[lower] = consonantFrequencies[lower] + 1
 
    #sort dictionaries
    allFrequencies = sortDictionary(allFrequencies);
    vowelFrequencies = sortDictionary(vowelFrequencies);
    consonantFrequencies = sortDictionary(consonantFrequencies);
 
    if verbose:
        #display the lists
        print "ALL:\n", allFrequencies
        print "\nVOWELS:\n", vowelFrequencies
        print "\nCONSONANTS:\n", consonantFrequencies
 
 
    charts = {"All+Letters" : allFrequencies, "Vowels" : vowelFrequencies,
             "Consonants" : consonantFrequencies}
 
    for chart in charts:
        # make the image URLs, using Google Charts
        if thumb:
            url = "http://chart.apis.google.com/chart?chs=100x100&cht=p"
        else:
            url = "http://chart.apis.google.com/chart?chs=400x300&cht=p"
 
        # build lists for data series and its labels
        labels = []
        data = []
        for entry in charts[chart]:
            if int(entry[1]) > 0: # exclude any letters not used
                # make sure a thumbnail doesn't have too many labels to clutter it
                if thumb and len(charts[chart]) <= 6:
                    labels.append(entry[0].upper())
                else:
                    labels.append(entry[0].upper() + "+(" + str(entry[1]) + ")")
                data.append(str(entry[1]))
 
        # set them to the query string parts for data and labels
        dataRange = "&chd=t:" + ",".join(data);
        if (thumb and len(charts[chart]) >= 6):
            labelRange = ""
        else:
            labelRange = "&chl=" + "|".join(labels);
 
 
        # build the array of chart colors
        chartColors = "&chco=" + ",".join(hexColors[0:len(charts[chart])-2])
 
        # build final URL
        url = url + dataRange + labelRange + "&" + chartColors + "&chtt=" + chart;
        print "\n", chart, "\n", url

The Results

Might as well show off the pretty, pretty pictures, huh? Click any graph below to enlarge it.

At first look, the data is not too promising. I can give you two letters that will increase your chances of getting a ‘hit’, and one of them might come in handy. In our six months’ worth of data, O is the favorite… but not by much. Looking at both periods, it seems pretty clear that somebody at Merv Griffin Productions is responsible for distributing the vowels O, I, and A across the spectrum so none of them shows up too frequently. Notice how I and O are tied on the most recent set of data, but A is the second-most frequent vowel on the older figures. Combining all the numbers, we see that these three vowels are essentially tied in frequency, with U in a slightly lower class. But at least it’s something to work with, right? From the last six months of Wheel, it looks like ‘O’ is the best vowel to go with.

Now what about consonants? I was most excited when I pulled up the 2009 consonants graph (the first one I did), because you can clearly see that the top two letters are definitely a bit more common than the rest, and even the top three look pretty solid. H, G, and D… could those be the winning ones? My excitement faded, however, as I ran the earlier set of data through the script. Looking at the combined chart, H still has a statistically significant lead. But you’ll have no luck trying to discover the three letters to choose. But we can limit our options a little. F, G, and B are all clearly separated from the next letter (D) in the combined graph, with a decent-sized gap between them. It’s harder to say for certain, but it looks like the producers may be balancing these top four letters throughout their puzzles.

So, what to go with? You should definitely choose O for your vowel. H is the consonants which statistically is most likely to occur. Then any of F, G, and B would probably do you some good.

And how about those shifty producers? Are they gaming the final answers, so they don’t have to give out as much prize money? Are they maybe picking and choosing their phrases to deflect somebody who did a little research before heading down to the studio to play? Well, let’s try to find a pattern in the frequency of letters in the English language (please note that I’ve removed RSTLNE from these graphs):

Right away you should notice some major discrepancies between the Wheel of Fortune data set and written English. While H shows up at the top where we’d expect, D is clearly in a much higher class than B, F, and G that we picked above. In fact, F and G aren’t even in the top five, and other letters that show up often in English aren’t placed very high in the combined final puzzle data. This is probably the result of producers fine-tuning their answers over the years, either to avoid the letters contestants chose most often or to more evenly distribute the winning ones.

This is such a small data set, however, that we shouldn’t rely on it too heavily. After all, Wheel of Fortune has been on the air for twenty-six years, and we only have half a year’s worth of data, or around 2% of all that is available. But a small attempt at analyzing this data is probably better than going in blind and picking letters that you ‘think’ show up frequently.

There are other ways that this quick-and-dirty analysis can be improved. Mine is a pretty naive approach. Going over some basic rules of English might help to improve the method. For example, breaking the final puzzles down into phonemes could yield more information, as might looking at letter pairs instead of single letters. For instance, Q never occurs without U, and some letters are more common after others. This is especially useful in our task, as we need to choose three consonants but only one vowel. Consonants are most often followed by vowels, so consonant pairs increase the uniqueness of a phrase. P is often followed by R, L, or H, for example. Looking for patterns in the words themselves might also yield better predictions about what letters would be better to guess.

Another thing to realize is that these numbers are averages from a discrete set. Some puzzles might include the high-frequency letters and be solvable with only those (and RSTLNE), while some might not include a single one of the high-frequency picks. Picking from one of the high scorers might improve your odds of getting more letters, but it doesn’t guarantee that you’ll get some, or even any. You might wind up with something like ‘Blind Luck’, which doesn’t contain an O or an H. These estimates can help you, but only so much.

So, after all these calculations, I now know what I would do if I ever found myself in Wheel’s final round. I’d go for H, G, and B (G and B having been arbitrarily picked over F), and then O as my vowel. And maybe I’d win big. Of course, the biggest factor in all this is your ability to manipulate letters and words in your mind. That’s one subject in which I lack skill, as evinced by the Boggle-solving program I wrote (a story for another time). So I might tank, even if my statistically-chosen letters filled out quite a bit of the puzzle. A lot of it does come down to luck, which was probably the producers’ intention all along.

Your Punk Rock Friends

Friday, July 2nd, 2004

Current Listening: Swingin’ Udders — “Next in Line” (Fat Music Vol. 3: Physical Fatness)
freedom’s the only thing you need but the truth is something few understand and an unwelcome reality now it’s dark and black and sad and gone you express and repress the thing gone wrong

I just got an e-mail about my article on the Nerds With Instruments website, Dave’s Ten Punk Tips. This letter was of course filled with hatred because they thought I ‘didn’t get it.’ If the person had actually read the essay, he might have found that I was being sarcastic. So far, I’ve gotten about 15 hate-mails, and 1 message from someone who ‘got it.’

So, being the punk expert I am, I have decided to create a guide to punk rockers. As always, send comments to nirvanasongs @ yahoo.com!

The Old-School Punker

hardcoahicuh imbelisus

The epitome of punk rock. No job, no respect for authority, can barely speak without drooling over everything. These guys hate everything. Unemployment, employment, the government, anarchy, everything. The only discernable skills they have are the ability to sneer for hours on end. They only go to shows to say how terrible punk rock has become. They don’t own any records released after 1985. If a band signs to a label that most people have never heard of (i.e., Epitaph, Fat Wreck Chords, Hopeless), then they immediately hate the band, even if they were its bigger fan before.

The Hot Topic Punk

gothicus lame

Covered in tattoos, piercings, and eye shadow, these punks live a twisted, troubled life. Mainly from the ass-whoopings they receive at the hands of the Old-School Punkers. These punks have a lot in common with typical goths, except that their self-hatred is only feigned. See, some goth found out a long time ago that girls with low self-esteem and scars on their wrists would sleep with him if he acted depressed and deep, too. Now, goths really feel that way, but the Hot Topic Punk only feels that way when he sleeps with one of the said goth girls and finds out that he got some new, interesting, collectible venereal disease.

Whereas Goths are generally sincere, this species really couldn’t give a damn. They listen to AFI, in an effort to look cool. When asked why they like that type of music, they generally reply, ‘because it’s so deep.’

The Skinhead

docmartenicus humongicus

Never weighing less than 300 pounds (all muscle), these punks are the behemoths of their class. Contrary to popular belief, not all skinheads are white power idiots – most of them are just idiots. They bray on and on about being working class, despite the fact that the bands they listen to generally stay in four-star hotels and only interact with the working class when they want a Big Mac. These guys don’t consider a mosh pit to be cool unless bones are breaking and blood is flowing.

The Emo Brat

cryingabouteverything withtheirstupidglassesola

This species orginated when the thin, whiny kids who used to hang out with the jocks realized they couldn’t get any because they did not run around like big idiots and try to ‘score’ with big, muscular men. So they decided that they would become introverts and cry about everything.

Whereas the Hot Topic Punk at least is willing to pierce himself to get laid, the Emo Brat only puts on stupid, thick-framed emo glasses. Their haircuts, moussed and sometimes spike, are vestiges of their jock heritage. They spend most of their time on weblogs, writing about how their (often) imaginary girlfriend just dumped them and writing stupid, stupid poetry about it. They like to wear workshirts too and bray about how they’re ‘so totally individual’, despite the fact that every one of them listens to Thursday, Thrice, and other such bands with stupid names.

These punks often keep journals about their suffering, and whine about never getting jobs, despite the fact that they refuse to work a day in their lives. Most are in college, and try to justify their bad grades with excuses ‘depression.’ But they’re not fooling anybody.

High School Punks

punkrockus knowitallis

The worst of the lot. These kids are whiny, know-it-alls, and trendy as hell. Their lyrics are sophomoric, trite, and often about girls. They play shows with their screaming high school friends and record demos with money that their mommies and daddies gave them. They often get expensive guitars and Marshall stacks as birthday presents, and if not they can afford to buy them because they don’t have real expenses, like rent/car payments.

Fortunately, this is a short-lived species. After about two years, they realize how stupid and idealistic they were, and either give up music for real work or turn into a crusty Old-School Punk.

Remember, nobody is as punk as me, nobody.

Questions, comments, disagree? E-mail: nirvanasongs@yahoo.com.

Me The Woman

Wednesday, June 30th, 2004

Current Listening NOFX – “The Decline” (The Decline)

I wish I had a schilling, / For every senseless killing, I’d buy a government. / America’s for sale / And you can get a good deal on it / And make a healthy profit

Somebody mistook me for a woman today. Someone called, asking for my dad, “Steve Short.” I said he wasn’t home, and they asked if I were “Mrs. Short.” Now, last time I checked, I had gone through puberty and my voice sounds like a man’s, at least enough like a man’s for the raging sissy-boy I am.

Of course, this isn’t the first time this has happened:

It all adds up…we feel 16% certain that you are…
A Woman!
Compared to others…


70% more male than you6% like you24% more female than you

TheSpark tells me that I’m a woman; in fact, there are only 24% of people who’ve taken this test who are more womanly than me. This means that either 1. an army of short-haired, boot-wearing, man-hating she-males has taken the test or 2. I am a nancy boy. I tend to agree with the second conclusion, mainly because I’m sure that valley girl, makeup-ensconsed, prissy teen queens use TheSpark. And me.

So, in order to combat my unmanliness, I have come up with this six-point plan to combat my sissiness:

1. Watch More Sporting Events

Since I was a child, I have been horribly deficient in the watching-other-people-have-fun category. To my knowledge, there 156070 x108 activities I would rather do than watching sports. Call me crazy, but I find nothing entertaining about a bunch of grown men running around in tight clothes and tackling each other. Sexy, maybe, but not entertaining.

2. Stop Asking Directions

I know this is a stereotype, but I’m not taking any chances. From now on, I will pick a direction and keep driving that way, never giving up or admitting I’m wrong or lost, no matter what, even if I’m going to New Mexico and I can see penguins out the window.

3. Start Eating Meat

I’ll level with you all. I stopped eating meat to get chicks. It’s a great conversation starter! But it’s just not manly. especially here in Montana, where everybody, even the girls, hunt and kill deer.

4. Start Working on Cars

This might be difficult, because I don’t have a car of my own and I’m terrified to touch my parents’ cars. So I figure I can start working on other peoples’ cars — people I don’t evne know. I’ll be like the car fairy, flitting from hood to hood, initially damaging the cars I tinker with but eventually being able to do some sort of repair, until I get shot.

5. Start using the word ‘fag’

Nothing shows how manly I am more than throwing hateful phrases at others because of my own deeply-hidden homosexual tendencies!

6. Start grabbing the breasts of random women

I’m really looking forward to this one.

7. Build Things

The only things I’ve ever built involve Legos. I want to be able to create monstrocities, things that can destroy major metropolitan areas.

And, most important of all:

8. Stop Writing in a Blog

I mean, c’,mon!!! It’s basically a diary, right?

PS — Dear diary! Today I ran into Judy Armstrong, and she is SOOOOO HAWT!!!1!!!onehundredeleven!1!!1 I hope she asks me out, but I just can’t wait… I’m sooo sad!!! LOLOLOLOL!!!

Top Ten Albums of 2002: No Use For a Name – Hard Rock Bottom

Friday, June 13th, 2003

The Top Ten Albums of 2002

#9 No Use For A Name – Hard Rock Bottom

Hard Rock Bottom is a poppy CD with a fresh aftertaste, kind of like Colgate compared to Western Family brand toothpaste. Sure, the Western Family cleans your teeth, but it also makes your mouth feel like you’ve been sucking on an eighty-year old mint from grandma’s candy dish. NUFAN does the pop-punk thing, but they do it right.


I have their last album, Making Friends, but I wasn’t really too impressed with it. The drumming was monotonous (it was waaaay too fast; the bass drum sounded like the ticking of a hyperactive clock) and none of the songs really stuck in my head, except for the Celtic ballad “Fields of Athenry.” I pretty much gave up on NUFAN until I heard their song on Fat Music 5, “Let Me Down.” That song was awesome: the hooks, the harmonies, everything. Seeing them live at the Warped Tour this year convinced me to give NUFAN another go.


So when I heard about their new disc I decided to give it a whirl. Pleasantly, Hard Rock Bottom more than made up for the shortcomings of Making Friends. Yes, there are still some songs that have super-fast kick drum parts, but they share time with slower, more thoughtful songs, like the opening track, ‘Feels Like Home,’ which lacks percussio althogether. That first track is bare minimalism: just frontman Tony Sly’s voice and a clean electric guitar. It seagues into ‘International You Day,’ a somewhat cheesy song with poppy lyrics: “Without you my life is incomplete / My thoughs are absolutely gray.” Right, Tony Sly.


And therin lies my only real complaint about the album: the lyrics. Usually, NUFAN has some awesome lyrical lines behind their music, but there were some real stinkers on this album. For example, in ‘International You Day:’ “Nothing that I’ve tried is as simple as this line.” C’mon, a meta-reference in a love song? Another example, in “Pre-Medicated Murder”: “More times than five, I’ve been right here by your side.” Yuck. What does the number five have to do with anything? I have no extreme problem with the poppy songs, which dominate on this release, but some of those lines make me want to bang my head against a wall, and not in that ‘fuck society’ type of way.


But, aside from that minor quibble, this album rocks. The band was even brave enough to include an orchestra on the introduction to the aforementioned ‘Pre-Medicated Murder’, and an organ on the intro to ‘Any Number Can Play.’ That song seems to be a thinly-veiled attack on Top Forty Radio, which I’m all for. I could seriously see No Use next to Sum-41 or Blink 182, and I mean nothing bad by that. These guys have talent. They’d have to add a number to their name, though (maybe “No Use For A 412?”).

The standout track is definately the duet ‘This is a Rebel Song”, which is a cover of a Sinead O’Connor tune. Why didn’t Tony have the guts to sing this himself, though? Too shy to croon ‘I love you my hard Englishman,’ Mr. Sly? I’m being facetious, though. It’s a lovely number, replete with awesome harmonies.

Then there is ‘Insecurity Alert,’ one of those songs that reeks of post-9/11 sympathy. Those songs suck; I think America needs to get over what happened to those planes, instead of wallowing in musical sympathy. I actually like this song, though. It’s not whiny, nor is it filled with accusations of conspiracy. It asks us to question what happened — in a good way — and to question America’s reaction, especially toward the Islamic: “Set up the guillotine and televise the execution, we have to ask ourselves, ‘Can we feel safe?'”. That song is the only overtly political tune on the disc, and I’m glad for it. If I want a number of political songs, I’ll put in my copy of Underground Network.


This disc could definately become one of my favorites. Sure, some of the lyrics could have been written in a high-school creative-writing class, but others are purely brilliant (“And all the happy pills make her look like a cardboard cutout of someone I used to learn from”). The musicianship, although at times a little too fast, is interesting and a nice alternative to the all-too-happy sounding pop-punk camp. The harmones rival those of Bad Religion or Reel Big Fish, and the CD is exactly the right length: a little over half an hour. Just enough time to ride my bike around the neighborhood and harmonize with all the songs, to the bewilderment of passersby. And to me that’s the ultimate test of a band: do their songs make me want to sing along?