Thursday, September 29, 2005

Mike Tyson Vs. Keshto Mukherjee

Yes, thats what Amit Varma has likened has likened the much hyped China Vs. India economic duel and refers to a [column] penned by Shankar Acharya, the chief economic adviser to the Indian govt. Pay special attention to the table.

But, not to worry - the future is indeed colored saffron! James Waterton has made a case against China [here] and for India's cause [here].

Venus has an interesting post [here] on competing oil interests and how their lopsided economic status and differing foreign policies affect their run ins.

Atanu Dey, an economist who runs a fantastic blog on India's development, labels the Indian democracy a cargo cult democracy. To see what he means, go [here] and [here].

This ties in with the table you saw in Shankar Acharya's column that documents India's miserable socio-economic indices. Without carrying the people along, no country can make any progress, atleast progress that can be called progress. Flashy malls, booming IT sector are leaps but eventually they all are drawn back and move on an average with the slowest link - social development. Without progress in education, health care and other primary concerns India's development is largely still on paper. Atanu is bang on target when he writes "Democracy cannot work when the electorate is nearly totally uninformed, where there are strong vested interests, where the notion of accountability is non-existent, where voters can be intimidated and bribed, where the culture is steeped in feudalism, and where illiteracy, superstition and corruption is the norm."

I urge you all to subscribe to Atanu's feed, he writes with clarity, perspective and passion for India's development.

Wednesday, September 28, 2005

Catch 'em, Kill 'em Pt.2 - Kill 'em

After the overwhelming response of all the code warriors out there, I decided to put the answers up. I could have provided alternate answers, but I just chose to provide the ones that the author provided.

the original posts can be found at Michael Howard's Web Log

// Example #1 (code prior to this verifies pszSrc is <= 50 chars) #define MAX (50) char *pszDest = malloc(sizeof(pszSrc)); strncpy(pszDest,pszSrc,MAX); The code is allocating the size of a pointer, 4-bytes on a 32-bit CPU, and then trying to copy 40 bytes.

// Example #2
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX);
If the length of the string pointed to by pszSrc is exactly MAX, then strncpy does NOT null-terminate szDest.

// Example #3
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX);
pszDest[MAX] = '\0';
Oooops - we just whacked element 51, not 50!

// Example #4
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX-1);
strncat(szDest,pszSrc,MAX-1);
The last arg to strncat is not the total length of szDest, it's how much space REMAINS!

// Example #5
char szDest[50];
_snprintf(szDest, strlen(szDest), "%s",szSrc);
szDest hasn't been initialized yet, so strlen(szDest) could return any value!

// Example #6
#define MAX (50)
void func(char *p) {
char szDest[MAX];
strncpy(szDest,p,MAX);
szDest[MAX-1] = '\0';
}
If p == NULL, your app just died!

Tuesday, September 27, 2005

Legal Case Study of iTunes' business model

Ars Technica (In my opinion this is one of the best tech sites out there, top notch and very authoritative) has links to a Harvard Law School legal case study of the iTunes business model. Now, most people who know me also know that I dislike the iTunes store inspite of all its perceived "coolness". I will over the course of the next few days go through the paper and write up my own summary (of course, the underlying premise being that I can understand the legalities). Until then, you can browse through Ars Technica and read the official report and/or the official summary.

Explore the Ars Technica treasure trove of tech articles [here]

The Ars Technica page hosting the report on the Harvard Law School study can be found [here]

The full 100 page study can be found [here] and a summary can be found [here].

teaser -
"The paper looks at a number of interesting issues, including the convergence of copyright and contract, the legal cushioning that props up Digital Rights Management Technologies (e.g., the DMCA), and fair use. The paper begins by outlining how contracts are being used to restrict the normal freedom given to users by copyright law in general. Contract trumps copyright, at least in the United States and Europe, which means the courts will typically arbitrate disputes based on contract and not intellectual property law per se. This is already an interesting development because of what we tend to call the shrink-wrap phenomenon: digital content is being sold in a manner more akin to software than tangible content, although even there, software buyers typically have more rights. One of the biggest legal questions to arise out of the DMCA and DRM-efforts relates to how these technologies conspire to essentially shut down or make exceedingly difficult the right of second sale of protected content.The paper rightly notes that the US and Europe, acting in order to fulfill the demands of the WIPO, are drafting and enforcing laws designed to trump fair use by making it illegal to circumvent DRM. The chain works loosely as follows: copyright is trumped by contractual law, which seeks to restrict fair use in legal terms, which then backs up that by requiring adherence to the rules that are technologically enforced by DRM, which itself is protected by laws such as the DMCA in the US and the EU Copyright Directive in Europe."

Monday, September 26, 2005

Carnival of Computing

