Thursday, December 30, 2010

Is Saleh an option to Karzai?

I accidentally watched Amrullah Saleh's talk on C-span and suddenly I see new hopes emerging in Afghanistan. I was impressed so much so that I googled him and read a few articles. What I decipher is he is neither a Madarsa going blind jihadi type nor is he an absolute pro-US face. He is an educated person and has a high understanding of Afghan problem and seem to have clear view of its solution. At least he says true things as they are. No politics no gimmicks. That said where is he going? US is utterly unhappy about Karzai. Karzai's recent pro-Pak decisions has alienated Indian interests and an increasingly powerful Taliban is crying for a change. A change that is deep rooted. In Saleh I see a Man who is intelligent and a leader with followings in grassroots. He seems to understand the problem better than US and NATO. With US (In Obama) and Europe now beginning to acknowledge its displeasure with Pakistani efforts they need a tough actor in its backyard. Someone who could also be a face saver for western powers upon their exit. With Saleh's experience being a Spy-master he is not one who would be as concerned about his survivability as Karzai is today. So I don't know what the big game would be but I am pleased to see new young and confident leaders emerging in Afghanistan.

Sunday, December 26, 2010

Best and worst of e-newspapers

I read a few news papers and here is my list of my reading pleasure ranking:

Rank (1): http://in.rediff.com - Simple and easy. News are mostly latest. Even though it does have a tendency to lean towards RSS/BJP ideologies but the newspapers simplicity is its greatest strengths. Providing yahoo like email service is an icing on the cake.

Rank (2): http://news.bbc.co.uk - One place to find the latest relevant happenings around the world. News you can call impartial and believable filled with quality English. News are easy to traverse through. A site I can trust with authentic news.

Rank (3): http://www.yahoo.com - Believe it or not, yahoo provides better news reading experience than many news channels and it is not even a news channel.

Rank (4): http://www.cnn.com - If you have to check the hottest news flash it is difficult to beat CNN.

Rank (5): http://www.timesofindia.com - I wanted to rank this last because of its poor reading experience. Unwanted advertisement flashing up over the news you are just starting to read is such an annoyance. It is the worst e-newspaper down right. Whoever leads it has made sure it looks totally non-professional some cheap ad-driven channel. That said still not ranked last because its better news coverage of India and Indian cities. City news are easy to find and can be reached without scrolling the page.

Rank (6): http://www.hindustantimes.com - Definitely a better reading experience than timesofindia but still the way news are arranged makes it difficult to traverse through what I am looking for. Many good news articles can not be reached without scrolling down. News content is not remarkable but does stay latest and literary articles are mostly worthless.

Tuesday, December 21, 2010

Wifey in the front row of a music concert

As she continues to be a classical music fanatic (only if you could recognize her):

Monday, December 13, 2010

Migrants cause increase in crime. Hold on!

My dream to work in a research organization took me to a job in Ahmedabad, Gujarat. I never felt more UPian than when I used to catch a train back to Lucknow. I still remember horrific scenes at railway platforms. Direct trains from Ahmedabad to UP neither got any respect nor did its passengers. I used to rent a place in Gandhinagar - a relatively clean and an organized city. I once heard someone complain of increase in theft since the influx of migrant laborers from UP and Bihar. No it was not a Police report but one native's perceptions. BTW, during those days we also used to see roadside colonies of native tribes that even some of my Gujarati friends were skeptical of. Safety is a major social concern and migrants often bear the brunt. All my friends from UP and Bihar were Engineers and Scientists some with degrees from USA. I could have trusted them with my wallet full of cash. As I could not afford flight tickets I traveled by trains where I met regular hard working families. People who were more concerned of the money they saved and taking it back than stealing someone else's. Even though I did not travel in general compartments but the train itself used to make me feel a migrant laborer. I have never stolen a thing.
Then one day I decided to migrate again. Mumbai consulate had a huge line waiting to get Visas to US. I was astonished to find that the majority names ended up in Patels. Gujarati is a hard working community and mostly business owners in United States. Likewise laborers from UP and Bihar is a hard working lot. Migrants chase a better life. A life that is safer and prosperous for their children. Be it leaving stark poverty of eastern UP or a dream to own a motel and restaurants in United States. There are and will always be gray elements in any part of the world. The recent economic depression has proved bigger thieves in white collars than those sweaty laborers. Migrants don't increase crime, they increase competition.

PS: The blog is in response to Chidambaram's derogatory remarks against migrant workers in Delhi. I used Gujaratis to showcase a trend and my experiences from the days I worked in Ahmedabad.

Tuesday, December 07, 2010

पीने वालों के लिए इक शेर

लगी है लत यूँ शराब पीने की,
मौत भी लग रही तम्मना मुझे जीने की।
क्या गिला जो गलता शरीर इसे पीने से?
बढ़ाये धड़कने जब ये हमारे सीने की।

Monday, December 06, 2010

WikiLeaks - Is it worth the commotion

There are certain things that get more attention and importance more you give it to them. Is wikileaks telling whats "aha new"? Oh no! Pakistan is an arch enemy of India and Chinese are covertly using it against India - Is this a revelation needed from wikileaks? Biggest fundings for Taliban and Qaeda comes from Saudi Arabia - hmm! Where were those 19 hijackers came from, does anyone remember? Even many Iranians don't like the Ahmedinazad's regime - what would be new if Saudis don't either? Extrajudicial killings in Iraq - sad and needed to be stopped but who would have not thought it happens when armies are engaged. Karzai's government is corrupt the elections were rigged. So? Is US going to leave Afghanistan over it? Is there a credible alternative to that? What wikileaks is telling the world that any astute political analyst would already know or have guessed. Yeah the leaks would have been if US helping Iran to counter Israel! Yeah that would be a real shattering leak. So if you don't have anything that is not already kind of known then change its name to wikireminders.

Thursday, December 02, 2010

Internet vs Book

Wednesday, December 01, 2010

Program on BalKrishna Sharma Naveen

So if you happen to listen to All India Radio, Lucknow station do not forget to listen to http://drpratiksha.blogspot.com/2010/12/blog-post.html on Dec'8th 2010.

Friday, November 26, 2010

Five lessons from the last decade we are likely to forget in the next

1. Terrorism is evil for everyone.
2. Saving has no substitute.
3. War does not solve problems.
4. Political stupidity is shameless.
5. Peace does not mean justice. Its making brokers happy.

Wednesday, November 24, 2010

Where Naidu failed, Nitish succeeded

Bihar election results were stunning but not an eye opener. It was somewhat expected. Its a victory of sincere effort to govern over the same old caste based, psychological crap game so far played by Congress and RJD combined. Years ago when Chandra Babu Naidu lost the Andhra elections it was a shocking defeat. In spite of all the industry that Naidu succeeded in bringing in and bringing Hyderabad on a global map, the wealth did not reach the poor. Nitish kept the goals in sight and not necessarily in just impression building. It was not just Patna shining - Every city of the state has seen growth. Not every citizen may have an email address but they now do have roads to places they want to go to. Social and political situations in Andhra is very similar to Bihar and one lesson to learn is - "In the world of technology, it is very difficult to master people". Just don't lose the sight from the people.

Monday, November 08, 2010

A poem to salute soldiers fighting Militancy

