[ Content | Sidebar ]

Archives for 2010

Cold

December 31st, 2010

Here in Hastings it’s been cold just like the rest of the country. I walked right up to the highest point in the area a few days ago and it’s still covered in snow.

Here is some evidence of a cow caught on the fence:

This is probably the final post of the year which means I haven’t been nearly as productive as I was in 2009 with a measly 73 posts to last year’s 96. Must try harder in 2011.

Filed in photos - Comments closed

Borked Sheep

December 31st, 2010

This sheep, it not functioning anymore.

Filed in photos - Comments closed

Sparkle

December 30th, 2010

My dad has some magical glass that he can put in front of his camera to make things sparkle! Here I borrowed the camera and applied the sparklizer to the Christmas tree!

Filed in photos - Comments closed

Scheme on TV

December 24th, 2010

Here’s a collection of interesting Scheme videos you can watch instead of the usual Christmas TV:

http://programming-musings.org/2009/12/23/scheme-lectures-mostly

The Guy Steele Designing by Accident talk on the history of Scheme is really good (download the slides first). Watch the Gerald Sussman one too (it’s short!). Also, who doesn’t want to know the value of ((call/cc call/cc) (call/cc call/cc))?? Holiday fun for all the family.

This talk on a Scheme documentation language (and DSLs in general) is good also. From last year’s ICFP:

http://www.vimeo.com/6630691

Using SLIME with Chicken Scheme

December 12th, 2010

Common Lisp programmers are blessed with the awesome SLIME development environment for Emacs; but sadly Schemers have nothing comparable. There are a few SLIME backends for various Schemes around, in varying states of completeness, but as far as I can tell none for my Scheme implementation of choice: Chicken Scheme.

Therefore I present swank-chicken: a SWANK server written in Chicken Scheme. (SWANK is the protocol SLIME uses to talk to the inferior Lisp process.) I’ve been hacking it together over the past week or two and it’s now reached the point where it is more or less usable. Click on the screenshot below for an example:

Supported features so far:

  • REPL support with input/output (i.e. read and write work as expected)
  • Complile region and load file commands (e.g. C-c C-l, C-c C-c)
  • Basic SLDB support with back trace
  • Parameter argument hints in the minibuffer

Huge swathes of SLIME features are obviously missing at the moment, but the most useful ones are there. In particular, I think it’s at least as functional as the normal inferior-scheme mode. The most significant omission at the moment is support for interrupting Scheme evaluation from Emacs – C-c C-c at the REPL will currently kill the backend process completely. Naïvely this should be implemented in the same way as the debugger-abort command: by calling the top-level continuation. However, perhaps unsurprisingly, calling a continuation from a Scheme SIGINT handler turns out to be a bad idea. So if you have a runaway process you must kill and restart it with C-c C-c M-x slime-restart-inferior-lisp.

UPDATE: some of these issues have been fixed.

To get started clone the git repository using:

git clone git://github.com/nickg/swank-chicken.git

Alternatively just download swank-chicken.scm and chicken-slime.el.

First we need to install a few Chicken extensions:

chicken-install format symbol-utils

Obviously you also need to install SLIME: I’ve been using the latest code from CVS but older versions should work too.

Next, place chicken-slime.el somewhere in your Emacs load-path and add the following to your .emacs:

(autoload 'chicken-slime "chicken-slime" "SWANK backend for Chicken" t)
(setq swank-chicken-path "/path/to/swank-chicken.scm")
 
(add-hook 'scheme-mode-hook
          (lambda ()
            (slime-mode t)))

Now you should be able to use SLIME commands in a Scheme buffer. To start a Scheme REPL do M-x chicken-slime.

That’s it! Let me know if you have any problems/suggestions. I intend to do some more work on this and package it up as an Egg. The code is available under the MIT license.

Abingdon, Oxford

November 21st, 2010

Today is my activity day so I diligently headed off on the next part of my Thames Path adventure from Culham to Oxford. Culham, if you remember, was where I had to be evacuated from by taxi after the unexpected coming of darkness a few weeks ago. It turns out Culham is the site of the UK’s two fusion experiments – MAST and JET – which I missed before, on account of it being dark.

It was a fairly short section of path – around 12 miles – which is just as well as it was cold and grey and intermittently wet. After a few miles I came to Abingdon.

Because I don’t have much to talk about this week, I’m going to insert a topical factoid: the building you can see above is the County Hall. Why is this topical? Well, it’s tradition that on important royal occasions such as coronations or the upcoming wedding the local dignitaries climb onto the roof and hurl buns at the crowd below. The local museum apparently has preserved examples of buns that were thrown as long ago as the 19th century. Unfortunately it was closed today so I’ll have to go back again.

After several more hours of walking I arrived in Oxford. Beyond Oxford is a great unknown, as I don’t believe I’ve ever been to Wiltshire before. But that will have to wait for another day. I’m sure you’re all as excited as I am.

A new toy

November 20th, 2010

I have a new toy! It’s a tiny computer. Specifically a BeagleBoard-xM. Here it is next to a pen for comparison:

Inside is a TI OMAP3530 SoC containing an ARM Cortex A8 core, TI C64x DSP, and a PowerVR GPU. As well as 512MB RAM and 256MB NAND flash. It supports tons of peripherals including a UART, Ethernet, audio in/out, DVI out, and four USB ports. So you could actually use it as your main computer if you wanted! There’s also an expansion header for electronics projects and a JTAG port for hardcore debugging. Underneath is a micro SD slot which it can boot off.

I haven’t done too much with it so far: I’ve built a Linux 2.6.36 kernel and booted it with an Ubuntu userland to check everything works. I also rebuilt and re-flashed the bootloader and Das U-Boot to make sure I knew how they worked. While doing this I ran into a bug with the bootloader where it was unable to read files from the second sector of the FAT32 root directory. It was quite simple to fix (thankfully the source was available) and you can get the patch from my GitHub if you run into the same thing. Alternatively use FAT16 for the boot partition. Hopefully it will be merged with the mainline code soon though.

I’m not sure what I’m actually going to do with it: currently looking for a project. I want to play with the PowerVR GPU (it supports OpenGL ES), and I’ve done a little bit of TI DSP programming in my day job so learning more about that could be fun. I also like the idea of trying to get NetBSD to boot on it (FreeBSD doesn’t yet support this ARM core version). Hopefully I will find something interesting to do and post it here.

Filed in musings - Comments closed

xcowsay 1.3

November 11th, 2010

Out of the barn and on to the interwebs: here it comes! xcowsay 1.3! This version is another minor upgrade to xcowsay with the following changes:

  • A number of small bug fixes in xcowsay itself and the configure script.
  • Setting --time=0 now means the cow is displayed until clicked.
  • If the text is so wide that the speech bubble would not fit on the screen, word wrapping is automatically applied. This can be disabled with --no-wrap.
  • As requested by some users, it is now possible to make the speech bubble appear on the left hand side using --left. This is useful if you are using your own left-facing image, for example.
  • New Russian and updated Portuguese translations.

You can download the source code here: xcowsay-1.3.tar.gz. There are no binary packages for this release as xcowsay is now in a large number of Linux distributions and BSD ports collections which will hopefully be updated soon.

You can now track xcowsay on GitHub if you like.

Several people have asked about anti-aliasing the edge of the cow and speech bubble. I’ve experimented a bit using Cario but unfortunately this does not seem to be possible as X only accepts a binary mask when cutting out shapes in windows. I think you would need a compositing window manager with a proper alpha channel for this to work so I doubt xcowsay will support it any time soon.

Filed in xcowsay - Comments closed

Goring to Culham

November 7th, 2010

I walked along the next bit of the Thames Path today, slowly making my way towards Oxford. Today’s segment was between Goring and Culham. It was quite pretty with autumn trees and quaint villages, but it did rain a bit. I didn’t manage to take many good pictures, but here’s one of some ill-looking berries:

Unfortunately it nearly all ended in disaster as I somewhat overestimated the distance I could walk during the daylight hours available. So I found myself hurrying along a muddy path as darkness closed in alarmingly quickly. I made it to Culham before it was completely dark but not in time to catch the last train home. Luckily there was an adjacent pub where I could acquire ale and the services of local taxi firm who conveyed me to Didcot for an outrageous fee – seriously, £16 for a seven mile journey??! I think I left quite a lot of mud in his car so maybe that’s fair.