Based on paranoids blog article cgroup ubuntu 18.04 howto
sudo apt install cgroup-bin cgroup-lite cgroup-tools cgroupfs-mount libcgroup1
# Setup | |
library(ggplot2) | |
# Sample set | |
fruit <- matrix(c("Apple","186","Banana","93","Elderberry","48","Durian", "28","Cherry", "28"), ncol = 2, byrow = TRUE) | |
colnames(fruit) <- c("Name","Freq") | |
fruit <- as.data.frame(fruit) | |
fruit$Freq <- as.numeric(as.character(fruit$Freq)) | |
# Plot graph |
library(ggplot2) | |
ggplot(data = data.frame(a = c(1,2,3), b=c(4,5,6)), aes(x=a, y=b)) + geom_point() |
# Restart bluetooth service on ubuntu when it can be toogle on/off | |
sudo /etc/init.d/bluetooth restart |
library(dplyr) | |
library(purrr) | |
mini = list( | |
fpkm = list( | |
A = data.frame(x = c(1,3,4), y = c(23,634,12)), | |
B = data.frame(x = c(4,7,8), y = c(22,857,35)) | |
), | |
counts = list( | |
A = data.frame(x = c(0.1,0.3,4), y = c(0.23,0.634,0.12)), |
shopt -s globstar | |
for file in **/* | |
do | |
slash=${file//[^\/]} | |
case "${#slash}" in | |
0) echo "├── ${file}";; | |
1) echo "│ ├── ${file}";; | |
2) echo "│ │ ├── ${file}";; | |
esac | |
done |
# Computes max depth of a list (recursively) | |
depth <- function(this) { | |
if (is.list(this)) { | |
ifelse(length(this) > 0, 1 + max(sapply(this, depth)), 0) | |
} else { 0 } | |
} | |
# Wrapping function to check if first point of entry is a list | |
list.depth <- function(my_list) { | |
ifelse(is.list(my_list), depth(my_list), stop("my_list have to be a list")) |
# Telling git to use a specific private key | |
Host github.com | |
HostName github.com | |
IdentityFile ~/.ssh/id_rsa_github | |
User git |
Based on paranoids blog article cgroup ubuntu 18.04 howto
sudo apt install cgroup-bin cgroup-lite cgroup-tools cgroupfs-mount libcgroup1
# ********************************************************************* # | |
# Quick script to find which example is the longest to run in a package # | |
# ********************************************************************* # | |
library(magrittr) | |
# Getting function name | |
functions <- list.files("man") %>% | |
strsplit(".Rd") |
\documentclass{article} | |
\usepackage[utf8]{inputenc} | |
\newcommand\note[2]{\getid{#1}\label{note:#1:#2}\textsuperscript{\ref{note:#1:#2}}} | |
\makeatletter | |
\newcommand{\getid}[1]{% | |
\@ifundefined{c@#1} | |
{% the counter doesn't exist | |
\newcounter{#1}\setcounter{#1}{1}% | |
} |