Fish Sticks

I just saw an article that incited in me an atavistic fear and loathing. What was it that left me trembling and whimpering? Fish sticks. The very name brings back childhood horrors. Long ago, in the dark ages before the Internet, I was in (what we now call) middle school. On most Fridays—in deference to Catholics who weren’t allowed meat on Fridays—we were served the abomination called fish sticks. They actually made me gag but the teachers insisted we eat them.

It never occurred to me that anyone actually liked them. I always considered them just another way for the school system to torture their students. But the article says that fish sticks are beloved by many and tolerated by many more. I would have been surprised to find anyone who would admit to even tolerating them. Some people say, apparently, that you can almost pretend they aren’t fish. If only that were true. For the record, I like seafood but fish sticks don’t qualify.

It turns out that fish sticks were invented to solve a problem. Stronger motors and bigger boats back in the 50s meant that there were too much fish being caught to sell quickly so they started skinning, deboning, and freezing it on the boats. That raised the question of how to sell the frozen fish. After a series of failed experiments, they settled on fish sticks, which did surprising well. The article has other curious facts about fish sticks. If, like me, you have a complicated history with them, you might enjoy the article. As for me, I’m just glad that I don’t have to choose between starving and letting a single crumb of fish stick pass my lips.

Posted in General | Tagged | Leave a comment

Using Org-capture With Org-drill

I saw a pointer to this New York Emacs Meetup talk from 2016. It’s about how Josh Moller-Mara uses org-drill and org-capture together to learn Chinese. Most of us don’t need to learn Chinese, of course, but we all do have things we need to learn and org-drill’s implementation of spaced repetition is an excellent way to do it.

The most interesting part of the talk to me was how Moller-Mara uses org-capture to easily build the flash cards. These are more complicated than usual because Moller-Mara includes additional information such as a code that describes what the Chinese character looks like. What’s nice is that the process is almost entirely automated. When Moller-Mara comes across a new character, he cuts and pastes it into an Org-capture template and the template looks up all the information and adds it to the flash card. All this is driven by the text file Chinese/English dictionary CEDICT. When Moller-Mara pastes a Chinese character into the template, the template code simply does a regex search of the CEDICT file to find the definition.

This is a really good example of how flexible org-capture is and how it can do non-trivial processing of its input. That’s because you can put calls to arbitrary Elisp in the template definition. It would be easy to adopt Moller-Mara’s ideas to other, similar applications.

The slide deck for the talk is here. At the end, are links to his templates and software. The talk itself is just a bit over 36 minutes so plan accordingly.

Posted in General | Tagged , | Leave a comment

Paper on Native Compilation

If you’ve been following the Emacs native compilation effort and are curious about the technical details, Andrea Corallo, Luca Nassi, and Nicola Mancahave have an arXiv paper that describes Bringing GNU Emacs to Native Code. The paper does a good job explaining the technical details of how the native compiler works without requiring specialized compiler theory knowledge.

The TL;DR is that the native compiler uses the intermediate language from normal Emacs byte compilation as input and produces GCC intermediate code (IR). The final step is for GCC to compile this IR into native machine code. It’s a nice solution because it lets GCC worry about generating the final code so the solution should work for any architecture that GCC targets.

The details are a little more complicated, of course. The Emacs byte code IR is first translated into a special IR (called LIMPLE) that the native compiler can operate on and make optimizations that GCC can’t for various reasons having to do with the differences between LISP and C. It’s LIMPLE that is actually translated into the GCC IR. The paper explains all this so you should definitely read it if you’re interested.

Posted in General | Tagged | Leave a comment

Three Useful Emacs Packages

Emacs-Elements has a short video that describes three useful packages that save various pieces of Emacs state. The three packages are:

  1. real-auto-save
  2. persistent-scratch
  3. session

The first, real-auto-save, saves the file you’re working on when Emacs is idle for a configurable number of seconds. Most people probably wouldn’t want this globally applied so you can set hooks to only do it for the type of files you want to automatically save.

The persistent-scratch package does just what it says. It will save your scratch file across Emacs sessions. That’s handy for folks who actually use it to take notes and don’t want to lose those notes when they restart Emacs.

Finally, session saves things like the values you’ve stored in registers. Follow the link to see a list of all the things that session saves. I’ve never been a fan of this sort of thing but many people are so if you’re one of them, take a look at the package.

The video is only 6 minutes, 17 seconds long so you can probably watch it while you’re waiting for your coffee to cool. These packages are good examples of small Emacs apps that help you adapt Emacs to work the way you want it to.

Posted in General | Tagged | Leave a comment

Marks and Regions

David Wilson has a new video out on efficient text selection in Emacs. You can’t really understand text selection in Emacs without understanding the mark. The basic fact is that the currently selected text—the region in Emacs lingo—is the collection of characters between the mark and the point.

Wilson explains how to select text regions by setting the mark and then moving the point. When you have a region defined, you can perform any of several operations on it. That can be anything from simple cuts and copies to more esoteric things like changing the case of every character in the region. Mostly, you learn those commands as you go along but the first thing to learn is efficient ways setting the region.

Emacs, as you’d expect, has many shortcuts to set the mark and then move the point to some predetermined place. For example, there are commands to mark the current word, paragraph, page, or buffer. There are even move specialized commands for Lisp code that deal with things like marking the current s-expression or function definition.

