May 19, 2005

Letting Java in on SQL Server Notifications

tarting with SQL Server 2000, Microsoft added the concept of notification services to their flagship database engine. SQL Server Notification Services lets you generate and send notifications whenever some criterion is met. Generally, you use notifications to alert or update data for users or applications without having to repeatedly poll

Use Callbacks to Isolate Concurrency Bugs

ne of the most common errors Java programmers make when they first learn multi-threaded programming is to misunderstand locks. They believe that locking an object prevents access to its fields and methods, when in fact a lock on an object serves only to prevent other threads from gaining the same

Masked Edit Control

To include characters in your mask that are also part of the set of mask syntax characters, escape them by using the backslash () character in front of the character you want to include. For example, in the following code, the character “9” is a mask sign, so you have

Use Reflection to Find Dynamic Class Information

Use this code to find information?such as the method name or the parameters?of a dynamic class: import java.lang.reflect.*;public class DynMethodNames{ public static void main(String a[]) { try{ //passing class name as argument Class c = Class.forName(a[0]); System.out.println(“Constructors”); //List of constructors of the given class Constructor cons[] = c.getConstructors(); for(int i

Using StringBuilder in .NET

StringBuilder has an Append method that returns a reference to itself. This is useful for when you want to append several items in one go. The following code is an example. Obviously, you’ll get more benefit the more items you add: StringBuilder sb = new StringBuilder( ) ; string s

Display Alert Messages on Separate Lines

Everybody knows that the alert() function in JavaScript is used to display messages in a dialog box. For example, the following code: alert(‘Hello Prakash’); will pop up with this message: ‘Hello Prakash’. But suppose you want the Hello on one line and Prakash in another? You can do this by