July 2011 Archives

$16 trillion for fat cats; $0 for you and me

The chart on p. 144 of this General Accounting Office audit of the Federal Reserve Bank shows that banks and other financial institutions received $16.115 TRILLION in (virtually zero-interest) loans from the Federal Reserve from December 2007 through July 2010.

As Sen. Bernie Sanders writes, “This is a clear case of socialism for the rich and rugged, you’re-on-your-own individualism for everyone else.”

Posted by James on Jul 22, 2011

Americans believe federal funding of research & arts is huge, but it's actually tiny

Our federal budget is totally irrational. Excluding trust funds like Social Security, America spends over half our budget on the military.

Even worse, a functioning democracy requires an informed public, yet most Americans have completely false beliefs about how their tax dollars are spent. For example, most believe foreign aid and spending on the arts are orders of magnitude larger than they are:

Asked to estimate how much of the federal budget goes to foreign aid, the median estimate is 25 percent. Asked how much they thought would be an “appropriate” percentage the median response is 10 percent.

In fact just 1 percent of the federal budget goes to foreign aid.

And foreign aid is huge compared with arts spending:

The [Corporation for Public Broadcasting] CPB is getting $455 million (of which about $90m goes to radio stations). The Smithsonian gets the biggest federal arts allocation, at $761m. If you add all arts-related federal programs together, funding for the current fiscal year totals just over $2.5 billion. Honestly, that number looks pretty large to me. I can’t imagine what a billion of anything really looks like. But the total federal budget for this fiscal year (which runs through September) is $3.82 trillion. So the federal arts funding we’ve identified is 0.066% of the total federal budget. And when we’re only shouting about CPB, we’re talking about 0.012%. That is twelve one-thousandths of one percent….

According to a CNN poll, most Americans do not think the CPB gets twelve one-thousandths of one percent of the budget. Actually, only 27% of those surveyed believe the CPB gets less than 1% of the total budget. 40% believe the CPB gets 1-5%. Everyone else believed the appropriation to be greater than 5%, and an astonishing 7% of those surveyed believe the Corporation for Public Broadcasting gets more than 50% of the budget (which would have to be close to $2 trillion)….

What about [categories not even included in the poll, like] subsidies to the oil & gas industry, which the Obama administration claims add up to $4 billion (about 9 times CPB funding)? What about direct subsidies for farmers, which were about $5 billion last year? Tax exemptions for ethanol production aren’t mentioned, either. Nor are the $8.5 billion in subsidies given to the airlines since 9/11 simply to help them survive. These subsidies went to for-profit industries, which are theoretically subject to the rigor of the free market and exist for the profit of their shareholders. And yet, more discussion is generated by $2.5 billion in subsidies to arts organizations, both governmental and non-profit, that explicitly exist for the public benefit and do not have shareholders.

David Brooks offers some interesting examples of the practical value of social science research:

When you renew your driver’s license, you have a chance to enroll in an organ donation program. In countries like Germany and the U.S., you have to check a box if you want to opt in. Roughly 14 percent of people do. But behavioral scientists have discovered that how you set the defaults is really important. So in other countries, like Poland or France, you have to check a box if you want to opt out. In these countries, more than 90 percent of people participate….

What is the starting taxi fare in your city? If you are like most upper-middle-class people, you don’t know. If you are like many struggling people, you do know. Poorer people have to think hard about a million things that affluent people don’t. They have to make complicated trade-offs when buying a carton of milk: If I buy milk, I can’t afford orange juice. They have to decide which utility not to pay.

These questions impose enormous cognitive demands. The brain has limited capacities. If you increase demands on one sort of question, it performs less well on other sorts of questions.

Shafir and Mullainathan gave batteries of tests to Indian sugar farmers. After they sell their harvest, they live in relative prosperity. During this season, the farmers do well on the I.Q. and other tests. But before the harvest, they live amid scarcity and have to think hard about a thousand daily decisions. During these seasons, these same farmers do much worse on the tests. They appear to have lower I.Q.’s. They have more trouble controlling their attention. They are more shortsighted. Scarcity creates its own psychology.

Princeton students don’t usually face extreme financial scarcity, but they do face time scarcity. In one game, they had to answer questions in a series of timed rounds, but they could borrow time from future rounds. When they were scrambling amid time scarcity, they were quick to borrow time, and they were nearly oblivious to the usurious interest rates the game organizers were charging. These brilliant Princeton kids were rushing to the equivalent of payday lenders, to their own long-term detriment.

Given his belief that social science can inform wiser, cheaper social policies, Brooks is understandably upset social science is on the budgetary cutting block:

Yet in the middle of this golden age of behavioral research, there is a bill working through Congress that would eliminate the National Science Foundation’s Directorate for Social, Behavioral and Economic Sciences. This is exactly how budgets should not be balanced — by cutting cheap things that produce enormous future benefits.

Politicians will only rationalize spending if the people have some semblance of a grasp on actual spending. The American people are obviously clueless about how their tax dollars are spent. Until we figure out where our dollars are going, politicians will continue spending them however they see fit their corporate donors tell them to.

