Monday

WPF 1


This is a simple WPF GUI project. It uses some common layout containers.

Sunday

Java - Invalid Number Exception

public class JInvalidNumberException extends Exception {
String mistake;

public JInvalidNumberException()
{
super();
mistake = "Unknown error.";
}

public JInvalidNumberException(String reason)
{
super(reason);
mistake = reason;
}
}

Above is customized exception that is created to be thrown when a invalid postal code enter by a user.

Monday

MySQL note

MySQL does not have "SELECT INTO" statement. A similar statement in MySQL is "INSERT INTO"

INSERT INTO copy_table SELECT * FROM data_table;

The statement copies data from data_table into copy_table

Java data generator

// create child element
child_NumGp_SNO = doc.createElement("SNo");
child_NumGp.appendChild(child_NumGp_SNO);
String sno = String.valueOf(i+1);
Text txt = doc.createTextNode(sno);
// append child element
child_NumGp_SNO.appendChild(txt);

randint = r.nextInt(101);
System.out.print(randint + "\n");

child_NumGp_RAND = doc.createElement("Rand");
child_NumGp.appendChild(child_NumGp_RAND);
String randomint = String.valueOf(randint);
Text txt2 = doc.createTextNode(randomint);
child_NumGp_RAND.appendChild(txt2);


Above is part of Java code that will generate an output XML file that wil be feed by Serial Comm or Network Port to my earlier Line Graph program.

Thursday

Line Graph project

Fig 2

Fig 1

This program is created using C# with graph plotting control from Gigasoft

Not completed yet, but a least the graph is running

[12-May-2010]
Now my program is able to receive data from serial port. The data is displayed on the chart. (See Fig 2)

Wednesday

Stock analysis program using Perl and MySQL


Attach showing part of the perl code that write stock information to MySQL database. The completed code should able to read input list of stock to monitor from a text file, analyse SGX daily stock price in HTML file and write price and other information into a MySQL database.

At present, the program is able to analyse sgx HTML file and write data into MySQL. But the column alignment is a bit out.

Software used/installed
Perl - version 5.10
DBI
DBD-mysql

Heidi GUI for MySQL

Future work
Create a java program that reads from DB and display previous stock price record.

Tuesday