Archive for April, 2007

More on Flash Video…

Monday, April 30th, 2007

My brother mocked my use of ffmpeg to create flash video as I did a couple of days ago. He sent me this set of command line options for the Swiss Army knife of video encoders: mencoder. I went ahead and encoded the classic civil defense film “Duck and Cover”, and then used the flvtool2 to add indexing.

Here is the result:

Here is a little shell script that shows the options. I used mencoder as installed fresh from a new Fiesty Fawn Ubuntu installation. If you install rubygems, you can then type “sudo gem install flvtool2″ to get flvtool2 installed (it is in /var/lib/gems/1.8/bin/flvtool2, which is not in my path, but it’s there), and it seems to work well too.

Anyway, Kevin wanted me to test it, and it seems to work.

Overpass Collapses, Many People Annoyed for Months

Monday, April 30th, 2007

I dropped in at work over the weekend (we are in the final death throes of production on Ratatouille, so I’m basically doing 7 days a week for the next couple of weeks) and noticed that the traffic along 80 was pretty bad. I didn’t think too much of it, but apparently the cause was a collapsed overpass very near Pixar. A tanker truck apparently exploded and burned on one of the overpasses, and the deck above it collapsed. It’s quite the mess, and will likely take months to fix. I went over to an adjacent overpass and took this photo. It’s ugly. Really ugly.

Struggling with Milhouse…

Thursday, April 26th, 2007

My checkers program has developed some annoying quirks (read: bugs) and I haven’t made any good progress in figuring them out, except to assertain that most of them appear to be centered around the use of transposition tables (when I disable the transposition tables, my program is much better behaved). Because I didn’t know what was wrong, the code has been mangled in a way I don’t like. Oh well. Rather than mangle it further, I thought I’d dig up some more reading material. The links o’ gold today are T. A. Marlsand’s older papers, including a review on game-tree pruning that seems to answer many questions. Good stuff.

Oh well. I’ll work on it this weekend.

Micro-Max, a TEENY chess program

Tuesday, April 24th, 2007

During my lunchbreak, I ran across this miniscule chess program. Very, very neat.

Micro-Max

More links on search and computer game playing

Monday, April 23rd, 2007

Bruce Morleland has some excellent stuff on his Computer Chess page, including some details on transposition tables that seems useful.

Historic Paper on Transposition Tables

Monday, April 23rd, 2007

Today was a miserable day for my checkers program. I suspected that some of the cases that were causing me some difficulty in the puzzles that I have attempted to date were caused by some problems with my alphabeta search. To resolve this, I coded up some simpler versions and a simple version of minimax. Indeed, I found that these worked reasonably well, but that my transposition table code bolluxed things. I obviously didn’t have the brain cells firing on all cylinders, so here it is, 12:35AM and I’m scanning the web for papers that might help. I found that Zobrist’s original paper on transposition tables was available for download.

Here it is: Tech Report TR88

[tags]Computer Game Programming, Checkers[/tags]

The Internet Movie Database

Monday, April 23rd, 2007

I didn’t realize that the data for The Internet Movie Database (IMDb) was available for download as plain text files. Did you?

Thanks to the Foxmath blog for pointing this out to me.

Progress with Milhouse

Saturday, April 21st, 2007

My Checkers Program is Not Endorsed by the SimpsonsMy checkers playing program milhouse is currently advancing at a good clip. I’ve added iterative deepening and a transposition table, and probably will add a history heuristic for move reordering to improve the search further. I’ve also started typing in a bunch of problems from Pike’s Little Giant Encyclopedia of Checkers Puzzles, and used them as test cases. It’s able to solve lots of them, but also stumbles on a few. I’m not certain that the basic alphabeta framework is completely bugfree (in fact, I’m pretty sure it is not) but it is still somewhat gratifying to find it solve problems like the one below:

EXECUTING PUZZLE From D. Oldbury, WHITE TO MOVE FIRST
        +--------+
        | - - - -|
        |- w r R |
        | - w w -|
        |r w w - |
        | - w w R|
        |r - w - |
        | - r w -|
        |- r - r |
        +--------+

1.      ...     27-24 [10001]
2.      20x27 [-10001]
2.      ...     14-9 [10001]
3.      7x14 [-10001]
3.      ...     15-11 [10001]
4.      1x10 [-10001]
4.      ...     11-7 [10001]
5.      13x6 [-10001]
5.      ...     18x2 [10001]
6.      25x18 [-10001]
6.      ...     23x14 [10001]
7.      10x17 [-10001]
7.      ...     19-16 [10001]
8.      3x10 [-10001]
8.      ...     2-6 [10001]
9.      12x19 [-10002]
9.      ...     6x13 [10003]

        +--------+
        | - - - -|
        |- - - - |
        | - - - -|
        |- - - - |
        | - - - W|
        |- - - - |
        | - - - -|
        |- - - - |
        +--------+

transposition: 61096470 lookups, 7241926 finds,
    53839352 stores, 1048576 entries

[tags]Checkers,Programming[/tags]

Lennart Augustsson on Automatic Differentiation

Thursday, April 19th, 2007

Lennart has a nice writeup on automatic differentiation in Haskell. I keep trying to come up with a reason to learn more about Haskell, and examples like this (which are difficult or at least less understandable in C or C++) go quite some way in convincing me that I should invest the time to understand how lazy, functional, polymorphic languages like Haskell can change the way I write programs.

[tags]Programming.Haskell, Automatic Differentiation[/tags]

Cat on video…

Thursday, April 19th, 2007

