Thursday, November 27, 2008

"War in Mumbai": The Intertia of reactive governance

It has been more than 36 hrs since terrorists began their occupation of Mumbai and the terror continues with bouts of gun shots, fire, blasts. The message from various sources continues to be mixed with little coherance amongst various bodies involved in cleansing the terrorists. The very occupancy of the financial capital of India by these terrorists for over 36 hours is a testament of a broken system. - porous borders, ever disgruntled and never satisfied religious sect, an inefficient bureaucracy, completely broken intelligence.

To begin with the porous border, it is unbelievable at how swiftly these terrorists could gain entry into the country with all their required ammunition and communication devices. It is understandable that monitoring the wide borders is difficult. But the entry point here, the entry point was through the ocean into the heart of the city. In such a prime area how is it possible that the government had zero security. Added to this was the total failure of the intelligence. Although there are reports that fishermen did report to the cops about suspect activity by strangers, the swiftness of the terror agents was no match to the slumberness of the cops. Within 2 hrs, Mumbai was immersed in terror.

Now looking at the starking reality at how broken the communication from Ground Zero has been it is distressing. At one moment, the media reports the Mumbai Commissioner as stating the operation to be complete and in couple of hours he comes back to revert his previous statement. Disparate sources of information have only complicated the information. Unbelievable at how the government failed in anointing a joint committee consisting of all the bodies involved in the sanitization process and ensure there is one spokesperson for the whole operation?

While some of the folks on TV have made comments about a disgruntled Muslim population in India. The big question is what are these people disgruntled about? They are treated equally in all areas and have infact been given preferential treatment such as having their own colleges and universities to cater exclusively to their religious sect, laws exclusive to them to cater to their religious beliefs, unlimited access to practicing their religion and many more. While some of the people from this religious sect have integrated into the society and proven to be successful such as the Bollywood actors, it is a just a few hardcore muslim's who believe in making India a muslim nation that seem to be disgruntled. It is time for the government to send a strong message to these hardliners, believe in the nation and its laws else get out of the country, probably the country they love - Pakistan. There is no more time for negotiation and pampering.


Above all, this incident occurs after repetitive terror acts within the country. The Home department never got its act together. The rate at which terror acts have occurred in India in 2008 is appalling.
November 26: Mumbai: Over 125 killed, nearly 300 injured and still counting.
October 30: Assam: 84 killed and 470 injured.
Sep 29: Malgoan: 8 dead and 80 injured.
September 27: Delhi: 3 killed and 23 injured.
July 26: Ahmedabad: 56 dead and 200 injured.
July 25: Bangalore: 2 dead and 20 injured.
May 13: Jaipur: 80 dead and 216 injured.

An evident trend that the officials have not realized yet and prefer to be reactive to when the incidents occur rather than taking pro-active steps.

There have been few positive ends too. To mention couple of them, the first being, this is the first time the Indian government has not negotiated with hostage takers. Second and the highlight has been in the way the people in the fore front of the cleansing operation have taken on the terrorists. It would be a great injustice on my part if I do not pay tributes to these folks who have sacrificed their lives fighting the terror elements. They have been exemplary in being at the forefront of the operation, leading their men, unlike many others including the politicians who sit at their desk and command and demand from their people.
- Hemant Karkare
- Ashok Kamte
- Vijay Salaskar
- Mohan Chand Sharma
- Muralidhar Laxman Chaudhary
and many more. Officers, your loss is a great loss to the humanity and your service will ever be remembered for your braveness in being at the forefront of leading your men these senseless mindsets.

If there is any indication of this article being prejudiced against existing government or any indication of being pro-BJP, let me assure you that the wound from previous government's handling of Kandahar hijack incident still bleeds in me - an blatant act in loss of confidence in our commando's. Without going into the details, the purpose of this article is to express my strong feelings at how meek, reactive, submissive and spineless the Indian government is considered amongst the terrorist outfits.

Immaterial of external factors that may have their role in these terrorist activities, it is high time we set our house right. An awakening call can not be more glaring than what we see today in Mumbai - for the people of India, the policy makers and the politicians. Action is required - quick, swift and coherent amongst all the division of the government and political establishment. The old guard sitting in the echelons of the government - Shivraj Patil, Arjun Singh and others MUST go, with no further delay. Bring in more dynamic and younger blood. The chief's of RAW & IB MUST go. Embrace technology to secure the country's borders. The length of the operation could have been drastically reduced by incorporating technology into the operation to identify where exactly the terrorists are located using gadgets such as remote video toys. Incorporate touch laws for terrorism - immaterial of whether it is by a Hindu, Muslim, Christian or any religion, they need to face it. It is difficult to digest the fact that it has been 15 yrs since Mumbai blasts and the people who abetted the perpetrators such as Sanjay Dutt roam around scott free.

Note "If we continue in this reactive intertia mode, the day would not be far before India becomes an another Pakistan".

Thursday, November 20, 2008

WSJ.com down, exposes stack trace

The prestigious Wall Street Journal was down today sometime between 8.20 am - 8.25 am PST, as shown in the below image. Initially the website did a decent decent job in re-directing to a different page - stating the website is down due to technical difficulties.



The next time I refresh, it blew up. Check out the below image and what is displayed is a whole stack trace which bares out the internal software used - apache struts, IBM web container etc.. It looks like redirection to the error page too failed - check out the complete stack trace at the end of the blog.



The HTTP error is 400 i.e 'Bad Request' due to either the URL syntax being malformed or invalid. But since the error page could not show up, it looks like the web application has crashed. Could potentially be a result of:
* the application getting overloaded with users - more than what the application can handle?
* Maintenance of the web application? This would be weird given that it is morning time and the load on the website would be the maximum. For WSJ to undertake maintenance at this time of day would have been a very bad decision.

With regarding to stack trace being displayed, implementation of any software should be such that the exception stack trace is never be exposed outside the boundaries of the organization. The reasons for this include:
* Stack trace is a content understood by only the techies. While visitors to most of the websites are non-techies. Seeing the junk on the screen can turn their face blank, frustrated and in some cases result in moving to alternate sources of information.
* Exposure of internal implementation details. This trace clearly indicates the software WSJ uses - IBM web container, Struts, JSP. These are details internal to an organization.
* In some cases, albeit unknowingly, stack traces can expose internal implementation details that could lead to exposure of proprietary information. Added to which you never know what hackers have up their sleeves when such information is exposed. Hacking websites is not a difficult task more in these Web 2.0 days where not all the developers have an understanding of the security implications of Web 2.0. But the stack trace displayed here, to me seems harmless given that it displays trace of IBM and Struts codebase which are not proprietary to WSJ nor does it indicate usage of any Web 2.0 technologies.

To ensure the occurance of this incident, it is a good practice to re-direct the webserver to its own error page when a particular application is not available.

----------------------- Stack Trace ----------------------------------
Error page exception
The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.

Original Exception:
Error Message: Invalid path /WSJPageNotFound was requested
Error Code: 400
Target Servlet: action
Error Stack:
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Invalid path /WSJPageNotFound was requested
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:536)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:967)
at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:684)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:242)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1439)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)



Error Page Exception:
Error Message: JSPG0036E: Failed to find resource /utils/error.jsp
Error Code: 404
Target Servlet: /utils/error.jsp
Error Stack:
java.io.FileNotFoundException: JSPG0036E: Failed to find resource /utils/error.jsp
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.findWrapper(AbstractJSPExtensionProcessor.java:300)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:273)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:2804)
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:544)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:967)
at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:684)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:242)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1439)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

