This file contains hidden or 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
# modeling this ridiculous healthcare proposal | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def healthcare(steps=11, initial_cost=2500000., mean_increase=6., sd_increase=2.): | |
# stash initial values | |
cost = initial_cost | |
uo_cost = cost*0.95 | |
increase_pct = 0. |
This file contains hidden or 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
library(googlesheets) | |
library(tidyverse) | |
# get spreadsheet key | |
#sheet_key <- extract_key_from_url("https://docs.google.com/spreadsheets/d/e/2PACX-1vRyiiW8T0JFOnycEhQM6WaoUgcA_5xpO5xe-x0ifhI38XfmOpAuUvbtMCw8Lg6CuX5W--wbh0XFk9KU/pubhtml") | |
# stash so it dont crash during class | |
sheet_key <- "1TbkdZ_FSdf-PBqPwNBFcEVCANVgb1xgXv70GhqjmWrk" | |
# download sheet | |
emotions_raw <- gs_key(sheet_key) %>% gs_read() |
This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup as bs | |
from tqdm import tqdm | |
import json | |
import os | |
import tables | |
import numpy as np | |
import pdb | |
import traceback |
This file contains hidden or 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
[ | |
"Dear Colleagues, Universities today face headwinds from a multitude of sources. In the political sphere, one party castigates us for being ideologically unbalanced and intolerant of free speech and the other for being unaffordable and elitist. Trust in universities is battered by a deluge of criticism and well-publicized scandals involving sexual violence, administrative misfeasance, and admissions improprieties. Political support has diminished with public trust. Many public universities, including the University of Oregon, never recovered from the 2008 recession in terms of state funding. Underfunded pension plans, skyrocketing health-care costs, and skepticism about our mission and operation have created tremendous pressure on our twin missions of education and research. Despite these challenges, I am incredibly optimistic about the future of higher education, generally, and at the University of Oregon, in particular. I know some of you will read this, roll your eyes, and think to yourself, \u201cHe g |
This file contains hidden or 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
library(psych) | |
library(ggplot2) | |
library(plyr) | |
library(lme4) | |
library(lmerTest) | |
n_sims <- 1000 | |
sims <- expand.grid( | |
i_sim = seq(n_sims), |
This file contains hidden or 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
library(rvest) | |
library(dplyr) | |
library(stringr) | |
m200 <- read_html("http://www.alltime-athletics.com/m_100ok.htm") | |
m2_table <- m200 %>% | |
html_nodes("body > center:nth-child(8) > pre") | |
# make list of rows, split by newline character |
This file contains hidden or 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
<scheme name="Peacocks In Space Contrast (rainglow)" version="142" parent_scheme="Darcula"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<metaInfo> | |
<property name="created">2019-01-03T19:28:35</property> | |
<property name="ide">PyCharmCore</property> | |
<property name="ideVersion">2018.2.0.0</property> | |
<property name="modified">2019-01-03T19:28:43</property> | |
<property name="originalScheme">_@user_Peacocks In Space Contrast (rainglow)</property> | |
</metaInfo> | |
<option name="LINE_SPACING" value="1.4" /> |
This file contains hidden or 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
# renamed files to 'vid.avi' and 'points.csv' | |
# deleted first row of points.csv | |
# call this and use -p 'y'/'n', -r 'y'/'n' to control playing and rendering the video | |
# or do ./elliot_pupil.py --help | |
# you could comment out the skvideo and tqdm imports and objects if ya don't want to install/render. | |
import cv2 | |
import pandas as pd | |
import numpy as np |
This file contains hidden or 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
library(ggplot2) | |
jobs <- data.frame(start=c(2000, 2006, 2008, 2009, 2014), | |
end =c(2005, 2009, 2010, 2015, 2015), | |
idx = rev(seq(5)), | |
name =as.ordered(c("job a", 'job b', 'job c', 'job d', 'job e'))) | |
g.job <- ggplot(jobs)+ | |
geom_rect(aes(xmin=start, xmax=end, ymin=idx, ymax=idx+1, fill=name))+ | |
scale_fill_grey(start=0, end=0.8)+ |
This file contains hidden or 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
# a more or less line-for-line transcription of the source available here: | |
# https://docs.google.com/open?id=0B10RxHxW3I92dG9SU0pNMV84alk | |
# which is described in this paper: | |
# http://ieeexplore.ieee.org/document/6166585/ | |
# D. K. Prasad, C. Quek, M. K. H. Leung and S. Y. Cho, "A parameter independent line fitting method," The First Asian Conference on Pattern Recognition, Beijing, 2011, pp. 441-445. | |
# doi: 10.1109/ACPR.2011.6166585 | |
# | |
# | |
# Operation is pretty simple, just pass an **ordered** Nx2 array of x/y coordinates, get line segments. | |
# A convenience ordering function is provided free of charge ;) |