devxlogo

The Latest

Using Property Files instead of Hardcoding Values

Oftentimes, you hard code values like URL Related Posts Using the FileTime Class in JavaJury Orders Oracle to Pay HPE $3 Billion in Itanium LawsuitBYD unveils new plug-in hybrids in

Use IN in place of OR

If you use OR against a table when you are trying to retrieve rows on matching criteria, it will search the table as many times as matching criteria you gave.

Using the dir() and the dir$() Functions

It’s possible to use the dir() and the dir$() functions to list directories. However, many programmers handle the two first returns from the functions “.” and “..” by using an

Set Fraction Digits

To reduce the number of fraction digits in a double type variable, follow the code sample below. This can be useful in money calculations. Firstly, create a NumberFormat instance and

Don’t Worry about Sorting

It is possible to sort any type of array of elements, even if you don’t know a sorting algorithm. First, pass an array variable to sort the method (which is

Exception Specifications — Myth and Reality

When exception specifications were added to C++ a few years ago, they looked very promising. However, as is often the case in a programming language Related Posts Java Support for

Place a Member Initialization List in a Constructor

In the following example, a member initialization list appears in the inline definition of the constructor, inside the class body: class ratio {private: int x, y;public: ratio(int top, int bot)

Use Control/Space for VB IntelliSense

You can press Ctrl-Spacebar to make IntelliSense prompt you for variables, methods, properties, or events at any point in a code window.For example, if you have a variable named myvariable,

Avoid Regenerating Overlay Images

If you Related Posts May’s geomagnetic storm sparks unique atmospheric changesGoogle unveils new AI accessibility featuresExplore a Few Math Functions in SQL ServerCA Acquires BlazeMeterChinese universities overhaul majors for hi-tech

Allow Only Programmatic Input to Combo

Database applications often need to forbid user input to combo boxes, which limits the user to a given set of choices. But just as often, these apps need to assign

Keep a MAP File

If the LINK environment variable is set to /MAP when VB launches, you’ll get a MAP file whenever you Make EXE, even when you are not generating debug symbols. Keeping

Validate Text Against a List of Values

I often find it necessary to check that a string is valid by ensuring it exists in a list of strings. For instance, you might need to check that a

Copy an Array Faster

Here Related Posts Cisco to cut 7% of workforceMicrosoft updates Recall amid privacy concernsAmazon Launches Machine Learning IoT Analytics ServiceValve to support ASUS ROG AllyKudu Now a Top-Level Apache Project

Preventing Derivation

In general, disabling inheritance is a dubious idea. Yet under some circumstances it may be useful. To do this, declare the class in question (called A in our example) as

How to Derive from a Class Template

A template Related Posts Biased AI in Recruitment Raises ConcernsAdding Longs Without OverflowingArmed Commercial Drones To Be in the SkiesAmazon Launches New Cloud Development ToolsMoving a File Using Java

Microsoft All Talked Out, Cancels PDC This Fall

ew Orleans?A Microsoft spokesperson said today that the company would not hold its annual Professional Developers Conference (PDC) at its traditional time in the Fall this year. The company is

Transform Legacy Data to XML Using JAXP

he ability to parse and transform XML documents is nothing new for Java developers. There are several packages available that come with the tools to do it. But these products

Use C-Style Arrays as Containers

C-style arrays can be passed as containers to STL algorithms. The pointers to array elements can be used as iterators.Example: #include #include int main(){ int array[] = { 1, 3,

Inhibit Derivation from a C++ Class

If no other classes can derive from a class, then you know that all the pointers to that class point to objects of a uniform size. This can simplify memory

Switch Statements in Object Oriented Design

There is nothing intrinsically evil about ‘switch’ statements. However, they do sometimes result from improper Object Oriented design. There are twodesign principles to keep in mind.1. Open/Closed Principle: this states

Print the Length of the String Without Using strlen()

The following code reads one string, and prints the length of that without using strlen(): #include #include int main(){ char s[20]; gets(s); printf(” %d “,printf(“%s”,s));/*return type of printf() is int.

Pull a Date From SQL Server DateTime

SQL Server stores datetime data in 8 bytes. The first four bytes represent the date and the second four represent the time. To axe off the time part of the

Add a Tooltip for the MFC Dialog

This method works for the MFC derived class and was tested on a Dialog-based class. Set Active Project Select Project –>Add to Project –>Components and Controls –> VC++ Components –>