Thursday, August 12, 2010

Time for my IE revenge

Since the birth of internet we all have been tortured by website which work only in IE 6. It is time for revenge! Mostfit doesn't work in IE6. We tell the companies using it specifically to use Firefox or chrome. If they insist on M$ we tell them to "use IE 8, but no IE6"!

Die IE6! DIE

open source

Open source is super contagious. I just my office admin saying to a M$ guy: "We are against microsoft! we are building one open source products and we do not appreciate M$"! Mind you this is a social sector company and not a technology company!

Tuesday, August 03, 2010

Google ME

Rumour has it that Google is planning yet another social product "Google Me". I would like to take this early opportunity to put it out there:

IT IS GOING TO FAIL

like others viz Buzz, Wave, Knol, Open social, Orkut etc.

Monday, July 12, 2010

Why *NIX is the future ?

"perfect replication is enemy of any robust system" - DAEMON by Daniel Suarez

This is the single biggest reason why windows systems/networks are captured so easily by worms, hackers and viruses. Each windows network is made of exact clones and if an attacker can pawn one system in the network he can annihilate each and every one of them. A typical corporate windows network is made up of identical systems running workstations, laptops, routers and servers. Once a box is compromised each and every one of them is compromised.


Compare this to a linux system/network. Even though it is possible to write a virus/worm for linux based systems, writing a virus which can affect every posix complaint system is at best improbable. Almost every *nix box is different from each other. Kernels, Desktop environments, distributions, servers, browsers etc all are be different and this makes is so much difficult to run an exploit on each of these machines in one go.

Saturday, April 17, 2010

Microfinance as a business

Microfinance as an industry has started to grow up. However it is not all rosy. An impending IPO of SKS has added more fuel to the naysayers calling MFIs yet another loan sharks, sum-prime like bubble, profiteers and what not.

A lot of these are coming from western media like WSJ who have started covering MFI sector almost every week and obviously a lot of it is negative. They generally pick up on small village and show how MFIs have flushed them with loans or how they have all defaulted as a community. A lot of it, I think, is plain BS! These Americans have no freaking idea of whats happening on the ground. I think what western media clearly fails to comprehend is the sheer size of the market and diversity of this country...or they don't want to. Paint a bleak picture and their readers would get some kind of sadistic pleasure out reported failing of yet-another-poverty-elimination-experiment.

Viability of Microfinance: A thought experiment
Microfinance institutions(MFIs) lend to poor people who actually do some 'real' work and repay it back to MFIs overtime. For this MFIs charge a good amount of interest rate. Now lets take an example of a farmer taking a loan for cow. A good cow(not a jersey) which costs about INR 10,000 gives about 10 lts of milk. This in rupees terms comes to about INR 80 per day. Even if we take 20% of this as costs of medicines etc and assume that a cow gives milk only half the year then he earns about INR 30 or per week INR210. Now a typical MFI loan of Rs.10000 with 50 installments has an EMI of about Rs. 230. I don't understand who it is difficult for a farmer to service this loan when cows are just a side business for a farmer. Moreover he'd get good returns on his 10K loans after he has paid of the loan in one year.

Why scaling up is a necessity for MFIs
Scaling up is not a luxury but a necessity. Those who do not scale their operations cannot ever make significant dent in the bleak universe of poverty. A typical MFI starts with about 100 clients and quickly grows to about 1000 clients. The typical loan size is about 10000 which means the amount of money disbursed is about 1 crore INR. That is a large village or a small town to whom they can reach. After this they start to stagnate in need of better management, IT, manpower etc.

India has 110 crore people. 30-70% of which are in dire need of funds to scale up whatever they do and become "non-poor". The market size is about 100 million clients. If an MFI just reaches 1000 people then it is not doing enough. In my view when they reach about a million clients then all they have captured is 1% of the market which still is clearly not enough. Even if we have 100 such players still there would be room for more MFIs to service cycle 2 and 3 loans of these people. In India MFIs of size serving more than a million customers was 3 according to this report in October 2009(page 11). Therefore saying MF sector is a bubble is a joke! There is a clearly a lot of room to grow.

There are many more challenges for smaller MFIs. Fraud by their employees due to weak monitoring, difficulty is securing credit lines, higher cost of loans etc. Larger MFIs with good governance can tide over these difficulties with ease.

