OSCON 2011: Friday

Friday marked the last day of the O’Reilly Open Source Convention (OSCON), and my last day in Portland, Oregon. Unlike previous trips, I traveled home on Friday night instead of Saturday morning. In the past, I’ve sat around my hotel on Friday night with nothing to do except finish posts about OSCON. There is one drawback, though. I’m finally finishing this post 20 days later, which means it probably won’t be as fleshed out as my posts about Wednesday and Thursday.

After my near complete lack of interest in the keynotes I saw on Wednesday and Thursday mornings, I paid little attention to those on Friday. I thought the message Karen Sandler had about open health was good, but that’s about all I can say about them.

By far I was the most pleased by the sessions I attended on Friday. First, Kevin Falcone’s Shipwright: Application Distribution Simplified. Kevin works for Best Practical, a company with the best shirts. I plan on doing some evangelizing of Shipwright at work, as it would help a lot of people, including me, to better develop and deploy their applications.

I wasn’t planning on attending OSCON this year. I was perfectly happy skipping it and staying home during the last week of July. Then I happened to be looking over the list of Perl sessions and saw, at the very end of the list, Easy Distributed Computing with Perl and Grid::Request. It seems that Victor Felix has released a module that does exactly the same thing as some of the modules I’ve maintained at work, only the design is much better. However, it doesn’t support the batch system we use. I emailed Victor to discuss some collaboration and registered for OSCON so I could meet him. So yeah, I attended OSCON for one session. But it was worth it. The module looks great and Victor seems happy that I have an interest to contribute. It will be much better use of my time to contribute to a module on the CPAN than to continue pouring effort into what we have today.

Since, after chatting for a bit with Victor, I was already standing outside the room well into the next time slot, I popped into Git for Ages 4 & Up. Michael Schwern and Ricardo Signes demonstrated the Git commands everyone should know to get started with the version control system. As an added bonus, they used tinkertoys to help the audience visualize what Git’s internal representation of the repository looked like after each command. It was definitely a different and entertaining talk.

Prior to the closing keynote, Piers Cawley was invited to sing his library song, which I mentioned in Thursday’s post, again for the benefit of all OSCON attendees.

Paul Fenwick delivered the closing keynote. If you haven’t seen one of his talks, shame on you. Here, to help you fix that, I’ll refer you to his keynote, All Your Brains Suck—Known Bugs and Exploits in Wetware.

After three days in Portland, I finally ate at Burgerville. Eating at this regional chain is something I look forward to every time I’m in the area. Though, I suppose my change in diet may have suppressed my eagerness and led me to put it off until Friday. In any case, I ordered a cheeseburger with grilled onions (ditching the bun) and a large raspberry shake. While I prefer their blackberry shakes when available, the meal was delicious.

The high point of the conference happened, oddly enough, after it had ended. For whatever reason, I happened to wander into a different area of the convention center, in which a sock knitting conference was taking place. Outside of their expo hall was the Sockgate, a cardboard replica of a Stargate. As we were waiting to take pictures with it, Paul Fenwick happened by and offered to take some photos. He’s a really nice guy and I enjoyed finally getting the chance to meet him. After the photo op, he headed into the knitting expo hall. In retrospect, I should have done the same. It would have been interesting to see what it was like.

Sockgate

Photo Credit: Paul Fenwick

Finally, I learned that when I attend OSCON, I really do need to go for the entire week. Apparently, it takes me about two days to acclimate myself to the environment and really start interacting with people. Of course, by arriving Tuesday night, I was ready to interact on Friday, just as everyone was heading home. It didn’t help that I was staying in a hotel way out by the airport, with MAX service ending before 11:00 PM. With a new baby at home, I certainly don’t regret my choice to be away for a shorter period of time, but if I go next year, I’ll probably go for the entire week.

OSCON 2011: Thursday

Thursday was the second day of sessions at the O’Reilly Open Source Convention (OSCON) and my third day in Portland, Oregon. Overall, the sessions I attended were arguably more relevant to my work than those I attended on Wednesday. Still, the day left me feeling unsatisfied. At past OSCONs, I ended each day with my mind brimming with new ideas, scarcely able to wait until I could put some of them into practice. So far, this year’s conference hasn’t had the same effect on me.

