Red Meat Friday: Taking Up Space With Metadata

Note: For some reason WordPress refused to embed Fraga’s tweet so I had to link to the tweet instead.


As you all know by now, I prefer a minimalist approach to my editor screen layout. I want as much screen real estate as possible devoted to the file I’m editing. That maximizes context and minimizes scrolling. Eric Fraga, it appears, agrees:

When I first saw that screenshot, my immediate reaction was, “Why would anyone do that?” Look at that layout. It’s got all sorts of metadata about other files displayed but devotes only a third of its working space to the point of an editor: editing the text of a file.

After thinking about it for a while, I came to the realization that the people who prefer this type of configuration find text boring. It’s not “modern looking”, it’s not flashy, and worst of all it doesn’t look cool. But a setup like VS Code’s default? That’s happening!

Of course, as I’ve said before, different strokes for different folks so use whatever works for you. Still, I maintain my cranky, much maligned opinion that serious developers don’t use setups like that. Let the abuse begin.

Posted in General | Tagged , | Leave a comment

Six Useful Emacs Settings

David Wilson over at the System Crafters Channel has a new video up on The 6 Emacs Settings Every User Should Consider. The six settings are

  1. Enable remembering recently edited files
  2. Enable minibuffer history
  3. Enable remembering last place visited in file
  4. Changing the location of the custom file
  5. Disabling UI dialog boxes
  6. Enabling automatic reversion of file changes

Even intermediate Emacs users are probably familiar with most of those settings although I had never heard about disabling dialog boxes before. That’s probably because they only come into play when you’re using the mouse, which I virtually never do.

Oddly, I use only two of these settings. I have my init.el under version control so it’s really annoying when some random function decides to scribble in it. That can be avoided by moving the custom data to a separate file. That file will also receive the random scribblings so my init.el doesn’t get corrupted with transient information.

The other setting I use is to enable minibuffer history. That’s really useful and something I take advantage of many times a day.

I haven’t explicitly enabled recentf but something else in my configuration has because recent files are being saved and when I tried recentf-open-files I got the list as shown in the video. Even so, my workflow is such that I’d hardly ever use the facility so I ignore the setting and will probably forget all about it soon.

The same goes for remembering the last place visited in files. I hate that kind of thing. Emacs has great search capabilities—which avy makes even better—so I can always easily find where I want to go in a file. Most likely that’s the end of the file so a simple Meta+> suffices.

The same goes for global-auto-revert-mode. My workflow just doesn’t have the problem of other processes updating files I’m working on so the overhead isn’t worth it to me.

Other folks will certainly have preferences that differ from mine so it’s worthwhile taking a look at the video. The run time is 15 minutes, 40 seconds so plan accordingly.

Posted in General | Tagged | Leave a comment

Guess Who Was Responsible for the Missouri SSN Leak

Back in October of last year Irreal recounted the hilarious but sad tale of the Missouri governor trying to press charges against the St. Louis Post-Dispatch for discovering, notifying the state, and then reporting on the fact that a state Web site had exposed the social security numbers of hundreds of thousands of teachers. Governor Mike Parson was not amused and threatened to bring charges against the reporter for “hacking” despite the fact that the social security numbers were embedded in the site’s HTML and visible to anyone simply by selecting their browser’s “show source” option.

The governor enlisted the State Police and the State Attorney General to investigate the matter. In a splendid example of the adage that you should be careful of what you wish for, the State Police and Attorney General did investigate.

Brian Krebbs is reporting that the results of that investigation is that the governor’s office is responsible for the leak. They also concluded that the reporter and his paper did nothing wrong.

There’s nothing venal in all of this. Whoever built the site was incredibly incompetent, of course, but as Irreal readers know, there’s a lot of that going around. If the governor hadn’t weighed in, it would have been a one day story of “diligent reporter discovers data leak in state website that has since been fixed.” Now the story is that the governor is a clueless moron who was attempting to cover up a serious screw up of his office by trying to shoot the messenger.

