Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schwehr
schwehr / mbsystem-const-demo.diff
Created February 19, 2014 17:29
What it takes to make a parameter const for a function. You must edit (at a minimum) both the function prototype and function definition. Here, I am making the verbose argument const.
svn diff mb_define.h mb_defaults.c
Index: mb_define.h
===================================================================
--- mb_define.h (revision 2165)
+++ mb_define.h (working copy)
@@ -315,7 +315,7 @@
#define MB_PROJECTION_PROJECTED 1
/* MBIO core function prototypes */
-int mb_defaults(int verbose, int *format, int *pings,
@schwehr
schwehr / cheetah3-start.diff
Created April 1, 2014 13:20
first couple changes to start cheetah towards python 3.4
diff --git a/SetupConfig.py b/SetupConfig.py
index 5620416..60bfb8d 100644
--- a/SetupConfig.py
+++ b/SetupConfig.py
@@ -14,8 +14,8 @@ packages = ['Cheetah',
'Cheetah.Tools',
'Cheetah.Utils',
]
-classifiers = [line.strip() for line in '''\
- #Development Status :: 4 - Beta
@schwehr
schwehr / states_fiona_shapely.ipynb
Created May 28, 2014 16:36
make a graph of adjacency of states in the United States
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schwehr
schwehr / gist:7f1509c95f7acf7496ed
Last active August 29, 2015 14:14
libais + gpsd mangled output - fields that are strings
import json
msg = json.loads(
'{"class": "AIS", "device": "stdin", "libais_rot": 0.0, "spare": 0, '
'"raim": false, "mmsi": 412371205, "libais_special_manoeuvre": 0, '
'"maneuver": 0, "status": "15", "repeat": 0, "lat": -45.66791915893555, '
'"heading": 354, "libais_true_heading": 354, "libais_nav_status": 15, '
'"status_text": "Not defined", "turn": 0.0, "libais_mmsi": 412371205, '
'"libais_raim": false, "libais_x": -60.606895446777344, '
'"received_stations": 37, "speed": 0.5, "libais_rcvr": "rORBCOMM103", '
'"libais_rot_over_range": false, "course": 248.0, "scaled": true, '
@schwehr
schwehr / gist:757bae6bd28d9a7ffc4d
Created February 10, 2015 19:02
gdal 1.11.2 RC2 tests on mac osx 10.9 with fink - failures
grep -i fail results | grep TEST
TEST: ogr_cartodb_init ... HTTP service for https://gdalautotest2.cartodb.com is down (HTTP Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581))
TEST: ogr_shape_68 ... Fails on MacOSX. Not sure why.
TEST: ogr_wfs_deegree_wfs200 ... gml_id = 'SGID024_MUNICIPALITIES2004_EDITED_5' filter failed
TEST: gdal_api_proxy_3 ... Fails on MacOSX ('ERROR 1: posix_spawnp() failed'. Not sure why.
TEST: ecrgtoc_online_1 ... HTTP service for http://www.falconview.org/trac/FalconView/downloads/17 is down (HTTP Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581))
TEST: http_4 ... fail
TEST: jpeg_1 ... fail
TEST: jpeg2000_8 ... fail
TEST: lcp_17 ... expected_fail
@schwehr
schwehr / gist:c9e9fb595d0370e7eff7
Created February 12, 2015 19:50
gdal 1.11.2 RC2 on mac osx 10.9 with fink
Running tests from ogr/ogr_arcgen.py
TEST: ogr_arcgen_points ... success
TEST: ogr_arcgen_points25d ... success
TEST: ogr_arcgen_lines ... success
TEST: ogr_arcgen_lines25d ... success
TEST: ogr_arcgen_polygons ... success
TEST: ogr_arcgen_polygons25d ... success
Running tests from ogr/ogr_as_sqlite_extension.py
Running tests from ogr/ogr_avc.py
TEST: ogr_avc_1 ... success
// clang++ -std=c++11 one.cc -o one -Wall -Wextra
#include <vector>
// #include <array>
// #include <list>
#include <iostream>
#include <algorithm>
int main(void) {
int l[5] = {1, 5, 3, 7, 2};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schwehr
schwehr / io_ais_bq01.ipynb
Created April 22, 2015 17:48
BigQuery in an IPython notebook circa 2013
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.