for (var i = 0; i < array.length; i++) {
}- Code has to run in old versions of IE.
| import arcpy | |
| import os | |
| def create_path(path): | |
| if not os.path.exists(path): | |
| print "Creating directory {}".format(path) | |
| os.makedirs(path) | |
| # default application data dir; e.g. c:\Users\scw\AppData\Roaming |
| /* | |
| You'll need something like this in your HTML: | |
| <script src="http://d3js.org/topojson.v1.min.js"></script> | |
| */ | |
| L.TopoJSON = L.GeoJSON.extend({ | |
| addData: function(jsonData) { | |
| if (jsonData.type === "Topology") { | |
| for (key in jsonData.objects) { | |
| geojson = topojson.feature(jsonData, jsonData.objects[key]); |
| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } |
| import os, urllib, urllib2, datetime, arcpy, json | |
| ## ============================================================================== ## | |
| ## function to update a field - basically converts longs to dates for date fields ## | |
| ## since json has dates as a long (milliseconds since unix epoch) and geodb wants ## | |
| ## a proper date, not a long. | |
| ## ============================================================================== ## | |
| def updateValue(row,field_to_update,value): | |
| outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field |
| @echo off & python -x "%~f0" %* & goto :eof | |
| # ========================================================== | |
| # one way to place python script in a batch file | |
| # place python code below (no need for .py file) | |
| # ========================================================== | |
| import sys | |
| print "Hello World!" | |
| for i,a in enumerate(sys.argv): |
| from celery import Celery | |
| from celery.signals import after_task_publish,task_success,task_prerun,task_postrun | |
| # first argument, current module | |
| app = Celery('tasks') | |
| app.config_from_object('celeryconfig') | |
| # To instantiate celery and import this module | |
| # do: celery -A task worker --loglevel=info | |
| # after, once celery is running, instantiate a python console: |
| import pymssql | |
| import pandas as pd | |
| ## instance a python db connection object- same form as psycopg2/python-mysql drivers also | |
| conn = pymssql.connect(server="172.0.0.1", user="howens",password="some_fake_password", port=63642) # You can lookup the port number inside SQL server. | |
| ## Hey Look, college data | |
| stmt = "SELECT * FROM AlumniMirror..someTable" | |
| # Excute Query here | |
| df = pd.read_sql(stmt,conn) |
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
This gist contains lists of modules available in
in AWS Lambda.