devxlogo

Tip Bank

Calling C Libraries from .NET

Suppose your library is in C and and your code is in .NET or VC++ (for a UI-based application). Further, suppose you want to display a message box whenever the

ASP.NET 2.0’s Project Health Monitoring Feature

ASP.NET 2.0 provides much needed project health monitoring through its Health Monitoring feature. Simply add few tags and their values in Web.Config and your project will be automatically monitored. This

Manipulate the Components of a JNDI Composite Name

This following code shows you how to list, add, and remove components from a JNDI composite name (javax.naming.CompositeName): import javax.naming.*;class jndiCompositeName{ public static void compositeComponents(CompositeName cn) { for(int i=0;i&ltcn.size();i++) System.out.println(cn.get(i));

How to Calculate the Alignment in C++

Use the following class to help calculate the alignment in C++: template&lttypename T&gtclass Alignment{ struct Align { char align; T t; };public: int alignment() { return sizeof(Align) – sizeof(T); }};

Turn Off Auto-Commit for Better Performance

When you first establish a connection to a database, the connection is in auto-commit mode, by default. For better performance, turn auto-commit off. You can do this by calling the

New Web Fonts for Windows Vista

Microsoft has released a number of new Windows Vista fonts, for use in web development. They are described on the Microsoft Typography site, with examples shown in XPS files. If

Create the “Night” Filter Using the RGBImageFilter Class

The following code uses the RGBImageFilter class to create the “night” effect on an image: import java.awt.image.*;public class NightFilter extends RGBImageFilter { double frac; //0.0&lt=g>=16; int green=rgb & 0x0000FF00;green>>>=8; int