Ritchie’s Thesis

There’s a substantial body of lore associated with Dennis Ritchie and his work. One of the minor stories involves his PhD or lack of it. The most common story is that Harvard refused to award Ritchie his degree because Ritchie objected to paying a thesis binding fee. I’ve always accepted that story but it never made sense to me. Having gone through the process and pain of writing a PhD thesis myself, I can’t imagine giving up the prize over a triviality. But, of course, Ritchie was unique in many ways.

That story—right or wrong—is the least of the mysteries around his thesis. A recent paper by Brailsford, Kernighan, and William A. Ritchie examines the mystery of how Ritchie “typeset” his thesis. The scare quotes on typeset are because this was in 1968 and the only realistic way producing hard copy for a thesis was with a typewriter. But the extant copies of the thesis, which was highly mathematical, has aspects which seem impossible to produce with a typewriter. It is in any event a tribute to Ritchie’s attention to detail.

Brailsford, of course, has a video about the mystery but to really understand what an astounding feat accomplishing the typesetting was, you need to read the paper. Note, especially, how Ritchie centered the Roman numerals on his lists. Brailsford and Kernighan are experts on this sort of thing and even they can’t figure it out.

William Ritchie is Dennis’s brother and has a website on the mysteries of his brother’s thesis. It’s also worth looking at.

To really understand what’s going on and why the physical presentation of the thesis is so astounding, you definitely should read the paper. It’s 10 pages but very interesting. The paper and the mysteries it examines tickles the intersection of several of my interests and I really enjoyed it. If you’re interested in this sort of thing, perhaps you will too.

Posted in General | Tagged | Leave a comment

On The Fly Command Repeat

As many of you know, I spent many years as a Vi/Vim user. A bit more than 15 years ago, I moved to Emacs, mostly I think, because I was moving a lot of my coding to various Lisps and loved the idea of an editor that was programmed and extensible in Lisp. As I’ve written before, when I moved to Emacs I went all in learning and internalizing the native Emacs key sequences rather than fall back to Vim by using Evil. I’ve never regretted that decision but one thing I do miss is the easy Vim command repeat bound to the . key.

Emacs has its own repeat commands but the situation is complicated by Emacs’ complex commands. One nice feature in Emacs, though, is that some commands with a long prefix can be repeated without retyping the prefix on subsequent invocations. Being Emacs, it is, of course, possible to set up your own repeatable bindings but this has to be done in advance.

Karthik Chikmagalur has an interesting post that shows how to build and invoke a repeatable key sequence on the fly. He does this by cleverly leveraging the Ctrl+h helper function that is called when you type Ctrl+h after inputting part of a binding. The only downside—if it is one—is that you have to type Ctrl+g to get out of the repeat mode.

If you’re like many (most?) Emacsers and are striving to be as efficient as possible, this may be something you’ll like. It requires only eleven lines of code so it’s easy to add to your init.el.

Posted in General | Tagged | Leave a comment

Web Scraping With Org Mode

Beetle_b has an interesting short post, about scraping a Web site, that outlines a technique that may be useful to some Irreal readers. The TL;DR was that he wanted to capture and print the content from a Web page that had links to several subpages. There were about 20 subpages and they all had ads and lots of wasted space on them. That meant that he’d have to continually print pages and would have a lot of wasted space on each page.

His solution was to first capture the links (with the judicious use of a keyboard macro) and then use alphapappa’s org-web-tools to capture the content at each link (without ads) and insert it into it own Org heading.

Many of us try to remain digital as much as we can so we have no need to produce hard copy but most of us have occasionally wanted to capture and preserve the content from a series of Web pages. Beetle_b’s method is an easy way to do that but, of course, you’re going to need to load org-web-tools first. It’s definitely worth a couple of minutes to read and bookmark his post against the day when you want to capture some content.

Posted in General | Tagged , | Leave a comment

Torstein Johansen on Dumb-jump

Torstein Johansen has a short video on one of my favorite navigation packages. These days, everyone appears to want Emacs to offer the completion of those LongAndStupidFunction.names beloved by Javanistas and others. You can’t blame them, of course, but that means running LSP or Eglot. Fortunately, the languages I use don’t have sesquipedalian function names or calling sequences so I’ve never bothered setting up LSP or Eglot.

One thing I do like to do, though, is jump from a class or function reference to its definition. The traditional way of doing this is with a TAGS file but means keeping the TAGS file in sync as you make changes. That’s okay for a static project but doesn’t work well when a project is under active development.

My long term solution to this is dumb-jump. I’ve been using it for the last six years and wrote about it here. It really is the sweat spot for me. Johansen’s video discusses dumb-jump and how he uses it. He discusses something I didn’t know about. Apparently there is now an integration with the Xref framework. That’s nice because it gives you a consistent way of dealing with cross reference navigation. I use the older style that defines custom keybindings. Here’s my configuration

