Emacs pinky solution

Oct 23, 2008

For those who don't know of the Emacs pinky problem, I quote an explanation:

Because of Emacs' dependence on the modifier keys, in particular, how the control key is pressed with the little finger ("pinky"), heavy Emacs users have experienced pain in their pinky fingers (see repetitive strain injury and fat-finger).1

My solution to this problem has been to enforce a rule when using the keyboard:

Never use one hand to press two keys.

I personally do not have the pinky syndrome and I work in Emacs for everything apart from my web browser and GIMP, nine hours a day minimum.

This rule rids you of all sorts of pains, especially in Emacs.

  • C-x-s: right hand Ctrl, left hand x-s.
  • C-x b: right hand Ctrl, left hand x b.

This style shouldn't be all that alien, considering, and I really hope you already do this one: C-y: right hand Ctrl, left y (or vice-versa, but most of the time your right hand will be hitting Ctrl). I am efficient with this style and my hands don't hurt. I recommend it to everyone. Technically you don't have to use your pinky either. (And mapping CapsLock to Ctrl isn't useful at all (kind of a half-solution it seems to me).) It's just like learning to touch type correctly with proper finger positioning (which I learned recently with KTouch); strange at first but it is beneficial.

Blog shift and tagged feed

Oct 20, 2008 | Published in Misc, Haskell

I have completed shifting my blog back to /blog and in doing so discovered something nifty. Planet Haskell reads your blogs feed, but it reads every post no matter what the content, right? That's really annoying! Panda, fortunately and excellently, has one feed for all posts, and a separate feed for every tag you have. This means that I can redirect Planet Haskell to my Haskell feed, so you chap(ettes) only get my Haskell posts (instead of random posts about my cats). I suggest you all do the same. That is, I suggest you all use Panda or something. Or get some blog plugin that supports this. It would make Planet Haskell much more relevant. Unless everyone is already aware of this kind of feature and just choose to post irrelevant stuff on Haskell. If that is the case ignore this post.

Hopefully this will actually work. I don't know how often Planet checks feeds and I can't be bothered finding out right now. I tested myself with telnet:

chris@chrisdesktop:~$ telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /blog/feed/atom HTTP/1.1
Host: chrisdone.com
User-Agent: Planet Haskell and stuff

HTTP/1.1 301 Moved Permanently
Location: /blog/tag/Haskell/rss.xml
Content-Length: 0
Date: Mon, 20 Oct 2008 21:29:54 GMT
Server: lighttpd/1.4.19

It looks good. My lighttpd.conf code is:

$HTTP["useragent"] =~ "Planet Haskell" {
   url.redirect = ("^/blog/feed[/]{0,1}" => "/blog/tag/Haskell/rss.xml")
}

Fingers crossed.

(I know; I don't think atom is the same as RSS 2, but that's all Panda supports and hopefully Planet is clever enough to try all the kinds of feeds when parsing rather than looking at the filename.)

Lojban lookup page using Kibro

Oct 17, 2008 | Published in Kibro, Haskell

I have written a simple web app for querying Lojban vocabulary called jbobaurei. It uses the Language.Lojban library and Kibro. Check out the source code paste, and demo. A good demonstration is a search for "work".

This is my .kibro configuration:

[DEFAULT]
app-dir: app
fastcgi-dir: app/fastcgi
fcgi-out-dir: public
ghc-options: 
lighttpd-dir: app/lighttpd
main-is: src/Main.hs
manage-lighttpd: no
name: jbobaurei
public-dir: public
src-dir: src

And here is my lighttpd.conf configuration, under jbotcan:

$HTTP["host"] =~ "jbotcan.org" {

 ...

 # jbobaurei application
 fastcgi.server =
  ("/home/chris/haskell/jbobaurei/public/jbobaurei.fcgi"
   => (("socket" => "/home/chris/haskell/jbobaurei/app/fastcgi/jbobaurei.sock")) )
 $HTTP["url"] =~ "(^/jbobaurei[/]{0,1}|^/jboborei$)" {
   server.dir-listing   = "disable"
   server.document-root = "/home/chris/haskell/jbobaurei/public/"
   server.error-handler-404 = "jbobaurei.fcgi"
 }

 ...

}

Above you can see that any URL starting with "/jbobaurei" will be handled by jbobaurei.fcgi if 404 (directory list with dir-listing disabled is a 404 error). I change the document-root so that Lighttpd can access jbobaurei.fcgi.