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 do-on-change [func files] | |
| (let [old (atom (map-current files))] | |
| (while true | |
| (do | |
| (Thread/sleep 500) | |
| (let [current (atom (map-current files))] | |
| (println "hi") | |
| (if (hash-diff @old @current) | |
| (do | |
| (func) |
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
| test=> (Provider/) | |
| Provider/getCurrentProvider Provider/logger | |
| test=> (Provider/getCurrentProvider) | |
| CompilerException java.lang.NoSuchFieldException: getCurrentProvider, compiling:(NO_SOURCE_PATH:1:1) |
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
| keys.core=> listener | |
| #<Object$HotKeyListener$13666434 keys.core.proxy$java.lang.Object$HotKeyListener$13666434@6d7accc9> | |
| keys.core=> keys | |
| #<AWTKeyStroke shift ctrl pressed 1> | |
| keys.core=> a#<CarbonProvider com.tulskiy.keymaster.osx.CarbonProvider@44980228> | |
| keys.core=> (.register a keys listener) | |
| IllegalArgumentException No matching method found: register for class com.tulskiy.keymaster.osx.CarbonProvider clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80) | |
| Java: | |
| provider.register(KeyStroke.getKeyStroke("control shift 0"), listener); |
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
| (ns keymaster.core | |
| (:gen-class) | |
| (:use seesaw.core) | |
| (:require [keymaster.keymaster :as km])) |
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
| keymaster.core=> (clojure.core/require '[clojure.java.io :as io]) | |
| nil | |
| keymaster.core=> (clojure.core/require '[keymaster.keymaster :as km]) | |
| IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:505) |
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
| traceroute to clojurewerkz.org (5.9.20.53), 64 hops max, 52 byte packets | |
| 1 * * * | |
| 2 * *traceroute: sendto: No route to host | |
| traceroute: wrote clojurewerkz.org 52 chars, ret=-1 | |
| * | |
| traceroute: sendto: Host is down | |
| 3 traceroute: wrote clojurewerkz.org 52 chars, ret=-1 | |
| *traceroute: sendto: Host is down | |
| traceroute: wrote clojurewerkz.org 52 chars, ret=-1 | |
| *traceroute: sendto: Host is down |
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
| #Reproducible example | |
| lik <- structure(list(Relevant = structure(c(6L, 5L, 6L, 2L, 5L, 4L, 5L, 5L, 6L, 2L, 6L, 3L, 5L, 4L, 5L, 3L, 2L, 2L, 4L, NA, 2L, 6L, NA, 5L, 5L, 5L, 5L, 5L, 6L, 6L), .Label = c("0", "Agree", "Disagree", "Neutral", "Strongly Agree", "Strongly Disagree"), class = "factor"), Help.career = structure(c(3L, 5L, 6L, 2L, 5L, 2L, 5L, 5L, 6L, 2L, 6L, 3L, 5L, 4L, 3L, 2L, 2L, 2L, 2L, NA, 6L, 6L, 2L, 5L, 5L, 5L, 5L, 4L, 6L, 6L), .Label = c("0", "Agree", "Disagree", "Neutral", "Strongly Agree", "Strongly Disagree"), class = "factor"), Earn.credential = structure(c(6L, 5L, 2L, 2L, 2L, 4L, 5L, 5L, 6L, 4L, 6L, 2L, 5L, 2L, 3L, 3L, 2L, 4L, 5L, NA, 3L, 6L, NA, 6L, 3L, 4L, 4L, 6L, 6L, 2L), .Label = c("0", "Agree", "Disagree", "Neutral", "Strongly Agree", "Strongly Disagree"), class = "factor"), Prestigious.U = structure(c(6L, 5L, 2L, 2L, 2L, 4L, 5L, 2L, 6L, 3L, 6L, 4L, 5L, 4L, 3L, 3L, 2L, 4L, 2L, NA, 6L, 5L, NA, 2L, 3L, 5L, 2L, 5L, 6L, 6L), .Label = c("0", "Agree", "Disagree", "Neutral", "Strongly Agree", " |
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
| > t<-table(prec$usercat,prec$relevant.to.aca.study.Why.enroll) | |
| > f<-as.data.frame(unclass((prop.table(t,1)))) | |
| > sum(f$Agree) | |
| [1] 1.744855 | |
| > sum(f$Disagree) | |
| [1] 0.6086854 |
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
| db <- as.data.frame(lapply(db, function(x){ | |
| x <- as.character(x) | |
| replace(x, x == "0", NA) | |
| x <- as.factor(x)})) | |
| db <- as.data.frame(lapply(db, function(x){ | |
| x <- as.character(x) | |
| replace(x, x == "", NA) | |
| x <- as.factor(x)})) |
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
| replace <- list(c("Academic / Professor", "Academic/Professor"), | |
| c("Lifelong learner", "Lifelong Learner"), | |
| c("Student (University/College)", "Student")) | |
| for(e in replace) { | |
| db$usercat <- replacefact(db$usercat, e[1], e[2])} |