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...
read moreThe 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...
read moreOne 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...
read moreRecently, 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:
- Sinatra for the...
Adding More Quality Assurance Engineers Raises Quality Across the Board
In the last 9 months, we added a quality assurance manager and two more QA engineers to the PatientsLikeMe team as the engineering team continued to grow. As you might imagine...
read moreWhen 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.
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...
read more8 shell tricks DHH doesn't want you to know...
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...
read moreLarry Wall once said that the three great virtues of a programmer are laziness, impatience, and hubris. This post is about laziness.
I've been working on speeding up an ETL process that takes about 48 hours to run. The ETL consists of about three...
read moreIntro
As ruby developers, we often learn to handle nils as follows:
def some_method(some_var)
some_var.try!(:some_method)
end
or
def some_method(some_var)
some_var.some_method if some_var
end
If we don't do this, we will get the dreaded "NoMethodError...
read moreI 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...
read moreYou'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...
read moreThere are so many loggers already, surely one of them will work
Recently I've been working on a few projects that run as background tasks on our servers. Since there's no user interface, I wanted robust logging so that we can monitor the tasks and...
read moreHi. 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.
Welcome to our new tech blog, which is a reboot of our old tech blog.
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.
How to fix bad url generation when you are using url_for inside a nested controller
Problem:
I have a nested resource, say: members/:member_id/timelines/:id
Inside my nested controller (timelines_controller) I use:
url_for(:controller =>'patients', :action => 'view', :id=> @patient.id)
The url generator decides that since I am nested inside ‘members’ I want my url to look like this: members/patients/:id
In fact, no I do not want my url to look like that. That url does not work. Do not want.