(To the God almighty)
अभय दो अभय दो अभय दो अभय दो,
इस हिंसा की नगरी में मुझको विजय दो।
मैं सब कुछ हूँ छोड़ आया इनको बचाने,
इन मासूम बच्चों को ममता ह्रदय दो।
(A message to the enemies)
अगर अरि ये सोचे वो रण जीत लेगा,
इन भारत के बच्चों को वो मीन्झ लेगा,
तो सुन लो ओ बाग़ी संभल लो ज़रा सा,
इन सिंग्हो की गर्जन में तू होगा डरा सा,
जो नफरत की अग्नी जला तू चला है,
बुझा दो बुझा दो बुझा दो बुझा दो।
अभय दो मुझे तुम अभय दो अभय दो।
(Now a plea to terrorists)
जो घर तू है तोड़े वो तेरा ही घर है,
तेरी चीखों में तेरे ही बच्चों का स्वर है,
तेरा कुछ ना होगा जो भूला तू राहें,
जिन हाथों को तोड़े वो तेरी हैं बाहें,
हे इश्वर ओ अल्लाह अब इनको समझ दो।
अभय दो अभय दो अभय दो अभय दो।

Monday, November 01, 2010

I disagree with Nitish Kumar though I like him

Rahul Gandhi is a force to reckon with. Most non-congress state governments do not like him. So much so that they pass personal comments against him. No denying people do like him. Where ever he is going he is connecting with people and this is what worrying the state governments who may not be in immediate danger but as the grass-root shifts will be in dire need of survivability. That said I like Nitish Kumar. I am not from Bihar but have always been awestruck with its potential and sad for its painful state and hateful attitude of some parts of India towards its people. I also disagree with when Nitish Kumar asked Rahul Gandhi that he should become a CM first before targeting the PM post. Was this what Nitish Kumar had in mind? If so I warn him. India's history is very clear. Prime Ministers who had been CMs have miserable track record more so plain forgetful. All successful Prime Ministers were never been Chief Ministers of a state.

Friday, October 29, 2010

Yes we can! But,

I argued with my wife, stopped all noises in the room and delayed my dinner just to watch Obama's appearance in Jon Stewart show. At the end I was disappointed. I was disappointed not because I found him a bad President or what he did in last 18 months were any less than what was being done in entire presidential terms but because I saw a Man's hope who galvanized the entire world wavering. He just doesn't seem to be confident anymore. A person who just two years ago would have said - "Yes we can, absolutely! And we have to work for it and the goals we want to achieve would come and it is going to take some time as we are on the right track.." started his explanation with a "But!". Nope this was not Obama this country elected.

Sunday, October 24, 2010

Arundhati Roy is not just Ignorant she is an Idiot!

