Monthly Archives: November 2007

Dollar depreciation, inflation, and welfare

A question from Yahoo! Answers:

Should we start calling the United States dollar the United States Peso if it keeps going down in value?

Does anyone think gas is going up or is it that your dollar is just worth less in this Welfare/ Warfare state?
(inflation tax)

You are confusing dollar depreciation with inflation… While both concerns are valid, they have to be treated separately.

Depreciation of the dollar is not necessarily a bad thing. It will lead to reduced trade deficit and increase in employment in export-oriented and import-competing industries. In 1985-87, the dollar depreciated about 50% against both the yen and the mark, and the U.S. economy continued to hum along nicely.

Inflation tax does in fact exist, but it is much smaller than income tax and way smaller than payroll taxes.

As to welfare and warfare, the U.S. definitely needs less warfare and more welfare. Suffice it to say that the U.S. is the only advanced nation without universal heathcare and has one of the worst primary and secondary educational systems in the industrialized world…

Original poster’s reply:

more welfare?
welfare sometimes can create lazy criminals.
take away someones self respect by giving welfare and suffer the consequences of their future behavior.

Yes, more welfare (in broad terms), including universal health coverage and a reform of the public school system.

There’s absolutely no evidence that welfare creates lazy criminals. What does create lazy criminals, however, is restricting teenagers’ access to abortion. Legalizing abortion usually leads to a visible drop in crime in 16-18 years. Criminalizing abortion, conversely, leads to increase in crime in 16-18 years.

As to taking away people’s self-respect, health insurance companies do it every day by denying medically necessary treatments to people they insure, and very few people seem to care…

The effects of depreciating dollar

A question from Yahoo! Answers:

What do you think are the effects of the depreciation of USD?

it would really help me if you have statistics to prove your statement…! you think it is helping to reduce the US trade deficit and did it cause inflation? This is for my Econ project and i’m kinda lost.

Domestically, there will be next to no visible effect. In 2006, imports accounted for about 18% of U.S. GDP (see the BEA national income data); on average, one percentage point increase in import (meaning, wholesale) prices leads to about 0.4 percentage point increase in the final consumer price (see Campa and Goldberg). So even if the U.S. dollar loses, say, 30% of its value, the additional inflation caused by it will be about (30% * 18% * 0.4) = 2.2%. Note that this would probably happen over a period of time greater than one year, so this 2.2% increase in price level will be spread over that entire period and annualized contribution to inflation will be smaller. Now throw in the likely increase in employment in export-oriented and import-competing industries…

As to reducing the trade deficit, this is already happening. As Paul Krugman recently put it,

Over the past year real exports are up about 10 percent, a lot faster than overall growth, while real imports are up only about 2 percent, slower than overall growth; all this is presumably the effect of the weak dollar, and there’s probably a lot more to come. Overall, the improving trade picture added about 1 percent to the economy’s growth rate, which is modest but significant.

So all in all, as a result of the declining dollar, the U.S. would probably have a small gain in economic growth at the expense of slightly higher inflation…

You should probably read up on the effects of the last dollar collapse, the one that happened in 1985-87…

Running PHP on IIS 7

From comp.lang.php:

I’m trying to set up my first Vista/IIS7 box with PHP5 — in IIS7 I mapped the current php5isapi.dll.

I’ve noticed that if I simply open a PHP page (it works), when the IIS application pool later recycles (either timed or forced), I get an “IIS Worker Process has stopped working” alert, and a “Faulting application w3wp.exe” event in the Event Viewer.

Is there a way to fix that? (Other folks seem to have the same problem, but I can’t seem to find a solution.)

Is *anybody* here running IIS7/PHP without this problem? Alterntively, do others here have the same problem?

Same poster 26 hours later:

I think I found it…

if I open:
IIS Manager > DefautAppPool > Advanced Settings

and change:
Process Model > Identity

from NetworkService to SpecificUser

and enter my credentials in:
Identity SpecificUser Credentials

The problem stops

I wonder is running the CGI/FastCGI interpreter will run into the same problems as those of the ISAPI filter described above… Speaking of FastCGI, IIS.Net has a fairly detailed tutorial on configuring PHP as FastCGI on IIS 5.1 and 6.0. Chances are, most of it is applicable to IIS 7 as well…

Simple string validation with PHP

A question from Yahoo! Answers:

I have googled, forummed, read the manual and I am still unable to accomplish or properly understand form validation.

I use dreamweaver, php4 and mysql. My site depends on user input, mostly text.
I want to validate the input as text plus punctuation only, input to database or redirect to original form page with error messages.
I am having trouble making even the simplest validation using preg_match and simple regex to perform as expected, even when using a form and error page to practise.

For simple validation, you do not necessarily need regular expressions. Try this:

