Playing around with a word counter

I write bits and pieces of code on the side, even though it seems that people find it hard to believe that managers in India can actually code. Most of the code is usually small tools I write to automate parts of my work. But sometimes, I write code which should be ok for use for other people also.

Recently, I decided to put one of these code pieces online. This is the word counter and you can get it on the github gist at : https://gist.github.com/vibhurishi/3d4793e60e24af8ebb9ebd9c547b8222

As a test text, I was looking for something that would be of relevance. Since we just celebrated our 72nd Independence day, I took Jawaharlal Nehru's epic speech on the night of Independence and ran it through the word counter. Below is the result.

tryst.txt
about               1
accept              1
achievement         1
achievements        1
act                 1
action              1
advance             1
adventure           1
afresh              1
after               1
age                 1
ago                 1
ahead               1
allow               1
aloft               1
ambition            1
ancient             1
anew                1
apart               1
appeal              1
architect           1
asia                1
assembly            1
await               1
bear                1
begins              1
being               1
belong              1
betrayed            1
beyond              1
bind                1
birth               1
blaming             1
blown               1
body                1
bold                1
boundaries          1
brave               1
brings              1
brothers            1
burdens             1
cause               1
celebrate           1
centuries           1
challenge           1
cherished           1
citizens            1
clings              1
closely             1
clouds              1
common              1
communalism         1
confidence          1
continue            1
cooperate           1
country             1
courage             1
create              1
criticism           1
cut                 1
darkness            1
dawn                1
death               1
dedication          1
democracy           1
democratic          1
destructive         1
difficult           1
disaster            1
disciplined         1
discovers           1
dwell               1
ease                1
east                1
economic            1
embodying           1
encompass           1
encourage           1
endeavour           1
ending              1
ends                1
endured             1
ensure              1
equal               1
equally             1
eternal             1
ever                1
eye                 1
face                1
failures            1
fateful             1
father              1
fight               1
filled              1
finds               1
first               1
fitting             1
followers           1
forgotten           1
forth               1
fragments           1
fulfil              1
fullness            1
furthering          1
gave                1
generation          1
generations         1
give                1
grandeur            1
grasp               1
greater             1
greatest            1
greetings           1
happen              1
heavy               1
held                1
herself             1
hind                1
homage              1
hour                1
however             1
humanity            1
humility            1
ideals              1
imagine             1
imprint             1
incessant           1
independent         1
indivisible         1
inequality          1
institutions        1
intended            1
isolated            1
jai                 1
join                1
justice             1
knit                1
larger              1
lighted             1
longer              1
lost                1
loved               1
made                1
magnificent         1
mansion             1
many                1
materializes        1
memory              1
midnight            1
millions            1
mindedness          1
motherland          1
must                1
nevertheless        1
next                1
noble               1
obligations         1
off                 1
only                1
opening             1
pay                 1
peasants            1
period              1
petty               1
point               1
power               1
praise              1
present             1
privileges          1
problems            1
progressive         1
prosperity          1
prosperous          1
rarely              1
reality             1
rejoice             1
religion            1
remain              1
remember            1
representatives     1
representing        1
responsibilities     1
rests               1
reverent            1
reward              1
rights              1
rises               1
said                1
send                1
served              1
set                 1
share               1
sharers             1
she                 1
sight               1
sisters             1
sleeps              1
slumber             1
social              1
soldiers            1
solemn              1
son                 1
soul                1
split               1
standard            1
stands              1
started             1
stormy              1
strayed             1
stricken            1
stroke              1
struggle            1
substantially       1
succeeding          1
success             1
suffer              1
suffering           1
suppressed          1
surround            1
surrounded          1
tear                1
tears               1
tempest             1
think               1
though              1
thought             1
through             1
together            1
too                 1
trackless           1
triumphs            1
tryst               1
turning             1
unending            1
unhappily           1
unknown             1
unto                1
unworthy            1
upon                1
utterance           1
verge               1
very                1
vision              1
vital               1
volunteers          1
where               1
whither             1
wholly              1
wind                1
wipe                1
wise                1
without             1
woman               1
workers             1
write               1
years               1
yet                 1
again               2
alike               2
any                 2
appointed           2
as                  2
awake               2
beckons             2
before              2
bring               2
build               2
by                  2
cannot              2
children            2
come                2
disease             2
do                  2
dreams              2
end                 2
enough              2
faith               2
full                2
go                  2
good                2
hard                2
hearts              2
high                2
hope                2
ignorance           2
into                2
labour              2
life                2
make                2
means               2
measure             2
message             2
much                2
narrow              2
nations             2
old                 2
others              2
ourselves           2
out                 2
over                2
pains               2
peace               2
peoples             2
pledges             2
political           2
poverty             2
quest               2
responsibility      2
resting             2
some                2
sorrow              2
sovereign           2
spirit              2
step                2
still               2
strength            2
striving            2
take                2
taken               2
their               2
there               2
they                2
those               2
thoughts            2
till                2
torch               2
what                2
whatever            2
whose               2
also                3
an                  3
can                 3
day                 3
destiny             3
even                3
every               3
fortune             3
free                3
his                 3
live                3
man                 3
moment              3
often               3
past                3
redeem              3
star                3
time                3
up                  3
at                  4
been                4
comes               4
from                4
future              4
great               4
history             4
ill                 4
nation              4
never               4
new                 4
now                 4
opportunity         4
pledge              4
service             4
them                4
today               4
which               4
work                4
has                 5
no                  5
one                 5
when                5
who                 5
world               5
all                 6
long                6
may                 6
shall               6
people              7
will                7
her                 8
so                  8
or                  9
be                 11
freedom            14
our                14
us                 16
india              18
we                 37
('Number of words in the file :', 1099)

