- Get IP of local workstation X with Internet connection (which is ofc. reachable by beefy machine via intranet)
- Install sshserver on local workstation X
- Install gurobi on the beefy machine by copying tar and extract it, set ~/.bashrc environment things
- Try out executing gurobi_cl on beefy machine, it should say there is no valid license on machine
- ssh to the beefy machine and execute ssh -L 8008:apps.gurobi.com:80 @localWorkStationXIP
- ssh with another session to the beefy machine and execute grbgetkey --server=127.0.0.1 --port=8080 -- verbose xxxx-xxxx-xxxxxxx-xxxx
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 packages | |
library(Rcpp) | |
library(testthat) | |
# define functions | |
cppFunction(' | |
Rcpp::List export_data(Rcpp::NumericVector x) { | |
std::vector<double> x1 = Rcpp::as< std::vector<double> >(x); | |
std::vector<double>* x2 = new std::vector<double>; | |
*x2 = x1; |
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
Do populations in protected areas have population matrix properties? | |
==================================================================== | |
## Methods | |
First, we need to | |
## Results | |
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
## Define function that will convert temperatures to Celcius and divide by 8 [same as * 1/8] (as each measurement represents 1/8 of a day) | |
#Note: need to add a part here where any value <0 = 0 and not a negative, as heating DD's are calculated only using the 'above the threshold' | |
extractDD=function(path) { | |
# extract values and convert to kelvin | |
vals=(values(raster(path,varname="TMP"))-273.15)/8 | |
# set any numbers < 0 to zero | |
if (sum(vals<0)>0) { | |
vals[which(vals<0)]=0 | |
} | |
# return error if any NAs |
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
library(snow) | |
library(plyr) | |
library(doSNOW) | |
library(compiler) | |
data(mtcars) | |
ratio=cmpfun( | |
function(x, w) { | |
return(mean((x$mpg * w) / (x$wt * w))) | |
} |
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
#### Initialization | |
# set global pars | |
rm(list=ls()) | |
set.seed(500) | |
# set user params | |
n=500 | |
spline_df=5 | |
# load deps |
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
#### Initialization | |
# set params | |
stan.chains=4 | |
stan.iter=10000 | |
stan.thin=5 | |
max_treedepth=20 | |
adapt_delta=0.9 | |
# load deps | |
library(glmnet) |
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
# deps | |
library(magrittr) | |
library(dplyr) | |
library(ggplot2) | |
library(gridExtra) | |
# load data | |
data(iris) |
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
# run | |
# source('https://gist.githubusercontent.com/paleo13/746682a785e709d475c2/raw/100bbc10033a3a9bd1f2fa804d2b508743e06287/install.R') | |
# set mirror | |
chooseCRANmirror(ind=4) | |
# cran packages | |
install.packages("devtools") | |
install.packages('zoo') | |
install.packages('testthat') |
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 deps | |
library(rgdal) | |
library(raster) | |
library(data.table) | |
library(rgeos) | |
library(tools) | |
library(RColorBrewer) | |
library(dplyr) | |
library(shape) |
NewerOlder