After a break

March 11, 2008 by sreedharan

Cricket and Star gazing has been keeping me a bit busy. Add to this my official work, which involved a lot of travelling. All these led to a self imposed break on blogging. Now that Iam back, I intend to keep writing more. There are a lot of things to write about. Hope I do justice in the days to come.

How to Track sessions in Mobile Phones while using Tomcat?

December 23, 2006 by sreedharan

These days mobile platform is being used for developing web applications. One of the important aspects of web applications is Session management. How can we maintain sessions in mobile phones?

Web sessions can be tracked either by cookies or Session ID’s. A web application can choose to use either of these methods. In mobile phones, for example, it is wise to use Session id. So how do we make a web application intelligent enough to maintain the session through either of these methods. The method suggested here is for the Tomcat.

The easiest way to do this is to encode all the URL’s using
response.encodeURL and response.encodeRedirectURL methods.

The first method encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.

The second method is useful when requests are forwarded from one page to other.

For robust session tracking, all URLs emitted by a servlet should be run through the relevant method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.

Price of Petroleum products – the real economics

December 8, 2006 by sreedharan

When the price of crude oil was above $70 a barrel there was a steep rise in the prices of petroleum products. None but the “left” complained. We all thought that it was a correct economic decision. But as this article suggests, we are definitely missing the grand picture. The argument is petroleum products are not as costly as they are made out to be. How?

Roughly 50% of the price of petrol and diesel is Central and State taxes. It is the greatest revenue earner for the states and center and no body wants to let go this easy money. It is an indirect tax and is sustained by the adminstered price mechanism followed by GOI for oil.

The second reason is even more convincing. The administered currency value of the Rupee is yet another reason. The government is pegging the Re lower to make the exports cheap. But this has long term detrimental impacts.

1. Imports become costly. Roughly 2/3 of the oil is imported and hence is costly when compared to other countries. Oil is an important ingredient for the growth of economy and the rise in prices stifles it and also gives rise to inflationary trends.

2. Pegging the currency lower gives rise to higher inflows resulting in the increase of our reserves. But this should be a temporary step not a permanent one. The currency should be allowed to come to its own value, otherwise these built up reserves will vanish in the same way they accrued. In fact the over emphasis on reserves itself is useless as it is kind of a soft loan to US earning an interest of just 2%.

Economists think that the actual value of a Rupee is 9 to a dollar. The article also says that it would take 10 years for this exchange rate to get stabilized if the government control on exchange rate is removed.

Is there any other repurcussions for the actions suggested by the author of the article? Assuming that full convertibility is right, when is the best time to do it, during a economic downturn or otherwise?

Any economic gurus out there please clarify?

Hindi songs for Programmers

December 8, 2006 by sreedharan

Old hindi songs have a charm. They have meanigful lyrics with good word play and also have a soothing lilting music. But never knew they can be adapted to our programming world.

A CTRL-C CTRL-V job from a blog. The song of my choice is “Modem”.

Quote:
Programming Songs1.Two Recursive functions calling each other
Mujhe kuchh kehna hein
Mujhe bhi kuchh kehna hein
Pehle tum, pehle tum

2. The debugger
! Jab koi baat bigad jaye
Jab koi mushkil pad jaye
Tum dena saath mera hamnawaz

3. COM programming in VC++
Roop tera mastana
Pyar mera deewana
Bhool kahin hum se na ho jaye

4. From VC++ to VB
Yeh haseen vaadiyan
Yeh khula asmaan
Aa gaye hum kahan

5. Untrackable bug –
aye ajnabi, tu bhi kabhi,
awaaz de kahin se

6. Unexpected bug (esp. during presentation to client)

Ye kya hua, Kaise hua, Kab hua, Kyon hua

7. And then to the client

Jab hua, Tab hua, O chhodo, ye na socho

8. Load Balancing
Saathi haath badhana
ek akela thak jayega
mil kar bojh uthana

9. Modem – talk on a busy connection
suno – kaho,
kaha – suna,
kuch huwa kya?
Abhee to nahin…
kuch bi nahin

10. Windows getting open sourced
Parde mein rahne do
parda na uthao
parda jo uth gaya to bhed khul jayeha
allah meri tauba, allah meri tauba

11. Local variable
Mein pal do pal ka shayar hoon,
pal! do pal meri kahani hai,
pal do pal meri hastihai…

12. Global variable
Main har ik pal ka shayar hoon
har ik pal meri kahani hai
har ik pal meri hasti hai …

