December 8, 2004

Enforcing Compile-time Constraints

eneric containers and algorithms often impose certain restrictions on the objects that they manipulate. For example, the std::sort() algorithm requires that the elements on which it operates shall define the < operator. Enforcing this constraint is easy: the compiler tries to invoke this operator for the given type. If such

Open Only One Instance of a Popup Window in an HTML Page

To open only one instance of a popup window in an HTML page, use the windowName parameter of the window.open method. For example window.open(‘http://www.devx.com’) will open a new window each time the user clicks the link containing the window.open code. In constrast, window.open(‘http://www.devx.com’,’devx’) will open only one instance of the

Format a Textbox String to the Correct Currency

This code allows you to format a textbox string to the correct currency in SQL Server, independent of regional settings or the user input decimal symbol: Public Function FormatMoney(ByVal strValue As String) As String ‘**This function fails if the user uses a digit grouping symbol and no decimal symbol. ‘**

Integrate the Jad Decompiler Plug-in into Eclipse

on’t you hate it when you are debugging your code within Eclipse, and while stepping into a method call, a Class File Editor pops up exclaiming “Source Not Found”? Wouldn’t you rather see the Java source the next time that happens? By integrating a Java decompiler into your IDE, you

Register the Same SQL Server More than Once in Enterprise Manager

Suppose you want to register one SQL Server twice in Enterprise Manager. You want to test different registration properties from inside Enterprise Manager?especially permissions. In SQL Server 2000, if you try this, Enterprise Manager complains that you’ve already registered in the server. The way around this is to use the