May 30, 2003

Book Excerpt: Mobile and Wireless Design Essentials

his book explores the full spectrum of wireless networks including Bluetooth, Wi-Fi, and 3G. You’ll also find easy-to-understand guidelines and pointers on how to implement a mobile and wireless application to extend your enterprise systems and meet your company’s needs. This book presents key information on: How to build smart

Changing the Column Name Through StoredProcedure Dynamically

Here’s the syntax for the stored procedure: CREATE PROCEDURE [dbo].[RenameColumn] @tblname as varchar(50), @oldcolnameas varchar(50), @newcolname as varchar(50)ASdeclare @tblColname varchar(100)set @tblColname = @tblname +’.’ + @oldcolnameBEGIN TRANSACTIONSET QUOTED_IDENTIFIER ONSET TRANSACTION ISOLATION LEVEL SERIALIZABLESET ARITHABORT ONSET NUMERIC_ROUNDABORT OFFSET CONCAT_NULL_YIELDS_NULL ONSET ANSI_NULLS ONSET ANSI_PADDING ONSET ANSI_WARNINGS ONCOMMITBEGIN TRANSACTIONEXECUTE sp_rename @tblColname , @newcolname,’COLUMN’COMMITGO

An Alternative to StringTokenizer

Suppose you have a String containing comma-separated substrings. In order to access the substrings individually, you’d normally rely on a StringTokenizer. And if you wanted to put the substrings in an array you’d write something like this: import java.util.StringTokenizer; … String colors= “red,blue,yellow,green”; StringTokenizer tk= new StringTokenizer(colors, “,”); String[] colorArray=

Check the Correct Balance of Brackets in Arithmetic Expressions

Brackets are well balanced if each ‘(‘ has its ‘)’. The argument str represents the array of characters which contains the expression. The following function returns 0 if the brackets in the expression are well balanced, and a nonzero integer if not. int balanced(char *str){ int balance=0; // Balance indicator.

Access a Class Member Function Without Creating a Class Object

In some cases, it is possible to call a class member function without creating the class object. In the following example, the program will print “hello world” although class A has never been created. When the program enters the “PrintMe” function, the “this” pointer is zero. This is fine as