whazzing around

a thing on the internet

Becoming the Finisher

| Comments

Via Hacker News this morning I read Jacques Mattheij’s The Starter, the Architect, the Debugger and the Finisher. It was a great topic and one that I think about often; for me personally finishing projects smoothly is my biggest challenge.

For me, starting projects is a great time to be alive. I love bootstrapping repeatable builds, testing systems, automatic doc generation, etc. It’s a reflexive response having seen so many projects that were doomed from the word ‘go’ by developers who named folders any old thing. Even folks that joined the team within the first year were confused as to where code was located and what (if any) naming conventions existed.

Similarly, I’ve been writing software for millions of users for ten years now and these days I think intensely about architecture when bootstrapping new components or applications. Making the appropriate trade-offs between short- and long-term design up front will accelerate development while leaving you open to pivoting or scaling when the time is right.

My problem comes to the final touches of a release. For example, often when I’m working on a new release of fitgem I code up the functionality, write new tests, write inline API documentation as I create new methods, etc. After I think I’m done I’ll take the library for a spin in Pry and start coding against the new API functions. Things will go well for awhile and then I’ll hit a snag where I forgot a parameter or had a typo in the code. Great! My ad-hoc testing revealed something I hadn’t included in the unit tests. AND THEN I RELEASE. This is not a good thing, but I often spaz out when I get 95% of the way to finishing, hit a snag, and then fix my issue. I guess I feel exasperated about how long this thing is taking and then just wig out and push it (WE’LL DO IT LIVE!)

To be a good finisher I need to slow down and restart my release process (as light as it is!) when I hit problems. I need to suppress the anxiousness when I hit minor problems before pushing live, go back to the top of my checklist, and start it over. Doing that on small projects like a gem will instill good mental resistance to spazzing for large, important releases.

Don’t Call Me an Engineer

| Comments

When I go on campus to do university recruiting, or I’m in a non-technical social situation where I must explain what I do for a living, I often take great pains to explain what should be a simple thing. My title in my company is “Senior Software Engineer” but I always very precisely call myself a “software developer,” “programmer,” or “software nerd.”

I am uncomfortable specifically with the “engineer” label, and that discomfort stems primarily from a panel discussion I attended in conjunction with the UW Engineering Career Services group.

For some background, at the University of Wisconsin-Madison, Computer Science is not part of the School of Engineering, but a department in the School of Letters & Science. Even so, Computer Science students are given leave to particpate in School of Engineering career fairs and recruiting due to the crossover technical skillset.

As someone who conducts on-campus interviews and attends career fairs for my company at UW I was invited to a panel discussion on “starting your first engineering job after graduating.” It was a fantastic topic for a panel because many seniors are so busy interviewing, wrapping up courses, and thinking about relocation concerns that they often don’t think much about the actual beginning of a professional career. Other folks on the panel included chemical engineers, industrial engineers, civil engineers, mechanical engineers and more.

Topics ranged across the board (Do you work a lot of hours? Do you like your boss? Have you been promoted yet?) but one that stuck with me was the question: “Should I pay/study for my engineer certification? Is it better to do it before interviewing or will my employer fund the cost?” Many engineers on the panel had various opinions and it really did vary widely by field, but when it got to me I just shrugged and told the truth: there is no professional certification to be a software “engineer”. There are certainly certifications for working with a particular software system, but there is no certification that will allow you to be insured against writing buggy software.1

I admire engineers and really only want to drive on bridges and use power tools that were designed by professional engineers. Software developers CAN produce incredible feats of redundant, bug-free software system design and implementation but with the stipulation that time and process are needed to accomplish such things. There likely do exist folks with the sufficient experience and knowledge to be called software engineers, but I am not one of them and they are few and far between.

In the tech sphere this is really more of an academic conversation- we all speak the same language. Everyone at your software company has some flavor of “engineer” in their title, and no one thinks twice about it. When thrust into the larger world of engineers, however, the loosey-goosey nature of software development and it’s similarity to more of a craft than a discipline make strict adherance to standards of proven technical excellence difficult.

What do you think? Does the typical professional software development environment make you think of “engineering” in the same way that mechanical or civil engineers practice it? Does the fact that we do TDD/BDD make up for the fact that software tends not to have perfectly understood natural laws it must follow?

  1. This argument has indeed been made many times before; this post is more my feelings about it.

Whazzing.com Moved to Github

| Comments

Two things forced my hand to move my development blog off of my own Rails-based blogging codebase and onto Github Pages via Octopress:

  1. My VPS is becoming severely overcrowded with deployed apps; I use it as a testbed for a lot of ideas as well as my main swearing-at-pop-culture blog and I didn’t want to host yet another heavyweight rails app to chew through limited resources.
  2. I reaaally like the ‘one-file-per-post’ model of Octopress/Jekyll, and keeping my development blog/presentations right next to my open source code is very appealing.

