Unix As Literature

Someone has reposted Thomas Scoville’s article from 1998 on Unix as Literature. The article’s premise is that Unix (and these days, Linux) users are different from the users of other systems. That seems like a low calorie assertion but it’s his claim of how they differ that’s interesting. Unix users, he says, are over-represented by polyglots, people with liberal arts backgrounds, and generally those of an intellectual bent.

For years, Scoville wondered why that was and then he realized that one of the complaints from non-Unix people was that there is too much typing involved in using Unix. Windows people, as one example, don’t do that. They point and click and use menus to get things done. Unix people are more inclined to build pipelines out of obscurely named, tiny applications.

His conclusion is that Unix users are different because they are text oriented, like to read and write and are generally comfortable with wordsmithing. One might say, although he doesn’t, that Unix is the operating system for the literate.

Not even Scoville takes the premise all that seriously but I think it is true that Unix folks like—or at least don’t mind—using the command line, learning a largish collection of utilities, and putting them together in novel ways. It’s also true that others much prefer to have their workflows predefined and callable with a click. No typing required. It’s at least arguable that the first group is more likely to have literate interests. But read the article and decide for yourself.

Posted in General | Tagged , | Leave a comment

Ball Point Pens

What could you buy for the price of a ball point pen? No much. Not a newspaper, not a cup of coffee, and certainly not a hamburger. You can get one of the ubiquitous Bic pens for a little over 11 cents if you buy a box of 60. It wasn’t always like that, of course. When they were first introduced, ball point pens sold for the equivalent \$100–\$120 in today’s dollars.

The BBC has a fascinating history of the ball point pen that discusses the early days of the ball point and how it changed writing. If you’ve ever used a fountain pen, you understand why the ball point was so revolutionary. Fountain pens leaked ink, easily smudged, had to be refilled often, and regularly left drops of ink over whatever you were writing. All of those problems went away with ball point pens.

Marcel Bich’s genius was not inventing the ball point but in mass producing it at low cost. Between 1950 and 2006, Bic sold over 100 billion of their iconic Cristal ball points.

The article says that ball point pens changed writing forever. It’s ironic, then, that another article, this time from the Atlantic in 2015, claims that the ball point pen killed cursive writing. As regular readers know, I’d consider that another benefit of ball points. The TL;DR of that article is that whereas fountain pens encourage and make easy the forming of connected letters, ball points make that harder. I’m not sure I completely buy the premise but you can read it for yourself and see what you think.

Posted in General | Tagged | Leave a comment

File and Directory Local Variables

David Wilson over at the System Crafters Youtube channel has a useful video that discusses file and directory local variables. File local variables are Emacs variables that are specific to a particular file. A common use is to set the major mode of a file. You can do the same thing on a directory-wide basis with directory local variables.

Local variables are very useful but I’ve always had a hard time remembering the exact syntax. I almost always use the property line at the head of the file for file local variables and Wilson shows how to edit those by hand but the nice thing is that you don’t have to remember the syntax. You can use the command add-file-local-variable-prop-line to add a local variable to the property line and it will even add the property line itself if it doesn’t already exist. If you use the alternate syntax that puts the variables at the end of file, you can use the Emacs command add-file-local-variable to add a variable. There are also commands to delete variables although you can, of course, simply edit them out by hand. Local variables do not take effect immediately after being set. You have to reload the file or run the command normal-mode. I didn’t know about normal-mode so that alone made the video worthwhile for me.

Wilson shows a very nice example of using local variables to arrange for a file’s Org-mode Babel source blocks to be evaluated each time the file is saved. This applies to the single file only so it’s very convenient.

If you’d like to apply a set of variables to a group of files—a project, say—you can use directory local variables that will take effect for each file in the directory. The syntax for directory local variables is even more complex so you will almost certainly want to use add-dir-local-variable to add them and delete-dir-local-variable to remove them.

Wilson’s video also covers some of the finer details of using local variables and is definitely worth watching. The video is 37 and a half minutes long so plan accordingly.

Posted in General | Tagged | Leave a comment

Another Org Workflow

Wai Hon has thought carefully about his workflow and how he can leverage Org-mode to make it as efficient and seamless as possible. He’s concerned mostly about task management so of course Org-mode is a perfect fit. He’s published a blog post that describes his workflow and his rationale for the choices he made.

He begins by listing the principles that he believes should govern his workflow. These include

  • Be discriminating in what gets added as a task.
  • Not every task needs to be completed.
  • Minimize the number of “active” tasks, that is, those that are currently being worked on.
  • Make deciding what task to do next as easy as possible.

The rest of his post describes how he uses these principles to build an effective Org strategy. Some of the details are interesting so it’s definitely worth taking a look at his post but there’s nothing that an experienced Org user will find surprising. An important part of the process is that he has a strict procedure for reviewing his tasks, deciding what to do next, and reviewing the results.

If you’re looking for ways that Org can help you get organized, take a look at Hon’s post; it’s got some good ideas that may help you out.

Posted in General | Tagged , | Leave a comment

Reproducibility

I’ve written several times about the reroducibility crisis. That crisis is the fact that an astoundingly large percentage of scientific experiments can’t be reproduced by other researchers. That, of course, calls into question the validity of the original results.

My traditional poster child for this is Psychology where the irreproducibility rate is around 40–50%: essentially a coin toss. But that’s Psychology and for most studies it doesn’t matter much whether the results are right or wrong. Sadly, the problem is much more serious:

If you click on the tweet and follow the thread, you learn, among other things, that only 11% of cancer studies are reproducible. 11 percent! That’s not only shocking, it’s terrifying. The Nature article that Lehmann refers to is here.

Posted in General | Tagged | Leave a comment

