2011/05/05

Moved to Posterous

The blog is now served under my own domain, with the help from Posterous.
Here I briefly explained why I chose Posterous than blogger.com

2008/09/20

Definition of bind operator for State monad?

instance Monad (State s) where 
return a = State $ \s -> (a,s)
(State x) >>= f = State $ \s -> let (v,s') = x s in runState (f v) s'


instance
Monad (State s) where
return a = State $ \s -> (a, s)
m >>= k = State $ \s -> let
(a, s') = runState m s
in runState (k a) s

Hmm, how and why are they different? The latter one makes sense to me, but I cannot get the part to apply x to s in the former one.

Update:

I got it. I just did not notice that the former used pattern matching against to deconstruct the first argument (State x), where as the latter used field selector (runState). Note that the State monad is declared as follows:
newtype State s a = State { runState :: s -> (a, s) }

Labels:

2008/02/12

test from n810

here here

2008/01/06

Book Cataloging

It's been a while since my last post... actually I started writing this article one month ago and still I am writing this. In fact I sometimes make a reply for an email almost one year after receiving it. That was how we did in pen and paper era.

Technologies have made it easier to retrieve information, but have not much helped creating or generating something really new.

Now, I am talking about book cataloging, inspired by a Slashdot article: Slashdot | The Home Library Problem Solved. Although I do not have much interest in physical home libraries (it is not practical to build a decent home library in this small condo, after all), cataloging books has been one of my sources of headache.

My requirements are not ambitious:
  • Accessible through Web
  • Can handle multilingual titles
  • Easy entry
The first requirement is crucial and stand-alone applications such as Delicious Library and Booxter are excluded, though they are cool and comfortable to use. You can find information on open source cataloging software such as tellico here.

As the little widget in the sidebar of this blog shows, I have used LibraryThing for some time, but it has several problems including this. Actually I have tried Hondana.org, which is targeted at Japanese readers, but it is not about cataloging. Hondana.org focuses on social networking through books, and features not relevant to such a goal are not great.

From the Slashdot article I found goodreads, yet another LibraryThing. But it does not have collision issue like LT and seems to work flawlessly for now. Worth a try.

Just an additional requirement is lending management, and all of above have little support or nothing for that. There are such systems as Webrary and Koha, but they are both overkill for me.

And just for your information, you can find a detailed list of cataloging software here.

Labels: , ,

2007/12/15

Using CueCat USB barcode reader with Mac OS X

I got it from LibraryThing (also available from Amazon), to ease the task of entering books from my library into the database (presumably LT, but will consider using Delicious Library when it's 2.0 is available).

Unfortunately CueCat spits out encrypted data and needs a simple modification before it sends out any meaningful digits. I followed instruction at this site and it worked fine.

Note that you do not need this modification if you use it only on LibraryThing... it automatically decrypts the code for you.

Labels: , , ,

2007/12/08

Book collision on LibraryThing

I resumed using LibraryThing recently and added several books more (you might notice books selected from my online library in the sidebar). Among them, the entry for Iwanami Mathematics Dictionary (yes, it's in Japanese) on LT got weird.

The entry got mixed (or combined, as a post in LT group forum told) with some strange manga book which I am never aware of. The post said it was caused by hash collision... what a poor implementation!

Labels: ,

Joe Armstrong's Erlang Book

As some of you may know, I am responsible for translating Joe Armstrong's new book about Erlang into Japanese.

Translation is close to finish now, though still I have to do with inputs from reviewers and catch up to the latest version of the original English version. And it's nice if I can include updates from R12B-0 release if any, but that release seems not stable now.

So I am supposed not to make a fuss with Haskell. I know.

Labels: ,