WS-Security vs SSL

>> Thursday, May 29, 2008

It seems some people are taking Web services security so serious. No you it is not a must to use WS-Security to secure your Web service communications. Most of the time the plain old SSL is enough.

If

  1. you are using http for communications
  2. message exchanges are always between two nodes and doesn't use multiple hops to go from source to destination
  3. not worried to encrypt only parts of the message. i.e. you want to encrypt the whole message
then you are fine with SSL over HTTP.

There are few advantages in using SSL over WS-Security. First its much simpler and easier. Most of the web container, like Tomcat or http implementations like httpclient supports https by default. You will have to do minimal changes to enable https.
And WS-Security might be complex and hard to get working.

So whenever your answer is "Yes" to all the three questions above, you are fine with SSL.

Read more...

Visible Human Project

It is great to see a profile of our body animated from head to toes with 135 transverse sections. Check whether you can identify individual organs like heart, brain, lungs, etc., Amazing isn't it? Go to original web page for more animations.

(Original image extracted from : http://www.madsci.org/~lynn/VH/Transverse.gif)

Read more...

Answers to Interesting Questions

>> Sunday, May 04, 2008

Here are the answers to "Interesting Questions", I posted earlier.

1. Imagine you were standing on South pole. Whichever direction you chose to go, it will be north. Travel one mile north. Then go 1 mile east. You will be traveling in a circular path, centering the south pole. Then when you come back south 1 mile, you will be on the south pole once again. Your path will be like a pizza piece. Ok, we have one. What else?
Time to goto North pole ....... What ??? Yeah, you will get infinite points like this.
Stand 1+(1/(2*pi)) miles away from the north pole. Now travel 1 mile north (you will be traveling towards north pole). Then go 1 mile east (you will be going exactly one mile around the north pole). then when you go 1 mile south, you will come back to the same location you started. We selected the distance so that, when we go one mile east, you will be going in a circular path around the north pole and you will go exactly one time around north pole.

There will be infinite number of points like this, which will be on a circle with radius = 1 + (1/(2*pi)) miles and making north pole the center. So do we have more?? Yes !!

How about going around the north pole twice to make that 1 mile. So you will start 1 + 1/(2*2*pi) away from the pole. Like this you can start at any of 1 + 1/(2*n*pi) points from the pole, which will be again infinite combinations.
So you will have infinity * infinity points to fulfill this requirement.

2. This is again tricky :). This is how you do this. You switch on any of the three switches, for about 10 minutes. Then switch it off. Then switch on, one of the other two. Its the time to go to the room now.

If the light is on, then what you have set just now is the switch.
If the light is off, touch the light.
If it is hot, then the switch is what you switched on first. The bulb is hot as it was on for 10 minutes (that is the trick).
If it is not hot, then it is the switch which you never touched.

3. This is completely based on assumptions.
Assume you have 3 windows in an apartment and there are 20 houses in an apartment complex. Assume we have 3 apartment complexes in a block and there are about 200 blocks in your city.
Summing all these info together, we will have about

3 windows/house * 20 houses/complex * 3 apartment complexes/block * 200 blocks/city = 36000 windows/city.
Let's say you want to earn $20 per hour and you can clean 2 windows/hour. Then to clean all the windows you will charge (36000 windows/city) * ($20 per hour/ 2 windows/hour) = $36000 * 10

4. There are different ways of doing this. The one I think the best is to use a ship. Mark the water level on the body of the ship first. Then put boeing 747 of whatever object, that you want to weigh on the ship. Get the difference in water levels and use Archimedes' principles to get the weight.

Will post answers to the next two later.

Read more...

I think we need Axis2 "Lite Edition"

Last week I was desperate on a particular instrument on eBay and I was bidding like crazy. There were only one more person on this and I wanted to bid at the last 10 secs so that I could get it without increasing the price so much.

Since this was a trivial task, I searched for softwares to do this, and I saw couple of people earning money selling these software.

