LaTeX vs. Word Redux

Hey, remember that silly opinion piece masquerading as a scientific paper by Knauff and Nejasmic back in 2014? It claimed that Word was much more efficient than LaTeX for writing papers. I wrote about it more than once (1, 2, 3, 4) at the time. At the risk of beating a dead horse, I just came upon some further (recent) commentary by D. J. Bernstein that seems to me to be on point.

Although he finds the paper weak on many grounds, Bernstein’s main point is that the study uses the wrong metric to measure the two systems’ efficiency. Putting aside the ludicrous notion of “realistic working conditions” used by Knauff and Nejasmic, Bernstein notes that writing the initial version of a paper is only the beginning of the document preparation process. As much or more efforts goes into revision and editing and that’s one of the places where LaTeX shines.

Bernstein begins his post with an anecdote about watching a couple of interns insert a new item into a numbered list. They did this by renumbering the following items by hand. One intern did the work, the other checked his results. That should make any Irreal reader hyperventilate. None of us, I’m sure, would do such a thing. After all, we use decent editors and typesetters that make such things easy. But the story is on point because this is exactly the type of thing that Knauff and Nejasmic ignore in their comparative study of the efficiency of Word and LaTeX.

It’s been over 6 years since I first wrote about this so it’s not too unreasonable to return for one further flogging but I hope that this is the last time that I or anyone else ever hears of this study. Except, perhaps, as a cautionary tale.

Posted in General | Tagged | Leave a comment

Phone Notifications When a Command Completes

Before we get to today’s topic, I want to point you to Mike Zamansky’s latest video on using Clojure for Advent of Code problems. Emacs appears, of course, although it’s not really the point of the video. Even so, I like and am enjoying these videos and if you admire his Emacs videos, you probably will too. Still, I don’t want to keep stepping on his videos so I’ll just note that it’s there and that you should take a look.

Now on to getting a phone notification when a command completes. Over at Medium (I know, I know) c0d3x27 has a post that shows how easy it is to arrange for such notifications using free software that you probably already have. You’ll have to set up a Telegram account and Pip install the Python Ntfy library. The post has step-by-step instructions for setting things up. There’s no real coding so it really is an almost trivial operation.

This is mostly useful for long running commands, of course, but the same idea could be easily modified for other uses. In any event, if you’re looking for a way of being notified by phone when certain events take place, take a look at c0d3x27’s post.

Posted in General | Tagged , | Leave a comment

Zamansky: More Advent of Code and Clojure

If you enjoyed yesterday’s post on Mike Zamansky’s use of Clojure and Cider to solve an Advent of Code problem, he has a couple more offerings that you’ll probably like too. Like his last video, these two consider a current Advent of Code problem and apply Clojure and Cider to their solution.

If you don’t like Clojure, the first post above also considers the Python solution in the text but not the video. I don’t know any Clojure but it’s a Lisp and familiar enough that I had no problem following along. Even if you’re a complete Lisp n00b, Zamansky’s last 3 videos do a good job introducing some of the syntax and concepts.

As with yesterday’s post, these two approach the problems in an interactive or exploratory way. You can watch Zamansky build up the solution piece by piece and even do a bit of debugging when he gets stuck at one point.

I’ve always found the fact that Clojure is hosted on the JVM off-putting because of security and resource hog concerns. Still, I really enjoyed Zamansky’s videos and felt, despite my misgivings, an urge to try it out. Perhaps I will. Clojure is a far better way of dealing with the Java environment than Java itself.

Posted in General | Tagged | Leave a comment

Zamansky on Clojure and Cider

Mike Zamansky has another video up. It’s not quite one of his Using Emacs Series videos but he says it could be as it discusses the Emacs Cider infrastructure. It’s ostensibly about day 3 of this year’s Advent of Code, and considers his solution to the day’s problem. To me, the interesting part was his introduction to and demonstration of the Clojure/Cider environment in Emacs.

Zamansky says that Cider is the best development environment he’s ever used. It reminds me of the Slime environment for Common Lisp or Geiser for Scheme. You have a REPL in one window and can enter code in another. You can try out bits of code in the code window as you enter it so Cider enables the interactive programming style that I find so attractive and useful.

