Archive for October, 2008

I suddenly switched to a new project. (Ever wonder why none of my projects ever get “finished”? I have project ADD.) Now I’m working on another quiz program. (I’ll be re-using bits of the Leitner method system I described in earlier posts.) This quiz program is for Go, though.

One of the most common ways to study Go is to look at “tsumego”, or “life and death problems”. Given some board position, the student has to determine what move to play in order to capture (kill) a group of stones, or prevent its capture (make it live). These problems can start out simple, so that any beginner can understand them, and end up heinously complex such that even a pro player would have difficulty discerning the answer.

My program is intended to help practice these “life and death” shapes in an incremental way, by memorizing simple shapes first, then memorizing what moves lead to those simple shapes, then memorizing more and more moves incrementally until one can simply see, at a glance, the correct move.

I’ve actually been spending more time working on my projects lately than writing about them, yay! I promise I’ll try to write more often, though. (At least if life settles down a bit.)

I’ve been working lately on implementing the “end-game protocol” for my Go server. The game of Go is a little odd in that there’s no concrete point at which the game is over. The object is to surround territory on the board, and when a player feels that all the territory on the board is solidly captured and well-defended, he simply passes. If both players pass, then the game is considered over.

After both players pass, there will likely be left on the board stones that could have been captured throughout the course of the game. The players will typically recognize that these stones are, in fact, “dead,” and remove them after passing but before counting the score.

It turns out to be rather difficult for a computer program to figure out which stones are “dead,” so servers where computer programs typically play don’t have any mechanism for removing dead stones from the board, since that would make things more complicated. The programs just tediously spend the time capturing all the stones, one by one, until all “dead” stones have actually been removed from the board through play.

This would be outrageously boring for human players to do. In fact, I don’t know of a single server for humans that requires them to capture all stones manually, like servers for computer programs do. (I think one of the Facebook Go apps did originally, but hardly anyone used it until they added a “mark stones dead” feature.)

Normal Go servers just have the players click on the dead stones to remove them from the board. Human players almost always agree on which stones are dead, but on the rare occasion when they disagree, most Go servers don’t have any way to deal with this. On KGS (one of the most common Go servers in the US), the players will typically ask a stronger player for help resolving the issue. The stronger player will take one glance at the situation, and tell the players whether the stones are, in fact, capturable.

This tactic works for human-versus-human matches, but obviously it is more difficult when there is a computer involved. How do you “convince” a computer that it’s wrong about the status of some troublesome stones?

For my server, I wanted it to work well for both human and computer program matches, so I had to devise a way to resolve disputes about dead stones. I ended up implementing a very simple approach—if after two passes, the players disagree, then play continues. If both players pass again, then all disputed stones are considered alive. This gives the player who thinks they’re dead incentive to actually capture the stones through play. If he cannot do so, then he will have to pass and the game will be over.

I now have this end-game protocol implemented and working well. Although it’s not going across the REST server yet, I’m able to play against GnuGo and successfully resolve games where we “disagree” about the status. The client still needs a bit of cleaning up, but the concepts are sound and the functionality is there.

A few months ago, we were talking at work about what it means to be “truly rich” (in a financial sense). I realized then that there are many, many different perspectives on what it means to be rich, or what it means to be poor.

My coworker’s definition was as follows: if, when purchasing a plane ticket, you always get a first class ticket—in fact, it doesn’t even cross your mind not to—there’s no weighing of the pros and cons or considering the extra cost. That was his definition of what it meant to be truly wealthy. None of us were “rich” under that definition. None of our bosses were, or our bosses’ bosses. Possibly their bosses, who are senior level at the company, might qualify, we theorized.

This was worlds away from what my definition had always been. In fact, it struck me how different a perpective I held from most of my peers. For me, “truly rich” was the point at which you could buy food without thinking about the cost. You could go grocery shopping whenever it was convenient during the month—you didn’t have to wait until the paycheck cleared or to check to make sure there was enough money in your accounts. You bought food based on nutritional value or your particular tastes—you weren’t checking the prices, trying to find the best value so you could make sure to have enough food to last through the month.

Such a stark contrast between the two. Such a humbling reminder of the tremendous wealth inequality, even just here in America.

What’s your definition of “truly wealthy”? At what point would you consider yourself “truly rich”? And has that definition changed over time?

The project I’m working on at the moment is an open-source, open-protocol Go server. Basically, that means that anybody could write a program to connect to this server to play Go. At the moment, most servers don’t allow this—you have to use their program to connect, and if there are features you want that their program doesn’t have, you’re out of luck.

It’s a bit strange testing this server, however, because I’m not actually writing my own program to connect to it. Instead, I’m using somebody else’s program that speaks a different protocol (the “Go Text Protocol”), and writing a thin wrapper that translates GTP to my server’s protocol.

