brew install
brew uninstall
apt-get install
apt-get remove
pkg install
pkg delete
This file contains hidden or 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 hidden or 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
| #!/usr/bin/env bash | |
| # source map: http://www.arcgis.com/home/item.html?id=0dd32a9c77b8400ebf60261571b9134b | |
| echo "You must abide by the terms of use of this data:" | |
| echo " https://ref.data.gov.sg/common/terms.aspx" | |
| echo "Agree to terms? (y|n)" | |
| read input | |
| if [ ${input} == 'y' ]; then |
This file contains hidden or 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
| # step 0 -- install miniconda into ~/miniconda | |
| cd ~/miniconda/bin | |
| # running this will drop you into the 'root' conda environment, | |
| # the one that has the conda executable | |
| source ./activate root | |
| # to test, get the version of conda back | |
| conda --version | |
| # Now, you can run the conda command, and create a new environment. | |
| # Here's an example installing a geo stack. Note I reference the | |
| # conda-forge channel '-c conda-forge' because geopandas isn't in |
This file contains hidden or 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
| # Second example from RasterToNumPyArray (arcpy) | |
| # http://resources.arcgis.com/en/help/main/10.2/index.html#//03q300000029000000 | |
| """ | |
| A Python NumPy array is designed to deal with large arrays. There are many exist | |
| ing Python functions that have been created to process NumPy arrays, the most no | |
| ted being contained in the SciPy scientific computing package for Python. You ma | |
| y want to convert an ArcGIS raster to a NumPy array to | |
| 1. Implement one of the many existing Python functions that can be applied to a | |
| NumPy array (for example, run filters on the data, perform multidimensional |
This file contains hidden or 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
| from __future__ import print_function | |
| from __future__ import division | |
| from __future__ import unicode_literals | |
| import ctypes.wintypes | |
| import os | |
| # cyptes constants | |
| CSIDL_PERSONAL = 0x05 | |
| CSIDL_APPDATA = 0x1A |
This file contains hidden or 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
| @setlocal enabledelayedexpansion | |
| @echo off | |
| @CALL :normalizepath scripts_path "%~dp0" | |
| @set env_text="%scripts_path%proenv.txt" | |
| :: read the activte environment name | |
| @set /p CONDA_NEW_ENV=<%env_text% | |
| @set CONDA_SKIPCHECK=1 | |
| @set "CONDA_PREFIX=%CONDA_NEW_ENV%" |
This file contains hidden or 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
| colorama 0.3.7 py35_0 defaults | |
| cycler 0.10.0 py35_0 defaults | |
| future 0.15.2 py35_0 defaults | |
| matplotlib 1.5.3 np111py35_0e [arcgispro] esri | |
| mpmath 0.19 py35_1 defaults | |
| netcdf4 1.2.4 py35_0e [arcgispro] esri | |
| nose 1.3.7 py35_1 defaults | |
| numexpr 2.6.1 np111py35_0e [arcgispro] esri | |
| numpy 1.11.2 py35_0e [arcgispro] esri | |
| pandas 0.19.0 np111py35_0 defaults |
This file contains hidden or 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
| x = [5, 10, 15, 20, 30, 40, 50, 60, 100, 140] | |
| def range_finder(seq): | |
| it = iter(seq) | |
| prev = next(it) | |
| prev_diff = seq[1] - seq[0] | |
| r = 0 | |
| for (i, item) in enumerate(it): | |
| diff = item - prev | |
| if diff != prev_diff: |