Friday, November 15, 2013

NOBODY is getting off the Titanic, if people keep claiming it is not sinking

I have two problems with loud and influential climate-change deniers. First, they are usually cherry picking their facts. Second, it is a tragedy of the commons to listen to climate-change deniers.

Tragedy of the commons. Let's say you're on the Titanic, and it has just hit an iceberg. The Titanic could not sink, so what reason would people have to get out of the nice warm ship, into the cold air, and into the lifeboat? It would be uncomfortable. So when some people were saying 'it cannot sink', some people may have not gotten into the lifeboat. At that point, they are gambling with their own life. I believe strongly that it's everybody's right to be ignorant, as long as it is only their own life they're playing with.

Now imagine that the Titanic's captain insists that the ship is not sinking, people are inclined to listen. Not only because he is the captain and therefore he has an influential voice. But also because people would prefer to stay inside. If, in addition, enough people listen and ignore the slow tilting of the ship, that will cause the disinformation to spread quickly. Because people will want to believe the ship is not sinking.

Climate change is a different beast, however. When enough people do not take action to mitigate its effects, everybody suffers. Therefore, loud and influential climate-change deniers are neglecting their responsibility. Yes, they have a right to free speech. But their right to swing fists about ends where humanity's nose begins.

Cherry picking. To illustrate what I mean by cherry picking, look at the picture above. (I used the Matlab/GNU Octave code snippet below to generate the data, run it in Matlab if you have it, or download your copy of GNU octave to run it yourself). The data (blue line) was generated by taking 20 random numbers, and plotting it on top of a slope of 1/10. I then compare the last 4 numbers, and see if there is a downward trend. If not, I create a new set of random numbers, and try again. I keep trying until I see a downward trend in the last 4 numbers. As you can see, you have to do this quite a few times (40 in this case) to get a downward trend in the last 4 numbers (red line). It is clear, however, if you look at the overall trend, it is going up (black line).

Climate change deniers usually look at a subset of the evidence. While the overall temperature (blue line) fluctuates around a rising overall trend (black line), there may be a small set of temperatures that will be going down (red line). It is obviously a wrong approach to do so. 

Now, some may say that to say the climate is changing, is basically falsely yelling fire in a crowded theater. The problem with that argument?

The theater is on fire, the Titanic is sinking, and the climate is changing. 
deniable = 0;
i = 0;
slope = 1/10;
n = 20;
while deniable == 0,
    i = i + 1;
    x = [0:n-1]';
    y = rand(n, 1)+slope*x;
    if and(y(n) < y(n-1), y(n-1) < y(n-2), y(n-2) < y(n-3))
        deniable = 1;

hold off;
plot(x, y, 'b-', 'Linewidth', 2);
hold on;
plot(x(n-3:n), y(n-3:n), 'r-', 'Linewidth', 3);
plot(x, x*slope+1/2, 'k-', 'Linewidth', 3)
xlabel('X (a.u.)');
ylabel('Y (a.u.)');
legend('The Data', 'OMG it is going down!', 'No it is not', 'Location', 'SouthEast')
title([num2str(i) ' runs had to be ignored'])
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 4 3])
print('deny.png', '-dpng');

Thursday, November 8, 2012

Write your own web browser in 9 lines flat

This web browser in 9 lines of code comes to you courtesy of the awesome python bindings to the webkit renderer on Mac OSX, WebKitCtrl. One simply defines a window and drops the webkit renderer in, done!

First, make sure you have installed wxPython

Then drop this code into a file called :
import sys
import wx
import wx.webkit       

theApp = wx.PySimpleApp(0)
theFrame = wx.Frame(None, -1, "", size=(640,480))
w = wx.webkit.WebKitCtrl(theFrame, -1)
You launch the browser from the command line, passing the URL to go to as argument, like so:
The last bit needed is the script python_32, which ensures python will run in 32 bit mode, because the 64 bit mode is broken unless you have installed the wxPython Cocoa libraries. Place these lines in the file 'python_32'
/usr/bin/python "$@"
and place that file in the same directory as ''. Now, also make sure that this script is executable
chmod a+x python_32
Nitpickers take note. One might say that this is no different from calling a browser from the command line directly, which, according to the line counting above, would give you a browser in 0 lines of code:
However, I would not call that 'your own browser' in the sense that you cannot wrap your own controls around it and interact with the browser contents as you can with the script above.

