The Secret to Losing Weight by David Heinemeier Hansson (or what he would say)

February 20, 2010 by Noel Gomez · Leave a Comment
Filed under: General 

Disclaimer: David had nothing to do with this post, but I am a big fan of  his and I have watched several of his speeches like this one.  His words (or my version of them) been my inspiration for losing weight over the last month and a half.

I have created a book for losing weight in the form of DHH.  It’s embedded below for free, enjoy:

The Secret To Losing weight

The background for the book

Over the years my wife would come to me and mention how she wanted to join some program like Weight Watchers and every time I would say “Give me the money and I will tell you to not eat so much.”  She would moan and grown about her weight about once a year, but about 6 months ago she started reducing her caloric intake.  Without counting points she switched to eating smaller portions for lunch and dinner and she began eating a lot more vegetables.  This has worked for her, she has lost weight and is very happy with her results.  Her mantra was “Nothing tastes as good as Skinny feels”  We heard that from some skinny girl on a reality show, don’t remember where.

I had kept my same routine, but in January I finally thought I needed to loose some weight after speaking to a friend who had managed to do just that.  He had reduced his caloric intake and began exercising and in a few weeks had amazing results (Biggest Loser type of results).  He has been at it for about 10 weeks and has lost over 40 pounds.

My Journey Begins

So taking my own advice I decided to “Stop Eating so F-ing much.”  I didn’t think I could cut calories since I only had breakfast on the weekends and rarely had lunch.  My main meal came at dinner and I thought I couldn’t possibly be consuming so many calories.  My one weakness was for dessert.  I love my ice cream before bed.

My friend, who is married to a dietician who does not necessarily like our method to weight loss, told me that to loose a pound of fat you needed to burn 3500 calories.  The engineer in me kicked into high gear.  Now I knew all I had to do was consume a lot less then what my body burned.  This was not necessarily a new revelation, but this number gave me a target.  I had read how people who began a diet and exercise program tended to either remain the same or gain some weight.  A few years back when I was doing a lot of traveling I began taking advantage of the hotel’s fitness centers and after months I saw little to no weight loss.  At the time I thought that given how little I ate adding exercise would have an impact.  Realistically I think at most I probably burned an additional 500 calories a day.  Hardly a dent.  Exercise also tends to have the negative effect of giving you a sense of entitlement to more food since you now are exercising.

To top things off, Linus pretty much nailed it when it came to exercise, at least for me.

Counting Caliroes

To be fair my wife and I already ate fairly healthy compared to most of America.  We would have salad with a side of protein at least twice a week and very rarely had any sort of fast food.  She cooks almost every day so our problem wasn’t eating a lot of takeout or ready to eat meals.

For me it all came down to having no clue how many calories I was consuming.  I had become complacent since I only ate one meal a day on most days, but once I started looking it was obvious.

I set a goal of consuming 1000 calories a day.  I didn’t go out and get a food scale, but I started looking at labels and modifying what I ate so that I consumed fewer calories.  Ice Cream was substituted with a single piece of Lindor Truffle (I love these things).  73.3 calories to cap off my day with milk chocolate goodness.

The most amazing fact was opening my eyes to how many calories are in all sorts of things I ate.  The tortilla for a breakfast burrito was over 100 calories each and that’s just the tortilla.  One wouldn’t satisfy me on the weekends so I would have to eat 3.  How about In N Out once in a blue moon.  A Double Double, French Fries and a Chocolate shake?  That can’t be so bad, I have that less than once a month.  Well, that meal is over 1600 calories, WOW!!!

I still have no clue the calories in certain things my wife cooks, but we have increased the number of salad only meals and I have reduced my portions.

How has it worked?

In just over 6 weeks I have lost about 10 pounds.  I have not suddenly picked up exercise.  I do the same things I used to do, all I have done was stopped eating so many calories.  If you watch Survivor you know that losing weight is not so difficult.  Everyone on that show loses weight.  I am convinced that the US would be a lot thinner if the government did not subsidize high fructose corn syrup because everything unhealthy has it and it packs in the calories.  I am also pretty sure that if everyone became more aware of how many calories they consumed, they would actively work to reduce them.

Is this Healthy?

