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

Exporting from FoxPro 3.0 to 2.6

Question: I have a table in FoxPro 3.0 that I need to export to FoxPro 2.6 to give to someone outside my company. However, when I export, the memo fields

MTS and Passing Direct Reference

MTS objects clients should never have access to unsafe references. A client application should never be passed a direct reference to an MTS object. Once such a reference is passed

Exception in Destructor

Question: If an exception is thrown in a destructor will the data objects in the class be destructed properly? Answer: Throwing an exception from a destructor is a bad idea

string.h

Question: I am a beginner with C++ programming. I was doing fine until I came to the string data type. Here is my problem: #include #include This gives me errors.

Strong Types

Question: How do you make the compiler generate an error when a variable is set to a value outide the range of the constrained type? For example; strong x; //strong

Using the ?: operator as opposed to if…else…

Question: Is there a problem with using the ?: operator instead of the if…else… construct? For example, see the following: if(iNum1 > iNum2) iNum3 = iNum1;else iNum3 = iNum2; The

Introspection of classes

Question: In Java using the java.lang.reflect classes, one can find out the name, class, and methods of an object simply by having a reference to that object. Is there a

Calculating interest without floating types

Question: How can you caluculate interest using only integers and no double or floats? Answer: This question can be of interest for anyone who is confined to ineteger arithmetic. Many

Passing a unction as an argument

Question: How do I pass a function as a parameter? Answer: First, let’s distinguish between a parameter and an argument. The parameter is the type of the object passed. An

C++ objects

Question: How can I declare a constant object that is actually constant? Answer: Here’s an example: const Date d; //create a const Date object Note that you can only invoke

anonymous unions

Question: I’m trying to find information regarding anonymous unions in C++. I hear that in C++, one is able to declare a union such as: union example{ int a; int

Inheritance and Memory Allocation

Question: I can’t create an instance of the derived class using operator new. The base and the derived classes differ only by a virtual function. The error messages I receive

Quickly initialize Variant and String arrays

Visual Basic doesn’t provide any way to declare an array and initialize its elements at the same time. In most cases you end up with setting individual elements one by

Replace the last occurrence of a string

Here is a one-liner that replaces the last occurrence of a substring in a string. It is slightly less efficient than using the InstrRev plus a Replace statement, but at

Count substrings with the Replace function

You can often use the Replace function in a smewhat unorthodox ways to simplify (and sometimes optimize) your code. For example, in order to count the number of occurrences of

Avoid append operations with the Replace function

I find the Replace function very useful when I want to avoid too many append operations just to insert non-printable characters. For example, the following statement: MsgBox “Disk not ready.”

Extract null-delimited strings

Most API function that return a string require that you pass a buffer where they can place the result as a null-terminated ANSI string (a.k.a. ASCIIZ string). The calling code

Using NetAddUsers

Question: I created a program to Add User Account to my NT Server. It reads from a text file which provides the user info. Everything works fine, except that the

Accessing a Workstation in a Domain

Question: I would like to know how to access a workstation which is configured and logged on to an NT domain, from another PC in a workgroup environment? Most of

Concatenate Variables Containing Numbers

Question: I need to know how to concatenate variables containing numbers, that is, string them together one after the other. Every method I know simply adds the various numbers together

Rotate an Image

Question: I’m creating a drag and drop program to design kitchens. How can I rotate a single picture using JavaScript? Answer: You can’t rotate an image using JavaScript. JavaScript doesn’t

Insufficient Key Field Information Error With RDS

Question: I am using the Dataspace and DataControl objects to interact with a database through Internet Explorer 4 using form elements. The data displays perfectly when I use this query:

Disable Browser’s Menu Items

Question: Can I use JavaScript to disable the one of menu items of Internet Explorer or Netscape Navigator? Answer: Sorry, you can’t modify the menus in Internet Explorer or Netscape

Function for Adding Sales Tax

Question: What function would I use to take a given amount of money and add 6% sales tax? Answer: In JavaScript you could use: function addSalesTax(SubTotal){ return SubTotal * 1.06}

Cannot Use JavaScript to Get Server Date

Question: How do I get the server date using JavaScript that is embedded in an HTML file? Answer: You can use server-side code (like Perl, ASP, and so forth) to

Resolving IP Addresses

Question: I require Visual Basic code to resolve IP addresses stored in firewall logs generated by Checkpoint Firewall1. The aim is to report company access by user (assigned dedicated IP

Reference an External JavaScript File

Question: How do you reference an external JavaScript file from an HTML page? Answer: You can reference an external JavaScript file from your HTML page similar to the way you’d

Cannot Align Prompts and Alerts

Question: I have alerts and prompts intermingled on a page that collects information from the user. Is there a way to align them all so that they do not appear