Tuesday, September 16, 2008

Nightmare on Wall St - Failures of Lehman, Merryl, AIG, WaMu....

In The Simpsons Movie, when Bart Simpson, utterly embarrassed by a situation, moans - "This is the worst day of my life!", his father replies - "This is the worst day of your life, SO FAR". The same could be said about the happenings in the last week of the US Financial sector.

What a week it was. just when you were thinking that the worst was over, the financial sector keeps hitting new lows. Couple of months back Bear Sterns was taken over by JP Morgan in a Shotgun wedding arranged by The Fed. Markets were a bit stable, and now it spread like wildfire in the last week. These are a couple of things which went bad in the financial sector in the last week.

- Freddie Mac & Fannic Mae were nationalized
- Lehman Brothers stock in free fall resulting in its declaring Chapter 11 bankruptcy
- Merryl Lynch bought over by Bank of America, after a free fall in its stock
- AIG group stock going down, resulting in its "restructuring"
- Washington Mutual (WaMu) Bank's stock tumbling
- Wachovia Bank's stock nose diving

So now out of the big Five wall street investment firms, only two - Goldman Sachs & JP Morgan were left standing. This extreme uncertainty in the financial sector trashed the DowJones, making it face the worst percentage fall in 6 years.

The ticking timebomb here is that the investment firms make a lot of trades with one another. Since there are a very few big firms taking up both sides of most of the trades, the trades suffer from counterparty risk. i.e. if you make a trade which realized a profit on the books, but the counterparty to the trade cannot pay up since it went bankrupt, then you lose too since you wont be seeing any real money from them. Now that Lehman has gone down, all the trades done with it need to be unwound, or a loss taken. When these losses start appearing on the books of other investment firms, they too will start taking a hit.

Lehman's is the biggest bankruptcy filing ever with $639 billion in assets. So there are bound to be repercussions everywhere in the financial sector. UK regulators have already asked firms to declare their exposure to Lehman. Citi group looks like it has a serious exposure to Lehman, which if it did, would seriously undermine its current precarious position.

Already there is a talk of a further rate cut by the Fed, which, at current inflation levels, can only be bad.

So is the rock bottom hit? is this the worst? I cant help thinking of the answer given to Bart Simpson...

Sunday, September 14, 2008

Continue Browsing during Power failures

Power cuts (or load shedding, black outs, or however you want to call them) are very frequent and frustrating here in hyderabad. Other times we face the low voltage situations (also called the brownout). In such cases I would be able to continue using my laptop (given that its a 9 cell Thinkpad), but lets face it - Very little work of value (or timepass, as my friends like to call it) gets done without the INTERNET! It is even more frustrating when you tend to work from home, and you are cutoff due to power loss and have to rush to office.

The best way to beat this situation is to bring out the old UPS you used for your old desktop. Even if u never had a UPS, you can buy a cheap one for less than Rs 1500/-. Once you connect your modem and wireless router through the UPS, you will get a backup of almost 2 hours straight. However if you are using Sify or other ISPs which given you a direct ethernet cable to your house you might be out of luck, since the local hub at your operator will lose power. This was one more reason for me to switch from Sify Broadband to Airtel, other than Sify's pathetic customer care and reliability issues (15 days of no internet in a month makes you go crazy!).

Also, if you are watching a movie with friends and power goes out, you can connect the speaker set to the UPS, to get the enhanced volume. Or in emergencies you can charge your cell phone on it too.

Converting AVI/MPG to 3GP files in Linux

The best way to convert an AVI/MPG video file to 3GP (like for viewing them on your cellphone) is to use the opensource program - ffmpeg. The ffmpeg was also the starting point for the most famous movie player for linux - the mplayer suite.