I am not a doctor, nor do I play one on TV, but I just had a physical last week and all is well.  Carrying around an extra 10-15 lbs. can’t be so good and realistically a lot of people in the world, probably the majority, get by with fewer calories than I was consuming.  I have also read studies on longevity and reduction of caloric intake.

“I am so hungry… WAAAHHH

Most of my life I have not eaten breakfast or lunch and I have met many people who ask how I can go all day without eating.  I have come to the conclusion that their attitude is both psychological and related to their ingrained belief that X meal is important or that the body has to have food X number of times a day.  They get a headache if they don’t eat, they can’t function if they don’t eat, etc.  How are people in third world countries surviving?  My dog eats once a day and she has had a pretty full life.  I will admit that whenever I am on vacation I tend to eat more meals per day and switching back to the single meal after an extended period of multiple meals is difficult.  It is hard to fight the hunger, but after a couple of days you body adjusts.  Another thing which makes hunger worse is eating junk food or anything high in carbs or sugar.

When I started my calorie reduction the hardest part was the weekend.  I could no longer have 6 pancakes or 3 burritos, but after a few weekends I had conditioned my mind to not expect such luxuries.  Watch the contestants on Survivor.  The first few episodes people talk about how hungry they are, how they can’t function, etc.   But that, they adjust.  So can anyone.

The first rule of process improvement

Everyone knows that you can’t control that which you can’t measure.  Now that I am actively calculating the calories I am consuming I have been able to qucickly achieve that which had aluded me for many years.  My goal is to loose at least 10 more pounds.  I then figure that a person my size probably consumes around 2000 calories(educated guess, I am not a health Nazi yet lol), so I can probably increase my intake without gaining any more weight, but at least now I will be more aware of what I am consuming.

Now, as Peldi would say…. Onward

Medicare Fraud – Inspecting Quality into a process rarely works well

October 25, 2009 by Noel Gomez · Leave a Comment
Filed under: Process 

I just watched a story on 60 Minutes on how simple it is to game the Medicare system out of millions of dollars. Essentially, with a few pieces of static data a criminal can bill the system for medical equipment without having even met the Medicare patient. The government will pay the charges in 30 days and if the criminal gets a hint that they are under investigation, they just close shop and open up another business reusing the same list of patients.

The criminals purchase lists of patients for $10 per patient and bill Medicare for any number of devices or drugs. In the report they interview a person whose credentials were used to bill the system from two prosthetic arms. The man had his real arms and only learned of the fraud from a quarterly statement from Medicare.


Watch CBS News Videos Online

What I found most interesting is that the solution being employed to reduce the fraud is more law enforcement and more auditing. To me this is backwards. The government is trying to inspect quality into the billing and payment process. No matter how successful the government is, given the simplicity of the crime, I doubt the effectiveness of their efforts.

Instead of inspecting quality at the back end of the process, it is always better to prevent the defect. From what I know of the process based on the report, it seems that the main flaw is the fact that it is so simple to acquire the static patient credentials needed to bill the government.
keyfob
While there are probably more ways to prevent fraud, the solution I thought of immediately is giving each patient a single use token device like Secure ID. If the patient is involved in a medical transaction, they would be required to provide the provider a single use number which the provider would use to authorize that transaction with the government. While this would not prevent fraudulent companies from billing for unnecessary equipment, it would immediately render the patient lists useless since companies could not use them without the single use token.

A second line of defense would be to employ data mining software like those used by credit card companies. I imagine it would be possible to develop algorithms that would catch potential fraud before invoices are paid. For example, prior to paying for prosthetics, the system would assure that amputations had been billed.

It is usually simpler to add more inspections to the end of a process, but it rarely has the impact that error prevention does.

Competing poorly outside your core is not the way to win

August 17, 2009 by Noel Gomez · Leave a Comment
Filed under: Marketing, Strategy 

On Twitter today @paul_irish shared this infographic which illustrates why the legacy carriers can’t effectively compete with low-cost airlines.

Infographic illustrating how low-cost airlines beat their competitors

The information on this picture is nothing you can’t learn from taking any business school class, but what is interesting is how something so obvious is not put to good use. I have felt for a long time that by trying to compete with the low cost airlines, the legacy airlines are “stuck in the middle” as Porter suggested. Today these companies are neither differentiated nor low cost.

