Monday, September 23, 2013

iPhone 5S Fingerprint scanner hacked

Am I surprised? Not really. Fingerprint scanning isn't new technology, and the knowledge of how to get around them has been around for a while. To be honest I'm kind of surprised that it took this long.

The reality is Fingerprint scanners have a few problems.

  1. You only have 10 fingers meaning you only have 10 possible options when choosing a "passkey", unless you decide to use your toes... or nipples. Let's hope you don't have a enterprise security policy that requires you to regularly change your "passkey" without repeats, because you could eventually run out...
  2. You tend to leave you fingerprints all over the place... I mean people sometimes leave their passwords written in weird places, but think of everything you touch during the day with your hands... 
  3. I don't know about you, but my finger prints are all over my screen. IT'S A TOUCH SCREEN. I mean seriously could I make it any easier?
So bottom line this "security feature", was never really about security. It was about the illusion of security. People like the idea of someone not being able to look at their phone, but most people are too lazy to set up a pin to enter after the "Swipe to Unlock". I mean entering a password? I just want to take a picture of my lunch for Instagram!


Saturday, September 21, 2013

The Importance of Keeping a Log


There are times when working out can feel like a really big drag. That you aren't getting anywhere and that you have been doing this FOREVER with no results. The truth his you probably have been making progress, but you might not notice. This phenomenon happens all the time to people with kids (also pets, if you've had them since they were very young). You see your child (or pet) every day, and you don't really notice that they're getting bigger, and then all of a sudden they no longer fit where they used to, and you have the magic epiphany of: OMG he/she is getting so big! In fact this same phenomenon is often times why we don't notice that we are gaining weight until all of sudden that pair of jeans that we've had forever are "suddenly" way to snug! It's because of this phenomena that is absolutely vital that you keep track of your progress (or lack thereof).

By jotting it down, you can actually see that you are indeed making progress, and that changes to your body are actually happening! Sure they may not be as fast as you like, but progress is progress, and that's the goal. It's a motivator, it keeps you from giving up when you feel like this whole thing isn't worth it. It simultaneously gives you data to make other changes to perhaps push yourself through a plateau!

Plateau busting can be one of the most frustrating aspect of Muscle Building or Weight Loss. You get to a point where it just doesn't seem that you are getting anywhere. It can go on for days, weeks, even months! Keeping a log allows you to see things that may be causing your plateau. You can look back to when you stopped making gains or losses and see what perhaps might be causing that. Maybe you stopped doing an exercise. Maybe you started doing a little less or more time on the elliptical. Maybe you started eating a different kind of protein bar as a mid afternoon snack.

Being able to take in this data, and synthesize it into useful information to help you get to your goals is the name of the game! Big companies use this all the time, they call it analytics! But in order to analyze why things may not be working as well as you'd like you need to keep your data somewhere, and you need to keep it in a consistent manner. You don't have to use anything fancy I used a Mead Composition Book for years! You can get a 5 Pack of them here from Amazon for about $9.

So keep a log, take as many measurement as consistently as you feel doing. Using data to drive your goals is the optimum way of achieving them.

Friday, September 20, 2013

Break down your bigger goals


If you want to lose weight one of the best ways to help is to break down your bigger goals into smaller ones. Losing, for example, twenty pounds is a big challenge! After all, in a healthy world you only really want to drop 1 to 3 pounds a week. That means twenty pounds should take about 10 weeks.

10 weeks is a long term goal. It sounds so achievable at the beginning. That 10 weeks seems so far away that you are very likely to "take it easy" because you "have plenty of time!" Four weeks later, when you have been very lax on yourself and if you are lucky you may have dropped a couple of pounds. But now you have 6 weeks to lose 18 pounds! That's on the upper end of healthy and now it's a very hard to achieve goal!

So how should you break this down. Well it depends on you. I've found four week intervals to work the best. Four weeks is just long enough to give myself a little leeway for lapses in my goal, while simultaneously giving me the kick in the pants that I "ONLY" have a few weeks left! In addition it allows you to use another mind trick: the "I can do it for X" mind trick, because after all it's only a month, you can be super strict for a month!

By the time the end of that month rolls around hopefully you will be so well on your way to your big goal that you will just let it keep going! After all you already showed that you can be super strict for a month, and it wasn't so bad! So break up your big goals into incremental smaller ones. Gauge where you are when you get to that smaller one and adjust accordingly. Losing weight and keeping it off is a bunch of incremental changes over time! Going for the big bang is dooming you to failure before you even start.

Breathing new life into Microsoft


If you are to believe the media blitz, Microsoft is on the ropes. They have just started a massive reorganization. Ballmer has agreed to retire, and they've bought Nokia. They seem to be trying to convince Wall Street that it can still be profitable. Personally I'm not really sure why this is in question. Microsoft is a big company with many fingers in many pots. They have a huge developer talent pool, and have produced some amazing things from their Research and Development department.Sure they are taking hits at the moment, especially to their sacred cash cows, but it doesn't mean that they are done.

People seem to forget just how much stuff runs on windows, and just how often some of those things get upgraded. Retailers, Governments and Financial Institutions hate spending money on replacing things that work, but guess what Windows XP is being killed. That means that these big entities who don't want to spend money upgrading, are being forced to. I guarantee that money isn't going to Linux, and it's probably not going into Windows 8, and that means Microsoft will get another chance to get an end of life boost in another couple of years.

In the meantime they are trying to consolidate their platform. Bringing mobile and desktop together. It's the right move, and they should definitely continue on that. Ballmer said he wishes that he'd put more talent into Windows Phone earlier. Well it's never to late! Get to it! Use some of your XBox pull, Apple and Google seem to be making plays at the gaming market, use what you have and try and beat them to the punch!

Microsoft does slowly seem to be adopting some of the strategies of Google and Apple which is a good thing! Buying Nokia had to happen and ultimately is a good idea. Keep in mind Google did the exact same thing with Motorola, and no one called it a desperation play! Understanding the pain points of an OEM I think will help them ultimately create a better product for other OEMs. It may also be time to think about not charging OEMs for Windows Phone OS, at least for this cycle. It would be a way to increase adoption of that OS by cheaper OEMs and get broader adoption. It also may be time to broaden the horizons of your own apps Microsoft.

Getting Office onto other devices NOW is absolutely vital! People know office, they understand it. To some extent the Ribbon is already touch capable. Release and Android version, release an iOS version! How many management folks really do not need a full laptop? Sure you may be cannibalizing some of your own market by no longer selling your OS, but the reality is that market is already being cannibalized by smaller start ups, Apple and Google Docs! They are trying to eat your lunch, and succeeding! I for one already tell my son to use Google Docs! He doesn't need all the fancy stuff that lives in office, but he does need to have access to it anywhere! If it helps your bottom line and time to market, make two versions, a light and a full featured!

As much as I love Open Source software (and Microsoft is a huge contributor to Open Source despite what you may think), something to keep in mind is that Microsoft makes great tools for business. Office is a VERY powerful tool, and Microsoft's developer tools are absolutely amazing. It really does amaze me how little fan fair Visual Studio gets. Hands down it is the best IDE (Integrated Developer Environment) I have EVER worked with, and they do an excellent job at improving it year after year. C# is a great coding language, and .NET a great framework. I love the fact that thanks to Microsoft and Xamarin I can even use it in Linux, iOS and Android.

With all its irons in the fire, Microsoft has the ability to reorganize and be a strong competitor. I'm not sure they will ever reach the position they had in the 90s, but that doesn't mean they can't be in the thick of things, and it definitely doesn't mean they are down and out. Sure they've made some miscalculations, and missed some opportunities, but that's the great thing about the tech industry. Everything moves so fast today's underdog can be tomorrow's juggernaut, and if any industry has a history of recent turn arounds, its this one. Apple is one example and Yahoo seems to at least be on the path back.

