June 3, 2008

Crafting Strings in C#

ecently, I came across an application that contained a binary + operator in which at least one of the operands was of type string. While debugging this app, I found that the Microsoft C# compiler had compiled the the program so that the value was 158, while the maximum value

Write a VB6 String that Contains Double Quotation Marks

There are typically two ways to express the string that contains double quotation marks. For example, suppose you have following string in VB6: &lta href=”http://www.sina.com”&gtsina You can express this string in one of two ways, both listed below: Dim tem As String tem = “sina” Dim tem As String tem

Convert a Date to mm/dd/yyyy Format in JavaScript

Learn how to use a JavaScript convert date format. When you create an a Date()object in JavaScript, the value you get is something like this: ‘Tue Apr 1 12:58:25 EDT 2008’ Now suppose you want to display this date in mm/dd/yyyyformat. The following code snippet provides a quick way to

Disable Copy/Paste in a Textbox in Your WinForms Application

The following two steps disable the Copy/Paste feature in a textbox: Disable the default menu and associate the textbox with an empty context menu that has no menu items (mouse actions). The user can still use the shortcut keys on the keyboard and perform these operations. So, override the ProcessCmdKey

Use LSOutput and LSSerializer to Serialize a DOM Tree

This tip shows you how to use the LSOutput/LSSerializer interfaces (from the DOM Load and Save API) for serialize a DOM tree. Extract the DOM tree with the following basic steps: //AirWings_xml.xml – the XML document from this example//LSOutput_1.xml – the result of serializationimport javax.xml.parsers.*;import org.w3c.dom.*;import java.io.*;import org.w3c.dom.ls.*;class DOM{ DocumentBuilderFactory

Building Personalized Applications on the Windows Live ID Platform

o you have a cool personalized application that you want to offer to over 400 million users? Do you want to light it up with Live controls or create a mashup with Live resources? Windows Live ID now offers a simple way for third parties to get Live ID authentication