Tip Bank

DevX

Write to a Perl File Using Flock

In his tip “Locking a File With the Perl Flock Function,” Steve Renaker’s example opens a file without specifying read or write. While this will successfully open a file for

DevX

Overloading a Function Template

If the function template you’re adding incorporates functionality that you already have, then you need to remove the old members first; otherwise the duplication will cause ambiguity. Here’s an example.

DevX

Use This Method to Format an Integer

Say you want the length of an integer to be exactly five digits, you can use the below method: NumberFormat nf=NumberFormat.getInstance(); // Get Instance of NumberFormatnf.setMinimumIntegerDigits(5); // The minimum Digits

DevX

Export HTML Data into Excel Files

Nowadays, many reports are generated as HTML documents for access on the Web. This tip shows you how to export that HTML data as it is (including all the CSS

DevX

Accept Multiple Arrays as Parameters

Passing multi-dimensional arrays to routines is different in VB.NET. Say you have a two-dimensional array called aStrMy2DArray(10,1) as a string data type: Private Sub MyRoutine(ByVal aStrMy2DArray as String (,)) ‘

DevX

Execute a .jar File Without All the Usual Debugging

In order to execute a .jar file using Java’s -jar jarfile command, the manifest file needs to have the classpath defined. This would look something like: Manifest-Version: 1.0Sealed: trueMain-Class: com.CalculatorClass-Path:

DevX

Copy Multiple Items in the Clipboard

Many times during coding you feel the need to keep more than one block of code in your clipboard.Visual Studio provides a wonderful feature for this using the clipboard ring.