I don’t know if Parson is a good or bad governor but I do know that he’s ignorant about the Internet and should refrain from expressing his opinions on its technical aspects. To do otherwise is to invite the ridicule that he’s receiving and so richly deserves.

Posted in General | Tagged | Leave a comment

Why Learn Scheme

Back when I was learning Scheme, my go to implementation was DrScheme. It had great libraries, an excellent IDE, ran on Windows, Macs, and Linux, and produced good standalone code. Eventually it drifted away from the Scheme specification and was renamed DrRacket. It’s still a great environment and a good way to get started with Scheme.

Micah Cantor, a student at Grinnell College, provides his answer to the question, “Why should I learn Scheme?” The question was occasioned by the fact that his introductory programming course was taught using Racket and there was a lot of student grumbling about wasting time learning a language they wouldn’t use instead of one that could get them a job.

Putting aside the fact that a liberal arts education is different from a vocational education, the question deserves an answer and Cantor provides a pretty good one. The short answer is that Scheme and the functional programming paradigm teach a new way of thinking about writing programs and solving problems.

A good example is recursion. The usual introduction using a C-like language involves silly examples like factorials and Fibonacci numbers: problems that are ill suited to a recursive solution even though their definition maps naturally into recursion. In Lisp dialects—especially Scheme with its guaranteed tail call optimization—recursion is the natural iteration mechanism and one of the primary tools used by Lisp programmers.

Suffice to say that learning Scheme or some other Lisp is life changing for a programmer. I know this is true because it happened to me. After almost an entire career in programming I learned Scheme and read SICP and it changed they way I think about and practice programming.

Posted in General | Tagged , | Leave a comment

An Example of RSS Use

Chris Hardie is, like me, a believer in RSS and considers it an important protocol that can be used for more than just following blogs. He considers the example of a municipal website that posts information of concern to its citizens. Suppose, he says, that a water main breaks, the water supply is compromised and the city tells its citizens to boil their water. When the water supply is safe again, the city will post an alert letting everyone know that they no longer need t boil their water.

If you’ve ever been through something like that you know it’s a pain and that you want to stop as soon as you can. What to do? You can check the city’s Website every time you need water but who wants to be checking a Website all the time?

But suppose the Website had an RSS feed. It’s easy to leverage this into an alert by piping into something like Slack or a simple notification app. The problem is, what if the city’s Website doesn’t have an RSS feed as many don’t.

Hardie has a couple of solutions but they’re complicated and more work than most people would be willing to do. That leads Hardie to make a plea: if you’re a Web developer or responsible for deploying one, please provide an RSS feed. It’s not hard and it can make a lot of difference to your users.

Posted in General | Tagged | Leave a comment

The Year 2038 Problem

All of you Unix heads know about the coming Unix apocalypse. On January 19, 2038, the 32-bit Unix time variable will overflow and Unix will suddenly think it’s December 13, 1901. Except, of course, virtually all extant Unix systems now have time_t defined as a 64 bit integer, which covers us for roughly 20 times the age of the universe. We’re probably safe.

So problem solved? Silent says no, the year 2038 bug is alive and well. Of course, time_t is in no danger of overflowing but there’s still code about that implicitly assumes Unix time is 32 bits. As the example in the post shows, the dependency can be quite subtle. In this case, the villain is a macro that multiplies two 32-bit integers to yield a 64-bit result. It’s used to convert Unix time to a Windows FILETIME value.

Silent has launched a project to hunt down all the places this code is used and provide fixes. Take a look at the post if you’re interesting in helping.

In the mean time, if you want to keep track of things in a graphical way you can use the Emacs function hanoi-unix. It that makes you anxious, try hanoi-unix-64 that shows the same thing but for a 64 bit time_t. Using the Tower of Hanoi puzzle to count down to the end of time is not as whimsical as it seems. According to the legend of the Tower of Brahma, a 64 disk version of the game is being played by priests in the Indian city of Benares. When the puzzle is complete, the legend says, the world will end.