Tuesday, October 28, 2008

Challenging times to head an investment bank

Reading today's financial news, one article that struck me was http://www.reuters.com/article/marketsNews/idINN2839680920081028?rpc=44. The article was about a negation by Morgan Stanley (MS) of a rumor on its exposure to losses in Citadel Hedge Fund and Volkswagen. Similarly, about 2 - 3 weeks back, MS had to re-issue assurance statements on daily basis that its 21% sale of share in the company stock to Japan's largest bank Mitsubishi UFJ Financial Group was on. This was primarily to counter the rumors on the news boards and wall street that the Japanese bank would back out. The two together brings a thought to my mind on what managements can do in these highly volatile times.

These are undoubtedly challenging times for investment banks and their management. Largely abreast of the latest financial news, I started to see the value and challenge in the role of being a CEO of an investment bank in these un-ordinary times. The scope shift in the role where primary responsibilities shuffle around with market psychology, a dormant constituent in a normal situation moves up in the list; ensure rumors, speculators and suspicions do not play a detrimental role to the health of the company. The CEO and his team have to turn around quickly to the latest news and word on the wall street or main street and ensure the right message - be it negation or assertion, is communicated effectively and widely.

A lack of self-discipline and regulation in most of the banks in their rat race for greed, added to which was a regulation-free environment, has resulted in where we are today. The whole picture is so murky that large or small investors have little or no insight in the state and health of a bank, thus resulting in a lack of confidence in all the major investment banks. This in turn has resulted in an breeding environment for rumors, speculators and suspicion. To gain the confidence back in such an environment is going to be an uphill task for even the greatest of the management.

These are the times where CEO's have to prove their mettle in critically evaluating the situation on a daily basis. To enlist a set of actions, I started to imagine how a CEO in this role would spend his time and below is the list:

- cash reserves: cash is the most dearest asset in today's financial doldrums. Banks need to continuously evaluate if they have enough liquid cash to enable them meet their daily commitments to run the business. This would mean cash-to-debt ratio should be really healthy.

- means and sources to raise cash: contineously keep a tab on potential investors who can pump money into the company when required. Keep this channel open. What assets can be sold off to enable the company raise healthy cash. The analysis is critical here since sometimes the dearest and most profitable assets may have to be let go to raise cash in these time. Surely mortagage based asset would reap nothing for the company.

- government: Keep in touch with the Fed and Treasury on the state of the company and seek additional help as required from the government.

- mergers or sell-offs: Analyze into the forseeable future, if the conditions seem to go for the worse, seek mergers or sell 0ff the company as Meryll Lynch CEO John Thain did promptly. Today he is considered by the educators in management schools as an example of how a CEO can ensure the share holders money in the company is not totally lost, in contrary to the style of Lehman Brothers. There is a thin line between belief in the company and performance of the company.

- a feel of market psychology: the management may have little control over this but it must monitor the news, the word, the feel of the market and ensure any rumors or negative talk is effectively quashed. The management must also be abrest of the latest state of their industry, especially peer companies since the phenomenon of 'peer effect' is contagious and in bad times detrimental.

- evaluate the performance of assets: Continuously seek reports from the lower management on the health of existing asset. These assets need not be performing well or even if making losses is fine as long as their health is not depreciating exponentially. Well, any asset that is returning profits is a dear one. The management must have a record of the best performing and worst performing assets to continuously keep a tab on the profits and losses.

- international markets: evaluate the international operations and how the markets there are reacting to news and ensure all the above are followed too there.

Overall, these are times where every CEO is challenged on how he /she manage situations beyong their control and ensure best possible returns for the share holders of the company. It is these times that a CEO should be evaluated in terms of cost to the company and appropriately compensated. It is not necessary that he / she continues to be a CEO of the company at the end of this tumultous period but more in how much value add his share holders see in the company.
I am sure most of us will be here to see and judge the best of the managements. After all, challenging times are what bring out the best of humans.

I am not a financial expert and at the least not even in the financial industry. So please take all the above with a little more salt.

Saturday, October 4, 2008

economic crisis and solution

Some of the folks who were in strong support of government intervention were finally happy to see the $700 billion dollar bill pass in the US Congress on Friday, the 3rd Oct. But paradoxical part of the day was the stock market which was going north went south after the bill was passed. The only reason I could see was there was still bad news flowing in from not only the US but also from Europe and other parts of the world. Although the bill has now been signed by the US president, the question still remains on how the money would be used - who gets the money, which mortgage securities are considered bad and to with what relativity.

Well, my question is, as some of you may have already asked, should the government even buy up these mortgage securities from banks? To add more claritiy, my question is about how the government should intervene rather than should the government intervene. It is long due for regulators to step in and take hold of the situation.

Why should the government intervene? The whole world runs on money. From the time you wake up in the morning - your brush, paste everything runs on money. And the folks who manage all the money have us by the throat. When financial markets freeze,
- business who depend largely on loans to run their daily activities can not obtain any credits or loans,
- employee funds who invest in financial markets can not withdraw any money for their day to day business as some of the schools scrambled to banks on Friday to withdraw money to pay teachers,
- retirement savings are lost,
- even governments themselves, who carry huge deficits on their balance sheets, can not obtain loans as California Governor Mr Schwanazer issued an emergency request to Treasury secretary Paulson stating the state requires $7 billion to meet its demands immediately,
and the viscious cycle just keeps getting worse. For the common man he is going to be affected by all the above.

So how should the government chip in? In trying to understand the role of government in a capitalist economy, I started to analyze where the crux of the problem actually lies. Using the top down approach, all the noise we see and hear is due to banks going belly up and writing off huge losses. The primary reason stated is bad mortgage bets in terms of securities or bonds or credit swap loans etc.. Why are these mortgages bad? The people who have taken these loans to purchase real estate are unable to pay the money for reasons:
- their fixed low interest rates of 2% or so has now become 6%+ i.e approx 3 times. The locked in rate when they acquired the loan was for a fixed time and the time has expired.
- Have been just able to meet their ends while for the past year or so the inflation has added stress to their budgets that has in turn resulted in accumulation of additional credit card loans etc..

So the crux of the problem seems to lie at the lowest level. This is where the government should be concentrating their primary efforts. Biggest assumptions of today are:
- all mortgage loans are bad. There is no or little tracebility in the investment industry since the loans have been packaged and re-packaged by multiple people.

Some of the options, that I believe, could alleviate common man from defaulting on loans are:
- extend the loan time frame. Today if it is a 30 yr loan, extend it to say 40 yrs. The banks atleast get their money back but over a longer time frame. This is not un-common to most of the banks.

Questions arise such as:
- The mortgage loans are packaged as securities by banks and sold or held as collateral. Today the banks are unable to pay up the required amounts to cover these investments and there by defaulting. Defaulting results in the credit swap's (an insurance in financial industry for defauling to pay) coming into play where the insurers have to pay up. So who takes these losses? My answer is the financial companies MUST take these losses since they have hedged their bets on it and obviously relish or pain involved in profits or losses. The government has not role in here. At the same time, most of the loans have not gone bad since people continue to pay but in lesser amounts for a longer period of time.
One big question here is about people who have hedged their bets in real estate purchasing more than one home. I, personally believe these people would invested to reap huge profits from real estate should have been prepared to take on the losses. So who owns these loans. This is where the government intervenes by taking over these loans and ensuring these folks pay up for their bad deeds over a much longer run - either by directly taxing them more than others or by other means.