In any case, the Thursday morning keynotes were far better than those foisted upon us on Wednesday morning. Gabe Zichermann’s talk, in particular, caught my attention. In Game theory applied to user engagement in Open Source he talked about using so-called gamification techniques to draw people into using Open Source software. Many of his examples had to do with using game theory to alter real life behavior, such as a lottery to reward good drivers in Sweden or the use of consumption graphs in hybrid vehicles. On a separate note, I tend to grow annoyed at the latter, having been stuck behind too many hypermiling drivers.

Getting into the sessions, I favored those more in line with the work I do as a Perl programming system administrator. Also, it didn’t hurt that The Conway Channel 2011 happened to take place during the first time slot of the day. I’m a bit sorry I passed up DIY Clinical Trials (Or: How to Guinea Pig Your Way to Scientific Truth and Better Health), if only for the reason that it would have been completely different from anything I normally do. But, I attended those types of sessions on Wednesday, so it was back to business, so to speak. Damian Conway was in his usual top form, as entertaining as he is educational. I won’t go into too much detail, only to note that he demonstrated four of his modules, using a theme I’m sure most will recognize. First, something old, updates to the Regexp::Grammars module. He then introduced something new, the IO::Prompter module, which supersedes his older IO::Prompt. There was something borrowed, the Data::Show module, which serves as a convenience wrapper around the Data::Dump module. And finally, something blue, the Acme::Crap module, which seems oddly cathartic.

I like to think I’m a halfway decent Perl programmer, but that doesn’t mean I think I can ignore things like Jacinta Richardson’s Perl Programming Best Practices 2011. The talk was a round-up of the tools and modules that are generally considered to be the best practices by the Perl community today. Yes, generally. People will have their differences of opinion, and I don’t always agree with the advertised best practices. However, if followed, the practices will lead to better code, and if violating a practice, I like to be able to back that up with a well thought out reason (it doesn’t necessarily have to be a good reason). The first of two, possibly pithy, examples of this is the local::lib and it’s default use of ~/perl5 as its include path. I prefer to use ~/local/lib/perl5 and, sure, the module allows me to do that easily enough, but it’s an extra, non-standard step. Second, the cpanm has been touted as the best way to install modules from CPAN. As a control freak with a highly customized CPAN configuration, I’ve never liked the way cpanm seems to do things its way. Admittedly, it may be customizable, but I’ve never had the need to look into it.

There’s been some noise around the office about testing Amazon’s EC2 offering. To that end, I thought James Loope’s Utility and Automation: Low Overhead Operations with Amazon & Puppet would be educational, possibly giving me some ideas about how to managing our own potential EC2 environment. Unfortunately, it didn’t work out that way for me. The talk was heavily focused on the way the web application was designed and pieces of Amazon’s infrastructure were used. We’re not creating or running web applications, so none of it was beneficial to me. There was nothing about Puppet aside from explaining that using it (or another configuration management tool) is vital for keeping everything running.

At this point, I was turned off from any cloud talks at OSCON. There seems to be, with probably good reason, an inextricable tangling of cloud and web applications. Because of this, I decided to pass on Achieving Hybrid Cloud Mobility with OpenStack and XCP and instead attended Piers Cawley’s Polymorphic Dispatch—It’s Not Just a Good Idea, It’s the Law. I’m glad I did, because there were definitely some very useful ideas presented. The idea, taken from Smalltalk, of passing messages to objects has a lot of merit. Combining this with polymorphism, sending a message and allowing different objects to act on it differently, vastly simplifies code. Simple code, of course, is easier to test and easier to debug when things go horribly wrong (and actually is less likely to go horribly wrong in the first place). Of particular interest to me were the Null Object pattern and what Piers referred to as the key tenant of object-oriented programming: tell, don’t ask. That is to say, if I understood correctly, instead of querying an object for information and using it to determine which action to perform, give the information to the object and have it perform the action. Finally, Smalltalk Best Practice Patterns was recommended as the best book on good coding practices out there. According to Piers, it “will change the way you think about programming.”

