Skip to content

Instantly share code, notes, and snippets.

Avatar

Russell Reas rreas

  • Seattle, WA
View GitHub Profile
@rreas
rreas / readme.txt
Created Oct 27, 2015
Notes on Clover install
View readme.txt
http://sourceforge.net/projects/cloverefiboot/
To prevent freezing on changing MTU from 0 to 1500 on boot.
http://sourceforge.net/projects/osx86drivers/files/Kext/Snow_or_Above/
Needed drivers/kexts:
1. AptioFix
2. Video resolution fix (cpumem?)
2. Latest Intel driver (E1000e) http://sourceforge.net/projects/osx86drivers/files/Kext/Snow_or_Above/
@rreas
rreas / nginx.conf
Created Mar 17, 2015
Simple API + UI nginx configuration for development
View nginx.conf
#user nobody;
daemon off;
worker_processes 1;
events {
worker_connections 256;
}
http {
include mime.types;
View .tmux.conf
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# default command - use zsh shell
set-option -g default-command "reattach-to-user-namespace -l zsh"
@rreas
rreas / .vimrc
Last active Aug 29, 2015
Monolithic .vimrc
View .vimrc
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
@rreas
rreas / list.md
Last active Aug 29, 2017
Computer Science & Web Development Reading List
View list.md

Discrete mathematics

To really understand data structures and algorithmic complexity, you need to understand discrete math. This the best starting point for CS theory. I love discrete math, others may find it very boring.

  • Essentials of Discrete Mathematics (Hunter)

Data structures

I can't think of a good data structures reading off the top of my head unfortunately. Often the trick to an efficient algorithm is really just an efficient data structure. Check out Dijkstra's algorithm for a great example of this (BFS + min-heap/priority queue).

@rreas
rreas / als.m
Created Jun 6, 2012
Regularized Alternating Least Squares
View als.m
function [U,V] = als(X,k,tol,imax,lambda)
[d,n] = size(X);
U = rand(k,d);
V = rand(k,n);
I = eye(k);
% convergence monitors.
olderr = 0;
@rreas
rreas / logpca.m
Created Jun 4, 2012
Logistic PCA
View logpca.m
% Adapted from the original, available online:
% http://www.andrewschein.com/software/lpca_code.tar
%
function [U,V] = logpca(X,k,tol,imax)
% ensure we have a binary matrix.
X = spones(X);
[N,D] = size(X);
U = rand(N,k);
@rreas
rreas / exppca.m
Created Jun 4, 2012
Exponential Family PCA (Poisson Distribution)
View exppca.m
function [U,V] = exppca(X,k,tol,imax)
[d,n] = size(X);
% random initialization.
U = rand(d,k);
V = rand(k,n);
I = eye(k);
% for numerical errors.
@rreas
rreas / distkmeans.m
Created Jun 2, 2012
Euclidean Distance K-Means Clustering
View distkmeans.m
function [U,V,idx] = distkmeans(X,k,tol,imax)
[d,n] = size(X);
U = zeros(d,k);
V = zeros(k,n);
% random clusters.
for j = 1:n
V(randi(k),j) = 1;
@rreas
rreas / spkmeans.m
Created Jun 2, 2012
Spherical K-Means Clustering
View spkmeans.m
function [U,V,idx] = spkmeans(X,k,tol,imax)
[d,n] = size(X);
U = zeros(d,k);
V = zeros(k,n);
% random clusters and normalize to unit sphere.
for j = 1:n
V(randi(k),j) = 1;
You can’t perform that action at this time.