Archive for January, 2007

A large picture

Monday, January 29th, 2007

And not a very good one at that, but the first time I've tried stitching together a panorama.

On the far left, the Pacific Ocean (almost visible!). On the far right, that tiny white thing on the hillside is the Hollywood sign. In between is mostly downtown Culver City, with the high-rise offices of Wilshire in the background.
West LA

the email project part 2

Monday, January 29th, 2007

Well, after a crash course in perl I hacked together something to parse the text files and create mbox format, which I then managed to import into Evolution. So now I have recovered email from my early days at Bullfrog (95-96). Still working on the .pst which isn't readable by readpst. Maybe I'll have to take it to work to open with Outlook and re-export.

the email project

Sunday, January 28th, 2007

In a further effort to consolidate and preserve data, I've made a start with getting all my past email imported into Evolution (from whence I shall more easily be able to propagate it in future). The email of the past dozen or more years is scattered on several CDs which I've tracked down, and in several formats. With the help of readpst, libdbx, and msgconvert I've managed to read most of it in. What remains is a singular .pst file that won't read for some reason, the current stuff I have at work, and the very old stuff (1994-1997) that is in text files exported from Pegasus Mail and Pine. Perhaps I can figure out some way to process the text files.

The Amen Break

Monday, January 22nd, 2007

If you're watching the Aussie Open on ESPN2 this week, listen out for the Amen Break in the Nissan commercial. It's the first time I've heard it “in the wild”.

A new car!

Sunday, January 21st, 2007

2005 Toyota Camry LE, Dark Blue (I think it's “Indigo”). All the usual gubbins plus powered driver's seat and stereo controls on the steering wheel. Mrs Elbeno is happy now that she can gad about with Mini-Elbeno without having to drop me off in the morning and pick me up in the evening.


Saturday, January 20th, 2007

Just wanted to fill in the “Music:” box really.

A Functional Weekend

Tuesday, January 16th, 2007

For some time now I’ve been aware of the fact that 12 years’ professional C and C++ programming has moulded my programming thinking habits. This has been brought home particularly in the last 3 years when I’ve been doing quite advanced C++ and therefore reaching the limits of compilers and indeed the limits of C++ itself. So with that realisation, I resolved some time ago to learn more languages and broaden my current programming horizons.

I am fortunate that I learned ML before I learned C (both at university), although of course like many Brits of my generation I first learned BASIC on a BBC micro (and in fact a little 6502 assembler!). Perhaps that is why I realise the limitations of my C++ thinking in the first place. Anyway, over the last year or so I’ve been studying a bit of Lisp, and lately I’ve been studying Haskell.

Haskell reminded me of ML, or to be more accurate, reminded me of my ML course back in the day. Particularly the way it specifies function types, and although my tutorial hasn’t covered it yet, I know that curried functions are only a page or two away. Anyway, thinking back to my ML course, I remembered it really coming alive near the end when one of the exercises we had was in doing lazy list evaluation.

You are of course familiar with the Sieve of Eratosthenes. I remembered my ML exercise as using this method: i.e. lazily evaluating an infinite list of integers, then filtering out the multiples of successive list head elements. This seemed to me like a good test application for a functional language – more interesting than a factorial function (the “Hello, World!” of functional languages), and of appropriate complexity density to get a feeling for the power of the language.

So I spent some time digging in the basement and uncovered all my university lecture notes. A veritable treasure trove! But more of than another time. I found the original ML exercise (number 9 in a series of 10), which says:

Here is a definition of integer streams.

datatype stream = Item of Int * (unit->stream);
fun cons (x,xs) = Item(x, xs);
fun head (Item(i,xf)) = i;
fun tail (Item(i,xf)) = xf();
fun makeints n = cons (n, fn()=> makeints(n+1));

You can see where this is going: a stream is a tuple of (int, function to produce the rest of the stream) and repeatedly tailing the stream is repeated application of the function. Thus you get a lazily-evaluated infinite stream of integers. Then we can define a function that maps a function onto every item in the stream:

fun maps f xs = cons(f (head xs), fn()=> maps f (tail xs));

From this basis it is fairly easy to write a function that filters out all multiples of n from the stream and hence to proceed to an implementation of the Sieve of Eratosthenes.

Having refreshed my memory, I set about solving the same problem in Haskell. I needed to read a few pages ahead in the tutorial, but Haskell has two great things working for it for this problem: built-in lazy evaluation, and list comprehensions. After a bit of reading, I discovered the following:

numsFrom n = n : numsFrom (n+1)

Which produces our infinite list of integers starting from n. Because it cannot of course be completely evaluated, it’s useful to use the take function to get a given number of elements from the front:

take 10 (numsFrom 1)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

From here it was a hop and skip (via way of a list comprehension) straight to the sieve:

primes n = n : [x | x <- primes (n+1), x `mod` n /= 0]

(n is the list head, the rest of the list is made from n+1 etc with multiples of n filtered out.) And that’s it!

take 10 (primes 2)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

Haskell passes the test. The Sieve of Eratosthenes in one line.

Videogame memorabilia!

Sunday, January 14th, 2007

Medal of Honor

Various items I’ve collected over the course of my career.

Videogame shirts!

Sunday, January 14th, 2007


Shirts that I’ve collected over my career.

from the person who followed the orange meme…

Tuesday, January 9th, 2007

1. Elaborate on your default icon.
It's from my wedding programme. Original artwork by mikem.

2. What's your current relationship status?
Married with one child.

3. Ever have a near-death experience?

4. Name an obvious quality you have.
Red hair? Intelligence? Define obvious.

5. What's the name of the song that's stuck in your head right now?
Mahna Mahna.

6. Name a celebrity you would marry.
If I weren't already married? And if she weren't married? And if we were dating? Alicia Silverstone is easy on the eyes, but she'd have to let me eat meat and such.

7. Who will cut and paste this first?
I did.

8. Has anyone ever said you look like a celebrity?
That guy off CSI. But not so much.

9. Do you wear a watch? What kind?
Seiko. Analogue. Gold, slim, white face, thin Roman numerals.

10. Do you have anything pierced?

11. Do you have any tattoos?

12. Do you like pain?
I am a product of evolution. So no.

13. Do you like to shop?
Online, where the shopping experience can be short and targeted.

14. What was the last thing you paid for with cash?
A roll of lifesavers.

15. What was the last thing you paid for with your credit card?
A P.G. Wodehouse book.

16. Who was the last person you spoke to on the phone?
Brian from Wonderful World of Animation.

17. What is on your desktop background?

18. What is the background on your cell phone?
I don't have one of those new-fangled ones with backgrounds. It makes phone calls, it stores numbers. The screen is a regular monochrome LCD. That is all.

19. What was the last movie you watched?

20. What was the last book you read?
To Engineer Is Human.