Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#' Read xlsx files | |
#' | |
#' @param file The path to xlsx file | |
#' @param keep_sheets A vector of sheet name | |
#' @param header Whether include the head in the sheet | |
#' @param empty_row Whether to remove the empty rows | |
#' @export | |
xlsxToR <- function(file, keep_sheets = NULL, header = TRUE, empty_row = TRUE) | |
{ | |
suppressWarnings(file.remove(tempdir())) |
# here's some sample data to test it out | |
require(data.table) | |
require(dplyr) | |
set.seed(45) | |
DF <- data.frame(x=sample(3, 25, TRUE), y=1:25, z=26:50) | |
DP <- tbl_df(DF) # for DPLYR data.frame object | |
DT <- data.table(DF) | |
# 1) row-wise subset (usually based on conditions): |
# Because there is no way to tell data.table | |
# "interpret this variable as a column name", it's possible to come up | |
# with corner cases. I'll grant these are unlikely to occur in day | |
# to day use, but any function that uses `data.table` must account for | |
# them | |
# Low odds, and yes, there are workarounds, but this is | |
# what I mean by you have to think carefully to avoid | |
# corner cases |
Git and GitHub (Hadley Wickham): http://r-pkgs.had.co.nz/git.html
R development using GitHub (Gabor Csardi): https://github.com/MangoTheCat/github-workshop
Working with RStudio, Git, GitHub (STAT 545): http://stat545-ubc.github.io/git00_index.html
Version control with git (R. Fitzjohn): http://nicercode.github.io/2014-02-13-UNSW/lessons/70-version-control/
Version control with Git (Software Carpentry): http://software-carpentry.org/v5/novice/git/index.html
Notes:
I've tried to break up in to separate pieces, but it's not always possible: e.g. knowledge of data structures and subsetting are tidy intertwined.
Level of Bloom's taxonomy listed in square brackets, e.g. http://bit.ly/15gqPEx. Few categories currently assess components higher in the taxonomy.
#!/bin/bash | |
SERIAL="00000000" | |
echo "Looking for device with serial $SERIAL..." | |
for d in /sys/bus/usb/devices/*-*; do | |
if [[ -f "$d/serial" ]]; then | |
serial=$(<"$d/serial") | |
if [[ "$serial" = "$SERIAL" ]]; then | |
device="$(basename $d)" |
library(data.table) | |
?`[.data.table` | |
DT <- data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9) | |
X <- data.table(x=c("c","b"), v=8:7, foo=c(4,2)) | |
colnames(DT) | |
# [1] "x" "y" "v" |
@echo off | |
REM ######################################################################## | |
REM # (@)sql.bat | |
REM # | |
REM # Copyright 2014 by Oracle Corporation, | |
REM # 500 Oracle Parkway, Redwood Shores, California, 94065, U.S.A. | |
REM # All rights reserved. | |
REM # | |
REM # This software is the confidential and proprietary information | |
REM # of Oracle Corporation. |
#! /bin/bash | |
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION | |
# Developed for DSM 6 - 7.0.1. Not tested on other versions. | |
# Steps to install | |
# Save this script in one of your shares | |
# Edit it according to your requirements | |
# Backup /usr/syno/share/nginx/ as follows: | |
# # cd /usr/syno/share/ | |
# # tar cvf ~/nginx.tar nginx |