Polyglot Documents in Org-mode

The University of Oxford Software Engineering Research group (OxRSE) has an interesting post on how they use Org-mode to publish tutorial material with the examples in different programming languages. The idea is to present the concepts, which are language agnostic, in a language familiar to the student. The language specific material includes both example and the accompanying narrative.

Of course, they don’t want to maintain separate documents for each language since most of the material is independent of the language and would be the same in each such file. Emacs and Org-mode to the rescue.

Org-mode, along with Babel, is already an ideal solution for writing technical material but there’s another Org feature that provides just what OxRSE needed: tags. They can mark code examples and the accompanying prose with a tag for that particular language. Then when they want to export the document for a particular language, they can add the tags for the other languages to a #+EXCLUDE_TAGS: directive.

It’s a nice technique for most situations where you’d like to maintain a single document for several slightly different versions of the same material. The post has a toy example for a tutorial on the Hello, World program but it’s so simple to implement that you hardly need the example.

If you have to the same document in slightly different flavors, be sure to take a look at this post.

Posted in Blogging | Tagged , | Leave a comment

Red Meat Friday: Word as a Random Number Generator

As you all know, Word is one of my favorite whipping boys. I often say it’s the worst piece of software ever foisted on an unsuspecting public. Doubtless that’s hyperbolic but Word is something I try never to use. Karl Voit apparently feels the same:

If you’re in any doubt as to what Voit really thinks, there’s this:

Posted in General | Tagged | Leave a comment

Emacsclient and macOS

As I’ve said many times, Emacs is the first thing I start after a boot and it stays running until the next boot or I update packages that need a restart. That means that Emacs startup time is a non-issue for me. If you’re one of those people who like to start Emacs when you need it and shut it down afterwards, Emacs can be painfully slow to get running. Fortunately, Emacs has you covered. You can start Emacs in server mode and use emacsclient to bring up a frame whenever you need one.

Sadly, it’s hard to start a GUI Emacs frame without going through the terminal first. Dante Catalfamo has a handy post that discusses his method of starting GUI frames with emacsclient. He uses iCanHazShortcut to map hotkeys to actions that would otherwise require invocation on the command line. I’ve always used Alfred or Quicksilver for things like that but iCanHazShortcut seems like a nice lightweight solution if you don’t want or need the power of Alfred or Quicksilver. Really, macOS should have the hotkey capabilities built in but the above utilities are free and more than capable.

In any event, if you’re an Emacs user on macOS, you should take a look at Catalfamo’s post. It’s a short and easy read.

Posted in General | Tagged | Leave a comment

Websockets from Emacs

Websockets are a way of providing two way communication between a Web server and a browser. Their benefit is that the server can send data asynchronously to the browser. That differs from the normal protocol of the browser sending a request and the server responding. With websockets, the server can send data whenever it needs to. A good example of their use is in the Web-based chat applications that many companies use for customer support.

Naturally, Emacs has a way of interacting with Websockets. You can write code to act either as a client or server. Adrien Brochard has a very nice post that illustrates the use of emacs-websocket package for using websockets.

Brochard’s post is sort of a minitutorial. He shows how to use the basic interface to send a message to the server and to write a server side function that refreshes a page on the browser whenever it’s code on the server is updated. The interface is simple and easy to use. Brochard’s examples include some code written in Javascript that talks to Elisp code using websockets.

If you have any interest at all in websockets or working with them, be sure to take a look at Brochard’s post. It’s an excellent introduction and well worth the time to read.

UPDATE [2020-07-15 Wed 13:53]: Fixed link to Brochard’s post.

Posted in General | Tagged | Leave a comment

Idiosyncrasies in Academic Publishing

If you’ve been around for a while, you know that I’m not a fan of academic journal publishers and their rent seeking. Happily, those days are years behind me now but for thousands of academics the process and its indignities are a daily reality.

One of the points of my rants is that it’s hard to see exactly what value the publishers bring to the process. Bastian Rieck has a post that provides some insight into that question. It turns out, according to Rieck that mostly they just add work for the authors. Read his post for an infuriating list of examples.

What’s ironic is that’s many of the things that Rieck finds annoying are simply the result of “that’s how we publishers have always done things.” The irony lies in the fact that the reason they can continue doing things the same old way—and seeking rents—is that academics also insist on doing things the way they’ve always done them: Want tenure or promotion? Publish in the top journals. Want to publish in a top journal? Abide by their annoying and nonsensical rules.

Rieck’s solution to this problem is a bit different from mine. I think either the publishers must be eliminated entirely or they must change their business model to charge for publishing instead of reading papers. Rieck just wants them to be a little more transparent about how they spend all that money they make and maybe share some of it with the people doing all the work. He’d also like the publishers to hire more competent people to do the final tweaking of the LaTeX. No doubt all this would help but the problems run deeper with than that.

Even if you aren’t in academia, Rieck’s post is a revealing peek into the publishing process. Doubtless, we all have similar inanities in our own jobs so it’s comforting to know others are suffering their own Sisyphean trials

Posted in General | Tagged | Leave a comment

Ransomware: Prevention & Recovery

A couple of days ago, I mentioned Backblaze and their newsletter with an article about Tips for working remotely. That newsletter has a link to an older article that discusses how to prevent a ransomware attack and recover if you get one. It’s a fairly long article that covers a lot of ground.

Sadly, ransomware is a growth business. Between Q1 and Q3 of 2017, attacks grew from one every 2 minutes to 1 every 40 seconds. Thing haven’t gotten any better. Hardly a day goes by with a report of another attack and some hapless company or government entity trying, often times unsuccessfully, to recover.

