Skip to content

Instantly share code, notes, and snippets.

@nkhuyu
nkhuyu / try_distance_corr.py
Created January 22, 2016 03:44 — forked from josef-pkt/try_distance_corr.py
distance covariance and correlation
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 14:00:29 2012
Author: Josef Perktold
License: MIT, BSD-3 (for statsmodels)
http://en.wikipedia.org/wiki/Distance_correlation
Yaroslav and Satrajit on sklearn mailing list
@nkhuyu
nkhuyu / springer-free-maths-books.md
Created December 29, 2015 21:06 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@nkhuyu
nkhuyu / Basic timeseries exploration.ipynb
Created November 18, 2015 04:59 — forked from cast42/Basic timeseries exploration.ipynb
Exploration of basic timeseries approach to forecast sales in the Rossman Kaggle competition
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nkhuyu
nkhuyu / NormalizedGini.java
Last active August 29, 2015 14:26 — forked from amihalik/NormalizedGini.java
NormalizedGini
import java.util.Arrays;
import java.util.Comparator;
public class NormalizedGini {
private static double gini(double[] a, double[] p, double[] w) {
int len = a.length;
if (p.length != len || w.length != len) {
throw new IllegalArgumentException("array length not equal");
}
# Original code from tinrtgu on Kaggle under WTFPL license
# Relicensed to BSD 3-clause (it does say do what you want...)
# Authors: Kyle Kastner
# License: BSD 3-clause
# Reference links:
# Adaptive learning: http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41159.pdf
# Criteo scalable response prediction: http://people.csail.mit.edu/romer/papers/TISTRespPredAds.pdf
# Vowpal Wabbit (hashing trick): https://github.com/JohnLangford/vowpal_wabbit/
# Hashing Trick: http://arxiv.org/pdf/0902.2206.pdf
@nkhuyu
nkhuyu / latency.txt
Last active August 29, 2015 14:23 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@nkhuyu
nkhuyu / ranking.py
Last active August 29, 2015 14:22 — forked from agramfort/ranking.py
"""
Implementation of pairwise ranking using scikit-learn LinearSVC
Reference: "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich,
T. Graepel, K. Obermayer.
Authors: Fabian Pedregosa <fabian@fseoane.net>
Alexandre Gramfort <alexandre.gramfort@inria.fr>
"""
@nkhuyu
nkhuyu / ScalaHelloWorld
Created April 11, 2015 04:38
Scala HelloWorld
object test {
def main(args: Array[String]) {
println("Hello World!")
}
}
apt-get -y install build-essential libssl-dev libqrencode-dev libminiupnpc-dev git libz-dev libbz2-dev python2.7-dev
git clone https://github.com/dogecoin/dogecoin.git
wget -O boost_1_55_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download
tar -xvzf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh --prefix=/usr
./b2 stage threading=multi link=shared
./b2 install threading=multi link=shared
cd /home/user/dogecoin/src
make -f makefile.unix

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English