Skip to content

Instantly share code, notes, and snippets.

View mtakemiya's full-sized avatar

武宮誠 (Makoto Takemiya) mtakemiya

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mtakemiya
mtakemiya / XMLZipTest.java
Created November 1, 2011 01:47
Unzip and read zipped xml files
package jp.atr.dni.zip.test;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.zip.ZipFile;
import org.apache.commons.io.IOUtils;
/**
@mtakemiya
mtakemiya / gist:2157565
Created March 22, 2012 10:15
Streaming File Using SSHJ
/**
* www.brainliner.jp
*
* @author 武宮 誠 「Makoto Takemiya」<br />
* (株)国際電気通信基礎技術研究・脳情報研究所・神経情報学研究室<br/>
* 「ATR - Computational Neuroscience Laboratories, Department of Neuroinformatics」
*
* @version 2012/03/22
*/
public class StreamingInMemoryDestFile extends InMemoryDestFile {
@mtakemiya
mtakemiya / BrainLineReader.r
Created April 26, 2012 07:25 — forked from mitsuaki/gist:2496795
Read .mat file in R
library("hdf5")
hdf5::hdf5load("fileName.mat")
# To show the value of chData, for example,
chData$ch1$value[[1]]
@mtakemiya
mtakemiya / BrainLinerMatReader.m
Created April 26, 2012 07:29
Read .mat file in Matlab
load('fileName.mat')
% plot data from the first channel, for example,
plot(chData.ch1.value)
@mtakemiya
mtakemiya / UsingNSReader.m
Created May 8, 2012 05:36
Reading .nsn File in MatLab
[chData, chHeader, fileInfo] = ns_Reader('raw_EMG_signal.nsn');
@mtakemiya
mtakemiya / beanPlot.py
Created August 10, 2012 05:08
Beanplot Example
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
shou = np.random.random(100)
chiku = np.log(shou)
bai = np.exp2(shou)
data=[shou, chiku, bai]
ll = ["shou (" + str(np.round(np.mean(shou),decimals=2))+")", "chiku (" + str(np.round(np.mean(chiku),decimals=2))+")", "bai (" + str(np.round(np.mean(bai),decimals=2))+")"]
@mtakemiya
mtakemiya / violinPlot.py
Created August 10, 2012 05:14
Violin Plot Example
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
shou = np.random.random(100)
chiku = np.log(shou)
bai = np.exp2(shou)
data=[shou, chiku, bai]
ll = ["shou (" + str(np.round(np.mean(shou),decimals=2))+")", "chiku (" + str(np.round(np.mean(chiku),decimals=2))+")", "bai (" + str(np.round(np.mean(bai),decimals=2))+")"]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mtakemiya
mtakemiya / BrainLinerMatReader.py
Created April 26, 2012 03:48
Reading .mat File in Python
import h5py
f = h5py.File('fileName.mat')
fileHeader = f['fileInfo']
data = f['chData']
dataHeaders = f['chHeader']
numChannels = len(data)