13. Null pointers
Mera jeevan kora kagaz kora hi reh gaya.

14. Dangling pointers
Maut bhi aati nahi jaan bhi jati nahin.

15. GOTO
Ajeeb dastan hai yeh
Kahan shuru kahan khatam
Ye manzilen hain kaun si
Na woh samajh sake na hum

Advanced Care for your Windows PC

December 5, 2006 by sreedharan

How many times have you cursed your fate, when your windows PC, which incidentally is the most widely used desktop computer in the homes, behaves mysteriously and would not allow you to perform your task. How many times have you really liked to clean up your PC and did not do because of boredom or screwing up something. How often have you been frustrated by the myriad tools and utilities that you need to run to keep your beloved PC running fine.

Well I have my PC firewalled and protected with antivirus (AVG free version, thank you guys at Grisoft ). I also periodically keep my computer patched up with latest Windows updates. Inspite of that Iam still not sure that my computer has not been intruded.

Yesterday I came across this freeware from IObit called Advanced WindowsCare Personal.

Advanced WindowsCare v2 Personal is a comprehensive PC care utility that takes an one-click approach to help protect, repair and optimize your computer. It provides an all-in-one and super convenient solution for PC maintenance and protection

the site says. and most importantly it is a freeware. Decided to use it to find out the status of my PC as well as to maintain it in future.

It is approx a 4 MB download. Installation is just as simple as any other Windows executable. The first time you start it helpfully asks if you want a restore point created. I decided to create so that I do not encounter any nasty surprise.

Here are the screenshots of the first two screens and is self explanatory. The second picture shows what all this software will do in a click. Before you go full steam ahead, update the database.

Screen1

iobit2.JPG

I thought twice before hitting the Scan button. But there is nothing to fear. All this software does is to identify the problems in the scan and let you know. You can choose to repair the selected components. There is also a provision to select items within the available components. I forgot to add one more thing, it is really fast.

In case you have accidentally done a registry change that you donot want to happen, there is restore center link available which will undo the changes. But I fear that it can only restore one step backward.

So now onto some things that are not so great. I opted for the spyware protection and the software states that it has immunized me against some websites. Iam not sure what it means. As Iam able to visit the site that is immunized and shows me all the not so pleasant pictures. It would be nice if they specify clealry what they mean by immunization.

This  software is worth a try.

Indian Ocean Tsunami anniversary – Sensors, Warning, Rehabilitation – where are we

December 2, 2006 by sreedharan

We are approaching the second anniversary of the Great Indian Ocean Tsunami. Nearly a quarter-of-a-million people in 12 Indian Ocean countries died from the Dec. 26, 2004, tsunami cause by a 9.3 magnitude earthquake off the Indonesian island of Sumatra.

A lot was said about the Tsunami Warning setup and about Tsunami Sensors. A lot of money was pumped into the relief and rehabilitation of the Tsunami victims.

So where are we now. An Indian ocean Tsunami warning system is up and running. A network of 26 national tsunami information centres and 25 new seimological stations have been set up in Indian Ocean countries, capable of receiving and distributing tsunami advisories around the clock.

The first DART buoy is being deployed this weekend.

The DART device will link a water pressure detector 4.5 kilometers (3 miles) under the Indian Ocean seabed with a tethered buoy.

Located at a key point along the area’s main undersea fault line, the Sumatra Trench, the device will note any increased water pressure indicative of a tsunami as soon as an earthquake occurs. It will relay the data to the buoy, which is designed to transmit it by satellite to monitoring stations in more than two dozen Indian Ocean countries within five to seven minutes.

Former US President Bill Clinton on his second visit to India commended the rehabilitation efforts in the Cuddalore district of TamilNadu and proposed this model to emulated elsewhere, even for the rehabilitation of Katrina victims.

So looks like considerable progress has been made in all the three areas. But does this alone mean that we can avoid a repeat of the disaster. I feel that much more needs to be done on the ground rather than under the sea to prevent ourselves from another disaster.

That fateful day I had been on a walk along the shores of North Chennai. This part of the shore does not have wide beaches. A lot of fishing hamlets lie very close to the sea. The roads that lead to these hamlets are very narrow (3 feet at the maximum). Iam not sure how many people can be evacuated from these places at 2-3 hours notice which are typical response times for Tsunami’s in Bay of Bengal. The situation still remains very much the same.

