Tracking Exercise with Org-mode

Polaris64 has a very interesting post about using org-mode to track his expercising. That doesn’t sound particularly interesting, I know, but read on to find out why I find it worth mentioning. If I wanted to track my exercising, the first thing I’d think of is to enter it into an Org-mode table. For historical or other reasons, Polaris64 keeps his exercise data as part of a more general daily journal.

The top-level heading is the date and under each date there are several second level headings, one of which is “Exercise.” Under Exercise there are third level headings that specify the type of exercise and its “value,” its duration or number of reps, for example. A typical entry looks like

*** Crunches 100

Now comes the interesting part: Polaris64 wanted to summarize the exercising entries into a table. Stop and think for a second how you’d do that. If you’re not intimately familiar with Org programming you’re probably envisioning something involving heavy use of regular expressions and loops. I’m not invoking Jamie Zawinski here; that seems like a reasonable solution but Org offers a better one.

Org has several built-in functions dedicated to parsing Org data and extracting information from it. Polaris64’s post details how to use these to build an efficient solution to his problem. That’s the reason his post is interesting. It offers an excellent go-by for dealing with Org data. If you need Org functionality beyond that provided by the UI, this information is really useful.

Posted in General | Tagged , | Leave a comment

Hyperbole

A while ago, Bob Weiner asked me to take a look at Hyperbole and maybe write a post about it. It’s been in my queue to do that ever since but Hyperbole is a large and complex system and every time I tried, figuring it out seemed too daunting so I kept putting it off. Then Weiner gave a talk about Hyperbole to the NYC Emacs Meetup and I thought the video would be a good introduction and help me figure things out.

The video did help but the system is much like Org-mode in that it does so many things it’s hard to write a short explanation. Indeed, the video is over and hour and ten minutes and still didn’t cover everything. The basic idea—as I understand it—is to provide a mode that manages the display, retrieval, and linking of text across all of Emacs.

The primary active object in Hyperbole is the button. These can link to a piece of text in the same or another file, a Web site, an Info file or many other similarly things. They can also initiate actions. You can, in fact, tie a button to a piece of Elisp and have it perform any arbitrary action. The capabilities are very rich and can be invoked from anywhere within Emacs.

As far as Irreal is concerned, any future posts about Hyperbole will be like those about Org: they will focus on one particular aspect of the system and how it solves some problem or another. Before that happens, though, I’m going to have to read the manual and actually use the system. There’s a lot to learn.

Posted in General | Tagged | Leave a comment

Amazon & Antitrust

A surprising number of people hate Amazon. I say “surprising” because I don’t understand their animus. Sure, they send us a huge amount of what amounts to spam, have an unfriendly attitude towards organized labor—at least as concerns their own labor force—and have effectively cornered the ebook market. But consider: if you’re a customer is their advertising a price you’re willing to pay to have reasonably-priced, needed staples delivered to you door in this time of COVID-19? If you’re an employee, are you happy to have a job to go to, even if—despite Amazon’s precautions—there might be some risk involved? Before you dismiss that question, ask a restaurant worker what they think. My life during the last few months would have been considerably more complicated without them.

Many people are advocating for the DOJ to take antitrust action against Amazon. Byrne Hobart has an interesting article that considers the case for this in his newsletter, The Diff. Such things are not really in Irreal’s purview but I think the article will be interesting to many Irreal readers. Hobart begins with a long section on how Amazon works and makes its money. It’s a lot more complicated than you probably thought. Then he discusses antitrust and why, according to current antitrust standards, Amazon is not a viable target. But, he argues, even though Amazon is completely innocent on paper they nevertheless feel as if they’re violating antitrust laws. The TL;DR is that for Justice to make their case they would have to press a novel interpretation of antitrust and that it’s by no means sure that they’d prevail. Still, Hobart believes that there’s a good chance that the courts might accept the novel antitrust standards and that Amazon might be found guilty of them.

There are two things about this article that I found particularly interesting and that make it worth reading. First is the explanation of how Amazon works. It’s really fascinating and probably not at all what you thought. The section on antitrust mostly discusses predatory pricing and that it’s a lot more difficult to get away with than you think. It’s really interesting even if you don’t care about economics or antitrust theory. Definitely worth a read.

Posted in General | Tagged | Leave a comment

From SMS to an Org TODO

