2010年9月25日星期六

But the revelations of widespread prisoner abuse

Wal-Mart priced it at $2.97--a year's supply of pickles for less than $3! "They were using it as a 'statement' item," says Pat Hunn, who calls himself the "mad scientist" of Vlasic's gallon jar. "Wal-Mart was putting it before consumers, saying, This represents what Wal-Mart's about. You can buy a stinkin' gallon of pickles for $2.97. And it's the nation's number-one brand."

Therein lies the basic conundrum of doing business with the world's largest retailer. By selling a gallon of kosher dills for less than most grocers sell a quart, Wal-Mart may have provided a ser-vice for its customers. But what did it do for Vlasic? The pickle maker had spent decades convincing customers that they should pay a premium for its brand. Now Wal-Mart was practically giving them away. And the fevered buying spree that resulted distorted every aspect of Vlasic's operations, from farm field to factory to financial statement.

Indeed, as Vlasic discovered, the real story of Wal-Mart, the story that never gets told, is the story of the pressure the biggest retailer relentlessly applies to its suppliers in the name of bringing us "every day low prices." It's the story of what that pressure does to the companies Wal-Mart does business with, to U.S. manufacturing, and to the economy as a whole. That story can be found floating in a gallon jar of pickles at Wal-Mart.

The existence and locations of the facilities -- referred to as "black sites" in classified White House, CIA, Justice Department and congressional documents -- are known to only a handful of officials in the United States and, usually, only to the president and a few top intelligence officers in each host country.

The CIA and the White House, citing national security concerns and the value of the program, have dissuaded Congress from demanding that the agency answer questions in open testimony about the conditions under which captives are held. Virtually nothing is known about who is kept in the facilities, what interrogation methods are employed with them, or how decisions are made about whether they should be detained or for how long.

While the Defense Department has produced volumes of public reports and testimony about its detention practices and rules after the abuse scandals at Iraq's Abu Ghraib prison and at Guantanamo Bay, the CIA has not even acknowledged the existence of its black sites. To do so, say officials familiar with the program, could open the U.S. government to legal challenges, particularly in foreign courts, and increase the risk of political condemnation at home and abroad.

But the revelations of widespread prisoner abuse in Afghanistan and Iraq by the U.S. military -- which operates under published rules and transparent oversight of Congress -- have increased concern among lawmakers, foreign governments and human rights groups about the opaque CIA system. Those concerns escalated last month, when Vice President Cheney and CIA Director Porter J. Goss asked Congress to exempt CIA employees from legislation already endorsed by 90 senators that would bar cruel and degrading treatment of any prisoner in U.S. custody.

The entertainment system was belting out the Beatles' "We Can Work It Out" when the phone rang. When Pete answered, his phone turned the sound down by sending a message to all the other local devices that had a volume control. His sister, Lucy, was on the line from the doctor's office: "Mom needs to see a specialist and then has to have

a series of physical therapy sessions. Biweekly or something. I'm going to have my agent set up the appointments." Pete immediately agreed to share the chauffeuring.

So the core problem is how do we assemble

So you've got a web page. You’ve marked it up with structural XHTML. You’ve also been a good little web developer and used style sheets to control what your document looks like. You’ve even gone the extra mile and created several alternative style sheets to show how hardcore you are.

Great. But now you need a cross-browser way to dynamically switch between the style sheets.

Styling your site
Style sheets can be associated with documents using a list of link elements in the head. There are three different relationships external style sheets can have with the document: persistent, preferred, and alternate.

Persistent
These style sheets are always enabled (they are always “on”) and are combined with the active style sheet. They can be used for shared rules common to every style sheet. To make a style sheet persistent, the rel attribute is set to “stylesheet” and no title attribute is set.

To make the style sheet paul.css persistent, the following link element would be included in the head:
Figure 1 shows the dependencies for this situation. The MovieLister class is dependent on both the MovieFinder interface and upon the implementation. We would prefer it if it were only dependent on the interface, but then how do we make an instance to work with?

In my book P of EAA, we described this situation as a Plugin. The implementation class for the finder isn't linked into the program at compile time, since I don't know what my friends are going to use. Instead we want my lister to work with any implementation, and for that implementation to be plugged in at some later point, out of my hands. The problem is how can I make that link so that my lister class is ignorant of the implementation class, but can still talk to an instance to do its work.