I was in way over my head in Tom Christiansen’s Unicode in Perl Regexes. The only thing I managed to learn is that I don’t know nearly enough about Unicode to actually understand using it. I’ll leave it at that. It was a very information-dense session and it’s possible that Tom knows more about Unicode than those who designed it. Other choices during this time slot, which may have been better for me, were Connecting iOS to the Real World with Arduino, presented by my friend Alasdair Allan, or, venturing again into the realm of health geekery, Open Source Preventive Medicine: Citizen Science Genomics

The last session I attended on Thursday had so much potential, but, for me, it fell flat. I expected A. Sinan Unur‘s Visualizing Economic Data Using Perl and HTML5′s Canvas to focus far more on visualization than it did. Instead, the majority of the presentation was about the difficulty of parsing public data published by the United States government. For this, Sinan uses Spreadsheet::ParseExcel and explained a few of the techniques he uses to extract data from tables designed primarily for visual consumption. Unfortunately, very little time was spent showing how Canvas was used. We were given one static example and an explanation that there is no method available for determining the height of text in a Canvas element. I had hoped to return to work with some ideas for using Canvas to visualize data from our batch scheduling system, but ultimately left disappointed.

After the last session, I met up with a coworker, an old friend, and a new friend to have dinner at Chipotle. Normally, I like to avoid chain restaurants—national chains in particular—when traveling, preferring to sample the local cuisine. But, we wanted a quick dinner and it was nearby. My opinion was requested, on the relative healthfulness of pinto versus black beans. I simply stated that I would be ordering my carnitas bowl without any beans.

After dinner, we returned to the convention center for the Perl Lightning Talks and the State of the Onion. As always, the talks were quite entertaining. Of note was a juggling demonstration, illustrating various programming languages and databases. Near the end, Ricardo Signes recounted a conversation he had with a couple of women from the knitting conference sharing the convention center with us. Its presence provided a wonderful juxtaposition. While OSCON is male-dominated and many don’t know how to act when women brave their way into our midst, the knitting convention is completely opposite. Ricardo’s message to us was, take the time to look up from our laptops and chat with those around us. We might just have a better time and make new friends.

Finally, Piers Cawley favored us, as he does every year, with a song. This year, however, he did not bear a tale of levity, but a message of deadly seriousness. The United Kingdom is closing libraries in an attempt to reduce public spending. As a protest, Piers wrote a song, “Child of the Library”. There doesn’t appear to be any video (yet) of Piers performing at OSCON, but I’ve gone ahead and embedded one that I found. It’s catchy, I had it stuck in my head for a couple of days after the conference.

We could easily see the same thing happen in the United States—and in fact I have already seen it proposed in San Diego. I’ll first admit that I have not set foot inside a library since college, over a decade ago (high school, if only counting public libraries). Do libraries still matter, or is the concern over their closing merely the knee-jerk nostalgia of those of us who came of age in a world that didn’t yet know the Internet? I can’t, and won’t, take a side on this issue until I’ve taken the time to visit my local library. If I can recognize it as something I saw in my childhood, perhaps it should be closed. If it has adapted to the so-called Information Age, maybe it’s worth funding.

As a final, humorous note, I almost didn’t make it back to my hotel. At least, not without finding an alternate method of transportation. At 10:22 PM, excusing myself and apologizing for staying so far away from the conference, I left Media Temple party at the Jupiter Hotel, arriving at the convention center MAX station at 10:32 PM. The schedule at the station listed 10:42 PM as the last red line train to the airport, with Google Maps concurring that a train was 10 minutes away. About two minutes later an unmarked blue line train arrived at the station, traveling east. At this point, Google Maps had decided it would rather show me its trip planner instead of the previous screen which showed the impending arrival of the red line. Forced to make a split-second decision, I hopped on the train. I knew that I could take it at least as far as the Gateway station, where I could transfer to the red line if it was still behind me. Around 11:00 PM I arrived at Gateway, after spending the ride thinking about how much a cab would cost. This station had a real-time display with train arrival times. The last red line of the day was only three minutes out. Whew.

OSCON 2011: Wednesday