Thursday, September 18, 2008

"A Dream that has gone too long"

After coming to the US in 2000, I along with my cousin Subash, drove to Berkely to meet a family friend Laxmi. In the midst of our discussions, housing market came up and Laxmi mentioned how eager she was to buy a home which is considered to be an 'American Dream'. Her husband, Dhruv whom I was meeting for the first time was not for it with the justification that housing prices were too high and some day they have to come down.

Well at that moment, based on my minimal knowledge on economics, I did support Laxmi stating real estate will always have its cycles but over a long run, it is one of the safest investments'. Added to this was the fact that friends and neighbours who had bought homes were reaping the benefits of house appreciation and eugolizing their investments. To this Dhruv's reaction was 'thu tho bache hai' in Hindi meaning, you are kids. Having got introduced couple of hours back, I decided to not argue any further. But for Dhruv, a Harvard Graduate, he knew how little knowledge we had on the macro-economics.

I continued with the my belief in safe returns on real estate investment, added to which was the fact that living in an apt is a dead investment, especially given the high rental rates in california. The same money if I would invest on a home, I would rather reap long term benefits. With this mindset I have always looked out for purchasing a home. Probably the first visit I paid to a home and got the brochure was in Oct 2003, a KB Home in Rancho Cocomonga, Southern California, where I had moved on job. Although it was a new community with a 3-bed home costing less than 300 K, I decided to opt out from the 'American Dream' for personal reasons - impending marriage.

After marriage, I started to see a steady and slow increase in the rate at which people around me - friends and cousins were buying homes. Although enticed into the dream, I decided to wait until the finalization of my wife's graduate school. In 2006 she finalized and got admission in Cal Poly, San Luis Obispo. We moved to San Luis Obispo and were attracted to the serene beauty of the place and community. I was very eager to have my dream realized here. But, what stopped me was the real estate market itself - its high exorbiant housing prices. Also, by this time, I started to feel a eere or un-easiness around the housing market and that it is probably getting stretched.

We moved back to Los Angeles after my wife's graduation and now we started to see in quick succession few of my colleagues buying homes in Chino, CA. The desire to realize the dream made me look up again and shop. Now, with people having seen the contineous rise of the housing market, for so long, had enough justifications that this was not a bubble and even if it was it would never crash land. But the eere inner feeling helped slow down the thoughts and procastinate the dive into the dream. The last visit I paid to a housing location was probably in May 2007. Probably some time around July 2007, I believe reality started to unfold and the housing market started to slow down and credit slowly tightened up.

Today, reflecting back, what comes to my mind is probably what was going on in Dhruv's mind in 2000 - Macro-Economics. The steeper and longer the slope the harder is the crash. Some may argue he was conservative especially in a place like Berkely the house prices are still above the prices in 2000. Probably true, although I do not have hard facts and can not weigh on that decision. But on personal end, probably the price of the first home I saw in Rancho Cocomonga, may be back or around the price I was offered in 2003. In which case, probably if I would have invested in the home in 2003, I would not have lost much money and infact save on my rent. As a counter argument, when I consider the indirect costs of buying the home - the flexibility to move to San Luis Obispo - without any hassles of renting out, cost of gas ($4+ per gallon) and the time, in hindsight, it was not a really bad decision to not have bought the home.

All through these years I always thought of 'my American Dream having gone too long'. But with the sequence of events that have been unfolding since this July, I now feel, 'It is THE American dream that has gone too long - stretched un-interrupted and un-regulated'. The blame game will go on from bankers to brokers to regulators to economists to politicians and to many more. But let us not exclude some of us on the main street whose extravegence & greed, spreading ourselves very thin and purchasing more than one home are equally responsible for where we are today.

Friday, September 12, 2008

Opening an offshore development center - ensure you check off this list

If you are planning to open an offshore development center, there are few points that could help you ensure a reliable and durable business. Below are some of the points that I list from my personal experiences.

- If you are starting your new operations offshore, always start with few people. Optimally try to have 3 people per division / team to begin with - a lead and 2 product experts. I have seen companies recruiting big with each team constituting more than 10 people which ended up with more politics and little output.

- Identify people from your on-shore team with a good understanding of the culture and society of the place. If none are available, try to recruit an agency that can help. It is worth the money upfront than failing totally. Understanding the local culture and people is important to identify the right talent and doing business in the future.

- Your first team should be the path leaders for the future team that would be recruited. So ensure you put your future money on safe bets - the best possible talent.

- Look out for people with talent - dirty jerseys, and not people who can talk great. To my knowledge the best talent in India are not great talkers or presenters.

- Provide necessary training for these leaders. Ensure the training session is not crowded with too many people. Get the best experts from for the corresponding products from your on-shore team to train the folks.

- Lay down a process for communication between the on-shore and off-shore teams. A process on who or which team members, when and how the team's would interact.

- It is important for on-shore team to identify key members and engage them as the team grows. The old guard or some times a new guard could bring in politics. From my personal experience, there can be people who specialize in politics and in turn destroy the team. It is difficult to identify these talented people given that the place could be culturally different but the effort in trying to identify people is worth the effort.

- Keep a tight tab on the status and expectations. The work culture of the two teams could be different and hence expectations on what each party states can be different. It is mandatory to document explicitly the expectations to as much detail as possible. For eg: if a feature has to be delivered, it has to be coded, documented and tested.

Monday, July 14, 2008

Economic outlook - perspective July 2008

News on Economy:
It was Friday and sitting on the couch as I opened WSJ to read the latest news, the first article was on Fed regulators seizing IndyMac bank - a bank that hedged its bet on sub-prime mortgage. Couple of days later, on Sunday night, the news read Federal government decides to back Freddie Mac and Freddie Mae, temporarily increasing the longstanding Treasury line of credit and the Treasury department seeking to buy an equity in both the companies if required. Suddenly all the other bad news is in oblivion. As a common man who lives in a rented apartment, my pain point was oil peaking to $147 which was now relegated into secondary news.

It was a tricky situation for the US government and federal regulators. On one side by backing the two mortgage giants they acknowledged that the two government charted agencies were going in red especially after both the stocks plummeted more than 45% - the general market concern. On the other end, if the government did not act quickly the worst could turn loose with more banks following Bear Sterns except that this time there would be no JP Morgan to save them. The effect would ripple through in the global economy.

Current state:
So far we have only heard of the major financial giants write off bad loans or hedge funds closing or reporting huge losses - all of whom had bet big on housing market. While the above news shows how the bad news has percolated to the root of the housing market which is the government chartered Freddie Mac and Freddie Mae. The trouble at the two big housing giants is probably the peak of the problems creating from the housing boom that occured from late 90's to 2007. Well is it the peak or ? One news is as of 2006, Freddie Mac and Freddie Mae were overshadowed by banks and other investors in issuing mortagage based securities.

How long?
The big question on every one's mind is how long would it be before we are out of this mess. Looking at the housing market specifically, the loans were issued out until mid-2007 in a fashion that is today considered to be reckless and irresponsible. Assuming most of these loans are 5 year fixed APR, the bad loans would surface through out the next 5 yrs and majority of the owners who are big financial banks and firms will continue to write off these as losses. In the best case, even if we could assume that only 5% ( a random number I choose) of these loans would turn into bad loans, there are other factors that have a negative influence. These are a bad economy influenced by an inflation, oil crisis that contributes to a large inflation of basic essentials, the Iraq and Afghanistan wars that will continue for another few years. The best possibility is a remote possibility and can be discarded.

