Autocorrecting

Avdi Grimm has posted a nice video demonstrating Artur Malabarba’s autocorrect code. The code is just a bit of Elisp that you paste into your init.el; no packages necessary.

Once you have it installed, it allows you to correct a misspelling and add the misspelling and correction to the abbrev list so that the next time you make the misspelling, it will be automatically corrected.

Old Unix heads will remember aliases in their .bashrc (or whatever) files for things like mroe = more and other common typos. This facility is similar but more convenient because you can add to the list on the fly. If you have things you commonly mistype, this may be just what you need. Watch the video and see if it’s for you. The video is less than 3 minutes so it doesn’t require much of an investment.

Posted in General | Tagged | 1 Comment

Why Indeed?

Posted in General | Tagged | Leave a comment

Cabledolphin

If you’re a networking geek like me or if you write Elisp that uses the network to communicate with external sources, you may find cabledolphin useful. It captures network traffic to and from Elisp processes in a form that can be read and formatted by wireshark or tcpdump.

The data is captured at the application level so even if the network connection is encrypted, you can still see the data. The data is written to a file in pcapng (default) or pcap format. After capturing the data you use your favorite TCP line monitoring software to read it.

Since the data is captured at the application layer, the TCP headers have to be synthesized for wireshark or tcpdump so cabledolphin probably isn’t useful for troubleshooting actual network problems. Think of it as an aid in debugging Elisp applcations.

UPDATE Fixed misspellings of ‘cabledolphin’

Posted in General | Tagged , | 2 Comments

Emacs Garbage Collection

Bailey Ling over at bling on software has a great post on tuning Emacs garbage collection. Most of us never think about Emacs garbage collection but Ling shows that it can have an effect on performance.

The Emacs garbage collection strategy is pretty simple: once it’s allocated a certain amount of memory, it stops and does garbage collection. The default threshold is pretty small: 800 KB. It seems to make sense, given today’s systems, to increase this. The problem, Ling says, is that if you increase it too much there’s a lot of memory to recover and it can stop things for 20 seconds or more. That’s clearly not acceptable.

On the other hand, if it’s too small Emacs spends a large proportion of its time garbage collecting, also not optimal. It turns out that the Emacs manual has a solution and Ling has ferreted it out for us. Head over to Ling’s site for the details. If you’re seeing Emacs delay processing often or for long times, garbage collection may be the problem and you should check out Ling’s post.

The garbage collection threshold is a simple variable that is easily changed in your init.el so it’s easy to experiment with different values or to try Ling’s solution.

Posted in General | Tagged | Leave a comment

Editors Explained

Posted in General | Tagged , | Leave a comment

Remote Code Blocks

As Irreal readers know, John Kitchin, a Chemical Engineering Professor at Carnegie Mellon, produces virtually all of his group’s journal articles in Org mode. Those articles typically contain a lot of figures and graphs. In his latest post, Kitchin shows us how to put the calculations for those graphs and figures into code blocks that reside in other files. That makes it easy to reuse those code blocks in other papers or situations and to organize the article source and supplemental information in an orderly way.

The remote code blocks turn out to be really easy to do. Basically you just use a #+call: statement in your main org file that points to the remote code block by name and file. See Kitchin’s post for the details and an example. In the example, the calculations and graphing are performed by a Python program of about 40 lines. Everything is contained in a code block that resides with the supplemental information for the paper.

It’s an impressive technique that makes reproducible research easier and more natural.

Posted in General | Tagged , | Leave a comment

Looking for Emacs?

Here you go:

Posted in General | Tagged | Leave a comment

Query

Is anyone else having problems loading twitter.com and pages linked with its url shortener t.co? (This is with a browser, not a twitter app.) What I’m seeing is that sometimes the load will hang. If I retry it a few times or wait for a couple of minutes it works again. Sometimes I get a message like

Safari can’t open the page “https://t.co/RXqLfv94n2” because the server where this page is located isn’t responding.

after which I can load the page. Other times it just starts working.

Looking at it with a line monitor, it appears to hang during the TLS negotiation. It’s acting like the server is hanging and then restarting or maybe recovering from a resource exhaustion.

This is with a Mac running the latest OS X with a standard install. Google finds a few similar complaints but I can’t tell if the problem they’re reporting is the same one I’m experiencing. If you’ve seen this problem, could you leave a comment so I don’t spend time trying to solve a problem that’s not under my control?

Thanks.

Posted in General | Tagged | 2 Comments

Bad Idea of the Year

We’re always seeing a lot of—sorry I can’t think of a more apropos term—stupid ideas for Emacs: let’s get rid of Elisp and make Javascript the extension language; let’s make it more like Notepad+; and so on. Here’s my nomination for the worst idea of the year: let’s make it run on the JVM.

I don’t know where to start so I won’t. I’ll just let you bask in the comfortable knowledge that no matter how bad some idea you once had was, it wasn’t the worst.

Posted in General | Tagged | 1 Comment

How to Securely SSH into Your Home Network

Karl Voit shares a nice trick with us. Suppose you want to SSH into your home server. You may be loath to open a port in your firewall and your ISP may assign you a temporary IP address that can change at any time. These problems can make accessing your server difficult.

Voit has just the solution: access your server through TOR. The trick is to run a TOR hidden service. Sure, that’s what all sorts of shady enterprises do but so do Facebook and other legitimate enterprises. It turns out that it’s really easy to do this; see Voit’s post for the details. Once you’ve got it set up you can securely access your server even if you have a dynamic IP address.

Posted in General | Tagged | Leave a comment