Scott Hanselman

South Africa 2008: NewsFlash - Turns out eating less and moving more causes weight loss

January 3, '09 Comments [36] Posted in Africa | Musings
Sponsored By

image0-1When I left for South Africa I was 193lbs/87kg, my heaviest ever on a 6 foot/1.8 meter medium frame. This was shocking to me because I could totally see 200lbs coming. It was right there ahead of me. As a Type 1 Diabetic getting fat(ter) is deeply uncool. You can literally be a Type 1 (insulin dependant) and Type 2 (insulin resistant) diabetic at the same time. This would mean I'd need to take MORE insulin to do the SAME amount of work. I'd already started seeing this recently as my total daily insulin dosage, usually under 30U (Units) was creeping up to 40U.

Then we headed to Africa for our semi-yearly sojourn. Fast forward roughly a month and I'm 176lbs/79.8kg. That's 17 pounds, or as a newly svelt person me likes to say "I lost, like, 20 pounds!" The trick will be to keep it off, but here's what I think worked (as I lose nearly 20 pounds on EVERY trip to Africa, and nearly every trip overseas. The tragedy here is the re-gaining and re-losing of that same 20 pounds.)

These are totally obvious observations/tips, but I'm a little dense, so I'm writing them down.

That picture to the right is me when I was thinner. I'm also the short one in the picture.

Don't Eat a Serving Larger than Your Fist

I didn't consciously do this, it just happened. As my wife and I discussed in our recent podcast, folks just show up to visit and food is divided appropriately. This is not to say that I wanted for food in any way. I didn't. It's that my hosts in South Africa gave us a reasonable amount of food, not an American Amount of Food.

This just happened to be about the size of one's fist. Kind of unrelated, I mentioned this to the boy's doctor since the older boy wasn't eating that much and he said that most kids will naturally eat what they need to, no more and no less, and that amount was often about the size of his fist. We'd been wasting a lot of food as I was giving him a plate full of food as big as his head! So, it's a fist-sized serving for me.

Eat Breakfast

I am notorious for eating one giant 1pm meal, ahem, then a giant 6pm meal, then a small (read: almost giant) midnight meal. This didn't fly in South Africa, as there was a lovely light breakfast at 7am, lunch at 1pm, and a dinner around 6pm. Each was appropriately proportioned, especially lunch which went on the assumption that you ate breakfast.

I realized that I've been eaten Epic Lunches to stave off death by starvation from skipping breakfast entirely. While eating breakfast does make my diabetes a little more tricky to manage as it adds a new variable, breakfast does support the next tip...

Eat Only Enough to Get You To the Next Meal

or

You Will Eat Again, In Your Life, You Know

My brother, the Ironman competitor and firefighter, taught me this not-obvious-to-me tip. He says that folks who aren't eating often enough eat like it's the last time they will ever eat. Rather, try eating with the knowledge that you will eat again in a few hours. If you realize that this meal only needs to get you to the next meal. This is the single most powerful dieting tip I've got.

Reset Your Full Indicator

My wife calls overeating "Pushing Through" as in "Oh, I pushed through with that last bite." Not recognizing what full feels like is a big problem for me. Basically you can reset your internal gas tank indicator by just thinking about it. "Am I full?" "Do I really need that next bite?" This has caused me to eat about 1/3 less without actually feeling any less full. Actually, I feel less bloated after meals.

Aside: I actually have personal data (and charts!) that reflects this - while I was in South Africa my daily insulin usage (and hence, carb intake) went from 30-40U a day to 20U. Basically I used 33% to 50% less insulin per day.

Move More

I didn't visit the South Africa that a lot of people do. In my South Africa not everyone has a car. In mine you can easily fit 9 people into a VW Golf. Either way, I walked a lot. If there's no car available and you want to go to the mall that's 3km away, you walk. This, along with sweltering heat and a lot of water, is another nice way to lose weight.