function isValid ($string) {
  $allowed = 'string containing all allowed characters';
  $n = strlen($string);
  for ($i = 0; $i < $n; $i++) {
  if (strpos($allowed, $string{$i}) === false) {
      return false;
    } else {
  return true;

This is a simple function that would return TRUE if all characters in $string are found in $allowed and FALSE otherwise.

You can also slightly modify this function by making $allowed a second argument:

function isValid ($string, $allowed) {
  $n = strlen($string);
  for ($i = 0; $i < $n; $i++) {
  if (strpos($allowed, $string{$i}) === false) {
      return false;
    } else {
  return true;

The advantage of doing so is that you can validate different things. For example, to validate an integer, you can call:

isValid ($toBeValidated, '1234567890')

To validate an alphanumeric string with punctuation, you can call something like this:

isValid ($toBeValidated, '1234567890' .
                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
                         'abcdefghijklmnopqrstuvwxyz' .
                         ' .,!?-;:()')

Obviously, you can expand the list of punctuation marks if you so choose…

Validating a floating-point number, however, may be problematic. You can call

isValid ($toBeValidated, '1234567890.')

but it will not guard against multiple instances of decimal point occurring in $toBeValidated, so you may need to check for it separately.

Choosing a Wi-Fi card

A question from Yahoo! Answers:

What wifi LAN card is compatible with my ASUS A9Rp notebook pc?

I have an ASUS A9rp-5A096 notebook pc and much to my surprise, it doesn’t have a built-in wifi! What wifi LAN card should i buy for my notevook pc???

You are asking the wrong question. It is not compatibility with your hardware you should worry about. You need to check for compatibility with your OPERATING SYSTEM and your WIRELESS ROUTER (or gateway, as the case may be). First, look for your operating system’s logo on the Wi-Fi card packaging. Then, see if the Wi-Fi card supports at least one communication protocol your router provides (so far, there are three — 802.11b, 802.11g, and 802.11n — and every router supports at least one; information about protocol(s) supported is usually labeled onto the router’s back or bottom panel).

What should you buy? It’s up to you, really. There is a considerable variety of Wi-Fi devices out there; some are connected via a USB port, others, via a PCMCIA slot. Personally, I like PCMCIA cards better and prefer Netgear brand, but it’s just a personal preference… If you choose a USB device, make sure that your computer supports the minimum required version of the USB protocol (some older computers out there still have USB 1.x, which may not work all that well with a device requiring USB 2.0).

Pastoral setting in Renaissance literature

A question from Yahoo! Answers:

What is the appeal of the pastoral setting in renaissance literature…?

What other setting could be more appealing to a Renaissance person? There were only two settings to choose from, pastoral and urban. Renaissance cities were full of filth and disease, so city dwellers (including writers) looked to the countryside as an aesthetically attractive (although impracticable for most) alternative to city life.

Is terrorism an economic problem?

A question from Yahoo! Answers:

Why we cannot wipe out terrorsim from the world through globalization and economic cooperation?

Rich countries should help poor ones through economic cooperation & educational upliftment of children especially women which will eventually wipe out terrorism

Terrorism is far from a purely economic phenomenon. Back in 1970s and 1980s, “home-grown” terrorist groups existed in many affluent nations (Red Brigades in Italy, Red Army Faction in Germany, or Action Directe in France come to mind). Red Brigades, for example, committed thousands of violent acts, including the kidnapping and murder of Italian prime minister Aldo Moro. Many terrorists were and are well-educated (many 9/11 attackers had engineering degrees, the most recent string of bombings in Britain was perpetrated by a group including several doctors), so “educational upliftment” doesn’t seem to be the answer.

What we know about terrorists seems to indicate that they are disenfranchised from the society in which they live. Whether they choose to express it by joining a radical left-wing group, a radical right-wing group, or a radical Muslim group is completely unimportant (the disenfranchised would join any group that seeks them out). Statistically, the most likely cause of this disenfranchisement is parental neglect suffered between ages two and six (consider Osama bin Laden, who was one of 55 or so half-siblings born from 22 different mothers, but at no time did the old Mr. bin Laden have more than four wives, so the wives had to jockey for position to ensure a comfortable future for themselves and their children; a poster child for parental neglect, wouldn’t you say?)

The roots of terrorism (and almost any other antisocial behavior) lie in the family, not in the economy…

Is China’s currency really undervalued?

A question from Yahoo! Answers:

China’s currency is artificially cheap because they control the exchange rate. Why can’t the U.S. do the same

What is good for the goose is good for the gander. Could the U.S. make the yuan only worth 5 or 7 yuan?

Your basic premise is wrong. China’s currency may actually be artificially expensive.

Two currencies are at a fair value relative to each other when their respective economies are in external equilibrium (exports are approximately equal to imports) AND in internal equilibrium (unemployment is at a non-inflation accelerating level). You seem to be basing your reasoning on external equilibrium alone, while completely ignoring the internal equilibrium. China has an enormous frictional unemployment (every year, enough people move from countryside to cities to populate a city the size of Houston), so all things considered, its currency may well be overvalued.

Also, consider this. China consistently has a higher inflation compared to the U.S., yet the yuan is not losing its value relative to the dollar, which is a sign of the currency value kept artificially high (sort of like the Argentinian peso during the currency board period).

Does geography matter in international trade?

A question from Yahoo! Answers:

Does geography matter in international trade?

You can make a case for either yes or no answer. On the one hand, a disproportionately large amount of international trade happens within one region, Europe, so geography must matter. On the other hand, China trades with the faraway U.S. as willingly as with the nearby Japan, so geography must not matter all that much…

A theoretically sound answer, though, would go something like this. Geography imposes transportation costs, so it matters (hence, the European countries, located close to each other and having a great transportation infrastructure, heavily trading with each other). But in many cases, the comparative advantage is large enough to cover the cost of transportation to virtually any location in the world (hence, China heavily trading with both U.S. and Japan).

This said, you might consider the fact that geography is not a very significant trade barrier compared to tariffs and non-tariff barriers erected by governments…

Technological unemployment?

A question from Yahoo! Answers:

What is technological unemployment? Is this a problem in today’s society? Explain.?

Technological unemployment is what supposedly happens when technology makes workers redundant. For example, the advent of electricity put out of work a lot of candlemakers; the invention of automobile had a similar effect on workers involved in horse breeding and making carriages, riding accessories, and other horse-related products.

Is it a problem in today’s society? Yes and no. It is definitely a problem for the workers (and business owners) whose skills (and investments) become obsolete, so they have to find a new way of making a living, which is never an easy thing, especially if you are over 40. The number of individuals affected, however, tends to be relatively small, so the society as a whole rarely notices, especially since technologies that create technological unemployment in the declining industries also create technological employment in rapidly expanding industries.