July 2011 Archives

July 6, 2011

Command line weight loss

$ sudo setweight --bmi=21

It'd be nice if it were that simple.  But it almost is!

Scales of Truth
is a command line implementation of The Hacker's Diet.  The basic principle is to lose (or gain, I guess, theoretically at least) weight by taking an engineering approach to your body's energy requirements. There are quite a few implementations of this or similar things (e.g. The Hacker's Diet Online and Physics Diet), and an important feature is that the required day-to-day administration, i.e. typing in your weight, is not very time-consuming.  Less than five minutes a day?  Well opening a website, logging in, typing a value in and so on seems like a lot of work to me.  With Scales of Truth, you simply click over to one of the many terminals you no doubt have open, and type:

$ sot XXX

Where "XXX" is your current scale reading (in your choice of unit).  Scales of Truth does all the necessary calculations, backs up your readings using Git (because losing months of figures would really suck), and displays some interesting statistics:

Current mass estimate: XXX kg (instantaneous BMI XX.X kg/m^2)
7-day change: -.42 kg (-1757.2 kJ or -419.9 kcal per day)
30-day change: -2.77 kg (-2704.2 kJ or -646.3 kcal per day)


If you happen to miss a few readings, it interpolates the missing values automatically so your running average stays up to date.  For the average reader of this site, the whole procedure probably takes slightly less than two seconds.  That is, assuming you can resist taking a look at your progress using "sot --graph":

sot.pngThat's my own graph for the last few months, so I've taken the liberty of removing the actual numbers.  Suffice to say that each tick on the mass axis corresponds to two kilograms, and I'm rather pleased with progress so far...

You can download Scales of Truth right here.  Simply download the file, open it in a text editor, satisfy yourself that it's not going to do anything evil to your computer, then follow the instructions.