Introduction to EWW

I’ve been making a point of trying to use the Emacs Web Wowser (eww) when it makes sense. As much as I’d love to move browsing into Emacs—and thus realize my goal of virtually never leaving it—sadly eww can’t replace a full fledged browser such as Safari, Chrome, or Firefox.

There are places, though, where it’s use does make sense. My most frequent use is with mu4e to display HTML emails that miscreants insist on sending me. Even there, it’s not always adequate: emails from Amazon, for example, really need to be displayed in Safari to see the content correctly. Still, for most HTML emails eww is fine.

The other place where eww makes sense is to look at things like on-line manuals. I don’t always remember to use eww for that but I’m trying to train myself. Another place I find it useful is to find the correct spelling for a word I don’t remember how to spell. Sometimes flyspell can help with that but when it doesn’t, I usually just go to the browser and look up the word with an approximate spelling. Almost always, DuckDuckGo will tell me the correct spelling. This is an ideal use for eww because I don’t have to leave Emacs to find that spelling.

Over at Emacs Notes, Emacks has a nice post on using eww. It’s just the basics but it’s good to get you started. The thing I liked best about the post is that Emacks says the proper way to think of eww is “as a handy HTML-to-text converter that extracts content from your favourite web-pages to your personal notebooks.” Looked at that way, you no-longer care as much about its limitations because you’re not trying to use it to replace your browser

Posted in General | Tagged | Leave a comment

Eshell and Emacs Everywhere

Seven or eight months ago, I wrote about a couple of posts from Pierre Neidhardt (Ambrevar) concerning Eshell and the utility of doing as much as possible in Emacs (1, 2). Since then, he’s revised them a bit from the original reddit postings and made them available on his site at Eshell as a main shell and Emacs Everywhere.

I rediscovered them when @hideo_is tweeted links to them. These are really interesting posts and well worth reading again. Ambrevar states his belief that although eshell is not a standard Unix shell, it is better suited for use with Emacs—not being tied to ancient terminals in the way traditional shells are—and that its differences should therefore be celebrated rather than looked upon as shortcomings. He makes, I think, a convincing case for that belief.

In the Emacs Everywhere post he describes the joy of doing almost everything from within Emacs and pleads the case that Emacs is not a violation of the Unix philosophy of a program doing one thing well. He says, essentially, that the one thing Emacs does and does well is to provide a standard and powerful interface to other programs and packages. In that way, it is no different from Qt, GTK, Tk, or even curses.

I enjoyed reading the posts again and you probably will too. If you haven’t already read them, be sure to take a look. They’re definitely worth your time.

Posted in General | Tagged | Leave a comment

The Cost of Adtech

As a result of the GDPR going into effect, USA Today is—presumably temporarily—running a special version of their site for those in the European Union. This version has all the ads and tracking scripts disabled. Marcel Freinbichler shows us the shocking—if not really surprising—results:

If you click on the tweet, you can see the rest of the thread, which includes these statistics:

  • Load time went from more than 45 to 3 seconds.
  • Javascript files loaded went from 124 to 0.
  • HTML requests went from more than 500 to 34.

As I’ve said many times in the past, I understand and accept the need for content providers such as USA Today to serve advertisements. They have to pay for running their business some way after all. But when you get 10% content and 90% tracking and ads, it seems to me that they’re abusing their readers’ goodwill and understanding.

Posted in General | Tagged | Leave a comment

Emacs 26.1 Is Out

Nico Petton tweets the good news:

I’ve already downloaded, compiled, and installed it and am writing this with the new version.

If you’re on macOS, here’s my recipe for the compilation and installation:

configure --with-ns CFLAGS="-g3 -O2 -I /usr/local/include/libxml2"
make
make install
make install-info
sudo mv nextstep/Emacs.app/ /Applications/Emacs.app

The last time I installed Emacs, the last step in the recipe was

sudo cp -R nextstep/Emacs.app/ /Applications/

but this time macOS complained so I used the mv instead.

If you’ve got macOS set to not run “unknown applications” and get an error message when you try to run it, follow these directions.

Posted in General | Tagged | Leave a comment

f-strings in Elisp

John Kitchin, as you probably know, is a fan of Python as well as of Emacs. One of the things he really likes in Python 3 is f-strings. They allow you to do things like

import datetime
today=datetime.datetime.today()
name="J. Random User"
print (f'{name:14s} signed up for Bozoid Services on {today}')

You may or may not like the idea but if you do and you’re an Elisp programmer, Kitchen has a simple implementation in Elisp. They’re not quite as powerful as Python’s but Kitchin says they do what he usually needs them to do.

Unless you’re in the camp that eschews the loop macro and format strings on the grounds that they’re “unlisp-like” you may want to try it out.

Posted in General | Tagged | Leave a comment

The Irreal Privacy Policy

As far as I can tell, the GDPR does not apply to Irreal. Nevertheless, Irreal is trivially in compliance because we don’t collect or store any information about our readers. Even if we did collect such information, we would never sell or share it with anyone.

If you post a comment to Irreal, you are using the Disqus Commenting system and they do collect some minimal information needed to run their commenting network1. That data is under Disqus’ control and Irreal has no say in its use or disposition. If you’re concerned about the information Disqus maintains, log in to the Disqus Data Sharing Page to adjust your settings.

