devxlogo

Tip Bank

Easily Assign Containers

STL containers overload the assignment operator, thereby allowing you to easily assign containers of the same type to one another: #include #includeusing namespace std;void main() { vector vi; vi.push_back(1); vi.push_back(2);

Where is That Serialized Hashed Key?

When serializing a Hashtable in Java, make sure that the keys used to store objects are either primitives, or the key class’ hashCode() method overrides the superclass Object’s hashCode() method.

Customize Your 404 Page

Even if your Web site is rock-solid with no broken links on it anywhere, chances are someone is going to see a 404 File not Found error page someday, if

Sorting a Two-Dimensional Array With <=>

The Perl sort function is useful for alphabetically sorting lists. However, you can’t use it on a list of lists, because once a list starts listing other lists, they cease

Serializing and Deserializing Objects

The serialization mechanism in Java provides the means for persisting objects beyond a single run of a Java program. To serialize an object, make sure that the declaring class implements

Display Read-Only Data on Your Web Pages

You can do a lot of cool things using Microsoft’s Remote Data Services (RDS). For example, have you ever wanted to display a field from a database table read-only in

Non-Virtual Multiple Inheritance

Virtual inheritance is used to avoid multiple copies of a base class in a multiple-inherited object. However, there are cases where multiple copies of a base are needed in a