Skip to content

Instantly share code, notes, and snippets.

@seancarmody
seancarmody / gist:8193687
Created December 31, 2013 07:26
Updated julia build error
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Cloning https://github.com/JuliaLang/julia.git
git --git-dir /Library/Caches/Homebrew/julia--git/.git status -s
Updating /Library/Caches/Homebrew/julia--git
git config remote.origin.url https://github.com/JuliaLang/julia.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git checkout -f master
Already on 'master'
@seancarmody
seancarmody / gist:8193023
Created December 31, 2013 05:34
Julia install problem
$ brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libosxfuse_i32.2.dylib
/usr/local/lib/libosxfuse_i64.2.dylib
/usr/local/lib/libtcl8.6.dylib
library(XML)
library(stringr)
url <- "http://cran.r-project.org/report_cran.html"
raw_path <- tempfile()
download.file(url, raw_path, quiet = TRUE)
# Extract table
tables <- readHTMLTable(raw_path, stringsAsFactors = FALSE)
downloads <- tables[[13]]
@seancarmody
seancarmody / ngram_parse.R
Last active December 19, 2015 19:48
Parse Google Ngram Viewer
ngram_parse <- function(html){
if (any(grepl("No valid ngrams to plot!",
html))) stop("No valid ngrams.")
cols <- lapply(strsplit(grep("addColumn", html,
value=TRUE), ","),
getElement, 2)
cols <- gsub(".*'(.*)'.*", "\\1", cols)