Last week I was in Boston, MA for Tech Ed. Roughly 10,000 – 15,000 IT professionals decended upon Boston to add to the already horrible traffic situation. It was my first time in Boston and I had a blast. I went to Cheers twice, Jullians, Avalon, Fenway Park and of course the Convention Center where I walked about 10 miles a day (no joke). Before I left for Boston I was trying to get an order re-filled for my contacts. My eyes are extremely sensitive to light and this is why I typically have a pair of sun shades on my head even in the heart of winter. I have been using 1-800-Contacts for several years now to get my contacts. The only *catch* using them is you have to have a valid prescription. Right before leaving for Tech Ed mine ran out. So I got an appointment, got a new prescription, called 1-800-Contacts and placed my order on a Wedensday before leaving on Sunday. Since I had already placed an order before they told me I would get priority shipping and my shipping costs would be waived. Great. It turns out USPS doesn’t give a damn about its 1-2 day express shipping. To them it means, 1-4 days. They just don’t care, litterally. Fed-ex will drive through swamps and face a huricance head on to get your package delivered in 1-2 days. To make a long story short I had to leave for Boston without contacts. I called 1-800 and they were going to ship me another order to Boston and I was to instruct my wife to refuse the package when it arrived to the house from our lazy friends at the postal service. Turns out there were problems with the shipping address. For some reason a major carrier has trouble finding a 25 story &#*#$^^*#$ing hotel! By this time it was middle of the week and I just said screw it, I’ll deal with it when I get back home. This morning I called into 1-800-Contacts. Side note here. Usually when you call a place like this you expect to be on hold. 9 times out of 10 when I call the phone rings and I get a rep immediately. No pressing this number for this, or dial this extension for that, just straight through to a sales rep. I sure wish the rest of the world would pay attention to this. Put your freaking sales people as the first line of defense! We have the same philosophy where I work, get a human on the phone with a client as soon as possible. Moving on. I knew I was going to have to explain this long story to the sales rep so being a great southern story teller with years of experience I began painting a verbal picture filled with southernisms. The gentleman on the other end said, “Mr. Elder I really appreciate you explaining that. It sounds like you’ve been through a lot with this. The first thing I am going to do is put a $10 credit on your account. You’ve been so patient, most people would be yelling and cursing at this point at me.” I then said, well, it isn’t your fault so what’s the point. The gentleman on the phone then created a new order and as shipping the contacts business overnight. So this little order has cost them 2 expedited shipping fees and $10.00. Now of course they aren’t making any money on this order, but it doesn’t matter, I’m a happy customer because the sales rep showed compassion and my problem was fixed in the most expedited manner it could have been. The $10 credit is just a bonus to this whole mix-up. The moral of the story is, it doesn’t matter if the business screws up. The real true test of a company is how they “fix” or “handle” the problem after something does get messed up.
Don’t trust your web host, they really don’t care about you
Posted by Keith Elder | Posted in General | Posted on 19-06-2006
For those that were following this blog you may have noticed something as of recent. Primarily, where did all of the blog entries for this site go? Well, let’s just say the web hosting company I am using is a complete IDIOT! If you’ve been paying attention to this blog you would have noticed the last entry on this blog was in the middle of March. In March, I had to swap database servers. Not that I got an email or anything from these assholes telling me I needed to do so, my web site just stopped working one day. It seems I am suppose to have the intuition to log into my control panel once a day to read what is going on. Anyway, after making the necassary changes, I was back up and running. I was running flawlessly for about 2 months. Then one day, my web site went down again. I contacted support and when it returned (not in timely fashion I might add), my data was gone! I had lost months of entries, good ones too.
After fighting with WebHost4Life for about a week, they finally admitted they screwed up and lost my data. As a grand prize I get 3 years of free hosting with a company who lost months of my data. Yeah…….
Why didn’t I blog earlier about this tragedy? I couldn’t, I was too pissed and would have filled this entry with random bits of rage, four letter verbiage and comments about how the little guy gets screwed by the big guy. I would have also commented on how companies don’t really care about their customers once they have your money.
Over the next several weeks I’ll work on getting the older articles back onto the site. The hard part isn’t re-writing them, but remembering what the hell I posted.
“Today I was sitting in the home office coding and I heard what sounded like someone had thrown a rock into the bay window that looks out over the deck from the home office. I looked around in the yard but didn’t see anything or anybody. Then I noticed there was a dead bird laying in the dog pen that we use to cage Simon, Max and Coda sometimes (our cocker spaniels). Apparently this bird was flying as fast as he could until he met my bay window. He died instantly. Pictures can only do this justice.

