Thursday, May 10, 2007

Debian gets feisty

A couple of weeks ago I upgraded my Debian box to Ubuntu feisty. The upgrade went ok, though today I found that my machine was having some issues and needed to be restarted. This is all fine and good except that I learned that the root filesystem is selected differently in feisty than it is in Debian.

Feisty wants to mount by UUID and my old upgraded Debian system wanted none of it. It had a kernel panic.

The fix?

I changed /etc/grub/grub.conf from root=UUID={...} to root=/dev/sda5.

I can't say I'm surprised. I've been a Debian user for coming up on 9 years. If I wasn't so comfortable with it I probably wouldn't have attempted the upgrade just because I know something is likely to go wrong when converting between distributions that just happen to use the same package manager.

Lets remember that this upgraded from a kernel I compiled myself with lilo as my boot loader. Ubuntu installed its own kernel and it uses grub unless you really have an opinion on the matter.

All told it was only a 15 minute fix and that's how I learned a valuable lesson.

Shaun

Funny thing I just heard

"Dude, it worked. I just drew the internet with it!"

Sunday, May 06, 2007

Programming Erlang

Last night I pre-ordered my copy of Programming Erlang: Software for a concurrent world.

After having read the example chapters I think this is going to be a really good book on the subject. Granted, by the time it gets here I may not really need it, but it will still be nice to have.

One of my favorite things about buying books like this is that I can get a better view of what the author thinks is really important about the language. Instead of a language reference where everything is given equal time. (because that's what you need in a reference) You get a view of some of the best practices around using certain parts of the language.

Languages have syntax, libraries, and idioms. You don't get the idioms from the library reference. You also don't get them from the language reference, it's too busy describing the syntax.

I like what I've seen, and I'm excited to get my copy when it ships later this summer.

More erlang awesomenes

This weekend I started playing with erlang again, and erlang started impressing me again.

I just declared a lexically scoped anonymous function and sent it to a different node. I then executed it on that node and it worked as expected.

For those who are not familiar, an anonymous function is a function that exists, but that is not associated with a function name in a global table of functions. It only exists by a variable reference that can and will go away at some point.

Lexical scoping is when you use a variable in an anonymous function that exists in the current scope where the function is created. That is the only copy of the variable that will be used in the execution of the anonymous function, even in the case that another variable of the same name is seen near the anonymous function later.

Creating the lexically scoped anonymous function and sending it to the other host:

(nomad@nomad)43> Var = 4.
4
(nomad@nomad)44> Fn = fun(X) -> Var * X end.
#Fun
(nomad@nomad)45> global:send(slim_proc,Fn).
<4792.72.0>


Receiving the anonymous function into the variable Fn and executing it using map and executing it directly:

(slim@slim)28> receive Fn -> Fn end.
#Fun
(slim@slim)29> L = [1,3,4].
[1,3,4]
(slim@slim)30> lists:map(Fn,L).
[4,12,16]
(slim@slim)31> Fn(3).
12


Remember: these are on two different machines executing in a clustered erlang environment.

Is this not awesome?

Saturday, May 05, 2007

If you die in Canada you die in real life!

In the event you haven't noticed. I would have to say that xkcd.com is my favorite web comic.

That said, it looks like I'm going to PGCon at the University of Ottawa in a couple of weeks. This will be my first conference of this variety. I'm highly excited.