Two Videos on Early Unix

I just came across some old videos from AT&T about Unix that are worth taking some time to watch. I thought I had written about them before but I couldn’t find any mention of them either locally or on Irreal itself. In 1982, Unix had been around for a bit over a decade, had matured quite a bit, and was being used throughout the Bell system as well as other places. That year, Bell Labs produced two short films, The UNIX System: Making Computers More Productive and The UNIX System: Making Computers Easier to Use. They cover the same material and even use some of the same sequences but it’s still worth watching both. AT&T says the first was aimed towards software developers and computer science students. The second was for programmers specifically.

I really enjoyed seeing some of the original Unix developers including an impossibly young Brian Kernighan but also Thompson, Ritchie, Steve Johnson, Lorinda Cherry, John Mashey, and Al Aho. They’re all delightfully nerdy as they describe Unix and how it makes developers’ lives easier.

At one point in both films, Kernighan builds a spell checker by piping together a series of existing programs to do things like splitting text into one word per line, sorting, eliminating duplicates, and checking against an existing dictionary. What was interesting is that although the same commands (more or less) exist today, they had different names. Kernighan used a program called makewords to split the text into words while today we’d probably use tr. What we now know as uniq as called unique and the functionality of comm was implemented in a program called mismatch. Nonetheless, you could build the same pipeline today with any Unix system using the modern versions of the programs Kernighan used.

If you enjoy seeing how things were early in Unix’s life and would like to see what the early researchers looked and sounded like, it’s definitely worth spending a bit of time watching these videos. The first is about 27 and a half minutes and the second is about 23 and a half minutes.

Posted in General | Tagged | Leave a comment

The Emacs Commune

Someone posted a chapter from Sam Williams’ book Free as in Freedom (online here), that discusses the early history of Emacs. The chapter, The Emacs Commune, is full of things I didn’t know about how Emacs evolved from the TECO editor.

We all know that Emacs started as a set of macros to the TECO editor (hence Editing MACroS) but there’s a lot more to the story. In the first place, the choice of the name Emacs involved more than just the obvious mnemonic. The choice was, in fact, chosen for efficiency reasons. You can read the chapter to see what that was.

You may also have heard that Guy Steele played an important role in the development of Emacs. That’s true, and, in a way, he started the whole thing, but the driving force was always Richard Stallman.

If you’re an Emacser, you owe it to yourself to take a look at this chapter if only so you’ll know where the editor that we love and depend on came from. Even early on, lots of people contributed, if only in the form of their own TECO macros. It turns out that the early standardization of those macros—in what was later to become Emacs—presented a political problem for Stallman. Read it and become enlightened.

Posted in General | Tagged | Leave a comment

HTTPS Is Easy

Troy Hunt, whom I’ve written about many times, has performed a public service by putting together 4 simple videos that show how easy it is to implement HTTPS on your site. The link takes you to a blog post that discusses all this but the actual videos are on a separate site, httpsiseasy.com.

You can get security that’s stronger than the typical bank site security with a little more than 5 minutes of work. It turns out you can do all of this and more for free. As Hunt explains, CloudFlare has a free service that allows you to easily do all this without changing your hosting provider.

Head over to the httpsiseasy.com site and watch the videos. The four of them together take a little less than 20 and a half minutes to watch. You’ll see how easy it is to secure your site. Even if, like Irreal, there’s nothing on the site worth securing, you’ll protect your users from malware and make it harder for the nosey parkers to peek at what you’re doing.

Posted in General | Tagged | Leave a comment

An Emacs Interface to the macOS System Dictionary

As I’ve said many times, I consider abo-abo’s define-word one of my most useful packages. I use it several times a day. If you’re looking for a dictionary that ties in seamlessly with Emacs, you should take a look at define-word.

Some people may be put off by the fact that define-word leverages the Wordnik dictionary site to get its definitions. As I noted in my post on powerthesaurus, I’ve used define-word since it was announced (over 3 years ago) and have never had a problem with its depending on a third-party site. I guess that if I lost or didn’t have connectivity for some reason, I could just use the macOS system dictionary but I’ve never had to do that.

For any macOS Emacs users who are worried about such things, Xu Chunyang has written a package to query the macOS system dictionary from Emacs. I am, as I said, perfectly happy with define-word so I haven’t installed osx-dictionary. I could, I suppose, install it as a backup system in case I don’t have connectivity but, at least at this point, it doesn’t seem necessary.

But don’t let my preferences sway you. If you’re looking for an easy way to access the macOS system dictionary from Emacs, you should definitely take a look at Xu’s package.

