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
#!/usr/bin/python | |
# A script to automate changelog generation from Git commit messages | |
# | |
# For use with a git-flow workflow, it will take changes from the last tagged release | |
# where commit messages contain NEW, FIXED, and IMPROVED keywords and sort and fromat | |
# them into a Markdown release note list. | |
# | |
# Forked from https://gist.github.com/ttscoff/17fbce4f229609082b45681bba7a9967 |
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
from datetime import datetime | |
from os import path | |
from time import sleep | |
from urllib import parse | |
import redis | |
from celery.task.control import inspect | |
from django.conf import settings | |
redis_urlparts = parse.urlparse(settings.CELERY_BROKER_URL) |
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
from datetime import datetime | |
from os import path | |
from time import sleep | |
from urllib import parse | |
import redis | |
from celery.task.control import inspect | |
from django.conf import settings | |
redis_urlparts = parse.urlparse(settings.CELERY_BROKER_URL) |
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
UPDATE RFID.dbo.rfid_active_assignment2 | |
SET LS_Size = Size | |
FROM | |
Routeman.dbo.ContractLine AS cl | |
JOIN RFID.dbo.rfid_active_assignment2 as asgn | |
ON asgn.LS_ContractNumber = cl.ContractNumber | |
AND asgn.LS_ContractLineNumber_smInt = cl.LineNumber |
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
calc_indexes <- function(n_rows, n_cols){ | |
index <- 0:(n_rows * n_cols - 1) | |
row_0 <- floor(index / n_cols) | |
list( | |
row = row_0 + 1, | |
col = index - (row_0 * n_cols) + 1 | |
) | |
} | |
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
library(combinat) | |
library(plyr) | |
run_simulation <- function(c_size, t_size, c_mean, t_mean){ | |
### Generate and Combine data | |
control <- rnorm(c_size, c_mean, 1) | |
treatment <- rnorm(t_size,t_mean, 1) | |
group_labels <- c(rep("control", length(control)), | |
rep("treatment", length(treatment))) |
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
library(combinat) | |
library(plyr) | |
library(doMC) | |
doMC::registerDoMC(cores=8) | |
grads <- read.csv("GradCleanup.csv") | |
# Subset data to look at only three years (5!)^3 permutations | |
grads <- subset(grads, Cohort > 2003) | |
# Block by Cohort, group by Borough |
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
library(combinat) | |
library(plyr) | |
# Generate data | |
borough <- c(rep("Bronx",6), rep("Manhattan",6)) | |
year <- rep(2001:2006,2) | |
gradrate <- runif(12,.5,1) | |
data <- data.frame(borough,year,gradrate) | |
grads <- read.csv("GradCleanup.csv") |
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
DROP TABLE IF EXISTS child; | |
DROP TABLE IF EXISTS parent; | |
CREATE TABLE parent (id INT NULL, -- NOTE THE ALLOW NULL | |
name text, | |
PRIMARY KEY (id) | |
) ENGINE=INNODB; | |
insert into parent(id, name) values (NULL, "UNKOWN"); -- FAILS because of primary key | |
insert into parent(id, name) values (1,"BOB"); | |
CREATE TABLE child (id INT NULL, |
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
# Package to connect to MySQL from | |
# install.packages("RMySQL") | |
library("RMySQL") | |
# MySQL authentication credentials | |
# Get these from Jacob Moody or CSR | |
dbuser <- "" | |
dbpassword <- "" | |
dbhost <- "statmm.byu.edu" | |
dbport <- 3306 |
NewerOlder