Digital Nomads in 2022

Long time readers know that I’ve been fascinated by the idea of digital nomads since reading Mike Elgan’s article on The New Bedouins in 2007. Back then, it was mostly journalists and a few IT people who were able to live the life of the digital nomad. Since then, the practice has become much more common and there are now many companies that operate exclusively with remote employees.

The practice has become so mainstream that even Bloomberg has taken notice. They’ve published an article that serves as an update on digital nomadism. Being a digital nomad is a little different from what’s become known as “remote work”. The digital nomads don’t want to work from home; they want to go to exotic, usually warm, places. They’re very apt to move on after a few months for somewhere new so they’re not digital expats either.

Of course, being Bloomberg, the article makes the point that the digital nomadic life may not be for everyone and can be fraught with difficulties. There are local laws and tax issues to deal with and as the article observes, the beach is just about the worst possible work environment.

If, like me, you’re fascinated with the idea of working from exotic, pleasant places, take a look at the article. They even have a list of the top five destinations (for various values of “top”).

Posted in General | Tagged | Leave a comment

The Case for Emacs, Vim, and Nano

Over on the Red Hat site there’s a post that makes the cases for the Emacs, Vim, and Nano editors. That may seem like blasphemy to some but different people do have different needs and expectations from their editors.

The first problem is that the post begins with the quote, “Text editors. They aren’t something that most users put a lot of thought into.” Huh!?! Sometimes it seems like that’s all we think about. As ESR once said, programmers spend most of their tube time in their editor so of course we spend a lot of time thinking about them.

I’ve used all three of those editors, although I’ve used Nano only when building a Gentoo Linux system until I could get a real editor installed. The section on Nano pretty much supports this: It’s a simple, straightforward editor that’s intuitive and easy to use. I’m not sure why any serious developer would use it other than to bootstrap a system where other editors aren’t available.

I thought the section on Vim was the best and most compelling. The writer, Ricardo Gerardi, makes a good case for Vim and details all its advantages. It’s fast, light weight, and has the wonderful composable command set.

Sadly, the Emacs section was the least persuasive. As I’ve said many times before, if you want a fast, flexible, intuitive editor, Vim is for you. If you want a programming environment that serves as a sort of operating system—or more to the point, a sort of Lisp Machine—then Emacs is for you.

As for Nano, I suppose you could think of it as a replacement for ed in those situations where you need an extremely lightweight editor to get things going but I can’t imagine using it in my day-to-day work. Of course, other folks disagree. The nice thing is that there are plenty of editors that will meet almost anyone’s needs.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Seek Help

Here’s a stunning example of retro abuse. I get that it’s fun—for some people—to revisit old tech but if this looks good to you, seek help. I’m old enough to have worked with those terminals—both the green and amber versions—and I can tell you, unequivocally, that there’s no way I’d choose to go back.

Emulations like this are fine for pranking that annoying guy at the office but I can’t imagine anyone choosing to use it. But that’s me. Judging from the comments, there are a lot of folks who disagree. Whatever floats your boat as they say but I’m happy running Emacs in GUI mode and failing that in a decent, modern terminal.

Of course, all this from a guy who yearns for his very own Lisp Machine.

Posted in General | Tagged , | Leave a comment

Mickey On Shells & Emulators

Mickey from Mastering Emacs has posted an excellent summary of shells & emulators in Emacs. The subject can be a little confusing—mostly centering around the difference between a shell and an emulator—so if you’ve ever been uncertain if you should be running shell, term, or ansi-term be sure to check out his post.

If you’ve used any of those you know that they all have limitations. Mickey’s post tells you how to work around some of those limitations and how to do things like change the default shell or stop the duplicate echoing of shell input. He also discusses Vterm and Eshell.

Mickey’s first recommendation is to consider whether you need a shell at all. Emacs, after all, has Dired for file manipulation, Magit for Git interaction, built-in network utilities, and the compile function to compile and test your code. Even as a long time command line guy, I’ve found that I rarely need to invoke a shell these days.

If you do need a shell, Mickey recommends either shell or eshell. These have the advantage that you’re working in an Emacs buffer so you have all the usual Emacs capabilities available for working with the text. I like Vterm because it gives a much better emulation than the others but as Mickey says, you won’t have the valuable Emacs features available for working with the buffer.

