Pages

Wednesday, April 30, 2008

Tagging The Digital Music

I am obsessive about my music collection - you can say that I actually suffer from obsessive compulsive disorder when it comes to digital music - I like everything to be properly tagged, with cover arts. I remember, last year, when I bought my iPod, I spent an entire week sorting my entire collection. Initially I was manually updating some 4000+ songs, but then, I came across some good tools. So this post is mainly about those tools.


First is the TagRunner - this software automatically searches for missing tags in your music files. So the major part of your tagging problems are taken care by it. Next, if you use iTunes to listen to music, Tunesleeve can be used to search for album arts for each of the albums. It looks into your iTunes library and updates the cover arts of most of the albums (assuming all your songs are properly tagged with the correct albums).

Sunday, April 13, 2008

Sunday!!!

Another Sunday post :) - now I have created a separate label : "sunday" ...

For the last few days, I seem to be posting a lot on my blog, a few of them being technical stuffs I have been working on this week.

In our company, we have a company blog (ChannelOne blogs by WordPress). Even though it has some advanced features (one that enables the users to upload files directly to the blog server), somehow, it seems to be too unattractive. The themes are limited (till now, haven't found an option to edit the templates, other than updating the header image), and its too damn slow. And, when it comes to posting in my company blog, I am too selective - most of the articles are transferred from this blog, after each post goes through lots of scrutiny.

Last week, in my free time, I managed to watch some old movies (not that old though) - Elizabeth (1999), The Thomas Crown Affair (2000), Cruel Intentions. Out of these, I had already watched the Thomas Crown Affair about 4 years back, but didn't remember the details of the plot. And, I enjoyed watching it again. Elizabeth was good, and was a bit too dramatic. Cruel Intentions was crap (somehow I expected it to be like that anyways, so wasn't disappointed much).

The book I was reading last week is almost nearing completion :) .

Saturday, April 12, 2008

Developing JAX-WS based Web Services using Java WSDP

After developing web services using JAX-RPC, I shifted my attention to another web service standard for Java - JAX-WS (Java API for XML based web services). It is a successor to JAX-RPC 1.1, and obviously, it enjoys some advantages over its predecessor.

The major differences between the two standards are:
  1. JAX-WS supports SOAP 1.2, and XML over HTTP.
  2. JAX-RPC supports WS-I's Basic Profile (BP) version 1.0. JAX-WS supports BP 1.1. (WS-I is the Web services interoperability organization.)
  3. JAX-RPC maps to Java 1.4. JAX-WS maps to Java 5.0. JAX-WS relies on many of the features new in Java 5.0.
  4. JAX-WS's data mapping model is JAXB, unlike JAX-RPC. which create LiteralSerializer classes for all the data elements.
  5. JAX-RPC handlers rely on SAAJ 1.2. JAX-WS handlers rely on the new SAAJ 1.3 specification.
  6. JAX-WS heavily relies on annotations.
Now, for the implementation. I created a sample web service application based on JAX-WS (the pack comes with the Java WSDP). To develop a web service, two tasks are provided: wsimport and wsgen.

wsimport creates service artifacts and client stubs by looking into the WSDL. wsgen reads a web service endpoint class and generates all the required artifacts for web service deployment, and invocation. Both need to be used together to create a web service.

The steps that need to be followed for creating a web service and deploying it can be listed down as follows (refer to the build.xml in the uploaded zip file):
  1. Create the WSDL (assuming top-down approach) .
  2. Generate the service interfaces using wsimport. Additionally, server binding configuration xml can be used to specify the namespace mapping with Java packages, and specifying the server side handlers. Refer to the ant task - create-server-wsdl.
  3. Implement service endpoint using the interface.
  4. Generate the service artifacts from the implemented class using wsgen. This generally comprises of JAXB objects.
  5. Create a war file, which has the following structure:
    • WEB-INF/classes
    • WEB-INF/lib
    • WEB-INF/web.xml
    • WEB-INF/sun-jaxws.xml
    • WEB-INF/wsdl/wsdl-file.wsdl
    (For steps 4 and 5, refer to the ant task - build-war)
The sun-jaxws.xml is an additional file which needs to be created. It specifies the end point interfaces, the implementation class, the port, and the url pattern for the service, which is used by the container in which the service is deployed.

Once the war is created, it can be deployed on any web server/ application server. I tested it on both Tomcat web server 5 and Sun Application Server 9.

