## Emacs Survival Card

I stumbled across this Emacs survival card, which I hadn’t seen before. It’s very much like the Emacs Reference Card but seems more useful to me. Of course, you may disagree but it’s worth taking a look at it to see if you find it useful.

I don’t print out cheat sheets anymore but I do bookmark them for those occasions when I need a quick reference. I will definitely be bookmarking the survival card. At least on my Mac, survival.pdf is included with Emacs so I can use it offline and I automatically keep it up to date as I compile and install new Emacs versions.

Posted in General | Tagged | 1 Comment

## Experiencing the Old Days

Many of you know I like reading about early Unix history and how the original developers worked to implement the utilities that we take for granted today. A nice resource for this is The Unix Heritage Society and their mailing list on which some of the oldtimers share their memories.

One of the things you often see on the mailing list—either in the message body or the signature line—is that some of these folks are running old, even ancient, versions of Unix. Sometimes it’s versions as old as the 1st edition but many of the purists insist that V7 was the greatest Unix release and that it’s all been downhill since.

Much as I like reading about the history, I’ve never had the urge to actually run of the older versions for serious work. Not everyone agrees. Xorhash decided to experience a bit of life in the past by doing his document preparation on a V7 Unix system.

How do you do this? Xorhash started with Robert Nordier’s port of V7 to the X86 and using the then current Vi for editing and Nroff for formatting the documents. His post was, itself, written in Troff markup but he had to use Groff to actually typeset it because the V7 version of Troff was for the long dead CAT typesetter. If you’d like to try something like this, take a look at Xorhash’s post to see the details and how he managed to get the data into and out of V7 system.

## Apple and Targeted Ad Revenue

Here’s some good new (via John Gruber) from the fight against ad-tech and the industry’s efforts to track our every move on the Internet. The Guardian is reporting that companies perpetrating these outrages are losing hundreds of millions of dollars due to Apple’s Intelligent Tracking Protection that the company rolled out in 2017. One advertising company, Criteo, reports that its revenue is down 20% despite Apple’s Safari accounting for only 15% of the browser market.

This is an excellent start and I hope that it ends with every company guilty of these invasive techniques being driven out of business. They will have well and truly earned it. Let me state again for those of you who haven’t read my previous writings on this, I have no objection to display ads. They are the price we pay for having access to the content they support. The people who create that content need to earn a living just as we all do and ad-supported content appears to be the best model we’ve found.

What I do object to is being tracked across the Web by these companies and their running what can only be described as malware on my computer without my permission. Often that JavaScript is literal malware but even when it isn’t it’s still software running on my computer doing things I don’t approve of. It’s got to stop and if driving these predators out of business is the result, I’m fine with that.

## An Oldie but Goodie

I was looking at some old Irreal posts and stumbled across this post. It’s something that I’d completely forgotten about so I thought it would be worthwhile pointing to it again.

The TL;DR is that when using Magnar Sveen’s excellent Multiple Cursors you can narrow to the matched lines (and a little context) by calling mc-hide-unmatched-lines-mode. It’s really handy when the targets are spread out in a larger buffer because you can see all (or at least more) of the targets on the screen. Take a look at the original post for the details.

## Linux Journal on Scimax

Over at the Linux Journal, Joey Bernard has a nice article on John Kitchin’s scimax. I’ve written about scimax before but for those who came in late, it’s a collection of Emacs and Org mode tools to make using reproducible research methods for performing and writing about research easier.

If you’re doing research and especially if you’re publishing your results you really should check out scimax. A good way to see what it can do for you is to take a look at its manual or by watching Kitchin’s video

## The Em-Dash

Those of you who have been around for a while and who pay attention to such things have probably noticed that I’m partial to—probably overly partial to1—the use of em-dashes. I no longer remember for sure how it started but it’s probably something I learned Rich Stevens who had a large influence on my early writing.

I used them in this blog even when—for reasons I still don’t understand—they didn’t render correctly in the RSS feed (despite being fine in the post itself). They’ve always seemed to me to be the perfect way of setting off those interstitial remarks that amplify but aren’t really part of the main flow of my thoughts.

Considering all this, I was delighted to see that Adam O’Fallon Price has posted a lovely paean to the em-dash. Price says that the em-dash is rarely used. That’s news to me, probably because I see so many of them in my own writing. Nevertheless, he says, it’s a beautiful and useful punctuation mark that conveys subtle distinctions in meaning from the comma, colons, and parentheses that it often replaces. He goes on to give several examples of their use and the added precision they bring to the writings of such people as Vladimir Nabokov, Donald Antrim, and Emily Dickinson.

All of this is outside of the usual Irreal purview, of course, but it seemed like a pleasant Sunday interlude, nicely set off by metaphorical em-dashes from our more routine subject matter.

## Footnotes:

1

See what I did there?

Posted in General | Tagged | 3 Comments

## A Handy Calc Tip

As I wrote three weeks ago in these two posts, I’ve renewed my efforts to become semi-proficient with Calc. On the one hand, it’s not that hard. By default, it’s simply a stack based RPN calculator of the sort that I’m very familiar with from my HP calculator days. Some of the symbolic mathematics parts are a bit trickier but not very much so.

