Latest on twitter:

Support is everything, use it

Since my last post my training has taken a turn for a worse. Two days after my run with weight my knee swelled up for three days, even with ibuprofen and ice. I took it easy on it for a while so that it could heal, which it did.

However when I finally got down to doing another long run again I could only reach mile 14 of 18 before my legs wouldn’t go any further. This wasn’t just a “I’m out of breathe, I can’t go any further”, I had literally run out of energy. My legs could barely move and I was still 2 miles from home on the shortest route. On my walk back I got very cold and my head was in a dizzy haze. It seems that the walk home and lack of energy in my system had given me a mild case of Hypoglycemia and / or Hypothermia. Luckily for me L and T were around to help me feel human again. After a bath, lots of blankets, sweets, drinks and some rest I was feeling better. It was very clear to me though that if I didn’t have the support of those two I would have been in a far worse state.

Men often think that they have to be strong enough to deal with their problems alone. It’s exactly what I did when I walked those 2 miles home, but if I’d have asked for help, even if I’d have paid for it by hailing a taxi I would have got home a lot quicker and probably in a much better shape than I was. So the thing I wonder is, if I put myself through that much extra agony for two measly miles of walking because I didn’t ask for help, imagine what someone will go through when they can’t get the support they need to help them cope through something as life shattering as rape. Scary isn’t it.

Mankind Counselling - Sponsor me

Today’s escapade’s when running around Uckfield.

Can motivation overcome tiredness?

I think I’ve got a pretty high level of self motivation and normally it takes a lot to falter it. Since Sunday I’ve been on a mission to get all of the below done by Thursday evening, which I think proves that:

- MOT and servicing my car
- servicing my bike
- stripping and preparing the stairwell by Thursday morning
- working my usual 8 hour day each day
- organising my own server and other client sites
- seeing the people I love
- football training
- marathon training.

However, the last item on the list is pretty darn important considering what I’m going to be doing on the 15th of April. Yet this morning I couldn’t get myself out of bed. Had I lost my motivation? Why couldn’t I do what normally seems so easy? *

I eventually put it down to just being tired and in my head that’s a lame excuse. You know what though? It’s been a busy week and there’s still 52** days to go until the marathon. That’s loads of time to be my usual mad / crazy / [enter adjective here] self by getting up early in the morning and enjoying my runs like I usually do.

So in conclusion my motivation couldn’t over come my tiredness today and there will be other days in the future where the same occurs. However, that’s the minority and I’ve got the majority on my side ;)

* I want to think of a better word but it just seems to flow well. It’s fair to say that getting up at 5:30 in the morning is never easy!

** That was calculated at the time of writing. Luckily I didn’t even have to calculate it as I had an email from Brighton Marathon telling me this morning. #win

Brighton Marathon 2012

I decided a few months back that I would run the Brighton Marathon again. That’s right, for a second time. However I’m doing it with a difference this time around. I’m going to run the full 26.2 miles while carrying 15kg of weight.

Why on earth would I do that?

Our burdens, mental or physical, have a profound impact on how we live our life and those around us. Mankind support men (18+) who have experienced childhood sexual abuse and/or adult sexual assault at any time in their lives. Without that support a lot of men would more than likely try to struggle on keeping their experiences to themselves with potential tragic consequences.

So how does running with weight help?

To show a burden in an extremely obvious and physical way I’m going to run the entire marathon with 15kg bearing down on me. It’s going to be one hell of a challenge, one that I don’t know if I will be able to complete. However with my training and stubbornness I feel like I can give it a damn good shot.

Support needed

Last year everyone was fantastic in helping me raise over £800 pounds for St. Wilfred’s Hospice Eastbourne and I’m hoping that everyone can show me that same level of support this year.

I really hope I put enough emphasis above on how important support from Mankind is for those that need it. 3 in 20 men are affected by sexual violence, so there’s a high chance that someone you know would benefit from their help. Please show your support by donating generously.

If you don’t have any money to donate, please spread the word. It’s another way that we can help banish this taboo of men talking to others about their problems.

John

P.S. I’m also going to be blogging about my more interesting runs to show you what I’ve been up to. It’s a shame I’m doing this so late because you’ve already missed numerous blistersgrazes and saws. Including a 10 mile run while carrying 10kg which was very testing for my legs to take that extra weight.

26.2 miles with a bag of sand.

