Tuesday, July 21, 2009

Water Babies

India is essentially an agricultural economy. Now why say that?! Agricultural and related activities accounts for nearly 17% of our GDP and employs nearly 60% of our labour force. Any growth in our economy happens from grass root level. It is this 60% of the work force that drives our economy. Past five to six years have been very good for our economy. Our GDP grew by average 8 - 9%. Agricultural growth may just have been in range of 2 - 4 % but the multiplier effect it created has resulted in this superb economic growth. Stable livelihood that agriculture has given to our 60% of population has resulted in money in their pockets. This they have spent on consuming goods and services other sectors have produced thereby giving India its much to talk about GDP growth.
Some may lobby for placing greater importance to IT in our economy or some may lobby for more and more SEZ. Others may talk about liberal financial markets for FDI and FII to pour money into our economy and few on disinvestment and all sorts of infrastructure building. However the bottom line is, all we need to ensure is that this 60% of population's pockets are never empty!
People point at our young crowd of IT and finance people in malls and say this is where our future growth lies in terms of consumption and spending by them. Yes we are a consumerist society and a consumption driven economy but the real consumption is not driven by this tiny mass of people we see flocking in newly built malls, its driven by this very 60% of agriculture labours spread across the rural hinterlands of our country (places which we hardly visit).

Speaking about importance of agriculture in our economy, on what is the output of this sector largely depended upon? Sadly, its still the monsoons. Our irrigation facilities are not so developed across the states and these farmers largely depend on blessings of rain god for their good livelihood. Building great agricultural infrastructure is another topic all together and may focus on this some other day, right now focus is on monsoons vs stock markets.
There are many charts which show correlation between GDP numbers and monsoons. Stock markets are said to be voting machines for a short term and weighing machine for a long term. What do they weigh? They in general weigh the health of our economy or in a long term conform to the GDP numbers. So if GDP numbers are good, our economy is growing, stock markets would also tend to have an upward bias. So as monsoons are co-related with GDP and GDP with stock markets, isn't monsoon co-related with stock markets.
This is the last thought that can come to someone's mind. Stock markets and monsoon, ha!

Let me try to analyze this issue a bit. Here I am presenting a chart of rainfall as % to LTA (long term average) and returns of sensex (a barometer for stock market), for the next year. So like in 1998 rainfall was 106% of LTA, and sensex returns in 1999 were -4% relative to 1998. Both the charts are scaled so as to overlap one another so as to see a co-relation.


One can clearly see a strong co-relation between rainfall in a particular year vs performance of stock markets in the following year. So we look at all possible numbers IIP, FII inflows, broker community's sentiments and what not, but a simple analysis of an event which has greatest impact on the lives of people which in turn have greatest impact on our economy can provide us with almost all the answers. Can it?!!

So with the current performance of monsoons, what would be the direction of stock markets next year can be anybody's guess. The point here is that many times something simple is more effective than something complex and just because something is so simple, don't overlook or ignore or replace it with something complex and hard to understand.

A public-opinion poll is no substitute for thought!

Sachin

Tuesday, July 7, 2009

Is Bob Arum playing safe with Manny Pacquiao's next fight

With Floyd Mayweather Jr Vs. Juan Manuel Márquez fight postponed to September later this year due to Mayweather's rib injury, any chance of either of the two facing Manny Pacquiao may not happen till mid of next year. So who should Pacquiao fight next is a multi-million dollar decision. He is a prized fighter and there is a line of challengers waiting to face him. Who is the lucky one is what Paquiao's camp is working on these day.
As per reports, Miguel Cotto is coming out to be the chosen one. Question here is that is he the right choice for Paquiao.

Let us examine the possible alternatives. Firstly the big question is on what weight the fight should happen. I feel that the Super lightweight (140 lb) is the ideal weight Pacquiao should take the fight. As we saw in Ricky Hatton's fight, he is best at this weight. So who all can be his opponents at or around this weight (+- 4 lbs)

One boxer that readily comes to our mind is
Shane Mosley. He is a world class boxer with huge fan following and a formidable opponent for Pacquio. This no doubt can be the best fight we all would witness in present times. However he is little too bigger for Pacquiao. At 5'9'' and fighting at 147lb he can no way make it near 140 lb. I think this was perhaps main reason for talks between these two camps to breakdown and another may be split of fight purse as Mosley's camp would want a close 50-50 split.

Next can be Andre Berto. Undefeated welter weight (147 lb) champion. He may not have that a big fan following right now which may deter Pacquiao's camp to take a fight. Another reason can again be his reluctance or inability to make it to 144 - 140 lb range.

