Thursday, October 23, 2008

The baby-sitting analogy to understanding the economy.

Many thanks to my buddy Srivatsa Mohan for letting me know about the existence of this article and most definitely to Nobel Laureate Paul Krugman for helping laymen understand the economy better.

Baby Sitting the Economy - By Paul Krugman , Aug. 14, 1998

Twenty years ago I read a story that changed my life. I think about that story often; it helps me to stay calm in the face of crisis, to remain hopeful in times of depression, and to resist the pull of fatalism and pessimism. At this gloomy moment, when Asia's woes seem to threaten the world economy as a whole, the lessons of that inspirational tale are more important than ever.

The story is told in an article titled "Monetary Theory and the Great Capitol Hill Baby-Sitting Co-op Crisis." Joan and Richard Sweeney published it in the Journal of Money, Credit, and Banking in 1978. I've used their story in two of my books, Peddling Prosperity and The Accidental Theorist, but it bears retelling, this time with an Asian twist.

The Sweeneys tell the story of--you guessed it--a baby-sitting co-op, one to which they belonged in the early 1970s. Such co-ops are quite common: A group of people (in this case about 150 young couples with congressional connections) agrees to baby-sit for one another, obviating the need for cash payments to adolescents. It's a mutually beneficial arrangement: A couple that already has children around may find that watching another couple's kids for an evening is not that much of an additional burden, certainly compared with the benefit of receiving the same service some other evening. But there must be a system for making sure each couple does its fair share.

The Capitol Hill co-op adopted one fairly natural solution. It issued scrip--pieces of paper equivalent to one hour of baby-sitting time. Baby sitters would receive the appropriate number of coupons directly from the baby sittees. This made the system self-enforcing: Over time, each couple would automatically do as much baby-sitting as it received in return. As long as the people were reliable--and these young professionals certainly were--what could go wrong?

Well, it turned out that there was a small technical problem. Think about the coupon holdings of a typical couple. During periods when it had few occasions to go out, a couple would probably try to build up a reserve--then run that reserve down when the occasions arose. There would be an averaging out of these demands. One couple would be going out when another was staying at home. But since many couples would be holding reserves of coupons at any given time, the co-op needed to have a fairly large amount of scrip in circulation.

Now what happened in the Sweeneys' co-op was that, for complicated reasons involving the collection and use of dues (paid in scrip), the number of coupons in circulation became quite low. As a result, most couples were anxious to add to their reserves by baby-sitting, reluctant to run them down by going out. But one couple's decision to go out was another's chance to baby-sit; so it became difficult to earn coupons. Knowing this, couples became even more reluctant to use their reserves except on special occasions, reducing baby-sitting opportunities still further.

In short, the co-op had fallen into a recession.

Since most of the co-op's members were lawyers, it was difficult to convince them the problem was monetary. They tried to legislate recovery--passing a rule requiring each couple to go out at least twice a month. But eventually the economists prevailed. More coupons were issued, couples became more willing to go out, opportunities to baby-sit multiplied, and everyone was happy. Eventually, of course, the co-op issued too much scrip, leading to different problems ...

If you think this is a silly story, a waste of your time, shame on you. What the Capitol Hill Baby-Sitting Co-op experienced was a real recession. Its story tells you more about what economic slumps are and why they happen than you will get from reading 500 pages of William Greider and a year's worth of Wall Street Journal editorials. And if you are willing to really wrap your mind around the co-op's story, to play with it and draw out its implications, it will change the way you think about the world.

For example, suppose that the U.S. stock market was to crash, threatening to undermine consumer confidence. Would this inevitably mean a disastrous recession? Think of it this way: When consumer confidence declines, it is as if, for some reason, the typical member of the co-op had become less willing to go out, more anxious to accumulate coupons for a rainy day. This could indeed lead to a slump--but need not if the management were alert and responded by simply issuing more coupons. That is exactly what our head coupon issuer Alan Greenspan did in 1987--and what I believe he would do again. So as I said at the beginning, the story of the baby-sitting co-op helps me to remain calm in the face of crisis.

Or suppose Greenspan did not respond quickly enough and that the economy did indeed fall into a slump. Don't panic. Even if the head coupon issuer has fallen temporarily behind the curve, he can still ordinarily turn the situation around by issuing more coupons--that is, with a vigorous monetary expansion like the ones that ended the recessions of 1981-82 and 1990-91. So as I said, the story of the baby-sitting co-op helps me remain hopeful in times of depression.

Above all, the story of the co-op tells you that economic slumps are not punishments for our sins, pains that we are fated to suffer. The Capitol Hill co-op did not get into trouble because its members were bad, inefficient baby sitters; its troubles did not reveal the fundamental flaws of "Capitol Hill values" or "crony baby-sittingism." It had a technical problem--too many people chasing too little scrip--which could be, and was, solved with a little clear thinking. And so, as I said, the co-op's story helps me to resist the pull of fatalism and pessimism.

But if it's all so easy, how can a large part of the world be in the mess it's in? How, for example, can Japan be stuck in a seemingly intractable slump--one that it does not seem able to get out of simply by printing coupons? Well, if we extend the co-op's story a little bit, it is not hard to generate something that looks a lot like Japan's problems--and to see the outline of a solution.