This year I've started working out, six days a week, for eat least an hour. I'm alternating cardio and anaerobic exercise. I'm finding that if I time my workouts with the length of certain television shows, I can make it through without going insane. That means, 40 minutes of cardio while I watch, say, Heroes. Then 22 minutes of weights as I watch Arrested Development. I'm actually watching more TV (and enjoying it) but I don't have to feel bad since I'm moving.

Drink Water

Yes I know if you drink WAY too much water you can mess up your salt/electrolyte balance, but a few liters a day are what I've found is the right amount for me to lose weight. I can't overstate how water intake directly affects weight loss. It's really amazing. Everyone I know with 6-pack abs carries a water bottle around with them. While I was in Africa I really upped my water intake because of the heat, to the point where drinking water at every turn was second nature.

What are your weight loss tips, Dear Reader?

Technorati Tags: ,

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Back to Basics: Explore the Edge Cases or Date Math will Get You

January 3, '09 Comments [21] Posted in Back to Basics
Sponsored By

Disclaimer: I don't work for the Zune team and I don't know anyone on the team. I think that Z2K9 was a bummer, but I don't have any inside knowledge. Everything here came from the public interweb.

Dates will get you every time. Further more, it's all about Edge Cases. This is one of the things you'll think about when doing Test Driven Development and it's one of the things that everyone learns in Computer Science 101. You really have to hit those edge cases, be they dates, or number overflows, or buffer overflows.

The news reports:

"A bug in the internal clock driver related to the way the device handles a leap year affected Zune users," said the company in a statement. "That being the case, the issue should be resolved over the next 24 hours as the time change moves to January 1, 2009."

Disclaimer*2: I have no idea if the following is 100% true, only that it seems quite plausible. I present it for educational purposes, nothing else. It's very interesting. Again, I'm just a caveman.

A Zune Fan poked around in the source code from the vendor (Freescale Semiconductor) that made the real time clock in the Zune (The vendor's source for rtc.c is here) and with the benefit of hindsight, noted that there's the opportunity to get stuck in an infinite loop.

The Zune 30 shows the date and time, as do many devices, as the number of days and seconds since January 1st, 1980 at midnight.

year = ORIGINYEAR; /* = 1980 */

while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}

The days variable is read out of the memory location managed by the Real Time Clock (RTC). When the value of days == 366, you break out of the inner loop, but you can never get out of the outer loop.

A number of folks have blogged about the bug, their analysis and how they'd fix it. Programming Phases has a good post and folks have twittered suggestions). The basic problem is that since there are 366 days remaining when the calculations are reached for the year 2008, there will never be another subtraction to bring the total below 365, so the loop continues. The value of days is stuck at 366. It IS a leap year, but days is not > 366, so the loop continues.

In working with banking software for years, I can tell you that dates'll get you. When dealing with dates and date math you can't underestimate the value of really good code coverage. Also, even if you have 100% coverage, as I learned in my interview with Quetzal Bradley, 100% coverage just tells you a line of code DID run, it doesn't tell you that it ran correctly.

I noticed also when I visited my Live home page on Dec-31 that it said today was Jan-1, likely a Time Zone glitch. However, when I clicked the date, I was taken to a page with historical facts about Dec-31. ;)

jan1

dec31

Dates, especially when TimeZones are added in, are notoriously hard.

To this day there are a half-dozen bugs in DasBlog where we have a devil of a time with Time Zones. Omar spent weeks fighting with them before he just gave up. We have to reconcile the local time of the visitor, the time on the server, and GMT time (the time we store everything in). It usually works, but when the Server isn't on GMT we get into all sorts of trouble. We also have problems with clients that call the XML-RPC APIs, some of which use UTC (GMT) time and some use local time. Other than keeping an internal table to wrong-headed clients, there are no good solutions.

