Thursday 28 August 2008

Visual Studio 2008 code clone detective

Nice tool for improving code quality (removing redundancy). Free VS addon and it actually works, it’s quite cool. Currently available for C# only.

It works by identifying potential code duplication. Sadly it does not do anything resolving the issue at this stage, but it still helps to point out areas where code quality could be improved.

Article: http://www.infoworld.com/archives/emailPrint.jsp?R=printThis&A=/article/08/08/27/Cloned-code-finder-offered-for-Visual-Studio_1.html

Project : http://www.codeplex.com/CloneDetectiveVS

Monday 18 August 2008

Nice paging stored procedure in MS SQL T-SQL

This also demonstrates the use of the WITH heyword.

CREATE PROCEDURE [dbo].[Employee_Paged] ( @maximumRows int = 10, @startRowIndex int = 1 ) AS

BEGIN

SET NOCOUNT ON;

WITH [EmployeeByPage] AS

(

SELECT

row_number() OVER (ORDER BY Employee.Id ASC) AS rowid,

Employee.Id,

Employee.Name

FROM

Employee

)

SELECT

Paged.Id,

Paged.Name

FROM

[EmployeeByPage] AS Paged

WHERE

Paged.rowid BETWEEN @startRowIndex AND @startRowIndex + @maximumRows

END


Source: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3263486&SiteID=1

And some irrelevant links...

interesting reads:

8 ways to make money online

Startup Ideas

Friday 8 August 2008

Call .NET dll from MS SQL server - analyse query plan

This is a very well presented article which explains how we can obtain the query plan - estimated execution time for a query in SQL Server. It is also very useful because we can see in detail the process of registering and calling a .NET assembly from within SQL Server. Applies to: Microsoft SQL Server 2005 and Microsoft Visual C# .NET, but most likely will be possible to use a similar or even the same process in SQL Server 2008 and later.

http://technet.microsoft.com/en-us/library/ms345130.aspx

Friday 1 August 2008

C# code beautifier

I came across this interesting project for C# code beautification - Still haven't tested it. It seems in early development stage, but it does look promising for the future.

http://narrange.sourceforge.net/