Thursday, September 9, 2010

Rails Double loading

<code>Rails console work revealed a rails file being loaded twice but some of the code was external to me. So, I could not really
where it was coming from. Jason King had this nice tip.

</code>

It looks like things are being loaded twice. Not sure what `config/preinitializer.rb` is (part of your own project?) but obviously rack shouldn't be loaded twice. This can happen if two things are requiring the same file in different ways the only way that `require` protects you from multiple-loading is a string comparison of what was required. Eg. require 'redcloth' and require 'RedCloth' will both succeed.

The simplest way to resolve this is to edit the files that are being loaded, and at the very top of them (to debug) just put this:

y caller

Then just fire up your console, and you should get a stack trace of where the files are being loaded from. You might find multiple load points in your project, or at least some hints as to where to look for the double-loading.

Monday, June 7, 2010

Does the Government of India care for its citizens, especially its poor?

After a long blogging hiatus, the Bhopal verdict today made my blood boil and I just felt like writing. 26 years, that's how long its taken for this verdict - Two freaking years for each of the convicted, who got out without a fret on bail. To further ridicule both the living and the dead, UCIL was  only asked to pay 5 lakhs as fine. Great, further this rotten judicial system and we shall continue to bask in the glory of 'India Shinning'.

These past six months of stay in India has revealed something very sad. Respect to both living and the dead in India are confined to the religious epics, the people and government in general care less (including me). It only stays in memory for a few minutes and forgotten or swept under the rug real quickly.

Prime examples are the recent spate of attacks on CRPF, the attach on the Gyaneshwar Express and the judgement on Bhopal. Most dead are India's poor and the elitist government has turned a blind eye.

Thursday, November 5, 2009

Koda Episode - Aberration or Norm?

I think we as Indians should be ashamed to call ours a civilized society. There is hardly anything civil about the nature of how these criminal, absolute inhuman rogues get away. In the case of Koda and Ekka as this blogs point out, the two national parties are directly involved breathing life into who eventually turned out to be scumbags. I am not trying to accuse the leaders of these parties but if they have an ounce of spinal fluid left in their system, they would bring these morons to justice in the quickest possible way and distribute all their wealth to protecting the wealth of the state. To hear each day a statement like Rich State, Poor people have to be like a Thorn in the eye.

While it is good to hear speeches, it is time the President does something rather than remain a 'rubber stamp'. I often think whether that post has any use at all. While Manmohan Singh seems a nice man, it takes someone with far more audacity to wipe out the menace once for all.

When we lift are MLA and MP's to safety for purely selfish power grabbing reasons, we are sacrificing the core reason why we exist as humans. It wouldn't be far fetched to say that these leaders are leading us to oblivion and creating more maosits every damn day. With folks like Koda minting at a startling official figure of 4000 crores, all tribals in Jharkand are a Maoist waiting to happen.

Although anecdotal, each trip I've heard stories about how Chandrababu Naidu amassed 1000's of crores, same is the case with late YSR and his son Jagan, Venkaiah Naidu and his brethren, same in Bombay, similar with the 'mining' brothers in Bangalore.

I cannot imagine that YSR and co got away (during recent elections) declaring assets of 50 lakhs as their entire property. How can one for a minute even think of making that document public and absolve the scrutiny that may come with? How dumb can they expect the citizens to get? And, for that matter, the entire legal system. Perhaps, it is for this reason. When the CJI of India and his team can claim their entire earnings are about 40-50 lakhs, anything is possible.

It is certainly not an aberration but a norm. We do live in times where for a few cents more, everyone of these buggers will sell darn anything, including the sovereignty of the country. Folks like Koda and Ekka would have no clue what that would mean...

Sunday, October 18, 2009

TheMoth.org

I happened to listen to three stories today on NPR from a collection at TheMoth.org. One of them from Ed Gavagan is on their featured listings. The stories told with no notes, prompts are told live in free form. When I sat down in the car, I had a short drive and the first one started playing. Within the first few minutes, I was so spell bound that I had to pull into a parking lot, turned off the engine and sat there listening to the next full hour.

I was just blown away by the shear eloquence of the story tellers, normal folks like you and I who could recite a deeply moving/funny/serious incident that occurred in their lives. If you have not heard about TheMoth.org, you are missing a great deal. Check'em out.

Monday, September 14, 2009

What a Dick!

Did you see the US open final between Federer and Del Potro? A great game. Dick Enberg, MC interviewed Federer and then Del Potro in English. Del Potro made a very gracious speech in English and then requested the MC to speak a few words in Spanish.

The prick Dick refused the first time saying there was no time and proceeded to ignore him. Del Potro who was living the best moment of his life, and wanted to address his native country had a very confused look and had to ask a second time before Mr. Enberg handed it over saying that he would speak short. WTF!!
The man of the evening wants a minute or two to address his fellow Argentinians and he has to take the permission of the old hag.

Get a life, CBS should ask him to issue an apology and ask him to lock himself with Serena to help her shove that ball that she so wanted to shove. That would work each other out..

Friday, June 19, 2009

The Double Talker -- Just Awesome

I don't usually break out in laughter (esp, alone) at office but this did it. This is just awesome.



Price is Right-Joseph, the "double talker"

Tuesday, May 19, 2009

Beautiful Rails

This past couple of weeks I was back again working with Rails. This was after an initial discussion with Indian Railways GM who said a prototype/demo might help them with the service proposal. I was after their API but apparently at this point, if someone wants to use their API, it is burdened with huge price and unrealistic requirements. At some point, they had 20 lakhs of deposit and 5 crores of turnover to even qualify to use their API. It is mind-numbingly cruel on their part to ignore young budding entreprenuers but that is for a different topic.

While I was experiment about their APIs, I wondered if it would as restful as Rails is. I still have no idea but I still had to come up with a prototype to discuss what I intended to offer. Rewind 2 weeks, I had no site, no code written. Today, albeit in a dev environment, I have couple of pretty decent Rails sites that talk to each other via XML, all written to be Restful.

Technology is wonderful, the ones that make sense and are easy to use are even more satisfying. Rails is cool, easy to prototype and amazingly fast to adapt. The plugins that are available to support are just limitless.

As part of this effort, I ended up using the following open source resources:

I just wish there was open source hosting sites that would let you host until you move to commercial space. Not all of us are seed funded. All in all, exciting two weeks. I plan to enhance it further until the folks in Delhi ask for one or deny. If they do not ask for a demo, backup plans are to contact other OTA's or go solo. Either ways, its exciting.