Today is a good day to code

Losing Weight With Technology

Posted: February 3rd, 2010 | Author: | Filed under: Lifestyle, Programming | Tags: , , , , , , , | No Comments »

About 8 months ago I started running because I noticed that Nike+ was built into my iPhone 3GS.  I had run in the past, but never very seriously.  I started to lose a bit of weight, but it wasn’t coming off like I felt it should.  I’ve always been heavy, except for the couple of times in my life when I went on a crash diet.  Once I lost nearly 100 lbs, way back when I was 16 by eating every other day.  Recently I think I have found something that works so A few days ago I felt motivated to indulge in telling my story on my blog since perhaps someone would find it helpful.  Since my weight kept going up, and I kept exercising harder and harder, I thought that something must be wrong with me.  At one point I was riding my bike to work, totaling over 200 miles a week and I didn’t lose an ounce.

Over the years, the lifestyle of a software engineer and a literature nerd took its toll on me and I gained back all of the weight that I had lost when I was 16, and then some.  I signed up for one of Nike’s virtual running plans and started to run more and more.  I was really enjoying analyzing the data that was coming out of my nike plus, that combined with the weather data from slowgeek.  But I wasn’t really losing any weight.  I just sort of settled into the fact that maybe I was just one of those people who were meant to be fat.

My wife wanted me to go to the doctor and ask for statins, which I did, because she was worried about my blood pressure and cholesterol, which I hadn’t checked in forever.  My doctor agreed with me that something wasn’t right about the fact that I wasn’t losing weight, even though I was working out like a demon, that my blood pressure was so high, and that I was having allergy and miscellaneous immune issues.  She didn’t want to give me any drugs, she is an awesome doctor, so she sent me over to get a lab done.

The cool thing about my doctor is that, much like a software engineer tracking a problem, she was able to string together a bunch of seemingly random data, anecdotal and otherwise, mix it with empirical data from the labs and quickly come to a working theory of what was going on.  I had a chronic vitamin D deficiency.  I know it sounds like a joke, and I thought it was pretty silly when she prescribed me high-dose vitamins, but my laughter in ridicule quickly turned into joyous laughter once the weight started dropping off.  My cholesterol was fine, so that was the only thing.  My doctor told me that a) everyone has a vitamin D deficiency, and b) since I was African American it was worse for me, especially living in the Bay Area.  She said that vitamin D plays a role in, get this, metabolizing sugar.  That without it your body has a hard time using the energy from sugar.  Well most of everything we eat is sugar ( high-fructose corn syrup ), so this would explain why I couldn’t lose weight.

That wasn’t all either, I had been moody for quite some time, but the Vitamin D mellowed my moods and helped me to concentrate.  About the same time I had been reading a book called The Omnivore’s Dilemma.  I was becoming more conscious of what I was eating.  I figured that since the iPhone was so awesome at capturing data with the Nike+ and that I always have it with me, if I could find something that would track my nutrients and calories on the iPhone I’d be able to see what was going on with my diet.

When I first started using LoseIt! (ITMS Link) I was shocked that almost all of my calories, between 4,000 and 6,000 a day were coming from carbohydrates.  I was running at something like 90% carbs 2% fat and the rest was protein.  Prior to using the program I was under the assumption that all I had to do was keep my fat down.  With my Vitamin D deficiency preventing me from actually burning the massive carbohydrate load I was putting in, my body was just storing everything.  Once I finally got the Vitamin D levels evened out with supplements, I started cutting down the calories.

Almost immediately I noticed that I started choosing the lower calorie foods with high protein such as eating a chicken breast, with no bread or rice, and a salad, instead of a salad and a horde of pretzels.  The pretzels had an insane amount of calories, so did bread, and rice, so I stopped eating so much of those almost immediately.  I started eating way more fat, and when I say way more, I mean that between 12% and 20% of my calories were from fat.  I still eat way more fat than people say is good for you, all the while losing weight at between 1 and 3 lbs a week, with little to no ravenous hunger that doesn’t occur at mealtimes.  Of course I avoid trans-fats and saturated fats, but I am not afraid to eat a steak or dark chicken meat.  Once you get into training for endurance sports your needs will change, but at the beginning it is really good advice to follow Chris Carmichael’s : Eat Right to Train Right foundation percentages.

All this data was making me giddy, I could actually see what was happening to my body as I changed the mixture and quantity of what I was eating.  As I fixed my diet, the constant hunger went away.  LoseIt had me at around 2800 calories when I was at about 260 lbs, but now it has me at about 2060 at 200.