Only way to do that is to stop bypassing environmental safeguards for narrow commercial interests. A Coastal regulation act was passed in 1991 calling for properties to be built more than 500 M away from the sea. All coastal states protested and managed to bring it down to 100 M. Finally Supreme Court intervened and made it 200 M. The effect of that was that more and more people started having properties close to the sea. Fishermen who used to occupy those places were pushed closer to the sea. Remember that most of the dead are children and women residing close to the sea. The magnitude of the calamity would have been lesser had we adhered to the originally proposed limits.

On the other hand, in Royapuram, in order to curb sea water erosion, artificial stone structures called Gyrones have been constructed. In fact from a bridge overlooking one of these Gyrones, one could see the raging sea far ahead lashing in while within the gyrone the sea was much more calm. It is also said that Pondicherry escaped much of the brunt because of stone structures in front of the main beach. Same is the case with Male also. Gyrones can be one more line of defence.

Mangroves form an effective barrier against such giant tidal waves. We have been systematically destorying mangroves along the east coast. We should try to improve the mangrove cover.

Prof. Hawking thinks human have to set up colonies outside our Solar System if mankind has to survive. He talks about disasters like Asteroid collision, Nuclear wipe out etc. But by systematic destruction of Nature’s own balances, we have been setting up ourselves for large scale human and property losses with disasters like Tsunami which are many orders of magnitude less than catastrophe that Prof. Hawking is talking about.

How much rest to overcome Jetlag

December 1, 2006 by sreedharan

Ever wondered how much rest should one take to overcome jetlag.

ICAO uses Buleys formula to calculate days of rest to overcome jetlag.

Number of days of rest = ((T/2)+(z-4)+Cd+Ca)/10

where T = hours in transit
z= number of timezones crossed (0 if less than 4)
Cd and Ca are departure and arrival coefficients calculated from the following table. Substitute Cd and Ca with the value given in the table below based on time you left the starting place and arrived at the destination. All times are local times.

Time of day         Cd         Ca
0800-1157             0          4
1200-1759             1           2
1800-2159             3           0
2200-0059            4           1
0100-0759             3          3

0 is good,

1and2 fair,

3 poor,

4 bad.

I will try to calculate the rest one needs to take when someone travels from India to Western USA based on the above formula.

Assume transit time is 26 hours and you left India at 23:30 hrs so Cd is 4 (poor) and assume that you arrive at US by 12:00 the Ca is 2 (fair). Since US is -8 behind UTC and India 5:30 ahead z = 13:30. Since the formula is in days I leave of the :30 mins and make z = 13.

Now the amount of rest you should take is = ((26/2)+(13-4)+4+2)/10 which is 2.8 days.

But what happens practically is that you usually start on Saturday night from India and land in USA Sunday afternoon and Monday morning in an all important meeting you are either dozing off or keeping yourself awake with liberal doses of Caffeine.

What ails customer technical support

November 27, 2006 by sreedharan

Here is a blog on why tech support sucks by Zac Garrett. He claims that lack of money and outsourcing are some of the reasons why tech support sucks.

Here is my take on this as well as CRM in general based on my experiences with the Customer help line of a bank and a broadband service provider.

I needed to order a cheque book. I knew only this and nothing else. Not the “TIN” or “IPIN” or anything. I called up the bank’s phonebanking and said to them that I knew just my customer id and nothing else. The friendly operator verified my credentials by asking few supplementary questions, placed an order for chequebook, bridged me to a “TIN” generator and helped to get a “TIN”. I felt so very happy after this transaction. Customer Relationship Nirvana.

I also had a chance to interact with customer helpline of the broadband service provider. This is a different ball game altogether. They too seem to have a CRM software in place. They identify the caller based on the phone number and also know about the detail of the equipment supplied and also have instructions for doing simple things. The operator at the frontend even bridges to the technical helpline in case of complex problems. But from here CRM breaks very badly. Here we were giving symptoms upon symptoms and that guy seemed to be in a different wavelength. He was asking us to navigate to Start>Programs etc trying to get the problem solved. It is wortwhile to say that as we kept on giving the symptoms the solution seemed to be getting more complex than simple.

Managing an IT services team, I can understand how difficult it is to troubleshoot problems remotely. The situation becomes complex because the solution to the problem is dependent on a lot of variables some of which would have been altered by the customer. And then we have varying types of customers from the dumb to a geek and it is very difficult to match the frequencies with the right person without knowing him intimately.

