- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
#' @title list all functions in a package | |
#' @param pkg character string containing package name | |
#' @return character vector of functions in given package | |
#' @export | |
lsf <- function(pkg) { | |
envirName <- paste("package", pkg, sep = ":") | |
everything <- ls(pos = envirName, all.names = TRUE) | |
funcs <- c() |
lintr::lint_package(linters = lintr::default_linters[names(lintr::default_linters) != "object_camel_case_linter"]) |
//' @title Sort using STL | |
//' @description if compiler flags and standard library support is available | |
//' (only tested on glibc), OpenMP, then this will use a parallel sort | |
//' algorithm which is significantly faster. It doesn't however deal with NA | |
//' values. TODO: handle NA values. | |
//' @param x vector of strings. In the current implementation, NA is completely | |
//' ignored, so is probably converted to "NA" | |
//' @examples | |
//' \dontrun{ |
library(fastmatch) | |
library(microbenchmark) | |
WORDS <- read.table("https://dotnetperls-controls.googlecode.com/files/enable1.txt", | |
stringsAsFactors = FALSE)[[1]] | |
words_factor <- as.factor(WORDS) | |
# generate 100 sentences of between 5 and 15 words: | |
SENTENCES <- lapply(c(1:100), sample, x = WORDS, size = sample(c(5:15), size = 1)) |
#!/bin/sh | |
# This assumes you have access to the system via SSH already, and need | |
# remote VNC access as the same user, and you want only the primary display. | |
export DISPLAY=:0 | |
# Encoded password with http://www.motobit.com/util/base64-decoder-encoder.asp | |
export VNC_PASSWORD="dm5jX3Bhc3N3b3JkNzE=" # vnc_password71 | |
export VNC_PASSWORD="dm5jX3Bhc3M=" # vnc_password (a character limit is enforced?) | |
# Sadly many common VNC clients don't support encryption. |
macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.
Instead of tmux-256color
, use screen-256color
which comes with system. Place this command into ~/.tmux.conf
or ~/.config/tmux/tmux.conf
(for version 3.1 and later):
#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.
putty
Set Connection -> Data -> Terminal-type string
to xterm-256color
tmux
Add this line to ~/.tmux.conf
This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.
Most the credit for these changes go to Dave Holland.
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |