All posts by coach

The social media thing!

Recently at work, I was given the task of implementing social engagement buttons for the likes of Google +1, Twitter, Facebook, LinkedIn.

And the successful implementaion was in two phases.

The first phase: Installing/Configuring the scripts for inclusion and second was testing them out!

Here comes the comparison of their usage:

Ease of finding share buttons.

Here LinkedIN fared last(it took me some time to reach the actual page)), while facebook came second last(it was simply not intuitive to see what changes were getting affected) and google just beat twitter for better placement of the generated script.

Basis: Easy finding + Instant display of customization + Zero extra effort.

Size of included JS

Here FB was last with 100+KB of script, while other three were quite okay, seemingly under 29KB all three combined.

Basis: Don’t know why FB is pushing so much client side javascripts?

Ease of understanding the tag’s

Here the clear winner is twitter, as they simple do a script include and use an anchor tag! It can not get simpler than this. Google came second by making it complex by adding their own custom tag. FB was ugly, while LinkedIN was pathetic, as there was not handle that I could find in their code!

Basis:I am a non-UI guy, so and anchor tag + js include sounds like I am at home!

Alignment on the UI

Twitter and Google fared quite well here, as placing them in a span/div tag, did not distort their buttons, whle FB and LinkedIN folks seems to have done a sloppy job here. Try putting a div around them and you might see their button’s vanishing at times!

Basis:I should be given complete freedom to place the button’s where I like’em.

Getting them to work!

All 4 of these scored 0 on this front. I wasted one whole day trying to figure-out the reason for these tag’s not working on localhost. Surprisingly they require a live public url for them to work fine!

Very dis-appointing!

Basis:I suppose I should be able to test on local how these buttons look for testing!

After getting them to work!

Al most all of these have a bug that if I delete the publicly promoted link/url/etc, the count does not seem to come down accordingly.Strange, but true.

No – Thank You!

For incorporating all of them I had to create a new id and register. I am glad I did it that ways, because LinkedIN was all over me pouring all their corporate tie-ups link/spam/trash all to me and making me a subscriber by default. Also reading the fine print LinkedIN seems like they are selling all infromations to 3rd party affiliates without a clear consent!

Going through FB and twitter settings was also a pain, did not go through details on +1!

Basis: No thanks for the spam!

The inclusion codes for each of these are available on these sites:

1/Google +1 2/Twitter  3/Facebook 4/LinkedIN

Well after checking out the code on a live public url, I suppose the feature would easily come out, but this was an interesting learning experience about how do folks at big public organizations code!

Twitter seems to be leading in this front by keeping it really simple!

~rohit.

Zero Fat( read: XML), Zero Cholestrol(read: Annotations) Web Services!

I have never been an advocate of XML per-say.
And I was faced with the difficulty of writing one recently overwhelmed by the amount of XML and Annotations, well I was looking forward to a hard day ahead. 

Then motivated to defeat XML in my own war, and reducing its footprint in the codebase I am working on, I put on the searching glasses and XFire came to the rescue(credits to them for integrating WS in the most cleanest manner done with Spring, that I know of!)

Now that the plot is set, here’s simple how to:

Presumption: You have two different projects one is the WS other is the consumer of the WS.

Step 1/ Write your service and its implementation in the WS project.
(eg: XXXService/XXXServiceImpl for the project YYY)

Step 2/ Configure the usual project as a spring web project.

Step 3/ Add the following snippet into the web.xml(append incase you have contextConfigLocation predefined.). This makes your project XFire aware.

  
    contextConfigLocation  
    classpath:org/codehaus/xfire/spring/xfire.xml  

Step 4/ Expose the service as Http WS through XFire Exporter:

    
                
                
                
        XXXService    

Step 4.2/ Inject the Service Impl Bean.


Step 4.3/ Configure the Url for accessing the Service.

    
        
                                                

Step 5/ Deploy the WS project an tomcat/jboss.

 

|| End of Server Side Configuration||

Step 6/ Test using the soap url:: http://localhost:8080/YYY/XXXws?wsdl

Step 7/ Configure the XFire client on the other project as follows:

    
      XXXService        
      http://localhost:8080/YYY/XXXws?wsdl    

Step 8/ Inject it in your client

  
      

Step 9/ The client should be configured as::

public class WsClient{    private XXXService xxxService;}
|| End of Client Side Configuration||

Step 10/ Done!

Things to remember::
1/The Java Interface XXXService needs to be shared with the client.
One can overcome this by creating a third common project shared for the WS Provider and WS Consumer.

2/Any changes in the WS provider, would require re-deployment of the first project.
This is the least a java developer(xml unfriendly) can absolutely live with!

3/Once these configurations are done, forget that you ever need to look into the xml’s!
Also any change addition/removal of the methods that needs to be exposed will be purely a java exercise, without requiring to smell XML.
Well you won’t be able to find any xml!!!, thanks again to the wonderful folks at XFire!

PS: All these steps are written here with the help of http://xfire.codehaus.org/Spring+Remoting and implementing this in a production environment!

Hope this helps you in reducing the amount of unnecessary XML’s in your java projects!

~rohit.

Dim Dim is no longer free!

Quoting from their mail received today:


Dear Customer:

Dimdim has been acquired by salesforce.com. Your free Dimdim account will remain active until March 15, 2011. After that date, you will not longer be able to access your free Dimdim account.

