Monday, November 19, 2007

Because Polling Is Evil

Is this thing still here? Wow. Anyway, I like my job. I get to play with robots, and I have opportunities to learn a lot of new things (most of the tasks assigned to me are things I've never done before). Last week I learned how to write a daemon.

I had been asked to write a Linux program which would sample force-torque data from an ADC and then send it to another computer (via TCP). Doing the bare minimum didn't take all that long, once I stopped trying to use the buggy DAQ driver from the vendor (I won't name names, but it's a national company known for making various types of instruments) and went with libcomedi instead; but after I got it working with the functionality I'd been asked for, I decided to scrap that and do it the right way instead. (The original design had me doing things like transmitting floating point numbers as ASCII character strings and taking sample readings in response to polling from the client rather than at a steady frequency. Polling!)

In the process of making the deliverable awesomer, I decided it would be a good opportunity to work on my Unix system programming skills (which don't get exercised much when I'm doing Java stuff). So, first I read about getopt_long and had it parse command line arguments to (for instance) set the server port number and data collection frequency. Then after thinking about it some more, I decided that my server should act like a real server and have a name ending in "d", so I set to work daemonizing it (this came in handy). I redirected I/O to /dev/null, I replaced the verbose-mode printfs with calls to syslog, I gave it a .conf file which lives in /etc, and I gave it an init script so that my daemon would get launched automatically when the machine enters runlevel 2 (the kubuntu default). Oh, and a lockfile so that only one instance will run at a time. And I added the "d" to the end of its name. I'm quite happy with the result, and my project supervisor said, "You are the biggest geek I know. And that's saying something. Good work."

Of course, the guys I did this work for? The first thing they asked me to do was stop the daemon so they could run their slow buggy collect-data-and-save-to-a-file, regulate-collection-frequency-with-usleep program based loosely on the old version of mine. Oh well.

Wednesday, June 27, 2007

But Then I'd Have To Kill You

Hay ciertas cosas de que no quiero hablar aquí. Una de esas es el razón porque no he escrito nada desde 5 Junio. Ella se llama Gricel y nos conocimos en Hersheypark. Solamente voy a decir que recientemente hemos pasado mucho tiempo juntos, y me hace feliz. O sea
(if (pair? '(jamie . gricel)) 'felicidad 'tristeza) => felicidad.

Tuesday, June 5, 2007

La Vita È Bella

My life is pretty good right now. In fact, it's very good. I've been happier recently than I had been in a long time.

There is a high likelihood that no one other than myself will ever read this, and I'm perfectly OK with that. I'm writing this for my own personal benefit, so that when I find myself feeling down, I can refer back to this and remember to praise God for being so faithful. (And thanks to the marvel of Teh Intarweb, I don't have to be at home to do the referring back.)

It's actually a very sobering realization, that as much as I try to be faithful to Him, God has been so much more faithful to me. I started thinking about it the other day after I got back from Hershey. On the way back, Lux was talking to me about how she wants to see the young people in her fellowship learn to put God first, rather than money; she doesn't want to see them become workaholics out of a desire to amass wealth at the expense of spending time with other Christians (and, when they get married, their families).

It made me think, because I spend more than 40 hours at work every week. How am I assigning my priorities? I came to the conclusion that I am not, in fact, spending a lot of time at work out of a desire to hoard money; I'm spending a lot of time at work because I love my job. I truly think that right now, I have the ideal job for me. I work with a bunch of great people, I get along with everybody, I'm learning a lot of new things, AND I GET TO PLAY WITH ROBOTS.

Three years ago, when I was getting ready to graduate, I had absolutely no idea what I would be doing after that Commencement ceremony. I had been accepted to the EECS Master of Engineering program, but I wasn't sure if I would be doing it; I didn't want to go any further into debt than I already was, so I prayed about it and decided that I would only go through with it if I found a paid position as a research assistant.

When classes ended, I still had nothing, but I kept praying about it, trusting that God would show me one way or the other what He wanted me to do. And then during the week or two between finals and Commencement, I found out about a position working for a professor in Course I, doing wireless network stuff. After an interview that I didn't personally think too highly of, I found out that the position was mine. Praise God! I get to defer the dreaded job search for another year.

The next year, as I was working on my thesis, my former roommate told me about a company that was looking to hire for work in DC which had contacted him. I sent them my résumé, and after an interview that I didn't personally think too highly of, I found out that I had a job. Praise God! I get to avoid the dreaded job search.

But then the original project I would have been working on for this company fell through, so I had a company but no job. Here I was with two degrees and no idea what I'd be doing with them. (At the time I was spending the summer back home in Florida.) So, I went back to praying about my future, and I started talking to a couple other companies, but then I got a call about a different project in DC, which sounded more interesting than the original one I'd signed up for: I would GET TO PLAY WITH ROBOTS. Could I wait a couple more months? Hmm… more time in Florida, now that's a tough decision. So I ended up taking the position and started working at the end of January 2006.

All seemed to be going okay until last October or November, when my boss told me that, due to several setbacks throughout the year, he intended to shut down his company and move away from DC. So now I had a job but no company. So, I went back to praying about my future again. I liked my work and wanted to stay with the project, but I needed to find somebody willing to give me paychecks for it. I ended up talking to the company of one of the other guys on the project, a smallish private engineering firm called The PTR Group, Inc. After an interview that I didn't personally think too highly of, I found out that I was PTR employee # 26. Praise God! I can go home for Christmas vacation and have a job when I get back. The entire process from first contact with the company to my first day as their employee took one week. I was the fastest hire in the history of the company.

Which brings us back to the present. I'm twenty-four years old, I have two degrees from MIT in Electrical Engineering & Computer Science, I work at a well-thought-of private company which is small enough that I know everybody and everybody knows me, and I GET TO PLAY WITH ROBOTS.

My (civil servant) project supervisor (our resident robotics supergenius) is a terrific guy and we get along very well. We both have a computer science background, we both claim Mac OS X as our operating system of choice, and we have very similar senses of humor. Either of us can make a joke with Biblical allusions or Douglas Adams references and the other will get it. Professionally, I've developed a rapport with him such that I feel free to ask him about robotics stuff and he comes to me about programming. He's been assigning me increasingly important software responsibilities, and I think he's decided that I either know or can quickly figure out how to do pretty much anything he asks of me.

Even in this long exposition, I've glossed over so much about my work (and about how I wound up at MIT in the first place). In the past year and a half, I've learned about network programming, threads, 3D simulation, nonlinear optimization methods, trajectory planning, computer vision… and I GET TO PLAY WITH ROBOTS. I love my job.

On top of all of this, I'm more involved with my church than I've ever been before. I'm in a Bible study with some great guys and I've been doing sound engineering for youth group on Wednesdays and my own service on Sundays. Because of that, I met the people who do sound for the Hispanos en Cristo (Spanish language) service, and through them I've gotten involved with the young Latino group. I finally feel like I belong, and I hadn't been searching for any of it.

It had been years since I had the opportunity or necessity to practice Spanish in earnest, other than conversing with my grandmother, and I did vaguely regret not having a reason to use it, but I wasn't actively seeking to change the status quo. I'm reticent as it is in English; I certainly didn't think my Spanish was good enough to inflict upon a genuine Latin American (at least not one who wasn't a relative with a familial responsibility to tolerate my inability). But God saw fit to meet a need I wasn't asking about, and the end result has been that I've met a bunch of new friends and have been having fun with them. And practicing my Spanish.

When I stop and look back at all the little seemed-insignificant-at-the-time events (and the few big ones) which have led to where I am right now, it's as plain as day how God has been directing my path. Which is totally awesome, but also makes me think about how many times I know I've disappointed Him, even in the past year. It's not that He's been faithful to me because I've been faithful to Him; even while I was screwing up royally, He was engineering things to my benefit. Wow. What an amazing and merciful God He is.

And that makes me happy.

Sunday, May 27, 2007

Mmm... The Land of Chocolate...

Ayer yo fui a Hersheypark en Hershey, Pennsylvania, con un grupo de Latinos (y algunos gringos) de mi iglesia. Hersheypark es un parque de diversiones como Busch Gardens, pero con chocolate en vez de cerveza. Hay montañas rusas, un carrusel, y también un parte que es parque acuático. Yo no fui por allí porque no había traído traje de baño, pero sí fui a las montañas rusas, y el carrusel era muy divertido. Lo del parque que no me gustaba era que la tierra no es llana; no sé cuantas millas caminamos, y me parecía que siempre caminabamos hacia arriba.
Hacía mucho calor por el medio del día, y pasé un rato en el aire acondicionado de Chocolate World, otro lugar al lado de Hersheypark donde se explica cómo se hace el chocolate. También tiene tienda muy grande donde se puede comprar una tableta de chocolate que pesa ¡cinco libras! En Chocolate World me refresqué con un gran banana split.
Después regresé al parque y pasamos por las montañas rusas hasta muy tarde cuando comimos y entonces miramos a los fuegos artificiales. Pasamos la noche en acampar al otro lado de la calle y hoy regresamos a Virginia.
Me disfruté mucho de ir allá con esa gente. Podía (o sea tenía que) practicar mi español y conocí a muchos nuevos amigos. Todos son amables y espero pasar tiempo con ellos otra vez.
Pero en este momento estoy muy cansado y me voy a dormir. Estoy feliz porque mañana es Memorial Day y no tengo que trabajar; puedo dormir y descansar por todo el día.

Monday, May 21, 2007

Correspondence from a Rodent


I received the following letter in the mail today:
May 18, 2007

Dear MIT10-er,

Thanks so much for your 2006—2007 gift to MIT! Having made a gift this year, when you only recently graduated and perhaps aren't exactly "rolling in the dough," makes you not only doubly special, but also a certified friend of mine.

But what of it? Pride, that's what! And commitment! And the bliss of supporting an institution devoted to the common good! All are yours to enjoy because you made an annual gift to MIT. So, too, is the enclosed "Friends of Tim" card that's been personalized just for you.

Take this card and put it in your wallet. Have it, hold it, and proudly display it wherever you go. Soon you'll discover what every other card-carrying Friend of Tim knows (in addition to the sheer rapture of simply being a Friend of Tim): that you can walk among the beavers with pride.

See ya next year!

Tim

Tim the Beaver, MIT Mascot
That's right, I now have a card in my wallet proclaiming my friendship with a cartoon beaver. You know, before, I had some doubts about making a donation when I still owe them so much in loans, but now it all feels totally worthwhile. This sheer rapture is some pretty great stuff, let me tell you. It's nearly enough to make me almost forget, for a veritable plethora of nanoseconds, all about the many many thousands of dollars I owe the 'Tvte.

I will say this: as corny as it is, it's nice to be appreciated once in a while; the Perkins Loan people never send me thank you notes, they just send me more bills. So, you're welcome, Tim the Beaver. I am your Friend. Now tell the blasted Alumni Fund to quit hitting me up for cash.

Friday, May 18, 2007

To Boldy Go Where No Symphony Orchestra Has Gone Before

I've been rewatching TOS for the past few weeks, and it's been extra-noticeable to me this time* how much the music provides evidence of a low budget - even more than the special effects.

This show came out in 1966; it would be another decade before George Lucas and friends would invent the technology to create convincing special effects for cheap. So, I'm really not sure how much different the effects would have been even if they'd had twice the budget.

The music is a different story. In some sense it's Wagnerian, in that different situations have particular themes that get played. However, it isn't that the theme is worked into a new piece of music; they just replay the prior recording. So, you have episode after episode replaying exactly the same incidental music. The suspenseful theme heard during the standoff in The Corbomite Maneuver gets rehashed for Dagger of the Mind and countless other episodes (at least, more than I've bothered to count), which ends up greatly diminishing its suspense.

To contrast this, look at The Next Generation or the other later Star Trek series in which each episode had its own score. They still reuse motifs, but they are newly recorded each time. The music winds up matching what we see on screen much better, enhancing the dramatic effect rather than detracting from it. TNG, DS9, Voyager, and Enterprise were all nominated for or won Emmy awards and ASCAP awards related to their music.

Now, sure, certain episodes of the original series would still be kind of goofy even with super awesome music (especially that one with the Space Hippies), but it definitely would have helped. After all, try watching Star Wars on mute and see how ridiculous the dialog is without John Williams' wonderful score.

One more thing: it would also have been good not to spend so much time at recognizable Southern California rock formations.

*Possibly because the last series I went through before this was Batman: The Animated Series, which consistently put a lot of effort into its incidental music.