Saturday, July 31, 2004

City Quiz

I saw this on a friend's blog.

Take the quiz: "Which American City Are You?"


I took the quiz and got:
Seattle
Your dark exterior masks a caffeine driven activism. You'll take up a cause and you'll get ugly to advance it.

Guess I'm in the right place!

I was undecided on a few of the questions, and took the quiz again and chose the other answer. This time I got:
Las Vegas
You Shine bright and partake in all the vices. You'd rather burn out then fade away.

Looks like I'm a west coast kind of person - I can agree with those results. While the east coast has its charms (I've lived in Brunswick, GA for half of 9th grade; Silver Spring, MD for my high school years; and NYC for four months, before I moved to Washington state) I do like the west better.

Rice Alums

Tonight I drove into Seattle to the Roanoke Park Place Tavern for a Rice alumni meeting. Our alumni group is called RAIN - Rice Alumni In the Northwest. Catchy name, don't you think?

RAIN met regularly for years, but then the woman who ran the email list graduated and moved away. She gave plenty of warning, but I suppose the rest of us were too lazy to do anything like take it over from her. That was over two years ago so we hadn't gathered in quite some time. I made some good friends in the group, including Tom and Lila, and a few others I keep in touch with since they've moved away.

I was looking forward to the event since after such a long break, this would likely draw a large crowd of alums. Tom and Lila were there tonight and I was happy to see them. Lila has made a few interesting career changes and is currently in law school, so I asked her all about how her first year went. I talked to a few others, including some friends I hadn't seen in a long time. The group plans to meet once a month so we'll see who the hardcore attendees are after a while!

I must eat a better dinner tomorrow, as I just had beer and nachos. ;)

Friday, July 30, 2004

IRC Bot

I've been playing around IRC lately, and since that is already goofing off in the highest degree, I decided to write a simple IRC bot. My day job is software development, and I thought this would be a fun diversion.

An IRC bot? What's that you ask? Well, assuming you have some background in IRC as a user, a bot is just a program that provides some service. It may fetch sports scores, log all text and produce stats, or grant ops to users that join the channel. Fancy bots do crazy stuff like let people choose music to play, run webcams, and so forth. My goals are far simpler!

My immediate goals for the bot were: keep a channel open, and greet users that join that channel. Since this is a learning experience, I decided to be more "hands on" about writing the bot, and not just take an existing one and modify it slightly.

I started by googling for existing IRC bots, preferably ones I could download and examine to see what I was getting myself into. Google turned up several written in PERL, Java, and C# - any of these languages would be fine. I have two windows boxes and one linux box, and all those languages are available. I also skimmed the IRC specs just for basic information.

In my searches I came across a JAVA API for IRC bots! I couldn't resist starting with such a great foundation, so I began reading the documentation for PircBot.

At risk of peeling back the curtain and piercing the aura of difficulty surrounding software development ;) all it took to make the bot greet users was this code:


public void onJoin( String channel, String sender, String login, String hostname )
{
sendMessage( channel, "Hail " + sender + "! Welcome to the harem." );
}


In addition to this, I just had to fill out the correct server and channel to join.

To be honest, it took me longer to update my Java SDK to the latest version and remember how to build and run Java apps than it took me to get a bot up, running, and greeting users. I also enhanced the bot code so it takes the bot name on the command line. Thus, once the bot is ready, I can easily launch several copies and give each one a different name.

Now, this implementation isn't very sophisticated. For example, the bot greets itself when it joins the channel. I decided that looked really stupid so I made a minor enhancement:


public void onJoin( String channel, String sender, String login, String hostname )
{
if ( getNick().equals( "harembot" ) && !sender.equals( "harembot" ) )
sendMessage( channel, "Hail " + sender + "! Welcome to the harem." );
}


The extra code does this: only a bot named "harembot" will greet users, and the bot named "harembot" will not greet itself.

That wasn't so hard, now was it?!

I left the bot running over night and found it had been disconnected somehow. So, I added in two different methods for reconnecting. The first cycles through the various servers until the bot connects successfully, and the second just keeps trying to reconnect to the same server. Right now I'm running both methods to see which one results in a more reliable presence.

The other thing I added was ops granting. This was interesting as I had to learn about various modes and the messages involved when a user gets ops or has ops removed. I may cover this later, but right now I also have my various bots recognizing each other and granting ops when they join. I need to take it a step further and implement a system where I can add people to a list for the same treatment.

