February 13, 1999

Use External JavaScript Files

If you have the same JavaScript program appearing on several different Web pages, you might want to consider using an external file. That way all the pages can refer to the same script, and if you want to change it you only need to change it in one place. It

Creating Files Using FileOutputStream

You accomplish basic file I/O in Java using data streams. The most basic file I/O operations in Java use the functionality offered by these classes: FileInputStreamFileOutputStream If you’re new to Java, you’d probably assume that creating a file on the file system would be an operation on Java’s File class.

Using Static Variables to Store State Across Instantiations

There are several situations when you need to retain the state of a flag between different instances in a program. The standard way to do this is to declare the flag static. The state of the flag will be maintained across multiple instantiations of the class. However, the static flag

Locate an Element of a Container Using the find() Algorithm

You can use the generic algorithm find() to locate an element of a container. The find() algorithm takes three arguments. The first two are iterators that point at the beginning and the end of the sequence, respectively. The third argument is the sought after value. The find() algorithm returns an

The Underlying Representation of NULL

C and C++ define NULL differently: #define NULL 0; // A typical definition of NULL in C++ #define NULL ((void*)0) // C defines NULL this way Why is it defined differently in the two languages? Pointers in C++ are strongly typed, unlike pointers in C. Thus, void* cannot be implicitly

Creating an HTML Directory in ASP

Although most Web servers give you the option of allowing users to view the list of files in a Web site directory, you may not want to show some types of files. Also, you may want to present the list of files in attractive table. The following code, written for