June 23, 1999

Declare a Function Template as a Friend of Another Class Template

There are various forms of friend declarations within a class template: a non-template friend, a specialized template friend, and a class template friend. A function template can also be declared as a friend of a class template. For instance, you might add an overloaded operator == function template to test

Assigning Integers to an Enum Type

In C, it is valid to assign integers to an enumerated type. For example: /*** valid in C but not C++ ***/enum Status {good, bad};void func(){ Status stat = 1; /* integer assignment */} In C++, however, enums are strongly typed. You can only assign enumerators of the same enum

Initialize a Radio Button

Question: Is there a parameter that can be used within a radio button tag in an HTML form to set the default value for the radio group? Answer: The CHECKED parameter will cause a radio button to be turned on when the page appears:

Processing a Transaction on One or More Remote Servers

In SQL Server 6.5, this command specifies that a distributed transaction managed by Microsoft Distributed Transaction Coordinator (MS DTC) starts and the transaction_name specifies a user-defined transaction name that is used to track the distributed transaction within MS DTC utilities: BEGIN DISTRIBUTED TRANsaction [transaction_name] You should use the BEGIN DISTRIBUTED

Prevent Lenient Date Parsing

The java.text.DateFormat class and its java.util.SimpleDateFormat subclass are useful for formatting and parsing date and time values. For example, your application may allow a user to enter a date value and then use SimpleDateFormat to process it and return an instance of java.util.Date. When DateFormat attempts to process a string

“Disable” the Browser’s Back Button

While there is no way to specifically disable the back button from within the browser, you can shortcut the navigation to another page. The trick is to catch the onbeforeunload event of the window: Whenever anyone attempts to leave the page, the browser will nudge the user back. You can