I, personally do not foresee the US economy showing any signs of comfort in the next couple of years and the next President who ever it be - Obama or McCain, will have a rough tenure in handling economy, war, inflation etc.... Good luck President...

Are you frightened? If yes, the good news is I am a ZERO in economics. All the above is based on the general knowledge I have gained reading various new articles. So do not take my words with all reality.:-)

If you are interested in reading about how the housing market got so intricately twined with financial markets, a good read is http://www.imf.org/external/pubs/ft/fandd/2007/12/dodd.htm.

Monday, May 12, 2008

ఇది నా మొదటి తెలుగు పత్రిక

నమ్మ లేని వార్త. ఇది నా మొదటి పత్రము - తెలుగు లో.

JavaOne 2008 - May 7th Technical Sessions

After the Oracle session, the first session I managed to get in was TS-5579 (Closures Cookbook). Although I had read about closures, I had practically never applied the same nor truely remembered what I had read on Closures. The purpose of attending this session was to ramp myself on this topic and what is to come ahead in Java 7. The session was well briefed with examples and a good amount of explanation although I need to review my notes after the session to recap and attain better grip. Corresponding notes I jotted down is below. There seem to be multiple efforts for Closures with JDK 7 working towards including this, while the presenter from Google was working parellely on feature sets to be supported.


As part of the daily update, there was a change in the sessions at 10.50am where a new session TS-5027 on Minion Search Engine was added. Curious about how they handle business data and searching while the content is being streamed, I decided to attend this session. The presentation went into good set of details on how to use the APIs defined as part of Minion engine could be used. How the stats are created and how the results surface up depending on matches. The search engine does scan through music files based on the tags specified for the same. But unfortunately, this search engine requires the document/content to exist in the file system.

My next session was TS 6237 Debugging Data races. The topic interested me since we keep running into exceptions that intermittently occur, occur on one system and not on other. The session was pretty detailed in showing how race conditions could occur especially on multi-core processors. Some notes are captured below.

With the same curiosity and many answers un-answered, I went for my next session TS 6316 Transactional memory in Java Tech based systems. This was even more interesting since Intel and its partners were looking to implement transactionality at the core level by using certain constructs. More notes below in corresponding section.


My next visit was the AMD general session. The session was not really exiting apart from claiming that they were working closely with Sun on bettering Java etc.

To close the day I decided to go for GlassFish V3 and JMaki Lab. To my luck there were slots available for me to do the lab. The reason to attend this session was to get a feel of both technologies GF and JMaki. The exercise details including instructions are available on line. Pls refer below for the link.


--- TS 5579 Closures Cookbook -----------------------------------------------
Closures cookbook: Niel Gafter from Google

BGGA Review
Runnable r = {=> doWhatever(); }; //the method executed when run is executed below
r.run();

Callable cs = { => "result"}; method take no arg and returns string.

when params are involved
Comparator reverse = {String s1, Strin s2 => s2.compareTo(s1)};

param and statement involved
sing closures in Swing
ItemSelectable is - ...
is.addItemListern(
{ItemEvent e => doSomethig (e, is); }) //alows u to use local params


- Creates an object that represents - code of body, lexical context
- An instance of some interface
- Few restrictions - may access local, this, may return enclosing method


Aggregate Operations:-
- Input is an agg: array, list, map etc.
- Bulk computation over data
- Part of computation caller-defined
- Can often be "automatically" parellelized
- Sort, filter, map, reduce, fold etc.


//seq code - what is highest GPA amongst students graduating
double highestGpa = -Double.MAX_VALUE;
for (Student s : students) {
if (s.graduationYear == THIS_YEAR) {
int gpa = s.getGpa();
if (highestGpa gpa) highestGpa = gpa;
}
}

Have to read whole thing to understand

//aggregate code
final doul highestGpa =
students
.filter({Student s => s.graduationYear == THIS_YEAR})
.map({ Student s => s.getGpa() })
.max();
An agg code instead of using a List. Concurrently the code can be executed especially on multi-processors. Enables management of concurrency in lib code instead of letting JVM manage it.


JSR 166y.


An API
/* record perf statstics of an operation */
public void recordTiming {
String opName,
long nanosec,
boolean succeeded) {...}

client code:
long startTime = System.nanoTime()l
boolean success = false;
try {
//a series of stmt to be timed
success = true;
} finally {
recordTiming {
"opName", System.nanoTime() - startTIme, success);
}

Problem: Appears 110 of times n clutters in codebase

One aspect to overcome above is Aspect OP. Lots of use cases of AOP and closures overlap.
Move boilerplate into API?

class Trace {
private final long startTime = System.nanoTime()l
private final String opName;
private boolean success = false;
public Trace(String opName) {
this.opName = opName;
}
public success() {
success = true;
}
public void done() {
record...
}
}

client:
Tracer tracer = new Tracer("opName");
try {
tracersuccess();
} finally {
tracer.done();
}

Little better and not successfull. Major drawback, what happens if return is required in themethod

try {
if () {
tracker.success();
return result;
}

tracker.success();
return result1;

}

Scope for forgetting resulting in wrong output

- In 7 java, there is an option to use multiple exceptions in one catch block
catch (Myxception | myxception 2) {
tracker.dofailure();
} finally {
tracker.done();
}


In 7 there is a final where the exception caught is rethrown by doing some logic
} catch (final Throwable ex) {
tracker.faulure();
throw ex; //throws same exceptions
}


How to solve above problem using closures:
Closure-based API
interface Block{
void execute();
}
public void time(String opName, Block block) {
long startTIme = System.nanoTime();
boolean success = fase;
try {
block.execute();
} finally {
recordTiming....);
}
}



client:

public void time(String opName, Block block)...

time("opName", {=>
//a series of stmts to be timed
});


Exceptions:
When timing code throws exceptions - above interface Block does not throw any exception
How to

interface Block {
void execute() throws X;
}

public void time {
String opName, Block block) throws exception



