Generational Shenanigans

It is a complete shame for this tidbit to buried, as it is, in the middle of FiveThirtyEight’s daily news summary. I want to tattoo this on the forehead of every journalist who writes all-knowingly about millennials.1

8 percent

Percentage of those ages 18 to 34 who identified themselves as members of the Greatest Generation in a Pew survey, to which I say damn right. Are people in that age range typically described as “millennials”? Sure. But let’s get a couple of things straight. First, naming generations is a pseudoscience developed by charlatans with peculiar and frankly stupid notions of generational predestination. Second, any society that has convinced itself that its greatest generation has past—and do not get me wrong, they were awesome—dooms itself to decline. Third, naming a new generation before its finest hour is an act of desperation that the dying prosecute on the ascending. Are 18- to 34-year-olds millennials? Maybe. Are they the greatest generation? Give us a few years to find out. Kudos to the 8 percent who think they already know. [Pew Research Center]

  1. Or any other generation, really. Except the baby boomers. I only tolerate stereotyping of baby boomers.2 

  2. And no, I’m not a millennial. I’m in some sort of nether region between Gen X, Gen Y, and millennials, depending on whom you ask. Did I mention that this was all nonsense? 

Building an Exercise and Weight Display: Part 1

[I’ve called this Part 1. Let’s see if I get around to writing parts 2–4.]

While doing some overplanning in the last few weeks of the year, I built a few text files and spreadsheets. In the process, I decided that some sort of display would be worthwhile for keeping track of a few goals that I had developed. I thought about Dashboard widgets, but they seem to be waning. And then I thought about NerdTool/GeekTool, but those never worked very well for me when switching monitor resolutions, which I do often. And then a friend mentioned Übersicht, which I didn’t think I had heard of, but Brett Terpstra has written a couple of widgets. So, I’ve probably at least heard of it.

So, I played with some of the widgets from the gallery, and developed the beginnings of the heads up display that I wanted. But, one of the things I wanted was a way to track weight and exercise. I’ve been tracking my running for the last few years in RunKeeper, and I’ve been tracking my weight, off and on, in Weighbot. So, the first question was how to get the data out.

Weighbot presented a problem. It is mostly an iOS app, although it has a cloud backup service. The cloud backup service will let you download all your data in a CSV file from a website. This could probably be automated. But, my tests suggested that Weighbot usually did a backup immediately upon app launch. My usual usage pattern is that once a day I launch the app, enter my weight, and then close the app. The backup on launch, though, meant that the data set I downloaded was always missing today’s data point, unless I forced an additional backup. Then I realized, though, that RunKeeper could also track weight. I put a couple weeks worth of data points in, and I was off to the races.

RunKeeper has an API called HealthGraph that lets other apps access their data. I assumed that access to this API would be simple, like for Flickr or But it’s a little more involved. First, you register, and they give you a Client ID and a Client Secret. You then use the Client ID to get RunKeeper to generate a Code. You then use the Client ID, Client Secret, and Code to generate an Access Token, which finally lets you access the data. Figuring all this out and making it work seamlessly is probably worthwhile if you are building an app for the masses, but it was quite a lot of trouble for a one-off data display. Luckily, this blog post walks you through the steps and provides the necessary snippets of code.

Then, I was off to the races. Starting by stealing some API access code from Dr. Drang, I used my new Access Token to create some Python code that downloads my run data and my weight data. Basically, you request a URL with a couple extra headers (including the Access Token) in the HTTP request, and you get back JSON blobs of data. I then wrote code that processed those blobs into a graph and extracted the bits of raw data that I wanted to display. At that point, I needed to get the raw data over to Übersicht to format for display. I puzzled for a bit about how to do this, and I wound up with an obvious solution—another JSON blob. Since Übersicht uses a JavaScript-related language called CoffeeScript, I assumed that processing the JSON would be straightforward, and it was.

Here’s the code that downloads the necessary JSON blobs. It requires a bit of explanation. First, it gets the Access Token from a file called .runkeeper that I keep in my home directory. Then, it makes an initial call to the RunKeeper API to get a JSON blob of user information. In fact, with the exception of a User ID, this blob contains almost no actual user information. What it contains, instead, are pointers to the URLs to use to obtain the desired JSON blobs. In fact, these seem to be static strings, but the API documentation insists that they should not be hardcoded. Thus, the next two calls to the RunKeeper API use the information from the user blob to request the fitness_activities blob and the weight blob.