Posted by James on Jul 09, 2011

Andreessen: The immorality of not letting a robot drive your car

I’m scared humanity will place too much control of societal infrastructure in the “hands” of computers and robots and grow too dependent on them, but there is one area I can’t wait for robotics to dominate: driving. I’d love to be able to read while “driving.” But I’m far more interested in making the roads safer. I’m astonished daily by how inept, incompetent, reckless, law-breaking, rude, and distracted many of my fellow drivers are. I’ve nearly been hit by cars driving full speed through red lights and stop signs. Some drivers seem blind to lane dividing lines. People can’t park properly. Many are obviously inebriated or on drugs. Many more are — I still can’t believe this — too busy texting or chatting away on their cell phones or putting on makeup to bother to drive properly.

So I enjoyed Marc Andreessen’s comment and hope it proves prescient:

Google is working on self-driving cars, and they seem to work. People are so bad at driving cars that computers don’t have to be that good to be much better. Any time you stand in line at the D.M.V. and look around, you’re like, Oh, my God, I wish all these people were replaced by computer drivers. Ten to 20 years out, driving your car will be viewed as equivalently immoral as smoking cigarettes around other people is today.

Posted by James on Jul 30, 2011

Another reason to love objects

A major benefit of object-oriented programming is that there’s one and only one place to modify something. If a program’s objects are designed and named intelligently and you need to fix a bug or add new functionality, you know exactly where to go.

A less frequently cited benefit is that users can quickly find out how to use your software, even if you provide little/no documentation (or, even worse, completely outdated and misleading documentation).

Over several years of screen scraping, I’ve used a series of programs, starting with Hpricot, Nokogiri and Mechanize. But these don’t work well with Javascript-based, formless logins, so I’ve just switched some of my code over to Selenium Webdriver. But Selenium’s documentation is a mess because “Selenium” is really several different programs that have been mashed together, and Selenium’s evolving quickly. Selenium’s documentation warns “We are currently updating this document for the Selenium 2.0 release. This means we are currently writing and editing new material, and revising old material.”

My efforts Googling for how to save a page’s HTML to a file kept coming across suggestions to use “.getBodyText().” This, I figured, was the Java form, so “.get_body_text” should be the Ruby form. I found the .get_body_text method in the API docs, but — I discovered after a while — it has apparently been deprecated because it was defined in the “legacy_driver.rb” file. This belongs to the Client version of Selenium, not the WebDriver version. The API docs should not mix the two, but they do.

So then I went looking in the Selenium::WebDriver::Driver class, and — sure enough — there it was. The new method is called “page_source”. Problem solved.

I was slowed down and led astray by outdated documentation, naming changes, and the conflation of two different APIs into one set of API docs. But I found the right answer reasonably quickly, thanks to the beauty of objects.

Posted by James on Jul 12, 2011

Credit cards are so 20th Century

Tired of feeling like an old man — at age 42, no less — I recently… finally… joined Twitter and am now following many of the Ruby/Rails/JQuery/PostgreSQL/JRuby masters. I’m loving it. I joined after reading Twitter lets people you trust curate the Web for you. They do exactly that, informing me of breaking news in subjects I care about. It’s fabulous.

But my old-man reluctance to sign up for this service and that service — I swear I’ll never join Facebook! — cost me a valuable opportunity. A few days ago, Avdi Grimm tweeted that his e-book, Exceptional Ruby, had a one-day 50% off sale. I went to buy it, but the only purchase options were PayPal and Google. I started signing up for PayPal before reading the terms of service and giving up. I just want to use my darn credit card.

Gosh, I feel old. Now where did I leave my horse-and-buggy?

Posted by James on Jul 07, 2011

Funny things our kids say

Our kids are always saying and doing funny things. Just this morning:

Lia (who turned 2 in March) has been peeing in the potty for months but often still poops in her pants. This morning, after another accident, my wife tried to use Lia’s hero, “Super Why,” to encourage her, saying “Super Why doesn’t poop in his pants.” Lia shot her down, replying, “Super Why poops in his super pants!”

And Daryl (4 going on 5) told me “This is a Costco!” Having played the imaginary store game many times, I thought I knew what I was doing when I asked, “Oh, great. Could I please have some of your delicious raisin bread?” But Daryl replied, “This is a Costco. You have to get everything yourself.”

Posted by James on Jul 09, 2011

Grateful whale thanks rescuers

We took our kids whale watching off the Massachusetts coast Sunday and saw quite a few whales. Very impressive creatures. Such a shame humans have so severely damaged our oceans and depleted well over half the oceans' fish over the past 100 years.

We had a wonderful ride, except when our son’s beautiful new Red Sox hat — made in his mother’s hometown in China — flew off his head and into the water.

Large, intelligent mammals fascinate me because their emotional lives often appear so similar to humans'. I was touched this morning by this story:

