Skip to content

Instantly share code, notes, and snippets.

View shohei's full-sized avatar

Shohei Aoki shohei

View GitHub Profile
@shohei
shohei / erubis-test.rb
Created December 27, 2011 06:15
My first gist
#!/usr/bin/env ruby
require 'rubygems'
require 'erubis'
require 'erubis/tiny'
require 'erb'
@date = Time.now
str = "<%%= Time::at( <%= @date.to_i %> ) %>"
@shohei
shohei / StopAtHome.java
Created December 27, 2011 06:16
My first public gist
import java.util.ArrayList;
// "len" scope into the for statement
class StopAtHome {
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 100000; i++) {
list.add(i);
@shohei
shohei / .vimrc
Created December 27, 2011 06:22
Vim configuration file
"新しい行のインデントを現在行と同じにする$
set autoindent$
"バックアップファイルを作るディレクトリ$
set backupdir=$HOME/vimbackup$
"ファイル保存ダイアログの初期ディレクトリをバッファファイル位置に設定$
set browsedir=buffer$
"クリップボードをWindowsと連携$
set clipboard=unnamed$
"Vi互換をオフ$
set nocompatible$
@shohei
shohei / karman.py
Created December 27, 2011 06:28
Karman Filter
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import *
import numpy as np
from scipy import stats
import scipy
import scipy.linalg
from pylab import *
@shohei
shohei / README
Created February 10, 2012 04:11
Processing Arduino Serial communication test
Youtube movie
http://www.youtube.com/watch?v=hCfSdrqmkRw
require controlP5
http://www.sojamo.de/libraries/controlP5/
@shohei
shohei / hello.rb
Created February 10, 2012 05:01
Hello, World!
puts "Hello, World!"
@shohei
shohei / A.txt
Created April 11, 2012 16:57
Document processing using regular expression
Abase
【他動】〔地位・品位などを〕落とす、下げる【発音】эbe'is、【変化】《動》abases | abasing | abased、【分節】a・base
abash
【他動】赤面{せきめん}させる、まごつかせる【発音】эbae'∫、【@】アバッシ、アバッシュ、【分節】a・bash
abate
【自動】減少{げんしょう}する、減る、勢いが衰える、弱まる、おさまる、和らぐ却下{きゃっか}する【他動】~の勢いを減らす、~を弱める、和らげる、減らす〔税金{ぜいきん}・料金{りょうきん}を〕引き下げる《法律》~を排除{はいじょ}する、〔起訴{きそ}を〕停止{ていし}する、〔令状{れいじょう}などを〕無効{むこう}にする【レベル】12、【発音】эbe'it、【@】アベイト、【変化】《動》abates | abating | abated、【分節】a・bate
abdicate
【自動】退く、退位{たいい}する、辞任{じにん}する、〔正式{せいしき}に〕放棄{ほうき}する〈性俗〉自分{じぶん}がホモセクシュアルであることを世間{せけん}に公表{こうひょう}する【他動】〔王位{おうい}などを〕捨てる、放棄{ほうき}する【レベル】12、【発音】ae'bdike`it、【変化】《動》abdicates | abdicating | abdicated、【分節】ab・di・cate
aberrant
【形】常軌を逸した、異常な、組織から浮き上がった存在のThis is an aberrant thing. : これは異常な[常軌を逸した]ことだ。【発音】aebe'r(э)nt、эbe'r(э)nt、【分節】ab・er・rant
@shohei
shohei / 1-gram.py
Created April 12, 2012 10:38
n-gram
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from eparser import Parser
from collections import defaultdict
import glob
p = Parser()
@shohei
shohei / 2-gram.py
Created April 14, 2012 12:09
talking with artificial intelligence
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import re
import codecs
filename = raw_input("input the file name:")
fin = codecs.open(filename,"r","utf-8")
fout = codecs.open("2-gram_"+filename,"w","utf-8")
#sent = u"日本語で書いた日本語の文を解析します。"
@shohei
shohei / README
Created April 27, 2012 10:35
Count the words
2011/9/27 青木 作成
【説明】
id:instructablesの製作記事index.htmlを格納。
# wget及びsite sucker(mac)でダウンロードした。
# instructablesの製作記事のページは、www.instructables.com/id/(記事名) にある。
parsing.py:instructablesのindex.htmlを整形してテキストファイルにする。
# BeautifulSoupが必要。