First, we have to imagine a co-op the members of which realized there was an unnecessary inconvenience in their system. There would be occasions when a couple found itself needing to go out several times in a row, which would cause it to run out of coupons--and therefore be unable to get its babies sat--even though it was entirely willing to do lots of compensatory baby-sitting at a later date. To resolve this problem, the co-op allowed members to borrow extra coupons from the management in times of need--repaying with the coupons received from subsequent baby-sitting. To prevent members from abusing this privilege, however, the management would probably need to impose some penalty--requiring borrowers to repay more coupons than they borrowed.

Under this new system, couples would hold smaller reserves of coupons than before, knowing they could borrow more if necessary. The co-op's officers would, however, have acquired a new tool of management. If members of the co-op reported it was easy to find baby sitters and hard to find opportunities to baby-sit, the terms under which members could borrow coupons could be made more favorable, encouraging more people to go out. If baby sitters were scarce, those terms could be worsened, encouraging people to go out less.

In other words, this more sophisticated co-op would have a central bank that could stimulate a depressed economy by reducing the interest rate and cool off an overheated one by raising it.

But what about Japan--where the economy slumps despite interest rates having fallen almost to zero? Has the baby-sitting metaphor finally found a situation it cannot handle?

Well, imagine there is a seasonality in the demand and supply for baby-sitting. During the winter, when it's cold and dark, couples don't want to go out much but are quite willing to stay home and look after other people's children--thereby accumulating points they can use on balmy summer evenings. If this seasonality isn't too pronounced, the co-op could still keep the supply and demand for baby-sitting in balance by charging low interest rates in the winter months, higher rates in the summer. But suppose that the seasonality is very strong indeed. Then in the winter, even at a zero interest rate, there will be more couples seeking opportunities to baby-sit than there are couples going out, which will mean that baby-sitting opportunities will be hard to find, which means that couples seeking to build up reserves for summer fun will be even less willing to use those points in the winter, meaning even fewer opportunities to baby-sit ... and the co-op will slide into a recession even at a zero interest rate.

And this is the winter of Japan's discontent. Perhaps because of its aging population, perhaps also because of a general nervousness about the future, the Japanese public does not appear willing to spend enough to use the economy's capacity, even at a zero interest rate. Japan, say the economists, has fallen into the dread "liquidity trap." Well, what you have just read is an infantile explanation of what a liquidity trap is and how it can happen. And once you understand that this is what has gone wrong, the answer to Japan's problems is, of course, quite obvious.

So the story of the baby-sitting co-op is not a mere amusement. If people would only take it seriously--if they could only understand that when great economic issues are at stake, whimsical parables are not a waste of time but the key to enlightenment--it is a story that could save the world.

Wednesday, October 22, 2008

All your base are belong to us

I cannot imagine my blog without a post about an internet phenomenon during the early years of this decade. This was sometime during the year 2001 when a Japanese video game made by Sega was translated into English language (Zero Wing) , in a rather hasty manner. It led to several spoofs and parodies and still garners interest among quite a few internet users. This iconic cut-scene from the game is often regarded as the height of English language butchery.

The original cut scene from the game :



Transcript:
In A.D. 2101
War was beginning.
Captain: What happen ?
Mechanic: Somebody set up us the bomb.
Operator: We get signal.
Captain: What !
Operator: Main screen turn on.
Captain: It's you !!
CATS: How are you gentlemen !!
CATS: All your base are belong to us.
CATS: You are on the way to destruction.
Captain: What you say !!
CATS: You have no chance to survive make your time.
CATS: Ha ha ha ha ....
Operator: Captain !! *
Captain: Take off every 'ZIG'!!
Captain: You know what you doing.
Captain: Move 'ZIG'.
Captain: For great justice.

If Sega had hired translators rather than make their Japanese geeks translate , the non-literal translation would've been so :

AD 2101―
A battle has begun.
Captain: Tell me what happened!
Engineer: It seems someone installed explosives unnoticed.
Communication operator: Captain! Receiving transmission!
Captain: What?
Communication operator: Visual incoming on the main screen.
Captain: Identify yourself!
CATS: (You) Look busy, gentlemen.
CATS: Assisted by the Federation Government forces, CATS have taken over your base completely.
CATS: Your ship is about to meet its doom as well.
Captain: This is absurd!
CATS: Thank you for your cooperation.
CATS: Cherish these few remaining moments of your lives.
CATS: Ha ha ha ha ha...
Communication operator: Captain....
Captain: (I) Order launching all ZIG units!!
Captain: Entrusting them is the only option left....
Captain: The hope of our future...
Captain: (We're) Counting on you, ZIG!!

And now , The parodies :)





Some more text spoofs :

AYBABTU in Invasion of Normandy

In A.D. 1944
War was ending.
Adolf Hitler: Vat happen ?
Heinrich Himmler: Somebody set up us the D-Day
Joseph Goebbels: Ve get allies.
Hitler: Vat !
Goebbels: Main screen turn on.
Hitler: It's you !!
Harry Truman: How are you nazis !!
Truman: All your Normandy are belong to U.S.
Truman: You are on the way to invasion.
Hitler: Vat you say !!
Truman: You have no chance to fight back make suicide.
Truman: Ha Ha Ha Ha ....
Goebbels: Fürher !!
Hitler: Take every cyanide pill.
Hitler: I know vat I döing.
Hitler: Svallow pill.
Hitler: Für great suicide.

