devxlogo

The Latest

File Properties

Question: How can I retrieve a file’s properties? Either using an API call or a VB Control (i.e. version information)? Answer: To retrieve the file properties displayed on the property

VB and Web Development

Question: We have several applications developed in VB. What are the best alternatives for making these applications Web-enabled, and what are the advantages and problems associated with them. Answer: If

Simplify DHTML Scripting With SrcElement

Browsers Targeted: Internet Explorer 4+ The SrcElement DOM object is generated any time that an event is called, and it contains the element that called the event in the first

The Standard C++ Naming Convention

If you’re looking for a “house style” of naming convention, you can adopt the one used in Standard C++. It uses all lowercase letters for identifiers, and underscores as word

The snprintf() Function

The C99 standard defines a new version of the function sprintf(), namely snprintf(), with the following prototype: int snprintf(char * restrict s, size_t n, const char * restrict format, …);

The “Maximal Munch” Principle

Every compiler has a tokenizer, which is a component that parses a source file into distinct tokens (keywords, operators, identifiers etc.). One of the tokenizer’s rules is called “maximal munch”,

‘Restrict’ Pointers

One of the new features in the recently approved C standard C99, is the restrict pointer qualifier. This qualifier can be applied to a data pointer to indicate that, during

Managing the Processes on Your SQL Server

You can view a list of the processes currently running on your server by executing the sp_who system stored procedure. You can also view a list of active processes by

Passing a Date With the Query String

Question: Can I pass a date with the query string? Will the slashes cause a problem in this example? testing.asp?date=03/01/00 Answer: Yes they will. You will need to “encode” the

Create a Collapsible Tree in IE5 Using SrcElement

Browsers Targeted: Internet Explorer 5 Tree structures appear quite often over the ‘Net, and they are becoming especially prominent in the face of the emergence of XML. Fortunately, tree structures

Determine Your Heap Size

The following example program prints out both the total and free memory sizes, allocates a chunk of memory, and then prints the memory sizes again. If the initial size of

Font Metrics

Font properties that affect the rendering of strings are represented by the FontMetrics class. You can determine the FontMetrics of the current font in a graphics context with Graphics.getFontMetrics(). If

Beware of Static Finals

Consider this scenario, you define a public static final variable in one java file, and access the variable in other java file. Now, if you change the value of static

Remote File Size

Question: How can I discover the size of a remote file stored on an HTTP server? Answer: The HTTP protocol supports the transfer of extra information about thecontent referenced by

Determining Heap Size

Question: How do I find the size of the heap memory that is available for Java program? Answer: The maximum size of the Java heap is fixed by the JVM

Form Input and JSP

Question: I want to collect form data in a JSP page where the form issubmitted by one of many possible links (possibly passing values usingURL rewriting). In one case, I

Destroying Objects

Question: In VB, you can release the object’s memory with the following: set object = nothing How do you accomplish the same thing in Java? Answer: The analogous way of

String Search Mechanism

Question: How do I do a string comparison where I want to determine if onestring is contained within another? For example: Str1 = “Degree in IT”;Str2 = “Diploma or Degree

ServerSocket Port Binding Error

Question: My Java server compiles perfectly, but when I try to run it on mymachine I get an error when it tries to open up the ServerSocket onport 2525. I

JVM Process ID

Question: On a POSIX-compliant system, is there a way to get the process ID ofthe JVM running the current code? Answer: There is no standard means of obtaining the process

Date Arithmetic in Java

Question: I have a ResultSet created using JDBC and it contains some datefields. Now I want to subtract one date from the other. Howdo I do this? Answer: Date arithmetic

Reloading Java Classes in JSP Development

Question: How can I force a reload of a JavaBean that is being used in a JSPpage? The problem is I am developing a JSP-based Web application andI need to

Entering Information Into Two Tables at Once

Question: I have two tables: Items_table: Item_id (primary key) Description (foreign key) Item_priceDescrip_table: Description (primary key) Item_type How do I enter information into the two Description columns simultaneously? Answer: An

Changing a Column Name Within a Table

Question: Is it possible to change the name of a column within a table after it has been created? For example, I want to change the column “Name” to “FName”.

EXE Starts and Ends Immediately

Question: When I build my application as an EXE and run it, the application comes up and then immediately disappears. What is wrong? Answer: You need to create an event

Filling a Field with Data

Question: How can I fill a numeric field with a sequence of numbers using SQL? For example, I want a field named NUMBER to contain the numbers 1 for the

Restricting Users’ External E-mail Access

Question: We have a private WAN network with Exchange Server 5.5 and also have one inbound/outbound Internet mail service for all people to use to send Internet e-mail. I want