devxlogo

July 16, 2008

Mobile Confusion

With last week’s release of the 3G iPhone, things are really heating up in mobile software development. My inbox is flooded with announcements–Nokia going open source, Google phone rumors, Windows

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