Friday, May 22, 2009

Not wasting food on your plate - Indian custom gone wrong

Here is another low-hanging fruit for bolstering your diet - if food is left on your plate after you are done - THROW IT AWAY! NEVER, EVER, EVER eat food because it will go waste.

This problem of not wasting food on the plate is especially prevalent among Indians, who consider it a cultural taboo to waste food, which is considered equivalent to insulting God. But the problem is by overeating you ARE insulting life itself, not to mention doing harm to yourself and your surroundings. The custom itself came from a time, when food was not as available as it is right now, atleast for many of us. So it is a more stronger version of "saving for the rainy day". But if you are on a diet, you KNOW you are trying to lose the rainy day reserves, so it makes no sense to eat the excess food.

If there is food wasted on your plate, remember you are the one you have taken more than you require. So deal with the problem by judging the quantities correctly in future, and not by stuffing yourself.

A special mention is required for social occasions in the Indian context, where the host is serving food. The host is EXPECTED to over-serve, lest the guest is feeling shy. Such scenarios need the guest to be culturally sensitive and handle the situation tactfully. If it is a once-in-a-blue-moon thing, just accept it. If it is more frequent, do inform the host politely but firmly that although you appreciate their hospitality, you do not want extra food on your plate.

Wednesday, May 20, 2009

Missing tasty foods for diet? - here is why your diet WILL fail

"Fallen off the wagon, have you?" is what people (who know I am on a diet) say when they see me eating chocolates, kebabs, lassi and hyderabadi biriyani. However what most people do not realize it that by staying off your favorite foods, your diet is essentially doomed!

The trick is to NEVER give up your favorite foods. If you do, you feel like sacrificing, which adds a lot more emotional stress to your diet. And believe me, your diet will fail, especially once the results start pleatueing.

All you have to do while eating your favorite foods is to make sure you are not exceeding calories by too much. Generally I put 2 complete days as no-diet days every week (mostly saturday and sunday), that way, I diet the entire week and eat the items I love on these two days. The important point of eating during these 2 off-diet days is RELISHING the food! not splurging it. Order a chicken biriyani or icecream, but eat until your hunger is satiated, not until your stomach feels like bursting!

I also realized something during this time - I used to eat one and a half biriyanis generally, but after I started eating only till my hunger was satiated, I am eating only half a biriyani! This is a very useful thing to do especially once your diet concludes and you are following a normal diet.

And most important of all - NEVER eat fatty food you HATE! For example, I hate sweets in general, but used to just pop them whenever I pass by a sweet box, just for the heck of it. NEVER do this. there is nothing more counter-productive and stupid than eating fatty foods you hate!

Spot Reduction Myth - Nightmares while losing tummy


"Do crunches/situps to reduce your tummy" - If I had a cent for everytime that was said to me, I would be a billionaire. But people fail to realize that this seemingly logical "truth", is a total myth! You do not lose any tummy fat by doing crunches/situps, anymore than you do by doing biceps.

This myth makes people believe that by working out a muscle underneath the layer of undesired fat, the fat will melt away! Fat is lost through out the body in a uniform fashion depending on genetics. However this myth which was started by the afternoon infomercials seems to be propagated on and on and on. They are able to sell more and more stupid devices like abdomen belts etc due to the prevalence of this myth.

You would be much better off doing cardio or weight training, than trying to strain those abdomen muscles exclusively to get rid of your tummy. Although, by doing crunches you improve your muscles in your abdomen it does not help if you have any amount of fat in your tummy, which will cover that six pack.

Also another major disadvantage of doing situps is that, you may end up getting lower back pain, which sucks because you could have avoided this altogether if you knew about the spot-reduction myth before hand!

So control your food, and do whatever exercise you feel like and count calories to make sure you are not over-eating. and your tummy will vanish in no time!

Here are some more links from Wikipedia and exrx.net about this myth.

Saturday, May 16, 2009

Virgin Cuba Libre - My Summer Special

Well to beat the Hyd heat over the weekends, I have devised my own mocktail which I call the - Virgin Cuba Libre. Well if you know the normal Mocktail naming conventions, you know what I am talking about - It is cola with Ice and Lime :) (Cuba Libre is Cola on Ice with white rum. A Virgin prefix for any cocktail indicates the alcohol part of it will be missing - just like a Virgin Mary is the mocktail equivalent of the Bloody Mary)

