Red Meat Friday: Unix in the Browser

No. Just No.

Semiserious afterword

I get that there’s some great engineering behind this but why would you want to “run” Unix in the browser? And why, in the name of all that’s holy, would you want an OS built on JavaScript?

Posted in General | Tagged , | Leave a comment

Finding Repeated Words

Years ago, Albert Heinle was writing his thesis. A common error that many or most writers must deal with is using the same word repeatedly in close proximity. I certainly do and so did Heinle. He was using Emacs and LaTeX to write his thesis and he looked around for some software to automatically check for a repeated word within a given radius. He couldn’t find one but he was using Emacs so he wrote his own.

Heinle recently came across his word repetition code and decided to make it available to anyone who needs it. He says he used the project to learn Elisp so the code should be considered beta quality. He’s promised to work on it and it is, in any event, a single file so it should be easy to adapt it for your own uses.

When I’m writing an Irreal post, I generally go over it several times editing as I go. Just before I publish it I make one more pass. The most common problem I find is reusing the same word within two or three sentences.

If you write prose and find yourself repeating words too often, try out Heinle’s repetition detector. Perhaps it will help.

Posted in General | Tagged | Leave a comment

Is Norton Stealth Downloading a Cryptocurrency Miner?

I just saw this horrifying Twitter thread. The thread makes it appear that Norton is stealthily downloading a cryptocurrency miner and running it without user consent. Instant outrage!

Except

  1. It’s Twitter
  2. If true this would almost certainly be illegal and at best open Norton to ruinous law suits

Perhaps a bit of wariness is appropriate. Here’s what Norton has to say about it. That makes it sound as if what’s happening is that Norton is providing a cryptocurrency miner that you can run if you like. If that’s the case, you can complain about the 15% fee but there’s nothing underhanded going on.

So the question is: what is going on here? If the thread is accurate it’s a major scandal but it’s a good rule to treat almost everything you see on Twitter with skepticism. Indeed, the majority of the Web seems to be treating this as a discretionary application that you can run if you like, not as a stealth download to steal your CPU cycles.

I didn’t go trawling in the Twitter swamp to find this thread. It came to me from my Hacker News feed. There was a long discussion on Hacker News but only one person noted Norton’s side of the story and that person was instantly shouted down. There’s enough character assassination on Twitter without spreading it on technical news sites. We should do better.

UPDATE [2022-01-06 Thu 15:38]: Krebs on Security has a post that summarizes and discusses the issue. The TL;DR is that while there is plenty to not like, Norton’s cryptocurrency miner does not run without the user’s consent. If you’re interested in this story, read Krebs’ post for a good account of what’s going on.

Posted in General | Tagged | Leave a comment

Another Look At Counting Org Tags

Andrea over at Where parallels cross has decided to post some shorter tips in addition to the blog’s longer offerings. The first is some Elisp to count the number of tags in your agenda files. When I looked at the code, I thought it was a bit too complicated for what it was trying to do.

My first objection was the onetime use of the macro but it turned out that Andrea already had it so that wasn’t a problem. The real issue is that the code duplicated a lot of already existing functionality. I remembered writing a post a couple of years ago where I needed to list all my agenda tags. It turned out that org-global-tags-completion-table did just that. It also eliminates duplicates and nil entries. In fact, if you look at the code, it does pretty much what Andrea did.

Here, then, is my rendition of counting Org tags:

(require 'dash)

(->> (org-global-tags-completion-table)
     -flatten
     length)
715

One final note. The tags for each file begins with a property string such as

#("JOURNAL" 0 7
 (inherited t))

so you should really subtract the number of agenda files to get an exact count.

Posted in General | Tagged | Leave a comment

Are Google Searches Losing Quality?

As most of you know, I try to avoid Google as much as possible. In particular, I haven’t used the Google search engine in years. But that’s because of privacy concerns and Google’s sordid record of vacuuming up as much of their users’ information as possible. I’ve always assumed, though, that Google probably had the highest quality search results in the industry. That’s undoubtedly been true in the past; after all, Google invented modern browsing indexing techniques and has been at it for a very long time.

Then I read this Twitter thread by Michael Seibel, a partner and director at Y Combinator. The TL;DR is that, at least in certain categories, Google search results are of very low quality with the top results dominated by “clickbait sites riddled with crappy ads”. Later in the thread, Tanay Jaipuria points to one of his Substack posts in which he shows the results of a Google search for “health insurance”. The first page has only one result that is not an ad.

Seibel speculates—and Jaipuria concurs—that Google may be ripe for some disruption. Paul Graham picked up on the idea with a thread of his own on the idea of going after a niche overrun with SEO spam. Seibel posits that these dismal results are not the result of sudden bad engineering but of short term bottom line obsessed executives who are insisting on ever more ads in the results. It wouldn’t be the first time suits overly concerned with the next quarter results have made bad decisions.

Betteridge’s law mandates that the headline’s answer should be “no” but Seibel and Jaipuria make a pretty compelling case. Happily, I have no direct experience to make my own determination.

Posted in General | Tagged | Leave a comment

Germany Gets It Right

Tutanota is a Germany-based secure email provider. As you would expect, they are very interested in privacy-affecting legislation, especially in Germany, so they were quick to announce a change in government policy regarding data retention on their blog.

The TL;DR is that the new German government would like to do away with data retention not required for business purposes except when presented with a legal warrant. There’s the usual bureaucratic wrangling but it looks like it’s going to happen. For years, the government kept passing data retention laws and the courts kept striking them down. Now, maybe, Germans can rest assured that the Government isn’t willy nilly snooping on their communications without a warrant supported by a finding of probable criminal activity.

