Second Year of Daily Posts

Today is the second anniversary of daily posts on Irreal. For the past two years, Irreal has published at least one post a day.

Last year I remarked that it was a lot harder than one would think. Nothing that’s happened this year has given me any reason to change my mind on that. Some days I had absolutely no reserve posts and had to come up with something or break the chain. Fortunately, my muse always came through—even if at the last moment—and I was able to keep going.

I’m going to keep on keeping on so my hope is that on June 1st next year I’ll be able to celebrate three years of daily posts. So. Onward and upward.

Posted in Blogging | 1 Comment

Twenty Questions for Donald Knuth

Over at Informit they’ve got a great Q&A with Donald Knuth. Twenty luminaries in computer science ask Knuth questions about himself, his work, and computer science. The questions are much more interesting than the usual session of this sort so it’s definitely worth taking a look.

Among the questioners are Jon Bentley, Radia Perlman, Robert Sedgewick, Silvio Levy, Al Aho, Guy Steele, Robert Tarjan, and Andrew Binstock, just to mention a few who are familiar to me. It’s no wonder the questions are of such high caliber.

If you read the entire article, you’ll learn lots of interesting things. For me, the most astounding thing was to learn (or more precisely, be reminded) that Knuth has been working on The Art of Computer Programming for more than 50 years. I’m pretty sure that that’s longer than most Irreal readers have been alive. As I say, astounding.

Posted in General | Leave a comment

org-ref

I’ve written previously about John Kitchin and how he uses Emacs and Org mode for reproducible research. Kitchen is a researcher in Chemical Engineering from Carnegie Mellon University so he writes a lot of technical papers and he uses Org mode and Emacs to prepare them. You can watch the video that I linked above to get an idea of how he uses them to integrate his research notes and calculations into the source file for the paper.

If you’ve written or read any research papers from any scientific field, you know that they typically have citations to other papers and internal references to tables, figures, or other parts of the paper. Org can handle a lot of that—especially the internal links—out of the box and there are external packages to help with the bibtex tools.

Kitchin has written an Emacs package, org-ref, that integrates these functions in a consistent way. He describes the package in a blog post on his group’s site. If you write research or technical papers that have a lot of internal/external references you should take a look at the package to see if it can help you.

Kitchin says that the package currently works well only for LaTeX export but suggests that he will be adding support for other formats such as HTML in the future. Right now the package isn’t in ELPA and he doesn’t say whether he will place it there but it is available from his site: see his blog post for the link.

I hope he continues work on this package. It looks as if it could really make handling bibliographies a lot easier.

Update: Apparently, Kitchen is continuing work on org-ref. In a subsequent post he describes how to export to other formats and remarks that export to HTML is working pretty well now. If you’re interested in using Emacs to handle bibliographies, you should take a look at Kitchen’s blog. He has many posts describing the work he’s done in that area. It’s pretty impressive.

Posted in General | Tagged | 3 Comments

Calculating My Average Post Size

Most of my posts are pretty short: maybe 250 words or so. The other day, I began to wonder how long the average post is so I wrote a few lines of Elisp code and just executed it in the scratch buffer.

Here’s the code:

(let ((posts 0) (words 0))
  (mapc (lambda(p)
          (with-temp-buffer
            (insert-file-contents p)
            (goto-char 1)
            (setq words (+ words (how-many "\\w+")))
            (setq posts (1+ posts))))
        (directory-files "~/org/blog" t ".*\\.org"))
  (format "Total words: %s, Average per Post: %s" words (/ words posts)))

As you can see there’s nothing special in it. The only points worthy of note are the use of with-temp-buffer and =insert-file-contents instead of find-file, a trick I learned from Xah Lee, and the use of directory-files, which is a nice way of getting a list of files satisfying some regex.

When I run the code I get

Total words: 362460, Average per Post: 303

so my posts are a bit longer than I thought. It’s also interesting that in the 3 years I’ve been posting to Irreal, I’ve written about 360,000 words or 120,000 words a year. That’s about a novel’s worth of words a year. Now if I could only write a novel.

Posted in Programming | Tagged | Leave a comment

SBCL 1.2.0

SBCL 1.2.0 has just been released. The big improvement in this release is support for ARM under Linux. As usual, it compiled and passed the test suite without problems on my OS X systems.