Today marks my first day of the O’Reilly Open Source Convention, since I chose to only attend the sessions this year. I will also depart with my tradition of writing a post for every session I attend. I enjoyed it in the past, but it adds more stress and distraction than I’d like this year. Instead, I plan to relax and enjoy each session I attend. I’ll still take a few notes, but I’ll limit myself to recapping an entire day in a single post.

I had breakfast in my hotel’s restaurant this morning, a mistake I won’t make again —over half the plate was composed of potatoes and toast, leaving little room for the eggs and sausage—. It was an easy walk to the Cascades MAX station, until I saw the train arriving before me. I likely could have made it onto the train had I sprinted, but I also had to buy a ticket, so I let it go. Fortunately, it was the beginning of the morning commute, so another train was not far behind.

This morning’s keynotes were dry. At least, I didn’t find them at all interesting. Well, except for one. I enjoyed Ariel Waldman’s brief talk about Hacking Space Exploration. It reminded me that I don’t spend nearly enough time on Galaxy Zoo.

The final keynote was a so-called surprise announcement. We were first treated to a video in which a bunch of big names in technology—Bill Joy, Tim O’Reilly, and Al Gore to name a few—gushed over the possibilities of commodity cloud computing. All that build up ended up being nothing more then a lead-in to an overblown advertisement for something called Nebula. While the idea of open and commodity elastic compute is cool, I have difficulty taking something seriously when it’s surrounded by as much hype as I saw during the keynote. Maybe I’m alone in this, but OSCON doesn’t really seem like the right venue to go heavy on marketing and light on technical detail. Maybe those of us sitting in the ballroom weren’t the real audience for the announcement. Perhaps they were just using the large and popular conference as a way of getting media attention.

So, what sessions did I attend?

About half way through OSCON last year, I realized that attending Perl sessions was mostly a waste of my time. They tended to fall into two categories: stuff I already knew and web development (which I don’t do). Where do I end up for the first session of this conference? In Perl 5.14 for Pragmatists, presented by Ricardo Signes. For anyone who has read the Perl release notes (perl*delta), very little of what was presented will be novel. However, it was very useful to see the relative emphasis placed on different features by someone as familiar with Perl as Ricardo. In particular, fully half of the session was dedicated to Perl’s improved Unicode support. As Ricardo stated, Unicode isn’t going away, so we need to get better at working with it.

After attending a session of some relevance to my profession, I wanted to take advantage of a series of back-to-back sessions of a more personal interest. My passions of late have leaned towards health, fitness, and, in particular, a more so-called primal lifestyle. So I was excited to see the session Geeking in a Cabin in the Woods, presented by Ryo Chijiiwa on the schedule. Previously employed as a software engineer at Yahoo! and then Google, Ryo took us through the history and motivation behind quitting his job, buying 60 acres of barren land in northern California, and simplifying his life by living on it. It was a fascinating tale of overcoming challenges. Part of me would love to do exactly what he did. Ryo has a blog (with a really cool domain name) where he writes about his experiences.

Following in the same basic genre, I next attended Sarah Sharp’s talk on Growing Food with Open Source. Sarah is a Linux kernel hacker who also enjoys gardening. Being a lazy hacker (I can relate), she wants to automate all of the mundane, tedious work that comes with a hobby like gardening. She’s written code to manage planting calendars, hoping to eventually integrate it with a service like Remember the Milk, and an Android app to alert her of impending weather conditions that could affect her garden. The most impressive piece was the work she’s done to create an automatic watering system, using home-made moisture sensors and Arduinos. More information can be found on a site I will soon be spending a lot of time on, Garden Geek.

My earliest computer-related memory is playing text adventures on our Apple Macintosh, circa 1984. For that reason, I was excited to attend Ben Collins-Sussman’s talk on The Unexpected Resurgence of Interactive Fiction. So excited, in fact, that I passed up a session r0ml was presenting. Ben took us through a brief history of interactive fiction, from Adventure to present day. He talked about both the science and the art of the genre as both have evolved over the years. He focused primarily on the Inform language and the Glulx virtual machine (not to mention current efforts to produce a web browser-based player), which leads me to think that there isn’t much point in putting any more effort into playing with TADS. He also mentioned the annual Interactive Fiction Competition, which I love and have participated as a judge in for the last several years. This session has gotten me excited about interactive fiction again, after mostly ignoring it as a hobby for the last few years. I have a couple of ideas for games that I’d like to enter into the competition, which I should finally get started on.

