Thursday, July 29, 2010

Continuous Newbie Gains

I've developed a new weight lifting methodology, which I call "Continuous Newbie Gains" or CNG for short. This methodology I have progressively refined over the past several winters and is actually an off shoot from Winter Wall Syndrome which I discussed a while back.

The basic premise for CNG is as follows:
  1. Get enthusiastic about going to the gym.
  2. Start going to the gym regularly and strictly following schedule etc.
  3. Experience all the loveliness that accompanies starting fresh at the gym, the excessive DOMS and the all the Newbie gains that can be had.
  4. Get distracted, get a cold, get injured playing rugby, lose focus, go away on holidays etc
  5. Stop going to gym regularly.
  6. Miss a few sessions here and there.
  7. Suddenly realize that you haven't been to the gym in a month.
  8. Decide that you need to get back into it.
  9. Return to step 1.
I realized as I walked to the gym to shower after my morning ride today that this is pretty much how I operate over winter. And apparently I find its a great way to get to the gym in the cooler months.

Wednesday, July 28, 2010

Using Parted Magic to Ghost System Drives

This lovely live CD saved me, or rather it would have, had I bothered to use it when I first setup my computer at work with Windows 2008 server.

You see what happened to me yesterday was that as I was testing the installer and uninstaller for our next release a gremlin got into my system and corrupted the registry settings for the latest copy that I had just installed. This was all well and good until I decided to run the uninstaller on the broken install and when it got to the point of deleting files it read the corrupted entry and thought the install directory was "/" as a result it started deleting random files from my system hard drive.

Unfortunately as I had only thought about cloning my system drive I was left with the task of reinstalling my computer from scratch. In a effort to see the positive side of this whole thing I am telling myself that I was probably due for a system clean up anyway, but its not quite working for me. So this time around I have taken the extra step of using Parted Magic a live CD with partitioning and disc tools on it to clone my drive, the features are listed below.
Features
  • Format internal and external hard drives.
  • Move, copy, create, delete, expand & shrink hard drive partitions.
  • Clone your hard drive, to create a full backup.
  • Test hard drives for impending failure.
  • Test memory for bad sectors.
  • Benchmark your computer for a performance rating.
  • Securely erase your entire hard drive, wiping it clean from all data.
  • Gives access to non-booting systems allowing you to rescue important data.
  • Runs from the CD, no install required.
Using Parted Magic it only took around 15 minutes to clone my freshly setup system drive to my secondary hard disc in preparation for the next time that I destroy my system install. Which I have to admit happens a little too frequently for my liking as I spend a lot of time at work installing, uninstalling and upgrading  software while testing. Once I completed the cloning I tested a restore to make sure it worked and in only ten minutes or so I had a freshly restored system.

Now that I have armed myself with a clone of my system drive I can resume my work duties happy in the knowledge that even if everything goes pear shaped again I can get up and running again a whole lot quicker than a complete system reinstall, except for a few personalization tasks and updating to the latest code bases I can be back up and only in 20 minutes.

Tuesday, July 27, 2010

MVC WTF?

It has really been that long since I studied programming but as I’ve started looking at some of the iPhone Development Lectures from Stanford on iTunes University I’ve noticed them talking about some things that I’d blocked out (Assignments and exams) and some things that I’m not sure I’ve ever heard of such as the Model View Controller architecture pattern. In the case of MVC I am not sure whether it is because I mostly did low level programming courses at Uni or because it is the latest pattern to re-emerge as favourite among the development community.

In an effort to get more comfortable with the concepts involved in the MVC pattern and how to program within it I thought I would right up a short post. You may have noticed that some of my posts seem more like brain dumps than anything else, this is because I often reach a point of enlightenment or understanding on a subject when I attempt to explain it to someone else. In this case, all my readers get to be that someone else. I am sure there is some amusing quote that I should be quoting to illustrate my point here but a ten second google didn’t reveal it to me

The basic premise with the MVC pattern is that you have a Model which represents and contains the data that the application uses, a View (or collection of views) that is a rendering of the data, or subset of data, in a way that allows user interaction and a Controller is  the glue that links everything together.

Models store data and provide domain logic that provides some meaning to the raw data, such as ranking information or totalling a shopping cart, when a model’s data changes it will notify its associated view via the controller.

The Views are what the user sees and interacts with, they are the visible side of the program and are related to a specific model or model subset, they know how to display the data that is contained in a particular model in a way that is meaningful to the user. A view allows a user to modify data in the model by sending events to the controller, which decides how to handle them.

The Controller oversees the interaction between the View and the model, the controller contains the application logic and determines how a View modifies data within the model.

As I said, this post was to clarify things in my head, I hope you found it useful, but be warned there will be more posts like this coming your way.