Living the Dream one day at a time...

Binary to Hex to Binary

Binary to Hex to Binary

My sister recently asked me to write a c++ program which would convert binary to hex and vice versa. I have no idea why she needed it, but I took up on it and this is what I came up with. It’s not particularly elegant, but it gets the job done and I think what I find most interesting about this approach is that it doesn’t involve any math other than calculating some simple string manipulation, but the actual conversion between number systems is done completely through “language translation.”

read more

Using Regex to Match Multiples of Four

Using Regex to Match Multiples of Four

This topic came up recently in a discussion on stack overflow so I thought I’d post what I came up with here. Obviously this is not the most practical way to determine multiples of four but, I think this is an interesting question if for no other reason than it presents an interesting challenge academically.

read more

Get Started Running

Get Started Running

A good friend of mine recently asked me for a few tips on how to get started running.  At first I was a little surprised because I was unaware that I had any “street cred” as a runner, but I was also a little flattered so I went ahead and wrote down the first few things that came to mind.  Then I realized that I actually did have something to say about running.  After all, I have been running for about ten years now, so it’s not unlikely that I would have picked up a few pointers along the way.  As I wrote I remembered all the pitfalls I ran into when I first took up running, and I thought to myself, “it sure would have been nice to have had a little guidance when I laced up my first pair of running boots (I’ll explain later)”  So I thought I might as well share some of this knowledge.  I am not a professional athlete and I have had no formal training with anything related to running.  I am just a regular joe who decided pounding out a few miles on the asphalt every other day would be a good way to kill some time.  

First off, running is awesome… you can do it anywhere, it’s free and all you need is your feet.  I’ll tell you how i started.  The first time I got it in my head to run I weighed about 230 lbs and I hadn’t done anything more strenuous than trying to carry in all the groceries in one trip since I quit wrestling five years earlier.  Most people are probably in better shape than that, but I still wouldn’t recommend doing what I did, and just heading out the door to run four miles with nothing but high hopes and broken dreams…

read more