Posted by Rick on the 23rd of October, 2008 at 10:38 pm under ublog.    This post has Comments.

My Emacs startup time was stretching beyond 10 seconds, which seemed a bit offputting even for a text editor cum operating system. I do have a fair amount of elisp loading at startup, however, and though I have played with byte-code-cache, I determined there must be an easier way to compile all my elisp files in one go, rather than calling byte-compile-file for each file in my elisp directory.  It turns out there is:

C-0 M-x byte-recompile-directory

will recursively traverse a directory stucture and compile all .el files encountered.  My startup time is back to 4 seconds.

Posted by Rick on the 19th of October, 2008 at 7:19 am under ublog.    This post has Comments.

It took me 30 years, but I woke up this Sunday morning and realized that rational numbers can be expressed as the ratio of two integers.

Posted by Rick on the 18th of October, 2008 at 7:01 pm under ublog.    This post has Comments.

By far the most brain-bendingly elegant definition of all the Fibonacci numbers I have ever encountered:

(def fibs (lazy-cat '(1 2) (map + fibs (drop 1 fibs))))

Found over an the clojure-euler wiki.

Posted by Rick on the 17th of October, 2008 at 11:53 pm under ublog.    This post has Comments.

Just watched the December 2007 Google Authors session with Randall Munroe, creator of the XKCD webcomic.  Really good talk; he seems like a real geek, which is awesome.  He inspired me to sign up for Project Euler, which I have.  I did the first problem in a couple of minutes, and visited the forum to find out what kind of code others were writing.  I continue to love lisp, so I think I’ll be tackling the challenges in Clojure.  The first problem yields to some basic list operations:

(reduce + (filter #(or (= (rem %1 3) 0) (= (rem %1 5) 0)) (range 1000)))

We’ll see how well Lisp holds up for the later problems.

Posted by admin on the 11th of October, 2008 at 4:09 pm under ublog.    This post has Comments.

Discovered that Wordpress has a great built-in feature that allows you to post entries by email. Setting it up was easy…and it may give me a way to post updates when I’m behind Nazi firewalls.

Posted by Rick on the 11th of October, 2008 at 1:31 pm under Programming and ublog.    This post has Comments.

Trying to figure out if there is anything in the canonical definition of streams (lazy lists) that says that you need to keep the initial elements of the stream after use (if, for example, you’re recursing down the list and the head elements are getting garbage collected). Can streams be used as iterators when traversed recursively?

Posted by Rick on the 11th of October, 2008 at 11:51 am under ublog.    This post has Comments.

Discovered Backpack a while back (February), a service from 37Signals that allows you to manage your data online in a variety of ways.  It seems like a shame to use their service when you have your own domain, so I decided that some of their features I could make use of with a “journal” approach to blogging, rather than only essays.  We’ll see if it works out.

Posted by Rick on the 11th of October, 2008 at 11:49 am under ublog.    This post has Comments.

Figured out how to generate a list of all k-element combinations from a set of n elements using double recursion. Apparently, the solution I developed is the “classical” way to do it, but it was challenging nevertheless.