Since I wrote my latest blog engine to take markdown input it was easy-as-pie to export the existing posts to files and then use them to bootstrap this Octopress site. For now I’ll ride on the default theme and see how it goes. I hope to spend more time iterating on my presentations and a bunch of C++ code that I’m working on for a work project, so it’s also a plus that I don’t have maintain the platform source tree anymore.

Fitgem v0.5.0

| Comments

I’m happy to announce that the latest Fitbit API features have been exposed through the fitgem ruby library and released as v0.5.0.

New features include glucose, blood pressure, and heart rate logging and retrieval methods. Documentation has also been updated to include new endpoints for the Time Series interface.

Source | Gem | Issues | Documentation

v0.5.0 changelog

  • Added Fitgem::Client#heart_rate_on_date to retrieve heart rate data by date
  • Added Fitgem::Client#log_heart_rate to log heart rate data
  • Added Fitgem::Client#delete_heart_rate_log to delete previously logged heart rate data
  • Added Fitgem::Client#blood_pressure_on_date to retrieve blood pressure data by date
  • Added Fitgem::Client#log_blood_pressure to log blood pressure data
  • Added Fitgem::Client#delete_blood_pressure_log to delete previously logged blood pressure data
  • Added Fitgem::Client#glucose_on_date to retrieve glucose data by date
  • Added Fitgem::Client#log_glucose to log glucose data
  • Added Fitgem::Client#delete_glucose_log to delete previously logged glucose data
  • Updated README

Long Live Markdown

| Comments

I’ve been doing a lot of development around markdown lately and I’m really starting to love it. Specifically, Github-flavored markdown has grown on me with its ability to do easy fenced code blocks and syntax highlighting.

```ruby
comments = Comment.all
```

becomes

comments = Comment.all

When I rewrote the code for this web site awhile back I decided to support markdown, but didn’t really think I’d use it much; maybe to do code blocks but not much else. Now I find myself writing markdown for all content, and only translating it through various interpreters when I need the HTML. In retrospect I’m extremely glad I went through the effort to add markdown support for the site– I use it all the time now.

There’s an incredible app for writing markdown on the fly: Mou is a Mac application that lets you input markdown on the left pane and the HTML is dynamically updated in the right pane. I’m literally using it right now to write this post, just to get a preview of what it will look like when I drop it into the <textarea> on the web site.

I basically use it for all markdown content authoring, and then I copy/paste the result into whatever application/content field I will use it in. It allows me to do edit/revision cycles on content as well as seeing the application of styles. Highest recommendation.

I also recently forked git-wiki and started working on improving it for my own use. It also uses Markdown to write the wiki entries, which gets a little weird if you’ve ever used MediaWiki or Wikipedia. The default way to define wikiwords in git-wiki didn’t really work for me so I updated it and checked everything back into my own repo. I’ll be updating more about my git-wiki fork once I get it refactored and a little more configurable.

So there you go- markdown is awesome and you should write your content in it; if you’ve never worked with it then try it out on Github (just make a public repo and create a README.md in the index).

Fitgem v0.4.0

| Comments

I’m happy to announce that the latest Fitbit API features have been exposed through the fitgem ruby library and released as v0.4.0.

In addition to the new features, I thoroughly documented the entire library API (available here), added many more unit tests, refactored the subscriptions methods, and moved the oauth process documentation to the project wiki on github.

Source | Gem | Issues | Documentation

