Ernst Kuschke

     Arbitrary thoughts and musings on life, the universe and everything else

Syndication

News

    ernst kuschke (v1.0)

    My Photos

    Microsoft Most Valuable Professional

    Member in good standing

    View Ernst Kuschke's profile on LinkedIn

    Add to Technorati Favorites

Blogs I read

Books I recommend

General Links

May 2006 - Posts

There's been a cool (I found it interesting) discussion on converting a comma-delimited string of int values into an int array lately. Gregory posted the details here.

The discussion carried forth to declare an inline method, instead of delegating to intToString, which seemed even more elegant: (the method was now only one line!)


int i[] = Array.ConvertAll<string, int>(commadelimitedInts.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries), new Converter<string, int>(delegate(string inVal) {
return int.Parse(inVal); } ));

There's in fact a better, more elegant way to do this than my inline method (thanks to colleague Piers!):

int i[] = Array.ConvertAll<string, int>(commadelimitedInts.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries), new Converter<string, int>(System.
Convert.ToInt32));

Why not use the methods provided by the framework? :-)
Posted by Ernst Kuschke | 2 comment(s)
Filed under: ,
Visual Studio 2005 consumes some serious memory, and sometimes takes quite a while to load big solutions. To speed up the load of a solution, minimize Visual Studio to the taskbar while the solution loads. It just works.
Posted by Ernst Kuschke | with no comments
Filed under:
I found it interesting that the 1st hit on MSN search for "Anonymous delegate" was Alcoholics Anonymous Delegate Area 26 Website...
Posted by Ernst Kuschke | with no comments
Filed under:

Here's a handy little script for killing open connections to a database in SQL Server:

USE

[master]
GO

IF

EXISTS (SELECT [name] FROM sys.databases WHERE [name] = N'YOUR_DATABASE_NAME')
BEGIN
   
DECLARE @spidstr VARCHAR(8000)
   
DECLARE @ConnKilled SMALLINT
   
SET @ConnKilled = 0
   
SET @spidstr = ''

   
IF DB_ID('YOUR_DATABASE_NAME') < 4
   
BEGIN
       
PRINT 'Connections to system databases cannot be killed'
       
RETURN
   
END

   
SELECT @spidstr = COALESCE(@spidstr, ',') + 'kill ' + CONVERT(VARCHAR, spid) + '; ' FROM master..sysprocesses WHERE dbid = DB_ID('YOUR_DATABASE_NAME')

    IF LEN(@spidstr) > 0
   
BEGIN
       
EXEC(@spidstr)
       
SELECT @ConnKilled = COUNT(1) FROM master..sysprocesses WHERE dbid = DB_ID('YOUR_DATABASE_NAME')
   
END

    PRINT CONVERT(VARCHAR(10), @ConnKilled) + ' Connection(s) killed for DB YOUR_DATABASE_NAME'

END
GO

Posted by Ernst Kuschke | with no comments

The UMPC is a new toy that we might start seeing around soon. Quick summary of what's packed:

  • Windows XP Tablet PC Edition 2005 OS
  • Approximately 7” diagonal display (or smaller)
  • Minimum 800 x 480 resolution
  • Approximately 2 pounds
  • Integrated touch panel
  • WiFi- and Bluetooth-enabled
Posted by Ernst Kuschke | with no comments
Filed under:
A cool feature of Word 2007!
Posted by Ernst Kuschke | with no comments
Those of you who code in VB (not that there are many, of course!) might be happy to see this Refactoring Tool suported by Microsoft.
Posted by Ernst Kuschke | 1 comment(s)
Filed under:
The J# redistributable libraries, vjslib.dll, contains amongst others two areas of functionality that is very commonly looked for:
I often see people using third party tools just because no one knows about this - in fact, these are so often needed that I think it would make sense for Microsoft to include them in the .NET Framework.