March 12, 2010
It’s been 2 years since I got my Proliphix thermostat, and while I did some early hacking on it, largely the whole effort just sat around for the last 2 years. However, with the fun of connecting up my weather sensors, I went back in this weekend and beat the code into a much more sane interface.
Thermostat.rb 1.1.1 was released yesterday. It provides a concise interface to the Proliphix web services API. An example of the usage is something like:
thermostat = Thermostat.new("hostname", "admin", "password")
# get the current temperature
current_temp = thermostat.temp
# get the current setback heat value
current_target_temp = thermostat.heat_to
# set the thermostat to 69F (units are set in the thermostat)
thermostat.heat_to = 69
I’ve got support under the covers for everything in the Proliphix API. I’ve only mapped about 1/2 of it to the user visible interface, starting with all the functions I’ve tended to need or use. I was a good little agile developer and built unit tests for everything here. Using the new module, I added the thermostat to my homegraph code, with some pretty reasonable results:

All this is released under the MIT license.
March 12, 2010 01:31 PM
Over the weekend I was working on revamping a whole set of older ruby projects, some having to do with my Proliphix Thermostat. I had this crufty Rakefile from the icalendar project that I’d been copying and modifying for new projects, and it was slowly degrading. I thought that there had to be a better way. There is, it’s called newgem.
Newgem is like h2xs in the Perl world, something to stub out a new module with all the right files and structures. But, as the Ruby folks tend to do, it ups the ante in the process. In addition to the basic build, packaging, testing, and coverage results you’d expect, you also get a targets for: creating you rubyforge website, publishing your gems to rubyforge and gemcutter, posting release announcements on rubyforge, and even posting blog posts about your release (though I haven’t configured that one yet).
The release cycle is now:
rake release
rake website
rake post_news
The Rakefile created is loading these features from base modules, so it’s only ~ 30 lines, a heck of a lot easier to maintain than the 300 line Rakefiles I had which provided about 1/2 these features inline.
If you are doing Ruby development, you should really check out newgem.
March 12, 2010 12:59 PM
March 10, 2010
Robert Wright provides a nice analysis on the current Toyota recall:
Let’s do the math.
My back-of-the-envelope calculations (explained in a footnote below) suggest that if you drive one of the Toyotas recalled for acceleration problems and don’t bother to comply with the recall, your chances of being involved in a fatal accident over the next two years because of the unfixed problem are a bit worse than one in a million — 2.8 in a million, to be more exact. Meanwhile, your chances of being killed in a car accident during the next two years just by virtue of being an American are one in 5,244.
So driving one of these suspect Toyotas raises your chances of dying in a car crash over the next two years from .01907 percent (that’s 19 one-thousandths of 1 percent, when rounded off) to .01935 percent (also 19 one-thousandths of one percent).
The rest of the op ed fills out some more of the details, and talks about the dangers of fearing something that is such low risk. It echos back to Tom Engelhardt’s thoughts from last week.
March 10, 2010 12:23 PM
March 09, 2010
About 14 months ago I raised my hand to help with a more interactive web presence for the Poughkeepsie Farm Project. This kicked off a large discussion over the course of the year, a web committee, and a great pro bono new graphic design. Many many people were involved to get this project to completion, I just consider myself a catalyst.
Today, after a year of work, we launched the new farmproject.org:

