19 June, 2010

normally distributed random numbers in haskell

somehow I expected to be able to get a normally distributed random number in haskell really easily by typing some term like "haskell random normal" into google. that came up with a bunch of stuff but nothing so simple as:
n <- getNormal mean dev
.

The most promising seemed to be the cabal package random-fu - although it looks like it has a lot of stuff in it and really all I want is the above single monadic action.

Cue the usual BS about installing packages (not haskell specific, just damned packaging in general) - today I need to edit my local hackage repository to remove some malformed packages, and upgrade GHC. frr. 6 hours just getting cabal install random-fu to work.

But once that was all done, the next morning, I got what I wanted - a short IO Double action: sampleFrom DevURandom (normal mean dev)

Hurrah.

12 June, 2010

rlwrap

I got frustrated when some application I was using *still* didn't support delete properly and discovered that the solution in that community (the OCaML world) seems to be (at least for commandline use) to use 'rlwrap' to add readline support to arbitrary applications.

eg:
$ rlwrap cat
Now you can use readline features (eg delete, cursor movement) to edit text

Neat.

http://utopia.knoware.nl/~hlub/rlwrap/

05 June, 2010

pink panther usb hub

I got this pink panther USB hub from mediamarkt - it was the same price as a USB extension cable (which is what I was looking for) - €7.99

Now I have three extra USB ports too, which is useful for attaching (for example) bamboo encrusted memory sticks, or my wide SD card reader.

One problem: when there are two of them chained with my ext hd on the end, the ext hd makes terrible clicking sound and doesn't start up properly. maybe thats a power problem?