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
| point_layers = [] | |
| line_layers = [] | |
| polygon_layers = [] | |
| for lyr in arcpy.mapping.ListLayers(mxd): | |
| if lyr.isFeatureLayer: | |
| # Try to get .shapeType attribute from data source. | |
| # For XY event layers there is no shape type (it's a | |
| # CSV or something) so assume it's a Point layer. | |
| shape_type = getattr(arcpy.Describe(lyr.dataSource), |
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 arcpy | |
| import sys | |
| class WrappedStream(object): | |
| "Wraps sys.stdout to have all the usual methods of a file object" | |
| def __init__(self, wrap): | |
| self._wrap = wrap | |
| def close(self, *args, **kw): | |
| try: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 inspect | |
| import sys | |
| def tracefunction(frame, event, arg): | |
| if event == "line": | |
| info = inspect.getframeinfo(frame) | |
| fname, lineno, fn = info.filename, info.lineno, info.function | |
| with open(fname, 'rb') as f: | |
| line = [line.rstrip() for line in f][lineno - 1] | |
| print "Function: {} (in file {}:{}) | {}".format(fname, fn, lineno, line) |
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
| # coding: utf-8 | |
| import lib2to3 | |
| import lib2to3.fixes | |
| import lib2to3.refactor | |
| __all__ = ["code_to_py3"] | |
| all_fixes = ["lib2to3.fixes.fix_{}".format(l) | |
| for l in lib2to3.refactor.get_all_fix_names("lib2to3.fixes")] |
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
| def export_fc_to_csv(fc, out_csv): | |
| """ | |
| Export each vertex in a line or poly fc to a csv with OID | |
| user requested at http://arcpy.wordpress.com/about/#comment-348 | |
| example | |
| import geom_snippets | |
| geom_snippets.export_fc_to_csv(r"c:\proj\fc1.shp", r"c:\proj\fc1.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
| // MaxSum.cpp : Just a silly little problem to solve -- what is the | |
| // maximum sum of non-adjacent numbers in an array? | |
| #include "stdafx.h" | |
| #include <algorithm> | |
| #include <deque> | |
| #include <iostream> | |
| #include <string> | |
| #include <vector> |
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
| #! /bin/bash | |
| SESSION_NAME=$( tmux display-message -p '#S' 2> /dev/null ) | |
| WINDOW_TITLE="Workspace" | |
| check_session() | |
| { | |
| if [ x$SESSION_NAME == "x" ] | |
| then | |
| echo "Please do this in a tmux session" |
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 time | |
| from github3.models import GitHubCore | |
| def throttle_github(github_like, requests_needed): | |
| """Takes any github3 objects (repo, org, etc) and will throttle if there are | |
| not at least requests_needed requests remianing before the API starts | |
| throttling. If there are not enough requests left, sleep until the window | |
| resets. Note this uses up one API call to get the rate limit headers, so be |
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
| ascii12 | |
| ------- | |
| mmmm mmmmmmmm mm mmm mm mmmmm mm mm mmmmmm | |
| m#""""# """##""" #### ### ## ##"""## ## ## ##""""#m | |
| ##m ## #### ##"# ## ## ## ## ## ## ## | |
| "####m ## ## ## ## ## ## ## ## ## ## ######" | |
| "## ## ###### ## #m## ## ## ## ## ## | |
| #mmmmm#" ## m## ##m ## ### ##mmm## "##mm##" ## | |
| """"" "" "" "" "" """ """"" """" "" |