The city of life and death

I have just come back from theatre, depressed and a little disappointed. Although shocked the realistic visual affect, the movie is not as good as I expected, there are quite some space for improvement  to catch up with the famous Schindler’s List, such as the script, filming and music. Anyway, the work could be encouraged, it show the world, from the most direct angle, how much pain Chinese has suffered in this disaster.
The days of the winter of 1937 in Nanjing, is unforgettable. I feel so luck that I was not there at that time, every time I try to feel the hopeless and suffering of those people, I can’t help trembling. I began to know how bad it will be when people becoming crazy, especially when it is not a individual behaviour, but a well planed, orgnized and executed collective operation. But this is not the most horrible thing, try to think about this question: what make people lost their human mind and turn into devil? Will be one day, the same thing happen again?
I truely hope to see peace and love, all around the world, all my life.


Example of poor-user-experience software, WMDC

A bad designed software could really make people mad. I have spent so much time and patience looking for the answer how to install Windows Mobile Device Center(WMDC) on Vista business N  64bit, simply because this crap only throw me a "The update could not be installed because at least one Windows component required by Windows Mobile Device Center is missing " dialog. How could a software be worse than this?  People are not expecting to see something *UNKNOWN* is missed!!!!!!!!!!

Anyway, I got IT stuff solved my problem. Here is the solution:

1. Download a installer of Windows Media Player 11 for XP 64bit.

2. Start the installer, after one looks-like-not-respond minute, the installer will prompt you to start download a upgrade package, which is around 128M big.

3. After complete the upgrade, you should be able to install WMDC.

Stupid software!

Little ‘white’ and ‘black’

I get two new friends today, one black and on white. The black one, ThinkPad X200 7457-4AC note book, and the white one, D-Link DI-524M wireless router. I love Mac, but I’m also a ThinkPad fan, fascinated by its classic beauty, it’s amazing durability. For this reason, lots of ThinkPad fans sweetly call their black box ‘little black’. I have been always look forward to have my own ‘little black’ one day, in fact, I have seriously planed to buy it for several times. Any way, I finally have it today, it is really not surprise, or excited when I  take hold of it, like a old friend gets back.

While my white friend is quite different. I have read about it for some quite time, knowing it’s a reliable gadget. But when I open the box, I still can’t link the real one to the image in my head, It’s much smaller and much smarter. 

My two new friends are all small in size, but it doesn’t mean any small in functioning. In fact, they are all powerful and reliable, and to my surprise, they are very well in working together. I can very easily pick up the signal with two walls between the little black and the little white, and watching streamed video without buffering.

I love my little two friends 🙂

照片 008

Debugging the java STAF service

Service debugging is a big challenge for STAF service developers, based on its register-and-use nature, and that may be the reason why debugging STAF service is a pop topic in the STAF forum and mailing list. Reading the debug tutorial is well worthy to me, it not only tells you how java service actually works in STAF system, but also something I ignored in Java. Let’s find out these interesting things:

First, you need to enable remote debugging for the JVM on which your service runs. For the JDK later than 5:

STAF local SERVICE ADD SERVICE Device LIBRARY JSTAF EXECUTE {STAF/Config/STAFRoot}/services/device/STAFDevice.jar OPTION JVMName=Device OPTION "J2=-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=7778"

Second, you need to do configuration for you debugging client, I mean eclipse:

    1. In Eclipse, navigate to Run | Debug
    2. Select Remote Java Application , on the left column. Click New , on the bottom of the same column.
    3. Fill out the parameters configured in the JVM to the corresponding field, done!

Congratulation, you are ready to debug your first Java service for STAF 🙂

Memo for writing STAF service using java

I spend quite some time trying to write a "hello, world" STAF service with Java. After lots of the failures, here is my conclusion:

1. Write your service implement the "STAFServiceInterfaceLevel30", there is a complete tutorial on the office STAF web site on how to write code. There is one thing to mention though: A skeleton service, which is only implement all the required methods with "return null; ", will failed in registering itself to STAF. STAF will return an error like this:

Error submitting request, RC: 38
Additional info
Error initializing service, jstaf, Result: java.lang.AbstractMethodError

2. Compile the java source file to class file.

3. Create a MENIFEST.MF file with blow content:

   1: Manifest-Version: 1.0
   3: Name: staf/service/info
   4: Service-Class: Service1


Notice: the empty line #2 and #5 is required, according to some users experience.

4. Create a folder ./STAF-INF/classes, can copy the class file to this folder.

5. Create jar file with command "jar cfm service1.jar MANIFEST.MF STAF-INF". The jar structure is like blow( use jar tf service1.jar to print ):


6. Register the jar file as a STAF service:

C:>staf local service add service srv1 library jstaf execute "c:Documents and Settingspyinworkspace_EuropaStafService2binservice1.jar"