Ten Rules for Reproducible Research

Those of you have been around for a while know I’m a big fan of reproducible research. I’ve written about it here, here, here, here, here, and here. Now Anton Nekrutenko, James Taylor, and Eivind Hovig have a nice article in the Computational Biology section of PLOS entitled Ten Simple Rules for Reproducible Computational Research.

Some of the rules are obvious such as

  • Version control all custom scripts
  • Always store the raw data behind plots

while others are things you might not think of such as

  • For analyses that use random input, always record the random number generator seed so that the exact run can be reproduced
  • Generate a Hierarchical Analysis Output, Allowing Layers of Increasing Detail to Be Inspected

The nice thing about the article is that they discuss each rule and offer ways to follow it. If you’re involved in publishing your research (or even if you’re doing research that won’t be published) you should take a look at this article. It will make your life a lot easier, especially since many journals are now requiring some sort of reproducibility documentation.

The article doesn’t mention Emacs but as I’ve written many times, Emacs and especially Org mode provide many tools for doing reproducible research effectively. If you’re not familiar with that, the posts I linked above will give you a few ideas.

Thanks to Jorge Tavares via Jean-Philippe Paradis for the pointer to the article.

Posted in General | Tagged , | Leave a comment

Notes on the Sacha-Magnar Interview

Sacha Chua has posted a followup to her interview with Magnar Sveen. It’s basically a set of topic headings that index into the video of the interview. That’s very nice because if you want to revisit a particular part of the interview, you can go right to it rather than having to run through the entire video.

She’s also added audio only links in MP3 and OGG for those who want to listen during a commute. That’s very nice too.

Chua is famously “semi-retired” but the interview and followup represent a tremendous amount of work. We should all be grateful for her taking the time to do this and maybe leave a thank you on the post at her site.

Posted in General | Tagged | Leave a comment

A YASnippet Tutorial

Matthew Keeler has posted a nice introduction to writing YASnippets. Keeler starts with a minimal snippet that simply includes the GPL 3 boiler plate in the file and then moves on to a for loop snippet for C/C++ that uses tab stops.

Finally he presents a couple of complex examples. The first uses mirrored fields to build C++ QT classes. It also demonstrates embedding Elisp code in the snippet. A second example ties everything together to build a snippet for defining a PHP class.

Writing snippets is pretty easy once you’ve seen a couple of them explained. Keeler’s post is a nice way to get started.

Posted in General | Tagged | Leave a comment

Coping With the NSA Dragnet

Senators Ron Wyden, Mark Udall, and Martin Heinrich have an interesting Op-ed in The New York Times entitled End the N.S.A. Dragnet, Now. In it they say that they believe the NSA’s collection of telephone call metadata is a clear case of an unconstitutional general warrant of exactly the type that the American Revolution was fought to prevent. They further state that the NSA greatly exaggerates the usefulness of the bulk collection and have been unable or unwilling to provide any evidence of its usefulness despite repeated requests for the evidence by the senators.

They also discuss Senator Feinstein’s reform bill, which they describe as business as usual for the NSA, and go on to contrast their own legislation that would prohibit the government from conducting “backdoor searches” of Americans’ communications such as phone call metadata, emails, text messages, and Internet use.

Sadly, the Senate Intelligence Committee has voted out Feinstein’s bill so we can expect to see little help from the Senate. They will, of course, pretend that they’ve solved the problem while the NSA continues to abuse the rights of American citizens and, indeed, citizens of every other country as well. It’s shameful.

Posted in General | Tagged | Leave a comment

More Site Tuning

Since I tuned up the caching software for Irreal.org I’ve seen a significant improvement in download speeds. Unfortunately, I’ve also seen some problems with client-side caching. After I add a new post and reload the site, I see the previous state without the new post. If I delete my browser history, the problem goes away.

Obviously, that’s not acceptable so I turned off client side caching. I will monitor the performance on my side to see if this helps things but if you see new problems (or, hopefully, improved performance) please let me know.

Posted in Blogging | Tagged | Leave a comment

Counting Check Marks

