Bloomfilter in Action

Angelegt von suung Tue, 23 Nov 2010 19:28:00 GMT

>> STOPWORDS_ENGLISH
=> ["a", "about", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "amoungst", "amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom", "but", "by", "call", "can", "cannot", "cant", "co", "computer", "con", "could", "couldnt", "cry", "de", "describe", "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herse”", "him", "himse”", "his", "how", "however", "hundred", "i", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itse”", "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "more", "moreover", "most", "mostly", "move", "much", "must", "my", "myse”", "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thick", "thin", "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves"]
>> STOPWORD_FILTER
=> {:english=>#<BloominSimple:0x7f2b9af413a8 @bitfield=#<BitField:0x7f2b9af41240 @field=[0, 268435456, 0, 67371008, 0, 0, 0, 4, 2281701504, 16779264, 536870912, 0, 4096, 268435456, 0, 0, 0, 0, 32, 16384, 0, 0, 524288, 0, 0, 16384, 8388608, 67108864, 524288, 0, 524304, 1, 1, 0, 0, 2097152, 256, 2, 0, 2147483648, 0, 0, 1073741824, 512, 0, 0, 96, 0, 0, 0, 0, 0, 4194304, 1, 288, 536870912, 2048, 1310720, 0, 4194304, 0, 0, 0, 4456960, 0, 1073741824, 0, 0, 0, 0, 67109376, 65536, 0, 268435456, 256, 32, 4198400, 134217728, 0, 0, 0, 8, 134217728, 8, 0, 0, 33554432, 0, 0, 64, 65600, 0, 0, 4198400, 33554432, 0, 524288, 0, 0, 0, 65537, 4, 0, 134217728, 0, 2048, 0, 524288, 0, 2, 0, 0, 33554496, 0, 4096, 16, 0, 0, 131072, 536870912, 16777728, 0, 0, 1073741824, 0, 0, 0, 128, 0, 8, 0, 256, 0, 0, 0, 0, 16777216, 131072, 524288, 536870912, 0, 8, 65536, 0, 32, 0, 0, 0, 524288, 262144, 0, 536870912, 8388608, 0, 0, 524288, 0, 4, 0, 131072, 0, 0, 0, 4194304, 0, 0, 128, 4096, 16777216, 2, 2048, 0, 256, 8388608, 134217728, 16777216, 268439616, 0, 0, 16777344, 2048, 8388608, 0, 0, 4, 0, 0, 2097152, 0, 12288, 65536, 0, 1048576, 0, 67108864, 134217728, 1065216, 32, 131072, 0, 4096, 0, 524288, 0, 64, 536870912, 4096, 34603008, 0, 0, 0, 0, 0, 2147483648, 64, 512, 0, 0, 0, 0, 0, 536870912, 0, 67108864, 4, 0, 0, 0, 32, 16777216, 0, 0, 1052672, 0, 0, 12288, 16777224, 0, 2048, 4325376, 8388608, 16777216, 0, 1073741824, 536870912, 1, 1073741825, 0, 0, 0, 0, 0, 541065216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 2147516416, 536903680, 2147483648, 0, 0, 0, 0, 0, 0, 134217728, 65536, 0, 32, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 8388608, 0, 0, 0, 2, 0, 0, 4, 0, 536870912, 0, 1073741824, 16, 16777216, 0, 65536, 0, 0, 0, 128, 512, 131074, 8389632, 134217728, 131072, 0, 65540, 0, 34603008, 0, 1048576, 134217728, 2048, 131072, 67108868, 128, 134250504, 0, 1073741825, 1073741824, 0, 1, 16777224, 0, 5184, 0, 0, 0, 0, 67108864, 4096, 16, 262144, 33570816, 4096, 2, 0, 0, 0, 0, 0, 16384, 0, 0, 131072, 0, 0, 0, 268435456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 2, 32768, 0, 0, 0, 0, 2048, 0, 288, 4194304, 2147483648, 524288, 8519712, 0, 2, 32768, 0, 256, 1073741824, 67108864, 0, 2147483648, 34078720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2097152, 0, 8192, 536870912, 32, 0, 0, 0, 0, 4, 32, 0, 0, 0, 2147483648, 20480, 16777216, 0, 2, 262145, 2147483649, 272, 16384, 536870912, 0, 0, 0, 0, 268959744, 4096, 0, 0, 2048, 0, 0, 0, 33554496, 2147483648, 0, 0, 65536, 0, 0, 0, 0, 2149597184, 2048, 0, 2098176, 536870912, 131072, 8388608, 268435464, 2147484672, 8192, 97, 0, 0, 0, 2097152, 0, 0, 0, 2, 0, 0, 0, 134225920, 2097160, 2151678464, 0, 0, 0, 0, 0, 262144, 0, 16512, 0, 589952, 0, 0, 67108864, 262144, 8388608, 8192, 335544320, 0, 8192, 16, 33554432, 524288, 0, 2147483648, 1073741824, 0, 16384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1048576, 0, 17301504, 0, 0, 0, 0, 0, 134217728, 0, 0, 0, 4096, 268435456, 536871424, 0, 0, 0, 0, 2147483648, 16842752, 1073741952, 0, 0, 134217728, 0, 17, 32768, 268435456, 256, 0, 18, 8, 0, 0, 0, 0, 64, 0, 524288, 8192, 0, 0, 4096, 0, 2097152, 0, 516, 0, 1073741824, 1032, 0, 0, 0, 0, 0, 16777216, 131332, 0, 0, 0, 2048, 553648128, 327680, 536870912, 0, 0, 0, 278528, 134217728, 64, 0, 0, 1048576, 0, 0, 0, 0, 0, 0, 524416, 0, 0, 64, 134217728, 0, 32768, 2304, 0, 0, 0, 65568, 0, 0, 0, 0, 67108864, 16, 0, 0, 0, 0, 8192, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8192, 64, 65536, 0, 0, 0, 1075838976, 128, 134217728, 0, 0, 0, 65536, 65536, 0, 256, 0, 1, 0, 0, 33554432, 0, 1073741824, 0, 0, 65, 8388608, 16777216, 1048576, 0, 16384, 0, 0, 16, 67108864, 134217729, 34816, 0, 25166336, 0, 1073741825, 0, 0, 16, 0, 0, 256, 0, 2048, 0, 16777216, 0, 0, 134217728, 0, 0, 0, 0, 0, 2359296, 134234112, 0, 0, 0, 131072, 8, 32, 8388608, 512, 131072, 16777216, 0, 2049, 2097152, 32768, 0, 67108864, 0, 2048, 536870920, 536870912, 0, 0, 8388608, 0, 8650752, 0, 8, 67108864, 2097152, 1024, 2, 526336, 1, 0, 0, 0, 0, 268435456, 0, 0, 1, 524288, 71303168, 8650752, 0, 0, 32, 0, 0, 0, 0, 16384, 268435456, 0, 0, 1, 0, 0, 0, 0, 524288, 67108896, 536870912, 8208, 0, 0, 32768, 0, 0, 4, 537133056, 1610612736, 2048, 131072, 0, 0, 0, 268435584, 32, 0, 4194304, 16777216, 0, 2, 1024, 81920, 32768, 10240, 0, 0, 0, 1, 2048, 0, 0, 8, 528, 33554432, 0, 0, 0, 0, 2147483776, 2147487776, 4, 64, 0, 0, 65568, 0, 32768, 0, 805306368, 0, 0, 536907776, 0, 0, 33554432, 16777216, 0, 524288, 0, 4098, 0, 0, 0, 133120, 0, 0, 0, 0, 0, 1, 0, 262144, 2684354560, 0, 8519680, 0, 67108864, 134217732, 131072, 0, 512, 8388608, 0, 134217728, 0, 65664, 134217728, 0, 16777216, 134217730, 2097152, 0, 0, 0, 0, 0, 33554432, 67108865, 1, 0, 0, 0, 0, 0, 64, 0, 262146, 67108864, 4194304, 0, 0, 32, 33554432, 0, 0, 4, 512, 0, 71303168, 2097152, 0, 0, 65536, 0, 0, 2147483648, 0, 0, 1048576, 0, 2048, 0, 0, 2214592512, 262144, 0, 0, 4, 16777280, 0, 0, 0, 8192, 0, 0, 8388608, 4, 2147483648, 2048, 0, 16777218, 0, 16, 0, 0, 0, 0, 0, 4194304, 128, 0, 1073741824, 8192, 268435456, 0, 0, 637534208, 0, 2097152, 0, 4194304, 32, 0, 0, 2, 0, 0, 128, 2048, 0, 0, 131072, 262144, 3221241856, 2097152, 0, 0, 0, 4, 67108864, 8704, 16, 0, 0, 0, 0, 0, 0, 4194304, 0, 3221225472, 0, 8388608, 1073741824, 0, 16777216, 4104, 0, 0, 8192, 536870912, 0, 536870912, 524288, 0, 134217728, 0, 1024, 0, 0, 0, 0, 131072, 16384, 0, 256, 0, 0, 0, 134217728, 0, 0, 16, 0, 0, 536870912, 4096, 67108864, 0, 128, 0, 524800, 0, 32, 8421376, 1073741824, 2147549184, 0, 0, 64, 4, 8388608, 0, 1074003968, 0, 0, 0, 0, 0, 2048, 8388608, 0, 0, 0, 0, 576, 1, 0, 4096, 0, 0, 0, 0, 0, 65664, 3145728, 0, 1024, 0, 0, 0, 0, 1, 0, 17825792, 0, 0, 0, 268435456, 4096, 8388608, 0, 0, 1048576, 0, 0, 0, 0, 524288, 4194304, 0, 0, 2147483648, 32768, 128, 4352, 256, 0, 0, 0, 16, 17825792, 67108864, 8, 65536, 0, 536870912, 512, 0, 0, 0, 134217728, 0, 8192, 0, 0, 64, 256, 16777216, 65536, 0, 2097152, 8388610, 0, 0, 16785408, 0, 262144, 33554432, 8388608, 1073741824, 8388608, 2048, 0, 8192, 262144, 0, 0, 33554432, 67108864, 0, 0, 0, 4, 256, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 33554432, 256, 4194304, 0, 256, 0, 0, 1572865, 2, 0, 32, 0, 128, 0, 0, 0, 134217728, 96, 33556480, 0, 0, 268697600, 262144, 8448, 0, 0, 0, 67108864, 0, 0, 536870912, 0, 0, 256, 64, 2147483648, 536870912, 2050, 0, 134217762, 16777216, 0, 0, 65536, 1090519040, 0, 0, 0, 167772172, 64, 0, 0, 0, 0, 0, 0, 16777216, 0, 16777216, 2097152, 0, 0, 2048, 34816, 16777216, 1048576, 8, 0, 536879104, 0, 1024, 16, 0, 0, 0, 0, 2097152, 0, 0, 0, 0, 0, 0, 16448, 2147483776, 0, 64, 0, 0, 16, 0, 32, 513, 262144, 0, 536887296, 0, 49152, 0, 2097152, 4096, 67108864, 1024, 131072, 16384, 0, 0, 0, 0, 16777232, 16777216, 0, 0, 0, 0, 0, 4104, 0, 0, 0, 0, 0, 0, 524288, 4096, 268468226, 32, 33554432, 0, 8388608, 134217728, 0, 0, 134217728, 16388, 0, 2147516416, 134217728, 0, 0, 0, 16809984, 0, 0, 0, 0, 256, 8, 1, 0, 0, 0, 0, 0, 8, 32768, 1109393408, 2048, 0, 0, 0, 33554432, 0, 4194304, 0, 16, 0, 0, 16777216, 294912, 0, 0, 0, 0, 140640256, 4096, 1048576, 0, 8, 131072, 0, 0, 536936448, 0, 0, 0, 0, 1024, 0, 0, 0, 65536, 0, 2147483648, 0, 33554432, 1073741824, 8396800, 0, 0, 1073741824, 0, 0, 0, 2048, 0, 4096, 0, 65600, 65536, 67108864, 512, 2097152, 0, 0, 1073741824, 128, 2097152, 0, 2147483648, 0, 0, 0, 33554432, 67108864, 64, 0, 0, 8, 2, 0, 0, 131072, 0, 268468352, 4, 2048, 0, 0, 0, 8388608, 0, 0, 4194304, 0, 0, 8192, 0, 0, 16, 0, 0, 1, 0, 0, 0, 64, 4, 0, 0, 0, 0, 0, 134217728, 0, 0, 0, 0, 67108880, 0, 0, 0, 8192, 0, 1073741824, 0, 1056, 1048576, 66, 8388608, 1024, 8192, 1024, 0, 136314880, 0, 67109888, 0, 0, 0, 32768, 8200, 0, 0, 0, 8, 33554432, 0, 0, 256, 16785408, 0, 1, 536870912, 1073741826, 0, 2097152, 0, 2097152, 65536, 33554432, 16, 134217728, 2097152, 0, 268435456, 0, 0, 0, 2228224, 8388640, 33554432, 1073741824, 0, 1048576, 0, 64, 1077936640, 16, 4194304, 16777216, 32768, 0, 0, 8388608, 0, 0, 536870912, 0, 0, 0, 16384, 4, 0, 131072, 524288, 256, 1048576, 0, 16384, 0, 268435457, 524288, 0, 0, 134217729, 0, 4194304, 4096, 16512, 0, 0, 524288, 0, 1048576, 0, 0, 0, 2051, 0, 4096, 0, 9, 0, 0, 2097152, 1879048200, 130, 8192, 1056768, 0, 0, 17825792, 0, 0, 262272, 16, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 1048576, 268500992, 0, 0, 0, 33686528, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 37748736, 268435456, 67109888, 256, 4194304, 16, 0, 2147483648, 0, 0, 0, 0, 0], @size=50000>, @size=50000, @hasher=#<Proc:0x00007f2b9af41ce0@./vendor/plugins/redmine_seo/lib/seo/constants.rb:8>>, :german=>#<BloominSimple:0x7f2b9af40fe8 @bitfield=#<BitField:0x7f2b9af40bd8 @field=[0, 8, 16809984, 1048832, 2097152, 2151677963, 0, 4, 1342177280, 0, 6224, 518, 512, 33554432, 272, 8192, 134217728, 128, 3238002704, 0, 269484032, 0, 16777220, 537133056, 2684977152, 0, 0, 1024, 301990656, 16777216, 536870912, 131072, 0, 4202512, 0, 12288, 0, 2560, 67110912, 1048832, 2172780546, 8388866, 33685504, 671088640, 4224, 67108864, 1024, 537397248, 12, 1064961, 4, 2286059522, 1032, 0, 16908288, 301989888, 134217744, 1107820576, 33554432, 335544320, 8392720, 0, 1024, 1078198272, 2361378, 536871168, 8256, 0, 268697600, 16, 4194304, 2151677968, 2099200, 2147483664, 2348810240, 272629776, 67111936, 65538, 260, 134217728, 0, 270336, 1073750016, 34637824, 536870914, 3892314760, 4609, 256, 133248, 0, 134217744, 640, 68165632, 8396816, 2147522624, 131072, 268439681, 1081348, 545259552, 0, 545275905, 4456449, 538968064, 32768, 34834, 1024, 134217736, 2, 16781312, 79691776, 536871680, 0, 67108930, 16777216, 67108928, 139264, 8589313, 1024, 0, 0, 35651586, 9437184, 525312, 0, 64, 2147483648, 16777216, 196624, 2281702400, 25165824, 8523778, 67108868, 2181038080, 2162688, 570425344, 268435488, 542114048, 0, 2048, 537690120, 0, 8, 24, 4, 33570825, 524288, 4194304, 64, 4, 16777250, 310378528, 1073741824, 134218273, 1088, 32768, 131072, 0, 536870928, 589824, 34603008, 4096, 0, 1048576, 4218880, 537133056, 0, 0, 8389376, 612368512, 67387394, 0, 537396224, 16384, 1048608, 0, 17301504, 0, 4194816, 134217728, 1078001664, 33558530, 16843776, 64, 3072, 0, 4128, 262168, 65664, 262144, 268435968, 4096, 2281750528, 2, 2560, 553648640, 2097152, 196641, 0, 262152, 133121, 0, 0, 33556480, 0, 2049, 536870912, 512, 8388610, 524288, 204800, 1024, 131072, 131200, 1073745920, 67108864, 4194560, 1073872904, 33589250, 67141632, 1081872, 1073747972, 603980032, 8195, 268435460, 1073875972, 58720256, 32896, 134217732, 148, 67108880, 0, 32768, 393216, 2, 151011328, 2105344, 0, 262146, 256, 1075847192, 276840452, 524289, 4194560, 24584, 1074267136, 4096, 256, 1074003972, 262400, 1040, 33554432, 0, 34078724, 0, 2080, 2048, 8192, 128, 0, 69238784, 2155874304, 2, 69634, 147456, 0, 268435456, 0, 32772, 671121408, 1024, 65796, 0, 545554433, 516, 553648128, 402924547, 1073742336, 32769, 136314880, 196864, 1074268164, 67584, 547637248, 1064960, 8652928, 538973184, 16, 1048580, 139264, 545259520, 0, 128, 536870912, 1024, 134217728, 2147483648, 4325376, 0, 320, 1073741824, 1073741840, 1174405120, 2, 512, 2052, 0, 0, 138412032, 536875008, 0, 272631296, 264224, 402653220, 64, 2097152, 0, 38076416, 277873664, 4231184, 10240, 33554434, 40960, 1073741824, 16384, 134348800, 0, 0, 1056768, 2359312, 73733, 8388608, 1040, 2097152, 33554560, 2560, 0, 134283776, 2099200, 1296, 335544320, 0, 35008, 2097936, 0, 80, 1, 33562624, 0, 320, 2147484032, 201326596, 1048576, 16777250, 50336768, 135168, 3221225472, 0, 65536, 0, 4, 0, 2064, 134217728, 64, 2097152, 2147483680, 21, 64, 0, 16384, 33555968, 167772160, 536938512, 1064960, 17563649, 536870912, 64, 1073742848, 1280, 48, 0, 0, 671088640, 135274496, 4194816, 33570816, 2, 1024, 1073872896, 8192, 0, 32, 6, 2, 268435456, 2, 67633160, 147592, 33554432, 2692743168, 8390656, 262465, 2114048, 2181038080, 536871200, 524288, 603981824, 1581058, 1074790400, 0, 2415919104, 2099200, 65536, 0, 147456, 570425344, 167772166, 268566530, 524288, 262144, 0, 256, 262144, 131072, 131088, 0, 0, 0, 2130176, 0, 33604192, 536870944, 131080, 299008, 8208, 538968576, 539000832, 0, 0, 8, 4726800, 131072, 32, 1, 18432, 536903728, 67108868, 536870912, 0, 0, 2048, 536870912, 294912, 0, 67108864, 295108, 134219776, 68419842, 2098176, 98304, 134217984, 2164293632, 4343809, 18874384, 262144, 2148534272, 1086586880, 524288, 134217728, 276825088, 2245634, 16384, 0, 262146, 201, 4194305, 8388608, 65536, 8396800, 8388608, 2166784, 1610612736, 2684354560, 67127298, 1343225857, 1024, 2097153, 262144, 268452864, 16416, 8389120, 12288, 536870976, 805442560, 268468224, 516, 262152, 541065472, 0, 1024, 0, 134217728, 0, 1077936128, 33619968, 4096, 4202496, 0, 134217728, 131074, 0, 208, 65536, 0, 8749056, 67108864, 2164260864, 8388865, 0, 268959744, 20, 1073807360, 12288, 2, 2048, 131072, 8256, 536870913, 142606337, 16384, 268437520, 132, 268435456, 1073774593, 640, 0, 75501602, 544772, 24, 67637248, 8, 2147491840, 32, 0, 0, 0, 0, 1024, 33554432, 131072, 4194304, 1073938496, 0, 96, 0, 2129920, 32768, 17336320, 2149580800, 1048576, 14336, 2415919106, 4196384, 8404992, 34603008, 131200, 538968064, 134217736, 2048, 1115136, 2147483648, 1048848, 17024, 67125250, 0, 134217728, 512, 4195328, 1350565892, 1073741824, 1073743874, 4194304, 0, 2080, 1090527264, 2097152, 0, 16777216, 131072, 1082131456, 262144, 135266304, 16777272, 1034, 8512, 536870912, 16777228, 1073877000, 537461888, 2, 537137152, 0, 1, 0, 2147516432, 4, 32768, 4, 2048, 16777218, 262145, 1, 262148, 4194304, 134225920, 2147483648, 2147485824, 69271580, 4112, 42508288, 593920, 16777216, 4196352, 33554432, 0, 16400, 134217728, 2099217, 768, 257, 201327616, 278528, 8454474, 402653184, 134217728, 512, 8388608, 134217728, 589824, 0, 131104, 0, 2114048, 2147483650, 65544, 16794112, 8389632, 524800, 512, 0, 0, 0, 2147483648, 1074266116, 2147549185, 1073808384, 67109888, 0, 1024, 69206016, 0, 16777474, 2147614720, 536871424, 1074790402, 32768, 32770, 8388608, 33554432, 266240, 6144, 2147614720, 8404992, 134217729, 1048576, 268435456, 1142161536, 18939904, 134760448, 16793728, 262144, 16777744, 1, 2097152, 32768, 65536, 16810048, 524288, 33554436, 66048, 0, 8388608, 8388608, 16390, 2148532224, 4, 0, 8519682, 0, 3, 20971520, 268435456, 1342185476, 1207959552, 24577, 16809984, 0, 33554432, 2048, 671088672, 8388608, 1048585, 0, 65536, 1118208, 0, 40960, 72351746, 131072, 34611296, 3149824, 65536, 8, 0, 16777504, 134219776, 147456, 134217730, 1610620992, 3221225496, 536879136, 16384, 268435712, 536937216, 2147483648, 2181038336, 32768, 520, 557056, 0, 18874500, 8192, 557056, 8388608, 268697600, 2147484802, 67174400, 262208, 262144, 1280, 0, 1064960, 2129921, 10240, 4325377, 263173, 1090519168, 131072, 2113536, 4194816, 67108864, 33554432, 3221229632, 1056781, 0, 67109440, 4202496, 8192, 524288, 0, 536870912, 2147745796, 0, 3221299200, 16777280, 8650760, 1114948, 16384, 150994944, 268435456, 1024, 536887297, 0, 67108928, 257, 67108865, 33555460, 176, 1048704, 131072, 285278208, 512, 49280, 2359296, 65536, 8192, 67125281, 262148, 1082130436, 2147549248, 532, 0, 67239984, 134235392, 8396800, 1216348160, 0, 0, 16384, 0, 67584, 524288, 0, 48, 0, 0, 536870928, 0, 0, 4104, 33554504, 131072, 2048, 1073741856, 0, 2097152, 0, 16386, 134217728, 134217856, 536870912, 5243136, 0, 0, 67371040, 135266304, 0, 0, 1073741824, 0, 67108864, 3229614084, 8388610, 0, 3221225472, 570425346, 6291456, 64, 131072, 131072, 33554436, 16785408, 50331648, 67183616, 524800, 32, 8388672, 2147487744, 4096, 2048, 268437504, 0, 262144, 64, 524288, 2147492866, 536870976, 134217728, 67108865, 0, 8519688, 805308416, 0, 67108872, 516, 289539328, 1024, 419430400, 2261028, 32769, 0, 1, 16384, 67110912, 16384, 1056768, 131074, 2147500032, 134217728, 2151677952, 131072, 33, 1073741824, 1114244, 2147502337, 67379456, 0, 2147483648, 1, 2097152, 134217728, 0, 1056768, 0, 32768, 131328, 4325696, 34603008, 2101760, 8192, 46137344, 2147549696, 0, 4, 33556552, 4194688, 262144, 33555712, 1073755200, 2099328, 2048, 8200, 4194304, 67108865, 1074004008, 0, 1310724, 8194, 33587204, 32840, 0, 0, 67764224, 1056768, 0, 2147745792, 270664192, 536870944, 0, 68683776, 16, 32784, 2, 0, 4198400, 536870912, 34742272, 286913, 268699648, 69337088, 553649152, 147460, 67108864, 64, 16386, 1610613760, 2214592512, 8, 1073741888, 805341200, 512, 33562624, 268438016, 138412096, 67108864, 12288, 100663296, 268435456, 33554432, 128, 0, 1073741828, 2048, 0, 130, 8454176, 33554560, 0, 34668544, 8, 1073750016, 393216, 2717941776, 4, 8912896, 536904704, 8, 34603008, 32768, 0, 4, 100728880, 16, 536870912, 4259840, 4, 17301520, 0, 134775040, 524300, 16384, 0, 2490400, 4200448, 2147483680, 1048581, 524288, 2147483686, 4096, 268435456, 516, 64, 2147483648, 4100, 2718040064, 2684354560, 2048, 64, 269484160, 8388865, 1090523136, 268697856, 41943056, 70254592, 0, 67633152, 2147500032, 5242882, 16, 8421376, 2048, 8519680, 8685568, 545259520, 10, 4210704, 2185527296, 33619968, 4194304, 16384, 1, 2147483968, 16809988, 262148, 50331648, 20608, 8388608, 8, 802816, 2214592512, 8192, 0, 0, 512, 262144, 164, 83886592, 8, 2147614728, 16908288, 0, 33024, 20, 393216, 536870912, 131601, 1074022401, 98368, 2560, 3332, 2228224, 3073, 134217728, 0, 134877184, 131328, 1048584, 4194568, 0, 4196356, 270848, 0, 65536, 144, 2098176, 2147483648, 134217730, 67108928, 268730401, 2097160, 25165824, 42079240, 1067074, 262216, 1050240, 0, 2049, 1073742080, 2260992, 512, 0, 268435456, 524288, 270532608, 1, 32, 0, 65536, 9216, 65536, 33554432, 65536, 1056768, 67110912, 0, 32768, 163840, 1073741824, 1090568192, 17862656, 16448, 545, 512, 2097152, 0, 134217860, 8912898, 65536, 0, 2148007936, 2149851136, 2147484864, 608174080, 622880, 16384, 41947136, 1073742112, 142606336, 0, 2, 17039368, 8388612, 2097152, 65536, 2147745800, 0, 16777216, 2147483648, 0, 536870912, 4201472, 1052672, 0, 1024, 16, 0, 0, 65568, 167772160, 167772160, 0, 67117062, 524800, 3363831808, 4096, 262148, 18696, 0, 786432, 557568, 142869512, 83886336, 32770, 1073758216, 16384, 0, 536870913, 5120, 268440320, 536870913, 2105378, 2147747840, 8192, 4112, 134742016, 128, 8388612, 2415919112, 0, 2688549120, 33570818, 4194320, 33554432, 3221229572, 4, 4, 51203, 0, 4096, 1073741826, 1057856, 4800, 2, 4194304, 205521424, 1107296256, 67109128, 16913, 0, 8, 134217985, 32800, 0, 2684354560, 537919488, 2149744896, 1073741826, 0, 133144, 2108420, 2, 33554448, 8, 1073741824, 3222274048, 268697602, 6, 2147615760, 0, 32768, 67108866, 1082139136, 0, 2150106112, 0, 1048576, 2147483648, 83887616, 1114112, 2151678480, 0, 1073758280, 8, 268435456, 2304, 1, 1082408968, 134217730, 134217728, 72, 67174912, 2, 136314880, 4096, 336199680, 1040, 0, 12587024, 2, 0, 8388624, 36928, 270532608, 2148008016, 0, 67109120, 64, 2147762312, 65600, 130, 167903240, 80, 16384, 2097412, 0, 33284, 2, 1073743872, 131072, 16908288, 1073741888, 67108864, 172032004, 565248, 1048576, 4096, 16777216, 0, 0, 270532672, 2048, 1052672, 422641664, 3222405120, 1082146848, 8, 42074112, 813694980, 2129924, 262304, 1589248, 776, 50331648, 16384, 1107296256, 33558528, 4227088, 604014848, 49408, 16385, 0, 1342185984, 33555460, 100663296, 140509184, 4096, 4194305, 1024, 2228224, 2623496, 262144, 537919560, 0, 1048642, 0, 67633152, 2105376, 256, 536875136, 0, 268437504, 0, 16512, 33554448, 402653184, 8388608, 5, 2155905024, 1075838979, 64, 1024, 1024, 18, 0, 268435456, 65568, 268435456, 37748736, 0, 1073742080, 8, 33554432, 2147483648, 268438528, 4194824, 2097152, 33818112, 2097152, 0, 32896, 0, 2147483656, 1207959552, 4195328, 4195328, 67239944, 805314560, 2157969700, 536870912, 131072, 536889344, 268599296, 524288, 67108928, 138412032, 2560, 0, 1048576, 1024, 16785424, 2359360, 0, 1, 4194304, 2147796992, 67108864, 3145792, 8, 16400, 402726912, 65536, 8389120, 2147483648, 1052672, 0, 2147483648, 25165924, 67108864, 2147750016, 2147549184, 129, 16384, 2097152, 1, 0, 256, 1, 1048580, 1342177280, 2, 1074266120, 2147483648, 1310720, 16777216, 4194304, 4096, 16384, 8, 80, 0, 0, 2097152, 0, 262144, 0, 0, 1183874, 2147483648, 16812032, 33554432, 1056768, 46399488, 64, 131072, 16842752, 807403520, 2097152, 0, 2112, 3072, 2432, 0, 134234112, 2162688, 1108870144, 0, 1024, 2099200, 2155876433, 4096, 8929280, 32768, 8, 8704, 1, 67109120, 0, 0, 524320, 16777216, 4194816, 41945088, 67108864, 8388608, 257, 1140851712, 4225, 45088896, 0, 1073741824, 55574561, 2147614720, 512, 8404992, 65794, 0, 3489660928, 0, 524304, 524288, 1073743872, 536871936, 12288, 34604032, 74752, 16384, 536871056, 276824064, 272629762, 1083396, 0, 524808, 0, 134217736, 536870912, 33554432, 2147483652, 1073741824, 3490185216, 2149580800, 0, 67113216, 1073741824, 32768, 67109040, 1610629121, 14680075, 3229620224, 18432, 1073741824, 128, 0, 8704, 134217729, 16777248, 402653184, 17, 2622464, 1073750016, 2147500032, 268436480, 8388896, 1056768, 8519680, 1056768, 67158272, 1056768, 512, 197120, 4325376, 2048, 262144, 134351360, 16384, 131073, 8388608, 327680, 16777221, 1050624, 262145, 2113, 16384, 64, 0, 786432, 16392, 16384, 81920, 536870912, 0, 35651584, 0, 268436480, 0, 0, 67109892, 1048576, 2214666240, 128, 262208, 0, 2149580802, 0], @size=50000>, @size=50000, @hasher=#<Proc:0x00007f2b9af41ce0@./vendor/plugins/redmine_seo/lib/seo/constants.rb:8>>}

Algorithm Package for Ruby

Angelegt von suung Tue, 23 Nov 2010 17:01:00 GMT

Unlike Java or C++ Ruby has come without a large library of namespaced argorithms.

I found this from Google Summer of Code.

It's here to remind me, reading the code.

Collaborative Map Reduze with Javascript (this is more interesting than it might sound)

Angelegt von suung Tue, 23 Nov 2010 16:51:00 GMT

This a like one year old article about Using Javascript to share computing time amongst nodes (that is computers on the web).

Well, it's even coming with code.I
I think, we all wait for the time, where it's realistic to use one users's power without additional installation and security holes for his data privacy.

Javascript inside the browser could be exactly that.


Yeah, here is the code

 

<html>
  <head>
    <script type="text/javascript">
 
      function map() {
        /* count the number of words in the body of document */
        var words = document.body.innerHTML.split(/\\n|\\s/).length;
        emit('reduce', {'count': words});
      }
 
      function reduce() {
        /* sum up all the word counts */
        var sum = 0;
        var docs = document.body.innerHTML.split(/\\n/);
        for each (num in docs) { sum+= parseInt(num) > 0 ? parseInt(num) : 0 }
        emit('finalize', {'sum': sum});
      }
 
      function emit(phase, data) { ... }
    </script>
  </head>
 
  <body onload="map();">
    ... DATA ...
  </body>
</html>
 

require "rubygems"
require "sinatra"
 
configure do
  set :map_jobs, Dir.glob("data/*.txt")
  set :reduce_jobs, []
  set :result, nil
end
 
get "/" do
  redirect "/map/#{options.map_jobs.pop}" unless options.map_jobs.empty?
  redirect "/reduce"                      unless options.reduce_jobs.empty?
  redirect "/done"
end
 
get "/map/*"  do erb :map,    :file => params[:splat].first; end
get "/reduce" do erb :reduce, :data => options.reduce_jobs;  end
get "/done"   do erb :done,   :answer => options.result;     end
 
post "/emit/:phase" do
  case params[:phase]
  when "reduce" then
    options.reduce_jobs.push params['count']
    redirect "/"
 


  when "finalize" then
    options.result = params['sum']
    redirect "/done"
  end
end

 

 

 

Nice introduction in how search algorithms work

Angelegt von suung Tue, 23 Nov 2010 15:44:00 GMT

I found on the wikipedia page of  the Rabin Karp String Search Algorithm a nice introduction in searching in general.

 

1 function NaiveSearch(string s[1..n], string sub[1..m])
2    for i from 1 to n-m+1
3       for j from 1 to m
4          if s[i+j-1] ≠ sub[j]
5             jump to next iteration of outer loop
6       return i
7    return not found

This algorithm works well in many practical cases, but can exhibit relatively long running times on certain examples, such as searching for a string of 10,000 "a"s followed by a "b" in a string of 10 million "a"s, in which case it exhibits its worst-case Θ(mn) time.

The Knuth–Morris–Pratt algorithm reduces this to Θ(n) time using precomputation to examine each text character only once; the Boyer–Moore algorithm skips forward not by 1 character, but by as many as possible for the search to succeed, effectively decreasing the number of times we iterate through the outer loop, so that the number of characters examined can be as small as n/m in the best case. The Rabin–Karp algorithm focuses instead on speeding up lines 3-6.


        
      
    
  

Faster counting in ruby 2

Angelegt von andi Sun, 03 Oct 2010 15:40:00 GMT

Assuming you want to do something 100.000 times.

The usual way is, to run a loop and use an counter

i =0 while i < 100000 do #DO something i = i+1 # in some languages you have i++ instead end

this sets i to it’s former value plus one after every loop.

I did a benchmark between Integer#+1 and Integer#next

Integer next is the favourite, because it knows, that it needs to count plus one already.

Here is the result:

jrw@sublime:~$ ruby integer_next_against_plus_1.rb 
using i.next 100 times
1
101
  0.000000   0.000000   0.000000 (  0.000115)
using i+1 100 times
1
101
  0.000000   0.000000   0.000000 (  0.000108)
using i.next 1000 times
101
1101
  0.000000   0.000000   0.000000 (  0.000881)
using i+1 1000 times
101
1101
  0.000000   0.000000   0.000000 (  0.001130)
using i.next 10000 times
1101
11101
  0.020000   0.000000   0.020000 (  0.011330)
using i+1 10000 times
1101
11101
  0.000000   0.000000   0.000000 (  0.011211)
using i.next 100000 times
11101
111101
  0.080000   0.020000   0.100000 (  0.118224)
using i+1 100000 times
11101
111101
  0.080000   0.010000   0.090000 (  0.110932)
using i.next 1000000 times
111101
1111101
  0.690000   0.230000   0.920000 (  0.998541)
using i+1 1000000 times
111101
1111101
  0.800000   0.180000   0.980000 (  1.051063)
using i.next 10000000 times
1111101
11111101
  7.000000   2.060000   9.060000 (  9.769309)
using i+1 10000000 times
1111101
11111101
  7.630000   2.110000   9.740000 ( 10.480469)
using i.next 100000000 times
11111101
111111101
 68.130000  19.560000  87.690000 ( 89.887507)
using i+1 100000000 times
11111101
111111101
 76.420000  19.240000  95.660000 ( 98.498498)
using i.next 1000000000 times
111111101

and here the code

require 'benchmark'


i1 = 1
i2 = 1
r1 = ""
r2 = ""

time = 100

while time < 100000000000000

puts "using i.next #{time} times"
puts i1
 r1 = Benchmark.measure do
  time.times do
    i1 = i1.next
  end
end
puts i1
puts r1

puts "using i+1 #{time} times"
puts i2
  r2 = Benchmark.measure do

time.times do

    i2 = i2+1
  end
end
puts i2
puts r2

time = time * 10
end

So, if you want to count, it’s alsmost 10% faster, to use builtin Integer.next