Caught Sam’s cat on the wireless webcam, but mostly this is just a test of the embedded flash player.

Addendum: Here is WP-FLV, the Wordpress Plugin you need.

Addendum2: You can create flash video using only open source, free tools. I took the AtomBomb1946.mpeg from archive.org, and then ran:

ffmpeg -i AtomBomb1946.mpeg -s 320x240 atombomb.flv

and then just created the viewer:

Nifty.

Baseball and Programming…

Wednesday, April 18th, 2007

Well, I had maxed my vacation time out again, so was forced to take a day off. Oh darn. My son and I decided to take the opportunity for a little daytime baseball. Despite some early fear that it would be cold and windy, it was only a little windy, but a very nice day at the ballpark. The Atheletics were battling the Angels, Haren vs. Lackey. Nice. Haren pitched a sweet 3-0 shutout, and Street got the save.

When I got home, I wasn’t up to figuring out what the problem was with my checkers program, so instead I revamped the program that I wrote that fetched the major league schedules to get more up-to-date info, and include the likely pitchers for
the current day. My idea is that this will run at 3:00AM or so, and save the info off into the /etc/motd file, and I can view it whenever I log in.

A bit of hacking, and this is what today’s lineup would have looked like.

------------------------------------------------------------
                MLB SCHEDULE FOR 04/18/2007
------------------------------------------------------------
04/18 10:05 AM  KC @ DET Meche (1-1) vs Bonderman (0-0)
04/18 12:10 PM BAL @ TB  Bedard (3-1) vs Kazmir (1-1)
04/18 12:35 PM LAA @ OAK Lackey (2-2) vs Haren (1-2)
04/18 04:05 PM CLE @ NYY Sowers (0-1) vs Igawa (1-0)
04/18 04:05 PM NYM @ FLA Maine (2-0) vs Willis (3-1)
04/18 04:05 PM PHI @ WSH Eaton (1-1) vs Bergmann (0-1)
04/18 04:07 PM BOS @ TOR Wakefield (2-1) vs Ohka (0-2)
04/18 04:10 PM HOU @ CIN Sampson (2-0) vs Harang (2-0)
04/18 04:35 PM CHC @ ATL Zambrano (1-2) vs Davies (0-0)
04/18 05:05 PM PIT @ MIL Maholm (0-2) vs Vargas (1-0)
04/18 05:11 PM TEX @ CWS Millwood (2-2) vs Buehrle (1-0)
04/18 05:35 PM LAD @ COL Lowe (2-2) vs Lopez (1-0)
04/18 07:05 PM ARI @ SD  Webb (1-1) vs Wells (0-1)
04/18 07:05 PM MIN @ SEA Silva (1-1) vs Hernandez (2-1)
04/18 07:15 PM STL @ SF  Keisler (0-0) vs Morris (2-0)

[tags]Baseball,Programming[/tags]

Why I don’t leave the ballpark early…

Sunday, April 15th, 2007

Oakland AthleticsIf you are one of those people who leaves the ballpark early, all I can say is shame on you. SHAME!

Today was an excellent example of why I don’t leave the ballpark early. After scoring two early against Andy Pettit, the A’s would eventually fall behind 4-2 going into the bottom of the ninth. When in the ninth, you see Mr. Automatic, Mariano Rivera, and he gets Chavez to ground out, and then Bobby flies out to deep right. If there was ever a time that heading to the exits might seem reasonable, this is it.

But instead, it turned into an example of why you stay till the last out.

Walker gets a single, and then goes to second on fielder’s indifference. After a good AB, Kendell fights off some high pitches and draws a walk. Up comes Marco Scutaro, who had 7 walkoff hits in his career. He quickly goes down 0-2.

And then hits one deep to left field, off the left field foul pole. Walk off home run.

That’s why I stay to the last pitch.

MLB - New York Yankees/Oakland Athletics Recap Sunday April 15, 2007 - Yahoo! Sports

[tags]Oakland Athletics,Yankees Suck,Marco Scutaro[/tags]

Today also happens to be the 60th anniversary of Jackie Robinson becoming the first African American MLB baseball player. I can’t decide whether we’ve come a long way, or we have a long way to go. Probably both.

Milhouse still has some confusing bugs…

Sunday, April 15th, 2007

Well, I’ve got my first trivial attempts at alpha-beta search working, and my confidence in the general framework that I had constructed was growing, when I discovered that there are some circumstances where milhouse (which mostly just plays itself at the moment) seems to forget which side it is playing, and moves red checkers when it should be moving white ones. I’m kind of baffled as to the cause. I’ll have to think about it some more. In the mean time, I have begun to consider what work I need to interface milhouse to the world at large: this mostly means understanding how to compile it to play with xchecker, and also to be able to read and produce Portable Draughts Notation files. I haven’t done any work on the former, but the latter is described in the following format description document:

PDN 2.0 Specification

[tags]Checkers,Programming[/tags]

Milhouse solves its first (trivial) Checker Puzzle

Saturday, April 14th, 2007

With white to have the first move, my checkers program was able to chart its way to a win for white.

Here’s the log.

It’s almost certainly chocked full of bugs, and is using a hideously childish evaluation function, and has no interface at all, but it’s making progress.

[tags]Checkers,Programming,Alpha Beta Search[/tags]

Gutenberg Gem: People’s Handy Atlas of the World

Saturday, April 14th, 2007

Sure, it’s from 1910, but it’s a free atlas. Maps are kind of cool. Enjoy.

People’s Handy Atlas of the World

From the People's Atlas

[tags]Public Domain,Project Gutenberg[/tags]