devxlogo

Tip Bank

Wrap the Result of an XQuery Query into an XML Document

Wrapping the result of an XQuery query into an XML document is very useful if you’re working with atomic values. The following Java program uses the net.sf.saxon.om.SequenceIterator and net.sf.saxon.query.QueryResult classes

An Improved szEncryptDecrypt VB6 Funtion

This is an improvement to the tip “Encrypt a String Easily.” I found that the szEncryptDecrypt function in this tip did not handle unicode strings properly, but otherwise worked well.

Converting an Integer to a C++ String

Boost libraries provide a better way to convert numbers into strings or vice versa. You must install the Boost libraries on your computer to make this work (click here for

Implement mouseDragged and mouseMove Events

This tip shows you how to implement mouseDragged and mouseMove events for moving components into a frame: import java.awt.*;import java.awt.event.*;class f extends Frame implements MouseMotionListener,MouseListener{Checkbox CB=new Checkbox(“Label”,true);Button BP=new Button(“BUTTON_1”);Button B=new

Viewing Contents in the Background Form

Suppose you’re working on multiple forms and you’ve got a visual dependency on data in one or more forms (something like the Aero effect in Vista). In such cases, use

Using the &ltidbag&gt Element in Hibernate

Hibernate’s facility allows you to map many-to-many associations and collections of values to a single table with a surrogate key. The following code shows an example of mapping: &ltidbag name=”cars”