February 27, 2008

Use Xerces-J to Obtain a Serialized DOM Tree

Suppose you need to serialize a DOM tree, with the result being an XML document. Xerces-J allows you to specify a maximum line length and an indent value. Here’s an example: //the XML document used in this example is://”C://Data_local//xml//docs//AirWings_xml.xml”//The application has two steps:// 1. – Get the DOM tree of

Quickly Navigate VS 2005 IDE’s HTML Editor

You can spend a lot of time perusing your ASP.NET pages in HTML view?oftentimes, the amount of HTML makes it difficult to locate little details. But the Visual Studio 2005 IDE provides features that allow you to navigate very quickly around the HTML Page. First, take a page with lot

Obtain Information About Table Columns in Microsoft SQL Server

To obtain information about table columns in Microsoft SQL Server, use the INFORMATION_SCHEMA.COLUMNS view: SELECT COLUMN_NAME,columnproperty(OBJECT_ID(TABLE_NAME), COLUMN_NAME, ‘IsIdentity’) as IsIdentity,ORDINAL_POSITION, IS_NULLABLE, DATA_TYPE, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, COLLATION_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ‘your_table_name’ORDER BY TABLE_NAME, ORDINAL_POSITION, COLUMN_NAME

Multi-Threading: When printf Can Be Better than cout

If you use cout (or some other ostream) to output text data in a multi-threaded program, you’ll probably get a lot of gibberish. One thread begins streaming text out, gets preempted, and then another thread starts streaming: a single line of text might contain characters from multiple threads. That’s not