Knoppix ready for the Desktop

I maintain a website that is used to rehome unwanted cats.
Normally I would have used windows:

  • Paintshop Pro
  • AceFTP
  • Firefox

in my course of updting pictures and text to the site.

Due to a recent hard drive failure I have yet to reinstall Paintshop pro and decided to give Knoppix a go.

The stack:

  • GIMP
  • FTP
  • Mozilla

was perfectly adequate for the job. It took a while to get used to using GIMP, but it is far more powerful than PSP 5 that I had been using.

I thought that I had a problem with accessing the photos from my camara until I found that the USB cable was not plugged into the PC.

I am amazed with how well Knoppix configures a basic PC.
It recognises and configures my soundcard automatically – something that Windows 2000 cannot do.

Performance of dynamic sql

You would expect that dynamic sql, that is a string constructed in a stored procedure and then executed would be slower than the equivalent as a stored procedure. However I was surprised to find that an application become 7 times faster by removing this.

The dynamic sql allowed the database to be accessed to be specific at call time. However at any given time only one other database was being used. By replacing the appropriate stored procedures at change over time we obtain a substantial performance benefit.

Linux equivalents to Longhorn pillars

Longhorn (the long awaited next version of windows) includes various pillars.
The major areas are:

  • WinFX – Managed OO replacement for the Win32 api
  • Avalon – vector graphics based UI expressable in XAML
  • Indigo – communication stack (web services, remoting and some COM+)
  • WinFS – The really long awaited meta-data aware filesystem

In the same timeframe the linux world has

  • Mono – Open source implemnetation of .NET Framework
  • Cairo – SVG based graphics ui
  • Beagle – personal search tool to provide the benfits of WinFS

Mono is trying to investigate implementing Indigo. However this may have licencing issues.

C# Constructors

The C# constructor syntax is odd.

MyClass : MyAncestor
{
    public MyClass(int Foo) : base(Foo + 1)
    {
       // implementation ommited
    }
}

You can’t directly call the ancestor.
However you are allowed to make manipulations on the data.
You can even invoke static methods on the class that you are creating:

MyClass : MyAncestor
{
    public MyClass(int Foo) : base(Bar(Foo))
    {
       // implementation ommited
    }

    static int Bar(int Foo)
    {
       return Foo + 1
    }
}

This does allow a certain amount of flexibility.
However since static methods cannot be virtual you can’t quite reach the flexibility of Delphi.
Delphi would allow a virtual method to be called that can set values before the inherited constructor is called. This can be very useful in some situations.For example if the ancestor is creating a font you could have a descendant choose whether the font is bold.

AJAX and IFrames

Having had a quick look at AJAX it looks strangly familiar.
It looks like I reinvented the wheel, and mine only fitted on Fords.

Last year I implemented something very similar (although IE only).
I had some status information that I needed to keep upto date on a web page but did not want the flicker associated with a refesh. So I added a 1 pixel IFrame with its own refresh interval. It used javascript and DHTML to update it’s parent frame with the new content. This looks exactly how AJAX works only it uses a http method to call and obtain an xml document.
It is amazing how things come around.

SQL Server Index Tuning : Experimental Black Art

The SQL Server Index Tuning Wizard is an incredibly powerful tool that can find amazing performance increases. There are some times when it can be a pain to get to work.

It is great when you want to use it on a given query. It makes great suggestions very quikly.

It is slightly painful when you want to tune a stored procedure as a whole. Especially when it is large and can take several hours to run. I am trying to find what you actually need to put into a trace so that the index tuning wizard will accept it as a workfile. The documentation is useful as ever – it will only tell you what you need to know if you ask exactly the right question. Anything else will drown you in useless details of other features.

Useing web service without a web reference

This article covers how to use a web service without a web reference.

The only thing that it fails to do is to recommend the creation of a descendant class to set the url.
This should be standard behaviour when dealing with autogenerated code – don’t touch it.

This allows the creation of a proxy that can have the url specified at run time.
This provides far better decoupling of the web service and gives the client the possiblility of choosing from a number of web service implementations.