<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Graham King</title>
	
	<link>http://www.darkcoding.net</link>
	<description>Solvitas perambulum</description>
	<lastBuildDate>Mon, 01 Feb 2010 19:00:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/darkcoding" /><feedburner:info uri="darkcoding" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Treating the common cold</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/cGgthKusy5U/</link>
		<comments>http://www.darkcoding.net/misc/treating-the-common-cold/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 06:59:08 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[cold]]></category>
		<category><![CDATA[echinacea]]></category>
		<category><![CDATA[health]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[vitaminc]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=690</guid>
		<description><![CDATA[	Will Vitamin C really prevent or cure your cold?

	What about Echinacea?

	The best way to find out is to follow these simple steps:

	Gather 2000 people who have the common cold
Split them randomly into two groups of 1000
Give vitamin C to one group, and a sugar pill (the placebo) to the other
Make sure the people receiving the [...]]]></description>
			<content:encoded><![CDATA[	<p>Will Vitamin C really prevent or cure your cold?</p>

	<p>What about Echinacea?</p>

	<p>The best way to find out is to follow these simple steps:<br />
<ol></p>
	<p><li>Gather 2000 people who have the common cold</li><br />
<li>Split them randomly into two groups of 1000</li><br />
<li>Give vitamin C to one group, and a sugar pill (the placebo) to the other</li><br />
<li>Make sure the people receiving the pills and those dispensing the pills don&#8217;t know which is which (to make your trial double-blind)</li><br />
<li>Wait a bit</li><br />
<li>See if the Vitamin C group gets over their colder faster than the other group</li><br />
</ol></p>

	<p>You will of conducted a double-blind placebo controlled scientific trial.</p>

	<p>Luckily for us, we don&#8217;t have to do it ourselves. Several of these trials have already been done. Enough trials, in fact, that one can do a <a href="http://en.wikipedia.org/wiki/Meta-analysis">Meta analysis</a>, a statistical review and summary of all the trials.</p>

	<p><b>A comprehensive meta analysis, by an unbiased organization, is the gold standard of scientific inquiry; it is our best chance of knowing the truth.</b></p>

	<p>The <a href="http://en.wikipedia.org/wiki/Cochrane_Collaboration">Cochrane Collaboration</a> is an international not for profit organisation set up 15 years ago to create transparent, systematic, unbiased reviews of the medical literature on everything from drugs, through surgery, to community interventions. And I have a cold. I read their review to find out whether Vitamin C or Echinacea would be effective in treating it.</p>

	<p><h2>Vitamin C</h2></p>

	<p>Here is the review of research on <a href="http://www.cochrane.org/reviews/en/ab000980.html">Vitamin C for preventing and treating the common cold</a>.</p>

	<p><blockquote><br />
Thirty trials involving 11,350 participants suggest that regular ingestion of vitamin C has no effect on common cold incidence in the ordinary population.</p>

	<p>It reduced the duration and severity of common cold symptoms slightly, although the magnitude of the effect was so small its clinical usefulness is doubtful.</p>

	<p>Nevertheless, in six trials with participants exposed to short periods of extreme physical or cold stress or both (including marathon runners and skiers) vitamin C reduced the common cold risk by half.</p>

	<p>The failure of vitamin C supplementation to reduce the incidence of colds in the normal population indicates that routine mega-dose prophylaxis is not rationally justified for community use. But evidence suggests that it could be justified in people exposed to brief periods of severe physical exercise or cold environments.<br />
</blockquote></p>

	<p><h2>Echinacea</h2></p>

	<p>Here is their review of research on <a href="http://www.cochrane.org/reviews/en/ab000530.html">Echinacea for preventing and treating the common cold</a>.</p>

	<p><blockquote><br />
Echinacea preparations tested in clinical trials differ greatly. There is some evidence that preparations based on the aerial parts of E. purpurea might be effective for the early treatment of colds in adults but the results are not fully consistent.</p>

	<p>Beneficial effects of other Echinacea preparations, and Echinacea used for preventative purposes might exist but have not been shown in independently replicated, rigorous RCTs.<br />
</blockquote></p>

	<p>Get well soon!</p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/cGgthKusy5U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/treating-the-common-cold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/treating-the-common-cold/</feedburner:origLink></item>
		<item>
		<title>Predictably Irrational, by Dan Ariely</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/OAzyi3ufRB8/</link>
		<comments>http://www.darkcoding.net/behaviour/predictably-irrational-by-dan-ariely/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 07:12:43 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[dan ariely]]></category>
		<category><![CDATA[predictably irrational]]></category>
		<category><![CDATA[social psychology]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=668</guid>
		<description><![CDATA[
My short notes on Predictably Irrational, by Dan Ariely. An excellent book. Entertaining, and covers much fascinating ground from social psychology and behavioral economics. Some of the experiments Dan and his team designed are fiendish!



Value is relative

We only know what we want when we see it in context. The bike the Tour de France winner [...]]]></description>
			<content:encoded><![CDATA[<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=darkcoding-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0061854549" style="float:left;width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

<p>My short notes on <a href="http://www.amazon.com/gp/product/0061854549?ie=UTF8&#038;tag=darkcoding-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0061854549">Predictably Irrational</a><img src="http://www.assoc-amazon.com/e/ir?t=darkcoding-20&#038;l=as2&#038;o=1&#038;a=0061854549" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, by Dan Ariely. An excellent book. Entertaining, and covers much fascinating ground from social psychology and behavioral economics. Some of the experiments Dan and his team designed are fiendish!</p>

<hr />

<h2>Value is relative</h2>

<p>We only know what we want when we see it in context. The bike the Tour de France winner rides. A set of speakers compared to another. </p>

<p>We only know what something is worth, or how much we like it, when comparing to other similar things (purchases, partners, jobs, etc..</p>

<p><strong>We tend to choose the middle option</strong>. A high price option on a restaurant menu increases average order price, because it makes the rest seem cheap in comparison.</p>

<p><span id="more-668"></span></p>

<p>If we have several difficult to compare items, but two are easily comparable and one of those two is clearly superior to the other, we will prefer that one to <em>all</em> the other options. We can introduce a &#8216;decoy&#8217; version of one item, slightly less appealing, so that the target item is chosen. In A v B, introduce -A, and most people will choose B.</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=151">The truth about relativity</a></p>

<h2>Arbitrary coherence</h2>

<p>When we seriously contemplate buying something at a given price, that price becomes our <strong>anchor</strong>. From then on we judge other similar items relative to that price. We are coherent with our first valuation of something, even if that price is now irrelevant, arbitrary. </p>

<p>Items on sale attempt to get you to anchor at the &#8216;pre-sale&#8217; price, before introducing the sale price.</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=176">Starbucks, Dunkin Donuts, and Anchors</a></p>

<h2>Herding</h2>

<p>Joining a queue because other people are in it. Preferring a busy restaurant. Assuming something is good (or bad) on the basis of other people&#8217;s behavior.</p>

<p>Self-herding is when you do what you did before, because, well, that&#8217;s what you do. (See also: <a href="http://changingminds.org/explanations/theories/commitment.htm">commitment</a>)</p>

<p>We are irrationally attracted to FREE(!) things. We often pay a high cost in time and opportunity cost for them. Discounting from  cent to free has a much higher influence than 2 cents to 1 cent. Free is a whole different place than something that has a cost.</p>

<h2>Social Norms vs Market Norms</h2>

<p>Pay someone cheap, they don&#8217;t work much, because they use market norms and don&#8217;t feel it is worthwhile. Pay someone nothing, they work hard, because they use social norms.</p>

<p>Gifts stay within social norms, <em>unless</em> you mention the price of it, in which case people revert to market norms.  </p>

<p>Thinking about money makes people more self-reliant, selfish, solitary, individualistic.</p>

<p>Counting money is a pain buffer, makes people feel more powerful.</p>

<p>If both are present, market norms displace social norms, and it is very difficult to get the social norm back.</p>

<p>With gifts, benefits, and a good atmosphere, companies try and create a social contract with their employees. The employees hence expect the other side, the company to be there for them when they needed. Social norms require a high level of commitment from the company. Google and lots of startups get this right.</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=192">The Cost of Social Norms</a></p>

<h2>Emotions</h2>

<p>When not experiencing the emotion, we are bad at predicting our responses in a <strong>strong emotional state</strong>, such as sexual arousal, anger, hunger, excitement, jealousy, etc.</p>

<p>It is not easy to look from one emotional state to another.</p>

<p>Most people are aware that they procrastinate. Giving them tools to commit to a deadline helps them overcome it. </p>

<p>The best remedy for procrastination is <strong>an external force</strong>: Automatic payroll deductions for saving, teacher imposed assignment deadlines, exercising with a partner, etc. </p>

<p><strong>Engineer the world to force you to achieve your goal</strong>.</p>

<p>Simpler schedules are easier to commit to and more likely to be followed.</p>

<p>Package actions up into something that feels important enough to avoid procrastination. The same way auto-dealers package up our servicing into large mileage increments, and do all of it at once.</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=218">The Influence of Arousal</a></p>

<h2>Endowment effect</h2>

<p>We value what we own more than other people do. Sellers usually value their items more than buyers do.</p>

<p>The sellers focuses on the loss of the enjoyment of the item. The buyer focuses on alternate uses for the money. Seller and buyer expect the other to see things the same was as them. </p>

<p>The more work you put into something, the more ownership you feel. The <a href="http://hbr.org/web/2009/hbr-list/ikea-effect-when-labor-leads-to-love">Ikea Effect</a>, because you assembled it yourself.</p>

<p>The endowment effect is why companies offer &#8216;trial&#8217; rates and &#8216;money back guarantees&#8217;. Once we have something, own it, we value it more. A &#8216;virtual ownership&#8217; applies to trying on clothes, and especially to online auctions. </p>

<p>The endowment effect applies to ideas too. We don&#8217;t want to let go of them, so they become a rigid ideology.</p>

<p>People dislike losing options, and will work quite hard to keep all their options open, eve if that means occasionally ignore their best option.</p>

<p>Often, we are presented with two or more very similar options. In this case <strong>the biggest cost is that of not choosing</strong> &#8211; the time spent deciding is time we are enjoying neither option.</p>

<p>Life usually conforms to our expectations, so you can influence results by setting expectations. Marketing sets expectations.</p>

<p>Video: <a href="[http://www.predictablyirrational.com/?page_id=348">Dating, doors, and loss aversion</a></p>

<h2>Priming</h2>

<p>Priming is putting thoughts into someones head. </p>

<p>Often, an experiment will ask people to unscramble a word, that word is chosen to make them think the priming thought.</p>

<p>Priming is a <a href="http://en.wikipedia.org/wiki/Context_effects">context effect</a>: Being influenced by something irrelevant in our immediate environment. </p>

<p>Two parties in a conflict, having already strongly committed to one side, need a neutral third party to resolve their conflict.</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=350">The Effect of Expectations</a></p>

<h2>Placebos</h2>

<p>Placebos are <em>belief</em> and <em>conditioning</em>. Many, maybe most, surgical procedures are not placebo tested.</p>

<h2>Honesty</h2>

<p>We internalize social virtues, so our conscience keeps us broadly honest.</p>

<p><strong>Given the opportunity, most people will cheat a little bit.</strong> A greater potential and reward for cheating doesn&#8217;t increase the cheating. Being reminded of the Ten Commandments, or of honor systems, eliminates the cheating.</p>

<p>People are more likely to cheat for non-monetary items &#8211; steal a pen from work, but not the value of the pen from the petty cash box.</p>

<p>It seems that people will only cheat within the limits their conscience (super-ego) allows them. <strong>We cheat to the extent we can justify it to ourselves.</strong></p>

<p>&#8220;It is difficult to get a man to understand something when his salary depends upon his not understanding it&#8221; &#8211; Upton Sinclair</p>

<p>Video: <a href="http://www.predictablyirrational.com/?page_id=224">The Context of our Character</a></p>

<hr />

<p>Dan Ariely maintains an excellent website with links to research papers from the book, and much more, here: <a href="http://www.predictablyirrational.com/">http://www.predictablyirrational.com/</a>.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/OAzyi3ufRB8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/behaviour/predictably-irrational-by-dan-ariely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/behaviour/predictably-irrational-by-dan-ariely/</feedburner:origLink></item>
		<item>
		<title>Influence, by Robert Cialdini</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/5hTVAJM_j8w/</link>
		<comments>http://www.darkcoding.net/behaviour/influence-by-robert-cialdini/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 06:42:09 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[influence behavior cialdini presuasion social psychology socialpsychology]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=652</guid>
		<description><![CDATA[
As an Amazon reviews says, &#8220;arguably the best book ever on what is increasingly becoming the science of persuasion.&#8221;

If you want to understand why you felt compelled to give money to a Hare Krishna devotee, how car salesman or realtor&#8217;s work, and much more, you should read this.  

It&#8217;s also a very easy and [...]]]></description>
			<content:encoded><![CDATA[<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=darkcoding-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=006124189X" style="float:left;width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

<p>As an Amazon reviews says, <strong>&#8220;arguably the best book ever on what is increasingly becoming the science of persuasion.&#8221;</strong></p>

<p>If you want to understand why you felt compelled to give money to a Hare Krishna devotee, how car salesman or realtor&#8217;s work, and much more, you should read this.  </p>

<p>It&#8217;s also a very easy and enjoyable read. These are my notes. They cover all the content in the book, but don&#8217;t link to research. In the book, most of the statements have links to research papers to back them up.</p>

<p>Get <a href="http://www.amazon.com/gp/product/006124189X?ie=UTF8&#038;tag=darkcoding-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=006124189X">Influence: The Psychology of Persuasion</a><img src="http://www.assoc-amazon.com/e/ir?t=darkcoding-20&#038;l=as2&#038;o=1&#038;a=006124189X" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
 from your local library, this has sold so many copies they are bound to have some.</p>

<hr />

<h1>Heuristics</h1>

<p>We can process incoming information cognitively in one of two ways: </p>

<ul>
<li><strong>Controlled responding</strong>, which is subjecting information to a thorough analysis. This is when we think a problem through, research it, etc. We only do this if we have the desire and the ability. It is intellectually taxing and time consuming.</li>
<li><p>Use <strong>judgmental heuristics</strong> such as:</p>

<ul><li><em>Price as surrogate for value</em>. Applies particularly to items which are hard to value: Wine, jewelry, art, employee salaries, etc.</li>
<li><em>Trust experts</em>. This is why pseudo-science books always have &#8216;PhD&#8217; or &#8216;MD&#8217; after the author&#8217;s name.</li>
<li><em>Because</em> &#8211; we want reasons to do something, even bogus ones.</li></ul></li>
</ul>

<p><span id="more-652"></span></p>

<p><strong><a href="http://changingminds.org/principles/contrast.htm">Contrast principle</a></strong>: Two different things presented together or sequentially will feel more different than they really are. Hence <em>sell the expensive item first</em>, as the other items will seem cheap after that. <a href="http://en.wikipedia.org/wiki/Good_cop/bad_cop">Good cop / bad cop</a> is about creating a contrast between the two, to increase liking of the &#8216;good cop&#8217;.</p>

<p>A <strong>fixed action pattern</strong> is an automatic behavior pattern often triggered by a single item in the information. Also known as a <em>heuristic</em>.</p>

<h2>Reciprocity</h2>

<p>A <a href="http://en.wikipedia.org/wiki/International_Society_for_Krishna_Consciousness">Hare Krishna</a> devotee presses a flower or a copy of the Bhagavad-gītā into your hand (that happened to me), or a store gives you free samples, and you feel awkward about taking it for free. You end up giving money or buying something you don&#8217;t want. That&#8217;s the <a href="http://en.wikipedia.org/wiki/Norm_of_reciprocity">norm of reciprocity</a> at work.</p>

<p>We also reciprocate to <strong>concessions</strong>. Start witha large but not unreasonable request, which gets rejected, then &#8216;retreat&#8217; to the target request. People who comply after this technique has been used on them feel more satisfied with their decision than those who agree straight away, because they &#8216;bargained&#8217; for it. They shaped the outcome, so they feel ownership for it.</p>

<p>A recent research article I read (apologies, can&#8217;t locate link right now) supports this, by saying that when the seller of a product is the first to quote a price (typically quite high), the product sells for more than when the buyer opens the negotiation (with typically a low price).</p>

<p><strong>Surprise</strong> increase the likelihood of the target using heuristics instead of controlled responding. A shaved headed person in orange robes shoving an ancient Indian text at you, that&#8217;s surprising.</p>

<h2>Consistency / Commitments</h2>

<p>We wish to think of ourselves, and appear to others, as being consistent in our behavior, we apply the <a href="http://changingminds.org/principles/consistency.htm">consistency principle</a> heuristic. We make up reasons to justify our behavior, to seem logical and in line with our previous behaviors.</p>

<p><a href="http://en.wikipedia.org/wiki/Foot-in-the-door_technique">Foot in the door technique</a>: Start small and build. Extract a small inconsequential commitment, then a slightly bigger one, and so on.</p>

<p><strong>Commitments</strong> are most effective when they are:</p>

<ul>
<li><strong>Public</strong>: Forces us to stick to it to look consistent. Especially effective for those whith lots of pride or public self-consciousness.</li>
<li><strong>Active</strong>: Perform some action to take the commitment, such as writing, swearing an oath (also public), etc.</li>
<li><strong>Effort-full</strong>: The bigger the price the bigger the commitment. Hazing / initiation ceremonies. Extract a bigger effort with foor-in-the-door technique.</li>
<li><strong>Freely chosen</strong>:Avoid threats, or any external reward such as prizes. The commitment must feel freely chosen for the person to accept responsibility for it, it must feel internally motivated.</li>
</ul>

<p>Caveat: If the commitment alone gets the same result as the goal, we may not pursue the goal. For example if you are going to attend law school so that people will think you are clever, and telling people you are going to attend gets the response and recognition desired, the motivation to actually attend is removed.</p>

<p>Commitments get internally justified, they grow their own legs. Car salesman will often <em>low ball</em> you, offer an artificially low price.<br />
You gladly accept the low price. Time passes as you fill in some forms, test drive, etc. They take the paperwork to their manager for final approval. Manager comes out and explains the salesman made a mistake, the price is higher.<br />
You would of refused the higher price originally, but now you are committed, and much more likely to accept the high price.</p>

<h2>Social Proof</h2>

<p>The greater the number of people who find any idea correct, the more a given individual will perceive the idea to be correct. This is the <a href="http://en.wikipedia.org/wiki/Social_proof">Social Proof</a> heuristic.</p>

<p><strong>We look to others for behavioral guidance when we are unsure, in an unclear, unfamiliar, or ambiguous situation.</strong> Often in such situations others do the same thing, which leads to <em>pluralistic ignorance</em>. </p>

<p>In an unclear emergency situation, a lone bystander will help, but a group looks to each other to decide how to act, and does nothing. This is the <a href="http://en.wikipedia.org/wiki/Bystander_effect">Bystander effect</a>.</p>

<p>In an emergency situation you need to reduce the uncertainty experienced by bystanders:</p>

<ul>
<li>Pick one and speak directly to him</li>
<li>Say you need help</li>
<li>Tell him how to help (&#8221;Call an ambulance&#8221;, &#8220;Help me out of my car&#8221;, etc)</li>
</ul>

<p>Social proof is strongest when the others we look to for guidance are similar to ourselves. Hence Joe Average in television adverts.</p>

<p>Individuals in psychological pain look to others in similar situations to see how to deal with it. After a widely reported high-profile suicide, suicides increase, often using a similar method. Copycat crimes work in a similar fashion.</p>

<p>Books, products, feature <em>One Million Sold</em> or <em>New York Times Bestseller</em> on the packaging. Informing someone that many people like him (NY Times readers) have adopted a certain behavior makes them more likely to also adopt that behavior. Testimonials.</p>

<h2>Liking</h2>

<p>We prefer to buy from people we like. <strong>The strength of the social bond is twice as likely to determine product purchase as is preference for the product itself.</strong></p>

<p>So, what makes us like people?</p>

<h3>Physical attractiveness</h3>

<p>More attractive people, all other things being equal, are:</p>

<ul>
<li>paid higher salaries</li>
<li>less likely to be sent to jail</li>
<li>more likely to be helped in an emergency</li>
<li>more persuasive</li>
<li>seen as possessing more of the desirable personality traits</li>
<li>seen as having higher intellectual capacity</li>
</ul>

<p>It&#8217;s pretty shocking, I know, but the <a href="http://www.google.ca/search?q=attractive+people+more+successful">evidence is plentiful</a>.</p>

<p>Physical attractiveness triggers the <a href="http://en.wikipedia.org/wiki/Halo_effect">Halo Effect</a>, where one positive characteristic dominates the way that person is viewed by others.</p>

<h3>Similarity</h3>

<p><strong>We like people like us</strong>, whether that &#8216;like us&#8217; is because they share opinions, personality traits, background, or lifestyle. To influence, try and match the target in as many ways as possible:</p>

<ul>
<li>Dress</li>
<li>Interests</li>
<li>Background</li>
<li>Age, religion, politics, specific habits</li>
<li>Posture, verbal style, mood, etc. See <a href="http://en.wikipedia.org/wiki/Mirroring_%28psychology%29">Mirroring</a>.</li>
</ul>

<h3>Compliments</h3>

<p>People want to be liked. Be nice, pay compliments, send a greeting card. There is evidence that positive comments make the giver more likable even when the receiver knows the compliment is not genuine.</p>

<h3>Contact and co-operation</h3>

<p>Positive familiarity. <strong>Familiarity caused by contact leads to liking, <em>unless</em> the contact occurs under unpleasant circumstances.</strong></p>

<p>Here is a recipe for creating cross-group hatred: Split people into two groups. Name each one, to increase group identity (creating a <a href="http://www.darkcoding.net/behaviour/how-we-know-what-isnt-so-by-thomas-gilovich/">minimum group</a>). Wait. Then mix  the two groups in competitive actions.</p>

<p>And here&#8217;s how to fix it: Successful joint ventures towards common goals.</p>

<h3>Association</h3>

<p><strong>An innocent association with good or bad things will influence the way people think about that us</strong></p>

<ul>
<li>Showing a credit card logo to people with positive associations to credit cards (most people) made them tip more, even when paying cash. </li>
<li>Killing the messenger: An association with bad news, used to be bad news for the messenger.</li>
<li>Celebrity endorsments. Sponsorship of the Olympics, or whatever cultural event is popular, even if the connection doesn&#8217;t make sense. </li>
<li>Stand attractive people by your product. Their beauty somehow &#8216;rubs off&#8217; to make your product more appealing. </li>
<li>Hometown team victory makes us feel good, even though we obviously had no part in the victory.  </li>
<li><a href="http://en.wikipedia.org/wiki/Reductio_ad_Hitlerum">Reductio ad Hitlerum</a>: &#8220;Hitler was a vegetarian, so vegetarianism is wrong.&#8221;  </li>
</ul>

<p>Taken to extremes this is a personality flaw, showing low self worth, exhibited by groupies, sports fans, etc.</p>

<h2>Authority</h2>

<p><strong>We trust experts, we obey experts</strong>. Often the appearance (symbols) of authority are enough, symbols such as:</p>

<ul>
<li>Titles: PhD, M.D., Dr., Professor.</li>
<li>Clothes: Medicine is advertised on TV by actors in white lab coats.</li>
<li>Trappings: Car, house, &#8216;lifestyle&#8217;.</li>
</ul>

<p>The seminal research on obedience to authority, and probably the most famous study in social psychology, is the <a href="http://en.wikipedia.org/wiki/Milgram_experiment">Stanley Milgram experiment</a>.</p>

<h2>Scarcity</h2>

<p>Opportunities seem more valuable when they are less available. <a href="http://changingminds.org/principles/scarcity.htm">Scarcity heuristic</a> applies to information and goods.</p>

<p>If something is in short supply, everyone else must of wanted it, so it must be good.<br />
If something is in short supply, we are about to lose the freedom of acquiring it. </p>

<p><a href="http://en.wikipedia.org/wiki/Reactance_%28psychology%29">Reactance theory</a> says that an attempt to restrict something makes us want it more, and hence assume it is more valuable and desirable than we previously thought.</p>

<p>Things that recently became scarce are perceived as more valuable than things that have been scarce a long time. We react to a freedom being taken away.</p>

<p>Competition for a scarce item increases perceived value of the item, beyond scarcity alone, or social proof alone. Hence: Auctions.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/5hTVAJM_j8w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/behaviour/influence-by-robert-cialdini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/behaviour/influence-by-robert-cialdini/</feedburner:origLink></item>
		<item>
		<title>How we know what isn’t so, by Thomas Gilovich</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/EhJXSY1a8V8/</link>
		<comments>http://www.darkcoding.net/behaviour/how-we-know-what-isnt-so-by-thomas-gilovich/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 06:27:59 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[social psychology socialpsychology reason influence]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=622</guid>
		<description><![CDATA[
By Thomas Gilovich, social psychologist and CSI Fellow, this well written book explains some of the reasoning and deduction errors we make when trying to understand the world, and ways to avoid making those errors.

This is an easy and engaging read, and offers several straightforward techniques to avoid making common reasoning errors. I recommend you [...]]]></description>
			<content:encoded><![CDATA[<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=darkcoding-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0029117062" style="width:120px;height:240px;float:left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

<p>By <a href="http://en.wikipedia.org/wiki/Thomas_Gilovich">Thomas Gilovich</a>, social psychologist and <a href="http://www.csicop.org/about/csi_fellows_and_staff/">CSI Fellow</a>, this well written book explains some of the reasoning and deduction errors we make when trying to understand the world, and ways to avoid making those errors.</p>

<p>This is an easy and engaging read, and offers several straightforward techniques to avoid making common reasoning errors. I recommend you look up <a href="http://www.amazon.com/gp/product/0029117062?ie=UTF8&#038;tag=darkcoding-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0029117062">How We Know What Isn&#8217;t So: The Fallibility of Human Reason in Everyday Life</a><img src="http://www.assoc-amazon.com/e/ir?t=darkcoding-20&#038;l=as2&#038;o=1&#038;a=0029117062" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
 in your local library, or get it second-hand from Amazon for less than a posh cup of coffee. </p>

<p>These are my notes / summary of the book.</p>

<hr />

<h2>I. Cognitive determinants of belief</h2>

<h3>2. Something out of nothing: The mis-perception and misinterpretation of random data</h3>

<p>We are predisposed to see order, pattern, and meaning in the world, and we find randomness, chaos, and meaninglessness unsatisfying.<br />
As a consequence we tend to &#8217;see&#8217; order where there is none, and we spot meaningful patterns where only the vagrancies of chance are operating.</p>

<p><span id="more-622"></span></p>

<p>Detecting patterns and seeing connections is very useful, leads to discovery and advance. But the tendency is so strong we sometimes do it when there was nothing to spot.</p>

<p>Example of <a href="http://www.google.ca/search?q=Gilovich+1985+The+hot+hand+in+basketball">hot hand in basketball</a>. Why?</p>

<ul>
<li><strong>Availability heuristic</strong>: We remember the long streaks, forget the single shots. Can interpret near-misses as evidence of &#8216;hot&#8217; or &#8216;cold&#8217; player.</li>
<li><p>People have faulty intuitions about what chance sequences look like.</p>

<p>See: <em>R. Falk (1981) The perception of randomness. In Proceedings, Fifth international conference for the psychology of mathematics education.</em></p>

<p>In a coin toss, people expect a near perfect alternation of heads and tails. In a series of 20 tosses, there is a 50/50 chance of getting 4 heads in a row, and 10% chance of six in a row. <a href="http://en.wikipedia.org/wiki/Clustering_illusion">Clustering illusion</a>.</p></li>
</ul>

<p><a href="http://images.google.ca/images?q=st+louis+gateway+arch">St Louis Gateway Arch</a> is one of the worlds largest optical illusion. It appears much taller than it is wide, yet height and base width are the same.</p>

<p><strong>Representativeness heuristic</strong>: &#8220;Like goes with like&#8221;. We expect things that go together to look similar. We expect instances of a type (librarian) to look like the prototype (a cliche librarian). Complex effect stem from complex causes. Effects look like their causes: Jagged handwriting means jagged nerves, heartburn comes from hot/spicy foods, etc.</p>

<p>Representativeness usually very helpful. Occasionally mis-applied. The salient (&#8217;prominent or conspicuous&#8217;) feature of something is what we remember, and apply the representativeness heuristic to that. The salient feature of a random sequence is the even mix of all the outcomes.</p>

<p>Law of averages is, by statisticians, correctly called the <strong>law of large numbers</strong>. The even mix of outcomes is only true for very large random sample. There is no &#8216;law of small numbers&#8217;.</p>

<p>Stock market: <a href="http://www.amazon.com/gp/product/0393330338?ie=UTF8&#038;tag=darkcoding-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0393330338">Random walk</a><img src="http://www.assoc-amazon.com/e/ir?t=darkcoding-20&#038;l=as2&#038;o=1&#038;a=0393330338" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, but chartists insist they see patterns in the randomness.</p>

<p>In any random distribution (e.g. x,y plots on a graph), there will be a way of segmenting it (along the axes, diagonally, in bands, etc) that will appear non-random. Carving up data after the fact is meaningless. If we <em>think</em> we see a pattern in the data, test that pattern on other independent sets of data.<br />
Unfortunately, for most people hypotheses constructed on one set of data are considered proved by that same data.
This is why medical trials announce their goal, the expected outcome, ahead of time.</p>

<p>Once we think we see order in randomness, humans are exceptionally good at justifying it with a post-hoc theory. Improv comedy teaches &#8216;jump and justify&#8217;; say something random then justify it, it&#8217;s surprisingly easy.<br />
For example people let to believe they are above or below the average at some task can explain the difference quite easily, even when the experimenters assigned the above/below at random.<br />
Experiments with split-brain patients, where they justify what the other part of the brain just did.</p>

<p>Once a person has (mis)identified a random pattern as a &#8216;real&#8217; phenomenon, it will not exist as a puzzling, isolated fact about the world. Rather, it is quickly explained and readily integrated into the person&#8217;s pre-existing theories and beliefs. These theories then serve to bias that persons evaluation of new information. People cling tenaciously to their beliefs in the face of hostile evidence.</p>

<p><strong>Regression to the mean</strong>: When two variables are related, but imperfectly so, an extreme value on one tends to be matched by a less extreme value on the other. A high number roll on the dice tends to be followed by a lower number, and a low number by a higher one.
A companies disastrous years tend to be followed by betters ones. Students with exceptionally good grades in high-school tend to do slightly less well in college.</p>

<p>Regression can be understood than in any performance (game, test, financial year, etc) there is a part of talent and a part of chance. An very high score is more likely to be a good student with luck in their favor, rather than an extremely good student with luck working against them, simply because there are more &#8216;good&#8217; students than &#8216;extremely good&#8217; students. So a very high score is likely to be followed by a slightly lower one, because it is unlikely to get chance that much in favor two times in a row.</p>

<p>Most people understand regression, but make two mistakes:</p>

<ul>
<li>Insufficiently &#8216;regressive&#8217; when making predictions. The &#8216;next&#8217; value after an extreme one is closer to the average than they tend to predict.</li>
<li>Regression fallacy: Fail to recognize statistical regression, and explain it away with a superfluous and often complex causal theory. Ad-hoc justification where none was needed.</li>
</ul>

<p>The regression fallacy shapes people (parents and teachers, mostly) perception of the effectiveness of rewards and punishments. A good performance is likely to be followed by a less good one, and a bad one by a less bad one. If the good performance is rewarded, the reward will be perceived as ineffective because the good performance was not repeated. If a bad performance is punished the punishment will be perceived as effective because the bad performance will not be repeated.<br />
That notwithstanding, psychologists have known for some time that rewarding desirable behavior is generally more effective in shaping behavior than punishing undesirable responses.<br />
See: <em>B. F. Skinner (1953) Science and human behavior.</em></p>

<h3>3. Too much from too little: The misinterpretation of incomplete and unrepresentative data</h3>

<p>Using empirical evidence as proof: &#8220;I&#8217;ve seen it happen&#8221;, &#8220;I know someone who did&#8221;, etc. If a phenomenon exists, there must be some positive evidence &#8211; &#8216;instances&#8217; of its existence visible to us. So empirical positive statements are <em>necessary</em> for a belief to be true, but they are not <em>sufficient</em>. We also need to know <strong>what goes in the other boxes</strong>. </p>

<p>Many of the beliefs we hold are about the relationships between two variables (&#8217;takes vitamin C&#8217; and &#8216;gets better&#8217;).
Say we were investigating &#8216;vitamin C megadose&#8217; on cancer patients. We notice some patients get better after taking mega-doses of vitamin C. That prompts us to <em>start</em> investigating. Positive outcomes under treatment are one box, we need to know the other three:</p>

<table>
<tr><th></th><th>Takes Vitamin C</th><th>Doesn&#8217;t take Vitamin C</th></tr>
<tr><th>Gets better</th><td>a</td><td>b</td></tr>
<tr><th>Doesn&#8217;t get better</th><td>c</td><td>d</td></tr>
</table>

<p>If we stop at noticing some patients getting better, all we have is box a. All we have is the &#8216;illusion of validity&#8217;.</p>

<p>For vitamin C to be effective, the probability of getting better after taking it <code>[a / (a + b)]</code> must be higher than the probability of getting better after not taking it <code>[c / (c + d)]</code>.</p>

<p>This is often difficult to do intuitively, because box &#8216;a&#8217; is the most salient. <strong>We notice things happening, not things not happening</strong>. </p>

<p>We often <strong>seek only evidence to confirm our beliefs</strong>; we should also seek information to disprove them, and only hold our beliefs if such evidence is not available.</p>

<p>Often the evidence in the other boxes is not available, particularly in evaluating selection criteria. How do we test whether a companies interview process is effective? We are asking the relationship between &#8216;passes interview&#8217; and &#8216;performs well at job&#8217;. But it&#8217;s very nature, we don&#8217;t have the data on job performance for people who didn&#8217;t pass the interview.</p>

<table>
<tr><th></th><th>Passes selection</th><th>Doesn&#8217;t pass</th></tr>
<tr><th>Performs</th><td>a</td><td>?</td></tr>
<tr><th>Doesn&#8217;t perform</th><td>c</td><td>?</td></tr>
</table>

<p>The only data we have is a and c, we can only compare the success rate of those who pass the selection. If the base rate of success is high (most people could perform well, only the best performers apply, etc), a would be higher than c whatever the selection criteria, so we would spuriously conclude our criteria are good.</p>

<p>It is not possible to be confident about the selection process without the data on those who were not selected.</p>

<p>Furthermore, simply being accepted can give someone a competitive advantage. Being admitted to a better school, getting a research grant, or working with high-performing colleagues will all improve an individuals performance compared to someone of similar initial ability who didn&#8217;t get selected.</p>

<p>Effectiveness of public policy is similarly difficult to measure, because we can&#8217;t both set the policy and not set it.</p>

<p>Often the lifestyles we lead, the roles we play, and the positions we occupy in a social network, deny us access to important classes of information and thus distort our view of the world. Overcoming that bias is difficult: We must first recognize the existence of a class of information we have not been exposed to, and then accurately characterize what that information is like.</p>

<p><strong>Self-fulfilling prophecies</strong>: Have got a lot of attention. For a prophecy to be self-fulfilling there must be a mechanism that translates the expectation into confirmatory action. They often serve to exagerate a belief that holds a kernel of truth.<br />
Thinking a bank is in trouble (usually with good reason), creditors will withdraw their money, and the bank will <em>really</em> be in trouble. Behaving in an unfriendly and defensive manner because you think someone is hostile will often produce that very hostility.</p>

<p>True self-fulfilling prophecies are ones in which a persons belief elicits the very behavior originally anticipated.<br />
A <strong>seemingly self-fulfilling prophecy</strong> is one which alters a persons world or limits their responses, in such a way to make it very difficult or impossible for that expectation to be proved wrong. If someone thinks that I am unfriendly, they will avoid me, so I will have no opportunity to prove them wrong. If a sports player is thought incompetent, he won&#8217;t get to play, so won&#8217;t be able to prove himself competent. The continued absence of positive contribution can easily be mistaken for an absence of talent, when it is simply an absence of opportunity.</p>

<p>Negative first-impressions are generally more stable than positive ones, because we keep interacting only with people who created positive first impressions.</p>

<h3>4. Seeing what we expect to see: The biased evaluation of ambiguous and inconsistent data</h3>

<p>Information consistent with our pre-existing beliefs is generally accepted at face value, whereas evidence that contradicts them is critically scrutinized and discounted. Our beliefs are much less responsive than they should be to the implications of new information.
This is a sane and necessary strategy. If a belief has a lifetime of support, it is perfectly valid to be skeptical of evidence that contradicts it.<br />
Well supported beliefs have earned their inertia. We need to be wary of the beliefs that don&#8217;t have a solid foundation, such as cultural stereotypes, social norms, and traditions.</p>

<p><strong>Ambiguous information</strong> is usually perceived in a way that fits out expectations. We may not even be aware of the ambiguity &#8211; it gets resolved before reaching conscious awareness.</p>

<p>Gamblers tend to attribute their losses to outside forces (chance, the referee, a team injury), but their wins to themselves (knew the team well, studied the form). We re-write our history to discount our losses and bolster our wins.</p>

<p>By carefully scrutinizing information that does not fit our beliefs, we can usually find a way of either discounting or re-interpreting it.</p>

<p>Scientists use a set of formal safeguards to prevent their own erroneous thinking affecting their results:</p>

<ul>
<li>Statistical measures to guard against the mis-perception of randomness</li>
<li>Control groups and random sampling to avoid drawing inference from incomplete or unrepresentative data</li>
<li>&#8216;Blind&#8217; observers to eliminate experimenter bias.</li>
<li>Precisely specify in advance the meaning of various outcomes, and objectively determine those outcomes.
These rules are the &#8216;context of justification&#8217;, used when testing an idea. Idea generating is much more open. Science works by flashes of inspiration followed by rigorous testing. The rigorous testing is what differentiates scientific inquiry from everyday life.</li>
</ul>

<p><strong>Multiple endpoints</strong>: By not precisely specifying an expected outcome, we can pick any one and claim it as success. Psychics will use very vague descriptions, so that we can apply them to our lives and perceive them as true. If the subject is fuzzy (&#8217;personal well-being&#8217; for example), we are likely to seize upon any subsequent measure of it that fits our initial beliefs.</p>

<p><strong>Variable windows</strong>: By not specifying an endpoint to a prediction, it stays &#8216;open&#8217; until it comes true. &#8216;Thing happen in threes&#8217; because we could &#8216;things happening&#8217; after the third one has occured, whenever that may be. The third event defines the time window for our prediction.
With a wide enough variable window, beliefs can <em>only</em> be confirmed.</p>

<p><strong>Multi-faceted expectation</strong>: For any two sufficiently complex entities, we can produce a mapping of one onto the other that will produce a certain amount of overlap, and allows us to claim they are similar in some way. Often used with the representativeness heuristic. </p>

<blockquote>
  <p>You have a strong need for other people to like you and for them to admire you. At times you are extroverted, affable, and sociable, while at other times you are introverted, wary, and reserved. You have a great deal of unused energy which you have not turned to your advantage. While you have some personality weaknesses, yo are generally able to compensate for them. You prefer a certain amount of change and variety and become dissatisfied whne hemmed in by restrictions and limitations. You pride yourself on being an independent thinker and do not accept others opinions without satisfactory proof. You have a tendency to be critical of yourself. Some of your aspirations tend to be pretty unrealistic.</p>
</blockquote>

<p>If you see yourself in that description, you are not alone. It is multi-faceted, so most people will find the part that related to them the most salient, and the statements are so general (multiple endpoints) that they are bound to ring true. This is how horoscopes work.</p>

<p><strong>One-sided</strong> versus <strong>two-sided events</strong>: </p>

<ul>
<li>One-sided events are ones that are memorable only when they turn out a certain way: &#8216;The phone always rings when I&#8217;m in the bath&#8217;, &#8216;You wait forever for a bus and three come along at once&#8217;, etc. If the phone does not ring whilst you are in the bath, the non-event does not register.</li>
<li>Two-sided events are ones that register regardless of the outcome: Vacations, dates, gambling, buying a stock, etc. Both outcomes stand out from the stream of experience.</li>
</ul>

<p>In two-sided events, often negative outcomes are remembered better than positive ones, as they require more rationalization to incorporate them into our self-image and understanding of the world.<br />
In one-sided events, we are more likely to remember the &#8217;side&#8217; of events that has meaning to us, which is usually the one that reinforces our world-view. If I believe my dreams are prophetic, I will remember those much more than the other dreams. If I believe that strange things happen during a new moon, I will notice and remember the strange things, not the ordinary things (strange things not happening).</p>

<p>Many one-sided events only &#8216;exist&#8217; when they are confirmed. If a fortune teller says you will have twins, and you have twins, you remember the fortune teller, link the two events, and form a strong memory. If you have one child, you probably won&#8217;t think of the fortune teller at all. And even if you did, the fortune is not contradicted, simple un-confirmed. You could have twins later in life.</p>

<p>One-sided events tend to be temporally unfocused, they have variable windows to be confirmed in. A &#8216;prophetic&#8217; dream, a fortune, doesn&#8217;t have a fixed date, so only the positive outcome is acknowledged.<br />
Two-sided events tend to have fixed windows: A sporting event, a vacation, a job interview. The closed window forces us to acknowledge both outcomes.</p>

<p>In two-sided events, both outcomes produce the same intensity of emotion (winning or losing a bet). In a one-sided event, only one of the outcomes has any emotional weight: It &#8216;always&#8217; seems to rain when you forget your umbrella, because getting wet has an emotional attachment (hair ruined, clothes soaked, etc), whereas not-getting-wet doesn&#8217;t.</p>

<p><strong>Definitional asymmetries</strong>: &#8216;American tourists in London are loud&#8217;, &#8216;I can always spot fake breasts&#8217;, &#8216;You need to hit rock-bottom to bounce back&#8217;. All of these are difficult or impossible to disprove: We only notice the loud people, we don&#8217;t notice fake breasts that we didn&#8217;t spot, and how can you say if someone has hit rock-bottom or not? Definitional asymmetries are all one-sided events.</p>

<p>One-sided events tend to have a &#8216;normal&#8217; outcome with a high base rate, which we don&#8217;t notice because it is part of everyday life (&#8217;look, it&#8217;s not a full moon&#8217;), and an less usual more salient outcome (&#8217;o oh, it&#8217;s a full moon!&#8217;).</p>

<p>All of the above relate to the <strong><a href="http://en.wikipedia.org/wiki/Availability_heuristic">availability heuristic</a></strong>.</p>

<h2>II. Motivational and social determinants of questionable beliefs</h2>

<h3>5. Seeing what we want to see: Motivational determinants of belief</h3>

<p><strong><a href="http://en.wikipedia.org/wiki/Endowment_effect">Endowment effect</a></strong>: We value something more when it is ours. Ownership creates an inertia that prevents many potentially beneficial transactions from occurring.</p>

<p>The endowment effect applied to humans is the <strong>Lake Wobegon effect</strong>, or <strong><a href="http://en.wikipedia.org/wiki/Illusory_superiority">Illusory superiority</a></strong>. This is particularly true on ambiguous traits (&#8217;intelligence&#8217;, &#8217;sensitivity&#8217;, &#8216;idealism&#8217;), and less true on more specific traits (&#8217;thriftiness&#8217;, &#8216;being well-read&#8217;). If a specific definition is given in the question, the above average effect tends to disappear: People are not lying or cheating, it&#8217;s just that the first thing that comes to mind when asked an ambiguous question is usually something they are good at, something salient in their lives.</p>

<p><strong>We attribute success internally and failure externally</strong>. Thanks to their own resources, they succeeded. Because of the others/the environment, they failed.<br />
Many psychologists hold that we do this to maintain self-esteem. There is also a cognitive explanation: Succeeding at something is at least partly due to our own effort, and thus warrants some internal attribution. Failing at something usually happens despite our best efforts, so often invovles an unfavorable external situation. </p>

<p>People <em>are</em> more likely to believe things they want to believe, but are constrained by objective evidence and the need to construct a justification that would presuade a dispassionate observer. We draw the desired conclusion only if we can muster up enough evidence to support it. It is in this sense that most people think of themselves are objective.<br />
People often do not realize that their selection and interpretation of data is biased by their goals &#8211; the data could be interpreted a different way, and there is other data they ignored. They may well be able to justify opposite conclusions on different occasions.</p>

<p>How we &#8216;filter&#8217; data to ensure it supports our goals:</p>

<ul>
<li>Seeking only to confirm</li>
<li>Select who we consult. By judiciously choosing whom we consult on an issue, we can increase our chances of hearing what we want to hear.</li>
<li>Amount of information: If the initial results confirm out expectations, we stop looking. If they don&#8217;t, we keep looking.</li>
</ul>

<p>We should not stop at <code>Can I believe this?</code>, but should progress to <code>Must I believe this?</code>.</p>

<p>These are some of the ways we skew the evidence in the world, frame it to support our beliefs. This is healthy. People who can&#8217;t frame effectively run the risk of depression.</p>

<p>Beliefs are like possessions: We acquire the ones we think will make us feel good, and cling tightly to the ones we have.</p>

<h3>6. Believing what we are told: The biasing effects of secondhand information</h3>

<p>Telling a good story: The speaker needs their message to be worthy of the listeners attention. For the listener the interaction must be worthwhile in some way. The message must be understandable (not assume too much knowledge of the listener) and yet not too detailed (not assume too little knowledge of the listener).</p>

<p><strong>Sharpening and Leveling</strong>: What the speaker construes as the gist of the message is emphasized, &#8217;sharpened&#8217;, where are details thought to be less important are de-emphasized, &#8216;leveled&#8217;.</p>

<p>One results of sharpening and leveling is that we often develop exaggerated or extreme views of people we have only been told about. </p>

<p>One way to make a message more entertaining or seemingly informative is to <strong>increase it&#8217;s immediacy</strong>. Instead of the story happening to a friend of a friend&#8217;s colleague, have it happen directly to friend or family member, or even better, you. Often such alterations are intended for the self-aggrandizement of the speaker. It places them closer to center-stage. Other times it is simply an effort to make the story more salient, more vivid and concrete.</p>

<p>Increasing immediacy makes it difficult for the listener to accurately gauge the reliability of your message:</p>

<ul>
<li>Reducing the hops: We all know that the more hops a message has been through, the less reliable it is. Increasing the immediacy of a message for the sake of entertainment or self-aggrandizement also makes a message seem more reliable than it is.</li>
<li>Changing the origination (&#8217;my brother&#8217;, instead of &#8216;my brother&#8217;s friend from work&#8217;): Your brother might be trustworthy, so we trust the message, but your brother&#8217;s friend is an inveterate liar. The original source of the message has been obscured.</li>
</ul>

<p>Presenting and accepting remote accounts as secondhand is misleading when estimating the prevalence of a phenomenon in the general population. If something happened to lots of your friends cousins, it is happening a lot. If lots of your friends cousins heard a story about someone else&#8217;s friends cousin, and passed it on, there might be a single case.</p>

<p>In attempting to be informative, we might level some of the qualifications in the original message. This is often the case when scientific findings are reported in the news media.<br />
Sometimes the facts are stretched to &#8216;help&#8217; their audience get the message. This results in hysterical public service campaigns, that elicit far more fear than the original risk warranted (drugs, &#8217;stranger danger&#8217;, terrorism, etc). The facts are stretched beyond recognition to make a more compelling story.<br />
Parents are often guilty of this distortion in attempting to motivate behavior in their children.</p>

<p>The desire to <strong>entertain</strong> often creates a conflict for the speaker between satisfying the goal of accuracy and the goal of entertainment. There is often a tacit agreement between speaker and audience that the truth may be stretched: Tabloids and &#8216;light entertainment&#8217; news shows are granted this permission. &#8220;One of the most common sources of such inaccuracy is the dissemination of unfounded or fallacious claims by news and other media organizations that try and entice by their ability to entertain.&#8221; The demand for news has been met by and artificial increase in supply.</p>

<p><strong>Plausibility</strong>: Inaccurate or fictitious stories are sometimes told and retold because they just seem so plausible, that we let our critical guard down. Our standards for plausibility are often very low, a decent irony is often enough (the creator of the song &#8220;Don&#8217;t worry be happy&#8221; committing suicide, for example, or someone at the patent office resigning because there was nothing left to invent).</p>

<p><strong>Summary</strong>: As we have seen in previous chapters, the data from our own experience is often biased and incomplete. In this chapter we saw that data from others is also. It is therefore important to locate unbiased, complete sources of base-rate data (scientific inquiry mainly), and use those to asses how likely it is that our own perceptions or those of our social group are true.
If the base rate data and our personal experience concur, then we are likely correct. If they don&#8217;t a reliable base rate should be our guide. If the base rate data is to reliable, at least we know that we don&#8217;t know.</p>

<p>How to assess secondhand information:</p>

<ul>
<li>Consider the source: The New York Times or the National Enquirer? A rock star or a researcher? An actor who plays a doctor on TV, or a practicing medical doctor.</li>
<li>Trust facts, distrust projections: Predicting the future is hard, even for an expert. What looks like an <a href="http://images.google.ca/images?q=exponential">exponential</a> curve can turn out to be <a href="http://images.google.ca/images?q=sigmoidal">sigmoidal</a>.</li>
<li>Watch for Sharpening and Leveling.</li>
<li>Be wary of testimonials. One striking human interest story does not tell you anything about prevalence or risk.</li>
</ul>

<h3>7. The imagined agreement of others: Exaggerated impressions of social support</h3>

<p>What we believe is heavily influenced by what we think others believe. This is usually a good strategy. However we often exaggerate the extent to which others hold the same beliefs as us. We think we have more social support for our opinions than we really do.</p>

<p>This is the <strong><a href="http://en.wikipedia.org/wiki/False_consensus_effect">false consensus effect</a></strong>: This is a <em>relative</em> effect. We realize if our belief is in the minority. We underestimate by how much in the minority.</p>

<p>Reasons:</p>

<ul>
<li>Motivational: A desire to maintain a positive assessment of our own judgment.</li>
<li>Social: We interact with people who agree with us</li>
<li>Context interpretation: We assume that given the same context, everyone will infer the same thing. As we see others in the same context, we assume they come to the same conclusions as us. As a result the false consensus effect is strongest for beliefs we attribute to external factors (buy stock in Ford or Google), and weakest for ones we attribute internally (name your son Jacob or Ian). The context is often ambiguous, and different people resolve the ambiguity in different ways, often without noticing it.</li>
</ul>

<p><strong>Inadequate feedback from others</strong>: People are generally reluctant to openly question another person&#8217;s beliefs (<em>Adults</em>, that is. Children do it all the time). Only intimate friends and relatives can be counted upon for honest feedback. More casual acquaintances often side-step the awkwardness of disagreement and thus leave us without essential corrective feedback.
Because so much disagreement remains hidden, our beliefs are not properly shaped by healthy scrutiny and debate.</p>

<h2>III. Examples of questionable and erroneous beliefs</h2>

<p>(not summarized)</p>

<h2>IV. Where do we go from here</h2>

<h3>11. Challenging dubious beliefs: The roles of social science</h3>

<blockquote>
  <p>The real purpose of [the] scientific method is to make sure Nature hasn&#8217;t misled you into thinking you know something you actually don&#8217;t know. 
  R. Pirsig, Zen and the Art of Motorcycle Maintenance.</p>
</blockquote>

<p>To avoid erroneous beliefs it is necessary that we deveop certain habits of mind that can shore up various deficiencies in our everyday inferential abilities. Fortunately, there is reason to believe that these corrective habits of mind are not difficult to develop. Students familiar with the work on errors and biases readily apply the learning to their everyday lives.</p>

<p>Most important mental habit is realizing the folly of trying to draw conclusions from incomplete and unrepresentative data.</p>

<p>Ask: <code>What do the other three cells look like?</code></p>

<p>Information presented as firsthand is often secondhand or more remote, and from a less trustworthy source. Be sure you know where you information originated before assessing it&#8217;s value.</p>

<p>Many of these habits are core to scientific research. Familiarity with that world helps. Gives you valuable exposure to uncertainty and doubt, a healthy skepticism, and the awareness of how hard it can be to really know something with certainty.</p>

<p>Exposure to the &#8216;probabilistic&#8217; sciences (psychology, economics, social sciences, etc) may be more effective in teaching these habits than the &#8216;deterministic&#8217; (physics, chemistry, etc) sciences.<br />
Probabilistic sciences deal with phenomena that are not perfectly predictable, and with causes that are generally neither necessary nor sufficient. The death of a spouse is associated with deterioration in health. However not all partners health deteriorates (not sufficient), and people&#8217;s health deteriorates for other reasons (not necessary).<br />
To compensate for this lack of determinism, probabilistic sciencists must be aware of statistical regression, sample bias, and the importance of control groups.</p>

<p>Social sciences deal with everyday phenomenon, so it easier for them than physical sciences to make the probabilistic tools of reasoning readily understandable and available.</p>

<p>Social scientists should no longer suffer from physics envy. They cannot match their explanatory power or predictive precision, but specifically because of this, they are better equipped to deal with the messy, complex phenomena of real life. Their tools and process, rather than their content, may turn out to be the social sciences most valuable discoveries.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/EhJXSY1a8V8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/behaviour/how-we-know-what-isnt-so-by-thomas-gilovich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/behaviour/how-we-know-what-isnt-so-by-thomas-gilovich/</feedburner:origLink></item>
		<item>
		<title>Memcached: List all keys</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/2IpOwHTf9yo/</link>
		<comments>http://www.darkcoding.net/software/memcached-list-all-keys/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 16:50:30 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[memcached cache keys list]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=596</guid>
		<description><![CDATA[	In the general case, there is no way to list all the keys that a memcached instance is storing. You can, however, list something like the first 1Meg of keys, which is usually enough during development. Here&#8217;s how:

	Telnet to your server:

	telnet 127.0.0.1 11211

	

	List the items, to get the slab ids:

	stats items
STAT items:3:number 1
STAT items:3:age 498
STAT [...]]]></description>
			<content:encoded><![CDATA[	<p>In the general case, there is <a href="http://code.google.com/p/memcached/wiki/FAQ#Can_I_iterate_the_items_of_the_memcached_server?">no way to list all the keys</a> that a <a href="http://www.danga.com/memcached/">memcached</a> instance is storing. You can, however, list something like the first 1Meg of keys, which is usually enough during development. Here&#8217;s how:</p>

	<p>Telnet to your server:</p>

	<p><blockquote>telnet 127.0.0.1 11211</blockquote></p>

	<p><span id="more-596"></span></p>

	<p>List the items, to get the slab ids:</p>

	<p><blockquote>stats items<br />
<span class="caps">STAT</span> items:3:number 1<br />
<span class="caps">STAT</span> items:3:age 498<br />
<span class="caps">STAT</span> items:22:number 1<br />
<span class="caps">STAT</span> items:22:age 498<br />
<span class="caps">END</span></blockquote></p>

	<p>The first number after &#8216;items&#8217; is the slab id. Request a cache dump for each slab id, with a limit for the max number of keys to dump:</p>

	<p><blockquote>stats cachedump 3 100<br />
<span class="caps">ITEM</span> views.decorators.cache.cache_header..cc7d9 [6 b; 1256056128 s]<br />
<span class="caps">END</span><br />
stats cachedump 22 100<br />
<span class="caps">ITEM</span> views.decorators.cache.cache_page..8427e [7736 b; 1256056128 s]<br />
<span class="caps">END</span></blockquote></p>

	<p>Thanks to Boris Partensky in the Memcached group <a href="http://groups.google.com/group/memcached/browse_thread/thread/632ce89cff47522d?pli=1">here</a></p>

	<p>There you go!</p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/2IpOwHTf9yo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/memcached-list-all-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/memcached-list-all-keys/</feedburner:origLink></item>
		<item>
		<title>Guy Kawasaki’s 10-20-30 presentation rule</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/at_QTTNo9Ls/</link>
		<comments>http://www.darkcoding.net/misc/guy-kawasakis-10-20-30-presentations-rule/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 17:41:22 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[presentation youtube guykawasaki 10-20-30]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=587</guid>
		<description><![CDATA[	Funny, practical, and well worth 1 minute 50 seconds of your life:

	

	via the BootUp Labs Blog.

 ]]></description>
			<content:encoded><![CDATA[	<p>Funny, practical, and well worth 1 minute 50 seconds of your life:</p>

	<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/liQLdRk0Ziw&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/liQLdRk0Ziw&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>

	<p>via the <a href="http://blog.bootuplabs.com/2009/09/29/3-investor-pitch-conditions-why-you-get-conflicting-advice/">BootUp Labs Blog</a>.</p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/at_QTTNo9Ls" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/guy-kawasakis-10-20-30-presentations-rule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/guy-kawasakis-10-20-30-presentations-rule/</feedburner:origLink></item>
		<item>
		<title>I’m on identi.ca and Twitter</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/Jr9EV5nq8gg/</link>
		<comments>http://www.darkcoding.net/misc/im-on-identi-ca-and-twitter/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 16:08:35 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[microblogging twitter identica]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=578</guid>
		<description><![CDATA[I am sharing my thoughts, mainly about web technologies, on identi.ca and twitter.


Graham King on identi.ca
Graham King on Twitter


The nature of the medium means those thoughts will be generally raw and truncated, but timely.
]]></description>
			<content:encoded><![CDATA[<p>I am sharing my thoughts, mainly about web technologies, on identi.ca and twitter.</p>

<ul>
<li><a href="http://identi.ca/grahamking">Graham King on identi.ca</a></li>
<li><a href="http://twitter.com/grahamking">Graham King on Twitter</a></li>
</ul>

<p>The nature of the medium means those thoughts will be generally raw and <a href="http://identi.ca/notice/9739093">truncated</a>, but timely.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/Jr9EV5nq8gg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/im-on-identi-ca-and-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/im-on-identi-ca-and-twitter/</feedburner:origLink></item>
		<item>
		<title>Social psychology in sales copy: Good copy writing</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/4GbKdZ3lyYw/</link>
		<comments>http://www.darkcoding.net/behaviour/social-psychology-in-sales-copy-good-copy-writing/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:03:35 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[behavior socialpsychology influence copy copywriting sales]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=560</guid>
		<description><![CDATA[I recently received an advert for an investment fund in which, as the amateur social psychologist that I am, I noticed illustrated a couple of psychological principles. The are both covered in the email title:


  Last chance to invest in a firm favourite


They are covered again in more detail in this paragraph:


  The [...]]]></description>
			<content:encoded><![CDATA[<p>I recently received an advert for an investment fund in which, as the amateur social psychologist that I am, I noticed illustrated a couple of psychological principles. The are both covered in the email title:</p>

<blockquote>
  <p>Last chance to invest in a firm favourite</p>
</blockquote>

<p>They are covered again in more detail in this paragraph:</p>

<blockquote>
  <p>The x y z Fund only launched six months ago, but has already attracted considerable interest. To keep it small and flexible the number of units has been capped at 200 million. Last week they had reached two-thirds of that total and interest is intensifying. In the last two days alone they sold over 6 million units, so it is likely to close very soon.</p>
</blockquote>

<p><span id="more-560"></span></p>

<h2>Social Proof</h2>

<p>The first principle is <a href="http://en.wikipedia.org/wiki/Social_Proof">Social Proof</a>. This fund is <em>&#8220;a firm favorite&#8221;</em> and <em>&#8220;has already attracted considerable interest&#8221;</em> and already <em>&#8220;sold over 6 million units&#8221;</em>. In other words, other people think it&#8217;s a very good idea to invest in this fund, so you should to.<br />
Many of the top researchers in the field of influence (social psychology, behavioral economics, etc) <a href="http://www.time.com/time/printout/0,8816,1889153,00.html">worked with the Obama campaign</a>, Their last minute get-out-the-vote message was <em>&#8220;A Record Turnout Is Expected&#8221;</em>. People are more likely to vote if they think other people will vote. The most beautiful part of social proof is that it is undetected &#8211; most people will deny that this is the case.</p>

<p>No-one know which fund to invest in, because most of them under-perform the index, and if the stock market really is a <a href="http://en.wikipedia.org/wiki/Random_walk_hypothesis">random walk</a>, then there is no sane way to invest. It is in exactly that type of ambiguous situation where people look to other people to decide how to react.</p>

<h2>Scarcity</h2>

<p>We want what we may not be able to have in the future, that&#8217;s the <a href="http://changingminds.org/principles/scarcity.htm">Scarcity Principle</a>. This is the <em>&#8220;Last chance&#8221;</em> to invest in this fund because it is <em>&#8220;likely to close very soon&#8221;</em>. Fear of losing out on something can be an extremely powerful motivator, and you see it every day when stores have end-of-line or closing-down sales, or when something is offer in &#8216;limited quantity&#8217;.</p>

<h2>Invest with your calculator, not your heart</h2>

<p>That email is an emotional appeal, not a rational one. Selling a new fund during a recession must be difficult, and there&#8217;s no reason to think this one is selling well. The language doesn&#8217;t promise anything concrete, so it doesn&#8217;t lie. It just influences. And that is good copy writing.</p>

<p>The seminal book on this topic is  <a href="http://www.amazon.com/gp/product/0205609996?ie=UTF8&#038;tag=darkcoding-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0205609996">Robert Cialdini&#8217;s &#8220;Influence&#8221;</a><img src="http://www.assoc-amazon.com/e/ir?t=darkcoding-20&#038;l=as2&#038;o=1&#038;a=0205609996" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, which I highly recommend. It&#8217;s a New York Times best seller, and Fortune Magazine lists Influence in their &#8220;75 Smartest Business Books.&#8221; You see what I did there? :-)</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/4GbKdZ3lyYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/behaviour/social-psychology-in-sales-copy-good-copy-writing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/behaviour/social-psychology-in-sales-copy-good-copy-writing/</feedburner:origLink></item>
		<item>
		<title>Choosing a message queue for Python on Ubuntu on a VPS</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/xO-uPwO5HSE/</link>
		<comments>http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 05:05:13 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[python ubuntu messaging queue gearman]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=539</guid>
		<description><![CDATA[More and more, my web apps need to run things in the background: Sending email, re-calculating values, fetching website thumbnails, etc. In short, I need a message queue in my toolbox.

Luckily for me, message queues are this years Hot New Thing, so there&#8217;s some good options. I looked at RabbitMQ, Gearman, Beanstalkd and StompServer.


I&#8217;d like [...]]]></description>
			<content:encoded><![CDATA[<p>More and more, my web apps need to run things in the background: Sending email, re-calculating values, fetching website thumbnails, etc. In short, I need a message queue in my toolbox.</p>

<p>Luckily for me, message queues are this years <a href="http://simonwillison.net/tags/messagequeues/">Hot New Thing</a>, so there&#8217;s some good options. I looked at <a href="http://www.rabbitmq.com/">RabbitMQ</a>, <a href="http://gearman.org">Gearman</a>, <a href="http://xph.us/software/beanstalkd/">Beanstalkd</a> and <a href="http://stompserver.rubyforge.org/">StompServer</a>.</p>

<p><span id="more-539"></span>
I&#8217;d like the message queue to play nice with Python, with Ubuntu, and take almost no memory, as I&#8217;m on a <a href="http://linode.com">Virtual Private Server</a>, and I&#8217;d like it to stay up forever. I want small and solid.</p>

<h2>Summary</h2>

<table border="1" cellpadding="2">
<tr>
  <td></td>
  <th>RabbitMQ</th>
  <th>Gearman</th>
  <th>Beanstalkd</th>
  <th>StompServer</th>
</tr>

<tr>
 <th>Language</th>
 <td>Erlang</td>
 <td>C</td>
 <td>C</td>
 <td>Ruby</td>
</tr>

<tr>
 <th>In Ubuntu?</th>
 <td>Yes: rabbitmq-server</td>
 <td>Yes: gearman-job-server</td>
 <td>No</td>
 <td>No, it&#8217;s a Ruby gem</td>
</tr>

<tr>
 <th>Python lib</th>
 <td>amqplib</td>
 <td>gearman</td>
 <td>pybeanstalk</td>
 <td>stomp-py</td>
</tr>

<tr>
 <th>In PyPI?</th>
 <td>Yes</td>
 <td>Yes</td>
 <td>No</td>
 <td>No</td>
</tr>

<tr>
  <th>Memory</th>
  <td>9Mb</td>
  <td>1.4Mb</td>
  <td>0.5Mb</td>
  <td>7Mb</td>
</tr>

<tr>
 <th>Protocol</th>
 <td>AMQP</td>
 <td>Custom</td>
 <td>Custom</td>
 <td>STOMP</td>
</tr>

<tr>
 <th>License</th>
 <td>MPL</td>
 <td>BSD</td>
 <td>GPL</td>
 <td>MIT</td>
</tr>

</table>

<p>Memory size is the resident set size, obtained like so: <code>ps -Ao pid,rsz,args | grep &lt;name&gt;</code>. If there is a better way of estimating memory please let me know in the comments.</p>

<h2>RabbitMQ</h2>

<p>An all-singing all-dancing &#8220;complete and highly reliable Enterprise Messaging system&#8221;. With language like that you&#8217;d expect horrible bloat and per-cpu licensing, but happily that&#8217;s not the case. It&#8217;s straightforward to setup and relatively lean.</p>

<p>The protocol, <a href="http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol">AMQP</a>, comes from the financial world, and is intended to replace Tibco&#8217;s RendezVous, the backbone of most investment banks. There&#8217;s lots of documentation, lots of users, a healthy ecosystem, and it looks good on your CV.<br />
I tried RabbitMQ first, and liked it so much I almost stopped my evaluation right there and deployed it.</p>

<p>The best tutorial for using it from Python is here: <a href="http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/">Rabbits and Warrens</a></p>

<h4>Publisher</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5391');">Quick Code</a></p></p>

<div id="quickcode5391" class="quickcode"><code><br />
import sys<br />
import time<br />
&nbsp;<br />
from amqplib import client_0_8 as amqp<br />
&nbsp;<br />
conn = amqp.Connection(host=&quot;localhost:5672&quot;, userid=&quot;guest&quot;, password=&quot;guest&quot;, virtual_host=&quot;/&quot;, insist=False)<br />
chan = conn.channel()<br />
&nbsp;<br />
i = 0<br />
while 1:<br />
&nbsp;&nbsp;&nbsp;&nbsp;msg = amqp.Message(&#039;Message %d&#039; % i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;msg.properties[&quot;delivery_mode&quot;] = 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;chan.basic_publish(msg,exchange=&quot;sorting_room&quot;,routing_key=&quot;testke y&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;i += 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(1)<br />
&nbsp;<br />
chan.close()<br />
conn.close()<br />
</code></div>

<h4>Consumer</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5392');">Quick Code</a></p></p>

<div id="quickcode5392" class="quickcode"><code><br />
from amqplib import client_0_8 as amqp<br />
&nbsp;<br />
conn = amqp.Connection(host=&quot;localhost:5672&quot;, userid=&quot;guest&quot;, password=&quot;guest&quot;, virtual_host=&quot;/&quot;, insist=False)<br />
chan = conn.channel()<br />
&nbsp;<br />
chan.queue_declare(queue=&quot;po_box&quot;, durable=True, exclusive=False, auto_delete=False)<br />
chan.exchange_declare(exchange=&quot;sorting_room&quot;, type=&quot;direct&quot;, durable=True, auto_delete=False,)<br />
&nbsp;<br />
chan.queue_bind(queue=&quot;po_box&quot;, exchange=&quot;sorting_room&quot;, routing_key=&quot;testkey&quot;)<br />
&nbsp;<br />
def recv_callback(msg):<br />
&nbsp;&nbsp;&nbsp;&nbsp;print msg.body<br />
&nbsp;<br />
chan.basic_consume(queue=&#039;po_box&#039;, no_ack=True, callback=recv_callback, consumer_tag=&quot;testtag&quot;)<br />
&nbsp;<br />
while True:<br />
&nbsp;&nbsp;&nbsp;&nbsp;chan.wait()<br />
&nbsp;<br />
#chan.basic_cancel(&quot;testtag&quot;)<br />
#chan.close()<br />
#conn.close()<br />
</code></div>

<h2>Gearman</h2>

<p>Gearman is a system to farm out work to other machines, dispatching function calls to machines that are better suited to do work, to do work in parallel, to load balance lots of function calls, or to call functions between languages.</p>

<p>Developed by <a href="http://www.danga.com/">Danga Interactive</a> (essentially Brad Fitzpatrick, who brought us Memcached and Perlbal). Used by LiveJournal, Digg and Yahoo.</p>

<p><em>Ubuntu users:</em> Make sure you install package gearman-job-server, which is the newer leaner C version of Gearman. Don&#8217;t install gearman-server, that is the old Perl version.</p>

<h4>Client</h4>

<div class="quickcodenoclick"><code><br />
import sys<br />
import time<br />
&nbsp;<br />
from gearman import GearmanClient, Task<br />
&nbsp;<br />
client = GearmanClient([&quot;127.0.0.1&quot;])<br />
&nbsp;<br />
i = 0<br />
while 1:<br />
&nbsp;&nbsp;&nbsp;&nbsp;client.dispatch_background_task(&#039;speak&#039;, i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;print &#039;Dispatched %d&#039; % i<br />
&nbsp;&nbsp;&nbsp;&nbsp;i += 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(1)<br />
</code></div>

<h4>Worker</h4>

<div class="quickcodenoclick"><code><br />
import time<br />
&nbsp;<br />
from gearman import GearmanWorker<br />
&nbsp;<br />
def speak(job):<br />
&nbsp;&nbsp;&nbsp;&nbsp;r = &#039;Hello %s&#039; % job.arg<br />
&nbsp;&nbsp;&nbsp;&nbsp;print r<br />
&nbsp;&nbsp;&nbsp;&nbsp;return r<br />
&nbsp;<br />
worker = GearmanWorker(&quot;[127.0.0.1]&quot;)<br />
worker.register_function(&#039;speak&#039;, speak, timeout=3)<br />
worker.work()<br />
</code></div>

<h2>Beanstalkd</h2>

<p>Beanstalkd is a fast, distributed, in-memory workqueue service. Its interface is generic, but was designed for use in reducing the latency of page views in high-volume web applications by running most time-consuming tasks asynchronously.</p>

<p>Developed for a very popular Facebook Application. The smallest memory footprint: after startup, connecting, sending a few messages, it&#8217;s resident memory size (rsz) was still only <strong>0.5 Mb</strong>!</p>

<p>To install the server:</p>

<ul>
<li>sudo apt-get install libevent-dev</li>
<li>wget http://xph.us/dist/beanstalkd/beanstalkd-1.3.tar.gz</li>
<li>tar xvzf beanstalkd-1.3.tar.gz</li>
<li>./configure</li>
<li>make (there&#8217;s no install step, it just generates the file &#8216;beanstalkd&#8217;)</li>
</ul>

<p>To install the Python library:</p>

<ul>
<li>wget http://pybeanstalk.googlecode.com/files/pybeanstalk-0.11.1.tar.gz</li>
<li>extract it</li>
<li>sudo python setup.py install</li>
</ul>

<p>There&#8217;s a good tutorial here: <a href="http://parand.com/say/index.php/2008/10/12/beanstalkd-python-basic-tutorial/">http://parand.com/say/index.php/2008/10/12/beanstalkd-python-basic-tut orial/</a></p>

<h4>Producer</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5395');">Quick Code</a></p></p>

<div id="quickcode5395" class="quickcode"><code><br />
import time<br />
&nbsp;<br />
from beanstalk import serverconn<br />
from beanstalk import job<br />
&nbsp;<br />
def producer_main(connection):<br />
&nbsp;&nbsp;&nbsp;&nbsp;i = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;while True:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = &#039;This is data to be consumed (%s)!&#039; % (i,)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print data<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = job.Job(jid=i,data=data, conn=connection)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data.Queue()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i += 1;<br />
&nbsp;<br />
connection = serverconn.ServerConn(&#039;localhost&#039;, 11300)<br />
#connection.job = job.Job<br />
producer_main(connection)<br />
</code></div>

<h4>Consumer</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5396');">Quick Code</a></p></p>

<div id="quickcode5396" class="quickcode"><code><br />
from beanstalk import serverconn<br />
from beanstalk import job<br />
&nbsp;<br />
def consumer_main(connection):<br />
&nbsp;&nbsp;&nbsp;&nbsp;while True:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j = connection.reserve()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &#039;got work: %s&#039; % j.data<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j.Finish()<br />
&nbsp;<br />
connection = serverconn.ServerConn(&#039;localhost&#039;, 11300)<br />
connection.job = job.Job<br />
consumer_main(connection)<br />
</code></div>

<h2>StompServer</h2>

<p>StompServer is a lightweight pure Ruby <a href="http://en.wikipedia.org/wiki/Streaming_Text_Orientated_Messaging_Protocol">STOMP</a> server. </p>

<p>To install the server on Ubuntu:</p>

<ul>
<li>sudo apt-get install ruby-dev rubygems</li>
<li>sudo gem install stompserver</li>
</ul>

<p>To install the Python library:</p>

<ul>
<li>wget http://stomppy.googlecode.com/files/stomp.py-2.0.1.tar.gz</li>
<li>extract it</li>
<li>sudo python setup.py install</li>
</ul>

<p>There&#8217;s a good Python / Stompserver tutorial here: <a href="http://morethanseven.net/2008/09/14/using-python-and-stompserver-get-started-message-q/">http://morethanseven.net/2008/09/14/using-python-and-stompserver-get-s tarted-message-q/</a></p>

<h4>Sender</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5397');">Quick Code</a></p></p>

<div id="quickcode5397" class="quickcode"><code><br />
import time<br />
&nbsp;<br />
import stomp<br />
&nbsp;<br />
conn = stomp.Connection()<br />
conn.start()<br />
conn.connect()<br />
&nbsp;<br />
i = 0<br />
while 1:<br />
&nbsp;&nbsp;&nbsp;&nbsp;conn.send(&#039;Message %d&#039; % i, destination=&#039;/queue/test&#039;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;i += 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(1)<br />
&nbsp;<br />
conn.disconnect()<br />
</code></div>

<h4>Listener</h4>

<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode5398');">Quick Code</a></p></p>

<div id="quickcode5398" class="quickcode"><code><br />
import time<br />
import sys<br />
&nbsp;<br />
import stomp<br />
&nbsp;<br />
class MyListener(object):<br />
&nbsp;&nbsp;&nbsp;&nbsp;def on_error(self, headers, message):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &#039;received an error %s&#039; % message<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;def on_message(self, headers, message):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &#039;received a message %s&#039; % message<br />
&nbsp;<br />
conn = stomp.Connection()<br />
conn.set_listener(&#039;&#039;, MyListener())<br />
conn.start()<br />
conn.connect()<br />
&nbsp;<br />
conn.subscribe(destination=&#039;/queue/test&#039;, ack=&#039;auto&#039;)<br />
&nbsp;<br />
while 1:<br />
&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(2)<br />
</code></div>

<h2>Results and Conclusions</h2>

<p>I&#8217;d be happy working with any of these four. All four were easy to setup, fast, decent in memory consumption, and had good Python libraries.</p>

<p>RabbitMQ has the most mindshare (it is the only one which registers on <a href="http://www.google.com/trends?q=rabbitmq%2C+gearman%2C+beanstalkd%2C+stompserver&#038;ctab=0&#038;geo=all&#038;date=all&#038;sort=0">Google Trends</a>), but it took the most memory and is the most complex to use. It looks like a great product, but it&#8217;s Message Oriented Middleware, not an in-memory job queue, so it&#8217;s not what I&#8217;m looking for.</p>

<p>StompServer had the least documentation, and took several times more memory than Gearman and Beanstalkd. In seems the most immature project, but would probably be a good choice for someone working in Ruby.</p>

<p>Beanstalkd is great. I would like to see it in the Ubuntu repositories, and it&#8217;s Python lib in PyPI, but aside from that, I can&#8217;t fault it. I&#8217;m not choosing it, because Gearman is even better.</p>

<p>Gearman was designed for exactly the problem I have, takes almost no memory (1.4Mb), has a great pedigree (Danga), is widely deployed (LiveJournal, Digg, Yahoo), is in Ubuntu (almost), has a Python library is in PyPI, and someone helped me out on the #gearman IRC channel straight away. It even has queue persistence and clustering. So, <a href="http://twitter.com/jacobian/status/2761378698">Gearman it is</a>.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/xO-uPwO5HSE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps/</feedburner:origLink></item>
		<item>
		<title>Quote of the day – monkeys</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/NsPI-aDIxnk/</link>
		<comments>http://www.darkcoding.net/misc/quote-of-the-day-monkeys/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 19:09:11 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[quote monkey business]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=535</guid>
		<description><![CDATA[	In response to monkeys stealing his coffee beans, an Indian farmer observes: If you start shooting monkeys, you&#8217;ll spend the rest of your life shooting monkeys.



	via  Bruce Eckel
 ]]></description>
			<content:encoded><![CDATA[	<p><blockquote>In response to monkeys stealing his coffee beans, an Indian farmer observes: <em>If you start shooting monkeys, you&#8217;ll spend the rest of your life shooting monkeys.</em></blockquote></p>



	<p>via <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=264047"> Bruce Eckel</a></p>
 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/NsPI-aDIxnk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/quote-of-the-day-monkeys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/quote-of-the-day-monkeys/</feedburner:origLink></item>
		<item>
		<title>On cellphone use in cars</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/A7ud60-_N44/</link>
		<comments>http://www.darkcoding.net/society/on-cellphone-use-in-cars/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:11:28 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Behaviour]]></category>
		<category><![CDATA[Society]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=527</guid>
		<description><![CDATA[	A very interesting article in the New-York Times on the research behind the risks of being distracted by a cellphone whilst driving:

	http://www.nytimes.com/2009/07/19/technology/19distracted.html

	Here&#8217;s some excerpts:

	in a survey of 1,506 people last year by Nationwide Mutual Insurance, 81 percent of cellphone owners acknowledged that they talk on phones while driving, and 98 percent considered themselves safe drivers. [...]]]></description>
			<content:encoded><![CDATA[	<p>A very interesting article in the New-York Times on the research behind the risks of being distracted by a cellphone whilst driving:</p>

	<p><a href="http://www.nytimes.com/2009/07/19/technology/19distracted.html">http://www.nytimes.com/2009/07/19/technology/19distracted.html</a></p>

	<p>Here&#8217;s some excerpts:</p>

	<p><blockquote>in a survey of 1,506 people last year by Nationwide Mutual Insurance, 81 percent of cellphone owners acknowledged that they talk on phones while driving, and 98 percent considered themselves safe drivers. But 45 percent said they had been hit or nearly hit by a driver talking on a phone. </blockquote></p>

	<p>That&#8217;s the <a href="http://en.wikipedia.org/wiki/Lake_Wobegon_effect">Lake Wobegon effect</a>, the tendency for overestimate their capabilities in relation to others.</p>

	<p><span id="more-527"></span></p>

	<p><blockquote>&#8230;research, showing that multitasking drivers are four times as likely to crash as people who are focused on driving, matches the findings of two studies, in Canada and in Australia, of drivers on actual roads.</p>

	<p>The highway safety administration estimates that drivers using a hand-held device are at 1.3 times greater risk of a crash or near crash, and at three times the risk when dialing, compared with others who are simply driving. The agency based its conclusions on research from the Virginia Tech Transportation Institute, which placed cameras inside cars to monitor drivers for more than a year. The study found cellphones to be the most common cause of driver distraction.</p>

	<p>Research also shows that drivers conversing with fellow passengers do not present the same danger, because adult riders help keep drivers alert and point out dangerous conditions and tend to talk less in heavy traffic or hazardous weather.</blockquote></p>

	<p>The research shows that having a conversation on a hands-free sets is as dangerous as a conversation on a handheld phone &#8211; the problem is that, unlike a passenger, the person on the phone doesn&#8217;t stop distracting you when road conditions change, and they aren&#8217;t a second pair of eyes compensating for your distraction.</p>

	<p>So if the research is so strong, there are so many lives to be saved, how come we haven&#8217;t solved this one yet. Read on:</p>

	<p><blockquote>Joe Simitian, a state senator in California, managed to get his hands-free legislation, an effort he began in 2001, passed in 2006. He argued, based on data collected by the California Highway Patrol, that drivers using cellphones caused more fatalities than all the drivers distracted by eating, children, pets or personal hygiene.</p>

	<p>In each previous year, the bill was killed &#8212; after lobbying by cellphone carriers, including Sprint, AT&#038;T and T-Mobile. Mr. Simitian said that in the first two years, he would visit the offices of his colleagues on the Transportation Committee on the day of the vote and &#8220;find three cellphone industry lobbyists sitting in the legislator&#8217;s office,&#8221; Mr. Simitian said. &#8220;They&#8217;d just smile.&#8221;</blockquote></p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/A7ud60-_N44" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/society/on-cellphone-use-in-cars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/society/on-cellphone-use-in-cars/</feedburner:origLink></item>
		<item>
		<title>Django dynamic forms and formsets</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/wBfvWBCUWgQ/</link>
		<comments>http://www.darkcoding.net/software/django-dynamic-forms-and-formsets/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 01:08:23 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[django form formset]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=517</guid>
		<description><![CDATA[	A couple of great posts which explain Django dynamic forms and advanced formset usage very clearly:

	
	James Bennett: So you want a dynamic formMalcolm Tredinnick: Advanced Formset usage in Django


 ]]></description>
			<content:encoded><![CDATA[	<p>A couple of great posts which explain <a href="http://www.djangoproject.com">Django</a> dynamic forms and advanced formset usage very clearly:</p>

	<p><ul></p>
	<p><li>James Bennett: <a href="http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/">So you want a dynamic form</a></li><li>Malcolm Tredinnick: <a href="http://www.pointy-stick.com/blog/2009/01/23/advanced-formset-usage-django/">Advanced Formset usage in Django</a></li><br />
</ul></p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/wBfvWBCUWgQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/django-dynamic-forms-and-formsets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/django-dynamic-forms-and-formsets/</feedburner:origLink></item>
		<item>
		<title>How and Why to extend Firefox in Javascript</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/8rAYamLEMXs/</link>
		<comments>http://www.darkcoding.net/software/how-and-why-to-extend-firefox-in-javascript/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 03:29:22 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[owv2009 firefox speaking vancouver extension addon javascript]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=512</guid>
		<description><![CDATA[	I will be giving this talk on Friday 12th June, at Open Web Vancouver 2009.

	View more Keynote presentations from Graham King.

 ]]></description>
			<content:encoded><![CDATA[	<p>I will be giving this talk on Friday 12th June, at <a href="http://www.openwebvancouver.ca/">Open Web Vancouver 2009</a>.</p>

	<p><div style="width:425px;text-align:left" id="__ss_1565242"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owv2009-090610200628-phpapp02&#038;stripped_title=how-and-why-to-extend-firefox" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owv2009-090610200628-phpapp02&#038;stripped_title=how-and-why-to-extend-firefox" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">Keynote presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/graham_king">Graham King</a>.</div></div></p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/8rAYamLEMXs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/how-and-why-to-extend-firefox-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/how-and-why-to-extend-firefox-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Unix shared directory permissions: GUID and umask</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/qap1ixATOAM/</link>
		<comments>http://www.darkcoding.net/software/unix-shared-directory-permissions-guid-and-umask/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 19:11:26 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mercurial guid unix group permission directory]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=502</guid>
		<description><![CDATA[I setup my Mercurial repository in the same way we used to do CVS, then SVN: A directory owned by a group, with the GUID bit, and all users who need to commit are in that group. 

The steps are, create the group and add relevant users to it:


&#160;&#160;&#160;&#160;sudo groupadd topsecretgroup
&#160;&#160;&#160;&#160;sudo usermod -a -G topsecretgroup [...]]]></description>
			<content:encoded><![CDATA[<p>I setup my Mercurial repository in the same way we used to do CVS, then SVN: A directory owned by a group, with the GUID bit, and all users who need to commit are in that group. </p>

<p>The steps are, create the group and add relevant users to it:</p>

<div class="quickcodenoclick"><code><br />
&nbsp;&nbsp;&nbsp;&nbsp;sudo groupadd topsecretgroup<br />
&nbsp;&nbsp;&nbsp;&nbsp;sudo usermod -a -G topsecretgroup graham</code></div>

<p><span id="more-502"></span></p>

<p>Change the project directory to be owned by that group, and accessible by no-one else:</p>

<div class="quickcodenoclick"><code><br />
&nbsp;&nbsp;&nbsp;&nbsp;cd topsecretproject/<br />
&nbsp;&nbsp;&nbsp;&nbsp;sudo chown graham:topsecretgroup -R .<br />
&nbsp;&nbsp;&nbsp;&nbsp;sudo chmod g=u,o= -R .&nbsp;&nbsp;</code></div>

<p>Set the GUID bit on all the directories, so that new files and directories are created owned by the group:</p>

<div class="quickcodenoclick"><code><br />
&nbsp;&nbsp;&nbsp;&nbsp;find . -type d | sudo xargs chmod g+s</code></div>

<p>Change the umask for everyone, so that new files are created with read and write permissions for the group:</p>

<div class="quickcodenoclick"><code><br />
&nbsp;&nbsp;&nbsp;&nbsp;sudo vi /etc/profile<br />
&nbsp;&nbsp;&nbsp;&nbsp;change &#039;umask 022&#039; to &#039;umask 002&#039; </code></div>

<p>The last part, changing the umask, isn&#8217;t ideal. It works on Debian and Ubuntu, because every user has their own group. I would rather a more focused solution, just for that directory &#8211; suggestions welcome.</p>

<p>References:</p>

<p><a href="http://www.freehackers.org/thomas/2008/09/16/about-mercurial-and-permissions/">Mercurial and permissions</a><br />
<a href="http://www.selenic.com/mercurial/wiki/MultipleCommitters">Multiple Committers</a><br />
<a href="http://ubuntuforums.org/showthread.php?t=127084">Change Ubuntu global umask</a><br />
<a href="http://hgbook.red-bean.com/read/collaborating-with-other-people.html">Collaboration models</a>  </p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/qap1ixATOAM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/unix-shared-directory-permissions-guid-and-umask/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/unix-shared-directory-permissions-guid-and-umask/</feedburner:origLink></item>
		<item>
		<title>Legal 1 Usability 0</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/syoSnOH99wg/</link>
		<comments>http://www.darkcoding.net/misc/legal-1-usability-0/#comments</comments>
		<pubDate>Wed, 27 May 2009 18:55:46 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[food temperature microwave legal usability]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=494</guid>
		<description><![CDATA[	The cooking instructions for my Tandoori Chicken Breast microwave lunch, are to cook&#8230;

	&#8230;until internal temperature reaches 74C (165F).

	How many office kitchens have a cook&#8217;s thermometer? Score nothing for usability.

	Should you for any reason attempt to sue the manufacturer, it will rapidly become apparent that you didn&#8217;t follow the cooking instructions. Score one for legal.

 ]]></description>
			<content:encoded><![CDATA[	<p>The cooking instructions for my Tandoori Chicken Breast microwave lunch, are to cook&#8230;</p>

	<p><blockquote>&#8230;until internal temperature reaches 74C (165F).</blockquote></p>

	<p>How many office kitchens have a cook&#8217;s thermometer? Score nothing for usability.</p>

	<p>Should you for any reason attempt to sue the manufacturer, it will rapidly become apparent that you didn&#8217;t follow the cooking instructions. Score one for legal.</p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/syoSnOH99wg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/legal-1-usability-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/legal-1-usability-0/</feedburner:origLink></item>
		<item>
		<title>OpenTTD: Trains and signals for beginners – a tutorial</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/XnibbhArJgU/</link>
		<comments>http://www.darkcoding.net/misc/openttd-trains-and-signals-for-beginners-a-tutorial/#comments</comments>
		<pubDate>Thu, 21 May 2009 07:22:43 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[openttd train signal game tutorial]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=464</guid>
		<description><![CDATA[I have been playing Open Transport Tycoon Deluxe, or OpenTTD on and off for a while, but I confess I only understood train signals very recently. The game gets a lot more fun once you can have complex track layouts, so here&#8217;s a tutorial on train track layout and signaling for complete beginners.
Building tracks the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing Open Transport Tycoon Deluxe, or <a href="http://www.openttd.org">OpenTTD</a> on and off for a while, but I confess I only understood train signals very recently. The game gets a lot more fun once you can have complex track layouts, so here&#8217;s a tutorial on train track layout and signaling for complete beginners.</p>
<h2>Building tracks the wrong way</h2>
<p>If you&#8217;re anything like I was, all your train layouts probably look like this:</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/one-to-one.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/one-to-one-150x150.jpg" alt="one-to-one" title="one-to-one" width="150" height="150" class="aligncenter size-thumbnail wp-image-468" /></a></p>
<p><span id="more-464"></span></p>
<p>You can only run one train on that track, but say you&#8217;re happy with that. When you need to connect another station, you might, unsuccessfully, try this:</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/two-stations-naive.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/two-stations-naive-150x150.jpg" alt="two-stations-naive" title="two-stations-naive" width="150" height="150" class="aligncenter size-thumbnail wp-image-469" /></a></p>
<p>Notice the three two-way signals. <strong>A signal locks an entire section of track from that signal until the next signal or the end of the line.</strong> These signals define four locks, color coded on this screenshot. If the train from Lundinghattan Ridge is in the Mardingbury station, it will have a lock on the yellow section, but not on the green section. The signal nearest Mardingbury will be red, but the other two signals will be green. The train from Marbourne will be able to acquire a lock on the green section, and stop at the signal nearest Mardingbury. We have a train stand-off. Not good.</p>
<p>To make that layout work, you&#8217;d need to remove the signal nearest Mardingbury, thereby merging the green and yellow sections. You remove that, and you have two trains sharing a station. OK, so now you add a third station to your network. Now things really start to break down.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/blocked.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/blocked-150x150.jpg" alt="blocked" title="blocked" width="150" height="150" class="aligncenter size-thumbnail wp-image-471" /></a></p>
<p>The blue section is shared between the Lundinghattan train and the Chenningpool train. The Lundinghattan train is top left, just leaving Mardingbury station. It has the lock on the yellow section. Notice the two signals nearest it are red (actually all the signals in this picture are red, but focus on just those two).  The train from Chenningpool acquired the lock on the blue section, but and this is the first important concept of this tutorial, once it got level with the depot it had a choice of two paths: Mardingbury, which is blocked by a red signal, and the depot, which isn&#8217;t. <strong>A train faced with a red two-way signal will always avoid that signal, even if that means going away from it&#8217;s destination</strong>. If instead of the depot we had a track running to the other side of the map, our Chenningpool would of happily headed down it, to avoid the red signal.</p>
<p>In practice this means our Chenningpool train will head into the depot, turn around, and head back to Chenningpool. It will never make it to Mardingbury. There is something very wrong with our approach, and the short answer is that we were using two-way tracks and two-way signals. We need to think one-way. Let&#8217;s start again.</p>
<h2>The basic loading loop</h2>
<p>Every shared station should have a one-way loading loop.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/loading-loop.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/loading-loop-150x150.jpg" alt="loading-loop" title="loading-loop" width="150" height="150" class="aligncenter size-thumbnail wp-image-473" /></a></p>
<p>Notice the signals around the loop are all one-way. To place a one-way signal place a signal as normal, then click the signal again, once or twice depending on the orientation you want for your signal.</p>
<p>Now let&#8217;s connect our loop up to a town, and run two trains betweens those two towns.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/shared-track1.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/shared-track1-150x150.jpg" alt="shared-track1" title="shared-track1" width="150" height="150" class="aligncenter size-thumbnail wp-image-474" /></a></p>
<p>We connected the shared track from Marbourne to our loading loop, with two short one-way sections. We can see the back of a one-way signal in the red circle, and the front of a one-way signal just to the right of the blue circle.</p>
<p>Let&#8217;s look at what&#8217;s going on in this picture. The train circled in red has the lock on the red section of track, and is held at the signal circled in red. It is waiting for a lock on the blue section of track. Notice that it could of kept going around the loop, instead of branching off and stopping at the red signal. <strong>Faced with a red one-way signal and a clear track going the wrong way, the train will stop at the signal, which is nearly always what we want</strong>. This is exactly the opposite to what would of happened with two-way signals.</p>
<p>The train circled in blue has the lock on the blue section of track, and is about to acquire the lock on the yellow section. As soon as it does, it will release the lock on the blue section, and the train circled in red will move forward. This is a layout that works.</p>
<h2>Prefer one way tracks</h2>
<p>Let&#8217;s connect up the other two towns, and not get blocked this time. The trick is to make all shared sections of track one-way.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/one-way.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/one-way-150x150.jpg" alt="one-way" title="one-way" width="150" height="150" class="aligncenter size-thumbnail wp-image-475" /></a></p>
<p>The only two-way signals in this picture are circled in blue. All the others are one-way. The two-way signals are there to prevent a train on the two-way track from locking part of the one-way loop. If the left-hand two-way signal was not there, a train in Lundinghattan station would hold a lock on it&#8217;s two-way section of track, and the bottom part of the one-way section, up to the next signals. Remember, a lock is between two signals or the end of the track. Incidentally, stations don&#8217;t end a lock. If you had a station half-way along a track, the lock would run right through it until the next signal.</p>
<h2>Pre-signals, the pro-layout</h2>
<p>Mardingbury is getting quite busy now, we&#8217;d like to have two tracks in the station. Stop all the trains (or be quick!), bulldoze the station, and build a new, two track one. I moved mine back a square to allow space for the tracks to merge. and made the loading loop a little bigger. To control access to a multi-track station, you need <strong>pre-signals</strong>.</p>
<p>Pre-signals come in two types, entrance and exit. An entrance pre-signal will be red if all the exit pre-signals behind it are also red. The motivation for pre-signals is nicely illustrated here: <a href="http://wiki.openttd.org/Signals#Pre-signals">Pre-signals on the OpenTTD wiki</a>.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/pro1.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/pro1-150x150.jpg" alt="pro1" title="pro1" width="150" height="150" class="aligncenter size-thumbnail wp-image-479" /></a></p>
<p>The entrance pre-signal is circled in blue. Notice that it has a horizontal white-bar, to show it is different. The exit pre-signals are circled in purple, and have vertical white bars. There is currently a train in the station, so one of the exit pre-signals is red. Because one of the tracks is free (green signal), the entrance pre-signal is green. The next arriving train will correctly go to the empty track. Even though they are pre-signals, we are still using one-way signals</p>
<p>What you can&#8217;t see on the picture, but which are very important, are the two normal one-way signals circled in black. They control station exit, by forcing a train wanting to leave the station to acquire a lock on the yellow section. This prevents two train leaving at the same time crashing into each other.</p>
<p>When a train is in the station, it still holds a lock on it&#8217;s section of track. The lock runs from the exit -pre-signal at the entrance to the station, to the regular one-way signal at the exit of the station.</p>
<h2>Scaling it up</h2>
<p>You now know all the key concepts, the rest is just more of the same. Here for example is what you would do if Lundinghattan got busy.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/two-loading-loops.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/two-loading-loops-150x150.jpg" alt="two-loading-loops" title="two-loading-loops" width="150" height="150" class="aligncenter size-thumbnail wp-image-481" /></a></p>
<p>You give it a loading loop, and a multi-bay station. Pre-signals control station entrance, and regular one-ways control the exit. You can see the one-way&#8217;s at the exit much better on this station.</p>
<p>There&#8217;s one final change we need to make to allow lots of trains &#8211; we need to replace the two-way section highlighted in blue with two one-way sections.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/pro-final.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/pro-final-150x150.jpg" alt="pro-final" title="pro-final" width="150" height="150" class="aligncenter size-thumbnail wp-image-483" /></a></p>
<p>We don&#8217;t have any more two-way signals. Each station has a loading loop, and one-way tracks connect the stations. In our first tries we had one track connecting the stations, and could only run one train between them. Now we have two tracks connection the stations, and in this picture alone there are eight trains, all serving Mardingbury. Now that&#8217;s more like it!</p>
<p>The stations are quite close together, so it might not be clear what is loading-loop and what is the tracks that connect them, so here&#8217;s an example with stations further apart.</p>
<p><a href="http://www.darkcoding.net/wp-content/uploads/2009/05/pro-big.jpg"><img src="http://www.darkcoding.net/wp-content/uploads/2009/05/pro-big-150x150.jpg" alt="pro-big" title="pro-big" width="150" height="150" class="aligncenter size-thumbnail wp-image-491" /></a></p>
<p>Other stations would have their own loading loops, and as long as the one way tracks connect, you end up with a network spanning the world. Trains can run from anywhere to anywhere, and new stations just need plugging in to the network.</p>
<p>I have one final tip: Playing with virtual toy trains can be quite addictive, so remember to get some sleep :-)</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/XnibbhArJgU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/misc/openttd-trains-and-signals-for-beginners-a-tutorial/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/misc/openttd-trains-and-signals-for-beginners-a-tutorial/</feedburner:origLink></item>
		<item>
		<title>Quote of the day: Why racists have bad graphic design</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/EZlIGvKNfHQ/</link>
		<comments>http://www.darkcoding.net/society/quote-of-the-day-why-racists-have-bad-graphic-design/#comments</comments>
		<pubDate>Wed, 20 May 2009 16:34:19 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Society]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=460</guid>
		<description><![CDATA[	Charlie Brooker on a television advert by the British National Party, England&#8217;s (very small) right-wing political party:

	
Extremist material of any kind always looks gaudy and cheap, like a bad pizza menu. Not because they can&#8217;t afford decent computers &#8211; these days you can knock up a professional CD cover on a pay-as-you-go mobile &#8211; but [...]]]></description>
			<content:encoded><![CDATA[	<p>Charlie Brooker on a television advert by the British National Party, England&#8217;s (very small) right-wing political party:</p>

	<p><blockquote><br />
Extremist material of any kind always looks gaudy and cheap, like a bad pizza menu. Not because they can&#8217;t afford decent computers &#8211; these days you can knock up a professional CD cover on a pay-as-you-go mobile &#8211; but because anyone who&#8217;s good at graphic design is likely to be a thoughtful, inquisitive sort by nature. And thoughtful, inquisitive sorts tend to think fascism is a bit shit, to be honest. If the <span class="caps">BNP</span> really were the greatest British party, they&#8217;d have the greatest British designer working for them &#8211; Jonathan Ive, perhaps, the man who designed the iPod. But they don&#8217;t. They&#8217;ve got someone who tries to stab your eyes out with primary colours.</blockquote></p>

	<p>Read the article: <a href="http://www.guardian.co.uk/commentisfree/2009/may/18/charlie-brooker-bnp-racism">Charlie Brooker on the <span class="caps">BNP</span> and their political broadcast</a>.</p>

 <img src="http://feeds.feedburner.com/~r/darkcoding/~4/EZlIGvKNfHQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/society/quote-of-the-day-why-racists-have-bad-graphic-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/society/quote-of-the-day-why-racists-have-bad-graphic-design/</feedburner:origLink></item>
		<item>
		<title>Speaking at Open Web Vancouver 2009 in June</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/7fCngKnb4Xo/</link>
		<comments>http://www.darkcoding.net/software/speaking-open-web-vancouver-2009/#comments</comments>
		<pubDate>Sun, 17 May 2009 21:30:59 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Future of Web Apps]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[owv09 speaking vancouver]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=455</guid>
		<description><![CDATA[I will be speaking at Open Web Vancouver on Thursday, June 11, 2009 and Friday, June 12, 2009.
That&#8217;s in Vancouver, B.C., Canada. There&#8217;s a very interesting speaker lineup, and the whole conference is reasonably priced, so come along, learn, interact, and enjoy Vancouver in the summertime.

My talk will be entitled How and Why to Extend [...]]]></description>
			<content:encoded><![CDATA[<p>I will be speaking at <a href="http://www.openwebvancouver.ca">Open Web Vancouver</a> on Thursday, June 11, 2009 and Friday, June 12, 2009.<br />
That&#8217;s in Vancouver, B.C., Canada. There&#8217;s a very interesting <a href="http://www.openwebvancouver.ca/speakers_sessions">speaker lineup</a>, and the whole conference is reasonably priced, so come along, learn, interact, and enjoy Vancouver in the summertime.</p>

<p>My talk will be entitled <strong>How and Why to Extend Firefox in Javascript (and Thunderbird, Komodo, and Songbird)</strong>. I will post the slides here in June.</p>

<p>See you there!</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/7fCngKnb4Xo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/speaking-open-web-vancouver-2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/speaking-open-web-vancouver-2009/</feedburner:origLink></item>
		<item>
		<title>Micro-Zooids: A story</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/Q8ePPaHsQVQ/</link>
		<comments>http://www.darkcoding.net/software/micro-zooids-a-story/#comments</comments>
		<pubDate>Sun, 10 May 2009 22:23:13 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Strategy]]></category>
		<category><![CDATA[story game youth]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=450</guid>
		<description><![CDATA[When I was 16, I wrote a computer game, called Micro Zooides. It was called that partly because on Windows .EXE files all start with the two characters MZ, and partly because it was about small creatures. Micro-Zooides was going to be about humanity&#8217;s progress, it was going to be Civilization, which didn&#8217;t exist yet.

The [...]]]></description>
			<content:encoded><![CDATA[<p>When I was 16, I wrote a computer game, called Micro Zooides. It was called that partly because on Windows .EXE files all start with the two characters <code>MZ</code>, and partly because it was about small creatures. Micro-Zooides was going to be about humanity&#8217;s progress, it was going to be <a href="http://www.civilization.com/">Civilization</a>, which didn&#8217;t exist yet.</p>

<p>The game had a splash screen of a Far Side comic, then a short video of me tromping through the woods like a Neanderthal, which my Dad filmed and which I digitized with a very early video capture card.</p>

<p>In <a href="http://en.wikipedia.org/wiki/Turbo_C%2B%2B#Historical_versions">Borland&#8217;s Turbo C++ 3.0</a> I wrote a basic graphics engine to display the tiles of the world, and an event loop so I could move the main character around the world. I drew sprites for a proto-human (the micro zooid), dirt, rocks and sticks. He could walk around the world, and pick up and put down rocks or sticks.</p>

<p>Then I took a break to plan. I have a proto-human, rocks, and sticks. How do I get to civilization?</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/Q8ePPaHsQVQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/micro-zooids-a-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/micro-zooids-a-story/</feedburner:origLink></item>
		<item>
		<title>Turn on debug output in SVN</title>
		<link>http://feedproxy.google.com/~r/darkcoding/~3/CcvH7zCNk-o/</link>
		<comments>http://www.darkcoding.net/software/turn-on-debug-output-in-svn/#comments</comments>
		<pubDate>Thu, 07 May 2009 23:02:38 +0000</pubDate>
		<dc:creator>Graham King</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.darkcoding.net/?p=435</guid>
		<description><![CDATA[After a desktop and server upgrade, my subversion client stopped working. I am using Digest authentication, and it kept asking me for the username and password. Wireshark showed me that the SVN client wasn&#8217;t sending the Authentication header. To find out more, I turned on Subversion&#8217;s debug output. Here&#8217;s how you do it:

Edit /etc/subversion/servers
Add this [...]]]></description>
			<content:encoded><![CDATA[<p>After a desktop and server upgrade, my subversion client stopped working. I am using Digest authentication, and it kept asking me for the username and password. <a href="http://www.wireshark.org/">Wireshark</a> showed me that the SVN client wasn&#8217;t sending the Authentication header. To find out more, I turned on Subversion&#8217;s debug output. Here&#8217;s how you do it:</p>

<p>Edit <strong>/etc/subversion/servers</strong><br />
Add this line at the end: <strong>neon-debug-mask = 511</strong></p>

<p>That showed me this error: <code>auth: '/' is inside auth domain: 0.</code></p>

<p>This means that the path I was requesting (the root of the repo) was not considered inside the <code>AuthDigestDomain</code> I had set in Apache.</p>

<p>It turns out that at some point in the upgrade of Apache, Subversion, or a library, the AuthDigestDomain requires a scheme. I had<br />
<code>AuthDigestDomain svn.myserver.com</code><br />
whereas it should of been<br />
<code>AuthDigestDomain http://svn.gkgk.org</code>.</p>

<p>So now you know.</p>
<img src="http://feeds.feedburner.com/~r/darkcoding/~4/CcvH7zCNk-o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.darkcoding.net/software/turn-on-debug-output-in-svn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.darkcoding.net/software/turn-on-debug-output-in-svn/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 2.622 seconds --><!-- Cached page served by WP-Cache -->