For the final two sessions of the day, I decided to return to my core competency, and arguably the whole reason I’m here, and sat down in the Perl room. Damian Conway talked about (Re)Developing in Perl 6. I’ve previously attended his six hour class on this topic, but it was a nice refresher, since I don’t use Perl 6 regularly. He guided us through porting a handful of his modules—Acme::Don't, IO::Insitu, IO::Prompter, and Smart::Comments—from Perl 5 to Perl 6. Each of these modules was selected as a representative of a given method used to port the code. In the simplest case, a basic transliteration can be used. For some modules, new features of Perl 6 can be used to replace long pieces of code; argument lists are a great example. Finally, the ability to extend the grammar removes the need for source filters and allows the programmer to seamlessly add language features.

I ended my day with a session on improving code performance: Sooner, Cheaper, Better — Optimization on a Budget, presented by Eric Wilhelm. I didn’t find it very well organized or delivered, which is a shame, because I’ve seen him present before and he was rather good. After introducing us to the Rules of Optimization Club, Eric took us through a number of real world examples in which optimization might prove to be a waste of time. Old hat for a lot of people, I know. In fact, many people just wait for computers to get faster. However, he then switched gears into a more interesting problem. With today’s advances coming in the form of more cores rather than more speed, optimization was replaced with parallelization. The same rules apply and it’s good to remember that.

Following the last session of the day, a booth crawl was held in the expo hall. This involved setting up food and drink tables at the booths of various vendors, the idea being to bribe attendees to approach them. There was beer, possibly wine, and the food leaned heavily towards cookies and grain-wrapped items. I wandered around, played a Mario Kart-like Pac-Man multi-player racing game on an Android tablet at the QuIC booth, ate a bunch of cheese, and left at 7:00 PM …

To attend the .vimrc birds of a feather (BOF) session. A .vimrc, oft pronounced vim-wreck, is the name of the configuration file Vim uses. It’s more than a configuration file, though; it’s a full scripting engine, which provides quite a bit of potential for customization of one’s editor. Damian Conway, famed teacher of Vim, Perl, and myriad other topics, was in attendance. As expected, the entirety of the session was spent learning about some of the neat, as yet unreleased, scripts Damian has been working on for Vim.

I didn’t have it in me to attend any of the evening events. I was aware of two parties, but I neither wanted to drink nor stay out late. Unlike years past, I haven’t been very social this year, either. Instead, I made the relatively long trip back to my hotel, where I wrote this post (well, just the first draft; I finished it on Thursday morning over the lousy coffee provided by the Oregon Convention Center) and turned in early.

OSCON 2011: Tuesday

This marks the fourth time in five years I’ve attended the O’Reilly Open Source Convention (OSCON). I skipped it in 2009, when it took place in San Jose. This year the convention is back in Portland, Oregon, as it was last year. So I’m here, too.

Unlike in previous years, I didn’t show up on Sunday to explore Portland and attend the Monday tutorials. I didn’t want to spend an entire week away from home, but at the same time, nothing I saw on the tutorial schedule interested me. So I flew up Tuesday afternoon and plan to return on Friday night.

Most of the hotels near the Oregon Convention Center (OCC) were booked up, and I left my itinerary planning to someone else (who is unfamiliar with Portland), so I’m staying at the Courtyard Marriott by the airport. This wouldn’t be so bad, but, according to Google Maps, it’s a 1.2 mile walk to the Cascades MAX station.

Anyway, after getting settled in my hotel room, I headed to the OCC to meet up with my friend, Jonathan. I made it in time to register, pick up my swag, and grab some cheese and beer on the expo floor. I wandered over to the QuIC booth to chat and saw a nice demo of Android and HTML 5 applications running on Qualcomm demonstration hardware. It really showed off the power of the platform.

