June 29, 2005

Passing Pointers Instead of Const Reference Parameters

Usually, you pass const reference parameters to functions like this: class OneKind;class AnotherKind;class Example{ public: Example( const OneKind &inParam ); // conversion operator Example( const Example &inOriginal ); // copy constructor const Example &operator=( const Example& inRhs ); // assignment operator void MemberFunc( const AnotherKind &inParam );}; There are many

Printing the Contents Displayed in an Applet

Step 1: Draw any graphics objects in the applet as shown below: public void drawDemo(int w, int h, Graphics2D g2) { GeneralPath p = new GeneralPath(GeneralPath.WIND_EVEN_ODD); p.moveTo(w*.2f, h*.25f); // adds a cubic curve to the path p.curveTo(w*.4f, h*.5f, w*.6f, 0.0f, w*.8f, h*.25f); p.moveTo(w*.2f, h*.6f); // adds a quad curve to

Wed Yourself to UML with the Power of Associations

he UML association is a concept that is often misunderstood. The most common misperception is that an association is the same as a pointer, or maybe two pointers, in a program. UML associations are much more powerful than that. This article will explain exactly what UML associations are and the

Limit the Focus of an MSFlexGrid to a Certain Range of Columns and Rows

This code limits the focus in a big MSFlexGrid to a certain range of columns and rows. It limits movement by using the entercell method. It controls the use of enterkey, arrowkey, or mouse clicking with simple, on-cell direct editing: Const XTRA_COLS = 3 ‘including fixed columnConst XTRA_ROWS = 15

Forcing HTML Data to Render Properly

If the data in your database looks like “SomeValue or other HTML, you have to do something to prevent the browser from showing the tags, when you want just to display the HTML. Here’s how to do it: under –> “Notes” is a field name in the table containing HTML

Microsoft to Add AJAX Capabilities to ASP.NET

ver the past few months, there’s been an increasing amount of buzz about Asynchronous JavaScript and XML (AJAX) programming. It’s about time. AJAX is the new term for a technology that Microsoft IE developers have been using for years?the ability to make background requests to a server from a client

Some Useful TSQL Code Snippets for Beginners

For the benefit of the newbies in SQL Server, here’s a list of a few basic queries: How to determine whether a table column exists in a table: Run this query, and if the column exists, it will return a number greater than 0: Select Coalesce(Col_length(‘authors’,’au_lname’),0) Determine whether a database