As I say every month, if you’re looking for an excellent Common Lisp implementation, give SBCL a look.

Posted in Programming | Tagged , | Leave a comment

Xah Lee on Docstring Markup

If you write Emacs functions—even for yourself—you are, of course, including a docstring. Functions have a way of escaping from your init.el and finding their way to someone else’s config. Even if that doesn’t happen you may find yourself happy to have a reminder of the function’s details. At least if you’re like me.

It turns out that docstrings have their own mini-markup language. Xah Lee has a nice tutorial on how to use that markup language. I find Lee’s post clearer and easier to read than the Documentation Tips page of the Elisp Manual.

The Emacs built-in documentation is nicely formatted and, when properly done, very useful. Most times, it’s all you need to use a command, function, or variable successfully. By learning and using the markup language that docstrings provide, you can document your code as nicely as the built-in functions.

Posted in Programming | Tagged | Leave a comment

Night of the Scum Spammer

Irreal is undergoing a sustained spam attack again. This is despite the nucaptcha, which is still working. Either the spammers have defeated it or they’re paying a bunch of people a penny a piece to fill them in. In either case they spam only older posts to reduce the chance that anyone other than Google will notice.

To combat this nonsense, I’ve shut off comments for posts more than a week old. I hated to do this because I sometimes get useful comments on older posts but as usual the spammers are ruining things for the rest of us. Perhaps I can reenable comments on the older posts when the spammers give up and go home.

Sorry for the inconvenience.

Posted in Blogging | Tagged | 2 Comments

Geek Porn

If you’re a geek you gotta love this whether or not you’re a Formula 1 fan. I’ve written about Formula 1 racing before so this is two more times than I expected to have anything to say about it.

It’s easy to dismiss racing as a sort of silliness that has nothing to do with the exalted heights to which we nerds aspire. As the two Irreal posts show this is far from the truth. Racing, as it’s practiced today, is extraordinary technical with enough serious challenges to occupy any of us.

I’m still not a racing fan but I do admire the technical challenges that they’ve overcome. If you haven’t seen my first post, take a look at it and follow the links: what the pit crews do is nothing short of extraordinary.

Posted in General | Leave a comment

The Effectiveness of Dynamic Typing

As I wrote the other day, there has been, of late, an ongoing, vigorous debate on the virtues of dynamic versus static typing. There are a lot of muscular declarations from both sides but not a lot of evidence. Now Robert Smallshire has looked into the matter and discovered that dynamic typing is much more effective than it should be.

Even more, he says that the benefits of static typing cost more than the benefits they provide. That’s pretty provocative and of course he gets some push back in the comments. You’ll have to watch the video to see if you think he makes his case.

Even if you’re neutral in static-dynamic skirmishes or don’t care, the video is still worth watching because Smallshire tightens down on what, exactly, we mean by typing and various orthogonal meanings that can apply to that term.

Worth watching if you have any interest in types in programming languages. The video is just under 52 minutes so plan accordingly.

Posted in General | Leave a comment

Navigating with ace-jump-mode

This is by way of an obvious Emacs tip. While I was in my emacs.el adding ace-windows, I decided to fix a problem with ace-jump-mode as well. When I first installed it I used【Ctrl+x Space】as the triggering key sequence. Somewhere along the line that got taken over by GUD so I changed it to 【Ctrl+c Space】 but that doesn’t work for Org files because it’s used to blank table fields so I needed a new binding. I chose 【Hyper+a】 because it easy to type and therefore fast. Once I got that taken care of I starting thinking about ace-jump-mode and realized that I could use it more widely than I’d been doing.

Mostly I was using it for micromovements and using isearch for larger movements as recommended by Steve Yegge but if the place you want to go is on the current page it’s a lot easier and faster to use ace-jump-mode. I just use the first letter of the word I want to go to as the jump target, pick the correct red letter, and I’m there. I could, I suppose, specify the universal argument to jump into the middle of a word but it doesn’t seem necessary.

I’ve been making an effort to follow this plan for a few days now and it’s working out very well. If you aren’t doing this, try it out. You might find yourself with a new habit.

Posted in General | Tagged | Leave a comment