LoseIt works on a very simple assumption, that 3500 calories a week equals 1 lbs, so short 3500 calories a week, you should lose 1 lbs per week.  With all the data I can now see, based on what I am eating, what is happening to me during races, long rides, etc… I have a much better understanding of why I am cramping up on rides, or during swims, or why I bonk, or can’t crank up the output on some days.  I am learning which foods burn best for what.

Everyone thinks that the government has BMI and the diet guidelines all wrong, and to be fair, it is a bit off, but not as much as people think.  People want to believe that they are just the way they are, and that they don’t need to, or can’t change.  Many people think that they can be healthy while being seriously overweight, or that they are somehow special and the laws of thermodynamics don’t apply to them.  Everyone is so focused on eating more “good calories”, etc… That is all bullshit.  A calorie is a calorie.  If you don’t burn it you will gain weight.  Unless you are a triathlete, marathoner, etc… 3500 calories = 1 lbs period.  First you have to fix any chemical or other issues in your way, but aside from physical biochemical issues, it is possible for everyone to be at a healthy weight, and it isn’t hard as long as you can be anal about tracking calories.

I would have lost 1 lbs per week had I not been running, picked up swimming, and started cycling more.  Instead I was losing around 3 to 3 and 1/2 lbs per week.  While doing all of this I was building my CycleMetrics application for the iPhone.  Testing it was a monster, I had to do intervals to test the power output on the bike even when I wasn’t riding simply for fun.  All the while aggregating my exercise data on Google Docs, and using LoseIt to count calories.  Some people may think it is rude when I pull out my phone at dinner and start tallying up the damage before I eat it, but it helps me with portion control, and screw them if they don’t like it.

At the moment I have lost 60 lbs.  I still have a bit to go to hit my ultimate goal, which is to hit the top end of the normal BMI range for my height and shoulder width, but now that I have a framework with which to control my weight and keep myself at peak physical and mental performance I am not concerned that I will hit them.

I would like to editorialize a bit and rant about the food industry.  It is absolutely insane that I need this much technology to figure out what is in the foods that I am eating.  I shouldn’t have to track every calorie this way, corn shouldn’t be in everything in the quantities that it is.  The government shouldn’t tax fossil fuels, they should tax high-fructose corn syrup.  Also, eating out is inordinately hard.  I needed The Daily Plate ( Livestrong ) (ITMS Link) Application just to figure out how to approximate what I was eating and what the calories are in stuff at restaurants.  They should really consider putting this on their menus voluntarily, and if they won’t the government should make them do it.  Only because if they don’t everyone’s health care bills will rise.

With all of the money that we are looking at spending to improve health-care, I can’t believe that we don’t do something about the sugar / corn intake of people.  Unless you look at what you are eating, the amount of calories that you can consume is really absurd.  The bag of pretzels next to your desk that you munch on while coding and listening to glitch music is about 1400 calories, you’d be better off with two butterfinger bars.  Better than that would be to eat a balanced lunch with fat, carbohydrates, and protein.

If I was reading this, and I was still where I was, I’d be saying to myself, yeah its all well and good that you found religion, but you are working out, eating right, and got quality medical care.  It worked for you, but how can I know that it will work for me?  Its a good question.  I don’t know that it will work for everyone.  However, what I do know is that for each of the people that I have given this app to who have seriously tracked what they ate, their results are the same as mine.  Think about it this way, development without a framework is hard, it is tough to know where to start, and even harder to know when you have built enough.

LoseIt is like a framework, it makes the hard decisions about how much and what to eat.  It lets you think about that fancy Lisp project that you want to build, instead of feeling guilty about eating too much, or wondering whether to eat this or that.  Really it doesn’t matter much what you eat, if your goal is to lose or maintain a healthy weight.  I still eat McDonalds, although I get a happy meal, I eat dominoes and drink copious amounts of beer.  The difference is that either I work out to get rid of the excess calories or I stop eating and drinking when I hit my limit.  That is not to say that you won’t have any health problems eating this stuff, it is just to say that your weight won’t be one of them if you stay within your calorie boundary.

As far as the exercise goes, there are so many different types of sports out there, even people who say they hate sports admit to not trying them all, who knows, you could have a desire to be a curling champion, or to do pole vault, etc…  There is something for everyone.

If you capture the data, imagine the awesome analysis software you can write to find trends.  Right now I am cross referencing my diet with the weather, and speed with altitude to see at which humidity and carb levels I perform best at with altitude.  It isn’t so much that I care, it is mostly about the fun with analyzing the data.  I never thought I would have so much access to the inner life of my body.  Anyway, I this is about wrapped up.  If you are having trouble losing weight look into Vitamin D, and if you haven’t already, grab LoseIt (free) and a copy of Omnivore’s dilemma, it will change your life for the better.