It’s easy to take a “Meh, BFD” attitude about this but it’s not often I get to report such an improvement. Certainly here in America things are getting worse, not better. The Fourth Amendment seems pretty clear on the issue but the courts apparently have special glasses that allow them to read the tea leaves in a way that we hoi polloi don’t have access to. Still, Irreal will take its victories where it can find them and celebrate this step forward for privacy. I just hope that my own government will do likewise. For health reasons, I’m not holding my breath.

Posted in General | Tagged | Leave a comment

Draft 4 Revisited

It’s New Years day and a lot of you are probably in no mind for an over stimulating rant on one of Irreal’s hobby horses or perhaps even a technical discussion so, instead, I offer a reprise of one of my favorite posts from back in 2015. That post was about James Somers’ wonderful article on why you are probably using the wrong dictionary. Someone just reposted a pointer to the article and I enjoyed reading it again just as much as I did the first time.

Somers tells the story of John McPhee’s New Yorker article Draft No. 4. The article describes how McPhee, an acclaimed essayist, “punches up the language” of his essays after the creative work is done. He does this by looking for words that aren’t quite right or that can be improved and looks them up in the dictionary. But not just any dictionary. Somers says that most dictionaries offer dry, bureaucratic definitions but, he discovered, McPhee uses Webster’s Revised Unabridged Dictionary (1913 + 1828). Happily this dictionary is freely available and Marcin Borkowski discovered a way to make it accessible from within Emacs. This is perfect. You can just point at a word in an Emacs buffer and get Webster’s definition. I don’t use it all that often but when I do it’s really a life saver. If you write prose, you really need this.

I have long thought that Somers’ article was a beautiful paean to McPhee and his process for making his prose as perfect as possible. Even those of us who aren’t in his league can learn and benefit from how he does things.

Posted in General | Tagged | Leave a comment

Emacs 28, Menus, and Mice

Philip Kaludercic has an interesting post on the new Emacs 28 context menu feature. It has some useful information on how to use and configure the feature. The TL;DR is that you can configure menus to be context sensitive. For example, if the point is on a file path, the menu can add an entry to open that file. Kaludercic gives several other examples and provides some demonstration code to show how the capability can be used.

Emacs 28 will soon be with be officially upon us—the first pretest has already been released—so it’s worth taking a look at Kaludercic’s post if you have any interest in this sort of functionality.

But my interest in his post really concerns a meta-issue that he raises: that of using a mouse and menus with Emacs. As I said just the other day, I’m content to let people find the workflow—Emacs-based or not—that works best for them. That includes using a mouse and/or menus with Emacs. Kaludercic feels the same—sort of—but is suspicious of those of us who avoid using the mouse and menus.

Contra Kaludercic, I’m don’t have a fear, irrational or otherwise, of the mouse and use it all the time in, say, the browser or others apps where it makes sense. But the thing is, in my estimation, it doesn’t make sense in Emacs. I don’t care what Kaludercic and Rob Pike say, I’m faster and more efficient in Emacs without the mouse. The same goes for menus. I always have them enabled because it’s hard to do otherwise in macOS but the only time I ever invoke them is for seldom used commands that I can’t remember and know is on a currently available menu. That happens no more than once every couple months at most.

Again, do whatever works best for you but grant leave to those of us who have other workflows to do the same.

Posted in General | Tagged | Leave a comment

Finite Automata State Diagrams With Tikz

I’ve mentioned before that one of my favorite implementation techniques is finite state machines. I started using them for communication protocol implementations but soon discovered that they could be applied to several sorts of problems. It’s easy enough to sketch out a state diagram on paper and code from that but what happens when you want to document the FSM?

I’ve always used the Graphviz dot command language to draw high quality digital versions of the state diagrams but it’s hard to get the placement exactly right and looking good. Alexander L. Hayes, a Ph.D.Student at Indiana University Bloomington, has a short guide on using Tikz to draw the diagrams.

The good news is that the diagrams look really great and don’t seem very hard to specify (although you can fine tune the results). Take a look at the link to see what I mean. The bad news is that neither Hayes’ guide or the relevant chapter of the TikZ and PGF Manual that he points at does a very good job of explaining the language and how to use it. They are, rather, a set of examples. Fortunately, state diagrams aren’t very complex and you can probably figure out what you need to do from those examples.

If you need to typeset some state diagrams, take a look at Hayes’ guide and section 19 of the manual. Tikz seems like an easy way to get the job done.

Posted in General | Tagged | Leave a comment

A Nice Example of Emacs Keyboard Macros

Just a quickie today. Bill over at ATMakers has a short video on Why He Uses Emacs. It’s actually a nice example of using keyboard macros to convert raw data into the required form.

I like it because it’s a realistic example. Very often when we want to convert a data set to some other format, we have the problem that the source data is not completely regular. Theoretically, this means we can’t write a quick and easy macro to do the conversion but, of course, that is not how we work. If there are one or two outliers in the data, we just convert everything according to the canonical data and fix up the outliers by hand afterwards.

That’s exactly what Bill does in his video. Most of the data is converted perfectly but the two outliers are easy to fix by hand and the entire process is much more efficient than converting each datum by hand or writing an app that does the right thing for each entry. Instead of an hour or two of tedious work or programming, Bill converts the first entry while recording his keystrokes and then applies that to all the other entries. The fact that it doesn’t work on a couple of irregular entries doesn’t matter; they are easily fixed by hand.

The video is only 6 minutes, 15 seconds long so it should be easy to find time for it.

Posted in General | Tagged | Leave a comment