The group came upon a stranded humpback whale who was so tangled in a mesh of nylon netting that she was beginning to drown, and as Fishbach noted in this video, was possibly an hour from death. The crew worked tirelessly for more than an hour to free the stranded whale and, to their elation, eventually succeeded. Then, magic happened.

For miles on their ride home, the whale put on a beautiful show — perhaps to say “thank you” to her rescuers?

Posted by James on Jul 19, 2011

How to replicate random bugs in Ruby

Yesterday, someone Tweeted that a random test run of his code had produced a rare ordering-related bug that he couldn’t replicate because he didn’t know the seed value.

This suggests an interesting dilemma. Randomness is good because it exercises your code more rigorously, enabling you to identify more bugs. On the proverbial other hand, random bugs are tough to fix because they can’t be replicated.

The “obvious” solution — recording the seed when you generate a random one — is infeasible in Ruby because srand()’s return value is not the new seed but the previous seed.

Here are two solutions, both involving recording the seed to enable you to replicate any bug. Whenever you find your code making random calls — and don’t forget things like looping through hashes, whose ordering is not guaranteed — you’ll want to record your seed value:

1) Wrap random calls in begin... rescue... end blocks and make sure your rescue section prints the seed value or saves it to a temp file. I suspect the strange behavior of srand() — its return value is not the new seed but the previous seed — is presumably designed to make this possible:

irb> srand(1)
=> 9664034031542159759956844050608130405
irb> srand(2)
=> 1
irb> srand(3)
=> 2

This seemingly odd behavior enables you to grab the seed that produced the exception just by calling srand() again. This spares you the hassle of saving the seed when you initially call srand() and have not yet hit an exception.

2) An alternative approach — which I prefer because the seed value is really a global variable that should not be entangled with your code — is to set and save a random seed value. This seems impossible, since srand() returns the previous value and randomly selects a new value, which it does not return. But you can call srand() three times, first to generate a seed, second to save the seed in a variable, and third to set the seed. This lets you set and record a random value each time you run your test code:

irb> srand() # generates random seed
=> 230484092778069480813792111804730187148
irb> rand_seed = srand() # stores random seed in variable
=> 286682958024894595375678230594990984042
irb> srand(rand_seed) # sets seed
=> 185843738191625995823601334214935582043
irb> srand(rand_seed) # test: it works!
=> 286682958024894595375678230594990984042
irb> srand(rand_seed) # test again: still working!
=> 286682958024894595375678230594990984042

The first solution is arguably cleaner (aside from its entanglement in your code). But the three calls to srand() can be encapsulated in a function that sets a random seed and returns its value, as follows:

def srand_and_return_seed
  rand_seed = srand()

seed = srand_and_return_seed

This works well:

irb> seed = srand_and_return_seed
=> 199008925976592588622036659089197447054
irb> seed
=> 199008925976592588622036659089197447054
irb> srand()
=> 199008925976592588622036659089197447054

Either way, you get the benefits of randomness while retaining the ability to replicate even the most obscure bugs.

Posted by James on Jul 26, 2011

If police can record us, they can't arrest us for recording them

Many police departments are putting small video cameras on their officers:

Oakland and hundreds of other police departments across the country are equipping officers with tiny body cameras to record anything from a traffic stop to a hot vehicle pursuit to an unfolding violent crime….

Officers are required to turn on their cameras for calls. They are also required to download their video within a day and they are not allowed to edit or manipulate it.

This is a potentially great thing. But I have three worries:

First, there should be no way for a bad cop to “forget” to turn on their video recorder or “accidentally” erase a recording.

Second, the accused must have access to all relevant recordings. Videos must not become something the police can use when it makes them look good and something they can suppress when it makes them look bad. Police departments have withheld video recordings that incriminate themselves.

And, third, there must be a balance of rights between police and non-police. If police have the right to record their interactions with the public, then the public has the right to record their interactions with the police. Instead, police in many cities and towns have been extremely aggressive about threatening, harassing and arresting Americans for the “crime” of recording public police activities:

It’s a huge problem.

Because guns kill, I don’t buy the “if everyone had guns, we would all be safer” argument. But I do believe this regarding video cameras, which can help juries determine who did what to whom. Bad police would behave better if they suspected non-police might be recording them and feared their own recordings could be used against them. And good police would be better protected against false claims by the public about harassment and abuse if they and others recorded their actions. As it stands today, it often becomes a “he said, she said” between a police officer and an ordinary citizen. This allows bad police to behave badly toward anyone juries might disrespect or be prejudiced against for any reason, like when L.A. police beat Rodney King.

Depressingly, in many communities today, video is a weapon of the police that those same police are (illegally) denying to the public. This must change.

Posted by James on Jul 10, 2011

Killer hospitals


The WHO appointed Professor Liam Donaldson, England’s former chief medical officer, as the agency’s envoy for patient safety….

“If you were admitted to hospital tomorrow in any country … your chances of being subjected to an error in your care would be something like 1 in 10. Your chances of dying due to an error in health care would be 1 in 300,” Donaldson told a news briefing, Reuters reported.