When I do Brighton 2012 I’ll basically be carrying one of these:

15kg - Bag of sand

Please sponsor me to raise money for ManKind, http://www.charitygiving.co.uk/johnharman.

If you’re actually after a bag of sand then Amazon can provide - http://www.amazon.co.uk/Childrens-Play-Sand-15kg-Bag/dp/B002ED5Y2K

DataAnnotations validation with ASP.NET MVC silently fails

Well I spent hours the other day trying to work out why my validation using the default DataAnnotations in ASP.NET MVC wasn’t working.
It turns out that my resource file was internal and not public so the model binder couldn’t access the resource file properties. It’s fair enough that it couldn’t gather the error messages but I really do think that it should throw an exception if that is the case.
I’ve added an issue to codeplex about this because a silent fail really doesn’t seem helpful to me at all. Will update if they take action on this or give a reason otherwise.

Tips to help write flexible and robust sites with CSS

HTML and CSS isn’t new but there are still so many people out there that mis-understand it. So I’ve come up with my own list of tips to help develop more robust and flexible pages.

Use a reset stylesheet

All browsers have their own defaults for paddings, margins and all sorts of settings which can make your life harder. So level the playing field by using a reset stylesheet to bring them all as close to each other as possible before you even start. Just Google around to find the one you want to use.

Use the right tool for the job

I won’t go into this too much as it should be obvious, it basically means that you should use HTML as it was suppose to be used e.g. use a table for tabular data, fieldsets to group logical form fields, a label to describe a field’s purpose (Read up on it, you may not know as much as you think.)

Don’t abuse your HTML

Adding HTML to the page so that it is easier to style it is a no no! e.g. adding an empty item in a list or empty paragraphs. Not only is the added HTML irrelevant and useless but you are making more work for yourself. Why? Because you have just tied your stylesheet directly to your HTML, if you want to change your styles then it’s likely you will have to change that HTML too. CSS was created to be separate from HTML so that’s how you should use it.

Misunderstood rendering

I see so much unnecessary CSS in stylesheets because a developer doesn’t understand that a div will fill up the full width of its parent or that a standard hyperlink can’t have padding unless it is set to a block. Have a read of this article (which I just found) which does a good job of explaining how blocks and inline elements work. Also check this bad boy which may clear a few things up what can or can’t be which type of display setting.

Avoid floats and widths

Floats are great but often over used, this goes the same for widths. Try to think of ways to styling the page without using either. There is a good reason for limiting the use of these, for floats it simply limits the number of issues you will have because lots of bugs often relate to floats whether that is an un-cleared item within it or even numorous bugs found within in IE6 (which is still going to be here for a year or two trust me!) As far as widths are concerned you can often let elements fill out the parent container, it’s a natural thing to do so let it do it. The bonus side effect is that the fewer widths you have the easier it is to update a site when it changes dimensions as everything just fills to the parent’s new size.

Natural flow of the document

If you view your page without any styles it should be easy to read and in logical order. e.g. main navigation near the top, content and then any sub-content and navigation. Don’t organise it around your styling, this is the wrong way to think about it. If you really MUST move HTML somewhere different for styling purposes then do it with JavaScript afterwards as an enhancement not a requirement.

Hope the above helps.

500 error IIS7 with blank page

So I went to fix a bug in a clients site the other day, loaded up visual studio as usual and went into debug to see if I could find the problem.

However no matter what I did I was getting the error “Unable to start debugging on the web server” Now considering I thought I hadn’t touched anything for some time I was surprised to say the least.

Next I tried to just load the site in the usual manor (as it is a legacy application as a website not a web application). On doing this I just received a blank page, after loading Fiddler to try and get a better look I still got nothing to tell me what was going on but Fiddler said a 500 error was occuring.

Anyway, after uninstalling various pieces of .NET and lots of Google searches. I went to add the logging features of IIS7 to help me out (for some reason they weren’t installed). I can’t remember what exactly but I also had to add some error options on.

Once this was done I was told the actual error message, basically that I didn’t have permission to read the web.config. Simple fix and away we go.

One word to sum up the entire ordeal, ANNOYING.

I thought I recognised the location and it turns out I lived there for a year! So enjoy watching Worthing at it’s best… probably…

NHibernate QueryOver

It’s a small thing but I’m really looking forward to NHibernate 3.0 with QueryOver.