As we move down the weight category to 140 lb we have an option of Andreas Kotelnik or Timothy Bradley or say Nate Campbell. Kotelnik is busy fighting Amir Khan, Bradley may be less experienced and Campbell may be too old to take on Pacquiao. Also none of these fighters have a big fan following to make a great PPV fight.

Lets move further down to 135 lb category. One name that comes to my mind is of Edwin Valero. He is is a great fighter, a south paw, has tremendous punching power and speed. Just like Pacquiao! Further he is available and has shown interest in fighting Pacquiao. What more adds to the fame of this guy! He is currently Lightweight WBC champion. He holds a perfect record of 25 victories and all these coming by a way of knockouts. Infact first 18 of his fights were won with a KO in first round itself. He may not have fought many quality fighters till date, but he surely deserves a chance to take on one, and who could be a better opponent than Pacquiao. I think this fight is the best fight which Manny Paquiao camp should consider as next one.
Here are few reasons for same:

  1. Both boxers have same size and the contracted weight to fight would be ideal for both. They both would be in best shape making it a great fight to watch.
  2. They both have similar energy levels, speed and punching power.
  3. Purse negotiation won't be any problem for Pacquiao's camp and even a 65-35 split can be arranged.
  4. There would be great air behind the fight. Valero has a good fan following now, has fought in USA and has a claim to fame that is always knocked his opponent down.
Coming back to the choice of Cotto. I just don't think it is a good choice. Cotto seems like a fighter on a decline and had struggled to win against Clottey in his last bout. Also there may not be much air behind the fight.

Where do we go now!

Sachin

Tuesday, June 30, 2009

IT Software Freelancing - Choosing a right buyer

We see numerous articles, blogs over the internet where people have written how to choose and select the right provider for the job.

Here is something opposite, its from the provider perspective on how to choose right buyer and their projects. I have been freelancing for over 5 years now and have applied and got projects from number of freelancing sites like odesk, guru and rentacoder.

If you have done your homework well, have good skill set and bid competitively and selectively then there a good chances of success in this fragmented world of software freelancing.
Speaking of success, what is general success rate?
My experience on bidding on project shows that if you qualify as a good freelancer, good success rate would be anywhere between 5 - 10%. Now that seems low, but actually it is not, here is a bit of breakup on where you bid goes:

  1. Buyer selects you 5 - 10%
  2. Buyer selects someone else 10 - 25 %
  3. Bid goes waste 70 - 80% (yes that is right!!!)
The third includes - job expired, project itself canceled or project itself did not start after buyer selecting a provider.
There has been lot of profiling done on providers, their demographics, their competence, but seldom or never has the buyers been profiled (also because buyers profile unlike the providers is not publicly available).

Who is this typical entity on the other side of the fence (whom we would never meet, as most of the projects are transacted online with people in different geographies)?
Possible answers:
  1. Would be a small company how does not want to go through the troubles of having physical presence in a different geography.
  2. Would be a startup (but incorporated) company working on a new concept and has plans but not enough cash to hire full time employees.
  3. Would be a stealth startup (not incorporated), taking a long shot on something, would be a one man show who is still busy in his full time job.
  4. Would be a middle man trying to hire someone cheap for the local market to work on his clients projects.
  5. Would be an individual like the provider, trying to get something done or taking a long shot at some concept.

As we see that 70 - 80% of the bids go waste, so unless buyer belongs to first two categories described above, there is a pretty good chance that your bid would end up in waste.

Freelancing market is still fragmented, there is still no sign of organized biggies of the IT and software world (Microsoft, Google, Amazon, Facebook etc.) entering this market. They either have their captive units in local or offshore markets or enter into defined contracts with offshore vendors for their IT needs be it support or development or services work.

I continue to believe that the startups that would be big tomorrow would still be the ones that have an energetic team physically located and working together at one place. Something like Google or even Facebook or Twitter cannot happen using offshore freelancers. So we as providers cannot hope for many long term, big budgeted projects and would have to bid regularly on small to medium size projects. Thus with all this background there comes a need to know where to bid, as actual projects are scarce and competition is high.

Here are some pointers that may help to choose the right buyer or project:
  1. Every good freelancing site has steps to verify or review a buyer, like the payment verification, contact details verifications to know the entity is real. They usually stamp such buyers along with the projects they post. Look for these. Usually buyers under category one or two would have these.
  2. Next comes the project description itself. There would be well defined scope of the project or well defined criteria for providers needed for that project. This shows they have plan and again buyers under category one or two would fit these. Ignore projects with clone of this or clone or that or where from the project description it is not clear what the buyer wants. Avoid projects with generic descriptions, which are so general that there would be many bids and in the end project would never take off.
  3. Projects have clear guidelines on the time estimate i.e. duration, hours per week, no of providers needed or tentative budgets. Again buyers under category one or two have to go through this process for every project because they are incorporated and budgeting is needed for planning. Avoid projects with open or unsure budget duration. These would seldom take off ending your bid in waste.
  4. Many freelancing sites give a brief work history of the buyers posted projects. Like how many projects he posted, how many got started, size of the projects etc. If someone has posted many projects but none took off you can assume he falls under the category 3 - 5. No point wasting your bid on that.