We decided not to stick around for the so-called OSCON Carnival, so hopped across the river on the MAX and looked around for dinner. In our wanderings, we dropped into Bailey’s Taproom to use the bathroom and have a beer. The bartender recommended the Davis Street Tavern for a good burger paired with a good tap list. I ended up having seared scallops, which were quite good. After dinner, we wandered over to the Puppet Labs party, where I got a souvenir Open Source Lab beer mug.

Bailing fairly early on the party, I caught the MAX red line back over the river and on to the Cascades station. The hotel’s shuttle driver had warned me against the walk, pointing out that there are no sidewalks. However, Google directed me away from the main road and through a business park. I don’t know why people are so averse to walking more than a couple of blocks. I found the walk to be quite pleasant, and there are blackberry brambles growing wild along the streets, providing snacking opportunities. It takes me back to childhood trips to the Pacific Northwest, when I would pick wild blackberries with my grandfather.

Back at the hotel, I grimaced at what they call a fitness center, swam a bit in the poor excuse for a pool, and soaked in the hot tub. Then it was off to bed, because, unlike the lucky folks staying near the OCC, I have to wake up in time for a 20 minute walk followed by a 25 minute MAX ride.

Before & After: Why I Care About My Health

At the beginning of the year, I commented on my weight loss success. To recap, that guy over on the right, that was me back in April 2007. Looking at the picture now, I barely recognize myself. Wow, I was fat. I couldn’t do a single pull-up without a machine providing weight assistance. Then, in September 2008, my first daughter was born. That was the motivation I needed to not just lose weight, but to improve my overall fitness. I was determined to be a healthy influence for my kids. Fortunately, the event coincided with learning about carbohydrate restriction for weight loss and a Paleo lifestyle for overall health.

Fast forward four years. We’re spending the July 4 weekend with my parents in Big Bear Lake. There’s a nice park with a playground down by the lake, about half a mile from the house. Playground equipment isn’t just fun for children and is way more exhilarating than a stuffy old gym. There are kids climbing, swinging, and sliding, contributing to an energetic atmosphere. The warm sun beats down me, manufacturing that essential of hormones, vitamin D. Not only is the equipment is good for the climbing and sliding you’d expect, but it’s good for pull-ups and dips. No one has told any of the kids that they need to go to the gym to exercise, they’re doing all of this for fun.

So now this is me, playing with my daughter at the park this morning after breakfast. Inspired by MovNat, I couldn’t help myself. I saw those angled supports on the swing set and thought it would be fun to climb to the top. It turned out to be really easy. After doing a few pull-ups at the top, my daughter looked at me and asked, “Are we swinging, Dada?” I replied, “Yes, sweetie, we are swinging.”

Moments like this are why I’ve become so obsessed with health and fitness over the last few years. I can play with my daughters. I mean, really play with them. I’m not standing around the edges of the playground, merely encouraging them to do things I can no longer do myself. Someday they will be able to climb higher, run faster, and jump farther than me. But that day is far off and, as long as I’m around, I will give them a run for their money.

No Fair Food This Year

Every year my wife and I attend the San Diego County Fair at least once or twice. Aside from the garden exhibits and animals, one of the big lures is the food. I mean, doesn’t this look delicious?

Fried Food at the Fair

Fair Fare

Not pictured is the deep fried s’more, which was a big hit with my daughter last year. It appears to have been replaced by the deep fried brownie.

A few years ago, I could eat a funnel cake, a battered onion, a doughnut chicken sandwich, some Indian fry bread, and follow that with various and sundry deep fried candy bars. As each year passed, we ate a little less of the food. Last year I could only stomach a couple bites of funnel cake after helping my daughter eat her deep fried s’more.

I took my oldest daughter to the fair today, to get her out of the house and shower her with attention after the birth of her baby sister. We even stood in front of the vendor pictured above. In the end, I ate nothing at the fair. There wasn’t anything that looked at all appetizing. Actually, the smoked turkey legs always look awesome, but I refuse to pay $10 for something I can make so easily myself. Maybe finally removing these foods from my diet has had an effect on my taste. Maybe the fact that I’ve been slowly replacing my wardrobe with size small shirts and, just yesterday, purchased several pairs of size 32 shorts, kept me from partaking of such disgustingly unhealthy fare. Either way, I don’t really miss eating that stuff.

