Skip to content

Instantly share code, notes, and snippets.

View wush978's full-sized avatar
👶
Working with my baby

Wush Wu wush978

👶
Working with my baby
View GitHub Profile
__version__: 0.2
1:
corrplot: 0.77
magrittr: 1.5
BH: 1.60.0-1
slidifyLibraries: github::repo=wush978/slidifyLibraries@066465ce5bf1aed6fc47c2b28cbd3021021b802b
praise: 1.0.0
binom: 1.1-1
labeling: 0.3
yaml: 2.1.14
@wush978
wush978 / DSR-slide.yml
Created February 8, 2017 04:10
pvm of DSR-slide
rstudioapi:
repository: CRAN
priority: .na
name: rstudioapi
version: '0.5'
base:
repository: CRAN
priority: base
name: base
version: 3.3.1
library(magrittr)
library(itertools)
library(lbfgsb3)
library(FastAUC)
sigma <- function(x) 1 / (1 + exp(-x))
log1pexp <- function(x) {
retval <- x
index <- retval < 30
retval[index] <- log1p(exp(retval[index]))
{"app":{"cat":["IAB14"],"domain":"demo.com","id":"13000001","name":"Demo_US_480x80","publisher":{"id":"100801001","name":"Demo"}},"at":2,"bcat":["IAB25-5","AND1-6","IAB25-4","IAB25-7","IAB23-1","IAB25-6","AND1-3","IAB25-1","IAB25-3","IAB25-2","IAB9-9","IAB14-4","IAB22-1","IAB14-1","IAB22-2","IAB14-2","IAB14-3","IAB23-6","IAB13-1","IAB7-45","IAB26","IAB7-44","IAB23-7","IAB7-3","IAB8-5","IAB25","IAB23-8","IAB24","IAB23-9","IAB23","IAB23-2","IAB23-3","IAB23-4","IAB8-18","IAB23-5","IAB4","IAB7-28","IAB18-2","IAB3-11","IAB19-3","IAB17-18","IAB7-31","IAB7-30","IAB7-39","IAB23-10","IAB26-3","IAB26-4","IAB26-1","IAB26-2","IAB7-41","APL8-7","IAB7-42","APL8-6","APL8-5","APL8-4"],"device":{"connectiontype":0,"devicetype":1,"dnt":0,"ifa":"874273775852857007","didsha1":"03791cf87e352da6434e4d964f54f0f64db933aa","didmd5":"68b329da9893e34099c7d8ad5cb9c940","dpidsha1":"bfc523f83fa54a19e7b2d8bdf8acd687a09fba09","dpidmd5":"223632c428784fecaaa3e2a6aaaf6d8e","geo":{"country":"USA","lat":29.8327,"lon":-95.6627,"type":1,"zip":"770
@wush978
wush978 / init-swirl.R
Last active April 9, 2017 16:39
透過80 port 來安裝R語言翻轉教室
local({
check_package <- function(pkg) {
if (!suppressWarnings(suppressMessages(require(pkg, character.only = TRUE)))) {
install.packages(pkg, repos = "http://wush978.github.io/R")
}
}
lapply(c("rappdirs", "bitops", "curl"), check_package)
utils::install.packages("swirl", repos = "http://wush978.github.io/R")
})
library(swirl)
#!/bin/bash
if [ $# -ne 1 ]; then
echo 'usage: ./mux.sh [serverlist]'
exit
fi
if [ ! -f $1 ]; then
echo "Serverlist file not found!"
echo 'usage: ./mux.sh [serverlist]'
options(repos = c(local = sprintf("file:///%s", normalizePath(choose.dir(), winslash = "/")),
CRAN = "http://cran.csie.ntu.edu.tw"))
install.packages("swirl")
swirl::install_course_zip(choose.files())
xlim <- ylim <- c(-1.2, 1.2)
q.list <- c(seq(0.2, 2, by = 0.2),
seq(2.4, 4, by = 0.4),
8, 16, 32)
out <- "minkowski.gif"
suppressMessages(saveGIF({
for(i in seq_along(q.list)) {
q <- q.list[i]
dev.hold()
plot(0, 0, type = "n", xlim = xlim, ylim = ylim,
options(repos = c(CRAN="http://cran.csie.ntu.edu.tw"))
install.packages(c("devtools", "magrittr"))
library(magrittr)
rmd <-
dir("slide", ".Rmd$", full.names = TRUE) %>%
lapply(readLines)
pkgs <-
lapply(rmd, function(txt) {
regexec("library\\(([^\\)]+)\\)", txt) %>%
regmatches(x = txt) %>%
StrToBits <- function(x) {
.x <- charToRaw(x)
.x2 <- rawToBits(.x)
paste(substring(as.character(.x2), 2, 2), collapse = "")
}