This compared with a risk of dying in an air crash of about 1 in 10 million passengers, he said.

Of every 100 hospitalized patients at any given time, seven in developed and 10 in developing countries will acquire at least one health care-associated infection, according to the report.

…“if I was having an operation tomorrow I wouldn’t go into a hospital that wasn’t using the [WHO surgical safety] checklist because I wouldn’t regard it as safe,” said Donaldson.

I did an empirical analysis recently that found a strong relationship between healthy behaviors (exercising, eating well, not smoking, etc.) and health but zero — or even a slight negative — relationship between quality hospitals and health. I was surprised to see a slight negative relationship, but hospitals can be dangerous places. They’re no longer leeches-and-lobotomies dangerous, but they’re full of antibiotic-resistant germs and hospital employees who make mistakes.

Much better to live a healthy lifestyle than rely on doctors to fix you.

Posted by James on Jul 22, 2011

Michael Irvin stands up for gay rights

This is a nice story. I’m moved by Irvin’s love for his brother, their dad’s tolerance and acceptance of his gay son (in an earlier, less enlightened era), and Irvin’s very public stand for gay rights.

I also admire Irvin’s words:

“I don’t see how any African-American, with any inkling of history, can say that you don’t have the right to live your life how you want to live your life. No one should be telling you who you should love, no one should be telling you who you should be spending the rest of your life with. When we start talking about equality, and everybody being treated equally, I don’t want to know an African-American who will say everybody doesn’t deserve equality.”

Posted by James on Jul 13, 2011

My simple metric for primary education

Because I have two young kids, I’ve read and thought a lot about education and learning over the past five years.

I can summarize my objective for my kids' elementary years as “developing a passion for learning and the capacity to learn independently.”

Any kid who enjoys learning and is equipped with skills and resources to pursue her/his interests and curiosities will thrive.

NCLB’s focus on test scores confuses cause with effect and doesn’t even aim for the right effect! Passing math and English tests is a side effect of real learning, and it’s a lousy measure of the success of our schools. Replacing a learning experience with intensive test prep may or may not boost test scores. But it certainly will stifle learning in the long term by artificially making learning a chore, rather than something exciting and valuable for its own sake.

Enthusiasm drives learning. A kid who carries a book with him/her everywhere he/she goes — a lifelong habit of mine; my parents dragged me around Canada one summer while I read a thick SAT vocabulary book — doesn’t need to copy by hand twenty dictionary definitions a week — as my 9th grade English teacher forced us to… though I refused, resulting in my English grade falling from a 1st quarter “A+” to a 4th quarter “F.”

We should teach in ways that leverage kids' natural enthusiasm for learning. For example, let students choose which books to read, and let’s teach math using (online and “offline”) games. Learning new things is intrinsically enjoyable and rewarding. Drills and worksheets, conversely, suck the fun out of learning.

My metric for judging an elementary school is simple: The proportion of kids smiling (because they’re playing with friends or excited by the science experiment they’re conducting) or entranced by some task that will expand their knowledge (like reading a book or observing a frog or watching a documentary on the Mayflower).

Schools with happy, engaged kids are fostering students' love of learning and building their capacity for lifelong learning. Test scores follow naturally. Conversely, schools that “drill and kill” fail students in the long-run and, probably, the short-run too. No school should be allowed to kill children’s natural enthusiasm for learning.

Posted by James on Jul 25, 2011

Online learning is the future -- and present -- of education

Like global warming, online educational tools will have their greatest impact in the future but are already having effects today.

Educational technologies will keep getting better. And teachers and students will learn how to better utilize them. One teaching adaptation multiple teachers have independently discovered — and all seem to love — is flipping lectures and “homework”: lectures are recorded, uploaded online, and watched by students at home, freeing up class time to do “homework” when the teacher can offer assistance and answer questions:

Using Camtasia Studio, a screen recording and video editing program, Roshan uploaded her lectures to iTunes and assigned them as homework. “We’ve kind of reversed the whole dynamic of the class,” she says. “Instead of lecturing in class, I lecture to them when they’re at home, and we work problems together [in the classroom]. I liken it to an English classroom where the kids go home and do the reading and then they come into class and have this lively, engaging discussion.”

Taught with the video lectures, Roshan’s students in the 2010-11 school year scored an average of 4.11 on the AP calculus test, compared to the 3.59 average among her students who took the test and were taught in the traditional classroom setting the year before. And a third of the class—a 10 percent increase from the previous year—scored a 5, the highest score.

Posted by James on Jul 15, 2011

Ray Dalio: A financial Bill Belichick

In 2005 or 2006, I mailed Bridgewater Associates founder Ray Dalio copies of my Patriots books because I was fascinated by similarities between his leadership style and Bill Belichick’s.

This New Yorker article on Dalio and Bridgewater provides more evidence of the similarities between the two men and the organizations they lead.

A very interesting similarity is these leaders' emphasis on intellectual rigor and on eliminating emotional barriers to continual improvement, as individuals and as teams:

