This file contains 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
#!/bin/bash | |
# Program: | |
# Check Folder $1 with R | |
./roxygenize.R $1 | |
rm -rf check | |
mkdir check | |
cp -r -H $1 check | |
cd check | |
find . -name .git -type d | xargs rm -rf | |
R CMD check --no-codoc --no-manual --no-examples --no-vignettes --no-rebuild-vignettes --check-subdirs=no --install-args=-d --install-args=--no-docs --install-args=--no-html --install-args=--no-help --install-args=--no-demo --install-args=--no-multiarch $1 |
This file contains 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
#!/bin/bash | |
# Program: | |
# Check Folder $1 with R | |
./roxygenize.R $1 | |
rm -rf install | |
mkdir install | |
cp -r -H $1 install | |
cd install | |
find . -name .git -type d | xargs rm -rf | |
R CMD INSTALL $1 |
This file contains 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
if (require(inline) && require(Rcpp)) { | |
hex2str <- cxxfunction(sig=c(Rinput="character"), plugin="Rcpp", body=' | |
int hex2bintab[] = { | |
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, | |
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, | |
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, | |
0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, | |
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, | |
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, |
This file contains 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
source("hex2str.R") | |
remove_unicode_escape <- function(src) { | |
start.set <- gregexpr("\\\\u[0-9a-fA-F]{4,4}", src, perl=FALSE, useBytes=TRUE)[[1]] | |
sub.list <- list() | |
for(start in start.set[length(start.set):1]) { | |
if (!is.null(sub.list[[substring(src, start, start+5)]])) next | |
pattern <- substring(src, first=start, last=start + 5) | |
hex <- substring(pattern, 3, 6) | |
result <- iconv(hex2str(hex), "UTF16BE", "UTF8") | |
cat(paste(hex, "-->", result, "\n")) |
This file contains 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
argv <- commandArgs(TRUE) | |
if (!length(argv)) { | |
cat("Convert Rmd to md\n") | |
cat("Usage: <input> <output>\n") | |
quit("no") | |
} | |
if (!require(knitr)) { | |
stop("knitr is required") | |
} | |
opts_knit$set(upload.fun = image_uri, animation.fun = hook_r2swf) |
This file contains 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
# * 結構說明 | |
# | |
# 群組 | |
# 規則名稱 | |
# Regex 字串 | |
# 關鍵字跟位置的對應表 | |
# | |
# match_any is a special string for resuing regex | |
--- | |
_alias: |
This file contains 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
library(xts) | |
data(sample_matrix) | |
x <- as.xts(sample_matrix) | |
library(inline) | |
library(Rcpp) | |
f <- cfunction(sig=c(Rxts="Rxts"), Rcpp=TRUE, | |
includes=' | |
extern "C" { | |
#define class xts_class |
This file contains 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
library(xts) | |
library(inline) | |
library(Rcpp) | |
#' normalization | |
#' | |
#' This function will normalize the input \code{Rxts}. | |
#' | |
#' @param Rxts xts object which will be normalize | |
#' @return NULL |
This file contains 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
<?php | |
if (count($argv) != 6) { | |
echo "Usage: add_user.php <uid> <first-name> <last-name> <e-mail> <phone>\n"; | |
exit(1); | |
} | |
$current_uid = shell_exec("ldapsearch -x -LLL -b dc=iis,dc=sinica,dc=edu,dc=tw 'uidNumber<=65534' uidNumber"); | |
preg_match_all("/uidNumber.\\s(?P<uid_number>\\d+)/", $current_uid, $matches); |
This file contains 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
\documentclass[$if(fontsize)$$fontsize$,$endif$]{$documentclass$} | |
\usepackage{fontspec} | |
\setromanfont{WenQuanYi Micro Hei} % | |
\XeTeXlinebreaklocale "zh" | |
\XeTeXlinebreakskip = 0pt plus 1pt | |
\usepackage{amssymb,amsmath} | |
\usepackage{ifxetex,ifluatex} | |
\ifxetex | |
\usepackage{fontspec,xltxtra,xunicode} | |
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} |
OlderNewer