Would like to have any no of exceptions
Exception Transparency:
interface Block {
void execute() throws X;
}
public void time(
String opName, BlockM bloc) throws X {
long startTime..
boolean sucess false
try {
block.execute();
success = true;
....


Completion Transparency:
to time pdy of method
int f() {
return ..compute result..;
}

int f() {
time ("opName
}


Note that the success=true MAY not be executed above.


refactor above as:
boolean success = true;
try {
block.exeucte();
} catc (final Throeable ex) {
success = fasle;
throw ex;
} finally {...}


Completion
int f() {
time {"op", {=>
return ....compute...; //return result from f
});
)


A blck that can not complete normally

interface NothingBlock {
Nothing execute() throws X;
}

public Nothing time2 {
String opName, NothingBlock block) throws X {
long st = SYstem...
boolean success = true;
try {
return block.execute();
} catch (final Throable ex) {
success = false;
throw ex;
} finally {
recordTiming (....)
}
}
}


if op completes successfully use time(...) else time2(...)

A block that can complete normally

interface VoidBlock {
Void execute() throws X;
}

public Void time3(
String p[, VoidBlock block) throws X {
...
try {
return block.execute();
}
.....
}
}

Combine using Generics:
interface Block {
R execute() throws X;
}

public R time {
String op, Block bock) throws X {
....


client code:
int f() throws MyException {
time("op", {=> //executed on success
//
});
time ("op" {=> //on failure
//
});
}


Simplified Syntax:
some boiler plate code below such as => etc..
time{"op", {=>
...;
});

can be avoided with below syntax
time ("opName") {
....;
}


- Closing stream is boiler plate code when working with streams
withStream(InputStreams: makeInputStream()) {
//do
}

interface ClosableBlock {
R invoke(C c) throws X;
}


R withStream (C c, CloseableBlock block) throws X, IOException {
try {
return block.invoke(c);
} finally {
c.close();
}
}

above block can be replaced with below where function types are used instead of wildcards
R withStream(C c, {C ==> R throws X} block) throws X, IOExcepion {
.....


- Loop over entries in map

Use BGGA closures can do the looping
Map map = ..
for eachEntry(Key k, Value v : map) {
//do
}


void for eachEntry {
Map m,
{K, V ==> void throws X } block) throws X {
for (Map.Entry e.....
llop through


- In concurrency packages

Lock lock = ...;
withLock (lock {
//do
}


R withLock (Lock lock, { ==> R throws X} block) throws X
......

-----------------------------------------------------------------------------


--- TS-5027 Minion Search Engine --------------------------------------------
Minion Search Engine

get searchEngine by specifying an index dir where index is to be stored.
define fields using config file or API
index documents
pulic void index(SimpleIndexer si, MimeMessage m String foldername) {
si.setID(m.getMessageID());
si.setField(m.getFrom());
...
}

Querying:
Use ResultSet.

Query operators
- Term - case exact, morph, stem, wildcard.
- Proximity near, within, phrase, passage
- parameterci : =, <
- boolean

Available Grammars:
- Full: contains, note, and
- web
- Lucenesque style

Doc vectors;
Provides wights on the no of time the word is found in the doc.

Finding similar docs
- can get Doc vector and find similar docs
- search based on a field eg: subject
- search based on weighted fields

Document trainer:
Given set of docs with a label can tran the engine how to apply the label to new docs and classify them.


Clustering docs:
-

Tag based documents:

http://minion.dev.java.net
TS-5841

blogs.sun.com/searchguy

One major part I was looking for to search over a stream is not supported.


- How to apply for batch of documents? How to identify the separator betwen each doc
- Only on clear text data?
- Can I train the doc to contain a key word at a particular index

-----------------------------------------------------------------------------


--- TS 6237 Debugging Data races -----------------------------------------------
The content here is not comprehensive since it contained very fine details that I could not capture.
Debugging races:
- Hashmap - with one write multiple readers. Reader could read 3/4 insert.
- Similarly List


Debuggin:
- Visual Inspection: But user may not know the complete flow etc..
- Printing:
- make noise at each read/write of shared variable
- inspect trace after crash
- Per thread pringing of System nanoTime: but a heavy weight technique.

- FindBugs
- scales to prd use
- pattern matching

-----------------------------------------------------------------------------

--- TS 6316 Transactional memory in Java Tech based systems -----------------
Java Transactional Memory: Suresh Srinivas, Vyacheslav Shakin from Intel

- TM is a tool for concurrency control in Multi-core systems
- STM is a soft tech for developing new parellel software.
- HTM is a hardware tech that both existing and new software can utlizie to improve perf as well as concurrency.
-


static void move (Queue q1, Queue q2) {
synchronized(q1) {
synchronized(q2) {
Object o = q1.dequeue();
q2.enqueue(o);
}
}
}

client code:
cls.move(q1, q2)
cls.move(q2, q1)

Possible problem to above is Thread1 acquires lock on 'q1' while Thread 2 acquires lock on 'q2'. Deadlock occurs
To overcome this the block can be declared in 'atomic' block which when stmt 1 acquires it commits and in between if stmt 2 tries to commit any of its changes exception is thrown. Basically Transaction implemenation at lowest level.

Implementations:
Atomic
McRT (Multi Core runtime)


- java locks are optimized for:
- No Contention case
- not optimzed for case of lock contention with no real data conflicts.


Hardware Transaction Memory:
- java system utilizes HW transactional Memory ("isolation" & "atomicity") with no changes to software
- Software lock Elision
- Speculative Execution


PPoPP 2008 paper
ISCA 2007 paper - on speculative elusion.


References:
whatif.intel.com
java HTM is work in progress
stamp.stanford.edu
http://cs.rochester.edu/
-----------------------------------------------------------------------------


--- LAB 4520LT GlassFish V3 and building JSF using JMaki --------------------
Check out the link at http://developers.sun.com/learning/javaoneonline/j1lab.jsp?lab=LAB-4520LT&yr=2008&track=1 for details on instructions in doing this lab.
-----------------------------------------------------------------------------

Thursday, May 8, 2008

JavaOne 2008 - May 8th

NOTE: Below is what I could capture as notes as I attended Technical sessions at JavaOne 2008 on May 8th. I have tried to capture the presenters names for the corresponding sessions. All the content there in is owned by corresponding presenters and any session where the names are missing I apologize.

Intel General Session:
I got in late for the session, a reluctant entry to the session given that I was not really impressed by AMD's session the previous evening and had the same impression that it would be bland about perf improvements and a very high level on how they are using it. But the few minutes I was there, which was to the end of the session, it was pretty interesting. With presenters who were adept to stage presence and ex-tempo rather than reading from the presentation visible below the stage on the LCD screens, Intel finished off pretty strongly. The message from the last few minutes was about Intel's Xeon being the fastest processor for Java, strongly moving towards Mobile devices and tablets, an their open source community for development - Moblin.org

Started off by going to the session on TS 5793 on Groovy and Grails. My knowledge on the session was minimal since I had only played around with Groovy. The presentation was a quick overview and at a high level but had good number of snippets of code especially how to use metaClass feature and its related functionality. To this were the tips added on how to replace DAO and ServiceLocator patterns on how the boiler plate code can be avoided. The gaps for me were on the interal workings since I have a deep desire to understand how the internals work - how the code was generated by Groovy behind the scenes, especially the loss of encapsulation that the methods can be defined outside of the class. Pretty evident that I need to do more investigation on this front.

The next session was on JRuby On my way to the session I happen to run into Michael Czapski and Brendan Marry - professional services folks who had become new authors and had published their first every book on Java CAPS suite. After a brief discussion I barged into the JRuby session and could capture some of the notes only. Again this was another session where I was a beginner and could grasp what I could get and look forward to specialize depending on priorities. More notes on the session are below.

My next session was TS 6256 (Scalable non-blocking data structures) which was pretty detailed on how to build DS especially in cases where multiple reads, copying of DS are involved. More notes on the session are below.

My next session was TS 6587 (Patterns and solutions for Offline Batch Processing). This was a problem we had partly attempted to solve as part of the B2B solution. We had done the Batching part only and not the un-batching part. I was curious to hear on difference in how others have solved the problem. But to a large extent the presentation addressed the problem similar to how we had. It rather expanded on it in different ways from tightly coupled to loosely coupled.


--- TS 5793 Groovy & Grails- Changing Java ------------------------------------
By Graeme LaForge - Proj lead of Groovy and JSR 241

Groovy:
- dynamic language for JVM.
- groovy.codhaus.org

Grails:
- web platform that implements full stack from build system down to ORM layer. To put all technologies together.
- Leverages existing tech Spring, Hibernate, Quartz
- grails.org

Groovy dynamic:
Dynamic langs - Python, VB, Ruby, Groovy
Meta Object Protocol - Grovy, Ruby, LISP

Groovy MOP:
- Every class has a MetaClass which can be obtained as below
def obj = "Hello"
df metaClass = obj.metaClass

obj.metaClass.methods.each {

}

using respondsTo and hasProperty
- Need to find out whether an object implements a method? Use respondsTo:
- Need to find out if an object has a property? Use hasProperty:
if (foo.metaClass.hasProperty("bytes")
println foo.bytes.encodeA;
}
MataObject Model and other details available on groovy website


//can add new methods at runtime. Eg: On String class padLeft and other utils dynamically.
class Dog()
Dog.metaClass.bark = { -> "Woof!" }
Dog.metaClass.getBreed = { -> "BullDog"}

def d = new Dog()
println d.bark()
println d.breed() //interestingly this works??? although method is getBreed


Integer.metaClass.plus = { Integer i -> 1 }
3 + 4 (this will always return 1.


Integer.metaClas.getDollars = { -> "$delegate dollars"}
4.dollars


Static methods and constructrs
- static ethods can be added

Dog.metaClass
.static.bark = {new Dog() }
println Dog.create().bark()


- Note that every time you do a new Dog() the same instance is returned. (verify this???)
Constructor can be added using a special property


Meta-Program hooks
- invokeMethod, methodMissing, get/setProperty, propertyMissing:

Dog.metaClass
.methodMissing = { String name, args ->
println "Dogs..."



Meta-Prog Patterns
Interesting pattern developed in Grails
- Intercept, Cache, Invoke
- Basic Usage:
- inercept method
Dynamc create new method
cache new method
invoke new method
Dog.metaClass
.methodMising = { String name, args ->
def cached = {Object[] a ->
println "Dogs.."
}
Dog.metaClass



DAO pattern:
Implications of DAO
- Class explosion
- promotes aemic domain model
- configuration, config, config - a lot of repetition
- violates DRY???

GORM n Grails
- Dynamc queries can us used where methods need not be static. An interceptor can be built, where method name starting with certain string can be identified and corresponding logic executed.


MOP == goodbyte to DAO
- repetitive, boilerplace DAP logic gone (DRY)
- logc exists wher eit belongs - in domain (DDD)
- no direct ref to third party dependencies


Svc Locator
Eg: Spring & Grails
class Book {
Purchasing Service pusvc
Transaction buyBook(User u) {
purchasingService.buyBook(this, u)
}
}

Book.metaClass.constructor = (->
def obj = BeanUtils.instanctiateClass9book)
applicationContext
.getAutowreCapableBeanFactory()
.autowireBeanProperties(obj, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME,
false)
return obj
}

Adv of Meta way
- promotes DomainDriven Design (DDD)
- No config

Summary:
- Meta programming represents a new way to think abt problems
- Common patterns like DAO & Svc locator r present bcos of limitations in Java Platform
- Groovy & Grails open doors to declartive prgms, DSLs and DDD

grails.org
Code available in Grails docs
-------------------------------------------------------------------

--- TS 6490 JRuby --------------------------------------------------------------------

JRub/LDap
penSSL => JRuby/OpenSSL


Warbler: util to package app into web
- Application Layout (Rails) is kind of opposite of WAR file. Warbler takes care of this
- Installed as a gem(jruby -S gem install warbler)
- installing warbler as a plugin - jruby -S warble pluginze
- Configuring Warbler
jruby -S warble config
- Can also specify DataSource name in Wobbler config

Demo:
jruby -S rake db:create //std Rails rake cmd to create DB. The config file with variables is updated.


Tuning your deployment:
Runtime Pool size:
- config/warble.rb:

Warbler::Config.new do |config|
#....
#contorl the pool of Rails runtimes
config.webxml.jruby.min.runtimes = 2
config.webxml.jruby.max.runtimes = 4
end

Session handling:
Rail session != Servlet sessions

Caching and File Stat'ing
- Ensure view cacing is enabled (deault in Rails 202)
configaction_view.cache_template_loading = true
Aviod asset ID timestamp checks with RAILS_ASSET_ID
ENV['RAILS_ASSET_ID'] = 'r#{.....
Ensure ull page cache dir points to root of WAR
config.action_controller.page_cache_directory
Rails.public_path coming in 2.1


Performance: evolving and no stats are available.
concurrent request 10-90 while response time increases linearly.


Pre-compiling Rails
- compile Ruby code to bytecode before execution
- System property: -Djruby.compile.mode=FORCE
- still eveolving and may not return desired results.


JRuby-Rack
wiki.jruby.org/wiki/JRuby_Rack - converts java req to what Rails can understand
rack.rubyforge.org

------------------------------------------------------------------------------

---- TS 6256 -------------------------------------------------------------------
Towards scalable Nonblocking Data Structure - Azul systems

BitVector
Use the bits to capture the state of the DS - from initial(0000) to set data(0XXXX) then to move the content to another DS, you set an intermediate state (1XXXX) and once the DS is copied over reset the status to (10000).

Resize - copy mechanics

- Use Finite state machine to control writes
- Use large array for data

e2e.azulsystems.com - contains papers and other material for engineers.
azulsystems.com/blogs/cliff

--------------------------------------------------------------------------------

---- TS 6587 Patterns and solutions for Offline Batch Processing ----------------------------------------

Higher level framework:
SpringBatch - an implementation from Spring. Do not know much.
Spring Integration


- Batch infrastructure adds optimization adn low level abstractions.

EDA
- Contineous and concurrent
- Sometimes perceived as opp of Batch procesing - but not really

The presentation was pretty much in line with BatchSvc implementation as part of B2B effort. But the presentation started from the ground up how the message is read and written as
- read and write tightly coupled
- read separated out from writer but not in a scalable model
- further were how the batching could be scaled using BP's, JMS etc..

--------------------------------------------------------------------------------

Wednesday, May 7, 2008

JavaOne 2008 - May 6th Technical Sessions

With a lot of excitement I went to the first session of my JavaOne 2008 - TS-4992 (Funambol Java Platform, Java ME technology based open-source Messaging Client). What I was looking for from the session was to see how Java ME and messaging work. To learn about its application much more than SMS purposes. Unfortunately, the session turned out to be less about it and more about the product and information that I was really un-interesting to me. In between I walked out expectin to jump into TS-5771 (PHP meets Java - the best of both worlds), but I was not allowed since it was full. Disappointed, I decided to check my mails and do some work.

I hopped into my next session TS-6623 (More "Effective Java") which was totally packed. By the time I got in (given that I am a Sun employee and get the last opportunity to attend a session), the session had already started and Joshua was at the end of his Generics - the wildcard usage and largely concentrated on Enum this year. His session is always thought provoking and to me most of it I get better only after stepping out and reviewing his presentation. My notes for the session are at the bottom.

Had a quick lunch and got back to the Pavilion. Visited couple of booths of which noteworthy was Spring Source where I could not get all the information I needed in what Spring Source is about and will have to revisit.

Took off for a TS-5870 session (JBI and SCA best of both worlds). Again by the time I got in the session was already on and based on the content my understanding was the presenters were from Apache Tuscany and ServiceMix contributors. It was good to see some one putting together the complimentarty technologies which are largely misunderstood to be competitive specs. The presentations was more XML based and I happen to capture some notes below under corresponding TS number section.

My next stop was at TS-5921 (Glassfish v3 - an extensible modular platform). The session was very interesting to know the directions the GF is headed towards and how OSGi is reshaping the technology world. GF v3 is being built upon OSGi while also keeping its HK2 modular framework which was pre-built and going forward would sit on OSGi. Other highlights included the 2MB footprint and lazy initialization of containers eg: web containers are used only when needed. The interesting gap here in was the management of all these modular components. Some notes at available under corresponding TS number section.

The next session was TS-5711(jMonkeyEngine and gaming in Java) which was more out of curiosity. Some notes are available under corresponding TS number section.

After which I got into BOF-5150 (Event Driven SOA in Java using OSGi and Spring). I personally did not find it very interesting since the perspective with which I went for the session was to learn about ED using OSGi and Spring. It so happened the content was more on BEA products. At the point they started talking of JRockit I decided to quit since the subject was very diferent from the presentation. I hopped into BOF-5552 (Java Platform Observability by ByteCode instrumentation). This happened to be very interesting in how you could use bTrace utils annotations to debug code at byte level. Some notes are available under corresponding TS number section.


---TS - 4992 Funambol: JavaME & open src messaging client -----------------------
Funambol SDK - Java ME

NOT WORTH

JSR 75:

toSerialFormat - to set VCard info
fromSerialFormat - to read contact info

SyncML

Push EMail:
SMS and TCP based
ME platform
email on mass market handsets including black berry
Impl:
- Using SMS - app registers with PushTRegistry for incoming SMS
- Using Socket -
- CTP: app manages socket open to CTP server that uses it for sending notifications
- STP: app starts server socket and waits for server notifications
IP natting, proxies
- Socket * STP

------------------------------------------------------------------------------

---- TS - 6623 More Effective Java -----------------------------------------------
Wildcard usage, follow the rule:
PECS: Producer extends, Consumer Super

Dont use wildcard types as return types

1) void pushAll(Collection rc);
void popAll(Collection dst);

void pushAll (Collection src);
src is an E producer
void popAll(Collection dst);

user canpush ALl from a Collection or a Collection onto s Stack
user can popAll into a Collecton or a Coll from a Stack

2)
public statc set union(Set s1, Set s2) -
Both s1 and s2 are E producers
No wildcard tpe for return value
wouldnt make API any more flexible
would force user to deal with wildcard types explicitly
user shold not have to think abt wildcards to use your API

Enum types:
How to implement no of musiciansl

public enum Ensemble {
FIRST SEC THIRD FOURTH FIFTH SEXTH SEPT OCT NOV DEC
public int numberOfMusicians() {
return ordinal + 1;
}

}

Wrong
- maintenance nightmare - somene reorders constants, prg brekas silently
- Cant add multiple constants wih


public enum Ensemble {
SOLO(1) DUET(2) TRIO(3) FOURTH FIFTH SEXTH SEPT OCT NOV DEC

priv final int nofOfmusician

Ensemble(int size) {
return ordinal = size;
}


public int numberOfMusicians() {
return ordinal;
}
}


One way to represent set is Bit Fields
Eg:
public static int ITALIC = 1;
public static int BOLD = 2;


Bit Fields are obsolete

Why not use Bit Fields: (All problems of int constnts and more)
- Not type sfe
- No namespace
- Brittle - constants compled into client
- Printed values are cryptic
- No easy way to iterate elements represented by bt field
- Not scalable: no of constants grows beyond 32, you are toast. Beyong 64 your burnt.

Use EnumSet

public class Text {
public enm Stype {
BOLD, ITALIC, UNDERLINE, STRIKETHROUGH
}
//
public void applyStyles (Set

JavaOne2008 - Oracle General Session

NOTE: As with all my JavaOne 2008 posts, the below are more of notes I tried to capture when attending sessions and if there is something to be added or corrected please feel free.

Using JBuilder display how to create Graphs using exposed services. The bar chart exposes data from the DB. As data changes the graphs get updated. Using excel sheet data is updated into DB and the graph gets updated. The person doing the Demo along with Thomas Kurien is Duncan - a sales executive.

The same GUI is showed on Apple iPhone although it does not show it working on iPhone.

Sales person doing a demo for Oracle contrasts so much to Sun where the Engg manager did the demo yesterday for JavaFX. To me it indicates the importance the two technology companies assign to corresponding divitions - Sun is very Engineering oriented while Oracle is very Sales / revenue oriented.

Enterprise 2.0: by Peter M
An unfulfilled order is highlighted and how to identify why? Identify the order and seamlessly behind a search is executed to identify details on current status and whom to connect. Further details on the hierarchy of people involved and responsible is displayed. All web 2.0 interfaces.

Business Process Orchestration: Kevin
SCA: adapt SCA for composing services
BPEL: orchestration
Human Workflow:
Event processing and Activity Monitoring:
SOA Governance:
The above order undergoes an end-2-end view on its processing. A step by step how the order is processed. New enhancement is the Rules engine for Biz people to enter rules.

There seem to be some functionality that Kevin was trying to show and to me looked to be not working but this would have been unnoticed by most of the folks who are not familiar with such editors given that Kurien continued to engage the audience and Kevin with questions. One again very sales and marketing oriented compared to Sun which believes more in Engineering and tries to show the product as it is.


Managing Hetrogenous system with SOA Order Entry (WebLogic Operation Control - Virtual Edition), Pricing Engine (that calculates the price based on existing stock, orders etc.), Cluster of Oracle Applications and finally a Store Front 0 WebLogic Server.
- Shows how when no of orders coming in are very large, the GUI shows the throughput falling and order delivery getting delayed and an alert stating the no of orders coming in is larger than the capacity.
A demo on JRockit and how it displays all the threads and perf matrix using dashboard widgets etc..
The integration of WebLogic is more of a message that Oracle is sending about its seriousness in getting all WL functionality on board to Oracle's product suite.

All are avalable for download @
Oracle Developer network:
Oracle Fusion preview 4
Eclipse pack
Also IronMan movie ticket free at Oracle booth.

Tuesday, May 6, 2008

JavaOne 2008 - May 6th General Session

John Gage, Chris help James Gosling shoot T-Shirts into the crowd. There are few other folks throwing T-Shirts among the crowd behind.

John, James start off JavaOne by stressing on the importance of energy and environment saving efforts. Show various devices displayed across for JavaOne to meter the audience flowing in and out of any session, devices used to identify the energy consumed in JavaOne etc.

* John invites Rich Green on to stage.
- Rich requests Amazon VP onto the stage to demo Kindle. Talks of how they would like to replace the experience of book with Kindle where you can download, search millions of books, bookmark them etc.. Tries to download JavaBook over the internet and in mean time read WSJ etc.. The download of the book takes longer than expected while he walks off the stage. The complete software is on Java and was built before the device was actually available.

- Sony-Ericsson:
Rich invites Sony-Ericsson Senior VP on to the dias. The 6 yr old company has a business of $19 billion. Presents how they are planning to change the social experience using Sony phones. Hope to have the device released later this year. All applications built on Java.

*Java FX*:
- A demo by Nandini on Java FX:
Connected Life: An application plugged into Facebook page. This app consolidates other social networks and websites such as Flickr, IM into one application. Cool part of this being the app (plugin) can be dragged and dropped on to the desktop. The same can be run on mobile phones. Unfortunately the demo kept crashing and Nandini had to re-initialize the app atleast 3 times before the demo was ended. Rich Green's embarassment was obvious while Nandini engaged everyone with diversion tactics such as slow network and not a best of the vendor engagement statements (only to console herself) that Amazon's Kindle also did not work. Naaaa not too elegant...

- Another demo by <> on JavaFX and media by JavaFX designer. Showed how 2D, texting etc can be built using JavaFX. An application where the app plugs into Flickr and as you type keywords, it searches for photos on Flickr with corresponding tags. Pretty cool indeed as the images enter the app's galaxy like view.
A demo displaying graph of HD videos to select and play the movie. The app plays all the corresponding CODECS.
A demo showing Android simulator, in it the ConnectedLife app mentioned above is run.

*Some stats*:
A staggering 2.2 million devices out there that run Java. 85 % of mobile devices run Java while 91% desktops/laptops run Java.

*Java & JavaFX release schedule*:
Java 6 update 10 preview release.
Java FX Mobile and TV 1.0 Spring 09
Fall 08 FX desktop[ 1.0
Jul 08 FX desktop DSDK EAP

*Enterprise Apps*:
- GlassFish:
98K core kernel
lightweight mobile server
Communications server
Modular Design
Rate of downloads adoption increasing exponentially.

- Project Hydrozine:
Content Creators
Services - find services, merge deploy, share and eventually monetize.
Not mentioned but this runs on the ESB / Java CAPS suite behind.

- Project Insight:
Understand user action - monitoring technology etc..

Around 10.05 am Jonathan was called on to the stage by Rich. Jonathan states his 150,000 ft view on where Sun is gong.
- Java is about empowering individuals.
- To all devices: embedded, consumer devices, RFID devices
- Apps available on browser and out of it.
- Dev can instrument on what they build on what ever they want to build.
- All free available - can travel where ever it can go.
- Neil Young invited by Jonathan.

Niel (www.neilyoung.com/archives):
In 80s you could not bring what you wanted
- Sound: 192 / 24 sound available with BluRay.
- Chronological events over time on the stages he has been through for user to traverse back. Powered by Java technology.
- Partner LA Johnson invited on to the screen - Shaky Pictures.
- Viedo from 1963. All videos from 1963 could navigate through using a File Cabinet.
- An old record player
- Casette, IC player?? and a giant dump into CD (of the data).
- Also displays House in Topanga Canyaon.
- LinkVolt - elimiate gas refuelling, power coming into vehicle Volts used by car.


openeco - companies to monitor power of Sun - monthly billing of utility.


With this General Session ends and we all walk off for sessions and Pavilion.

Update: Fixed the typo in Niel Young URL.
Few more statistics I forgot to add:
MySQL -
Before Sun acquisition: 50000 / day
After Sun acquisition: 65000/day

NetBeans
44% increase Year over Year

Ubuntu shipping Java soon

Thursday, May 1, 2008

Generating revenue - exploring different models to win customers

NOTE: This blog post largely uses software industry as a reference to understand revenue models. All the content here in are not the opinions of corresponding organizations nor is it based on any insider information.

On May 1st, Sun Microsystems released its quarterly earnings which were below expectations. The company returned to quarterly loss after 5 consecutive quarterly profits. Sales in the US were down by 10%. Personally, it wasn't something we, from product division at Sun were expecting. Even as employees continued with their normal daily business, the hot topic of discussion amongst them was the quarterly results combined with the announced reduction in work force. These discussions led to some interesting thoughts which I thought I blog about.

The question we all had was what could be going wrong and what could Sun do to bring in more revenues. This question led us into trying to understand Sun's strategy towards revenue generation and what it believes would bring in more. Most of the major events at Sun are about open sourcing its products - which includes its flagship product Solaris. This raises the question, would OpenSource products ever generate revenue for the company? Could this be the cause for a bad quarter? The answer is - NO, for which we need to understand the relation between OpenSource and revenue generation - the model I believe Sun is hedging its bets on. In today's highly competitive market, companies are doling out software for free and transitioning these costs into services and support fees that the customers are more willing to pay for. Given that customers absolutely require professional services and support to implement the product in their IT division, they end up paying for the product eventually but in the name of services. One advantage here with OpenSource is the customer has an option of taking the risk to go alone which would not be available in the traditional sales model. Anyway, this posting is about analyzing different revenue models and will continue into details later in the post.

'Community brings revenue' seems to be the strategy that few companies including Sun seem to believe in. The traditional model for revenue generation has been Sales. Sun has indeed been very successful in building a community around Java which in turn generates a decent amount of revenues, albeit not as much as BEA or IBM make. The community approach, also called as bottom up approach is a slow process and can be categorized as a long term strategy.

This leads to the thought how the two revenue generating models - traditional sales and Community match up against each other.

One of the most widely employed and proven model is the Top-Down approach where the vendor's sales executives approach targeted customer's management echelons and clinch the deal. Since executives have a good understanding of - historical business trends, current state of business and future directions of the organization added to which is the financial strength, it is largely considered that they are most apt in making the decision. The primary drivers of this model are the Sales people who are highly valued for going out and clinching the deals. From product perspective, based on some of my experiences in the software industry, the product may not be production ready before the Sales team successfully demonstrates a POC to the customer to clinch the deal. Once the deal is clinched, the Engineering team accelerates the development phase for delivery. Typically there is a buffer time available for Engineering before delivering the product. Most of these deals are clinched based on personal rapport built at the customer end. On the flip side of adopting this model is, Sales executives are very competitive and cut throat, especially the ones from large corporations. Your product has to either be a revolutionary, or have a strong reference from internal or external source or have any other un-balancing factor to push the deal through. In an equilibrium situation, where the benefits in one product are balanced by benefits in the other product, the probability of competing and clinching the deal over a large competitor could be very slim.

The other mode of sale is by reference where an existing customer can recommend the same to its friendly or associated companies. This model has been applied heavily in the direct-2-customer approach where products are bought based on good reviews received from friends, family etc.. This model is pretty rampant on the internet where most or all of the online stores have the option to provide feedback and rating of a product. We will undoubtedly see this grow further on the internet with Social networking catching up quickly where the ratings and reviews you receive are from trusted and known sources instead of the unknown. For eg: as a happy owner of Bravia TV, I could recommend the same by post positive reviews on my social network account. To go one step further, the social networks could also have provision to share notes on the product. The major draw back to this approach is its limitations on its application to products that are largely sold directly to end consumer.

The contrarian model to traditional Sales model is the 'Community brings revenue' model - the bottom up approach where the product is given away for free to attract more developers and user for the product. This model has proven to be successful in the software industry especially. Eg: JBoss, RedHat, MySQL etc.. As the user base grows, word spreads faster through blogs, discussion forums and other means resulting in wealth of information being available for every one and eventually leading to increased industry adoption. Here the potential customer's developers recommend to their management the benefits of the product. Management in turn purchases the product and its services resulting in revenues to the product manufacturer. Customer benefis in many ways - free software, open code with more eyes on the source, collaborative effort where customer can participate to make the product better, if the company ever goes belly up, the product is still available with the source & many other benefits. The negative side of this could be - Is the management willing to take what the developers recommend depending on business policies and future directions, business politics, price etc.. How many of these truely translate into revenue for the company? The developers at the customer end may be willing to support the product on their own.

Comparing the Sales and Community models over a period of time, how would the costs and revenues outweigh each other is the big questions. It would be interesting to see a mathematical model that builds a linear expression for the same. Using my wild imagination below is a graph I believe when revenues are plotted over time.

As you may note, the revenues for Sales model flatten or saturate over time while in the community model revenues are slow to come at the begining but over time the revenues increase exponentially. Again the above graph is a wild imagination and I do not have any statistical data while I would be very interested in seeing such statistical data.
Even if the above graph could be true, the challenge of generating or converting community leads to revenues could be daunting and more work is probably required on various strategies that can be employed as part of this model - evangelism, participation in various conventions etc.. I believe Sun is looking towards a long term strategy and will continue to consolidate its operations and product offerings.