[Dalio] encourages people to challenge one another’s views, regardless of rank, in what he calls a culture of “radical transparency.” Dalio had no qualms about upbraiding a junior employee in front of me and dozens of his colleagues. When confusions arise, he said, it is important to discuss them openly, even if that involves publicly pointing out people’s mistakes—a process he referred to as “getting in synch.” He added, “I believe that the biggest problem that humanity faces is an ego sensitivity to finding out whether one is right or wrong and identifying what one’s strengths and weaknesses are.”

[An April New York article] accused [Dalio] of running Bridgewater like a cult. “I’ve been surprised that there’s been so much controversy about us having such clearly set-out principles, especially since they’re all about being truthful and transparent to do good work and have meaningful relationships,” Dalio wrote to me subsequently.

…Bridgewater’s headquarters are in the woods, isolated from any other financial institution; Dalio is a strong-willed leader; and the employees do use their own vocabulary—Dalio’s vocabulary. Bob Elliott, a twenty-nine-year-old Harvard graduate who has worked at Bridgewater for six years, told me earnestly, “Once you understand how the machine works, you have the ability to take that and study and apply it across markets.” It’s also the case that in the time I spent at the firm I saw senior people criticizing subordinates—but not the reverse.

In his Principles, Dalio acknowledged that his firm can seem strange to outsiders and newcomers: “Since Bridgewater’s culture is very different from what is typical in the world at large, people often encounter culture shock when they start here.” In part to minimize this shock, for years Bridgewater recruited young men and women straight out of college. (Harvard, Princeton, and Dartmouth were favorite targets.) But the firm’s in-your-face attitude—and the relentless pressure to perform—takes its toll. “We get a lot of people who self-select out of that pretty quickly,” Michael Partington, a recruiter at Bridgewater, said to me. Within two years of arriving at Bridgewater, about a quarter of new hires have quit or been let go.

…[I] sat in on a management-committee meeting, which had been set up for the purpose of “getting in synch” with a recent recruit, whom I’ll call Peter and who had come from a big financial firm. All nine members of Bridgewater’s management committee were sitting at a long wooden conference table. Peter, a lean man with fair hair, sat stiffly near the front: he looked like somebody anticipating a root canal. Jensen and McCormick were nominally in charge, but Dalio took over, telling Peter that, during a previous management meeting, he had answered emotionally in response to questioning from Jensen. “This is a common thing when somebody’s getting probed,” Dalio said. “Because the amygdala gets stimulated and you have that emotional reaction.” Peter agreed that he had become upset, especially when he sensed he was being accused of misleading his colleagues. “I felt in some sense my integrity was being attacked,” he said. “That’s when things spiralled out of control.”

Dalio walked to the front of the room, where he wrote on a whiteboard, “FELT,” “INTEGRITY,” and “MISLED.” “?‘Felt’ is the key word here … and it’s a challenge for people,” he said. After a bit more discussion, he went on, “What we’re trying to have is a place where there are no ego barriers, no emotional reactions to mistakes… . If we could eliminate all those reactions, we’d learn so much faster.”

Posted by James on Jul 22, 2011

REA (Resources, Events, Agents)

While researching domain-driven design, I came across the term “REA,” which stands for Resources, Events and Agents (and Commitments and Contracts). It’s hardly an earth-shattering concept, but it provides a clear, logical framework for modeling real-world processes in software.

I’ve studied a fair amount of accounting and always felt the intangibility of debits and credits made them an odd way to model financial accounts, so I was particularly intrigued that REA’s original use was to model financial accounts directly:

The REA model gets rid of many accounting objects that are not necessary in the computer age. Most visible of these are debits and credits—double-entry bookkeeping disappears in an REA system. Many general ledger accounts also disappear, at least as persistent objects,—e.g., accounts receivable or accounts payable. The computer can generate these accounts in real time using source document records.

REA treats the accounting system as a virtual representation of the actual business. In other words, it creates computer objects that directly represent real-world-business objects.

The free chapter “What is REA?” from the 2006 book Model-Driven Design Using Business Patterns by Pavel Hruby provides a clear introduction to REA.

Posted by James on Jul 07, 2011

Robotics + democracy => Basic income guarantee => Creative explosion?

At the gym last night, I noticed a CNBC show with video of Rolls Royce factory workers building cars by hand. I couldn’t hear, but it was shockingly clear the incredible amount of time, effort, and craftsmanship required to build a car by hand. Even without any options, a base model Rolls will cost you $246,000 to $447,000, and a good chunk of that money goes to the craftsmen who build those cars.

Thanks to robotics, a reasonably similar car built mostly by robots can be purchased for $30,000 or $40,000. So, robotics has squeezed roughly 90% of the cost out of automobiles. And robots have squeezed out at least 95% of the labor costs. Imagine how robust the automobile labor market would be and how wealthy auto workers would be today if all cars were still built by hand.

Many years ago, I realized robotics and computer automation were rendering more and more people’s labor less valuable and that this trend would continue. (Back then, it was ATMs and bank tellers, but now it’s cheap legal software and lawyers who do routine legal work.)

