devxlogo

Tip Bank

Release Resources with a Shutdown Hook

JDK 1.3 introduced the addShutdownHook() method to the java.lang.Runtime class. Implementing a shutdown hook is useful if you need to take some action right before your app stops running. To

Search a Directory for Files with a Pattern

The following is a powerful UNIX command that searches for files or folder names containing a particular pattern:1 $>grep -l “main(String” `find . -name *.java -print` This particular code will

Eliminate Data Caching from Your Browser

There are times you don’t want your output to be cached on browsers. For instance, when a user is viewing their account balance, you want the data to be retrieved

Debugging the Memory Leaks in MS VC++ 6.0

The failure to deallocate previously allocated memory is known as a memory leak. A memory leak is one of those hard to detect bugs, and it may cause unpredictable behavior

A Convention for Naming Variables

Naming variables has a major effect on how hard it will be for a person to follow the code, whether it is the same person who wrote it or someone

How to Write Userdefined Exceptions

Here’s an example: Code For Balance Class——————————————————————————–// Demo class for User-Defined Exceptions To Ensure The// Validity of Data Contained In A Classimport java.io.*;public class Balance{ int bal; public Balance(){ }

Linking Your Access Databases with ADOX

This small routine creates a link from all the tables of one .mdb file to another. First, you need to select reference ‘Microsoft ADOX’, your available version. Private Sub CreateLinkTables()

WebRequest & WebResponse

There are two methods to send info and get a response via HTTP. The second (alternate) method works for both .NET and VB6, but it requires DLL reference (take your

The #define Directive

When you compile a program the compiler first uses a preprocessor to analyze the code. The #define directive can be used to either define a constant number or function or