Amalgamation II

by zenquaker

I was walking down the street from the Metro station to work this morning, and I realized I couldn’t find my apple. I’m almost four weeks in to forming the habit of eating an apple every day, and I’ve been wondering if I’m ready to push into the next habit (studying Chess flashcards on the bus). So I’m a bit disturbed that I forgot my apple this morning, although I’m pretty sure I didn’t. I did drop my keys in the Metro station so maybe I dropped my apple somewhere (and thanks again to the guy behind me who saw me drop my keys, picked them up, and gave them back to me). I’m groping around in my pocket in case it’s hidden behind my gloves, patting down my other pockets, trying to figure out where it is. I come to an intersection and I don’t have the walk signal, so I stop and take a bite out of my apple while I think about it. I look down at the half eaten apple that has been in my right hand the whole time and think to myself this is going to be a bad day.

It actually wasn’t that bad a day after all. Actually it was pretty good. Yesterday I made sure to get all the necessary work and weekly work out of the way. I did forget my Metro subsidy re-certification paperwork, but it won’t kill me to do that Monday. So I was able to spend the day programming. I’m working on revamping my dynamic code generating search program to deal with the new Sharp Floor system. I was having some bugs I couldn’t understand last time I was working on it, but today I managed to knock both of them out. One was that the test data set was just wrong. Once I noticed that it was 60% the size it should have been, I reran it and it worked. The other one I tracked down to a way we had asked for the old data to be translated into the new system that makes the two systems inconsistent.

Working on these bugs required making repeated test runs. These test runs require pulling multiple years of data from the server, and with a couple dozen of them to run each time it can take a while. So I took the time to read the SAS book that I got them to buy me at work, and learned something new and useful. If you don’t program SAS, you probably don’t realize that most SAS books are not Scottish (NSFW). Thus, learning something new, much less something useful, from a SAS book is a thing to sing and dance about. However, I manfully refrained from singing and dancing. For those with no taste for programming, skip the next paragraph.

What I learned about was proc append. A lot of the time I’m writing loops, and with each iteration of the loop some data is created. I store that data by appending it to the previous data. However, I’ve been doing this with what we SAS programmers call a set merge. The problem with a set merge is that if the data you’re appending to doesn’t exist, it causes an error. On the first time through the loop, there’s no previous data to append to. So you either have to create an empty data set before the loop (which leaves an empty observation you later have to remove) or you have to put a conditional in the loop to create the initial data on the first loop. As I learned today, if you use proc append when the data you’re appending to doesn’t exist then it creates that data as a copy of what you’re appending. End result: in numerous places in all the major programs I’ve written at work, I can now cut ten lines of code down to two. I started by doing it to the program I was working on today.

To be honest, I can be a bit of a slacker. So I didn’t spend all of the time I had while waiting for test runs on work related stuff. I fiddled around on some Chess websites and read some RSS feeds. The latter led me to a fascinating article on the European Union National Institutes of Culture. If you find that to be a bit of a mouthful, you can instead use the acronym: EUNIC. This was one of those few times when the acronym LOL was literally true. For quite a while.

Then I came home, had my turkey pasta leftovers (the second best meal of the week), and reviewed a very well annotated game between two grandmasters. And since I did manage to get a few good laughs at myself for the whole apple thing, it was a good day all around.

I hope you had one too.

Advertisements