*UPDATE: 2/19/2010*

I forgot to write an additional thing that I am doing to control my weight.  Since my father died a little over a year ago, I have been trying to get 100% of my fiber each day, somewhere between 25 and 30 grams.  Coincidentally, I learned later that fiber plays an important role in helping you to feel full after meals, as well as helping your body dissipate excess calories.  I would recommend that anyone increasing their fiber, however do it gradually or you might have some uncomfortable results.

Why the Volume Approach to Sales in the Apple App Store Won’t Work

Posted: December 16th, 2009 | Author: | Filed under: Apple, Companies, iPhone | Tags: , , , , , | No Comments »

For a few months I have been thinking about the app store. Specifically I have been thinking through all of the drama and screaming that is occurring on the internet over the rejection of a few apps, the difficulty of finding anything quality in the app store, and the impact to actual users. The conclusion that I have come to is one that is different from the conclusion to which I had figured I’d arrive before thinking deeply about it.

Basically the App Store is great for Apple, but bad for developers. OK, you may think, well that is obvious and it is, but I don’t think that it is quite as simple as that. Firstly, I think Apple has brought their brilliance for marketing physical machines, accessories, and their integrated software and applied it to third party applications. Secondly, they have created an ecosystem where sales volume is king and the primary means of competition is over price, not quality. Regarding the second point, I am certain that they did not intend to do this however, it is in fact where things are today.

To understand why volume alone in software sales does not make one rich or profitable, you have to look at the contrast between physical goods sales, and service sales in an environment similar to the app store.

Imagine that you have an area like the Akihabara district in Tokyo, Japan, where you can buy anything technology based, motherboards, cameras, MP3 players, etc… Everyone who wants to sell this stuff crams into the Akihabara district even though there are already thousands of people there selling the same exact thing. So why would you do this one might think? It is because even though you have to drop your price to compete with the others, the number of people who will come to the Akihabara looking for some electronic thing is very high, if you were to locate elsewhere, you could increase the price, but you would have fewer people coming to your store. This is less than optimal for someone selling a physical good, to understand this, you have to look at how profitability works when selling a real thing.

If I can buy 5 widgets at $2, my cost is $10, if I sell the widgets at $4, my revenue is $40, my net profit is $30, not too bad. Now lets say I move into the Akihabara, I will need 1000 widgets to accommodate all of the foot traffic, and the people who want my widgets. Because I can sell 1000 widgets, the supplier is willing to sell them to me for $0.25 each. Now I have to cut my price because I have thousands of others selling the same type of widget, so lets say I cut the price to $2.50, my cost is now $25.00, but my revenue is now $2,500, that leaves my net profit at $2,475. I am making way more money now that I am in the Akihabara, even though I am losing some business to my competitors and my per item cost is lower, my profitability is actually better.

Now, lets say we do the same thing for a service based industry like plumbing. I have a plumbing business out in the suburbs and I charge $175 / hour to fix plumbing, maybe I get 100 hours of work every month since I am out in the suburbs and I am the only one. I am making $17,500 per month, I’m doing pretty well. Now I move into the plumber’s alley in town with 50 other plumbers, well, in order to get jobs, since it is so easy for customers to shop around, I have to cut my rate to $65 / hour, and since I am around there with 50 other plumbers, there is a bit more foot traffic, but I am just one guy so when I am out on a job, I can’t collect any more work. Now I am doing 150 hours of work each month, but at $65.00, I’m only making $9,750 per month. The answer would be to hire another guy, let’s say I do that, now I can do 300 hours of work each month, but I have to pay this clown, plus the drain on my time to train him to do it my way, after his pay, I am making $45.00 / month, $13,500, not bad, but still not as good as working less and making more in the suburbs.

Software is not exactly the same, but it is similar enough that the calculus works out nearly the same. I have just seen this happen with my CycleMetrics application, which applies to a broad vertical, versus my Mides application, which applies to a very narrow vertical, and came out when there were very few items in the app store.

With software, there is a significant up-front cost of your, or if you have to hire a team, your team’s time.  But for most people in the App Store, it is just you, lets say you want to build a really high quality application, it takes you about 18 months to get it all done alongside your day job.  You have put about 2,000 hours into it.  Typically your time is worth about $125 / hour, or at least that is the neighborhood in which an agency would price you out at as an iPhone dev in the bay area.  So you have put $200,000 into this iPhone application, or if you were to do a 12 month consulting job instead ( because it would be full-time ), that is what you would have made in salary plus benefits, or salary if you are a typical contractor.