# coding=utf-8

from __future__ import division
from __future__ import unicode_literals
import json
import urllib2
from os import environ

# Get my Runkeeper Access Token
  with open(environ['HOME'] + '/.runkeeper') as rcfile:
    for line in rcfile:
      k, v = line.split(':')
      if k.strip() == 'access_token':
        AccessToken = v.strip()
except (IOError, NameError):
  print "Failed to get Access Token"

# Get the user from Runkeeper
  userReq = urllib2.Request('') 
  userReq.add_header('Authorization', 'Bearer ' + AccessToken) 
  userReq.add_header('Accept', 'application/')
  userJsonString = urllib2.urlopen(userReq).read()
  user = json.loads(userJsonString);
except (IOError, ValueError):
  print "Connection failure for user."

# Get the fitness activities from Runkeeper
  fitnessReq = urllib2.Request('' + user['fitness_activities']) 
  fitnessReq.add_header('Authorization', 'Bearer ' + AccessToken) 
  fitnessReq.add_header('Accept', 'application/')
  fitnessJsonString = urllib2.urlopen(fitnessReq).read()
  fitness = json.loads(fitnessJsonString);
except (IOError, ValueError):
  print "Connection failure for fitness activities."

# Get the weight from Runkeeper
  weightReq = urllib2.Request('' + user['weight']) 
  weightReq.add_header('Authorization', 'Bearer ' + AccessToken) 
  weightReq.add_header('Accept', 'application/')
  weightJsonString = urllib2.urlopen(weightReq).read()
  weight = json.loads(weightJsonString);
except (IOError, ValueError):
  print "Connection failure for weight data."

Each call to ‘json.loads()’ parses a JSON blob and turns it into a Python dictionary. The structure of these dictionaries (JavaScript Objects) is explained in the HealthGraph API documentation. Here is the documentation of the fitness_activities blob, and here is the documentation for the weight blob. There is no real error checking, and your mileage may vary, etc.

It’s been a fun little project. If I were to write a second part of this blog post, it would be on extracting the running data for display (and retrieving my training plan from a text file for display, as well). If I were to write a third part, it would be on extracting the weight data, computing my weight goals, and creating a plot of both the data and the goals with Matplotlib. And if I were to write a fourth part, it would be on writing the HTML, CoffeeScript, and CSS to display everything as an Übersicht widget, which was by far the most painful part of the whole process. But I’m a professor, so I may leave those tasks as an exercise for the reader.

Bits and Pieces

  • Blogging 101 wasn’t for me. I sortof knew that it was for new bloggers, but I thought that I could make it work. I couldn’t or didn’t. The assignments didn’t appeal to me. Besides, November (and the first half of December) is a busy time in academia. So, it didn’t really happen. So it goes.

  • But, I’ve given up social media for Advent. So, maybe while I’m absent from Twitter I’ll blog more. Maybe. Do people give things up for Advent? Not that I know of. But I have to take periodic breaks from social media or it starts to make me crazy. Advent and Lent seemed like one way to do it; both are seasons of waiting and preparation.

  • If you miss me that much, though, I’ve decided that Instagram doesn’t count. (Mostly because I follow only a few people on Instagram and the volume of posts is light.) Will I blog more often or Instagram more often? Yes. Maybe.

  • Every December for the last several years I’ve hit Instapaper zero. It happened by accident the first time or two—Winter Break is conducive to reading all the things—but for the last couple of years it has been intentional. And as I started making my way through my queue this year, I finally read Ta-Nehisi Coates’s piece on reparations from last June. Wow. There is so much about the history of racism in the United States that I was never taught. The piece was widely lauded, so I’m late to the party, but it’s probably the best thing I’ve read this year.

  • On a lighter note, I’m a long time fan of Merlin Mann, and hence a long time listener to his podcast with Dan Benjamin, Back to Work. If I may be so bold, it is a lot of nonsense punctuated by moments of brilliance. And in the most recent episode, a little after 1:27, Merlin says, “The problem is you still have hope about email. That is hell. Hell is believing that there is hope in email. The only thing that can actually help you is to realize that it is completely hopeless.” My name is Allen, and I have an email problem.

  • And today, after finishing up that episode, I was listening to this fantastic interview of Ira Glass by Alec Baldwin. So, so good. I don’t listen to Alec Baldwin’s show very often, but maybe I should. (I wrote a whole post about his interview of Billy Joel back in 2012.)

Here We Blog Again

Lots of people are talking about blogging again, from well-known folks that don’t need a link from me to my friend Steve. And a Twitter conversation yesterday about the subject with local bloggers Alice and John led to this post. So, I signed up for Blogging 101 this month. Not because I need the training, but because I surely need the encouragement.

The first assignment is to post about “who I am and why I’m here”. I’m Allen. I started blogging in October 2001—you can see the archives down the right side there. I haven’t always blogged consistently, to say the least—you can see that down the right hand side, too.

A lot has changed for me since October 2001: I finished my Ph.D., got a tenure track job, and got tenured and promoted. Along with that tenure track job, I moved to Southwest Virginia and bought my first house with my lovely wife, Becky; this summer, we sold that house and bought a different one across town. We did that in part because it isn’t just the two of us like it was back then; now, there are three more: Charlie (8), Megan (6), and Noah (4). We lived in Ireland for a year, too, all five of us, and it was fantastic. So, I guess I’ve been busy.

But I’m back to blogging because I need a place online to call my own. This blog has always been about precisely whatever I feel like writing about. It’s not a professional blog; it’s a personal one. It will be about my hobbies, my fascinations, my family, and my free-floating opinions. I admire bloggers who cross professional lines and write amazing blogs about their professional expertise, but so far, I don’t seem to be one of them. If that changes, you’ll be the first to know.

I tweeted on Friday that “I work with some fantastically generous, brilliant people.” The same could be said for my friends, online and off. I hope this blog keeps me in touch with those friends, reconnects me with old ones, and helps me make some new ones. Is that too much to ask? I don’t think so.

A Paean to a New Favorite: Bell X1

I’ll be the first to confess that I have eclectic musical tastes. (A common feature is that I almost exclusively like singer-songwriters, though.) So, standard disclaimers apply. Lately, though, I’ve been listening to Bell X1 a lot, though, and I wanted to share.

Bell X1 is a band from Dublin, Ireland. They popped up on my radar last Fall, a few months after we returned to the states. I don’t even remember how I first came across them. But I liked the bit that I heard, and their Wikipedia page claimed they were the second most popular Irish band in Ireland after U2, which seemed like an interesting (if impossible to measure or verify) factoid. So, I bought their double live album, Field Recordings, released in 2012.

I played it often and continued to like it. Months later, I found myself on the band’s website just after they’d announced their 2014 US Tour. One of the tour dates was to bring them to Maryland, where my in-laws live. So, I hatched the scheme of making a weekend of the concert, leaving the kids with their grandparents, and I bought a pair of tickets.

Shortly after buying the tickets, I bought their latest studio album, Chop Chop. I listened to it several times, but it didn’t really click for me. I mentioned to a friend in Ireland that we were going to see them, and he shrugged (virtually) but said they were probably good live.

“Good live” was a dramatic understatement, though. They were fantastic live, particularly in an intimate venue. The musicianship, as the band members moved effortlessly from instrument to instrument was astounding, and, though they have a clear lead singer, they were all great vocalists, too. The lyrics were a bit easier to understand live, too, and I was moved by them. Not only that, but they played several songs from Chop Chop, and it really made those songs come alive for me.

My new favorite from Chop Chop is probably “Feint Praise”. I like the overall message of the song, about the bankruptcy of conflict avoidance, and I love the description that faint praise has a “bitter aftertaste, like rust.” But I also just love the almost-non-sequiter in the bridge, because it’s just dripping with Irishness: “You must never squeeze the teabag // Leave it alone // What did it ever do to you?”

But the last song on Chop Chop has also really grown on me since the concert. It’s an apocalyptic song called “The End is Nigh”, but it’s less about the end itself than about the people we’d choose to be with in the darkest of times. We saw Bell X1 on September 12, and the band had played in New York City the night before. They mentioned that they didn’t play “The End is Nigh” though, because it seemed too “close to the bone” for that day. Some lyrical goodness from that one: “And flailing like a landed fish // Trying to get back to before his day went awry.” I find that image both funny and deeply resonant.