Bailout after bailout the legacy airlines pursue the same failed strategies. They continue to cut costs at the expense of service and I have noticed in my travels that the low cost airlines continue to outperform. The same was true of the US automakers and we see where that led.

Instead of trying to compete on price, legacy airlines should look for ways to leverage their size and put up a good fight against low cost airlines. A “fly anywhere” for a month pass from American Airlines is surely better than one from JetBlue. How about giving passengers who have to go through hubs the flexibility to book their connecting flight on a different day? I think everyone would see the value in being able to take a detour for a few days in Chicago on their way to Indiana. This perk would win favor with passengers while only increasing airline costs marginally (for additional baggage handling, automated check-in, etc.).

When a company sees itself losing sales to someone following a different generic strategy it can’t defend itself by trying to compete using the competitor’s strategy. It needs to get better at their strategy when on the surface it appears they need to abandon it.

Could Target ever beat Walmart on price? Probably not. Instead it chooses to have reasonable prices and compete on differentiation tied to style and trendiness. Dell has been trying for a few years to compete with Apple on style and has not done any better. When Apple was faced with extinction in the 90s instead of trying to compete on price they chose to go after innovation which was their core and is why today they are the model every company tries to copy. If you look at the early 90s, you can argue that it was the CEOs who lost that focus at Apple which put it in the predicament in the first place.

So when someone is competing with you don’t blindly abandon your core strategy. Look for ways to leverage what you have because your competitor won’t be able to effectively counter a strategy foreign to them.

Virtual relationships and the art communication

August 8, 2009 by Noel Gomez · Leave a Comment
Filed under: General 

Services like Twitter and Facebook have allowed us to connect with people in ways we never imagined. They have also allowed us to learn more about these people and to put our virtual feet in our mouths without even know we had.

You see, verbal communication and written communication are very different beasts. When you hear someone tell you something you get cues about their intention and motivation from the manner in which they say it. If someone is speaking to you and you are standing in front of them, you can pick up additional cues, but in the written word all you have are the words in front of you.

Some people are naturally gifted at writing eloquently. These people can defuse conflicts with just the right words, however, there are others who can innocently put a few words together and come across the wrong way. A comment made in jest or the combination of several tweets over time can distance those with whom you’d previously had close relationships.

The problem with social networks is that it is very hard to know if those in your network have been offended by something you said or something you did. It is even more difficult to try to mend a relationship once you think you have offended someone. In this new medium we don’t “have to” work with one another. We can block a user or simply choose to ignore them.

An employee known to work at a certain company posts a link to a video and their followers will unconsciously attach the emotions the feel while watching the video to the company. If a person makes a comment about healthcare reform, the type of computer they use, the political party they belong to or if their positions on such matters can be inferred, some followers will superimpose their offline prejudices on to those people and possibly the companies they work for.

We all look for ways to connect with others who share our passions, the problem now is that these passions are now being merged on to the same stream. One of your followers may share your interest for a programming language, but the same person may detest your love for Sarah Palin.

In the long run we are going to have to make a few concessions if we want to make the most of this new medium. We are going to have to learn to be more open with one another and instead of ignoring those who hurt us we could try to find the best in them and learn to forgive. We are going to have to understand that we are all multi faceted individuals and while in some ways we will agree, in other ways we may not. We shouldn’t throw the baby out with the bath water because there are still great things we can learn from one another. Now more than ever we need to give people the benefit of a doubt because some people are just not as gifted at putting together 140 characters as others.

Sending email in Rails via GMail & using HAML with Action Mailer

August 6, 2009 by Noel Gomez · Leave a Comment
Filed under: General 

Sending Email via Gmail

I was following the Action Mailer Rails Guide to set up outbound email from my app and I came across a problem when trying to use GMail. Many blog posts and the Rails guide point to plugins which enable TLS. I kept running into a wall and getting this error:

wrong number of arguments (3 for 2)

Luckily I finally found there is a very simple solution which is defined in the Rails API in ActionMailer::Base. This essentially says that Section 5.2 of the Rails Guide can  be simplified by adding an additional parameter to the smtp_settings:

