Skip to content

Instantly share code, notes, and snippets.

View mtakemiya's full-sized avatar

武宮誠 (Makoto Takemiya) mtakemiya

View GitHub Profile
@milesgrimshaw
milesgrimshaw / gist:5172167
Created March 15, 2013 18:55
Obesity In The USA (Octopress Blog Post)
---
layout: post
title: "Obesity in the USA"
date: 2013-03-14 12:59
comments: true
categories:
---
<!-- Make sure to include D3 first or else the IIFEs won't work. -->
<script src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="/Data/obesitystatedata.js"></script>
@jgarzik
jgarzik / ron-shamir-review.md
Created October 16, 2012 20:51
Peer review of "Quantitative Analysis of the Full Bitcoin Transaction Graph"

This is a review of "Quantitative Analysis of the Full Bitcoin Transaction Graph" by Dorit Ron and Adi Shamir.

There are some incorrect details and analyses that warrant attention.

Oct. 31 UPDATE

The authors have introduced several revisions to their paper, available at the same URL as before.

The criticism below may be outdated in part or in full.

@shurain
shurain / autoencoder.py
Created October 6, 2012 16:31 — forked from anonymous/autoencoder.py
Python: Sparse Autoencoder
import numpy as np
#from matplotlib import pyplot as plt
from scipy.optimize import fmin_l_bfgs_b as bfgs,check_grad,fmin_bfgs,fmin_tnc
from scipy.io import loadmat
import cPickle
class params:
'''
@larsmans
larsmans / hellinger.py
Created July 15, 2012 13:25
Hellinger distance for discrete probability distributions in Python
"""
Three ways of computing the Hellinger distance between two discrete
probability distributions using NumPy and SciPy.
"""
import numpy as np
from scipy.linalg import norm
from scipy.spatial.distance import euclidean
@woodb
woodb / setup_flask_and_friends.sh
Created July 8, 2012 16:43
Shell script to get setup with Flask, nginx and uWSGI on an Amazon EC2 Linux image
#!/bin/bash
#
# Shell script to automatically configure a new Flask, nginx and uWSGI based blog
# on an Amazon EC2 instance.
#
# See http://bit.ly/MeGwjD for more information!
#
# If you are forking this for your own custom configuration script, see the following other gists:
# https://gist.github.com/3071737
# https://gist.github.com/3071739
@fnielsen
fnielsen / Nielsen2012Numpy_quotes.py
Created June 12, 2012 17:33
Wikipedia/stock quote visualization with Python and matplotlib
import urllib, urllib2
import simplejson as json
import dateutil.parser
import datetime
import matplotlib.dates
import matplotlib.finance
from matplotlib import pyplot as plt
import nltk.corpus
import numpy as np
import re
@crizCraig
crizCraig / gist:2816295
Created May 27, 2012 22:52
Download images from Google Image search using Python
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.
@mitsuaki
mitsuaki / gist:2496795
Created April 26, 2012 06:41
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.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)
@mblondel
mblondel / lda_gibbs.py
Last active October 9, 2023 11:31
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
License: BSD 3 clause
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""