January 26, 2006

Knee update

I remember writing about my knee a number of months ago, and I thought this would be a good time for an update.

Why is this a good time? I just got back from my doctor after having an MRI on my knee.

Now, lets be fair -- I was hoping he would find something that could be fixed. He didn't. That isn't to say he didn't find something wrong, just nothing that can be fixed. That would be Arthritis, also known as osteoarthritis.

So, I got into a talk with the doctor about injecting chicken parts into my knee, and there is a 70% chance that will work. But it isn't a long term fix of any sort. Just my luck, I need chicken parts right when bird flue is running laps around the world.

In the mean time, I just bought a home gym (commonly known as an expensive clothing rack) and will be looking for a stationary bike. Apparently some of this can be worked out through some exercises.

January 24, 2006

Unit Testing for customers

OK, here is an interesting thought. A new .NET Rocks is out today and they are interviewing Adam Cogan of SSW. He is known for having a long list of rules for developers working at his company.

This includes rules for writing rules that check dependencies like datasets, schemas, and web services. How to format code, how to respond to email. You just have to read some of them.

But there was one interesting rule that caught my eye: Menu - Do you have a standard 'Help' menu that includes a way to run your unit tests?

This is something that I haven't thought about. Letting users run your unit tests at any given time. How would this be a good thing. How many times have you had a "it works on my machine" moment, followed by a screen shot that apparently displays the problem -- but it doesn't.

But, if you can have your users run the unit tests on their machine, and you have written them in a logical fashion, you could game some valuable insight to what is wrong...without having to be on the users machine!

Now, what are the hidden requirements of this? You have to be able to distribute your unit tests, and the application that runs the unit tests as part of your executable. So NUnit is fine, but you will have some trouble with Team Systems.

I am going to have to think about this a bit more, but I am really liking the sound of this idea for many cases.

January 13, 2006

Retrieving Query Parameters in a Smart Client

OK, so there is this little cool feature in Smart Clients that allows you to start a .NET executable from a web page. You can set it up so the program is always started from the web page, or just use it as a distribution method.

I'm interested in the "only start from a web page" option.

But, this is only useful if you can pass data to the smart client from the web page. Preferable thru the URL. And guess what -- You CAN! You just have to pile through a lot of help docs to find the documentation on it.

So here is what you do.

In you program, you will need some code that looks like this:



if (ApplicationDeployment.IsNetworkDeployed)
{
// retrieve the url. It will look something like this:
// http://localhost/myapp.Application?Param=Var
string url =
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];
// do something with the url
}



Next step is to call your application through your url with a parameter attached. It will probably look like this:
http://localhost/MyApp/MyApp.Application?Param=Var

Everything after the ? is up to you. Also left up to you is parsing the url for the parameters and values.