I then asked myself, “How would democracies respond to more and more wealth going to those who own and design/program robots/computers and less and less income going to everyone else?” The answer seemed obvious: Take a somewhat larger fraction of the income from those getting fabulously wealthy and guarantee everyone a basic living income. Everyone should be able to live a modest, frugal lifestyle, even if the market judged them unsuited to work. Anyone who wanted more than a basic living would have to find a job. But no one would go homeless just because technology had rendered their labor virtually valueless. Taking a bit more from the richest of the rich seems fair because the robotics and computing innovations their businesses are leveraging grew out of decades of societal progress in those fields. Facebook CEO Mark Zuckerberg did not “earn” his $13.5 billion net worth. He created a very popular website, but that website would not exist without thousands of previous inventions Zuckerberg had nothing to do with. And a website quite similar to Facebook would probably exist today if Mark Zuckerberg had never been born.

The final step in my thought experiment was to speculate that some fraction of those people guaranteed a basic living would use their time in creative, socially productive ways. Some would create art or novels. Some would volunteer at community centers or serve as tutors. Some would write open source code. In fact, that’s exactly how Linux came about. The Finnish government pays university students like Linus Torvalds a modest income while they’re students. Torvalds used his government-paid time to create Linux, a free gift to the world that has created many billions of dollars of value for millions of corporations and individuals (like me… typing this now on my Linux laptop).

I was reminded of this reading Richard Kosinski’s insightful comment about Harry Potter author JK Rowling:

[P]arents and teachers all over the world owe a great deal of thanks… to the British welfare system which sustained her as a single mother while she created her little wizard and his magical world in a coffee shop, able to watch her own child with the knowledge that her and her child’s health care needs were covered.

Contrast this with the single mother you may know, working a minimum-wage job with no health benefits, having to rely on others for childcare with little energy to do anything else at the end of the day but fix dinner and put herself and her child to bed.

In return for its commitment to invest in its citizens, Great Britain yielded dividends from a multi-billion dollar industry, creating thousands of jobs, and more importantly watching millions of children in Great Britain and the rest of the world put down their iPods and pick up books to read again.

Bill Gates and Warren Buffett appreciate that their success would have been impossible without society, and they’re giving away most of their wealth to benefit society. Government should take a little more from society’s luckiest to ensure society’s unluckiest do not sleep in cardboard boxes and scavenge for food in trash cans. And, as a bonus, I predict a creativity explosion that would benefit society and grow the economic pie further.

America has still not made what I consider the logical democratic response to humanity’s technological revolution. But I’m still hopeful.

Posted by James on Jul 15, 2011

Social gaming offers clues to the future of education

Interesting article on how social gaming companies are using analytics to make social games more enjoyable for users and more profitable for themselves:

[W]hat the big [social gaming companies] have learned is that coming up with a great game concept is only the beginning. A successful free-to-play game is all about inspection and iteration; it is about launching quietly, testing and fine-tuning the experience constantly, watching how players react, listening to feedback and re-building. This is how the likes of Popcap and Playfish arrived at super-addictive titles like Fifa Superstars and Plants vs Zombies. And now a whole new business is emerging to help developers understand their players….

Game Analytics, a new UK-based company specialising in the data-mining and monetisation of online games [is] a real-time service that continually monitors every player in any virtual world it’s commissioned to work on. It’s like CCTV constantly monitored by psychologists and statisticians.

Game Analytics gathers data on all aspects of players, including the basics: age, gender and location. “…[W]e look at their data and we identify behaviour patterns. It allows the publisher to learn a lot more about their game than they thought they knew.”

In his experience, it’s rarely great big design errors that trip up growing freemium games – it’s tiny, often over-looked alterations. “We’re working with a big MMO at the moment. We studied the last five years of their operations and we noticed that there was a huge change in just one month in the retention rate of new players. It turned out the publisher had made just one change that caused the game to be less appealing for newcomers – they didn’t even notice it; this is one of their worlds! So now they’re trying to digest that information and work out what they did wrong.”

The key message behind freemium analytics is that free-to-play game construction is similar to web design – the publisher needs to understand, and subtly guide, every aspect of the user journey through the experience. Whereas traditional games are about creating big macro-environments for player exploration, freemium is about micro-managing every step the player takes toward actually buying something.

“A developer can build ‘funnels’ that depict the player actions leading to a financial conversion like purchasing extra content or virtual merchandize,” says Justin Johnson, CTO of Playmetrix, another British company specialising in game analytics. “It’s then down to the developer to use this analysis to improve conversion by removing obstructions and bottlenecks that may be inherent in the design. For example, aspects of the game may be unclear or too difficult for newcomers, leading to early high attrition, which means they never reach the purchase step.”

The implications go far beyond social gaming. Any field that can gather data from many users can mine that data for insights that can feed back into design changes that improve the user experience.

