Tuesday, December 14, 2010

Science is About Strength of Evidence: Climate Change

Not in dispute

CO2 absorbs infrared light. Air is mostly blue (it absorbs non-blue light), but it is also complement-of-infrared, in the sense that the CO2 in the air absorbs infrared. You can confirm this with a cool tabletop experiment involving a candle and an infrared camera, cue the BBC. The Myth Busters have their version too.

The Earth surface radiates 390 W/m2 of longwave, while the top of the atmosphere radiates 240 W/m2. The difference is the longwave energy absorbed by the atmosphere (around 150 W/m2).You can tell which gas is absorbing the energy by looking at the colors carefully. Water vapor absorbs the most. CO2 absorbs around 30 W/m2. (ref)

The industrial age has brought up the concentration of CO2 concentration by 30%, from 280 parts per million to 390 parts per million. We burned roughly 500 billion metric tons of carbon in 150 years. That's enough carbon to raise the atmosphere's concentration of CO2 to nearly 500 ppm, but 110 ppm have been absorbed by the ocean in the biosphere. (ref) We know the carbon is our because, aside from there being exactly the right amount, its isotope signature exactly matches that of fossil carbon. (ref)

Data points with uncomfortably large error bars/Being researched further

This 30% increase in CO2 (along with increases in other greenhouse gases) have increased the amount of energy captured by the atmosphere by 2.5 W/m2. Other chemicals we have released have generated a cooling effect of 0.9 W/m2. So the net extra amount of energy at the moment is 1.6±1.0 W/m2.

Generally, more energy translates directly into warmer temperatures. But the climate has many positive feedbacks and many negative feedbacks, so the relationship is not that direct. If you add up all the known feedback (positive and negative) you get 0.75°C warmer temperatures for each W/m2 of additional energy (with rather large error bars (ref)). This number is called the climate sensitivity. Since the extra energy at the moment is 1.6±1.0 W/m, if we stopped all emissions today, we should expect 1.2°C of warming. We measure 0.7°C, so another 0.5°C is "in the pipe" even if we stop all emissions now.

We have burnt 500 billion metric tons of carbon so far. How much is there left? If we burn all of it, how high will the CO2 concentration get? Credible numbers range from 450 ppm to 1300 ppm. If we are really unlucky, and there is a whole lot of carbon, and the climate sensitivity is super high, how hot does it get? MIT calculated 7°C of warming. (ref)

What are the consequences of 7°C of warming? Warmer air holds more moisture (ref). At 7°C, the air sucks all the moisture out of the ground and nothing can grow. Food production collapses, and humanity dies. (ref)

Not settled/Being researched

  • The ocean and the biosphere have absorbed 110 ppm so far. Can they absorb much more? Are there big negative feedbacks we haven't discovered yet?
  • This would be great news, and people are looking as hard as they can, but nothing so far. But we are allowed to hope.
  • Are there any big positive feedbacks? These would make global warming even more catastrophic than the current predictions.
  • There are many candidates at the moment which are being studied Are there ways to take the carbon out of the atmosphere? Soil carbon sequestration looks promising (ref).
  • Are there ways to increase the 0.9 W/m2 cooling effect caused by our pollutants (most of which are toxic) without poisoning people?
  • Which one will come first, peak oil (causing a crisis in transport), peak coal (causing a crisis in energy), population collapse due to climate change, or the deployment of forward-looking practices in commerce, in government, and in our lives, that will give us a chance to avoid all three catastrophes?