1
2
3
4
5
6
7
8
9
ActionMailer::Base.smtp_settings = {
   :enable_starttls_auto => true, 
   :address => "smtp.gmail.com", 
   :port => 587, 
   :domain => "domain.com", 
   :user_name => "user@domain.com", 
   :password => "password", 
   :authentication => :plain 
}

There is no plugin / gem needed, but you must be on Ruby 1.8.7

From the Rails API:

  :enable_starttls_auto - When set to true, detects if STARTTLS is enabled in your
  SMTP server and starts to use it. It works only on Ruby >= 1.8.7 and Ruby >= 1.9. 
  Default is true.

Using HAML with ActionMailer

Section 5.3 of the Rails Guide also mentions a configuration setting to get Action Mailer to recognize HAML templates. This configuration is not needed. As I found here.

I added comments to the Rails Guide Lighthouse ticket, so hopefully the guide will be updated.

Book Review: Rails Freelancing Handbook

August 3, 2009 by Noel Gomez · 1 Comment
Filed under: General, Programming 

As part of helping out on a RailsBridge project, I was given a copy of the Rails Freelancing Handbook by Mike Gunderloy so I thought I would share my impression of it.

Overview

Even though the book has the word Rails in the title, a lot of the advice in this book can apply to anyone who wants to work on their own, from a freelance designer to a business consultant.

The book covers topics from deciding if freelancing is for you to legal and tax implications, marketing, and managing clients.

Writing Style

This book packs a lot of good advice and is a quick read at just 65 pages.  I love this.  There is no fluff, just clear concise advice based on Mike’’s personal experience as a freelancer.

Mike’s Advice

Mike does not pretend to have all the answers, but instead points you in the right direction.  Whether that means telling you to find a lawyer and an accountant, or pointing you to web resources for doing it yourself if you can’t afford one,.  This makes the book a really practical resource which you can refer to as you move through the stages of becoming a freelancer.

You will find that Mike’s advice is pretty comprehensive and you will gain nuggets of wisdom even if you have experience freelancing.  Even though I have done consulting work and have gone through the process of establishing an LLC, I learned about factoring receivables which was something I had no idea even existed.

Mike even covers ergonomics, using multiple monitors, and web based tools to improve your workflow.  I had never put as much thought into an office chair as I know Mike has, and since I’m a person that rather get the Consumer Reports version, I found this topic particularly interesting.

Conclusin

For under $10 you can’t ask for more.  This book is full of actionable advice for anyone starting a small business.  There is a free chapter online, so check that out and if you find it as useful as I did, you will want to get yourself a copy of this book.

The problem with SKU proliferation

July 24, 2009 by Noel Gomez · Leave a Comment
Filed under: Marketing, Strategy 

TechCrunch has a short post on the number of models of handsets Nokia and Sony Ericson have on their site.

Why Nokia and Sony Ericsson are failing

For reasons of market segmentation and distribution strategies electronics companies choose to spin new almost identical models of products which on some marketing plan may seem reasonable, but which in fact tend to confuse the customer and add operational overhead.

Whenever someone asks me about a laptop I can quickly tell them about all the Apple models, not only because I am a Mac user, but because remembering the permutations is incredibly simple.  MacBook, MacBook Air, and MacBook Pro.  It’s not hard to remember even for a person who tends to forget things, like me.

Look at companies like Toyota and Honda and you will find the same thing.  Very simple, clearly differentiated models each targeting a specific segment of the market.

Large consumer manufacturers should take note and not create a new indistinguishable model just to sell a “different” TV at Costco.  The iPod you can get at Costco and Walmart are in fact the same ones you get at Best Buy or at the Apple store.  Simple for the company and simple for the consumer.

The Toyota A3 Report | shmula

July 21, 2009 by Noel Gomez · Leave a Comment
Filed under: Process, Tools 

This is a really good article on the Root Cause analysis technique developed by Toyota.

The Toyota A3 Report | shmula.

A study of Sass (meta-language on top of CSS)

June 14, 2009 by Noel Gomez · 8 Comments
Filed under: Programming 

