Skip to content

Instantly share code, notes, and snippets.

View buhii's full-sized avatar

Takahiro Kamatani buhii

View GitHub Profile
#!/bin/bash
mecab="mecab-0.996"
mecab_python="mecab-python-0.996"
mecab_googlecode="https://mecab.googlecode.com/files/"
if ! type curl > /dev/null; then
downloader='wget '
else
downloader='curl -O '
@buhii
buhii / fanta.py
Created December 14, 2013 02:00
Fanta quiz 3
# -*- coding: utf-8 -*-
def all_startswith(question, d):
for num in d:
if question.startswith(num):
yield num
def pickup(string, d, result=[]):
if string == "":
print result, ''.join([d[num] for num in result])
# -*- coding: utf-8 -*-
import json
from datetime import datetime, timedelta
ROBOT_RECORD = "RobotRecord"
RECORD_KINDS = ('AFSMData', 'Compass', 'FaceMotionData', 'OmniControl', 'RSSIRecord', 'URGData')
FILENAME_PREFIX = "2012-08-31 11:00:00+09:00_2012-08-31 17:10:00+09:00_"
#!/Users/buhii/.virtualenvs/gemini/bin/python
# -*- coding: utf-8 -*-
import os
from path import path
IMAGE_EXTENSIONS = ('png', 'jpg', 'gif', 'pdf')
d = path('.')
@buhii
buhii / framed.py
Created January 14, 2013 20:05
framed.py - draw a frame for any pictures
#!/Users/buhii/.virtualenvs/gemini/bin/python
# -*- coding: utf-8 -*-
import sys
if len(sys.argv) != 2:
print "Usage: framed.py [image path]"
sys.exit(0)
else:
import os
@buhii
buhii / gist:4476122
Last active December 10, 2015 18:38
minecraft coordinate
-Diamond Island
--X: -211
--Y: 12
--Z: 484
-Mushroom Island
--X: -597
--Y: 72
--Z: 0
@buhii
buhii / magnet_holder2.scad
Created October 4, 2012 22:51
magnet_holder2.scad
rod_radius = 1.3; //1.2 / 2; // + 0.63;
magnet_height = 4.0;
magnet_radius = 4.0;
holder_length = 8.0;
holder_width = 11.0;
holder_edge = 6.0;
module magnet_holder()
@buhii
buhii / battery_holder.scad
Created October 3, 2012 19:16
magnet holder 1
rod_radius = 1.2 / 2; // + 0.63;
magnet_height = 3.0;
magnet_radius = 3.0;
holder_length = 8.0;
holder_width = 11.0;
holder_edge = 6.0;
@buhii
buhii / txosc_client_practice.py
Created August 28, 2012 18:55
txosc practice
def _callback(result):
print("connected")
client.send(osc.Message('/ack'))
from twisted.internet import reactor
from txosc import osc, dispatch, async
client = async.ClientFactory()
_client_port = reactor.connectTCP('10.0.1.2', 59603, client)
client.deferred.addCallback(_callback)
@buhii
buhii / kondo.py
Created August 19, 2012 09:06
in progress
# -*- coding: utf-8 -*-
from struct import pack
class RCB_4HV(object):
def __init__(self):
pass
def uni_servo(self, ics, speed, position):
# uni servo control