Apple, iOS7, the new iPhone 5S and iPhone 5C and Innovation


Apple had been on a media blitz. With iOS7 being release yesterday, and the impending iPhone 5s and 5c onslaught, its been dominating tech news today. It seems they are trying to paint the picture that Jony Ive, Craig Federighi and Tim Cook are the happy awesome replacement for Steve Jobs as the head innovators of Apple. They may be able to pull it off, but I must say that some of the quotes that have been coming out of Apple have left me a little less than sure of this. I think Apple makes some beautiful products, but the reality is I'm not seeing the same swagger that I used to see at Apple during the years of Jobs. I am however seeing a lot of arrogance. Thats not to say that Jobs wasn't arrogant, but at least it seemed like he backed it up with some innovation.

I upgraded my iPad 2 and my sons iPhone to iOS7 last night, and played a little, and I can honestly say: meh. In all honesty, iOS needed a UI update. It's looked pretty much the same since 2007, it was getting dated. Now it looks like... well, I'll put it in the terms of my teenage son: "check it out, now it looks kinda like the [Samsung] Galaxy [S4]!" Ouch.

Now I don't want to take that quote out of context, he was thrilled, but as Apple, when your big UI update has you "catching up" to a phone released months ago, you may want to get to work on wowing us a little more next time. I think Apple can do it, clearly they've put a lot of thought into the underpinnings of the OS with things like moving to 64bit architecture etc, so there is definitely more to the update than just fancy UI elements. Speaking of other elements, how the hell did the lock screen vulnerability get past Apple? I can't imagine that would have ever flown with Jobs at the helm, especially with one of big features release on the iPhone 5s was a new security feature!!!!

Which brings me to the new iPhone. The lines are forming, but they usually do for new iDevices, because after all they are luxury "must have" item. Apple devices always have been sold at a premium. in 20 years I have never looked at an Apple device and thought of it as cheap. Even when the company was struggling in the 90s! That being said, Tim Cook taking shots at Android and the "cheap" market seemed strangely defensive to me. I mean by now you should know that Apple products aren't cheap. I'm still not sure what people expected out of the iPhone 5c. I certainly didn't expect a new $50 iPhone. I expected it to be cheaper than the iPhone 5s but where they priced it is about where I expected it. Realistically it's a way of cutting some of the costs of manufacturing the iPhone 5 to keep the margin on those devices where they were.

The iPhone 5C is simultaneously a way of taking trying to make a play on the used phone market. Right now the iPhone 5 starts at around $400 on eBay. While the iPhone 5c is a little pricier at $549 unlocked, you can guarantee that is new, works, and won't have any issues during activation! Alternatively you can buy it on contract with one of these new upgrade plans that the carriers are offering! That's where the brilliance of this move comes into play!

So I think rumors of Apple's demise might have been largely overplayed. They seem to be playing the media and marketing game better than anyone at the moment. Despite Tim Cook being defensive when it comes to talking about Android, Apple is still making the right moves for them. While I'd love to see some huge technological innovation from Apple, I just think in the mobile market were not going to see the level of innovation we've been used to over the last few years. I would have liked to see something more distinctly Apple in iOS7 rather than doing Android Apple Edition. I do believe that Apple is still Innovating, just maybe not in ways that we expected.

Mind Trick: I can do it for "X"


I REALLY used to dislike cardio. I mean I had a serious disdain for the whole activity, the intense sweat, the shortness of breath, the constant monotony of being on a machine. I tried to take it outside, and run, but I was big, the concrete pavement hurt my knees and I live in the Atlanta Metro area. The Atlanta Metro area has some SERIOUS air quality issues. Running outside at the wrong time made me feel like I had been sucking on a tail pipe. So I stuck to indoor equipment. The thing is most of the time I was ready to give up after about five minutes. That's when I discovered this little gem of a mind trick.

I realized that every time I got on a piece of cardio equipment (usually a treadmill), I'd get to about 3 minutes and 30 seconds and want to get off. My head would be hurting, my knees began to whine, I was out of breath, the sweat started pouring from my brow, and my heart felt like it was going to explode out of my chest. In my head the cursing would begin. I would just tough it out, call myself a wuss. You know the typical macho crap that you see on all those workout posters. When I reached about 7 minutes miraculously my head would be clear, my knees didn't hurt, my heart and breath evened out and the sweat only bothered me a little.

Now usually I'd only last another 7 minutes from that point and then cool down (I was almost 300 pounds at the time...), but I figured out something. If I could get past the initial 5-6 minutes I could do my cardio! I further went down the road of, its only 5 minutes! That's not so much! Anyone can do 5 minutes that's not so bad!

Fast forward 10 years (or so) and I still use this trick today! I've run a half marathon using this trick. In fact I used it this morning! I was 45 minutes and 6 miles in to a run on the treadmill. I didn't want to do anymore. I was tired, and I could already taste my after workout refuel. But I said to myself, come on Alex, just do five more minutes. It's five minutes, that's not too much longer! I ended up doing that a few more times pushing myself to 9.5 miles over and hour and ten minutes! Maybe that's not super quick, but believe me its one of my better times!

The best part about the trick is that it doesn't just work for exercise it works for your diet too! I did a juice fast a year or so ago. I used the same trick with the mindset of "It's only a week. I can do this for a week! It's not that long!", and you know what? It wasn't! I ended up doing it for two! So if you're dragging don't feel like exercising or sticking to your diet, just break it down to a tiny time frame. It will make it seem much more reachable and much less harsh.

Thursday, September 19, 2013

Gym Etiquette 101 or How not to be an Ass at the gym

I know when you pay for a service you feel entitled to certain benefits, but here are a few things at the gym that I have PERSONALLY witnessed that I feel are just unacceptable behaviors. Bottom line is, everyone's time is valuable, and we are all trying to keep up our intensity. So let's be mindful of our fellow gym members.

Rack Your Weights



You would think this one would be self evident, but apparently some people feel that they work *SO* hard that picking up their weights after they're done is just too much. Or maybe they feel that the gym staff is there to pick up after them, like Mommy used to. Look if you don't want to pick up after yourself, please get a home gym. This is an area for all of us. We're all busy and we all get tired at the end of our sets if we're doing it right. Cleaning up after yourself is just common fucking courtesy.

Wipe Down Sweaty Equipment

Do I really need to explain this one? I mean look I get tired after running for 10 miles too, and I sweat profusely! But you know who doesn't like to be covered in your sweat? Anyone else! So please take a moment and wipe up after yourself...

It's a Workout Buddy, not Workout Buddies


I guess I could understand three people doing a workout together, but anymore than that and split it the fuck up! I've seen 4 guys standing around a bench watching a fifth guy do a set. It just looks weird, creates a crowding around other (unused) equipment and quite frankly totally decreases the intensity you could otherwise create in your workout.

The Gym is not a Social Club


If your tongue is getting more of a workout than any other muscle, you are doing it wrong. It's perfectly fine to have gym friends or a workout partner, but the reality is that when you are on the gym floor you should be there to work! Not to be seen, heard or gossip... You can always chat AFTER your workout. Preferably off the floor in the locker room, in the lobby or outside.

Wear Proper Attire

I'm not going to dignify this one with an image. You know what I'm talking about. Certain clothing just gets in the way, and certain clothing is literally worn just to scream "LOOK AT ME!" You should be there to work not make a fashion statement or "get noticed".


Personal Hygiene

You are going to the gym. You are going to work hard. You are going to stink afterwards. But you know what lets try to minimize the offense to all of our olfactory senses and not go into the gym smelling like we just got out of a manure field. I'm not saying to take a shower before you go, but clean clothes and a couple of wet wipes go a long way.





The Economics of College

I have a teenager who is finishing up high school this year. Needless to say I have been paying VERY close attention to the costs and news associated with enrollment at college. So when I read/hear statistics like: between 1982 and 2007 the average income for families in the United States rose 147% while college costs grew 440%, my ass puckers a little bit!

