I hereby claim:
- I am scw on github.
- I am scw (https://keybase.io/scw) on keybase.
- I have a public key whose fingerprint is DC95 4D84 4B97 617D 62FC 4498 F3E7 6E7C 03E8 FB6A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# I've added this to my ~/.bash_profile to use it, you could also create a stand-alone shell script. | |
# Usage: pipx install cython | |
function pipx() { | |
# Many Python packages don't install correctly with clang, as mentioned here: | |
# https://gist.github.com/goldsmith/7262122 | |
# This wrapper forces gcc for pip installations: | |
export CFLAGS="-arch i386 -arch x86_64" | |
export FFLAGS="-m32 -m64" |
def time_in_min(time_string): | |
# assumes 24h times | |
(hour, minutes) = [int(t) for t in time_string.split(":")] | |
return hour * 60 + minutes | |
def min_to_time(time_min): | |
minutes = time_min % 60 | |
hours = (time_min - minutes) / 60 | |
# return hour:minutes with leading zero | |
return "{0}:{1:02d}".format(hours,minutes) |
def jaro_cost(inputs, weight=1): | |
min_score = 1.0 | |
for a,b in list(itertools.combinations(inputs, 2)): | |
jaro_score = jellyfish.jaro_distance(a, b) | |
if jaro_score < min_score: | |
min_score = jaro_score | |
return (1 - min_score)*weight | |
def attr_score(attribute): |
SPAGeDi 1.4c (build 17-07-2013) - a program for Spatial Pattern Analysis of Genetic Diversity | |
Written by Olivier Hardy & Xavier Vekemans | |
Contributions by Reed Cartwright | |
Input file : "C:\Users\shau7031\AppData\Roaming\geneGIS\spagedi_data.txt" | |
Results file : "Z:\data\arcgis\addins\genegis\tests\data\tmxr.txt" | |
1318 individuals | |
2 categories: CA-OR, Cent_Am | |
Latitude-longitude coordinates (assumed to be in degrees; used to compute distances in km), Latitude, Longitude |
brew install
brew uninstall
apt-get install
apt-get remove
pkg install
pkg delete
#!/usr/bin/env bash | |
for file in `find . -name "*.env"`; do | |
# we want the name without the '.env' bit | |
base=`basename $file .env` | |
echo $base | |
done |
# Configure Postgres | |
# | |
# create a postgres database for the records | |
createdb sailwx | |
# make the new database PostGIS compatible (here, against Postgres 8.4) | |
git clone https://github.com/straup/postgis-tools | |
cd postgis-tools | |
sh ./createdb-8.4.sh sailwx sailwx |
checkRaster <- function(raster) { | |
if (raster@nrows * raster@ncols == 220106) { | |
message <- paste("Raster size checks out for layer:", raster@layernames, sep="") | |
} | |
else { | |
message <- paste( "invalid raster dimensions; nrows:", raster@nrows, " ncols:", raster@ncols, sep="") | |
} | |
print(message) | |
} |
# fine scale inner block | |
outFocalStatistics = FocalStatistics(Bathy, NbrAnnulus(FineInnerRadius, FineOuterRadius, "CELL"), "MEAN") | |
outRaster = Int(Plus(Minus(Bathy, outFocalStatistics), 0.5)) | |
# broad scale inner block | |
outFocalStatistics = FocalStatistics(Bathy, NbrAnnulus(BroadInnerRadius, BroadOuterRadius, "CELL"), "MEAN") | |
outRaster = Int(Plus(Minus(Bathy, outFocalStatistics), 0.5)) |