In 2007 CNN talked to a Major General about a bug in some F-22's that caused them to malfunction when going across the international dateline. The Unofficial Apple Weblog had an interesting post on Apple Date/Time bugs through the years. If you're interested in working with and maintaining legacy code, I recommend Michael Feathers' Working Effectively with Legacy Code.

As a random slightly-related aside, I was over at Hollywood Video buying a used copy of Mirror's Edge yesterday and some folks were talking about the Zune problem. The manager said, wow, I'm running the music in here on a Zune right now, and produced his brown 30G Zune from behind the counter. He either hadn't turned it on today fresh or the clock was wrong so he was able to weather the whole day without an incident. He seemed pretty pleased about his "survival."

I wonder how many other less widespread devices are running this real time clock and if any of them had trouble as well.

Do you have any personal Date/Time stories, Dear Reader? Please share in the comments!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

South Africa 2008 - Avoiding or Minimizing Jet Lag

January 2, '09 Comments [17] Posted in Africa
Sponsored By

We're back and we've got a little problem. Part of the family has jet lag and part doesn't. It doesn't matter who does or doesn't ;) but some of us have figured out a few basic tricks when crossing more than 4 time zones. They work for us, but YMMV (Your Mileage May Vary).

In this case, we were travelling from GMT-8 to GMT+2, so that's 10 time zones. Right now it's 9:05pm where I am, and it's 7:05am tomorrow morning in South Africa.

It's not really possible to completely AVOID Jet Lag. It is JET-lag, and not bicycle-lag or walking-to-fast-lag. The human body just wasn't meant to cross an ocean in a few hours. It's supposed to take a few months or not happen at all. ;)

