March 30, 1999

Setting Heap Sizes

If your Java program requires a large amount of memory, it’s possible that the virtual machine will begin to throw OutOfMemoryError instances when attempting to instantiate objects. In some cases, this may be the result of a programming error, but in others, it’s simply a result of your program legitimately

Make ASP-Generated Code Easier to Read With VbCrLf

Technically, neatness doesn’t count in the world of HTML source code. However, nicely formatted source code makes debugging easier and adds a professional touch to your work. That’s why HTML text editors usually generate very readable source code that includes line breaks and indentations. You may have noticed that HTML

Using Multiple Submit Buttons with Select Case

It is common to have a Web page that calls itself. On this page, you may want to have many buttons that will each produce a different call. An example is a page that allows you to navigate, add, edit, or delete a record/recordset. You can accomplish this by appending

Embed a User ID and Password in a URL

Frequently, a Web page or an FTP site has protected areas open only to those with a valid login. As you browse to the page, a form appears querying the user id and password. While this feature is nice for a human user to log on interactively, it could be

Use BreakIterator to Parse Text

Parsing text is a common, complex operation. For example, your application might need to allow users to enter text and then break the text into separate words or sentences for processing. On the surface, this task seems easy. In the case of sentence parsing, for instance, it may appear that

Initializing const static Data Members

The C++ Standard now allows initialization of const static data members of an integral type inside their class. #include class Buff{private: static const int MAX = 512; //definition static const char flag = ‘a’; //also a defintion static const std::string msg; //non-integral type; must be defined outside the class bodypublic://..};const

How to Change the Text Color of a VID OptionGroup Script Object

The Visual InterDev 6 OptionGroup design-time control (DTC) provides several properties that you can set. These properties include whether or not to add a border around the group and whether to align the radio buttons vertically or horizontally. Unfortunately, you can’t set the text color using the DTC. However, you

A Simple Way to Detect Client Browser Type

There are so many tools and techniques to detect the client’s browser type. However, if you want a quick two-minute solution or you just want something simple, use this code to get the client browser: Dim mszBrowserTypemszBrowserType=Request.ServerVariables.Item(“HTTP_USER_AGENT”)Response.Write mszBrowserType You may get output such as this: Mozilla/4.0 (compatible; MSIE 4.01; Windows

Exceptions During Object Construction Don’t Cause Memory Leaks

Operator new performs two operations: it allocates memory from the free store, and it constructs an object on the allocated memory. The allocated memory doesn’t leak when an exception is thrown during the construction process. The memory is returned to the free store by the system before the exception propagates

No more posts to show