AYB Are Belong to the Blair Witch

In A.D. 1994
Film was beginning.
Heather: What happen?
Michael: Somebody set up us the horror.
Joshua: We get chilling ritualistic figures.
Heather: What?
Joshua: Main camera start rolling.
Heather: It's you!
Blair Witch: How are you filmmakers.
Blair Witch: All your camera are belong to us.
Blair Witch: You are on the way to disappearing.
Heather: What you say!!
Blair Witch: You have no chance to survive make your time.
Blair Witch: Ha ha ha ha...
Joshua: Heather!
Heather: Take off every compass.
Heather: You know what you doing.
Heather: Move compass.
Heather: For great documentary.

Tuesday, October 21, 2008

Where has all the money gone?

Trillions in stock market value -- gone. Trillions in retirement savings -- gone. A huge chunk of the money you paid for your house, the money you're saving for college, the money your boss needs to make payroll -- gone, gone, gone.

Whether you're a stock broker or Joe Six-Pack, if you have a 401(k), a mutual fund or a college savings plan, tumbling stock markets and sagging home prices mean you've lost a whole lot of the money that was right there on your account statements just a few months ago.

But if you no longer have that money, who does? The fat cats on Wall Street? Some oil baron in Saudi Arabia? The government of China?

If you're looking to track down your missing money -- figure out who has it now, maybe ask to have it back -- you might be disappointed to learn that is was never really money in the first place.

Robert Shiller, an economist at Yale, puts it bluntly: The notion that you lose a pile of money whenever the stock market tanks is a "fallacy." He says the price of a stock has never been the same thing as money -- it's simply the "best guess" of what the stock is worth.

"It's in people's minds," Shiller explains. "We're just recording a measure of what people think the stock market is worth. What the people who are willing to trade today -- who are very, very few people -- are actually trading at. So we're just extrapolating that and thinking, well, maybe that's what everyone thinks it's worth." Shiller uses the example of an appraiser who values a house at $350,000, a week after saying it was worth $400,000.

"In a sense, $50,000 just disappeared when he said that," he said. "But it's all in the mind." Though something, of course, is disappearing as markets and real estate values tumble. Even if a share of stock you own isn't a wad of bills in your wallet, even if the value of your home isn't something you can redeem at will, surely you can lose potential money -- that is, the money that would be yours to spend if you sold your house or emptied out your mutual funds right now.

And if you're a few months away from retirement, or hoping to sell your house and buy a smaller one to help pay for your kid's college tuition, this "potential money" is something you're counting on to get by. For people who need cash and need it now, this is as real as money gets, whether or not it meets the technical definition of the word.

Still, you run into trouble when you think of that potential money as being the same thing as the cash in your purse or your checking account.

"That's a big mistake," says Dale Jorgenson, an economics professor at Harvard.

There's a key distinction here: While the money in your pocket is unlikely to just vanish into thin air, the money you could have had, if only you'd sold your house or drained your stock-heavy mutual funds a year ago, most certainly can.

"You can't enjoy the benefits of your 401(k) if it's disappeared," Jorgenson explains. "If you had it all in financial stocks and they've all gone down by 80 percent -- sorry! That is a permanent loss because those folks aren't coming back. We're gonna have a huge shrinkage in the financial sector."

There was a time when nobody had to wonder what happened to the money they used to have. Until paper money was developed in China around the ninth century, money was something solid that had actual value -- like a gold coin that was worth whatever that amount of gold was worth, according to Douglas Mudd, curator of the American Numismatic Association's Money Museum in Denver.

Back then, if the money you once had was suddenly gone, there was a simple reason -- you spent it, someone stole it, you dropped it in a field somewhere, or maybe a tornado or some other disaster struck wherever you last put it down.

But these days, a lot of things that have monetary value can't be held in your hand.

If you choose, you can pour most of your money into stocks and track their value in real time on a computer screen, confident that you'll get good money for them when you decide to sell. And you won't be alone -- staring at millions of computer screens are other investors who share your confidence that the value of their portfolios will hold up.

But that collective confidence, Jorgenson says, is gone. And when confidence is drained out of a financial system, a lot of investors will decide to sell at any price, and a big chunk of that money you thought your investments were worth simply goes away.

If you once thought your investment portfolio was as good as a suitcase full of twenties, you might suddenly suspect that it's not.

In the process, of course, you're losing wealth. But does that mean someone else must be gaining it? Does the world have some fixed amount of wealth that shifts between people, nations and institutions with the ebb and flow of the economy?

Jorgenson says no -- the amount of wealth in the world "simply decreases in a situation like this." And he cautions against assuming that your investment losses mean a gain for someone else -- like wealthy stock speculators who try to make money by betting that the market will drop.

"Those folks in general have been losing their shirts at a prodigious rate," he said. "They took a big risk and now they're suffering from the consequences."

"Of course, they had a great life, as long as it lasted."

This article is from here.

Thursday, October 16, 2008