Booker got one thing wrong - Arundhati Roy. She has been (or wants to be) in limelight for all wrong reasons. Her brush with stupidity started with her comments in support of Maoists and now her blabbering on Kashmir. People like hers should go learn and study history before trying to become a champion of subjects they talk about. Kashmir has always been an integral part of India or the ex-Greater Indian that includes the Indian subcontinent culturally and administratively. Kashmir historically has been a center of Sanskrut scholars and study. "History of Kashmir" was written in the 12th century by Kalhan. According to Mahabharath, Kambojhs ruled Kashmir. The place Peer-Panjal which is very much Kashmir comes from the word Panchaal (you know who Paanchaali was, don't you?). It has been under Mughal, Sikhs and Hindu rulers. What India she talks about? Here is some history -

  • Emperor Ashok founded ShriNagari (Today's Srinagar)
  • Akbar reclaimed Kashmir in 1588
  • Ranjit Deo (1780's)
  • Gulab Singh (1846-1857)
  • Ranbir Singh (1857-1885)
  • Partab Singh (1885-1925)
  • Hari Singh (1925-1949)
Republic of India historically has always been a federation of independent states very similar to today's Afghanistan. Communities fiercely independent and regional but all recognizing the border integrity of the country. If she dares why can't she go and ask Pashtuns if Nothern regions were not Afghanistan. May be she should have been on the east Bengal when the country was divided by the British. We will still be glad to swap her with Taslima Nasreen.

Wednesday, October 13, 2010

इक और शेर

जब मिलने में हो मज़ा, तब क्या फर्क मैं था कहाँ?
जैसे ही आवाज़ आयी, रुक तो गया मैं था जहाँ।

इक छोटा सा शेर

कुछ वो पन्ने उड़ रहे थे,
कुछ कहानी खो रही थीं।
ग़र कलम मिलता न मुझको,
मेरी यादें सो रही थीं।

Sunday, October 10, 2010

Five professionals you should never trust completely

No I do not mean to offend anyone and you will find some real good folks out there but you need to be cautious when you work with these professionals because you for them is just someone to make money off of, and personally I have had trouble with.

  • Realtors - They are not there to help you really. They are there to make money off of you and as soon as they could. They would not or not allowed to discuss future projections and will never tell you why you should not buy one house. They will take you to the closing instead of telling next year market would be full of foreclosures.
  • Car Salesman - Very few car sales men will be truthful. There payments are mostly off of you too. You buy and they make money. They will sell you anything. They are not your friends. Always check with a few and then make your decision. Check with kbb.com and edmnds.com before going to a dealer.
  • Independent Contractors - Be it plumbing issues or carpet installer. Be specially alert when you get one from craigslist. The moment they get a feeling you barely know anything about it they will drain your wallet. Check with Home Depot, Lowes and/or Ace hardware before talking to one.
  • Brokerage - If you could then do it yourself. Don't let them sell you some class of funds and stocks you don't understand. Typically each brokerage firm has preferred list and they will do their best to get you in. Research before signing.
  • Cab Driver - Many roads lead to the same destination. Off-peak time and they will do the best to take the longest. So check with the gps phone you have before you board.

Friday, October 01, 2010

Why Indian muslims should not feel second class citizens

Even though with some delays, the High Court has given its verdict on India's most controversial and complex case that involved faith, known and unknown history, emotions and a serious prospect of religious tensions. At the end the verdict acknowledged an existence of a Temple underneath the mosque, its usage both by Hindus and Muslims as a place of worship and land ownership by three contesting party. I and many Indians are very pleased by the decision as it did not turn out be a verdict of victory or loss. The shear fact that there exist a Temple underneath the place of content should be enough to respect it. There should not be any need to go to Supreme court. Babar or any of his lieutenant were no Islamic saints they were barbarians who could not see freedom of religious practice as a core essence of the country they migrated to. No one has to prove where Ram was born. And Muslims in India are as Indians as any of its Hindus and they reserve the right to same freedom that everyone enjoys. Now all the parties should come together and work towards an amicable solution that gives dignity and safety to all the citizen and a salute to the judges who tried to solve a problem of 483 years.

Tuesday, September 28, 2010

What the heck is President Obama doing?

Yes wth? Why is he not doing the following:

  1. Starting war with Iran when its President blamed US for 9/11?
  2. Boosting star wars budget instead of working to train more Maths and Science high school teachers?
  3. Wasting time on health care bill so that every one in America has dignity in life. Which sane country spends billions to keep their poor healthy?
  4. Not coming on TV everyday to boost our morale instead of boosting the economy?
  5. Stopping religious equality and protecting their rights?
  6. Worrying about Kim Jong Il's son instead of American's?
Be scandalous not scandal-less. Obama, you still have some time - Yes you can!

Thursday, September 23, 2010

Returning empty collection or a null?

Should a null value for an expected collection be preferred or an empty Collection object? Lets see through a program:


import java.util.Collection;
import java.util.Vector;

import static java.lang.System.out;

public class E {

public void isNull (Collection col) {
long t = System.nanoTime();
if (col == null) {
}
out.println ("Time to check null: " + (System.nanoTime () - t));
}

public void isEmpty (Collection col) {
long t = System.nanoTime ();
if (col.isEmpty ()) {
}
out.println ("Time to check empty: " + (System.nanoTime () - t));
}

public static void main (String args []) {
E e = new E ();
e.isNull ((Collection) null);
e.isEmpty (new Vector ());
}

}
Running this on my laptop with Java 6 produced:
Time to check null:  45234
Time to check empty: 10750

Something to think about..

Lets see how sane Indian Muslims and Hindus are!

September 24th 2010 an Indian court will give its verdict in once seemed never ending case - Ayodhya. Both Hindus and Muslims are wary of violence and Government seems taking it very seriously or may just be creating hysteria. This may not be a final verdict and it can still be stretched to another lifetime but it has a potential of igniting another riot. What needed to be seen is how sane has young Hindus and Muslims of India have become since the last riots that claimed thousands of life in early 90's.

Here are some historic sequence:

  • Year 1528 - First Sunni Muslim king of India, Babar or his lieutenant Mir Baki razed a Hindu Ram temple and built a Mosque over the land, probably to celebrate the arrival of Islam in India or to thump their authority. So did they do at Krishna Temple in Mathura and Shiv temple in Somnath - three most revered deities of Hindus.
  • Next few centuries on and off attempts were made by Hindus to reclaim the land but all such attempts were crushed heavy handedly.
  • By 1857, the year of India's first war of Independence or a mutiny against the British rulers, Hindus and Muslims prayed together in proximity - Muslims inside the Mosque and Hindus just in its periphery. 1857 was also the year Hindus and Muslims were closest and hand-in-hand fighting a "foreign" aggressor together.
  • After the failed attempt of 1857 to claim Independence from the British, the differences between Hindus and Muslims grew wider and in 1947 India was split in two nations in the name of religion and Pakistan was born.
  • In 1949 Hindus tried to reclaim the land and Idols of Lord Rama and Maa Sita were installed inside.
  • Then came a series of law suits till mid-1960's with none ever resolved.
  • 1992 turned out to be a black year in Indian history when the amity between the two communities was broken when some Hindu mob tore town the 350 year old tomb. By then the place was in central governments control and only Hindu priests were allowed to perform limited Puja. 100s and thousands of lives were lost after ensuing riots and retaliations with clear "foreign hands" being exposed in exploiting the situation.
  • After realizing the futility of hatred and pending court case, Indians moved on. Political parties at front of enticing communal riots lost over next years.
  • Hindus and Muslims of Ayodhya never got involved in riots and continued to live together with their daily chores. Muslims continued to be involved in small scale industry that makes offerings for deities and Hindus never threatened them in this temple town.
What now?
  • Pakistan and now increasingly Chinese intelligence agencies are continually looking for opportunities to exploit any communal situations and destabilize the country.
  • Kashmir valley is boiling again this time rather more seriously.
  • We know how much peace is important to India.
  • Neither Hinduism nor Islam teaches violence and killing innocents.
Its time to prove that Indians are sane citizens and no one can ignite violence between us no matter what the verdict would be. Its time to leave past behind and build our shared future on mutual respect and dignity together.

Thursday, September 02, 2010

वाह रे गाड़ियाँ

सिलेंडर चार से छह कर दिया फिर आठ से बारह,
घटा न तेल कन्जम्पशन, मैं इस गैलन से अब हारा।
बुरा क्या था जो हांके बैल थे मेरे पुरखे?
थोड़ा रफ़्तार के बदले, खाए तो थे बस चारा।

Wednesday, September 01, 2010

फिर से एक शेर

जो राहें छोड़ आगे चल दिए वो याद आते हैं,
वो यादों के परिंदे फिर से वापस लौट आते हैं।
वो धूप जो आक़र आँख को कस के जलाती थी,
थपेड़े ठण्ड के सह के अब हमें फिर से बुलाते हैं।
हवा भी रूह को मेरे बर रोज तार-तार करती है,
जो मरहम नींद के थे अब हमे रातों सताते हैं।

Sunday, August 22, 2010

Software development process - which one to use?

If you came to this blog in hope you will find a concrete answer then before you get disappointed let me tell you - I don't know. I don't know like many other including those who do claim they know. Software development process is like a system of political governance one system is not made for everyone. Before choosing one, do not read why one fails but why one succeeds. If water flow process was that bad it would have never been used. Democracy is popular not because it is the best system and everyone who follow are always happy. It is popular because it gives you the best safety net when things start to go wrong. Software development is on the same line. If you get hold of five best believe me you would succeed in any process. If you have an idea and the only one developing it full time, no process is the best process. The process becomes critical when you have varying class of members. Some strong in certain areas and others in some other. How efficient is your business owners? Do they just come to office to flash their shiny cars or they really spend time with your team to delegate the real requirements? Do you produce documents because you think they are ought to be produced or you do think they are good source of concrete referential descriptions. Have you thought if just a blog or wiki could replace your documents in a file? If Agility does work for you then use it. If morning 15min standup meetings with a white board full of yellow stickies sounds ridiculous then you don't have to. If pairing up accelerates the deliverable then yes do it. If one room with a big table makes your team more productive then invest in that instead. It really is what works for you. Don't let articles, blogs, books drive you. Think what you really worked in the past and how that can be modified to adapt to new challenges. Process names are just to publish books read them as a novel not necessarily to become a character of it.

Why iRobot is the worst vacuum to own?

I don't think I am a gadget freak but systems that are "self-sustained" do attract my attention. My purchase of iRobot Roomba about four years ago was one such attraction. I had many choices then as I have now when it comes to cleaning your floors, but ease of use always tops my list for what I do and what I own. In just a couple of years I realized something got broke and after rigorous analysis I found it was the in built battery charger that was unable to charge the batteries. I found Roombas being sold in Costco and in Target and neither of these giant stores carried any accessories. What a bummer! This was the first time I was pissed. Anyhow, I looked up on the web and bought one battery and one external charger from Amazon. Amazon continues to amaze me what I can buy there but thats for sometime later. Roomba was back in business. By this time I already had three other working/partially working vacuum cleaners and out of the four I had I was very impressed by the cleaning power of that small Shark. Ease of use remained at the top of my list and I continued to roombatize my floors. I moved and after stuffing part of my basement with my stash I moved to another place and took just my Roomba with me. I could have taken Shark too but I left it there.
With in just a few months my iRobot turns it battery lights red even after the battery is just fully charged. At this time I do not know whats wrong. But still took a round to Costco and Target in hope that at least now I should get its accessories. Instead of buying a new vacuum cleaner I was still inclined to get a new battery. When I love someone my faith sticks there. Nope! Even after these many years while Target continues to keep one or two Roombas around they still do not sell any of its accessories. This time I was really pissed. I saw a good deal on a Dirt Devil and saw its bag completely full with dirt just after cleaning half of my apartment and this being just a fraction of the price I paid for Roomba four years ago. Roomba disappointed me. If you are selling something this pricey you need to make sure that its operating cost is kept to minimum. Its anybody guess why bag-less cleaners are so much popular today compared to bagged ones - it is about TCO. After paying $300 for Roomba I expected it to run for a very looong time by continuing to charge its batteries. And at least expect to get its so critical accessories to be available freely from big stores. I will continue to tell that I owned an intelligent vacuum cleaner but when it comes to cleaning your home I don't think I am going to recommend it to anyone. Its just one very bad toy to own.

Friday, August 13, 2010

Kashmir is in pain - Government's apathy or incompetence

"Stone pelting mob fired upon by security forces" - A problem many nations are facing today and no one seems to understand that bullets cannot be an answer. Security forces can do very little but to fire but it only shows the incompetence of the state as well as federal governments that they seem clueless of finding ways to control the situation. Chidambaram may have been a good finance minister but is an incompetent home minister. He seems to have no answer to Naxal issues and seems again clueless on Kashmir. Not every time foreign forces can be blamed in fomenting trouble in the state. If you want Kashmiris from valley to be Indian citizens then treat them like that. There will always be foreign elements taking advantage and fueling unrest but its the responsibility of the state and what the federal government cannot shy off of, to bring people in the mainstream. If grievances and stones are met by bullets even in the Hindi heartland it will only fuel more unrest so more protests in Kashmir is not something unexpected. Its not Security forces but the incompetence of Obdallahs and this Congress government which is alienating Kashmiris from valley even further. Blood of an Indian - Kashmiri or any other cannot be this cheap. If current governments see no value in it then they have to go. Period.

Tuesday, August 10, 2010

A story..

The story goes.. there was this true wizard. Poor, unaware but with an astute brain. He had this ability to guess things with his strong intuitions. The King invited him to see if he was a cheat. Without anyone seeing him, the King slipped a diamond ring in his fist and asked the wizard if he could guess what it was? Wizard thought about it for a bit and said it is something circular. Then he thought more and said it has a hole inside it, you have a stone that is elevated on one side. Then he thought more and then - "Its a Grinder" - the wizard said. Everyone laughed and made fun of him. How could a stone grinder could be inside a fist? Wizard was a cheat and stupid everyone said.
Being poor, Wizard had never seen any Jewellery, far from a diamond ring. What he had seen was a hand-driven stone grinder also called a Chakki. What he lacked was awareness and a sensibility to relate even if true how could a grinder fit in a small fist. What he was right about was how he saw the problem and how close he was to solve it that people who laughed would never have guessed either.

Thursday, July 08, 2010

Mounting Windows FS in Ubuntu

Because I am in serious process of fully Ubunticizing myself here is a neat trick to mount a Windows Filesystem onto a Ubuntu directory? Follow the following:

  1. sudo fdisk -l (find which FS it is for Windows? On my laptop it was sda1)
  2. sudo mkdir /XP (Create a directory to mount the FS to)
  3. ls -l /dev/disk/by-uuid (Copy the UUID of the Windows FS)
  4. sudo nano /etc/fstab (Start editing the file)
  5. Add UUID= /XP defaults 0 0
  6. Save the file and run sudo mount -a
  7. Give the right permission: sudo chown -R user:group /XP

बहुत दिनों बाद एक शेर

तस्वीर मेरी देख कर जो सब कुछ समझ गए,
फिर क्या ज़रुरत मैं तुमसे कहीं मिलूँ?
गर मूक कागजों में ही मैं रह सकूँ हर वक़्त,
कसम मुझे है जो दर्द मैं अपना तुझे कहूँ।

Wednesday, June 23, 2010

AT&T covers 97% of Americans - How?

Lets try to calculate how AT&T covers 97% of all Americans?

  • Subtract all legal and illegal immigrants - They are not Americans
  • Take a good percent of Bay Area and Places in Connecticut and NY out where the service sucks.
  • Buildings where Americans work and can't make a phone call because of lack of signal. They work 1/4th of the day in these buildings so take 25% of all Americans in these buildings out.
So at any given time I think AT&T may only be covering 50-60% of all Americans instead of 97% as claimed.

Do not touch IIT selection process

For the record I am not an IITian. I wanted to be - a lot but could not be one, neither in Grad or Post Grad. And I do not think folks from the IITs are the only ones smart enough to work on the most complex Engineering problems. A recent panel has proposed to give 70% weightage to 12th grade marks - but I overwhelmingly oppose it. Why?

  • There are many students who do not score well in the 12th grade but crack IITs
  • There is no common standard for all the 12th grades. ISC is different from CBSC which is different from the state boards.
  • Do not melt down the brand. IIT is meant to cater only the finest of the brains and is not an institute to produce just Engineers. There will always be plenty of good students who would be successful if they study in IIT but then there are plenty of RECs and State run Engineering Colleges that are not so far behind in their standards.
  • IITs do not have resources to handle a huge stream of students and a College in every other city and still keep the same standards it is known for.

Friday, May 28, 2010

Mr. Chidambaram - Indian life cannot be this cheap

When a country like India should be working day and night with all its resources in eradicating diseases and spending in Infrastructures that provide safety to life, life of an Indian is getting less and less secure by shear in-action of the current Government. We cannot accept insecurity as part of our daily life as we have accepted corruption in our system. Today anti social organizations like Maoists can blow up tracks and cause massive loss of life and your Government continues to sit idle with no replies to increasing boldness and challenges to our Nation's integrity and the safety of its citizens. And what do we see? Leaders of UPA give statements that "Maoists only kill people who spy on them". Did you dare to ask these Naxal elements in your UPA how many spied who lost their life in yesterday's train sabotage? And why don't you have guts to put these elements in Jail who directly or indirectly support these anti-national elements? Indians today demand your report card on what have you and your Government done to make us more secure? Why an non-combatant's life so insecure? Why terrorists and criminals are allowed to get away so easily? Why has this government become a government of spineless representatives? Don't forget we have always found the alternatives. If you don't believe us ask those who once said we were shining.

Sunday, May 23, 2010

Another hot summer in India

This summer it was hot again. I mean real hot which now has become somewhat expected. What have not been expected were plenty:

  • Cathay Pacific - One of the worst airlines I have ever boarded. After 15 hours of tiring flight to HongKong the connecting flight to Delhi was delayed because they scheduled a bigger aircraft for Delhi which was supposed to go back to Oakland. WTF! Didn't they know that before hand? It was my first experience to see a Chinese service and they scored zero. And the result was painfully missing my connecting flight at Delhi to my home town that I missed by a few minutes that resulted in a 7hr wait at New Delhi Airport.
  • Indian Railways - Another bad bad bad experience. Mamta Banarjee sucks as the new Indian Railway Minister. Even though not spectacular but her predecessor Lalu's work was visible on the platform. I was getting used to clean platforms, clean and hygienic toilets, near on-time train departures and arrivals. With Mamta Banarjee the Railways is faltering. This lady is such a disaster that she blamed the "crowd" after a fatal chaos instead of accepting any responsibility for crowd management. We had to wait for 7 hours at the dirty waiting (AC) rooms, smelly toilets and absent attendants.
  • Internet - I assumed by now Internet would be flourishing all over India. No. There were no free Internet at Delhi Airport which I was amazed to find out missing at this improved airport. Internet connection at home was flaky too.

Saturday, May 08, 2010

Solving Immigration Problem

Its frustrating to see naturalized citizens engaged in act of terror against the same country that provides them livelihood and a quality of life. And then there seems an unending queue of legal, clean, and tax paying residents who are stuck in a never ending residency queue. So as we can't seem to fix the immigration problem, lets come up with some creative ways:

  • Any naturalized foreign national found in illegal activities should lose his/her residency and his/her's green-card should be returned to a pool where a lottery should give it to someone in that residency queue.
  • Any resident who has lived legally in the States for over 10 years should have a separate category. "No EB2 or EB3.. Just "legal residents over 10 years" pool. And they should participate in the lottery system.
  • Only one of the Wife or Husband should have a pending residency application. A lot of clutter can be cleaned of redundant applications.
  • Grade system should increase or decrease the country based quota. If one national of a country is found to abet, support or engaged in terrorism or any other anti-national criminal activity then the country he/she belongs to should have lower quota and that seat should be given to other nations. Let Communities themselves clean those black spots.
I am running out of ideas.. But please listen someone.. This country cannot afford criminal residents.

Thursday, May 06, 2010

Ask the problem first

There is something called "A Problem Statement". No this is not a 20 page business requirement document. Its a single (at most two) line statement that describes what a customer is trying to solve. Believe me the ones who can not give it, don't know what they are doing. With repetitive refinements these are some typical problems you get:

  • To speed up our company's web-site's responses.
  • To stop our application getting bogged down under heavy load.
  • To exercise stocks under xx Milli-seconds.
  • To bring the application back up with x% of data loss with in 't' minutes.
If you look at it a problem statement did not include any implementation details or even functionality details. They were all business problems.

Why a Problem Statement is important?

Nah.. I am not a qualified MBA but I will tell you a story. A business analyst comes to Engineering and asks for a Cassette player for a Car so that the customer can play his songs. Engineering builds it and the player gets integrated in the car. Analyst is happy. Customer is happy and the Analyst moves on (gets a promotion). But was he/she right? No. Because the Customer never asked him to get him a Cassette player. What he really meant was "I need a way to play my favorite music while I drive". So what happens? Cassette players gets outdated and we build CD players. In a few years we build MP3 players and so on. And if not cautious you could end up driving a car with a Cassette player, a CD player and a MP3 player. Believe me its a bad car.

So whats wrong?
The baggage is wrong. Engineering ends up supporting features that has no revenue potential. The better solution is you gave the Customer a Cassette Player in '80s because that was what technologically possible then. In '90s your car only offers a CD player and so on. And in turn you assist a parallel industry or professional services who provide you gadgets to convert your Cassettes to MP3s. The continuous refactoring of your product is as important as providing solutions to the problems. So never lose the Problem Statement. Its not the cassette but the music what Customers are really paying for.

Tuesday, May 04, 2010

How to do Grid Computing right?

Nah.. There are plenty of forums and consultants who would talk and guide you on complex challenges with Grid Computing. Following are seven simple premise to do Grid computing right. No this is not off of a book or a result of any theoretical analysis but my field experience with numerous clients over the last three years of Coherence consulting on high volume systems.

  1. Process where data are - Its a proven fact that processing data where they are is much more efficient than bringing it over the wire and then processing it - A concept popularized by PL/SQL.
  2. Storage Disabled - This challenge I have seen often with products that have embedded Coherence. Application objects competing for the same heap that Coherence uses to manage data. Remember Garbage Collection in Java still remains an unresolved necessity. GC can not be avoided but its affect can be minimized. Make a rule of thumb - Make your application storage disabled member of the Grid if you really want a stable Grid with predictable performance. Application layer can be scaled out independently of storage nodes. Application can go under long GC and the load-balancer can choose another application instance while the Data Grid remains responsive and stable. An effective way of building a high responsive system.
  3. Key Association - In any serious application we always talk about associated data. Person associated with an Address. If computing demands Person and Address to be processed together then keep them together and use Coherence Key Association or partition affinity. Partition affinity can have some major performance impact.
  4. Domain Model - Typically not talked about much. You don't have to put every object of your application in Coherence just because you have them. Put only those objects in Cache that are needed for computation. A stock is associated with an Account which is associated with an address. Why to keep Address in the Cache if it has no bearing on stock's buy or sell? Selective association also trims the composite object size and helps in effective partition affinity.
  5. Thread Count - Make sure you use the Machine to its fullest. Don't just go by some rule of threads and cores ratio. Run the application in real-life-like environment and see which number makes sense? Appropriate thread count with Invocation Service can have real impact.
  6. Backing Map Listeners - If done right BMLs can make the application layer very light weight. BML using Executor service to do asynchronous processing is a proven architecture but take it with salt and see if that makes sense for your application. But when it comes to raw end-to-end computing performance take a stab at it.
  7. Custom Backing Map - By default in distributed scheme, Objects are stored in Binary format. This is the most efficient and effective format to manage partitioned data but it doesn't have to be. If your application requires to minimize deserialization cost during an expensive computation then you can change the Object format to what ever you like it to be or keep them unchanged by writing a custom Backing Map. Work with someone who has done this before because Backing Map should be the most efficient piece of the solution.
I haven't seen a single application that has violated any of these seven rules and have not have had any problems, yet. So Enjoy!

Thursday, April 29, 2010

Bay Area SIG - 29-Apr-2010

So this was my second Coherence SIG (the first was in New York almost three years ago). This time it was all about monitoring monitoring monitoring. It was nice to meet familiar faces. Few who recognized me right away, including Jon, Peter, and with a slight hick up Desmond and Raanan. Rao from Oracle EM remembered me from my blog photo (I think I still look the same). Ones who did not, included Craig. A few I knew I have met before or worked with was good to see in the Coherence crowd. It was a good presentation from Randy Stafford and his tips were:

  • Monitor everything - CPU, Network, Heap and Application.
  • Different tools for different things - Jamon, sar/ksar, JMX
  • Re-architect if you have to.
  • No comprehensive patterns available for Grid Computing so keep yourself up-to-date
  • Mission Control rocks - May be single biggest reason to use JRockit
Tom from SL.com's presentation was informative and stressed the importance of Monitoring and why it is not an optional piece of the solution. I had introduced them to one of the clients I worked with and was to good to see that they were in their customers list as shown in his slide. It was good to see Tom recognizing features of Oracle EM not offered by RTView. Rao must feel happy. At the end Taylor from Grid Dynamics talked about the proven design patterns also implemented by Oracle Consulting at numerous engagements and was good to see common solutions to common problems by two professional services. Overall was a good night out.

Wednesday, April 28, 2010

Chinese gymnast stripped of Olympics Medal

Now Chinese Government is launching its own investigation - How did she escape the Nike sweat shop?

What is BJP doing wrong?

Its heart breaking to see as a keen self proclaimed political analyst how day by day a national party is dying under its own weight. The recent slap being from Shibu Soren's JMM. So what is this once beloved political front doing wrong?

  • Lack of leadership
  • Coalition of opportunists
  • Inability to prove why Congress is bad for the nation
  • Losing its key constituents to regional parties
  • Becoming agenda-less secular front
So how could they ever come back?
  • Find leaders with mass appeal - The ones who represent not necessarily smart
  • Delhi - You win Delhi, you win India
  • We all know corruption exists. Prove why it hurts?
  • Become secular when you are in power, not when you are out.
  • Grass root Grass root Grass root

Sunday, April 18, 2010

A song by Gumbu and Shumbu


*Animation not self created - downloaded from google

Wednesday, April 14, 2010

A Song by Aliens


* Animations not self created - downloaded from google

Monday, April 05, 2010

Five Pakistanis I wish were Indians

These are Five Pakistani celebrities who I respect a lot and would have love to have as Indians:

  • Wasim Bhai Akram- He has been more pain in the neck for India than even a well trained Pak SoG soldier. A guy to salute, what an awesome bowler he has been.
  • Ustad Nusrat Fateh Ali Khan - A real maestro. His songs has united more Indians and Pakistanis than a series of CBM meets.
  • Shoaib Akhtar - For some reason Bollywood and hence the rest of India loves to see a flamboyant and a little arrogant talent. What if his name sounds "show aib", so be it.
  • Shoaib Malik - A guy who took away the heart of someone who the entire India loves. He must be someone.
  • Ghulam Ali - He had put Ghazals back on the table in Hindi Cinema. We had more of his cassettes than any Hindi movie's. Don't hear him much these days though.

Sunday, April 04, 2010

iPhone again - This time it removed an important email

For some reasons Apple iPhone keeps doing something or the other that does not let me settle down and love it. This time it deleted an important email - Just out of the blue. I was reading a yahoo email and accidentally it moved it to one of the other folders from Inbox. After searching a bit I found the email. I opened it and clicked the move icon and moved the email back to Inbox. Nope. Instead of moving back to Inbox it removed it. I spent hours to search on iPhone and email's web interface to find where that email was but could not trace it. No where to find. Thanks iPhone! With all your fancy bells and whistles you are proving to be a junk phone that I have ever bought - at least for me.

Tuesday, March 30, 2010

Miscellaneous news and my take

  • US Health Care bill passed - Republicans, too much tea is not good for health.
  • Sania marrying Shoaib - Sad part is India could not produce a single Muslim hunk. Zaheer, Irfan, Yusuf et al, stop going around Bollywood actresses.
  • Ricky Martin is gay - Thanks Adam Lambert for being his inspiration.

Nerd vs Geek vs Dork

Thanks to www.greatwhiteshark.com and a re-tweet from Cameron Purdy here is the difference between Nerd, Geek and a Dork:

Sunday, March 28, 2010

Why blame Karzai?

In 1857 India rose against the British Empire which now is called its first war of Independence - Or at least most of India. After a few early successes the rebellion was crushed and the British were able to do so by keeping a corrupt few together and using them effectively. In the process they structured a new land they could effectively hold and what India became as a nation in 1947 when it eventually got its Freedom. No one knows how this nation could have churned out had the states that revolted against the then East India Company succeeded. But British did so in 1857 not because the Indians were happy under their rule or if they had an overwhelming power, but because they had corrupt friends in some princely states that had power to control. British also had a long term vision for this outpost of its Empire - A united India under one rule of law irrespective of how biased, undemocratic and in-humane that law was.
Afghanistan as it stands today has some roots in how India was a few centuries ago. Independent tribes under one Nation with local laws, customs and rules with no or little centralized control. Corruption in this phase of a nation's evolution could be a good tool if tied with a long term vision for the country. Hamid Karzai, the president of Afghanistan has been blamed for corruption in his government. Appointments not based on merit, a blind eye to Poppy cultivation and under hand deals with local tribal leaders. But if it is effective for not letting them defect to Taliban then what is wrong in it? In a state of chaos choosing a lesser evil sometimes is a path the process of evolution takes. I am in no way proposing a corrupt civil administration in Afghanistan or if he should not be under pressure to tackle it but Karzai still needs the support of the Free world because he has become a pillar for a stable country.

Saturday, March 20, 2010

Thursday, March 18, 2010

Coherence with Spring on OSGi - Oh My!

OSGi has gotten some real traction as an Enterprise services platform. For one of the projects I was involved in a viability study for Coherence with Spring on OSGi recently. Even though not all can be divulged here but we overcame some interesting challenges that are worth to blog about.

Why OSGi? Why Spring? and Why Coherence (Is that a question)?

  • OSGi - It has championed the modularity.
  • Spring - Dependency Injection probably is still its biggest strengths.
  • Coherence - Solves World Peace with simplicity, elegance and Powerful APIs.
Challenges:
  1. OSGi - It needs patience. Lots of it specially if you are just starting with it. You do not need to change the application code to be OSGi compliant. It requires a specific MANIFEST.MF that describes the bundle's attributes and packages it exports and imports with other bundle dependencies. Make sure you have BND handy. I would not recommend you writing the Manifest file your own. Let BND do it for you. Equinox and Knopflerfish are two very popular platforms. I used Equinox.
  2. Spring - Do not work with vanilla Spring APIs. You would need Spring Dynamic Modules that are Spring for OSGi. Also download Springsource Tool Suit. You would need some jars from it's STS to be installed. Also make sure you deploy the 3.0.0 version of the libraries. It will solve a lot of pain you would rather end up going through.
  3. Coherence - Coherence does not have an OSGi bundle off the shelf so you would need to create one. Creating an OSGi bundle for Coherence is fairly easy by using Eclipse IDE. File->New->Project->Plug-in from Existing jar Archives->Select coherence.jar and follow the rest of the instructions. Export the artifact. That's it. Watch out for serialization issues if multiple modules are involved.
Spring DMs:
Install the following modules in the same order (use appropriate start levels):
  1. com.springsource.org.aopalliance
  2. com.springsource.org.apache.commons.logging
  3. org.springframework.aop (3.0.0.RELEASE)
  4. org.springframework.asm ( 3.0.0.RELEASE)
  5. org.springframework.beans (3.0.0.RELEASE)
  6. org.springframework.context (3.0.0.RELEASE)
  7. org.springframework.core (3.0.0.RELEASE)
  8. org.springframework.expression (3.0.0.RELEASE)
  9. org.springframework.osgi.core (1.2.1)
  10. org.springframework.osgi.extender (1.2.1)
  11. org.springframework.osgi.io (1.2.1)
  12. org.springframework.transaction (3.0.0.RELEASE)
  13. com.tangosol.coherence (Or whatever name is given for the Coherence bundle created)
Don't shy away by restarting the Equinox a few times - you may need it.

Lets build a service: Say we want to build a service that puts a String key and a String value in a given data source.

public interface IPut {
public void put (String ds, String key, String value);
}

For an ability to replace Coherence as a Datasource with another lets use a Template that can be injected by Spring later with Application remaining agnostic to the data source provider.

public interface ITemplate {
public void put(String ds, String key, String val);
}

Even though IPut and ITemplate are similar it doesn't have to be. IPut represents the exposed service and ITemplate is for persistence.

Implementations:

public class Putter implements IPut {
private ITemplate template;

public Putter(ITemplate template) {
this.template = template;
}

public void put (String ds, String key, String value) {
if (template != null) {
template.put(ds, key, value);
}
}
}

And,

public class CoherenceTemplate implements ITemplate {

public CoherenceTemplate() {
}

public void put (String cacheName, String key, String value) {
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
ClassLoader newLoader = com.tangosol.net.CacheFactory.class.getClassLoader();
Thread.currentThread().setContextClassLoader(newLoader);
NamedCache nCache = CacheFactory.getCache (cacheName);
nCache.put (key, value);
Thread.currentThread().setContextClassLoader(oldLoader);"

}

}


Make sure you do have appropriate coherence-cache-config.xml deployed.

Configurations:
Spring beans.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd>

<bean name="template" class="CoherenceTemplate" scope="prototype">
</bean>

<bean name="daoService" class="Putter">
<constructor-arg ref="template"/>
</bean>

</beans>


That's not it. We need another configuration to expose this service for OSGi:

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:service id="daoOSGiService" ref="daoService"
interface="IPut"></osgi:service>
</beans>


It's also important to place these two configurations under META-INF/spring directory.

What about the MANIFEST.MF?
Use bundlor to generate the MANIFEST.MF for you. You will have to copy the manifest back to the project and then re-bundle the final artifact jar.

Once you have it all together thats all you need to deploy this application on OSGi.

What about the Client now?
Client would be another OSGi bundle and the process of developing it is similar. As it is still all Spring driven make sure the services are appropriately injected.

First the OSGi configuration:

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:reference id="daoService" interface="IPut"/>
</beans>

Then for other beans:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="persister" class="MyClient"
init-method="start" destroy-method="stop">
<property name="putter" ref="daoService"/>
</bean>
</beans>


And the client is like any typical Spring client:

public class MyClient {
IPut putter;

public MyClient () {
}

public IPut getPutter() {
return putter;
}

public void setPutter(IPut putter) {
this.putter = putter;
}

public void start() throws Exception {
putter.put ("MyDataSource", "key", "Value");
}

public void stop() throws Exception {
System.out.println("Goodbye");
}
}


Don't forget to use the BND again to generate the manifest and re-bundling it with the client artifact jar.

Now deploy the client jar and start it.

Enjoy!

Monday, March 15, 2010

Development problems I hate to get into

Here are my pet peeves when it comes to Software development:

  1. Click New Project and select type 'X' in your Eclipse IDE
  2. Deploying unending Apache libraries
  3. Power-point driven Architectural directions without self-contained working prototypes.
  4. Helpless Component dependencies and NoClassDefFoundError
  5. Having to change standard J2SE modules to work in a specific platform.
  6. URLs in response to RFH that you have already been banging your head on.

Saturday, March 13, 2010

Chevy Malibu shares the Arjun Tank story

A little history - India in mid-70's realized a need of an indigenous MBT and embarked upon once seemed a never ending path. Today after three decades of ups and downs the development of Arjun has been completed as it now competes with world's other Main battle tanks. It will not be an exaggeration to say Arjun is one menacing beast but to no avail because its user has already taken a love route to Russian T-90s that India had purchased in mid 90's more so in panic. Today even though Arjun is a better tank its not going anywhere because folks it was built for have already made up their minds.
This story sounds so similar to what Chevy Malibu is today. I have rented so many cars in past many years and I can say for sure Malibu is one that has impressed me the most. But where does it stand against Toyota Camry and Honda Accord? Even with problems of Toyota if I have to buy one I would rather buy a Camry than a Malibu, renting could be another story. Its called a proven platform in the changing world. I will be ready to give Toyota a pass for its problems because I believe they are serious in delivering the same quality that it once was known for. With GM, no.

Friday, February 26, 2010

होली पर एक शेर

चलो होली के इस रुत में आज कुछ रंग हो जाए,
जो आशिक है छुपा बैठा, थोड़ा सा तंग हो जाए।
महक फूलों कि चादर मैं बना कैसे इसे ओढूँ?
हवा में खुशबुयें जो हैं, हमेशा संग हो जाए।

चलो फिर से शेर सुनो

अजीब वाक़या है ये ज़िन्दगी हर मोड़ मुड़ती है।
लगे तो ये कि आखिर मै चलाता हूँ इसे फिर भी,
ये अक्सर राह ही अपने आप मुड़ के यूँ निकलती है।
खुदा जाने कि राहें ये चुना मैंने, या उसने है चुना मुझको?
पर जब भी यूँ लगे कि हाथ में पतवार आयी हो,
झटक के वो सहारा ही मेरे हाथों फिसलती है।

Wednesday, February 17, 2010

A week with Six companies

This has been a week where directly or indirectly I interacted with six companies for the services I use. Here is my rating out of 10 with 10 being highest:

  • Costco - Went to buy a Sleep Science mattress. Costco only carries them with online orders. Ordered one online with tentative shipping day between 2-4 weeks. Seemed a lot. The next day I receive an email that the order has been fulfilled and Mattress has been shipped. Rating - 8
  • Sleep Science - A manufacturer of memory foam mattress. I have used NovaFoam toppers before but this 10" mattress is just awesome. Not as good as Tempurpedic but the cost difference vs quality is just too close. Rating - 9.5
  • UPS - Costco shipped the bed with UPS who gave me shipping time between Morning 8AM to Evening 7PM. Not something you can plan your day around. Because of this vague time slot I had to work from home all day. A shorter slot could have been much better. Mattress arrived around 3PM. Rating - 7
  • Comcast - A company slowly that is getting difficult to pass by these days. I had to transfer my services to this location. They were good to give me a time slot between 4-6PM. The technician arrived at 6:30 - so not good. Looked friendly but he found he needed an amplifier as signal was too low. He was not carrying an amplifier which I would think should be part of their installation package in case required. He plugged some basic cable with a promise to come tomorrow between 12-1PM to install the rest. Rating - 6
  • Apple - A company that boasts itself an epitome of perfection. I have an iPhone so this has become an ongoing thing. I had bought an iPhone compatible data cable because of repeated issues with one given by Apple. This cable worked with my iPhone for close to two months and I carry either this or Apple's when I travel. Last night I suddenly get a message that cable is not compatible and cannot be used. With USB being the only option to charge this phone, my iPhone discharged over the day. I wanted to give Apple a big zero for the premium they charge and pain I am having but giving a benefit of doubt over using a cable not from Apple. Rating - 1.5
  • Sprint - I have a Sprint data card that has been a key to my productivity because the nature of my job where I cannot expect a Cat5 around all the time. In December'09 Sprint offered me a complementary upgrade to their 3g/4g device. Soon I found it was not a complementary upgrade but a Test Bed of it's new technology. I am sitting at the heart of bay area and this device has trouble finding the signal. It connects and disconnects intermittently severely affecting my work. Spent close to 30mins with their technical support who could not fix it and asked me to go to a near by store. I feel cheated by Sprint. With no phone and this flaky internet has put me almost isolated. Rating - 0

Tuesday, February 02, 2010

इक कॉमेडी शेर

पुकारें सुन सुन के वो खुदा शायद थक गया होगा,
ईमेल है नहीं मेरा "अच्छा है" ये फिर भी सोचता होगा।
गर चीखें मेल से आतीं तो कैसे हेल्प करता मैं,
जो टाइम खोलने में लगता बेचारा मर गया होता।
मोबाइल ना बनाया मैं पर उंगलियाँ दी बहुत सी हैं,
रहम एसेमेस से जो जाता, तू क्या मस्जिदों में बिल भरता?

Sunday, January 31, 2010

Could someone please shutdown zillow.com


Attached snapshot says it all.. With illogical zestimates, this site is not only confusing buyers but also depriving sellers of the fair value. How could a condo in an area where prices have dropped and recently sold for $129K now is zestimated a hopping $300K? I am pretty sure the owner has not replaced its walls with golden bricks.

Friday, January 29, 2010

How to SIP a Coherence soup - Part(I)

A few times a requirement has passed our way to find if Oracle Coherence can be integrated with hand-held devices. Either to get a notification of an Entry or as a task submission unit. The short answer is No and the long answer is Yes. No - because Coherence requires at least a J2SE to be used natively. J2ME platform is not supported. Yes - because there is an architectural pattern called edging. Edging is a pattern of platform integration when a system does not support the protocol of another and we have to create an intermediary system that integrates these two protocols by understanding both. This intermediary system is "edged" or proxied in between. So lets cook this recipe.

Problem Statement: Integrating a cellphone with Coherence.

Ingredients
:

  1. A clean servlet container
  2. Coherence jar
  3. A SIP emulator and,
  4. An IDE as per your taste
For a spicy recipe we have used an Oracle WebLogic Application Server, JDeveloper and Sun's now called Oracle's Java ME Platform SDK.

How to Cook:
  • Download Weblogic Application Server from OTN and install it.
  • Install Java ME Platform SDK from http://java.sun.com, install it and start Java_Platform_ME_SDK under toolbar/bin.
  • While j2me SDK is warming up start JDeveloper and a simple Coherence cluster.
  • If this is the first time you are cooking keep coherence-cache-config pretty simple with a distributed cache "A". If you like a little hotter you can spice the cache configuration up as needed.
  • By now JDeveloper should be boiling. Create a new J2EE project and put the following servlet:

public class SipRequestInitiator extends HttpServlet {

private NamedCache nCache = CacheFactory.getCache("A");
public SipRequestInitiator() {
}
public void init(ServletConfig sc) throws ServletException {
super.init(sc);
}
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
int num = 10;
try {
num = Integer.parseInt(req.getParameter("num"));
} catch (NumberFormatException nExp) {
System.out.println("Wrong number, defaulting to 10");
}
Filter filter =
new LimitFilter(new LikeFilter(new KeyExtractor("toString"),
"news-%", '*', true), num);
Set news = nCache.keySet(filter);
StringBuilder sB = new StringBuilder();
Iterator iter = news.iterator();
while (iter.hasNext()) {
String k = (String)iter.next();
sB.append((nCache.get(k)).toString());
sB.append("\n");
}
res.setContentType("text/plain");
res.setContentLength(sB.toString().intern().length());
res.getWriter().println(sB.toString());
}
}
  • Deploy the servlet with a web.xml. WebLogic plate should be ready now.
  • Once J2ME is hot enough start a MIDP project and cook it with the following Midlet:

public class CohMIDlet extends MIDlet
implements CommandListener, SipServerConnectionListener {

private Display display;
private Form form;
private Command myMessages;
private Command exitCommand; // The exit command
private TextField number;

public CohMIDlet() {
display = Display.getDisplay(this);
form = new Form("Receive Message");
exitCommand = new Command("Exit", Command.EXIT, 0);
myMessages = new Command("Messages", Command.ITEM, 1);
number = new TextField ("No. Of Messages", "10", 3, TextField.LAYOUT_LEFT);
form.append (number);
form.addCommand(exitCommand);
form.addCommand(myMessages);
form.setCommandListener(this);
}

public void startApp() {
display.setCurrent(form);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
notifyDestroyed();
}

public void commandAction(Command c, Displayable s) {
if (c == myMessages) {
Thread t = new Thread() {
public void run() {
getMessages();
}
};
t.start();
}

if (c == exitCommand) {
destroyApp(true);
}
}

private void getMessages() {
int num = Integer.parseInt(number.getString());
HttpConnection hc = null;
InputStream in = null;
String url = "http://localhost:7001/sipinitiator?&num=" + num;
try {
hc = (HttpConnection) Connector.open(url);
in = hc.openInputStream();

int contentLength = (int) hc.getLength();
byte[] raw = new byte[contentLength];
int length = in.read(raw);

in.close();
hc.close();

// Show the response to the user.
String s = new String(raw, 0, length);
form.append(s);
} catch (IOException ioe) {
form.append(ioe.getMessage());
}
}

public void notifyRequest(SipConnectionNotifier arg0) {
}
}
  • put two entries in cache A with keys as "news-$i", where $i is the article number.
  • Choose a Cellphone type as per your choice. I like the good old style flip-phones. Run the emulator. It will deploy the application. Press the Menu button and select Messages. Do you see the following?

In this part we have prepared the soup and tasted it using a Midlet. In part(II) we will try to find how we can SIP it. Enjoy!

Tuesday, January 26, 2010

Customizing JMX Reporter

JMX Reporter is a Coherence utility that generates statistical logs about nodes, networks, memory, proxy and cache usage. If enabled (-Dtangosol.coherence.management.report.autostart=true) by default every minute it prints these statistical logs and every hour creates a new set of files. What if we need to customize it?

  1. Easiest is to unzip coherence.jar and extract reports directory. This is what we would customize by putting in the classpath before coherence.jar
  2. Edit report-group.xml to change the frequency and the location where these reports should be created.
  3. Configure the <report-list> to have a list of <report-config> for the reports we want to have. The report-config takes a location of where the configuration of a specific type is defined.
  4. Copy the report configurations in the directory as defined in the report-group.xml
Following is a sample of report-group.xml under reports/ directory that prints memory status and network health reports at a frequency of 10mins:
<report-group>
<frequency>10m<</frequency>
<output-directory>../StatisticalReports</output-directory>
<report-list>
<report-config>
<location>reports/report-memory-status.xml</location>
</report-config>
<report-config>
<location>reports/report-network-health.xml</location>
</report-config>
</report-list>
</report-group>
reports/report-memory-status.xml and reports/report-network-health.xml has a list of respective attributes to be reported. Each report-config sets the file-name and the delimiter typically set as {date}-<stat-name>.txt and {tab} respectively. The report generated are CSV files that can be opened in MS Excel or Openoffice and historically analyzed. What if at the end of the day you want to open in Excel and analyze it? Following is a simple shell script that concatenates the reports appropriately (by removing repeated headers) and names it aggregate-<report-type>.xls:
#!/bin/bash
p=0;
k=`ls *$1.txt 2>/dev/null | wc -l`
if [[ $k == 0 ]]
then echo "Valid types are: ";
echo -e "\tmemory-status";
echo -e "\tnetwork-health";
exit;
else
for i in `ls --sort time -r *$1.txt`
do
if [[ $p == 0 ]]
then
cat $i >> aggregate-$1.xls;
p=1;
else
sed '1d' $i | cat >> aggregate-$1.xls
fi
done
dos2unix aggregate-$1.xls
fi
Enjoy!

Thursday, January 14, 2010

Drive to Pikes Peak

Sunday, January 10, 2010

Monday, January 04, 2010

An Island from above