This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count = 0 | |
if target_user_ids.empty? | |
count += Foo.all.count | |
else | |
target_user_ids.each do |user_ids| | |
count += Foo.where(user_id: user_ids).count | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/lib/kytea.cpp b/src/lib/kytea.cpp | |
index 8dbae30..04324c3 100644 | |
--- a/src/lib/kytea.cpp | |
+++ b/src/lib/kytea.cpp | |
@@ -74,6 +74,11 @@ void Kytea::addTag(typename Dictionary<Entry>::WordMap& allWords, const KyteaStr | |
Entry::setInDict(it->second->inDict,dict); | |
} | |
} | |
+ | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dict = Dict() | |
@time for i in [1:10000000] | |
dict[i] = 1 | |
end | |
# elapsed time: 22.824151615 seconds (2413509808 bytes allocated, 9.20% gc time) | |
dict = Dict() | |
@time for i in [1:10000] | |
dict[i] = 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Julia using -O wakati | |
using Benchmark | |
using MeCab | |
function count_word(text::UTF8String) | |
mecab = Mecab("-O wakati") | |
counts = Dict{UTF8String, Int}() | |
for word in split(sparse_tostr(mecab, text)) | |
counts[word] = get(counts, word, 0) + 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> Pkg.update() | |
INFO: Updating METADATA... | |
...snip... | |
INFO: Building Homebrew | |
remote: Counting objects: 818, done. | |
remote: Compressing objects: 100% (232/232), done. | |
remote: Total 818 (delta 644), reused 759 (delta 585) | |
Receiving objects: 100% (818/818), 92.06 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (644/644), completed with 144 local objects. | |
From https://github.com/Homebrew/homebrew |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compile g++ -Wall re2test.cpp -o re2.out -lre2 -lpthread | |
#include <iostream> | |
#include <string> | |
#include <re2/re2.h> | |
#include <cassert> | |
using namespace std; | |
int main(int argc, char **argv){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <re2/re2.h> | |
#include <vector> | |
using namespace std; | |
int main(){ | |
string str("あぶらかたぶら"); |
OlderNewer