start new:
tmux
start new with session name:
tmux new -s myname
| """ Module to compute projections on the positive simplex or the L1-ball | |
| A positive simplex is a set X = { \mathbf{x} | \sum_i x_i = s, x_i \geq 0 } | |
| The (unit) L1-ball is the set X = { \mathbf{x} | || x ||_1 \leq 1 } | |
| Adrien Gaidon - INRIA - 2011 | |
| """ | |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| 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 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| import scala.collection.mutable | |
| /** | |
| * Bounded priority queue trait that is intended to be mixed into instances of | |
| * scala.collection.mutable.PriorityQueue. By default PriorityQueue instances in | |
| * Scala are unbounded. This trait modifies the original PriorityQueue's | |
| * enqueue methods such that we only retain the top K elements. | |
| * The top K elements are defined by an implicit Ordering[A]. | |
| * @author Ryan LeCompte ([email protected]) | |
| */ |
| #!/usr/bin/R | |
| # Functions for R and ggplot2 to create log-scale density plots | |
| # Main function: density.log(...) | |
| # Produce a dataframe used to produce a density plot | |
| # Input: | |
| # data: dataframe, | |
| # var: variable to plot on y-axis | |
| # split: factor to split on |
| # This script installs everything you need on an EC2 GPU Instance | |
| # Create an Ubuntu 12.04 GPU Instance with at least 16GB of free space | |
| # Base packages | |
| sudo apt-get update | |
| sudo apt-get install build-essential | |
| sudo apt-get install gcc git cmake | |
| # CUDA/Nvidia installations | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.0-37_amd64.deb |
| # install general deps | |
| sudo yum groupinstall "Development Tools" | |
| sudo yum install wget unzip | |
| # install java | |
| cd /opt/ | |
| sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz" | |
| sudo tar xzf jdk-8u60-linux-x64.tar.gz | |
| cd /opt/jdk1.8.0_60/ |
| ## helper and setup functions | |
| wrap_party_df <- function(func) { | |
| function(x, object, ...) { | |
| n <- col_name(substitute(object)) | |
| # have to create an expression since we cannot rely on local | |
| # variables | |
| args <- list(...) | |
| expr <- substitute(do.call(func, c(list(.[[colname]][[1]]), args)), |
| find . -exec ls -dl \{\} \; | grep ".*\.py" | awk '{print $9}' | xargs 2to3 -w |