Of course, that’s only half the story about marks. You can also jump to them. Even more, they’re saved in a special structure called the mark ring. Thus, one can jump to the last \(n\) marks where \(n\) is the size of the mark ring. The mark ring has 16 entries by default but, being Emacs, it is, of course, configurable.

Wilson explains all this and more in the video so be sure to take a look. His demonstration of the global mark ring falters a bit at the end but it’s still a very worthwhile video. The video itself is about 28 and a half minutes so plan accordingly.

Posted in General | Tagged | Leave a comment

Red Meat Friday: How Not To Design Signs

As promised, no journalists were harmed in the posting of this Red Meat Friday. Instead, via Karl Voit, I present this example of really atrocious design.

The perpetrators of this mess doubtlessly thought they were cleverly using color to guide the eye but forgot that the (Western) eye is much more likely to be guided by left-to-right, top-to-bottom linearity. Or maybe it’s the other way around. Who can tell?

Posted in General | Tagged | Leave a comment

And You Don’t Mess Around With Jim

The late Jim Croce famously sang

You don’t tug on Superman’s cape
You don’t spit into the wind
You don’t pull the mask off the old Lone Ranger
And you don’t mess around with Jim

Cloudflare has another item for that list: “You don’t patent troll Cloudflare.” That should have been obvious to everyone after they essentially destroyed Blackbird Technologies when Blackbird tried filing a spurious patent suit against them. Cloudflare responded by offering a bounty for prior art not only on the patent Blackbird was asserting against them but for every patent in Blackbird’s portfolio.

Sadly, some people are slow learners. Another non-practicing entity (NPE), an outfit called Sable Networks, decided to try its luck and asserted patent infringement against Cloudflare on four of its patents. Cloudflare was not amused and has launched another bounty program for prior art on all of Sable’s patents.

You can read the details and a list of the patents on Cloudflare’s post about the suit. It’s too bad that other large companies—such as Cisco and Juniper—caved to Sable and bought them off. That’s what NPEs depend on: that it’s cheaper to settle than to fight. It takes a company like Cloudflare, or Newegg before them, to do what’s right and smash these trolls and the bridges they hide under to pieces. After a while the trolls learn that you don’t mess around with Jim.

Posted in General | Tagged | Leave a comment

Bastien on Using TODO Lists Efficiently

Bastien Guerry, longtime maintainer and advocate for Org-mode, has a few thoughts on using TODO list efficiently. His thoughts are distilled from 15 years of using Org to keep his TODO list and schedule his tasks.

The chief challenge, he says, is using your TODO list as a tool and not letting it become a burden. Doing it correctly takes discipline and without that discipline the TODO list can become formulaic and burdensome. Happily, Guerry has discovered some principles that can help avoid these problems.

The first principle is to distinguish between notes and TODO items. Things you want to remember should not appear as tasks. Notes are not (necessarily) actionable and should not appear in your TODO list until they are.

A second and related principle is to write concise and focused task items. That means basically just listing the task without a lot of context or explanatory material. That content, if needed, should be linked to not included in the TODO item.

Finally, take care of your agenda. That means not adding TODO item until and unless they are needed and have a specific date they need to be done. Nice-to-do or “someday” items should be in your notes, not your TODO list. You can migrate them from your notes to your TODO list when you are ready to schedule them on a specific date.

Take a look at Guerry’s post to get the details. He’s got some useful ideas if you’re serious about using TODO lists to become better organized.

Posted in General | Tagged , | Leave a comment

The Post Office and Surveillance

The U.S. Postal Service (USPS) has fallen on hard times. The Internet, email, FedEx, and UPS have been eating their lunch for years. It’s not hard to see why. A first class letter costs 55¢ with delivery time measured in days. Once you have Internet access, which just about everyone does, email is essentially free and delivery is immediate. Even Aunt Millie has more or less given up on snail mail. What the Internet is doing to letter delivery, FedEx, UPS, and even Amazon are doing to package delivery: the USPS delivers about 7.3 billions packages a year while FedEx, UPS, and Amazon together deliver about 12.6 billion.

What, then, to make of this Yahoo! News article about the USPS monitoring social media for posts about protests? The post office is hemorrhaging money and can barely carry out their legitimate roles. Why are they involved with this? Irreal is not alone in its confusion; no one understands why this happening. Putting aside its dubious legality, the experts can’t understand why the USPS was tasked with this instead of, say, the FBI or Homeland Security.

What’s odd is that the USPS has been doing better—from a customer service perspective—lately. It’s hard to see why they would embrace this sort of distraction. Despite their boilerplate attempt at justification, this operation doesn’t seem to have anything to do with delivering the mail or the type of problems Postal Inspectors generally deal with.

And speaking of Yahoo! News, their horrendous, very user-unfriendly site reminds me why I’m always surprised to discover that they’re still a thing. Just go look at the article to see what I mean.

Posted in General | Tagged | Leave a comment

Two Quickies

Ten Years At This Location

Irreal will be 12 years old in July but 10 years ago today I published my first post at irreal.org. Before that, Irreal was hosted at Blogger and I posted sporadically at best. Once the blog got its own domain, it felt more official and I tried to write more regularly. Eventually, I started posting everyday, which in retrospect seems a little silly but it’s a habit now.

Native Compilation has been merged

Native compilation was, indeed, merged over the weekend. It’s still an optional feature for now but Eli has indicated that he hopes to make it the default in Emacs 28. Again, it’s extraordinary that such a major feature could be integrated so quickly.

Posted in Blogging, General | Tagged , | Leave a comment