It is About time we started looking at MFIs as proper for profit businesses. We have reached a point where MF sector needs to kick off the training wheels and switch to corporate model and government should respond with creating solid guildlines and rules for this sector. RBI has very clearly shown that with the banks and now is the time that they do it for MFIs/NBFCs. They also need good governance and that needs talent. Without money this sector cannot bring in talented people. This sector needs good IT, solid reporting tools, CIBIL like credit bureau, professional consulting firms etc. All of this can only come along if these MFIs start scaling up, bringing to the table economics of scale to pay off corporate salaries and put in good solid systems.

Profits not extraordinary profits
What Md. Yunus started was a NGO like Bank for poor but clearly the self governing, non profit model is not for everybody and that model cannot scale for everybody. Not everybody is Md. Yunus. He has very clearly shown us a path. Not everybody is a as talented or motivated. Moreover greed is the primary reason why farmers have suffered for so many years. Allowing it all over again would be foolish. This is a capitalist economy and everybody needs to earn his/her bread. If poor are benefiting from the loans MFIs provide them and earn profit on it then why should MFIs not be allowed to earn some profit. Having said that extra-ordinary profits is something what good RBI regulation should prevent from happening.

Note: This post is about what I think & feel and not of my employer.

Monday, April 05, 2010

Featuring MOSTFIT

I have been working on Mostfit for about 6 months now. It is an open source MIS (management information system) for MFIs(Microfinance institutions). For the uninitiated MFIs provide loans to the poor without any collaterals. It is a social lending model where a group takes a joint responsibility of timely repayment of loans. MFIs are almost like the infamous money-lenders with much larger scale and lower interest rates. This idea was first started by Md. Yunus of Bangladesh who later received Noble peace prize for it.

MFIs now have started to scale up and have started adding hundereds and thousands of clients to their books every week. Most of the MFIs are managed by excel sheets and due to the size of operations it quickly starts becoming a problem for them. Let me give you an idea of this size: SKS microfinance which arguably is India's largest MFI has about 1 crore clients and about Rs. 4000 crore in loan outstanding. They are even going for an IPO very soon.

This is where MOSTFIT comes into picture. It is designed to suit the needs of a diverse model MFI with many loan products. It is built from grounds up to be completely flexible. It is written in ruby, datamapper, haml and rspec. Code resides here. We even provide an instant MIS instance on http://mostfit.in

So any MFI out there looking for a MIS should give it a try at http://mostfit.in

Saturday, October 24, 2009

Google wave is a failure

Google wave has created a lot of frenzy lately. It has people begging for accounts and people who have invites selling them at e-bay. Deja-Vu! Gmail reloaded? Remember when everybody went crazy for the invitations and a lot of them were sold on ebay at that time. Google kept the supply scarce to drive this even more, tapping on a very basic instinct of human nature: elitism. "Oh_my_god_you_have_gmail" was like Harry potter's forehead scar and people loved to flaunt it. Google wave's launch have been similar. But there is a difference between Gmail and Wave.

Gmail was/is an awesome product and path breaking in many ways. Google provided 1GB storage when yahoo gave 4MB! Not only that, compared to Yahoo's interface Gmail was light-years ahead. It did what every great design does i.e. get out of the way and let them do what they want to. Gmail had features which people needed and they used the right technology to deliver it. It was first free ajaxified email client(a major one at least) and allowed people to do everything without reloading the page.

Wave, on the other hand, is almost obnoxious. It is as if Google is trying very hard to show off what it can do instead of delivering what people need/want. For instance, that live typing thing. I hate that feature. It is like the unix "talk" on console back in college and I hated it back then too. I do not want people to see what I am typing. I write angry things sometimes which I never send and therefore I do not want people to read what I type. I have talked to people about it and everybody feels that real time typing is just overkill. If you think about it e-mails allow people to speak freely without the fear of others stepping on your feet. It also allows you to think about what you want to convey, double/triple check what you are sending, check facts etc. Google wave just kills all this in one go!

I am sure Google engineers/product managers know that but they are too obsessed with the technology to kill this feature. Or may be they do not realize it. That is a bigger problem which means they do not understand the domain problem well and do not know what problem they intend to solve.

Even if Google gives and option to switch it off, I do not think Wave is going anywhere in this avatar. Wave UI sucks: It is unintuitive, slow and generally not well thought out. So even if they give an option to switch off the instant typing thing, this is not so easy to fix. For instance, if there is a long wave and there are to new waves at different ends of the conversation, I do not know how to find them. The enter key doesn't work as expected. There are so many "unsynced waves" notification. I can go on and on and on.

Monday, October 12, 2009

Proactive India

I love the fact that this Government is very proactive:

