August 29, 2000

Making Better Use of Garbage Collector

Imagine you have an enormous object serialized on disk that you are using in memory, or that object is loaded in memory. You want to allow the garbage collector (GC) clean memory when it needs it, right?. Imagine you are about to run out of memory; do we really need

Implementing Callback Routines

One of the easier ways of implementing an event-driven programming model is through passing function pointers which are invoked when an event occurs. But because Java doesn’t support the notion of pointers, this convenient mechanism is ruled out. This fuctionality, however, can be achieved in Java by using the interfaces

Controlling Debugging Information

Debugging is a core part of application development in Java. Programmers tend to use System.out.println & System.err.println in the code everywhere, which becomes uncontrolled as the program evolves. This becomes a problem when moving the application to the production environment and controlling the debugging information generated by the class. A

Getting Around a Bug in Testing Your Applets

If you’ve tried using the Java Plugin to test your Applets and got a mysterious “Security Exception,” then you’ve run into a known, but unadvertised bug. For a complete description of the bug, see: The bug occurs when you attempt to load an Applet that lies in your Classpath.

Be Careful Before Returning Mutable Objects Through Accessor Methods

Accessor methods are those methods which provide access to the values stored in instance field. Mutable objects are those objects which providen certains methods which can change the instance data stored in them. You should always be careful before returning references to mutable objects from the accessor methods of your

Checking for Value “NaN”

Question: Why does my if statement if (final == “NaN”) { window.alert(“You…are…a…dunce. Hit reload to try again.”);} fail to detect when final is “NaN”? It always goes straight on to the else part, and then comes back with the answer “Required Percentage: NaN%.” Answer: If you put “NaN” in quotes

Date Conversion from Seconds to Normal

Question: Is there some way to write a function that converts a date that is in seconds since December 31, 1969, into a normal date format? Like this: date from (900,973,200) in seconds to (YYYY,MM,DD) or any normal format. Answer: The dateadd funtion takes three arguments: the date part, a

WAP Security Issue

Question: When encrypted information is being interchanged between a client and a “secure” server through WAP, does the information ever lie decrypted on the WAP gateway or does the client handle the decryption? Answer: Yes, it does lie unencrypted on the gateway. It’s the infamous security flaw with WAP, and

SQL with Unix Arguments

Question: How do I pass arguments from a Unix shell onto SQL for various SQL statements (e.g., select * from $tablename, create table $TABS, etc.)? Also, how do I get output from SQL within a SPL to several different files? So SQL executes many times and creates a different file

No more posts to show