Happy Women's Day

Wishing you all a very happy Women's day. Sharing a few tweets that I gathered from around the world.

The Good
















The Bad









The Ugly









North India Polluion


There seems to be an opinion that somehow the pollution is only Delhi centric. This is not the fact. The crops are being burnt in the states around Delhi, but the stupid and idiotic news media shows only Delhi.

Here are a few visuals from other places. The situation is dire all throughout.




















Indian Kingdoms : By duration

In my last post I had listed out the various Indian Kingdoms and the duration of their reigns through our recorded history. That timeline gives a great look at the march of time through the ages. But it does not give a good idea of a comparison of how long each kingdom existed.

So, today's post ( a bit short though) is on the absolute length of each kingdom. We do not worry about where it was in the relative timescale here.

We know that India is a young country. But how young ??  See the below chart.


There ! India is right at the bottom. I had left out some very small and short lived states in the historical list earlier - and well, India is just a bit longer than them. Most of these empires are based on the reign of a single ruler/king. India at 70, just is beginning to feature in the list.

Hope to see it grow up upwards as the years march onwards !

But then, this huge list does not give a very good idea of a relative size. How much longer did the British rule ? How long did the longest living kingdom exist ?

So, here is another chart - but based on only a few that I found interesting.



Alright ! Lets take the 70 years of the Republic of India as a single unit of time.

The top 4 empires were 20 times longer at the least. In fact, the Pandayan Dynasty lived on for a cool 2350 years till the mid 16th Century. Obviously this begets the question whether the timeline in Wikipedia for this empire is correct ? Wikipedia lists this as having 3 different stretches - maybe it had its ups and downs ? I do not know - needs more study.

But as with the other top 4, these start in sometime in BC - and we know that these dates are best guesses, so would have an element of error in them. However, the end dates are pretty well known - so there is credence to these long lived dynasties. I would love it if people can point me towards details of these empires.

The Cholas is an interesting empire. It spread from south India all the way to the Indonesian islands. How could they have managed this huge an empire over the seas in that time - without the means of instant communications ? Amazing !

We hear that the Mughals and the British ruled for a very long time. Well, the data is not that much in favor of them.

The entire mughal sultanates, from their times of conquests in India till their ultimate decimation by the British existed only 5 units of time.

And the British ? Even less. So less in fact that I have include the Company Company and the British Raj - as just by themselves they were for a very short duration. The British Raj was actually just a bit longer than the Indipendent India. Just 89 years in fact. However, most of the infrastructure had been built in that time. This begets the question - what have we really done in the last 70 years ?

A timeline of the Indian Empires

The Empires through the ages.
Link to larger version as Blogspot doesn't let me link the image.

So, over the last few weekends, I went over the various wikipedia articles to figure out the various kingdoms that were , which lead to the mordern day India. Part of this research was instigated due to the fake rehtoric nowadays about how our glorious past has been lost due to the Mughals / British etc.

As I started researching, the timelines kept reaching back. All the way to the time before Christ - the colloquial 0 AD date. We are so much caught up in the hate agendas focusing over the last couple of years that we forget that this land was always very diverse.

