The Hacker’s Diet - A WordPress Weight Loss Plugin

Posted by on January 17, 2007

This is the very first public release of my WordPress plugin based off John Walker’s book The Hacker’s Diet. The version of this release is 0.9 beta. It is compatible with WordPress versions 2.0.x or higher.

What is it?

The Hacker’s Diet is a plugin which you can use to input your weight everyday for calculating and tracking your weight trend based off the guidance and formulas used in the book, The Hacker’s Diet by John Walker.

Why did I write this?

So last August I noticed something. That “something” was that I couldn’t button my pants because my gut was too big. So I was faced with a decision: either buy new pants or lose weight. Now that I think about it, I guess this all started due to the fact that I hate shopping! Either way, I began to look into weight loss systems. I thought things like Atkin’s and South Beach were just gimmicks, so I dug deeper. Then I found The Hacker’s Diet, written by the founder of Autodesk (creator of AutoCAD). It was written by a nerd, for nerds, and it really inspired me. The first paragraghs of his book sum up the whole concept of weight loss very succinctly.

There’s an old Wall Street tale: a tyro asks an old-timer, “How do you make money in the market.” The wise man answers, “Nothing could be simpler: buy low, sell high.” The beginner asks, “How can I learn to do that?” The sage responds, “Ahhhh…that takes a lifetime.” Simple doesn’t mean easy.

There is no magic secret to losing weight and keeping it off, just as there is no hidden key to instant wealth. Nonetheless, every year another crop of “magic diet” and “secrets of investing” books appear on already-creaking shelves. The human capacity to ignore inconvenient facts and avoid unpleasantness is immense. Success in any endeavour requires coming to terms with the true nature of the task at hand and, if the goal is worth the effort, getting on with it.

“How can I lose weight?” “Simple, eat less food than your body burns.” “How can I learn to do that?” Read this book.

There was one problem, to me, with his system. Since it was originally written in 1991, you had two choices for tracking your progress: pen and paper (what is this, the stone age?) and Excel spreadsheets. I found the spreadsheets extremely lacking, and I thought to myself “Man, I wish there was a cooler web-based version of this.” And with that, this plugin was born.

The plugin

This plugin serves one primary purpose: to replace the original spreadsheet’s functionality while increasing usability. Here is the current (simple) feature list:

  • Dashboard integration
  • Flickr-style “edit in place” daily weight entry
  • Weight trend calculation
  • Reporting (weight vs. trend vs. goal)
  • Reads custom RSS feed for notifications of plugin updates

I have been personally using this plugin in my WordPress install for the past 5 months, and I have decided to publically release it the same day that I hit my weight goal. (Go me!) The development process has been very iterative. I first wrote the bare minimum needed to replace the weight logging part of the system’s spreadsheets, and then over the past 5 months have added features to either recreate functionality of the original spreadsheets, or add cool stuff as I saw fit. :)

But to be honest, I really haven’t touched the code in about 3 months since it was stable and did everything I needed. Recently I’ve worked on some things that were on my “todo” list, and I now feel that the plugin is ready for public use.

Download

hackersdiet_0.9b.zip Current version: Download from Wordpress.org Plugin Repository

Screens:

Added link to the Dashboard for quick one-click access to the admin screen for easy daily weight entry. Daily weight list with gap between weight and trend shown. Flickr-style edit-in-place for quick and easy data entry. Graph of previous 2 weeks located on main admin screen. Set goals and the plugin will help you keep on track. Quick links to commonly used charts, and RSS feed of updates from my website. Reporting screen.  Choose dates to a create a custom graph.