Zamansky provides a nice example of the technique as he pieces together his solution to the Advent of Code problem. One nice bit is his use of a Clojure threading macro. The ->> macro that he uses doesn’t really introduce any new capabilities but it does make the code a little easier to read. I think it fits in nicely with the interactive programming paradigm because it makes it easy to use what’s already been calculated as input to another function.

The video is just short of 38 minutes so you’ll need to schedule some time but, as usual, it’s well worth watching. If you’re curious about Clojure, it’s also a nice introduction to it and Cider.

Posted in General | Tagged | Leave a comment

Repeating Commands in Emacs

One of the things that Vi/Vim does much better than Emacs is repeat commands. Pressing . in Vim repeats the last native command. It simple and easy to use and when I was a Vim user, I did, in fact, use it all the time. Its real power, I think, comes from the fact that a single easy to reach key will repeat whatever you just did.

The situation in Emacs is not as nice. If you want to repeat the last simple command (one that didn’t involve the minibuffer) you can do so with Ctrl+x z. But that’s a lot harder to type than a single period and might even be harder to type than the command you want to repeat. As a result, I never bother with it. It’s just too much trouble.

Then there’s the repeat-complex-command function that you can use to repeat a command that involves the minibuffer. Marcin ‘mbork’ Borkowski, who has a knack for discovering obscure Emacs commands, has a nice post on repeating complex commands if you want more details. It has a horrible default key binding but even if you remap it, it’s still too much trouble to bother with. I know this is true because although I wrote about repeat-complex-command four and a half years ago, I had no memory of it or ever using it when I saw Borkowski’s post.

Still, if you’re looking for a way to repeat Emacs commands, take a look at Borkowski’s post. Perhaps you’ll find the Emacs repeat commands more useful than I do.

Posted in General | Tagged | Leave a comment

The DEA Supplies Another Example

Speaking of governments supplying examples of the Iron Law of Data Collection, one of the US Government’s most notorious abusers of data collection and constitutional protections whose TLA is not NSA, has stepped up to provide yet another example. The DEA believes that they can better protect us from drug abuse by abusing our privacy and civil liberties.

In a recent RFP, the DEA expresses an interest in providing its agents “ ‘unlimited access to patient de-identified data’ on re/filled prescriptions, daily supply, payment type, dosing information and gender, among other characteristics, until at least 2025.” Of course, the “de-identified” patients’ identities would then be easily available through an “administrative” subpoena, a device that the DEA’s Inspector General found the agency has a record of misusing.

Opiate abuse is a serious problem, especially here in the U.S. and a case can be made for tracking its manufacture and distribution. That does not mean, however, that the DEA has a compelling need for the wholesale routing around in the health records of individual citizens. If they have a reasonable suspicion that a citizen has broken the law, they can get a (real not administrative) subpoena from the courts the way that law enforcement agencies are supposed to.

This case is another excellent example of the Iron Law in action. Data originally collected for use by medical personnel was appropriated for use by law enforcement and promptly abused. This RFP is the DEA wanting to abuse the data more efficiently.

Posted in General | Tagged | Leave a comment

The Iron Law and Abuse

I’ve written many times about the iron law of data collection. Briefly, it’s the notion that whenever data is collected

  1. No matter the original rationale given for its collection, new uses will be found for the data.
  2. The data will eventually be abused.

I don’t have any actual figures but it’s pretty clear that the worst offenders are our own governments. A typical example is a government taking a blood sample from newborns to screen for a dangerous genetic disease. Years later the police start accessing the data for criminal investigations. Back when I wrote the above post, I naively assumed that in the U.S., at least, this type of thing couldn’t happen. Sadly, age has disabused me of such rosy ideas.

The latest example involves the IRS buying cell phone location data from data brokers. The data is collected by, say, a weather app that needs your location to deliver the local weather. Then it gets sold to companies like Venntel that curate the information and resell it to the government. The problem is that the US Supreme Court has already ruled that significant use of phone location data requires a warrant. The IRS is buying the data from a private source to avoid fourth amendment prohibitions.

