Claude Shannon Redux

Recently, I wrote about the IEEE Spectrum’s article on Claude Shannon by Jimmy Soni and Rob Goodman. If you haven’t already read their article, I urge you to do so. Shannon was a fascinating man and a genius virtually unknown outside the tech community.

Over at The Mission, Soni and Goodman have another article that’s also in support of their book on Shannon. This article focuses more on Shannon’s genius and some of the things that the authors learned from their study of him. In particular, they list 12 lessons or strategies that Shannon used to organize his research and focus his genius on the problems he was interested in solving. These included such things as “Time is the soil in which great ideas grow” and “Fancy is easy. Simple is hard.”

The lesson I took away from the article, although it wasn’t explicitly called out, was to husband your time. Shannon would famously throw letters that he didn’t want to deal with into a “procrastination bin” from which they never emerged. He didn’t waste time on anything that didn’t interest him. He didn’t bother trying to sell or argue for his ideas. If someone didn’t believe in them, he ignored that person.

Many or most technical people are not history buffs—I know that’s true of me—but there’s something about Shannon that resonates. Do yourself a favor and read these two articles. I’m certain you’ll be glad you did.

Afterward

Soni and Goodman have a third article that discusses Shannon’s wife, Betty Moore Shannon, whom they describe as his most important collaborator and a topnotch intellect in her own right. If you enjoyed the first two articles on Shannon, you’ll like this one too.

Posted in General | Tagged | 1 Comment

The Pass Password Manager

A recurrent theme here at Irreal is that you really need to be using a password manager. Let it generate a long, unique, random key for each site and protect those keys with a secure master password (generated by, say, diceware).

Andy Moran used to use LastPass but didn’t like that all his data was stored on a remote sever that he didn’t control. There are lots of password managers that don’t have this problem—I use 1password but there are plenty of others. Moran has posted about one of them, the Pass password manager. Pass is open source and tries to adhere to the Unix philosophy. Basically, every password lives in a GPG-encrypted file named for the resource it’s protecting. The files can be manipulated with the usual Unix tools and except for being encrypted are plain text.

Moran’s post walks you through installing and setting the utility up. He also shows some examples of its use. If you’re looking for a good password manager that you control and that you can sync with Git, take a look at Moran’s post. I’m very happy with 1password but if I weren’t or if I become unhappy in the future, I would certainly give Pass a try.

Posted in General | Tagged | Leave a comment

Tuning Your Emacs Configuration for a Fast Load

Gergely Risko has an interesting GitHub repository that explores ways of making your Emacs load time as small as possible. Unless I’m hacking on my configuration, I rarely start Emacs except at boot time so the two or three seconds of startup time doesn’t bother me much. But if you simply must get your startup time to an absolute minimum, take a look at Risko’s strategy.

The TL;DR is that he avoids package-initialize and uses use-package in its place. The real problem with that solution is getting the load paths for the packages. In the video on use-package, John Wiegley and Sacha Chua discuss that problem. Wiegley avoids it by not using the package system. Most of use would rather not take that option and Risko has a method of loading the paths that runs when init.el isn’t compiled and adds them to the init.elc image so that the overhead is mostly avoided.

Most of us, I’m sure, don’t load Emacs very much. We either have a long running instance or start the server and use emacsclient so unless you have a use case like Wiegley’s that requires frequent restarts of Emacs, you may not want to bother with Risko’s solution. If minimizing your Emacs load time is another video game for you, take a look at the repository to see if his ideas might help.

Posted in General | Tagged | 6 Comments

Configuring Notmuch and Offlineimap for Emacs

As most of you are doubtless sick of hearing by now, I’ve settled very happily on mu/mu4e to handle my email from within Emacs. It’s not the only possibility, of course, and many other Emacers prefer using notmuch, which is similar to mu but with a robust tagging system.

For those of you in the notmuch camp, KKatsuyuki has an excellent post on how to configure notmuch and offlineimap for use with Emacs. He’s got a complete recipe so you should be able to pretty much paste his configuration into your init.el making only the obvious changes to things like paths and email account info. KKatsuyuki’s configuration is for Gmail, so you may have to do a bit of research on offlineimap if you’re using something else.

KKatsuyuki’s post is an excellent go-by for anyone wanting to bring email into Emacs using notmuch.

Posted in General | Tagged | 1 Comment

An Application of let-alist

Since Emacs 25.1, Artur Malabarba’s excellent let-alist macro has been a built-in feature of Emacs. As the name suggests, it’s a way of dealing with alists. The idea is that instead of writing a series of assq and cdr statements, you just write .tag where tag is the car of an alist element. Malabarba’s post gives an example of its use.

There’s a nice example of its use by T. V. Raman in a post about parsing the result of a json-read. Most of the examples I’ve seen use json-read to produce the alist, but the macro can, of course, be used with any alist. It can even handle nested alists as both Malabarba’s and Raman’s examples make clear.

Posted in General | Tagged | 1 Comment

Zamansky 36: Swapping Buffers and Some Elisp

Mike Zamansky has another video up. This time, it’s about swapping buffers but keeping focus in the original window. The video is interesting because it shows the process Zamansky went through to solve a problem he was having.