mallu special : hotel keralafonia



On the road to Trivandrum
Coconut oil in my hair
Warm smell of avial
Rising up through the air
Up ahead in the distance
I saw a pink tube-light
My tummy rumbled, I felt weak and thin
I had to stop for a bite
There he stood in the doorway
Flicked his mundu in style
And I was thinking to myself
I don't like the look of his smile
Then he lit up a petromax
Muttering "No power today"
More Mallus down the corridor
I thought I heard them say
Welcome to the Hotel Kerala-fonia
Such a lousy place,
Such a lousy place,
Such a sad disgrace,
Plenty of bugs at the Hotel Kerala-fonia
Any time of year
Any time of year (background)
It's infested here
It's infested here
His finger's stuck up his nostril
He's got a big, thick mustache
He makes an ugly noise - *ugly noise*
But that's just his laugh
Buxom girls clad in pavada
Eating banana chips
Some roll their eyes, and
Some roll their hips
I said to the manager
My room's full of mice
He said,
Don't worry, saar,I sending you
Meen karri, brandy and ice
And still those voices were crying from far away
Wake you up in the middle of the night
Just to hear them pray
Save us from the Hotel Kerala-fonia
What a lousy place,
What a lousy place (background)
Such a sad disgrace
Trying to live at the Hotel Kerala-fonia
It is no surprise
It is no surprise
That it swarms with flies

The blind man was pouring
Stale sambar on rice
And he said
We are all just actors here
In Silk Smitha-disguise
And in the dining chamber
We gathered for the feast
We stab it with our steely knives
But we just can't cut that beef
Last thing I remember
I was writhing on the floor
That cockroach in my appam-stew was the culprit,
I am sure
Relax, said the watchman
Just this enema will make you well
And his friends laughed as they held me down
God's Own Country? Oh, Hell!

- the Yeagles

Wednesday, October 8, 2008

My Quote :D

"Test cricket is for Gentlemen , ODI is for Men and T20 is for Madmen." - Anand S , Circa 2008

Sunday, October 5, 2008

Help the world.

This article is from here.

Project 10100



Why this project?

Never in history have so many people had so much information, so many tools at their disposal, so many ways of making good ideas come to life. Yet at the same time, so many people, of all walks of life, could use so much help, in both little ways and big.

In the midst of this, new studies are reinforcing the simple wisdom that beyond a certain very basic level of material wealth, the only thing that increases individual happiness over time is helping other people.

In other words, helping helps everybody, helper and helped alike.

The question is: what would help? And help most?

At Google, we don't believe we have the answers, but we do believe the answers are out there. Maybe in a lab, or a company, or a university -- but maybe not.

Maybe the answer that helps somebody is in your head, in something you've observed, some notion that you've been fiddling with, some small connection you've noticed, some old thing you have seen with new eyes.

If you have an idea that you believe would help somebody, we want to hear about it. We're looking for ideas that help as many people as possible, in any way, and we're committing the funding to launch them. You can submit your ideas and help vote on ideas from others. Final idea selections will be made by an advisory board.

The categories :

  • Community: How can we help connect people, build communities and protect unique cultures?
  • Opportunity: How can we help people better provide for themselves and their families?
  • Energy: How can we help move the world toward safe, clean, inexpensive energy?
  • Environment: How can we help promote a cleaner and more sustainable global ecosystem?
  • Health: How can we help individuals lead longer, healthier lives?
  • Education: How can we help more people get more access to better education?
  • Shelter: How can we help ensure that everyone has a safe place to live?
  • Everything else: Sometimes the best ideas don't fit into any category at all.

Submission Deadline:
October 20th, 2008

Good luck, and may those who help the most win.

Thursday, September 25, 2008

Setting an example - "Hello World" , "99 bottles of beer" is here.

I've been terribly lazy , I've not posted anything o'er here in a long time and i badly want to write some crap :P , so.. here goes

"Hello World" , "99 bottles of beer" is here.

People who have been trained or have been training others in computer languages would definitely have come across this very famous sentence in the study material they use - the "Hello World" . A very simple sentence , but unmistakably the most popular example that is used to introduce people to a computer language.
As you read this... there might be several hundreds of budding programmers out there , typing this line and marking their foray into the world of programming. But how popular is this?

If the helloworld site is to be believed , there are 409 computer language versions ( actual code for all those is available on the site) of the most popular example program. Now , that is almost all the computer languages man has ever created.

A couple of them caught my attention :

1) the longest possible coding for a simple , single lined output

The RedCode Version (alias- the redneck version):