Thus by understanding the online freelancing world better and profiling the buyer better, you can improve your strike rate and spend more time working on right projects than bidding on waste projects.

Hope this helped!

Sachin

Friday, June 19, 2009

Easy solution to strip certain HTML elements using XSLT with Groovy

I won't waste much time explaining XSLT or Groovy. Refer the links associated with each to know more about these.

Problem in our hand is that we many times scrape html for existing sites to create one mashed up html. Many times we don't want certain html elements to be included in the resultant html. How do we do that? Fortunately XSLT comes to our rescue. Also on the implementation of XSLT engine I would be using Java based Groovy scripting language. Scripting languages are best to use when you want quick results. You can bootstrap the scripting engine quickly from your server and get the job done. Groovy is a very useful scripting language and now a web framework GRAILS based on Groovy has come up to help you develop web applications with minimal effort. I think in future this is going to be a serious competitor to much popular Ruby based RAILS framework.

So lets jump to the problem and its solution:
Problem we have is that from the html defined in input variable we don't want certain div elements to be included, in the resultant html.
We simply define a valid XSLT pattern for same.
Here it is: div[@id='ad*']
This simply means that exclude all divs whose id starts with 'ad'.

The solution is described in the Groovy script below.


import javax.xml.transform.TransformerFactory
import javax.xml.transform.stream.StreamResult
import javax.xml.transform.stream.StreamSource

def pattern = "div[@id='ad*']"
def input = """
<html>
<head>
</head>
<body>
<div id="ad1x1">
this is NOT OK!
</div>
<div id="ab1x1">
this is OK!
</div>
<p>
this is OK!
</p>
</body>
</html>
"""

def xslt = """
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- By default, copy all nodes unchanged -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<!-- but strip the matched ones -->
<xsl:template match="${pattern}" />
</xsl:stylesheet>
"""

def factory = TransformerFactory.newInstance()
def source = new StreamSource(new StringReader(xslt))
def transformer = factory.newTransformer(source)
transformer.transform(new StreamSource(new StringReader(input)), new StreamResult(System.out))


So as you can see defining pattern is so simple, all you need is some html element and its attributes to match for exclusion.
The resultant html after transformation would have the same input html minus the excluded elements.

Hope you found this useful.

Any comments feel free to contact me.

Sachin

Wednesday, June 17, 2009

Always invest for future but don't forget the past

Investing is always done keeping future in mind. When today I invest in any business I am mostly interested in what the cash flows would be in future. Based on these estimated cash flows I come up with my intrinsic value of the business and then based on what market is offering me I decide on my buying decision. The business may have done great in past, however if I somehow feel that the past performance can no longer be replicated I won't buy into that business no mater how attractive its current price is relative to its past earnings.
As Mr. Warren E. Buffet rightly puts: If past history was all there was to the game, the richest people would be librarians.

P/E or price to earnings ratio is one of the commonly used yardstick to evaluate any business. The question here is what P/E we should use trailing or forward. Most rookie investor blindly follow trailing P/E. This is very easy to calculate and can be calculated fairly accurately. Business may (deceptively) look very attractive on this parameter, however when there is no visible earning potential in future, soon it turns out to be very expensive. What mostly happens is that earnings fall sharply and then even with little or no fall in price the P/E ratio becomes very high and same business which looked cheap a year back now looks very expensive and all we are left with is holding a dud business.

So should we use forward P/E? Math isn't simpler here too! Forward P/Es are not easy to estimate and each analyst comes up with his own estimates of same business. Whats even more dangerous is that every month depending upon cheer or gloom in the market, they continue to revise their own estimates of P/E. Investor ends up even more confused with all these flip/flops.

Evaluating individual business based on P/E does no good. One should not pay too much attention to this parameter at the time of buying a business. What one can do is look at the business you 'really' understand and use your own experience and judgment to estimate future cash flows of the business. Discount them at an appropriate discounting rate to come up with intrinsic value of that business. This exercise has to be done in complete isolation from market. Don't do such a thing like if market price is 100 and then you say that my acceptable entry price would be 80, this way you are nothing but a slave of market moods and all you would end up is speculating and not investing per say. If your honest valuation comes to 50 even if current market price is 100, stick to that and one day you would find that same business quoting below your valued price. Buying a business quoting a discount of your estimated intrinsic value and not at a discount of current market price is a better way of making expected returns from the market.

