30 Jan 2006
I had optimized a delete sproc as much as possible using WITH (ROWLOCK) and all the other performance tricks I could find. Showing Execution Plan in Query Analyser shed no light on the problem - it reckoned the delete was putting little load on the server. However, deleting 500 rows from a table was taking 40 seconds!
Turns out that if you have referential integrity set up between your tables (i.e. foreign key relationships with Foreign Key Constraints enforced), you need to ensure that all foreign key columns in your tables have an index. Otherwise, when you delete a record from a primary key table, referential integrity checks will cause table scans on the referring foreign key tables - and scans are terribly slow compared to index lookups. Sure enough I had neglected to put an index on one of the referring tables; when fixed the same query took less than 2 seconds.
CustomerID (Primary Key)
OrderID (Primary Key)
CustomerID (Foreign Key - Relationship with Customer table - THIS FIELD SHOULD BE INDEXED)
Order Details etc.
18 Jan 2006
The new phone seems pretty good so far. Just wanted to share with you something I've observed with it when trying to copy files to it via USB from Windows 2000.
Basically, don't try to access the MP3 tracks on the phone while the cable is connected to the pooter. Otherwise weird stuff happens, like tracks going missing. Here's how I transfer without problems:
1. Connect phone to computer via USB.
2. Copy tracks to phone either using Disc2Phone or Windows Explorer (the latter is quicker I reckon)
3. Use "Unplug or Eject Hardware" in the Windows taskbar to safely drop the connection.
4. Remove the USB cable from the phone.
I'm guessing step 3 won't be required on XP, but haven't tested it yet.
8 Jan 2006
So I did a bunch of googling but the best solution I could find is just to create a new mail profile (in Control Panel > Mail), fill in all the bleedin' POP3 account details again and then add my old PST file with all my mail in it. You do that in Outlook - Tools > Options > Mail Setup > Data Files > Add. Then you have to set the old PST file as your default delivery location: Tools > Email Accounts > View / Change Existing Email Accounts > Deliver New Mail To The Following Location.
Only then can you delete the new PST file, smoke a doobie and pretend none of this crap ever happened. As ZZ Top said - "have you heard... what's the word??? It's Thunderbird".
6 Jan 2006
So what is it? Basically it's a USB soundcard in a snazzy red case, with phono outputs, a headphone output, a line-in and most importantly - an input for an electric guitar (or microphone or whatever). That's not the clever bit - the clever stuff is the bundled software that processes the guitar input and makes it sound like I'm playing through a giant marshall stack with a grand's worth of effects pedals at my feet.
Really, for the money it is excellent - umpteen different amps modelled, a bunch of stomp boxes, a noisegate, a metronome and a tuner all united on a sweet computer interface that you control with just your mouse. For me with wife and tiny baby, being able to get a good sound without cranking up an amp is really cool. Headphones are fine - and if I want I can stick it through my stereo too.
Anyone considering purchasing one may have some questions like I did, about what else you need to run it an such. Well, because it's a soundcard in its own right all you really need is:
- Computer with Win98-ME-2000-XP (I use a 1.8MHz laptop with 1Gb of RAM)
- Guitarport Sound Engine software (included)
- USB cable to GuitarPort (included)
- GuitarPort (obviously :)
- Electric guitar cable
- Electric guitar
- Headphones (they plug into the GuitarPort, not the computer)
That's the super-slimline basic requirements. Other than that you could run a cable from the line-out of your computer (if you have one) to the line-in of the GuitarPort; That would let you mix the computer's sound output with the modelled sound output of your guitar. Another groovy thing about it being a soundcard is that you can select it as an input in some recording software (e.g. the excellent and free Audacity) and record your rocking new sound.
Good job, Line6!
4 Jan 2006
Now ASP.NET only really allows us to use one form (without nasty hacks) on a page, we have the problem that any submit button is potentially the target of the Enter key.
I did an ASP.NET 1.1 site where I had to solve this prob and used the MetaBuilders solution: http://www.metabuilders.com/Tools/DefaultButtons.aspx
Well, I just found out that the Panel object in ASP.NET 2.0 has a DefaultButton property which applies to all the child inputs of the Panel. Lordy loo.
3 Jan 2006
Here's how I did it:
1. Create a method e.g. LoadControl() to load the control.
2. Create the OnClick() handler for the button that initially loads the control onto the page, and wire it to LoadControl();
At this point, the control will appear in response to the OnClick() method, but will disappear again when you try to handle any further events that the control creates. This is because the control is only created in reaction to OnClick, not by the postback from the control. So....
3. Place code in the Page_Load() or OnLoad() method to call LoadControl() if certain postback criteria are met e.g. IsPostBack and detect some property of the dynamically loaded control from the postback.
4. And here's the bit that took me ages to track down - ensure you have given an explicit ID to every input of your dynamic control including buttons. Otherwise .NET will generate its own ID which may be different between requests, hence causing missed event handling.
Pretty obvious really, but I, as the Lancaster Bomber used to say, "had a cold". Ho ho ho.