Video Introduction to Magit

Over at the System Crafters Youtube channel, David Wilson has a new video on Magit. It’s the first in a planned series so it serves as an introduction to the most important Magit facilities with more information on them to be forthcoming in future videos in the series.

The video concentrates on the status screen and what each of the sections means and how to display more or less information in each of them. He also goes over how to stage, commit, and push commits to a remote repository.

Wilson says, and I agree, that Magit is a much more efficient way of using Git than the command line. Others have said that it’s the most efficient way. I don’t doubt that but I obviously haven’t tried them all.

If you’re interested in Git and are an Emacs user, you should definitely take a look at this video. I looking forward to the rest of the series. The video is just short of 33 minutes so plan accordingly.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Dark Mode and Sanity

The Minions, fresh off their recent victory in sneaking another light-mode/dark-mode post into the queue, have struck again. Here we have Kontra’s take on the eventual dénouement of the dark-mode fad:

This is, of course, another example of Kontra’s wry wit but I must admit to a certain sympathy. With my eyes watering from site after site with unreadable dark blue on black text, I often feel the urge to stick a pencil in my eyes. And to tell the truth, I do feel depressed looking at those dreary dark-mode sites.

Of course, as I always say, the choice is up to you. Just don’t blame me if you find your sanity deteriorating.

Posted in General | Tagged | Leave a comment

Brian Kernighan on the Birth of Unix

Over at CoRecursive they have a really excellent interview with Brian Kernighan on the birth of Unix. The interview starts out with this quote from Adam, the interviewer:

When you work on your computer, there are so many things you take for granted: operating systems, programming languages, they all have to come from somewhere. In the 1960s, that somewhere was Bell Labs, and the operating system they were building was Unix. They were building more than just an operating system though. They were building a way to work with computers that had never existed before.

That’s telling, I think, because we take the Unix model so much for granted today but back in the 60’s and early 70’s it was all about punched cards, Fortran, and waiting half a day to get the results of your program run back.

Unix famously grew out of the desire on the part of Ken Thompson, Dennis Ritchie, and a few others to recapture the comfortable programming environment they’d experienced while working on Multics. In the beginning, Unix was very much a skunk works project that was developed on an unused and forgotten PDP-7. The Unix engineers basically conned AT&T management into formalizing the development by promising a word processing system for the Patent Department.

The interview is long, which is one of the things that makes it so useful because it leaves plenty of time for revealing vignettes. One of the recurring themes is what a genius programmer Ken Thompson is. In one story Kernighan tells how he, Thompson, and Joe Condon were puzzling over how to figure out how their new typesetter worked. They didn’t have source code for the program that ran it but they did have the binary. Kernighan took a dinner break and when he came back, Thompson had written a disassembler. Then, of course, he wrote an assembler for the minicomputer that ran the typesetter so they could produce their own program for it. There’s more like that in the interview.

The text is a transcript of a podcast so you can listen if you’d rather. There’s a button on the page for playing it in case you want to listen.

Posted in General | Tagged | Leave a comment

Punch Cards

It’s likely that very few Irreal readers have ever used punch cards or maybe even know what they are. Nevertheless, they were once the mainstay of the computer industry. Indeed, IBM started out as a company that made punch-card-tabulating machines for the U.S. Census. If you’re really an oldtimer, you may even have called them Hollerith cards, named for the man who invented them and got the whole thing rolling.

In those days, there were no terminals or other interactive access to computers. Everything was batch and the way you input things—programs or data—was through punch cards. The last few columns of the card were theoretically reserved for sequence numbers but nobody ever used them for that. That led to many exciting experiences when a card deck containing your program or data was dropped and scattered on the floor.

Caleb Scharf over at Slate has an interesting article on punch cards and their role in our industry’s history. It’s based on his book The Ascent of Information: Books, Bits, Genes, Machines, and Life’s Unending Algorithm. The article doesn’t quite capture what it was like dealing with the cards and their periphery, such as key punches and card readers, but it does have lots of interesting details about the cards and their influence.

