Friday, October 28, 2011

Random thoughts on Turkic and Mongolic tribes

I like to study the origins and history of various tribes and how they are inter-related in today's modern world.

Over the time there have been many migrations and inter mixing of various tribes and today its hard for one to identify where did he actually come from.

One thing that confuses more and more as I read into, relationship between Mongols and Turks.




So Today I just decided to pen some of my thoughts, so that I have a reference point, when I dwelve into this topic again.

  1. I believe Mongols and Turks originated from different part of central Asia. Though both belong to a common mongoloid race.What I have gathered so far is that Turks are primarily from present day region around Mongolia, and Mongols from present day region around north east china. There have been many migrations from east to west starting from Huns and culminating with Mongols.
  2. Who were Huns? I believe there were Turks and started first wave of migration.
  3. Are Han Chinese same as Mongols? I believe they are Mongols and I suppose first under Qin dynasty and than later under Han dynasty, many warring tribes were united to form kingdom of china. The rulers under these dynasty started building great wall of China to prevent nomadic Mongolic and Turkic tribes from laying further wars inside main land china.
  4. What I understand is that first Turkic tribes migrated east and then Mongols. Mongols and Turkic tribes readily intermixed and together they conquered Arabic tribes. Over their migration they intermixed with Arabic people, adopted Islam and founded Ottoman empire. I feel today's so called Turkish people are mix of European and Arabic people with traces of Turkic-Mogolic gene pool.
  5. I further feel that Indo-Iranian people are not same as Caucasian people, but a different tribe in itself. During their peak (Under Mauryan Empire) they conquered much of India and Persia. However over the time it declined and was then conquered by Turkic-Mongolic tribes (Mugals)  from North and Turkic-Iranian tribes from East.
  6. I think adoption of Islam by Turkic-Mongolic people was turning point of most of the Modern day history we witness in Asia and Europe. I feel once they defeated Arabic people if they would have continued with Tengerism we would have witnessed a different Geo-political map of the world today.


Wednesday, August 26, 2009

Extending JQuery Translate plugin to include raw text translations

There is an excellent JQuery plugin to translate text. This is based on Google Ajax Language API. This JQuery based translate plugin circumvents the limitation of number of characters that can be sent using the raw Language API. This is a serious limitation when integrating language API into our code, we cannot translate big documents typically having 2000 or more characters.

The translate plugin works very well, except there is a minor limitation, i.e. when we pass a raw text to it (which may contain line breaks, tabs and other special characters), the translated text strips out such characters back. Many times we need to preserve these in the translated text too.

The reason for this is because in the plugin, the language translate API is called using:

google.language.translate(text|content, srcLang, destLang, callback)
It always passes default text which the API interprets it as HTML markup. To pass a raw text, one needs to pass a content object with attributes {text: textToTranslate, type:'text'}. This way the google language API treats it as raw text and preserves the line breaks and other special characters.

So in order to have the jquery translate plugin work same way for raw texts also, I have extended the plugin to make distinction between type of the text to translate. One can pass the type in options.
Default is: type: 'html' and for text one would need to pass type: 'text'.
Example:
jQuery.translate(textToTranslate, languageToCode, {
type: 'text',
complete: function(translation){
//translation contains the complete translation of textToTranslate
},
error: function(){
//error callback
}
});

So I have extended the plugin to take care of calling google language API based on type. I have called this version as 1.3.10. It should work with jQuery 1.2+

Hope you find this useful. Any questions or comments feel free to contact me.

Thanks
Sachin

ps: download the above version from this link.

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