The poem you are looking for has moved here.
Thanks, Arne
| class CedictLoader | |
| include Enumerable | |
| URL = ENV['CEDICT'] || 'http://www.mdbg.net/chindict/export/cedict/cedict_1_0_ts_utf-8_mdbg.txt.gz' | |
| def initialize(input = nil) | |
| @input = input || ( | |
| require 'zlib' | |
| require 'open-uri' | |
| Zlib::GzipReader.new(open(URL))) |
| module Watchable | |
| attr_reader :watchers | |
| def watchers | |
| @watchers ||= Hash.new{|hsh,k| hsh[k]=[]} | |
| end | |
| def watch(&blk) | |
| b=WatcherBuilder.new self | |
| blk[b] if block_given? | |
| b |
The poem you are looking for has moved here.
Thanks, Arne
| <html> | |
| <head> | |
| <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script> | |
| <script type="text/javascript"> | |
| var count = 7360; | |
| $(document).keypress(function(event) { | |
| //if ( event.which == 13 ) { | |
| // event.preventDefault(); | |
| var url = 'http://www.kleurplaten.nl/kleurplaten/' + count + '.gif'; | |
| $('#tekening').attr('src', url); |
| *WORK IN PROGRESS* | |
| If there is truth to be found I'll find it | |
| Truth is elusive | |
| a trick of the light | |
| you can see it from the corner of my eye | |
| you can reach it in the blackness of the night | |
| you can hear its solemn whisper in the silence |
| #!/usr/bin/awk -f | |
| # Convert the "svn log" output into a one liner format, which is easier to grep | |
| # or use in scripts. Pipe "svn log" into this script | |
| # When we get a line that starts with a revision number, put the data in variables | |
| /^r[0-9]+/ { | |
| rev=$1 | |
| user=$3 | |
| date=$5 |
| rvm use 1.9.3-p125@sprinkle |
| #!/bin/bash | |
| # pg_dump wrapper | |
| # - add 'CREATE DATABASE' to dump | |
| # - compress with bzip2 | |
| # - timestamp | |
| if [[ "$1" == "" ]]; then | |
| echo " Usage: " | |
| echo " $0 <db_name>" |
| # Please fork if you can improve this. (e.g. Windows support) | |
| # | |
| # Ruby 1.9 doesn't contain any SSL root certificates, neither does it read the ones | |
| # installed with your operating system. This results in an error like | |
| # | |
| # SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
| # | |
| # This solution is based on http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/ | |
| # but can be used to monkey patch 3rd party tools, e.g. Github's 'gist' command. | |
| # |
| # Very (very) naive wordt segmentation algorithm for Chinese | |
| # (or any language with similar characteristics, works at the | |
| # character level.) | |
| class Partitioner | |
| attr_reader :ngrams | |
| # +ngrams+ Enumerable list of ngrams | |
| def initialize(ngrams, lookahead = 6) | |
| @lookahead = lookahead | |
| @ngrams = {} |