But this post was actually prompted by the video below, which the band tweeted today. It’s from that September 11 show in New York City. They played the same song in Annapolis the next night as their first encore. I don’t think it gives you a great feel for the band’s music, because they’re really a “Pop/Rock Combo” (their description, in another song) that mostly plays original music, and this is an acoustic cover. But it gives you a feel for their incredible musical talent, even if the live audio recording leaves a bit to be desired. It’s a song called “She’s a Mystery to Me” written by Bono and The Edge for Roy Orbison, who popularized it.

Bell X1 “She’s a Mystery To Me” from Patrick Glennon on Vimeo.

This afternoon, I also learned that the lead singer of Bell X1, Paul Noonan (on the right in the video), has a computer engineering degree from Trinity College Dublin. So, I guess that by itself explains just about everything about my newfound love for a random band from Dublin.

Coffee Heresy

You can make great coffee at home or work. Lots of people have written about how to do it. Maybe later, I’ll tell you how I do it. But for now, here’s a great article. If you want, you can skip the geeky back story in that article and jump straight to the six principles. They are simple. They are solid. You are welcome.

Let me make an observation, though: The equipment required to make a great cup of coffee is relatively inexpensive. You’re going to need a conical burr grinder, but you can get a Hario Mini Mill for \$29 (and I’ve seen them for less). You have several choices for brewing equipment, but the main options are less than \$25. You’ll also need a way to heat water, but you probably have one of those already.

But once you get into it, there’s a world of stuff to learn about growing regions and farms, about roasting, and about your personal preferences. I haven’t scratched the surface of most of this stuff on my own coffee journey. I just know when it tastes good, and I appreciate that it is an agricultural product handled with love and care by my favorite local roaster.

You cannot make great espresso at home or work. At least, you can’t without a lot more time, effort, and money than you are probably willing to invest. In terms of money, they used to say that a good espresso machine would set you back at least \$2000. I’ve been watching these guys since their Kickstarter went live, and from everything I hear they make an amazing machine, breaking new ground in “inexpensive” home espresso, for \$800.1

Once you get a decent machine, you’re going to need some training. Seriously, if you want to do this right, you need barista training, and you need to get it from someone good. And then you’re going to have to practice, a lot. But even then, you’re probably not going to pull a perfect shot first thing every morning. How do I know? Because I regularly see great baristas who have pulled thousands of shots throw them away when they don’t come out right. And I’ve been served lousy espresso by baristas that ought to know better. You have to get the grind dialed in, the portafilter tamped just so, and then you have to get the temperature, pressure, and timing right. And then, for many espresso drinks you have to learn to properly steam milk, and keep things clean in the process.

I like espresso drinks. My favorite drink is the latte, but a good espresso shot can also be divine. But take my advice: Learn to make good coffee at home, and find a great local coffee shop to make your espresso drinks. Treat yourself, and think of all the time and money you are saving. You can buy me a latte to thank me.

Here comes the heresy: If, even after reading my advice, you absolutely must have espresso at home or work, Nespresso is probably the way to go. You can get a Nespresso machine for under \$200. The capsules aren’t cheap, but neither are they particularly dear (about \$0.65 each). They’ll give you a consistent, espresso-like experience, no skill or training required. I used them at work in Ireland, because there was a machine at the office.2 Nespresso is served in Michelin-starred restaurants and sometimes beats espresso in taste tests. I think those taste tests are flawed (and there are others that contradict them), but I think they make my point, nevertheless. The likelihood that you are going to make better home espresso than a Nespresso machine without a substantial investment of time, effort, and money is nil. I will add, though, that I have never used their milk frothing contraption; you’re on your own, there.


Anyway, that’s my advice: Learn to make great coffee at home and work. Buy your espresso drinks from your friendly neighborhood barista and leave a tip. If you won’t take that advice, though, then Nespresso might be your ticket.

  1. One of the guys who started the company was a VT engineering graduate student, so I have followed the project from the start. Despite everything I say here, I sortof wish I had gotten one of their machines for \$200 or \$300 during the Kickstarter. Back in those halcyon days they thought their machine would retail for \$400. 

  2. I did, in fact, bring a grinder and an Aeropress to Ireland with us to make the great coffee described at the beginning of this post. But I kept and used those at home.