The client stubs can be generated using the wsimport and specifying the WSDL file. (ant task - create-client-wsdl). Again, the binding configuration file for the client can be used to provide namespace mapping and client side handlers.

As with JAX-RPC implementation, the wsimport and wsgen tasks are dependent on a number of configuration xml files. But unlike the wsdeploy task in JAX-RPC, where a valid web.xml deployment descriptor is created with a listener class and a JAX-RPC servlet automatically, here, in JAX-WS, these entries have to be manually entered. Also, there is a heavy use of annotations, and JAXB objects.

The sample application, together with the build script is uploaded as BookQuoteService.zip

Thursday, April 10, 2008

Developing JAX-RPC based Web Services using Java WSDP


A bit of technical stuff today. Yesterday I tried out Sun's WSDP (Web Services Development Pack) to create client and server side artifacts using WSDL, and deploying it on a web server.
Earlier, I used to develop web services using BEA's Weblogic workshop, which had loads of automated tools to create the service en
dpoint interfaces, looking at the WSDL, and generate client proxies to invoke the web services. But, as I am currently studying about JAX-RPC, I was interested to try out the JAX-RPC implementation developed by Sun.
I downloaded the available Java WSDP pack from the Sun site. I used the tools present in the pack to compile and deploy a web service: wscompile and wsdeploy. It started by creation of a sample WSDL file. Once created, I created an ant build script which made use of wscompile to generate server side artifcats. This als
o involved the creation of a configuration file for the wscompile task to understand. Once the service endpoint interfaces were generated, I implemented the iterface with a dummy web service, and compiled the whole application.

There are 2 phases of development of a w
eb service using the pack - first a raw WAR file is created, having the server side classes, a web deployment descriptor (web.xml), and a JAX-RPC deployment descriptor (jaxrpc-ri.xml). The raw WAR file has the following structure:
  • WEB-INF/classes
  • WEB-INF/jaxrpc-ri.xml
  • WEB-INF/web.xml
  • WEB-INF/model.xml.gz
The model.xml.gz file is generated while using wscompile.
Based on the jaxrpc-ri.xml (has to be manually created), use the wsdeploy task to create a "cooked" WAR which is ready to be deployed on a web server. Again, in the original Ant build script, this task was added.

Once the service is deployed, now comes the creation of client stubs/proxies to invoke the webservice. Using the same wscompile to
ol (but this time specifying that the client side artifacts need to be generated), the client stubs are created, and thats about it.

The configuration files provides all the f
eatures to include handlers, namespace mapping etc which is generally needed in the web service.

With this development pack, only JSE (Java Service Endpoints) are created (no EJB endpoints).

For further details, and instructions (including sample applications), refer to Understanding your JAX-RPC SI Environment.

The sample application can be downloaded here.

Tuesday, April 08, 2008

Angry pup, eh???

While I am posting about pets and dogs, I thought of putting this picture on my blog too... I just couldn't stop laughing when I came across this pic somewhere on the internet :)

Nostalgia....

Today, as I was going through my photo albums, I thought of selecting some of the cutest pics of my pets. I remember clicking so many pics whenever I bought a new film for my camera. Here are some of those timeless snaps....

Every time I look at these photographs, I miss them even more....

Monday, April 07, 2008

The Darjeeling Limited - Is that supposed to be India???

Some weeks back, I had the opportunity to watch a movie named "The Darjeeling Limited". And I was disappointed, seriously. It tells the story of 3 brothers, who have drifted apart from each other, make a soul-searching trip to India - and what a trip it turns out to be!!! They show nonsense stuffs happening to them in India.
Let me elaborate - for one, the train is named "The Darjeeling Limited", but believe me, it is no where near the scenic hill station - it keeps wandering in the desert, and sometimes gets lost too!!! Yup, you have heard me right, they show that the Indian trains get lost, even though its moving on railway tracks!!! Can you beat that???Then comes the train itself - I don't know what kind of rickety tourist train have they shown.

India is shown as a land of snake charmers - one of the three brothers, on a trip to some Hindu temple, buys a snake!!! And, somehow that snake is lost in the train. The head steward(or whatever) of the train, takes the snake, and worships him. Weird!!!And to top it all, they show some "International" airport, and my goodness, what an airport it is - it seems shabbier than the dirtiest railway stations in the smallest towns in the country!!

