Tuesday, March 31, 2009

How to apply/create an svn patch (for beginners)

To apply an svn patch (your_patch_file.patch) go to the root of your source directory, and place the patch there. (or you can specify the location of the patch with the patch name if it is not placed in the root of the source tree.)
patch -p0 < your_patch_file.patch
Similarly if you have modified the source tree, and want to create a patch for the changes that you made, from the source root:
svn diff > your_patch_file.patch
or giving the files/folders that you need to get the diff of, along with their relative path.
svn diff path1/file1 path2/file2 path3/file3 > your_patch_file.patch

your_patch_file.patch will be created inside the root of the source tree. (You may specify the location too, as usual)

Similarly,
How to get the svn diff between two commits?

svn diff -r 5224:5225 > your_patch_file.patch
gets the commit 5225 for the particular directory.

svn diff -r oldversion:newversion files > your_patch_file.patch
gets the diff between the commits newversion and oldversion.

Sunday, March 29, 2009

Online text-to-speech utilities

Text-to-speech (TTS) utilities are useful utilities that are a fun to try. Moreover, they increase the accessibility of the products and web sites.


More languages, more voices, and more effects, with a realistic image representing the voice. Try this text-to-speech tool for a list of languages including English, Chinese (Mandarin, Cantonese, and Taiwanese), German, Hindi, Portuguese (both European and Brazilian), and many more.


Saturday, March 28, 2009

SVN Commit in windows [Could not use external editor to fetch log message]



