Skip to content

Instantly share code, notes, and snippets.

@praeclarum
Created September 4, 2013 03:09
Show Gist options
  • Save praeclarum/6432363 to your computer and use it in GitHub Desktop.
Save praeclarum/6432363 to your computer and use it in GitHub Desktop.
Pre-release of new examples for Calca 1.2.

Health

Basal Metabolic Rate

The BMR tells you how many calories you burn if you were to lay in bed all day. In other words, this is the amount of energy you need to stay alive.

Of course, this number is different for every person and their environment. There is, fortunately, a basic equation that can give you a rough estimate:

BMR = 
  10   weight/kg + 
  6.25 height/cm - 
  5    age/year  +
  (if boy then 5 else -161)
   
weight = 185 lbs
height = 5 ft + 4 in
age    = 33 years
boy    = true
   
BMR in kcal/day => 1695.1458845 kcal/day

According to this, I need 1,700 calories per day just to stay alive. Now that I have this number, I can plan a ruthless diet...

Ruthless Diet

I want to lose some weight, and I'm a geek, so calorie counting works great.

Current Weight = 185 lbs
Target Weight = 155 lbs

Diet Time = 12 weeks

Weight Loss Rate 
  = (Target Weight - Current Weight) / Diet Time
  => -2.5 lbs/weeks

Doctors recommend that your maximum weight loss be 2 lbs/week. But life is more interesting if you exceed limits such as these.

The trick to a ruthless calorie counting diet is to consume fewer calories than your BMR (basal metabolic rate). That is, you starve yourself. Your body reacts by destroying its muscles and, eventually, its fat reserves. This makes you weak, slow, and stupid, but at least you lose weight in a timely and predictable manner!

The key is to know the conversion from calories to pounds of fat:

fat conversion = 3,500 kcal / 1 lbs

We can use this number and the weight loss rate to calculate our daily calorie deficit:

calorie deficit =
  Weight Loss Rate * fat conversion in kcal/day
  => -1,250 kcal/day

1700 kcal/day + calorie deficit in kcal/day
  => 450 kcal/day

Huh. So I will only be able to eat 450 calories of food a day. That doesn't sound doable, so let's extend the time of the diet:

Diet Time = 6 months

Weight Loss Rate in lbs/week 
  => -1.14992094 lbs/week

1,700 kcal/day + calorie deficit in kcal/day
  => 1,125.03952853 kcal/day

OK, 1,100 calories a day a reasonable. And in just 6 months I will have lost 30 lbs!

Calorie Journal

In order to meet a daily calorie count, I am going to keep a journal of the food I eat.

To do this, I will make a little database of my favorite foods:

banana   = 100 kcal
bacon    =  50 kcal
beer     = 200 kcal
coffee   =  50 kcal
egg      =  75 kcal
gyro     = 400 kcal
lollipop = 200 kcal

Keeping a daily journal is now as easy as listing the foods I eat each day:

Sep 3 2013 =        
  1 banana +
  4 bacon +
  2 coffee +
  1 lollipop +
  1 gyro
  => 1000 kcal

Sep 2 2013 =        
  4 bacon +
  3 egg +
  4 coffee +
  2 gyro
  => 1425 kcal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment