Friday, November 20, 2009

Abdominal Guards and population

Some relations are just weird. I mean, I read it somewhere - the abdominal guards in cricket were first used in 1874. And helmets in 1974.
Also consider that India is very populous and also very cricket crazy. Well, some ppl think with different organs :) .

Friday, October 09, 2009

Subtle difference in access modifiers in java & ruby

Just going through basics of Ruby and realized there is a slight difference in the behavior for protected and private access modifiers. From java to Ruby access modification differences are (other then syntax)
1. In Ruby default access to instance messages is public. In java the default method visibility is package.
2. In Ruby private access can be done only internal to the instance i.e. not even from other instance of the other class. In java that is allowed. Pretty much because in Ruby access determination happens at runtime.

Wednesday, April 08, 2009

Why Mayawati PM could be useful?

A rather non technical /non managerial post.
I've met so many of my friends in India who dread the possibility that Mayawati could become prime minister of India. Why? What's so bad about it? Well, quiet a few things, she is corrupt, biased and definitely does not believe in meritocracy (we are democracy any way:) ) , think of a disaster when she is on a world forum and just can not think strategically, an embarrassment. She will not understand what it takes to make sure India stays competitive in this world and we the citizens will lose out. well, there are many reasons indicating she is not the fit.
Here is one I think, why she could be a blessing, the first and foremost I believe she represents a large section of Indian population that just may realize a sense of power and may be start believing in Indian dream. Being a dreamer is a good thing, you need to be responsible and a believer in the rule of law to realize the dreams. Let's diverse and see what I mean?
Consider this, Indians take pride in their civilization, and believe in a bygone era when they were the knowledge center of the world. At the same time, have a look at the technology, Indians claim they never attacked a country. May be, they couldn't? I may be wrong, but look at Indian sword or a bow and arrow, or a shield, all important accouterments of a soldier. Compare it, with invading army, e.g. Puru had a local advantage over Alexander, and in the battle they lost primarily because
1. The elephants, the Alexander's army attacked the trunks of elephants with spears and arrows, and elephants turned back and crushed their own army.(The elephants caused similar damage to another defending ruler in India against Babur)
2. They had heavy bows and due to the rains last night were not able to hold those properly.
Now think about it, Only people in the world who could tame elephants and use them with infantry lost due to those? On an elephant, u r on a height and if u have a long range archers sitting on elephants, its way too difficult for invading army to get closer to ur elephants and actually use spears against those.
We didn't posses long range weaponery. neither hardware nor skills. Imagine a middle age rajputana sword, compare it with chinese (Chinese BTW had different kinds of flame throwers, bows that could shoot multiple arrows and could be very quickly reloaded with magzines) , almost 6-7 different kind of swords for different styles.
Now why a huge population, that was rich,organized,excellent thinkers, knowledge seekers and also valiant warriors could not make relatively simpler technological upgrades?
could the reason be that a warrior (a kshtriya) who need to use the sword doesn't talk to the iron smith (a lohar) who designed and created it?
An innovation, be it a game changer (e.g. Internet) or simpler one ( a new code idiom) evolves when a lot of stakeholders collaborate, discuss, try, fail, try again and then a new winner comes along. It does not happen when those who understand physics and maths(Brahmins) does not see value in a technique that allows a lohaar to create a more lighter but powerful metal. Either the new technique won't evolve fully or nobody would suggest the man to use a better approach. Resulting into less innovation.
A cast system, that did not allow people to collaborate killed all that could be created only by matching and synthesizing new ideas between different actors.
I believe after a lot of years, a bigger section of the population trusts a leader, even when I abhor her. May be just may be, she give the confidence to these people to come out of their rut and try harder. May be, she realize in order to rule, the leader has to be responsible and honest.
She is street smart, sharp and just may bring a huge population to strive for education, better jobs, better techniques. Well, if she can make that section of India go for enterprise, we may ignore her obvious lack of English speaking abilities.

Saturday, March 21, 2009

Xfire dependency of spring

