The Right Dictionary

A couple of years ago, I wrote about James Somers’ beautiful post on why you are probably using the wrong dictionary. The right dictionary, it turns out, is the 1913 + 1828 Webster’s Revised Unabridged Dictionary. You can read my original post and Somers’ to find out why that’s true.

Sadly, the University of Chicago site that those posts mentioned and that the DuckDuckGo bang shortcut !webster took you to is now offline. It’s even disappeared from DNS so I’m losing hope that it will return. I emailed the responsible folks but have not heard back from them. All we can do is check back with the site once in a while.

Well, actually we can do more. Marcin Borkowski (mbork) was a user of the dictionary and displeased with its demise. Fortunately, he’s figured out a way to download the dictionary and read the StarDict format that it’s encoded in. Even better, he’s figured out how to read it from Emacs. It’s pretty straightforward. You just download the files, unzip them into ~/.stardict/dic, install the sdcv application, and finally install the sdcv-mode package for Emacs. Even if you’re not an Emacs user you can use sdcv as a command line tool.

The only hassle is sdcv. If you’re on a Mac like me it’s hard to get compiled. That’s most likely because I’m using Clang rather than gcc. Happily it’s available with Homebrew and the link even tells you how to load Homebrew if you don’t already have it.

If I learn anything more about the original site, I’ll make a followup post. In the meantime, mbork’s solution is probably better because it’s integrated into Emacs and you have a local copy so you don’t have to worry about sites going offline. If you only occasionally use the dictionary and don’t want to bother loading a local copy, you can find sites offering the 1913 version. Here’s an example. I haven’t found a site offering both versions like the University of Chicago site did.

Posted in General | Tagged , | Leave a comment

Refining Spell Checking in Web-mode

Chen Bin posted some nice Elisp on how to make flyspell at little more useful when dealing with Web-mode buffers. The problem is that many tag elements fail the spell check and you get a lot of spurious misspelling warnings.

Chen’s code fixes this so that only appropriate parts of the HTML are checked. He also shows how to extend this to Javascipt as a way of pointing to ways of extending his methods to other modes. If you do a lot of work in Web-mode or you’re looking for a way of solving the same problem in some other mode, take a look at Chen’s code.

Posted in General | Tagged | Leave a comment

Another Workflow

Regular readers know that I’m fond of seeing other people’s workflows, especially those workflows centered around Emacs. Torstein Johansen has an interesting post on his workflow.

Johansen describes his hardware and OS environment (a Thinkpad with 2 external screens running Debian) and then his most used software. Like me, he mostly lives in either his browser or Emacs. He has one speed key to bring up a terminal but everything else is either started at boot time or started from the terminal as needed. I like the basic minimalism of his setup. The usual full set of applications are available for use when needed but his workflow and setup are centered around Emacs and the browser. Of course, he also has a virtual screen for chat applications and a music player, which he controls with shortcut keys.

If you, too, enjoy seeing how others get their work done, take a look at Johansen’s post. In particular, if you’re running Linux you may like his ideas about key shortcuts.

Posted in General | Tagged | Leave a comment

Rust vs. Go

As most of you probably know, Eric Raymond (ESR) is part of an effort to rewrite the Network Time Protocol (NTP) suite to be smaller and more secure. You can follow the project’s progress on their blog. The NTP daemon itself is written in C but ESR and the other developers are already considering the possibility of rewriting it in a safer language.

At this point, they are looking at two languages: Rust and Go. ESR being ESR, he decided to test their suitability by writing a small but realistic program in each language. He’s written up his results in a post that anyone considering learning either of those languages may find useful. The TL;DR is that while each language has some advantages over the other, Rust is not yet mature enough for NTP.

Bear in mind that the comparison was made with NTP in mind and that the conclusions might change for another application. This is a point that ESR stresses but many commenters ignored that nuance in favor of flamethrowers. Regardless, the post is a useful comparison and well worth taking a look at.

While you’re at it, take a look at the NTPsec blog posts to see some of the engineering decisions that the team has made and the rationales behind them. If you’re working with a team that doesn’t have the same discipline, you’ll learn things that will make your own efforts more effective.

Posted in Programming | Tagged | Leave a comment

Dangerous Phishing Attack

There is a dangerous phishing attack being targeted (mostly) at Google Mail. It’s clever enough that it has fooled even sophisticated technical users. What happens is that you get an email from someone you know that includes a clickable image. When you click on the image you are asked to login to Google again. As soon as you do, you’re compromised.

That sounds like a vanilla phishing attack but what is different is that the location bar appears to point to Google so an unwary user will feel safe clicking. If you carefully examine the contents of the location bar you will see that the protocol is slightly wrong. The post linked above has all the details so you should definitely check it out.

The post discusses this in terms of the Chrome browser but from the comments it appears that—at least—FireFox is vulnerable as well. Google is aware of the problem and is working on a fix but if other browsers are vulnerable you will need to be careful regardless of what Google does. Enabling two-factor authentication may or may not help but is always a good idea.

If, like many people, your Google account is tied many other services, having it compromised can be disastrous. Again, you should definitely follow the link and read the post so you know what to look for.