Going after the naxals proactively
Naxals have been a big menace for this country. They started off as a movement to protect the interest of Poorest of poor. However it has mutated into a cult which promotes crime and law and order which in turns makes sure poores-of-poor remain just that. It was abut time that govt. capture/shoot all the big naxal ideologists and they did just that when they captured Kobard Ghandhy. And now comes the pounding of the naxal land. Hope this seals the fate of Naxals.

Dealing with Pakistan in a firm manner
Pakis have been very adventurous last year with Mumbai attack. India responded really well by making them pay at various fronts like diplomacy and threatening stability of Pakistan. India also managed to launch the long needed eye-in-the-sky. They were all set to launch this Israeli "eye" in 2006 when America intervened. This is a crucial realtime element which has been missing since the days of Operation Blue star.

Dealing with China
China has been feeling adventurous lately and that is not good for us. India has shown China that it is not the 1962 India and will not take things lying down. They are activating advance airstrips, deploying Mig 29s, Brahmos missiles, building more roads and infrastructure to make sure China understands clearly.

Keep up the good work

Sunday, October 11, 2009

One line window pagination in Ruby

def getPages(current_page, minimum=1, maximum=20, window=2)
return((minimum+window<current_page ? minimum.upto(window).collect : minimum.upto(current_page+window).collect) + (current_page-window > minimum+window ? [".."] : []) + (current_page>minimum+window ? (current_page-window > minimum+window ? current_page-window : minimum+window).upto(current_page+window > maximum ? maximum : current_page+window).collect : [])+(current_page+window+1<maximum-window ? [".."] : [])+(current_page<maximum-2*window ? maximum-window : current_page+window+1).upto(maximum).collect)
end
Output:
>> 1.upto(20){|x| print x; print " : "; p getPages(x,1,20,1)}

1 : [1, 2, "..", 19, 20]
2 : [1, 2, 3, "..", 19, 20]
3 : [1, 2, 3, 4, "..", 19, 20]
4 : [1, "..", 3, 4, 5, "..", 19, 20]
5 : [1, "..", 4, 5, 6, "..", 19, 20]
6 : [1, "..", 5, 6, 7, "..", 19, 20]
7 : [1, "..", 6, 7, 8, "..", 19, 20]
8 : [1, "..", 7, 8, 9, "..", 19, 20]
9 : [1, "..", 8, 9, 10, "..", 19, 20]
10 : [1, "..", 9, 10, 11, "..", 19, 20]
11 : [1, "..", 10, 11, 12, "..", 19, 20]
12 : [1, "..", 11, 12, 13, "..", 19, 20]
13 : [1, "..", 12, 13, 14, "..", 19, 20]
14 : [1, "..", 13, 14, 15, "..", 19, 20]
15 : [1, "..", 14, 15, 16, "..", 19, 20]
16 : [1, "..", 15, 16, 17, "..", 19, 20]
17 : [1, "..", 16, 17, 18, 19, 20]
18 : [1, "..", 17, 18, 19, 20]
19 : [1, "..", 18, 19, 20]
20 : [1, "..", 19, 20]

Dunno if I should be proud of this or worried!

Wednesday, September 23, 2009

Dump those fixtures

I hate testing/debugging a rails application on "unreal" data. At the same time I find writing fixtures by hand is a big pain. I wrote this rake task to dump all the data in fixtures folder by (rake test:fixtures:dump) on a production environment, bring it to development environment and do a rake test:fixtures:load


desc "Dump all the data from DB to fixtures in YML format"
namespace :db do
namespace :fixtures do
task :dump => :environment do
require 'active_record/fixtures'
ActiveRecord::Base.establish_connection(Rails.env)
base_dir = ENV['FIXTURES_PATH'] ? File.join(Rails.root, ENV['FIXTURES_PATH']) : File.join(Rails.root, 'test', 'fixtures')
fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir

Dir.entries(File.join(RAILS_ROOT, "app", "models")).each{|filename|
if /\.rb$/.match(filename)
model = Kernel.const_get(filename.gsub(".rb", "").camelcase)
if model.ancestors.include?(ActiveRecord::Base) and model.table_exists?
puts "Dumping #{model}"
file = File.open(File.join("test", "fixtures", model.table_name+".yml"), "w")
counter = 1
model.find_in_batches(:batch_size => 5000){|rows|
rows.each{|row|
file.puts "#{counter}:"
file.puts row.attributes.to_yaml.split("\n")[1..-1].collect{|x| "\s\s"+x}.join("\n")
counter+=1
}
}
file.close
puts " -- Created a file with #{counter} rows"
end
end
}
end
end
end