This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import speech_recognition as sr | |
r = sr.Recognizer() | |
mic = sr.Microphone() | |
with mic as source: | |
r.adjust_for_ambient_noise(source) | |
audio = r.listen(source) | |
print(r.recognize_google(audio, language='ja-JP')) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.datasets import load_boston | |
import pandas as pd | |
import xgboost as xgb | |
from tensorboard_logger import configure, log_value | |
from sklearn.cross_validation import train_test_split | |
def logspy(env): | |
log_value("train", env.evaluation_result_list[0][1], step=env.iteration) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pychromecast | |
def play_mp3(mp3_url): | |
cast.wait() | |
mc = cast.media_controller | |
mc.play_media(mp3_url, 'audio/mp3') | |
mc.block_until_active() | |
chromecast_name = "つーねらの部屋" | |
chromecasts = pychromecast.get_chromecasts() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import subprocess | |
import time | |
exec_path = "/home/tsu-nera/tmp/a.out" | |
core_path = "/home/tsu-nera/tmp/core" | |
bt_path = "/home/tsu-nera/tmp/backtrace" | |
core_time = subprocess.check_output(['ls', '-l', core_path]).split() | |
bt_time = subprocess.check_output(['ls', '-l', bt_path]).split() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import subprocess | |
import re | |
try: | |
res = subprocess.check_output(['ps', '-e']) | |
except: | |
print "Error." | |
lines = res.splitlines()[1:] | |
pidname = dict() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gof.command; | |
import java.util.Stack; | |
class CommandSample3 { | |
//////////////////// | |
// Command | |
//////////////////// | |
abstract public static class Command { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Leap, sys | |
import paho.mqtt.client as mqtt | |
from Leap import CircleGesture | |
client = mqtt.Client() | |
client.connect("localhost",1883,60) | |
class SampleListener(Leap.Listener): | |
def on_connect(self, controller): | |
controller.enable_gesture(Leap.Gesture.TYPE_CIRCLE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import paho.mqtt.client as mqtt | |
from pynput.keyboard import Key, Listener | |
client = mqtt.Client() | |
client.connect("localhost",1883,60) | |
def on_press(key): | |
print("{} is pressed".format(key)) |