Bodyfat percentage with pictures

I think this is a great little article to help one understand what bodyfat percentages actually mean or “look like”. It also implicitly shows how low BF confers the muscular look many people are looking for. Check it out.

PS: thanks Serban for the link

The path from being able to program, to learning how to program

I found this post to be wonderfully insightful. Enjoy!

Communicating over the USB cable

For the eTegrity project I’m working on for my senior design, I needed the smartphone and the computer to communicate over a USB connection. This turned out to be an unusually difficult thing to figure out, but really simple otherwise.

Now, an important thing to note here is that it does require software to be installed on the host computer, specifically the adb tool from the Android SDK and of course the driver (this depends on your OS, see details here)

That being said, all you need to do is to activate port forwarding using adb. What this does is it maps a port on your local computer to a port on the smartphone. For example:

adb forward tcp:1234 tcp:1234

If it returns no message, it executed correctly, otherwise it could be that the port you specified cannot be binded on one of the two machines or some other issue (it will tell you). The link above is great for figuring out how to use adb, so just check it out.

Then, you can go ahead and implement regular sockets on both machines. For some reason, at least in my case the server socket had to be on the smartphone, all attempts to have it be on the computer failed. So put the server socket on the phone, client socket(s) on the computer and you’re all set.

Make sure when you implement the socket on the phone that your application specifies the “INTERNET” permission in its manifest. I know, you’re only trying to do a local network connection, but you need that to be able to open sockets.

I’ll try to post some sample code to go together with this explanation soon.

Notes:
- I am using a Windows XP SP 3 box and an HTC Hero phone (running Android 1.5)
- I believe that in Linux there is a simpler way of doing this, but I haven’t tested at all
- You do have to run the adb port forwarding command again after reboot
- Since 2.0 they introduced Bluetooth so you can just do the socket thing over Bluetooth directly without the adb stuff. Then again, not many devices out there running 2.0 right now as far as I know.

Android category

I’ve just added a new category called Android. I’ll be posting here various things related to the Android architecture that I find interesting as I’m digging my way through it. And of course, my usual skeptical criticism.
Stay tuned!

DC’s winter (aka How *I* defeated Global Warming)

I see a lot of people wondering what’s going on with all the snow in the world recently and I especially see a lot of questioning faces around me in DC, where we seem to have had some record snowfall this winter. I would have thought the answer to be obvious, but it seems I need to explain it.

I have defeated global warming. As you surely must have heard by now, global warming is something caused exclusively by humans and as of such, what each and everyone of us does, will help. I should announce that in 2008 I changed all the light bulbs in our apartment with super-duper-energy-saving spiraled ones. It seems like a small thing to do, doesn’t it? But these efforts add up, keep that in mind! The TV told you that, so IT MUST BE TRUE! If you didn’t believe it then, now you can be sure. As anyone can easily observe, after two years, global warming is no longer a problem thanks to my diligent and precise efforts.

I know what you’re thinking now.. what would’ve happened if I hadn’t changed those light bulbs? Would there have been any snow at all in DC this winter? Would GW kids have gotten (at least) three snow days this week? Would Santa Claus ever come again? Fortunately, all of this is history now, thanks to a handful of energy efficient light bulbs, in the right place, at the right time.

Thank you, thank you all.

“This is our last dance. This is ourselves. Under pressure.”