devxlogo

Tip Bank

The Remove_if() Algorithm

If you are familiar with the remove_if() algorithm, you’re used to applying remove_if() followed by erase(). For example, suppose you’re given a predicate to determine whether a number is even:

Resolve DB2 Instance Creation Failure on UNIX

On AIX, and UNIX in general, DB2 instance creation fails with vague errors: Update DBM cfg SYSADM_GROUP errcode = 8DBI1281E The database manager configuration file could not be initialized. Explanation:

Extract JAR and ZIP Entries with JarURLConnection

Use the following code to extract JAR and ZIP Entries with JarURLConnection: import java.net.*;import java.io.*;import java.awt.*;import java.util.*;import java.util.jar.*;class read extends Frame{URL url=null;JarURLConnection URLcon=null;JarFile jar=null;TextArea TA=new TextArea(15,35);public read(String titlu){ super(titlu);}void init(){

Combine Multiple .NET Assemblies into One

You can use Microsoft’s ILMerge tool to merge .NET assemblies?even those written in different .NET languages?into a single assembly for easier distribution, something that’s not possible using Visual Studio alone.

Comparing Strings Properly in Java

The semantics of ==, with regards to string comparison in Java and C#, are totally different from each other. Suppose you have two strings?s1 and s2?and the following statment: //

Converting a String to a GUID

There is a simple way to convert a string, which is in the correct GUID format, into a GUID. Simply do the following: GUID GUID = (SqlGUID.Parse(s)).Value;

A Loop with an Exit Condition

Here is a pattern you will see quite often when structuring your code in loop constructs: 01 enum command { start, stop, wait, quit };02 command instructions;03 int counter =