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 -*- | |
require 'natto' | |
require 'msgpack' | |
require 'mongo' | |
texts = ['shirobako★が3巻が見たい', '大久保瑠美さんに会いたい'] | |
trans_freq = Hash.new{|h, k| h[k] = Hash.new{0.0}} | |
texts.each do |txt| |
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
module.exports = (robot) -> | |
robot.hear /mecab (.*)/i, (msg) -> | |
text = msg.match[1] | |
MeCab = new require 'mecab-async' | |
mecab = new MeCab() | |
ret = mecab.parseSync(text) | |
msg.send text |
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
// Generated by CoffeeScript 1.9.2 | |
(function() { | |
module.exports = function(robot) { | |
return robot.hear(/mecab (.*)/i, function(msg) { | |
var MeCab, mecab, ret, text; | |
text = msg.match[1]; | |
MeCab = new require('mecab-async'); | |
mecab = new MeCab(); | |
ret = mecab.parseSync(text); | |
return msg.send(text); |
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 'json' | |
class Hoge | |
def initialize | |
@a=1 | |
@b='hoge' | |
@c={:a => 1} | |
end | |
def to_json |
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
#http://www.logos.t.u-tokyo.ac.jp/www/home/chik/algorithm-design/08%20Graph%20Algorithms.pdfの38枚目を参考に | |
class OKAJIMA | |
def initialize(file_path) | |
@maze = Array.new() | |
open(file_path).each do |l| | |
@maze.push l.chomp.split(//) | |
end | |
@cost = Hash.new(1/0.0) | |
@det = Hash.new() |
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 -*- | |
#Generalized Co-HITSを計算するスクリプト | |
#A Generalized Co-HITS Algorithm and Its Application to Bipartite Graphs | |
#Hongbo Deng* The Chinese Univ. of Hong Kong; Michael Lyu The Chinese University of Hong Kong; IRWIN KING Chinese University of Hong Kong | |
#http://portal.acm.org/citation.cfm?id=1557051 | |
#入力は | |
#u_1 \t v_1 \t count |
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 -*- | |
#/opt/lcoal/bin/ruby | |
#Query Clustering using Click-Through Graph | |
#http://portal.acm.org/citation.cfm?id=1526853 | |
class BiGraph | |
def initialize | |
@nodes = Hash.new{|h,k|h[k] = 0} | |
@out_degree = Hash.new{|h,k|h[k] = 0} | |
@in_degree = Hash.new{|h,k|h[k] = 0} |
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
\documentclass[11pt,a4paper]{jsarticle} | |
\title{離散最適化 課題3} | |
\date{\today} | |
\author{ore} | |
\begin{document} | |
\maketitle | |
\begin{equation} |
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
(require 'ess-site) | |
(setq ess-ask-for-ess-directory nil) | |
(setq ess-pre-run-hook | |
'((lambda () | |
(setq default-process-coding-system '(sjis . sjis)) | |
))) | |
(set-language-environment "Japanese") | |
(set-default-coding-systems 'sjis) | |
(set-terminal-coding-system 'sjis) |
OlderNewer