Archive for February, 2008

Stratamodel in Niger

Saturday, February 16th, 2008

Tom Bell of Stratamodel is an exploration geologist. He travels around the world looking for valuable minerals. He’s just wrapping up a several-week expedition to the desert in Niger to look for uranium. This guy has an incredible job.

Tom gave me a ring a few days before leaving for his trip to see if we could put together a quick program for his laptop. He had a set of barometers/thermometers that connected to the USB port on his Windows laptop, and he wanted us to write some software to read the data from the devices and record it. He also wanted to ensure that it could all run unattended, and that it would maximize battery life. We also had to be 100% sure that the program would work properly, since he would hardly have any outside contact once he entered the desert.

Using the specifications from the manufacturer, we put together a Ruby program to talk to the devices and record the data (we used the ruby-serialport gem, if you’re wondering how). Getting the timing right with the devices was the only tricky part — they were very picky about how much time elapsed between sending and receiving each character, and between sending a command and retrieving the response.

To save power, we set up the code and data on a flash drive so it wouldn’t use the hard drive. We then set up a power scheme that would keep the computer running, but would shut down the hard drive, display, and allow the machine to keep running with the lid closed (essential for keeping out dust and sand).

All in all, we had everything developed, tested, and installed in about 24 hours.

After hearing about what his trip was going to entail, we also set up a blog for him to write about his experiences. He’s been writing some great stories and taking a lot of amazing pictures. I’m really struck by how similar some of the desert pictures are to the ones from the Mars rovers!

I highly recommend checking out the Stratamodel blog. Also be sure to check out the Stratamodel photo stream on flickr. Great material. Have a great trip Tom!

Exploring Ruby class methods

Friday, February 15th, 2008

I decided that I needed to learn more about all the different ways to declare and use Ruby class methods, so I wrote a 10-line example script to try a couple things out. Two hours later, it had expanded to almost 300 lines (including lots of comments) as I tried to demonstrate and explain every way that I could think of to declare and use class methods.

Take a look, download the code, open it in your editor, and run it (Apple-R in TextMate). Mess around with it.

Did I miss anything? Did I get anything wrong? Post your comments and questions in the comments below.