Skip to content

Instantly share code, notes, and snippets.

View motoso's full-sized avatar

Motoso Inami motoso

View GitHub Profile
@motoso
motoso / default.conf
Created August 7, 2016 07:04
はてなブログ用のnginxのリダイレクト設定
server {
listen 80;
server_name www.letstouch.tech;
return 301 http://www.yak-and-duck.com$request_uri;
access_log /var/log/nginx/www.letstouch.tech.info_access.log main;
error_log /var/log/nginx/www.letstouch.tech.info_error.log;
}
@motoso
motoso / hardy-ramanujan-number.c
Created March 7, 2016 16:05
ハーディ・ラマヌジャン数を求めるプログラム
#include <stdio.h>
/*ハーディ・ラマヌジャン数を求めるプログラム
以下の条件を満たす4桁の自然数を求める.
1.2つの数の立方の和として表す表し方が2通りある数.
2.その数の中で最も小さいもの*/
int max_ripp(void);
int main(void){
int max,i,j,k,m,flag;
@motoso
motoso / 11-3.c
Last active March 5, 2016 06:09
2010年にC言語プログラミングレッスンを読んだときつくった解答
/*
* 文字列を逆に並び替えるプログラム
*/
#include<stdio.h>
int main(void);
void reverse_string(char *p);
int count_string(char *p);
int main(void)
@motoso
motoso / align2Csv.py
Last active August 29, 2015 14:11
A parser for the output file of Julius: .align to .csv[onset, offset, phoneme]
# coding: UTF-8
import sys, re, csv
if(len(sys.argv)) != 2:
print("usage: python3 align2Csv.py [align file]")
sys.exit()
transFile = sys.argv[1]
if __name__ == '__main__':
tf = open(transFile, "r")
@motoso
motoso / Gemfile
Last active September 28, 2015 13:48
Twitter bot on Heroku
ruby '2.1.4'
source 'https://rubygems.org'
gem 'sinatra'
gem 'twitter'
@motoso
motoso / nameExtractor.py
Last active January 2, 2016 06:49
【Python】[ブース] [サークル名]の項目が並んだテキストファイルからサークル名のみを抽出したテキストファイルを作成するプログラム.コミティアのサークル名簿( http://www.comitia.co.jp/100/100list.html )からサークル名を抜き出すために作成.このあと,むちゃくちゃ形態素解析した.
# coding: UTF-8
import sys
argv = sys.argv
argc = len(argv)
if (argc < 3):
print "Usage: # python %s [input] [output]" % argv[0]
quit()