Here’s my solution to the last EmacsGolf challenge. I used the apparently little-known how-many command. I normally use how-many in Elisp to count the occurrences of some regex. Here’s an example from my old blog that leverages some code from the always useful EMACS-FU. It turns out that how-many is a command and thus callable interactively. That makes the solution straightforward.

Meta+xhmReturn Call how-many
cbMeta+/ cb → ✓
Return result returned in minibuffer

That does the job in 8 keystrokes.

The excellent flx-ido mapped hm to how-many on the first try despite the fact that I hadn’t used how-many in several months (and never before interactively). I map 【Meta+/】 to hippie-expand, which takes care of expanding the abbreviation.

Posted in General | Tagged | 3 Comments

Experience With flx-ido

After watching Sacha Chua’s interview with Magnar Sveen, I wrote that Sveen had demonstrated some Emacs features that I wanted to try out. One of those was flx-ido. The flx package was written by Le Wang to bring Sublime Text’s fuzzy matching to Emacs. Wang describes it as fuzzy matching with good sorting.

The ido package already supports fuzzy matching, of course, so the advantage of flx-ido is the improved sorting of prospective targets. You can see flx-ido in action with comparison searches using ido flex in this screencast from Wang. It nicely illustrates the advantages of flx-ido in a way that writing about it can’t.

I’ve been using the package for about 3 weeks and, after some acclimation, really like it. Initially, I used it like I did ido flex but that gave me suboptimal results. Once I started typing the first character of each word—some-fancy-command → sfc—I got excellent results. If you decide to try it, give yourself a bit of time to get used to it and train yourself to type appropriate abbreviations.

The other thing that I find a huge advantage is ido-vertical-mode. It lists your ido choices vertically instead of the default horizontal method. That makes it much easier to see the choices and pick the correct one. This was one of those things that I was pretty sure I wasn’t going to like but I got used to it right away and wouldn’t want to go back now. Even if you decide not to try flx-ido, do yourself a favor and give ido-vertical-mode at try. I think you’ll like it. You can see it in action in the Sveen interview or in an animated gif at its project page.

Posted in General | Tagged | Leave a comment

The NSA and Terrorism Fear Mongering

Whenever ordinary folks push back against—or even question—the NSA’s extralegal surveillance of innocent citizens they are always told that it’s to protect them from terrorists. “Don’t let there be another 9/11,” they say. “Really,” they assure us, “it’s for your own good.”

It’s all nonsense, of course, and now the EFF has published an interesting article that puts the lie to those claims. In reality, the EFF says, terrorism is only a narrow aspect of the NSA’s broader activities and interests. Their own talking points memo advises spokesmen to continually invoke 9/11.

In truth, the NSA spends most of its efforts spying on foreign heads of state, foreign businesses, the World Bank, the UN, and just about everything else. You may or may not think that such activities are justified but one thing for sure, there’s a lot more going on than just protecting the world from terrorists.

Posted in General | Tagged | Leave a comment

What Does It Take? (European Edition)

Just in case those of you in Europe think that you don’t have reason to be as mad as Americans should be, you might want to reconsider.

Posted in General | Tagged | Leave a comment

An Easy EmacsGolf Challenge

Here’s an easy EmacsGolf challenge that came up today. I have an org file in which some of the headings have a check mark (✓) at the beginning of the heading (but after the stars). The file is quite long and I want to count how many check marks there are in the file.

For clarity, the file looks something like this

 * Level 1.1
 ** ✓ Level 2.1
   blah blah blah
 ** Level 2.2
   blah blah blah
 * Level 1.2
 ** Level 2.1
   blah blah blah
 * Level 1.3
 ** ✓ Level 2.1
   blah blah blah
 ** Level 2.2
   blah blah blah
 ** ✓ level 2.3
   blah blah blah
...

Here are the rules:

  1. There are no check marks in the body of the text, only at the beginning of some headers.
  2. You may assume that there’s an abbreviation, cb, for ✓.

The challenge is to find the total number of check marks in as few a number of keystrokes as possible.

Posted in General | Tagged | 3 Comments