The Trial

It’s like something out of Kafka. C. awoke one morning to find that after 15 years, all of his Google accounts were locked. He’d been accused of violating the terms of service. What violation? They wouldn’t tell him. He didn’t think he’d done anything wrong but since the charges were secret, how could he know? All he knew what that all of his data was unavailable. The link above has other, similar stories.

It’s not like these people haven’t been warned. There’s story after story about people having their accounts locked for some unspecified transgression. Sometimes, if they make enough noise, Google will admit that, oops, there was a mistake. They’re sorry. The account has been restored. Usually, the victims just lose their data.

I’ve stopped feeling sorry for these people. The warnings were there, screaming from all sides as Pink Floyd put it, but they chose to ignore them and believe that since they weren’t doing anything wrong, everything would be okay. Until it wasn’t.

I’m a fan of Uses This, a series of short interviews that ask various nerdy people what they do and what hardware and software they use. In interview after interview I see people proudly proclaim that they have their whole life in Gmail, Google Docs, Google Drive, and the rest of it. I cringe every time. These people have a tiger by the tail but believe this is fine.

Let me say it again. Do not commit your data to any system you don’t control. Keep a copy of everything that matters on a machine you physically control and make sure it’s not in a proprietary format. As you all know by now, I live an almost exclusively digital life but have no trouble keeping a copy of everything important on my laptop. You can too. You just have to abandon your belief that Google or whoever will always be there for you and take control of your own life. Because that’s what all that data represents: your life.

Posted in General | Tagged | Leave a comment

Unix Pipes

This post is a blast from the past \(\times 2\). One reason it’s a blast from the past is that it discusses the Unix V6 code. The other reason is that it discusses some of the code that first helped me understand what was going on with Unix.

One of the real wins in Unix is the notion of pipes. Not even Ken Thompson or Dennis Ritchie understood this at first. It was Doug McIlroy, who insisted that the ability to link processes be implemented, who was responsible. One of the things that everyone in the labs say about them is that they were all astounded how quickly the ability lead to a whole new way of thinking about computation. Once pipes were implemented, it was almost trivial to make applications talk to each other and build up the modern notion of pipelines.

The thing about pipes is that despite their power, they have a fairly simple implementation. Abhijit Menon-Sen has an illuminating post that explains how pipes are implemented. If you go through his post, you will see that there’s not that much code in the pipe implementation and that it’s pretty easy to understand. I started with the V7 code base but it’s not much different and after I understood that, most of the other things in the kernel seemed to come easily.

Since the early days, there have been alternative implementations. BSD used Unix domain sockets for a while and later AT&T Unix versions built them on top of the STREAMS mechanism. BSD, at least, found the socket implementation too slow and reverted to the traditional mechanism. Linux, of course, never implemented the STREAMS paradigm so most extant Unices are using the traditional implementation.

If you read and understand the pipe implementation code you will find that you understand many of the important Unix kernel mechanisms and will be able to understand the rest of the kernel fairly easily.

Posted in General | Tagged , | Leave a comment

James Bond

In the end, there can be only one.

Posted in General | Leave a comment

The Map

Although I’ve never lived in New York City, I love being there, have family who are lifetime New Yorkers, and visit regularly. One of the things I love about the city is that I can walk to most places I want to go. Of course, I mostly stay in Manhattan when I’m there and that means I seldom need to take the subway and don’t know the system the way a New Yorker does.

The MTA system is large and complicated and can confuse even residents. One of the problems is the system map. There have been several iterations of the subway maps using different layout philosophies but none of them seemed to work very well.

Recently, New York in conjunction with the digital agency Work & Co have produced a new digital, real time map that has different layouts as you zoom in, shows up-to-date schedule changes, and even shows the locations of the trains. The map is online so you can see it from anywhere in the world by going to https://map.mta.info.

The map and its creation is beautifully described in a 10 minute movie by Gary Hustwit. Unless you do this type of thing for a living you’ll probably be surprised at how difficult the project was. After all, what could be so hard about producing a map of a subway system. Watch the video and find out. It’s very illuminating.

Posted in General | Tagged , | Leave a comment

Taking Math Class Notes With Emacs

A year and a half ago, I wrote about Gilles Castel’s video on taking math class notes. I found his workflow astounding. He was able to take LaTeX notes in Math class at speed. By “at speed” I mean he was able to keep up with the instructor. If you’ve ever written in LaTeX you know that Castel’s feat is pretty impressive. His secret sauce was the Vim UltiSnips snippets package.

At the time, I speculated about doing the same thing with AUCTeX and yasnippets. Yasnippets aren’t as powerful as UltiSnips but I felt Castel’s workflow could be more or less translated to Emacs.

I just saw this post by karthink that explains how he does the same thing in Emacs. His secret sauce is AUCTeX, Yasnaippets, and CDLaTeX. He doesn’t have a long video like Castel’s but there are some shorter GIF animations that show his system in operation. The real winner here is CDLaTeX, an Emacs package written by Carsten Dominick, that allows the fast and easy entry of LaTeX input. I didn’t know about CDLaTeX but it turns out to be really useful. You can use it anywhere in Emacs but there’s also a special interface for it in Org-mode.

If you’re like me and need to write occasional mathematics in Org, it’s just what you need to make it as painless as possible. It even has a which-key-like hinting system so you don’t need a cheat sheet to get going. Take a look at karthink’s post or the Org manual to see how to enable it.

If you’re taking mathematical notes or even if you merely need to write some occasional mathematics, you should definitely take a look at his post. There’s also a pointer to some of the snippets he uses.

Update [2020-11-05 Thu 14:02]: ACUTeX → AUCTeX.

Posted in General | Tagged , | Leave a comment