Trying to commit to the repository:
E:\INDUSTRIAL TRAINING\LEAD\event-notifier>svn commit
svn: Commit failed (details follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and
no 'editor-cmd' run-time configuration option was found


Let me read the error message:

Oh.. yes,
It just needs the log message, and as no external editor is set to fetch the log message, I should use the -m option to specify the log message for the commit.

E:\INDUSTRIAL TRAINING\LEAD\event-notifier>svn commit -m "Moved the pom and build.xml inside the event-notifier folder"
Deleting build.xml
Adding eventNotifier\build.xml
Adding eventNotifier\pom.xml
Deleting pom.xml

Committed revision 179.
[Also it seems 179 will be the final version for our svn branch, most probably!]

Success!

Friday, March 27, 2009

Unicode support for Windows 9x

Unicode support for windows is not a new topic to discuss at all, since Windows NT. When it comes to internationalization (i18n) Unicode plays a major role. Hence the usage of Unicode is obvious and not a strange topic to discuss at all. But when it comes to the older Windows 95/98/ME Systems, we have to consider more factors. Most software have stopped supporting these legacy windows operating systems at all. In that case, they have no need to worry at all. If an application wants the Unicode support, yet running on these obsolete versions of windows, which do not have the native Unicode support, the problem arises.

To solve this issue, Microsoft Layer for Unicode on Windows 95/98/ME Systems [MSLU] has been introduced. This component allows us to write a single Unicode application which can run on all the platforms, by providing a layer over the Win32 API on those earlier versions of Windows. MSLU contains two parts - Unicows.dll and Unicows.lib. MSLU is easy to use. Just compiling the application as a Unicode component and adding the Unicows.lib with the other libraries is enough. Similarly hence Unicows.dll doesn't load MSLU at all when using Windows NT or later, introducing this layer, doesn't cause a performance cost.

However it should also be noted that, MSLU not essentially will give the obsolete windows 9x versions, the same multilingual support that the later versions of windows provide. The application does get a Unicode face from MSLU, but still has to deal with a non Unicode operating system internally.

Tuesday, March 24, 2009

Performance Testing and WSO2 Carbon









Finally we were wrapping up the Messagebox program we had created using Apache Axis2. Now comes the final point. Yes, we had to do a performance analysis using Apache Jmeter. Our Messagebox program has four operations: createMessagebox, storeMessages, takeMessages, deleteMessagebox. Being a web service, we have the axis2 archive (.aar) of our program.

We have developed a client to run our web service. Given the WSDL, wsdl2java will auto-generate the Client Stub and the Server Skeleton. Completing server skeleton with the necessary logic obviously has cost a much longer time, when compared with the writing of client code using the client stub. Now during the performance testing, we are going to use the same web service, but we will not use the client we have developed. Rather we will be using our test plan generated using JMeter, as the client to run our server. Now we need SOAP/XML-RPC Request for each operation.

This Jmeter performance analysis will be saved as a .jmx file. In the Admin Console of WSO2 WSAS (Web Services Application Server or WSO2 Application Server), we have "Add Axis2 Service" option in the left hand side panel. I uploaded our aar using that Add option. A success message appeared as expected. Then I clicked the List Menu for deployed services. There I clicked Try this service option for the MsgBoxService. I was taken to the Try the MsgBoxService service. 

WSAS has a nice GUI with textboxes to input the values. Getting the output instantly, I was walking through WSAS to see more. Found something under the monitor menu. SOAP Tracer! I configured the Configuration Status to ON. A warning says “Tracing will have a performance hit. Use with caution.” I will not overuse this functionality however. Then I went back to try the service. After trying all the four operations, I came back to the SOAP Tracer. SOAP messages for both the request and the response. Then it took me just minutes to copy-paste those SOAP messages for the four operation requests, into the respective SOAP/XML-RPC Request of Jmeter.

The conclusion of the performance analysis was not much difficult after that. Just adding a variable in place of the input value, a counter to have about 1000 users each user as a thread, timer, Loop Controller to send 10 msg for each user’s msgbox, and finally Graph results to see the performance of each operation visually.

Event Notifier Service for LEAD System

EventNotifierServce is a notification system developed for LEAD [Linked Environments for Atmospheric Discovery] System developed at the extreme labs of Indiana University.
When a scientist runs a workflow, he can provide his interested events to the EventNotifierService with a notificationAddress. The service will listen to the workflows invoked by the scientists and notify them when an interested event occurs. Hence the Scientist can leave the system as he adds a request to listen to a particular workflow in the LEAD System, and hence his time will be saved.


Requirements
The program is tested to be run in Windows XP and Linux environments.


Setting up the event Notifier Service [More updated information can be found here.]

1. Download the Event Notifier Service from the SVN Tree:
https://svn.wso2.com/projects/lead/repo/event-notifier/
You will need the authentication password to access this SVN tree.
Alternately, you can download the files as archives from here.
This includes the messagebox code as well.

2. Download and set up the WS-MESSENGER, a messenger service built at Extreme! Labs using XSUL.

3. Configure the parameters included:
You will need to configure these files, which are inside the resources folder.
db.config : This config files contains the details needed to connect to the relevant database
epr.config : This config file mentions the end point reference
MailSender.properties : This properties file mentions the properties of the mail server. Currently the properties file has gmail as the mail server. When chosing the other mail servers or when you create your own mail server, you have to replace this properties file with that specific to your server.

4. Include puretls.jar and notification-types.jar included inside the lib directory into the axis2/lib.

5. Create a database 'EventNotify' and create tables using the db-creation.sql file included inside the resources folder.

6. Manually install the jars included inside the lib directory, and build using mvn. Alternatively you may prefer to use ant to build the project.
wsmg-1.76.1_a5.jar can also be downloaded from the original location:
notification-types.jar is an XMLBeans generated jar file for the given events schema.


You also need to manually download and install three jar files from the sun java web site due to the licensing requirements.


7. Deploy the generated zip file into the axis2 server.



Running Event Notifier Service
1. Starting the Messenger Service
Start Tomcat
Start Messenger

2. Starting the EventNotifierService
Start Simple Axis2 Server

Now the EventNotifierService is ready to be used.


Architecture

EventGenerator
This program includes a simple LEAD simulator which generates LEAD event notifications by reading the log file, leadevents.log included inside the resources directory.
In case of unavailability of the real LEAD system, you may use this program to simulate the system.

For this you have to run the EventGenerator.java included inside the edu.indiana.extreme.www.xgws.eventGenerator package.


Client
Client program included inside the syncClient package can be used to test the service. It will get the WorkflowID, eventsInterested, notificationMedium, and notificationAddress as String input. Here you may give multiple addresses and the eventsInterested as a String with the elements separated by a comma.


Limitation
The default notification medium is assumed to be email, and in case of email, the notifications will be sent as the events are received. In case of the other media, the events will be saved into an events table. If the notification medium is set to email, our program will handle the notification part, that is, it will notify the users as well. But as we haven't implemented the code for the other media, like SMS and IM, the program will save the relevant notification to the events table, and the notification part should be handled separately.

It should also be noted, in case of unavailability of the database the program will run in inMemory mode, where concurrentHashmaps are used to represent the tables, clients, events, and interests.

Monday, March 23, 2009

Some Interesting Reads..

Welcome to my blog! I am listing down some important notes that I found over the web in this post.

using AC_CANONICAL_TARGET, and  The canonical target are nice posts on compilers and auto tools.

OSGI for beginners and Supporting OSGi Bundles in the Java Module System discuss the framework for the Java Module System.

A list of important sql commands.

Writing Styles
How To Write A Dissertation
Wikipedia:Manual of Style (words to watch)
Advice to systems researchers


Testing the syntax highlighter with the help of HTMLEncode below. ;)



<pre name="code" class="Java">//my code starts here
     private static void initializeParams(
            String name, String email) {
        try {
            initialize(name, email);
        } catch (Exception e) {
            String msg = "Unable to initialize";
            log.error(msg, e);
        }
    }
// my code ends here.
 </pre>