Skip to content

Instantly share code, notes, and snippets.

@philkuz
philkuz / histogram.py
Created October 14, 2015 19:41
The histogram overlay
#=============EXAMPLE===============
def compare(t, conditions, values):
"""Overlay histograms of values for two conditions."""
t['count'] = 1
e = t.pivot(conditions, values, 'count', sum)
for label in e.column_labels[1:]:
e[label] = e[label]/sum(e[label]) # Normalize each column of counts
e.hist(counts=values, normed=True, overlay=True)
compare(couples, 'mar_status', 'age')
if [ "$#" -ne 1 ]; then
echo "Usage: autograder <email>"
exit 1
fi
EMAIL=$1
echo $EMAIL | java editorTester.AGInitialCursorTest gradescope
echo $EMAIL | java editorTester.AGSimpleTextTest gradescope
echo $EMAIL | java editorTester.AGBackspaceTest gradescope
echo $EMAIL | java editorTester.AGArrowKeyTest gradescope
echo $EMAIL | java editorTester.AGNewlineTest gradescope
@philkuz
philkuz / classify.ino
Created April 19, 2016 06:38
Classify for the MSP430 project SIXT33N
/* classify.ino
** Processing Integration sketch for SIXT33N Music version
**
** EE16B Spring 2016
** Emily Naviasky & Nathaniel Mailoa
**
*/
#include "./fix_fft.c"
#define MIC_INPUT P6_0
@philkuz
philkuz / projectmang.sh
Created June 8, 2016 21:27
Manages a current project as a script
# Function that sets the current project
function set-project() {
if [ $# -ne 1 ]; then
echo "command should be formatted as 'set-project <project-dir>'"
exit 1
fi
if [ "$1" = "." ]; then
dir=$(pwd)
else
dir="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
@philkuz
philkuz / .gitattributes
Created August 23, 2016 03:50
Filter out python notebooks
*.ipynb filter=dropoutput_ipynb
@philkuz
philkuz / Dockerfile
Created August 24, 2016 00:20
Ruby on Rails dockerfile
FROM ruby:2.3
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
COPY Gemfile* ./
RUN bundle install
@philkuz
philkuz / mlbootcamp.ipynb
Created August 24, 2016 22:29
Data Transformation Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Phillip Kuznetsov

sexy-phil

I am cool. Do you like my picture?

#!/usr/bin/env bash
#Code adapted from https://gist.github.com/rashmibanthia/5a1e4d7e313d6832f2ff (Removed Anaconda install for those servers that have it installed)
jupyter notebook --generate-config
key=$(python -c "from notebook.auth import passwd; print(passwd())")
cd ~
mkdir certs
cd certs
input: "feat"
input_shape {
dim: 1
dim: 4096
}
force_backward: true
layer {
name: "defc7"
type: "InnerProduct"
bottom: "feat"