Much before the British. Much before the Mughals. Much before the Ashokas and the Akbars. Much before Chandragupta Maurya. Thats when the recorded history starts. Most of this is about the Mahajanapadas - and we owe it to the Buddhist and Jain texts which recorded it for posterity. Before that, most of the history is suspect as it is based on word of mouth. the long lines reaching back to 1500 BC are part of that - we really do not know when those empires started, and so these are best guess dates. More research is needed into them before we can for sure say that these are the actual timelines of these kingdoms.

Before the mahajanapas was the Vedic age. Since there are too many conflicting estimates of that age, I have left it out. Also it does not give any inkling to the various kingdoms that were there.

As you move forwards in time, you see that India was actually very fractured. Mutliple kingdoms existed. Backstabbing each other. Fighting for land. Having various treaties and marriage arrangements.

Fast forward a whole lot of years and you start seeing the first of the Islamic kingdoms - the sultanates. The ones in Green. At the same time, there were healthy and long lived other non-islamic kingdoms. No idea why most of the people forget to mention that, but if you look at the graph, you can see the interleaving of the black and green lines.

Forward a few hundred years more and the red lines - the British start to appear. And yet the black lines do not go away. They exist in different parts of present day India.

Finally, everything merges and we get India ( well, also Pakistan and eventually Bangladesh). The blue blip - that puts into perspective the small amount of time that the Republic of India has existed. Kinda insignificant in the grand scale of things so far.

PS : A lot of time went into preparing this chart. If you do share this - please do with proper attribution.

Link to google drive in case you want to download this https://drive.google.com/file/d/0B6LzAV0_xl_2MnIyNUVoV2FTcDQ/view?usp=sharing

Hindustan - how the name came about to be

There is a recent push to rename India as Hindustan. I wonder if people who want India to be renamed as "Hindustan" even know the origins and the extent of it ?

I initially started searching for the roots because anything <>stan does not seem to be indigenous to the Hindu religious wording - its more Islamic. And true to it, the region on the other side of the Indus was called Hindustan by the Persians.

In 4 BC, when Megasthenes visited India, he wrote Indika - his book on India. Its interesting that in 4th BC, the name used was Indika and not Hindustan - which is closer to the term India that the Brits used. It could be that the term Indika was still being used in Europe at the time that they started to trade with this region.

By the 13th century, the region on the other side of the Indus were called Al Hind, and the "stan" started creeping in and was called Hindustan - to denote the region - not a particular country or state. This I would attribute to the standard Arab terminology. We usually put a "pur" or a "halli" or something similar in the local dialect, and the Arabs just gave their own name to it.

The British and other European merchants in the 18th Century then started trying to figure out the name for the religion. There was not one unified religion - everyone had their own ways of worship. This concept of polytheism was alien to these guys, so they clubbed together everything and started denoting the pagan worshipers as Hindus. Essentially, if you were not a follower of monotheist religion ( Christian or Islam ) you by default were a Hindu.

One more interesting thing is the extent of Hindustan. It did not cover the entire Indian peninusla. The extent was till the Vindyas in the mid of current day India - essentially, the lands of the Indo gangetic plains, demarcated by the seas of the mountains on the sides. Made a lot of sense I suppose in the earlier centuries for people traveling, and also percolation of the same customs throughout due to ease of traveling ( apart from the jungles at that time).

Affected by Petya

#Petya ransomeware started to creep out on 27th June. Initial analysis by Symantec and McAfee seems to indicate that it is similar to the #WannaCry ransomware that hit about a month back, but Kaspersky says it is #NotPetya

Ransomware screen. Win 8 systems. Source


Also note that the email address that is mentioned in the ransomware screen is blocked. So, even if you pay the ransom ( and 35 people have paid ) , there is no way you are going to un-encrypt your system.

Do not pay Ransomware. The email id is blocked.


While the AV companies debate it out as to what it is, here is the toll that it has taken so far :

Leave a comment if you come across more companies hit by this malware. Please link to source.
  • Russia
    • Rosneft (Oil Producer)
    • Home Credit ( Banks)
    • Evraz ( steel makers )
  • Denmark
  •   Britian
  • USA
    • Merck
  • Ukraine
    • Banks
    • Power Grid
    • International Airport 
    • Metro (wholesale store)
  • France
    • Saint Gobain
  • Germany
    • Deutsche Post
  • Netherlands
  • India
    • Beierdorf AG (India branch) ( makers of Nivia)
    • Reckitt Benckiser ( India branch) ( makers of Dettol , Lysol )
    • Jawaharlal Nehru Port  


Side Note : Someone with the account 1FuckYouRJBmXYF29J7dp4mJdKyLyaWXW6  as paid 0.0000666 BTC ( approx 16 cents ) . That's one way of getting your point across !