Scharf presses a connection between punch cards and biological processes that I find a little strained but the article is still interesting and worth a read if you’re interested in retrocomputing. It’s also worth a read if only to discover how easy we have it today. Believe me, a crashed disk or corrupted file system are way less common than a dropped card deck. And did I mention card readers regularly shredding cards? That gave rise to the universal sobriquet “card eater.”

Posted in General | Tagged | Leave a comment

Another Reason Elfeed Is The Best RSS Reader

As you all know, I’m a big fan of Chris Wellons’ Elfeed package for reading my RSS feed. There’s a lot to like. Wellons reimagined what an RSS reader should be and organized it around search. Most of the time, the search is implicit, defaulting to “show me the unread entries for the last 6 months” but you can specify anything you want.

The other day I saw this tweet from Karl Voit

and it made me realize another advantage of Elfeed: it never goes down. Or at least if it does it’s because your computer or Internet connection is dead.

That’s not to beat up on NewsBlur. Every cloud service—even those run by giant corporations with hoards of first rate engineers like Apple, Google, or Microsoft—has periods of downtime. The thing about Elfeed is that it doesn’t depend on any remote servers other than those hosting the sites in your feed. If one of those goes down, you simply don’t get its articles until it comes back up.

Elfeed holds every article in every one of your feeds in its local index making it easy to revisit any article you’ve ever seen. Even so, after four years my index is only 162 Megs. None of that depends on anything external to work.

Posted in General | Tagged | Leave a comment

Lisp and Replace-Regexp

Álvaro Ramírez has a nice post that reminds us of one of those things you don’t need very often but when you do it’s exactly the right tool. Emacs has many ways of doing mass replacements but one of the most fundamental is replace-regexp. It and its sibling query-replace-regexp are generally the first method an Emacs n00b learns for performing find and replace operation.

Being Emacs, these functions are, of course, more powerful than their cousins from other editors and word processors. The first big advantage is that you can search for a regular expression rather than just a text string. Of course many other editors have this feature but Emacs allows you particular power in forming the replacement string.

As Ramírez points out in his blog post Emacs: smarter search and replace, you can do arbitrarily complex replacements because Emacs allows you to use Elisp to form the replacement string. That means you can transform the input string in just about any way you like. Ramírez use a recent question from Reddit as a test case: how can you apply a function to every number in a buffer?

The secret is to merely use \,(some Elisp) as the replacement string. To help out with forming the replacement, Emacs provide \& and \n as variables that contain the entire matched string and the \(n^{\textrm{th}}\) submatch. You can also specify those as \#& and \#n in which case the match is converted to a number before being passed to the Elisp. You can see all this in action by taking a look at Ramírez’s post.

I probably don’t use the \, replacement more than once a year but when I do I’m really happy to have it. Given how seldomly you’ll probably use it, you don’t have to memorize the details. Just knowing it exists is enough because it’s easy to look it up with describe function.

Posted in General | Tagged | Leave a comment

The Evolution of Unix

I’ve written about Diomidis Spinellis and his wonderful Unix repository before. It’s a single place you can go to get most of the publicly available Unix source code. As I’ve said previously, one of the best ways of becoming a master developer is to read the code of the masters. Spinellis’ repository allows you to do just that and is definitely worth checking out if you haven’t already.

For the last five years Spinellis and Paris Avgeriou have been researching the evolution of Unix and have produced a paper documenting their work. You can see read a summary of the work at the above link or you can read the whole paper here.

It’s an interesting study and definitely worth taking a look at if you have any interest in Unix, which, of course, you should. One of the big lessons is how well thought out the original architecture was. It formed a sturdy base from which modern versions evolved.

There’s been a lot of evolution. The first edition Unix had 2489 lines of kernel code and 9095 lines of programs. That’s even more amazing when you realize that those were lines of assembly code. Today’s FreeBSD distribution has more than 20 million lines of code, mostly in C.

The summary is short and every Unix user should take a look. It’s a reminder about what an astounding achievement Unix is.

Posted in General | Tagged | Leave a comment

Innovation at the Office

COVID-19 has dramatically reset worker expectations. Prepandemic, most people just assumed being in an office was part of having a job. Now, however, those workers have seen how well working from home works—especially for them—and many of them say they’ll quit rather than go back.

