Overclocking Pentium 840 D

I’ve done some naive overclocking of my watercooled 840 at 3.6Ghz at 40, which is about the temperature it was running before overclocking– This is run UD agent as the load.

This article says they overclocked the 840 at 3.5Ghz at 70 degrees, but says water cooling can get you to 3.7 or 3.9Ghz

This article reports instability at 77 degrees at 4.0Ghz. They said 3.8Ghz runs fine with an air cooler.

This article reports stable at 4.04Ghz with a water cooler and 3.8 without a water cooler.

This article reports stable at 4.0Ghz with a quality air cooler, and instablity at 4.2Ghz.

This article reports stable at 3.7/3.8 air/water and instable at 4.4 water cooled.

Here is an opinion that the maximum temperature for 840 is about 70 degrees

Intel says the 840 should be at most 69.8 degrees.

Setting a database to Read Only

If you set a SQL database to read only, SQL doesn’t have to lock pages.  This is good for performance.  This should mean more people can query the same tables at the same time.  This is good for concurrency.

Of course to use a RO strategy, you will have to turn on RW at least during periodic data loads.

However, to change to Read_Only, no one can be connected.  If have to wait, you might end up waiting until 2AM in the morning until the database is quiet.  If you forcably kill the connections, you will invalidate any pooled connections or connections that haven’t gone out of scope.  There are half a dozen places where things that are connection pooling or things that act like connection pooling occur, in ADO, ASP, ODBC, etc.  To avoid invalidating connection in a pool, you need to either drain the pool (a method that isn’t available in some of these API’s) or wait until the pool is drained, which may take a very long time.

Another possiblity is just letting users deal with the error message they see when their webpage tries to use an invalid connection.  This allows for a mid-day RW/RO switch.
Another possibility is to do data loads unattended in the middle of the night.  This might work for some shops.  That way the RW/RO switch can be done when the database is quiet.

Actually trying to use MS-Words HTML editing is not a good idea

I was determined to use MSWord for my website’s frontpage.  It was a time consuming determination.

Here is some advice in case you are crazy enough to try it:

Enable the view script icon. (You have to add it to the menu bar, then enable view script, then double click on the script icons to edit the script)

Set up a custom php.ini file which overrides default php.ini.  It needs to say asp_tags=1.  This will allow you to use the < script language=php > tags. Without these tags, Word will reformat your php turning it into a mess you can’t read and the interpreter will reject.

Set up tables with relative measures (20% of screen, etc)

Links should be full URLS.  Word gets confused with relative URLs.  Normally relative URLs are a best practice, so that you can move your website around without changing every link.

Turn off smart quotes, dont use the single character version of … or the single character em-dash from word.  They don’t always show up correctly in HTML browsers.

The HTML is still a mess.  One solution is the Microsoft tidy tool.  One solution is HTML tidy.  One other solution is a PERL HTML tidy script.

Here is some explanation on why MS-Word HTML looks so screwy.  Manually tidying a Word document is not worth the effort, unless it is a one time conversion, not very useful if you intend to do any further work in MS-Word.

Also, use the Styles feature of Word.  In case you don’t use styles, a style is a bundle of font family, size, weight, etc.  If you don’t use a style, word will wrap every single paragraph with bulky formatting code.  If you use styles, Word will use CSS and merely wrap every single paragraph with a named CSS style, which is a better practice.

Building a computer, Part II

Last time I posted my part list.  After putting this and that together over a course of a couple of evenings, I spent most of a day assembling the rest of the computer.

Blood.  So far the only blood was from the over sharp and spiky PCI slot covers.

Sweat. The water cooling gaget quadruples the difficulty of buidling the computer.  I there wasn’t enough room in the case for the pump, there wasn’t a suitable place to mount the radiator.  The tubes take up so much space I’m worried I won’t have a PCI slot left over for the sound card.
Tears.  The machine is DOA. No POST beeps, no fans spinning. Only brief blinks of the HD and power LED’s on powerup and a green standby light on the mother board.  And that is it.  I probably still don’t have the speaker connect correctly, or I damaged it by plugging it in backwards.
Advice from the web is is to disassemble and reassemble.  Sometimes that will work, implying a talentless power connection or a random short.
Assemble and reassemble while testing with power at the minimum number of devices (enough to get video out) and then adding devices until the bad device is found.
Here are some techology comments:

Dual SLI  requires a huge case.  The cards are huge to start with.  They take up the space of four PCI slots and make it impossible to reach most things inside the case.  Other than that, installing a graphics card was one of the easier tasks.
CPU. Installing the CPU is nervewracking. You alternate betewen instructions that say becareful, use no force!, the slightest touch will destroy the device! and instructions that say you have to apply a lot of force to clamp things in place–once for the cpu and then again as you clamp the cooling device onto the CPU.

