18 August 2005

A few haikus to start...

Hello out there! So I decided that it's high time I joined the blogging world. My new job keeps me so busy that it's hard to keep in touch with all my friends, and there's SO much that I want to tell everyone!

Anyway, I sat down last night and wrote some haiku to kind of summarize how life has been going for me since I moved to Japan last month. Here they are, with annotations as appropriate:

Used coffee filter
Dried out in the kitchen sink
It's time to slow down

This is the one that got me started - I got home last night after work and found an old coffee filter lying in the sink - the filter and the grounds were bone dry, and I realized that I've been so busy lately that not only have I not had time to cook at home, I haven't even had time for coffee in the morning... I think that filter was from about a week ago! I think I'm going to make a concerted effort to slow down a bit and regain some balance.

It's hard, though... I really enjoy what I'm doing at work (building and programming humanoid robots, for any of you who were wondering) so I tend to stay pretty late. I really don't mind working long hours, but it doesn't leave much time for other things in life.

A trembling servo
Redesign its control loop
And drink more coffee

So for one of my projects I'm building this stuffed animal (not really sure what it's supposed to be - the girl I work with just keeps telling me "It's traditional Japanese ghost.") which has servos in it to move its arms and head. One of the problems with the servos and controller boards we use (or maybe all servos do this?) is that they tend to twitch back and forth slightly as they try to stay still. This is kind of annoying in a stuffed animal, so I rewrote the code to cut the power to the motors when they're not actively in use. The other night, though, I was on my nth cup of coffee for the day where n was large, and looking back and forth between the shaking arm of the doll and my own hand shaking over the keyboard, I had a "moment" - it was kind of like in Return of the Jedi where Luke looks back and forth between his own damaged mechanical hand and Darth Vader's.

A memory leak
Manifestation of sin
How much time is left?

So for those of you who don't know, as a program runs, the computer has to allocate chunks of memory to hold variables and objects that the program uses. After that memory is used, it needs to be freed so that it can be reused. Sometimes this is automatic, but sometimes you need to do it by hand. A common problem that happens when programming is that you forget to free up memory that has been allocated. If this happens many times (say, inside a loop) then the program starts to take up more and more memory as it runs, until the program exits or the computer's memory is full.

For one of my projects, I've been writing control software for various sensors, which collects data from the sensors and sends it to other programs over the network. A few days ago we started running it at the Osaka science museum, where we have humanoid robots that guide people around to the various exhibits. In the last few days before the project went live, we were doing overnight test runs of all our software to make sure it was stable over long periods of time. During those tests, we discovered some memory leaks. Since we had so much work to do, though, we really only had time to fix the worst ones. Practically speaking, if a program leaks 10 megs of memory over 8 hours, it's not a problem on a system that has 512 megs of RAM.

Generally speaking, though, memory leaks tend to be the result of sloppy programming. In many cases, if you're just going to compile your code and pass the program off to someone else, they'll never know how well- or poorly-designed your code was, but in this case it's clearly visible. The indelible evidence of your sin is exposed for all the world to see, with no time left to cover it up. I feel like this was a rich metaphor for many aspects of life, but I don't want to ramble too long. Next poem:

The convenience store
Closes at 9:30 sharp
Convenient, for them.

This is just one of my little frustrations with the place where I live. It's way out in the sticks. There are no bars and no karaoke near our station, and even the convenience stores close early! Of course, it's probably a good thing that there aren't many distractions because it helps me focus on work, but ... 9:30? Come on.

Anyway, there's my first blog post. I'll try to get some photos up here at some point too.

1 comment:

Dylan said...

Hey Ernest,

You're always welcome
Mi casa es su casa
I've got a futon