May 19, 2009

How Base64 Content Encoding Works

The term “Base64” refers to a specific MIME content-transfer encoding. It’s also used as a generic term for any similar encoding scheme that encodes binary data by treating it numerically and translating it into a base-64 representation. The particular choice of base is due to the history of character set

Incrementing a C# Variable Efficiently

When you’re incrementing an object of a fundamental type, there’s no difference between prefix (++obj) and postfix (obj++) operators. However, when you’re incrementing a composite object, using the postfix operator causes the .NET Framework to create a temporary object, whereas the prefix operator doesn’t.So, when you’re incrementing an object that

Calling JTidy from Java to Convert HTML to XHTML

The open source JTidy project does an excellent job of converting HTML files to the newer XHTML standard. The following code shows how to invoke JTidy programmatically from Java: /*In: C:Data_Localxmldocs est.htmlOut: C:Data_Localxmldocs estXHTML.xml*/import org.w3c.tidy.Tidy;import java.io.FileInputStream;import java.io.FileOutputStream;import org.w3c.dom.Document;public class HTML_to_XHTML{ public static void main(String[] args){ try{ FileInputStream FIS=new FileInputStream(“C://Data_Local //xml//docs//test.html”);

Displaying Embedded Newline Characters from ASP.NET Resource Files

When an ASP.NET resource file includes newline characters ( ) as part of a string value, the embedded newlines don’t show up correctly on the client side. The solution is to use the special defined character Environment.NewLine in your server-side code. The example below is in VB, but the same

Using the OneWay Web Service Attribute

When you call a web service method that doesn’t return a value (a void method), you don’t want to waste time waiting until the call returns. But by default, the calling thread blocks until the server responds. In such cases, you can use the OneWay Boolean attribute of the SoapDocumentMethod

Dances with Workflows (One Newbie’s Journey)

ecently I started working with a client who was interested in using Windows Workflow Foundation (WF) in a custom application. Having never used WF before, I thought it might be interesting to document the experience and my assumptions as I started learning and implementing the technology in production. I talked