Print the Stack Trace of the Exception to a String
When an exception occurs, this code snippet will print the stack trace of the exception to a string. This way, the exception stack trace at runtime can be recorded in
When an exception occurs, this code snippet will print the stack trace of the exception to a string. This way, the exception stack trace at runtime can be recorded in
The compiler creates a default construtor only in the following situations: When the class’s base class defines the default constructor. When the class of member objects defines default constructors. When
To be able to read from two streams, you need two threads. A common mistake is to start a process and then only read standard out (stdout. Another mistake is
How can you detect if a class overloads a particular operator when you don’t have the source for the class? You can define the operator globally so that it accepts
SQL has the habit of displaying date fields as: yyyy-mm-dd 00:00:00.000. But sometimes, you need to display just the Date or just the Time from a date field. Here are
The compiler performs implicit conversion whenever it feels the need for it. For example: class test{ public: test (int y) : h(y) {} int h;};void func (test t){ cout
Have you ever wanted to connect to a database without dealing with Oracle’s annoying reliance on the tnsnames.ora file? The trick is to put the tnsnames information into the ODBC
Oftentimes, you have a bit of logic or a block of code that’s repeated in all your servlets. Or you may need to check or validate the doGet() or doPost()
You can change the tab order of the controls in your dialog box by changing the Z order of the controls. You simply use the SetWindowPos API function. For example,