PGP Problems

I’ve often written about the need to encourage wider use of encrypted emails. As everyone knows, the main problem is that existing email encryption solutions are too hard to use: Aunt Millie simply won’t deal with the complexities. But what are those problems? On the Mac, for example, GPGMail integrates more or less transparently with the Mail App. There are two buttons for choosing signing and/or encrypting an outgoing email—which can be set to perform their functions by default—and incoming encrypted mail is automatically decrypted, perhaps after prompting for a password for the private key. Probably easy enough for even Aunt Millie.

So what are the problems? Matthew Green has a post that offers an answer. The real problem is what it always is with crypto systems: key management. Current email encryption systems, which are mostly all based on the OpenPGP protocol, illustrate this nicely. After you’ve generated a GnuPG/PGP key, how do you communicate it to Aunt Millie? How she can she be sure it’s really your key and not that of her other, conniving, evil nephew? Those are just some of the problems that an email encryption system must deal with. Read Green’s post for exactly what those problems are and some possible solutions.

Posted in General | Tagged | Leave a comment

Map Reduce Explained

If you’re a Lisper, the chances are that you understood the basics of Google’s map-reduce framework before you even read the paper. However, many people without a Lisp background find the ideas difficult to understand. Fortunately, if you fall into this group, Mathieu Blondel has you covered

Posted in General | Tagged | Leave a comment

The Editor of a Lifetime

Recently, I wrote about Sacha Chua’s chat with Harry R. Schwartz and his work with EmacsNYC, which, among other things, releases videos of talks that its members give to the group. The latest video is a talk by Perry Metzger about his 31 years as an Emacs user.

Metzger talks about Emacs’ enduring popularity and why anyone would keep using it for more than 3 decades. There are many answers to that, of course, and Metzger talks about several of them but the main reason is that Emacs excels at the thing programmers, writers, and others whose jobs mainly involve working with text do the most: edit text. He says that a modest effort in becoming proficient in Emacs pays daily dividends in time saved editing text.

The talk is not all cheerleading though. Metzger talks about the shortcomings of Emacs and what we can do to address them. These include better email support, CALDAV and CARDDAV integration, improvements to the extensions language, threads, HTML and PDF display, and others.

Metzger is an interesting guy (I remember reading his blog years ago before he abandoned it) and his talk is well worth watching. The video is 68 minutes so plan accordingly.

Update: There’s an interesting discussion of the talk at the Google+ Emacs Community. Metzger expands on his discussion of Email and Web page rendering, so it’s definitely worth a look if you liked the talk.

Posted in General | Tagged | Leave a comment

Dress Codes

If there are any antediluvian companies out there still insisting that their engineers wear coats and ties or some other sartorial silliness, maybe it’s time to rethink that policy. When you’re holding on to a policy that even the U.S. Government has abandoned, you know it’s time to give it up.

Posted in General | Leave a comment

A Followup on Leaving Gmail

In my post about Chen Bin’s guide to using Gnus with Gmail, I mentioned that in my own quest to move my email operations to Emacs, I was looking at three packages: mew, mu4e, and gnus. In the comments, I got a couple more recommendations. David recommended Wanderlust as a mature and full featured solution. Sam recommended that I look at Notmuch. Both useful additions to my list and I’m glad to have them even though they complicate my decision making.

Sam also provided a link to a post by the invaluable Christopher Wellons that compares Notmuch and mu4e. Wellons’ post is interesting because it’s principally about moving off of Gmail and onto his own server that he would access using an Emacs-based email client. I found this particularly interesting because that’s my end goal: no email middlemen that offer the NSA and others easy access to my email.

If you’re OK with Gmail but would just like to compose messages in Emacs, Artur Malabarba has got you covered with his gmail-message-mode that lets you hot key from your browser to Emacs when you want to compose an email. Malabarba’s got it working with Chrome, Firefox, and Conkeror. He uses Markdown to compose messages but it could probably be patched to use Org-mode fairly easily. In any event if you’re interested in integrating Gmail and Emacs, give Malabarba’s post a look.

Posted in General | Tagged | 9 Comments

Generating an Org Link to a Web Page

Recently, I was rereading Vivek Haldar’s post on the seven levels of Emacs proficiency and suddenly realized that I’d regressed in one aspect of my Emacs skills. Haldar says

Up until now, you probably had one large Emacs window plus many other
shell windows spread out on your screen. Also, if you are a typical
developer, you often had to cut and paste text between those windows.
And that was a major road bump, because you had to use the mouse to
select text in an xterm.

I thought I’d long since stopped committing that sin but my epiphany upon rereading Haldar’s post was that I was still guilty of it in one important case: grabbing links to Web pages. Almost all my blog posts link to at least one Web page and often several. I generated those links in exactly the way that Haldar deprecates: change focus to the Web page, cut the URL from the title bar, switch back to Emacs, paste the URL into the Org link. Clearly, I needed a better method; something that would allow me to grab the URL of the currently displayed browser page and turn it into a link in my Org buffer without leaving Emacs.

The org-mac-link package almost does what I needed but it fills in the link description with the Web page title, which was not what I wanted. So I looked at the org-mac-link code and Kris Jenkins’ excellent video on using AppleScript to play Spotify tracks from Emacs and put together a bit of Elisp that does just what I want:

