August 7, 2003

Find an Offset into a Structure

Here’s the code: #define offset(a,b) ((int) (&( ((a*)(0)) -> b))) Step by step, here’s what it does: Type-cast 0, or NULL, into a pointer of type a. So a must be a typename. Member-select b from that pointer. So a must be a structure typename, and b some member property.

Use XML to Store Your App Settings in ASP

XML provides many opportunities to share and store data. One of the most common and simple uses of XML is to use it to store data used by your application. Every application uses data. The traditional way to store this data was in INI files. Then came registries. Now, more

Add User-friendliness to an HTML CheckBox/RadioButton

The HTML CheckBox/RadioButton is selected only by clicking on the control and not the text associated with it. Using , you can bound the text with the CheckBox. For instance, the following checkbox is selected only by clicking the checkbox: All Items However, this checkbox can be selected either by

Windows and Linux: Time for Microsoft to Cede to Coexistence

San Francisco?At a somewhat anemic LinuxWorld 2003 conference in San Francisco, big-corporation Linux supporters showed that Linux has grown up and “gone mainstream,” according to Peter Blackmore, Executive Vice President of the Enterprise Systems Group at Hewlett-Packard, who gave the opening keynote Tuesday. And it’s true, Linux has grown up.

Produce a Hex Dump of the Contents of a URL

This program opens connection with a specified URL and hex-dumps the contents received from an associated input stream. Use this to find out what’s going on with your browser. public class UrlHexDump { static final char[] hexes = “0123456789abcdef”.toCharArray(); public static String toHex(int value, int length) { StringBuffer b =

Book Excerpt: Murach’s SQL for SQL Server

hy learn SQL? First, because most database programmers would be better programmers if they knew more about SQL. Second, because SQL programming is a valuable specialty in itself. And third, because knowing SQL is the first step toward becoming a database administrator. In short, knowing SQL makes you more valuable