Skip to content

Instantly share code, notes, and snippets.

View alfredplpl's full-sized avatar

Alfred Increment alfredplpl

View GitHub Profile
@alfredplpl
alfredplpl / 5-pi_is_not_in_z.ipynb
Last active April 2, 2022 10:19
5**pi_is_not_in_Z.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alfredplpl
alfredplpl / createMovie.py
Created November 2, 2019 04:44
Concatenate movies by ffmpeg on Windows. ffmpegで動画をつなぐスクリプト
# License: MIT License
__author__="Alfred Increment"
import glob
import os
import datetime
dt_now = datetime.datetime.now()
dateString=dt_now.strftime('%Y-%m-%d')
@alfredplpl
alfredplpl / STT.cs
Created December 20, 2018 00:38
Speech-To-Text on Unity
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Windows.Speech;
using System.Collections.Generic;
using System.Linq;
public class STT : MonoBehaviour
{
public UnityEngine.UI.Text resultDisplay;
@alfredplpl
alfredplpl / EmotionalAgent.py
Created November 26, 2017 05:41
自然非言語処理第1日目のソースコード
# coding: UTF-8
__auhtor__="alfredplpl"
#See also:
#https://westus.dev.cognitive.microsoft.com/docs/services/5639d931ca73072154c1ce89/operations/56f23eb019845524ec61c4d7
#http://labs.eecs.tottori-u.ac.jp/sd/Member/oyamada/OpenCV/html/py_tutorials/py_gui/py_video_display/py_video_display.html
import httplib,cv2,json
## constants
@alfredplpl
alfredplpl / shareMemory.py
Last active August 29, 2015 14:22
Pythonでよく迷うプロセス間のメモリ共有のサンプルを書きました。
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はいたしかねます。
from multiprocessing import Manager,Pool
def f(param):
l,s=param
for i in range(10):
t=[x+i+s for x in l]
@alfredplpl
alfredplpl / InputTools.py
Created May 30, 2015 03:42
Simple key input with time out on python. タイムアウト付きキー入力。
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はいたしかねます。
__author__ = 'alfredplpl'
# This fucntion can use on Unix systems (Mac or Linux) .
TIMEOUT_VAL=-1
def waitKey(miliseconds):
@alfredplpl
alfredplpl / cmpPickle.py
Last active August 29, 2015 14:21
自動で圧縮してくれるPickleです。今までのコードに「from cmpPickle import CompressedPickle as pickle」と最初に書くと、そのまま使えます。Auto compressing pickle.
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 日本の方へ
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はいたしかねます。
# 参考URL: http://osdn.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license
# References: https://docs.python.org/3/library/gzip.html
# http://henrysmac.org/blog/2010/3/15/python-pickle-example-including-gzip-for-compression.html
@alfredplpl
alfredplpl / MultivariateMinibatchSGDR.py
Last active August 29, 2015 14:21
多変量版のミニバッチSGDです。マルチタスク学習でないので、効率はすごく悪いです
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はしません。
# 参考URL: http://osdn.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license
from sklearn import linear_model
import Image
import numpy as np
from sklearn.cross_validation import ShuffleSplit
from sklearn.metrics import r2_score
@alfredplpl
alfredplpl / MinibatchSGDRegressor.py
Last active August 29, 2015 14:21
ミニバッチSGDです。Kaggle見ても、作れとしか書かれてなかったので作りました。
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はしません。
# 参考URL: http://osdn.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license
from sklearn import linear_model
import Image
import numpy as np
from sklearn.cross_validation import ShuffleSplit
class MinibatchSGDRegressor(linear_model.SGDRegressor):