To start using ffmpeg, First download the latest ffmpeg source code. Run configure on it using the following command line, followed by a make and make install.
./configure --enable-nonfree --enable-gpl --enable-libamr-wb --enable-libamr-nb
--enable-libmp3lame
If you do not have the libamr-wb and libamr-nb codecs installed, download the following packages - amr-nb-7.0.0.2 and amr-wb-7.0.0.3 - and configure, compile and install them. The description of these packages is given in detail here.

NOTE that if you have FFmpeg installed, you need to make sure that you see both --enable-libamr-wb and --enable-libamr-nb in the configuration. You can check the configuration of ffmpeg by running ffmpeg > /dev/null.

Then run the following command to convert the AVI/MPG files to 3GP
ffmpeg -i inputfile.mpg -s 176x144 -b 300k -r 10   -ar 8000 -ab 12.2k 
-ac 1 -f 3gp -aspect 4:3 outputfile.3gp
Upload to your cell, and it will help you get over lots of boring times :)

Monday, September 8, 2008

End of Credit Crisis in Sight - Freddie Mac & Fannie Mae nationalized

The Credit crisis which has roiled the markets for over 2 years is now hopefully nearing an End with the near-nationalization of the US Secondary Mortgage Market Majors - Freddie Mac and Fannie Mae, yesterday. This action has fed a lot more confidence into the credit markets reeling from the subprime crisis.

The US mortgage market is structured in such a way that, you have the primary lenders (banks like Wells Fargo etc) who make loans to individuals for the purpose of housing. However, these mortgages run into hundreds of thousands of dollars. So a normal lender can only give so many mortgages, before his cash flow is completely stuck in these extremely long-term (upto 30 year long) loans. So to add more liquidity to such a market, the US Govt established the Freddie Mac in c1970, which would buy the loans (at its discretion) from these primary lenders. Having got back their initial capital, the primary lenders can provide other people loans. Freddie Mac in turn pooled and securitized (oversimplification:bundled) these loans and sold the resulting securities to investors in various organizations. Freddie Mac, guaranteed the rate of interest on these securities and hence assumed the credit risk, for which it charged a fee. Essentially, this means that any non-payment of mortgage by a person, will be made good by Freddie Mac. Fannie Mae is also essentially similar, except for its beginnings. Between themselves, these organizations own over 50% of all home loans in the US.

Technically these organizations were supposed to be Government Sponsored Enterprises, but essentially private corporations owned by stock holders, without any Govt insurance for their loans. However, due to their size and presumed US Govt backing, they had acquired the tag of "Too big to fail", as in, if they fail, they would drag down the economy with them. This caused them to take up riskier mortgages from the primary lenders. At last count, Both Freddie and Fannie had over $12 Trillion exposure to the mortgage market.

Now that the Subprime crisis has precipitated a downturn in the US housing market, this downturn has resulted in a lot of mortgage defaults (although Freddie Mac does not buy subprime loans), which caused Freddie & Fannie to declare losses of nearly $15 billion last year. This has led to their credit rating dropping to Junk status, forcing the premium on loans to them (bonds) going over 2.5%, making it very difficult for them to raise much needed new capital.

To alleviate the crisis, the US Congress in July passed a law, with bi-partisan support, allowing the US Govt to step in and bail out these corporations if required. This was supposed to give confidence to potential lenders that their loans to Freddie would not go bad (thereby reducing the risk and hence premiums on the bonds). But this action backfired badly, since people know that any such nationalization would wipe out Freddie's stock value. This caused its share price to plummet to less than $5. This precipitated a crisis, forcing the Govt to act immediately and nationalize them both. As expected, Freddie Mac shares dropped to less than 25 cents.

So now the US taxpayers are "bailing" out these corporations. The impact of the bailout is not completely known, and is supposed to be in tens of billions of dollars, if not hundreds of billions. This will also cause tighter regulation in the housing markets, with people having even prime credit ratings facing difficulty to make a mortgage. The US treasury bills have also dropped.