In the end, it seems really odd, because in essence I’m writing an extra bit of logic between two programs—that, by themselves, could talk to each other just fine—just to add my new server in between and make sure it works fine. In the end, of course, this will be great because other programs that couldn’t normally talk to each other will be able to because of my server. But in the meantime, it’s more than a little strange to be looking at these odd conversions back and forth that seemingly could be all stripped away without any change in behavior.

Life has been busy lately, but I thought I’d drop in with a quick update and let you all know how life is going.

The Dow continues to drop. Work continues to be busy. Pneumonia continues to lurk around our house. The normal hockey season has officially started. Metric Thanksgiving is on Monday. I did the laundry and the dishes but the house is still a mess. I’m taking a Japanese class on Tuesdays that is totally fun. When I watch Hikaru I understand a surprising lot of the Japanese. We had less than two weeks of autumn—it went straight from summer to winter with hardly a breath in between. I’m posting this from a MacBook. And now it’s time for bed.

It’s been a while since I’ve done the typical “project update” post that was supposed to be the heartbeat of my revived blog. I guess part of that is because I haven’t actually done much with my projects lately. Things have been so busy and hectic at work that, for the first time in a long time, when I get home at the end of the day I want to do something besides more programming. (Fortunately, as I noted in my last post, hockey season is coming up.)

Meanwhile, I did discover a cool program called f-spot, which is a Linux photo-managing application (much like iPhoto or Picasa). It allows you to sift through dozens of photos fairly easily, tag them, and export them to Flickr and other such programs. I’ll have to see if it fulfills my needs well enough that I can resume cataloguing and organizing my enormous photo collection, but at the moment it looks promising. Apparently it even has Wordpress integration.

This weekend marks the 2008 NHL Premiere—four regular-season games played in Prague and Stockholm to celebrate the National Hockey League both here and abroad. So far the games have been exciting, and I’m more ready than ever for the rest of the season to start this coming Thursday.

Every year, teams change—people leave old teams, people join new teams, old stars retire, new stars appear—there’s always something different. It’s strange for me to see Jarkko Ruutu playing for Ottawa, especially in these first games against his old team, the Pittsburgh Penguins. He was always such a staple on that team that it’s strange to see him skating a different direction on the ice.

But the most surprising change for me this season is that Roberto Luongo has become the first goalie to be named the team’s captain in the modern NHL. In fact, it’s actually technically against NHL rules for the goalie to be the captain! So Luongo won’t have a “C” stitched to his jersey, in order to comply with the official rules, but in all other ways he’ll be considered the leader of Vancouver Canucks.

Congratulations, Luongo! You deserve it.

I must confess, one of the features of the new Wordpress that has directly contributed to the vitality of my resurrected blog is the “scheduled post” feature. Basically, I can write several posts at once when my creativity is high (typically on the weekends, when my mind is fresh and clean instead of worn out from a long day of selling my creativity for money)—and then schedule them to be posted on some day in the future.

Lately, I’ve been writing a week’s batch at once, then setting them to publish every other day throughout the week. This is handy because it only takes three posts two get through a week, and it also leaves every other day available in case I see something interesting that I want to publish right then. Otherwise, if creativity strikes during the week (or something vaguely interesting happens in my life), I just add it to the end of the scheduled posts queue. I’m writing this post, for example, more than a week before it will actually get published.

It’s definitely a useful feature, in a number of different ways.

Today I discovered an interesting new Internet phenomenon. You know how the IM generation has all these abbreviations and slang that would be completely incomprehensible to an English speaker of a decade or so ago? (Like “w00t! pwned j00, lol. gg, thx. omg, ttyl, gtg.”) Apparently, a similar thing has been happening to Chinese, although of course producing different fake-ola words and in different ways—and recently, the word they’ve been using to describe this Chinese “‘leet speak” is 火星文—literally, Martian.

Some of the words are created by using a combination of Roman letters and numbers that sound similar to Chinese words. For example, “3Q” means “thank you”, with the three pronounced in Chinese as “san” (making “san-kyu”). “QK” means “take a break”, because it sounds similar to “xiu xi”, which is Mandarin for the same.

Other words are pictograms or emoticons, much like how a semicolon and parenthesis can become a smiley-face. “VoV” represents a person (the “o”) holding up two V-for-victory signs with either hand. “Orz” means “I bow to you in thanks”, with the “o” again representing the head, the “r” the torso, and the “z” the kneeling legs. This blog has a lot of different examples and explanations.

According to pinyin.info, some of these neologisms were actually “included in the Chinese-language section of this year’s college-entrance exam for Taiwan”. Needless to say, that didn’t last long.

But who knows—will English exams someday require knowledge of “wtf” and “omgz0rs” to pass? Well, maybe when Chinese Martians attack.