The Latest

DevX

Using the EventObject Class

The EventObject class is the base class for transferring events in Java (see Tip “Understanding the Listener Pattern”). It provides these methods: public EventObject (Object source) // Constructor. The “source”

DevX

Show a Random Image

A bit of randomness can help keep your Web site from getting stale. You can use the JavaScript rand() function to display random text or a random image. function goRand()

DevX

Unconsting a const Variable

There are two types of const data storage: true const and contractual const. const int cn = 5; // true const A contractual const variable is a non-const one, which

DevX

Preload Your Images

If you use JavaScript rollover images on your Web pages, it’s a good idea to preload them in order to reduce lag time while the image downloads. Non-preloaded images won’t

DevX

Minimize Server Script in Active Server Pages

To improve performance in your Active Server Pages, try to minimize the amount of server script present. From a design point of view, putting extensive code and business rules in

DevX

Understanding the Listener Pattern

The Listener pattern is commonly used in the AWT since JDK 1.1. In fact, the Listener has been the base for the event handling mechanism for UI events in Java.

DevX

Servlets are a Viable Alternative to CGI

Servlets provide a more effective mechanism of achieving the functionality offered by CGI (Common Gateway Interface) scripts. CGI was one of the first techniques for creating dynamic Web pages by

DevX

Index Server Directory Scanning

If you are utilizing Internet Information Server (IIS) 4 and Microsoft Index Server, be careful which directories you set up to be traversed by Index Server. You likely do not

DevX

What are Servlets?

All Java programmers probably know what Java applets are and how they differ from Java applications. After all applets were Java’s gateway into the Internet. Servlets are Java’s entry into

DevX

Calling JavaScript in an Anchor Tag

There are many ways to call a JavaScript function in an HTML document. One way is inside an anchor tag. Any function that is listed in the portion of the

DevX

Customize the Index Server Results Page

Don’t like that plain search results page that comes up when using index server, when the rest of your site looks so nice? The results page is a file with

DevX

Performance of typeid vs. dynamic_cast<>

As far as design is concerned, dynamic_cast should be preferred to typeid because the former enables more flexibility and extensibility. Notwithstanding that, the runtime overhead of typeid can be less

DevX

Delphi MDI Form

Question: Imagine an MDI application where the MDIFrame has many MDIChild forms?each one derived from TBlueForm class. The TBlueForm class has a public method named ChangeColor which only makes the

DevX

Database Reporting

Question: What is the best way to do a database report?in other words print a database? I have been having serious trouble with QuickRep. I specify the dataset but still

DevX

Saving New Database at Run Time to a New File

Question: How do I save my new database at run time to a new file? I’m using a paradox database?DBGrid, and a table and data source control. Answer: Use TTable’s

DevX

Displaying Changes to a Record

Question: I have set up a paradox table for multiple user access using the Netdir method, but when I post a record other users cannot see the changes until the

DevX

Resources for Delphi 32-bit Programming

Question: Can you recommend resources to learn how to tackle 16-bit and 32-bit programming in Delphi? Answer: A number of good books that I’ve read include: All of Charlie Calvert’s

DevX

Using Stored Procedures Boosts Performance in ASP

Active Server Pages that utilize databases like SQL Server are no different than conventional programs in that they will experience a performance boost when you use stored procedures instead of

DevX

Use the Continuation Marker Before a Line Break

C++ statements can be broken into more than a single line. However, you cannot break literal strings such as printf() format string, macros, or literals. When you need a long

DevX

Lingering on Sockets

Java’s Socket class gives you control over how a socket handles queued data when it closes. This linger-on-close option allows you to dictate whether you want the socket to send

DevX

Quirks of the Dir$ Function

If you use the intrinsic VB Dir$ function to check for the existence of a certain file, then subsequently try to remove the directory where the file is found using

DevX

Keep Menu Items in Sync With Enabled Property

How many times have you had to control the same processes with both command buttons and corresponding menus? I expect you’d say “many,” which means you’ve had to set the