On the brighter side, however, markets are very optimistic over the measure since the credit markets will now be more liquid, stock of various banks which gave loans to Freddie (like Citi Group) have gone up a lot, the premiums have also dropped on mortgages. The last one will once again hopefully rejuvenate the housing sector, which makes up over 25% of the US economy. So overall the housing sector can recover from the glut of unsold inventory, and once again start growing. These will also help to reduce the effects of the current recession the US economy is undergoing.

Saturday, September 6, 2008

MPlayer - Overcoming in-built low volumes of media files

Many times, the AVI files of movies end up with a very low audio volume causing a lot of pain for use with laptop speakers (esp like ThinkPad), which do not have a very wide range of volumes like headphones or traditional speakers. To overcome this issue, many media players provide an option to increase the volume more than 100% (upto 400% in case of VLC Media player).

After googling and RTFMing for a while I figured out that the way to do this in MPlayer is to use a software volume mixer instead of the soundcard's mixer. You can run mplayer with the following additional options
mplayer -softvol -softvol-max 400 

The 400 indicates that you want to increase the output by upto 400% of the base volume indicated in the media file.

This link has more information on using an audio filter instead of using a software volume mixer to do the same. Happy movie watching!!

Wednesday, September 3, 2008

Ripping DVDs into AVI files

Ripping DVDs in Linux using mencoder is tricky business. No doubt mencoder is the most powerful tool at your disposal with a wide variety of options to convert practically from any format to any format. This in turn also becomes its disadvantage - there are too many options, which an ordinary user cannot understand. There were nearly a 1000 options out there, with a variety of combinations between them, most of which keep taking about stuff like deinterlacing, quantization and key frames.

After trying a number of times to rip DVDs unsuccessfully in Linux, I recently struck gold, while googling, in a discussion forum on how to do this correctly. This is the command that worked flawlessly for me
/usr/bin/mencoder -vf harddup -vf-add 
smartblur=.6:-.5:0,unsharp=l5x5:.8:c5x5:.4
-vf scale=480:360 -xvidencopts
bitrate=900:profile=dxnhtntsc -lameopts
cbr:br=128:aq=0:vol=1 -oac mp3lame
-ovc xvid -o outfile.avi *.vob

The scale= could be used to set the new size of the AVI file. Lesser sizes will result in lesser space. The bitrate= also controls the quality of the movie generated, and is inversely related to the size of the generated AVI file.

Download the mencoder (located in the mplayer package) from some default distribution (I used yum to get it), so that most of the required options are compiled in.

Tuesday, September 2, 2008

Google Chrome - A New Era


Recently I heard about this new browser from Google called Google Chrome, which will be available in (Surprise! Surprise!) Beta version. The Google guys, true to the innovative streak, made a comic, justifying yet another entry into the world of browsers, already filled up with heavy weights like IE, firefox etc. However after going through the feature list, I was realized that this was not just another browser. It's design was more closer technically to an Operating System, than to a browser.

There is a fundamental paradigm shift happening here. The browser is the new Operating System. We have already seen a ton of web applications, like Spreadsheet, presentation apps etc, most of which were thought to be almost impossible to run in a browser.

Microsoft with its Windows, is entrenched in the Desktop OS market. I do not see any operating system which can challenge its dominance there. But Google has, instead of taking it head-on, is completely circumventing the Operating System, making it as just another commodity. More than 20 years ago, IBM thought that hardware was the key and the operating system did not matter too much. Microsoft came and commoditized the underlying hardware, and things were never the same again.

I see the same thing happening now, with Google commoditizing the Operating System market. Beyond a point, people will stop caring about what OS their machine is running anymore than people now care about what BIOS their machine is running. (Just to complete the analogy, IBM made the mistake of not doing an exclusive license of DOS, which sealed its fate. Microsoft's mistake happened almost 9 years ago with the introduction of the XMLHttpRequest)

A New Era has begun. If Google can pull off this browser thing decently, then history will definitely repeat itself.