Finally, there’s a long list of comments that are also worth reading. Especially Ramin Honary’s comment on using coterm for better terminal emulation. As always with Mickey’s posts, this one is very much worth reading

Posted in General | Tagged | Leave a comment

Google and Your Data

I’ve told you, and told you, and told you but some people aren’t listening. Here’s a tweet from a graduate student who, as part of a Digital Archiving class, had a list of people running in a local election and stored it on her Google drive. Google, of course, deleted it.

The tweet itself is bad enough but follow the thread by clicking on “Read the full conversation on Twitter.” In particular, take a look at this response:

Years of data lost because some Google algorithm got it wrong.

Kramer appears to be pursuing a graduate degree in Library Science so you’d think she’d be a little bit more savvy. Google has a well established track record of doing this sort of thing and as someone interested in digital archiving you’d think she’d know this. Or at least that her professor would.

As I’ve said before, I used to feel sorry for these people but no longer. If you keep committing your data to a service that thinks it’s their duty to delete your data for various dubious reasons, you’re going to get what you deserve. At least backup your data on a portable drive. They’re dirt cheap: even a grad student should be able to afford one. Just don’t expect tears from me.

AFTERWORD

After I wrote this but before I published it, this story appeared. Just think: a million words lost. Irreal knows about a million words and it is, believe me, a lot to lose. To be sure, this is in China but the principle is the same. Commit your work solely to someone else’s computer and you’re going to suffer.

Posted in General | Tagged , | Leave a comment

Eshell Prompts

Just a quickie today. Bytedude wanted to customize his Eshell prompt to add the date/time. With most shells, that’s simply a matter of changing an environment variable but with Eshell it’s a little more complicated.

It turns out the Eshell forms the prompt by calling a function and if you want to change the prompt you have to provide a new function. That’s easy because the function is pointed to by a variable so you need only change the variable to point at your own function. The function itself need merely form the desired string for the prompt.

A slight complication is that Eshell needs to be able to recognize prompts. It does that with a regex so if you change the prompt, you may need to change the regex. Take a look at Bytedude’s post for the details. The Emacs Wiki also has documentation on setting Eshell prompts that is worth taking a look at if you’re interested in customizing your Eshell prompt.

Posted in General | Tagged | Leave a comment

Quadratic Equations Reconsidered Redux

I did a poor job of making my intended point in Irreal’s Quadratic Equations Reconsidered post. The intended point was that Loh had discovered a method of solving quadratic equations without having to remember—or, heaven forefend, rederive—the quadratic formula or to invoke the usual guessing at the factors.

The post showed why the roots of \(x^{2}+bx+c\) sum to \(-b\) and have the product \(c\). The second observation was that since the sum of the roots is \(-b\) their average is \(-b/2\) and that therefore the roots must have the form \((-b/2-u)\) and \((-b/2+u)\) and that since their product is \(c\), we must have \(u^{2}=b^{2}/4 -c\).

I left the technical details there and judging from the comments, readers thought the method involved remembering \(b^{2}/4 -c\) instead of the quadratic formula. They even pointed out that \(b^{2}/4 -c\) is really just the usual discriminant, for the special case of \(a=1\), in the quadratic formula.

But the real point was the method so let me solve a couple of equations to illustrate. First up: \[x^{2}-8x+15=0\]
The roots sum to \(8\) so their average is \(4\) and therefore the roots are \((4-u)\) and \((4+u)\). Since their product is \(15\), we have \(16-u^{2}=15\) so \(u=1\) and the roots are \((4-1)=3\) and \((4+1)=5\).

When the \(x^{2}\) coefficient is not \(1\), we just divide by it first. Thus to solve \[2x^{2}+8x+6=0\] we divide both sides by \(2\) to get \[x^{2}+4x+3=0\]
Now, the roots sum to \(-4\) so their average is \(-2\) and the roots are \((-2-u)\) and \((-2+u)\). Since their product is \(3\) we have \(4-u^{2}=3\) so \(u=1\) and the roots are \((-2-1)=-3\) and \((-2+1)=-1\).

I chose those roots to be simple integers so as not to bog down in more complex arithmetic but the method works fine when the roots involve radicals or are complex. The point is that the only thing you have to remember is that the sum of the roots is \(-b\)—and that therefore the roots are of the form \((-b/2 \pm u)\)—and that their product is \(c\).

