- Download the SDK from ESRI's website http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api
- Extract the SDK, and put the contents of the directory in a known location, I used
~/local/filegdb
. Here's an example path to one of the files:~/local/filegdb/lib/libFileGDBAPI.dylib
- I use
~/local/filegdb
so it can stay isolated in it's own place. You can put it anywhere, but the next few steps might be different. - Go into the directory containing the FileGDB SDK, e.g.
~/local/filegdb
- ESRI built these dylib's using
@rpath
's, so to avoid needing to mess withDYLD_LIBRARY_PATH
, I updated the@rpath
's usinginstall_name_tool
. There might be a more elegant way to handle this. If so, comments are welcome! - Here are the commands I used to patch the dylibs, this is not required if you want to use
DYLD_LIBRARY_PATH
yourself:
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
# Requirements | |
#sudo apt-get install libcurl4-gnutls-dev # for RCurl on linux | |
#install.packages('RCurl') | |
#install.packages('RJSONIO') | |
library('RCurl') | |
library('RJSONIO') | |
query <- function(querystring) { | |
h = basicTextGatherer() |
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
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/2767174) | |
echo "Installing S3cmd..." | |
wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add - | |
sudo wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/s3tools.list | |
sudo apt-get update && sudo apt-get install s3cmd | |
echo "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
# best practices for web scraping in R # | |
# function should be used with ldply | |
# eg: | |
ldply(urls, scrape) | |
# add a try to ignore broken links/ unresponsive pages | |
# eg: |
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
data_sets <- c("mtcars", "morley", "rock") | |
shinyServer(function(input, output) { | |
# Drop-down selection box for which data set | |
output$choose_dataset <- renderUI({ | |
selectInput("dataset", "Data set", as.list(data_sets)) | |
}) | |
# Check boxes |
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
# Speed tests of different ways to read in large numbers of CSV files | |
# specifically read.csv.sql, read.csv (optimised) and fread | |
library(sqldf) | |
setwd("~/Downloads/wordcounts") | |
files <- sample(list.files(".", pattern="*.csv|CSV$"), 10000) | |
############# read.csv.sql ################### | |
system.time( |
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
get the FileGDB API http://www.esri.com/apps/products/download/ | |
extract it somewhere on your system and remember the path :) | |
mkdir build #directory where we are playing around | |
cd build | |
git clone https://github.com/OSGeo/gdal.git | |
cd gdal | |
./configure --with-fgdb=/path/to/your/FileGDB_API | |
make | |
(make install) optional, I'm just using it locally |
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
################################################### | |
## | |
## Functions for calculating AUC and plotting ROC | |
## Corey Chivers, 2013 | |
## corey.chivers@mail.mcgill.ca | |
## | |
################################################### | |
## Descrete integration for AUC calc |
just use GHC for OSX https://ghcformacosx.github.io
the rest of these directions are preserved for historical purposes
xcode-select --install ; brew tap homebrew/versions ; brew tap homebrew/dupes \
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
SELECT * | |
FROM | |
(SELECT | |
month, | |
amount, | |
pledge_count, | |
SUM(1) OVER(PARTITION BY month ORDER BY pledge_count DESC ROWS UNBOUNDED PRECEDING) as row | |
FROM | |
(SELECT | |
TO_CHAR(CONVERT_TIMEZONE('UTC', 'America/New_York', backings.pledged_at), 'YYYY-MM-01') as month, |
OlderNewer