Keeping A Lab Notebook Webinar

I came across a nice Webinar on keeping a laboratory notebook. It’s from the National Institute of Health and is therefore aimed at medical researchers and the type of labs they work in. Still, there are, I think, valuable lessons for those of us in software engineering even if we don’t work in a formal lab setting.

I’m a big believer in keeping a notebook that contains the same sort of information discussed in the Webinar. I record problems I work on and the steps I take to solve (or try to solve) them. Naturally, I keep mine electronically in Org mode. I try to use the method recommended by Howard Abrams in his really great video on Literate DevOps. I’m not doing DevOps but I really like his approach of embedding the code he used to solve a problem in an Org file that explains the problem and what he’s doing to try to solve it. That’s especially useful if the problem comes up again because I have working code that solved it last time.

If you have to fill out activity reports, keeping a lab notebook provides an excellent record of what you’ve worked on and—if you track your time—how long you worked on them. It takes a bit of discipline to keep an accurate and comprehensive lab notebook but is well worth the effort.

The video is a little over 13 minutes long so you may need to plan some time for it. If you’d rather, you can read the slides and associated narrative instead.

Posted in General | Tagged , | Leave a comment

Beginning Emacs Tutorial Video

Derek Banas has posted a nice introduction to Emacs video. It covers roughly the same material as the built-in tutorial with the addition of setting up a Clojure programming environment. Banas covers installing Emacs on both macOS and Windows. One of the commenters complained that he didn’t cover setting it up on Linux but it’s hard to imagine a Linux user not knowing how to install an application. He uses version 25.3 of Emacs so he’s working with an up-to-date Emacs.

Watching the video really brought home how much we all customize our Emacsen. Since he was using a stock install, he didn’t have things like minibuffer completion for file names and commands. It seemed painfully slow compared to how we work when we have something like Swiper/Counsel/Ivy or Ido/Smex installed.

My major complaint is that he used “window” and “frame” interchangeably. That distinction is confusing enough for n00bs without adding to the entropy in an introductory video. On the other hand, the production values for the video are excellent. It was very professionally done, including seamless switching between macOS and Windows.

If you’re an experienced Emacs user, the video probably won’t tell you anything you don’t already know but it’s an excellent resource for beginners. The video is a few seconds over 52 minutes so you’ll have to schedule time for it.

Posted in General | Tagged | Leave a comment

Magit Log for a File

Here’s a really nice tip from Wilfred Hughes’ Emacs Command of the Day Twitter feed:

This is just the thing if you need to examine to the commit history for a particular file. I ran it on one of my oldest files in Git (9 years) and could see all the changes in a buffer of only 161 lines instead of trying to pick them out from the thousands of lines in a full log listing.

Take a look at the documentation to see some additional capabilities of the command. You can, for instance, select a region in the current buffer and the command will show only the commits that affected those lines.

You can, of course, do the same thing interactively from the Magit menu but not as easily. If you find yourself needing to examine the commit history of a single file (semi-)regularly, it’s worthwhile remembering the magit-log-buffer-file command.

Posted in General | Tagged , | 1 Comment

Happy Birthday Smartparens!

Fuco1 writes that today smartparens is 5 years old. To celebrate, Fuco1 has released Version 1.11.0. Over the last 5 years, smartparens has become a ubiquitous and very popular package.

In the unlikely event that some Irreal reader is not familiar with smartparens, it’s a replacement for paredit that is useful outside of the Lisp world. Take a look at the README for the details. The TL;DR is that it provides paredit-like functionality for other languages.

Paredit’s central idea is that it forces you to maintain a syntactically correct Lisp program by enforcing matching parentheses and quotes. Smartparens can do that too but you can also choose to run it in non-strict mode that makes dealing with other languages (and plain text) easier.

If you haven’t tried it out, you really should. It brings the benefits of paredit to all of your buffers. If you aren’t already a paredit or smartparens user, you need to fix that. Paredit, especially, can be hard to get used to but the benefits are worth the effort. In Lisp, especially, it serves as an on-the-fly error checker.

Posted in General | Tagged | Leave a comment

Org 9.1.3 Is Out

Bastien tell us that there’s a new Org mode (a bug fix) out:

Just before writing this post, I updated my package repository but the new Org is not yet there. I’m sure it will be available in Melpa soon.

Posted in General | Tagged , | Leave a comment

More on ed

Last month I wrote in amazement that there was someone who (still) liked using the ed editor. If you’re coming in late, ed is a line editor that was used extensively by the early Unix developers. That made a lot of sense when the input device was a teletype but, in my opinion, makes no sense at all in today’s world. I say “in my opinion” because, as I pointed out in that last post, at least one person disagrees.

Either serendipitously or as a case of the Baader-Meinhof phenomenon, a thread on that very subject recently appeared on the Unix Heritage Society mailing list. In it many people wax nostalgic for ed and even the more horrible TECO editor. A surprisingly large number of them report still using it as an everyday tool. Ed has lived on mostly as an editor of last resort for fixing Unix systems that can’t mount the normal file systems that contain things like vi or emacs. Some folks, though, refuse to give it up.