Andrew Hughes is running a "Carnival of Computing" theme and has collected loads of very interesting tech blogs to catch up on. Check them out.

Sunday, September 25, 2005

Catch 'em, Kill 'em Pt.1 - Catch 'em

aaaaah yes, the code developers out there - find the bugs in these simple code samples involving just strncat and strncpy (n byte copy and concatenating). Of course, I didn't make up these questions. I shall provide the necessary back track to the source after I provide (his) answers. I got most of them, so that should be very encouraging for all of you. You can close your mouth now (in case its still open with shock that I managed to get even one).

// Example #1 (code prior to this verifies pszSrc is <= 50 chars)
#define MAX (50)
char *pszDest = malloc(sizeof(pszSrc));
strncpy(pszDest,pszSrc,MAX);

// Example #2
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX);

// Example #3
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX);
pszDest[MAX] = '\0';

// Example #4
#define MAX (50)
char szDest[MAX];
strncpy(szDest,pszSrc,MAX-1);
strncat(szDest,pszSrc,MAX-1);

// Example #5
char szDest[50];
_snprintf(szDest, strlen(szDest), "%s",szSrc);

// Example #6
#define MAX (50)
void func(char *p) {
char szDest[MAX];
strncpy(szDest,p,MAX);
szDest[MAX-1] = '\0';
}

What you thought you knew about Economics

Starting a discussion of the supply curve or price elasticity of demand can be a good way to clear out a crowded room. But does tuning out economics come at a cost?

For most Americans, a mandatory high school or college introductory course constitutes the extent of their economic training. However, though we may choose to leave economics alone after we have left the classroom, economic forces don't stop exerting a powerful influence on our daily lives.

The Wall Street Journal Online asked bloggers Russell Roberts, a professor of economics at George Mason University, and William Polley, an economics professor at Western Illinois University, to discuss what the public doesn't know about economics, and whether and how that knowledge gap might hurt.

Here is a link to the discussion titled "Knowledge Deficit"

Russell Roberts is professor of economics at George Mason University and he regularly blogs over at "Cafe Hayek" with his colleague Don Boudreaux.
William Poley is an assistant professor of economics at Western Illinois University. He dishes out economic commentary over at his blog "William J. Polley".

The strange liaison of Sartre and Beauvoir

Who hasn't heard of these two philosophers, thinkers and foremost proponents of existentialism. My brush with them started with reading one of the best psychological profiles of the Marquis de Sade ever written - written by Simone de Beauvoir as an introduction to the (in)famous 120 Days of Sodom. On the other hand, I have only heard and read titbits about Sartre and his philosphy of existentialism. Though I am in the process of learning more about the man and his philosophy through one of this books rather than news clippings, the book whose review I want to take you to is a careful documentary of the platonic relationship the two shared. One can get a view into the minds of these two philosophers/existentialists through their correspondences with each other, correspondences which their individual estates have been kind enough to provide. Some of their libertinous experiences and their candid assessment of their explorations, their contempt of the people who were used as a medium to explore these emotions will shock a few existentialists too.

Read all about it here -

"Stand By Your Man."
by Louis Menand

Monday, September 05, 2005

How stupid can one get?

A man walked into the downtown Bank of America and on the back of a deposit slip wrote, "this iz a stikkup. Put all your muny in this bag." While standing in line, waiting to give his note to the teller, the man began to worry that someone may have seen him write the note and might call the police before he could reach the teller.

So, the criminal left the Bank of America and walked across to the street to Wells Fargo. After waiting in line for several minutes there, he handed his note to a teller. After reading it, the teller determined that this robber was perhaps a few sandwiches short of a picnic.

She told him that because his note was written on a Bank of America deposit slip, she could not honor his demand. He would either have to fill out a Wells Fargo withdrawal slip or go back to the Bank of America.

Feeling defeated, the man said he understood and left. The Wells Fargo teller promptly called the police, who arrested the man a few minutes later--still waiting in line at the Bank of America.

Friday, September 02, 2005

Of Deepak Chopra, tsunami's, New Orleans

[Link] Follow the link to Deepak Chopra's post on the New Orleans tragedy. He makes a lot of comments that I had problems with. I have reproduced his entire post here for convenience along with my comments.

The blog "Intent Blog" is great source for 'food for thought' kind of posts with Deepak Chopra making bulk of the contributions along with many other celebrities such as Shekar kapur, nandita Das, Anil Dash etc. Check it out!

Deepak Chopra says -
New Orleans is a monumental and heart wrenching tragedy which maybe impossible to comprehend and come to terms with.