; Should work with any MARS >= ICWS-86
; with 128x64 gfx core
Start MOV 0,2455
MOV 0,2458
MOV 0,2459
MOV 0,2459
MOV 0,2459
MOV 0,2459
MOV 0,2459
MOV 0,2460
MOV 0,2465
MOV 0,2471
MOV 0,2471
MOV 0,2471
MOV 0,2479
MOV 0,2482
MOV 0,2484
MOV 0,2484
MOV 0,2484
MOV 0,2486
MOV 0,2486
MOV 0,2486
MOV 0,2486
MOV 0,2488
MOV 0,2493
MOV 0,2493
MOV 0,2493
MOV 0,2493
MOV 0,2497
MOV 0,2556
MOV 0,2559
MOV 0,2560
MOV 0,2565
MOV 0,2570
MOV 0,2575
MOV 0,2578
MOV 0,2585
MOV 0,2588
MOV 0,2589
MOV 0,2592
MOV 0,2593
MOV 0,2596
MOV 0,2597
MOV 0,2603
MOV 0,2605
MOV 0,2608
MOV 0,2667
MOV 0,2670
MOV 0,2671
MOV 0,2676
MOV 0,2681
MOV 0,2686
MOV 0,2689
MOV 0,2696
MOV 0,2699
MOV 0,2700
MOV 0,2703
MOV 0,2704
MOV 0,2707
MOV 0,2708
MOV 0,2714
MOV 0,2716
MOV 0,2719
MOV 0,2778
MOV 0,2778
MOV 0,2778
MOV 0,2778
MOV 0,2778
MOV 0,2779
MOV 0,2779
MOV 0,2779
MOV 0,2782
MOV 0,2787
MOV 0,2792
MOV 0,2795
MOV 0,2802
MOV 0,2805
MOV 0,2806
MOV 0,2809
MOV 0,2810
MOV 0,2810
MOV 0,2810
MOV 0,2810
MOV 0,2812
MOV 0,2818
MOV 0,2820
MOV 0,2823
MOV 0,2882
MOV 0,2885
MOV 0,2886
MOV 0,2891
MOV 0,2896
MOV 0,2901
MOV 0,2904
MOV 0,2911
MOV 0,2912
MOV 0,2913
MOV 0,2914
MOV 0,2917
MOV 0,2918
MOV 0,2919
MOV 0,2922
MOV 0,2928
MOV 0,2930
MOV 0,2933
MOV 0,2992
MOV 0,2995
MOV 0,2996
MOV 0,3001
MOV 0,3006
MOV 0,3011
MOV 0,3014
MOV 0,3021
MOV 0,3022
MOV 0,3023
MOV 0,3024
MOV 0,3027
MOV 0,3028
MOV 0,3030
MOV 0,3032
MOV 0,3038
MOV 0,3040
MOV 0,3103
MOV 0,3106
MOV 0,3107
MOV 0,3107
MOV 0,3107
MOV 0,3107
MOV 0,3107
MOV 0,3108
MOV 0,3108
MOV 0,3108
MOV 0,3108
MOV 0,3108
MOV 0,3109
MOV 0,3109
MOV 0,3109
MOV 0,3109
MOV 0,3109
MOV 0,3111
MOV 0,3111
MOV 0,3111
MOV 0,3120
MOV 0,3121
MOV 0,3124
MOV 0,3124
MOV 0,3124
MOV 0,3126
MOV 0,3129
MOV 0,3130
MOV 0,3130
MOV 0,3130
MOV 0,3130
MOV 0,3130
MOV 0,3131
MOV 0,3131
MOV 0,3131
MOV 0,3131
MOV 0,3135
JMP 0

(Imagine having to program with this assembly language . Guaranteed to give any sane geek the creeps. )

And 2) The shortest code :

The APL version (alias - the K.I.S.S version. All hail the APL) :

'Hello, world!'

//thats it folks , as simple as that!!

However , there seems to be another example .. which is a bit advanced than the "hello world". Its called "99 bottles of beer".

It happens to be a song that kids sing .

WTF?.... why in the world didnt i know about that song?

What might be the reasons I missed the song?

These might have been the reactions when the proposition to include the song in our computer syllabus at school had come up.

"BEER SONG FOR KIDS ?? :O Kids shouldnt sing about beer , definitely not my kid.. that is blasphemy, thats anti-social , thats totally unacceptable behavior. " - my parents.

"blah blah blah blah .. BEER is evil. It makes you the satan's slave and also blah blah blah" - my neighbor.

"Singing/Coding the song makes you feel like you want to drink beer. This is a scientific conclusion" - NCERT / CBSE / TN State Board.

Anyway .. I doubt whether that song wouldnt have made it to our text books. Here is the lyrics :

"99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

97 bottles of beer on the wall, 97 bottles of beer.
Take one down and pass it around, 96 bottles of beer on the wall.

.
.
.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall."

Now , why is this an advanced example? This example can be used to demonstrate the printing statement syntax, a loop control , a branching statement and the ill-effects of beer on your heads. Psychotic geeks-in-the-making can be identified if he/she makes the above output a continuous , infinite loop , virtually implying infinite beer .

Apparently , this example has more takers than the lame "Hello World". According to 99 bottles of beer dot net there are 1229 representations of the beer song in different languages and their variants.

My 4 line C program :P

main()
{
int i;
for (i=99;i>=2;printf("%d bottles of beer on the wall, %d bottles of beer.\n Take one down and pass it around,%d bottles of beer on the wall.\n",i,i,i-1),i--);
printf("1 bottle of beer on the wall, 1 bottle of beer.\n Take one down and pass it around,no more bottles of beer on the wall.\n");
printf("No more bottles of beer on the wall, no more bottles of beer.\n Go to the store and buy some more,99 bottles of beer on the wall.\n");
}

Got a better code for the problem above ? Post it on the comments.

