devxlogo

August 20, 2002

Remove Duplicates from Delimited String in T-SQL

Use this snippet to remove duplicates from a delimited string: DECLARE @mystring varchar(1000), @myword varchar(50),@CachedStringvarchar(2000)set @CachedString=”DECLARE @i int,@j intSELECT @mystring = ‘cat dog fox cat chicken hen goose cat bird

Get the Deep Copy of Any Object

This generic class will help to obtain a deep copy of any object and cast it to the Object Type: public class ObjectCloner{ private ObjectCloner(){} // returns a deep copy

Schedule Events with The Timer Class

Scheduling recurrent or future events can be a hassle, but the Timer class can make it a lot easier. With a couple of simple calls, you can create any number

Append an Exception Trace to a Log File

If you want all exceptions to go to the same file, use this code: import java.io.*;import java.util.Date;public class Logger{public static synchronized logException(Exception ex){try {RandomAccessFile ff = new RandomAccessFile(“c:\name.log”,”rw”);// to append

How to Print an __int64 Number in VC++

You can use the printf() function as in the following example: #include using namespace std;int main(){ __int64 i64 = 4294967296; printf(“%I64d “, i64); //in decimal printf(“%I64x “, i64); //in hexa