These policies apply to everyone, everywhere, not just readers in the European Union. We’re an equal opportunity non-abuser.

Footnotes:

1

Before Disqus, Irreal used the built-in WordPress commenting system. All logins and associated information to that system have been deleted.

Posted in Administrivia | Tagged | Leave a comment

Using Request to Download Financial Data

Sebastian Schweer has a nice post on using the request package to query an online financial service and download current stock quotes. That data is placed in an Org table along with certain historical data (such as purchase date and original cost) and used to calculate the current value of his stock holdings. The table can, of course, be exported to produce a nicely formatted report.

This post is similar to the one by Charl Botha that I wrote about previously. If you need to programmatically retrieve data from a restful website, you should carefully study these two posts. They show how to use the request package and then parse out the data. Sadly, I haven’t had a need to use these techniques but I’m really looking forward to when I do. Request, let-list, and the rest are tools that I’m dying to try out.

UPDATE [2018-05-25 Fri 18:48]: Added link to Sastibe’s post.

Posted in General | Tagged , | Leave a comment

Going Dark: How Many Locked Phones Are There?

In news that will surprise exactly no Irreal readers, the Washington Post and Techdirt are reporting that the FBI has been lying about the “going dark” problem. One of their favorite refrains is that terrorists, pedophiles, drug dealers, and whatever today’s fourth horseman of the Infocalypse is have been using their encrypted smartphones to frustrate the FBI’s ability to keep us and the American way safe. Their latest estimate is that they are currently locked out of nearly 7,800 phones. Therefore, the next line goes, we need a law that gives us a backdoor into that encrypted information.

Everyone who knows anything at all about the matter knows that this is all nonsense and that the backdoor or golden key or whatever the current euphemism is would make us less, not more, safe. Now it turns out that even the underlying fact for these claims is wrong. Critics have long been suspicious of the 7,800 phones that the FBI claims they can’t access. Now the FBI has admitted that the actual number is probably around 1,200.

It wasn’t that they were lying, they say, it was merely an error. It was, in fact, the ever popular “computer error” that caused the miscount. They mumble about multiple databases and phones being counted more than once. But here’s the thing: According to Wikipedia, there are just 56 FBI field offices in the U.S. What’s wrong with calling them up and asking, “How many locked phones are you currently trying to access?” One agent, or even secretary, could easily get that done in a day or two. Remember that these phones are evidence and are thus recorded in chain of custody logs. I find the claim that it’s hard to suss out this information to be disingenuous if not absurd.

The FBI is not having a good year. Practically everything they’ve told us has turned out to be false. At the same time, they appear unable to handle even routine investigative tasks like following up on the tip that Broward County, Florida school shooter Nikolas Cruz wanted to “kill people” and that there was a potential of him being involved in a school shooting. That potential was realized when Cruz killed 17 people and wounded 17 more. The FBI lied about that too, of course.

Posted in General | Tagged | Leave a comment

Reproducible Research for Management

The utility of reproducible research and literate programming methods in engineering and science is clear and well known by now but we seldom consider how the techniques might be extended to other disciplines. If, however, you think about what you’re trying accomplish with those procedures—documentation of process, tracking of changes, the ability to reproduce your work product and conclusions, and a self-contained file containing all the relevant data and calculations—it’s clear that almost any endeavor could profit from applying these techniques.

Derek Feichtinger has an interesting post in which he describes the application of reproducible research and literate programming to management problems. As an example, he considers generating a budget for a pair of related projects. His workflow is to first generate an outline describing his goal and the information he has and to refine that with subheadings as more information becomes available. That provides a history of the project and automatically tracks changes.

Feichtinger has written some Elisp that extracts the relevant data from the outline and puts in table form. That table can be used for further calculations, graphs, and other output. The results can, of course, be exported in a variety of ways according to what is needed.

If you are in management or you have to produce reports for management, you should take a look at Feichtinger’s post. There are a lot of good ideas in it even if you don’t choose to follow his exact workflow. As Feichtinger says, using these techniques is far superior to the usual management practice of doing everything with Excel.

Posted in General | Tagged , , | Leave a comment

Reproducibility Using GNU Guix

Regular readers know I’m fond of reproducible research and occasionally write about it. Unfortunately, I often write as if reproducible research is simply a matter of firing up Emacs and Org mode. It is, of course, a lot more complicated than that. Using Org mode puts everything in one place and makes it clear what you did and how you did it but that may not be enough for another researcher to duplicate or expand on your work.

The bioinformatics group at the Max Delbrück Center has an interesting preprint available that illustrates some of the problems and their solutions to those problems. The TL;DR is that they use the GNU Guix package manager to be able to precisely rebuild the software environment used for their experiments. This gives them a way of working with a common software stack for subsequent experiments or to allows others to reproduce their work. The goal is to provide a way of producing a bit-identical software base.

They illustrate this by packaging up 4 analysis pipelines used to process data and produce publishable tables and graphs. The abstract of their paper is available at bioRxiv along with a link to the paper itself.

You don’t have to have a background in bioinformatics to read most of the paper. You can skip the descriptions of the pipelines and concentrate on the description of the build system and the problems it addresses.

Posted in General | Tagged | Leave a comment