Skip to content

Instantly share code, notes, and snippets.

View ikegami-yukino's full-sized avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
@ikegami-yukino
ikegami-yukino / Grass.itermcolors
Created May 5, 2015 07:25
Mac Terminal Grass style for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
session = requests.Session()
session.mount('http://', requests.adapters.HTTPAdapter(max_retries=3))
session.mount('https://', requests.adapters.HTTPAdapter(max_retries=3))
response = session.get(lp, headers={'User-agent': UA}, timeout=1)
@ikegami-yukino
ikegami-yukino / machine_translation_tutlial.sh
Last active November 16, 2020 14:51
Tutial of Machine Translation for Mac OSX Mountain Lion
mkdir ~/smt
cd ~/smt
# Install Moses
export BOOST_ROOT=/usr/local/Cellar/boost/1.57.0
export BOOST_BUILD_PATH=/usr/local/share/boost-build
ln /usr/local/Cellar/boost/1.57.0/lib/libboost_thread-mt.a /usr/local/Cellar/boost/1.57.0/lib/libboost_thread.a
ln /usr/local/Cellar/boost/1.57.0/lib/libboost_thread-mt.dylib /usr/local/Cellar/boost/1.57.0/lib/libboost_thread.dylib
ln -s /usr/local/Cellar/boost/1.57.0/lib /usr/local/Cellar/boost/1.57.0/lib64
@ikegami-yukino
ikegami-yukino / mac_notify.sh
Last active August 29, 2015 14:17
Send message to the Mac OSX notification center
function notify() {
echo -e "display notification \"$1\" with title \"Terminal\" subtitle \"`date +"%F %T"`\"" | osascript
}
@ikegami-yukino
ikegami-yukino / kleinberg.py
Created March 10, 2015 04:48
Burst detection by kleinberg's algorithm
from collections import namedtuple
import np
class Bursts:
def __init__(level, start, end):
self.level = level
self.start = start
self.end = end
@ikegami-yukino
ikegami-yukino / jpcommon_label.c.patch
Created February 26, 2015 18:44
OpenJtalk 1.08 の間延びするバグ修正パッチ
*** jpcommon/jpcommon_label.c.old 2015-02-27 03:35:32.000000000 +0900
--- jpcommon/jpcommon_label.c 2015-02-27 03:36:34.000000000 +0900
*************** static int index_accent_phrase_in_breath
*** 296,301 ****
--- 296,302 ----
if (index == a)
break;
}
+ if (i > 3) i = 3;
return i;
@ikegami-yukino
ikegami-yukino / speech_install.sh
Last active October 23, 2024 00:46
Install hts_engine, hts_voice and open_jtalk
HTS_ENGINE_VERSION=1.10
HTS_VOICE_VERSION=1.05
OPENJTALK_VERSION=1.10
pushd .
cd /tmp
wget http://downloads.sourceforge.net/hts-engine/hts_engine_API-${HTS_ENGINE_VERSION}.tar.gz
tar xzf hts_engine_API-${HTS_ENGINE_VERSION}.tar.gz
cd hts_engine_API-${HTS_ENGINE_VERSION}
@ikegami-yukino
ikegami-yukino / vim_hive.sh
Created January 23, 2015 10:06
Hive syntax for Vim
mkdir -p .vim/syntax
wget -O .vim/syntax/hive.vim https://raw.githubusercontent.com/autowitch/hive.vim/master/syntax/hive.vim
echo "au BufNewFile,BufRead *.hql set filetype=hive expandtab" >> ~/.vimrc
echo "au BufNewFile,BufRead *.q set filetype=hive expandtab" >> ~/.vimrc
'''
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@ikegami-yukino
ikegami-yukino / file0.txt
Last active August 29, 2015 14:13
PythonでMeCabの制約付き解析を使う ref: http://qiita.com/yukinoi/items/4e7afb5e72b3a46da0f2
# -*- coding: utf-8 -*-
import re
import MeCab
from MeCab import MECAB_ANY_BOUNDARY, MECAB_INSIDE_TOKEN, MECAB_TOKEN_BOUNDARY
DICINFO_KEYS = ('charset', 'filename', 'lsize', 'rsize', 'size', 'type', 'version')
class Tagger(MeCab.Tagger):