The Java Virtual Machine Tax

Via Wilfred Hughes

I’ve often been tempted by Clojure but the JVM tax that Alex Payne talks about is primarily why I’ve resisted.

Posted in Programming | Tagged , | Leave a comment

Spring Fall Cleaning

In a comment to my Mathematics in a Blog Post post, Grant Rettke asked what versions of WordPress and org2blog/wp I was using. It turned out I had a pretty old version of org2blog/wp installed so I decided to upgrade. I had been maintaining a cloned version of its repository but I decided to see if I could get it to work from ELPA. I’d tried that before but it pulls in Org mode and there were problems with getting Org to work from ELPA then.

This time both Org and org2blog/wp worked fine when installed with ELPA so I got rid of my private cloned repositories for them. If you had a similar problem with Org and ELPA it appears to be working well now.

While I was cleaning things up, I decided to get rid of old files and subdirectories in my tools and tars directories. For example, I had half a dozen old copies of SBCL hanging around and even though I didn’t need the space (my iMac has a terabyte of disk space) I was in a housekeeping frame of mood so out they went. Normally when I do this type of thing, I use eshell to remove the files with

rm -rf ~/tools/sbcl-1.2.1

But then it occurred to me that even though I don’t edit any files in the tools directory, there was no reason I couldn’t bring it up in a dired buffer and just mark the subdirectories that I wanted to delete. That worked fine, of course, and was much faster than deleting each one by hand. Unless I’m already in a shell and just need to deal with one or two files, dired is faster and easier—even if it’s a directory that I don’t normally use Emacs with.

Emacs really is a wonderful environment. It is, as I’ve said many times, as close as we can come to using a Lisp machine. Not everyone, I suppose, wants that but I love it and don’t understand why anyone would use anything else.

Posted in General | Tagged | 5 Comments

Rock & Roll and a Rare Personal Item

I don’t often write about myself on Irreal because, really, who cares? I’m going to make a rare exception and share something about myself: I am a HUGE Pink Floyd fan and consider them the best Rock and Roll band in the world. You’re free to disagree, of course, but then you’d be wrong.

Last night I was at the Pizza parlor stocking up on programmer fuel when the (young) clerk noticed my Pink Floyd tee shirt and told me something extraordinary that I had somehow missed. After 20 years, the gods have smiled on us and we have this. I’m overjoyed and can’t wait. Here, in typical fashion, is the announcement.

Posted in General | Leave a comment

Sorting in Dired

Xah Lee just taught me something new about dired sorting. I mostly just sort the list by name but occasionally I want to see the newer entries so I toggle the sorting to “date” by typing 【s】. It turns out, though, that you can also sort by any of the fields supported by ls. This includes such things as displaying file sizes by kilo- or megabytes.

Head on over to Lee’s site for the details. If you’re like me, you’ll mostly want to sort by name or date but when you need it sorted another way, Lee shows you how. You can also set the variable dired-listing-switches to make your changes the default. Very useful post.

Posted in General | Tagged | 1 Comment

Correct Quotation Marks

There are few things as ugly, typographically speaking, as the straight quotation marks that are the default in most fonts. When you’re writing something that’s going to be rendered with proportional fonts, it’s easy to do the right thing and use left and right rounded quotation marks.

Artur Malabarba has a nice post up with a bit of Elisp to insert correct quotation marks in a context aware way. If you want a set it and forget solution, Malabarba’s is a good one. Just add his code to your .emacs or init.el file.

I do something simpler that requires me to decide when I want round quotation marks. I use the key-chord package that allows me to bind commands to key chords. It’s not context aware but it works well for me. When I want to insert proper quotation marks, I just press 【"】twice rapidly. If you want to use this solution, all you have to do after installing the package is add

(defun dq ()
  "Insert double quotes in an org buffer."
  (interactive)
  (insert "“”")
  (backward-char))

