Ant Bridges

This is doubtlessly beyond the remit of Irreal but it’s so interesting I thought I’d write about it anyway. It’s about ants, for crying out loud but take a look and see if you don’t find it interesting too.

As most of you probably know, army ants can use their bodies to build bridges across gaps. That by itself is pretty amazing but consider: how do they know how to do this. The individual ants are practically blind and have very small brains seemingly incapable of organizing such feats.

Simon Garner has been studying this behavior and has reached some conclusions. It’s all instinctual, of course, but how does it work? Army ants move very quickly (about 12 cm/sec) but when they find a gap, they slow down. That causes the ants behind them to march over their backs. When an ant feels that, it freezes in place and subsequent ants move a bit further into the gap until they too feel ants on their back. Bit by bit the ants form a bridge that the rest of the ants can march over. Take a look at the linked article. There’s a video of the process. The article also discusses how the ants know how to dismantle the bridge.

Even more interesting is what happens when there’s a V-shaped gap and the ants are at the top of the V. They could build the bridge there but that takes a lot of ants that could otherwise be employed. They could build it at the bottom but means further travel for the ants. There’s another video that shows the ants solving this problem.

I am by no means an entomologist and my interest in insects is mostly confined to keeping them out of my house. Still, I find this really fascinating and think you will too.

Posted in General | Leave a comment

The Emacs Writing Studio Is Finished and Available

I’ve written about Peter Prevos and his Emacs Writing Studio several times [1, 2, 3, 4 ]. It’s a series of articles on using Emacs for long form writing. Now, happily, Prevos has announced that the project—or at least the first version of it—is finished and available as a book from several e-bookstores. The source files are also available from his GitHub respository.

This is, as I’ve written, a great resource with lots of useful information. But don’t take my word for it. Protesilaos Stavrou also has a few words to say about it. He has, in fact, contributed those words as a forward to the book.

Those of you who have been around for a while know that I’m very interested in stories about people who use Emacs for non-technical purposes such as prose writing. Those who share that interest will find Prevos’ book a handy resource for using Emacs in their own projects.

I’ve read a lot of Prevos’ articles but never read them through as a book. I’m looking forward to reading the complete work.

Posted in General | Tagged | Leave a comment

Remote Emacs in Terminal Mode

There are some people who prefer to run Emacs in terminal mode. I have no problem with that but I do think that GUI Emacs has so much more to offer that it’s usually the best choice. Sometimes there’s no choice.

The need to use terminal mode often comes up when developers have to work on remote systems rather than their local machine. The usual advice is to use Tramp, which often works well and solves the problem but sometimes—especially with remote servers that are not on the local network—tramp can be too slow.

Wai Hon Law is in that situation. His employer does not allow source code on individual machines so he has do all his development on a remote server. Tramp didn’t work for him so he had to find another solution.

That solution involves a good terminal emulator and tmux. The two main problems are getting good colors for syntax highlighting and enabling the clipboard. These mostly depend on choosing the right terminal emulator but Law’s solution may not help too much because he’s using Chrome OS but there are doubtless terminal emulators suitable for your system.

The TL;DR is that you may have to experiment a bit to find the right emulator for your OS but once you do, you can look at Law’s post to get an idea of the other things you need.

I’m lucky that I’ve never been in this situation and could always just use Emacs in GUI mode but if you aren’t so lucky, take a look at Law’s post to see some possible ways forward.

Posted in General | Tagged | Leave a comment

Profiling Garbage Collection

Gene Goykhman over at Flaky Goodness has a nice hint on profiling garbage collection but the technique is more generally applicable. Goykhman wanted to know how much time he was spending in garbage collection while exporting his blog. It turns out there’s a really easy way to find that out.

The function benchmark-run will run its argument and report the total running time, the number of garbage collection calls, and the total time spent in garbage collection. That’s useful information to know for any function, even if all you’re interested in is the total running time.

Goykhman was concerned that garbage collection was taking up a significant amount of time in his export process so he arranged to inhibit it when he was exporting his blog. That worked out well for him but even if it’s not your problem, the benchmark-run function seems like a useful way of measuring the performance of your functions and perhaps adjusting things to improve performance.

Posted in General | Tagged | Leave a comment

Updating Builtin Packages

Charles Choi has a very informative post on the Emacs upgrading policy a very informative post on the Emacs upgrading policy. The TL;DR is that by default Emacs’ package.el will not upgrade packages that are builtin. Org is an example of this. The package is builtin but the Org team issues updates much more frequently than Emacs itself is upgraded. There’s a variable, package-install-upgrade-built-in, that can override this behavior and force package.el to upgrade packages whether or not they’re builtin.

When I read his post, I thought, “This is great. It’s the answer to why Org sometimes doesn’t upgrade correctly.” But then I realized that Org is upgraded by package.el even though package-install-upgrade-built-in is set to nil on my system.

So now I don’t know what’s going on. Org is certainly a builtin package but it doesn’t seem to be behaving in the manner described by Choi and the documentation. Choi’s use case involves transient, which he depends on for his Casual suite. He needed a later version but it was not upgraded for at least one of his users.

Perhaps the policy is restricted to the update of dependencies although the documentation does not reflect that. Fortunately, this is Emacs and all the source is available and hackable so it’s just a matter of digging into the code to see what’s going on. Perhaps I’ll do that in the near future but for now it’s enough to know that someone has thought about the issue and attempted a solution.

Updates
[2024-08-30 Fri 12:12]:

Philip Kaludercic explains what’s going on in this comment. What package-install-upgrade-built-in really does is interpret built-in as installed. Take a look at the comment for the full explanation.

[2024-09-02 Mon 18:16]:

Added link to Choi’s post.

Posted in General | Tagged | Leave a comment

Partying Like It’s The Last Century

It’s hard to be too cynical about the security practices of software vendors: even those selling “security” solutions. Although most Irreal readers probably know a lot more about good security practices than the average user, security is a difficult discipline requiring specialized knowledge.

That’s why, even we aware users, rely to the specialists. In practice, for most of us, that means we buy prebuilt solutions from companies with a good reputation. After all, security is their business so they’re mostly going to get things right.

Like most of you, I’m a developer and understand that there will always be bugs but we expect that the professionals will produce products that at least cover the basics. What, then, to make of the first article in this newsletter? Hardcoded credentials in a security product? You must be kidding.

Sadly, they aren’t kidding. This isn’t the first security screwup on the part of Solar Winds. You have to ask yourself why they have any customers left. This isn’t some esoteric hack that slipped in around otherwise sound protections. It’s hard coded credentials, which are probably the lowest of the low hanging fruit for cybercriminals.

Things like this are exactly why Bruce Schneier recommends using open source for your security products. You never know what’s hiding behind that closed source. Yes, as a practical matter most of us aren’t going to read that source but someone will and this sort of thing will get discovered sooner rather than later.

Of course, nothing will happen. Their customers will shrug and the most you can expect from Solar Winds is that some low level engineer will get fired as a sacrificial lamb. What should happen is that the CEO should fall on his sword and if he doesn’t, the board should show him the door. This kind of thing simply isn’t acceptable today. It hasn’t been acceptable for the last 30 years, at least.

Posted in General | Tagged | Leave a comment

Schneier On Staying Safe On The Internet

There may be more knowledgeable people on security than Bruce Schneier but hardly any of them are talking to us. They mostly work for the NSA or its brethren or they’re cybercriminals. Happily, Schneier does talk to us and he has good new and bad news.

The bad news is that if the NSA wants to be on your computer, they’re going to be on your computer. They simply have too many resources for just about anyone—and certainly for the average user—to resist. The good news is that they probably won’t try to get on your computer. It’s hard and risky for them to target individual computers so they do it only for high value targets. Unless you’re an Osama bin Laden lieutenant, you probably don’t need to worry.

That doesn’t mean the NSA isn’t reading everything you write though. What they do do is vacuum up essentially every bit of Internet traffic on the net. They do this through a variety of means that Schneier discusses in his post. It starts with secret agreements with the Internet infrastructure providers that allows them to tap into all the net traffic.

But it doesn’t stop there. They also do everything they can to weaken encryption standards. Usually this involves something esoteric like weakening the random number generator that can be dismissed as an error if it’s discovered. The TL;DR is that it’s really hard to protect yourself.