Enjoy!

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. [...] The Hacker’s Diet is a plugin which you can use to input your weight everyday for calculating and tracking your weight trend based off the guidance and formulas used in the book, The Hacker’s Diet by John Walker. [...]

  2. Chris Jan 18, 2007 07:30

    First off, Congratulations on reaching your goal weight!

    I know how difficult it can be to lose, and then maintain, weight. I’ve been struggling with that very issue for almost 2 years now. I need to lose about 50 pounds myself.

    Secondly, thanks for this handy plugin. I’ve recently downloaded and installed it. I’m looking forward to watching as make my way (slowly) to my ideal weight.

  3. Keith Jan 18, 2007 09:15

    thanks! good luck on your goal.

    feel free to comment about any bugs or missing features in the plugin. the top thing on my todo list for this plugin is to support multiple units like kilograms and stones. i’m sure that people from other countries need to lose weight as well :]

  4. [...] Ever heard the phrase “New Year, New You”? Unless you’ve been living a) under a rock or b) fixed to your computer screen for all your life then I’d guess yes. And if you’re anything like me, then that new years diet you promised yourself will have already gone down the drain weeks ago, and so you might just need the Weight Loss Plugin. Unfortunately it won’t emit a series of electric shocks through your keyboard to make you simply drop all your extra weight instantly, but it will track your weight trend based off the guidance and formulas used in the book, The Hacker’s Diet by John Walker. [...]

  5. drew Jan 18, 2007 16:23

    ever seen fitday.com?

    check out the “Diet” post here: http://www.cbbyers.com/

  6. Wendy Jan 18, 2007 18:16

    I attempted to install this on my WP install (2.0.6) and when I went to activate the plugin it threw a bunch of errors. An example would look like this:

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '( `wp_id`, `date` )) CHARACTER SET utf8 COLLATION utf8_general_]
    CREATE TABLE wp_hackdiet_weightlog (`wp_id` BIGINT( 20 ) UNSIGNED NOT NULL, `date` DATE NOT NULL, `weight` DOUBLE UNSIGNED NOT NULL DEFAULT ‘0′, `trend` DOUBLE UNSIGNED NOT NULL DEFAULT ‘0′, `rung` SMALLINT UNSIGNED NOT NULL DEFAULT ‘0′ PRIMARY KEY ( `wp_id`, `date` )) CHARACTER SET utf8 COLLATION utf8_general_ci ENGINE = MYISAM

    Any suggestions? Thanks and congrats on meeting your goal!

  7. Tyler Jan 18, 2007 23:02

    This better not turn my computer off when I launch it wee man…

  8. Josh Jan 19, 2007 08:26

    I am having the same issue as Wendy. Any suggestions for getting this to work on 2.0.6

  9. Keith Jan 19, 2007 08:44

    thanks for the heads up wendy and josh. i’ll look into it tonite after work.

    could you perhaps let me know the version of mysql installed on each of your servers?

  10. Josh Jan 19, 2007 16:05

    Keith… My version is “3.23.49″. Thanks.

  11. Keith Jan 19, 2007 20:51
  12. Oliver Muenk Jan 20, 2007 11:48

    It works only with lbs?
    In Germany we use KG? And it looks better for me when I can use KG!

  13. Keith Jan 20, 2007 12:06

    dont worry oliver, the next thing on my todo list is to add KG and ST.

    the idea of units is already in there, but i just have to add the conversions.

    keep an eye out for the next update!

  14. Jesi Jan 20, 2007 22:17

    This is great Keith! Thank you. I am installing now and can’t wait to use the plug-in. This is exactly what I need and you have made it available at the perfect time. I just got my new crosstrainer together and I am starting my new program tomorrow.
    Any chance that future versions will/can include measurement tracking?
    Thanks again.

  15. Lizzie Jan 22, 2007 09:00

    Hello,
    I just started a weight loss blog. I only weight myself weekly, so can I use this pluggin to track my weight weekly also?

  16. Keith Jan 22, 2007 09:32

    as a matter of fact, you can.

    your trend won’t be as accurate as if you were weighing in daily, but the plugin doesn’t mind if you miss a day. it will just use your most recent weigh-in to calculate your current average

  17. Chad Jan 29, 2007 14:48

    Keith,
    Great plugin, I’d love to use it, but I’m getting errors when I attempt to enter my weight. It simply says “Sorry, the update failed.” when I attempt to add a weight. Did I install it incorrectly?
    Thanks!

  18. Keith Jan 29, 2007 16:18

    chad: first make sure you have the latest version of the plugin. currently 0.9.2b.

    if you are, i would need a bit more info to help you out. such as

    wordpress version
    browser type
    if the plugin activated correctly (were 2 tables added to your wordpress database?)

    that should be enough to start investigating the problem.

  19. Chad Jan 29, 2007 18:56

    Hi Keith,
    I’m using your plugin version 0.9.2b.
    Wordpress is 2.1
    I’m using Firefox 2.0.0.1
    I’m using mySQL v5.0.24a
    Both tables created successfully. Settings are correctly written out to wp_hackdiet_settings
    Please let me know what else you need or if you’d like to try some debugging code. Feel free to email me.

    Thanks!
    Chad

  20. [...] The Hacker’s Diet Plugin which you can use to input your weight everyday for calculating and tracking your weight trend based off the guidance and formulas used in the book, The Hacker’s Diet. (Yes, yours truly should be on this diet any minute now!) [...]

  21. [...] I’ve also noticed a Wordpress plugin related to the Hacker’s Diet, but as it appears to be a dashboard-only plugin I haven’t tried it yet. I’ll add it to my round-up of tracking tools later this week. [...]

  22. [...] I am currently using a WordPress plugin called the Hacker’s Diet. I started it at the beginning of March to keep track of my fitness program and weight loss. Yesterday, I visited Jasmyne Cannick’s site and discovered she too is working on a weight loss program as well. As a result, I’ve decided to publicize my program as well. [...]

  23. Chelta Aug 07, 2007 06:57

    Hi,
    I’ve been trying to use your latest plugin of this on my blog, however it comes up with a fatal error. Version of plugin is 0.9.8b and I’m using Wordpress 2.2.2. I would really love to use this plugin, can you please advise?

  24. Keith Aug 07, 2007 11:07

    chelta, i haven’t tried the plugin with 2.2.2 yet.

    can you check to see if any tables for the plugin were created during activation? would help me pinpoint the problem.

  25. Chelta Aug 19, 2007 09:49

    Hi Keith,
    Sorry for the late reply. I checked, and it doesnt appear as though any tables have been created in mysql at all. The only tables I appear to have seem to be the default ones. Hopefully this information helps!

  26. Kile Jul 06, 2008 20:31

    Your plugin is great but for the widget it should display the weightloss graph. I am running a weight loss blog at the moment and that part would be so great. Thanks

  27. [...] preparation for meeting my first resolution, I found a cool plug-in for WordPress called The Hacker’s Diet. It’s based on the book of the same name by John Walker, the co-author of [...]

  28. Soft Focus | Dinhternet Jan 11, 2009 17:41

    [...] I’ve been doing. That one should be more interesting. It’s going to be based on the Hacker’s Diet WordPress plug-in, but also combined with some of the features from my original family weight challenge site and [...]

Comments

Comments: