A Bit of Wisdom…

…from Paul Graham

Posted in General | Leave a comment

Displaying Org-mode Notifications Natively on MacOS

As many of you know, I live happily in the Apple Ecosystem but do virtually everything that doesn’t involve the browser in Emacs. One exception is my calendar. Events like “Renew ACM membership” or “Research ways of doing \(X\)” are added to my todo.org file and appear in my Org Agenda. Events with a specific, hard date and time attached, such as a doctors appointment, are added to my Apple calendar.

That’s a bit schizophrenic, of course, but it works well for me. The advantage of using the Calendar app is that the event and details about it are synched to my other Apple devices—including my iPhone—and so go with me everywhere. It’s possible, certainly, to use an app like beorg or organice to get my Org-mode events synched to my iPhone but as I said, this system works well for me.

A potential problem with maintaining one’s calendar in Org-mode is alerts. The Calendar app will alert you to upcoming events even when you’re not in Emacs. It wouldn’t do to miss an alert from Emacs because you happen to be, say, in the browser. Christian Tietze has in interesting post in which he explores the beginning of a solution to the problem of having Emacs generate MacOS native alerts. It turns out to be pretty easy although there are some edge cases. Those seem reasonably easy to fix so if you’re interested in that type of functionality, be sure to take a look at Tietze’s post.

There are other possibilities. One is to use Growl. It’s a notification system that can receive messages from other applications and show them on a system wide basis. There is, of course, an Emacs interface. Or two. Another possibility is John Wiegley’s alert module, which he describes as a Growl workalike. Doubtlessly these systems would require a bit of integration but since I’m satisfied with my hybrid solution, I haven’t looked into what would be involved.

Posted in General | Tagged | Leave a comment

Strategies for Remote Work

Ever since I read Mike Elgan’s article on The New Bedouins back in 2007, I’ve been fascinated by the idea of remote work. These days, remote work is commonplace and becoming more so but in 2007 it was an impossible dream for most of us. Still, remote work isn’t always easy for either the employer or employee.

Two recent posts look at the problems from both perspectives. In the first, Josh Comeau recounts his experiences as a remote worker. His experiences may seem atypical but as he says, the point of remote work is flexibility and that, therefore, every remote worker’s experience is different. He discusses the problems and benefits but says that the main difficulty is communication. Remote workers aren’t privy to the water cooler discussions and it’s easy for them to feel isolated.

In the second post, Cédric Fabianski talks about remote work from the employer’s point of view. He has several interesting conclusions—including that “remote-first” companies do best with remote workers—but his main conclusion is the same as Comeau’s: the most essential problem to solve with remote work is communication.

Fabianski talks about the strategies that his company, bearer, uses to keep remote workers and everyone else up to date on their team’s progress and everything else that’s happening in the company. It’s an interesting read and reinforces everything that Comeau says about the importance of keeping remote workers “in the loop.”

Both posts are interesting and informative. If you have any interest in remote work, you should definitely take a look.

Posted in General | Tagged | Leave a comment

Expired SSL Certificate

I noticed this morning that Irreal’s SSL certificate expired last night. I’ve ordered a new one that should be active shortly (although it was a hassle last time so who knows). In the mean time you can still reach the site using the HTTP (rather than the HTTPS) URL.

Posted in Administrivia | Tagged | Leave a comment

Building a Personal Knowledge Base

I’m a big believer in collecting and storing information: in building a personal knowledge base if you like. I do this, of course, with Org-mode but that’s not the only possibility. Sung Cho has a nice post in which he describes how he built himself a personal knowledge base.

He started out by keeping his notes in Evernote but soon realized that he was spending all his time maintaining and polishing his notes but hardly ever using them. That led him to his first principal: Organizing knowledge should never become the goal. Rather, the goal should be to retain knowledge and help yourself learn. In keeping with this, he built himself a simple command line interface to a YAML database. He limited each note to a single line and didn’t use any tags.

In accordance with his second principal—searching is more efficient than organizing—he retrieved information by simply grepping for it. That was easy because of the third principal that the knowledge base should be local and open source. At this stage it was also plain text so the powerful Unix search tools could easily be applied for searching.

Overtime he has evolved his system to use an SQL database and made it accessible over the Internet. He also arranged for it to email him a digest of his recent entries to help him absorb the material. The whole system is open source and you can download a binary or source code from the dnote repository.

My own system pretty much adheres to Cho’s principals but I do use tags to help me search the data. I don’t obsess over them: I just tag the entries with keywords that I think suggest the data I’m entering.

Ali Abdaal has a similar system but he uses the proprietary Notion application and therefore violates the important rule that you must maintain control of your data and the means to access it. Abdaal has an excellent video on his system. It would be pretty easy to implement almost all of it with Org-mode so the video is worth watching even if you’re not interested in Notion.

Posted in General | Tagged , , | Leave a comment

Keeping An Open Access Site Online

I’ve written several times about the renegade pirate sites that curate scientific papers and make them available for free (1, 2, 3, 4, 5, 6). Their actions are clearly illegal and some say immoral but they’re a useful corrective to the equally immoral and predatory behavior of the scientific journal publishers. All of my previous posts have focused on Sci-Hub but it turns out there is another site, Library Genesis (LibGen), that has over 33 terabytes of books, papers, and other material available. Together, the two sites ensure the availability of the papers that researchers without access to University journal subscriptions need for their research.