v0.4.0 changelog

  • Added YARD documentation to thoroughly document code
  • DEPRECATED: Fitgem::Client#log_weight method, use Fitgem::Client#log_body_measurements instead.
    The new method allows you to log more than weight (bicep size, body fat %, etc.)
  • Added Fitgem::FoodFormType to be used in calls to Fitgem::Client#create_food
  • Added Fitgem::Client#log_sleep to log sleep data to fitbit
  • Added Fitgem::Client#delete_sleep_log to delete previously logged sleep data
  • Added Fitgem::Client#activities method to get a list of all activities
  • Added Fitgem::Client#activity_statistics method to get statistics for all logged activities
  • Added to documentation of supported endpoints for Fitgem::Client#data_by_time_range
  • Added unit tests for parameter validation for many methods
  • Overhauled notifications methods, including extensive documentation, unit tests, refactoring, and a couple of bug fixes. These methods now return both the HTTP status code and the JSON response body. See https://wiki.fitbit.com/display/API/Subscriptions-API for information on how to interpret each of the error codes.
  • Added fitgem to travis-ci for continuous integration (http://travis-ci.org/#!/whazzmaster/fitgem)
  • Added fitgem to rubydoc.info (http://rubydoc.info/github/whazzmaster/fitgem/master/frames)
  • Updated README
  • Moved OAuth documentation from the README to the fitgem wiki

December 2011 Reading List

| Comments

I thought I’d jot down my current technical reading list. I tend not to read technical books straight through, but instead I pick up a few at a time and refresh myself on whatever I’m interested in at the time. (Full disclosure: these links include my Amazon affiliate code).

  • Learning Mysql

    Back in 2002 I got my exposure to SQL while doing elemntary PHP programming. I read a little about MySQL back then, but never really went deep into things such as indexes and optimizations. Rails obscures a lot of that stuff, but I wanted to be able to optimize efficiently and learn more about the underlying technology. So far this book has been really good at diving down underneath your SELECT, UPDATE, CREATE, and DROP actions.

  • Metaprogramming Ruby

    This is bar none my favorite Ruby book, and in my opinion is far better than the Pickaxe book for those who are coming to Ruby from another language/ecosystem. The fellas at Bendyworks have been doing a bi-weekly book club on this book and I’ve happily attended as many as I could to talk about it. This book goes into incredible, understandable detail about the object model and dynamic nature of programming in Ruby. It gets my highest recommendation.

  • C Programming: A Modern Approach

    My college computer science curriculum was in C++ and Java. My job at Intuit involves C/C++/C# development, but it tends to fall heavily into the C++/C# side of things. I respect the hell out of Zed Shaw’s outlook on programming, and truly believe that a working knowledge of C development will take you far. To that end, I’ve been working through Learn C the Hard Way online while reading this superb book. I also purchased the original The C Programming Language book, but A Modern Approach is, in my opinion, superior as a reference and primer.

My technical reading list changes often; I’ll usually read through three books over the course of several weeks and then pull more off my shelf and refresh myself on a different topic. It’s why I also buy books on the periphery of my interests just to have them on my shelf. I enjoy having the references available, even if I don’t read them as soon as they arrive.

Whazzing.com v1.2

| Comments

Whazzing.com v1.2 has been deployed to production. Updates include:

  • Posts can now be attached to projects in order to create news feeds on a per-project basis.
  • Added favicon to the site
  • Added ranking implementation for posts using Redis. Not in use yet.
  • Added RSS feed for posts. Available at http://www.whazzing.com/posts.rss
  • Updated styles for the post and project pages

Upcoming plans include:

  • Post ranking implemented
  • Section on the homepage for ranked posts
  • Project RSS feeds
  • Twitter integration on projects

Fitgem v0.3.6

| Comments

On October 14th Fitbit announced the latest version of their API, including support for features of their new Fitbit Ultra tracker hardware.

Source | Gem | Issues | Documentation

Updates

Floors and elevation info from activities_on_date

pp client.activities_on_date("2011-10-24")
{"activities"=>
  [{"activityId"=>2130,
    "activityParentId"=>2130,
    "activityParentName"=>
     "Weight lifting (free, nautilus or universal-type), light or moderate effort, light workout, general",
    "calories"=>228,
    "description"=>"",
    "duration"=>3600000,
    "hasStartTime"=>true,
    "isFavorite"=>true,
    "logId"=>2136964,
    "name"=>
     "Weight lifting (free, nautilus or universal-type), light or moderate effort, light workout, general",
    "startTime"=>"16:15"}],
 "goals"=>
  {"activeScore"=>1000,
   "caloriesOut"=>2911,
   "distance"=>5,
   "floors"=>10,
   "steps"=>10000},
 "summary"=>
  {"activeScore"=>495,
   "activityCalories"=>927,
   "caloriesOut"=>2458,
   "distances"=>
    [{"activity"=>"total", "distance"=>2.07},
     {"activity"=>"tracker", "distance"=>2.07},
     {"activity"=>"loggedActivities", "distance"=>0},
     {"activity"=>"veryActive", "distance"=>0.3},
     {"activity"=>"moderatelyActive", "distance"=>0.68},
     {"activity"=>"lightlyActive", "distance"=>1.09},
     {"activity"=>"sedentaryActive", "distance"=>0},
     {"activity"=>
       "Weight lifting (free, nautilus or universal-type), light or moderate effort, light workout, general",
      "distance"=>0}],
   "elevation"=>90,
   "fairlyActiveMinutes"=>118,
   "floors"=>9,
   "lightlyActiveMinutes"=>102,
   "marginalCalories"=>562,
   "sedentaryMinutes"=>1210,
   "steps"=>4590,
   "veryActiveMinutes"=>10}
}

Floors and elevation info from data_by_time_range

pp client.data_by_time_range("/activities/log/floors", {:base_date => "2011-10-24", :period => "1d"})
{"activities-log-floors"=>[{"dateTime"=>"2011-10-24", "value"=>"9"}]}

Food Goals now available through the foods_on_date method

pp client.foods_on_date("2011-10-24")
{"foods"=>[],
 "goals"=>{"calories"=>2911},
 "summary"=>
  {"calories"=>0,
   "carbs"=>0,
   "fat"=>0,
   "fiber"=>0,
   "protein"=>0,
   "sodium"=>0,
   "water"=>0}
}

Device info now returns lastSyncTime

pp client.devices
[{"battery"=>"Full",
  "id"=>*****,
  "lastSyncTime"=>"2011-10-25T09:54:40.000",
  "type"=>"TRACKER"}]

Get details on a food with new method food_info

There is a new method that will fetch detailed food information given a food ID. Food IDs are generally retrieved by searching for a food using find_food.

# Get food info for an apple
pp client.food_info 20711
{"food"=>
  {"accessLevel"=>"PUBLIC",
   "brand"=>"Shoney's",
   "calories"=>81,
   "defaultServingSize"=>5,
   "defaultUnit"=>{"id"=>226, "name"=>"oz", "plural"=>"oz"},
   "foodId"=>20711,
   "name"=>"Apple",
   "units"=>[226, 180, 147, 389]}
}

Calories now returned in find_food results

pp client.find_food("GoLean Raisin Bran Crunch Cereal")
{"foods"=>
  [{"accessLevel"=>"PUBLIC",
    "brand"=>"Kellogg's",
    "calories"=>110,
    "defaultServingSize"=>1,
    "defaultUnit"=>{"id"=>17, "name"=>"bar", "plural"=>"bars"},
    "foodId"=>20942,
    "name"=>"Cereal Bar, Raisin Bran Crunch",
    "units"=>[17]},
   {"accessLevel"=>"PUBLIC",
    "brand"=>"Safeway",
    "calories"=>230,
    "defaultServingSize"=>1,
    "defaultUnit"=>{"id"=>304, "name"=>"serving", "plural"=>"servings"},
    "foodId"=>79051,
    "name"=>"Raisin Bran Crunch Cereal",
    "units"=>[304, 91, 256, 279]}]
}

Searching vs Finding

| Comments

I’ve found that many of the truly interesting and outlook-altering pieces of information I’ve acquired have come via finding something randomly or pseudo-randomly as opposed to searching it out.

These days the information in question is often a tool, configuration, or piece of code that radically shortcuts an oft-repeated activity. It has nothing to with luck, or ability to use Google, however. The delight in finding the perfect tool or option is often that you never conceived that it could exist in the first place.

The most stark example I’ve had recently is in pursuit of my quest to learn vim. In changing over from TextMate to vim many times I would end up pondering really newb questions: how do I cut a line of text? How do I move to the end of a file? A couple of HI-YAH’s of Google-Fu later I’ve got the answer an I’m trucking along. Some days, however, I’ll be reading something unrelated and all of a sudden learn that dt followed by a character will delete from the cursor position to the next instance of that character. It’s weird, but that was a game-changer for me. Changing out strings became: dt” and then insert and go.

I could also characterize my use of guard in this way. I was at a Mad-Railers hack day awhile back and Brad happened to be using guard for his rspec execution during TDD. It was a revelation that I could just edit files and tests and it would automatically rerun. Here’s where things get interesting, however. It had previously never occurred to me to even look for a way to speed up my tests or optimize the time spent manually executing them. It was a problem I didn’t know I had. After learning about guard I looked through the list of available guards, however, and found some other interesting ones. These additional plugins for the guard model were also solving problems I didn’t even know were bugging me until I found they were solved problems.

This all came to me this morning as I was watching Ryan Bates’ Railscast on using Spork to speed up test execution further by preloading the Rails framework and keeping it in memory between tests.

When worrying about getting a primary goal completed (say, a feature in an application) you don’t often think about solutions to one-off problems or annoyances, let alone prioritize solving them. This is partially why I invest time at the beginning of a project to develop and optimize the code-test-fix cycle, why I obsess over the deployment model when I only have a README, and why I like continuous integration before a test has been written. Once your process for coding is solid, you can optimize it piecemeal as you need to or as you find unexpected tools or processes that would increase your productivity drastically.

An example: my tests were already running really well under guard, but 15 minutes or install and configuration of guard-spork I saw immediate speed gains.