Code of Thrones

Nearest Neighbor Search with KDTree

Offen we need to ask Google Maps, what’s the nearest restaurant/hotel/whatever nearby? Then Google Maps will take your GPS information (latitude, longitude), and do a search on the map to find the nearest location. This is a multidimensional nearest neighbor search problem, in which case k-d tree can be useful. K-d tree is a binary tree of k-dimensional data, and is interesting that it splits the left and right children by different dimensions at different depth of the tree. Similar to other binary trees, searches take O(log n) time on average.

Continue Reading

Japanese Tokenization with Java and Lucene

I was trying to write Japanese analysis program with Java and Lucene 4.4. After trying Lucene’s CJKAnalyzer and Lucene-gosen, I ended up writing my own Tokenizer, Filter and Analyzer.

Continue Reading

Writing an application on Mac OS X with Mono C#

I have a windows form application written in C#, and I thought it would be cool if I can migrate it on to Mac OS with Mono, which claims to provide portable C# on both Windows, Linux and Mac OS.

Continue Reading