devxlogo

Tip Bank

Copying Files with File Streams

To copy the contents of one file into another, use the fstream classes. First, open the source file using an ifstream object, then create a target file using ofstream, and

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)

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

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

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

Placing Child Window

Question: How do I make a child window go behind its parent window when a button is clicked? I know self.focus() brings a window forward. I need the opposite of

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

Disabling Right Clicker on Mouse

Question: Is it possible to disable the user’s right click button using JavaScript? Answer: Is it possible? Yes. Oh, you wanted to know how to do it… Keep in mind,