brew install
brew uninstall
apt-get install
apt-get remove
pkg install
pkg delete
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('arcgisbinding') | |
arc.check_product() | |
# a FGDB source with a column 'datetime' containing our datetime field | |
d <- arc.open('a/fgdb/source') | |
df <- arc.select(d, 'datetime') | |
# convert from 1899-12-30 00:00 to UNIX Epoch, in seconds | |
as.unix.epoch <- (df$datetime[1]-25569)*86400 |
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
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 |
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
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): |
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
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) |
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
# 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" |
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:
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
import pyproj | |
import arcpy | |
# ArcMap result (meters): | |
# 306,414.514 854,124.573 | |
x = -70.216908 | |
y = 41.930268 | |
# perform projection using pyproj (PROJ.4) |
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
# this test should be run after a fresh run of makeaddin to rebuild the .esriaddin file. | |
class TestAddin(unittest.TestCase): | |
def setUp(self): | |
self.addin_path = os.sep.join([local_path, '..', '..', 'btm.esriaddin']) | |
self.addin_zip = zipfile.ZipFile(self.addin_path, 'r') | |
def testToolboxIsPresent(self): | |
toolbox_path = 'Install/toolbox/btm.pyt' | |
self.assertTrue(toolbox_path in self.addin_zip.namelist()) |
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
import arcpy | |
import binascii | |
line = arcpy.FromWKT('LINESTRING (30 10, 10 30, 40 40)') | |
print binascii.hexlify(line.WKB) | |
# produces: | |
# 0102000000030000000000000000003e40000000000000244000000000000024400000000000003e4000000000000044400000000000004440 |