10/19/09 – 10/25/09
Another week in the life of Hoxie. This week was mostly ups with a big down at the end.
It was a good week at work, with some interesting problems to solve and some cool R tricks to learn along the way. I recently learned that I have to give a 30-minute talk at a large mid-November meeting about what I’ve been doing for the last couple of months, so it’s time to start wrapping up the current phase of analysis and making a slideshow / practicing my talk. I really enjoy speaking in front of crowds and I have a couple of interesting results to share, so it should go well.
Here’s an R problem I couldn’t figure out an elegant solution to: given a vector of n strings that all contain at least one underscore, how do you create a new vector of length n consisting of the characters of each string in the original vector before the first underscore? i.e. Given x below, create a new vector of length 3 consisting of c(“Hoxie”, “is”, “cool”). I couldn’t come up with a way that avoided processing each term of x separately, although I’m sure such a solution exists. This was my solution:
x <- c(“Hoxie_Ackerman”, “is_my_favorite”, “cool_person_in_the_world!”)
first_text <- character()
for (j in 1:length(x)){
current_element_split <- unlist(strsplit(x[[j]],”"))
first_underscore_index <- grep(“_”, current_element_split)[1]
first_text[j] <- substr(x[[j]],1,(first_underscore_index-1))
}
# first_text = c(“Hoxie”, “is”, “cool”)
On Wednesday night, I went to Ryles salsa night and danced on2 salsa for the first time. After about 9 months of dancing on1, I had a hard time getting used to the on2 experience. (It didn’t help that they were playing music with relatively indiscernible beats.) When they opened up the floor to social dancing after the lesson, I reverted to my on1 ways pretty quickly. The night wasn’t a total loss, though: I met a couple of cool girls who live in the area and will probably be at Ryles pretty regularly.
And Friday night was my first Halloween party of the season. I had about 48 hours of lead time to get ready for the party with work/life consuming most of that time, so I threw together a pirate costume at the last minute and headed down to The Apartment on BU South Campus. More than a couple of the people attending had decided on a “Disney” theme ahead of time, so we had Pocahontas, Aladdin and Jafar, Woody (Toy Story), the Mad Hatter and the Cheshire Cat, the Queen from Snow White (played by a dude), Cruella de Vil, and Esmerelda (The Hunchback of Notre Dame) running around. Also in attendance were Maude (of Harold and Maude fame), The Bride, a schoolgirl, a couple dozen people cleverly pretending to be twenty-somethings, and some dude wearing his pirate pajamas. (I managed to snap a pic of him and Cruella). Good times.
Saturday was a busy day. I had lunch with a friend at the always-delicious Brown Sugar Cafe, another butt-kicking Intermediate BU Salsa Lesson, a nice chat with Julia down by the river, a couple of books waiting for me at the Boston Public Library, and a pretty atrocious bike wipeout on the MIT bridge. Oh yeah, that last kinda sucked. I was going close to full speed (probably 20 mph), the road was wet, and a car ahead of me was acting stupidly. I slammed on my brakes, my wheels locked up, I skidded, and suddenly I was sliding to a stop along the pavement. Ripped open the palm of my left hand, cut the palm of my right hand, two scrapes on my right knee, seriously mangled my right elbow, two nice scrapes on the right side of my body where my shirt had apparently been dragged up, and my front brakes aren’t working so well. The good news is that, 18 hours later, I think the bleeding has stopped (though my elbow had a good run there), nothing’s broken, my brain is fine (hooray for helmets, not that it make contact with the ground), and life goes on. The bad news is that it’s painful, I’m going to be recovering for a month, and I liked my bike when everything just worked. I rarely make the same mistake twice, but the lesson here is clear: when the roads are wet, slow the f*** down, Hoxie.