Typesetting Tables with Booktabs

Nick Higham, whom I’ve written about several times before [1, 2, 3, 4] is a mathematician at the University of Manchester. As an academic and book author he does a lot of publishing and, of course, one of his go to tools is LaTeX. He cares very much about the appearance of his publications so he puts in the time to make LaTeX tweaks to get things just right.

In a recent post, he talks about the Booktabs package that he’s recently started using to typeset tables. The post looks at two versions of a table from one of his books. The first uses the usual LaTeX markup and the second uses Booktabs. He says, and I agree, that the Booktabs table looks nicer and is less cluttered. In particular, the Booktabs package eschews vertical rules. That goes a long way towards making the tables look sleeker. Like Higham, I’m always inclined to add vertical rules but Org-mode doesn’t use them by default and I’ve grown used to tables without them so their absence in the Booktabs tables doesn’t bother me. Take a look at Higham’s post and see what you think.

Posted in General | Tagged | Leave a comment

PSA: How To Hotkey Into Messages in MacOS Catalina

This post will interest only Mac users so those of you who worship in another church will probably want to skip it.

I spend almost all of my tube time in either Emacs or Safari but I usually have three applications open. In addition to Emacs and Safari, I have the Messages app running in another workspace.

A Few years ago, I used to joke that I was getting in touch with my inner-teenager whenever I sent a text but these days it’s become mainstream and largely replaced email for a certain type of message. That’s especially true of Messages, which is really more like the old IM chat applications than texting. For a long time, I’ve had F9 mapped to open or switch to Messages but that stopped working when I upgraded to Catalina. That was annoying but not fatal because I could just switch to the workspace where it was the only app running.

I just saw this Daring Fireball post that explains what’s going on. With Catalina, Apple moved non-writable applications from /Applications to /System/Applications and Messages was now living in /System/Applications. Once I remapped F9 to open /System/Applications/Messages instead of /Applications/Messages, the F9 hotkey started working again.

Of course, it’s not only Messages that is affected. If you’re having a problem accessing an application after upgrading to Catalina, you should probably investigate if it got moved.

Posted in General | Tagged | Leave a comment

Claim: 95% of Users Prefer Dark Mode

Over at Polar, they’re getting a lot of requests to implement Dark Mode for their application. They claim that 95% of users prefer dark over light mode. Actually, they’re a little more nuanced than that so you should follow the link to get the whole story.

On the other hand, I, a persecuted but proud member of the light mode sect, am going to turn this into a Red Meat Friday post by speculating that the preference for dark mode is a direct application of Sturgeon’s law.

Posted in General | Tagged , | Leave a comment

Any Well Shuffled Card Deck Is Almost Certainly Unique

From Paul Graham we have this interesting fact:

We’re nerds and are used to dealing with large numbers so \(10^{68}\) doesn’t seem especially huge but let’s do a little back-of-the-envelope calculation. From Emacs Calc we learn that \(52! \approx 8 \times 10^{67}\), a slightly tighter estimate than that given in the tweet. I asked DuckDuckGo and it told me that the earth is about 4.5 billion years old and that as of April this year there are about 7.7 billion people living on it.

Another quick calculation with Calc shows us that if every person alive today had been shuffling cards since the birth of the earth, it would have required \(2.3 \times 10^{48}\) shuffles per person per year to generate the \(52!\) possible arrangements1. That means that each person would have to shuffle \(7.4 \times 10^{40}\) times a second for the entire age of the earth. Put that way, the claim in the tweet is eminently believable. Still not convinced? Suppose all the people who have ever lived (\(\approx108 \times 10^{9}\)) shuffled cards for the entire age of the universe (\(\approx 13.8 \times 10^{9}\) years). Would that make an appreciable difference on how many shuffles they would have to make per second? (Spoiler: no)

UPDATE [2019-11-29 Fri 12:09]: lets → let’s

Footnotes:

1

Assuming that each shuffle generates a unique arrangement.

Posted in General | Tagged | Leave a comment

HTML Email

If you’ve watched Perry Metzger’s Emacs Conference 2019 talk, as I hope you have, you’ll know that Metzger believes that modern Email should be carried as HTML. He wants—needs, he says—to see his colleagues emails exactly as they were written and to let those colleagues see his emails exactly as he has written them. Here’s a quote from one of his slides explaining why he no longer reads emails in Emacs:

Modern email is HTML. I need to see HTML email the way my colleagues see it. I have no choice. It’s not 1992 any more.

I can sympathize. Metzger is a technical guy doing technical work and he can’t afford to have the ideas in his communications with his colleagues mangled by the email presentation layer. Still, I really, really hate HTML emails and I’m not alone. I’m aware that at this point that’s a rearguard reaction but it’s a view held by many, even—or perhaps especially—by those in the technical fields. Metzger’s probably right but I still hate it.

Paul Graham also has a view on the issue:

I didn’t realize it until after I saw his tweet but that’s exactly how I feel. When I see an HTML email with multiple fonts and fancy formatting, I can be pretty certain it’s trash. Perhaps I need to start hanging out with Metzger’s colleagues. Or perhaps I’m just hopelessly reactionary.

Posted in General | Tagged , | Leave a comment

Perry Metzger: The Editor for the Next 40 Years

The videos from the Emacs Conference 2019 are up at YouTube. As many of you know I’m a big fan of Perry Metzger’s 2014 talk on 31 years as an Emacs user so the first video I watched was what amounted to a follow up to that talk. In Emacs: The Editor for the Next Forty Years, Metzger looks at the future of Emacs, where he thinks it’s going, and what it needs to do to remain the premier editor that it is.

