The secret of the internet is the fact that no matter how small a knowledge is, someone out there will surely benefit from it.
6°
Six degrees of separation.
The small-world effect is very interesting especially in the world of information retrieval. No matter how unknown you are, the knowledge that you share to the world will eventually be found useful by someone else. This page is dedicated to the world-wide effort of information sharing.
Father’s Day
by Bobby Corpus
My wife Jenny created this very beautiful video for her father ( and my father-in-law ) for Father’s Day. Happy Father’s day Dad!
I’m so impressed by this video, esp because I’m in it (with my eyes closed, unfortunately) that I decided to post it here. The little girl in this video is my wife when she was a kid.
It was only recently that I’ve heard of Father’s day. Back in the province, we don’t celebrate it. Not suprisingly, because we don’t know about it. But anyways, happy father’s day to my father too!
Running ANT from within an Eclipse Plugin
by Bobby Corpus
This is once again one of those things which I tend to forget and I have to put them here in order for me to conveniently reference them when I need to. I am creating a plugin to launch my automated task which I wrote using an ANT script. The ANT script I wrote is customized using a build.properties file. Here is an example of an ant script.

The build.properties file contains the following:
message=Hello World!
To run the build.xml, I only need to right-click it on the Navigator to open the pop-up menu. I choose Run As to get the following sub-menu:

I choose selection 2 above to run the default target called “test”. The output looks like the following:

Now there can be many properties which I can configure which I do by editing the properties file. However, there will come a time when you will need to pass this program to someone else and you want to make it idiot proof. Or you yourself will get tired of editing the properties file and would want something much easier, like for example choosing from a drop-down menu. So in times like these, you would like to make a simple gui to configure your properties file. This is what I did. I created a simple eclipse plugin which I can just click on the tool bar in order to launch the configurator. Here is a sample configurator for theĀ build.properties:

Now, what I would like is after specifying my message and clicking OK, I will be able to run my ant script immediately. The most immediate implementation is to run the ant executable using Runtime.exec() command. However, the code is quite long and you have to specify the ant directory which might be different in other user’s environment. Also, you would want to capture the out put of the ant execution, so you will have to write another code to show the output in a gui. However, what if we could actually use the right-click mechanism, as shown above, programmatically?
Here’s how I did it. I made use of the org.eclipse.debug.core package to programmatically run the ant script. However, I need to generate a launch configuration which I can easily do by righ-clicking in the build.xml file and choosing “Run As-> Ant Build… “. Notice that the “…” means to open the Ant configurator.

Click on the common tab as shown above and click on “Shared file”. You can specify where the save the configuration file. The extension of this file is “.launch”, which you can easily find in the workspace.
In your plugin code, you can then launch this file using the following:

If you are wondering about “config/MyProject build.xml.launch”, this is the launch configuration generated above which I moved to the config directory. Also, the variable “proj” is defined as:
IProject proj = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProject(”MyProject”);
The code above will launch the ant script using eclipse mechanism and you can view the output in the eclipse console.
All Things Bright And Beautiful
by Bobby Corpus
Today is the 4th anniversary of my mother’s passing away. Ever since that time, every little thing that reminds me of her is very valuable. Like this letter which I’m holding right now. It is actually a love letter by my mother to my father. In the last section of the letter is a poem which my mother learned when she was 10 years old. She committed it to memory since that time and in her letter she dedicates it to my father. I did a google search for this poem and it turns out that it’s a song.
Here is the poem:
All Things Bright And Beautiful
All things bright and beautiful,
All creatures great and small,
All things wise and wonderful:
The Lord God made them all.Each little flower that opens,
Each little bird that sings,
He made their glowing colors,
He made their tiny wings.The rich man in his castle,
The poor man at his gate,
He made them, high or lowly,
And ordered their estate.The purple headed mountains,
The river running by,
The sunset and the morning
That brightens up the sky.The cold wind in the winter,
The pleasant summer sun,
The ripe fruits in the garden,
He made them every one.The tall trees in the greenwood,
The meadows where we play,
The rushes by the water,
To gather every day.He gave us eyes to see them,
And lips that we might tell
How great is God Almighty,
Who has made all things well.
And here is the song:
In 1967, Stanley Milgram started a research on how any person on earth can be connected to any other person using intermediate persons. These intermediate persons are friends or acquaintances of the previous person. He found out that at most 6 persons are needed in order for any two persons in the planet to be connected. This came to be know as the small-world phenomenon or 6 degrees of separation.