By the time you put out your app, there are 300 other applications that do the same thing, 90% of them are crapware fake web apps with a Cocoa wrapper.  But in the App Store, the users can’t really tell the difference since the reviews have been gamed endlessly.  You don’t do any of that stuff, you play by the rules.  All of the other apps are priced at $0.99.  The target you have set to recoup your initial capital investment of $200,000 is two years.  You expect to sell about 100 a month average over 2 years, because your app is super awesome and you get a good pre-release review.  You realize that you would have to sell your app at $84 each to make that up in 2 years.  So you give up and hope for the best, you hope that Apple features you, or you hit the top 50 list.  You price your app at $19.99.  Apple rejects you a few times, so you have to put in another 100 hours into getting through the review process, now you are 2100 hours into it.  You figure you will eat that as a sunk cost now, chalk it up as a learning experience.

You sell 15 initially because people think it is so awesome that name-the-apple-podcast reviewed it.  Soon you start to notice a few bugs being reported in the comments that the Apple review has missed, and so have you.  But it will take a while to get the fix to market, and so you start this process over and over again.  This time it only takes 10 hours, but you have invested 2110 hours into the project, and have a 2 star rating in the App Store.  Now your sales are so low that you have to drop the price to keep moving units.  If you try raising your prices later, you will just not sell.

Even if all of the past time is sunk, you have future time in support and maintenance costs, even if you don’t add features.  It is the plumber model, you can never be as profitable as if you are a single guy working in an area in which there is nothing else like what you offer.

Most developers don’t count their initially invested time as money, so most developers don’t see this, but time is the only truly non-renewable resource.  They hear about the guy that sold 80,000 copies of x game in a month and raked in a million dollars.  Of course there will be a few like this, its like winning the lottery.  Apple picks a few and they do well for a time, after that however, they get pushed back into the pit with everyone else.

So, is there any way to fix it?  Apple has no incentive to fix it, they, and the app consumers are the beneficiaries of the huge delta in hours invested in the iPhone apps in the app store, and the lack of profit that the devs are getting.  I don’t think we should complain about it though.  It is awesomely powerful to be able to reach millions of people through the app store with a tap and a search.

There are three ways for devs to acheive profitability, one is for everyone in a section to raise their prices.  The overall sales volume would drop, but the profitability would increase, and everyone would make more money, not as much as if they were by themselves in the section, but more than they can make with the brute force of the quasi-free market forces in the app store.

The second way is to use the app store and your application to sell services outside of the app store, like Omni or pandora.  In Omni’s case, they use OmniFocus to drive sales of their mac desktop application where they have a vertical they own, selling productivity products for Mac OS X.  In Pandora’s case, they are using their application to drive affiliate link revenue as well as potentially some aggregate data mining products.  Either way, the bulk of their revenue is going to come from their other business efforts, the App Store is just an adjunct to this.

The third and probably most difficult way would be to come up with a product that is so unique in its technical application that it creates a natural barrier to entry, or to create a product for a vertical that is profitable, but is so small or difficult to understand that most competitors wouldn’t bother.  Examples of this would be like some sort of law research assistant with artificial intelligence that you could charge $199 for, or a notional application that would speak to industrial robots for which you could charge $30,000, but then you become acutely aware of the 30% that Apple charges.  At that price point, it might make more sense to develop it for Android and offer it directly from your site, but you get the idea.

The gist of all of this is that Apple has created a wonderful retail location in the image of their physical item store, one in which they have a monopoly on impressions and can leverage economies of scale.  Since economies of scale have no clear practical application to software development, the App Store should be seen as a massive lead generator for some other monetization strategy.  Getting angry at Apple for being Apple is pointless, take what they have given you and use it.

The last thought that I will leave you with is that Objective-C development is fun, and researching the background of Objective-C / Cocoa from smalltalk is also fascinating.  I am not for one minute suggesting that you shouldn’t develop applications for the iTunes App Store.  On the contrary, I think you should, but you should develop the applications because you enjoy the process, not because you hope to recoup your investment in a number of years.  You will likely not be able to recoup but a fraction of what you have invested.  That is not to say that you won’t get an awesome job with someone who has figured out how to make money in the store because of that initial time investment.  That is what I would be using the developer program for, to enrich and expand my programming abilities, not to try to get rich quick.