Welcome Brenna Rose

Brenna Rose

Brenna Rose

At 12:25 AM on Sunday, 12 June 2011, we welcomed our second daughter, Brenna Rose, into the world. Weighing 5 pounds, 14 ounces (2.67 kg) at 19 inches (48.26), she’s a tiny thing. Mom and baby are doing great. We think she’s another redhead, but we’re not entirely sure yet.

Trying Out a CSA

csaweek1CSA is short for community-supported agriculture. Last summer, the company I work for set itself up as a delivery location for the Sage Mountain Farm CSA. I’d been talking about signing up for it since it was announced and, last week, finally did so. I pledged for four boxes, just to try it out, and my first box was delivered on Wednesday. Getting the food home was interesting. I take the train to work, so I felt a bit strange standing on the train platform holding a box of fruit and vegetables.

Wow, what a lot of food. The picture on this post doesn’t do it justice. I was only able to fit about half of the included produce in my refrigerator and left the rest on the counter. Unfortunately, after Saturday’s heat, this meant that we had to throw some of it out. But, I was able to use most of what was on the counter before we did. I’ve never taken the time to try cooking beets or parsnips, and rarely buy chard, so having it selected for me was fun. That was one reason I wanted to try a CSA.

The sheer amount of food in the box caused me more stress than it was worth. I had expected the box to be much smaller and that we would still be able to visit the farmers market, which we enjoy attending. Suddenly something I thought would be a joy has become a burden. Why is there so much lettuce? I don’t even like salad. How can we possibly eat all this food? Where can I store it every week? How will I fit other food in my refrigerator? The small box, which I ordered, is advertised as being able to feed a family of two or three for one week. The members of that hypothetical family must be big fans of Michael Pollan, because they’d have to be eating mostly plants. We are not that family.

I have three more boxes coming over the next three weeks, so I’ll see how it shakes out. I’ll need to figure out what to do with the food when I receive it. I’m thinking of starting an extended family dinner and game night on Wednesdays, cooking as much of the food as possible and sending everyone home with leftovers. The rest I’ll prepare just enough so it won’t take up too much room in the refrigerator. Even so, I think that after the fourth box, we’ll go back to making our regular Saturday trips to the Vista Farmers Market. The market is more enjoyable for us. It gets us outdoors, we can pick our own food, and we can interact with the farmers and vendors.

For Want of a Newline

This article is also published on my Perl blog.

Today I had the pleasure of spending three hours debugging an obscure bug. An obscure bug I caused by introducing a newline. That little punk, 0x0A.

I released a new version of a command line program. It’s an elegant piece of work, combining a marvelously complex-but-intuitive configuration for system administrators with an absolutely simple interface for users. To use the command, the user runs it with a couple of arguments and it prints out a single line of useful text derived from that marvelously complex configuration.

But, it doesn’t print a newline.

It’s never printed a newline. The original author didn’t include one for some reason. Anyone who has ever encountered a command like this knows well my irritation.

my awesome prompt> some_lame_command
my awesome prompt>e answer

Argh!

The workaround I’ve seen used, after seeing the above is to face-palm, then run the command again, only differently.

my awesome prompt> echo `some_lame_command`
42 is obviously the answer
my awesome prompt>

I’m embarrassed when users see behavior like this from a program I wrote. Being the arrogant bastard programmer that I am, I decided to fix this. Since all commands print newlines, everyone should already be assuming that this one does too and should already be handling it in the proper manner. Right? When writing a shell script, the distinction between newline-printing and non-newline-printing commands is irrelevant. In either Bourne shell:

FROBBED=`frobnosticate`

Or C shell:

setenv FROBBED `frobnosticate`

The shell is benevolent enough to remove the newline, if it exists. After all, this is the most commonly desired behavior when assigning command output to a variable. However, things are a bit different when switching to a so-called real programming language, like Perl:

$ENV{'FROBBED'} = `frobnosticate`;  # Caution, newline ahead!

