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 cv2, numpy as np, json, sys | |
def simplify(data): | |
d = np.array(data).astype(np.float32) | |
if d.size > 3: | |
simple = cv2.approxPolyDP(d, thresh, False).tolist() | |
data = [[round(n, 6), round(p, 6)] for n,p in np.reshape(simple, [-1, 2]).tolist()] | |
else: | |
print "not reducing {}".format(d) |
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
cfg_parser () | |
{ | |
ini="$(<$1)" # read the file | |
ini="${ini//[/\[}" # escape [ | |
ini="${ini//]/\]}" # escape ] | |
IFS=$'\n' && ini=( ${ini} ) # convert to line-array | |
ini=( ${ini[*]//;*/} ) # remove comments with ; | |
ini=( ${ini[*]/\ =/=} ) # remove tabs before = | |
ini=( ${ini[*]/=\ /=} ) # remove tabs be = | |
ini=( ${ini[*]/\ =\ /=} ) # remove anything with a space around = |
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
#!/usr/bin/env python | |
"""html2text: Turn HTML into equivalent Markdown-structured text.""" | |
__version__ = "2.40" | |
__author__ = "Aaron Swartz ([email protected])" | |
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." | |
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"] | |
# TODO: | |
# Support decoded entities with unifiable. |
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
#!/usr/bin/python | |
# Downloads Google Web History | |
import sys, optparse, datetime, tempfile, os, string, urllib | |
import getpass, uu | |
import httplib2,re | |
import time | |
from Cookie import SimpleCookie | |
import atom | |
#import gdata.service |