Skip to content

Instantly share code, notes, and snippets.

View odashi's full-sized avatar
🏠
Working from home

Yusuke Oda odashi

🏠
Working from home
View GitHub Profile
@odashi
odashi / crowl.py
Created March 2, 2014 17:44
Simple Web crowler
# coding: utf-8
import chardet
import datetime
import html.parser
import optparse
import os
import re
import sys
@odashi
odashi / lame.py
Created March 9, 2014 18:37
LAMEでWAVをまとめてMP3にするスクリプト(古いもの)
# lame.py
# Convert WAV files into MP3 format by using LAME.
# Copyright (C) 2010/06/11~ by Odashi.
import os
import sys
import subprocess
# Global settings
LAME_PATH = '"C:\\Program Files\\LAME\\lame.exe"'
@odashi
odashi / parser_pascal.cpp
Created March 9, 2014 18:52
Boost.SpiritによるPascalのパーサ
// parser_pascal.cpp
#include <iostream>
#include <string>
#define BOOST_SPIRIT_USE_OLD_NAMESPACE
//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/classic.hpp>
#include <boost/spirit/include/classic_ast.hpp>
#include "parser.h"
using namespace boost::spirit;
@odashi
odashi / fourier.py
Created March 9, 2014 18:59
離散フーリエ変換。
# fourier.py
# This source contains below:
# * Discrete Fourier Transform (DFT)
# * Fast Fourier Transform (FFT)
# * Discrete Co-sine Transform Type-II (DCT2)
import math
def dft(samples):
n = len(samples)
@odashi
odashi / haar_dwt.py
Created March 9, 2014 18:59
Haarウェーブレットによる離散ウェーブレット変換。
# haar_dwt.py
import sys
######## input file ########
fp = open(sys.argv[1], "r")
n = int(fp.readline())
samp = []
@odashi
odashi / bibtex.cgi
Last active August 29, 2015 14:01
JSONで書いた文献一覧をBibTeXで吐き出す。
#!/path/to/python3
# -*- coding: utf-8 -*-
import cgi
import cgitb
import io
import json
import os
import sys
@odashi
odashi / test-map-iteration.cc
Last active August 29, 2015 14:10
mapのイテレーション速度を測定
#include <map>
#include <random>
#include <iostream>
#include <cmath>
#include <sys/time.h>
using namespace std;
double mytime() {
timeval tv;
«
🐶
♡»
♡♡
🙇✨
😇💓
♡♡♡
☺️💓
🌟✨💫
@odashi
odashi / 1-to-many.txt
Last active September 11, 2015 09:57
日本語1文字から英語1単語への対応。EIJIROとWWWJDICを解析。
27 垓 100,000,000,000,000,000,000
22 京 10,000,000,000,000,000
18 根 stick-to-itiveness
18 闇 black-marketeering
17 兆 1,000,000,000,000
17 悦 self-satisfaction
16 訛 mispronunciation
16 識 acquaintanceship
16 矩 perpendicularity
16 鎌 sickle-and-chain
@odashi
odashi / rnnlm_lightnovels
Created March 13, 2014 16:45
RNNLMでWeb小説25万文を学習し、ランダムサンプリングで文生成したもの。
「腹には悪くなかった。
今も楽しまわったりすること。
力のためになりながら横に鉈を済ませ
「俺はベランダの前述を見て貫太郎は慌てて略わけにします)。その上で結構弾けること!」
「ひべ』
君は、荷物深いものを青白くまとわりつくところです。吊っ(バックボーン、はかっ、むなぐらをつかみの現さないくらいの説明をしてしまったつかさが、ゆり!)
「用さぁ」
雄治の早起きからいい外装というられるのだろ」
その男は言えないか。なんとなく思います。
「クリスマス』な」というの経済を続ける感覚に弾が休ませずにくれそうなところでいき、船がない。