[Based on the post The CO2 problem in 6 easy steps, by Gavin Schmidt, climate modeller at the NASA Goddard Institute for Space Studies in New York (PhD in Applied Mathematics from University College London), and contributor at realclimate.org.

A Short History of Global Warming Science

In 1896 a Swedish scientist published a new idea. As humanity burned fossil fuels such as coal, which added carbon dioxide gas to the Earth's atmosphere, we would raise the planet's average temperature.

In the 1930s, the United States and North Atlantic region warmed significantly versus the previous half-century; the amateur G.S. Callendar scientist suggests greenhouse warming might be on the way.

In 1960, painstaking measurements confirm the level of the CO2 is in fact rising in the atmosphere, year by year.

Through the '60s we see the appearance of the first quantitative global warming forecast, suggesting that average temperatures would rise a few degrees within the next century.

Also during the '60s smog pollution balances out greenhouse pollution and for a moment the Earth temperature stops rising. Smog is toxic, and smog causing power plants are made illegal by the Clean Air Act in 1970. The smog dissipates, and the world's temperature resume their rise.

During the '80s, readings of the planet's long history reveal that the climate is a chaotic system. Once provoked, it cannot but trusted to return, or stabilize. Policy makers across the world take notice.

At the UN in 1992, the work on the Kyoto Protocol begins.

And on 11 December 1997, the Kyoto Protocol is signed, confirming the world's commitment to prevent catastrophic climate change, somehow. Based on the (fantastic) web book A Hyperlinked History of Climate Change Science, by the American Institute of Physics


So, yeah, humanity's destruction is in the cards. If we land in the high-end corner of the probability curve, and if our political institutions continue their head-in-sand approach, we're screwed. It's hard to imagine the politico would stay so aloof in the mist of people dying by the billions, so that's two somewhat big ifs.

I would like to add a personal note to help make sense of all of this.
Let's compare this situation with the threat of total nuclear war. Since the arrival of nuclear weapons, if our politicians insist on being maximally-stupid, we all die. It's not a comfortable place to be. On the other hand, for all their faults, political institutions have not blown us up yet, and they usually do come around to big problems. The dust bowl was addressed. We used to have rivers on fire and that got fixed too. Nuclear war has been avoided and the Vietnam War got stopped. It sometimes take a lot of popular pressure from the public to help our politicians along, but that's why we're here.
I help out with 350.org and justandstable.org, and I have re-oriented my career to work in green building. It helps to channel the anxiety into something productive.

Monday, October 25, 2010

Measuring the Effectiveness of Error Messages Designed for Novice Programmers

My latest paper was accepted at SIGSCE. I will be speaking in Dallas in March.

If you have any interest on teaching programming to beginners, I invite you to read the pdf. It's an exploration of one factor that is largely ignored when people choose a language to teach with: how well do the error messages support learning? Of course, the answer is "not very well." But the surprise is that, even in a project that has spent considerable amount of time thinking and refining its error messages, we found considerable opportunity for improvement, simply by looking at students' behavior closely.

Here's the abstract, and a link to the paper.

Good error messages are critical for novice programmers. Many projects attempt to rewrite expert-level error messages in terms suitable for novices. DrScheme's language levels provide a powerful alternative through which error messages are customized to pedagogically-inspired language subsets. Despite this, many novices still struggle to work effectively with DrScheme's error messages. To better understand why, we study the effectiveness of DrScheme's error messages. Unlike existing work in this area, we study messages at a fine-grained level by analyzing the edits students make in response to various classes of errors. We present our rubric, apply it to a course-worth of student lab work, and describe what we have learned about using the rubric effectively.


Saturday, September 18, 2010

Dictate to your computer like a pro

Do your wrists hurt? If you program all day, or write prose, or otherwise spend most of your time typing on a keyboard, chances are you'll develop some pain. The intensity of the pain will fall somewhere between not much at all and this somewhat rare catastrophic wrist failure I got.

The details of the risk factors of repetitive stress injury (RSI) are still being mapped out. People suspect influences from your overall health and constitution, your amount of stress, your general level of intensity at the keyboard, how many breaks you take and how effective they are. However, the largest factor is well known: it's the amount of time spent at the keyboard. According to the medical literature, anyone who types more than four hours per day is at risk -- though that's in part caused by medicine's low thresold for calling something a risk.

The point is, at four hours the risk is measurable, then it goes up from there.

As I was saying in my article on wrist health, the best way to prevent (or alleviate) RSI is to remove the hours spend typing emails from the equation. Dictate them instead. Because this strategy targets the #1 risk factor, it is more effective than any fancy keyboard, or any posture training.

Since 2005, I have been using Dragon NaturallySpeaking to dictate email messages and other documents of all sorts. Dragon's recognition accuracy has improved so much over the years. Across the last couple of version releases, it has gone from being accurate enough to use if you don't have an alternative (v7 and v8), to being fine if you speak with an impeccable accent (v9), to being faster than anyone can humanly type on a keyboard, for pretty much everyone (v10). I have no reason to suspect the new Version 11 doesn't continue this progression.

Since I have spent so much time with Dragon, I have a collection of tips and tricks to offer.

[1] Get the cheap version of Dragon NaturallySpeaking, at $50

The more expensive versions of Dragon provide fancier support for complex programmed commands, and little else. Unless you are a doctor, a lawyer, or you need a bilingual version (such as the French+English version available at amazon.fr), save the money.

There is no need to bother with Dragon's large set of voice commands. Everything you can do with Dragon's commands you can do more easily with the mouse or through a few keyboard shortcuts. If your hands hurt too much to use a mouse, get a GlidePoint usb touchpad. The only commands I use are "Cap that," to turn text into title-case, and "Switch to dictation mode", which turns off a few useless commands that only get in the way.

[2] Get a decent noise-isolating USB microphone

First, the microphone has to be USB, or it has to be plugged into an external USB sound pod. Any soundcard inside the case of the computer will pick up the interference from the CPU and hard drives and more or less ruine the sound quality. I would advise to get the USB pod even if your computer happens to have some internal shielding, else you won't have the option of switching computer.

Second, the microphone has to be noise-isolating. Dragon has essentially no ability to tell apart your voice from any background noise. You depend on your microphone's ability to filter them out. If you use the microphone that comes with Dragon, you will have to sit alone in a perfectly silent room, wondering whether it's the songs of the neighborhood birds' or the sound of your computer's fan that's undermining your recognition accuracy. My microphone might be expensive, but I can dictate papers while on the road to Washington, and that's awesome.

Third, it's better if your microphone has a good sensitivity. You almost have to yell into the stock microphone to get good enough sound quality. It's annoying, it's obnoxious to your neighbors, and it will give you RSI of the vocal cords if you do it for too long. With a microphone worth above 100$ or so, you start being able to dictate in hushed tones, and that's quite nice.

Fourth, you will spend many hours with this microphone, better find a microphone that's not fragile, plasticy and uncomfortable, like most gaming headsets are.

My favorites are the Buddy FlamingoMic 7G , the Sennheiser ME3, or possibly the Sennheiser ME3 Knock Off. But there are more good microphones on this list and this list.

[3] Make sure you have enough RAM. Boost your CPU. Upgrade to a SSD drive.

The performance of your computer will have a huge impact on your recognition accuracy. After you speak, Dragon launches a search through a list of utterances you might have said. Dragon sets itself a deadline of around half a second per word to choose its best guess. The faster your machine, the deeper Dragon can search, and as in chess, the deeper the search, the better the choice.

Nothing kills Dragon accuracy more than swapping. If you don't have much RAM headspace, the first few sentences you pronounce after turning the microphone on will get terrible accuracy, guaranteed, because Dragon will be busy swapping itself into RAM and will miss its deadline. But the effect of RAM shortage will be felt throughout your dictation session. Each time Dragon will touch the RAM limit, it will hit the disk and make a mistake. It's frustrating.

Once you have enough RAM, get the fastest single-threaded processor you can afford. In laptops (at the moment) it's the Intel i7-M620, which is not that expensive of a CPU, actually. The more expensive CPUs sacrifice single-threaded performance to satisfy the marketing department's need for more cores. The i7-M620 runs at 1.6 Ghz when all four core are engaged, but it runs at 2.8Ghz when running single threaded. And in single threaded benchmarks, the CPUs are faithful to their maximum megahertz ratings.

Finally, upgrade to a solid state hard drive. They are expensive, but they are also a hundred fold faster than normal laptop hard drives. It will all strange delays Dragon otherwise sometimes has.

[4] Learn to be patient with the Dragon

It's natural to get frustrated when someone repeatedly fails to understand what you say. You cannot have the same attitude when speaking to Dragon -- you would go crazy. Meditate, if needed. Don't hesitate to make a correction with the keyboard when Dragon is being stubborn (to the extent your wrists will allow). It will help.

If your accuracy is bad all of a sudden, lunch Audacity or some other audio software and listen to the sound quality coming out of your microphone. It's often eye-opening. Listen for common sound quality problems: gaussian noise, interferences being picked up by your sound card from the CPU and hard drive, or booms caused by the wind of your voice hitting the microphone element.

[5] Go to preference dialog box and remap the keyboard shortcuts

Get into the habit of pressing Ctrl-Z instead of saying "Scratch that." Scratch that is too tedious and unreliable. If you're like me, you're hands are not in so bad of a shape that you can't afford to press Ctrl-Z.

Bind "Correct that" to F1. This way your fingers are automatically nearby the keyboard shortcuts needed to select from the correction options after you bring up the correction menu (press ALT+number). ALT-F1 should be bound the dictation box. Then choose one function key to use for Microphone On/Off, possibly F7. Turn on "Double click to correct". When correcting (aka, when the correction menu is shown,) switch between the utterances with the left and right arrows.

This arrow keys trick won't work well if you're dictating emails straight into Firefox, or into any other application that doesn't have native support from Dragon. Dragon has native support for Microsoft Word, WordPad, and Notepad. All other applications run in compatibility mode. In that mode, Dragon can't read the text you're editing, which means that all features that require knowledge of the text outside of what you have just dictated are disabled. Saying "Select foo" when "foo" isn't something you just said won't work, neither will the left and right arrows.

The fix is to install the Text Editor Anywhere program or the It's all text Firefox add-on and configure it to launch WordPad on Ctrl-F1. My Gmail is set with the rich text box off (otherwise It's all text doesn't work) and has keyboard shortcuts turned on. This way, to reply to an e-mail I press in sequence: "a" for reply-all, Shift-F1 for the microphone, Ctrl-F1 to launch WordPad, then I leave my left index finger to F1, with the thumb on the left-side ALT key, so that I am ready to select corrections.

Text Editor Anywhere works out of the box. For It's all Text, you need to set WordPad as the default editor. In the preference dialog box, use this path: "C:\Program Files\Windows NT\Accessoires\wordpad.exe", then set It's all text's character set to "iso-8859-1" (without the quotes).

[6] Run the email corpus training

After the 15 minutes initial voice training, the email corpus training will give your recognition accuracy another factor of improvement. Dragon learns from this training a sense of the words used to talk about the things you talk about. It actually doesn't matter that much if it's your writing or somebody else's. What matters is to give Dragon an opportunity to rule out words you never, or rarely ever use.

[7] Teach Dragon new words as you go

If you have a new word, just pronounce it. Dragon will write rubbish of course, but then press the correction shortcut key twice, once to bring up the corrections, then once to bring up the spell dialog box, then type the correct word. That's sufficient to train a new word. Dragon remembers the pronunciation and will associate it with the spelling.

[8] Don't hesitate to move the speed-vs-accuracy slider to the right

If Dragon is making mistakes, move it to the right. The added speed is never worth the frustration of the mistakes. Don't move it all the way though. The last tick mark is very demanding on the computer and not that useful. Try setting it 95% to the right.

[9] Apply corrections by repeating yourself

After pressing F1, you have two options. You can either pick a correction amongst the ones offered in the menu, or you can repeat what you just said. Repeating is surprisingly effective. When you repeat yourself, Dragon takes into account that its first guess was wrong and goes looking for a new interpretation. It's often faster than reaching for the mouse to choose a correction.


[10] If you're not a native English speaker, take an accent-training course

Seriously, Dragon NaturallySpeaking is excellent accent practice. Dragon will flag your mispronunciations like no polite friend ever dared to. On your own it's just frustrating, but with the help of a teacher you'll learn to mouth the missing sounds, and Dragon will mark your progress.

Monday, August 16, 2010

Climate Change Activists: For or Against Nuclear?

On one hand, if you look at France, nuclear has a track record of being inexpensive, safe, environmentally sound (in the sense that much less radiation is released into the environment by a nuclear power plant than a coal power plant), and has an overall low CO2 footprint. I'm going to state sources below for each one of these statements as a matter of course, even though my impression is that most of my readers are well aware of these characteristics of a nuclear power.

On the other hand, this great track record hinges on having a very high level of trust in the quality of the regulation apparatus. In a country like France, where the political system is somewhat healthy, and on the whole accountable to the people, it is easier to support nuclear. In the country that gave birth to the Deepwater Horizon disaster, it's harder. Furthermore, this judgment call on the quality of the political system has to be made for now, and for far into the future. For some people, no political system can uphold such a demanding long-term guarantee of stability. Again, I'm confident that everyone here is well aware of this dynamic.

Thus, whether one supports for opposes nuclear energy depends on a careful weighting of of three somewhat subjective impressions: How much do you trust your politicians?, versus how dire is the climate situation?, versus what alternatives are there? If you would like to see the difficulty of resolving these three questions play out in a large conference room, amongst a crowd of smart, well-informed people of all specialties, I'll recommend the following TED Talk:

TED Talk Debate: Does the world need nuclear energy?

In short, a well-informed environmentalist can come to either conclusion, for or against nuclear power; that's what's happening in our group. I don't think it is possible to resolve this diversity of opinions. I doubt the world can come to a consensus, no matter how much time we spend.

Thankfully, I do not see the need to come to a consensus. Not now at least. There is plenty of solutions to global warming calling for our considerations before the questions of nuclear energy becomes unavoidable. I would humbly suggest we focus everyone's efforts on these other solutions.


Projected costs of generating electricity: 2005 update By OECD Nuclear Energy Agency

Their investigation of the cost of numerous power plants identified the following cost brackets for different technologies.

Nuclear: 21 to 31 $USD/MWh
Coal: 25 to 50 $USD/MWh
Gas: 35 to 50 $USD/MWh
Wind: 35 to 95 $USD/MWh
Micro-hydro: 40 to 80 $USD/MWh
Solar: 150 to 300 $USD/MWh


Deaths per TWh for all energy sources: Rooftop solar power is actually more dangerous than Chernobyl. (Construction workers fall off the roofs all the time)

Environmentally sound:

Coal Ash Is More Radioactive than Nuclear Waste. By burning away all the pesky carbon and other impurities, coal power plants produce heaps of radiation.

Low CO2 footprint

Carbon emissions from electricity generation: a life-cycle analysis.

Table 1. Total lifetime releases of CO2 from electricity generating technologies

Coal Gas Solar PV Nuclear Wind Hydro

kg CO2/MWeh
ExternE [1] 815 362 53 20 7 -
UK SDC [2] 891 356 - 16 - -
U. of Wisconsin [3] 974 469 39 15 14 -
CRIEPI, Japan [4] 990 653(a) 59 21 37 18
Paul Scherrer Inst. [5] 949(b) 485 79 8 14 3
UK Energy Review [6] 755 385 - 11–22 11–37 -
IAEA [7] 968(c) 440(c) 100(c) 9–21 9–36 4–23
Vattenfall AB [8] 980 450 50 6 6 3
British Energy [9] 900 400 - 5 - -

Wednesday, May 5, 2010

This is why I eat chicken

Here is why I eat some chicken, no beef, I why I won't be eating shrimp anymore.

This chart is taken from the fantastic report by the UN, "Kick the Habit, a UN Guide to Climate Neutrality.", page 103. You need to combine it with the World Ressource Institute chart, pasted below, on the proportion of the entire problem that is caused by different activities, including agriculture and livestocks (it's 12.3%.)

It's also the reason I drive a 70 mpg motorcycle, and why I lobby for 100% clean electricity for Massachusetts by 2020.

Tuesday, May 4, 2010

Apple is the new dictator of my industry

I am distressed at the number of the IT professionals who are taking Apple's claims about the goal of the App Store's no-Flash or other such programming languages policy at face values. Apple's objective when refusing Flash has nothing to do with their stated position. Their concerns over quality or stability are not credible, when their action indicate that their goal with disallowing Flash is to reinforce their lock down on the platform. Indeed, Apple has already begun abusing the new-found benevolent dictator position:

Apple's PR department has been spinning their intent since the very moment of the release of the iPhone.

In the late '90s, Microsoft tried to use its monopoly position to crush the possibility that web application could become sufficiently feature-rich to compete with Windows. After years of fighting against that abuse of monopoly power, mainly through the funding of a huge effort to create the Firefox browser, today we enjoy thousands of rich and innovative web applications.

On the back of that success, we geeks are now handing a control of our computing to Apple. If one person buys an Apple products, no harm is done; if we all do, we instantiate an abusive monopoly, one that promises to be even more severely clutched than Microsoft's was.

I humbly suggest you considers boycotting Apple's products, and donating to an organization which fights monopoly abuse, such as the Electronic Frontier Foundation or the Free Software Foundation.

Saturday, May 1, 2010

Climatologist sues, wants paper to widthdraw its libelous statements

Via Andrew Trumper:

It's probably an unfortunate measure of the quality of modern journalism that few of us would be surprised to hear that an editorial on a politically controversial topic contained significant factual inaccuracies.

But climate change seems to have reached the point where even some apparent facts have become points of contention, and at least some reporters have become comfortable with simply making things up and ascribing their imaginings to credible scientific sources.

Apparently fed up with similar practices in editorials produced by Canada's National Post, a climatologist has now sued the publisher for libel and defamation. But the suit seeks a judgment that's remarkably sweeping: the scientist wants the publisher to hand over the copyright to the editorials so he can attempt to erase them from the Internet.

Link to the Ars Technica article on the matter.

Friday, April 23, 2010

Facebook has gone rogue

You can tell Facebook has gone rogue. After they began leaking information that their user had marked "private," they have now elected to leak this information to any websites you visit.

They require everyone to go through contortions to opt-out, and when you finally reach the button, it is labeled:
Allowing instant personalization will give you a richer experience as you browse the web. If you opt-out, you will have to manually activate these experiences.
You can tell from the turn of sentence that Facebook has been handed over to the marketing department, and that these individuals do not have your best interest at heart. Bastards.

After you uncheck the box, Facebook will reach for an excuse to continue leaking your information, and interpret your friends' non-opting-out as a permission to leak your information on their behalf. Facebook's message continues:
Please keep in mind that if you opt out, your friends may still share public Facebook information about you to personalize their experience on these partner sites unless you block the application.
In order to maintain you sense of inconspicuousness, you have to turn off acquaintance leaking as well.

Thursday, April 8, 2010

Catastrophic Rapid Climate Change

According to Krugman's excellent summary of the consensus amongst economists is that avoiding catastrophic rapid climate change would cost 0.03 to 0.09 percent point of growth per year until 2050. In other words, the annual to 2050 would be 2.31 percent, instead of 2.4 percent. That is very small indeed. Put another way, it would cost 775$ per household over 40 years, which is about 20$/year. And at 2.66 persons per household on average, solving the problem cost a whole 7.26$/year. It's about the price of the Starbucks latte you took Jan 17st, plus the price of the one from Aug 23rd.

Let's do a cost/benefit analysis. If we maintain the status-quo, and proceed as usual and burn all the coal available on this planet, the temperature goes up by 11F (see the question-and-answer section at the end of the talk.) New York becomes Mississippi and Mississippi becomes unlivable. If we burn all the coal, we return to the temperature on the planet before the coal was made, 55 millions year ago. It was the time of the Paleocene-Eocene Thermal Maximum, a "slow" event, with a gradual warming spread over 20'000 years time, that nevertheless resulted in a mass extinction.

Meanwhile, we human have sufficient coal-fire power plants deployed to get that kind of change done in 100 years. Go us!

So, to complete this cost/benefit analysis, I ask you, how much is your planet worth?

Monday, March 1, 2010

Americans have more investements in each other's health care than Canadians

Little known fact: Health care in America is funded by the government to a greater extends than in Canada. Between Medicaid, Medicare, Military Health Care, and emergency room services for the non-insured or the under-insured, the American government pays US$2,728 per person per year for health care. That's 23% more than the Canadian government expense (US$ 1,893.)

Ref: Wikipedia on the difference between the US and Canadian health care systems.