March 23, 2006

Trinity is Crawling

OK, this is not a programming related post. My bad, get over it.

But, my youngest daughter, now 10 months old just started crawling. Even better, I just caught the entire thing on tape. This is a momentous event, for all of you without kids and don't know better. This means the games have begun.

From the time a child starts crawling it is as if a silent gun has shot off for an Olympic 100 meter dash. Another analogy would be for a back woods car race. Doing the dashing is the parents and the baby, each trying to out maneuver each other to the best lanes. Unfortunately only the baby knows where those are, and it is up the parent to find them out -- preferably before the baby does.

How is the baby going to get to the stairs (we have lots of them), which electric sockets are exposed, which of the older kids toys are chocking hazards, etc. You see, this isn't something you can do once and you are good for life.

In the world of computer security, people are always wishing for more security, but gripe to high heaven when they have to enter a new password. It is annoying. Same with child proofing a house. Yes you can do it. But all of the stairway gates, drawer locks, and electric socket covers get really annoying really fast. So as soon as your kid gets old enough -- off they go! Of course, that is also when you find legos jammed in the electric sockets...again. So when the next baby comes around, there you go again. Reapplying old security fixes, and adding new ones.

That is enough analogies for one night.

March 13, 2006

Funny: best languages to learn

The best writing, to me anyway, is usually 1. something that you can learn something from, 2. funny, and 3. pragmatic.

This blog entry is all three with a discussion on the best languages to learn:
http://www.cabochon.com/~stevey/blog-rants/tour-de-babel.html

The only fault that I have: it doesn't list Delphi or C#. :)

March 11, 2006

Winforms 2.0: Application Settings

OK, I'm defiantly getting behind the times. But in my defense, I don't get many chances to use WinForms these days -- I'm still waiting for my great excuse to use Click-Once.

What did I miss all this time: Application Settings. This is not entirely new, we have had app.Config for a long time now, and the Settings class/designer uses the app.Config.

Couple of differences though:
  1. It is type safe. You add a property thru the designer, then you can access that value thru its property. Nice. (I'll show more on this in a minute)
  2. You can change the values, and there is a Save method!
  3. There is a setting for User vs. Application settings
Other items worth knowing: it can save any data that serializes to XML, but has problems with null data.

To add a settings class to a C# project: Right click on the project (like you do to add a class or a form), select Add->New Item.... Then select Settings File from the bottom of the list, and give it a name -- I called mine Settings1.

That produced a file called Settings1.settings in the designer.

To access the properties stored in the settings class, I use Settings1.Default..

Also, you can access the code behind the designer for the settings object. Be warned, it is generated code, and it will get overwritten from time to time.

There are some differences between the VB version of this and the C#, but those are documented in the source. The main difference is that the settings class is included in the My object, and C# has to use the method shown above. This is complicated by the fact that most of the documentation seems to cater to the VB crowd.

One final note that has to be looked into. All of the settings in the Settings class are ultimatly stored in the app.config file. Application level settings are stored in the node, and user settings are stored in the node.

Now how does that work for multiple users?

March 08, 2006

ClickOnce in FireFox

OK, here is something I have been waiting for: an article detailing how to run a .NET 2.0 ClickOnce application from FireFox.

http://blogs.msdn.com/saurabh/archive/2006/03/02/541988.aspx

We are going to have to see a presentation on this one at the local user group meeting, me thinks.

March 07, 2006

FireFox 2.0 with Spell Check

So the Alpha 1 of FireFox is supposed to be out this week. The big feature that I am looking for: as-you-type-Spell-Check.

Sure there are other cool features: better rss/atom support, tab enhancements, blah-blah-blah -- SPELL CHECK -- yay, yay!

Things that are not there: built in bittorrent would be nice. So would built in pod-cast support. Oh well, that is what extensions are for.

February 16, 2006

Advantage Database Server goes .NET 2.0

In the long list of technologies that I have been meaning to work with, but haven't had the time yet, is Advantage Database Server. You can get it for free, light-weight, native SQL support, and available from their DevCenter and they have been good about supporting our local developer groups.

And now, it has a native .NET 2.0 data provider.

Check them out: http://www.advantagedatabase.com

February 14, 2006

ASP.NET: AJAX with Anthem

OK, here is my take on AJAX at this point in history: a lot of talk, a lot of work, and little reality.

But, I have found one library that I actually like for doing AJAXy stuff: Anthem
http://jason.diamond.name/weblog/2006/01/31/anthem-100

Why do I like this one: it is easy to implement. They didn't go out and recreate a bunch of controls, but inherited the existing standard ASP.NET control library. So if you want a AJAX dropdownlist instead of a standard dropdownlist, change your asp:dropdownlist to an anthem:dropdownlist; or, my personal favorite, change your asp:calendar to an anthem:calendar (no more full post backs just for selecting a day).

OK, there are a couple of other steps involved, but all told it amounts to 4 extra lines of code, and there is a nice set of samples to tell you everything involved.

Did I mention this is an open-source source forge project?

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.