When I went thro the lyrics.. I had two questions in my mind ..

1) Were the kids made to sing all the way from number 99 to 0 beer bottles? If the answer is "YES" , that answers my question " Why is that almost everyone in the West drink beer? "

2)What would be the RedCode version of this program ? :O :D (Am sure I'd go retarded if I tried coding the same in RedCode.)

Monday, June 23, 2008

project euler

Greetings !

I finally decided to put in more commitment to solve problems listed in project Euler. You can use almost any language to work out the problems or if you are the kind who believe computers are idiot boxes (which they are :P ) .. you can use a pen and paper approach to solve problems :)
I do know that answers to the problems already exist out there on the web and a simple google search would fetch you answers. I am more interested in alternate solutions to the one that i'd come up with because 1) i am a terribly lazy programmer and my memory and time utilization is terrible 2) there is always a better solution :D

For those who haven't heard of project Euler , visit : http://projecteuler.net/

If you have a passion for programming and dont know how to kill time , this is your way out of boredom ;)

Saturday, June 21, 2008

And i'm back!! .. i guess :P

Its been 2 months since i came here and lot has happened in in that time .. and i was thinking on what should i put the blame on , for my absence from blog-o-sphere.. and quite a few things popped up , starting with

1) the project finals

2) the final exams of my not-so-smooth engineering education

Phew ! finally.

3) manoranjan ka baap

I thought of adding another post on the blog-o-sphere during the series.. but then, i am lazy. So ..

4) Football season

I watch football once in a blue moon . Its not because i dont like to watch it.. its just that i am a miser and i wait for free telecast of the paid channels on TV .. hehehe.. and the SCV morons thought they could make me pay for watching good football.

5) wandering aimlessly in the city

The above sentence says it all.

6) getting totally hooked onto "mafia" the game

I have missed this game so much . I had played this at my good friend's place long ago and i had ever since wanted to play it and only recently did i revamp my ol' comp. She was a good gal , a sweetheart and she was with me for the past 7 and a half years.Nothing much could be done to her.. her peripherals were failing one by one. May her circuits rest in peace ;(

"In ever loving memory of my beloved PC"
(January 2001 - June 2008)
Intel Pentium III,800 Mhz,Intel 810e chipset
384 MB SDRAM , Ethernet/USB 2.0 compatible (add ons)

7) addiction to mmorpgs: mafiaboss and mafiarise ( too much of mafia in my life)

8) project euler

9) listening to Don Vito Corelone's Words of wisdom and his tie-up with MTV :P

I think that list is enough for starters.

Wednesday, April 9, 2008

How To pick A Worthy CS Research Topic In 10 Seconds !!

Computer Science is facing a major roadblock to further research. The problem is most evident with students, but afflicts many researchers as well: people simply have a tough time inventing research topics that sound sufficiently profound and exciting. Many PhD students waste needless years simply coming up with a thesis topic. And researchers often resort to reading documents from government grant agencies so they will know what to work on for the next proposal!

Good news for the CS community: the problem has at last been solved. The table below provides the answer.

Column 1                 Column 2                            Column 3

integrated               mobile                                 network
parallel                     functional                           preprocessor
virtual                      programmable                    compiler
interactive               distributed                          system
responsive               logical                                   interface
synchronized          digital                                    protocol
balanced                  concurrent                           architecture
virtual                     knowledge-based                 database
meta-level              multimedia                           algorithm
optimized                binary                                   toolkit
active                       object-oriented                   display
parameterized        secure                                   technology
conceptual               high-speed                           solution
scalable                    real-time                              language
dynamic                   functional                             agent
high-level                parallelizing                          theorem prover
collaborative           watermarking                      work cluster
type-safe                 proxy                                     cache

To generate a technical phrase, randomly choose one item from each column. For example, selecting synchronized from column 1, secure from column 2, and protocol from column 3 produces:

A synchronized secure protocol


Best of all, two phrases can be combined with simple connectives, making the result suitable for the most demanding use. Possible connectives include:

for
related to
derived from
applied to
embedded in

For example, one could generate a thesis title by selecting a second phrase and a connective:

A synchronized secure protocol for an interactive knowledge-based system

The technique described here for selecting a research topic is far superior to the method currently in use because it can be automated -- a computer program can be written to select a phrase at random whenever one is needed. Furthermore, thanks to an enchancement by Ian Stark at The University of Edinburgh in Scotland, it is possible to automate an additional step in the research process by performing an automated literature search. Try the system by first generating a random topic and then performing an automated literature search.

This article's original location : http://www.cs.purdue.edu/homes/dec/essay.topic.generator.html
Follow the above link for a JScript implementation.
The above mentioned page is maintained by his highness - Douglas E Comer :)

Tuesday, April 1, 2008

A psycho-analysis of spiders on crack.



Starts off in the lines of a standard wildlife documentary .. turns out to be more interesting than those ;)

Friday, March 21, 2008

For the utterly jobless (3) - Watch insane videos on YouTube

Hello !! Welcome to the third edition of "For the Utterly Jobless" . I hope that you've wasted your time reading the other 2 editions of FTUJ :D . This one features some unbelievably stupid clips from commercial movies which went down the drain ,enacted by a "leading artiste" of the South Indian Film industry. Such clips provide really good pass time for the utterly jobless souls.