Posted in General | Tagged , | Leave a comment

The Bash Bible

Years ago I remember reading in Kernighan and Pike’s The Unix Programming Environment a quote about how the shell was very often their preferred programming language:

When you’re faced with writing a new program, there’s a natural tendency to start thinking immediately about how to write it in your favorite programming language. In our case, that language is most often the shell

It’s easy to see why. Programming in shell is quick and easy and you can use interactive programming techniques to build your application. It might seem like the shell is a blunt instrument but I’m often amazed at how large, robust applications can be built in shell. At the same time, it’s possible to perform low-level operations in shell.

Dylan Araps has curated a collection of pure Bash alternatives to several external programs. At the same, the collection demonstrates how to perform various low-lever computations such as removing duplicate array elements and much more. All this is collected in his Pure Bash Bible Github repository along with a handy, clickable table of contents.

If you write shell code or would like to, this is a valuable repository to bookmark or clone. You can also get a hardcopy from Leanpub if you prefer dead tree books.

Posted in General | Tagged , | Leave a comment

Delivery Robot Traffic Jam

One of the reasons I love being in New York City is that you can get virtually any type of food delivered at any time. Tampa is hardly a backwater but pre-covid we didn’t have a robust food delivery infrastructure unless you wanted pizza. Of course, all that’s changed now. Just like the Big Apple, we here in Tampa can get a meal or even our groceries delivered to our door.

Humans driving cars around to deliver food doesn’t seem all that efficient so, of course, the Geek in me is interested in other solutions. One such solution—probably best suited to smaller areas such as campuses—is the delivery robot. If you haven’t seen one, think of a beer cooler on wheels. They autonomously navigate from the provider to your door.

It’s easy to imagine a lot of ways things could go wrong but here’s one that didn’t occur to me:

Posted in General | Tagged | Leave a comment

Ibuffer

This tweet from Mickey

reminded me of something I haven’t thought of since I started using Emacs more than 15 years ago. Very early on I learned from somewhere that I should use ibuffer instead of list-buffers. I couldn’t even remember how I made the substitution and had to look. Back then I didn’t know very much Elisp so instead of remapping Ctrl+x Ctrl+b like I’d do today, I simply aliased ibuffer to list-buffers.

I can only concur with what Mickey says: just stop using list-buffers and change to ibuffer; you won’t be sorry. The only question in my mind is why ibuffer hasn’t replaced list-buffers as the default. It’s hard to imagine that anyone prefers list-buffers but those who do would still have access to it but the default would be the much more sensible ibuffer.

Posted in General | Tagged | Leave a comment

More on Google’s Poor Search Results

Back in January, I wrote about a Twitter thread concerning poor Google search results. The complaint was almost all the results were ads. DKB has a new post that covers the same ground. He says that Google is dying and reddit is now the search engine that everyone uses.

Neither of those two claims seems valid. After all, no one thinks that Google, who just had record profits, is literally dying. And how would you even use reddit as a search engine? DKB provides the needed context in his post. What is actually dying is the quality of Google search results in certain categories. Those categories are precisely the ones that attract advertisers. If you ask Google who the 32nd President of United States was, you get a accurate answer and probably little advertising. If, on the other hand, you search for a review of a particular late model car, your results are apt to be mostly ads and SEO engineered content.

That’s where reddit comes in. If you ask reddit about that same car, you’re going to hear from real people who doubtless have strong views but not a vested interest in getting you buy one. So DKB’s claim that reddit is the “most used” search engine should be understood to mean that people are now appending “reddit” to their searches as a way of finding out what reddit has to say on subjects whose results are abused by ads and SEO.

Take a look at the post to see the whole argument. You may or may not agree but it’s one more indication that Google is failing in their primary business.

Posted in General | Tagged | Leave a comment