October 25, 2003

Minimize Java Distributions with an Automated, Custom JAR File

his article presents a solution to a problem that you might not have known you had?the size of your Java code. Java programs can run the gamut from very small to very large. In fact, the variance is much larger in Java than in any other language. This is partly

Creating Container-managed Entity Beans with JBoss

n Entity Bean is an Enterprise JavaBean (EJB) that represents a persistent object in a relational database. JBoss provides two methods of entity bean persistence, Bean Managed Persistence (BMP) and Container-Managed Persistence (CMP). With BMP, the entity bean developer must implement all the persistence logic. With CMP, the application server

A VBScript Function that Emulates the VB IIf()

If you’re still using classic ASP, this is a simple little VBScript function that emulates the VB IIf(). It helps in intializing and making your code look a little cleaner. # Language: VBScript’# asp alternative to the inbuilt VB function IIffunction iif(boolEval, trueStr, falseStr) if boolEval then iif = trueStr

Create a Statically Initialized List of Objects

A group of objects can be organized into arrays or collections. Arrays are nice because you can statically initialize them, but collections have far more functionality. Using this tip you can have your array and iterate it too! In your class, create your statically initialized array as always: public static

A Better Version of Bubble Sort

This version of bubble sort stops when there are no more exchanges and it also sorts a smaller range each time. void bubbleSort3(int x[], int n) { bool exchanges; do { n–; // make loop smaller each time. exchanges = false; // assume this is last pass over array for

Format Color for HTML

This function, which converts a color value into a string suitable for HTML, formats an RGB color value, palette index, or system color constant. You accomplish this by breaking out the individual color values for red, green, and blue, then recombining them in the opposite order Windows likes, so HTML

Copy One Array to Another Without Using Loops or Conditions

Here’s the code the usage of arraycopy: public class testarrcopy{ public static void main(String arg[]) { //Array of any object can be user defined object String source[] ={“one”,”two”,”thr”,”four”,”five”,”six”,”sev”,”eight”,”nine”,”ten”}; //Array of any object can be user defined object String dest[] = new String[5]; …some conditions or calculations.. /* *This method copies

Change-proof Your Flat-file Processing with XML

very new enterprise system built today has to integrate with and support existing systems. Since the earliest days of programming, passing data between systems via flat files has been a common operation?and developers get to write the code to transfer the data from one format to another. As unexciting as

Time Conversion GMT to Current Time and Back

When you’re working in several time zones, you need to save date values in a common format?the most obvious one being GMT. The following stored procedures store datetime in GMT and retrieve date in current PC datetime. /*Convert Datetime to GMTTime FormatAuthor :PPG Dinesh AsankaDate :2003-08-23*/CREATE PROCEDURE [dbo].[Convert_DateTime_to_GMT]@dt_Date_Time as datetimeASselect