(defun jcs-get-link (link)
  "Retrieve URL from current Safari page and prompt for description.
Insert an Org link at point."
  (interactive "sLink Description: ")
  (let ((result (shell-command-to-string
                 "osascript -e 'tell application \"Safari\" to return URL of document 1'")))
    (insert (format "[[%s][%s]]" (org-trim result) link))))

Of course, this works only on OS X but that’s OK for me because I write all my blog posts on one of my Macs. Doubtless other operating systems have a way to do the same thing1. You could, for example, find a way of doing this in Python and then call Python instead of AppleScript to retrieve the URL. If your main OS is Linux or Windows and this interests you, leave a comment for others if you find a way of doing it in your environment.

Footnotes:

1

A quick check suggests that org-protocol may be a good place to look but I haven’t researched this in any detail.

Posted in Programming | Tagged , | 6 Comments

Bastien Guerry on Org Mode

Here’s a video by Bastien Guerry in which he talks about Emacs and Org Mode. Guerry, of course, is the maintainer of Org Mode and an interesting guy. Here at Irreal, we’ve mentioned him several times.

Guerry begins by demonstrating naked Emacs, his preferred configuration for how Emacs appears on the screen. Afterwards, he talks a bit about the features of Org Mode and the power it provides. If you’re already an experienced Org user, most of this will be familiar; if you’re a n00b or curious about Org, this video will give you a bit of a taste. The video is just under 27 minutes so plan accordingly.

Posted in General | Tagged , | Leave a comment

Formula 1 Communication Technology

I’ve said it before: I’m not a racing fan. And yet, I’ve already written about it twice before and here I go again. This post, like the others, focuses on the technical aspects of the sport.

According to this BBC story, data analysis has become more and more important in a race. The cars have about 150 sensors that provide telemetry on a assortment of measures such as tire pressure, drag, aerodynamic down pressure and many others. It takes a lot of engineers to analyze and interpret this data in real time and relay their findings to the driver.

Unfortunately, the Formula 1 governing body restricts the number of support personnel, including engineers, who can be at trackside to 60. That doesn’t leave enough room for all the engineers needed to work with the data so they moved the analysis back to the factory. This remote analysis necessitates a high speed data link, which turns out to be surprisingly difficult to provide. Communication providers have to set up and tear down facilities at each race site, which are located all over the world.

One provider, Tata Communications uses two teams. One dealing with things at the current race site and the other setting up the next site. Network latency ranges from 7 to 300 milliseconds, depending on distance from the factory. Data rates can sometimes exceed 100 gigabytes a second.

If you enjoy seeing how technology can be brought to bear on problems that don’t seem, at first glance, technological, give the article a read. It’s short and interesting.

Posted in General | Tagged | Leave a comment

Computing the Inner Product with Common Lisp

Over at iqool, Patrick Krusenotto asks how you would compute the inner product of two vectors using Common Lisp. He gives a number of solutions, all of which are interesting. You can look at this problem two ways:

  1. What is the most idiomatic way?
  2. What is the fastest way?

If I were writing a function to do this and speed was not an overriding concern, I would do something like

(defun inner-product (v1 v2)
  (reduce #'+ (mapcar #'* v1 v2)))

and Krusenotto agrees that this is what most Lispers would write.

If I was concerned about speed, I would want to avoid the consing from the mapcar and would do something like

(defun inner-product (v1 v2)
  (let ((sum 0))
    (mapc (lambda (e1 e2) (incf sum (* e1 e2))) v1 v2)
    sum))

That’s probably fast enough for almost all applications, especially if you add some declares to optimize code generation. There was a solution similar to this in the comments. To tell the truth, though, I might also use a tail recursive loop as in Krusenotto’s solution #2. I do love me some recursive programming.

If I was really concerned about speed, I would probably do something like Krusenotto’s solution #5, which uses an explicit go to speed the loop. With proper declarations, you probably can’t do much better.

It’s fun to think about how you might program simple problems like this. What solution(s) would you use?

Posted in Programming | Tagged , | 1 Comment

TIL: Something New About Ace Jump Mode

Regular readers know that I’ve been a huge fan of ace-jump-mode ever since I saw it demonstrated by Magnor Sveen in one of his celebrated Emacs Rocks! episodes. More recently, I’ve been using it all the time as a replacement for isearch to navigate within a buffer.

Since I started using ace-jump-mode instead of the Yegge approved isearch, my efficiency at jumping around a buffer has been increased significantly. Still, it doesn’t directly address a problem that I often have. When scrolling through a buffer with【Ctrl+v】 or【Meta+v】, I often find myself at the wrong edge of the display—at the top when I want the bottom, or vice versa. I generally solve that problem by picking a word on the desired line and using ace-jump-mode to jump directly to that word. It turns out, though, that ace-jump-mode has me covered for that case too. If I type【Ctrl+u Ctrl+u Hyper+a】 instead of【Hyper+a】, where【Hyper+a】is the sequence I use to invoke ace-jump-mode, each line is marked and I can jump to the desired line by typing the corresponding letter.

One could argue, I suppose, that that’s not any easier than picking a word on the desired line and jumping to that word but it feels more direct and somehow doesn’t take as many of my ever-diminishing brain cycles to invoke. If you aren’t already an ace-jump-mode user, you owe it to yourself to try it out. You’ll be amazed at how much more efficient your navigation becomes.

Posted in General | Tagged | 6 Comments