I hereby claim:
- I am mllg on github.
- I am mllg (https://keybase.io/mllg) on keybase.
- I have a public key ASAKJ2pkEz2CwPVYtKUwg058WRnAzXymECuaqIICnEWofQo
To claim this, I am signing this object:
function Tmpwatch(path, days) | |
let l:path = expand(a:path) | |
if isdirectory(l:path) | |
for file in split(globpath(l:path, "*"), "\n") | |
if localtime() > getftime(file) + 86400 * a:days && delete(file) != 0 | |
echo "Tmpwatch(): Error deleting '" . file . "'" | |
endif | |
endfor | |
else | |
echo "Tmpwatch(): Directory '" . l:path . "' not found" |
lpt = function(x, ncpus = 1L) { | |
checkmate::assert_numeric(x, min.len = 1L, lower = 0, any.missing = FALSE, finite = TRUE) | |
checkmate::assert_count(ncpus, positive = TRUE) | |
bin = integer(length(x)) | |
tta = double(ncpus) | |
for (xi in order(x, decreasing = TRUE)) { | |
i = which.min(tta) | |
bin[xi] = i |
#!/usr/bin/env Rscript | |
libs = c("libopenblas", "libicu") | |
packages = character() | |
patterns = sprintf("^%s.* => not found$", libs) | |
for (lib in .libPaths()) { | |
files = list.files(path = lib, pattern = "\\.so(\\.[0-9]+)*$", recursive = TRUE, | |
ignore.case = TRUE, full.names = TRUE, no.. = TRUE) |
#!/usr/bin/env Rscript | |
# Small R shebang script (useable from a shell) to convert R markdown files into HTML or PDF format | |
# using the knitr package. | |
# | |
# Place this file in a directory in your $PATH or create an alias to it, e.g. in your '.bashrc': | |
# alias knit='/path/to/script' | |
# alias knit2html='/path/to/script --html' | |
# alias knit2pdf='/path/to/script --pdf' | |
# |
I hereby claim:
To claim this, I am signing this object:
Index: src/library/parallel/R/unix/mcparallel.R | |
=================================================================== | |
--- src/library/parallel/R/unix/mcparallel.R (Revision 71169) | |
+++ src/library/parallel/R/unix/mcparallel.R (Arbeitskopie) | |
@@ -52,24 +52,26 @@ | |
if (missing(jobs)) jobs <- children() | |
if (!length(jobs)) return (NULL) | |
if (isTRUE(intermediate)) intermediate <- utils::str | |
+ pids <- if (inherits(jobs, "process") || is.list(jobs)) | |
+ processID(jobs) else jobs |
library(microbenchmark) | |
library(compiler) | |
library(ggplot2) | |
library(checkmate) | |
library(assertive) | |
library(assertthat) | |
bench = function(x, funs, repeats = 100) { | |
force(x) | |
microbenchmark(times = repeats, |
cart_iter = function(li) { | |
nextState = function(state, pos = 1L) { | |
if (state[pos] < state.last[pos]) | |
replace(state, pos, state[pos] + 1L) | |
else | |
nextState(replace(state, pos, 1L), pos + 1L) | |
} | |
nextElem = function() { | |
state <<- nextState(state) |
tryCatchDebug = function(expr) { | |
handler_warning = function(w) { | |
cache.warnings <<- c(cache.warnings, w) | |
invokeRestart("muffleWarning") | |
} | |
handler_error = function(e) { | |
catched.error <<- TRUE | |
dump.frames(".lastDump") | |
dumped = get(".lastDump", envir = .GlobalEnv) |
library(randomForest) | |
data(iris) | |
mydata = iris | |
############################################################################### | |
### sequential | |
############################################################################### | |
randomForest(Species ~ ., data = mydata, ntree = 1000) |