Multi Touch Sensor
Looks like the answer to the bad mouse experience is here. This thing is multi point and pressure sensitive.
9:28pm, November 17th, 2006
Looks like the answer to the bad mouse experience is here. This thing is multi point and pressure sensitive.
9:28pm, November 17th, 2006
I was just checking phone prices in HardwareZone Singapore and I was thinking…
Wouldn’t it be nice to have prices in Sri Lankan rupees?
With the power of Firefox and Greasemonkey that’s what I did.

You can install the HardwareZone Greasemonkey Script here.
You too can customize your web experience using Greasemonkey. You can learn more about Greasemonkey at Dive Into Greasemonkey and share and find more useful scripts at Userscripts.org.
Update: Added this script to Userscripts.org
7:46pm, November 17th, 2006
Almost all SQL Server database developers know this issue, in other word, limitation. You cannot insert values lower than 01/01/1753 into datetime column. Do you know the reason? I was unaware of this reason but yesterday, one of my friends (He insisted not mention his name :)) explained me one of possible reasons. And guess what, it is not a technical reason, it is historical reason.
You might know that there had been two calendar types; Julian and Gregorian. When the people who used Julian decided move to Gregorian, they had to skip couple of days (10 to 14 days). This was happen around 1752. Because of this, the dates earlier than 1753 are different from country to country and have to maintain different procedures for different countries (or cultures) if the system need to support for them. That’s why SQL Server treats 01/01/1753 as the earliest date.

8:46am, November 15th, 2006
2:35am, November 13th, 2006
Is new datatype introduced? Is it just like varchar? I thought yes. But it is not. Vardecimal is a storage format, not a datatype. Because of that it is not available for columns when design tables. I have been trying to find what it is, yes after Gogula's comment for my one of previous posts. Finally I figured it out how to use it; see the sample code I used for testing.
-- create a table with decimal column
CREATE TABLE TestTable
(ID int IDENTITY(1,1) PRIMARY KEY, Number decimal(20,3))
GO
-- insert some values
DECLARE @i int
SET @i = 1
WHILE @i < 100000
BEGIN
INSERT INTO TestTable
VALUES (rand()*1000000)
SET @i = @i + 1
END
-- check the space used for table
sp_spaceused 'TestTable'
-- result
-- reserved: 2632KB
-- data: 2576KB
Since vardecimal is a storage format, it cannot be set it to column itself. It has to be set for; first database and then table. But before all of these, it is possible to check whether the size reduction after enabling the format is really a worth enough.
-- check the estimated reduction for the row.
sys.sp_estimated_rowsize_reduction_for_vardecimal 'TestTable'
*Note: BOL shows the name of SP as sys.sp_estimate_ro... . Make sure you use it as sys.sp_estimated_ro.... .
-- result
-- avg_rowlen_fixed_format: 24.00
-- avg_rowlen_vardecimal_format: 17.98
The result tells us that the row size can be reduced by 25%. Isn't good? Yes, It is worthwhile to change the storage format of decimals. Enable it on the database and then the table.
-- enable the database for vardecimal storage format
sp_db_vardecimal_storage_format 'TestDatabase', 'ON'
-- enable the table
sp_tableoption 'TestTable', 'vardecimal storage format', true
Done. Lets check the space usage again.
-- check the space used for table
sp_spaceused 'TestTable'
-- result
-- reserved: 2248KB
-- data: 2176KB
Great. We just saved the disk space. And this is just for 100000 records. If you have millions of records with decimal values, Then it is high time to set this. Note that it is better to check the size reduction estimate before enabling it on the table because it might give you an unexpected result.

8:10am, November 11th, 2006
11:26am, November 10th, 2006
3:04am, November 10th, 2006
Had a chance to check this new trigger, wow it's cool and worked fine for me. This fires only after the authentication process is completed but before the session is estabilished. This is what I wrote to test this new trigger, it checks and accpets only windows users not SQL users.
CREATE TRIGGER ValidateLogon
ON ALL SERVER FOR LOGON
AS
BEGIN
IF EVENTDATA().value('(/EVENT_INSTANCE/LoginType)[1]', 'nvarchar(100)') != 'Windows (NT) Login'
BEGIN
ROLLBACK
END
-- only for Windows login
-- INSERT INTO TestTable VALUES (EVENTDATA())
END
I wanted to execute the INSERT statement even for SQL login but seems it is not executed if ROLLBACK is fired; because it is the original implicit transaction?

12:58am, November 10th, 2006
I just setup something called a World Wide Web Sri Lanka (W3LK) group. It seemed like a good idea at the time. About 17 web designers and web developers signed up pretty fast.
We’d like to improve web experience for Sri Lankan’s.
Join us and have your say.
10:11pm, November 8th, 2006
So I’m moving from this … (boring)

to this … (shiny)

Its a bit too late to show the kids in school but I’m blogging this. I’m trying to break away from the geek-with-a-notebook-bag to a more back-to-school look. I always wanted a bag like this when I was going to school. I know I’m older now but this thing is cool and I’m not sending it back.
The notebook bag was a pain on the shoulder and you can’t stuff too much stuff in it. Sometimes I chug the company notebook in there too then I wish I had desktops at home and office.
I love the Swiss Army brand and as far as bag-bling goes the Wenger Rival is shiny. It has a padded pocket for the notebook and many more pockets I haven’t figured out what to do with yet. See more pictures here.
5:43pm, November 8th, 2006
If you have used “SQL Server Scripts” project templates for maintaining scripts for databases, you must have noticed that order of the queries are not ordered (either ascending or descending). If you add a query to the project, it will be added to the end of the list. I used to manually change the order of added quarries by opening project file through one of text editors but as it is a painful task, most of the time, I didn’t do it.
When I open one of my projects today, I wondered, at last, list is automatically sorted. How did it happen? Yes, this is after installing CTP for SP2.
But it is not as smart as I thought. When I add a new query, it is added to correct place in the list (again, there is no way of giving the name of the query when adding so it is always “SQLQuery….”), but once it is renamed, it does not adjust the order of the list. Hope we will see the fix soon.
Saw two new menu items for table objects; Edit (If I am not mistaken) and Reports, Edit creates the table CREATE script, Reports does: No idea yet.

5:57am, November 8th, 2006