Our hearts go out to all those that suffer while life goes on as normal for the rest of us. Let us do everything to help those in need in whatever way we can, because the immediate need in the face of a disaster like the New Orleans flood is to offer every form of aid and compassion that can be mustered. But in the back of many people's minds is a lurking apprehension that grows larger every year.

The annual floods in Bangladesh have always seemed far away, as did the torrential monsoon last month in Bombay that crippled the city and killed hundreds. Hurricanes come closer to home, and the destruction wrought by Katrina is almost beyond comprehension, for it occurred with the same fury as the South Asian tsunami. Whole communities have been wiped out of existence, and the prospect of a major American city being under water for weeks or months feels as if Third World calamity, like those faraway Turkish and Iranian earthquakes that kill thousands without causing a ripple in America, has suddenly arrived here.

Both Katrina and the tsunami are forcing us to globalize our thinking under crisis conditions. Instead of approaching global warming positively, we are facing it the hard way, by enduring droughts, floods, and extreme natural disasters in general. No one knows to what extent any of these events is connected to human activity. It seems that global warming is playing its part in the increased force of hurricanes; one cannot find a similar connection to tsunamis, which are more like earthquakes and volcanic eruptions, but devout believers in the Gaia hypothesis have conjectured that perhaps our war against Nature is causing these responses from the planet.

I have no interest in metaphysical explanations here, and I would never join those religionists who will inevitably begin to mutter about God's retribution and premonitions of the End Time. But the fact that we are at war against Nature seems undeniable.

Katrina, we are told, would have been less devastating if local developers had not been destroying the marshlands that protect New Orleans from the fury of storms. But this ecological barrier was deemed unnecessary, and wetlands have been disappearing around the city at a rate of an acre every 24 minutes.

The war against Nature has been launched on many fronts:

--Abolishing native plant species in favor of overplanting the same few crops: wheat, rice, corn, and soybeans.

--Exploiting fossil fuels without regard for their environmental effects.

--Polluting the ocean to the extent that half the world's coral reefs are immediately in danger.

--Diverting and damming rivers without regard to the ecology or human needs downstream.

--Eliminating wild lands and forests by stripping them of all vegetation.

When Thoreau made his famous comment, "In wildness is the preservation of the world," he had no idea of the alarming rate at which human beings would mistake short-term gratification for successful living. The environmental argument has been well addressed in hundreds of places, and perhaps the stridency of ecological alarmists has numbed the public to what's going on, leaving an opening for President Bush and other anti-environmentalists to deliver the reassuring message, "Nothing's wrong. Go back to whatever you were doing."

I think New Orleans will stick indelibly in our national consciousness as stark evidence that the war against Nature has to be ended. The choice is more clear cut than ever, and one only hopes that international cooperation is in the offing, since we are no longer apart from the so-called Third World in enduring intolerable calamity.

My comments are below -

1. we, as you have, extend our heartfelt wishes to the affected families.

2. maybe I didn't catch your drift when you talked about "third world disasters" but it seemed to me that you did so with an air of a "we are a developed nation, we are above all the riff raff and nothing can touch us, better than the best" attitude that makes small of hundreds of people dying elsewhere as it doesn't mean anything to american interests. And now, disaster of such colossal magnitude (as the tsunami) has brought home death and destruction akin to the afflictions of the "third world" and you feel victimized by it? I disagree with the whole tone of your argument - "the prospect of a major American city being under water for weeks or months feels as if Third World calamity, like those faraway Turkish and Iranian earthquakes that kill thousands without causing a ripple in America, has suddenly arrived here.". Your closing argument is more humble but I still find an elitist element to it - "The choice is more clear cut than ever, and one only hopes that international cooperation is in the offing, since we are no longer apart from the so-called Third World in enduring intolerable calamity". I am confused and would like you to explain yourself better. As I said, maybe I misread you here but I would live to have this sorted out.

3. Though I agree with you and note with appreciation the thought that disasters are forcing us to globalize our crisis management, I fail to see the validity/applicability of the sudden inclusion of global warming into your case for war against nature especially when global warming is not the only consequence of unbridled human expansion and exploration.

4. "Instead of approaching global warming positively, we are facing it the hard way, by enduring droughts, floods, and extreme natural disasters in general." By approach positively you must mean corrective measures to counteract eons of our destructive way of life? Even in the case that we go about our lives destroying nature's fabric with impunity, your argument seems to suggest that we are running into hurricanes, earthquakes, tsunamis etc as a matter of choice between being good or face hardships if not. Then you go on to say that you will never take up rank with dooms day religionists (a view that I share) and the rest of your argument seems to suggest that you subscribe to the viewpoint of the Gaia principle though you haven't explicitly sided with that school of thought

5. I second your notion that the general public has been numbed by the continuity of dire predictions by environmentalists and may not fully appreciate our destructive way of life.