Skip to content

Instantly share code, notes, and snippets.

@8one6
8one6 / drawdowns.ipynb
Created January 19, 2014 15:36
A review of various functions for computing drawdowns and rolling drawdowns of a given 1-d data structure (numpy array or pandas series).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@akiatoji
akiatoji / build-opencv-mavericks.sh
Last active August 13, 2018 00:54
OpenCV 2.4.9 on Mavericks
# How to install and verify OpenCV 2.4.9 on OS X Mavericks
# 1. Install opencv from homebrew. You can do basic opencv things with this
brew tap homebrew/science
brew install opencv --with-ffmpeg --with-java --with-tests --with-qt # takes a long while
# 2. Download opencv source and build samples since Homebrew doesn't include them.
# samples are often referred to in how-to guides and books.
@bishboria
bishboria / LittleLang.agda
Last active January 17, 2016 16:15
How do I fix the 'cannot decide' error in the opt function?
module LittleLang where
open import Data.Bool
open import Data.Nat
data type : Set where
tNat tBool : type
data exp : type → Set where
nat : ℕ → exp tNat
@miklb
miklb / gist:8536fdb43ed8564689cb
Last active December 1, 2016 04:50
bookmarklet to hide "IFTTT" from a page. (specifically pinboard). Completely cribbed from this [Stack Overflow](https://gist.github.com/miklb/8536fdb43ed8564689cb/edit) solution.
javascript:function htmlreplace(a,b,element){if(!element)element=document.body;var nodes=element.childNodes;for(var n=0;n<nodes.length;n++){if(nodes[n].nodeType==Node.TEXT_NODE){nodes[n].textContent=nodes[n].textContent.replace(new RegExp(a,'gi'),b);}else{htmlreplace(a,b,nodes[n]);}}}htmlreplace('IFTTT','');
@kazad
kazad / fourier.html
Created June 25, 2014 19:00
BetterExplained Fourier Example
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
<!--
TODO:
@zcshiner
zcshiner / UbuntuMiner
Last active March 11, 2019 11:56
UbuntuMiner. Command list to build an Ubuntu 14.04 Server with Cuda Toolkit 6.5, driver 352.41, and ccminer.
#!/bin/bash
### Command log to install Cuda Toolkit 6.5, driver 343.22, and ccminer.
## Update the system
sudo apt-get update && sudo apt-get -y dist-upgrade
# All the dependencies for Cuda & ccminer (I think)
sudo apt-get -y install gcc g++ build-essential automake linux-headers-$(uname -r) git gawk libcurl4-openssl-dev libjansson-dev xorg libc++-dev libgmp-dev python-dev
@jetsonhacks
jetsonhacks / Install LT4 21.1.md
Last active January 26, 2024 16:59
Install LT4 21.1 on Jetson TK1

For best results, you should read through the official NVIDIA documentation found on:

https://developer.nvidia.com/linux-tegra-rel-21

In particular, the Quick Start Guide.

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04 is officially recommended. In practice, this may be a virtual machine, I have used VirtualBox in the past. Also, I've successfully flashed from Ubuntu Linux 14.04. Your mileage may vary.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply
@jetsonhacks
jetsonhacks / installCUDA65.sh
Last active April 1, 2020 18:51
Fresh install CUDA 6.5 on NVIDIA Jetson TK1 Development Kit
#!/bin/sh
# Fresh install for CUDA 6.5 on Jetson TK1 for Linux for Tegra (L4T) 21.1
# CUDA 6.5 REQUIRES L4T 21.1 !!!
sudo apt-add-repository universe
sudo apt-get update
# This is for L4T r21.1 ; Update for your L4T i.e. r21.3
wget http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda-repo-l4t-r21.1-6-5-prod_6.5-14_armhf.deb
# Install the CUDA repo metadata that you downloaded
# This is for L4T 21.1 ; Update for your L4T i.e. 21.3
@jetsonhacks
jetsonhacks / installCaffe.sh
Last active July 10, 2020 04:09
Install Caffe on NVIDIA Jetson TK1 LT4 21.2 - CUDA 6.5
#!/bin/sh
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
libboost-dev cmake libleveldb-dev libsnappy-dev \
libboost-thread-dev libboost-system-dev \
libatlas-base-dev libhdf5-serial-dev libgflags-dev \
libgoogle-glog-dev liblmdb-dev -y
@rshowcase
rshowcase / fm
Last active November 20, 2023 13:35
Fama-MacBeth Entire Procedure
# In my portfolio, I show how the popular Fama-MacBeth (1973) procedure is constructed in R.
# The procedure is used to estimate risk premia and determine the validity of asset pricing models.
# Google shows that the original paper has currently over 9000 citations (Mar 2015), making the methodology one of the most
# influential papers in asset pricing studies. It's used by thousands of finance students each year, but I'm unable to find a
# complete description of it from the web.
#
# While the methodology is not statistically too complex (although the different standard errors can get complex),
# it can pose some serious data management challenges to students and researchers.
#
# The goal of the methodology is to estimate risk premia in the financial markets. While newer, more sophisticated methods for