... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2010-09-23

Heavy-Cursor Code

Heavy-cursor code refers to misplaced code that, for architectural reasons, really belongs somewhere else. It is "heavy" as in: "I know I should have put that code in another class, but I was tired and the cursor was just too darned heavy to move."

Heavy-cursor code is a software analogue to a glacial erratic. It is the enemy of separation of concerns.

2010-09-16

Intelligence

Philosophers debate the definition of intelligence. Especially when qualified by the adjective artificial.

Intelligence is the ability to achieve ill-defined goals.

Go figure.

SQL Server vs IDENTITY ROLLBACK

SQL Server 2005 and 2008 support the concept of IDENTITY columns, which are integer columns that are automatically assigned a unique sequence number when rows are inserted into the table. Each table has a so-called IDENT_CURRENT value which remembers the last IDENTITY issued.

Curiously, IDENT_CURRENT values do not participate in transactions. Thus, once an identity value has been issued, it is issued permanently -- even if the containing transaction is rolled back. This is still true even if the transaction isolation level is serializable.

This makes one wonder how identity values are generated...

Here is some SQL that illustrates the problem.

CREATE TABLE zot (x INT IDENTITY, y INT)

GO

BEGIN TRANSACTION
INSERT INTO zot (y) VALUES (0)
SELECT 'first id: ', x FROM zot
ROLLBACK TRANSACTION

BEGIN TRANSACTION
INSERT INTO zot (y) VALUES (0)
SELECT 'second id: ', x FROM zot
ROLLBACK TRANSACTION

GO

DROP TABLE ZOT

The queries show that the first IDENTITY issued was 1 and the second was 2.

2010-08-19

Patent Trolls Beware

Like many (most?) developers, I've always thought that the software patent system is broken beyond repair. But, I didn't know whether to laugh or cry when I came across IBM's patent application 20070244837, "SYSTEM AND METHOD FOR EXTOREXTRACTING VALUE FROM A PORTFOLIO OF ASSETS". It would be "laugh" if this were to be used only defensively. But "cry" seems appropriate when one reads stories like how IBM "extracted value" from Sun.

We need shed no tears for Sun which had turned to IP trolling as a survival strategy. The attempt "extracted value" (unlike SCO), but ultimately failed to keep Sun alive. Oracle is disbanding Sun units all over the place, but apparently the IP trolling department is safe.

Should Oracle succeed, I'd love to see IBM get their patent, jump in and claim a royalty along with infringement damages. Or perhaps not -- be careful for what you wish!

Blog Archive