Monthly Archives: August 2007

A PHP equivalent of Server.Transfer?

A question from comp.lang.php:

In ASP.NET there is a method called Server.Transfer which transfers the request to a different page from the one that the user requested, but without doing a redirect. The user gets sent headers as though they were seeing the page they requested.

Does PHP have such a function?

No. Server.Transfer is IIS’ way of doing URL rewriting. PHP, being originally developed for Apache, leaves URL rewriting to the HTTP server. So what you need to do is to set up a rewrite rule. If you are using Apache, you already have everything you need for that. If you are using IIS, there are add-on modules that allow you to do URL rewriting. I use ISAPI_Rewrite on one of my development servers:

http://www.isapirewrite.com/

From your later message, I understand you are using WordPress. WordPress’ .htaccess file is not very complicated; it basically boils down to this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

and the above in all likelihood can be ported over to ISAPI_Rewrite.

When did trade begin?

A question from Yahoo! Answers:

When did trade of goods and services begen?

Trade in services predates the existence of the human race; is it often observed in primates. In a family group of monkeys or apes, individuals are much more likely to groom those who have groomed them in the past.

Socialized healthcare?

A question from Yahoo! Answers:

Socialized Health Care?

What will happen if we end up with Socialized Health Care?

Why “end up”? The U.S. already has two “socialized” (the correct term, in my opinion, is “publicly funded”) healthcare systems: Medicare (which is a single-payer system) and the Veterans Administration (which is a direct-provision system). Depending on which route, if any, is chosen to “socialize” healthcare in the U.S., the U.S. healthcare will look either like Medicare or like the VA…

Reducing the cost of living?

A question from Yahoo! Answers:

How can we get the cost of living in the U.S. down to manageable standards?

More and more people are relying on section housing and welfare to make ends meet, and it is only getting worse.

Do we need to reform our welfare system to drive certain taxes and costs down, or is it too late because the jobs available do not pay enough anyways.

Cost of living in and of itself is not important. What is important is the relationship between the cost of living and prevailing level of income. Generally, a more productive way of solving this problem is to concentrate on increasing incomes rather than on lowering the cost of living…

About 70% of all income in the U.S. is earned from employment. The highest-paid occupations are usually ones where the worker controls an expensive piece of machinery (a portal crane, a freight train, an airliner, etc.) So the key to higher incomes is in making sure there is a lot of expensive machinery around (in economics, this is usually referred to as “capital formation”).

Now capital formation is a fascinating phenomenon. It turns out that the primary source of capital formation is… inheritance. People tend to save and invest very little of what they earn, but a lot of what they inherit. So the number of proverbial “good jobs” turns out to depend on how much money has been passed between generations.

Now throw in the ever-increasing longevity and the fact that more and more people outlive their money, and ponder the implications for capital formation…

Was Import Substitution successful in Cuba?

A question from Yahoo! Answers:

Was Import Substitution successful in Cuba?

Import substitution is never successful. There is a reason for the imports to be; a country imports something either because it’s not available domestically, or because imports are cheaper, or because imports are (perceived to be) better than domestically produced goods. Either way, import substitution immediately and adversely impacts either real incomes or perception of lifestyle.

In case of Cuba, import substitution often meant substituting imports from the U.S. with imports from the Eastern Bloc and, more recently, Venezuela.

Economic impact of terrorism (again)

A question from Yahoo! Answers:

How did the semptember 11th attack affect our nation?

Since you are asking this question in the Economics section, you are probably asking about the economic impact. Brace yourself for an answer you probably don’t expect: it’s negligible. Attacks of September 11 did less economic damage than Hurricane Andrew in 1992 or Northridge earthquake in 1994.

In order for terrorism to have a lasting economic effect, it must occur repeatedly over long periods of time. For example, economists Alberto Abadie and Javier Gardeazabal studied the economy of the Basque Country (a region in Spain where terrorists linked to separatist groups committed terrorist acts for almost 20 years) and concluded that the cost of terrorism over 20 years was about 10 percentage points in the cumulative economic growth.

Source:

Alberto Abadie, Javier Gardeazabal, “The Economic Costs of Conflict: A Case-Control Study for the Basque Country”:

http://www.nber.org/papers/W8478

Inventions and timelines

A question from Yahoo! Answers:

What if all our modern inventions had been invented earlier?

For Instance, what if there were an ancient Greek Microsoft selling “The Surface” in 2000 B.C. What do you think we would have today?

Guess what? Quite a few modern inventions were in fact invented earlier. The first steam engine, for example, was built by Hero of Alexandria around 50 AD. But it was thought of as a toy, and a bad one at that; many thought that it was unbecoming of a free Greek to engage in manual labor. Manual labor was for slaves…

The (lack of) brutality in the American Revolution

A question from Yahoo! Answers:

Why did the American Revolution not (generally) sink to bestial levels of brutality?

There were some atrocities committed (by both sides) in the Revolutionary War. But, by comparison with the French Revolution, or certainly with the much later Russian Revolution, atrocities committed by soldiers upon one another or upon civilians appear to have been relatively few in both number and scale. This despite the fact that propagandists such as Paine were spewing out inflammatory tracts that could only be interpreted as incitements to extreme brutality.

So, how was it that conduct between enemies in the Revolutionary War was so comparatively restrained?

Or am I simply wrong in judging it to have been restrained?

Brutality is rarely committed by soldiers or against soldiers; it is usually committed by paramilitary outfits (essentially, either armed civilians or secret police) against unarmed civilians. During the American Revolution, there were virtually no unarmed civilians on the British side. So, once the British army withdrew and the German mercenaries surrendered, there was no one against whom brutality could be committed; even the German mercenaries were eventually granted clemency and allowed to return home or settle in the new nation…

Communism and totalitarianism

A question from Yahoo! Answers:

What is the difference between communism and Totalitarianism?

They are about different things. Communism is mostly about how wealth should be distributed (the government owns all means of production, controls prices and wages, etc.) Totalitarianism is mostly about abuse of political power and oppression of dissidence; the incumbent government aggressively seeks obedience and punishes disobedience. So, while most Communist states were totalitarian to a varying degree (after you gained control of the economy, shutting up those who disagree with you is easy), there were and are plenty of non-Communist totalitarian states (Italy, Germany and Japan before 1945, post-1979 Iran, and the Abacha government in Nigeria come to mind).