Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
KartikTalwar / Documentation.md
Last active August 25, 2025 16:38
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@rbresearch
rbresearch / etfReplayRank.R
Created January 27, 2013 21:30
implementation of ranking algorithm similar to ETF Replay
# Ranking Algorithm for ETF Replay
# Rank based on 3 factors
# 1. ReturnA (ret1)
# 2. ReturnB (ret2)
# 3. Volatility (vol)
# Returns are ranked from high to low
# Volatility is ranked from low to high
@rbresearch
rbresearch / etf-replay-rank-backtest.R
Created January 28, 2013 04:20
etfReplayRank backtest
# Backtest of ETF Replay Ranking Algorithm
# clear the workspace
rm(list=ls())
# step-by-step example of ETF Replay Ranking Algorithm
##### etfReplayRank Function #####
# we can use the same step-by-step approach outlined above to write a function
# to rank instruments based on ETF Replay
@theanalyst
theanalyst / pushbullet.el
Last active January 28, 2019 01:20
Easily push from your emacs to Android phone??
;;; pushbullet.el --- An emacs client for the pushbullet android app
;;; Using the pushbullet api at https://pushbullet.com/api
;;; Uses grapnel for http requests https://github.com/leathekd/grapnel
;;;
;;; Commentary:
;;;
;;; Code:
(require 'grapnel)
(require 'json)
@mblondel
mblondel / kernel_kmeans.py
Last active January 4, 2024 11:45
Kernel K-means.
"""Kernel K-means"""
# Author: Mathieu Blondel <[email protected]>
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils import check_random_state
"""Kernel K-means"""
# Author: Mathieu Blondel <[email protected]>
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils import check_random_state
@alexchinco
alexchinco / asset-pricing-time-scales.R
Created August 22, 2013 16:41
Code to create figures for my post "Identifying Relevant Asset Pricing Time Scales". url: http://www.alexchinco.com/identifying-relevant-asset-pricing-time-scales/
################################################################################
################################################################################
## Prep workspace
################################################################################
################################################################################
options(width=200, digits=6, digits.secs=6)
rm(list=ls())
library(foreign)

Compiling an optimized ATLAS on Ubuntu 12.04

  1. Download the latest ATLAS source from http://sourceforge.net/projects/math-atlas/files/. I'm using version 3.10.1
  2. Download the latest Netlib LAPACK from http://www.netlib.org/lapack/. I'm using version 3.4.2
  3. Turn off frequency scalings on your chip so that you can get reliable timings. This is essential to get a good ATLAS build
  sudo apt-get install cpufreq-info cpuspeed cpufrequtils sysfsutils
  # set each core to the "performance" governor, so that the clock frequency doesn't go down when idle
  # I have 8 cores, which is why I need to do this 8 times
  sudo cpufreq-selector -c 0 -g performance
@erogol
erogol / WTA_kernel_binary
Created August 30, 2013 16:06
Google's Winner Takes All hashing implemmentation
function[binary_codes,G_vecs] = WTA_kernel_binary(X,G_vecs,G, K)
% G is number of permutation vectors
% K is the insterest span
if size(G_vecs,1) == 0
G_vec = zeros(G,size(X,2));
for i = 1:G
G_vecs(i,:) = randperm(size(X,2),size(X,2));
end
end
@mblondel
mblondel / curve_averaging.py
Last active May 13, 2017 16:47
Variable-length curve averaging
"""Variable-length curve averaging"""
# Author: Mathieu Blondel <[email protected]>
# License: BSD 3 clause
import numpy as np
from scipy.interpolate import interp1d
def curves_mean_std(X, Y, kind="linear"):