Expanding this into a real system, we might have dozens of such services and components. In each case we can abstract our use of these components by talking to them through an interface (and using an adapter if the component isn't designed with an interface in mind). But if we wish to deploy this system in different ways, we need to use plugins to handle the interaction with these services so we can use different implementations in different deployments.

So the core problem is how do we assemble these plugins into an application? This is one of the main problems that this new breed of lightweight containers face, and universally they all do it using Inversion of Control.

Where the Articles are down at the bottom of

The name of the implementation class comes from the fact that I'm getting my list from a colon delimited text file. I'll spare you the details, after all the point is just that there's some implementation.

Now if I'm using this class for just myself, this is all fine and dandy. But what happens when my friends are overwhelmed by a desire for this wonderful functionality and would like a copy of my program? If they also store their movie listings in a colon delimited text file called "movies1.txt" then everything is wonderful. If they have a different name for their movies file, then it's easy to put the name of the file in a properties file. But what if they have a completely different form of storing their movie listing: a SQL database, an XML file, a web service,

Steve Dobbins has been bearing the brunt of that switch. He's president and CEO of Carolina Mills, a 75-year-old North Carolina company that supplies thread, yarn, and textile finishing to apparel makers--half of which supply Wal-Mart. Carolina Mills grew steadily until 2000. But in the past three years, as its customers have gone either overseas or out of business, it has shrunk from 17 factories to 7, and from 2,600 employees to 1,200. Dobbins's customers have begun to face imported clothing sold so cheaply to Wal-Mart that they could not compete even if they paid their workers nothing.

"People ask, 'How can it be bad for things to come into the U.S. cheaply? How can it be bad to have a bargain at Wal-Mart?' Sure, it's held inflation down, and it's great to have bargains," says Dobbins. "But you can't buy anything if you're not employed. We are shopping ourselves out of jobs."
or just another format of text file? In this case we need a different class to grab that data. Now because I've defined a MovieFinder interface, this won't alter my moviesDirectedBy method. But I still need to have some way to get an instance of the right finder implementation into place.

Welcome to Article Down, we have articles about thousands of various topics. News articles are available also. If you are looking for an article on anything, try us first. We may have your article of choice, and we hope we do, but remember, we are much more than "just" an article directory. We have a huge collection to explore. Bookmark us and check back often for new material. Sign up and post an article or link to us.

"Where the Articles are down at the bottom of the page and there is alot to do."

All the content here is fresh and unique and new articles are submitted daily. If you are an author and would like to submit to our directory feel free to sign up by clicking on "sign up" under new members.

Now we can change the style sheet

Now we can change the style sheet. Cool. We have a more personalized page. Excellent. But we don’t have a personalized site. The preference is only applied to the current page; when we leave the current page the preference leaves with us. This situation, however, can be rectified with a cookie.

To store a cookie we need another function to return the current style sheet. We also need two functions to store and read the cookie.

The implementation of this function is naive in the extreme, it asks a finder object (which we'll get to in a moment) to return every film it knows about. Then it just hunts through this list to return those directed by a particular director. This particular piece of naivety I'm not going to fix, since it's just the scaffolding for the real point of this article.

The real point of this article is this finder object, or particularly how we connect the lister object with a particular finder object. The reason why this is interesting is that I want my wonderful moviesDirectedBy method to be completely independent of how all the movies are being stored. So all the method does is refer to a finder, and all that finder does is know how to respond to the findAll method. I can bring this out by defining an interface for the finder.


First we loop through all the link elements in the document again. We then check whether the link is a style sheet. If it is, we check whether the style sheet has a title. This tells us that the style sheet is either preferred or alternative.

The last check is to see whether or not the style sheet is active. If all three checks return true, we have the current style sheet and we can return the title.

There is a w3c specified DOM Level 2 attribute, “disabled,” that is set to false when a style sheet is applied to the document. This attribute is correctly implemented in Mozilla, but unfortunately not in MSIE.

MSIE does have a proprietary HTML attribute, also called “disabled,” that applies to link elements. This attribute is initially set to false for all link elements.

To set the MSIE disabled attribute to match the DOM Level 2 disabled attribute, we can call the setActiveStyleSheet() function with the name of the preferred style sheet.

To find out which style sheet is the preferred style sheet, we need another function. Because this function is so similar to the getActiveStyleSheet() function I’m not going to explain how it works, but here is what it may look like:

Indeed, as Vlasic discovered

Indeed, as Vlasic discovered, the real story of Wal-Mart, the story that never gets told, is the story of the pressure the biggest retailer relentlessly applies to its suppliers in the name of bringing us "every day low prices." It's the story of what that pressure does to the companies Wal-Mart does business with, to U.S. manufacturing, and to the economy as a whole. That story can be found floating in a gallon jar of pickles at Wal-Mart.

When a document is initially loaded, the persistent and preferred style sheets are applied to the document. The alternate style sheets can then be selected by the user. The W3C tells us that the browser should give us a choice of the style sheet we want to use, and suggests that perhaps a drop–down menu or tool bar will be provided.

So far, so good. We have several style sheets and the visitor can choose their favorite from a menu. But then we encounter a problem. A major one. Mozilla provides a menu to select the style sheet we want to use under the view menu item. But Microsoft Internet Explorer (MSIE) provides no such menu. So we have several style sheets, and no way to access them in MSIE.

Here’s where a little bit of JavaScript can be used along with the DOM to provide a way for MSIE and Mozilla users to select the style sheet they want to use. Their preference can also be stored in a cookie. And because we are using the link tags as the W3C tells us to, the JavaScript doesn’t interfere with the menu in Mozilla, and it degrades very gracefully.


Wal-Mart is not just the world's largest retailer. It's the world's largest company--bigger than ExxonMobil, General Motors, and General Electric. The scale can be hard to absorb. Wal-Mart sold $244.5 billion worth of goods last year. It sells in three months what

number-two retailer Home Depot sells in a year. And in its own category of general merchandise and groceries, Wal-Mart no longer has any real rivals. It does more business than Target, Sears, Kmart, J.C. Penney, Safeway, and Kroger combined. "Clearly," says Edward Fox, head of Southern Methodist University's J.C. Penney Center for Retailing Excellence, "Wal-Mart is more powerful than any retailer has ever been." It is, in fact, so big and so furtively powerful as to have become an entirely different order of corporate being.

Wal-Mart wields its power for just one purpose: to bring the lowest possible prices to its customers. At Wal-Mart, that goal is never reached. The retailer has a clear policy for suppliers: On basic products that don't change, the price Wal-Mart will pay, and will charge shoppers, must drop year after year. But what almost no one outside the world of Wal-Mart and its 21,000 suppliers knows is the high cost of those low prices. Wal-Mart has the power to squeeze profit-killing concessions from vendors. To survive in the face of its pricing demands, makers of everything from bras to bicycles to blue jeans have had to lay off employees and close U.S. plants in favor of outsourcing products from overseas.

Of course, U.S. companies have been moving jobs offshore for decades, long before Wal-Mart was a retailing power. But there is no question that the chain is helping accelerate the loss of American jobs to low-wage countries such as China. Wal-Mart, which in the late 1980s and early 1990s trumpeted its claim to "Buy American," has doubled its imports from China in the past five years alone, buying some $12 billion in merchandise in 2002. That's nearly 10% of all Chinese exports to the United States.

One way to think of Wal-Mart is as a vast pipeline that gives non-U.S. companies direct access to the American market. "One of the things that limits or slows the growth of imports is the cost of establishing connections and networks," says Paul Krugman, the Princeton University economist. "Wal-Mart is so big and so centralized that it can all at once hook Chinese and other suppliers into its digital system. So--wham!--you have a large switch to overseas sourcing in a period quicker than under the old rules of retailing."

Wal-Mart priced it at $2.97--a year's

These style sheets are enabled by default (they are “on” when the page is loaded). They can then be disabled if the user selects an alternate style sheet.

To make a style sheet preferred, the rel attribute is set to “stylesheet” and the style sheet is named with the title attribute.

Several preferred style sheets can be grouped together by giving them identical title attributes. These grouped style sheets are then all enabled and disabled together. If more than one group of preferred style sheets are declared, the first group takes precedence.

To make paul.css preferred, a title attribute is added, giving the default style a name.
Components and Services
The topic of wiring elements together drags me almost immediately into the knotty terminology problems that surround the terms service and component. You find long and contradictory articles on the definition of these things with ease. For my purposes here are my current uses of these overloaded terms.

I use component to mean a glob of software that's intended to be used, without change, by application that is out of the control of the writers of the component. By 'without change' I mean that the using application doesn't change the source code of the components, although they may alter the component's behavior by extending it in ways allowed by the component writers.

A gallon-sized jar of whole pickles is something to behold. The jar is the size of a small aquarium. The fat green pickles, floating in swampy juice, look reptilian, their shapes exaggerated by the glass. It weighs 12 pounds, too big to carry with one hand. The gallon jar of pickles is a display of abundance and excess; it is entrancing, and also vaguely unsettling. This is the product that Wal-Mart fell in love with: Vlasic's gallon jar of pickles.

Wal-Mart priced it at $2.97--a year's supply of pickles for less than $3! "They were using it as a 'statement' item," says Pat Hunn, who calls himself the "mad scientist" of Vlasic's gallon jar. "Wal-Mart was putting it before consumers, saying, This represents what Wal-Mart's about. You can buy a stinkin' gallon of pickles for $2.97. And it's the nation's number-one brand."

Therein lies the basic conundrum of doing business with the world's largest retailer. By selling a gallon of kosher dills for less than most grocers sell a quart, Wal-Mart may have provided a ser-vice for its customers. But what did it do for Vlasic? The pickle maker had spent decades convincing customers that they should pay a premium for its brand. Now Wal-Mart was practically giving them away. And the fevered buying spree that resulted distorted every aspect of Vlasic's operations, from farm field to factory to financial statement.


A service is similar to a component in that it's used by foreign applications. The main difference is that I expect a component to be used locally (think jar file, assembly, dll, or a source import). A service will be used remotely through some remote interface, either synchronous or asynchronous (eg web service, messaging system, RPC, or socket.)

I mostly use service in this article, but much of the same logic can be applied to local components too. Indeed often you need some kind of local component framework to easily access a remote service. But writing "component or service" is tiring to read and write, and services are much more fashionable at the moment.

Lovable was already feeling intense cost pressure

In the years since Mariotti left Huffy, the bike maker's relationship with Wal-Mart has been vital (though Huffy Corp. has lost money in three out of the last five years). It is the number-three seller of bikes in the United States. And Wal-Mart is the number-one retailer of bikes. But here's one last statistic about bicycles: Roughly 98% are now imported from places such as China, Mexico, and Taiwan. Huffy made its last bike in the United States in 1999.

As Mariotti says, Wal-Mart is tough as nails. But not every supplier agrees that the toughness is always accompanied by fairness. The Lovable Company was founded in 1926 by the grandfather of Frank Garson II, who was Lovable's last president. It did business with Wal-Mart, Garson says, from the earliest days of founder Sam Walton's first store in Bentonville, Arkansas. Lovable made bras and lingerie, supplying retailers that also included Sears and Victoria's Secret. At one point, it was the sixth-largest maker of intimate apparel in the United States, with 700 employees in this country and another 2,000 at eight factories in Central America.

Eventually Wal-Mart became Lovable's biggest customer. "Wal-Mart has a big pencil," says Garson. "They have such awesome purchasing power that they write their own ticket. If they don't like your prices, they'll go vertical and do it themselves--or they'll find someone that will meet their terms."

In the summer of 1995, Garson asserts, Wal-Mart did just that. "They had awarded us a contract, and in their wisdom, they changed the terms so dramatically that they really reneged." Garson, still worried about litigation, won't provide details. "But when you lose a customer that size, they are irreplaceable."
So you've got a web page. You’ve marked it up with structural XHTML. You’ve also been a good little web developer and used style sheets to control what your document looks like. You’ve even gone the extra mile and created several alternative style sheets to show how hardcore you are.

Great. But now you need a cross-browser way to dynamically switch between the style sheets.

Styling your site
Style sheets can be associated with documents using a list of link elements in the head. There are three different relationships external style sheets can have with the document: persistent, preferred, and alternate.

Persistent
These style sheets are always enabled (they are always “on”) and are combined with the active style sheet. They can be used for shared rules common to every style sheet. To make a style sheet persistent, the rel attribute is set to “stylesheet” and no title attribute is set.

To make the style sheet paul.css persistent, the following link element would be included in the head:


Lovable was already feeling intense cost pressure. Less than three years after Wal-Mart pulled its business, in its 72nd year, Lovable closed. "They leave a lot to be desired in the way they treat people," says Garson. "Their actions to pulverize people are unnecessary. Wal-Mart chewed us up and spit us out."

The choice between Service Locator

The CIA program's original scope was to hide and interrogate the two dozen or so al Qaeda leaders believed to be directly responsible for the Sept. 11 attacks, or who posed an imminent threat, or had knowledge of the larger al Qaeda network. But as the volume of leads pouring into the CTC from abroad increased, and the capacity of its paramilitary group to seize suspects grew, the CIA began apprehending more people whose intelligence value and links to terrorism were less certain, according to four current and former officials.

The original standard for consigning suspects to the invisible universe was lowered or ignored, they said. "They've got many, many more who don't reach any threshold," one intelligence official said.

Several former and current intelligence officials, as well as several other U.S. government officials with knowledge of the program, express frustration that the White House and the leaders of the intelligence community have not made it a priority to decide whether the secret internment program should continue in its current form, or be replaced by some other approach.

Meanwhile, the debate over the wisdom of the program continues among CIA officers, some of whom also argue that the secrecy surrounding the program is not sustainable.

One year, Huffy had committed to supply Wal-Mart with an entry-level, thin-margin bike--as many as Wal-Mart needed. Sales of the low-end bike took off. "I woke up May 1"--the heart of the bike production cycle for the summer--"and I needed 900,000 bikes," he says. "My factories could only run 450,000." As it happened, that same year, Huffy's fancier, more-profitable bikes were doing well, too, at Wal-Mart and other places. Huffy found itself in a bind.

With other retailers, perhaps, Mariotti might have sat down, renegotiated, tried to talk his way out of the corner. Not with Wal-Mart. "I made the deal up front with them," he says. "I knew how high was up. I was duty-bound to supply my customer." So he did something extraordinary. To free up production in order to make Wal-Mart's cheap bikes, he gave the designs for four of his higher-end, higher-margin products to rival manufacturers. "I conceded business to my competitors, because I just ran out of capacity," he says. Huffy didn't just relinquish profits to keep Wal-Mart happy--it handed those profits to its competition. "Wal-Mart didn't tell me what to do," Mariotti says. "They didn't have to." The retailer, he adds, "is tough as nails. But they give you a chance to compete. If you can't compete, that's your problem."

The current rush of lightweight containers all have a common underlying pattern to how they do service assembly - the dependency injector pattern. Dependency Injection is a useful alternative to Service Locator. When building application classes the two are roughly equivalent, but I think Service Locator has a slight edge due to its more straightforward behavior. However if you are building classes to be used in multiple applications then Dependency Injection is a better choice.

If you use Dependency Injection there are a number of styles to choose between. I would suggest you follow constructor injection unless you run into one of the specific problems with that approach, in which case switch to setter injection. If you are choosing to build or obtain a container, look for one that supports both constructor and setter injection.

The choice between Service Locator and Dependency Injection is less important than the principle of separating service configuration from the use of services within an application.

Mariotti describes one episode from

Separating Configuration from Use
The important issue in all of this is to ensure that the configuration of services is separated from their use. Indeed this is a fundamental design principle that sits with the separation of interfaces from implementation. It's something we see within an object-oriented program when conditional logic decides which class to instantiate, and then future evaluations of that conditional are done through polymorphism rather than through duplicated conditional code.

What does the squeeze look like at Wal-Mart? It is usually thoroughly rational, sometimes devastatingly so.

John Mariotti is a veteran of the consumer-products world--he spent nine years as president of Huffy Bicycle Co., a division of Huffy Corp., and is now chairman of World Kitchen, the company that sells Oxo, Revere, Corning, and Ekco brand housewares.

He could not be clearer on his opinion about Wal-Mart: It's a great company, and a great company to do business with. "Wal-Mart has done more good for America by several thousand orders of magnitude than they've done bad," Mariotti says. "They have raised the bar, and raised the bar for everybody."

Mariotti describes one episode from Huffy's relationship with Wal-Mart. It's a tale he tells to illustrate an admiring point he makes about the retailer. "They demand you do what you say you are going to do." But it's also a classic example of the damned-if-you-do, damned-if-you-don't Wal-Mart squeeze. When Mariotti was at Huffy throughout the 1980s, the company sold a range of bikes to Wal-Mart, 20 or so models, in a spread of prices and profitability. It was a leading manufacturer of bikes in the United States, in places like Ponca City, Oklahoma; Celina, Ohio; and Farmington, Missouri.


If this separation is useful within a single code base, it's especially vital when you're using foreign elements such as components and services. The first question is whether you wish to defer the choice of implementation class to particular deployments. If so you need to use some implementation of plugin. Once you are using plugins then it's essential that the assembly of the plugins is done separately from the rest of the application so that you can substitute different configurations easily for different deployments. How you achieve this is secondary. This configuration mechanism can either configure a service locator, or use injection to configure objects directly.

In late 2002 or early 2003

Still without a long-term solution, the CIA began sending suspects it captured in the first month or so after Sept. 11 to its longtime partners, the intelligence services of Egypt and Jordan.

A month later, the CIA found itself with hundreds of prisoners who were captured on battlefields in Afghanistan. A short-term solution was improvised. The agency shoved its highest-value prisoners into metal shipping containers set up on a corner of the Bagram Air Base, which was surrounded with a triple perimeter of concertina-wire fencing. Most prisoners were left in the hands of the Northern Alliance, U.S.-supported opposition forces who were fighting the Taliban.

"I remember asking: What are we going to do with these people?" said a senior CIA officer. "I kept saying, where's the help? We've got to bring in some help. We can't be jailers -- our job is to find Osama."

Then came grisly reports, in the winter of 2001, that prisoners kept by allied Afghan generals in cargo containers had died of asphyxiation. The CIA asked Congress for, and was quickly granted, tens of millions of dollars to establish a larger, long-term system in Afghanistan, parts of which would be used for CIA prisoners.

The largest CIA prison in Afghanistan was code-named the Salt Pit. It was also the CIA's substation and was first housed in an old brick factory outside Kabul. In November 2002, an inexperienced CIA case officer allegedly ordered guards to strip naked an uncooperative young detainee, chain him to the concrete floor and leave him there overnight without blankets. He froze to death, according to four U.S. government officials. The CIA officer has not been charged in the death.

The Salt Pit was protected by surveillance cameras and tough Afghan guards, but the road leading to it was not safe to travel and the jail was eventually moved inside Bagram Air Base. It has since been relocated off the base.

By mid-2002, the CIA had worked out secret black-site deals with two countries, including Thailand and one Eastern European nation, current and former officials said. An estimated $100 million was tucked inside the classified annex of the first supplemental Afghanistan appropriation.

Then the CIA captured its first big detainee, in March 28, 2002. Pakistani forces took Abu Zubaida, al Qaeda's operations chief, into custody and the CIA whisked him to the new black site in Thailand, which included underground interrogation cells, said several former and current intelligence officials. Six months later, Sept. 11 planner Ramzi Binalshibh was also captured in Pakistan and flown to Thailand.

But after published reports revealed the existence of the site in June 2003, Thai officials insisted the CIA shut it down, and the two terrorists were moved elsewhere, according to former government officials involved in the matter. Work between the two countries on counterterrorism has been lukewarm ever since.

In late 2002 or early 2003, the CIA brokered deals with other countries to establish black-site prisons. One of these sites -- which sources said they believed to be the CIA's biggest facility now -- became particularly important when the agency realized it would have a growing number of prisoners and a shrinking number of prisons.

Thailand was closed, and sometime in 2004 the CIA decided it had to give up its small site at Guantanamo Bay. The CIA had planned to convert that into a state-of-the-art facility, operated independently of the military. The CIA pulled out when U.S. courts began to exercise greater control over the military detainees, and agency officials feared judges would soon extend the same type of supervision over their detainees.

In hindsight, say some former and current intelligence officials, the CIA's problems were exacerbated by another decision made within the Counterterrorist Center at Langley.

One thing we're seeing in the Java world

The agency set up prisons under its covert action authority. Under U.S. law, only the president can authorize a covert action, by signing a document called a presidential finding. Findings must not break U.S. law and are reviewed and approved by CIA, Justice Department and White House legal advisers.

Six days after the Sept. 11 attacks, President Bush signed a sweeping finding that gave the CIA broad authorization to disrupt terrorist activity, including permission to kill, capture and detain members of al Qaeda anywhere in the world.


It could not be determined whether Bush approved a separate finding for the black-sites program, but the consensus among current and former intelligence and other government officials interviewed for this article is that he did not have to.

Rather, they believe that the CIA general counsel's office acted within the parameters of the Sept. 17 finding. The black-site program was approved by a small circle of White House and Justice Department lawyers and officials, according to several former and current U.S. government and intelligence officials.

A separate but often conflated issue is whether to use configuration files or code on an API to wire up services. For most applications that are likely to be deployed in many places, a separate configuration file usually makes most sense. Almost all the time this will be an XML file, and this makes sense. However there are cases where it's easier to use program code to do the assembly. One case is where you have a simple application that's not got a lot of deployment variation. In this case a bit of code can be clearer than a separate XML file.

A contrasting case is where the assembly is quite complex, involving conditional steps. Once you start getting close to programming language then XML starts breaking down and it's better to use a real language that has all the syntax to write a clear program. You then write a builder class that does the assembly. If you have distinct builder scenarios you can provide several builder classes and use a simple configuration file to select between them.

I often think that people are over-eager to define configuration files. Often a programming language makes a straightforward and powerful configuration mechanism. Modern languages can easily compile small assemblers that can be used to assemble plugins for larger systems. If compilation is a pain, then there are scripting languages that can work well also.

It's often said that configuration files shouldn't use a programing language because they need to be edited by non-programmers. But how often is this the case? Do people really expect non-programmers to alter the transaction isolation levels of a complex server-side application? Non-language configuration files work well only to the extent they are simple. If they become complex then it's time to think about using a proper programming language.

One thing we're seeing in the Java world at the moment is a cacophony of configuration files, where every component has its own configuration files which are different to everyone else's. If you use a dozen of these components, you can easily end up with a dozen configuration files to keep in sync.

My advice here is to always provide a way to do all configuration easily with a programmatic interface, and then treat a separate configuration file as an optional feature. You can easily build configuration file handling to use the programmatic interface. If you are writing a component you then leave it up to your user whether to use the programmatic interface, your configuration file format, or to write their own custom configuration file format and tie it into the programmatic interface



Among the first steps was to figure out where the CIA could secretly hold the captives. One early idea was to keep them on ships in international waters, but that was discarded for security and logistics reasons.

CIA officers also searched for a setting like Alcatraz Island. They considered the virtually unvisited islands in Lake Kariba in Zambia, which were edged with craggy cliffs and covered in woods. But poor sanitary conditions could easily lead to fatal diseases, they decided, and besides, they wondered, could the Zambians be trusted with such a secret?

If you have multiple ways to construct a valid object

If you have multiple ways to construct a valid object, it can be hard to show this through constructors, since constructors can only vary on the number and type of parameters. This is when Factory Methods come into play, these can use a combination of private constructors and setters to implement their work. The problem with classic Factory Methods for components assembly is that they are usually seen as static methods, and you can't have those on interfaces. You can make a factory class, but then that just becomes another service instance. A factory service is often a good tactic, but you still have to instantiate the factory using one of the techniques here.

Constructors also suffer if you have simple parameters such as strings. With setter injection you can give each setter a name to indicate what the string is supposed to do. With constructors you are just relying on the position, which is harder to follow.

If you have multiple constructors and inheritance, then things can get particularly awkward. In order to initialize everything you have to provide constructors to forward to each superclass constructor, while also adding you own arguments. This can lead to an even bigger explosion of constructors.

Despite the disadvantages my preference is to start with constructor injection, but be ready to switch to setter injection as soon as the problems I've outlined above start to become a problem.

This issue has led to a lot of debate between the various teams who provide dependency injectors as part of their frameworks. However it seems that most people who build these frameworks have realized that it's important to support both mechanisms, even if there's a preference for one of them.

No one wants to end up in what is known among Wal-Mart vendors as the "penalty box"--punished, or even excluded from the store shelves, for saying something that makes Wal-Mart unhappy. (The penalty box is normally reserved for vendors who don't meet performance benchmarks, not for those who talk to the press.)

"You won't hear anything negative from most people," says Paul Kelly, founder of Silvermine Consulting Group, a company that helps businesses work more effectively with retailers. "It would be committing suicide. If Wal-Mart takes something the wrong way, it's like Saddam Hussein. You just don't want to piss them off."

As a result, this story was reported in an unusual way: by speaking with dozens of people who have spent years selling to Wal-Mart, or consulting to companies that sell to Wal-Mart, but who no longer work for companies that do business with Wal-Mart. Unless otherwise noted, the companies involved in the events they described refused even to confirm or deny the basics of the events.

To a person, all those interviewed credit Wal-Mart with a fundamental integrity in its dealings that's unusual in the world of consumer goods, retailing, and groceries. Wal-Mart does not cheat suppliers, it keeps its word, it pays its bills briskly. "They are tough people but very honest; they treat you honestly," says Peter Campanella, who ran the business that sold Corning kitchenware products, both at Corning and then at World Kitchen. "It was a joke to do business with most of their competitors. A fiasco."

But Wal-Mart also clearly does not hesitate to use its power, magnifying the Darwinian forces already at work in modern global capitalism.

Morocco, Egypt and Jordan have said that they do not

Morocco, Egypt and Jordan have said that they do not torture detainees, although years of State Department human rights reports accuse all three of chronic prisoner abuse.

Another advantage with constructor initialization is that it allows you to clearly hide any fields that are immutable by simply not providing a setter. I think this is important - if something shouldn't change then the lack of a setter communicates this very well. If you use setters for initialization, then this can become a pain. (Indeed in these situations I prefer to avoid the usual setting convention, I'd prefer a method like initFoo, to stress that it's something you should only do at birth.)

But with any situation there are exceptions. If you have a lot of constructor parameters things can look messy, particularly in languages without keyword parameters. It's true that a long constructor is often a sign of an over-busy object that should be split, but there are cases when that's what you need.


The top 30 al Qaeda prisoners exist in complete isolation from the outside world. Kept in dark, sometimes underground cells, they have no recognized legal rights, and no one outside the CIA is allowed to talk with or even see them, or to otherwise verify their well-being, said current and former and U.S. and foreign government and intelligence officials.

Most of the facilities were built and are maintained with congressionally appropriated funds, but the White House has refused to allow the CIA to brief anyone except the House and Senate intelligence committees' chairmen and vice chairmen on the program's generalities.

The Eastern European countries that the CIA has persuaded to hide al Qaeda captives are democracies that have embraced the rule of law and individual rights after decades of Soviet domination. Each has been trying to cleanse its intelligence services of operatives who have worked on behalf of others -- mainly Russia and organized crime.


The idea of holding terrorists outside the U.S. legal system was not under consideration before Sept. 11, 2001, not even for Osama bin Laden, according to former government officials. The plan was to bring bin Laden and his top associates into the U.S. justice system for trial or to send them to foreign countries where they would be tried.

"The issue of detaining and interrogating people was never, ever discussed," said a former senior intelligence officer who worked in the CIA's Counterterrorist Center, or CTC, during that period. "It was against the culture and they believed information was best gleaned by other means."

On the day of the attacks, the CIA already had a list of what it called High-Value Targets from the al Qaeda structure, and as the World Trade Center and Pentagon attack plots were unraveled, more names were added to the list. The question of what to do with these people surfaced quickly.

The CTC's chief of operations argued for creating hit teams of case officers and CIA paramilitaries that would covertly infiltrate countries in the Middle East, Africa and even Europe to assassinate people on the list, one by one.

But many CIA officers believed that the al Qaeda leaders would be worth keeping alive to interrogate about their network and other plots. Some officers worried that the CIA would not be very adept at assassination.

Here, for example, is an executive at Dial

Of course the testing problem is exacerbated by component environments that are very intrusive, such as Java's EJB framework. My view is that these kinds of frameworks should minimize their impact upon application code, and particularly should not do things that slow down the edit-execute cycle. Using plugins to substitute heavyweight components does a lot to help this process, which is vital for practices such as Test Driven Development.

So the primary issue is for people who are writing code that expects to be used in applications outside of the control of the writer. In these cases even a minimal assumption about a Service Locator is a problem.

Constructor versus Setter Injection
For service combination, you always have to have some convention in order to wire things together. The advantage of injection is primarily that it requires very simple conventions - at least for the constructor and setter injections. You don't have to do anything odd in your component and it's fairly straightforward for an injector to get everything configured.

Interface injection is more invasive since you have to write a lot of interfaces to get things all sorted out. For a small set of interfaces required by the container, such as in Avalon's approach, this isn't too bad. But it's a lot of work for assembling components and dependencies, which is why the current crop of lightweight containers go with setter and constructor injection.

The choice between setter and constructor injection is interesting as it mirrors a more general issue with object-oriented programming - should you fill fields in a constructor or with setters.

My long running default with objects is as much as possible, to create valid objects at construction time. This advice goes back to Kent Beck's Smalltalk Best Practice Patterns: Constructor Method and Constructor Parameter Method. Constructors with parameters give you a clear statement of what it means to create a valid object in an obvious place. If there's more than one way to do it, create multiple constructors that show the different combinations.

Our clients cannot grow without finding a way to be successful with Wal-Mart."

Many companies and their executives frankly admit that supplying Wal-Mart is like getting into the company version of basic training with an implacable Army drill sergeant. The process may be unpleasant. But there can be some positive results.

"Everyone from the forklift driver on up to me, the CEO, knew we had to deliver [to Wal-Mart] on time. Not 10 minutes late. And not 45 minutes early, either," says Robin Prever, who was CEO of Saratoga Beverage Group from 1992 to 2000, and made private-label water sold at Wal-Mart. "The message came through clearly: You have this 30-second delivery window. Either you're there, or you're out. With a customer like that, it changes your organization. For the better. It wakes everybody up. And all our customers benefited. We changed our whole approach to doing business."

But you won't hear evenhanded stories like that from Wal-Mart, or from its current suppliers. Despite being a publicly traded company, Wal-Mart is intensely private. It declined to talk in detail about its relationships with its suppliers for this story. More strikingly, dozens of companies contacted declined to talk about even the basics of their business with Wal-Mart.

Here, for example, is an executive at Dial: "We are one of Wal-Mart's biggest suppliers, and they are our biggest customer by far. We have a great relationship. That's all I can say. Are we done now?" Goaded a bit, the executive responds with an almost hysterical edge: "Are you meshuga? Why in the world would we talk about Wal-Mart? Ask me about anything else, we'll talk. But not Wal-Mart."

which these sources believe includes more than

The contours of the CIA's detention program have emerged in bits and pieces over the past two years. Parliaments in Canada, Italy, France, Sweden and the Netherlands have opened inquiries into alleged CIA operations that secretly captured their citizens or legal residents and transferred them to the agency's prisons.

More than 100 suspected terrorists have been sent by the CIA into the covert system, according to current and former U.S. intelligence officials and foreign sources. This figure, a rough estimate based on information from sources who said their knowledge of the numbers was incomplete, does not include prisoners picked up in Iraq.

The detainees break down roughly into two classes, the sources said.


About 30 are considered major terrorism suspects and have been held under the highest level of secrecy at black sites financed by the CIA and managed by agency personnel, including those in Eastern Europe and elsewhere, according to current and former intelligence officers and two other U.S. government officials. Two locations in this category -- in Thailand and on the grounds of the military prison at Guantanamo Bay -- were closed in 2003 and 2004, respectively.

John Fitzgerald, a former vice president of Nabisco, remembers Wal-Mart's reaction to his company's plan to offer a 25-cent newspaper coupon for a large bag of Lifesavers in advance of Halloween. Wal-Mart told Nabisco to add up what it would spend on the promotion--for the newspaper ads, the coupons, and handling--and then just take that amount off the price instead. "That isn't necessarily good for the manufacturer," Fitzgerald says. "They need things that draw attention."

It also is not unheard of for Wal-Mart to demand to examine the private financial records of a supplier, and to insist that its margins are too high and must be cut. And the smaller the supplier, one academic study shows, the greater the likelihood that it will be forced into damaging concessions. Melissa Berryhill, a Wal-Mart spokeswoman, disagrees: "The fact is Wal-Mart, perhaps like no other retailer, seeks to establish collaborative and mutually beneficial relationships with our suppliers."

For many suppliers, though, the only thing worse than doing business with Wal-Mart may be not doing business with Wal-Mart. Last year, 7.5 cents of every dollar spent in any store in the United States (other than auto-parts stores) went to the retailer. That means a contract with Wal-Mart can be critical even for the largest consumer-goods companies. Dial Corp., for example, does 28% of its business with Wal-Mart. If Dial lost that one account, it would have to double its sales to its next nine customers just to stay even. "Wal-Mart is the essential retailer, in a way no other retailer is," says Gib Carey, a partner at Bain & Co., who is leading a yearlong study of how to do


A second tier -- which these sources believe includes more than 70 detainees -- is a group considered less important, with less direct involvement in terrorism and having limited intelligence value. These prisoners, some of whom were originally taken to black sites, are delivered to intelligence services in Egypt, Jordan, Morocco, Afghanistan and other countries, a process sometimes known as "rendition." While the first-tier black sites are run by CIA officers, the jails in these countries are operated by the host nations, with CIA financial assistance and, sometimes, direction.

decisions about the future of the gallon

And so Vlasic's gallon jar of pickles went into every Wal-Mart, some 3,000 stores, at $2.97, a price so low that Vlasic and Wal-Mart were making only a penny or two on a jar, if that. It was showcased on big pallets near the front of stores. It was an abundance of abundance. "It was selling 80 jars a week, on average, in every store," says Young. Doesn't sound like much, until you do the math: That's 240,000 gallons of pickles, just in gallon jars, just at Wal-Mart, every week. Whole fields of cucumbers were heading out the door.

For Vlasic, the gallon jar of pickles became what might be called a devastating success. "Quickly, it started cannibalizing our non-Wal-Mart business," says Young. "We saw consumers who used to buy the spears and the chips in supermarkets buying the Wal-Mart gallons. They'd eat a quarter of a jar and throw the thing away when they got moldy. A family can't eat them fast enough."

The gallon jar reshaped Vlasic's pickle business: It chewed up the profit margin of the business with Wal-Mart, and of pickles generally. Procurement had to scramble to find enough pickles to fill the gallons, but the volume gave Vlasic strong sales numbers, strong growth numbers, and a powerful place in the world of pickles at Wal-Mart. Which accounted for 30% of Vlasic's business. But the company's profits from pickles had shriveled 25% or more, Young says--millions of dollars.

The gallon was hoisting Vlasic and hurting it at the same time.

Young remembers begging Wal-Mart for relief. "They said, 'No way,' " says Young. "We said we'll increase the price"--even $3.49 would have helped tremendously--"and they said, 'If you do that, all the other products of yours we buy, we'll stop buying.' It was a clear threat." Hunn recalls things a little differently, if just as ominously: "They said, 'We want the $2.97 gallon of pickles. If you don't do it, we'll see if someone else might.' I knew our competitors were saying to Wal-Mart, 'We'll do the $2.97 gallons if you give us your other business.' " Wal-Mart's business was so indispensable to Vlasic, and the gallon so central to the Wal-Mart relationship, that decisions about the future of the gallon were made at the CEO level.

Finally, Wal-Mart let Vlasic up for air. "The Wal-Mart guy's response was classic," Young recalls. "He said, 'Well, we've done to pickles what we did to orange juice. We've killed it. We can back off.' " Vlasic got to take it down to just over half a gallon of pickles, for $2.79. Not long after that, in January 2001, Vlasic filed for bankruptcy--although the gallon jar of pickles, everyone agrees, wasn't a critical factor.

By now, it is accepted wisdom that Wal-Mart makes the companies it does business with more efficient and focused, leaner and faster. Wal-Mart itself is known for continuous improvement in its ability to handle, move, and track merchandise. The difference comes if the lister is a component that I'm providing to an application that other people are writing. In this case I don't know much about the APIs of the service locators that my customers are going to use. Each customer might have their own incompatible service locators. I can get around some of this by using the segregated interface. Each customer can write an adapter that matches my interface to their locator, but in any case I still need to see the first locator to lookup my specific interface. And once the adapter appears then the simplicity of the direct connection to a locator is beginning to slip.

Since with an injector you don't have a dependency from a component to the injector, the component cannot obtain further services from the injector once it's been configured.

A common reason people give for preferring dependency injection is that it makes testing easier. The point here is that to do testing, you need to easily replace real service implementations with stubs or mocks. However there is really no difference here between dependency injection and service locator: both are very amenable to stubbing. I suspect this observation comes from projects where people don't make the effort to ensure that their service locator can be easily substituted. This is where continual testing helps, if you can't easily stub services for testing, then this implies a serious problem with your design.


It expects the same of its suppliers. But the ability to operate at peak efficiency only gets you in the door at Wal-Mart. Then the real demands start. The public image Wal-Mart projects may be as cheery as its yellow smiley-face mascot, but there is nothing genial about the process by which Wal-Mart gets its suppliers to provide tires and contact lenses, guns and underarm deodorant at every day low prices. Wal-Mart is legendary for forcing its suppliers to redesign everything from their packaging to their computer systems. It is also legendary for quite straightforwardly telling them what it will pay for their goods.

Using dependency injection can help make it

Service Locator vs Dependency Injection
The fundamental choice is between Service Locator and Dependency Injection. The first point is that both implementations provide the fundamental decoupling that's missing in the naive example - in both cases application code is independent of the concrete implementation of the service interface. The important difference between the two patterns is about how that implementation is provided to the application class. With service locator the application class asks for it explicitly by a message to the locator. With injection there is no explicit request, the service appears in the application class - hence the inversion of control.

Inversion of control is a common feature of frameworks, but it's something that comes at a price. It tends to be hard to understand and leads to problems when you are trying to debug. So on the whole I prefer to avoid it unless I need it. This isn't to say it's a bad thing, just that I think it needs to justify itself over the more straightforward alternative.

The key difference is that with a Service Locator every user of a service has a dependency to the locator. The locator can hide dependencies to other implementations, but you do need to see the locator. So the decision between locator and injector depends on whether that dependency is a problem.

Using dependency injection can help make it easier to see what the component dependencies are. With dependency injector you can just look at the injection mechanism, such as the constructor, and see the dependencies. With the service locator you have to search the source code for calls to the locator. Modern IDEs with a find references feature make this easier, but it's still not as easy as looking at the constructor or setting methods.

There is no question that Wal-Mart's relentless drive to squeeze out costs has benefited consumers. The giant retailer is at least partly responsible for the low rate of U.S. inflation, and a McKinsey & Co. study concluded that about 12% of the economy's productivity gains in the second half of the 1990s could be traced to Wal-Mart alone.

There is also no question that doing business with Wal-Mart can give a supplier a fast, heady jolt of sales and market share. But that fix can come with long-term consequences for the health of a brand and a business. Vlasic, for example, wasn't looking to build its brand on a gallon of whole pickles. Pickle companies make money on "the cut," slicing cucumbers into spears and hamburger chips. "Cucumbers in the jar, you don't make a whole lot of money there," says Steve Young, a former vice president of grocery marketing for pickles at Vlasic, who has since left the company.

At some point in the late 1990s, a Wal-Mart buyer saw Vlasic's gallon jar and started talking to Pat Hunn about it. Hunn, who has also since left Vlasic, was then head of Vlasic's Wal-Mart sales team, based in Dallas. The gallon intrigued the buyer. In sales tests, priced somewhere over $3, "the gallon sold like crazy," says Hunn, "surprising us all." The Wal-Mart buyer had a brainstorm: What would happen to the gallon if they offered it nationwide and got it below $3? Hunn was skeptical, but his job was to look for ways to sell pickles at Wal-Mart. Why not?


A lot of this depends on the nature of the user of the service. If you are building an application with various classes that use a service, then a dependency from the application classes to the locator isn't a big deal. In my example of giving a Movie Lister to my friends, then using a service locator works quite well. All they need to do is to configure the locator to hook in the right service implementations, either through some configuration code or through a configuration file. In this kind of scenario I don't see the injector's inversion as providing anything compelling.

Some detainees apprehended by the CIA and

When these containers talk about how they are so useful because they implement "Inversion of Control" I end up very puzzled. Inversion of control is a common characteristic of frameworks, so saying that these lightweight containers are special because they use inversion of control is like saying my car is special because it has wheels.

The question, is what aspect of control are they inverting? When I first ran into inversion of control, it was in the main control of a user interface. Early user interfaces were controlled by the application program. You would have a sequence of commands like "Enter name", "enter address"; your program would drive the prompts and pick up a response to each one. With graphical (or even screen based) UIs the UI framework would contain this main loop and your program instead provided event handlers for the various fields on the screen. The main control of the program was inverted, moved away from you to the framework.

For this new breed of containers the inversion is about how they lookup a plugin implementation. In my naive example the lister looked up the finder implementation by directly instantiating it. This stops the finder from being a plugin. The approach that these containers use is to ensure that any user of a plugin follows some convention that allows a separate assembler module to inject the implementation into the lister.

Steve Dobbins has been bearing the brunt of that switch. He's president and CEO of Carolina Mills, a 75-year-old North Carolina company that supplies thread, yarn, and textile finishing to apparel makers--half of which supply Wal-Mart. Carolina Mills grew steadily until 2000. But in the past three years, as its customers have gone either overseas or out of business, it has shrunk from 17 factories to 7, and from 2,600 employees to 1,200. Dobbins's customers have begun to face imported clothing sold so cheaply to Wal-Mart that they could not compete even if they paid their workers nothing.

"People ask, 'How can it be bad for things to come into the U.S. cheaply? How can it be bad to have a bargain at Wal-Mart?' Sure, it's held inflation down, and it's great to have bargains," says Dobbins. "But you can't buy anything if you're not employed. We are shopping ourselves out of jobs."

It is illegal for the government to hold prisoners in such isolation in secret prisons in the United States, which is why the CIA placed them overseas, according to several former and current intelligence officials and other U.S. government officials. Legal experts and intelligence officials said that the CIA's internment practices also would be considered illegal under the laws of several host countries, where detainees have rights to have a lawyer or to mount a defense against allegations of wrongdoing.

Host countries have signed the U.N. Convention Against Torture and Other Cruel, Inhuman or Degrading Treatment or Punishment, as has the United States. Yet CIA interrogators in the overseas sites are permitted to use the CIA's approved "Enhanced Interrogation Techniques," some of which are prohibited by the U.N. convention and by U.S. military law. They include tactics such as "waterboarding," in which a prisoner is made to believe he or she is drowning.

Some detainees apprehended by the CIA and transferred to foreign intelligence agencies have alleged after their release that they were tortured, although it is unclear whether CIA personnel played a role in the alleged abuse. Given the secrecy surrounding CIA detentions, such accusations have heightened concerns among foreign governments and human rights groups about CIA detention and interrogation practices.


I'm going to start by talking about the various forms of dependency injection, but I'll point out now that that's not the only way of removing the dependency from the application class to the plugin implementation. The other pattern you can use to do this is Service Locator, and I'll discuss that after I'm done with explaining Dependency Injection.

One way to think of Wal-Mart is as a vast

Although the CIA will not acknowledge details of its system, intelligence officials defend the agency's approach, arguing that the successful defense of the country requires that the agency be empowered to hold and interrogate suspected terrorists for as long as necessary and without restrictions imposed by the U.S. legal system or even by the military tribunals established for prisoners held at Guantanamo Bay.

The Washington Post is not publishing the names of the Eastern European countries involved in the covert program, at the request of senior U.S. officials. They argued that the disclosure might disrupt counterterrorism efforts in those countries and elsewhere and could make them targets of possible terrorist retaliation.

The secret detention system was conceived in the chaotic and anxious first months after the Sept. 11, 2001, attacks, when the working assumption was that a second strike was imminent.

Since then, the arrangement has been increasingly debated within the CIA, where considerable concern lingers about the legality, morality and practicality of holding even unrepentant terrorists in such isolation and secrecy, perhaps for the duration of their lives. Mid-level and senior CIA officers began arguing two years ago that the system was unsustainable and diverted the agency from its unique espionage mission.

"We never sat down, as far as I know, and came up with a grand strategy," said one former senior intelligence officer who is familiar with the program but not the location of the prisons. "Everything was very reactive. That's how you get to a situation where you pick people up, send them into a netherworld and don't say, 'What are we going to do with them afterwards?' "

number-two retailer Home Depot sells in a year. And in its own category of general merchandise and groceries, Wal-Mart no longer has any real rivals. It does more business than Target, Sears, Kmart, J.C. Penney, Safeway, and Kroger combined. "Clearly," says Edward Fox, head of Southern Methodist University's J.C. Penney Center for Retailing Excellence, "Wal-Mart is more powerful than any retailer has ever been." It is, in fact, so big and so furtively powerful as to have become an entirely different order of corporate being.

Wal-Mart wields its power for just one purpose: to bring the lowest possible prices to its customers. At Wal-Mart, that goal is never reached. The retailer has a clear policy for suppliers: On basic products that don't change, the price Wal-Mart will pay, and will charge shoppers, must drop year after year. But what almost no one outside the world of Wal-Mart and its 21,000 suppliers knows is the high cost of those low prices. Wal-Mart has the power to squeeze profit-killing concessions from vendors. To survive in the face of its pricing demands, makers of everything from bras to bicycles to blue jeans have had to lay off employees and close U.S. plants in favor of outsourcing products from overseas.

Of course, U.S. companies have been moving jobs offshore for decades, long before Wal-Mart was a retailing power. But there is no question that the chain is helping accelerate the loss of American jobs to low-wage countries such as China. Wal-Mart, which in the late 1980s and early 1990s trumpeted its claim to "Buy American," has doubled its imports from China in the past five years alone, buying some $12 billion in merchandise in 2002. That's nearly 10% of all Chinese exports to the United States.

One way to think of Wal-Mart is as a vast pipeline that gives non-U.S. companies direct access to the American market. "One of the things that limits or slows the growth of imports is the cost of establishing connections and networks," says Paul Krugman, the Princeton University economist. "Wal-Mart is so big and so centralized that it can all at once hook Chinese and other suppliers into its digital system. So--wham!--you have a large switch to overseas sourcing in a period quicker than under the old rules of retailing."

Although the CIA will not acknowledge details of its

On the opposite end of the career spectrum are lumberjacks. The study shows these workers, also known as timber cutters and loggers, as having the worst occupation, because of the dangerous nature of their work, a poor employment outlook and low annual pay -- just $32,124.

New protective gear -- such as trouser covers made of fiber-reinforcement materials -- and an increased emphasis on safety have helped to reduce injuries among lumberjacks, says Paul Branch, who manages the timber department at Pike Lumber Co. in Akron, Ind. Still, accidents do occur from time to time, and some even result in death. "It's not a job everybody can do," says Mr. Branch.

But Eric Nellans, who has been cutting timber for the past 11 years for Pike Lumber, is passionate about his profession. "It's a very rewarding job, especially at the end of the day when you see the work you accomplished," he says. Mr. Nellans, 35, didn't become discouraged even after he accidentally knocked down a dead tree and broke his right leg in the process four years ago. "I was back in the woods cutting timber in five weeks," he says.

Other jobs at the bottom of the study: dairy farmer, taxi driver, seaman, emergency medical technician and roofer.

Mike Riegel, a 43-year-old roofer in Flemington, N.J., says he likes working "outside in the fresh air." Since he runs his own business, which he inherited from his father, he can start and end his day early in hot weather or do the opposite when it's cold.

The study estimates roofers earn annual incomes of $34,164, which Mr. Riegel says is consistent with what he pays new employees. Roofers also ranked poorly because of their hazardous working conditions. "You obviously can't be afraid of heights," says Mr. Riegel, who once fell two stories while working on a rooftop in the rain but luckily landed safely on a pile of soft dirt. "I missed some cement by 10 feet."

While the Defense Department has produced volumes of public reports and testimony about its detention practices and rules after the abuse scandals at Iraq's Abu Ghraib prison and at Guantanamo Bay, the CIA has not even acknowledged the existence of its black sites. To do so, say officials familiar with the program, could open the U.S. government to legal challenges, particularly in foreign courts, and increase the risk of political condemnation at home and abroad.

But the revelations of widespread prisoner abuse in Afghanistan and Iraq by the U.S. military -- which operates under published rules and transparent oversight of Congress -- have increased concern among lawmakers, foreign governments and human rights groups about the opaque CIA system. Those concerns escalated last month, when Vice President Cheney and CIA Director Porter J. Goss asked Congress to exempt CIA employees from legislation already endorsed by 90 senators that would bar cruel and degrading treatment of any prisoner in U.S. custody.

Although the CIA will not acknowledge details of its system, intelligence officials defend the agency's approach, arguing that the successful defense of the country requires that the agency be empowered to hold and interrogate suspected terrorists for as long as necessary and without restrictions imposed by the U.S. legal system or even by the military tribunals established for prisoners held at Guantanamo Bay.

The name of the implementation class comes

The findings were compiled by Les Krantz, author of "Jobs Rated Almanac," and are based on data from the U.S. Bureau of Labor Statistics and the Census Bureau, as well as studies from trade associations and Mr. Krantz's own expertise.

According to the study, mathematicians fared best in part because they typically work in favorable conditions -- indoors and in places free of toxic fumes or noise -- unlike those toward the bottom of the list like sewage-plant operator, painter and bricklayer. They also aren't expected to do any heavy lifting, crawling or crouching -- attributes associated with occupations such as firefighter, auto mechanic and plumber.

The study also considers pay, which was determined by measuring each job's median income and growth potential. Mathematicians' annual income was pegged at $94,160, but Ms. Courter, 38, says her salary exceeds that amount.
The hidden global internment network is a central element in the CIA's unconventional war on terrorism. It depends on the cooperation of foreign intelligence services, and on keeping even basic information about the system secret from the public, foreign officials and nearly all members of Congress charged with overseeing the CIA's covert actions.

The existence and locations of the facilities -- referred to as "black sites" in classified White House, CIA, Justice Department and congressional documents -- are known to only a handful of officials in the United States and, usually, only to the president and a few top intelligence officers in each host country.

The CIA and the White House, citing national security concerns and the value of the program, have dissuaded Congress from demanding that the agency answer questions in open testimony about the conditions under which captives are held. Virtually nothing is known about who is kept in the facilities, what interrogation methods are employed with them, or how decisions are made about whether they should be detained or for how long.

The name of the implementation class comes from the fact that I'm getting my list from a colon delimited text file. I'll spare you the details, after all the point is just that there's some implementation.

Now if I'm using this class for just myself, this is all fine and dandy. But what happens when my friends are overwhelmed by a desire for this wonderful functionality and would like a copy of my program? If they also store their movie listings in a colon delimited text file called "movies1.txt" then everything is wonderful. If they have a different name for their movies file, then it's easy to put the name of the file in a properties file. But what if they have a completely different form of storing their movie listing: a SQL database, an XML file, a web service, or just another format of text file? In this case we need a different class to grab that data. Now because I've defined a MovieFinder interface, this won't alter my moviesDirectedBy method. But I still need to have some way to get an instance of the right finder implementation into place.

Other jobs at the top of the study's list include actuary

X
Welcome to the new ScientificAmerican.com

Enjoy the same timely, authoritative content in a cleaner, more readable site design—plus new additions that aimed to make the site serve your needs better. Newcomers and dedicated readers alike, we encourage you to explore the website. Take a look around and feel free to leave comments.

Thank you for reading Scientific American.

Her job entails working as part of a virtual team that designs mathematically based computer programs, some of which have been used to make films such as "The Matrix" and "Speed Racer." She telecommutes from her home and rarely works overtime or feels stressed out. "Problem-solving involves a lot of thinking," says Ms. Courter. "I find that calming."

Other jobs at the top of the study's list include actuary, statistician, biologist, software engineer and computer-systems analyst, historian and sociologist.

Mark Nord is a sociologist working for the Department of Agriculture's Economic Research Service in Washington, D.C. He studies hunger in American households and writes research reports about his findings. "The best part of the job is the sense that I'm making some contribution to good policy making," he says. "The kind of stuff that I crank out gets picked up by advocacy organizations, media and policy officials."

The study estimates sociologists earn $63,195, though Mr. Nord, 62, says his income is about double that amount. He says he isn't surprised by the findings because his job generates little stress and he works a steady 7:30 a.m. to 4 p.m. schedule. "It's all done at the computer at my desk," he says. "The main occupational hazard is carpal tunnel syndrome."


Supplemental Material
Sidebar
Glossary Sidebar
What is the Killer App? Overview
Semantic Web .The entertainment system was belting out the Beatles' "We Can Work It Out" when the phone rang. When Pete answered, his phone turned the sound down by sending a message to all the other local devices that had a volume control. His sister, Lucy, was on the line from the doctor's office: "Mom needs to see a specialist and then has to have

a series of physical therapy sessions. Biweekly or something. I'm going to have my agent set up the appointments." Pete immediately agreed to share the chauffeuring.

largest retailer. It's the world's largest company--bigger

Components and Services
The topic of wiring elements together drags me almost immediately into the knotty terminology problems that surround the terms service and component. You find long and contradictory articles on the definition of these things with ease. For my purposes here are my current uses of these overloaded terms.

I use component to mean a glob of software that's intended to be used, without change, by application that is out of the control of the writers of the component. By 'without change' I mean that the using application doesn't change the source code of the components, although they may alter the component's behavior by extending it in ways allowed by the component writers.

A service is similar to a component in that it's used by foreign applications. The main difference is that I expect a component to be used locally (think jar file, assembly, dll, or a source import). A service will be used remotely through some remote interface, either synchronous or asynchronous (eg web service, messaging system, RPC, or socket.)

I mostly use service in this article, but much of the same logic can be applied to local components too. Indeed often you need some kind of local component framework to easily access a remote service. But writing "component or service" is tiring to read and write, and services are much more fashionable at the moment.

Therein lies the basic conundrum of doing business with the world's largest retailer. By selling a gallon of kosher dills for less than most grocers sell a quart, Wal-Mart may have provided a ser-vice for its customers. But what did it do for Vlasic? The pickle maker had spent decades convincing customers that they should pay a premium for its brand. Now Wal-Mart was practically giving them away. And the fevered buying spree that resulted distorted every aspect of Vlasic's operations, from farm field to factory to financial statement.Nineteen years ago, Jennifer Courter set out on a career path that has since provided her with a steady stream of lucrative, low-stress jobs. Now, her occupation -- mathematician -- has landed at the top spot on a new study ranking the best and worst jobs in the U.S.


Scott Brundage."It's a lot more than just some boring subject that everybody has to take in school," says Ms. Courter, a research mathematician at mental images Inc., a maker of 3D-visualization software in San Francisco. "It's the science of problem-solving."

The study, released Tuesday from CareerCast.com, a new job site, evaluates 200 professions to determine the best and worst according to five criteria inherent to every job: environment, income, employment outlook, physical demands and stress. (CareerCast.com is published by Adicio Inc., in which Wall Street Journal owner News Corp. holds a minority stake.)


Indeed, as Vlasic discovered, the real story of Wal-Mart, the story that never gets told, is the story of the pressure the biggest retailer relentlessly applies to its suppliers in the name of bringing us "every day low prices." It's the story of what that pressure does to the companies Wal-Mart does business with, to U.S. manufacturing, and to the economy as a whole. That story can be found floating in a gallon jar of pickles at Wal-Mart.

largest retailer. It's the world's largest company--bigger Wal-Mart is not just the world's than ExxonMobil, General Motors, and General Electric. The scale can be hard to absorb. Wal-Mart sold $244.5 billion worth of goods last year. It sells in three months what

A gallon-sized jar of whole pickles is something to behold.

Note that it may be desirable to call this function before the onload event as well, causing the document to “paint” with our style sheet preference.

The CIA has been hiding and interrogating some of its most important al Qaeda captives at a Soviet-era compound in Eastern Europe, according to U.S. and foreign officials familiar with the arrangement.

The secret facility is part of a covert prison system set up by the CIA nearly four years ago that at various times has included sites in eight countries, including Thailand, Afghanistan and several democracies in Eastern Europe, as well as a small center at the Guantanamo Bay prison in Cuba, according to current and former intelligence officials and diplomats from three continents.



onUnload
To save the cookie in the onunload event is simpler. All we have to do is use the getActiveStyleSheet() function to return the active style sheet, and save this in a cookie. Using the function to store a cookie we will end up with something like this:
One of the entertaining things about the enterprise Java world is the huge amount of activity in building alternatives to the mainstream J2EE technologies, much of it happening in open source. A lot of this is a reaction to the heavyweight complexity in the mainstream J2EE world, but much of it is also exploring alternatives and coming up with creative ideas. A common issue to deal with is how to wire together different elements: how do you fit together this web controller architecture with that database interface backing when they were built by different teams with little knowledge of each other.A number of frameworks have taken a stab at this problem, and several are branching out to provide a general capability to assemble components from different layers. These are often referred to as lightweight containers, examples include PicoContainer, and Spring.

Underlying these containers are a number of interesting design principles, things that go beyond both these specific containers and indeed the Java platform. Here I want to start exploring some of these principles. The examples I use are in Java, but like most of my writing the principles are equally applicable to other OO environments, particularly .NET.

The implementation of this function is naive in the extreme, it asks a finder object (which we'll get to in a moment) to return every film it knows about. Then it just hunts through this list to return those directed by a particular director. This particular piece of naivety I'm not going to fix, since it's just the scaffolding for the real point of this article.

A gallon-sized jar of whole pickles is something to behold. The jar is the size of a small aquarium. The fat green pickles, floating in swampy juice, look reptilian, their shapes exaggerated by the glass. It weighs 12 pounds, too big to carry with one hand. The gallon jar of pickles is a display of abundance and excess; it is entrancing, and also vaguely unsettling. This is the product that Wal-Mart fell in love with: Vlasic's gallon jar of pickles.

Wal-Mart priced it at $2.97--a year's supply of pickles for less than $3! "They were using it as a 'statement' item," says Pat Hunn, who calls himself the "mad scientist" of Vlasic's gallon jar. "Wal-Mart was putting it before consumers, saying, This represents what Wal-Mart's about. You can buy a stinkin' gallon of pickles for $2.97. And it's the nation's number-one brand."


The real point of this article is this finder object, or particularly how we connect the lister object with a particular finder object. The reason why this is interesting is that I want my wonderful moviesDirectedBy method to be completely independent of how

Here’s where a little bit of

Swappin’ Styles
When a document is initially loaded, the persistent and preferred style sheets are applied to the document. The alternate style sheets can then be selected by the user. The W3C tells us that the browser should give us a choice of the style sheet we want to use, and suggests that perhaps a drop–down menu or tool bar will be provided.

There is a w3c specified DOM Level 2 attribute, “disabled,” that is set to false when a style sheet is applied to the document. This attribute is correctly implemented in Mozilla, but unfortunately not in MSIE.

MSIE does have a proprietary HTML attribute, also called “disabled,” that applies to link elements. This attribute is initially set to false for all link elements.

To set the MSIE disabled attribute to match the DOM Level 2 disabled attribute, we can call the setActiveStyleSheet() function with the name of the preferred style sheet.
In the onload function, we first set a title variable. This either holds the value of the previous style sheet that is stored in the cookie, or if there isn’t one, the title of our preferred style sheet. To keep things logical, let’s call the cookie “style.”

Next we call up the setActiveStyleSheet() function passing the title variable as the title. Our onload function looks something like this:


To find out which style sheet is the preferred style sheet, we need another function. Because this function is so similar to the getActiveStyleSheet() function I’m not going to explain how it works, but here is what it may look like:


So far, so good. We have several style sheets and the visitor can choose their favorite from a menu. But then we encounter a problem. A major one. Mozilla provides a menu to select the style sheet we want to use under the view menu item. But Microsoft Internet Explorer (MSIE) provides no such menu. So we have several style sheets, and no way to access them in MSIE.

Here’s where a little bit of JavaScript can be used along with the DOM to provide a way for MSIE and Mozilla users to select the style sheet they want to use. Their preference can also be stored in a cookie. And because we are using the link tags as the W3C tells us to, the JavaScript doesn’t interfere with the menu in Mozilla, and it degrades very gracefully.

First we loop through all the link elements

Even though he had voted for Obama, McChrystal and his new commander in chief failed from the outset to connect. The general first encountered Obama a week after he took office, when the president met with a dozen senior military officials in a room at the Pentagon known as the Tank. According to sources familiar with the meeting, McChrystal thought Obama looked "uncomfortable and intimidated" by the roomful of military brass. Their first one-on-one meeting took place in the Oval Office four months later, after McChrystal got the Afghanistan job, and it didn't go much better. "It was a 10-minute photo op," says an adviser to McChrystal. "Obama clearly didn't know anything about him, who he was. Here's the guy who's going to run his fucking war, but he didn't seem very engaged. The Boss was pretty disappointed."

Cookies
Now we can change the style sheet. Cool. We have a more personalized page. Excellent. But we don’t have a personalized site. The preference is only applied to the current page; when we leave the current page the preference leaves with us. This situation, however, can be rectified with a cookie.

To store a cookie we need another function to return the current style sheet. We also need two functions to store and read the cookie.

To return the current style sheet we look for an active preferred or alternate style sheet and check its title.

First we loop through all the link elements in the document again. We then check whether the link is a style sheet. If it is, we check whether the style sheet has a title. This tells us that the style sheet is either preferred or alternative.

The last check is to see whether or not the style sheet is active. If all three checks return true, we have the current style sheet and we can return the title.


he other constraint of the physical world is physics itself. The radio spectrum can carry only so many stations, and a coaxial cable so many TV channels. And, of course, there are only 24 hours a day of programming. The curse of broadcast technologies is that they are profligate users of limited resources. The result is yet another instance of having to aggregate large audiences in one geographic area - another high bar, above which only a fraction of potential content rises.

The past century of entertainment has offered an easy solution to these constraints. Hits fill theaters, fly off shelves, and keep listeners and viewers from touching their dials and remotes. Nothing wrong with that; indeed, sociologists will tell you that hits are hardwired into human psychology, the combinatorial effect of conformity and word of mouth. And to be sure, a healthy share of hits earn their place: Great songs, movies, and books attract big, broad audiences.
These style sheets are enabled by default (they are “on” when the page is loaded). They can then be disabled if the user selects an alternate style sheet.

To make a style sheet preferred, the rel attribute is set to “stylesheet” and the style sheet is named with the title attribute.

Several preferred style sheets can be grouped together by giving them identical title attributes. These grouped style sheets are then all enabled and disabled together. If more than one group of preferred style sheets are declared, the first group takes precedence.

To make paul.css preferred, a title attribute is added, giving the default style a name.
This allows the visitor to personalize a site and choose his or her favorite scheme. They can also be used for accessibility.

John Legend is modern R&B's classiest male singer, bringing old-fashioned suavity to hip-hop soul; the Roots are the world's most versatile (and maybe best) band. Together, they have made a brilliantly conceived and executed album, reviving music from the Nixon-era heyday of politically engaged R&B. Bustling through funk, Philly soul and gospel, taking on songs famous (Marvin Gaye's "Wholy Holy") and obscure (Mike James Kirkland's "Hang on in There"), Legend and the Roots capture the old feeling of protest and uplift while updating the sound. They're not imitators — they're heirs.

To specify an alternate style sheet, the rel attribute is set to “alternate stylesheet” and the style sheet is named with a title attribute. As with preferred sheets, these style sheets can also be grouped together by giving them identical title attributes.

Using the previous example again; to make paul.css into an alternate style sheet, the keyword “alternate” is added to the rel attribute.

When Barack Obama entered the Oval Office

So you've got a web page. You’ve marked it up with structural XHTML. You’ve also been a good little web developer and used style sheets to control what your document looks like. You’ve even gone the extra mile and created several alternative style sheets to show how hardcore you are.

Great. But now you need a cross-browser way to dynamically switch between the style sheets.

Styling your site
Style sheets can be associated with documents using a list of link elements in the head. There are three different relationships external style sheets can have with the document: persistent, preferred, and alternate.

Persistent
These style sheets are always enabled (they are always “on”) and are combined with the active style sheet. They can be used for shared rules common to every style sheet. To make a style sheet persistent, the rel attribute is set to “stylesheet” and no title attribute is set.

To make the style sheet paul.css persistent, the following link element would be included in the head:

The next morning, McChrystal and his team gather to prepare for a speech he is giving at the École Militaire, a French military academy. The general prides himself on being sharper and ballsier than anyone else, but his brashness comes with a price: Although McChrystal has been in charge of the war for only a year, in that short time he has managed to piss off almost everyone with a stake in the conflict. Last fall, during the question-and-answer session following a speech he gave in London, McChrystal dismissed the counterterrorism strategy being advocated by Vice President Joe Biden as "shortsighted," saying it would lead to a state of "Chaos-istan." The remarks earned him a smackdown from the president himself, who summoned the general to a terse private meeting aboard Air Force One. The message to McChrystal seemed clear: Shut the fuck up, and keep a lower profile

Now, flipping through printout cards of his speech in Paris, McChrystal wonders aloud what Biden question he might get today, and how he should respond. "I never know what's going to pop out until I'm up there, that's the problem," he says. Then, unable to help themselves, he and his staff imagine the general dismissing the vice president with a good one-liner.

"Are you asking about Vice President Biden?" McChrystal says with a laugh. "Who's that?"

"Biden?" suggests a top adviser. "Did you say: Bite Me?"

When Barack Obama entered the Oval Office, he immediately set out to deliver on his most important campaign promise on foreign policy: to refocus the war in Afghanistan on what led us to invade in the first place. "I want the American people to understand," he announced in March 2009. "We have a clear and focused goal: to disrupt, dismantle and defeat Al Qaeda in Pakistan and Afghanistan." He ordered another 21,000 troops to Kabul, the largest increase since the war began in 2001. Taking the advice of both the Pentagon and the Joint Chiefs of Staff, he also fired Gen. David McKiernan – then the U.S. and NATO commander in Afghanistan – and replaced him with a man he didn't know and had met only briefly: Gen. Stanley McChrystal. It was the first time a top general had been relieved from duty during wartime in more than 50 years, since Harry Truman fired Gen. Douglas MacArthur at the height of the Korean War.

We have two KIAs, but that hasn't been confirmed

For too long we've been suffering the tyranny of lowest-common-denominator fare, subjected to brain-dead summer blockbusters and manufactured pop. Why? Economics. Many of our assumptions about popular taste are actually artifacts of poor supply-and-demand matching - a market response to inefficient distribution.

The main problem, if that's the word, is that we live in the physical world and, until recently, most of our entertainment media did, too. But that world puts two dramatic limitations on our entertainment.

The first is the need to find local audiences. An average movie theater will not show a film unless it can attract at least 1,500 people over a two-week run; that's essentially the rent for a screen. An average record store needs to sell at least two copies of a CD per year to make it worth carrying; that's the rent for a half inch of shelf space. And so on for DVD rental shops, videogame stores, booksellers, and newsstands.

In each case, retailers will carry only content that can generate sufficient demand to earn its keep. But each can pull only from a limited local population - perhaps a 10-mile radius for a typical movie theater, less than that for music and bookstores, and even less (just a mile or two) for video rental shops. It's not enough for a great documentary to have a potential national audience of half a million; what matters is how many it has in the northern part of Rockville, Maryland, and among the mall shoppers of Walnut Creek, California.

The general stands and looks around the suite that his traveling staff of 10 has converted into a full-scale operations center. The tables are crowded with silver Panasonic Toughbooks, and blue cables crisscross the hotel's thick carpet, hooked up to satellite dishes to provide encrypted phone and e-mail communications. Dressed in off-the-rack civilian casual – blue tie, button-down shirt, dress slacks – McChrystal is way out of his comfort zone. Paris, as one of his advisers says, is the "most anti-McChrystal city you can imagine." The general hates fancy restaurants, rejecting any place with candles on the tables as too "Gucci." He prefers Bud Light Lime (his favorite beer) to Bordeaux, Talladega Nights (his favorite movie) to Jean-Luc Godard. Besides, the public eye has never been a place where McChrystal felt comfortable: Before President Obama put him in charge of the war in Afghanistan, he spent five years running the Pentagon's most secretive black ops.

"What's the update on the Kandahar bombing?" McChrystal asks Flynn. The city has been rocked by two massive car bombs in the past day alone, calling into question the general's assurances that he can wrest it from the Taliban.

There is plenty of great entertainment with potentially large, even rapturous, national audiences that cannot clear that bar. For instance, The Triplets of Belleville, a critically acclaimed film that was nominated for the best animated feature Oscar this year, opened on just six screens nationwide. An even more striking example is the plight of Bollywood in America. Each year, India's film industry puts out more than 800 feature films. There are an estimated 1.7 million Indians in the US. Yet the top-rated (according to Amazon's Internet Movie Database) Hindi-language film, Lagaan: Once Upon a Time in India, opened on just two screens, and it was one of only a handful of Indian films to get any US distribution at all. In the tyranny of physical space, an audience too thinly spread is the same as no audience at all.

McChrystal takes a final look around the suite. At 55, he is gaunt and lean, not unlike an older version of Christian Bale in Rescue Dawn. His slate-blue eyes have the unsettling ability to drill down when they lock on you. If you've fucked up or disappointed him, they can destroy your soul without the need for him to raise his voice.

"I'd rather have my ass kicked by a roomful of people than go out to this dinner," McChrystal says.

He pauses a beat.

"Unfortunately," he adds, "no one in this room could do it."

AVOID GETTING DEFENSIVE

AVOID GETTING DEFENSIVE. Do you ever take what another person says personally when what her or she is saying is not meant to be personal? Do you ever become angry at what another person says? Careful listening does not mean that you will always agree with the other party's point of view, but it does mean that you will try to listen to what the other person is saying without becoming overly defensive. Too much time spent explaining, elaborating, and defending your decision or position is a sure sign that you are not listening. This is because your role has changed from one of listening to a role of convincing others they are wrong.

After listening to a position or suggestion with which you disagree, simply respond with something like, "I understand your point. We just disagree on this one." Effective listeners can listen calmly to another person even when that person is offering unjust criticism.PRACTICE PARAPHRASING. Paraphrasing is the art of putting into your own words what you thought you heard and saying it back to the sender. For example, a subordinate might say: "You have been unfair to rate me so low on my performance appraisal. You have rated me lower than Jim. I can do the job better than him, and I've been here longer." A paraphrased response might be: "I can see that you are upset about your rating. You think it was unfair for me to rate you as I did." Paraphrasing is a great technique for improving your listening and problem-solving skills. First, you have to listen very carefully if you are going to accurately paraphrase what you heard. Second, the paraphrasing response will clarify for the sender that his or her message was correctly received and encourage the sender to expand on what he or she is trying to communicate.

The next morning, McChrystal and his team gather to prepare for a speech he is giving at the École Militaire, a French military academy. The general prides himself on being sharper and ballsier than anyone else, but his brashness comes with a price: Although McChrystal has been in charge of the war for only a year, in that short time he has managed to piss off almost everyone with a stake in the conflict. Last fall, during the question-and-answer session following a speech he gave in London, McChrystal dismissed the counterterrorism strategy being advocated by Vice President Joe Biden as "shortsighted," saying it would lead to a state of "Chaos-istan." The remarks earned him a smackdown from the president himself, who summoned the general to a terse private meeting aboard Air Force One. The message to McChrystal seemed clear: Shut the fuck up, and keep a lower profile

When Barack Obama entered the Oval Office, he immediately set out to deliver on his most important campaign promise on foreign policy: to refocus the war in Afghanistan on what led us to invade in the first place. "I want the American people to understand," he announced in March 2009. "We have a clear and focused goal: to disrupt, dismantle and defeat Al Qaeda in Pakistan and Afghanistan." He ordered another 21,000 troops to Kabul, the largest increase since the war began in 2001. Taking the advice of both the Pentagon and the Joint Chiefs of Staff, he also fired Gen. David McKiernan – then the U.S. and NATO commander in Afghanistan – and replaced him with a man he didn't know and had met only briefly: Gen. Stanley McChrystal. It was the first time a top general had been relieved from duty during wartime in more than 50 years, since Harry Truman fired Gen. Douglas MacArthur at the height of the Korean War.

Even though he had voted for Obama, McChrystal and his new commander in chief failed from the outset to connect. The general first encountered Obama a week after he took office, when the president met with a dozen senior military officials in a room at the Pentagon known as the Tank. According to sources familiar with the meeting, McChrystal thought Obama looked "uncomfortable and intimidated" by the roomful of military brass. Their first one-on-one meeting took place in the Oval Office four months later, after McChrystal got the Afghanistan job, and it didn't go much better. "It was a 10-minute photo op," says an adviser to McChrystal. "Obama clearly didn't know anything about him, who he was. Here's the guy who's going to run his fucking war, but he didn't seem very engaged. The Boss was pretty disappointed


Now, flipping through printout cards of his speech in Paris, McChrystal wonders aloud what Biden question he might get today, and how he should respond. "I never know what's going to pop out until I'm up there, that's the problem," he says. Then, unable to help themselves, he and his staff imagine the general dismissing the vice president with a good one-liner.