Many Org-mode users are looking for a way to add notes and TODOs when they aren’t at their computers. Most folks use one of the smart phone apps such as beorg or orgzly or perhaps even organice. Kevin Cunningham has another idea.

Cunningham is mostly concerned with adding TODOs to his GTD files wile he’s out and about so he put together a system to add TODOs with an SMS message. He uses Twilio and Dropbox to handle the messaging and communication between Emacs and his phone.

It’s a cute trick and Cunningham gives a detailed account of how he did it if you’d like to set up such a system yourself. His post is worth reading even if you don’t have an immediate need for such a setup. It’s a great example of snapping together existing technologies and adding to little glue code to produce a useful tool.

Posted in General | Tagged , | Leave a comment

Another Thesaurus for Emacs

It’s really handy to have a thesaurus handy when you’re writing, and of course if you’re writing in Emacs, you want to have that thesaurus available and easily accessible from Emacs. I’ve been using power thesaurus and its Emacs interface, powerthesaurus.el. It’s nice and works well but merely provides a list of synonyms from which you can choose a replacement for the word you’re looking up.

Recently, I saw a pointer to Ag Ibragimov’s mw-thesaurus. It’s an interface to the Merriam-Webster Thesaurus and is also quite nice. It’s strong point is that rather than a just list of synonyms, it provides a copy of the thesaurus page in Org format. That provides a lot of context and helps you zero in on the best substitute. On the downside, there’s no way to automatically substitute your choice in your text. That might seem like an odd omission but given the way it displays its results, it’s not clear how such a substitution would work.

In any event, I have them both installed at the moment. It’s not really much of an inconvenience to replace the word with its synonym manually. It’s certainly no harder than navigating to the proper synonym on the thesaurus page. On the other hand, it is convenient to be able to simply choose the word you want from a list with something like Ivy and have it automatically replace the word you’re looking up.

I’ll use them both until I decide which I like better. Or perhaps I’ll keep both installed and use the one that makes the most sense in a given situation.

Posted in General | Tagged | Leave a comment

The Costs of Mobile Data

I just came across some information that’s not actionable and therefore doesn’t really matter but it is interesting. Cable.co.uk has a fascinating page that describes the cost of mobile data in 228 countries. For each country, they show the cheapest, most expensive, and average cost of a gigabyte of mobile data.

There’s a map that you can hover over to see the results for your country. The big winner is India with an average cost of \$0.09 per GB. If you’re in St. Helena the results aren’t so good: you’ll be paying \$52.50 for that same gigabyte. In general, islands nations don’t fare so well for obvious reasons: they don’t the fibre infrastructure to support mobile data. The 5 most expensive countries are all island nations.

If you’re in the U.S., you’ll be paying an average of \$8.00. The map is color coded so you can see how various areas of the world shape up.

As I said, there’s nothing you can do with this data other than gloat or wail so it’s probably of limited usefulness. Unless, that is, you’re exceptionally mobile and the cost of mobile data is one of the most important desiderata in your choice of location.

Posted in General | Tagged | Leave a comment

Using Multiple Dictionaries for Spellchecking in Emacs

Alain M. Lafon has an interesting post on spellchecking in Emacs. Lafon is Swiss and therefore has to deal with four official languages as well as German and English in his day-to-day life. The Swiss with their usual efficiency handle that just fine but their polyglot ways means that a single document may contain text in two or more languages. The question is: what’s a good way of handling spellchecking in Emacs?

Well, it is Emacs so of course you can do that but it’s a bit trickier than you might expect. Lafon’s post gives step-by-step instructions for setting up spelling checking using multiple dictionaries.

The only potential wrinkle is that you have to use Hunspell if you want to have dictionaries for more than one language. If you’re on macOS (or Linux), you can install hunspell with Homebrew so it’s not much of a problem. Lafon gives the magic spell for apt users. If you use Homebrew, you’ll have to download the dictionaries separately but they’re available from the OpenOffice Extensions page.

Most of you—at least if we’re not Swiss—probably won’t have to worry spellchecking in multiple languages in the same buffer, but if you do, Lafon’s post tells you how to handle it.

UPDATE [2020-08-24 Mon 17:10]: Added link to Lafon’s post.

Posted in General | Tagged | Leave a comment

Gccemacs on Linux

Just a quickie today. Those of you who read yesterday’s post but are running on Linux might find this Reddit post by catsol_v2 on compiling gccemacs on Linux useful. It’s not quite as detailed as Ramírez’s post but has enough information to get gccemacs compiled and running.

