Tip Bank

DevX - Software Development Resource

Implement a Link Using XSL

Let’s say your XML looks like this: default.aspx?ID=13 Now, you need to transform this tag via XSL to the HTML tag: . The following XSL will do the trick: new

DevX - Software Development Resource

Count the Number of Occurrences of a String Within a String

The select statement below takes the name “george” and finds how many occurrences of “ge” appear within it. select (length(‘george’) – length (replace(‘george’,’ge’,”))) / length(‘ge’) countfrom dual/ COUNT———- 2 Using

DevX - Software Development Resource

Look Up a DataSource Object in Your Web Server

This code demonstrates how to look up a DataSource object in your Web server using JNDI Lookup. import javax.sql.DataSource;import java.util.Hashtable;import javax.naming.InitialContext;public void findDatasource() { // Initializing DataSource object DataSource dataSource

DevX - Software Development Resource

Sort a Collection of Objects

Suppose you have objects of type MyClass. Further assume that you have a collection (named myCollection) containing objects of type MyClass. To sort this collection, follow these steps: MyClass must

DevX - Software Development Resource

Track Process Runtime for Perl Scripts

For any script that takes more than just a few seconds to run, it’s always a good idea to track the runtime itself. This is especially useful in the development