Latitude/Longitude lookup

I’ve been needing to lookup the geo-coordinates of a number of places lately, and couldn’t really find the perfect solution for what I needed; MapQuest is from 1995 and none seem to provide a bounding box. I have to say that the Yahoo Maps AJAX API is dead simple, and making my own only took a few minutes. Click the following picture to open the finder in a new window, then resize/drag/zoom to find your location:

Or, if you’re afraid that I’m making you change your popup preferences so that I’m IN UR BROWSER KILLIN UR D00DZ, you can also find the project here: And the source.

How many taps in a URL

Since I’ve started using my mobile phone more often for web browsing I have become painfully aware of how many damn key presses it takes to enter some of my favorite URLs. It’s great that so many sites are offering stripped-down versions for quick mobile browsing, of course with the added expense of entering the URL. This sort of thinking led me to ask, how many taps does it take to get to a website?
Multi-tap is the method by which many mobile users interact with their phone. Each letter is entered by tapping a given key a number of times corresponding to the letter on that key. For instance, the letter ‘S’ would be entered by pressing the 7 key four times. I have developed a system to calculate the tappage for an arbitrary string. You can find it here:

In addition to the standard tap semantics, I add an extra tap for each time a key is repeated. This is because a repeated key requires that you either press a forward button (painful), or wait for the letter to register (painfully long). Also, since the tap dynamics for symbols vary from phone to phone, I set ‘.’ to one tap and everything else to 4 taps. So of course everyone is asking at this point: who has the shortest URLs?

After playing with this (highly addictive) tool for a few hours, I find the results to be really non-intuitive; some short things are long, some long things are short. I guess this is yet another dimension to consider when you are looking for a domain name.

Stopping comment spam with keystrokes

In response to the recent post by Simon Goodway, I threw together a simple implementation of the keystroke-approach to comment spam blocking:


It’s quick to install (one small file and one quick change to templates with a comment form). So far I’ve seen a 100% decline in spam, so much so that I’m thinking about turning off Moderate and going old-skoole with my comments.

If the spammers figure out the field I’m using, it’s trivial to change, and could even be automated. There are a number of ways to make it more difficult for spam purveyors, but my thought is that this 5% added difficulty will never be worth their while.

The final presidential debate

image courtesy of cnn.comThe third and final presidential took place tonight, and while I felt undecided on the results, an early CNN poll gave Kerry a substantial margin with a 59% to 39% victory over Bush. But first, a few words from our candidates (thanks to Microsoft Word):

Kerry in 100 words: 82,000 Arizonians lost their health insurance under President Bush’s watch. This president has turned his back on the wellness of America. President Bush has taken — he’s the only president in history to do this. 6 million jobs lost. This president has taken a $5. Once again, the president is misleading America. The president just said that government-run health care results in poor quality. The jobs the president is creating pay $9,000 less than the jobs that we’re losing. 6 million jobs. The president has denied 9. Let me pay a compliment to the president, if I may.

Bush in 100 words: My opponent talks about fiscal sanity. You voted to increase taxes 98 times. Most health-care costs are covered by third parties. If you have a child, you got tax relief. If you’re married, you got tax relief. If you pay any tax at all, you got tax relief. We passed tax relief. We’ll increase federal spending. We’ve increased funds. The people I talked to their spirits were high. My opponent, the senator, talks about foreign policy. I think people understand what she’s saying.

Kerry’s language in this debate focused on three phrases: minimum wage (8 mentions), health insurance (6 mentions), and social security (6 mentions), a recognizable platform for a democratic candidate.

Bush’s language on the other hand was less issue focused with the most popular phrases of my opponent (7), four years (6), and best way (5), a seemingly more defensive tone.

My personal reaction to the debate was that Kerry seemed overly repetitive and slightly less focused on the questions at hand, bringing terrorism and foreign policy into the debate too often when the focus was supposed to be on domestic issues. The CNN poll found however that viewers raised their opinion of Kerry more during the debate than Bush:

When asked who would handle domestic issues better, Kerry scored higher in health care (55-41). There was no clear leader on the economy (Kerry 51, Bush 46), education (Kerry 48, Bush 47) or taxes (Bush 50, Kerry 47). Kerry’s biggest win came on the question of who expressed himself better, where 61 percent of respondents chose him over Bush (29 percent).

I find it fascinating how bad my personal reaction is to the results of these political exchanges. After doing various forms of analysis for each of the debates, I feel like none of these methods have a predictive effect on the reaction of the voters. Or at least my reaction to the actual events and subsequent analysis seems to be contrary to the rest of the population. With that said, I guess it’s going to be a gripping election.

For more information on this analysis, please see analyses of the first presidential debate, vice presidential debate, and second presidential debate.

Presidential Debate Redux

bush and kerryI’ve rerun my presidential debate analysis (see analyses from the first presidential debate and the vice presidential debate) on the scripts of the second presidential debate. I’ve also updated the Debate Spotter to include the new text. But this time I’ve taken a slightly different approach to the analysis. Instead of some complicated weighting scheme, I’ve decided to use a very simple technique to sort the phrases for each candidate:

  • Count the number of phrases for each candidate
  • Score each phrase as the difference between the number of times each candidate used the phrase
  • Favor longer phrases in sorting

The results follow, and I think you’ll find them much more revealing than the previous lists. I also fed both candidate’s transcripts into Microsoft Word’s AutoSummarize feature to produce a sub-100 word summary. The results are… umm… compelling. From my perspective, it seems as though Kerry is on the offensive, and Bush is backpeddling. But of course that’s just Microsoft’s take on the debate. Click on the following links to download the source Word documents. I’ll leave running the grammar checker as an exercise to the reader.

kerry041008.doc bush041008.doc
Continue reading

Vice Presidential Debate Analysis

Akin to my last entry, I’ve run the transcript of the Vice Presidential Debate through a part of speech tagger and identified the most popular noun phrases for each speaker (listed below). I’ve also updated the Debate Spotter to handle both scripts. Simply change the debate field and the transcript and speakers will be changed accordingly.

Have fun, and of course let us know if you identify any interesting phrases.

Continue reading

Presidential Debate Analysis

Whenever I watch a televised debate, I always wonder what percentage of the speaker’s message is actually thinking on the feet and how much is canned material. With the advent of available transcripts, these sorts of questions can be addressed with various computational methods.

A simple way to identify repeated statements is to count the number of times a particular noun phrase is metioned. Noun phrases act as both a proxy to the subject matter of a given piece of text, but also the way in which things are worded.

For this simple experiment, we’ll need four tools:

The results are quite interesting. Looking only at noun phrases of at least 2 words occuring at least twice for a given speaker, we arrive at some spectacular catch phrases. For Bush my favorite is “hard work,” which he said repeatedly. Apparently Bush thinks that the world is a difficult place to be. For Kerry, a salient phrase was “war as a last resort.”

The top 25 phrases for Bush and Kerry follow. The number following each phrase is a rank described by the length of the phrase and the number of times it appeared.

There are so many other types of analysis that could be run on these data. If you find anything interesting, please let me know. Also, the Debate Spotter allows for any query, so post any interesting phrases that you find.

Update: I have also analyzed the Vice Presidential and the Second Presidential debates.
Continue reading