I have been looking for some Java based string Tries, preferably one with compression. Here is what I've come up with so far.
There is a TernaryStringTrie in the jaspell.sourceforge.com http://jaspell.sourceforge.net/javadocs/pt/tumba/spell/TernarySearchTrie.html
There is the open patricia trie http://code.google.com/p/patricia-trie/
I just found a simple PrefixTrie one in strut2. http://struts.apache.org/2.2.3/struts2-core/apidocs/org/apache/struts2/util/PrefixTrie.html
I guess there is this one.
http://www.java2s.com/Open-Source/Java-Document/Internationalization-Localization/icu4j/com/ibm/icu/impl/CharTrie.java.htm
There is this one
http://www.digitaltsunami.net/projects/wordscope/site/apidocs/net/digitaltsunami/word/util/CharTrie.html
I would like something like the marisa trie implemented in java.
http://code.google.com/p/marisa-trie/
There is this one:
http://www.badgenow.com/p/radixtree/
This one works well:
https://code.google.com/p/radixtree-java/
There is one here that gives a high degree of compression and sacrifices speed:
https://github.com/ning/tr13
Here is a nice comparison test that compares tr13 with hash implementations in terms of space and time.
http://groups.google.com/group/ning-tr13-users/msg/8c3e942335676b96
For compression I found the dsiutils project here
Wednesday, June 15, 2011
Wednesday, November 10, 2010
Use netcat as a fake server to debug http issues
I had a problem with my http server where my cookie didn't seem to be accepted by the browser and resent. To debug the issue I wanted to be able to edit the headers that were being sent back to the browser. Here is the technique I used to quickly find the issue.
After that you go to your browser at localhost:8099 and you'll get the response you set up.
# use curl to pull the raw response
# from the server and the headers that were sent back
curl -D headers2 --raw www.serverwithproblem.com > raw2.txt
# concatenate the headers and response into one file
cat headers2 raw2.txt > both2.txt
# cause netcat to listen on a specified port
# and cat your mock response to it
cat both2.txt | nc -l 8099
# netcat will sit and wait for your request
# now aim your browser at localhost:8099
After that you go to your browser at localhost:8099 and you'll get the response you set up.
Thursday, October 28, 2010
focus
I had been running some scripts, but kept getting distracted.
I found a linux script for a dialog alert, but not one for OSX, so here is my modified script for OSX.
I found a linux script for a dialog alert, but not one for OSX, so here is my modified script for OSX.
#!/bin/bash
eval $@
if [[ $? -eq 0 ]]; then
osascript -e 'tell application "Finder"' -e "activate" -e "display dialog \"Command '$@' in $PWD completed.\"" -e 'end tell';
else
osascript -e 'tell application "Finder"' -e "activate" -e "display dialog \"Command '$@' in $PWD failed! $@\"" -e 'end tell';
fi
Thursday, September 16, 2010
Yay Conque
I just found this vim plugin called Conque that lets you run a shell inside your vim window. It looks almost perfect.
Tuesday, September 14, 2010
Copy from and Paste to Native OS X Clipboard in Vim
I was annoyed that the builtin OSX vim version on Snow Leopard could not copy to the clipboard. I grabbed this homebrew formula http://github.com/adamv/homebrew/blob/duplicates/Library/Formula/vim.rb and recompiled vim with it. I had to move the existing vim out of way for some reason and then I had a shiny new vim with clipboard support. Just "set clipboard=unnamed" in your .vimrc file.
Wednesday, December 23, 2009
Vrapper is nice, Vim + eclipse
I like using vim, but all day I program in eclipse, which edits like a normal editor. The refactoring capabilities are important for my Java work. I tried eclim, but trying to learn the mappings is and get setup is just too much work, and some things are not yet implemented. I think with alot of time spent on it, it could end up useful, but for now Vrapper has been nice. I installed it as an eclipse plugin and it lets you easily turn it on and off. I also like that when you are normal mode it acts like a normal eclipse editor where highlighting works as expected, then you can switch back to vim mode with the escape key and do some more powerful editing, it doesn't do everything vim does, so sometimes it's better to use the real vim, but it does alot of what you want. For that I created an eclipse tool
Program:
/usr/local/bin/tmux
Arguments:
new-window "vim ${resource_loc}"
this lets me click my tool and open the current file I'm working on inside a new tmux window editing with vim. I typically use that when I need to do some substitutions because I like the way vim substitutes better than the modal dialog box eclipse uses.
Program:
/usr/local/bin/tmux
Arguments:
new-window "vim ${resource_loc}"
this lets me click my tool and open the current file I'm working on inside a new tmux window editing with vim. I typically use that when I need to do some substitutions because I like the way vim substitutes better than the modal dialog box eclipse uses.
Monday, November 30, 2009
Use Tmux instead of screen
I've been using tmux for awhile instead of screen. The options are a little more intuitive. The code is far cleaner than the screen code, and the development is active and ongoing. I've been working with Nicholas Marriot the maintainer to get a patch in (now added) to create some functionality similar to screen hardcopy and he has been very responsive.
Subscribe to:
Posts (Atom)