The recipe is simple, take a glass of Diet Pepsi, and add lots of icecubes. Then add a wedge of lime to it - and presto your new mocktail is ready for drinking.

WARNING: Using recipes created by the holy cow has been known to cause long lasting bouts of nausea, revulsion, headaches and suicidal tendencies in almost all people, other than the holy cow himself. So be forewarned! :D

JP wins from Kukkatpally

It is heartening to see that a leader who stands for development and progress has won the Kukkatpally seat. Call me pessimistic, but I thought that JP's chances of winning were pretty bleak given how easily voters get misled by false promises and alcohol/money supply. But the fact that the urban voters have come out against the traditional parties and voted for JP means that a definite change is happening although it is currently at a scale which will not affect the established polity. Also the lead of 15000+ votes is more or less substantial.

I believe JP now needs to develop a incorruptible second rung of leaders - who will also become equally famous as him. This will ensure the sustainability of the party in the state.

Lets see how JP develops his constituency over the next 5 years. And more than the constituency itself, people will be watching how he would approach various issues in the Legislative Assembly sitting in the Opposition. I strongly believe if he makes enough of a positive impact, Lok Satta can become a force to recon with in the future.

Monday, May 11, 2009

Processor Name Confusions

It used to be confusing a lot when people talk about i386, x86, AMD64, opterons etc. However there are some minor (and some major) differences in these terms. I try to explain some of the differences in this post. Consider this a very brief history lesson too :)

BTW, I oversimplified some product lines, so that clarity is maintained.

8088:An 8 bit processor from Intel, one of the first ones. You wont find this anywhere on PCs [EDIT: This is actually a 16 bit processor with an 8-Bit external bus]

8086:A 16 bit processor from Intel. Code written for this processor will STILL execute on even the latest Xeon multi-core processors! Such is the level of backwards compatibility provided

80x86:This is used to indicate the processors after 8086 like 80186, 80286, 80386 etc. This has been shortened to "x86".

x86:See 80x86

286:This processor had some basic support for segmentation etc

386:This was the first 32 bit processor in the Intel line and had a fully supported protected mode (along with an MMU), paging etc, which enabled development of complicated operating systems like Windows, Linux etc which provide features like Virtual Memory, protection between user processes & kernel etc.

486, 586, 686:Subsequently improved versions of 386

Pentium:For All processors mentioned before, other companies like AMD etc could make similar clones, AND use the same name, essentially denying branding of Intel's products. Intel's efforts to trademark 386 were denied by the US Govt on the grounds that a number cannot be trademarked. So Intel released the Pentium Line of processors to overcome these trademark issues. It was now able to prevent other companies from using the same names as itself.

Athlon:After Intel trademarked Pentium name, AMD was forced to use a new name for its processor line. It chose Athlon.

Itanium:Itanium was a 64 bit processor from Intel which was NOT backwards compatible with the x86 line. It was also fundamentally different at the ISA level using a VLIW architecture instead of the standard CISC of the x86 line. This was a major disaster for Intel, since AMD undercut it by releasing a x86-backwards compatible 64 bit processor. Barring a few HP machines, this did not sell much.

Athlon64:After Itanium, which required special OS and application development was faltering in the market, AMD released the AMD64 ISA which was backwards compatible. The corresponding 64 bit processor was Athlon64.

Opteron:Opteron is the AMD's Server class processor

Xeon:Xeon was a newer x86 64 bit Server-Class processor which was compatible with the AMD64 ISA. (Intel actually chose to call it EM64t instead of AMD64) (The 64 bit desktop processor was simply Pentium IV with EM64t)

IA32:This is the processor Instruction Set Architecture (ISA) of the i386 and above, 32 bit processors. Although this used to be called the x86 ISA, it was retroactively named as IA32 by Intel after the release of the IA64 line

IA64:See Itanium

AMD64/EM64T:See Xeon. Linux takes a neutral approach and calls it x86_64 architecture.

Xeon with HyperThreading: Hyperthreading (from Intel) is the poor silbling of Multi-Cores. Basically using just one processor core (and cache etc) they try to execute multiple threads. Some applications actually faced decrease in performance with this enabled. AMD never bothered to implement this.

