June 23, 2006

Week Three - Friday

It's been a good couple of days for coding. I got on something of a tear and managed to knock out almost all of the remaining code. The MySQL stuff still needs to be done, but the database is installed on a computer named Thanatos, and I haven't been able to access it remotely. Rumi's needed to use it for the past couple of days, so no MySQL stuff this week.

The scripts, however, are looking pretty good. There are two separate scripts, the intialization script (which gets the set of photos we'll be tracking) and the update script (which updates the number of views and favorites for each photo every couple of hours). Both scripts produce a log file, and I made sure to implement exception handling so that the scripts could keep running even if something went wrong. In the case of socket errors, I threw in a retry routine that tries the request again after a five second sleep. I discovered earlier in the week that the number of views and favorites for each photo can't be obtained via the APIs, so I had to go another route. I'd fortuitously stumbled across a guide to web scraping in Ruby, and revisiting it led me to the scraping tool Rubyful Soup. A port of the Python tool Beautiful Soup, this proved to be just what I needed. Several test runs helped me work out the bugs, and now all that's left is to write the code to put the data in the database.

June 20, 2006

Week Three - Tuesday

The Intelligent Systems Division here at ISI sponsors a series of AI seminars, and today the featured speaker was Jonathan Schaeffer from the University of Alberta. As a member of U of A's GAMES (Game-playing, Analytical methods, Minimax search, and Empirical Studies) research group, Dr. Schaeffer works on developing programs for strategic game playing. Today's talk focused on his group's efforts to create a high-performance poker program capable of taking on the best human players in the world. Poker presents a lot of challenges to AI research: a poker player must make calculated decisions based on incomplete information, taking into account factors such as the randomness of the deal and the behavior of the other players. How do you decide when to bet and when to fold? How do you know if someone is bluffing? Even humans have difficulty making good calls. I thought it was a very interesting talk, and it certainly gave me a lot to think about.

Something I've noticed since I started riding the Metro buses is the seeming ubiquity of television in Los Angeles. There are TVs on the buses. There are TVs in the elevators at ISI. Listening to the muffled sound of the TV on the bus last week, I heard that someone was going to start installing TVs at gas pumps. It's almost as if someone had watched a bunch of near-future sci-fi movies and said, "Hey, look at all the video screens ... that looks like a good idea!" Kind of surreal. It's also quite distracting; your eyes are automatically drawn to the flickering images you perceive out of the corner of your eye, and you find yourself watching it even when you originally didn't intend to. I usually bring a book to read when I take public transit, so I have an alternate distraction there, but the elevators are a different story. So far the only tactic that has worked has been to stand on the opposite side of the elevator and look at the wall or the elevator buttons. Sometimes, though, I just give in and read the snippets of news and trivia being fed to me. I wonder... does the TV presence in the elevators make people less likely to talk to each other as they wait to arrive at their floor? I suppose one could argue that the TV actually gives you something to talk about, but I suspect it probably induces more silence than discussion. Something to keep my eye on, so to speak.

June 19, 2006

Week Three - Monday

Leah left on Saturday, so I'm flying solo. I'm not completely alone, however; there are three other grad students who share the office with me, though they don't come in every day. Rumi is a masters student from India, and she's working on a project involving modeling crowd movements in museums. Myle's going to be attending Cornell in the fall, and right now he's working on a project involving mathematical modeling (though I'm not sure what of; I'm going to ask him more about it at some point). Anon is working on a project similar to mine, though he's collecting data from the social bookmarking site del.icio.us.

I realized that the XML returned by my queries is automatically converted to a hash by the Ruby gem xmlsimple, which flickr.rb requires. That means all I have to do is extract the key/value pairs I need from the hash and throw them into the database somehow. That's a nice feature, and I think it'll prove quite useful.