What really makes Calc hard is the huge number of commands it implements and the assignment, seemingly higgledy-piggledy, of those commands to one or two letter shortcuts. Unlike a calculator, there’s no convenient SQRT button to press: you’ve got to remember its shortcut, Q, instead. Suppose, for example, I want to factor the integer 3469394 into its prime factors 2, 17, 67, 1523. I know there’s a command to do that but I don’t use it enough to remember the shortcut—it’s k f but I only know that because I’m peeking at the cheat sheet.

Of course, all those shortcuts are bound to Elisp functions in exactly the same way that Ctrl+x Ctrl+f is bound to find-file so you can call them directly with Meta+x in the usual way. Now all you have to remember is that the command involves “prime factors” and Avy, Ido, or whatever you use will help you find calc-prime-factors. But it gets even better. The shortcut x will start the process for you by calling Meta+x and filling in the calc- part that starts every Calc command. Now to factor 3469394, you simply push it onto the stack, type x and enough of prime factors for command completion to do its thing.

The power in this is not that it saves some keystrokes but that you can easily find a function whose obscure shortcut you don’t remember. Theoretically, which-key or something similar will do this too but then you have to remember that the factoring command starts with a k. That’s precisely the hard part; I can probably remember the f on my own.

If you’re always factoring numbers (or whatever) you’ll learn the shortcut of course but what about the Bessel $J_{\nu}$ function? Since I learned and internalized the x shortcut, I’m finding it much easier to get a grip on Calc.

Update [2018-01-06 Sat 17:53]: I → you (a couple of times)

Posted in General | Tagged , | 6 Comments

## Frame Peek

As part of his Emacs mini manual series, tuhdo introduces an interesting idea for quickly looking at, say, a function definition. There are lots of ways of doing that, of course, and tuhdo isn’t advocating any particular one or eve a new one. Rather, you can think of his suggestion as providing a framework for quick-look systems.

To understand what that means, you first have to understand what tuhdo sees as the problem with the way current systems work. Some of them pop up a little subwindow with the required definition but the space is delimited and there’s probably no font locking or other amenities that we’re used to having with buffers. Others open a new buffer either in the same or another window. That can also be annoying even if it opens the new buffer in a different window because that window may also hold useful information that you want to see. Finally, a long string of nested such lookups can mean that you lose your place and have to search for your original buffer.

Tuhdo’s idea is to pop up a new frame positioned right under the symbol at point, use whatever quick-look mechanism you prefer—his demo uses the rtags-find-symbol-at-point function—and display that definition in a buffer in the new frame. That means the “popup” has all the capabilities of a normal buffer and it’s easy to nest calls without losing your way. You merely delete the frames to unwind the calls in a natural way.

Take a look his demo at the link. It makes all this clear and shows how natural and easy it is to use. It doesn’t take much code to do this. Tuhdo shows the code for using rtags, which you can just cut and paste into your init.el. If you use some other system, it should be easy to adapt.

Posted in General | Tagged | 2 Comments

Here’s a useful reminder from Wilfred Hughes:

I say “useful reminder” because—at least for me—it’s easy to forget about it. That’s true even though I have it bound to an easy keystroke, Ctrl+..

I originally set it up to make package configurations in my init.el easy to find but it’s actually handy for navigating in most languages. It gives you a list of functions and top level variables and, if you do such things, classes. When combined with counsel-imenu you get a nice Ivy-like list of candidates that you can successfully refine to narrow in on exactly what you’re looking for.

The reason that I often forget to use it is that swiper is so powerful that it’s my automatic go-to-tool when I’m looking for something in a file. That’s true even if I just want to glance at it and not necessarily move to it. Still, imenu is useful and gives a nice overview of what’s going on in a source file. It’s worth trying to remember to use it.

Posted in General | Tagged | 1 Comment

## Lava Lamps

If you’re a geek with an interest in cryptography, you know that one of the hardest problems in practical cryptography is random number generation. A weak PRG (pseudorandom number generator) is one of the surest ways to get a cryptographic protocol compromised. Most PRGs depend on random events such as mouse activity, disk latency, and other such non-deterministic events to seed the PRG with the required randomness.

You may also know that lava lamps, that refuge from the 1960s, can also produce random numbers1 but if you’re like me, you’ve probably always considered that a (geek) cocktail party factoid of no particular use. It turns out I couldn’t have been more wrong. Cloudflare, which handles about 10% of international Internet Web traffic, uses lava lamps to generate their random numbers. They have a wall with over 100 lava lamps that are busily bubbling away. A video camera captures the action and sends it to a computer for conversion into random numbers. This is an elegant and relatively low cost way of producing the large amount of random numbers that an operation like Cloudflare requires.

Oddly, the 53 year old fad remains strong to this day and you can still get a lava lamp. It makes me wonder what the Hippies would have thought of their beloved lava lamps being used as an integral part of computer communications.

## Footnotes:

1

If you’re interested in the details, here’s a nice explanation. It’s a lot simpler than you might think.