Skip to content

Instantly share code, notes, and snippets.

@erjiang
erjiang / dp.py
Created April 22, 2013 03:32 — forked from xarg/dp.py
# pure-Python Douglas-Peucker line simplification/generalization
#
# this code was written by Schuyler Erle <schuyler@nocat.net> and is
# made available in the public domain.
#
# the code was ported from a freely-licensed example at
# http://www.3dsoftware.com/Cartography/Programming/PolyLineReduction/
#
# the original page is no longer available, but is mirrored at
# http://www.mappinghacks.com/code/PolyLineReduction/
@erjiang
erjiang / jsoncheck.py
Created March 13, 2012 15:56
jsoncheck
#!/usr/bin/env python
"""jsoncheck checks a list of filenames to see if they are valid json files.
Usage:
jsoncheck file1 [file2 file3 ...]
jsoncheck returns 0 if all files loaded successfully, and 1 otherwise.
"""
import json
#!/usr/bin/perl
#
# Eric Jiang
# http://notes.ericjiang.com/posts/54
# This software is public domain.
#
# NOTE: This code is not maintained!
# There is a newer version written in C:
# https://github.com/erjiang/usbscale
#