The publishers and their governments are not amused and have done everything they can to shut these sites down but the open access movement is fighting back. A project started by redditors is seeking to make sure that LibGen is never again offline. That’s a substantial undertaking because in addition to suing the two sites, the publishers have fought to have the sites’ hosting shutdown or blocked. Read the Vice article linked above to see what the redditors are doing to keep LibGen online.

As I’ve said before, it’s easy to be conflicted about all of this. There’s no doubt that Sci-Hub and LibGen are stealing the papers but there’s also no doubt that the publishers are predatory rent seekers who abuse the original authors, the reviewers, the schools, their subscribers and even their own editorial staffs who are mostly unpaid university volunteers. In the end, the universities themselves will probably solve this problem by refusing, as the University of California has, to renew their subscriptions unless the publishers change their business models.

Posted in General | Tagged | Leave a comment

How to Alias Car and Cdr and Why You Probably Shouldn’t

A couple of days ago, I wrote about the minor controversy concerning the names of the Lisp functions car and cdr. Some people, mostly non-Lispers but also some who use Lisp, dislike the names and think they should be changed to something more mnemonic like head and tail or first and last. Paul Graham disagrees and tweeted an excellent, pithy argument as to why. I agreed with Graham and the post was really about his tweet.

Of course, being Lisp, it’s easy to alias the names to whatever you like. However, there is, at least for Emacs, a practical reason that you shouldn’t do that or at least that you should know what you’re doing before you try. Chris Wellons, who has a profound understanding of Emacs and Emacs Lisp has a very enlightening post as to why adding something like

(defalias 'head #'car)

to your init.el file is a bad idea. The reason for that is that Emacs Lisp recognizes the importance of car and cdr and has special byte code operators for them. When you alias car to something like head, the optimizer can no longer be sure that the meaning won’t change and therefore turns the head reference into a function call. Wellons has the details but the TL;DR is that the result runs twice as slowly.

This is Emacs so it is, of course, possible to do the alias and still have the result use the car byte code but you have to tell the optimizer explicitly to do so. Again, see Wellons’ post for the details.

Wellons’ post is a slight expansion of his comment to the reddit post asking how to alias car that I referenced in my original post. His explanation is generally useful, though, so I’m glad he made it a separate post.

Posted in General | Tagged | Leave a comment

How To Wrap The MacBook Power Cord

While learning how to pour organge juice, I stumbled on a video that shows you the right way to wrap your MacBook power cord into a small neat package that fits easily in your backpack:

Here’s another video that shows the same technique but emphasizes taking the strain off the cable so that it doesn’t fray prematurely.

Posted in General | Tagged , | Leave a comment

Car and Cdr versus Head and Tail

Right after parentheses, one of the things about Lisp that non-Lispers—and even some Lispers—like to complain about are the names of the two functions car and cdr. A common understanding is that car returns the first entry of a list and cdr returns everything after the first entry but they’re more accurately thought of as returning the contents pointed at by the first and second halves of a cons cell. That view helps us understand where the names come from.

The names are an historical artifact from the first implementation of Lisp and refer to a pair of assembly language macros used to access the two halves of the IBM 704 CPU registers. When a cons cell was in a register, the car macro would access the first half of the cell and the cdr macro would access the second half. Some Lispers have sought to replace these, admittedly opaque, names with something more intuitive and obvious such as head and tail or first and rest. Many have resisted these efforts, finding car and cdr short and perfectly adequate. Paul Graham makes a cogent argument for the traditionalists’ view:

I learned Lisp by reading Graham’s books so my thinking on Lisp matters is often informed by his but that aside, I agree with his tweet completely. It makes a convincing case for using car and cdr.

This discussion applies to Elisp too, of course, so Emacsers asking how they can alias car and cdr to head and tail should consider Graham’s argument carefully.

Posted in General | Tagged , , | Leave a comment

BPF: A New Type of Software

When I first saw the title of Brendan Gregg’s blog post—reproduced above—I had a small frisson of annoyance. BPF (aka Berkeley Packet Filter) has been around since 1992 as the kernel interface to tcpdump and here was Gregg appropriating the name for some other piece of software. I needn’t have worried. Gregg was, in fact, talking about the Berkeley Packet Filter but in its extended form as implemented in the Linux kernel. Actually, it’s been extended so much that it no longer has much to do with Berkeley, packets, or filtering. It implements a fairly powerful virtual machine that runs in the kernel.

Gregg recently gave a talk on BPF for the Ubuntu Masters Conference in which he describes the (extended) system and why it’s a new type of software. Rather than being a user application or kernel module, applications written for BPF run in user space but have access to kernel facilities through a special BPF API. There are many advantages to this approach including ease of implementation and safety.

Gregg works for Netflix and mostly uses BPF to instrument the kernel. He describes several examples in the talk that illustrates some of the things one can do with it. The system is a little complicated so your best bet is to watch the video for the details. If you’re really interested, Gregg has a book (out as an ebook, coming this month as a dead tree book) that describes the system in detail. It’s an interesting talk and definitely worth watching. Gregg’s post at the above link also has a pointer to the talk’s slides. The video is about 31 minutes so you’ll need to schedule some time.

Update added before publishing
ZDNet has an article on BPF and Gregg’s talk. If you’re interested in this technology, it’s worth reading after you watch the video.

Posted in General | Tagged | Leave a comment