Sure, it looks more or less the same, but veteran Perl programmers will immediately grimace when reading the above. Unlike the shell, Perl, like other programming languages, will preserve the output of the command verbatim. In this case, preserving data and letting the programmer decide how to use it is the most commonly desired behavior. Since everything coming from an external command ends with a newline, the environment variable being set in this case will have a newline. This will almost always cause a problem. One that, as I’ve learned, is not always easy to find. Since stripping input of newlines is just as common as the desire to preserve data, Perl makes this easy and most Perl programmers will habitually write it.

chomp( $ENV{'FROBBED'} = `frobnosticate` );

Now it doesn’t matter if the command prints a newline or not, the chomp built-in has your back. It’s just like being in the warm embrace of the shell, only with a little extra syntax.

So it turns out that one of the engineering groups I support was using a Perl script that set an environment variable as in the first example. The value of this environment variable was then being passed off to the batch system and used by an engineering program as a network address to connect to. Of course, the program made the fatal mistake of trusting user input and, in a spectacular fashion, failed to connect to the server whose name just happened to contain a newline.

After chasing down a couple of red herrings which left me flummoxed, one of the affected users shared with me an error log and the script that generated it. There, in all its syntax highlighted, mono-spaced glory was the environment variable being set without any attempt made to trim off the newline. I immediately swallowed my pride and released an updated version of the command reverting the newline behavior and the problem went away. My engineers—at least, the subset using this particular in this particular way—could once again get their work done.

By far, this isn’t the worst thing I’ve done to our batch system. One time I caused all jobs executing on Solaris hosts to immediately fail. Whoops.

Anyway, what’s the lesson to be learned from today’s experience?

Never—and I’ll repeat that, never—assume everyone will be doing the right thing (remember what they say when you assume something). Inevitably, someone won’t be.

There’s a corollary to today’s lesson. When coming across something that could be improved with a small change, don’t. Seriously, just don’t. Inevitably, someone will be depending on the current behavior, no matter how right or wrong it may seem. This is why the phrase “bug compatible” exists in the lexicon.

A 30 Day Challenge, of Sorts

Over the weekend, while reading posts from Richard Nikoley about Leangains and Primal Toad about his 30 day Paleo challenge, I got to thinking. Why not do a 30 day challenge of sorts myself?

Why of sorts?

I’ve never been one to stick to anything every day for an extended period of time. Even 30 days is extended for me. After a couple of weeks I tend to get bored or distracted and generally change things or abandon them altogether. This blog is a perfect example of the sporadic nature of my hobbies. I tend to make permanent changes to my life gradually. A little change here, another complementary change down the road, and so on until they add up to a big change. How I ended up in my current state of Paleo illustrates that progression pretty well. So I’m not taking this challenge as seriously as I perhaps should, but I’d like to try something.

I wrote previously that I weighed in at about 172 pounds. Well, that was three weeks ago and I’m still hovering around that number. A friend of mine, @augmentedfourth on Twitter, started tweeting his daily weight. Last week I decided to give it a shot.

Tweet Your Weight Chart, 14 Feb 2011

Granted, the data are rather limited, but the first thing I noticed is that I haven’t just plateaued, but my weight appears to be trending upward! I decided that I had to do something to break through my plateau. Fortunately, this coincided with reading the aforementioned posts. So I put a plan together.

First, I will start using the FitDay account that I opened way back on 14 September 2010, when I weighed in at 186 pounds, and hadn’t touched since. I’ll have to get over my initial annoyance with entering food and activities and my displeasure at discovering that I’ve only lost 14 pounds in the last five months.

Second, I will re-craft my workout based on the Leangains descriptions. Today I performed deadlifts, chin-ups, and some crunches. More importantly, I will stick to a gym schedule and track my progress.

Third, of course, I will stop cheating on my diet. My biggest problems are drinking milk and going back for seconds (and sometimes thirds) at dinner. It’s not like I ever eat bread or candy, but I did have a few chips at a Mexican restaurant last night.

I’ll do my best to stick with this plan for at least 30 days so I can give it a full and fair evaluation. Maybe it will help me break through my plateau and become one of those incremental lifestyle changes. As a bonus, I may even see some muscle definition.