Friday, July 20, 2012

Computer-Supported Collaborative Science, Summer 2012

It was an honor to work with the CSCS team again this summer in the yearly workshop for middle-school science teachers. In the first week of this workshop, we develop new science curriculum using the CSCS methodology: Computer-Supported Collaborative Science.

The teachers then proceed to teach these new lessons to middle-school students that participate in the SAEP (Summer Academic Enrichment Program). This provides instant feedback and allows rapid changes to the lessons based on real classroom experience.

For this workshop, I created two youtube screencasts:

Thursday, May 3, 2012

... or I shall replace you with a small shell script

So, this rather long description that I posted a while ago on how to get Sparkleshare (a cloud storage solution where you host your own cloud) working on Ubuntu can now be replaced with a simple

sudo apt-get install sparkleshare

or select it in the package manager.  This is all possible due to it being available in the repository in the latest Ubuntu: 12.04, aka "Precise Pangolin". Awesome.

Pretty soon I will be able to

sudo apt-get install write_grant write_paper win_nobel

Wednesday, March 21, 2012

Sparkleshare: not quite Dropbox, but better in ways that matter to me

So. You have been using dropbox for some time to make sure all your files are synced between different systems. Perhaps you have shared folders with collaborators and this is how you work together on documents. It has become part of your workflow.

But, there are things that bother you. First, you don't have ownership over where the data is stored. You're not paranoid, but you wonder if trusting all your precious data to an unknown location in the cloud is the best thing. Second, you really cannot afford to pay for more storage, but if would be sooo useful if you could just put everything in the cloud and be done with it, never having to decide whether something needs to go into Dropbox or not.

Enter Sparkleshare. It works on Linux, Mac, and Window 7/Vista (sorry, no XP). It is open source. It is free. And you can store the data in your own system. And it uses git, major geek cred there. That also means you can use sparkleshare to always have the latest snapshots on github etc on your local drive.

The following steps are not too difficult to follow, but it is definitely not as easy as Dropbox.

1. Preparation. As my linux box is running Ubuntu Lucid, I had to upgrade GIT by subscribing to this repository

2. Install sparkeshare, either by subscribing to this repository or installing the client from the website

3. Setup your own data store

4. ?

5. Profit!


1. As it uses GIT on the backend, it is not very good at dealing with large binary files. I haven't found any issues yet, but that is what google tells me

2. As it uses GIT on the backend, forget about putting a GIT repository in a sparkleshare folder

3.No iphone/android/Webos clients. Although you may run a web frontend to the GIT repository so you can get to the files that way too.

Saturday, February 25, 2012

Would You Like to Know the Truth?

Spread the Word, people. PDF is here

Monday, December 26, 2011

Getting Things Done with Thunderbird


Let me ask you a question: have you ever used todo lists? I have. Lots of them. And I don't like them. Some require singing on to an online service, and collaboration is clunky, or require money. And then they require your team members to use the same service, let alone people outside of your organization. Some are just downright too basic, and don't sync between multiple computers. But there is a bigger issue, so let me tell you what I do instead and why.

Many of my tasks (stuff on my plate) come to me through email. So, if you have a todo list that is separate from email, you will end up copying and pasting a lot back and forth. Yes, I know you can create todo items from email, but you still need to make sure your todo list stays in sync with your email.

Yes, I have read David Allen's "Getting Things Done", and I love the book. I have tried the paper approach he describes, but I ended up having to write down things that come in through email. And then when the piece of paper shows up on top of my list, I have to dig through the email and locate the item so I can work on it. In all fairness, David's book is not so much about using paper, it is more about the process.

My Approach

So, a far easier approach is to overlay the todo list with your emails. To do so, I am using labels, and I do that in Thunderbird (There are a few tutorials on the web, e.g. : see here).

I have been using this setup since the Summer of 2011 and haven't modified it since the initial setup.

I have renamed the standard thunderbird labels to

"DoNow" and "Do". I really see no need for more than two categories of urgency. You either have to do it NOW or do it a little later. DoNow versus Do only refers to time, both are important. I do not believe there are unimportant things you need to do. If they are unimportant, you don't need to do it. If you need to do it, it is important.

'WF' : Waiting For. I use it to mark emails that I have sent to someone asking for some action. I also use it to track purchases I have made when the order confirmation email comes in, or when the confirmation of a paper submission comes in.

