Posts

Running argoUML, fixing hostname

When attempting to run ArgoUML under my custom install of Debian Lenny, it died on startup with the following: "ERROR: unable to get localhost information. java.net.UnknownHostException (...)" solution: check the output of the command hostname , add a line corresponding to that name to the file /etc/hosts Anyway, it might be a great piece of software, but I didn't have much luck with the functionality I needed. Namely, my simple collaboration diagram got its indexes all mixed up.

Install Hugs under Puppy Linux to program Haskell

Hugs is a nice little interpreter if you'd like to try out the language Haskell. It has few dependencies and it requires moderate resources to run. The download for a minimal install is less than 1.5MiB in size. If you have an operating system with package management, you can simply install the package 'hugs', or 'hugs98'. For example, on Debian-based systems (including Ubuntu) this amount to simply running: aptitude install hugs On distributions without a decent package manager (like Puppy Linux), you can install the Debian packages manually (refer to your distribution for details, but it usually involves clicking on each downloaded package or typing dpkg -i name.deb ). You first need to select a Debian major distribution version which matches with the versions of libraries on your system. On the Pupeee (Puppy 4.3) I had been using till now, choosing Lenny seems to work fine. So I've downloaded each i386 version from a mirror close-by of the following packages:...

Install GIMP resynthesizer for texturization

With this free GIMP plugin, texture synthesis is possible. It can generate images and fill voids from a given texture sample. Its uses include making a picture tileable, removing objects from images and images comforming to a given theme. resynthesizer source code, binary and free windows download Resynthesizer tutorial - use the Earth as seen from the Moon as your background picture

Puppy Linux on the IBM ThinkPad T42

I only gave a quick shot at the beast, but it did work out pretty well. It didn't work out of the box, however. kernel: 2.6.31.5 (Puppy) hardware: IBM ThinkPad T42 error message: initrd boot error "pup-431.sfs not found" solution: remove 'pmedia=usbflash' from syslinux.cfg other remedies to try: kernel command line: add 'acpi=force' and 'pci=noacpi' BIOS: turn off Fast Boot

Elementwise processing 2.1 for common keys in Haskell

Here's a neat little utility function which I commonly find useful. ef2_1 :: (a -> a -> a) -> (a -> a -> Bool) -> [a] -> [a] -> [a] ef2_1 = ef0 [] where  ef0 zs f lt (x:xs) (y:ys) | lt x y = ef0 (x:zs) f lt xs (y:ys)  ef0 zs f lt (x:xs) (y:ys) | lt y x = ef0 (y:zs) f lt (x:xs) ys  ef0 zs f lt (x:xs) (y:ys) = ef0 (f x y:zs) f lt xs ys  ef0 zs _ _ xr yr = reverse $ xr ++ yr ++ zs main = print $ ef2_1 (\x _->x) (\(x,_) (y,_)->x<y) d1 d2 where  d1 = [(1,9), (3,8), (4,7), (5,6), (7,5)]  d2 = [(2,5), (4,4), (6,3)]

Making metropolitan travel more ergonomic

It would make a difference if they have published the exact synchronization of traffic lights and/or broadcast timely phase signals (via UDP over GPRS or such). Using this data combined with the readings of the bicycle odometer, software on your PDA or mobile phone could continuously suggest a velocity that should minimize idling at each traffic light. Manual settings for maximal speed, acceleration and cardiovascular pulse could be given. Note that this strategy only works well for uncongested networks, like dedicated bicycle lanes or paths. Trained cyclist already apply a similar technique manually, however, not all lights are synchronized to each other.

Can you guess which conjecture these try to test?

let f l 1=l++[1];f l k|mod k 2==0=f(l++[k])(div k 2);f l k=f(l++[k])(3*k+1)in putStr $ unlines $ map (show . f[]) [1..11] let f l 1=reverse(1:l);f l k|mod k 2==0=f(k:l)(div k 2);f l k=f(k:l)(3*k+1)in putStr $ unlines $ map (show . f[]) [1..11] let f 1=Nothing;f k=Just(g k,g k);g k|mod k 2==0=div k 2;g k=3*k+1 in putStr $ unlines $ map (show . \n -> n:unfoldr f n) [1..11] let f 1=Nothing;f k=let x=(if mod k 2==0 then div k 2 else 3*k+1)in Just(x,x)in putStr $ unlines $ map (show . \n -> n:unfoldr f n) [1..11]