#!/usr/bin/env bash
# I did this with OS X Yosemite 10.10.5 in May 2016
# Adding some changes from original
# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
sns.set_style('darkgrid') | |
from matplotlib.colors import ListedColormap | |
# Enter hex values of desired colors | |
color_map = ListedColormap(['#00bfff', '#ff8000']) | |
x = np.linspace(0, 2*np.pi, 100) | |
for i in range(2): | |
plt.plot(x, np.sin(x+np.pi/2*i), c=color_map.colors[i], lw=5, alpha=0.7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
___________________________________ | |
TO MAKE CAFFE (NOT FROM SCRATCH) | |
make all -j2; make pycaffe -j2 | |
make distribute | |
export PYTHONPATH="/Users/kristinhebert/Documents/GitClones/caffe/distribute/python:$PYTHONPATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
plt.xkcd() | |
ax = plt.subplot(111) | |
x = np.linspace(0,4*np.pi,100) | |
ax.plot(x, np.sin(x)/x) | |
ax.annotate('Hell ya!', xy=(2, 0.5), xytext=(6, 0.7), | |
xycoords='data', textcoords='data', ha='right', va='bottom', | |
arrowprops=dict(arrowstyle='->', lw=2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
see all available commands: | |
git | |
grab a repository from git: | |
git clone ___url___ | |
> COMMANDS FOR MAKING NEW GIT REPOSITORY | |
git init | |
git add -A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Functions" | |
--- | |
1. __What are the three components of a function?__ | |
* Envionment, arguments, and body. | |
```{r} | |
e <- new.env() | |
e$body <- print("Schrodinger's cat") | |
e$a <- function(argument){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
__author__ = 'Alex Galea' | |
""" | |
* No longer maintained * | |
See here for newer versions: https://github.com/agalea91/photo-batch-resize | |
""" | |
# Usage e.g. | |
# python photo-batch-resize-constrained.py --images-folder=lightroom-exports --max-px-size=1080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Miscellaneous tips for using R | |
# Select a set of columns from a dataframe | |
wage_red = wage %>% select(-sibs, -brthord, -meduc, -feduc) | |
wage_subset = wage %>% select(hours, lwage) | |
# Use q + dist type to get confidence interval | |
beta_iq_mean = summary(lm.wage_1)$coefficients[2] | |
beta_iq_std = summary(lm.wage_1)$coefficients[4] | |
qt(p = c(0.025, 0.975), df = 933)*beta_iq_std + beta_iq_mean # t = student-t dist., can also use e.g. qnorm |
OlderNewer