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 Mobile device releases. It’s funny, but with these announcements comes a feeling of industry-wide willful ignorance and hypocrisy. For instance,

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); }}; Below are two examples that use the Alignment class. The first one is for the char data type; the second

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 connection’s setAutoCommit() method and passing it a boolean false, as follows: conn.setAutoCommit(false); Be aware, however, that once you turn auto-commit

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 you’re a Web Designer and don’t have Windows Vista, you should download these fonts to check how your site looks

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 blue=rgb & 0x0000FF; int r=(int) (red*frac); int g=(int) (green*frac); int b=(int) (blue*frac); return (0x000000FF

Debugging SQL Server Stored Procedures Through Visual Studio.NET

To debug SQL server stored prodecures, use the Server Explorer to select the SQL Server database, select the desired stored procedure and set a breakpoint. Then run the code. After the compiler stops on the breakpoint, you can perform the step-in, step-out, and other common debugging procedures. Please note: You