Wednesday, February 23, 2011

Hacking Together Good Code Quickly

I'm kind of a perfectionist when it comes to writing good code. I'm not saying that I write amazingly perfect code all the time. However, I do take pride in writing good code and always over-analyze (not in an OCD way, but...) my architectural choices when designing systems.

Well, it's officially crunch time on a project that I'm working on, and I'm forced to add features into the application with the quickness (ie. hack). :( It's not bad code. It works. However, it is not written to my standards and has some majore "code smell" to it.

Things like this:


DoSomethingCoolHere();

foreach(var form in Application.OpenForms)
{
if (form is AnalyzerForm)
((AnalyzerForm) form).RefreshDisplay();
}


I would much prefer to NOT use the 'Application.OpenForms' static property, nor would like to cast objects to specific types to call a method on them. However it works for now, and can be refactored later. At least I can take comfort in knowing that I get to refactor as soon as the "facade" is working.

These are all the secrets that I'm going to expose right now about our amazing software. :)

Tuesday, February 22, 2011

Running with Dean Karnazes

I saw on Regis and Kelly this morning (no... Jen was watching it, not me) that Dean Karnazes is going to be doing a Run Across America, starting this Friday. He starts his journey in Disneyland and will be running through Ohio in mid-April. I'm going to find out the closest 5K event that he has around here and will run it with him. He's coming through Granville, so hopefully there will be one near there...(?)

I've read 2 of his books and watched the "50 Marathons in 50 Days" movie. Dean is a great guy (no matter what some ultra runners may think of him). He is out there trying to get people excited about getting healthy and he makes money doing what he loves; running. It will be great to just run a few miles with him, even if I don't get to talk to him. Plus, the money goes to a good cause to help childhood obesity, so I may recruit some of my friends to run with me too. :)

Here is his journey:



Anyway, if you've never read a Dean Karnazes book, I encourage that you do so. Even if you are not a runner, or have no desire to run, his books are very easy to read and will give you a whole new outlook on ultra athletes. He's an inspiration to all of us mere mortals. :) Sure, there are other athletes that are just as extreme in some regard, but Dean is the one that is pushing it to the kids and mass media so that people get excited about it. If you've never ran or don't know why people run, read a Dean Karnazes book. He describes the passion perfectly in Ultra Marathon Man: Confessions of an All-Night Runner. I read this book in 3 short nights and it changed my outlook on long distance running.

His book is what sealed the deal for me to sign up for my first marathon 3 years ago. Definitely an inspiration!

Tuesday, February 15, 2011

Hacking Like Neo

Have you ever wanted to skin your entire computing experience to be completely monochrome green and black like the Matrix? If you are a Mac user, you can.


Honestly though, I do a lot of coding in the dark and use this display a lot. I don't like sitting under bright lights. However, I used to get nasty headaches when looking at a glowing white screen in the dark. To solve this problem, I used to use a shortcut key combination built right into my Mac that would turn "White on Black":
> [CONTROL]+[OPTION]+[COMMAND]+[8] (try it now)
> or navigate through System Preferences -> Universal Access -> Seeing -> Display

Unfortunately, this would just negate all of the colors much like a negative from an old 35 mm roll of film. This wasn't very useful actually. My colors would all be out of whack with some pretty crazy colors (magenta, baby blue, purple, pink, lavender, yellow, etc..) and when I would visit a page that was originally black, then I would get the nasty white glare again.

A few months ago I stumbled upon a cool utility that allows me to do a lot more than just turn "White on Black". The utility is called Nocturne and it has been a dream come true for me. It works by adjusting tints and hues rather than just inverting all of the colors.

Here is a before pic:


Here is an after pic:



Not only does it look bad-ass for anybody looking over my shoulder, but it saves my eye sight when I'm coding in the dark. Best yet, you are not just limited to monochrome green and black. You can configure it to be any color you'd like. I can set my tint to red and it makes my Mac look like a submarine terminal. Check out my iTunes display:


So there it is. If you code in the dark, or want to code like a real hacker (:P), check out Nocturne (it's free)!

Sunday, February 13, 2011

Google Chrome and Blogger Issues - Solved!

For those that don't know, I'm a 100% Google Chrome user. It's fast, easy to use, and did I mention it's fast. However, for the last few months I've been frustrated with the fact that I couldn't enter new posts to my blog from Chrome. If I wanted to blog about something, I had to either open Firefox or use a 3rd party tool (like Blogo) to post something to my blog.

Today on my run I thought that it was ridiculous that Google owns Blogger and Chrome, but the two don't work together. Clearly I'm not the only person who's experiencing this problem and I had to figure out what the problem was. I'd done searches in the past to try and figure it out, but the results I got back weren't correct. I wasn't using the proper terms or something, so I played with it and finally did a search for: "google chrome +blogger" and found the problem.

The problem was due to a Chrome Plugin called "MeasureIt" (great plugin by the way). Once I disabled it, I was able to enter all of this text inside my Blogger editor using Chrome. Just another emotional baggage issue that I've solved to allow myself easy blogging again. Maybe I'll start blogging regularly again??

Monday, February 07, 2011

2011 Mohican Trail 100 Mile Run

I did it. I signed up for my first 100 mile run.

I'm nervous as hell but excited at the same time. I know I can do it if I put my mind (and body) to it.

The 100 mile run has been something that I've been curious about since I found out there was such a thing. Ever since my first run @ Mohican, I've brushed it off as something that I'd never try; "that's just crazy!"

After my 100 km race last year, I got the bug to go further... As I was approaching the finish line at Oil Creek, I thought to myself that I could have probably gone another loop if I had to. It would have hurt really bad and I would have probably hit a wall that I'd never hit before. However, I could have tried it with no real fear leaving the aid station. After that realization, I went through all the "what if" situations in my head for weeks. I realized that there's no real good reason NOT to try the 100 miler.

A few months ago, I told Jennifer that I was considering it and she was (kind of) supportive by saying:
Whatever, Babe!? You know I don't care...

So that was my approval from her to know that she was on board with my decision if I wanted to do it. Well, I arrived home from Virginia on Friday, and knew that if I was going to do this, I had better just do it. I didn't say anything to her or anybody else about it. I just went to the website and paid the fee. After I did it, I went over and gave her a big hug and told her what I'd done. :) She thought I was crazy, but she's used to that by now...

The organizers have made some huge changes to the race this year and I'm excited to be in the first group of runners to run the new course. For an understanding of what has changed and why they've changed it, visit Mikey P's blog. He lays it all out beautifully and tells what they've changed and why they've changed it. They knew they'd get the good and the bad responses from the veterans. I'm not a veteran by any means; I've ran at Mohican quite a few times, and attempted the 50 miler two years ago. However, I'm still one of the new kids and have crazy respect for the veterans of Mohican. My response to the new course change is very good; I think it's great what they're doing to to welcome the new class of trail runners. The course is much easier to manage, it eliminates a lot of bottle necks, it makes it easy for runners to know where they're going next, and most importantly it makes it easy for aid and crew to do their jobs.

This morning was the first day of my training. I ran a slow 12 miler yesterday and ate a lot of crap food during the Super Bowl. Today I woke up early and began the first day of the P90X program. I did this once and got very strong. The idea is to do it again and get even stronger. I'm going to eat right and run during the program too (of course). I'm really going to try and improve my pace this time. I don't want the cutoffs to beat me for this race. My goal is to loose about 20 lbs of excess weight so that I don't have to lug it around the woods for 24+ hours. My running buddy (Kimba) has dropped an insane amount of weight and she's reaping the rewards with faster times, and stronger finishes. I know that my weight loss from last year helped me finish Oil Creek, and that was only 62 miles. :)

As for running as a minimalist... I don't think I'm going to focus on that for this race. I will absolutely wear my VFF's on my training runs, but won't limit myself to just running in them as I train for this race. Last year, I ran exclusively in them. I didn't wear shoes all summer. However, the Indian Run 60K really put my feet and calves through hell. That run was only 38 miles. (again, :) ). After that run, I began to prepared for the Oil Creek race and switched back to shoes... It paid off and I finished with minimal damage. This race is very important to me and I don't want my feet to be the reason for me to DNF (Did Not Finish). Therefore, I'll use my VFF's for most of my training runs, but will wear shoes for my "longer" long runs and the race itself.

I just have to know if I can do this. My ultra-running friends say I can do it, and I believe I can do it, so the next logical step is to do it. I'm going to give it everything I have to finish this thing so I can get it off my back. After June 19th, I'll know all of the ups and downs of the 100 mile race. I'll run through the morning, day, evening, night, morning, and day to finish it... or black out (whichever comes first).