Again, this is for people who don’t mind living on the edge or who want to build a separate instance of Emacs to play around with native compilation. The rest of us are going to have to wait for Emacs 28 (at least).

Posted in General | Tagged | Leave a comment

Native Emacs Compilation on macOS

If you’re like me, you’re probably excited about native compilation coming to Emacs. In case you don’t know, the project, gccemacs (started and headed by Andrea Corallo), brings native compilation to Elisp. That means that not just will Elisp code—and hence Emacs—will run faster but also that some of the C code in Emacs can be replaced with Lisp.

Corallo gave a presentation to the European Lisp Symposium, which I’ve written about before, that discusses how things work and gives the results of some benchmarks. The work is ongoing but the system is already usable. As far as I can tell, the plan is to include it in Emacs 28 but if you can’t wait to try it out, the code is in the Emacs git repository.

If you’re on macOS, Álvaro Ramírez has step-by-step instructions for compiling Emacs with the native compilation enabled. You’ll need to load gcc with jit support if you don’t already have it. After that, it’s pretty simple. Ramírez provides a configure script to set everything the way you’ll need it so all you have to do is run the script and call make to build Emacs. See Ramírez’s post for the details.

This project is a great thing for Emacs and even for making Elisp a more general programming language. I’m already inclined to use Elisp when I can for small utilities and one-offs so improving Elisp is a win for me.

Posted in General | Tagged | Leave a comment

Red Meat Friday: WTF

Richard Stallman. Sometimes it’s hard to know what to think. On the one hand, he can be extraordinarily irritating and he holds all sorts of opinions that I and many people don’t agree with. On the other hand, no matter what else you think, the man is a hero of the Free/Open Source Movement and has the annoying habit of being proved right

I remember thinking when the GNU project was first announced that the chances of it gaining any real traction were small. And yet, here we are. We have Linux. We have gcc. We have Emacs. We have virtually all the Unix utilities and a bevy of language implementations. By any measure and no matter your politics, Stallman’s GNU project has been a resounding success.

The latest controversy involving Stallman involves his defense of Marvin Minsky in the Jeffrey Epstein scandal. That defense has, of course, been mischaracterized by a lazy and ignorant press and the usual Twitter mobsters as his supporting Epstein and rape. Reasonable people can, I think, can hold opposing views on Stallman’s support of Minsky but I just came across a take on the controversy that no reasonable person can support.

A random Emacs user asked on the Web asked how he could monetarily support Emacs. That’s great, of course. Not everyone can contribute time or code and helping to support those that do is laudable. But then we have this:

Under normal circumstances, I would donate to the Free Software Foundation, but I personally refuse to donate to them anymore because of Richard Stallman’s “cancellation” (over something petty, in my opinion).

This is childish on many levels but isn’t the worst example of the sort. I’ve even seen people ask if it was all right to use Emacs given Stallman’s alleged sins. Sorry, but these people need to grow up. In the first place, Stallman has virtually nothing to do with the development of Emacs or any other GNU software. Yes, he’s still the head of GNU but he resigned from FSF and his current GNU role is mostly spreading the Free Software message by speaking engagements. As far as I can see, his only connection with development is occasional posts on the devel lists and even those are mostly about maintaining Free Software purity. Regardless, it makes no sense to punish the FSF—and the thousands of developers who depend on its work—for the actions of someone who is no longer affiliated with them.

Actually, it makes no sense even if Stallman were still the president of the FSF. Lots of Apple users hated Steve Jobs and felt his behavior regarding his daughter was reprehensible yet they kept right on buying iPhones because they thought iPhones were the best phones available. It’s not the organization accused of misbehavior but one of its employees. Sensible people can draw that distinction.

Finally, notice that our random user admits that even he doesn’t believe Stallman did anything really egregious. Rather, he’s outsourced his opinion making to a few activists on social media, most of whom probably don’t know who Stallman is or what the controversy is about. People whose analytical abilities are so weak should consider whether they’re in the right profession.

UPDATE [2020-08-21 Fri 17:17]: Renegade offers an alternative interpretation of the comment about not supporting the FSF. It’s much more benign than mine and I hope Renegade is correct. If true, it moves the transgression from the individual to the organization.

Posted in General | Tagged , | Leave a comment