Archive for June, 2007

KISS #5

This will be my last entry for a few days (probably more like a week).  I’m the scoutmaster of troop 440 and we’re attending summer camp next week so I will not have much time available to email and blogging.  However, KISS #5 happened last night while I was activating my kids Vista computer.

The whole idea is that any message, error or otherwise, needs to be understandable by the average user.  This is the main reason why Linux will not get any serious traction on the desktop.  The gear heads that use it can’t stand to dumb down the interface of their baby and the current Linux desktop experience is just to complex.  If the user has to know what a swap partition is or that a file named ifconfig even exists, then it’s too complex.  But I digress.

So last night Katie (my daughter) tells me that her computer is broken.  Thinking that’s odd since I just built it, I asked her what it’s doing.  She says it’s telling her that she needs to activate it.  No problem.  I go upstairs and activate the computer (activation might be a KISS entry at some point but not this time).  While I’m there I see an icon for Age of Mythology on her desktop.  That’s a terrific game that my son plays on the same computer.  Knowing that she never plays it and the icon was placed there because the game did an ‘all users’ install, I drag the icon to the trash.

Bam!  Kiss, right on the mouth.  :)   Let’s skip past the fact that it stupidly asked me if I really wanted to throw it away and fast forward to the next dialog which was a UAC prompt asking for my password.  Huh?  I’m logged in as Katie, looking at Katie’s desktop, and throwing away an icon that is sitting on Katie’s desktop.  And I’m not allowed to do it.  How in the world can my 11-year old understand this kind of crap. It’s hard enough to get her to understand why I had to move Sims into her profile directory to get it to run (it was attempting to write back to the program files folder).

This utterly ridiculous.  I realize that the game ran as admin and therefore the icons created by it are owned by admin however a user should have complete and total control over their own desktop.  If I want to throw away something sitting on my own desktop, Vista should have nothing to say about that.

And that, my friends, is KISS #5.  See you next week.

KISS #4

This is really too easy.  Finding stupid and idiotic things about Vista is really just too easy.  This installment is not about any type of GUI but rather with the lack of secure inter-machine remoting capability.

Here at MySQL we have several Windows virtual machines setup to perform builds and tests of both our server code and our connectors.  Our builds are automated to be sure but our build engineers still need to “shell” into a remote box to perform some functions.  As any reasonable group would, we use ssh authentication for both our Linux and Windows boxes.  The problem, of course, is that no edition of Windows has shipped with a secure shell server or client.  Our build team is left with only a few alternatives and they have chosen to install cygwin on the Windows boxes.  Considering that cygwin has only recently become stable on 64 bit systems, this was shaky at best.

Now I realize that ssh networking is cutting edge technology <grin>, but Microsoft either doesn’t realize that no one is using telnet anymore or they are delusional enough to think that no one really needs to shell to a remote command prompt.  Either way,  it’s KISS #4.  Here’s to you, Microsoft.  Keeping it simply stupid.

KISS #3

So Vista has this “great” new feature called UAC which allows a user to run as a standard user until he or she needs elevated permissions at which point the system will prompt either for an administrator’s password or for your consent if you are already an administrator.  Everyone seems to generally hate it but we seem to be stuck with it.  In any case, that’s not what this post is about.

Those of  you who are software developers know that we often need to set environment variables for ourselves.  We use BitKeeper for source control so I need a BK_USER environment variable.  I also often need to add things to my path.  So what could be wrong with this?  Oh, let me count the ways.

First, environment variables for the currently logged on user are not properties of the computer.  Computer properties would be computer name, description, performance settings, etc.  However, the first way you get to the place where you can set environment variables is by right clicking on the computer icon and selecting properties.  You can also get to it by going to your control panel and choosing the System and Maintenance area and then the System area. 

Second, getting to the area where I can set my environment variables requires no less than 4 mouse clicks (assuming UAC is active) and one screen flash due to UAC.  Nasty.

Third, because the area where we set environment settings is tucked inside a dialog that is also full of system wide settings, we must suffer through UAC just to set our own environment settings.  Let me say that again.  Your account must be elevated to administrator level to set your own environment settings.  Keep It Simply Stupid.

KISS #2

Well, I’m already behind but managed to find time to get KISS entry #2 out.  This is a fairly easy one and one that I’ve blogged about before.  Consider this screenshot of my installed programs.

image

Applying the KISS principle to software installation (as Apple generally does) would mean that a single icon would indicate that a piece of software is installed and dragging that icon to the trash would either complete the uninstall or at least start the process.  But, as we’ve already discovered, Microsoft believes in the secondary KISS meaning (Keep It Simply Stupid).  The installation of Visual Studio 2005 does not produce a single icon but instead we get a whole series of things that are installed.

What in the heck is 64 bit Prerequisites?  Sure, I know technically what it is but why on earth is it a separate item here (and please don’t give me some lame answer as it coming from a different group and being it’s own MSI).  Am I really anticipating uninstalling or upgrading that item in isolation.  I don’t think so.  Microsoft treats this list as a hard list of actual components that are installed rather than a nice, user-friendly list of applications that are installed.

Microsoft could easily have made it possible to double click an application icon in this list and see a list of components that make it up.  That list for VS 2005 might have included the prereqs, the remote debugger, the J# redist package, etc, etc.  It’s really quite comical to read the setup instructions for new beta builds of Visual Studio and see that you have to remove previous beta bits in precisely the right order or things might not work right.  The list of things you have to manually remove is huge.

The whole idea behind software package management is that you can at least attempt to remove any package and, if it succeeds, your system is still in a usable state.  Try removing the 64 bit Prerequisites.  It will genuinely attempt to uninstall even though doing so would leave Visual Studio still installed but crippled. 

Simply stupid.

Long overdue…

Way back in February I gave a webinar on using our Visual Studio integration product with MySQL.  At the time, our code did not integrate very well with the TableAdapter wizard.  To be precise, you really couldn’t use stored procedures with a table adapter at all.  During the broadcast, someone asked me about using stored procedures and I told him that I would blog about it once I got it working.  Well, here we are.

Actually, we’ve had it working for a couple of weeks now but I’m just now getting to the blog post.  You know how it is.  There were several problems at play here but the biggest issues were the fact that we needed to provide an enumerator object for columns that would be returned by a stored procedure.  The second issue was needing to use the DbProviderSpecificTypeProperty attribute on our provider specific type property on the parameter class.  Let’s look at each one of these in more detail.

During the TableAdapter wizard, there is a page where you select the procedures you want to use for each operation (select, update, insert, and delete).  Once you choose the procedure for the select operation, the wizard wants to enumerate the columns that will be returned from this procedure.  It does this because, later, it will want to map parameters to the other procedures to these columns.  To support this, we needed an enumerator object.  MySQL doesn’t have the ability to execute a procedure but only return the metdata without making any other changes.  Therefore, when we execute the procedure to return the metadata, any other changes the procedure makes will happen.  So it is important to not do anything in this procedure except return the required columns.  Don’t write any logs, update any counts, etc.

The second issue was the wizard was unable to properly determine the types of the parameters.  This is typical Microsoft since the provider includes a parameters schema collection that provides all this information.  That’s too easy.  Instead the wonderful designers at Microsoft created a new attribute named DbProviderSpecificTypeProperty.  This allows the wizard to reflect on the parameter class, determine what property should be set with the provider specific type value, and set it.  It could have  used the generic DbType property but I guess that’s just too easy.

So, to sum up, Connector/Net 5.1.2 now includes the full ability to use stored procedures to manage the data in a datatable or dataset.