Which files changed on my feature branch?:
hg status --rev .:develop
Which commits belong to a named branch?:
hg log -r "branch(<branchname>) and 0:"
What heads exist on the current repository that have not been merged into the develop branch?:
| """Module for preprocessing operations.""" | |
| # Including all import statements from the original file, in case that matters | |
| # Original file available (raw) at http://adept.invest-natcap.googlecode.com/hg/adept/preprocessing.py | |
| import os | |
| import logging | |
| import tempfile | |
| import shutil | |
| import math | |
| import json |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| This a file in a gist. |
| import collections | |
| from osgeo import gdal | |
| RasterStats = collections.namedtuple('RasterStats', ['min', 'max']) | |
| def get_raster_values_from_attr_table(filepath, band_index): | |
| gdal_dataset = gdal.OpenEx(filepath, gdal.OF_RASTER) | |
| band = gdal_dataset.GetRasterBand(1) | |
| attr_table = band.GetDefaultRAT() |
| To run a python program (such as nosetests) in GDB, do the following: | |
| $ gdb --args python -m nose | |
| Then at the gdb shell: | |
| > start | |
| > continue |
| # encoding=UTF-8 | |
| """fix_geometry.py""" | |
| def doit(original_geometry): | |
| if not original_geometry.IsValid(): | |
| if 'POLYGON' in original_geometry.GetGeometryName(): | |
| # Geometries that are only self-intersecting can be fixed by | |
| # Buffering by 0. | |
| buffered_geom = original_geometry.Buffer(0) |
| #! /bin/bash | |
| diff <(gdalinfo $1) <(gdalinfo $2) |
| In the latest version of watershed delineation, a single watershed | |
| seed may be associated with many features of interest. For this reason, | |
| we need to be able to associate the attributes of the features of interest | |
| with each of the seeds derived from the features. | |
| The GeoPackage driver (https://www.gdal.org/drv_geopackage.html) supports | |
| 'aspatial' tables in GDAL>2.0, and 'attribute' data types in GDAL>2.2. | |
| The two prototypes needed are: | |
| * How do we make an aspatial table in GDAL 2? |
| #!/bin/bash | |
| # | |
| # Convert a program's manpage to PDF. | |
| # Assumes that the program has a manpage for it and that ps2pdf14 is installed (part of a latex package). | |
| # | |
| # Example usage: | |
| # $ ./man2pdf bash | |
| ${1?"Usage: $0 PROGRAMNAME"} | |
| man -t $1 | ps2pdf14 - $1_manpage.pdf |
Which files changed on my feature branch?:
hg status --rev .:develop
Which commits belong to a named branch?:
hg log -r "branch(<branchname>) and 0:"
What heads exist on the current repository that have not been merged into the develop branch?: