Archive for December, 2007

Design Pattern in Java 101 – Builder Pattern (Creational Pattern) »

Download Source Code Builder pattern is used to construct a complex object from simple objects step by step. E.g., I have a Message class public class Message { private String sender; private String recipient; private String header; private String body; public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; […]

Design Pattern in Java 101 – Visitor Pattern (Behavioral Pattern) »

Download Source Code NOTE: This is written for me to recap and relearn what I learnt before…. This article is written in order for me to recap what I have learnt and used before, though I know there are already many sites which talked about all these. Visitor Pattern defines a new operation to deal […]

iBATIS- Accessing Multiple Instances of Databases from Your Application »

While writing a Java application for backend processing, I encountered the need to access multiple instances of Oracle databases from one single application. I used iBATIS for my data access layer and to do this in iBATIS is very straightforward. Create the database.properties file which contains the information for the databases you want to access […]

Oracle – Understanding Your Database Update Statement »

Run the following SQLs to create the table and index create table mytable ( col1 number(12) primary key, col2 varchar2(100), col3 varchar2(100), col4 varchar2(100) ); create or replace function myfunc( col2 in varchar2 ) return number deterministic as begin dbms_output.put_line(‘Testing function’); return 1; end; / create index myidx on mytable(myfunc(col2)); insert into mytable values(1,’test’,’test’,’test’); The […]

Java – Writing An Automated Telnet Client »

Telnet is a common protocol that we normally used to connect to a remote server, especially in Linux or Unix environment. To programmatically automate a telnet session so that we can execute or retrieve information from a remote server can be easily done using Apache Commons Net. Below is the code that can be used […]

Vixta – Another Linux O/S »

Vixta is another Linux O/S based on Fedora. It can be run from CD, similiar to Ubuntu.

IBM Lotus Symphony – Another Alternative for OpenOffice »

IBM Lotus Symphony is a office suite which is currently in beta and available free for download. It consists of Documents Presentations Spreadsheets For those who are using OpenOffice, you can now have another alternative.

Free Diff Merge Tools »

3 great diff merge tools that can be used to compare files, directories of files and merge them. WinMerge is an Open Source visual text file differencing and merging tool for Win32 platforms. It is highly useful for determing what has changed between project versions, and then merging changes between versions. DiffMerge is an application […]

Free you mind using FreeMind »

FreeMind is a great free mind mapping software..

Java Native Compiler, Java Executable Wrapper »

JavaNativeCompiler (JNC) JNC is a Java to native compiler. It allows AOT (ahead of time) compilation of your Java applications. With JNC, you can create real standalone native binaries (.exe on Windows) which will no longer depend on a JRE.

Java – HashMap versus Hashtable »

This is one of the basic questions that is often asked by novice programmers. In summary, both are more or less the same, except Access to the Hashtable is synchronized while access to the HashMap is not. Iterator in the HashMap is fail-safe while the enumerator for the Hashtable is not. HashMap permits null values […]

Useful Eclipse Shortcuts »

Side note for useful Eclipse shortcuts. Of course there are many more which are not mentioned here. Ctrl+Shift+L Display shortcut keys. Ctrl+Alt+G Find text in workspace. Ctrl+Shift+R Open any file quickly. Ctrl+Shift+F Format source code. Ctrl+Shift+T Open a type (e.g.: a class, an interface) Ctrl+O Go directly to a member (method, variable) . Press Ctrl+O […]

Useful Unix Commands »

Some side note on some Unix commands. List will grow over time… Find new created large file for past 3 days # find /path -type f -mtime -3 -exec ll \+ | sort -rn -k5 | head -n 10 vi <esc>:g/^$/d This means that all the lines that just have a carriage return on them […]

Java Number Recognition System »

JavaANPR is an automatic number plate recognition software, which implements algorithmic and mathematical principles from field of artificial intelligence, machine vision and neural networks. I tested it to recognize normal numbers in JPG, GIF or PNG. It works quite accurately.

Multi-Platform File Splitter »

Tested HJ-Split, a multi-platform file splitter.

Video DVD Maker + VLC Media Player »

Playing around with free version of Video DVD Maker which allows you to grab your video from a camera or other source, convert it into an appropriate format and burn it to a DVD or a Video CD disk. and VLC media player – The cross-platform media player and streaming server VLC media player is […]

Oracle Queries for Performance Monitoring and Tuning »

Here are some Oracle queries I collected from various websites Resources in High Demand select active_session_history.event, sum(active_session_history.wait_time + active_session_history.time_waited) ttl_wait_time from v$active_session_history active_session_history where active_session_history.sample_time between sysdate – 60/2880 and sysdate group by active_session_history.event order by 2 Locked Objects SELECT o.owner, o.object_name, o.object_type, o.last_ddl_time, o.status, l.session_id, l.oracle_username, l.locked_mode FROM dba_objects o, gv$locked_object l WHERE o.object_id […]

WampServer »

Installed and tested WampServer = Apache, MySQL, PHP on Windows. Save all the hassles..

Free Photo Watermarking Software »

Finally managed to find a simple and easy to use open source free watermarking software. Watermark Creator

Wired and Wireless Network Monitoring using Microsoft Network Monitor »

Microsoft Network Monitor is a Network Protocol Analyzer to allow capturing and protocol analysis of network traffic (wired and wireless).