*STATUATORY WARNING* Please donot try these at home .Parental guidance is highly recommended :P

Open heart surgery with mobile phones:

This clip shows the latest advancements in heart surgery , demonstrated by Vijaykanth (who will be referred to as Capt. from now on) . Capt. demonstrates that mobile phones can be used for more than just yakking with another person. See how the powerful light emitted from the phone's screen helps the quacks er.. doctors to perform the surgery.



The next clip shows paranormal physics , superbly demonstrated by Capt. The baddie points a pistol (fake) at our hero , who pays no heed to the baddie's threat and keeps walking , gets shot and no, it doesnt end with that.. amazingly, our Captain survives and the bullet ricochets back to the baddie ,killing him instantly. Our modest superhero Capt. then reveals his secret that saved him - a plate stolen from a nearby hotel, which he then flings away with style. Capt. thus makes a fool out of Stephanie Kwolek.



This amazing clip shows that even Bill Gates or any other geek at microsoft have no clue that the software named Windows Media Player has mutated. Our Supergeek/Superhero Capt. makes the best use of this mutation to type in commands and lo and behold - WiMP becomes an interactive software thus clearly showing that it has a mind of its own. Screw you Billy.



This next video shows Capt.'s electrifying performance as he beats the crap out of electricity. The baddie approaches menacingly towards Capt., brandishing two electrodes , which donot blow the fuse even when it's repeatedly shorted by the baddie. He then places the two ends on the cheap helmet which our Capt., is forcibly made to wear. And to everybody's surprise , instead of limping in his chair , Capt. starts reeling out his award-winning dialogue (shown in the subtitle).

Wicked Cool Java - The JScience API

JScience is a hardcore Math-Science library which provides a wide range of methods and datatypes related to Measurement (Converters , Quantities , Units) , Economics , Geography (Co-Ordinates) , Mathematics (Functions ,Numbers,Structures,Vector) and Physics.It provides data types to store numbers with a very high precision. Classes such as the LargeInteger can hold numbers of immutable sizes with arbitrary precision.

Though they may sound similar to the BigDecimal class provided in the java.lang.Number class , the org.jscience.mathematics.number.Number.LargeInteger has the following advantages:

* It is optimized for 64 bits architectures. But still runs significantly faster on 32 bits processors.
* Real-time compliance for improved performance and predictability (no garbage generated when executing in StackContext).
* Improved algorithms (e.g. Concurrent Karabutsa multiplication in O(nLog^3) instead of O(n^2).

Links :

API List -> http://jscience.org/api/index.html

Source Code -> http://jscience.org/jscience-4.3.1-src.zip

Download Library -> http://jscience.org/jscience-4.3.1-bin.zip

If you find it useful, say thanks to the Project Owner - Jean-Marie Dautelle

JScience is powered by the Javolution library (for real-time/fast performance, parallel computing etc.)

The library is open-source (BSD License). Everyone can participate by submitting new modules as long as those modules are integrated with existing modules.

I'd like to end this post with a video of a mechanical calculator for simple binary arithmetic operations :)

Tuesday, March 18, 2008

For the utterly jobless (2) - Uncyclopedia

Are you tired of playing CS 24x7 and wanna take a break?

Are you tired of working like a slave in your office and wanna blow your boss's brains off?

Are you feeling lonely because none of your messenger buddies are online?

Or.. are you plain bored of everything being normal?

Yes people .. the remedy for all this and more is here --- UNCYCLOPEDIA ---

Uncyclopedia
1) What is it ?
Ans : It is the ultimate parody of the ultimate nerd site called wikipedia.

2) What stuff does it contain?
Ans: The most sarcastic , slanderous , humorous , sexist , 1337 stuff eva!

3) Quick.. Dont keep nagging and gimme the link
Ans: www.uncyclopedia.org

The home page is loaded with totally insane articles .. a hint of things to come.

Start with the "Today's featured article" and check out the UnNews .. where every bit of information is falsified to parodical levels. Make additions to the "On this day" section and move on to the "did you know" and "featured picture" and try your best to make it to the "noob of the month" hall of fame :P Search for articles of your interest using UnCyclopedia's search tool.

*Statuatory Warning* : Articles are totally insensitive and may even be racist, but guaranteed to be hillarious.

And yeah.. dont forget to read the quotes by Uncyclopedia's gay mascot - the homosexual Oscar Wilde.

Check out Uncyclopedia's "SISTA Projects"

UnNews - The news source on crack
Undictionary - The ick!tionary of all things best left unsaid
UnTunes - Where noisy things can live and prosper
The Uncyclopedia Store - Buy unnecessary items to support Uncyclomedia
UnMeta - How Uncyclopedia doesn't work
UnBooks -Content-free books
Unquotable - Useless misquotes galore
Uncycloversity - If it makes sense, we don't want it

Yes people .. this edition of "For the utterly jobless" needs advanced technical knowledge of "switching on a computer". This makes it even more complicated and challenging than the game of "pen fight" . Anyway .. take up the challenge and i hope that everybody who reads this succeeds in being Totally Jobless , no matter where you are from or what you do for a living.