Posted in General | Tagged | Leave a comment

Literate Programming Using Org Babel

Gregory Stein has an excellent post on Literate Programming with Org-Mode. Despite the title, it’s really more about leveraging Org Babel to create literate documents that contain notes, code, and results. This is, of course, the same area that Howard Abrams covered so well with his Literate DevOps post and video and Stein mentions Abrams work but also adds some material that I wasn’t familiar with.

In his section on working with code blocks, Stein covers how to set parameters that are specific to a language. That’s not useful for individual code blocks, of course, but it’s handy for file-global settings in, say, the :PROPERTIES: drawer when the file contains code from more than one language. He also shows how to enable the asynchronous execution of the code blocks using the ob-async package.

Finally, Stein offers an extended example of setting up a Python virtual buffer, If you program in Python with Emacs, that alone makes his post worthwhile.

Stein’s examples are a little less complex than Abrams’ so his post is a nice introduction to the subject and should probably be read first if you haven’t already read Abrams’ post and watched his video. This is really useful material that’s sure to give you plenty of good ideas; I recommend reading both Stein’s and Abrams’ posts and, of course, watching the video.

Posted in General | Tagged , | Leave a comment

Howard Abrams on Capturing Data to the Current Task

Howard Abrams has a very nice post in which he talks about how he uses Org capture in his workflow. Most of us are familiar with Org capture and the use of templates to store data in some Org file. I use them all the time and they are a critical part of my workflow.

Abrams’ post is about how he sands down the friction points involved in the process to make capturing data as painless as possible. His main trick is to use the currently clocked task as the destination for his captures. One of the things that adds friction to the capturing process, he says, is the need to determine where the captured data should go. It turns out that you can make the currently clocked task the destination so that the data will automatically go to the Org file (and headline) you’re currently working with.

With that idea in mind he created a template to move the highlighted item to his target Org file. That’s pretty nice but there’s still the distraction of creating and seeing the Org capture buffer. He solves that by creating a couple of templates that just store the selected data without bothering with a capture buffer.

Next, he considers capturing code and the metadata (such as file name and location) that goes with it. This requires a bit of Elisp but is pretty simple and easy to understand.

Finally, he thinks about capturing data that is not in an Emacs buffer. He wrote a shell script that you can pipe data into and have it capture the data and store it in the currently clocked task. That’s very handy when you want to capture the data from some external task or pipeline. He also wrote some scripts (particular to macOS) to scrape data and its formatting from a browser page.

Abrams post has a lot of useful ideas and is worth taking a look at. You may find some or all of them useful in your own workflow

Posted in General | Tagged , | Leave a comment

Get Your News From Blogs

Lately, it’s become obvious that just about every “official news source”—even tech sites—are in it only for the clicks. Journalists have been ignorant and biased for a long time, of course—see Michael Crichton’s hilarious explanation of the Gell-Mann Amnesia effect or Ben Rhodes’ description of the vaunted White House Press Corp as literally knowing nothing—but they, or their editors, no longer seem to care if their stories are even remotely correct. It’s not that the advertising is necessarily bad, it’s that the attached content has no value and, in fact, is most often ludicrously wrong.

All this occurred to me while I was reading one of the Macalope’s frequent take downs of tech pundits’ prognostications. Why, I wondered, do they keep making the same obviously wrong predictions? (“The iPhone X is a failure” is their latest trope even after Apple’s last quarter’s results proved that to be nonsense.) Why would they continue to embarrass themselves with predictions that any sane person knows are silly?

Then I realized that they don’t care about the truth or reasonableness of what they’re writing. It’s all about making some outrageous claim that will infuriate Apple fans (or give sustenance to Apple haters) encouraging then to click through in order to capture their eyeballs. If it were just Apple news we could shrug and take comfort in its fueling a never ending flow of Macalope humor but if you look closely, you’ll find that it’s all like that.

If you look at almost any news site, you’ll see an incendiary headline fronting a story that doesn’t make much sense. Either it’s obviously wrong or it doesn’t say anything at all. Once you’ve clicked through, their job is done and there’s no sense wasting effort on the story itself.

So what to do? One solution is to look for news in blogs, especially non-monetized blogs. There are a couple of problems with that. Sure, those of us who blog have our biases too but at least they’re ours and we’re mostly up front about them. More importantly, we’re not getting paid to push them. If you look at a variety of blogs, you’ll have a reasonable chance of getting a balanced viewpoint. More worrisome, is the fact that most blogs—not even Irreal—can afford a cadre of reporters to gather the news so they have to rely on the traditional news sources. But, as suggested by Crichton’s quote, there are always folks who are experts in the particulars of any given story and if you read a reasonable selection of blogs you’ll get their viewpoint.