I have a hard enough time trying to understand why anyone would prefer editors other than Vim or Emacs so a preference for ed makes no sense at all to me. But as they used to say back when ed was the Unix editor, “Different strokes for different folks.”

Posted in General | Tagged | Leave a comment

The Case for RSS

Recently, I stumbled across a couple of posts about the virtues and superiority of RSS. I was a little surprised because it seems like a no-brainer to me. What’s the competition? Facebook and G+? Those are systems for harvesting your private information and in any event filter what you see in a way that might not match your preferences.

What about Twitter? No one knows what Twitter’s for but it appears to be mainly a platform for people with a loose grasp on reality to express—and express and express—their political opinions.

The sweet spot for RSS, I think, is following a blog that posts every few days or perhaps even more irregularly. That strategy saves me a lot of time: rather than check a blog for a post that might not be there, I just let the post come to me. For blogs that publish once or more everyday, I simply check the blog once a day. There’s no reason to clog up my feed with a bunch of posts that I know will be there.

The other big question for RSS is what reader to use. For me, that’s also a no-brainer. Even if I didn’t prefer to do as much as possible in Emacs, I’d still use elfeed. I like its search features and the fact that I can search for old posts. Even so, me use of elfeed is pretty elementary. Take a look at Mike Zamansky’s three posts on using elfeed [1, 2, 3] to get an idea of what can be done with it.

Posted in General | Tagged , , | 7 Comments

A Small Swiper Trick

Over at the Emacs reddit, g00eykabl00ey shares a “swiper trick.” He gives an example of the trick where he wants to check the spelling of “Dostoyevsky,” which appears elsewhere in the buffer. To find the previous use—and its correct spelling—he starts a Swiper search with “dos.” That will bring up every occurrence of “dos” in the minibuffer. You can move up in down in the minibuffer (scrolling if necessary) and as each line is highlighted, the buffer being searched scrolls to that instance of the search term. If you type Return, the point is moved to the instance that is highlighted in the minibuffer. But if you quit Swiper (with Ctrl+g, say) the buffer is unchanged but you’ve seen the correct spelling. Notice that this same trick is useful anytime you want to see some term in context, a variable definition say.

I would have thought that this was pretty obvious but judging from the comments maybe not. I don’t keep track but I wouldn’t be surprised if half of my uses of Swiper are like this. I quit out of it as often as I complete the search by moving to the target. Tricks like this are why I say that Swiper and the associated Ivy library are my most useful package.

Posted in General | Tagged | Leave a comment

The NSA and Their Lost Secrets

The New York Times has a damning article on the NSA and its spilled secrets. It goes into depth as to how the Shadow Brokers have disrupted NSA operations and destroyed the morale of its employees. In a sense, nothing in the article is new news to those who have been paying attention but it is damning to see the whole thing laid out in one place.

The article ends with a discussion of the cost and ethics of the NSA’s holding on to vulnerabilities for their own use rather than reporting them to the vendors. Given the damage that the release of their “hacking” tools has caused, that’s a necessary and even urgent discussion to have.

To me, though, the biggest takeaway from the article wasn’t mentioned: Why would/should we trust the government with backdoors to our cell phones and encryption when their premier security agency seems unable to protect its most important secrets? I have no doubt at all that if they were to get their lusted after “golden keys” they would soon lose control of them and put every person on the planet at risk from criminals. That last statement doesn’t include threats from nation-state actors and the existential threat that could represent to folks like reporters and dissidents in some regimes.

Posted in General | Tagged | Leave a comment

Swapping Windows with Ace-window

By way of background, I need to remind you that I use ace-window for switching between windows. I think of it like ibuffer: it’s so much better than the default command that everyone should configure it automatically when setting up their Emacs. I have it mapped to Ctrl+x o which is convenient because it acts identically to other-window when there are only two windows.

I was getting ready to write something else for today’s post when I noticed that my two side-by-side windows were not in the usual blog writing order. My OCD immediately kicked in and I decided to swap them. The other day I was reading that you can change the default ace-window action before selecting the window to change to. By pressing m you can swap the current window with one of the others. Of course, that only works when there are three or more windows. When there are two windows it simply changes window focus immediately.

I wondered if there was a way to force one of the alternate actions so I typed Ctrl+u Ctrl+x o as an experiment. It immediately swapped the windows. I checked the documentation and discovered that if you type Ctrl+u twice before calling ace-window it will delete the current window. I’m not sure why you’d want that instead of the easier Ctrl+x k but that’s what happens.

Afterwards, I vaguely remembered knowing all this but I’d completely forgotten it. In case you’ve forgotten it too or didn’t know it, consider this a PSA. If you’re interested in what other actions you can perform when you have three or more windows, see here.

Posted in General | Tagged | Leave a comment