Guess Who's Back!!

It's been a week since i came online .. i had a great week in Goa with a bunch of totally bindaas people from SVCE. But no.. this post is not about ME getting back from wonderland. This is about a person ,whom i've never met before , never thanked for his kindness , a hero to thousands of leechers and yes .. the ultimate enemy of the bastards - MPAA . If you've been downloading movies illegally , you need no further introduction to the one and only .. king of movie torrents - AXXO.

Often imitated but never replicated , AXXO has established himself as the Demi-God of piracy. With his 700-MB-A-Movie rips , he has captured both the hearts and bandwidths of several thousand people , worldwide.

He has uploaded as many as 399 movies (as on 10-11-2007) . I guess he got pretty tired after uploading all those .. and he decided to take a break from his philanthropic-self and went into hibernation for 3 months. The MPAA leaped in joy as he made public his decision to take a break.

the torrent-world was plunged into darkness,
for her knight in shining armor had retired.
and MPAA guffawed with all its might,
for , the hero of the masses had disappeared in the night.
And then started the reign of his duplicates
who tried a lot to use his name ;but in vain .
And one nearly managed to overthrow the king .
Klaxxon was his name.
He grew and built up his fame.
but wrong did he .
by releasing rips sized more than one cd.
But now the king has returned,
to vanquish the evil and kill the beast,
the beast that was named MPAA.

(Damn.. i had a poet in me all along :P )

Anyway.. here is the link to his torrents

Mininova.org --> http://www.mininova.org/user/aXXo
Torrent Box --> http://www.torrentbox.com/account-details.php?id=277561

Please use ONLY the two links above to get hold of his torrents , both the old and the new ones. All other sites are bogus and are full of crap.

Happy leeching :D and yes .. please dont forget to upload after downloading. Dont be selfish.

Saturday, March 8, 2008

Interesting Caricatures

Mahabharatha - the re-run :P


Indian cricket , auctioned off :

(D)Evolution of cricket?

Lalloo , Putting a smile on aam admi's visage.
Laloo , P.C , PM and Sonia
Fidel Castro :)

Wednesday, March 5, 2008

Adieu , Gilly :(

The Cb Series victory was a remarkable feat by the young Indian squad. It was a day of joy and endless cheer for the Indian team.. but the day also marked the end of the road for Adam Gilchrist - the finest wicketkeeper-batsman that Cricket has ever produced. His aggressive game play and the agility that he demonstrated on the field has helped him to achieve unprecedented standards in the game. It is indeed a pity that he was on the field for only a few minutes in his last ODI appearance.


He has proclaimed himself to be a "walker" - ("to walk" is a term in cricket which means that a batsman ought to agree that he has been dismissed and leave the field of play without waiting for (or contrary to) an umpire's decision - an unparalled act of honesty that he has done on numerous ocassions. He might have been involved in a few controversies .. something very normal for an Australian cricketer :P but his game play has overshadowed all of these and he has made sure that it is his game play and not the controversies that people would remember him for :)


I'd like to end this post with these images











Monday, March 3, 2008

For the utterly jobless (1) - Pen Fight

Yes.. the name says it all.. the battle of the.. ermm.. pens (there is no spelling mistake there !)

Highly recommended for the totally jobless characters ... in the classroom , at office ..practically anywhere!

Equipment required : A table , preferrably 2x1.5 ft , pens - as required.

How to play :

1) There are two variants of the game.. a) The team game variant (max 2 teams/3 members a team) (b) The Every-man-for-himself variant.

2) If you are playing the singles match.. make sure your pens arent too close to your opponent's .
If you are playing the team variant.. choose a side of the table for a team.

3) All the players must have their pens on the table , perpendicular to the edge from which they are starting.

4) Players take turns in a clockwise manner to shoot their pen into the centre of the arena (the table :P ) . Care must be taken not to overshoot the table's boundary.

5) Players can use their pen to strike the opponent's pen using the Carrom - style striking action.
STRICTLY no pushing the pen or dragging it around or switching hands during a strike. The aim of the strike is to send the opponent's pen out of the playing area.

6) May the last person standing win. If atleast one member of a team is still standing at the end.. his/her team is the winner !

7) Matches are comprised of 10 games each.

Scoring Schemes (Singles Match)
(i) For every opponent you manage to knock out , add 5 points to your score
(ii) If an attempt to knock out an opponent results in a) either you flying off the table b)both you and the opponent are knocked out of the arena , then .. no one gets any points.
(iii) 1 point will be awarded to the player who is last - i.e has ot been knocked out of the arena by the opponents.

This game eventhough seems to be dumb.. requires a lot of concentration , judgement and practical knowledge of dynamics :D

Enjoy as you worthlessly spend your time pitting your pen against others and celebrating well deserved victories :)

Snaps of a group of utterly jobless people playing this game :


The initial position





Few seconds into a commenced game.





A "pen-fighter" analysing the next move to strategically crush his opponents .. He looks calm on the outside ..but in reality .. a storm is brewing in his head. Calculations pertaining to kinetics and dynamics are flowing thro his veins , assisting this would-be conqueror to reign supreme .. on the table :P


Beat the pen fighter's pose all you anands , fischers and topalovs :P