Hello
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy | |
import scipy.spatial | |
# データ読み込み | |
f = open('nihonseiji.txt') | |
head = f.readline() | |
parties = head.strip().split('\t')[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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy | |
# データ読み込み | |
f = open('nihonseiji.txt') | |
head = f.readline() | |
parties = head.strip().split('\t')[1:] | |
vlist = [] |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
""" | |
# 打率列から得点のシミュレーション | |
- 9回 | |
- 3アウトでチェンジ | |
- すべて単打 | |
- 4回以上連続でヒットで得点 | |
""" |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'kconv' | |
require 'nokogiri' | |
require 'json' | |
class Youtubelinks | |
def videoid(id) | |
url = "https://gdata.youtube.com/feeds/api/videos/#{id}?v=2&alt=json" | |
begin |
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
def binary_tree_dp_dfs(n, k=1, a=[1]): | |
''' | |
>>> for x in binary(3): print x | |
[1, 2, 4] | |
[1, 2, 5] | |
[1, 3, 6] | |
[1, 3, 7] | |
''' | |
if n == k: | |
yield a |
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
<html> | |
<head> | |
<title> | |
</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
class DSDR: | |
"""Z He, et al. Document Summarization based onData Reconstruction (2012) | |
http://www.aaai.org/ocs/index.php/AAAI/AAAI12/paper/viewPaper/4991 | |
""" | |
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
<!DOCTYPE html> | |
<!-- http://docs.mathjax.org/en/v1.1-latest/typeset.html --> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>MathJax Dynamic Math Test Page</title> | |
<script type="text/x-mathjax-config"> | |
MathJax.Hub.Config({ | |
tex2jax: { | |
inlineMath: [["$","$"],["\\(","\\)"]] |
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
# create candidate sentense set | |
docs = [['a', 'b', 'c'], | |
['b', 'd']] | |
terms = ['a', 'b', 'c', 'd'] | |
vlist = [] | |
n = len(docs) | |
d = len(terms) | |
for doc in docs: | |
tmp = [] | |
for term in doc: |