DualCore: Intel failed horribly while trying to push processor speeds to more than 10GHz. It conceptualized a new Processor Architecture called NetBurst, which was supposed to do this, but it was overheating at sub-5Ghz levels itself. So Intel cleverly shifted focus away from processor speeds to Processor Cores per Package. Now even 8 cores in a single package are also being developed.

I chose not cover the Mobile class of processors like Pentium M, Atom etc and the latest GPGPU offerings from NVidia etc as this post was getting too big!

Adrian v1.0 RELEASED!

At last I ironed out the bugs in the 1.0 branch and was able to release Adrian both for Windows and Linux. You can download the Linux version or the Pre-Compiled Windows Version.

Hope you guys enjoy the game. Do report any bugs you find here.

Source code is licensed under GPLv3 and the SVN repository is located here.

Here are some screenshots from the game (scaling them reduced the quality here)







Same post is copied at adriangame.blogspot.com

Friday, May 8, 2009

Interesting Bug in C++ code

I was trying hard to release a 1.0 version of Adrian game, but we had to face a showstopper bug which was crashing the Windows Release version, on start of the game itself. After hunting for it for a long time, I was able to figure out the bug, which turned out to be a very interesting issue.

Basically we have a structure which has an embedded vector STL class in it. What the code was doing was to create the structure, and before assigning contents to it, was simply memsetting the entire structure to 0. While this is normal operation in any C code, in C++ this can cause very weird bugs.

When the vector is embedded in the structure as a C++ class (Composition), it's constructor gets calls when the structure is created. This constructor actually setting some fields (pointers namely) to some initial values. However, when we memset the structure, the vector fields are again initialized to zero (and the pointer to NULL). So whenever I try to access the vector it causes a panic.

The fix was to simply remove the memset code, and then write a new constructor for the structure, which will initialize the other variables to zero, leaving the vectors alone. What a bug! it took a lot of hunting to get to this one :)

Now, We would be able to release Adrian 1.0 version soon.

Thursday, May 7, 2009

The MOST important dieting secret

NOTE: I am no doctor or dietitian... so this may or may not work for you and worse can cause serious problems... so just consult you doctor or whatever... end of disclaimer...

Most of you who know me, already know that lately I have become a complete health nut. Well that is true. The reason I became a total health nut is that I figured out a very important secret for fat loss. (Note that I am saying FAT loss - NOT weight loss). OK, this is turning out to be freakishly close to the infomercials you see on afternoon TV :D, But bear with me, since I have no financial motive :P

The mantra is "Reduce NET calorie intake". Couple of points...

- Your body requires about 1900 calories per day
- You make sure you eat 1400 calories - no more no less
- That deficit of 500 calories over 7 days is EXACTLY equal to 1 POUND of Fat

Now forget all the "tips" you hear from people, and just follow the mantra... Some of the tips I heard over the years from various sources
- Dont eat before sleeping
- Eat groundnuts
- Avoid Eggs
- Cashew is good for weight loss
- You cant lose fat without exercise
- Follow Atkins Diet
- Avoid non-vegetarian and alcohol
- drink lots of water (another was avoid water, since you will get "water body" - whatever that is!)
etc

Just assume all that is lies, lies, lies, and stick to the mantra. (Ofcourse many of them have as much truth in them as there is gold in sea water... yes there is, but does it really matter?) So choose any diet you want and stick to 1400 calories per day routine. You will lose 1 pound per week! It is the first law of thermodynamics!

This is the basic diet plan that I used for 3 months to get down from 68+ kgs to 61Kgs. I have tweaked it a lot lately, to help my strength training, but the basic principle stands.

Codefest :)

Two weeks ago, I resurrected an old game that I have written six years ago with my friends. I was not sure how long it would hold my interest. But I guess I was unnecessarily worried. I have completed over two weeks of work on it and spread over 60 changesets, the total Lines of Code changed is easily over 8,000 lines. So that is good work for 2 weeks, working part-time. The entire game has been revamped, with more focus on extensibility.

Although it will look mostly like the old game, extensive code reorganization work was done on it. Loadable TTF Fonts, Loadable Maps, efficient rendering etc are some of the things that I have been working on. Booty has been working on the windows port. Once the code re-org is completed, we plan to add more experience and gameplay changing features like terrains etc.

We also plan on providing a FPS kind of perspective, in future - but that is a long way to go. By using a source code repository, tracking these major release branches is turning out to be very easy!