So this is what I do sometimes to relax sometimes, rather then veg in front of the TV (which hasn't even been turned on in 5 days). However tonight I'll probably watch something in my Netflix queue.

Thursday, July 29, 2004

Camera Memory

I'm taking a vacation to New Zealand in November, and an important consideration for me is my picture saving strategy. This will be the first major trip I've taken since I bought my digital camera - previously I had an APS camera.

In Florida, I just saved my pictures to my notebook. But on this trip, I won't be taking a notebook computer with me, because both notebooks I have are through work, and this isn't a business trip.

Apple sells a media reader that lets you copy pictures to an iPod, but unfortunately it isn't compatible with the iPod mini, which is what I have.

I just decided to my more memory for my camera. I was using a 128 MB compact flash card, and that holds about 70 pictures at highest resolution and lowest compression. That isn't nearly good enough - I'm planning to take far more pictures than that.

So, I bought two 512 MB high speed compact flash cards. At highest resolution (2048 x 1536 for my camera) and lowest compression, that should hold around 280 pictures per card. I'm considering bumping down the resolution one notch to 1600 x 1200, which should result in about 480 pictures per card. That should be plenty, although I might buy one more 512 MB compact flash just to be extra safe, so then I would be able to save around 1400 total pictures!

I splurged a bit for higher speed flash memory, because the 128 MB flash I originally paused noticeably between pictures as it wrote to the card. I tried a few pics yesterday with the new CF card, and I did notice it pausing less after a shot.

Wednesday, July 28, 2004

Board Games

Tonight I met with some gaming friends at my former employer.

I've always enjoyed games, both board and computer, and found some people with similar interests where I used to work. We would gather once every other week or so and play in the evenings, just to take a break. I used to play Scrabble with another group there, but it dissolved so now I just play on the computer once in a while. Scrabble and backgammon are my two favorite "classic" board games, because they require both luck and skill, and are therefore fun. I don't find chess to be enjoyable, for example, because it is pure skill.

Anyway, in the board games group, we started playing RoboRally but hit some problems. The game is fun but moves were taking so long we would often play for two or three hours and only complete one (out of four or more) of the victory conditions! We tried a few other games such as Formula DE before discovering Settlers of Catan, a game all of us really liked. So much that we played all the expansions and eventually needed a break. As Yogi Berra might say, it was so popular we stopped playing. We tried Tikal (good strategy game but suffers from decision paralysis), Carcasonne (game of the year but didn't quite captivate us), Princes of Florence (very good game), Torres (very strategic, and sometimes the best move is to help an opponent), Ra (I like this but not everybody enjoys auction games) and many others. These games are all great fun but each takes a while to setup and play. Plus, we'd have to review the rules for several minutes beforehand. Nevertheless, we would cycle through the games and buy a new one every few months.

Lately we've been playing games that move a bit faster, such as Evo. One friend got so good at this game others started making special house rules meant to even things up! Card based games are fun and quick, such as Fluxx, which is fast and easy, but a bit random so we lost interest. High Society, Cartagena, Bohnanza are among our favorites.

Tonight we played Illuminati, a game about secret societies taking over the world. Your Illuminati group spends its turn either destroying, neutralizing, or dominating other groups, which may be in the power structure of a rival Illuminati group (the other players). It was close game - the four of us were each within another turn of winning when someone finally did. That's the hallmark of a good game, when everybody is in it until the end!

NOTE: all these links are to FunAgain.com. I'm not affiliated with them, just a happy customer. It was easier to link to their online catalog than chase down all these links at the respective companies.

Tuesday, July 27, 2004

Ending the Exercise Hiatus

I didn't exercise at all during my recent business trip to Orlando, which puts me behind on my training plan. There are still eight weeks to my target race, but since I'd just like to finish the event, it is still possible for me to enter. Yesterday I rode my bike with a friend from her house to Seward Park and back, a nice 23 mile round trip.

Today I decided to run. I was eager, in fact, perhaps too eager. I filled up my water flasks, put on my heart rate monitor and my Forerunner, and headed out. I decided to run from work, along a street, onto the Sammamish River Trail (a multi-use trail), and onto the Power Trail (which I recently discovered). To sum things up, I ran for 1 hour 43 minutes along 8.3 miles.

That may sound slow, and it is, but that was my goal: long slow distance. I run with a heart rate monitor and try to stay within certain heart rate zones. I have friends that run on RPE (rate of perceived exertion) and it seems to work for them, but I like to keep an eye on my heart rate. Heart rate is a great measure of how hard you are really working - it will vary with the weather, how tired and/or sick you are, whether or not you are climbing a hill or descending, and so forth. If I keep a constant heart rate, I slow down over time; conversely at a constant speed my heart rate will creep up over time. Naturally, my body isn't a machine and things will vary slightly, but I find heart rate to be really useful.

There are many complicated systems, some present five or more target zones. I prefer to keep watch on just three: aerobic, or below 70% of my max heart rate; anaerobic, or above 85% of my max heart rate; and the middle zone, above 70% and less than 85%.

Below 70%, your body burns more fat to supply you with energy. This is why walking is such an excellent exercise - it is easy on the joints, and burns fat. Above 85%, your body burns more carbs to supply your energy requirements. Carbs contains fewer calories per gram, but they are easy to metabolize and so that's what your body chemistry draws upon when it needs energy fast.

For my event, I'm mostly training aerobically, below 70%. That's the zone you build endurance in, which is what I'll need. It doesn't make sense to train hard (all the time) as during my race I'm not going to be running anywhere near my speed potential. Generally, to maximize training efficiency, I try to train aerobically or anaerobically, and stay out of the middle zone which is too fast to build endurance and too slow to build speed.

Today I kinda of blew that. My heart rate chart shows I averaged 78% the entire time. It was hot, the course had a few hill climbs and it is always difficult for me to keep my heart rate down while going uphill, without slowing down to a walk. Next time I run the same course I can compare - try to stay within my target heart zones better. Later, I'll run 8.3 miles along the flat SRT and compare heart rates and times.


heart rate 040726

Monday, July 26, 2004

TV: CSI

I don't follow many TV shows, but one of the ones I really like is CSI. I've also gotten into the spinoff CSI: Miami, and will undoubtedly do the same for latest spinoff, CSI: New York, which debuts this September.

The reason I like these shows is that science is the main plot element, unlike all the other police and law dramas on. A crime is committed, and the team goes out to gather evidence and then reconstruct what happened based on the evidence.

I also like the Discovery Channel show "New Detectives" which is similar - it details the forensic science behind solving a crime. One key difference is all the crimes in "New Detectives" are real cases.

One minor downer is pretty much all the crimes are homicides, although some are accidental death. On the other hand, sometimes the circumstances are so bizarre it is funny!

Anyway, two costars on CSI staged a salary protest but it has been resolved now. Good news - the show will go on on!