The way India has been depicted in the movie is seriously disappointing - I wonder what the director was even thinking... The movie has an impressive star cast by the way, and that was the only reason, I was interested to watch the movie in the first place - Owen Wilson, Andrien Brody and Jason Schwartzman play the role of the 3 brothers. Irfan Khan also has a small role in the film, even though, without any dialogs...


Firmware Upgrades - How Useful Are They?

Lately, I am seeing a lot of firmware upgrades coming up for different products - take for example, my iPod. The 5th generation video iPod (or the 5.5th generation, as a matter of fact), is no longer available in the market. But, Apple (hail Apple!!!), thought about iPod owners like us, and provided with a brand new firmware (1.2.x something to 1.3.0) - quite a jump, if you care to notice. But all I could find from various sites is that Apple has claimed it contains several "bug fixes".

Now, as a consumer, I should be told what are the exact bug fixes they are talking about - coz, after 1 year of usage, without any firmware upgrades, I haven't noticed any bugs which requires to be fixed. I am quite happy and content with my original firmware with which my iPod was shipped.

Well, actually, come to think of it, there was something that was missing in the original firmware - Apple, promply, forgot to add the Indian timezone in its time settings!!! Can you believe it? There is +5.00 GMT, and it then jumps directly to +6.00 GMT. As if the entire subcontinent populated with a billion something people is gone, vanished, disappeared!!! And weirdly, in its world clock, there is a mention of Bombay, but whats the use?? Its something like this - you are in India, but when you set the time, you cannot select the IST. So either you need to select +5.oo GMT, or +6.00 GMT. Now with either of these time zones, you actually screw up the world clocks that is displayed in your iPod. So, if you go to Bombay's current time in the world clock - its either half an hour late or early. And that is true for any other city in the world. I was actually surprised when I noticed this thing in my iPod.

But, now I hear, that they have finally introduced the IST in the new firmware. But still, I am not taking a risk of upgrading my firmware, which is working perfectly fine. It should not be the case that the new firmware introduces some new bugs together with fixing the existing bugs. Atleast, I'll wait for some further review/comments.

Sunday, April 06, 2008

My Blog Needed Some Much Needed Attention

Yup, the title says it all - it had been quite some time with the same template, so that needed some change - but at some cost. The beloved "Tag Cloud" I had created some time back is now gone, and I don't have the patience to create a new one to suit this template - so, I guess, I have to live without it for some time....

I also noticed one thing - now I don't have to select a profile pic from some http url (thank God for that) - it now provides a simple option of uploading your pic from your computer (thank God for that again - high fives etc etc) - I wonder why they didn't think of this before and waited so long to implement it. At least, that was a sweet surprise :) .

Now, that also makes my second post for the day (an indication of how eventful my day was today) - and requires a celebration!!! :P

Sunday Again

Once again, today is one of those days when I let my thoughts wander, and decide to post those weird and unrelated thoughts on my blog - which is soon going to complete its 2 years (its another 3 months to go anyways). Why do I blog by the way? I guess, when I am supremely bored, and I have nothing else to do - as I am doing just now. It was an uneventful Sunday, and a long one too - really long, when you manage to wake up at 7 a.m. in the morning, and have no fixed plans for the whole day. Yikes!!! 7 a.m!!! On a Sunday!!! Are you nuts?? That what I generally get a response when I tell my friends about it - but thats the truth. Whatever, the main point I am referring to right now that today has been an idle day for me, and for some reason, decided to post my uneventful day's events on the blog, to add one more irrelevant post to it, and to remind me to "GET SOME LIFE!!!!"....

Some of the things which I did today, worth mentioning here, that is, are:

1. Trying to complete the book I had laid my hands on last Wednesday.
2. Watched a movie.

Ok, now lets be a bit elaborate - the book I am referring to, and I am halfway through reading it is called "So He Takes the Dog" by Jonathan Buckley. Nice book, revolving around a murder mystery of a vagabond in England. And unlike a murder mystery novel, this one doesn't have the kind of adrenaline rush action which is a general characteristic of book of such genre. Infact this book is surprisingly calm and slow... And till now, I am liking it.

The second task - a movie. Oh this one is called "If Only" starring the always anorexic Jeniffer Love Hewitt and not so known Paul Nicholls. Good and mushy romantic movie, and a perfect time pass for an idle Sunday afternoon.

That pretty much sums up my day till now :)