Water Cooling. The water cooling device has leak points inside the case.  This is really unacceptable.  The clamps have to be leak proof for 8 years.  I’m thinking about my sinks–they can’t stay leak proof for 8 years.  In my set up, a leak would destroy $400 of graphics cards $100 of audio cards and a $100 mother board, and probably the $200 CPU, or 1/2 the cost of the computer. There are not suitable places to mount a radiator, there are not suitable ways to get the tubes out of the case and there is nowhere to put the pump, not internally or externally, especially if you have dual cards.  I used the fan mounts to mount the radiator, which I suspect will destory airflow.
Cabling. The cabling is a nightmare.  I have real respect for the craftsmanship of builders who can keep their cables undercontrol. I think controlled cabling requires longer cables.  Many of my cables seemed like they could only reach

Documentation. It varied from vender to vender. The worst was the case, which seems to have included a big bag of random screws and washers and had no advice on where we expected to use the different types.  This lead to some rework.

Updating a bazillion rows in SQL

It takes a long time to update 27 million rows.  One strategy I used– bcp Export the table to text, write a .NET program to read each line in, update the relevant column, write back out to a file, BULK import & voila.  Works only if no one is updating your big table during the time between the bcp export and bulk import.

If you have to do it in sql, I recommend doing a UPDATE TOP x, so that the update is done in batches of 50000 or so.

Computer Books

1) They are #$%@ expensive.  And heavy.  And take up lots of shelf space.

2) You have to buy a continual stream of them to remain competent in the field.  They get obsolete fast.

3) The library tends to lag technology and aims at home users rather than power users and programmers.  Plus, two weeks isn’t enough time to do much with a library book

One option is eBooks, which are sometimes sold at full price (no discount over the tree version!).

Right now, I’m interested in the Safari book subscription.

Why SQL SMO is so damn exciting

SMO is a .NET API for manipulating everything about SQL Server except data and result sets–ADO.NET exists for that. In otherwords, SMO is an administrative API. It allows you to backup and manipulate databases with .NET error handling, .NET syntax, .NET unit tests, ,NET looping, etc. instead of the primitive constructs available in T-SQL for general purpose programming.

1. You don’t have to buy SQL 2005 to use it. You can use it with SQL 2000 and the SMO objects can be downloaded for free from Microsoft. In fact, you could even use it with the free SQL Express and the free Visual Studio Express editions.

2. One admin script for both SQL 2000 and SQL 2005. Typical admin scripts use system stored procedures, system tables and these have changed radically between 2000 and 2005. In my case, almost 100% of the scripts in my admin database were broken in 2005. SMO abstracts away the differences between these two. Plus, SMO is more likely to support the next version of SQL, “Katmai”, than the equivalent T-SQL script.

3. You get to use a real programming language, with full access to the .NET library. Plus to get the use of .NET, you don’t have to run the script in the embedded SQL CLR, you can run an SMO script as a .exe file.

4. You can still issue SQL commands in a SMO script.

5. You can use .NET mail instead of trying to call CDONT or CDOSYS from inside a stored procedure.

Software Review: Free MS-SQL DB Documentation Generation

SchemaSpy is a free database documentation generation tool.  It uses Java and JDBC to gather schema information.  The output is a browsable website for each database. It generates ERD’s if you have Graphviz installed.  It also supports a large number of other databases, (important for me, SQL 2005).  I haven’t figure out how to get intergrate security to work, but it does appear to work with just a user in the db_datareader role.

SQL 2000 Read Only Databases

1. The misleading “Can’t issue a BEGIN TRANSACTION statement” error– I’ve seen this error from an ASP page. You can issue BEGIN TRAN/COMMIT TRAN on a read only database as long as you only do SELECT and the like.
2. Obviously can’t update anything– no INSERT, UPDATE, DELETE
3. All users must be disconnected before switching to or from READ_ONLY.

The need to disconnect all users to go from READ_ONLY to READ_WRITE is possibly the issue that will prevent READ_ONLY from being used more often, because even a datawarehouse needs to be loaded from time to time and kicking off all users is a bit hostile.

Nevertheless, if the database is usually read only and you can predict when some one is writing to it (like for a monthly data load), then it should be safe to kill open connections (except for connection pooling, see below), and the switch over is instantaneous. Another exclusion would be for stateful windows clients that hold connections open for a long itme. Another option is to patiently wait until the end of the work day when everyone has gone home.
Sample Code:

– To RW
– To RO

ODBC is rather dim witted when there is a bad connection in the pool. Instead of checking the connection and discarding it and opening another one, it assumes the server is down, the sky is falling and then it sits on it’s ass for two minutes waiting for the server to come back up. In the meanwhile, the user gets an error message. This happens if when we forcably close all the connections (WITH ROLLBACK IMMEDIATE).

The work around is to disable connection pooling. This will cause a small performance hit, which may or may not be equal to the performance gain you get with moving to a READ_ONLY database.

Application(“ConnectionString”)=”DSN=mydb;OLE DB Services= -2