There you see it: the iron law in action. The data is used for unintended purposes and finally abused by our own government to circumvent constitutional protections. The IRS for its part is refusing to justify its actions or provide the legal reasoning it used to procure the data. In this case, Senator Ron Wyden has promised to introduce legislation outlawing this type of abuse but we can rest assured that new abuses will pop up to replace it.

Posted in General | Tagged | Leave a comment

Keyboards for Emacs

One of the most important pieces of kit in our arsenal is the keyboard. It’s easy to treat them as an afterthought but if you do a lot of typing as most of us do, the choice can mean the difference between efficiency or inefficiency and comfort or RSI.

The choice can seem daunting. There’s ergonomic keyboards with weird shapes, wireless keyboards, austere models with 87 keys and space-cadet-like models with lots of extra keys. If you’re an Emacs user you probably want function keys, a reasonably placed Ctrl key, an Alt or Meta key, and maybe even keys that can be mapped to Super and Hyper.

Xah Lee is a guy who takes all this more seriously than most. He’s spent huge amounts of time researching optimal key placements and ergonomic form factors for keyboards. He does this because he’s interested in typing efficiency and speeds but also because he does a lot of typing and wants to protect himself from RSI as much as he can.

Lee maintains a page about the Best Keyboards for Emacs. His recommendations are his opinion of course and others may reach different conclusions but, as I said, Lee has spent a lot of time thinking about the issue so his opinions are informed ones and well worth considering if you’re looking for a new keyboard. One thing for sure: you can almost certainly do better than whatever keyboard came with your system.

Posted in Programming | Tagged | Leave a comment

Cloning a Repository

My day has been consumed by yak shaving so today’s offering is just a quickie pointing you to a very interesting post from Álvaro Ramírez. In a situation familiar to all of us, Ramírez noticed that every time he wanted to clone a repository, he had to go through the same set of simple but boring steps. Of course when you’re using the world’s most flexible editor that’s a problem crying out for the obvious solution.

Ramírez wanted a solution that would extract the repository URL from the clipboard and clone it into the proper directory. That’s pretty easy to do and he shows a nice bit of Elisp to take care of the task.

This sort of thing happens to me all the time: I’ll be doing some rote chore for the \(n\)th time and suddenly realize that there’s no reason I should be doing this by hand yet again. It’s usually pretty easy to write a little Elisp and reduce the task to a key press.

Posted in General | Tagged | Leave a comment

Managing Servers with Org

Fragbot has an interesting reddit post talking about using Emacs as a standalone infrastructure that can be shared by others. The idea is that you integrate Emacs into a workflow for use by folks who aren’t normally Emacs users. He even has a link to Steve Yegge’s famous story about the Mailman application at Amazon as an example.

Dante Catalfamo has a similar story although in his case it was for personal use. Catalfamo’s problem is that he maintains several machines and VMs at a couple of remote providers as well as at his home. There’s a lot going on and it’s hard to remember what’s running where and the particulars of each machine and application.

To keep track of everything, he has a servers.org file that contains all the information. Org’s hierarchical structure is perfect for that. He has the sites as first level headers, machines under those, and bullet lists specifying the applications running on those machines. He has property drawers with information about the OS, IP address, user name and password, and other data about each machine.

Finally, he wrote a custom exporter to take the information in servers.org and produce an SSH configuration file. That’s a nice feature because after he makes a change he need merely export it to update his SSH configuration file.

Notice that in none of this is Emacs really being used as an editor. The servers.org file could, in fact, be maintained with any editor all. Of course, Catalfamo makes use of Org’s searching and organizing capabilities too but, again, Emacs is not really being used as an editor and anyone could, with a little training, take over the maintenance of the system. It’s another nice example showing that Emacs is better thought of as an environment rather than (merely) an editor.

Catalfamo’s post is interesting and well worth taking a look at if you’re an Org user or thinking of becoming one.

Posted in General | Tagged , | Leave a comment