The problem was that he had a window configuration with one large buffer and two smaller ones. He wanted to swap the buffer in one of the smaller windows with the one in large window. If you have ace-window installed, it’s easy to swap two windows. I have the proper call in a hydra and use it reasonably often.

The problem with that for Zamansky is that he’s trying to move another buffer into the large window so he can work on it but ace-window keeps the focus with the original buffer so it’s in the wrong window. What he needed was to swap the buffers but keep the focus in the original window.

Most of the video is how he solved this problem with a bit of Elisp and how he felt his way to the solution by using the Emacs help system and by looking at the ace-window code. It’s an instructive video especially if you have only minimal Elisp skills. Zamansky shows that you don’t need to be an expert to solve real problems.

Even if you already use ace-window, the video may teach you something you didn’t know. It did me. It turns out that after calling ace-window to change to a new window, you can give it a subcommand instead of a window number. That makes it easy to swap windows and do certain other actions. See the video for the details.

The video is a little over 12 and a half minutes so it should be easy to find time for it. As with all of Zamansky’s videos, it’s well worth your time.

Posted in General | Tagged | Leave a comment

Creating a Branch from the Current Git State

Kris Jenkins, whose wonderful video I’ve written about before, has posted a very handy Magit tip. What do you do if you want to add a feature branch but start working on it before creating the branch? What you’d like to do is move your unpushed work to a new branch and set your current branch back to the state it had before you started working on your changes. Neither of the two common solutions are very good but it turns out that Magit has a solution: magit-branch-spinoff.

It does exactly what you want: it creates a new branch with your unpushed commits and resets your current branch to the last commit it shares with the upstream repository. As far as I can tell, this functionality exists only in Magit and is not part of Git. It’s yet another reason to be using Magit (and, of course, Emacs). Take a look at Jenkins’ post for the details and more background. Also take a look at the documentation to see its full functionality.

Posted in General | Tagged , | 3 Comments

The Most Beautiful Program Ever Written

If you’re a lisper and enjoy Scheme, you may like William Byrd’s video on The Most Beautiful Program Ever Written. Unless you’ve been immersed in the Lisp culture, it’s probably not what you think. According to Byrd, the most beautiful program is just 5 lines of code implementing a metacircular interpreter for Scheme. He has, he says, spent the last 13 years or so trying to understand the implications of those 5 lines.

His presentation starts off with a short introduction to Scheme and then moves immediately to writing a function (in Scheme) that can interpret Scheme expressions. He builds on a simple implementation and eventually pares it down to 5 lines.

His real interest, though, is using the ideas in the metacircular interpreter to do logic programming. The second half of the video is about a program that does program synthesis. You can specify some or even none of a program and what output you want and the program will compute Scheme expressions to give you the results. It’s sort of like Wilfred Hughes’ suggest.el for Emacs but much more sophisticated.

The video is just over and hour and a half so you will definitely need to schedule time. If you have only a casual interest in Lisp the hour and a half may be more time then you want to spend but the talk is interesting and self contained. You needn’t worry about not having enough background.

Posted in General | Tagged , | 4 Comments

Hosting Your Own Contacts and Calendar

Those of you who have been around for a while, know that I live in the Apple ecosystem. I like having all my devices synced up automatically and Apple does that pretty seamlessly and, I believe, reasonably securely. Still, I like to have a go-bag packed and ready for the time that disaster strikes and I have to leave the comfort of Appleland. That’s the reason all my data is either plain text or, in the case of things like pictures, in an open format that can be read with easily available open source tools. If Apple disappeared, I wouldn’t lose any data and could easily go back to a Linux based environment.

Part of my exit plan involves having a way of dealing with my calendar and address book. Apple handles those in a particularly pleasing way and keeps everything synced between my devices. What would I replace those with? I certainly don’t want to share my information with the world through Google so Google calendar and contacts is not an option.

Happily, Nick Touran has a nice solution. He has an interesting post in which he shows how he self hosts his calendars and address book. His setup includes syncing to both his Android phone and his wife’s iPhone so it’s a pretty comprehensive system. Take a look at his post to get the details.

I probably wouldn’t use the same clients as he does. As you know, I try to keep as much as possible in Emacs so I’d probably use bbdb or perhaps one of the Org solutions for my contacts and I’d import my calendars from the CalDAV server into my Org agenda and perhaps calfw. Touran’s setup allows him to share a calendar with his wife so my shared calendars wouldn’t be a problem. About the only thing I’d really miss is the wonderful Fantastical.

Posted in General | Tagged , | Leave a comment

Collapsing Empty Directories in Zsh

Earlier this month, I wrote about Fuco1’s package to collapse empty directories in dired listings. That’s a handy thing that lets you avoid clicking through a series of empty directories1 to reach the file or directory you really want.

The idea originated with GitHub where Karl Voit noticed it and soon became addicted. He started wishing he could do the same sort of thing in zsh. In particular, he wanted to have cd jump over the empty directories so he didn’t have to list all the intermediate directories. With the help of seanliao96 he offers a nice bit of shell code that does just that.

If you’re a zsh user, you should take a look at Voit’s post and see if you want to adopt his code. As I say, it’s a simple shell function that you can paste into your zshrc.local so it’s easy to experiment with and get rid of if you don’t like it.

Footnotes:

1

By which I mean directories that have only a single entry of another directory.

Posted in General | Tagged , | Leave a comment