Old Man’s War, by John Scalzi

April 28th, 2008
So when you turn 75, you join the Space Defense Forces. Kind of strange–the colonies only want people who’ve been around a bit. At least our intrepid hero is smart enough to realize that if it’s a two-year commitment that the SDF can decide to renew up to 10 years, that you’re really in for 10.Old Man’s War takes us through a shooting gallery in space between humans and everyone else. We get to see the world through the eyes of John Perry, a 75 year-old green recruit who is getting his first taste of life off earth. Mostly, it wants to kill him.It’s fun watching John grow throughout the book.

Online games

April 21st, 2008

If you have young children, you may have found that some of the popular sites for TV characters have simple online games.

It looks to me like these games are contracted out to separate companies.  Even within a site, the games have different artwork (for the most part, although the main characters seem to be consistent, so those must be supplied by the main company).

One game had music and sound effects that wouldn’t have been out of place in an 80s arcade game.  Amusingly,  one of the lines by the main character had static in it.  Apparently they hadn’t bothered to clean up their original recording, since digital music won’t introduce static.

Palm OS Development

March 21st, 2008

If you are interested in developing for Palm OS, then you probably want the Palm OS Development Suite (now called the Garnet OS Development Suite…the initials mean something, I’m sure…)

After some searching, this appears to be the correct link: http://www.accessdevnet.com/index.php/Garnet-OS-Development-Suite/View-category.html

Cursor’s Fury, by Jim Butcher

February 9th, 2008
I’ve really enjoyed this entire series. The main two protagonists, Amara and Tavi, are complex characters. Amara has conflicting loyalties, and Tavi is unique.In this world, everyone has furies. Furies are like elementals–they come in the four standard usual forms plus metal and wood. Tavi is the only one who doesn’t have furies. This book centers around Tavi who ends up leading a Legion to protect the Aleria Imperia against an attack by the Canim (huge intelligent, long-lived creatures that rival fury crafting warriors).

Amara is one of the First Lord’s spies, and her conflicting loyalties are tested again in this book.

iPhone SDK

January 20th, 2008

Some people have developed an iPhone SDK through some serious hacking.

And in February, Apple is supposed to release their iPhone SDK. I’m excited–I am going to port Double Chess to the iPhone when I get a chance.

Genetic algorithms

January 15th, 2008

I decided to improve the weightings in my chess program, and I wanted to learn more about genetic algorithms.

The basic idea in genetic algorithms is that you have some population of solutions (weightings, in this case), you have an evaluation function, and you have an evolution or mutation function that takes the results of the evaluation function and a population and produces a new population.

My chess program uses 30 weightings–everything from weights for individual pieces to multiplication factors for material, space, center, and so on.

I hacked up a version of my chess program to allow weightings and to take two weightings on the command line and return a result: white wins, black wins, draw, or moves exceeded.  I added an absolute limit of 100 moves for each side because a better chess algorithm should win more quickly, and I didn’t want to wait forever while two poor algorithms wandered around aimlessly.

I wrote the overall control script in python.  Initially, it handled running and scoring a set of weights against each other.  I always include the existing hand-tuned weights as a reference.

The first pass at the script generated random weights.  None of these random weights managed to score better than my reference weights (no surprise there).  The scoring function I used was simple: (wins + 0.5 * draws) / (wins + draws + losses).  I didn’t include the “moves exceeded” category–I typically had either 0 or 1 moves exceeded across all games in a run.

A typical run would be: the 10 highest scoring weights from the previous run, set as the reference list, and 20 new sets of weights.  Each of the 20 new weights would play 10 games against the 10 highest scoring weights.  After each of the new weights had finished it’s 100 games, the list would be resorted (i.e. the new weight could bump one of the existing weights down).

The genetic algorithm worked by taking the ten highest scoring weights and randomly picking two distinct weights (the highest-scoring was twice as likely as the 10th place to be chosen).  Then, for each position in the weights, the algorithm would choose: a new random weight, parent A, or parent B.  I used a 30% chance of a new weight, 35% chance of A, and 35% chance of B.

The beauty of a genetic algorithm is that the results can quickly surpass the starting conditions.  On the second round of using the genetic algorithm, I had a set of weights that scored better than my existing weights.

