Archive for October 2006

What’s bad about Ubuntu

The only really bad thing with Ubuntu is that they release every 6 months. This means that every 6 months the web is flodded with articles about installing Ubuntu; articles about what’s good, articles about what’s bad, articles about how to fix what’s bad and thereby showing that Ubuntu still is good, articles about upgrading, articles about installing on a clean system, articles about Ubuntu chaning lives, articles about how installing Ubuntu saves a kitten…

If this continues the web will become useless. Seriously, it will!

My thoughts on DT (like anyone cares)

It’s been hard to avoid the whole Dunc-Tank debacle that’s been going on in Debian for a while now. I can’t say I care a whole lot, but after reading the position statement posted by a few DDs I got to thinking.

At about the time of Warty Warthog I jumped on the Ubuntu band wagon. I had been using Debian for a few years already. Becoming a DD was something I thought was worth persuing, but it was hard work. I didn’t even find anyone to upload my packages. Disappointment struck and I jumped ship. In Ubuntu I found a new community, a community that was growing and actively supported people who were interested in contributing. Due to circumstances I couldn’t put in as much work as I wanted and I still had that nagging feeling that to really contribute, even to Ubuntu, I needed to contribute to Debian. After all Ubuntu is a fork of Debian. There was also a kind of built-in inequality in Ubuntu. There were first-rate citizens and second-rate citizens. First-rate citizens were employed by Canonical. In the end my Ubuntu days ended during Breezy and I went back to Debian. There were several reasons for my switch back, but one was that in Debian everyone is equal. You can go as far as you want in Debian, you just have to put in the work. It is a meritocracy.

So, where do my thoughts on DT come? Well, here it is; DT threatens that equality. Debian runs the risk of becoming a project with tiered membership. Luckily the members are vocal, opinionated, and not afraid of using their MUAs. I still have trust in Debian. We live and we learn.

The basic idea of DT (paying people to work on Debian) isn’t all bad but maybe they should have let the DDs elect who gets paid to work on Debian? Or maybe it should be run similar to Google’s summer of code, with project proposals and DDs electing projects worth investing in?

In the end, what do I know? I’m not even a DD.

YAHT: Simple state monad (note to self)

First off, keep in mind that the State st a type is a function type (st -> (st, a)) and that returnState a wraps a into a function that returns a state-value,value pair when it’s applied to a state-value.

bindState is a bit complicated to think about. It takes two arguments, both functions. The first (m) is of type st -> (st, a) (i.e. State st a). The second (k) is of type a -> (st -> (st, b)) (i.e. a-> (State st b)). In other words, this second argument is a function that takes a value and returns a function that we can apply to a state, the return function has “wrapped up” in it the end result of the computation. Looking more into the implementation of bindState we see that it returns a function taking one argument (st) where m is used to calculate a new state-value,value (st' and a) pair based on st. Next k is used to “wrap” a into a function (m') that we can apply a state_value to. The last step is to apply the new state (st') to the function wrapping the new value (m').

Looking at mapTreeStateM on (Leaf a) we see that f a is m in bindState. \b -> returnState (Leaf b), from our look at bindState we can see that b here will be our newly calculated value (i.e. the new value coming out of f a will be wrapped into a leaf again).

I found it easier to understand when I applied an “identity function” to a tree:

doNothing :: Integer -> State Integer Integer
doNothing a = returnState a

Working through, on paper, what goes on when applying doNothing, a tree of one leaf, and an initial state of 0 made it quite clear what is happening.

Analysing the recursive step after this is fairly straight forward. Adding parentheses makes it a bit easier to read and I found it helpful to rewrite it to only consider the left branches:

mapTreeStateMLO :: (a -> State st Integer) -> Tree a -> State st (Tree Integer)
mapTreeStateMLO f (Leaf a) =
    (f a) `bindState` (\b -> returnState (Leaf b))
mapTreeStateMLO f (Branch lhs rhs) =
    (mapTreeStateMLO f lhs) `bindState` (\lhs' ->
    returnState (Branch lhs' (Leaf (-1))))

The extension to right branches comes fairly naturally after that.

I wrote a few functions to play with mapTreeStateM. All of them use a single integer to represent its state.

State is the number of leaves in the tree:

countLeaf :: Integer -> State Integer Integer
countLeaf a = \st -> (st + 1, a)

State is the maximum value of a leaf

maxLeaf :: Integer -> State Integer Integer
maxLeaf a = \st -> (max st a, a)

This function that numbers each leaf in the tree.

numberLeaf :: Integer -> State Integer (Integer, Integer)
numberLeaf a = \st -> (st + 1, (st, a))

Why freedom matters to end users

I’m not a Debian Developer, so the recent Firefox/Icedove debacle hasn’t caught my attention that much. Basically I trust Debian to do the right thing. It seems in this case they are, again, doing the right thing.

GNOME’s Dave Neary says it’s ill-advised of Mozilla to care more about practicality and usability than freedom. He’s right! I read a few of the comments, and as so often people (i.e. users) say that freedom only matters to developers. That is simply not true! Please think about it! How does the freedom in source empower you to do what you want to do?

I’ve heard a few stories of people who are switching from Windows to Linux, but who can’t make a total switch because of iTunes. Since iTunes is closed (and defective by design) they have no choice but to keep Windows around in order to access the music they’ve bought. (It’s also higly ironical that Apple has written a program that keeps people using Windows.)

Consider what might happen if the Linux kernel accepted closed-source drivers.

Also, if you do care about freedom, then read this. Maybe it’ll help you in making others understand why free is better for you.

Yes, GConf synch would be good!

Jono is complaining about moving Evolution setting between machines. GConf can’t be synched easily between machines. Maybe the GConf diff tool could be a start of a proper synch tool for GConf?

(This is one of many reasons I keep on using mutt and fetchmail+procmail. I can easily keep my configurations in synch.)

YAHT: Things I haven’t seen in the text

If there’s a type Foo a b, then it’s possible to access a and b in a function definition through the notation f@(x y):

bar :: Foo a b -> Int
bar f@(x y) = ...

Very handy indeed.

YAHT: Computation class (note to self)

  • Computation wraps a result of a function in a type.
  • augment strips the type, applies a function to the result. The function must wrap the end result in the type again.
  • combine “joins” two results together.

Making [] and instance of Computation illustrates it the best. Maybe and Failable are a bit “funny” because the combine works like or, i.e. they take the first success x and run with it.

Getting searchAll to work requires a type definition.

 searchAll :: Graph  v e -> Int Int -> Maybe [Int]

or

 searchAll :: Graph  v e -> Int Int -> Failable [Int]

or

 searchAll :: Graph  v e -> Int Int -> [[Int]]

How I think about searchAll:

  1. src == dst is a successful end state. The result is [src] wrapped in success.
  2. Running out of edges in the inner function (search') is an unsuccessful end state. The result is a string wrapped in failure.
  3. The first recursive step for search' (src == u) walks us one step on the way (u -> v).
    1. The call to searchAll returns a wrapped result (i.e. path(s) from v to dst),
    2. we augment this result by sticking u in front of it (for the list-based Computation that means mapping u: on each path, for the others it means dropping the “wrapper type” and calling (u:) on the actual result), then
    3. we wrap it all up again.
    4. Finally we combine it with the result of a search' on the other edges. The combine in the case of lists is concatenation, i.e. we add our list of current results to all other results. For the other two combine is a “pick first” operation.
  4. The other recursive step for search' simply looks for results in all remaining edges since the current edge isn’t part of our path.

Now I can go on to read about monads.

Microsoft ad

Are you running a huge corporation with the solid cash flow that follows from having your employees sending instant messages to each other?

Then Microsoft is the company to turn to for software. They will help you “hit the ground running”.

Just remember that hitting the ground running won’t do you much good if you’re falling head first!

Links and stuff

Yes, hpodder is awesome.

Theo de Raadt sometimes has some very good things to say. His way of saying it is always entertaining though.

The US politicians have been busy. First they claim space. I predict it’s only a matter of time before DHS is given jurisdiction over space, effectively making the US an intergalactic power. At the same time they’ve been busy signing away the single most important idea in the US body of law, separation of powers, making US the Fourth Reich. It seems Constitution 2.0 is now a reality.

The UK can’t afford to be any worse. At least there is some discussion of our loss of liberty. Get yourself a suspected terrorist badge, or order a t-shirt:

I wonder how long it’ll take until the message reaches the media and the politicians. Solve the basic problem rather than patching up the symptoms. Identity fraud will remain a growing problem as long as it’s possible easy to “become someone” by using documents that are sent regularly through the mail (i.e. bills).

What’s wrong with the English when it comes to bathrooms?

Now, what’s wrong with the following:

  1. A hand-held shower in a bath tub.
  2. No shower curtain.
  3. Partial tiling around the bath tub, exposing dry wall at about 1 metres height.
  4. Thick, lush carpet on the floor.

Everything is wrong! If you don’t see that every one of those things, taken in isolation, is wrong then you’re most probably English! And, no! Four wrongs don’t make a right!

The amazing thing is that I’ve just described a large number of bathrooms in newly built homes in the area where we live. And they seem to be in use. I don’t see how, unless you shower in fetal position.