(use-package dumb-jump
  :ensure t
  :bind (("M-g o" . dumb-jump-go-other-window)
         ("M-g j" . dumb-jump-go)
         ("M-g b" . dumb-jump-back)
         ("M-g q" . dumb-jump-quick-look)
         ("M-g x" . dumb-jump-go-prefer-external)
         ("M-g z" . dumb-jump-go-prefer-external-other-window))
  :config (setq dumb-jump-selector 'ivy))

in case you want finer control but I like the Xref integration that provides the common operations in a consistent way.

Regardless, dumb-jump is a really useful package. Johansen’s video is only 7 minutes long so it’s well worth a few minutes of your time.

Posted in General | Tagged | Leave a comment

Red Meat Friday: What Are They Expecting?

This probably isn’t really a Red Meat Friday item—unless you’re a dentist—but it is, nevertheless, pretty funny and perfectly captures a common but annoying occurrence at the dentist’s office:

Because it’s unlikely to enrage anyone, you can take this as a break from Irreal’s usual fury-inducing Friday post.

Posted in General | Tagged | Leave a comment

A Short Rant on Passwords

It’s been a while since I’ve grumped about the dumb password rules you find on some sites. They have limits on password length, insist on some custom requirement concerning the number of digits, capital letters, and special characters, or, worst of all, they restrict the character sets you can choose from.

Anytime I see “you can use only the special characters…” I know that the site is insecure and probably storing the passwords in plain text, Why else would you care? The sad thing is that this is a solved problem. We KNOW how to hash and salt passwords and there are turnkey solutions in almost every language used to build Web sites that do so with a simple call. There’s no excuse for the moronic homegrown schemes that do nothing but decrease security.

If you want to enrage yourself, take a look at Dumb Password Rules and the list of sites and their rules. Again, there is no excuse for those stupid artificial restrictions. Anytime you see a limit on password length or a limit on the characters you can use, you can be sure the site isn’t doing the right thing. Sites that do these things should be shunned and shamed until they clean up their act.

But, of course, they won’t be. Instead they’ll continue to promulgate non-sensible rules that serve only to make you and their site less secure. And we’ll all suffer.

Posted in General | Tagged | Leave a comment

Dashes

It will not be news to Irreal partisans that we here at Irreal are enamored of em-dashes. Some say that they are seldom used but I love em-dashes and probably tend to overuse them. Back in the dark ages before ubiquitous personal computers there were typewriters and they had only one type of dash: the hyphen. There was a convention of using a double hyphen for an em-dash but most folks who weren’t professional writers or typesetters had never heard the term “em-dash”.

Until I learned TeX, I wasn’t aware that there are, in fact, three types of dashes: hyphen, en-dash, and m-dash. The TL;DR is that you use a hyphen as a break within words at the end of line, or to connect compound words; the en-dash to separate numerical ranges; and em-dash as a clause separator, sort of like a comma.

The rules are, of course, nuanced and the above doesn’t capture them precisely. For those of you who want to better understand which to use and when, Mister Punctual has a post on the use of hyphens, en-dashes, and em-dashes. Now that reasonable typesetting software is available to everyone, it behooves us all to learn the differences between the various dashes and when to use them.

Posted in General | Tagged | Leave a comment

Asimov’s Three Laws and the Future

I just came across this link to a 1965 short BBC interview of Isaac Asimov concerning his famous three laws of robotics. Those laws, as Asimov stipulates, are purposefully ambiguous to that he can use that ambiguity as a vehicle for his many stories that invoke them.

What struck me most about the interview was his discussion of synthetic organic matter and the possibility of robots and human beings growing closer to each other as the robots are built with more synthetic organic matter and humans incorporate more metal and plastic in the form of artificial organs. What impressed me particularly was that his vision contained echos of Bank’s Culture novels. He envisions a time when humans and robots will share a single culture although he does not foresee—or at least doesn’t mention—the extraordinary AI that the Culture’s robots, especially the Minds, are capable of. Of course, this was in 1965 and computers, let alone AI, were much more primitive than they are today.

The video is only 5 minutes, 42 seconds long yet still manages to raise some provocative points. It left me wishing it was longer but it was nonetheless very enjoyable and something I bet almost all Irreal readers will enjoy.

UPDATE [2023-03-15 Wed 13:43]: Azimov → Asimov

Posted in General | Tagged | Leave a comment

Removing Emacs Key Bindings

Once you’ve been sucked into the event horizon of your Emacs configuration, you’re always adding new bindings. Sometimes it’s for a homegrown function, sometimes it’s to configure a new package. If you longer needed one of those bindings, it’s trivial to simply remove it from your init.el or whatever you’re using.

Sometimes, though, some other package steals one of your bindings. You can either change yours or disable theirs. The question is: how do you disable a binding that’s not in your configuration?

Bozhidar Batsov over at EmacsRedux has the answer. It’s pretty simple: you simply set the binding to nil. He gives the example of paredit adding a binding the conflicted with one used by one of the REPL modes but we’ve all experienced the phenomenon. You can remove a binding globally or locally. Batsov also mentions using global-unset-key or local-unset-key to remove a binding.

Thankfully, this is not something the we have to do very often but it’s nice to know how to do it when the need arrives.

Posted in General | Tagged | Leave a comment

Using Org Mode

Aditya Athalye has a long(ish) and interesting post on how he uses org mode for writing and more. Like many of us, Athalye has used a lot of apps for keeping notes and publishing his blog and slides for his talks. He’s settled on Org for the sames reasons that many of us have:

  • It’s plain text so there’s no data lock-in.
  • It’s easily exportable to a variety of formats.
  • It has the ability to embed code with syntax highlighting.
  • It has the ability, through Babel, to execute that code and capture the results.
  • It offers a unified workflow for a variety of tasks.
  • Its Org markdown syntax is being adopted by a variety of (non-Emacs) apps.
  • It’s “local first” meaning that by default your data is held locally.

His post details how he uses Org and some of the Org features that he doesn’t use. He has no interest, for example, in using it for planning, time tracking, calendaring, or as a “second brain”. He’s content to use it for note taking and publishing.

He’s found, as have I, that Org can take over your life in the sense that it replaces most of your other applications. Sure, there’s still Email, RSS, music, and the rest but Org can subsume most of your record keeping requirements.

As I said, the post is a bit long but it’s a good example of one man’s use of Org mode and how it came to dominate part of his digital life.

Posted in General | Tagged , | Leave a comment