What I have so far mentioned has lot of subjectivity attached to it like 'business you really understand', 'honest estimation of cash flows', but again investing itself is subjective in nature and not objective or algorithm driven like many people assume it to be.

As I mentioned at start that past numbers don't translate to same for future, you should still look at a business's or company's past. A business which acts like a black hole for capital would continue to do so in future too and keep on raising or sucking more capital year on year to survive. A business which hasn't gone anywhere in past 10 years is unlikely to go somewhere in next 10 years too. A business run by dishonest management would continue to churn out fraudulent numbers in future too in order for growth to appear real. So if a business has done good things in past there are good chances that good things would happen in future too, provided surrounding conditions are still favourable for that business to survive (which your understanding of that business should tell).


The investor of today does not profit from yesterday's growth.

Sachin

Tuesday, June 16, 2009

Would Opera's new move take browsers and eventually WWW to a new level?

I have long been big believer of peer to peer type of network model than client-server or cloud based model. Reason I think so is that unlike before there is not much difference between client and server. Client i.e. you personal computer today has sufficient CPU and memory capacity to act like a server. Also with advances in communication technology we get high speed broadband right at our doorstep. The difference between client and server is narrowed down a lot as compared to what it was two decades back. Same machine acts as server at some places and is used at client at some places. Thus every machine is essentially a peer to others.

Most of the current and new web 2.0, is still working on a client server model and now a new buzzword called cloud model. Do we really need some centrally located servers or cloud of servers for our basic needs of networking, when same can be done right from our desktops or now even from mobile and other hand held devices. All we need is that these machines should be uniquely identifiable or have an IP address. We then can run a server right where we are and then these servers do the job of connect to other such clients and in a way build a peer to peer network. Skype is a good example of same and torrent based file sharing another. They all run on this peer to peer logic and are fairly popular.

Next step is to make general www peer to peer. I think first step here is taken by Opera. They have come up with a concept called opera unite. What opera has done is that it has placed web server at every client. This way everyone runs their own host device, with their own applications running on their own hardware, which can then be accessed from anywhere using any web browser. All this is to be rolled into their web browser. Opera is also providing extensive documentation to developers to create their own 'unite' applications and make it available www wide. Only drawback is that all peer to peer connection would be routed through the unite proxy. I think with time this limitation would be circumvented and internet would really be peer to peer they way it was originally envisioned.

Would other browsers particularly Mozilla's firefox join the bandwagon. If they do so then there would really be a need to standardize a p2p protocol to enable cross browser communication. Is this next step towards web 3.0 or semantic web, I don't know, but sure something to look forward.

Some of the web transactions still need to be client server, however much of the social networking which we do today can easily be done peer to peer (after all this is what social networking is about - peer to peer interaction). Would this change or endanger the current social networking platforms, I don't know, users would decide that.

Chains of habit are too light to be felt until they are too heavy to be broken!

Sachin

Friday, June 12, 2009

JQuery combobox plugin fixed for IE7

A useful JQuery plugin to display HTML Select element has been developed by Sanchez Salvador and team. Latest version can be downloaded from here (0.1.2.7). The plugin is good and fulfills the need of having a uniform select boxes across browsers.
However the latest version when tried on IE7 was causing page to jump whenever we selected any dropdown box. The reason was that the implementation was done by using focus and blur events of Javascript on the div wrapping the select box. In IE7 what happens is that when we focus any div, it cause page to auto scroll to the view where div is located causing page jumps. The same used to work fine on earlier versions of IE namely IE6. The same also works fine on FF2 and FF3. It seems that as MS upgrades the version of their IE they make many fundamental changes, which causes developers like us to rewrite certain parts of our applications to support them on their newer versions.
IE infact has few other bugs too, namely handling on z-index of CSS, which I think they have fixed it in IE8 (making it W3C compliant). For fix of this we had to patch using IFrames. There are some more issues like setting min/max-height/wdith is not possible in IE. For these too there are some custom fixes of patch available. Maybe thats the reason why browsers like FF are more popular with development community. I hope IE sticks closer to w3c standards in their coming versions.

Anyway coming back to the issue with the JQuery combobox plugin on IE7, this issue of page jump has been fixed, by changing the implementation of dropdown show/hide using mouse click events instead of using focus/blur.

The latest package can be be download from here (0.1.2.8). I am calling this version 0.1.2.8.
So if you are a user of this plugin and have been facing this problem in IE7, this version may help you. If you have any problems feel free to contact me.

Thanks
Sachin

update: Please download this link for a bug fix.
update: The JQuery combobox plugin made compatible with jQuery version 1.3.x. Please download it again from this link for the latest copy.
update: The JQuery combobox plugin made compatible with jQuery version 1.7.x. Please download it again from this link for the latest copy.