Skip to content

Instantly share code, notes, and snippets.

View r9y9's full-sized avatar
:shipit:
( ˘ω˘ ) zzz

Ryuichi Yamamoto r9y9

:shipit:
( ˘ω˘ ) zzz
View GitHub Profile
@r9y9
r9y9 / mlp3.jl
Last active August 29, 2015 14:19
mlp3.jl
sigmoid(x) = 1.0 ./ (1.0 + exp(-x))
dsigmoid(y) = y .* (1.0 - y)
type MLP3
W¹::Matrix{Float64}
b¹::Vector{Float64}
W²::Matrix{Float64}
b²::Vector{Float64}
end
@r9y9
r9y9 / vim_benchmark.sh
Created April 21, 2015 16:16
Easy vim benchmark (e.g: ./vim_benchmark.sh 10)
#!/bin/bash
# e.g. bash vim_benchmark.sh 10
LOGFILE=$(mktemp)
ITER=$1
function echo_mean_and_std() {
m=$(grep "editing files" $1 | awk 'BEGIN{m=0.0} {m+=$1} END{print m/NR}')
@r9y9
r9y9 / apr.jl
Created April 25, 2015 07:32
Apache Portable Runtimeをjuliaから呼んでみるテスト
const libapr = "./libapr-1.0"
@assert dlopen(libapr) != C_NULL
argc = Array(Cint, 1)
argv = Array(Ptr{Cchar}, 1)
env = Array(Ptr{Cchar}, 1)
# 引数なしの初期化
# ccall((:apr_initialize, libapr), Void, ())
@r9y9
r9y9 / d4c_badaccess_fix.diff
Created May 31, 2015 09:34
D4Cのメモリ違反をとりあえずfix
53c53
< double *waveform) {
---
> double *waveform, int waveform_length) {
66c66,68
< for (int i = 0; i <= half_window_length * 2; ++i)
---
> int upper_bound = half_window_length * 2 > waveform_length - 1 ?
> waveform_length - 1 : half_window_length * 2;
> for (int i = 0; i <= upper_bound; ++i)
@r9y9
r9y9 / mgcep_sketch.jl
Created July 26, 2015 17:53
Re-design MelGeneralizedCepstrums
# NOTE: requires julia v0.4
import Base: eltype, size, length, getindex
import SPTK
### Generic interface ###
abstract SpectralEnvelopeDef
@r9y9
r9y9 / istft tests.ipynb
Created August 24, 2015 15:58
istft tests for librosa
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@r9y9
r9y9 / STFT modify examples.ipynb
Last active August 29, 2015 14:28
STFT modify examples: magnitude scaling and phase vocoding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@r9y9
r9y9 / Stackoverflow when converting an RGBA image to Gray-scale image.ipynb
Last active October 8, 2015 07:57
Stackoverflow when converting an RGBA image to Gray-scale image.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@r9y9
r9y9 / opencv2-2.4.9.log
Created November 14, 2015 10:18
opencv2-2.4.9.log generated by `apothecary update ofxOpenCv` in scripts/apothecary directory
Log:
CMake Warning (dev) at cmake/OpenCVUtils.cmake:203 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "APPLE" will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.