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
alias todo.now='geeknote create --tags @work,1-Now --title ' | |
alias todo.next='geeknote create --tags @work,2-Next --title ' | |
alias todo.soon='geeknote create --tags @work,3-Soon --title' | |
alias todo.later='geeknote create --tags @work,4-Later --title' | |
alias todo.someday='geeknote create --tags @work,5-Someday --title' | |
alias todo.waiting='geeknote create --tags @work,6-Waiting --title' | |
alias show.todo.all='geeknote find --tags @work --notebooks "Actions Pending" ' | |
alias show.todo.now='geeknote find --tags @work,1-Now --notebooks "Actions Pending" ' | |
alias show.todo.next='geeknote find --tags @work,2-Next --notebooks "Actions Pending" ' | |
alias show.todo.soon='geeknote find --tags @work,3-Soon --notebooks "Actions Pending" ' |
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
### Generate a random big file that we want to sort, 10 Million lines | |
perl -e 'for (1..1E7){printf("%.0f\n",rand()*1E7)};' > bigFile | |
### Split the file up into chunks with 10,000 lines in each chunk | |
split -a 3 -d -l 10000 bigFile split | |
### rename the files on a 1-1000 scheme not 0-999 | |
for f in split*;do mv ${f} $(echo ${f} |perl -ne 'm/split(0*)(\d+)/g;print "Split",$2+1,"\n";');done | |
### submit a job array, allowing 50 jobs to be run at anyone time | |
ID=$(bsub -J "sort[1-1000]%50" "sort -n Split\$LSB_JOBINDEX >Split\$LSB_JOBINDEX.sorted" |perl -ne 'm/<(\d+)>/;print "$1"') | |
### merge the sorted files together once all the jobs are finished using the –w dependency | |
ID2=$(bsub -w "done($ID)" "sort -n -m *.sorted >bigFile.sorted" |perl -ne 'm/<(\d+)>/;print "$1"') |
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
if (!require(RColorBrewer)){ | |
install.packages("RColorBrewer") | |
library(RColorBrewer) | |
} | |
### Generate a random data set | |
data <- data.frame(names=c("Type1","Type2")[as.numeric((runif(n=100)>=0.5))+1],data=rnorm(100,100,sd=25)) | |
### Use the aggregate function to split and get the mean of the data | |
aggregate(data$data,list(data$names),mean) |
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
### Load the package or install if not present | |
if (!require("RColorBrewer")) { | |
install.packages("RColorBrewer") | |
library(RColorBrewer) | |
} | |
### Set the display a 2 by 2 grid | |
par(mfrow=c(2,2)) | |
### Show all the colour schemes available |