Do you realize that basically that means that the average cost of a four year degree from a state run school is nearly $14500 a year, and that's not going to include books, food, housing, computer, supplies and anything else that a college student is probably going to need! The worst part is that this is the bargain price!

What the hell is it that has made college prices skyrocket so much! Bare with me I have a theory, let me lay out some information and then I'll tie it together:


  • The US Government backs all college loans, meaning anyone can get one, regardless of credit history. Making college achievable is a great good, and I don't totally argue with the US Government doing it.
  • You can't get rid of a college loan... ever. Bankruptcy will not allow you to rid yourself of this debt burden.
  • You are constantly pitched the benefits of a college degree. The higher earnings potential, and stable job.
  • 4 Year colleges in 1982: 1957. 4 year colleges in 2009: 2774
  • Number of college students 1982: ~ 6 Million. Number of students 2013: ~21 million
So we have a ~40% more colleges, and ~250% more enrolled students between 1982 and 2013. Well from that statistic it certainly seems that demand may be outpacing supply, except I seriously doubt that any institution that was around in 1982 hasn't been growing. I mean Harvard has increased their undergraduate enrollment from 6000 students in 2000 to 7200 in 2013 or a 20% increase over the last 13 years, and that's one of the most prestigious schools in the country. I can only imagine that less prestigious schools with much smaller price tags and endowments have increased their enrollment sizes much more than that.

More importantly it seems that any student who wants to go to college seems to find a college to get into, thereby removing the argument that this whole cost increase is driven by supply and demand of students. But interestingly it does seem that there is a huge Supply of guaranteed money for colleges, and more importantly BANKS THAT SUPPLY LOANS!

We all know that when you get a loan for something the seller immediately gets the full amount of money they are asking for, and the buyer agrees to pay back the banker over time (with interest) in exchange for the lump sum. Financial Institutions are risk averse, they tend to want their money back. So they will only lend money if they feel they can reasonably get it back. The bigger the amount they lend the bigger the risk usually. This is why Jumbo Mortgage Loans (Loans over $500000) usually have a higher interest rate. They aren't guaranteed like smaller loans, and therefore lenders tend to err on the side of caution.

Well when you create a system that has NO UPPER LIMIT on the backing, and CAN NEVER BE DISCHARGED where's the risk for the lender? If there is no risk for the lender then why wouldn't they lend more money. That means that there is now a huge supply of money available to potential "customers of colleges" which means these colleges can charge more, because the market will bare it! 

It's not that education has gotten better, or that the facilities have improved that much its simply that the pockets have gotten deeper. I can't blame private colleges for trying to grab as much as possible, but it does seem to be an endless cycle. Couple that with the fact that Public colleges are receiving less government resources that would at least put some downward pressure on college prices, and we are just going to continue on this ever upward trajectory. At least, until it bursts. And it will burst. Prices for a good can only go up so much before it comes crashing down due to a backlash or something displacing it. I know its too late to hope for prices going down for me with my teen, but I certainly hope this fixes itself before my toddler is ready for college. I can only imagine what the cost will be for him if they don't.

Fantasy Football: Taking it a bit to far

I'm a huge Professional American Football Fan (NFL). In fact, I think its the only sport that I will actively carve out time to watch in a week (and even then it's usually after the game is over so I can fast forward through the commercials). I've seen the rise of Fantasy Football, and I've seen and heard the pools around the office, but it always seemed a little odd to me. I mean in theory you could be rooting for both your team and the other team at the same time... But then again, who am I to judge, I played Dungeons and Dragons, and probably still would if I had the time. Lately though I've noticed an odd phenomenon. It seems that people are taking to Social Media and quite frankly being total douche wads to some of these professional athletes.

The hate and vitriol thrown at these athletes is unreal. These are men who, as a general rule bust their asses day in and day out. Their training regimens would make most of the rest of us want to curl up into a little ball and die (though being the masochist I am, I would love the chance to try to keep up for a week :-)). Some of the hits and blows that they take would cause most of us to break down and cry for our mommies. And they do all this in the name of entertainment.

That's right, they play a game for us to spectate and enjoy. They spend their week rehabbing and training, and working until they puke. All so they put their lives and their health on the line for three hours a week. Yet some people have the audacity to question these men's manhood and their toughness? Really?

I understand that they are getting paid more money in a year than most people will see in their lifetimes. I get that some people think that justifies the hatred when these players say they are injured. But in game where their livelihood, and in some cases the only job they have ever worked or known, is always at risk on the next play, couldn't that pay be justified?

These men have spent years dedicated to mastering their craft, they are the pinnacle of Football perfection. Demeaning them because your Fantasy Football team is suffering is just pitiful. If you are losing money because you decided to bet on Fantasy Football, that's your fault, not theirs. As the old saying goes, don't gamble what you can't afford to lose.

Wednesday, September 18, 2013

Use Little Tricks to Push You

I use an app on my phone called Fitocracy (Fitocracy on iTunes / Fitocracy on Android ) to keep track of my workouts. It's not the best tool for this function but it does have on interesting feature that I love. They use the concept of points to rank your workout. After you achieve a certain number of points you "level up".

If you have ever played a video games with levels then you know just how addictive it can be to "level up". I played EverQuest (You know, before World of Warcraft even existed!) for years, and the time trap you would find yourself in was just trying to get to the next level, or to get the next piece of gear.

So why does this help with your workout? Let me give you an example. I was exhausted this morning. The day hadn't started right, I didn't have headphones, and it took me longer to get to the gym than expected. I plowed through a pretty decent workout, but I was going to skip my after weights run. So i entered what I'd done into Fitocracy, and lo and behold I'm 94 points short of a level.

I looked at it for a second and said well fuck, I guess I'll get that tomorrow. I walked ten feet, and said to myself damn it! Its 94 points! I can get that with one more hard set of exercise. So I turned my ass around and worked a little bit more. It was a little trick, but it caused me to push myself just a little further and get me closer to my goal just when I needed the inspiration the most. If I'd worked myself hard enough I would have been satisfied, but I hadn't, so I wasn't and that little 94 point reminder gave me the push I needed today.

Standing up to Patent Trolls


With all that goes on around the world today it really is easy to forget about the vulture's known as Patent Trolls. It's amazing that since the advent of being able to patent a process these "businesses" have come in and raped and pillaged across the board. They really are nothing but fucking vultures extorting companies with vague process patents claiming ownership of an idea that most of the time wasn't even theirs to begin with! They just bought the patent with the intent of clobbering companies for money.

The whole point of the patent system originally was to protect the little inventor from businesses stealing their idea and the little inventor getting nothing, but now patents are being used as a knife to draw blood from anything that it can! The reality is patents are no longer protecting innovation they are stifling it!

That's why I felt I had to give special recognition to companies like NewEgg, FindTheBest (Who is actually filing a civil RICO [Racketeer Influenced and Corrupt Organization] suit against them), RackSpace to name a few! Please keep up the good work!

Being Vegan in a Hostile Environment

For those of you outside the United States you have to understand that when I talk about the South I mean Florida, Georgia, The Carolinas, Tennessee, Alabama, Mississippi, Kentucky, Virginia and West Virginia . I grew up in the South. At age 11 I decided to become a vegetarian. My parents were supportive, although I'm sure they thought it was just a phase and it was probably a pain in the ass for them to figure out meals.  

The interesting thing about growing up in the South is that there is literally meat products in EVERYTHING. I mean traditional southern cooking involves vegetables being cooked in pork fat! So as you can imagine being a vegetarian posed some problems. There have been times when I have been unable to eat at a restaurant because even though they had vegetables on the menu, they weren't vegetarian vegetables.

The fact that I even had to write the phrase "vegetarian vegetables" kind of epitomizes the idea of a hostile environment to a vegan diet. When you have to question the green beans at a restaurant, you really do have to wonder how the hell you can keep a animal product free diet.

There are two ways to go about handling this. One is to question everything, and I mean literally everything. You will be a royal pain in the ass, but you also will only have to ask the questions once. If you don't want to ask at a restaurant then call ahead and ask. We live in a wonderful age where we have the Internet in the palm of our hands. Usually you can look up a menu and a phone number within a few minutes, and take care of your dietary needs even before you walk through the door. It's a lot easier than what I had to do growing up, and you can feel safe in knowing that you actually talked to someone who knows, versus the waiter, who depending on their mood may lie to your face (I've had that happen).

The second way to handle it is to just not go out to eat. Pack your food and bring it with you. I'm pretty sure I could live for two days with the food I have at my desk at work, and not necessarily in a totally unhealthy way! I have a fruit bowl, soups, protein powders, soy milk, raw vegan meal replacement bars, and cereal. My work bag always has a vegan meal replacement bar in it, as does my workout bag.

Bottom line, like everything about living a healthy lifestyle, you have to plan ahead a little bit. Know what you are getting into, where you are going, and think of your needs. Don't be afraid to be a pain in the ass, and don't be afraid to say no. It's your life and your health, choose what's important to you!

Unlocked Devices, The FCC, and the new Carrier Upgrade Plans

According to a Washington Post report, the White House has asked the FCC to change the rules on unlocked devices. Currently the way the system works is if you buy a phone from AT+T, Verizon, Sprint, or T-Mobile, the phone is "locked" to their network. Even after you are done with your two year contract (or if you pay for the phone outright at the beginning), you have to ASK AT+T, Verizon, Sprint or T-Mobile to unlock your phone. And if you fail to do so? Up to five years of jail time.

Wait. What?!? I have to ask a fucking company who has absolutely no reason to let me "free" the device that I paid for, or I go to jail? What kind of crazy system is this?!? Why even bother paying for a phone to begin with? If I can't unlock it why even bother "owning" a device since quite frankly at the moment I don't really even "own" it!!!

Which brings me to all these early upgrade plans, AT+T's Next, T-Mobile's Jump, Sprint's upcoming One Up program. Really these are glorified rental programs. You agree to pay monthly for your phone, and at the end of six months to a year, you can "upgrade" your phone to the newest model. This isn't necessarily going to get you out of the problem of switching carriers, as you would still have to pay an early termination fee, but at least you aren't locked to a device.

Over time you end up paying more and you don't own anything at the end of the day, but as long as it is illegal to "unlock" your own devices, and paying out right for an "unlocked" device to begin with is out of your price range, renting your device through these programs may be worth it.

Finding Motivation


I wake up at 5:30 AM every weekday morning to get my ass to the gym. I REALLY DO NOT LIKE GETTING UP IN THE MORNING. This is usually compounded by the fact that I have a toddler who I'm convinced could keep himself awake for a week straight if we didn't force him to lay down in a dark room, and by my teenager (I mean he's a teen... need I say more?). It really isn't uncommon for me to finally hit the bed at 11:00 PM, and sometimes even later.

So every morning when that fucking alarm clock goes off (and I do hate that fucking alarm clock), I immediately start dealing with my brain saying "what the fuck?" That's right, the first thing in the morning I have to deal with is my inner monologue coaxing me back to sweet slumber. And the first thing I have to do is to tell that inner voice to go to hell. You know what? It's really fucking hard. Every. Single. Day.

I wish I could say I always come out victorious in that battle, but the reality is I lose sometimes. That's OK, as long as I don't let it happen to often. The thing is, in order to truly beat that inner voice, the one that tells you that you can't do something, you have to find some reason to latch on to that says you can. I know, it sounds completely cliche, but its the truth.

Steve Jobs said (and I'm paraphrasing, but I included the video below) that in order to achieve amazing things as an entrepreneur you have to have passion. Passion for what you do, passion for what you are trying to create. The reason you need that passion is that being an entrepreneur is hard! You have to be a little crazy to be successful, because otherwise you would just give up!

The reality is that finding your motivation to be healthy, and make lifestyle changes is a personal thing. You have to make the time to find it for you. You have to believe it, totally and entirely, because in reality that's the thing that will get you to achieve your goals. That's the thing that drives you to get out of bed at 5:30 AM and hit the gym. That's what makes you say no to the birthday cake being passed around the office. Willpower alone just isn't going to cut it.

[I decided to embed the Steve Jobs YouTube Video]

Tuesday, September 17, 2013

Using ReportViewer in ASP.NET MVC

About three and a half years ago I was tasked with building a reporting portal. I elected to go with ASP.NET MVC due to the fact that most of the rest of my department was a Ruby shop. I figured if anyone else would have to come in and work on it, at least they wouldn't have to struggle with the idea of ASP.NET WebForms.

Now one challenge was that this was a publicly facing site, but the reports could only be seen by authenticated users with the right permissions. The main challenge however is the fact that ReportViewer requires that a page be able to store Session State. By definition MVC is Stateless.

So how do we solve this problem? Luckily the folks at Microsoft allowed us to have WebForms and MVC applications side by side. So the simplest solution is to just include a new webform page as part of the Solution.

The first thing we need to do is get our criteria. I'm assuming that you want to pass in some parameters to the ReportViewer, so lets grab those from our Form Collection and build our Action.

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult BuildReport(FormCollection collection)
{
       try
      {
            // Load Form Data into a report object
            DynamicReport report = new DynamicReport( collection["AccountName"], Convert.ToDateTime(collection["StartDate"]), Convert.ToDateTime(collection["EndDate"]));
           // Save Report to Session
           Session["Report"] = report;
           //Redirect to Reports WebForm Page
            Response.Redirect("../Report.aspx");
        }
        catch (Exception e)
        {
                  return RedirectToAction("Error", new { id = (int)ErrorCode.Unknown });
        }
}

Its just that easy. Can't believe this has been sitting in draft status for that long....
          

The Unhealthy Vegan

I've heard many people say being a vegan is unhealthy. As a general rule I find this to be an odd phenomenon. Generally when you dig into this person's statement about veganism being unhealthy, it usually ends up being due to one of two things. Either they have are completely misinformed about nutrition and veganism in general, or they have a friend/family member/acquaintance who is a vegan and is unhealthy. They then proceed to base their entire outlook of this lifestyle on this unhealthy individual.

There are some seriously unhealthy vegans out there. Being a vegan does not directly equate to being healthy, just as being an omnivore does not equate to being healthy. The human diet is far more complicated than that. If you are going to "go vegan" for health reasons, just cutting out the animal products is not going to make it so!

Look, I've met the unhealthy vegans too. The ones who live on white refined bread, candy, white rice, semolina pasta, french fries and processed soy products. Refuse to eat any kind of vegetables because they don't like the taste. You know what? If you added meat to that diet it would still be unhealthy!

The bottom line is this, just being a vegan does not make one healthy. It helps as usually it does force you to eat more vegetables. However if you do not cut down on processed foods and continue to eat like crap then not eating animal products is not going to help. So next time you meet someone who has a friend/acquaintance/coworker/family member who is a vegan and is unhealthy, ask a little bit more about their dietary habits. Perhaps you can educate them a little more about the importance of a balanced diet, even as a vegan.

Monday, September 16, 2013

Raising Vegetarian Children

Raising kids is hard. I'm a father, I know what I'm talking about. Anyone who tells you differently is definitely looking at it through rose colored glasses, and I applaud them for it. Interestingly. an issue that has popped has come around me a few times is parents who's children have decided to become vegetarian.

I must say that I am lucky in that both my partner and I are vegetarian, and so the choice to raise our children that way wasn't even a discussion. However some of these parents are at their wits end trying to figure out what to feed their children. They are concerned about their child's nutritional needs being met. Most often the question we get asked is what do you eat? For the most part the answer is: the same thing you do, minus the animal products.

Vegetarianism seems to be so misunderstood in general. The truth is eating a plant based diet is quite healthy, provided you eat a variety of NON-PROCESSED foods. Now what do I mean by non-processed? Well if it came out of a box, bag, bucket or drive thru window, its processed. Your best bet is to stick with the fruits and vegetable aisle with some grains thrown in there. To be fair this is pretty good advice for anyone, not just vegetarians.

Sure its going to be a pain in the ass to figure out what the hell you are going to feed your newly proclaimed non-omnivore, but the reality is they are actually challenging you to think further about YOUR nutritional choices. You may end up trading out eating at Taco Bell for eating at Chipotle or Moe's Southwest Grill for fast food. You may even find yourself cooking more at home! None of these are bad things! We may be our children's first teachers, but if you let them, it's amazing what they will teach you along the way.

No Sugar Added Gluten Free Protein Vegan Waffles

1/2 cup of gluten-free flour (I use Bob's Red Mill - Gluten Free "Sweet" White Sorghum Flouror Bob's Red Mill Organic Buckwheat Flour)
1/2 cup of Vanilla Pea Protein Powder (I use Pure Vegan Pea Protein Dietary Supplement - Vanilla )
1/2 teaspoon gluten-free Baking Powder
1/2 teaspoon Baking Soda
1/2 teaspoon of salt
1 cup of Milk Alternative (I prefer soy, but this works with Almond and Coconut as well)
1 Tablespoon of Apple Cider Vinegar ( I like Bragg's Apple Cidar Vinegar)
1/4 cup of Ground Flax Seed
1/4 cup of Bakeable Blend Stevia Sweetener
2 Tablespoons of Coconut Oil

Sift all dry ingredients into a mixing bowl. Place milk into a separate bowl and add apple cider vinegar. Whisk the wet ingredients and leave for a minute. This makes a non dairy buttermilk. Proceed mix all the wet ingredients into the milk mixture, and then add that to the dry ingredients.

Follow the ingredients for your electric waffle maker. I personally have the Oster Belgian Waffle Maker.

Gluten Free Vegan Protein Pancakes

1/2 cup of gluten-free flour (I use Bob's Red Mill - Gluten Free "Sweet" White Sorghum Flouror Bob's Red Mill Organic Buckwheat Flour)
1/2 cup of Vanilla Pea Protein Powder (I use Pure Vegan Pea Protein Dietary Supplement - Vanilla )
1/2 teaspoon gluten-free Baking Powder
1/2 teaspoon Baking Soda
1/2 teaspoon of salt
1 cup of Milk Alternative (I prefer soy, but this works with Almond and Coconut as well)
1 Tablespoon of Apple Cider Vinegar ( I like Bragg's Apple Cidar Vinegar)
1/4 cup of Ground Flax Seed
2 Tablespoons of Agave ( I like Agave In The Raw )
2 teaspoons of Coconut Oil

Sift all dry ingredients into a mixing bowl. Place milk into a separate bowl and add apple cider vinegar. Whisk the wet ingredients and leave for a minute. This makes a non dairy buttermilk. Proceed mix all the wet ingredients into the milk mixture, and then add that to the dry ingredients. Mix until non lumpy. Heat a lightly oiled griddle or frying pan over medium high heat. Pour or scoop the batter onto the griddle, using approximately 1/4 cup for each pancake. Brown on both sides and serve hot.

Losing Weight

When I first tell people that I used to be 320 lbs (145.5 kg), the usual reaction is: No way. You couldn't have been that big, you're so small! At 5 foot 8 inches (1.72 meters) I don't really like being called small, call it a Napoleon complex or something, but in general I understand what these people are saying. They have a hard time imagining a person my height weighing that much, and who now weighs quite literally half of that. Usually the next question is: How did you do it?

How did You Do It?

Wow is that a question I sometimes dread. Not because I mind answering it, I'm an open and honest guy. I'll happily tell you what I think about most any subject and I'm not afraid of offending someone. The reason I dread the question is because sometimes it's from someone who wants to use my secret themselves, or who wants to pass it on to the friend/family/coworker. The problem is that there is no secret. They already know the answer, they just may not know how to implement it.

The truth is I busted my ass and changed my entire lifestyle.

I'm not trying to come off like a pompous ass, or to discourage anyone, but in total honesty that's what it took! Try telling that to someone who is looking for help, who wants something, anything to help them change their bodies. Sometimes its fucking heartbreaking. In all honesty that's one of the reasons I started writing this blog. I want to help!

It All Happens Over Time

Now I don't know about you, but I didn't gain weight overnight. I mean it's not like I was sitting there with six pack abs as a teenager, went to college and fucking ballooned up to 320 lbs on pizza and beer as a freshman (though admittedly, the college lifestyle didn't help my situation). It was a gradual process compounding year over year over year. 

So if it takes that long to do the damage to yourself, and to create the body that you don't like, then quite frankly you can't expect any pill or magical formula to take it off that fast. It's a process, it takes time. You know why most diets fail? Unrealistic goals. If you expect to lose 5 lbs (2.2 kgs) a week for the next four weeks, then let me tell you right now you will be sorely disappointed. If anyone promises you these kinds of results (short of life-endangering stomach stapling surgery), just walk the fuck away. Losing weight is easy at its core: Burn more calories than you take in.

So Where Do I Start?

Well what got you here in the first place? What's your motivator? I know what mine was, I remember the exact story when I hit rock bottom, and I know that fueled my initial drive to make changes. If you can't find something to drive you, then you are going to fail. You need that motivator, that story, that memory to keep you going when the going gets tough, because it is going to get tough! It also can not be superficial. If you are doing it for some guy, some girl, because of some ephemeral "Life will be better if..." this is not going to work. Period. End of Story. Find your motivator, stick it on your phone, your mirror, make it your drive.

I've Got My Motivator Now What?

Well I'll give you a hint, your current diet and exercise routine aren't working. So how about we start there! Now remember this is a marathon not a sprint. Don't try to make a bunch of changes at once, because guess what? You will fail. When I first started I began by only starting on the exercise routine. Here's the thing though, I sat on my ass all day. Not totally my fault, I'm a Software Developer, and before that a college student who majored in Computer Science, loved video games, and delivered Pizza to make money. All of those things kind of largely involve being really good at sitting on one's ass for an extended period of time. I am quite exceptional at sitting on my ass, I've had a lot of practice, and I get paid to do it.

So first thing I did was to get off my ass. I joined a gym. I signed a fucking year long contract, and got a years worth or personal training. I didn't have to do it, and quite frankly when I started I didn't even have the money to do it. I went in to debt to do it! That's how powerful my motivator was for me. I was an entrepreneur and I was investing in me, and I was going to give it all I had.

The thing is though, I didn't expect miracles. I'm honestly not really sure what I expected at all. I hated the gym. I loathed cardio, and I had no clue what I was doing. None. I mean I didn't know anything about being physically fit, it had never been a concern before! So in the beginning I used a trick I had picked up when I first hated my job delivering pizza. I used mind tricks. 

Mind Tricks and the Importance of Exercise AND Nutrition

I used to hate going to deliver pizza. I mean it was boring, monotonous, and in the Florida sun, hot, sweaty and generally unpleasant. Top that off with living in a "rough" area, and you can imagine that it was neither lucrative or enjoyable. Calling it a job was not helping, so I began to refer to it as "my hobby". It kind of became a joke between my roommate and myself. But god damn if it didn't work. I started looking at it differently and it became bearable. 

I used that same trick in the gym. I hated going there in the beginning, but I played various mind games with myself and made it into a place I love to go. To this day I love the gym. I love hearing the clanking of iron. I love running on a treadmill for hours (Yes I have run on the treadmill for hours!). If I don't go to the gym for any length of time now, I actually get a really strong longing to go back! That's how powerful this trick is. I could fill posts with various mind tricks (and I probably will, in the future), but needless to say I had to find the tricks that worked for me, and everyone is different.

Convincing myself to go to the gym became easier and easier. It became a joy every day. My Personal Trainer at the time helped me through some of the initial learning curve, and to keep my on track in the beginning, but I soon came in regardless of if I had an appointment or not. I pushed myself, but not too much, after all I didn't want to hurt myself and then not be able to go back that week! 

From there I learned about what worked for my body. What I responded to and I saw weight drop off quickly. Probably because I was no longer JUST sitting on my ass. It was huge ego boost, and then I plateaued. 

That was frustrating. The weight was coming off but not as fast for a while, and then it just stopped coming off. I worked harder, but nothing happened. It was about that time I realized that I had been leaving out the other part of the equation. I was burning a shit ton more calories in the gym, but I was eating like a complete moron.

Ever try to lose weight while drinking two liters of soda a day and eating whatever sweet thing was in front of you at the time? I did. It didn't work out so well. So I made changes. Little ones. Substitute a salad for a meal here, switch out coffee for soda. Making sure that I ate vegetables, the Green Leafy ones! 

You can guess what happened, then weight began to slide off. Each little change made changes to the plateau until all I could think about was how to keep this awesomeness going! I read as much information as I could. I know more about Atkins, South Beach, Weight Watchers, Paleo, and god knows how many other diets than I should probably know. It's been a fantastic journey.

It took me a Year and Half

That's right a full 18 months. That means I lost a little under 9 lbs a month, or a little over 2 lbs a week. It was not a short path, but the reality is I have kept that weight off for the better part of a decade. I'll be honest, I'm a little up from lightest, but I still weigh less than when I did in high school. I've also had kids since then, and you try and keep up a daily exercise routine, and perfect eating habits with kids, it isn't easy. And that's just it, there is no easy way. It wasn't easy putting it on, you just didn't notice. Trust me if I actively tried to put on 160 lbs, I'm pretty sure it would take me more than a year, and I'd plateau a few times in the process, and I'm a professional Ass Sitter! So next time you feel like you can't do it, and that it's too hard, just remember it's all in your head. It's as hard as you make it to be. And if you need some help or motivation send me a message and I'll try to help as best I can.




Raw Tortilla Chips

This recipe was a Hail Mary to try and make something for my very picky toddler. We've tried to keep him as close to a raw food diet as possible. Sometimes he just would not eat what we made him.

Luckily we made him this and he loves them! He will easy a whole tray if we let him :-)

I've even made since variations on this recipe since then to include different vegetables.

2 cups of Sweet Corn
3/4 cups of Ground Flax Seed
2 cups of water
1/4 Teaspoon of salt
(optional) a little lime juice

Put all of the above ingredients into a blender (I use a Vitamix, conceivably this recipe could kill another blender, due to how much the flax seed thickens the mix during the blending process). Poor onto a few dehydrator trays and spread it around to thin it down to a couple of milimeters thick. Dehydrate at 115 for 10 - 12 hours.

Enjoy with Raw Salsa!

Using Protein Powders in Recipes

If you are like me, you like to give in to temptation sometimes and eat something delightfully decadent, and yet not good for you waist line. You may also have children (like me) who are vegetarian and yet you do not feel they are getting sufficient protein. I submit the following solution! Substitute some protein powder for flour in some of your baking recipes!

I know this sounds too good to be true, but I promise you it works amazingly. Doing this I have actually made some pretty tasty waffles, pancakes, donut holes, cakes, cookies, breads, and muffins! My current personal preference is to use Pea or Rice Protein. It's quite easy to do, just substitute part of the flour that you are going to put in the recipe with an equal part of one of the above proteins. If you are making something sweet I recommend the Vanilla flavor. If it's something savory I recommend the unflavored. That's all there is to it!

Now you can go out and make some delicious treats for yourself (maybe your kids too. If they're good :-) ) and feel somewhat good about it knowing that you are adding some protein to the recipe, you know, for health! Heck you can even enjoy a protein cookie after a hard workout!

I posted my Pancake and Waffle recipes!

Software Development and Quality Engineering

I can't tell you how many times I have heard developers and managers pay lip service to quality and testing. I cringe every time I hear the words "quality is important to us, but we need this done ASAP!" from management. I likewise cringe every time I hear a developer say "I did a quick test on it, QA will catch anything I missed". Both of the previous statements are just wrong. More importantly they are idiotic and a total fucking cop out. If code quality is of any importance whatsoever, it is absolutely VITAL that you think about the quality of the final product before you even start coding.

There are two huge hurdles that most organizations must overcome if they want to produce a quality product. These two hurdles are going to sound so idiotically simple, that you may stop reading, but please bare with me, as I explain. One hurdle is time, the second is terminology. I know those sound kind of silly but hear me out.

Time

We all know that there are deadlines that must be met. Sometimes we absolutely positively MUST get a deliverable out the door. The thing is, this does not happen in a vacuum. Working more hours, eating into testing time, sacrificing writing unit tests, throwing in hacks that will be "fixed later" all ends up sacrificing code quality. 

I'm sure as developers we've all at least heard of the mythical man month. The idea that throwing more developers at a project actually makes the project last longer. Yet this same phenomenon seems to be completely ignored when it comes time to complete Quality or User Testing! You cannot compress testing time and throw more testers at a problem and expect a quality result! It doesn't work that way! Have you ever seen a large group of testers testing functionality? It's a logistical fucking nightmare to begin with. Duplicate bugs are regularly reported leading to multiple developers trying to fix the same code from multiple different spots, which either leads to wasted time and duplicate effort and frustrations by both developers and testers!

Yet it seems in many places when a testers say we need two weeks to test some critical part of the system, it's viewed as a nice to have. This is simply not the case! Good testers understand that what they are doing is making sure that user doesn't have a "what the fuck" moment. Ultimately I hope you realize what a user with too many "what the fuck" moments can also be a called an "ex-user".

Terminology

This brings me to my next point which is terminology. I purposely used the word "tester" in my previous section, but you know what, that's the wrong word. In Software Engineering we are so fortunate to have a vocabulary that allows us to express abstract concepts to quickly convey meaning. Language, Object Oriented, Classes, Methods, Interfaces, Factories, Constructors, Compiler, Scripts all great words, and for the most part universal for developers. These words are important in their own ways, and yet it seems for some reason when it comes to code quality and testing we don't have quite the same vocabulary.

I absolutely abhor the word "Tester" to describe what these individuals do. Oh sure, they run tests, but that just makes it sound like something a monkey could do, and quite frankly that's just very, very wrong. Likewise I dislike the term Quality Assurance as that term seems to express the idea that quality is something that should be bolted on to the end of a project. Which in turn leads to the perception that you are "testing" the deliverable. This too is wrong.

Quality should be the focus throughout the process. Quality of the code written. Quality of the design and architecture. Quality of the final deliverable. This is not an process that can happen at the end, but a process that should happen THROUGHOUT the cycle! So since this is something that should happen throughout the process, the job description and name should change. I personally like the term that my friend and boss Pat Richards uses: Quality Engineering. After all that is what this process is aiming to do! 

Most importantly though, by changing the name to Quality Engineering you change what it is you are actually trying to accomplish. You are engineering quality right into the process. It makes much more sense to have someone who is called a Quality Engineer being a part of the initial design and estimation sessions, and that is a huge part of why Terminology is so important! 

Changing what you call something can totally revamp the way you look at its function. Equally important is making sure that everyone uses the SAME terminology. I have had a developer say to me "I am in the process of unit testing my code." That to me meant they were writing automated unit tests, since that's the terminology I use. What they meant was that they were doing developer testing on the module they had just wrote. They weren't wrong with how they phrased it, but because we weren't on the same page with terminology, I made some very wrong assumptions on the code base.

The same problems can arise on the transition from Development to Testing cycles. This too is why it is so important that Quality Engineers be involved in the whole process from beginning to end. By being embedded with the team that is developing a module, they come to use the same common terminology as the team, thereby decreasing communication problems and increasing understanding and thereby productivity. After all not having to circle back to make sure you think you understand whats going on is a huge time saver. 

 So bottom line is if you want to make sure you are delivering quality products, you have to be sure that you have a process in place that supports it. Robbing Peter to pay Paul by giving developers more time to write code and sacrificing final testing time is a quick way to failure. Likewise treating testing like it is something that CAN be sliced and sacrificed is a quick way to doom you deliverable to failure (or at least poor results). Never underestimate the importance of your choice in wording, and naming. Names have power that create preconceived notions in others. If you want to ensure quality, make sure the terminology that you use empowers that agenda. In addition make sure everyone is on the same page and speaking the same language. Anything short of that is a quick road to a bad result.

Saturday, September 14, 2013

And so it begins...

A few years ago I started to get a little annoyed at the whole retail push at Christmas, and proceeded to go on a little rant about what I at the time dubbed "Capitalismas". I complained about the rampant commercialization of the holidays and that the original idea behind the holiday had become so totally polluted by retailers that we were beginning to forget what it was we were celebrating. Instead we are just being told that we need to buy "stuff" because the holiday demands it!

Well needless to say over the last couple of years I have bought my share of stuff at the holidays, and grumbled under my breath at the whole thing. My little one is a toddler, and he's beginning to understand the concept of "special" days, and so his Mom and I try to make things fun. We did the dressing him up thing, and it was cute, I loved getting pictures of him.

But last night as I was watching TV, something which does not happen often, on comes a commercial from Party City for Halloween... It's not even the middle of fucking September yet, and it just dropped on my head like a bird dropping a turd. The season of Capitalismas has begun again... Enjoy the next four months of fevered retail marketing onslaught everyone!

Friday, September 13, 2013

Where do you get your protein?

A question that I get asked a lot when I tell people that I am vegan, is where do you get your protein? The truth is it really isn't that hard. Generally I don't eat crap food, and the crap food I do eat is usually some kind of protein bar.

So first of all lets focus on what it is that we do need. According to this study by the Institute of Medicine of the National Academics, a grown adult only needs about .4 grams of protein per pound of body weight to basically keep breaking down muscle mass. So lets add .1 for good measure for the following calculation. As a 160 lb man, I would need 80 grams of protein per day!

So then how do we get to the magic number of 80 grams a day. Well for me, I always like to start my day with a protein shake. It was something I started when I began to focus on the nutrition aspect of weight loss, and I've just kind of kept up with it. I vary which one I use on a regular basis, but I usually rotate through the Vega One Nutritional Shake-Berry, Vega Sport Performance Protein Vanilla, Vega One Nutritional Shake-French Vanilla, Garden of Life Raw Organic Meal - Vanilla, Sunwarrior Warrior Blend Powder - Vanilla, and some other Hemp, Pea, and Rice proteins that I come across. So that's usually good for about 20 grams of protein in the morning. Hey look at that I'm already a quarter of the way to my daily protein intake and I haven't even chewed yet!

Now where do I get my protein when chewing? Well this part is easy. I eat food, mostly plants. That means I don't eat that prepackaged frozen food. and I really don't eat much pasta or bread! So lets look at some nutritional facts.

1 cup of spinach has a 1 gram of protein.
1 cup of kale has 3 grams of protein.
1 cup of chopped broccoli has 2.6 grams of protein
1 cup of chopped carrots has 1.5 grams of protein
1 cup of shredded cabbage has 1 gram of protein
1 cup of shredded onion has 1 gram of protein
a cucumber has 2 grams of protein
a tomato has 1 grams of protein
1/2 cup of corn has 8 grams of protein

HOLY CRAP IS THAT A 20 GRAM OF PROTEIN SALAD BEFORE DRESSING!?!  Now add some black beans (21 grams for 1/2 a cup!), or lentils (25 grams for 1/2 a cup), or even on the lighter side some sunflower seeds (7.25 grams for a 1/4 cup), and you have just made some protein awesomeness!

 But for the sake of this article lets not add beans to the salad because guess what were having for dinner! That's right, lentils and quinoa! If you've never tried it, its awesome and as easy to cook as brown rice. Give it a try its awesome. Anyway a cup of quinoa and a 1/2 cup of lentils, and boom! 49 grams of protein.

So lets add that up shall we? 20 grams from the morning shake, 20 grams from my awesome lunch salad, and 49 grams from dinner! Look at that I'm over my requirement! I'm not even taking into account the fact that I put soy milk into my coffee, or that I have a protein shake after I workout, or that I sometimes have a shake or a Cliff Builder Bar or ProBar Core Bar if I get hungry during the afternoon! I've also been known to eat an apple and almond butter as a snack! Trust me I get WAY more than 80 grams of protein a day and I don't even try!

That leads me to the athletics side of things. I've read in a few places that you should aim to get 1 - 1.5 grams of protein per pound of body weight if you are "an athlete", and that consequently that's why its so hard to be a vegan athlete... I submit the above as testimonial, that in reality its not that hard. It does however require planning and forethought. Now one other thing to mention is the fact that vegetable sources of protein don't have the "essential amino acids". These are the ones the body can't produce. But there's a simple solution to this! You eat a variety of plants, which each have different amino acids, and presto you can ensure that you get the variety of amino acids that your body needs! Well hell our salad was a good mix! In fact I don't think we had any protein from the same source all day today! So bottom line is that it can be done. So eat vegan and thrive!

Coding for readability

I've read many books, sites and blog posts that explore the topic of what it means to write "good code". As a general rule they seem to mostly come down to "write the most efficient code possible". While as a rule of thumb I feel you should keep an eye on efficiency, I would argue that a more important point is writing code for readability. 

The reality is that over time even the most inefficiently written code will run better on faster hardware. Horribly inefficient code written 10 years ago runs blazingly fast today. That's not to say that you should sacrifice efficiency because it doesn't matter, but if you sacrifice readability for efficiency you end up causing problems later on. Let me give you an example.

    public class HelperClass
    {
        public HelperClass ()
        {
        }

        public void All(int x, int y)
        {
            for (int i =x; i<=y; i++) 
                Console.WriteLine (i);
        }

        public void Evens(int x, int y)
        {
            for (int i =x; i<=y; i++) 
                
//if its modulus is 0 it must be even
                if (i % 2 == 0) 
                    Console.WriteLine (i);
        }

        public void Odds(int x, int y{
            for (int i =x; i<=y; i++) 
            
//if its modulus is not 0 it must be odd
            if (i % 2 != 0) 
            Console.WriteLine (i);
        }

        public static void DoIt(int x, int y)
        {
            
HelperClass hlpr = new HelperClass();
            hlpr.All(x, y);
            hlpr.Evens(x, y);
            hlpr.Odds(x, y);
        }
   }


Look its a simple example, I know. I'm not trying to show off some elite coding skill, that's not the point. I want this to be useful to as many people as possible. So let me bring up a few things that could seriously increase readability.

Naming Your Classes

public class HelperClass

The word helper is REALLY tempting to use. After all, if you are coding very quickly (and lets be honest with deadlines we all take shortcuts), it can be tempting to just say "I'm going to be using this code in more than one place, because I'm trying to write good DRY (Don't Repeat Yourself) code". This leads to two problems though. The first is that when you go to actually call your code you end up with calls like this:

    var hlpr = new HelperClass();
    hlpr.All(x, y);

Ugly. Taken out of context, what the fuck is this actually doing? When you are trying to rip through this code in three weeks time trying to debug something, you are going to waste time circling back and reminding yourself what it is you were trying to write. The Second problem it brings up is that when you name something helper, it almost IMMEDIATELY becomes a dumping ground. It's amazing what ends up in those classes after a team of developers has had one of those around for a while. After a while they become a huge amorphous blob of crap and cruft that has to then has to be refactored thereby changing HUGE underpinnings of your application with it. It's not pretty I don't recommend it. So whats the easiest way to solve this? Call it what it is! In this case, public class NumberPrinter!

    NumberPrinter prtr = new NumberPrinter();
    prtr.All(x, y);

That's better but I think this leads to my next point

Naming Your Variables

    NumberPrinter prtr = new NumberPrinter();
    prtr.All(x, y);

Guys, you really aren't saving anything other than keystrokes if you don't give good descriptive variable names. The compiler doesn't care what you call your variable, but you know who will? The next developer who comes along. Changing this variable name to numberPrinter goes along way to making people happy.

    NumberPrinter numberPrinter = new NumberPrinter();
    
numberPrinter.All(x, y);

Well that's good, but now look at the line numberPrinter.All(x, y). I mean that doesn't exactly read well. Plus going back to my previous point of dumping grounds, the word All in this case is a little generic...

Naming Your Methods

        public void All(int x, int y)
        {
            for (int i =x; i<y; i++) 
                Console.WriteLine (i);
        }


What is this method actually doing? All is not very descriptive. How about giving it a more accurate name, like PrintAllNumbersBetweenBeginningNumberAndEndNumber? Sure its a lot longer but lets look at it in use:

    public void PrintAllNumbersBetweenBeginningNumberAndEndNumber(int x, int y)
    {
        for (int i =x; i<y; i++) 
            Console.WriteLine (i);
    }

That parts not too bad.

    NumberPrinter numberPrinter = new NumberPrinter();
    
numberPrinter.PrintAllNumbersBetweenBeginningNumberAndEndNumber(x, y);

Holy crap! I now know what that is doing without looking at the code! YAY! But wait, which parameter is the beginning and which one is the end... I damn, guess that needs fixing too!

Naming Your Parameters

        public void PrintAllOddBetweenBeginningNumberAndEndNumber(int x, int y)
        {
            for (int i =x; i<=y; i++) 
                
//if its modulus is not 0 it must be odd
                if (i % 2 != 0) 
                    Console.WriteLine (i);
        }

Anyone want to guess what this method is doing? Oh wait, you don't have to guess! You can tell from the name! How awesome is that! Unfortunately we don't know which parameter is the beginning and which is the end. Naming a parameter follows the same idea as both variables methods and classes! Be descriptive! Lets label our parameters with what they actually are to the method! So x becomes beginningNumber, and y becomes endingNumber! Brilliant!

    public void PrintAllOddBetweenBeginningNumberAndEndNumber(int beginningNumber, 
                                                          int endingNumber)
    {
        for (int i = beginningNumber; <= endingNumber; i++) 
            //if its modulus is not 0 it must be odd
            if (i % 2 != 0) 
                Console.WriteLine (i);
    }

Well that IS better. I mean look:

NumberPrinter numberPrinter = new NumberPrinter();numberPrinter.PrintAllNumbersBetweenBeginningNumberAndEndNumber(beginningNumber, 
                                                                endingNumber);

But Alex, you are thinking what about the i variable in the for loop! That's not descriptive. There is so many ways you can describe the counter in a for loop. counter being one of them. If you want to get creative that's fine, but most people learn this structure using i, so generally this is a pretty safe use for a crappy variable name. But you know whats bothering me about the method code? Lack of curly braces...

Use White space, and available Lexemes!

What to I mean by Lexeme? Well in this case I'm going to referring to Curly braces! We all know that in C languages you don't HAVE to use them all the time, there are exceptions. But in this case I think we may want to look and make sure we are making our code readable:

public void PrintAllOddBetweenBeginningNumberAndEndNumber(int beginningNumber, 
                                                          int endingNumber) {
            for (int i =beginningNumber; i<=endingNumber; i++) 
            
//if its modulus is not 0 it must be odd
            if (i % 2 != 0) 
            Console.WriteLine (i);
        }


Look Ma! I moved my white space and curly braces wherever I felt like! Guess what the computer can read that correctly! Other developers, will probably fuck up, and then get pissed off when can't figure out why there code isn't working. Just because you don't HAVE to use something, doesn't mean you shouldn't. I don't HAVE to use the turning signal on my car, but generally I feel its a pretty good idea. It makes it a bunch easier for other drivers on the road to know what it is I am actually trying to do... So lets fix this!

public void PrintAllOddBetweenBeginningNumberAndEndNumber(int beginningNumber, 
                                                          int endingNumber) {
            for (int i =beginningNumber; i<=endingNumber; i++) 
            {                //if its modulus is not 0 it must be odd
                if (i % 2 != 0)
                { 
                    Console.WriteLine (i);
                }
             }        }

Well that's better! But does anyone see an issue here? Were using two different styles for our curly braces! That's a recipe for future WTFs. 

Be Consistent

Use your lexemes in a consistent manner. If you want to put curly braces at the end of your if statement, use that for all statements! If you work with other developers make sure you ALL agree on a usage. Having differences in White spacing and statement terminators is a quick way to create a debugging nightmare.



Code Comments

That's right I put a code comment in there! Generally I'm not a huge fan of code comments. I think to many people rely on them for really poorly written code. If you write more comments than code, then quite frankly, you are doing it wrong. Now I realize in this case I put a comment over a line with modulus. Honestly that was the simplest thing I could think of that people may not recognize. I've met a few developers who have never come across the modulus operator, it happens. So keeping it short, I am basically telling the next developer "If you don't know what the % symbol means, it means modulus, and if you don't know what that is, google it!"

So Where did we end up?


public class NumberPrinter
{
    public NumberPrinter ()
    {
    }
 
    public void PrintAllNumbersBetweenBeginningNumberAndEndNumber(
                                                            int beginningNumber, 
                                                            int endingNumber)
    {
        for (int i =beginningNumber; i<=endingNumber; i++) 
        {
            Console.WriteLine (i);
        }
    }

    public void PrintAllEvenNumbersBetweenBeginningNumberAndEndNumber(
                                                            int beginningNumber, 
                                                            int endingNumber)
    {
        for (int i =beginningNumber; i<=endingNumber; i++) 
        {
           //if its modulus is 0 it must be even
           if (i % 2 == 0) 
           {
               Console.WriteLine (i);
           }
        }
    }

    public void PrintAllOddBetweenBeginningNumberAndEndNumber(
                                                            int beginningNumber, 
                                                            int endingNumber)
    {
        for (int i =beginningNumber; i<=endingNumber; i++) 
        {
            //if its modulus is not 0 it must be odd
            if (i % 2 != 0) 
            {
                Console.WriteLine (i);
            }
        }
    }

    public static void PrintAllNumbersEvenNumbersAndOddNumbersBetweenBeginningNumberAndEndingNumber(
                                                            int beginningNumber, 
                                                            int endingNumber)
    {
        NumberPrinter numberPrinter = new NumberPrinter();
        numberPrinter.All(beginningNumber, y);
        numberPrinter.Evens(beginningNumber, y);
        numberPrinter.Odds(beginningNumber, endingNumber);
    }
}

Well that's certainly more human readable, and you know what we didn't do a damn thing to the efficiency! Win! It's as simple as this, if you use a compiler, then any code you write can be read by a computer. Honestly that's the easy part. Writing code that future developers can read, understand and extend? That's hard. So many times we get lost in the sea of efficiency of our code from the machines perspective, but we need to make sure we don't lose sight of the efficiency of bring a new hire up to speed. Or reading through code that hasn't been touched in a long time because we need to update or extend its functionality. Or god forbid even having to dig into the deep dark reaches of the code for a heisenbug! The bottom line is don't neglect the human aspect of efficiency. After all, humans don't get faster hardware every few years.