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
(* | |
TeX2PDF for CotEditor | |
編集中のTeXファイルをDrag & Drop pTeX (http://www2.kumagaku.ac.jp/teacher/herogw/)でタイプセットするスクリプト。texファイルはどこかに保存されている必要があります。デフォルトではpTeX.appは“アプリケーション”フォルダにインストールされているとします。pTeX.appのスクリプトを参考にしました。少し書き換えればportsなどでインストールしたpTeXにも対応できるかもしれません。 | |
*) | |
(* written by satomacoto. 2010.1.26 *) | |
tell application "CotEditor" | |
if exists front document then |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
from collections import defaultdict | |
d = defaultdict(int) | |
for line in sys.stdin: | |
title, author, moji, rubi = line[:-1].split('¥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
#!/bin/sh | |
TEX=$* | |
DVI=`/usr/bin/basename "$TEX" ".tex"` | |
THECODE=`nkf -g "$TEX"` | |
case $THECODE in | |
UTF-8) KANJI="-kanji=utf8" ;; | |
EUC-JP) KANJI="-kanji=euc" ;; | |
Shift_JIS) KANJI="-kanji=sjis" ;; | |
ISO-2022-JP) KANJI="-kanji=jis" ;; | |
esac |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
Parameter Estimation for Linear Dynamical Systems | |
x[t] = A*x[t-1] + w[t] | |
y[t] = C*x[t] + v[t] | |
w[t] ~ N(0,Q) | |
v[t] ~ N(0,R) | |
''' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from matplotlib import pyplot as plt | |
data = """1 0.841470984807896 | |
0.54030230586814 0.287797828416081 | |
-0.416146836547142 0.172313864573127 | |
-0.989992496600445 0.830544794233449 | |
-0.653643620863612 0.414369558091726""" |
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
import matplotlib.pyplot as plt | |
from matplotlib.patches import Arrow | |
plt.figure(1, figsize=(3,3)) | |
ax = plt.gca() | |
ax.annotate("", | |
xy=(0.2, 0.2), xycoords='data', | |
xytext=(0.8, 0.8), textcoords='data', | |
arrowprops=dict(arrowstyle="->", |
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
import matplotlib.pyplot as plt | |
circle1=plt.Circle((0,0),.2,color='r') | |
circle2=plt.Circle((.5,.5),.2,color='b') | |
circle3=plt.Circle((1,1),.2,color='g',clip_on=False) | |
fig = plt.gcf() | |
fig.gca().add_artist(circle1) | |
fig.gca().add_artist(circle2) | |
fig.gca().add_artist(circle3) | |
plt.show() |
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
#! /usr/bin/python | |
# -*- encoding: utf-8 -*- | |
''' | |
Parser with MeCab | |
''' | |
import MeCab | |
import glob | |
import re | |
import os |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# extract YouTube videoids from html | |
import re | |
import json | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
def get_videoids(url): |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>A sample of YouTube Player API for <iframe> Embeds</title> | |
</head> | |
<body> | |
<!-- <iframe>(とプレイヤ)に置き換わる<div>タグ --> | |
<div id="player"></div> | |