Posted in General | Tagged | Leave a comment

DWIM Shell Now Supports Multiple Languages

Álvaro Ramírez continues to experiment with his DWIM Shell Command package. The basic idea was that to provide a framework that made it simple to invoke a command that has complex arguments and options directly from Emacs. Ramírez has published a few posts that demonstrates its use and advantages that Irreal has reported on.

Now, Ramírez has realized that sometimes you have a bit of code in some language or another to do some task. If the language can take input from STDIN, there’s no reason that DWIM Shell couldn’t invoke those too. His latest iteration does just that.

It’s a really nice extension to his previous framework. It allows you to define frequently occurring tasks as Emacs functions that invoke the appropriate commands just as if you had entered them from the shell. Ramírez notes that you can, of course, accomplish all this with Elisp but that the DWIM Shell framework provides an easy way of doing it even if you don’t know Elisp.

There’s no news as to whether this code is headed for MELPA or some other repository but it’s a single file and easy to grab if you want to play around with it now. I’m pretty fluent with Elisp so I could always do these things directly but Ramírez’s package provides an easier way to perform these functions.

Posted in General | Tagged | Leave a comment

Mickey on Keyboard Macros

The incomparable Mickey of Mastering Emacs fame has a really nice post on the power of keyboard macros. Most of us, even experienced Emacs users, tend to think of keyboard macros as a way of automating repetitive text editing but they’re actually much more powerful than that.

The key is that when you’re recording a macro, Emacs records everything you do. Thus, to use one of Mickey’s examples, it’s a simple matter to record your actions while you’re configuring your Emacs window setup and then use that macro whenever you want that particular setup in the future. Of course, to do that you need some way of persisting your keyboard macros across Emacs sessions.

That’s easy to do and Mickey explains the process, including how to turn the keyboard macro into a function that you can call in the normal way with Meta+x macro-name. Mickey also explains how to edit, debug, and step through a keyboard macro.

As Mickey points out at the beginning of his post, Emacs has all sorts of users and many of them don’t know or want to learn Elisp. Still, they, like the rest of us, have tasks they’d like to automate. Rather than having to learn Elisp, a simple keyboard macro will often provide just what’s needed.

All Emacs users should definitely read through Mickey’s post, probably more than once. You might even want to bookmark it so you can easily retrieve the details of working with keyboard macros.

Posted in General | Tagged | Leave a comment

Quadratic Equations Reconsidered

All of us remember quadratic equations, probably not fondly. If the need arises to solve one in our professional lives, our usual solution is to use the quadratic equation, which we may or may not have memorized through having had it drilled into our heads in Algebra I. The quadratic equation is what you get from applying the “complete the square” method to \(ax^{2}+bx+c\). Unless you’re a mathematician, that probably doesn’t mean much to you, even if you understood it at the time.

The mathematician Po-Shen Loh has discovered an incredibly simple method of solving quadratic equations that, astoundingly, doesn’t seem to have been known before. It’s based on the observation that if \(r\) and \(s\) are the roots of \(x^2+bx+c\) then \[x^2+bx+c = (x-r)(x-s) = x^2 -(r+s)x +rs\] so the sum of the roots is equal to \(-b\) and their product is \(c\). Therefore, the problem reduces to finding two numbers whose sum is \(-b\) and product is \(c\).

That may not seem a whole lot easier but Loh observed that if \(r+s=-b\) then their average is \(-b/2\). Two numbers will sum to \(-b\) precisely when their average is \(-b/2\). Those two numbers must be of the form \((-b/2-u)\) and \((-b/2+u)\) (because the average of two numbers lies mid way between them) so we need only find \(u\) such that \(b/2-u\) and \(-b/2+u\) have the product \(c\). That yields the equation \(b^{2}/4 -u^2 =c\). That’s easy to solve for \(u\) but the important point is there’s nothing to remember except that the roots sum to \(-b\) and multiply to \(c\).

You can find more details from Loh’s paper on the method, which is easy to read, but if you want to see a very simple demonstration of the method complete with examples take a look at his video. Watch the video and try a couple of examples to set the method and you’ll never have to worry about the quadratic equation again.

Posted in General | Tagged | Leave a comment