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
# -*- coding: utf-8 -*- | |
tmp = [ ] | |
open("../data/results/0225_0200/seiyu_graph_all.txt", "r"){|f| | |
tmp = f.read.split("\n") | |
} | |
women_seiyu = [] | |
open("../data/seiyu_namelist_women.txt", "r"){|f| | |
women_seiyu = f.read.split("\n") | |
} |
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
y_benjo@SuperBENZA:~% tree -d -L 1 | |
. | |
├── Desktop | |
├── Documents | |
├── Downloads | |
├── Dropbox | |
├── Library | |
├── Movies | |
├── Music | |
├── Pictures |
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
# simple_bagging.R | |
library(mvpart) | |
bootstrap.data <- function(data, size = nrow(data)){ | |
data[sample(nrow(data), size, replace = TRUE), ] | |
} | |
mode <- function(data){ | |
data.table <- table(data) |
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
# -*- coding: utf-8 -*- | |
# usage: ruby report_zangyou.rb --time 1h20m --day 6/6 | |
require "rubygems" | |
require "tmail" | |
require "tlsmail" | |
require "net/smtp" | |
require "net/pop" | |
require "kconv" | |
require "yaml" | |
require "optparse" |
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
require 'cgi' | |
google_url = "http://chart.apis.google.com/chart?cht=tx&chl=" | |
$<.each{|l| | |
l.chomp! | |
l.scan(/(\[tex:(.*?)\]){1,}/).each do |e| | |
math = e[1] | |
url_math = CGI.escape(math) | |
l.sub!(/#{Regexp.quote(e[0])}/,"<img src=\"#{google_url}#{url_math}\">") | |
end | |
puts l |
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
require "nokogiri" | |
require "open-uri" | |
require "progressbar" | |
def parse_flavor_text(card_url) | |
page = Nokogiri(open(card_url)) | |
card_title = (page/"td.mc"/"b").inner_text | |
fravor_text = (page/"i").inner_text.delete("\n\r\t") | |
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
# .zshrc | |
export LANG=ja_JP.UTF-8 | |
export PATH=/opt/local/bin:/usr/local/bin:/opt/local/sbin:/usr/X11R6/bin:/usr/bin:/bin:/opt:local/sbin:/usr/sbin:/sbin | |
export MANPATH=/opt/local/man:$MANPATH | |
export RUBYLIB=/opt/local/lib/site_ruby/1.8/:/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8 | |
export EDITOR='emacs' | |
export CPATH=$CPATH:$HOME/usr/local/bin/include:$HOME/local/include |
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
;;; デフォ | |
(set-language-environment "Japanese") | |
(set-default-coding-systems 'utf-8) | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(set-buffer-file-coding-system 'utf-8) | |
(set-locale-environment "utf-8") | |
(setenv "LANG" "ja_JP.UTF-8") | |
;;; みみっちい設定 |
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
file = [ ] | |
$<.each do |l| | |
file.push l.chomp | |
end | |
file.shuffle! | |
s = (file.size.to_f / 10).floor | |
open("./train.tsv", "w"){|f| |
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
cat f_1.csv|ruby -e '$<.each{|l|ary = l.chomp.split(",");3.upto(4){|i|ary[i]=0 if ary.include?("未満");if ary[i] != "-";ary[i]=ary[i].gsub(/[^0-9\.]/,"");end;};puts ary.join(",")}' | less |