(key-chord-define-global "\"\"" 'dq)

to your .emacs or init.el file. If you want to use this, the names of the proper glyphs are:

  • “ – LEFT DOUBLE QUOTATION MARK
  • ” – RIGHT DOUBLE QUOTATION MARK

Now you have two solutions so don’t let me see those ugly quotation marks in your writings anymore.

Posted in General | Tagged | 4 Comments

An Update to Mathematics in a Blog Post

Given that there was a bit more interest than usual in my Mathematics in a Blog Post post, I want to update it with a couple of things I’ve learned in the mean time. This only applies to those using Org mode to write their posts.

It turns out that Org runs its own MathJax server and automatically arranges for it to be called. That’s great if you only occasionally use MathJax but the Org folks ask that if you use it a lot or have a large readership that you serve your own copy or use the MathJax CDN. This means that my suggested solution of adding

#+HTML_HEAD: <script type="text/javascript"
#+HTML_HEAD:  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
#+HTML_HEAD: </script>

isn’t optimal. It results in another copy of MathJax being pulled in, which may or may not be the same. One of the advantages of using the MathJax CDN is that you’re guaranteed to get the latest version so unless you have strong reasons to do otherwise, you should use the MathJax CDN.

The proper way to get the CDN version is to add the line

#+HTML_MATHJAX: align:"center" path:"http://cdn.mathjax.org/mathjax/latest/MathJax.js"

to your post’s source file. Alternatively, you can edit the org-html-mathjax-options variable to set it once and for all.

Posted in Blogging | Tagged | Leave a comment

Another 12 Great Programmers

Here’s another list of the 12 greatest programmers of all time. As I’ve said before, these list all always silly but a lot of fun to talk and argue about. This list’s greatest programmers are:

  1. Dennis Ritchie
  2. Linus Torvolds
  3. Bjarne Stroustrup
  4. Tim Brenners-Lee
  5. Brian Kernighan
  6. Donald Knuth
  7. Ken Thompson
  8. Guido Van Rossum
  9. James Gosling
  10. Bill Gates
  11. Niklaus Wirth
  12. Ada Lovelace

I’d argue against Bill Gates and Ada Lovelace. Gates is, by all accounts, an excellent programmer and certainly a mover in our field but his contributions are more as a businessman than a programmer. Lovelace deserves our respect as arguably the first programmer and certainly as the first woman programmer but I’m not sure she qualifies as one of the 12 greatest programmers. Fran Allen or Grace Hopper, I think, have a greater claim to the title. On the other hand, she is widely considered to be the first to develop an algorithm to be carried out by a machine. I’m willing to be persuaded on this point.

As I’ve said, the fun of these lists is arguing about them. No one should take them as gospel.

Update: Minor edit: added missing comma.

Posted in General | Tagged | 1 Comment

A Math & Lisp Blog

If, like me, you’re interested in Mathematics and Lisp and like doing math experiments on a computer, you should check out Atabey Kaygun’s Blog. Kaygun is a Mathematician at Bahçeşehir University in Istanbul.

On his blog he considers various problems and algorithms that strike his fancy and uses (mostly) Common Lisp to experiment with them. Sometimes the problems are from Project Euler, other times they’re things that pop into his head, and still others are culled from the literature. The problems are generally accessible to non-specialists and Kaygun does a good job providing background and explanation so the average Irreal reader should be able follow along. Here is a list of some of his recent musings.

If Mathematics is right after root canals on your list of favorite things, you probably won’t be interested but if you like playing around with math problems and using Lisp to quickly and easily try out candidate solutions you’re apt to enjoy Kaygun’s blog. Fans of Project Euler and Programming Praxis are particularly likely to enjoy his posts.

Posted in Programming | Tagged , | 2 Comments

Keyboard Switches

As many of you know, Xah Lee is a keyboard aficionado who spends a lot of time researching and trying different keyboards. There are, it seems to me, three aspects to keyboards

  • Ergonomics
  • Layout
  • key switches

All three aspects are important and users feel very strongly about them. Lee has addressed all of those aspects but a recent post talks about the least obvious one: key switches. Many folks don’t think about them at all or, even if they do, consider them the least important aspect.

I disagree. The switches control what your typing feels like. If you have cheap rubber dome switches it feels like you’re typing on marshmallows. A good mechanical switch, on the other hand, gives excellent tactile feedback and makes typing a pleasure.

My favorite keyboard, by far, is the Unicomp Keyboard, a clone of the original IBM Model M keyboard. I’ve used both and love them. On my iMac, I use the Apple wireless keyboard, which is OK, but not a great as the Unicomp and Model M. I have several of the Unicomps and use them on all my non-apple computers. These keyboards use the buckling spring key switches and produce what I think is the best typing experience.

That’s where Lee’s post comes in handy. It discusses the various switches and let’s you know what to look for when purchasing a keyboard. For example, some people find the Unicomp buckling spring switches too noisy and want a key switch that is quieter but has a similar typing feel. Lee’s post is a good resource to find the type of key switches that meet your preferred typing style.

Posted in General | Tagged | Leave a comment

Launching Emacs Features

Artur Malabarba has a nice riff on his toggling keymap that I wrote about here. This time he considers launching Emacs commands such as calc, ediff-buffers, man, shell, proced, and others. As Malabarba says, these are useful commands that you don’t use that often so it’s handy having a way of launching them with an easily remembered key sequence.

The idea is the same as it was for toggling modes. You create a key map attached to 【Ctrl+x l1 in such as way that the keys are intuitive and easy to remember. Thus 【Ctrl+x l c】 launches calc.

As with his toggling post, you will probably have different commands you want to bind to your keymap but his method is completely general. If you have commands that you rarely launch, you may find his post useful.

Footnotes:

1

Or some other sequence such as 【Ctrl+c l】 if you’re worried about future conflicts.

Posted in General | Tagged | 6 Comments