I’ve been experimenting with different technologies as I learn Ruby on Rails and recently I have been looking into using HAML instead of ERB and Sass instead of CSS.  I started using HAML a while back and I really enjoy how clean the template files look. This article has an argument for HAML and I agree with the author. I found an article on A List Apart on sprites and I thought it was a good way to showcase the awesomeness of Sass.  The article covers creating an image map with a hover effect.

The Links

The HTML for the map is below: (I modified the IDs from the original article to make it simpler to follow)

1
2
3
4
5
6
<ul id="menu" >
  <li id="menu_item1"><a href="#1"></a></li>
  <li id="menu_item2"><a href="#2"></a></li>
  <li id="menu_item3"><a href="#3"></a></li>
  <li id="menu_item4"><a href="#4"></a></li>
</ul>

Here is the same map in HAML: (WP-Syntax does not support HAML/Sass, but this is not too bad)

1
2
3
4
5
6
7
8
9
%ul#menu
  %li#menu_item1
    %a{:href => "#1"}
  %li#menu_item2
    %a{:href => "#2"}
  %li#menu_item3
    %a{:href => "#3"}
  %li#menu_item4
    %a{:href => "#4"}

The Style

In the article they discuss how the hover effect is achieved using this image. (dimensions added for clarity)
test-1
The CSS used for the hover effect is below with some minor modifications to the original:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
#menu {
  width: 400px; 
  height: 200px;
  background: url(../../images/test-1.jpg);
  margin: 2em 2em; 
  padding: 0;
  position: relative;
}
 
#menu li, #menu a {
  height: 200px; 
  display: block;
}
 
#menu li {
  position: absolute;
  list-style: none;
}
 
#menu_item1 {margin-left: 0; width: 96px;}
#menu_item2 {margin-left: 96px; width: 76px;}
#menu_item3 {margin-left: 172px; width: 111px;}
#menu_item4 {margin-left: 283px; width: 118px;}
 
#menu_item1 a:hover {
  background: transparent url(../../images/test-1.jpg) 0 -200px no-repeat;
}
 
#menu_item2 a:hover {
  background: transparent url(../../images/test-1.jpg) -96px -200px no-repeat;
}
 
#menu_item3 a:hover {
  background: transparent url(../../images/test-1.jpg) -172px -200px no-repeat;
}
 
#menu_item4 a:hover {
  background: transparent url(../../images/test-1.jpg) -283px -200px no-repeat;
}

In the article they discuss the math that must be performed to make this work, but it’s hard to go from all the values presented to the logic that was used to arrive at those values. In addition, there are a lot of constants and repetition in the CSS. Not very DRY in my mind. Now here is the Sass that will produce the same CSS:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
!menu_image = "url(../../images/test-1.jpg)"
!width_item_1 = 96
!width_item_2 = 76
!width_item_3 = 111
!width_item_4 = 118
!height_menu = 200
!unit = px
 
#menu
  :margin 2em 2em
  :position relative
  :width 400px
  :height = !height_menu + !unit
  :padding 0
  :background = !menu_image
  a
    :height = !height_menu + !unit
    :display block
  li
    :display block
    :position absolute
    :list-style none
    :height = !height_menu + !unit
    &#menu_item1
      :margin-left 0
      :width = !width_item_1 + !unit
      a:hover
        :background = "transparent " !menu_image "0 " -(!height_menu) + !unit no-repeat
    &#menu_item2
      :margin-left = !width_item_1 + !unit
      :width = !width_item_2 + !unit
      a:hover
        :background = "transparent " !menu_image " " -(!width_item_1) + !unit " " -(!height_menu) + !unit no-repeat
    &#menu_item3
      :margin-left = (!width_item_1 + !width_item_2) + !unit
      :width = !width_item_3 + !unit
      a:hover
        :background = "transparent " !menu_image " " -(!width_item_1 + !width_item_2) + !unit " " -(!height_menu) + !unit no-repeat
    &#menu_item4
      :margin-left = (!width_item_1 + !width_item_2 + !width_item_3) + !unit
      :width = !width_item_4 + !unit
      a:hover
        :background = "transparent " !menu_image " " -(!width_item_1 + !width_item_2 + !width_item_3) + !unit " " -(!height_menu) + !unit no-repeat

