Kip

How to win at hangman

Written by Kip on Saturday, May 22, 2010 at 11:24 am (EDT)
Tagged as:

Last week Stephanie and I were discussing the game of hangman. I commented that “rhythm” and “myth” are good words because the only vowel is y, and most people try to find the vowel first. I wondered what might be the best possible words.  When I remembered that I’m a programmer, I said “hey, I can write a program to figure this out!” And since I haven’t posted on this blog in quite a while, I thought I’d share.

I found a list of 58,112 words and got to work. I decided to first count the frequency of each letter in the word list.1 I figured that the probability that a letter would be guessed is approximately equal to the frequency of that letter in the language. This could be a bad assumption, but it’s all I had to work with. Then I computed a score for each word by averaging the frequency of each letter in the word. I don’t know that this is the best way of measuring the difficulty of the word, but it’s the best one I could come up with.

Here are the words with the lowest scores (and therefore the most difficult hangman words, according to my algorithm):

fuzz     1.28%
fuzzy    1.37%
buzz     1.39%
why      1.57%
by       1.79%
jazzy    1.95%
jazz     2.01%
huffy    2.02%
buff     2.03%
huff     2.10%
jug      2.17%
jumpy    2.18%
puffy    2.18%
my       2.20%
hubby    2.20%
muff     2.23%
jump     2.29%
puff     2.29%
buy      2.33%
foxy     2.36%

And here are the easiest:

see     10.55%
eerie   10.15%
ere     10.13%
nee     10.08%
sees    10.05%
tee     10.04%
ease     9.81%
eire     9.79%
seer     9.73%
seen     9.69%
eerier   9.67%
tees     9.67%
serene   9.60%
eases    9.56%
settee   9.54%
lessee   9.54%
eel      9.52%
seine    9.52%
seers    9.50%
eeriest  9.47%

While I was at it, I did some other searches on the word list.  Here are the 49 words that have no vowels besides Y:

by
cry
crypt
crypts
cyst
cysts
dry
dryly
fly
fry
glyph
glyphs
gym
gyms
gypsy
hymn
hymns
lymph
lynch
lynx
my
myrrh
myth
myths
nymph
nymphs
ply
pry
pygmy
rhythm
rhythms
shy
shyly
sky
sly
slyly
spry
spy
sty
styx
sylph
sylphs
sync
thy
try
why
whys
wry
wryly

Seventeen words contain all the vowels, including Y:

consequentially
counterrevolutionary
disadvantageously
facetiously
gregariously
heterosexuality
homosexuality
neurologically
neurotically
pertinaciously
precariously
precautionary
questionably
revolutionary
simultaneously
supersonically
tenaciously

And only two words contain all the vowels, including Y, in order:

abstemiously
facetiously

1 This is slightly different from the frequency of each letter in the English language. For example, “t”, “h”, and “e” probably have higher probabilities in the English language than in the word list, since “the” is used over and over in the language, but it is only represented once in the word list.
No Comments
Kip

Please if you make web pages or web apps you really need to know this please

Written by Kip on Wednesday, April 28, 2010 at 5:38 pm (EDT)
Tagged as:

Please if you make web pages or web apps you really need to know this please
A haiku by Kip Robinson

It is so easy
to make forms much friendlier
with the label tag

No Comments
Kip

Tying your shoe laces

Written by Kip on Tuesday, April 27, 2010 at 9:53 am (EDT)
Tagged as:

Last week I came across Ian’s Shoelace Site, which describes several ways of tying your shoes. It turns that there are several more ways of doing it than they teach you as a kid. The “Ian Knot” is a much faster and easier way of tying the standard shoelace knot.  And the “Ian’s Secure Knot” produces a secure knot (it won’t easily come undone through the day), but it’s better than the traditional double knot because you can still easily untie it by pulling the loose ends. I’ve been using these for a week now and it’s a pretty nice timesaver that I thought I’d share with everyone else.

No Comments
Kip

Personal goals

Written by Kip on Friday, April 16, 2010 at 2:42 pm (EDT)
Tagged as:

In the six years since college, I have put on about forty pounds and added about 2-4 inches to my waistline (depending on the brand of pants). I keep thinking eventually I’ll do something about it, but I keep putting it off. So I’ve decided I need to stop this infinite loop.  I’m going to start off with the goal of completely eliminating the following from my diet:

  • Soft drinks and sweet tea (pretty much any drink besides water and milk)

  • French fries

  • Ice cream

  • Cake and cake-like substances (this includes brownies and doughnuts)

Assuming I manage to keep to this, I will re-evaluate the list in a few months and maybe add other things I really shouldn’t be eating. I realize that regular exercise would probably be an ideal approach in a perfect world. But I’m pretty sure the odds of me continuing to exercise regularly for a long period of time are pretty close to zero. Maybe if I worked at a company that had a gym on-site there would be a 25% chance I would actually spend some time there, and a 7%1 chance that I would go regularly for more than a year. So I’m hoping that attacking the most unhealthy parts of my diet will pay off.

Now I must apologize for boring you with aspects of my life that no one but me could possibly care about. I’m hoping that I will be more likely to stick to it after making a public announcement.

1 48% of all statistics are made up on the spot
Kip

Album Thumbnail PHP class

Written by Kip on Tuesday, April 6, 2010 at 8:49 pm (EDT)
Tagged as:

You may have noticed that the thumbnails for albums on our photos page are each little collages. Here are some examples:

Well as of today I’ve received three requests for the code behind these images, so I figured it was time to write up a proper blog post about the it. I mentioned the code in 2006, and that it was inspired by this article from A List Apart. I took their idea and came up with several more layouts to use, and some code to generate the thumbnail from dynamic layouts.

The class takes four image files as input, and generates a thumbnail for them. It does have the annoyance that the generated images have varying heights. I’ve thought about writing a fancy “2.0” version of the code, using Javascript to position/crop/scale the images, then use PHP to render the final result. But who knows if I’ll ever get around to it.

For now, I’ll just show you how it’s used. It’s very easy:

1
2
3
4
5
6
7
$at = new album_thumbnail();
$at->add_image('/images/001.jpg');
$at->add_image('/images/002.jpg');
$at->add_image('/images/003.jpg');
$at->add_image('/images/004.jpg');

$at->make_thumbnail('/images/thumb1234.jpg');

On my admin page, I initially pick four images at random from a given directory. I can then try again with four more images, or specify to keep some of the images and pick random images for the others, or I can specify the ids of all the images I want to be used. That part is left as an exercise for the reader. Without further ado...

View the source code here.

Kip

Emma is two years old!

Written by Kip on Monday, March 29, 2010 at 11:20 pm (EDT)
Tagged as:

It’s hard to believe it, but it has already been two years since Emma was born. I just posted a bunch of photos from her second birthday party, which we held on Saturday. Enjoy!

No Comments
Kip

Photographing the moon

Written by Kip on Saturday, March 20, 2010 at 2:22 pm (EDT)
Tagged as:

As I mentioned a few months ago, we got a new digital camera for Christmas.  I was curious to see how it would perform taking pictures at night, so I waited until a clear night with a full moon and took a few photos.  Below is a comparison with a picture I took during the lunar eclipse in 2008.

Comparison of moon photos on old camera and new

Now, this isn’t exactly a fair comparison. The exposure on the first picture was too long, and it’s grainy because it was using a higher ISO setting. Maybe I’ll try to do a fair comparison sometime, but I doubt I’ll get around to it. I’m not even sure if I can fully specify the settings manually on my old camera.

One thing I don’t understand is why the size of the moon in the two photos is so similar, given that one camera was 4 MP, and the other was 15 MP. If the images are taken with the same focal length, and the moon is 89 pixels wide in an image 2304 pixels wide, then in an image 4752 pixels wide the moon should be 184 pixels wide. But it’s only 112 pixels wide. Now, that would be true if they are the same focal length, but according to the metadata the 4 MP image is 18mm, and the 15MP image is at 55mm, which is more zoomed in, so the moon should be even more than 184 pixels wide.