I ran multiple rounds and eventually ended up with 5 sets of weights (including my initial set) that each scored best in at least one round of testing.

Let’s call these A-D, with E being the existing weight.

For final scores, I looked at how the weights performed across all rounds, using the same scoring function.  Then, I ran the five weights against each other and used those results as the final results (figuring these were the best, so that should be more important than how they did against random weights).

Final results:

1.  A, B

2. C, E

3. D

A and B were essentially identical in results, although the weights are dramatically different.  A and B actually tied when run directly against each other and were 1 point different overall against the best 5.

C beat E itself by 1 point and otherwise was approximately the same as the existing weights.

D lost to all the other algorithms.

So, genetic algorithms and a few rounds (12 rounds of genetic algorithm total) produced two weight sets that are better than the existing one, and one that is equivalent.

Baby on board

January 13th, 2008

The old “Baby on board” signs failed because they were too small and the warning wasn’t worded correctly.  Parent know that the warning wasn’t to let other people know that a small child was riding in the car–it was a warning that a parent was driving.
The signs should have been 2′ per side.

The warning should have said:

Warning: sleep-deprived, barely rational, distracted parent in semi-control of giant speeding moving vehicle.  If you can read this sign, be afraid.

Diseconomy of scale

January 12th, 2008

Economists love to talk about the “economy of scale”–basically, the idea that a bigger company can produce things less expensively than a smaller company.

However, they don’t talk about the diseconomy of scale.  Let’s take software as an example, and Microsoft as our big company.  (Disclaimer: I don’t work at Microsoft, nor have I ever worked there.  This is hypothetical–Microsoft is used as an example simple because it is huge).  Diseconomy of scale means that there are projects which Microsoft is too large to even consider.

Imagine a piece of software that would have annual sales of $200,000.  Microsoft couldn’t even pay for the meetings to have this product approved for $200,000.  Therefore, Microsoft couldn’t produce this product because of the diseconomy of scale.

However, if an individual programmer could build and support this program, that would make a nice living (assuming it doesn’t require constant 100-hour weeks or anything).

Query letters

January 9th, 2008

I’ve been practicing my query letters. None of these is quite right for me, but if anyone wants to use them, feel free.

  1. Dear Agent. I want to write a book. Please Help.
  2. Dear Agent. You asked for a sample of my writing. The first word of my novel is “Seven” and the last word is “elephants”.
  3. Dear Agent. My novel, Debbie the extraterrestrial vampire does Gergovia, volume I, is a 435,231.7 word fantasy-science fiction-horror-erotic-suspense-mystery-thriller. It is the first of twelve volumes.
  4. Dear Mr. or Mrs. Agent-person. My novel, Luke Potter and the Death Star Goblet, is a combination of Harry Potter and Star Wars. Luke Potter is orphaned on a desert planet. When he comes of age, he is invited to attend the Imperial School of Magic on Hogsucant. He is transported there on an Imperial Star Broom.
  5. Dear Agent. I have written a wonderful new book. It will appeal to children. And dogs. Maybe cats, but definitely not parrots. Oh, and the elderly will love it. And middle-aged people. And the in-betweeners. Possibly babies. And anyone who likes to read. It may even prompt people who don’t read to learn how, just so they can read my book!

Music player phrase book

January 8th, 2008

This is a cool idea–you can use your music player (iPod, iPhone, Treo, whatever) as a phrase book.  You can buy pre-built CDs for standard languages.  iSpeak is one series, but it only covers a few common languages.

What if you want to learn Irish?

If you search the web, you can find audio samples of many languages.  Collect a set of those and categorize them.  You can also add longer samples to practice your listening comprehension.

Then, use the song’s metadata to place the samples into categories and sub-categories.

For example, you can map Artist to Category, Album to Subcategory, and Song Title to the actual phrase.

Here’s an Irish example, assuming that you have an audio recording of “dia dhuit”, the phrase meaning Hello.

Artist: Basic Phrases

Album: Greetings

Song: Hello

On your music player, you would browse through artist and album, then tap “Hello” to hear the pronunciation.  Instant phrase book!