Posted in General | Tagged | Leave a comment

More Experiments with Indexing Org Files

A couple of weeks ago I wrote about John Kitchin’s use of SQLite to index his Org files. Kitchin uses Org mode as a centerpiece of his workflow and has about 5 years of files spread across his local file system, Dropbox, Google Drive, and other places. His idea was to index the files on headline, tags, citations, and a bunch of other fields that you can see by following the above link.

Now Kitchin is continuing his experiment by using the noSQL database MongoDB. It turns out that there are some advantages to using MongoDB but also disadvantages. Follow the link to see how easy it is to build the database and some strategies for getting the information out again. He continues the experiment in a subsequent post on implementing CRUD operations in MongoDB, which you should also read.

Kitchin’s work on indexing Org files along with Karl Voit’s approach to the same problem is really interesting. Those of us who put more and more of our lives and work product in Org files are, sooner or later, going to need something like this. Currently, I rely on tags or, if all else fails, a text search to find the entry I’m looking for but that only works for agenda files. So unless I’m careful to put a link to my work product in my journal (or one of the other agenda files) searching for tags won’t work. There is also, I suppose, a scaling problem. Once I get enough data, searching for tags or text is going to be too slow.

If you find yourself using Org for a significant part of your workflow, you should read these posts to help you get ready for the day that your own files get too large for easy searching.

Posted in General | Tagged , | Leave a comment

You Are Not Expected to Understand This

I recently came across a post that explains the famous comment in the 6th Edition Unix source code: * You are not expected to understand this. I haven’t seen or thought about this for years but it was once quite famous and appeared on all sorts of geek paraphernalia. The post describes the comment as notorious but it really wasn’t as flippant as it seems. The code it was describing is very hairy because it makes use of an artifact of a particular compiler for a particular machine. As Dennis Ritchie explained (see blow) this broke when they ported Unix to the Interdata and the code was rewritten.

Rob Pike tweeted that a few years later they understood the problem better and could use simpler code

Dennis Ritchie shows the code and explains (scroll down a bit) what it was doing, what they really meant by the comment, and admits that the real problem (as suggested by Pike’s tweet) was that they didn’t understand the problem very well either. Nowadays context switching is well understood and not considered the least bit hard so it’s interesting to read that real programming gurus like Ritchie and Steve Johnson struggled with getting it right.

If you have the Lions book, you can see the code in its original context (you can get the book here or from Amazon). By the Seventh Edition of Unix the code had been rewritten and the comment was gone.

UPDATE [2017-01-17 Tue 12:04]: There’s a great thread on all of this from the The Unix Heritage Society mailing list.

Posted in General | Tagged | Leave a comment

Recurring Org Events

Karl Voit has published an instructive post on how to specify recurring events in Org mode. As most of you know, you can annotate an Org TODO entry to specify that it should occur every day, every week, every 3rd day and other more complex criteria.

Even if you’re familiar with the above, Voit has an alternative method that I wasn’t aware of. That method is org-clone-subtree-with-timeshift that will duplicate the current entry but apply different time stamps. This has some benefits over the more common method. In the first place, if you have a meeting on Tuesday for the next 5 weeks, you can make the first TODO entry and then call org-clone-subtree-with-timeshift with a repeat of 4 and a timeshift of 1w. That gives you the exact number of entries and can edit or delete one or more as necessary. Another benefit is that you can add notes to each entry separately rather than having everything together in a single entry.

Take a look at Voit’s post for the details and more advantages of this method. It’s also a nice summary of how you can specify dates and times whether or not they’re recurring.

Posted in General | Tagged , | Leave a comment

A Reminder about Emacs Keybindings on MacOS

Recently, I’ve seen tweets such as this one:

It’s been a few years since I last wrote about that so here, as a public service, is a link to my post that explains how to install Emacs keybindings to MacOS apps. The process is simple so if you’re a heavy Emacs user on a Mac be sure to check it out. I use this and would be lost without it.

Posted in General | Tagged | 1 Comment

An Org Workflow

Gregory J Stein, an MIT Ph.D student in Electrical Engineering and Computer Science, has an interesting post on how he uses Org mode and the agenda to organize his projects and daily tasks. Like all graduate students, he leads a busy life so seeing how he leverages Org mode in his workflow is interesting and instructive.

Like me, Stein uses his agenda as a journal of what he’s done on a given day as well as keeping track of tasks that need to be done. Part of that is a fairly rigorous use of clocking to track his time. While that’s mostly a matter of developing the right habit patterns, he also has Org set up to automate it as much as possible.

One interesting strategy is his use of the MEETING keyword for his agenda. That keyword is used for scheduling meetings, of course, but he also uses it if some drops by his desk while he’s working. He has a capture template for meeting that automatically stops the clock on his current task and resumes it when the “meeting” is over. That’s a nice way of handling interruptions to your timed tasks. You could, of course, just stop the clock manually but if you’re like me you’ll almost never remember to do that so Stein’s method is a win.

There’s some other useful ideas in the post so you should be sure to give it a read. He also has a link to his configuration so you can see the details of how he set up his environment.

Posted in General | Tagged , | Leave a comment