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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
name="viewport" | |
content="initial-scale=1,maximum-scale=1,user-scalable=no" | |
/> | |
<title> | |
Intro to MapView - Create a 2D map | Sample | ArcGIS API for JavaScript |
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 python | |
# Sample Usage | |
# python bulk_update_details.py -u https://www.arcgis.com -o username -s password -p 'path/to/details.csv' | |
import argparse | |
import json | |
import csv | |
import requests |
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 python | |
# Sample Usage | |
# python publishShapefiles.py -u https://www.arcgis.com -o username -s password -p 'path/to/my/shapefiles' | |
import argparse | |
import json | |
import os | |
import time | |
import csv |
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
import urllib | |
import json | |
service = 'http://services1.arcgis.com/fGahaSQSAcHXfi8G/arcgis/rest/services/Social_Media_Reports/FeatureServer/0' | |
params = { | |
'where': '1=1', | |
'outFields': '*', | |
'returnGeometry': 'true', | |
'f': 'json' |
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
{ | |
"dependencies": { | |
"promise": "^7.0.4", | |
"request": "^2.65.0", | |
"terraformer": "^1.0.5", | |
"terraformer-arcgis-parser": "^1.0.4", | |
"turf": "^2.0.2" | |
} | |
} |
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 python | |
# Find all primes in a range using the Sieve of Eratosthenes. | |
# http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
def SieveOfEratosthenes(start, stop): | |
numList = __build__(start, stop) | |
return __sieve__(numList) | |
def __build__(start, stop): | |
numList = [] |
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 python | |
def formatTime(s): | |
'''Converts seconds to a pretty string like 1 h 5 minutes 10.3 seconds.''' | |
hours, remainder = divmod(s, 3600) | |
minutes, seconds = divmod(remainder, 60) | |
timestring = str(seconds) + ' sec' | |
if minutes > 0: | |
timestring = str(int(minutes)) + ' min ' + timestring | |
if hours > 0: |
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
## The Collatz Conjecture (http://en.wikipedia.org/wiki/Collatz_conjecture) | |
## Take any natural number n. | |
## If n is even, divide it by 2. | |
## If n is odd multiply it by 3 and add 1. | |
## Repeat the process indefinitely. | |
## The conjecture is that, no matter what number you start with, you will always eventually reach 1. | |
## The property has also been called oneness. | |
import string |