Software Development

Java Threading

November 21, 2009

TimerTextField.java import java.util.Date; import javax.swing.JTextField; public class TimerTextField extends JTextField implements Runnable { private boolean gogo = true; @Override public void run() { // TODO Auto-generated method stub Date d; while(gogo) { d = new Date(); this.setText(d.toString()); this.repaint(); try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } [...]

Read the full article →

Java Navigation

November 14, 2009

Main.java public class Main { public static void main(String[] args) { new Apps(); } } Apps.java import java.awt.Component; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; public class Apps extends JFrame{ private JButton jbsave; private [...]

Read the full article →

Java Hashmap

November 13, 2009

Pet.java public class Pet { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } } Apps.java import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.FileReader; [...]

Read the full article →

Java Array

November 13, 2009

import java.util.Arrays; public class MainProg { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int num1[] = {1,2,3,4}; int num2[] = new int[4]; int num3[] = new int[4]; // to populate for (int i=0 ; i < 4 ; i++) { num2[i] = i; } Arrays.fill(num3,0); // [...]

Read the full article →

New Oracle SOA Book

June 25, 2009

Are you new to SOA and would like to learn how Oracle SOA Suite fits into the SOA world ? Or are you a SOA professional and looking for an all in one book on Oracle SOA Suite? Then wait no more, after a few months of waiting, Matt Wright and Antony Reynolds finished the [...]

Read the full article →

Reading CSV File Using C Program

June 2, 2008

Since I’m on an integration project, I’m mostly dealing with transferring of data from two or more systems whether it’s from the legacy system or newly implemented system. Most of the type of data movement is sending CSV files to and from the different system. Here is a simple tutorial on how to read CSV. [...]

Read the full article →

Determine the File Count in Unix Directory

May 21, 2008

To determine the number of files in the Unix directory, use the following command. ls -l | grep -c “^-.*”

Read the full article →

Merging Files in Unix

May 9, 2008

You have multiple files in containing data in similar format and wanted to consolidate in a single file. This is usually the case if you have a daily log that you want to place an archive copy in a single file in weekly or in monthly, yearly. The basic syntax of merging file is cat [...]

Read the full article →

Writing Files in Unix

May 9, 2008

To write files in Unix, the syntax is echo > Example echo “This is my message.” > myfile.txt To add another line in the myfile.txt, use the following syntax. echo “This is my second message.” >> myfile.txt You may notice that double greater than sign (>>) is used instead of single greater than sign. This [...]

Read the full article →

How to display newline in Excel?

January 12, 2008

The commonly used to display newline in Visual Basic is using VbCrLF. But the problem is you will see a small rectangle at the end of the line. PLAIN TEXT Visual Basic: Dim strFirstLine As String Dim strSecondLine As String   strFirstLine = "This is the first line" strSecondLine = "This is second line"   [...]

Read the full article →