Infections can be difficult for big organizations to prevent because every employee has to security aware and vigilant. The means of infection are mostly the usual vectors of phishing, corrupt Websites, and social media. There are some other methods mentioned in the article so be sure to take a look.

The best part of the article, I think, is their discussion of what to do when you get infected. That includes isolating any infected machines from the local network, of course, but also the best way to go about recovering.

Effective recovery assumes, of course, that you have a backup of your data. That could be local or, better yet, a cloud based backup service. After that, the most important step is to complete wipe your system and start from scratch. They even recommend formatting your disks. Otherwise, the infection could reestablish itself.

Needless to say, the article suggests Backblaze as the means of backing up your data. They, of course, have an ax grind but I don’t and as I said in my previous post I’m really happy with them. They have a history of your files going back 30 days (a year for $24/year more) so you can recover your files before they were encrypted even if some of the encrypted files were also backed up.

If you care about the data on your computer, ransomware is a terrifying threat but a decent backup can make recovery as pain free as possible.

Posted in General | Tagged , | Leave a comment

Magit: The Emacs Killer App

Over at DistroTube, Derek Taylor has posted a video that makes the case that for many people, Magit is the killer app for Emacs. He thinks that’s especially true if you’re primarily a developer.

I use Magit everyday all day but for me the killer app is Org-mode. Taylor notes that Org-mode is the killer app for many people so we’re not really in disagreement. It depends on your workflow and what you’re doing with Emacs.

Most of the video is a short demonstration of Magit so if you’re wondering what all the excitement is about, this video is a good way to get an idea. The video is 9 minutes, 40 seconds long so it should be easy to fit it in.

Posted in General | Tagged , | Leave a comment

Some Remote Works Tips from Backblaze

I use Backblaze to backup my work. If you don’t have a backup service of some sort, you’re just an accident away from disaster. My recent debacle with my laptop illustrates the point nicely. Without backups I would have lost all my data, including Irreal, tax documents, medical records, and a host of other important information. Fortunately, I did have a backup service in place so recovery was fairly easy.

If you’re looking for a backup service, I can recommend Backblaze. The backup is continuous and seamless. You never have to think about it except to pay for the subscription once a year or recover your data if a disaster occurs. They’re very reasonably priced so there’s really no excuse not to be backing up your date either with them or some other service.

Occasionally, Backblaze sends me a newsletter with various articles that they think may be useful or enjoyable. The most recent such letter was entitled Welcome to the Digital Nomad Life. It’s a series of tips for those who were suddenly thrust into the remote work lifestyle. It’s not about technical issues such as what microphone or camera is best but instead lists ways to make working from home more pleasant and strategies for dealing with interruptions. It’s a short article and may help with a new and unexpected working environment so there’s no reason not to check it out.

Posted in General | Tagged | Leave a comment

The 500 Mile Email

I vaguely remember writing about this before but I just saw a reference to it and it’s such a great story that it should be repeated every few years. Trey Harris tells a funny and instructive tale about how even the seemingly impossible can happen in our industry.

Harris was a system administrator at an unnamed university who took care of the campus email system. One day the Statistics Department called up and said that their email was broken. They couldn’t send an email further than 500 miles. Well, actually, a little bit further but effectively 500 miles. Harris’ reaction was the same as yours or mine would have been: Cripes! Another luser with no understanding of tech or email.

Except that when Harris went to the department and checked things out, it turned out to be true. An email to a site less than 500 miles, no problem; greater than 500 miles, the send failed. If you know anything at all but how email works, you know this should be impossible. It couldn’t possibly be true and yet it was.

I won’t ruin the story by telling you the answer; you’ll have to read Harris’ story for that but, believe me, it’s definitely worthwhile. It’s also a good lesson. Sometimes the seemingly impossible can be true and when you figure out why, it’s a great lesson and a great source of barroom tales. You might even get someone to buy you a round.

Posted in General | Tagged , | Leave a comment

Organizing Workflow with Notion (and Org-mode)

Ali Abdaal, whom I’ve written about several times before, is a physician in the UK. Starting back when he was still in medical school, he’s been posting YouTube videos on how he studies and organizes his life. If you’re into productivity hacking, he’s definitely worth following.

He’s just posted a video on how he uses Notion to organize his YouTube activities. That doesn’t sound too exciting until you discover that he makes more from his Youtube videos than he does as a doctor. Although he describes his YouTube and other activities as a “side hustle,” a case could be made that medicine is the real side hustle and that he’s primarily a YouTuber. He’s currently aiming at posting 3 videos a week and has a support team to edit the videos and perform other vaguely administrative chores.

He’s a “Junior Doctor,” which in U.S. terms is something like an intern or resident. That means he’s always busy at the hospital and has to be as efficient as possible in his video endeavors. The current video describes the process he uses and how it’s all mediated by Notion.

Watching the video, I was struck, as I was with his previous videos, how everything he does with Notion could be done just as well with Org-mode. One of his big wins with Notion is the use of a template to organize and track a new video. As soon as I saw that I immediately thought of how I use yasnippet to do the same thing in Org-mode. If you’re an Org user and watch his video, you’ll be immediately struck with how seamlessly his process carries over to Org-mode.

Some of the things he says in the video about his structured planning of videos makes me think that I should adopt some of his ideas for writing Irreal posts. I have a process that’s sort of like what he does but his video shows there’s plenty of room for improvement. The nice thing is that I could adopt his entire procedure in Org-mode if I needed to.

Posted in General | Tagged , | Leave a comment