My best guess as to the reason is that the old camera has a much smaller sensor that records the image, so an 18mm focal length is a much higher zoom. I’ve seen the term “35mm equivalence,” and I’m not 100% clear on what that means, but I think that’s the difference here. The focal length isn’t the only factor to be considered. I think this means that the new camera has a much wider field-of-view than the old one, but I could be wrong about that too. One of these days I might get a decent telephoto lens; I’d definitely get a much larger moon that way.

Before I go, here are two other pictures I took with the new camera the previous night, when it was a little cloudy.

Photo of the moon behind clouds

The next one was interesting because I used a long exposure and I was zoomed out, and I got a lens flare from the moon, which I thought was cool.

Photo of the moon with lens flare

No Comments
Kip

Geronimo Jack’s Beard

Written by Kip on Thursday, February 18, 2010 at 3:35 pm (EST)
Tagged as:

I thought I’d point you guys to Geronimo Jack’s Beard. It’s a podcast about Lost from Jorge Garcia (Hurley) and some girl named Beth (I think she’s Jorge’s significant other, or maybe she’s just a friend; she’s not one of the actors though). They recorded these podcasts after initially reading the scripts, but they are only releasing them as each episode airs (for obvious reasons). It’s interesting because Jorge is just as confused as the rest of us, even though he is on the show. They are only doing it for this season, so there’s only three episodes out right now if you want to listen to them all.

No Comments
Kip

Compact 2010 Vancouver Olympics TV schedule

Written by Kip on Friday, February 12, 2010 at 12:39 am (EST)
Tagged as:

I’ve created a compact (fits on one page!) version of the 2010 Vancouver Winter Olympics TV schedule. (Similar to the one I made for the 2008 games.)  And, like last time, I thought it’d be polite to share it with the world.

You can download it here (PDF format)

A few things to note:

  • Times were retrieved from nbcolympics.com, on 2010.02.12. They are subject to change.

  • Times are for east coast United States time zone. They’re also in military format to conserve space and avoid ambiguity.

  • I don’t care about hockey, and there are a ton of hockey games, so I didn’t include them. If you’re into hockey this isn’t for you.

  • Whatever aired on NBC from 8pm to midnight is usually re-aired at 1:30 am that night. I didn’t include that on my schedule.

  • Some of the curling events are probably re-airings of the same events, but I’m not sure. I left out some that I thought were re-airings which might not have been. But does anyone really need to watch more than an hour of curling every four years? Just pick one hour, watch it, comment about how it’s such a weird sport and the people look so funny with their brooms, then forget about the sport entirely until the 2014 games in Russia.

  • Universal and Universal HD air stuff nearly every day, but it looked like it was all recaps so Ieft it out.

  • This was a bit tedious so it’s quite possible I made a typo or two.

  • Feedback always welcome

Kip

More thoughts on Pandora

Written by Kip on Wednesday, February 10, 2010 at 7:10 pm (EST)
Tagged as:

A little over a year ago, I posted my impressions of Pandora, the free online radio station website thingy. At the time, I was liking it, though after a while I started losing interest and stopped using the site.

Last month, I saw a cartoon about Pandora on Hijinks Ensue. The cartoon hit on a problem I also had with the site. I left the following comment there, which I thought was interesting enough that I’d share it as a blog post.

Kip: I like Smashing Pumpkins and Nirvana

Pandora: Hey, you must love Red Hot Chili Peppers!

Kip: No, really I don’t. Well OK, I like Under The Bridge, but most everything else is thumbs-downed.

Pandora: Great, so you wanna make babies with RHCP! While I keep playing them, I bet you like Foo Fighters too.

Kip: Yes, actually I do like them a lot

Pandora: Great, so you like any alt-rock from early-to-mid 90s. I bet you love Alice In Chains!

Kip: Can’t stand them

Pandora: I’ll keep a few more Alice In Chains songs in rotation in case you needed 15 years for them to grown on you. How about some Soundgarden?

Kip: Please stop

Pandora: Candlebox?

Kip: Okay time to stop

Pandora: Here’s another Chili Peppers song since you love them so much

No Comments
RSS feeds: Kip's - Stephanie's - Both
Admin