'Someday/Maybe' : I use it for keeping interesting things around for later. Say: a funding opportunity that may be interesting in the future, or a new journal asking for submissions.

Email Triage

I have 'new mail' notifications turned off, so I only check my email when I'm done with something. Yes, I split up my work in 15 minute chunks, so I never miss out on something really urgent. Most of the triaging goes on in the morning though.

So, once I open email, I hit 'N' to go to the next unread email.

If an email comes in and I can do what is being requested in less 2 minutes, I do it right away. This is on of the most powerful things in the David Allen strategy.


So, an email comes in requesting if I can review a paper. I decide whether I want to do it, and if so, I hit the key "2", the shortcut for applying the label 'Do' in my label setup. 

An email comes in asking for some information, I hit '2'

An email comes in saying we are out of gold for our evaporator, I hit '1' for 'DoNow'

An email comes in with a confirmation that I purchased something, I hit '5' : WF

I ask somebody to do something, I mark that email with 'WF'

Actually Doing Stuff

Now the time comes to do something. I hit the use the Quick Filter bar, and select 'DoNow' and do whatever is there. Afterwards, I hit 'Do'. I also have search folders setup, but prefer filtering my inbox instead. That way, if there was more communication on that task, I can quickly navigate the message thread.

WF : Waiting For. At the end of the day, I see what I have been waiting for. If things have been completed, I clear the label. If there has been no response, I choose to either send a reminder, or wait a little.

Someday/Maybe. Every once in a while, I revisit this list (about every week), and see if there are things that I want to work on now. In that case, I change the label to 'Do' or 'DoNow'.

Closing The Loop, Capturing Off-Line Action Items. So, what do you do if there is something on your plate that did not have an email that originated it? Send yourself an email! Like I said, most of my action items originate in email, so this rarely happens. But, if someone asked you in the hall to do something, ask them to send you an email, or, what I do, is send them an email with a summary of what you discussed and what actions were agreed upon. And apply the appropriate label. WF for if they need to do something, or 'Do'/'DoNow' if I have to.


What was the action? The problem with using 'email as todo list' is that you need to remember what action was required based on an email, or you'll have to reread the email every time you see it. This is a little bit out of line with the Zen approach to todo lists: only put things on there that are actionable, and use language that is action oriented ("Follow up", "Read", "Think about", "Do", "Write", "Google"), but it works for me. Besides, this is not too much of an issue, as long as you remember what action item was required. As a workaround, you could respond by sending an email to yourself, where you write what action is required and apply the label to that mail.

Dates: No capturing of due dates. If it is really important, and requires long stretches of work with not too many little tasks, use your calendar.

Final thoughts

And it's portable! Since I use thunderbird to access my google mail through imap, both thunderbird on my mac as well as linux machines are always in sync, and that includes the labels. Just make sure you name the labels the same on all thunderbird installs. Sometimes I need to restart the applications to force reloading labels, especially when coming to work, when I have been applying and changing labels on my laptop, and want to continue on my desktop.

Threading provides history and context. One of the greatest advantages of using this method is that you can always use the threaded message view to see the history and context of that action item. In addition, that also helps if you forgot to clear the WF label if you forgot to do so, because you see the follow up messages right below it.

Thread hijacking and multiple action items per email. Sometimes threads get hijacked, or you get a message with multiple action items associated with it. In that case, forwarding separate emails to yourself with separate action items may be advisable.

Cross-platform and -organization. As all my communication is through email, the collaboration and communication aspect of this todo list comes for free and it works across organizations! 

No context. A lot of David Allen's framework is about contexts: At Home/At Work/Behind Computer. I don't use them, as I almost always have my computer with me, or I know I can only do a certain task when I'm physically at work or at home. If you want, you could have a third label 'AtHome', yes, you can have multiple labels, and use that to provide some context, but I don't. I do minor triaging on my cell phone, adding stars to things I need to apply labels to when I'm behind the computer. Yeah it is not ideal, but my silly phone email does not do mail labels and I'm not in the market for a new phone just yet.

No associated files. I wish there was a nice way to link files and folders to action items. So when you start work on a certain task, you automatically open the right file and folder. This would be especially useful for actions that have a long lead time, and documents don't get revisited until a few months later. If possible, I keep the attachments around and work off that. 

Finally. Always be aware of the 'next thing'. When you clear a label, always ask yourself if there is a next action item that is supposed to follow after this one. Rinse, Repeat, Enjoy :)