Online education is a prime example of a field that can leverage datasets to improve the learning experience. Traditionally, teachers have taught in isolated silos (classrooms). Each teacher uses trial-and-error to improve their teaching, but most teachers learn shockingly little from one another. Online education can potentially optimize teaching based on what works and does not work for all students across all classrooms. And, with massive databases, analytics can identify different learning styles and separately optimize the learning experience for each type of learner.

Posted by James on Jul 14, 2011

The Law of Demeter

Superb article on The Law of Demeter. If you’re a programmer and don’t know what this is, stop whatever you’re doing and read Avdi Grimm’s article.

I’ve read about Demeter before, but I’ve never seen it described so clearly, with such excellent examples, and in such detail. For extra credit, read through the thoughtful comments. There’s a healthy debate about how strictly one should enforce Demeter in one’s code. Avdi is a “strict constructionist” while others, including Railscasts.com’s Ryan Bates, are willing to bend the law when convenient… though Avdi’s article makes a strong case that bending the law a little can lead to major headaches as your code base grows.

Posted by James on Jul 07, 2011

This man's death is irony, not tragedy

Tragedy: a serious drama typically describing a conflict between the protagonist and a superior force (as destiny) and having a sorrowful or disastrous conclusion that elicits pity or terror

I have no pity for this idiot:

A New York man died Sunday while participating in a ride with 550 other motorcyclists to protest the state’s mandatory helmet law.

Police said Philip A. Contos, 55, hit his brakes and his motorcycle fishtailed. Contos was sent over the handlebars of his 1983 Harley Davidson and hit his head on the pavement.

He was pronounced dead at the hospital.

“The medical expert we discussed the case with who pronounced him deceased stated that he would’ve no doubt survived the accident had he been wearing a helmet,” state Trooper Jack Keller told ABC News 9 in Syracuse.

The motorcyclist group organizing the helmet protest remains astonishingly oblivious to the irony:

“ABATE is very saddened and still shocked about the fact that we’ve lost another rider in Philip and that our hearts go out to him and our prayers as well,” Syracuse chapter president Christinea Rathbun told ABC News 9.

You’ve lost “another rider”! And you’re still fighting helmet laws!?!?

Posted by James on Jul 04, 2011

To learn better, study while exercising?

I love to study while riding an exercise bike at the YMCA. And I’ve long felt that I was better able to learn Chinese — whether memorizing characters or listening to podcasts — while walking or jogging.

There may now be a stronger scientific basis for my intuition:

Rhythms in the brain that are associated with learning become stronger as the body moves faster, UCLA neurophysicists report in a new study.

The research team, led by professor Mayank Mehta, used specialized microelectrodes to monitor an electrical signal known as the gamma rhythm in the brains of mice. This signal is typically produced in a brain region called the hippocampus, which is critical for learning and memory, during periods of concentration and learning.

The researchers found that the strength of the gamma rhythm grew substantially as running speed increased…

“The gamma rhythm is known to be controlled by attention and learning, but we find it is also governed by how fast you are running,” said Mehta, an associate professor of physics and astronomy, neurology, and neurobiology and the senior author of the study. “This research provides an interesting link between the world of learning and the world of speed.”

…The gamma rhythm, a fast signal that occurs while concentrating or learning, gradually grew stronger as the mice moved faster.

“It is rare to find a relationship that is so clear,” Chen said.

It’s hardly conclusive, but I’m a believer because I’ve long believed that studying while exercising enhanced my learning ability.

Posted by James on Jul 08, 2011

Why so many product reviews are worthless

Few products or services are truly “great” in the sense of being ideal for everyone. Whether a product is great for you depends on your budget, your feature preferences, your sense of style, your tolerance for complexity, your intended use of the product, etc. That’s true of movies, books, furniture, cars, computers, hotels, cell phones, lawn mowers… just about everything.

The greatest horror film ever may be “great,” but I would hate it because I dislike horror films.

Unfortunately, many product reviews say “this is awesome!” or “this sucks!” and leave it at that. Reviews by people with quite different needs/wants than us — even ignoring “reviews” by interested parties — not only waste our time but contaminate our decision-making process: “Well, this book looks like what I need but has only 3.5 stars while that book has 5 stars.”

So I love this review because Cory Doctorow begins by stating his biases and desires (which, even better, happen to coincide exactly with mine):

Ever since the iPad shipped, I’ve been waiting impatiently for a comparable Android device to emerge – something of like shape, size and capacity, but from a more open ecosystem than the one Apple offers.

Like Apple, Google operates an Android App Store that it controls – if your app doesn’t please Google, it doesn’t go in the store. But unlike Apple, Google allows you to install apps from unofficial sources, meaning that you can download apps directly from their authors or buy them from stores that compete with (or complement) Google’s store.

This is the kind of thing that’s important to me. After all, a tablet without software is just an inconveniently fragile and poorly reflective mirror, so the thing I want to be sure of when I buy a device is that I don’t have to implicitly trust one corporation’s judgment about what software I should and shouldn’t be using.