Go check it out. Now that we’re on a drupal platform, we’ll be rolling in smaller features over time. I’ve got a few ideas queued up that I’ll try to get out there for the first member pickup at the end of May.
March 09, 2010 02:01 PM
In findings sure to gladden the heart of anyone who’s ever wondered whether tiny acts of kindness have larger consequences, researchers have shown that generosity is contagious.
Goodness spurs goodness, they found: A single act can influence dozens more.
This is the same team that’s been studying how many things, loneliness, obesity, happiness, spread through social networks. Wired has a good write up on the research.
March 09, 2010 12:13 AM
March 08, 2010
It turns out that we found, then lost, the cure for scurvy well before we eventually identified it as Vitamin C. There is an incredible write up of that story.
Now, I had been taught in school that scurvy had been conquered in 1747, when the Scottish physician James Lind
proved in one of the first controlled medical experiments that citrus
fruits were an effective cure for the disease. From that point on, we
were told, the Royal Navy had required a daily dose of lime juice to be
mixed in with sailors’ grog, and scurvy ceased to be a problem on long
ocean voyages.
But here was a Royal Navy surgeon in 1911 apparently ignorant of
what caused the disease, or how to cure it. Somehow a highly-trained
group of scientists at the start of the 20th century knew less about
scurvy than the average sea captain in Napoleonic times. Scott left a
base abundantly stocked with fresh meat, fruits, apples, and lime
juice, and headed out on the ice for five months with no protection
against scurvy, all the while confident he was not at risk. What
happened?
It’s really fascinating, definitely worth your time.
March 08, 2010 02:09 PM
March 06, 2010
As I’ve been working on my weather station at home at nights, I realized the code would be a lot cleaner if I wasn’t constantly keeping track of temperature units. So I created the Temperature module for Ruby which adds methods to numbers to make them implicitly temperatures, as well as a parsing method on strings. To get a flavor of it, here are some examples:
freezing_in_F = 32
freezing_in_C = freezing_in_F.to_C
boiling_in_C = 100
boiling_in_C.units = "C"
boiling_in_F = boiling_in_C.to_F
absolute_zero = "0K".to_degrees
absolute_zero_in_C = absolute_zero.to_C
absolute_zero_in_F = absolute_zero.to_F
The full documentation for the project is on rubyforge. Gems, tar, and zip format have all been published, and it should be propagating out to the main gem servers tonight. It’s not exceptionally complicated, however it is convenient, and it’s even got 236 unit tests to ensure it’s doing things right. The code is released under the MIT license, so you are pretty much able to do anything you want with it.
March 06, 2010 12:12 AM
March 04, 2010
Last night was our monthly MHVLUG meeting, and it also marked 7 years since our first meeting.
7 years… it’s kind of hard to imagine. I was also really touched, multiple times last night, by the waves of appreciation I got from folks in the room.
Last night was a perfect night, even though it started as anything but. At 4:30, Thor’s hard drive decided it was no longer a drive, and without a backup of the presentation, we were scrambling in the office to try to recover the drive, and come up with a backup plan, which meant finding another good base presentation online he could work from. I still hadn’t gotten an ack back from the library, so had to call to ensure someone would actually open the door, and we didn’t get locked out of our space. Pat called during setup, and reported that they were having a mail server meltdown at work, so he would try to get there by the end with the cake, but there were no promises. This was exceptionally more chaos than we typically have to deal with for a meeting, but it definitely meant the night was starting off off balance, and we were just working to try to get it back on track.
As the meeting was about to start, Bruce Locke interrupted and got up and said a few words about how much he and others appreciated the efforts I’ve put into the group. He then presented me with a set of gift certificates to our local beer mecca, that a number of members had gotten together and pitched in on. I was really really touched by that. While this is a labor of love, it’s very energizing to have such a tangible gesture of how much it means to others.
The talk was great. Thor worked well off the borrowed slides, and we had a lot of great questions from the audience. Sahana is a great project, and really demonstrates how much of an impact we can have on people’s lives as members of the open source community. Sahana is actively being used right now in Haiti and Chile to handle the aftermath of their recent earthquakes. We had at least one new face in the room, who had first attended our meeting last month virtually (over the live stream), and had come out for the face to face meeting. As that was exactly what I was trying to get out of the streaming, I’m really glad it seems to be working.
I was given another comment of appreciation from the floor when I let folks know about the upcoming meetings we had locked and loaded for the year. It is hard to get that far out ahead on the schedule, and it was great that everyone seemed to really be excited about our upcoming meetings.
The cake… was not a lie.

Pat showed up about 7:40 with the cake, just a few minutes after the lecture had ended. We had people hanging out and chatting until 8, then 15 folks came out of the palace afterwards. We had great conversation that went until 11.
As I was driving home, I thought to myself how perfect that all had really been. Good people, a great talk, and lots of good conversation. Really… just perfect.
March 04, 2010 01:46 PM
March 03, 2010
This theme can be found all over the web, especially among security folks. Anyone that can do basic math can work out for themselves their chance of death from terrorists vs. their morning commute, for instance. And yet, the underwear pants on fire guy, who caused no casualties, got weeks of media coverage. Tom Engelhardt provides a good current summary:
Under the circumstances, you would never know that Americans living in the United States were in vanishingly little danger from terrorism, but in significant danger driving to the mall; or that alcohol, tobacco, E. coli bacteria,
fire, domestic abuse, murder, and the weather present the sort of
potentially fatal problems that might be worth worrying about, or even
changing your behavior over, or perhaps investing some money in.
Terrorism, not so much.
March 03, 2010 01:00 PM
March 01, 2010
I’ve finally got some very simple ruby code collecting my weather sensors to the round robin database. It took me some time this weekend to finally get my head around RRD, with having to predefine all the data you want to keep and how. It’s not much, but it’s a start.

March 01, 2010 01:06 PM
For all the gripe people gave to NBC on their coverage, I have to say I was pretty happy with it overall. When you look at the coverage across NBC, USA, CNBC, and MS-NBC it really seemed like they air more hours of unique coverage than during the Beijing Summer games, and a large portion (at least on the cable networks) was live. We had our DVR with 2 tuners almost constantly running and gathering the games.
My love of curling was rekindled, and I got to watch a lot of it during these games. While it was a bummer that the Americans didn’t do very well, the medal rounds were just incredible. The spontaneous outbreak of “Oh Canada” before the 8th rock of the final end in the men’s gold medal match was amazing. I didn’t watch much hockey, except for the gold medal match, which was definitely the best game I’ve ever seen.
To me, the most surprising thing of the Olympics was how much x-country skiing was aired, and how much I enjoyed watching it. The men’s 30 km pursuit was an incredible race. When I saw they were showing it live, I never thought they’d stick around for the whole thing, but they did. With the snow arriving this past week, it helped inspire us to get out to Fahnestock for some skiing of our own.
No Olympics will ever be the same to me as the Sydney games, which I got to experience both in person, and with Australian TV coverage that was live 8am – 11pm every day. However, I really think that with NBC’s use of their cable networks so extensively, we got much closer to that this time around. I’m hoping that isn’t a one off, and that we see that again in the future.
March 01, 2010 12:56 PM