Literate Programming With Org Babel

Howard Abrams recently gave a talk at the PDX Emacs Hangout in Portland. So far, there is no video of the talk but Abrams did write up his notes1. The talk was intended to be a workshop so you should work through his examples as you read the notes.

The idea of the workshop is using Org Babel for Literate Programming. Abrams demonstrates that you can do straight Literate Programming à la Knuth but the real power of the Org/Babel combination is the ability to mix languages, run the code in situ, and then incorporate the results of the program directly into the text.

Babel has many ways to accomplish those last two steps and the bulk of Abrams’ workshop is devoted to exploring the different ways to input and export data to the code. The notes are an excellent summary of the capabilities of Org/Babel and worth bookmarking.

I’ve written before of how enjoyable using Org/Babel for writing papers and organizing projects is. You get all the benefits of reproducible research as well as a pleasant environment in which to work. Babel really is one of the killer features of Org mode even though it’s less well known and appreciated than some of Org’s other features. If you aren’t familiar with it, take a look at Abrams notes and start feeling the power.

Footnotes:

1

Abrams says the notes are a “first draft” and that he will probably post them to Reddit or someplace similar later. Nevertheless, I found the notes reasonably complete and useful even in their preliminary state.

Posted in General | Tagged , | Leave a comment

Magit Video on Rebasing

Charl Botha has posted an excellent video on advanced rebasing with Magit. It serves as a great followup to Howard Abrams’ Magit tutorial video. Abrams covered rebasing too but Botha shows how to perform more complicated tasks.

First he shows how to change the commit message for any commit not just the last one. Then he shows how to easily reorder and combine (squash) commits. Squashing commits, especially, is a common task and a useful thing to be able to do. Magit makes this easy but it’s not obvious how to do it so having a tutorial is nice.

Finally, Botha shows how to break apart a commit into two or more separate commits. As he says, this is rarely needed but is possible and not too hard. Watch the video to see the details.

If you haven’t already watched Abrams’ video, watch that first and then take a look at Botha’s video. I learned a lot from them and if you’re not already comfortable with rebasing, you will too. Definitely recommended.

Posted in General | Tagged , | Leave a comment

Org Mode and Software Engineering

Rohan Kshirsagar has a nice post on integrating Emacs Org Mode into the software engineering process. That’s a big subject area, of course, but Kshirsagar focuses on using Org to take notes as things occur to you and perhaps turn some of them into TODO items. That’s only a tiny bit of the Org functionality that can be useful to a developer but it’s an important one.

The idea is that as you’re working some idea may occur to you and you’d like to capture it. If you have to switch to another application and do a lot of busy work to write your idea down, you can lose focus on your main task. A nice thing about Org is that it has a built-in facility to quickly and easily capture notes and store them in an Org file. It doesn’t take many brain cycles because almost everything is automatic.

I like this facility so much that I even have a global hot key to bring up the Org capture menu from any application on my machine. I mostly use this in conjunction with the browser when I want to make a note of something I’m reading but it works from anywhere.

Kshirsagar also points out that if—heaven forfend—some members of your team are not Emacs users, Org mode makes it easy to publish the notes as HTML and share them either on the team server or a public area of your workstation. It’s a useful post and worth a read so head on over.

Posted in General | Tagged , | Leave a comment

What Happens When You Give Law Enforcement a Backdoor Key?

This:

Posted in General | Tagged , | Leave a comment

John Oliver on Encryption

The other day I saw a hilarious John Oliver video on encryption. He explains, as only Oliver can, why despite outward appearances the encryption question is not simple and one’s immediate reaction of “Of course Apple should help the government fight terrorists” is actually more nuanced than one might think.

Now The Atlantic has run a piece on the video and asks Can John Oliver Get Americans to Care About Encryption? That’s an interesting question. Maybe commedians can do what common sense and rationality have been unable to do: make the average citizen understand what’s at stake in the debates. It turns out that Oliver’s crew spent considerable effort putting the piece together and interviewed all the players.

The Oliver video is embedded in the Atlantic article so you have one stop shopping. Even if you don’t care that much about encryption, the video is amusing and worth watching for its humor. It’s nice to see main stream publications giving the matter some intelligent coverage.

Posted in General | Tagged , | Leave a comment

A One-liner Fuzzy Isearch

If you’re looking for a quick and easy fuzzy isearch, here’s a way to get it with a single line of Elisp. Also check the comments for some riffs on the same idea.

Posted in General | Tagged | Leave a comment

Steven Levy on the New Crypto Wars

I’ve written about Steven Levy before (1, 2, 3). I still consider his book, Hackers, the definitive history of the hacker culture. Now over at Backchannel Levy asks Why Are We Fighting the Crypto Wars Again?

Levy recounts the history of the first crypto war and notes that after it was won not much happened to improve security for the average user. Recently, however, a series of spectacular security lapses and the Snowden revelations of government snooping on Americans not accused or suspected of any crime have started to change things. People started demanding more security and several tech companies—particularly Apple—responded by baking in security and enabling it by default on their devices.

The government, which had been content to let things lie, suddenly started to panic. Claiming they had an absolute right to see any information if they got a warrant—and often even if they didn’t—they’ve started demanding that the tech companies change their products to allow this. All this came to a head with the San Bernardino case but more significantly with the WhatsApp issue that cryptographer Matthew Green says is the real point of the San Bernardino contretemps.

Levy ends his article by glumly concluding that we’re back at square one.

UPDATE: a → at

UPDATE 2: The EFF has a nice explanation of the WhatsApp case that’s well worth reading. It explains the issues and why they matter.

Posted in General | Tagged , | Leave a comment

The Data on Farook’s Phone

Undoubtedly true but beside the point. The government wants a precedent not any purported data on the phone.

Posted in General | Tagged , | Leave a comment

Securing Your WordPress Site

About three years ago, after Irreal was hacked, I published a short article on securing WordPress sites that pointed to a WordPress article on ways to harden a WordPress site. Recently, John Stevens wrote me to say that he and his Hosting Facts team have written a follow up article that expands on the theme of the WordPress content.

If you’re using WordPress for blogging or some other CMS function you should definitely take a look at Stevens’ article. It has 28 tips on how to harden your WordPress site. Many of those are the normal things that you’d expect but there are also some suggestions that you may not have seen. It’s definitely a useful resource.

Posted in Blogging | Tagged | Leave a comment

Using Emacs for Prose

Most Irreal readers are, I think, involved with development or at least some sort of tech. Nevertheless, when I, from time-to-time, write about using Emacs for writing I invariably get some feedback from readers thanking me for covering that aspect of Emacs use.

With that in mind, I’d like to point you to this interesting thread on using Emacs for writing prose. The original poster wants to use spacemacs and appears to be interested in non-technical writing. Most of the responders recommended some combination of Org mode and Pandoc. That’s what I use so of course it’s my preferred solution as well. Others noted that if you prefer Markdown, Emacs has markdown-mode to help out a bit with the formatting and pandoc-mode to handle exporting the document to whatever final form you need it in.

If you write prose and believe—as all right-thinking do—that word processors such as Word are the spawn of the devil, you should take a couple of minutes to read through this thread. As someone who does all my writing in Emacs, I can testify that it’s both possible and pleasant to use Emacs for prose. I like Org mode and think it’s by far the best solution for prose but Emacs can support you if you like Markdown or if you need the full power of LaTeX Emacs has you covered with the powerful and wonderful ACUTeX.

Posted in General | Tagged | Leave a comment