June 30, 2000

Abstract Base Class(ABC) Creation

Question: How do I convert a class into an abstract base class without using a pure virtual member function in it? Answer: If your goal is to disable instantiation of a given class while allowing instantiation of classes that are derived from it, you can declare the class’s constructor, destructor,

Using HitCounters in Your Page

Question: Where can I download the HitCount Component for ASP? Do I need to register it on the Web server also? Answer: FrontPage 98 ships with a hit counter component. Use Frontpage to add it to an HTML page, and then, cut-paste it to your ASP page’s HTML. As long

Calculating the Average of a Column

Question: I’m doing a Web front for a database that contains data about temperature. How do I calculate an average temperature using SQL code? Answer: Use the AVG function to get an average of all the values in a single column. With a table called TestTable and this data: Temperature

Forward Declaration for STL String Class

Question: How do I do a forward declaration for the STL ‘string’ class? For example: // Foo.hppclass string;class Foo{ string f1(); void f2(const string& str); …} On various compliers (MS, Sun, GNU) this produces error messages to the effect of “invalid class definition” or “conflicting class definition.” Answer: You can’t

Submitting a Form with the Enter Key

Using the IE browser application, you can press the key while filling a form to submit the form. Indeed, this is a desirable feature for any Windows application. In order to make this work for all browser applications, you just need to add a few lines of code. The method

What Are Design Patterns?

A design pattern is a design solution to a software problem that occurs within a specific, recurring set of situations. Let’s say you are making software for a problem situation that involves a heat sensor, and an overheat alarm. And let’s say that whenever the sensor senses temperature above a

Building a Rotating Banner Ad with JavaScript

Banner ads are common on any commercial site these days. But most of them use mechanisms like Server Push, Serve-side objects, or even services of third parties to rotate the banner. Here is a simple, inexpensive, JavaScript-based, implementation of a banner ad. This banner rotator shows a different gif image

Identify Atomic and Non-Atomic Operations

In Java, the reading and writing of 32-bit or smaller quantities are guaranteed to be atomic. By atomic we mean each action takes place in one step and cannot be interrupted. Thus, when we have multithreaded applications, the read and write operations are thread-safe and need not be made synchronized.

Define Named Ranges in Excel Before Executing Queries

Once you’ve established a connection to Microsoft Excel using OLE DB, you’re not out of the woods. You still have to define a Named Range in Excel; then you can treat this named range like a database table to perform queries against. To do this from Excel, select the range

No more posts to show