“
Calling Multiple Web Services Asynchronously
Posted by Keith Elder | Posted in .Net, Asp.Net, Programming, Smart Clients | Posted on 16-03-2006
There are two ways to call web services: synchronously and asynchronously. Below is an example of a syncronous web call. The HelloWorld() call will not get executed until the ReturnLastCustomer() is completed. In some cases this is fine. For example if you need the information from ReturnLastCustomer() to then call the HelloWorld() example.
Syncronous Web Service Call
localhost.Service proxy = new WindowsApplication3.localhost.Service();
localhost.MyCustomObject myObject = proxy.ReturnCustomObject();
// Make another call to web service
string hello = proxy.HelloWorld();
In the example above we wouldn’t really care if one method completed before another. There may be code below it that can go ahead and get started processing. To do this we change this to call the service asynchronously. The idea behind the asynchronous call is we setup an event that gets notified through a delegate that the web service method is done with processing. Here is how the synchronous example above would look called asynchronously. It may look like a little more code, but in Visual Studio as you type this just press tab when it gives you a tooltip help and it will generate the right side of the += as well as the method stub for the call back.
Asyncronous Web Service Call
public Form1()
{
InitializeComponent();
localhost.Service proxy = new WindowsApplication3.localhost.Service();
proxy.ReturnLastCustomerCompleted += new WindowsApplication3.localhost.ReturnLastCustomerCompletedEventHandler(proxy_ReturnLastCustomerCompleted);
proxy.ReturnLastCustomerAsync();
// Make another call to web service
proxy.HelloWorldCompleted += new WindowsApplication3.localhost.HelloWorldCompletedEventHandler(proxy_HelloWorldCompleted);
proxy.HelloWorldAsync();
}
void proxy_HelloWorldCompleted(object sender, WindowsApplication3.localhost.HelloWorldCompletedEventArgs e)
{
string hello = e.Result;
}
void proxy_ReturnLastCustomerCompleted(object sender, WindowsApplication3.localhost.ReturnLastCustomerCompletedEventArgs e)
{
localhost.MyCustomObject myObject = e.Result;
}
The Problem
The problem with the above example is depending on the speed of how things get processed we will get random errors that an asynchronous call is currently being processed. The good news is there is an easy way to address this in .Net 2.0. There are two overrides for the Async calls. The first one is it takes the parameters of your web service call. The second override adds another parameter of type “object userState”. This allows us to pass in a unique identifier of the call.
To make sure our asynchronous example above works we need to make sure these calls can run at the same time. It is a simple change and that would look like this:
Calling Two Asynchronous Calls At the Same Time
localhost.Service proxy = new WindowsApplication3.localhost.Service();
proxy.ReturnLastCustomerCompleted += new WindowsApplication3.localhost.ReturnLastCustomerCompletedEventHandler(proxy_ReturnLastCustomerCompleted);
proxy.ReturnLastCustomerAsync(Guid.NewGuid());
// Make another call to web service
proxy.HelloWorldCompleted += new WindowsApplication3.localhost.HelloWorldCompletedEventHandler(proxy_HelloWorldCompleted);
proxy.HelloWorldAsync(Guid.NewGuid());
Notice the only difference in how we call the methods is we generate a new Guid as our userState object. This allows the calls to keep track of the state of each call. Pretty easy problem to get around but if you don’t explore your overrides of method calls, you may have missed this one. Being able to call multiple web service methods asynchronously at the same time is pretty important when writing a Smart Client so you’ll probably use this more in this scenario. With larger Smart Clients you typically have things running in the background to check on statuses, update queues, as well as carry calls to save and return data. This is how you get around that.
Channel 9 has been around awhile and is one of the things I spend time in the evening watching if there are new videos. There’s always good content on channel 9 and its great to hear the people that built a lot of the technology we use talk about it. Channel 9 is where they interview developers at Microsoft on how things were written or work. Channel 10 is a new site built upon Asp.Net 2.0, SQL Server 2005 and Ajax. The site’s mission is to provide content for the other side, the people that are using the technology. There are lots of cool features in the site. The team spent a lot of time building some very thought provoking UI into the site. Watch the video on Channel 9 about how the site was built if you are curious. Anyway, one of their features is you can put their video content inside of your blog. I thought I would try it and see how it went but I can’t get it to work. It seems my blogging software strips it out. Cool idea though.
You can check out the new site launch at http://on10.net .

