As a space fan, I couldn’t resist snatching the recently released book Bringing Columbia Home by Michael Leinbach and Jonathan Ward from the new books display at the library. I read almost half of it one Sunday. Not only do I not often have the opportunity...

The amazing physicist Stephen Hawking died this week. His passing will hit the geek community hard. I learned about it when I checked work chat while commuting on the bus and read my colleagues’ conversation. To say he revealed a lot of revolutionary...

One of the most common features for native mobile app development is push notifications. As we ready our
Android application for release here at PLM, I've had the job of implementing push notification
support on the server, i.e., getting real time...

Recently, I needed to create a small, temporary web application for testing purposes. I definitely didn't want to deal with Rails for this purpose. In fact, it was small enough that I just wanted to have everything in one file. So:

When I pair with people I reach for binding.pry a whole lot sooner than they do. I also stay in there longer. Here's some of the stuff I've found valuable in a binding.pry session that keeps me there instead of in my editor.

I've been using git for, what, 8 years now? You'd think I'd get it. But I constantly find myself confused by the complexities of git. So this past wow week, I went back and did some reading of the free Pro Git book. And I came to a conclusion. Much...

Setting up a CDN is something that almost any site can benefit from. Up until fairly recently however, they were cost prohibitive for many sites. With Cloudflare and Cloudfront -- among others -- becoming more mainstream, there's no reason not to...

Several of us in the engineering "pit" at PatientsLikeMe have eschewed the traditional desk and chair work setup. At this point a couple of us are on big rubber balls, and four of us are at standing desks. One lucky guy even has a standing desk with...

A while ago I wrote a little quiz for our staff so people could see how good they are at recognizing their co-workers. At some point, we started getting some rollbar errors from it that looked something like this:

Last month, Amy, Nat, Michael, Jon and I went to RubyConf 2014 in San Diego. I'd never been West of Salt Lake City before (unless you count a trip to Japan in when I was a teenager) so I was really excited about a trip to sunny California. Plus I was...

I joined PatientsLikeMe in July to contribute to the Open Research Exchange's quality assurance efforts. As I write, what comes to mind is a friend's thoughts about how quality assurance is a bit of a misnomer based on common word usage. I'm not here...

You've probably heard of Post Traumatic Stress Disorder (PTSD). Recently, we had a visitor come to our office and talk about PTSD, and he argued that it should be referred to as "Post Traumatic Stress," without the "Disorder" part, because really this...

Hi. I'm Jon. I'm the newest Rails dev at PatientsLikeMe. I've done plenty of web development before, but this is my first time working with Rails. In this post I'm going to talk about my first attempt to do something non-trivial with routes.

The task sounded straightforward. We had a set of pages that were already developed and deployed. But we wanted to also show them on a separate tab elsewhere, with a different set of URLs. So most of the work would be taking place in routes, with the controllers recycling a handful of views that already existed. Here's how it went.

Some time ago, our charts developer, Mike Danziger, noticed a strange issue that was showing up for some user-entered lab results. See if you can spot it:

Surely this user didn't actually enter a result of 119.66000000000001 mg/dL for their cholesterol reading. No blood test is that precise, right?

No, of course they didn't. What we're seeing here is a result of floating-point error. Floating-point error happens because in most cases, computers represent fractional numbers in base 2, in which it's often impossible to represent a base-10 fraction in a finite number of digits, so rounding happens. These tiny errors can become larger the more calculations you perform, due to compounding effects.

The old tech blog was running in PHP. Wordpress maybe? Who knows or cares. Anyway, the ops guys said something like "Hey, none of you lazy developers have written a blog post in over a year, and we've got this unpatched PHP instance running, we're going to take the damn thing down." Actually they were much nicer than that. But that's what they should have said.

None of us lazy developers objected. How could we? It was true. But silently we thought, "Having a tech blog is a good thing!" On the other hand, we didn't want to ask ops to patch PHP only to have them send the same email again in a year. Plus we wanted to do something cooler than PHP and Wordpress, I mean really.

We have a carefully thought out git branching strategy for the PLM Web site, but I kept screwing it up, so clearly I didn't have it all straight in my head. I figured writing about it would be a good way to make sure I understand it, and might be useful for others when considering their own processes.

What is WOW Week?

PatientsLikeMe has built our own version of Google’s “20% Time” that we call “WOW Week”. WOW Week is a week of unstructured development time for engineers, where they can work on anything to improve our products as long as they demo their progress in front of the company at the end of the week.

The engineering team works in 2-week long development sprints. After three development sprints in a row, we have a “Technical Debt” week and a WOW Week.

Today, we're releasing Robomo, a web application for tracking feature requests. Robomo is simple to use, fast, and fun. We've developed Robomo internally at PatientsLikeMe and have been using it ourselves for over a year. It's become an indispensable part of our workflow here, and now it's available to anyone who wants to use it.

will_paginate is one of those gems that always makes me smile. Back in the dark ages of Spring MVC & Hibernate I specifically remember being part of an estimation that decided that adding pagination to an admin page would take 2 days. Today that seems crazy of course, but I don’t think it was a bad estimate at the time since there really wasn’t any built-in support for that. Fast forward to now and as we all know pagination is one of those things that take about 2 minutes to implement. Progress!

So pagination is great and a pretty much solved problem, but it’s always irked me that it requires 2 very similar queries per request. Is there anything to be done about that? Let’s see.

How To Count Distinct Items Over Sliding Time Windows in Postgres

As a member of PatientsLikeMe's Data team, from time to time we're asked to compute how many unique users did action X on the site within a date range, say 28 days, or several date ranges (1,14,28 days for example). It's easy enough to do that for a given day, but to do that for every day over a span of time (in one query) took some thinking. Here's what I came up with.