Tag Archives: disaster

Of all the things I miss….

Before the death of my drives I had a flexible Measurement class written up. As most of you know brewing involves all kinds of measurement – hop weights, boil volume, bitterness, etc. The class served as a base that more specific classes would inherit and provided the framework for converting between different measurement systems. For example, the SpecificGravity class would inherit Measurement and provide the conversion code to switch between SG and Plato.

The database would save the scalar and units and instantiate an aggregation of these two pieces. When the units changed, back into the database it went with the new values. It was very easy to work with, but took me quite a bit of time to write.

“Why not use one of the libraries already available?” you might ask. The short answer is that they do not fit my needs. Firstly, none of them produced objects that I could stuff in the database as a aggregation – most are intended as great extensions to various number classes. Secondly, and most importantly, none of them dealt with Bitterness, Color or Specific Gravity, which is really why I need a measurement class. Lastly, most of them only handled linear transformations:

m2 = a * m1 + b

To convert from SG to Plato you need to use a cubic polynomial, ugh.

So I wrote my own, then re-wrote it, and it was beautiful. Now I am re-engineering the whole thing. In addition, I’ll have to figure out where I got the Plato to SG reverse conversion. I remember trying to solve the cubic equation, then finding something that actually worked.

It is a little faster-going because I wrote it all before, but I had some tr1cky 31337 code in there that I will have to figure out again.

Always make sure your backups are working and current.

–Dean

Disaster Recovery

BrewSession is not off the ground in a professional capacity, therefore all the code is housed on a machine I have running on my home network. A week and a half ago that machine’s disk controller corrupted my data. Then I screwed up the backup copy of that data in the restore process. The data is almost surely still there, but it’s just beyond my knowledge system administration. I have acquaintances in the data-recovery business, so there is hope for a full restore.

I am upset about losing 4 months worth of hard work because we were planing to have a private alpha test next month. However, now that I have sixteen weeks of ruby programming experience recreating the project will not be difficult. With luck we will be able to roll out our alpha in early spring, 2007.

The lesson here is to test your restores before you need to.

–Dean