Server Side Include messed up my layout
Here is what happened: I migrated some content to an SSI and when I viewed the page it was different. The file was SHTML. I had a div that was supposed to hug the top of the page. After, it was moved to SSI, it was pushed down 1 line. Tools Used: Fiddler Notepad ++ The cause: Shtml SSI streams the bytes of the included file byte for byte. The included file was saved as UTF-8 With BOM. The BOM bytes...
January 9th, 2012 by B.Harding
Log4Net in a Windows Forms app (quick and easy)
This post will show you how get Log4Net working ASAP on a windows forms application. First, get Log4net. The easiest way to do this is to open the Tools, Library Package Manager, Package Manager Console then type Install-Package Log4Net Next add the log4net config to your App.config. WATCH OUT! <configSections> must be the first child element of <configuration> WATCH OUT! Target the...
August 10th, 2011 by B.Harding
How to read a POST’s raw data
I was tasked with accepting data posted from an AS400 to a web page. The only problem is that for some reason the Request.Form was empty. I’m not sure if this violates the RFC or not but I have to deal with it. Luckily I can adapt with a few short lines. It turns out that this is caused by not using the correct content-type when the request was made. The request.form isn’t parsed unless...
April 13th, 2011 by B.Harding
Garage Door Opener Stripped Gear-How do you remove a Roll Pin?
Q: How do you remove a Roll Pin? A: With a Craftsman Roll Punch from Sears After about 10 years my garage door quit working. After a couple of turns of the screw driver I see that the innerds are full of gear dust. My drive gear is stripped! To fix or replace? That is the question. I quickly discover that a new gear is only $12 on ebay and that includes grease and free shipping. Done. When it arrives...
February 18th, 2010 by B.Harding
Watch out Chuck Norris! Scott Guthrie is in town!
Boosted from http://developerdeveloperdeveloper.com/guathon/Default.aspx Some things you might not know about Scott Guthrie When Scott Guthrie throws exceptions, it’s across the room. All arrays Scott Guthrie declares are of infinite size, because Scott Guthrie knows no bounds. Scott Guthrie doesn’t have disk latency because the hard drive knows to hurry up. Scott Guthrie writes code that optimizes...
September 24th, 2009 by B.Harding
My job hunt brain-dump
A couple of weeks ago I began working as a Web Developer for the American Motorcyclist Association. To me this is a big deal because I have the actual title of “Web Developer”. I love it. It’s a dream job. Nice people, nice gear, nice facilities and they have an adequate budget, I get benefits and paid over time. WooHoo! Getting here has been a bit of a journey. I’ve just come...
September 7th, 2009 by B.Harding
switch to ssl automatically
In this post I’ll explain how I transparently switch from http to https This same snipit can be put on any page as is and forces certain pages to be https. The nice thing about it is that the user can not edit the url back to http on a page that has this. All I did was put it on the login page and payment page. On page load the server examines the Request.IsSecureConnection flag and redirects...
February 5th, 2009 by B.Harding
Use Css to center a div
Using tables to layout a page is considered outdated. The “new” way to do it is with Div tags a alot of Cascading Style Sheets. To center a table is easy. You just set align=”center”. But what about when using the new way? When you want to center a div in the middle of the page use either a style or a css class to set the following attibutes: width: a fixed width; margin-right:auto; margin-left:auto; Note...
February 5th, 2009 by B.Harding
What’s the deal with flash videos not working?
A few of my clients have used flash videos in their pages. Out of the box this didn’t work on my server. It was fine in the development environment but once uploaded to production it was a no go. The video just never appeared. It’s been a while since I learned this trick but it recently popped up again so I figure I sould blog it. On a windows server running IIS flash . swf files that...
February 5th, 2009 by B.Harding
Automatically reboot an unresponsive Windows Server
My servers are leased so if anything goes wrong and a reboot is needed I have to wait for my provider to preform it. In this post we will create a vb Script that pings an IP address and reboots if it can’t see it. We will simply run it on a timer using the command scheduler. Here is the script: Option Explicit dim strHost ‘The ip address you want to monitor strHost=”111.222.333.444″ if...
February 5th, 2009 by B.Harding