Because the author states his criteria up front, the reader can choose whether to continue reading or not waste her time. My family has had an iPad for the past year that four of us use quite often, so we’re toying with buying a second device. I hate proprietary systems — and find the iPad’s closed nature especially frustrating, so I’m curious what more open alternatives exist and couldn’t wait to read this review, since the author had done my work for me.

Samsung’s tablets – for no discernible reason – use a custom tip that isn’t any of the standard mini- or micro-USB ends. Instead, it’s a wide, flat connector, like the one Apple uses, but of course, it’s not compatible with Apple’s cables, either. I’ve already lost mine, run down the battery and now I can’t use the tablet again until I find another one. I passed through three airports recently, and none of them had a store that stocked them.

I have phone charger cables in my office, my travel bag, my backpack and beside the bed. The very last thing in the entire world that I need right now is to have to add another kind of USB cable to all those places. The decision to use a proprietary connector in a device whose major selling point is that it is non-proprietary is the stupidest thing about the Galaxy Tab 10.1 – even stupider than calling it the “Galaxy Tab 10.1.”

Likewise disappointing was the decision to omit the microSD card slot on the Wi-Fi-only version…. [and] They’ve preloaded the device with several Samsung apps that, insultingly, can’t be deleted without “rooting” the device, a process that voids your warranty.

I had already ruled out a Galaxy Tab for its lack of a USB port, but what I read next soured me on Android (for now):

[U]ntil now, Android devices showed up on your desktop as standard USB storage, and you could move files off or onto them by dragging them around in your file-browser. This was straightfoward, fast and easy…. [T]he adoption of MTP means that Android now requires a proprietary desktop app to effect simple file transfers – an app that is, if possible, even worse than iTunes, and represents no selling-point for those of us who want non-proprietary, “just-works” mobile devices.

The perfect review… for me. The author’s “eyeing up the forthcoming Lenovo ThinkPad Tablet.” Can’t wait to read his review!

Posted by James on Jul 25, 2011

You will never see two chimpanzees carrying a log together

I’m fascinated by the evolutionary/biological origins of morality, so I love articles like Natalie Angier’s latest:

Darwinian-minded analysts argue that Homo sapiens have an innate distaste for hierarchical extremes, the legacy of our long nomadic prehistory as tightly knit bands living by veldt-ready team-building rules: the belief in fairness and reciprocity, a capacity for empathy and impulse control, and a willingness to work cooperatively in ways that even our smartest primate kin cannot match. As Michael Tomasello of the Max Planck Institute for Evolutionary Anthropology has pointed out, you will never see two chimpanzees carrying a log together….

David Sloan Wilson, an evolutionary theorist at the State University of New York at Binghamton, sees the onset of humanity’s cooperative, fair-and-square spirit as one of the major transitions in the history of life on earth, moments when individual organisms or selection units band together and stake their future fitness on each other. A larger bacterial cell engulfs a smaller bacterial cell to form the first complex eukaryotic cell. Single cells merge into multicellular organisms of specialized parts. Ants and bees become hive-minded superorganisms and push all other insects aside.

“A major transition occurs when you have mechanisms for suppressing fitness differences and establishing equality within groups, so that it is no longer possible to succeed at the expense of your group,” Dr. Wilson said. “It’s a rare event, and it’s hard to get started, but when it does you can quickly dominate the earth.” Human evolution, he said, “clearly falls into this paradigm.”

Our rise to global dominance began, paradoxically enough, when we set rigid dominance hierarchies aside. “In a typical primate group, the toughest individuals can have their way and dominate everybody else in the group,” said Dr. Wilson. “Chimps are very smart, but their intelligence is predicated on distrust.”

Our ancestors had to learn to trust their neighbors, and the seeds of our mutuality can be seen in our simplest gestures, like the willingness to point out a hidden object to another, as even toddlers will do. Early humans also needed ways to control would-be bullies, and our exceptional pitching skills — which researchers speculate originally arose to help us ward off predators — probably helped. “We can throw much better than any other primate,” Dr. Wilson said, “and once we could throw things at a distance, all of a sudden the alpha male is vulnerable to being dispatched with stones. Stoning might have been one of our first adaptations.”

Before the Patriots improbably won their first Super Bowl over the heavily favored St. Louis Rams, the Patriots insisted on coming out of the tunnel as a team rather than getting introduced player-by-player, as all previous Super Bowl participants had taken the field. Cohesive team-centric groups usually defeat individualistic me-centric “groups,” and though the Rams were more “talented,” the Patriots were the better team.

Why, then, did capitalism — based on greed — “defeat” communism? Because people are not ants or bees. We are not so selfless a species that we can practice communism on a national scale. Ant and bee colonies can become massive because ants and bees don’t differentiate between personal and collective (colony/hive) interests. When the Soviet Union and China embraced communism, people grew lazy.

On a small scale, collective-minded human teams can accomplish extraordinary things. But group cohesion falls as group size increases. Consequently, many startups (and startup-like groups within larger firms) choose to remain small because the costs of growing larger outweigh the benefits of adding more people.

Posted by James on Jul 08, 2011