The Latest

DevX - Software Development Resource

Chunk is Down

Question: We are using IDS 7.30 FC7 on DEC/Unix 4.2. Two separate OnLine works on the same machine. Let’s call them OnLine1 and OnLine2. While adding a new chunk (not

DevX - Software Development Resource

Error in Visual Studio Data View with CLI 2.40

Question: I have installed the Informix-CLI SDK 2.40 (driver ODBC rev. 3.31) both in Windows 98se and NT 4 sp4, and I’ve encountered a problem with Visual Studio Data View

DevX - Software Development Resource

Join on Key Fields of Differing Data Types

Question: I am trying to create some reports with a third party reporting tool accessing an Informix 7 database, which was not written by us. I want to join two

DevX - Software Development Resource

Using Mapinfo with Informix

Question: I want to use Mapinfo with an Informix database, but I can’t connect the database server from Mapinfo. The Informix dynamic server version is 5.0. My network protocol is

DevX - Software Development Resource

The AVEPopup ActiveX control

This ComboBox-like ActiveX control lets you host nearly every coincevable control inside it, so that you can save precious screen estate. For example, you can host a TreeView or a

DevX - Software Development Resource

Functions Are Extern by Default

Unless explicitly declared static, an ordinary function is implicitly declared extern in C and C++. For example: extern void func(int i); // extern is redundant However, sometimes the extern qualifier

DevX - Software Development Resource

What You Can Learn from Compiler Warnings

The following code has a subtle bug. Can you detect it? DWORD ErrCode = GetLastError(); // Retrieve the error codeif (!ErrCode==ERROR_FILE_NOT_FOUND) // warning on this line Although the compiler cannot

DevX - Software Development Resource

Short-Circuiting String Comparison

Normally, you don’t need to implement operator == for comparing string objects, as it’s already defined for you. However, for certain applications, you might need to provide a different version

DevX - Software Development Resource

Optimize Oracle’s SQL Statement Cache

When Oracle receives a SQL statement to execute, it first looks to see ifthe execution plan already exists in its cache. If the statement does existin the cache, the previous

DevX - Software Development Resource

Move a Form by Clicking Anywhere on It

The following code allows you to move a form by clicking anywhere on the formand dragging it: Option Explicit’define module level variables to store the last position of the form,

DevX - Software Development Resource

Counting “Live” Instances of a Class

Counting the number of object instances of a certain class can be necessary in debugging and performance tuning. To do that, declare a static data member as a counter, and

DevX - Software Development Resource

Fix Single Quotes in a SQL Statement

The following will replace all single quotes in a SQL statement [CHR(39)] with anapostrophe [CHR(180)]. This is useful if you are trying to add names to adatabase as parameter values

DevX - Software Development Resource

How Many Digits Does a Floating-Point Variable Have?

The standard function template std::numeric_limits (defined in < limits >) returns the implementation-dependent number of digits that a certain type has: #include int main(){std::numeric_limits < float >::digits10; //6 on my

DevX - Software Development Resource

Roles Are Disabled at Package Compilation Time

When granting permissions through roles, it is important to know that rolesare disabled while packages are compiled. For example, consider two schemas: User_A and User_B. Let’s create Role_A: CREATE ROLE

DevX - Software Development Resource

Selecting Three Radio Buttons

Question: I want to validate a form so that three radio buttons may be checked, but no more. This will be used in a “what are your top three choices”

DevX - Software Development Resource

Void Function Arguments

Question: Why does Java accept function declarations like public void func(); but not declarations like public void func(void); Answer: Java is not C. Despite the similar syntax, all C idioms

DevX - Software Development Resource

JavaScript Browser Detection

Question: When loading a web page, I need to have JavaScript look at the browser it is loading into, and if it is not version 5 (Internet Explorer 5), I

DevX - Software Development Resource

Mouse Position

Question: Can I retrieve the position of the mouse on the screen? I need to know the X and Y coordinates because I want to position a layer at that

DevX - Software Development Resource

Multi-dimensional Arrays

Question: Can I create multi-dimensional arrays in JavaScript? Do you have an example? Answer: Yes and no. You can’t create multi-dimensional arrays (as such) in JavaScript. What you can do

DevX - Software Development Resource

Store Procedure and View Creation

Question: We need to create a view based on about 1600 tables. One of the problems is that we cannot enter all of the query into the buffer because the

DevX - Software Development Resource

Project Reference

Question: In a code I’m developing, I am getting a “can’t find project or library” error message when it gets to the following functions: Chr(), Right(), Left(). Aren’t these VB

DevX - Software Development Resource

Use of SocketImpl Class

Question: What is the SocketImpl class used for? Answer: SocketImpl is an abstract class that provides an interface for customizing socket implementations. Subclasses of SocketImpl are not intended to be

DevX - Software Development Resource

Interface vs. Abstract Class

Question: What is the difference between an interface and an abstract class? Answer: Within the confines of Java syntax, an interface is a type that only defines abstract methods and

DevX - Software Development Resource

EJBs and Servlets

Question: Both Enterprise JavaBeans and Servlets are server side components. What are the major differences between them? Specifically, what is the difference between a Session Bean and a Servlet? Answer:

DevX - Software Development Resource

Objects and Sockets

Question: Is it possible to send an object over a socket connection in Java? Answer: Objects can be transmitted over a socket connection in the same way that they are

DevX - Software Development Resource

Delegation Technique

Question: What is delegation and how can I use it? Could you please give an example of a simple delegation technique? Answer: Delegation is a technique where one object directly

DevX - Software Development Resource

JavaScript Variable Declaration

Question: I am new to JavaScript, but familiar with a variety of other languages. I don’t quite understand what the following variable declarations do: ns4 = (document.layers)? true:falseie4 = (document.all)?

DevX - Software Development Resource

Using JavaScript to Find User Info.

Question: I’m working for a local newspaper, and we are writing a survey to see the type of technology our viewers are currently using to access the site. Is there

DevX - Software Development Resource

Viewing Source Code

Question: Is there a way to prevent users from using the VIEW/SOURCE to view the HTML in my pages? I need to have this for a form that uses sensitive