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
require(stats) | |
require(ggplot2) | |
# Download your last.fm history as a .csv from here: | |
# https://benjaminbenben.com/lastfm-to-csv/ | |
# load 'em | |
lfmdat <- read.csv('~/lastfm.csv', header = FALSE) | |
names(lfmdat) <- c("artist", "album", "song", "time") |
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
## in model.load_model: | |
# add import | |
from .utils.io_utils import ask_to_proceed_with_overwrite, update_config | |
# At 225 add a version check and call an updating function | |
model_config = json.loads(model_config.decode('utf-8')) | |
k_version = float(f.attrs.get('keras_version')[0]) | |
if k_version < 2: | |
# Have to rename params to load old models |
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 os | |
import pandas as pd | |
import numpy as np | |
from itertools import cycle | |
from tqdm import tqdm | |
from multiprocessing import Pool | |
import time | |
def concat_sport(sport, i): | |
sport_files = [s for s in files if s.startswith(sport)] |
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
# this should let ya surf the line. | |
# take edge coordinates (1 px thick) and reorder | |
# so first-last goes from one end of the line to the other | |
import numpy as np | |
from skimage import morphology | |
from scipy.spatial import distance | |
from collections import deque as dq | |
def order_edges(edges): |
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 ;) |
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
# 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
<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
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
library(psych) | |
library(ggplot2) | |
library(plyr) | |
library(lme4) | |
library(lmerTest) | |
n_sims <- 1000 | |
sims <- expand.grid( | |
i_sim = seq(n_sims), |
OlderNewer