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 / 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 / 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 / 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 / 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
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 / 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>
@ikegami-yukino
ikegami-yukino / google_login.py
Created June 12, 2015 09:26
Automatically Google login by selenium
mail_address = ''
password = ''
from selenium import webdriver
UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0'
PHANTOMJS_ARG = {'phantomjs.page.settings.userAgent': UA}
driver = webdriver.PhantomJS(desired_capabilities=PHANTOMJS_ARG)
url = 'https://www.google.com/accounts/Login?hl=ja&continue=http://www.google.co.jp/'
@ikegami-yukino
ikegami-yukino / install_byobu_yum.sh
Last active February 11, 2020 07:14
Install byobu to CentOS and Amazon Linux
sudo yum install byobu -y --enablerepo=epel-testing
@ikegami-yukino
ikegami-yukino / install_ubuntu_spark.sh
Created June 25, 2015 10:41
Install Scala 2.11.7 and Spark 1.4.0 with Hadoop 2.6 to Ubuntu 14.04
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz
sudo mkdir /usr/local/scala
sudo tar xvf scala-*.tgz -C /usr/local/scala
echo "export SCALA_HOME=/usr/local/scala/scala-2.11.7" >> ./bashrc
echo "export PATH=$SCALA_HOME/bin:$PATH" >> ./bashrc
wget ftp://ftp.kddilabs.jp/infosystems/apache/spark/spark-1.4.0/spark-1.4.0-bin-hadoop2.6.tgz
tar xf spark-1.4.0-bin-hadoop2.6.tgz
sudo mv spark-1.4.0-bin-hadoop2.6 /usr/local/spark
@ikegami-yukino
ikegami-yukino / japanese_matcher.java
Created July 28, 2015 02:27
Japanese character matcher for Java8
private static final Pattern PAT_JAPANESE_CHARACTER = Pattern
.compile("[\\p{IsHiragana}\\p{IsKatakana}\\p{InCJKUnifiedIdeographs}]");
private static boolean isJapanese(final String token) {
return PAT_JAPANESE_CHARACTER.matcher(token).find();
}