The top of the Sass file defines the constants that will be used for all the calculations in the CSS. This may seem like a little extra work, but it has a few advantages. First, this makes it simpler to calculate the position of the background image for the :hover and it allows the developer to quickly change the CSS if the image changes. For example, imagine that the image changed to this:


test-2
Not only did the dimensions for each item change, but the overall height changed from 200 to 50. If CSS was written directly, not only would the url to the new image need to be changed, but the positions would have to be recalculated and the height and negative y-position would need to change. Using Sass, we can just change the constants defined at the top of the Sass file:

1
2
3
4
5
6
7
!menu_image = "url(../../images/test-2.png)"
!width_item_1 = 75
!width_item_2 = 100
!width_item_3 = 50
!width_item_4 = 175
!height_menu = 50
!unit = px

I like the simplicity and flexibility that Sass enables when defining CSS. When I learned about CSS, the selling point was to allow the design of a site to be flexible, but having to statically define colors, positions, heights and widths for items like the one discussed here, make maintenance more complex and error prone. Imagine the potential for errors when the image was changed above. Finally, I believe maintenance and readability increases as it is simple to follow how the values are arrived at instead of simply stating the value.
 
Sass has a lot more to offer than what I present above. If you would like to learn more check out the HAML/Sass site.

iPhone 3G S, The world’s most accessible smart phone

June 8, 2009 by Noel Gomez · 1 Comment
Filed under: General 

Today Apple upgraded the iPhone and made it the most accessible phone.  As I had predicted in an earlier post, with more capable hardware they were able to improve accessibility.  Apple gets it, they see accisibility not as a hindrance, but as a way to create a competitive advantage.

Voice Over, speak it to me

With Voice Over anyone can now control the iPhone without needing to see the screen.  Gestures are used to move around and the entire OS is opened up to the blind:

You’ll hear descriptions of every item on the screen, including status information such as battery level, Wi-Fi and cellular network signal levels, the cellular network provider, and time of day. It even lets you know when the display changes to landscape or portrait orientation, and when the screen is locked or unlocked.

It is also localized

VoiceOver includes built-in voices that speak 21 languages including Chinese (Cantonese), Chinese (China), Chinese (Taiwan), Dutch, English (US), English (UK), Finnish, French (Canada), French (France), German, Italian, Japanese, Korean, Norwegian, Polish, Portuguese (Brazil), Portuguese (Portugal), Russian, Spanish (Mexico), Spanish (Spain), and Swedish.

This feature also allows a blind person to interact with a sighted person by displaying a Voice Over cursor which displays a rectangle around the item being described and the screen can be turned off for privacy.  The Voice Over feature could be great for a sighted person as well.  You can control the iPhone without taking it out of your pocket and you can probably extend battery life by not having the LCD on.

howitworks-20090608I am not sure how typing is handled (probably by selecting each letter at a time with the gestures), but Voice Over is a real win for the iPhone.

Voice Control, do as I say

Another feature that makes the new iPhone more accessible is Voice Control.  Apple prominently showcased this feature during the keynote announcement of the iPhone as one that has mass appeal, but here is another feature which helps the disabled by allowing dialing and music selection via voice commands.  It also supports 21 Languages.

you can use your voice to play music and make a phone call. Just press and hold the home button, listen for the audio prompt, and speak the name of the artist, album, or playlist you want to hear. You can pause, play, change tracks, even shuffle your music.

Zoom Zoom Zoom

The iPhone 3G S now lets you magnify the screen of any application on the iPhone.  Not only does this help those who traditionally need magnification, but Baby Boomers with poor eye sight now have an option for an accessible smart phone.

Zoom works everywhere, including the Home, Unlock, and Spotlight screens—even with applications you purchase from the App store.

zoom-on-iPhone

And there’s more…

These are just a few of the accessibility features of the iPhone , but these are ones which potentially have uses outside the disabled community.  It is clear that Apple is motivated to create accessible products, but by addressing this need, it also opens up the possibility to market these features outside the disabled community.

Be sure to check out Apple’s iPhone accessibility page for more information of solutions for the hearing impaired and those with physical and motor skills difficulties.

Next Page »