Now, as a diabetic, I have to pay more attention to Time Zones than most travelers, but this is all pretty standard jet-lag stuff but a little attention to detail and being willing to mess with oneself psychologically can cut your jet-lag recovery time in half or better.

  • Ahead of Time: Try to work out lots, especially cardio, in the days before your trip. I'm not sure why this works, maybe circulation, maybe it makes you tired, but it helps.
  • Water: Drink ridiculous amounts of water. I try to do at least two liters a day while travelling and I keep drinking two liters a day when I'm recovering from the flight. (Really, just drink lots of water all the time)
  • Take Advantage of the Flight Time: Our total door-to-door travel time was just over 26 hours. That's 26 hours that you COULD be getting acclimated to the destination time. I move my watch, and consciously try to move my brain to the destination time as soon as I sit down in my chair. That means literally saying to yourself, "OK, it's 7am. What would I be doing at 7am?" and trying to do it. You might find yourself needing to walk briskly around the plane when everyone else is sleeping, but it's worth it. There's many travel hours that you can be using to get ready for destination time.
  • Don't sleep when the Clock says it's Day: Lots of folks say that "your body knows what it needs." I believe this is nonsense when travelling. I think that jet-lag is the one time when your body has NO idea what it needs. You need to override your body's ignorance with your brain. If you get in to Europe at 2pm and you are exhausted, really, wait until at least 8pm or preferably later to sleep, otherwise you're screwed. I've watched people wandering around at 2am, ready for dinner, because they've slept their "8" in the middle of the day on destination time.
  • Be aware of travel direction: I find that travelling West is really easy. Travelling East is the killer. An excellent explanation from Wikipedia:
  • There seems to be some evidence that traveling west to east is the more disruptive. This may be because most people have a circadian period which is a bit longer than 24 hours, making it easier to stay up later than to get up earlier.

    It may also be that flights to the east are more likely to require people to stay awake more than one full night in order to adjust to the local time zone. For example, comparing a typical schedule for a traveler flying to the East vs a traveler flying to the West:

    • Westward from London to Los Angeles, VIA BA0279, Jan 29, 2008. Time zone difference 8 hours.
    • Westward Biological clock Los Angeles local
      Departure JAN 29 - 10:05 JAN 29 - 02:05
      Arrival JAN 29 - 21:10 JAN 29 - 13:10
      Bedtime JAN 30 - 06:00 JAN 29 - 22:00
    • Eastward from Los Angeles to London, VIA BA0278, Jan 29, 2008.
    • Eastward Biological clock London local
      Departure JAN 29 - 15:59 JAN 29 - 23:59
      Arrival JAN 30 - 02:05 JAN 30 - 10:05
      Bedtime JAN 30 - 14:00 JAN 30 - 22:00

    The first scenario is equivalent to staying up all night and going to bed at 6am the next day — 9 hours later than usual. But the second scenario (eastward) is equivalent to staying up all night and going to bed at 2pm the next day — 12 hours after the time one would otherwise have gone to bed.

  • Use Daylight: This one is the most important. When you arrive, either home or away, be outside as long and as often as possible. We used this on the children. The more sun you get (don't get burned) the more your brain will be reminded that it's daytime and you should be awake. This works even if it's snowy or gray. Just get outside!

What works for you, Dear Reader, when trying to minimize jet-lag?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 144 - Week Three in South Africa - Ntombenhle

January 2, '09 Comments [12] Posted in Africa | Podcast | Programming
Sponsored By

My one-hundred-and-forty-fourth podcast is up. Scott's on holiday in South Africa with his family this month. Rather than doing repeats or "best of" shows, Scott's doing man-on-the-street interviews and uploading them over cell phone. In this episode, Scott talks to his Wife, Ntombenhle, an MBA and Homemaker from Zimbabwe.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show!

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

Technorati Tags: Africa,South Africa,Ndebele,Zimbabwe,Zulu

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

South Africa 2008 - For Goodness' Sake, Go to the Airport Early

December 27, '08 Comments [8] Posted in Africa
Sponsored By

CIMG8726This trip to Africa was a reunion of sorts. My wife is the 4th of 7 kids, ranging in age from 38 to 18. This is the first time in over a decade that all seven kids have been in the same place at the same time. Folks are spread all over the world, so it's a challenge.

Our flight today was from Jo'burg to Paris, then to Amsterdam, and then on the lovely direct flight to Portland from Amsterdam. The Jo'burg flight left at 8:30pm. I really really like to not miss flights, plus I know that Murphy's Law always comes true. If it can go wrong, it will go wrong.

I suggested we leave for the airport at 3pm, which was heresy to the family, truly. Five hours early, are you insane?

I'm not sure what it was, but something felt wrong and I tried to find a balance between getting to the airport with some buffer and spending as much time with the family as possible. Certainly one doesn't want to break up a reunion by stressing about time.

We ended up getting to the airport at 5pm, which was nothing short of a miracle. It took about an hour to drive to the airport, plus the Jo'burg airport has a fairly complex parking structure, and there's some construction. It took another 20 minutes to load the bags and get to International Departures. 

CIMG8297 We were flying Air France this time (KLM before) and we knew that bags need to weigh less than 23kg/50lbs leaving the US, and 32kg/70lbs on the way back into the US. When we arrived at the Air France counter there was large sign that said just that - 32kg. Turns out that this weight limit changed in January, it's 20kg/44lbs for economy. Only Business Class gets 32kg. Everyone was having a problem with this today, and the guy in front of us was going insane. Like "I'll never fly Air France again" insane.

Weight is always a tough thing when travelling, and my wife and I always go back and forth about it. I tend to travel obscenely light. She wants to get her money's worth and bring everything and more, pushing to exactly whatever the limit is. However, airlines aren't giving folks any quarter these days, and I so people a few kgs over getting nailed with $50 per bag fees. We try to find a balance as a team.

CIMG8501 We usually weigh our bags with a scale, and I highly recommend you to also, and give yourself 5 pounds of wiggle room. The Jo'burg airport is interesting because it has a scale before you check in and they are strict. We had no trouble this time because we were prepared, but it was close.

The real trouble happened when we tried to check in. On the way to South Africa we had had a little problem with my infant son. He has my last name while my wife kept her name. However, apparently most airlines put a "lap child" record under the mother's ticket record. Suffice to say, someone got confused, and confused people usually mean confused computer records. They ended up putting in two infants. One with my last name and one with my wife's. When they asked if six folks were travelling, I said, no, five "souls" in four seats. (They say "souls" in the airline industry.)

CIMG8685 The first guy deleted the baby doppelganger and we travelled fine. This was over three weeks ago. Fast forward to today and when we go to the airport, the baby is gone. They'd deleted his record and ticket completely. But, he was still in there, floating around Tron-style in the system. The guy was doing his best, it was clear, but some foreign-key relationship was definitely not working. He spend literally 90 minutes working on this, going back and forth to ticketing, management, and IT. He ended up deleting our entire ticket completely and starting over issuing new tickets to get us boarding passes.

For me, in these situations, I seem to have infinite patience. For the most part these folks are doing their jobs, and announcing "I'll never fly Air France again" does zero good. I just kept thanking him for his patience, and for sticking with me. In the end, he fixed us, but also ensured us the baby bulkhead row as well. Thank goodness we showed up 3+ hour early or we would have been screwed, and the guy said as much.

The family was getting worried and stressed out, but we just keep reminding ourselves that this is all part of the fun. Everything is fun on vacation, and that is what we tell the kids. Sure we waited for and hour and a half at the Air France counter, but we did it together.

CIMG8735 We had a final meal as a group at Nando's outside security then headed in to Passport Control. This was tricky also because after waiting for a useless 90 minutes, folks figured that any urgency had passed. However, outbound Passport Control at Jo'burg is always busy and there's usually very few agents working.  I knew we could spend, easily, another hour waiting for our outbound stamp. The flight boarded at 7:55pm, and I was only able to get folks to say their good byes and start walking at 7:15pm. I didn't even bother mentioning that it was a full 2 kilometers between Passport Control and gate A17.

We played our trump card. We had a 3 year old and a 1 year old, so we went to the assisted passenger lane at Passport Control. This allowed us to avoid a line of over 300 people. However, we got stuck behind some UN guy whose papers weren't in order. Remember what I said about Murphy's Law? It gets better.

CIMG8322 After another 20 minutes as the next folks in line at Passport Control we moved up to talk to the agent. I remembered my trouble from before with my Passport at the Jo'burg airport and I wasn't going to make the same mistake again. Whatever trouble was coming, I was ready to be submissive and beg for assistance.

The agent started processing our passports. This consists of typing in the Trip Numbers from our South African Visas to show we departed. She typed with one finger like a slow tempo metronome. My passport was fourth and when she hit it, she couldn't make out the numbers because the original guy who got me out of the incoming trouble signed his name over the Trip Number. The agent went looking for help, and wouldn't you know it, she went and found the same guy from before. This is the guy who argued with the young girl about whether or not we were allowed to put Visas on the amendments pages of American Passports. He totally remembered us and said that he'd doubled checked after the unfortunate trouble before, and that yes, you can put Visas on the amendments page via a special memo from the US Embassy.

CIMG8372 Anyway, at this point, it's 7:45pm and we're really pushing it. We take off speed walking with the 4 bags, and two kids, which isn't really speed walking at all. It was easily 2km to the gate, and they were boarding when we got there.

It's always amazing to me when I'm walking onto a plane literally within minutes of missing it that things work out at all. I mean, we started packing at 9am, we left the house (late, I thought) at 4pm, for an 8:30 flight and we needed every minute.

Any additional hiccup, any bathroom break or trouble over this day-long process would have caused us to miss the plane. I am sad that we've left South Africa this year, but I am glad that we didn't miss our flight. I believe we didn't because we went to the airport early. I will always show up for international flights at least three hours early and now I've got a fun story.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.