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
main.table <- data.frame(Results = c("Exclusion", "Identification"), `Same Source` = c("Missed Identification", "Correct Identification"), `Different Source` = c("Correct Exclusion", "Wrong Identification")) | |
names(main.table) <- c("", "Same Source", "Different Source") | |
blank <- textGrob("") | |
gt <- textGrob("Ground Truth", gp = gpar(fontsize = 14, fontface = "bold")) | |
res <- textGrob("Results", rot = 90, gp = gpar(fontsize = 14, fontface = "bold")) | |
mt <- tableGrob(main.table, rows = NULL, theme = ttheme_default()) | |
layout.matrix <- matrix(c(1, 1, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4, 4), nrow = 4, byrow = T) |
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
shinyApp(ui = fluidPage(textOutput("pwd")), | |
server = function(input, output) { | |
output$pwd <- renderText(list.files(here::here())) | |
}) |
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
shinyApp(ui = fluidPage(textOutput("con"), textOutput("fileexists")), | |
server = function(input, output) { | |
output$con <- renderPrint(con) | |
output$fileexists <- renderPrint(list.files(here::here())) | |
}) |
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(RSelenium) | |
library(rvest) | |
library(tidyverse) | |
# Newer versions of Selenium don't work that well... | |
rs_driver <- rsDriver(port = 4567L, version = "3.12.0") | |
rd <- rs_driver$client | |
rd$setImplicitWaitTimeout(milliseconds = 5000) | |
url <- function(m, y) sprintf("https://www.timeanddate.com/weather/@4846834/historic?month=%d&year=%d", m, y) |
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
#!/bin/bash | |
for i in *.stl; | |
do T=__tmp__$i; | |
b=`basename $i`; | |
echo import\(\"$i\"\)\; | |
>$T; | |
openscad -o $b.png --render --colorscheme=Nature --camera0,0,0,30,-30,0 --imgsize=600,600 --projection=o $T; | |
rm $T; | |
done |
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(reticulate) | |
library(tidyverse) | |
library(stringr) | |
library(imager) | |
main <- import_main() | |
cv2 <- import("cv2", as = "cv2") | |
source_python("./inst/HoughLines.py") | |
chunk_edges <- list.files("inst/processed/slices/", pattern = "_edge", full.names = T) |
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
#!/bin/bash | |
# This uses GNU parallel: cite: | |
# @article{Tange2011a, | |
# title = {GNU Parallel - The Command-Line Power Tool}, | |
# author = {O. Tange}, | |
# address = {Frederiksberg, Denmark}, | |
# journal = {;login: The USENIX Magazine}, | |
# month = {Feb}, | |
# number = {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
#!/usr/bin/Rscript | |
# Scrape Southwest Power Pool LMP/SMP/MCC | |
library(scrapeR) | |
library(stringr) | |
library(lubridate) | |
library(ggplot2) | |
library(RMySQL) | |
library(plyr) | |
library(reshape2) |
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
# Bunch and Murphy simulation | |
library(tidyverse) | |
# Packet 1 contains 10 fires from the same weapon | |
# Packet 2 contains 1 from each of the other 9 glocks, plus one non-glock | |
# Packets 3-8 contain | |
# - 0, 1, or 2 non-glocks | |
# - 10, 9, or 8 randomly sampled from each of the other glocks | |
# After packet 2 is assembled, then, the following cartridges remain: |
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
# This processes figures for STAT guidelines... | |
library(tidyverse) | |
library(stringr) | |
# --- Pull out all figure captions and reference names --- | |
chunks <- readLines("index.tex") | |
figures_start <- which(str_detect(chunks, "\\\\begin.figure.")) | |
figures_end <- which(str_detect(chunks, "\\\\end.figure.")) |