devxlogo

Tip Bank

Trace the Path of Execution

In larger applications, a particular point of code can be achieved by multiple paths. This makes debugging that much more difficult. One alternative is to put debug statements in all

Determine Whether a String is a base64encoded

This function returns TRUE if the string is a base64encoded. Otherwise, it returns FALSE. ‘AUTHOR: KEYUR KALARIA’DATE: JULY 24, 2004’VERY USEFUL FUNCTION AND COULD BE HANDY IF YOUR WORKING AROUND

Disable Inheritance

Use this code to disable inheritance: class A;class Lock { friend class A;private: Lock() {}};class A : virtual public Lock { // …public: A() {} A(int t) {}}; Now, if

Regular Expression Validation in XSD

The following code performs powerful Date type validation in XSD. It validates date fields with timestamp (optional) in yyyyMMdd hh:MM:ss.ffffff format. If your XML file contains the element ValueDate, the

Using std::vectors Efficiently

Whenever possible, use C++ arrays. Array indexing has an order of magnitude of O(1). This means that it is very fast. However, if the size of the array is not