That’s not ideal, of course. We’d like to be able to read a single paper or site and get reliable news. Sadly, such papers and sites no longer exist.

Posted in General | Tagged | Leave a comment

Xah Lee on Frames vs. Window in Emacs

Xah Lee has an interesting post that I hadn’t seen before even though it’s originally from 2014 (since updated) and mentions a post of mine. The post is a discussion of whether it’s better to have a single large Emacs frame with multiple windows or multiple smaller frames. Lee makes the case that it’s more efficient to have two window-sized frames rather than running Emacs in full screen mode and having two windows in the frame.

When Lee says something about efficiency with respect to Emacs, it’s worth paying attention. In the end, you might not agree but Lee takes this stuff seriously and generally studies the alternatives to determine which is best. If you haven’t read his post, you should do so now so that you understand the context.

Lee’s argument, as I understand it, is that switching between windows in a single frame is suboptimal because various Emacs operations will destroy your windows configuration and using something like winner-mode to restore your window configuration is too much trouble. He prefers to let the OS handle the sizing and position of frames and configures a set of convenient keys to switch to Emacs and move between frames. He then feels free to split either frame temporarily into multiple windows and restore to the single window, presumably with something like Ctrl+x 1, when he’s done.

I disagree with his workflow but not emphatically. I think the multiple frame idea has merit but I don’t see how it’s better—or even as good as—multiple windows. If you divide a frame into more than two windows, you’re still going to want an easy way of switching between them. As I wrote in the post that Lee linked, ace-window is the ideal way to do that. And I don’t see how using winner-mode to restore your default window configuration is any harder than using delete-other-windows.

Still, most of this boils down to individual preference and there’s not really a right or wrong answer. All that said, my actual workflow is not that different from Lee’s. I have an OS key to switch to Emacs which is usually running in full screen mode with two windows. Sometimes I need to split one of those windows temporarily and when I’m done I just call winner-mode to restore things. Sometimes (usually when I running elfeed in a full screen window) I do fire up another frame. It opens in full screen mode but doesn’t, of course, show the original frame. When I’m done, I destroy the new frame with Ctrl+x 5 0 and I’m back to where I was.

I could easily use two frames with this method but then I’d have to worry about two ways of switching to the window I wanted rather than just using ace-window. What do you think? In particular, if you’re using the two frame method, what has been your experience?

Posted in General | Tagged | Leave a comment

Zamansky 49: Mu4e-conversation

Mike Zamansky has another video in his Using Emacs Series up. This time he talks about mu4e-conversation, which I wrote about previously. Mu4e-conversation is a package that makes reading email threads easier. It has two modes, (1) linear mode that displays every message of the thread in a single buffer that you can, say, search them all at once or just scroll through the message and (2) Tree mode that displays the messages in an Org mode tree.

Zamansky demonstrates both modes so you can get an idea of how it works. Like him, I haven’t decided yet whether it will become a permanent part of my workflow. As I said in my original post, threading in my workflow comes into play only when I’m reading posts from a mailing list. Otherwise, the threads are too shallow to need any special presentation.

One thing that I—and apparently Zamansky—haven’t figured out is how to get the individual messages colored by sender. They all appear in my normal display colors. I did a quick check of the code and it looks as if it should be working but I haven’t really researched the problem. I think that’s a very attractive feature of mu4e-conversation so I’ll probably spend a bit more time on it when I get a chance.

In the meantime, take a look at Zamansky’s video and see if mu4e-conversation makes sense for your workflow. The video is just a bit over 6 and a half minutes so it should be easy to fit it in.

Posted in General | Tagged , | Leave a comment

Klipse

I was looking through my file of blog ideas and found an interesting post about the Klipse plugin. The idea is that Klipse allows a blog post—or any Web page—to contain live code examples. Live code examples are just code snippets but with the additional feature that the reader can edit the example and have the result automatically recalculated.

This type of capability is ideal for language tutorials. Here’s an Interactive overview of Scheme’s semantics that illustrates the idea. It’s really easy to build posts like this. You can take a look at the Klipse plugin link or check out the README at the Klipse GitHub repository for the details.

Klipse supports:

  • Javascript
  • Clojure
  • Ruby
  • C++
  • Python
  • Scheme
  • Common Lisp
  • PHP
  • BrainFuck
  • JSX
  • EcmaScript2017
  • Google Charts

All the examples show retrieving the plugin from the Klipse repository but you can also host it locally if you prefer.

Posted in Blogging | Leave a comment