devxlogo

Tip Bank

Determine Prime Numbers with XQuery

Did you know you can determine if a number is prime by calling an XQuery query? Here’s the code: &ltprime_numbers&gt { for $a in (1 to 50) return( if(not(some $counter

Monitoring AWT Events with the AWTEventListener Class

The AWTEventListener class’ sole purpose is to view events. All you have to do is to implement the eventDispatched method. The following application demonstrates how: import java.awt.*;import java.awt.event.*;public class EventTest

Checking on Daylight Savings Time

Checking for Daylight Savings Time is one of the most common date checks developers perform. .NET provides an easy method to do this. In .NET 1.1, use the Timezone class’

Calling an SAP Function Module from Java

To call an SAP function module from a Java application, you first need SAP JCo (Java Connector); you can download it from SAP’s site, though you need an account to

Insert an XML Schema into an XQuery Query

Use the following code to insert an XML Schema into an XQuery query. The following code assumes that the XML Schema is: file:///C://Data_Local//xml//docs//AirWings_xslt_xmlschema.xsd and the XML file is: file:///C://Data_Local//xml//docs//AirWings_xpath_xslt.xml Import

Show() vs. ShowDialog() in .NET

The form class’ ShowDialog method functions differently than its Show method. Here’s how: ShowDialog‘s returned value can be used to determine how the user closed the form (using the DialogResult

Override Base Methods in a Form

If one class is inheriting from another class, a quick, easy way to find the available overrides is through .NET’s IntelliSense. Simply type “override” in a class and .NET will