Programming

Blog posts about computer programming languages.

Valentines for Nina and Lola

Nina and Lola,

Whenever I'm away from you and I spend a lot of time writing computer code, I think about the pretty patterns that your names make in binary code. Your names, Nina and Lola, are wonderful in so many ways that I could never describe them all. Here's one of those ways.

If you use the following Common Lisp expression, you can find the graphical binary representation of your names in binary code.

  (defun binary-name (name zero one)
    (map 'string (lambda (c) (case c (#\1 one) (#\0 zero) (t c)))

Git and Subversion

I'm not a revision control guru, but I've been using Git a lot more than Subversion in the last couple of years. Recently I found myself having to deal with a Subversion repository again. Stubbornly, I began to think about how to use the Subversion respository with Git. I had seen git-svn here and there (for example, I think apt recommends it when you install git-core), and I thought it might have the functionality that I was looking for. It turns out I was right; I now fail to understand why it took me so long to start using this most excellent tool.

Common Plisp: List Processing in Perl

I was recently talking on the phone with a person who lives at least 2,200 miles away and whom I'd never met or spoken to before. This is a surprisingly common occurrence in this day and age. I was explaining some of the things that I like about Perl. When I got to the part about how I love writing 4 or 5 lines of code where programmers of other languages have to write 20 or 30, my new friend hinted that he thought I was talking about completely unreadable Perl code.

Magit, HDIELWT, and Dot Emacs On Steroids

Everyone has experienced the feeling of familiarizing oneself with a technology over a period of a few weeks or months and arriving at the "How did I ever live without this?" moment (hereto forth HDIELWT). I have often pondered that question quite seriously, trying to remember hard how I managed before tool X came along. It has happened to me with many a tool, including Emacs, Common Lisp, Delicious, Reddit, and several Google products, such as Gmail, Reader, Calendar, and Voice.

Hacking XQuery Into Emacs With Berkeley DB XML

I often need to query an XML document without having to load it into a native XML database. In a perfect world, I would simply load the document into my editor, sprinkle some XQuery into the document, highlight the portions I want to evaluate, then hit a key combination to view a new window with the results. The whole operation should take all of a few seconds for a large class of XML documents and queries.

Thankfully, this is indeed a perfect world. And, I'm an Emacs user.

6 Tips for Optimizing a Native XML Database

IBM DeveloperWorks just published an article of mine: http://www.ibm.com/developerworks/xml/library/x-optxmldb/index.html

RE: Querying s-expressions in Common Lisp

I just found an article titled Querying s-expressions in Common Lisp that Slava Akhmechet posted to defmacro.org last year. (Yes, I know--old news. I have a lot of catching up to do.)

The article got me excited because I am an XQuery programmer and I've always wanted to see something like XPath in Lisp and in Perl. (Thanks Slava!) I've even mentioned this to my peers. But I'm not talking about a library to manipulate, navigate, or query XML.

Quicksort Performance: Comparing Some Lisps And Perl

A few days ago, I wrote a simple Quicksort implementation in Common Lisp. After that, I started to wonder how other lisps and Perl compared for sorting numbers.

SBCL is Fast!

I just read an article comparing the performance of Clojure, Java, Ruby, and Scala. As I read the article, I wondered how Common Lisp compares to the languages covered in the article.

Perl Sockets Swimming in a Thread Pool

I've written a simple multithreaded TCP server that uses sockets and a thread pool to handle client requests. This server is packaged into a class (DcServer) that can be trivial to use.
Syndicate content