These days creation of webservices has become so easy and some times we just miss the pitfalls.
I just wanted to remember this, a very last entry in the manual and my eclipse xfire dependency just drops it.
Those who get this stupid error
"
java.lang.IllegalStateException: Could not find valid implementation for: 2.0
"

Spring 2.x support

Because of Spring 2.x new feature, services.xml default namespace must not be declared on the root element of configuration ( beans ) and need to be moved to tag level.

http://xfire.codehaus.org/services.xml+Reference

Sunday, February 08, 2009

Job portal business model

These days, I'm working for a company, that runs among other web properties a job portal. Now, I'm beginning to understand the business a bit. The business models/ biggest revenue driver is to sell database. Simple, create a good search mechanism around the database and sell it as value add to database sell. There are other business models too, but no revenues to write home about, e.g. some premium services to job seekers like touching up their resumes, provide prominence to these on people search and all, but not much. Historically, the premium service were the only revenue driver in India (Every job seeker needed to pay a fee for allowing businesses to easily access their resumes), but large requirements to hire good people in short span and some innovation from a start up changed all that.
As I understand, this requires a lot of branding effort to get job seekers to register on your portal and marketing/sales efforts to sell this registration data to recruitment consultants and employers.
This actually becomes a kind of chicken and egg problem, because the job seekers will register to your web property only if they find jobs that they want to apply to, and job providers will only buy database (and associated right to post jobs) only if they find job seekers, those they can contact and want to contact. And if you are in a upward spiral, you would need to be really stupid to stem the tide and god forbid, if you are on downward spiral or not number one and two in an over crowded market, no amount of marketing, telemarketing, e-mail marketing can create a sustainable cash flow (Good, I've started using some management jargon now ) . You stop your effort or limit it and you see a drop in new registration/old job seekers getting active again resulting into less job postings and activity from the job supply side (again).
Now, I don't know, may be,I'll ask our business people, why can't we create a google ad sense kind of business model.
I think it should go like this, similar to free job seeker registrations, database search and job posting is also free. Go ahead post the job for free and search as much as you like in the database, again for free. But 2 things change, we as service providers charge for service offered, i.e., if you want to contact a job seeker, we charge per mail/per phone call. If you want contact job seeker yourself, we charge a bit more and allow you to see the job seeker's contact details, available to you for next let's say 6 months after receiving a small payment. The payment is strictly pre payment. Every contact that you make and every application to your job ad or every impression that your job ad get or every click on your job ad, we charge a small amount. You exhaust your payment, re charge. You may define your limits per posting, we don't mind. You may define, if you want your ad to be e-mail marketed or telemarketed or not.
Can we have a long tail then?

Friday, January 09, 2009

Jboss 5 classloading interesting

Very recently I started running a web application(previously on websphere 5) on Jboss 5 general release with JDK 6 on a Ubuntu box.
Really didn't had much to change except adding one jboss-web.xml, to set the context root. But it's a legacy application which has plethora of jar files in its webinf/lib file. What bugged me for about 2 hrs was this, on a Servlet filter the cast from ServletRequest to HttpServletRequest failed. I tried introspecting the request object in the filter code with the following code
logger.debug(getClass().getName());
logger.debug((req instanceof javax.servlet.http.HttpServletRequest));
for(int i =0; i < req.getClass().getInterfaces().length;i++){
logger.debug((req.getClass().getInterfaces()[i]).getName());
}
javax.servlet.http.HttpSession session=(javax.servlet.http.HttpServletRequest)req).getSession(true);

And the log statement in the for loop was displaying "javax.servlet.http.HttpServletRequest " and debug statement in line 2 was "false". And the last line was giving a ClassCastException.
Intially surprised then upon digging deeper realized it's a stupidity on my end and different classloading at Jboss.
I had a servlet-api.jar in my webinf/lib. I think JBoss loaded HttpServletRequest, it loaded from it's own classloader. While in the application a child classloader loads another instance of this "Class" object from the webinf lib. In the application code the last line compared 2 different class objects loaded by different class loaders, the request object was from Jboss classloader and the other one was from application classloader and gave the error.
Some insight that I had forever but took 2 hours to fix :).
The fix was to remove the servlet-api.jar from webinf lib.