It was no surprise that the gentleman beside me during the call, who obviously was a non techie, got wild after the interaction with the technical person. His comment was that customer support was all about generating multiple fancy ticket numbers to a same problem and reconfirming the problem to the help desk multiple times if only to assure that we reported the problem correctly. The problem was solved after an onsite visit by the technical person, but not before a lot of goodwill was lost.

While Zac’s blog covers only the latter case, I deliberately brought in the Bank scenario to understand why customer support can be such a negative experience.

In general customer support works when processes are strictly defined and the variables are few. But once you have lot of variables customer support sucks.

Most importantly in tech support the success or failure depends on the person who handles the call. It is the person rather than the system that determines the customer support experience. More importantly he should be experienced enough to run through lot of use cases before the patience of the customer runs out. This comes only with experience.

But as Zac explains, there are not many experienced people in technical support. Just a few days before I had a chance to read this article which throws light on why it is the norm. The customer support technicians are our favourite whipping boys. No wonder they fly at the earliest available opportunity.

Quality comes with passion and dedication. Usually the customer support executives are on the fringes of the organization and are treated very lowly by their colleagues in their own organization. As the company grows bigger these people are relegated to even inferior positions or their jobs outsourced. So the bigger the company worser the customer support. As long as the company thinks that customer support is a cost center, the situation is not going to improve.

PS: Here is a supplementary to this post on how the recent developments in remote management technology can be an enabler in improving the customer support experience.

450 GB data on paper, Scams in India and Science

November 27, 2006 by sreedharan

For the last few days one story has been making headlines in Digg. It is about an Indian student who developed and demonstrated a technology to store 450 GB of data on a sheet of paper. First it was this news which was based on the original article here. Now the second digg news is based on a blog calling it a scam .

Both these stories have got lot of diggs and has generated a lot of discussion. You may follow the links above to make an independent judgement. But what Iam planning to discuss is about scams.

There is a saying in Tamil which roughly translates to

“Anything that you hear with your own ears and anything that you see with your own eyes is false, complete analysis only can bring out the truth”.

In this particular case, I feel that analysis has not been done. There is some amount of information that is available, but that is from the journalist not from Sainul . In this scenario it would not be right to characterize it as scam or not a scam. Further scam as defined here indicates wrongdoing. I dont think it is a scam because it looks like he has not fooled people and made money in this process. He will not be able to do that also because what he claims is measurable. Even if his claims are wrong, he has only just managed to get attention. Well if managing to get attention is crime then many of us are criminals.

It has become fashionable to brand things as Scam. What I did not like about that article is a mention of India as a Scam Nation.

These types of scams happen regularly in India, a guy claimed he got alien cells from rain, someone developed gasolene from leaves in started selling it in large quantities

I dislike sweeping generalizations, particularly when it is made to shore up a logic. In the over zealousness of our scientific mind, we tend to forget the basic tenet of Science. Science is all about observation and attempting to explain why a certain thing happened.

I came to know about this Red Rain Story from above reference. If we follow that link we get the pdf of the original publication. It is a serious document that uses scientific principles to analyze the cause of this phenomenon. There is no denying the fact that Red rain occured. So how can it be a scam. Now if the conclusions are wrong, as scientists we have to propose another theory and justify it and refute the original conclusion. Calling it a scam and taking an escape route is injustice to Science.

Now take the case of Ramar Pillai Petrol. Sure he has accepted that he was a scamster. But scientists then told that fuel to run automobiles cannot be extracted from plants.

Now the new story is that there is a plant called Jatropha and bio diesel extracted from its seeds can run a Mercedes-Benz C 220 CDI. So where do those arguments stand now.

Over the period of years, basic assumptions in Science have changed. Afterall once upon a time the common belief was Earth was flat. Then we believed that light travels in straight lines. The basic assumption on which most of modern science is built, is that speed of light is a constant. Australian physicists propose that it may have slowed over the course of billions of years.

So Scientific beliefs have evolved over a period of time based on our capability to observe and ability to interpret those observations. So it is better that we observe and then analyze the observation to find out why/how something happens. Calling things that we cannot understand or explain as scam/superstition will not further the cause of Science.

Aaya Gaia

November 25, 2006 by sreedharan

Two days before there was a news on Digg about gaia. It was an open source project aimed at reverse engineering Google Earth.

But looks like Google has sent a Cease and Desist notice now and the gaia is dropping plans of reverse engineering. This may continue as a open source 3d earth viewer.

There is a saying in Hindi “aaya ram and gaya ram” mainly for politicians who come and go. Funny that the author chose to name the software project as Gaia, It’s gone.