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.