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
get.clip <- function(header = TRUE, stringsAsFactors = FALSE, ...) { | |
read.table(pipe("pbpaste"), sep = "\t", header = header, stringsAsFactors = stringsAsFactors, ...) | |
} |
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
# via http://www.enoriver.net/2015/02/09/r-version-of-tsfill-and-xfill-combined/ | |
xtill <- function(x) { | |
dt <- copy(x) | |
xtkeys <- c('zip.cd','cal.dt') | |
clkeys <- c('zip.cd','dma.cd') | |
xtfull <- CJ(unique(x[,zip.cd]),unique(x[,cal.dt])) | |
clfull <- unique(subset(x,select=c(zip.cd,dma.cd))) | |
setnames(xtfull,c('V1','V2'),xtkeys) | |
setkeyv(xtfull,xtkeys) |
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
painting | color_1 | color_2 | color_3 | color_4 | color_5 | |
---|---|---|---|---|---|---|
Adobe (Variant): Luminous Day by Josef Albers | #D77186 | #61A2DA | #6CB7DA | #b5b5b3 | #D75725 | |
Homage to the Square (La Tehuana) by Josef Albers | #C00559 | #DE1F6C | #F3A20D | #F07A13 | #DE6716 | |
Rainbow by Billy Apple | #F24D98 | #813B7C | #59D044 | #F3A002 | #F2F44D | |
Spar by Per Arnoldi | #C2151B | #2021A0 | #3547B3 | #E2C43F | #E0DCDD | |
Bicycle Rider By The Loire by Milton Avery | #F3C937 | #7B533E | #BFA588 | #604847 | #552723 | |
Cello Player by Milton Avery | #E2CACD | #2E7CA8 | #F1C061 | #DA7338 | #741D13 | |
The Swan by Hilma af Klint | #D6CFC4 | #466CA6 | #D1AE45 | #87240E | #040204 | |
Untitled (Black King Catch Scorpio) by Jean-Michel Basquiat | #8CABD9 | #F6A7B8 | #F1EC7A | #1D4D9F | #F08838 | |
DUSTHEADS by Jean-Michel Basquiat | #C11432 | #009ADA | #66A64F | #FDD10A | #070707 |
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
# VBR (with loop) | |
for f in *.wav; do lame --ti "path/to/file/album_art.jpg" --vbr-new -V 3 "$f" "${f%.wav}.mp3"; done | |
# Non-VBR (no loop) | |
lame --ti "path/to/file/album_art.jpg" -h -b "wavfile.wav" "mp3file.mp3" |
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
# Install ffmpeg with the right codec | |
brew install ffmpeg --with-fdk-aac | |
# Actual loop | |
for i in *flac;do of="${i/.flac/.m4a}"; ffmpeg -i "${i}" -c:a libfdk_aac -b:a 320k "${of}";done | |
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
# http://stats.stackexchange.com/questions/66757/random-forest-vs-regression | |
beta <- runif(5) | |
x <- matrix(rnorm(500), nc=5) | |
y <- drop(x %*% beta) | |
dat <- data.frame(y=y, x1=x[,1], x2=x[,2], x3=x[,3], x4=x[,4], x5=x[,5]) | |
model1 <- lm(y~., data=dat) | |
model2 <- randomForest(y ~., data=dat) | |
pred1 <- predict(model1 ,dat) | |
pred2 <- predict(model2 ,dat) |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 1, | |
"caret_extra_top": 1, | |
"caret_extra_width": 1, | |
"caret_style": "blink", | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", | |
"fade_fold_buttons": false, | |
"font_face": "Source Code Pro", |
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(a, b) { | |
equality.test <- (a == b) | |
equality.test[is.na(a) & is.na(b)] <- TRUE | |
equality.test[is.na(equality.test)] <- FALSE | |
return(equality.test) | |
} |
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
* Two-sample comparison of mean1 to mean2. Compute sample sizes with n2/n1 = 2: | |
sampsi 132.86 127.44, p(0.8) r(2) sd1(15.34) sd2(18.23) | |
power twomeans 132.86 127.44, p(0.8) nratio(2) sd1(15.34) sd2(18.23) |
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
awk 'NR%20==1 { file = FILENAME "_" sprintf("%04d", NR+19) } { print > file }' domains.xml |