Please see the Frequently Asked Questions (FAQ) for additional information.

We appreciate your understanding, and we thank you!


The Dimdim Team


Pursuant to the Dimdim Terms of Use (the “Agreement”) governing the use of Dimdim Inc.’s (“Dimdim”) Site and Services (as defined under the Agreement) by you (“You”), Dimdim is hereby exercising its right to terminate Your Dimdim Account and the Agreement in its entirety. Dimdim will continue to provide Services to you until March 15, 2011. Following March 15, 2011, neither You nor Dimdim shall have any further rights or obligations of any kind under the Agreement, including the right to access the Site, or receive or use any Services. Dimdim thanks you for your business, and wishes you success in the future.


Sad news.

The Java Roadmap – Its second life.

Woo Hoo!

I am excited to know about Java being back on-track with its journey of being the most preferred in-demand platform.
I started following the development at the following interesting links:
Here’s what I have learnt in the last few hours:
1/With news about the next JDK releases slated for 2011 and late 2012, the java platform is in for a complete re-write much more intutive and more robust than ever before.
2/The sensor api is the answer to the recent advancements in the mobile domain viz-a-viz touch screen/GPS enabled life-apps. Looks like J2ME(or what ever it will be called) will reign in for the first time in serious cometetion!
3/Must read Project Coin.
4/Oracle’s official statement is adamant at keeping two versions alive for whatever product they already had and what they inherited from Sun. A tough situation to be in.
I have been recently loosing faith in what the future of java will be after Oracle took over and a lot of Sun luminaries quiting Oracle controlled java. Atleast I see new life(hard work and pain going in) in my most loved language, Ever!
I look forward to it with renewed hope!

Annotations are hardcoded string literals.

Well,
I do not have much to say apart from the what the title of this post says.

I do not like annotations as a way of weaving code for an application at all.
XML’s are bearable, but looking at an annotated code, is like looking at hardcoded values as if they are all string literals.

The reason I prefer XML over annotations is atleast they keep the configuration part staked away seperately or is it just me who does not like overloaded contexts?

Here’s the real motivation:
The OO paradigm was there to do the abstraction right, by punctuating them with annotations, we miss the broader general rule of why the object maping was done initally.

Let’s Keep the principle Simple!

Stable Dev Environment?

Once upon a time there was a Q&A that happened as follows…

Q:So when can you say that your local dev environment is ready?
A:When you have run a comprehensive unit test, pre-existing or drafted yourself.

Q:What is a comprehensive unit test?
A:One that covers all major components of the architecture you are working on.

Q:What can be the major components of an architecture, one may be working on?
A:Layer Code, deployment, DB, Jndi context, orm context, 3rd party API context.

Q:What’s your point?
A:You environment ain’t ready until all your environments are not accessible from your box. The best way to ensure this is with a unit test and know thy environment!

Instant Noodle aka Instant Google!

As most of us have come to peace with the latest ripple(sorry wave ain’t news anymore) on the world wide web caused by no other than google, it is time to analyse the new offering!

What is it?
An approach that takes away the mice and directly displays search results as alphabets are typed.

Any similar things exists before?
Absolutely Yes. Any regular KDE user knows what happens when Alt-F2 is pressed.

Is it any worth?
Yup! It was fun using it for two days. But don’t know how long it lasts.The good thing is that the mice has been pushed away one step more.

Any Gotcha’s?
As with any ajax application, browser button behaviour is unpredictable.You might not see actually things on the screen, but your request has everything.
Also earlier, for a search text only a single hit was required to the google servers, now every alphabet invokes a new hit.Get ready to leak unnecessary bandwith data.
Google really has some strong servers to take the toll of every search query to around 5-7 times!

The official post is here.

Maven and Proxy scripts

This friday at work, I was configuring a new system for project use.
The transition to a newer LAN was fun but what was more challenging and a little less-fun the configuration of maven for some spikes.

I was supposed to get working on spring-webflow and for that I had to get a maven controlled project up and running.

In this I faced the challenge of getting maven past the proxy settings and it being able to download all/any dependencies as required.
I had earlier, on a previous LAN setup, known the proxy server and port number and configuring the settings.xml for the same was not at all tough.
This time, our LAN is configured via some asp scripts residing at a server, so I did the following to get maven talking to the internet.

1/Go the script hosting the proxy script.
2/Download and study the proxy script, find the final else-if case for identifying the actual proxy server and port.
3/Put my user name alongwith *domain* and put it in the settings.xml[this was the part that took longest amount of time to find]

And maven got to see the light of the internet!

It is important to note that maven does not support NTLM authentication(I assume this was the problem) although there are tools(cntlm), which I tried working for 5-10 minutes but did not get through.

The missing software oath!

We as software creators, affect lives of everyone.
Be it a lawyer/doctor/government/police/reporters and what not.
All of them have an oath they take acknowledging with their conscious the work they are supposed to do would be done with best spirits and with best intentions.
Although at the ground, it might not be true but atleast as a ceremony they have something to swear by!

Coming to the profession(an occupation requiring special knowledge) of software development and related works, we do have no such promises to make or oaths(commitment to tell the truth!) to take!

Maybe all related software professionals are assumed to lie or are assumed to be true.
If we all are liars, then we might not have his wonderful profession, as good things rest on good souls and get bad name from a few unfortunate few.

What place do you belong?