As Metzger says, it’s not 1992 anymore and many of the younger hackers aren’t adopting Emacs so we need to update it to meet modern needs. Of course, as Metzger also notes, Emacs has undergone continuous development and modernization throughout its lifetime. The question then—and the theme of the talk—is what changes do we need to make to Emacs? Much of what he has to say will probably ruffle some feathers or at least be controversial but whether you agree or not his arguments are well-formed and I found them cogent.

One of Metzger’s major points is that whatever we do, it must be done incrementally. One of the problems that every proposal for significant rewrites of Emacs has to face is the fact of the huge amount of existing code written for the Emacs ecosystem (Org-mode alone is 120K lines of code). That implies, for example, that implementing a new extension language means that it must interoperate seamlessly with Elisp and use the same run-time system.

Metzger’s summary at the end of the talk lists what he thinks the most important issues are:

  • HTML rendering
  • LSP support built into Emacs
  • Modern email and PIM support
  • A safe concurrency model
  • A new extension language

The body of the talk builds the case for each of these changes and discusses how they might be achieved.

In a second video, Metzger takes questions on the talk. The questions are also worthwhile and expand on the talk. The two videos are 58 minutes and 23 minutes long so you’ll definitely need to set some time aside but if you care about Emacs this is an essential talk. The slides from the talk are also available.

Posted in General | Tagged | Leave a comment

Scimax and Reproducibility

The College of Engineering at Carnegie Mellon has an interesting article on their Web site about John Kitchin and his work on Scimax. I’ve written about Scimax several times (1, 2, 3, 4, 5, 6, 7) so longtime Irreal readers will be familiar with it. If you’re new to Scimax, it’s a package of Emacs applications to make writing scientific papers easier and, in particular, to enable reproducible research: Here’s Kitchin’s Web page on the package.

The CMU article mentions several of Irreal’s favorite topics: Emacs, Org-mode, Writing with Emacs, and reproducible research. In the article, Kitchin makes the point that if your research can’t be verified, no one can tell if it’s the truth or not. Without reproducibility, anyone can say anything and you have to take them at their word. Kitchin says that the point of Scimax is not just to make writing papers easier but to increase the level of research integrity by making its results replicable.

Posted in General | Tagged , , | Leave a comment

Emacs 27.1 Coming

Eli Zaretskii has issued what amounts to a last call for new features to appear in Emacs 27.1. He’s planning to create an Emacs-27 release branch in about a week. After that, only bug fixes for the release will be accepted.

There’s still a lot of testing and release candidates to be done, of course, but we’re getting close.

Posted in General | Tagged | Leave a comment

The Pros and Cons of a Cashless Society

Over the last month or two, I’ve written a bit about the idea of eliminating cash and moving to a digital payment system. There are some problems with eliminating all cash so my preferred outcome is merely that it be possible to handle fiscal matters digitally while keeping physical currency available for those who prefer it. Over at The Balance, Justin Pritchard has a nice article that sums up the pros and cons of going cashless and takes a quick look at what a cashless society would look like.

The advantages fall into two groups: convenience and less crime. The convenience aspect is mostly obvious. You don’t have to deal with handling, storing, and replenishing cash. It could also make international travel easier by eliminating the need to buy local currency.

The anticrime aspects are a little—but only a little—less obvious. It would certainly eliminate most armed robberies since there would be nothing to rob. It would also eliminate some non-violent crime as well. Money laundering and tax evasion, for example, would be more difficult because there would be a paper trail.

The main problem, as I’ve written before, is that a certain segment of society—poor people mostly—don’t have bank accounts and credit cards so there needs to be a way for them to buy things without cash. Another problem is what happens when the technology fails. If some natural disaster results in a loss of power for, say, a week, how are people going to buy food and other needs? Similarly, if cybercriminals drain your account, what are you going to do until things get straightened out? And, of course, that paper trail that helps prevent money laundering and similar crimes also means that we all lose some privacy.

Pritchard examines each of these benefits and concern so it’s definitely worth reading the article if you have any interest in what a cashless society would look like and why or why not you might want one.

Posted in General | Tagged | Leave a comment

Chris Wellons on PRNGs

I’ve long been an admirer of Chris Wellons’ work and have written about him many times. I almost always learn something new and useful from his blog posts so of course I take notice when he publishes something new. His latest post is about building a linear congruential pseudo-random number generator. If you know anything at all about linear congruential PRNGs you might wonder what there is to say. Quite a bit, it turns out. Although they are very simple—just the recurrence relation \(x_{n+1} = x_{n} × C + A \bmod M\) where \(x_{0}\) is the seed—properly choosing the values of \(C\), \(A\), and \(M\) is important.

A good strategy is to choose prime numbers with certain properties for \(A\) and \(C\) and Wellons shows how easy this is to do using the excellent Calc utility built into Emacs. One of the things I learned from the post was that Calc has a function for the Miller–Rabin primality test. That’s not on the Calc Cheat Sheet so I’d long since forgotten about it and always cranked up my own Scheme version when I needed to check for the primality of large numbers. Having it available in Calc is a big win, especially since I’m probably making the calculations in Calc anyway.

Like all of Wellons’ posts this one is interesting and instructive and definitely worth your time.

Posted in General | Tagged | Leave a comment