Tuesday, July 25, 2006

फुलले रे ...

फुलले रे क्षण माझे फुलले रे
मेंदीने, शकुनाच्या, शकुनाच्या मेंदीने, सजले रे क्षण माझे सजले रे

झुळूक वार्‍याची आली रे लेऊन कोवळी सोनफूले
साजण स्पर्शाची जाणिव होऊन, भाळले मन खुळे
या वेडाचे, या वेडाचे, नाचरे भाव बिलोरे
मेंदीने, शकुनाच्या मेंदीने, खुलले रे क्षण माझे खुलले रे

ओढ ही बेबंद, श्वासात, ध्यासात, स्वप्नात येणे तुझे
भांबावल्या माझ्या उरात, स्पर्शात रेशिम काटे तुझे
मनमोराचे, मनमोराचे, जादूभरे हे पिसारे
मेंदीने, शकुनाच्या मेंदीने, हसले रे क्षण माझे हसले रे

प्रीत ही, प्रीत ही उमजेना
जडला का जीव हा समजेना
कशी सांगू मी, कशी सांगू मी
माझ्या मनीची कथा रे
मेंदीने, शकुनाच्या मेंदीने, भुलले रे क्षण माझे भुलले रे

Thursday, July 20, 2006

Mate with two bishops

The last pawn was taken on 54th move.
It took me 14 moves to mate the white king.
To play through the chess game, visit chesshere.

Here's the PGN...

[Event "Team Game"]
[Site "chesshere.com"]
[Date "2006.01.02"]
[White "shakkiipe"]
[Black "Gabbar"]
[Result "0-1"]
[WhiteElo "1453"]
[BlackElo "1505"]

1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 5. d3 O-O 6. Bg5 h6 7. Bh4 a6 8. Bxc6 dxc6 9. Nxe5 Qd6 10. Nc4 Qf4 11. Bg3 Qg5 12. O-O Bd4 13. Qf3 Bg4 14. Qf4 Rac8 15. Qxg5 hxg5 16. e5 Nh5 17. Rfe1 c5 18. Re4 Bf5 19. Ree1 c6 20. a3 b5 21. Nd6 b4 22. axb4 cxb4 23. Nxc8 Bxc8 24. Nd1 f6 25. e6 Re8 26. e7 Bc5 27. c3 Rxe7 28. Rxe7 Bxe7 29. Ne3 c5 30. Nd5 Bd8 31. cxb4 f5 32. h3 Nxg3 33. fxg3 cxb4 34. Nxb4 a5 35. Nc6 Bb6+ 36. Kf1 Bd7 37. Nxa5 Bd4 38. Nc4 f4 39. gxf4 gxf4 40. Ke2 g5 41. Ra8+ Kg7 42. b4 Bc6 43. Rd8 Bf6 44. Rd6 Bxg2 45. Rd7+ Kg6 46. b5 Bxh3 47. b6 Bxd7 48. b7 f3+ 49. Kf2 Bd4+ 50. Kxf3 Bc6+ 51. Kg4 Bxb7 52. Nd6 Ba6 53. Nf7 Kxf7 54. Kxg5 Bxd3 55. Kf4 Kf6 56. Kf3 Kf5 57. Kg3 Be4 58. Kh4 Be5 59. Kh3 Bf3 60. Kh4 Kf4 61. Kh3 Bf6 62. Kh2 Kg4 63. Kg1 Bh4 64. Kf1 Kh3 65. Kg1 Be2 66. Kh1 Bg5 67. Kg1 Be3+ 68. Kh1 Bf3# 0-1

Wednesday, July 19, 2006

How to access COM assembly from SQL CLR procedure

Question:
How to access COM assembly from SQL CLR procedure

Gabbar:
1. ALTER DATABASE [MyDatabase] Set TRUSTWORTHY ON
2. CREATE ASSEMBLY VSS FROM 'C:\Microsoft.VisualStudio.SourceSafe.Interop.dll'
WITH PERMISSION_SET = UNSAFE
3. Now, in the add reference window, this dll is visible.
4. Build and Deploy from buid menu option

The catch is, there are 3 permission levels for create assembly
1. SAFE - default mode - cannot access extrnal resource (files/folders)
2. EXTRNAL_ACCESS - can access extrnal resource (files/folders) bu not COM dlls.
3. UNSAFE - can do everything in the world including reference to COM dlls.

The naming of these options...SAFE, UNSAFE doesn't convey much.
But that's true for many microsoft things. :o(

Monday, July 17, 2006

Assembly not found in SQL Catalog

I don't believe this. Searching for my second day now.
All I want to so is create a CLR stored procedure which can access VSS on my own machine. I'm running into this when I try to deploy...

Assembly 'microsoft.visualstudio.sourcesafe.interop, version=5.2.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' was not found in the SQL catalog.

Is it possible that only a limited pre-listed assemblies can be used for reference in a CLR procedure?

Here's the solution...

Monday, July 10, 2006

New and Improved askGabbar

Let me know if you like the new look of askGabbar.

Tuesday, July 04, 2006

Most used indexes in SQL Server 2005

Question:
How to find mostly used indexes in SQL Server 2005?

Gabbar:

SELECT TOP 5 total_worker_time/execution_count 'Avg CPU Time',
SUBSTRING(st.text, (qs.statement_start_offset/2)+1,
((CASE qs.statement_end_offset
WHEN -1 THEN DATALENGTH(st.text)
ELSE qs.statement_end_offset
END - qs.statement_start_offset)/2) + 1)statement_text
FROM
sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
ORDER BY
total_worker_time/execution_count DESC

This is copied from http://www.databasejournal.com/features/mssql/article.php/3608296

Un-used Indexes in SQL Server 2005

Question:
How to find un-used indexes in SQL Server 2005?

Gabbar:

SELECT
    o.name,
    i.name
FROM
    (
    SELECT
        x.id,
        x.indid
    FROM
        sys.dm_db_index_usage_stats us
        join sys.sysdatabases d
            on us.database_id = d.dbid
        join sys.sysindexes x
            on us.object_id = x.id and us.index_id = x.indid
        join sys.sysobjects o
            on us.object_id = o.id
    WHERE
        d.name = 'YourDatabaseName'
        AND o.xtype = 'u'
    ) used
    right outer join sys.sysindexes i
        on i.id = used.id and i.indid = used.indid
    join sysobjects o on o.id=i.id
WHERE
    o.xtype = 'u'
    and used.id is null