The Greatest Car Commercial Ever

As a young nerd I wanted to be Spock. Every nerd wanted to be Spock. So of course this commercial really resonates with me. It’s hilarious and I’m sure all Irreal readers will love it even if your boyhood heroes run in a different direction. As one of the commenters remarked, the only thing that could make it better is an appearance by Shatner.

Posted in General | Tagged | Leave a comment

A Solution to EmacsGolf 4

EmacsGolf 4 didn’t generate a lot of interest, apparently. What little discussion there was centered on why you would want to perform the given transformations rather than how to do so. Nevertheless, the honor of Emacs users everywhere is at stake here so I offer the following solution using multiple-cursors.

Ctrl+n Ctrl+n Ctrl+f move to first defvar
Ctrl+* invoke multiple cursors on defvar
Ctrl+e move to end of line
Ctrl+BackSpace Ctrl+BackSpace kill variable name
Ctrl+y yank it back
SPC n i l add nil
Ctrl+n Ctrl+a beginning of second line
Meta+( wrap list in parens
s e t q SPC add setq
Ctrl+y add variable name
Ctrl+d delete extra space
Ctrl+n down to third line
Ctrl+x Ctrl+t interchange second and third lines
Ctrl+p Ctrl+p up to second line
Meta+^ join with first
Return exit multiple cursors

That 29 keystrokes. If you’re not using multiple-cursors (why not?!) you could use almost the same keystrokes with a macro. Substitute 【F3】 for 【Ctrl+*】 and 【Ctrl+3 Ctrl+n F4】 for 【Return】. Then use 【Meta+0 F4】 to run the macro on the rest of the buffer.

Surely the Irreal heavy hitters can do better than my 29. If you can, leave a comment. It’s not too late.

Posted in General | Tagged | Leave a comment

Lexical Binding in Emacs Video

If you’re still confused about the difference between dynamic and lexical scoping in Emacs, Nic Ferrier has an excellent video that explains it with a couple of simple examples.

You may find it useful to review the meaning of closure before watching the video. Here’s a short definition from the Emacs manual.

Posted in Programming | Tagged | Leave a comment

Org Mode Summary

I recently saw this Org-mode summary from the Linux Journal mentioned in a tweet. It’s pretty old—from 2007—but still serves as a useful introduction to some of Org-mode’s power. If you’ve never used Org-mode, this article will give you a feeling for what it can do.

The best introduction and go-by remains Bernt Hansen’s excellent Org Mode – Organize Your Life In Plain Text! It’s quite long but very comprehensive and Hansen considers it a work in progress so it’s always up to date. It’s the perfect follow on to the Linux Journal article. Of course, Org-mode comes with a comprehensive manual that covers everything in detail. There is also an compact Org-mode Guide that can serve as a sort of quick start manual, although I prefer Hansen’s guide.

With all this great documentation, there’s no excuse for not giving Org-mode a spin. Be warned though: it will insinuate its way into almost every aspect of your work flow.

Posted in General | Tagged , | 2 Comments

Complexity Cheat Sheet

Eric Rowell and Nick Dizazzo have posted a great Big-O cheat sheet. The sheet gives time and space complexity for several popular algorithms such as searching, sorting, and manipulation of data structures and graphs. One feature that I like is a graph that shows the curves for O(1), O(log(n)), O(n), O(nlog(n)), O(n2), O(2n), and O(n!). It demonstrates in a dramatic way how algorithms exhibiting these behaviors differ.

If you find yourself having to look up the complexity of algorithms occasionally, bookmark this page and have the information at your fingertips.

Posted in Programming | Tagged | Leave a comment

linedit

Pavel Penev has updated and republished his excellent post Learning Lisp The Bump Free Way. It’s a nice introduction to the problems that Lisp n00bs face and how to overcome them. If you know anyone struggling with learning Lisp, this is a good resource to point them to.

I learned something too: linedit. linedit is a readline-like library (written in CL) that brings greater editing functionality to the CL REPL. It’s got a lot of features that are detailed at the link so be sure to take a look if you ever use Lisp directly from the terminal. It appears to be (at least somewhat) SBCL-centric so users of other distributions may have varying results. It’s available from Quicklisp so installation is a snap. You add a couple of lines to your .sbclrc file to enable it and another line to your Emacs configuration to prevent it from interfering with Slime. The appropriate incantations are explained on the linedit site.

If you’re like me, you mostly use Lisp in conjunction with Slime but when I do use the terminal I always miss having basic line editing so linedit is a win for me.

Posted in General | Tagged , | Leave a comment

DRM-Free Day

Today is DRM-free day. To celebrate O’Reilly is offering 50% off on their entire ebook inventory1. I used the occasion to pick up a copy of Writing GNU Emacs Extensions. If you have any O’Reilly books on your “to purchase” list, this would be a good time. The sale ends at the end of the day (May 3) so hurry.

Footnotes:

1 I’m not an affiliate or connected to O’Reilly in any way (other than as a customer) and I don’t get anything from this post other than the satisfaction of performing a public service by letting you know about an opportunity to save some money.

Posted in General | Tagged , | Leave a comment

A Summary of New Libraries in April’s Quicklisp

Ben Hyde has produced a summary of the new libraries in April’s Quicklisp distribution. Each item has a link to the library’s README so it’s easy to get a more detailed look at libraries that interest you. A very nice piece of work. I hope he continues with it or, as Masataro Asai suggested, automate it and make it available as an RSS feed.

Posted in Programming | Tagged , | Leave a comment

EmacsMovies Looks at Gnus

Noufal Ibrahim has resumed his EmacsMovies series. This time it’s part 1 of a series on Gnus. Gnus is famously complex so Ibrahim’s taking the subject in smaller bites makes sense. As it is, the video is over 21 minutes long.

I’ve often thought about learning Gnus but its fierce reputation always persuaded me to explore some other aspect of Emacs instead. Thus, I’m looking forward to this series to goad me into finally taking a serious look at it. This first video is really just an introduction to Gnus and doesn’t get into the details; presumably subsequent videos will deal with the nitty gritty.

I had a small problem with the video. I was unable to get it to expand to full screen—in either Safari or Chrome—and the default size is too small to read comfortably (at least for my eyes). Because of this, I had a hard time following part of the presentation. I don’t remember this happening with the previous videos so perhaps this problem will resolve itself in subsequent videos.

Posted in General | Tagged | 3 Comments

SBCL 1.1.7 Released

The folks at Steel Banks Common Lisp have released SBCL 1.1.7. As usual the build, test, and installation went without mishap. This month’s release is mainly bug fixes but also includes an enhancement to TRACE so that PRINT-ALL handles multiple-valued forms.

As always, thanks to the developers for continuing to make SBCL one of the best Lisp environments.

Posted in Programming | Tagged , | Leave a comment