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
blockprint_training_dim1 <- function(rel, inc, boundary = 50) { | |
# right now this assumes rel = rotation and inc = spacing | |
isafep <- function(x) x < boundary # check if fep | |
isfep <- isafep(rel) # are we a fep? | |
cat("\t{\n") # begin block | |
cat("\t\tstimulus: gabgen(", rel,", ", inc, ")\n", sep = "") # code for generation | |
key_answer_val <- ifelse(isfep, 70, 78) # fep (f) if it's less than 50, n if more | |
cat("\t\tkey_answer: ", key_answer_val, "\n", sep = "") # which button is good? | |
text_to_use_correct <- ifelse(isfep, "fep_correct_text", "notfep_correct_text") |
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
(defn editor [text] | |
(let [dom-node (r/atom nil)] | |
(r/create-class | |
{:component-did-update | |
;; this is the draw code plus the update code | |
(fn [this old-argv] | |
(let [editor (js/SimpleMDE. | |
(clj->js | |
{:autofocus true | |
:spellChecker true |
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
(defn ignore-trailing-slash | |
"Modifies the request uri before calling the handler. | |
Removes a single trailing slash from the end of the uri if present. | |
Useful for handling optional trailing slashes until Compojure's route matching syntax supports regex. | |
Adapted from http://stackoverflow.com/questions/8380468/compojure-regex-for-matching-a-trailing-slash" | |
[handler] | |
(fn [request] | |
(let [uri (:uri request)] | |
(handler (assoc request :uri (if (and (not (= "/" uri)) |
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
is <- 12/2 # in units on the drawn grid, NOT pixels | |
relvals <- c(9, 25, 41, 59, 75, 91) | |
incvals <- c(9, 25, 41, 59, 75, 91) | |
imagelist <- list() | |
# loop through and make list of grobs using both | |
for (r in relvals) { | |
for (i in incvals) { | |
strvals <- paste("/Users/jtth/diss/RFCs/", r, "-", i, ".png", sep = "") | |
grob <- rasterGrob(readPNG(strvals), interpolate = FALSE) | |
v <- list(img = grob, x = r, y = i) |
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
(defn maketimestamp | |
"makes iso8601 timestamp manually | |
(works pre java 8) | |
from https://stackoverflow.com/questions/3914404/how-to-get-current-moment-in-iso-8601-format-with-date-hour-and-minute" | |
[] | |
(let [tz (java.util.TimeZone/getTimeZone "UTC") | |
df (new java.text.SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss'Z'")] | |
(.setTimeZone df tz) | |
(.format df (new java.util.Date)))) |
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 "rubygems" | |
require "twitter" | |
# get these from apps.twitter.com | |
CONSUMER_KEY = "foo" | |
CONSUMER_SECRET = "bar" | |
OAUTH_TOKEN = "blee" | |
OAUTH_TOKEN_SECRET = "baz" | |
TWITTER_USER = "your_username" # needs to be the one associated with keys above |
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
% adapted from https://texblog.org/2014/05/08/template-for-latex-phd-thesis-title-page/ | |
% Fits University of Wisconsin's dissertation requirements: | |
% https://grad.wiscweb.wisc.edu/wp-content/uploads/sites/329/2017/11/new_phd_title_page.pdf | |
\begin{titlepage} | |
\thispagestyle{empty} | |
\begin{fullwidth} | |
\begin{center} | |
\centering | |
% %Thesis title | |
{\sc{\Large The Incidental Learning\\ of\\ Feature Distributions\\ in\\ Supervised Classification\par}} |
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
const findPath = (targetNode, startNode = startWord, graph = wordlist ) => { | |
// source: https://books.google.com/books?id=GSBKDwAAQBAJ&pg=PA187&lpg=PA187&dq=bfs+lodash&source=bl&ots=FmkF1thzTu&sig=XjRtFH5vZH-mSRfIYowlwDdtIzM&hl=en&sa=X&ved=2ahUKEwjol-HZwbXdAhUDNd8KHW81Ao8Q6AEwCHoECAIQAQ#v=onepage&q=bfs%20lodash&f=false | |
// initialize the path to traverse | |
let travelledPath = []; | |
// mark the nodes that need to be visited breadthwise | |
let nodesToVisit = []; | |
// mark all visited nodes |
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-buff_t-fuchsia": [ | |
"p-chestnut_a-buff_t-fuchsia", | |
"t-fuchsia_a-buff_t-fuchsia", | |
"s-limegreen_a-buff_t-fuchsia", | |
"a-buff_p-chestnut_t-fuchsia", | |
"a-buff_s-lilac", | |
"i-darkpink_t-fuchsia" | |
], | |
"i-darkpink_t-fuchsia": [ |
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
function gaborgenhelper(tilt, freq, title, sc, reso, phase, contrast, aspectratio) | |
if nargin < 4 | |
reso = 400; | |
phase = 0; | |
sc = 50.0; | |
%freq = .07; | |
%tilt = 0; | |
contrast = 100.0; | |
aspectratio = 1.0; |