devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Form-Building Routines III—the Conclusion

f you’ve been following this series, the last couple of articles (see Resources) focused on writing some useful “form-building” routines in ASP pages. I’ll continue this month by developing routines

A Null Preprocessor Directive

An empty # sign is a null preprocessor directive. A null directive has no effect but you can use it to document your intentions, for example: ifndef HEADER_INCLUDED#define HEADER_INCLUDED#else# //

Wide-char File Streams

The library supports two types of file streams: char-based streams such as std::ifstream and whcar_t streams. The names of wchar_t streams are the same as their char-based counterparts, except that

Repositioning a std::fstream Pointer

Just like the fseek() function of , classes enable you to position the stream’s pointer at an arbitrary location by calling the seekg() member function. For example, you can position

char[] vs. char *

C++ forbids direct assignments of arrays. Therefore, your compiler will flag the following code as an error: char buff[];buff=

Optimizing the Use of std::string

Here a few guidelines for improving std::string’s performance and avoiding common pitfalls. Consider the following for-loop: std::string str =

Pointers and Arrays

C++ never passes arrays to a function. Instead, the argument is implicitly converted to a pointer that contains the address of the first array element. For example: void f(char s[]);int

Using a Template Member Function

An ordinary class may have template member functions. In the following example, the class A declares a template member function called f(): class A{public: template T f(T t);}; You may

Template Parameters and Template Arguments

The terms template argument and template parameter do not mean the same thing. A template parameter is a symbol, or a placeholder which is replaced by the actual argument when

To DLL or not to DLL?

Many Windows programmers use DLLs abundantly. Although dynamic linking certainly offers some advantages, it can also cause noticeable maintenance and performance setbacks. For starters, DLLs are slower than statically linked

Memory Deallocation Myths

A common myth among programmers says that you can avoid calling delete in your application because the operating system will release the allocated memory when the application terminates anyways. Indeed,

Screen Grabber Utility

This utility, provided as VB source code, captures the desktop and saves your selection as JPG (with quality settings) or BMP. Using it is quite simple: Go to menu and

Open and close the CD drive’s door

Here’s a short code snippet that lets you programmatically open and close the CD door. Note that not all the CD drives support these functions: Private Declare Function mciSendString Lib

The Error Lines Add-in

This is a simple addin that allows the user to add/remove err line numbers in their code and use them in an compiled application through the ERL function. With this

LinkedList – a class module to store list of values

‘————————————————-‘ LINKED LIST class module” This class implements a linked list structure, where you can store’ values (appending them after the last element or inserting them at’ given indexes), remove

CBitArray – a class for dealing with large arrays of Boolean

‘ ————————————————————————‘ The CBITARRAY class” simiulates an array of Boolean values’ saves memory by packing one element in one bit” IMPORTANT: you make make ITEM the default member for this

HashTable – a class module for storing (key,value) pairs

‘———————————————-‘ HASHTABLE class module” This class implements a hashtable, a structure that offers many’ of the features of a collectior or dictionary, and is often’ even faster than the built-in

Using Repeated-Letter Variable Names

When using a variable as a loop index, it is common to use single-letter variable names. This is a bad practice, because it can make it difficult to find all

Dynamically Creating Controls in Palm OS

Creating controls in Palm OS is very useful. It gives vital power to the programmer in creating applications. There are various controls in Palm OS like buttons, check boxes, radio

Generating Unique Numbers

Here is sample code: import java.security.SecureRandom;public class UniqueNumberGenerator{ static final SecureRandom random = new SecureRandom(); static final StringBuffer buffer = new StringBuffer(30); static { random.nextInt(); } public static String getNextUID()

Treat JNDI Naming Context As a Scarce Resource

It seems common knowledge that I/O streams and JDBC database connections are resources that need to be released as soon as they are no longer needed. Not so common knowledge

Closing JDBC ResultSet Instances Properly

Many books about JDBC and most of JDBC-related sample code floating around seems to assume that JDBC is used directly, meaning that database connection is established by the DriverManager, and

Execute ADSI Calls From an Anonymous ASP Page

If you’re like me, and sometimes need to modify Active Directory data from an ASP page where the user is either anonymous, or doesn’t have admin privileges, you need a

When To Use equalsIgnoreCase

The equals() method in the String class is commonly used to compare two strings for equality. However, this method returns true only if the argument is not null and is