Still, Schneier has some recommendations. They involve using strong encryption—preferably open source implementations—to protect your data. It’s probably true that if the NSA really, really wants to read your data, they will but it pays to make it as difficult as possible so they won’t bother unless you’re the aforementioned bin Laden lieutenant.

Take a look at his post for some actionable advice if you want to protect your data.

Posted in General | Tagged | Leave a comment

Ten Coding Fonts

A perennial topic of interest to programmers is their coding font. I’ve been using Inconsolata for as long as I can remember. I adopted it when I was still a Vim user and carried it over to Emacs. In my more than 17 years with Emacs, I’ve never used anything else.

Shockingly, to me at least, I started using Inconsolata before some Irreal readers were born. Still, every time I see an article about someone’s favorite coding font(s) I invariably have to look. As I’ve said before, my main requirement for a font is that I can discern the difference between 0, O, o, i, I, l, L, and 1. It’s surprising how many fonts get this wrong.

Jordi Ollé Ballesté has some excellent font porn in a post that lists his 10 favorite fonts. Some are paid and some, like inconsolata, are free. As usual, I didn’t see anything that made me want to move from Inconsolata but your mileage may vary.

It is, in any event, worth taking a look. Maybe you’ll find a new font but even if you don’t you’ll probably enjoy looking at the possibilities. As Ballesté says, your choice of font can make a big difference in your coding experience. Articles like Ballesté’s show you the possibilities.

Posted in General | Tagged , | Leave a comment

Nothing Today Because I’m Exhausted

Yesterday was a lost day. I haven’t been happy with my WiFi router so I got a new one and yesterday was the day that I was going to spend an hour or so installing it and updating my network. Installing the router and updating computers, phones, and tablets] wasn’t too much trouble although the router app was less than clear on a couple of issues. All that did indeed take less than an hour.

Then came the hard part. The Irreal bunker runs on Apple Home Kit and has several smart light switches, a TV, and a security camera all running on the network. I was hoping that once I updated the hub (aka the Apple TV) everything else would fall into place. Yeah right. Nothing worked and it took me all day to figure out what to do.

In the end, I had to delete each device and readd it. But that means I had to figure out how to get the device to go through pairing procedure again. It was, to say the least, not easy. The smart switches were particularly opaque but I finally figure out the spell.

That left the camera. You’re supposed to be able to stick a paper clip in the reset hole and do a network reset that allows it connect to the new network. As if. After some more research, I discovered that you could do a complete reset by holding the paper clip in for more than 10 seconds. After I did that, the camera connected to the new network and all is well.

I’m sure there’s an easier way to do these things but I couldn’t discover them. It should be a bit easier because, after all, changing your router isn’t all that unusual. Maybe it is, but I couldn’t find the spell. In any event, the Irreal bunker is back on line and assiduously pursuing our goal of world domination.

Posted in General | Tagged | Leave a comment

Why Isn’t Lisp Used More In Production Redux

I just came across an excellent Medium article by Kenichi Sasagawa that addresses the question of Why Isn’t Lisp Used More In Production that I wrote about the other day. My post took the somewhat cynical view that Lisp lost the language wars for the same reasons that Betamax lost out to the technically inferior VHS.

Sasagawa has a different view. He considers Lisp an “intellectual toy” in the good sense of bringing joy and fun to its users. Languages like Python, he says, bring to mind drudgery more than fun. Still, Python is very popular because it makes it easy to generate a lot of code easily. The batteries, as they say, are included.

I agree with Sasagawa completely about how much fun it is to use Lisp and I agree that it brings me a joy and pleasure that other languages don’t. What I don’t agree with is his implication that these other languages are more efficient than Lisp in the sense that it’s easier to generate code. My experience has been just the opposite: it’s easier for me to generate code with Lisp than it is with other languages.

Sasagawa’s article also speaks to another of my recent posts, Marlinspike On What’s Wrong With Software Development. Marlinspike claims that current development processes—largely imposed from above—have robbed all the joy from software development.

If you care about Lisp and software development, take a look at Sasagawa’s article. It’s short and a very interesting read.

Posted in General | Tagged | Leave a comment