Tag Archives: Emacs-lisp

My Solution to the Last Elisp Challenge

The challenge was to convert the output from dstat so that all the bytes values (some of which are given as kilobytes or megabytes) to just bytes. Thus, 2k would become 2048 and 3M would become 3145728. Similarly, dstat outputs … Continue reading

Posted in Programming | Tagged , | Leave a comment

Regular Expressions and Emacs Lisp

Over at What keramida said…, Giorgos Keramidas poses an interesting problem. Given the following output from dstat, get rid of the B, k, and M suffixes by converting them into bytes. —-system—- —-total-cpu-usage—- –net/eth0- -dsk/total- sda- time |usr sys idl … Continue reading

Posted in Programming | Tagged , | 3 Comments

Tail Call Optimization in Elisp

If you’ve got a Lisp background—especially a Scheme background—you may have internalized recursion as a looping mechanism and general programming strategy. That doesn’t work with Elisp, of course, because each recursive invocation allocates a stack frame. Not to worry, though, … Continue reading

Posted in Programming | Tagged , | 2 Comments

Elisp for Common Lisp Programmers

Jean-Philippe Paradis Tweets a thought about Common Lisp programmers learning Elisp that seems to me to be exactly right. I’ve expressed the same idea myself but not nearly as succinctly or neatly.

Posted in General | Tagged , | Leave a comment

Emacs Hash Tables

One of the most useful data structures in Computer Science is the hash table. I’ve been using them for my entire career and have implemented close to a hundred instances in several languages. That’s not as necessary these days as … Continue reading

Posted in Programming | Tagged , | Leave a comment

Maintaining My Blog Post Queue

Because inspiration doesn’t necessarily strike on demand, I like to stay a few posts ahead. For the last year, my procedure was to push a completed post to the site as a draft and then publish it when I was … Continue reading

Posted in General | Tagged , | 1 Comment

A O(n) Solution to the Last Elisp Challenge

As I mentioned in the post, my An Elisp Challenge post was suggested by this Programming Praxis post. The next Programming Praxis post was a followup that discussed Booth’s Algorithm, which calculates how many left rotations a string must undergo … Continue reading

Posted in Programming | Tagged , | Leave a comment

My Solution to the Elisp Challenge

Here’s my solution to the recent Elisp challenge. It’s easy to be seduced by the notion of rotating one sequence to see if it’s equal to the other. That would work but the rotation is pretty expensive and the solution … Continue reading

Posted in Programming | Tagged , | Leave a comment

An Elisp Challenge

Here’s a simple Elisp challenge suggested by a problem from by ProgrammingPraxis. We call one string a cycle of another if one string can be transformed into the other by a rotation of the characters. Note that this means They … Continue reading

Posted in Programming | Tagged , | 7 Comments

A Full Screen Eshell

Almost all of my tube time is spent in 4 programs: Emacs; Safari; Reeder; and Mail, roughly in that order. Naturally, I try to stay in Emacs as much as I can. In particular, I’ve long bound 【Ctrl+c s】 to … Continue reading

Posted in Programming | Tagged , | 3 Comments