This file contains 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(httr) | |
endpoint <- oauth_endpoint(NULL, "authorize", "token", base_url = "https://zenodo.org/oauth") | |
myapp <- oauth_app("zenodo", key, secret) | |
zenodo_token <- oauth2.0_token(endpoint, myapp, scope=c("deposit:write+deposit:actions")) | |
This file contains 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
#!/bin/bash | |
PORT=${PORT:=8787} | |
# Mac/Windows must get this from boot2docker | |
IP=${IP:="http://localhost"} | |
# Pull latest version? (Allowed to fail, in case of no internet etc) | |
docker pull rocker/rstudio || true |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Cite this post: <a href="http://greycite.knowledgeblog.org/bib?uri=<?php echo get_permalink(); ?>" | |
>BibTex</a> <a href="http://greycite.knowledgeblog.org/ris?uri=<?php echo get_permalink(); ?> | |
">RIS</a> | |
<!-- Uses the Greycite API --> |
This file contains 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("nycflights13") | |
library("dplyr") | |
library("mgcv") | |
by_dest <- flights %>% group_by(dest) %>% filter(n() > 100) | |
system.time( | |
by_dest %>% do(smooth = gam(arr_delay ~ s(dep_time) + month, data = .)) | |
) |
This file contains 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
link video files together | |
mencoder -forceidx -ovc copy -oac copy -o file.avi p1.avi p2.avi ... | |
vim map F3 to count number of printed words in tex file: | |
:map <F3> :w !detex \| wc -w<CR> | |
convert all pdfs to pngs: | |
for i in *.pdf; do convert "$i" "${i/.pdf}".png; done |
This file contains 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
PKG_CPPFLAGS=-Wall | |
PKG_LIBS=-lm -lgsl -lgslcblas |
This file contains 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
#include <gsl/gsl_siman.h> | |
/* set up parameters for this simulated annealing run */ | |
#define N_TRIES 200 /* how many points do we try before stepping */ | |
#define ITERS_FIXED_T 200 /* how many iterations for each T? */ | |
#define STEP_SIZE 1. /* max step size in random walk */ | |
#define K 1.0 /* Boltzmann constant */ | |
#define T_INITIAL 0.01 /* initial temperature */ | |
#define MU_T 1.003 /* damping factor for temperature */ | |
#define T_MIN .0078 |
This file contains 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
#!/bin/sh | |
# how to upload images to flickr and create a mediawiki embeddable text | |
flickr_uploader tag="$1" > ids.txt | |
# grep -o returns only the matches to the regular expression | |
# of any amount (*) of numbers to an endline | |
# sed find/replaces the number string with the <flickr> tag | |
# and the "&" pastes the regexp match back in | |
grep -o [0-9]*$ ids.txt | sed '/[0-9]*/<flickr>&|t<\/flickr>' |
OlderNewer