Interestingly eBay provides a Web services API, which anyone can use to write a tool like that. I wanted to write this as a light weight Swing application, but I wanted to use Axis2 for this. When I looked at Axis2 distro, I was not happy with it, coz we have lots of jars inside our distro which our code was dependingupon. If I am writing a software like eBay trader, which will run on some ones desktop, may it be a small webstart app or a swing app, it should be light weight.
To send bit of SOAP messages, I don't want to have 20 odd jars, especially if this app becomes a webstart app. So I think its the time to start thinking about Axis2 lite edition, which can be used at these sorts of cases. Yes, Axis2 can be for real pros, who needs real B2B stuff and yes Axis2 supports them without any trouble.
But wait .. it should be able to help me with these also. I think Axis2 should come as a lite edition, with max of 5 jars in total, which will help to do these sorts of apps. I think I proposed on minimal jar distro to Axis2 list, but I didn't see any movement towards that. Perhaps I think some one might tell me "thanks for volunteering". Yes I am willing to do that, but I didn't see any energy with others on this. People realize lots of flaws in software that they develop, when they become users of their own software. Sometimes it is a pain even for them to "eat their own dog food".

(BTW, I won that item, bidding at the last 5 secs. Fortunately the other person was not using any software for bidding :) )

Read more...

Dependency Parsing vs NGrams

I did a project this time for my Natural Language Processing class, on using both dependency parsing and ngrams to build a language models.

The key idea that motivated me and my friend Ikhyun was that NGram model was having trouble (as we thought) with long dependencies and with sparse data. So we wanted to see a hybrid model, consisting of both dependency model and ngram model, would be any better than ngram model alone.

We build our two language models and tested with various kinds of data. Initially we were not impressed by the results as it was no improvements over ngram model.

Then we tested with bad sets of sentences. These sentences were created shuffling original sentences. But our hybrid model didn't perform very well compared to ngram model alone, as we expected. We tested our results with a special perplexity measure. Since it failed, we drew graphs to see how models performance with ngram model. Both approaches showed no or little improvement.

During the discussion with Professor Gasser, we came up with some interesting ideas for the failure.
1. We used English sentences for this experiment. Perhaps English might not be too rigid about word order and this might be one factor. So carrying out the same experiment with a language like Spanish might give us some better results. But the problem was neither me or Ikhyun speaks or understands Spanish :(

2. The sentences we used to train and test the system didn't have long dependencies within them. But we wanted to have a model which would perform well, irrespective of the nature of the sentences. Actually we identified that dependency model was capturing the same information that ngram model was capturing. When we graph our probability results from the experiment, this was so obvious to us. Even though these two models rely on two different concepts, these observations were really interesting.

3. The worst one. We used Stanford dependency parser for our experiment to get dependency outputs. Being a statistical parser, this was always trying to give the best possible output, irrespective of the nature of the input sentence. For example, this was treating both "I go to school" vs "I to go School" the same way. We were expecting this parser to output something wrong, but since it was outputting correct even for the wrong ones, we were having trouble with our model.

I think we learnt a lot from these experiences. Perhaps we should try to test our model with a different dependency parser and a different language.

Read more...

Moved to Ubuntu Hardy and Vista ...

This times I changed both my the OSs in my laptop.

From Microsoft camp, I moved in to Vista Business edition, and that seems to be great (at least for the time being). I think I am fine as I have 2GB of memory in it. I am happy about the stylish user interface and various desklets. I was having trouble installing Visual Studio 2008, but in the second time I was successful.

From the Ubuntu side, I was having trouble with my Feisty version, especially w.r.t. to my graphics. I couldn't watch a video full screen, open-office was always stuck, and no Compiz etc. But hardy seems to be great. It had got everything correct so far, except that Skype seems to be having some trouble working with my sounds and mic. I think Hardy seems to much stable than anything else so far, but I don't know what might go wrong.

I kinda like Vista a bit (there is a different reason for this ;) ), but I still like working with Ubuntu.

Read more...