This file contains hidden or 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
mecab --node-format="%m/%h/%f[7] " --unk-format="%M" --eos-format="\n" --eon-format=' ' | sed -e 's/ $//' |
This file contains hidden or 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
SB棟の低層区の市民はエレベータの下のボタンを押しつつも、エレベータが高層区の乗降でしばらく下に来ないと分かるやいなや、階段で一階まで降りる。その結果高層区からエレベータで降りてくる市民は、乗客いない階で足止めを食らう。高層区の市民は自分より下の階にエレベータは不要であると思っているし、また、全ての市民は自分より上の階は崩れればいいと思っている。このような憎しみ合いの結果、だるま落としの上手い巨人でも現れない限り、SB棟は最上階から順に徐々に崩れ、いずれはSB棟を平屋建てにするだろう。 |
This file contains hidden or 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
require(lars) | |
y <- iris[,1] | |
x <- iris[,2:4] | |
x <- as.matrix(x) | |
result <- lars(x=x, y=y, type="lasso") | |
coefs <- predict.lars(result, x, type='coefficients') | |
print(coefs) |
This file contains hidden or 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
[~/work/now/mlr/third_party/dtm_release/dtm]$ gdb main haro@harombp 2013/09/27 10:19:13 | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ..... done | |
(gdb) run |
This file contains hidden or 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
% スライドパズルの移動のルール | |
move_one([0,B,C,D,E,F,G,H,I], [B,0,C,D,E,F,G,H,I]). | |
move_one([A,0,C,D,E,F,G,H,I], [0,A,C,D,E,F,G,H,I]). | |
move_one([0,B,C,D,E,F,G,H,I], [D,B,C,0,E,F,G,H,I]). | |
move_one([A,B,C,0,E,F,G,H,I], [0,B,C,A,E,F,G,H,I]). | |
move_one([A,0,C,D,E,F,G,H,I], [A,C,0,D,E,F,G,H,I]). | |
move_one([A,B,0,D,E,F,G,H,I], [A,0,B,D,E,F,G,H,I]). | |
move_one([A,0,C,D,E,F,G,H,I], [A,E,C,D,0,F,G,H,I]). | |
move_one([A,B,C,D,0,F,G,H,I], [A,0,C,D,B,F,G,H,I]). |
This file contains hidden or 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 Math | |
require 'pp' | |
X = 10 | |
T = 4 | |
PI = 3.14 | |
dt = 1 | |
dx = 1 |
This file contains hidden or 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
% komachi | |
digit(X) :- member(X, [0,1,2,3,4,5,6,7,8,9]). | |
is_composed_of(N, X, Y) :- | |
digit(X), | |
digit(Y), | |
(Z is X+Y; | |
Z is X-Y; | |
Z is Y-X; |
This file contains hidden or 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
l = gets | |
num_list = l.split(/\s/) | |
n = Math.sqrt(num_list.size).to_i | |
print '{' | |
n.times { | |
print '{' | |
(n-1).times { | |
print "%s, " % num_list.shift | |
} |
This file contains hidden or 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
l = gets | |
l.chomp! | |
while /^(.+)\1+/ =~ l | |
l = $1 | |
end | |
puts l |
This file contains hidden or 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
# generate a file (1000 lines) | |
def make_1000lines | |
f = open("hoge", 'w') | |
1000.times do |i| | |
f.puts i.to_s * 100 | |
end | |
end | |
make_1000lines() | |
puts `wc -l hoge` # 989 is printed in my environment. |
NewerOlder