Still, some CEOs, like Apple’s Tim Cook and JP Morgan’s Jamie Dimon, are taking a hard line and insisting that their employees return to the office. The usual reason given for such stands is the idea of serendipitous meetings at the water cooler that result in impromptu innovation. You hear the same argument in support of open offices: people need to be close so that a magical collaboration can occur.

The problem is that it’s almost certainly not true. Researchers who study the question say that they can find no evidence of this phenomenon and that it’s more of a fairy tale than reality. There is, to the contrary, evidence that all that close proximity actually results in less collaboration and innovation. The reason for that will be obvious to anyone who’s had to suffer in an open office: when you hear constant chattering and nattering, you put on your headphones and disengage with those around you. There are other problems as well. You can read about them at the above link.

Here’s another article making the same point. As usual with received wisdom, when you take a closer look, cracks start to appear. Both of the articles acknowledge that face-to-face conversations can be useful but that meeting with your colleagues every 3 months or so may be better than everyday.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Unintended Consequences

Irreal readers are, I’m sure, smarter than the average politico so they would know better than to pass a law like this Colorado bill without considering the consequences. On its face, the law doesn’t seem controversial; it’s just a little bolt tightening on the equal pay for equal work legislative framework. However, the law contains this proviso:

(2) AN EMPLOYER SHALL DISCLOSE IN EACH POSTING FOR EACH JOB OPENING THE HOURLY OR SALARY COMPENSATION, OR A RANGE OF THE HOURLY OR SALARY COMPENSATION, AND A GENERAL DESCRIPTION OF ALL OF THE BENEFITS AND OTHER COMPENSATION TO BE OFFERED TO THE HIRED APPLICANT.

What could go wrong? It turns out that some employers looking for remote workers didn’t want to disclose the salary range they had in mind so they simply said that Coloradans need not apply. The point here is not whether you think the proviso is good or bad, merely that it had an easily foreseeable consequence that the bill’s authors should have anticipated.

As with the last time Irreal considered unintended consequences, the problem is that those pushing for and passing this legislation failed to see how easily the intended targets of their law could bypass it. The French rich simply left France; Employers simply didn’t make their jobs available to Coloradans. In both cases, those that the laws were ostensibly meant to help were harmed instead.

Sadly, this sort of thing happens all the time. The unintended consequences are so easy to foresee that a cynic might conclude that those responsible are either incompetent or simply don’t care. Here’s a little test—or exercise, if you prefer—to see how well you’ve absorbed this lesson: what do you think will be the result of this?

Posted in General | Tagged , | Leave a comment

Technology Saves the World

Everything you read about tech these days is more or less a screed on the evils of the technology community. The smugly ignorant journalists of the tech press, most of whom wouldn’t know code from a cod, float every conceivable bit of nonsense and conspiracy theory all with the message that tech is evil and something should be done about it. The pandering ignoramuses in Congress are only too happy to comply.

It was a pleasure and relief, therefore, to read Marc Andreessen’s post Technology Saves the World. The TL;DR is the technology saved us from what—only a few years ago—would have been a five year wait for a COVID-19 vaccine and a probable reprise of the great depression.

While the astounding and speedy success of the vaccine program is probably technology’s greatest triumph, there were plenty of others. Among knowledge workers there was virtually no down time. That, of course, was made possible by the work-from-home technology that while nascent was already underway. Andreessen says that he talked to hundreds of CEOs and they were uniformly surprised at how well remote work worked from the very beginning.

Even nominally customer-facing workers were able to pivot to online ordering and delivery. Hence we could order groceries, meals, or whatever else we needed and have it delivered to our door. This worked remarkably well even though many small businesses bore the brunt of the lockdown.

The press, of course, responded to this by complaining that tech companies such as Amazon and Apple were making huge amounts of money. I remember in the middle of the crisis the Wall Street Journal was complaining about Amazon and some one asked who you’d rather have in the midst of COVID-19: the Wall Street Journal or Amazon. The question answers itself.

If, like me, you’re weary of the negative drumbeat from the tech press, take a look at Andreessen’s post. It will be a welcome respite.

Posted in General | Tagged | Leave a comment