Skip to content

Instantly share code, notes, and snippets.

View treo's full-sized avatar

Paul Dubs treo

View GitHub Profile
@treo
treo / build-dl4j-stack.sh
Last active June 7, 2017 22:36 — forked from crockpotveggies/build-dl4j-stack.sh
Script that cleanly builds and locally installs the Deeplearning4j stack
#!/bin/bash
# helper function that ensures cmd returns 0 exit code
function checkexit {
"$@"
local status=$?
if [ $status -ne 0 ]; then
echo "error with $1" >&2
exit 1
fi
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ldt.plateregconition;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@treo
treo / codegen.py
Created September 29, 2011 11:26 — forked from mattbasta/codegen.py
A module to "unparse" a Python AST tree.
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
# -*- coding: utf-8 -*-
from functools import wraps
import time
def retry(tries, exceptions=None, delay=0):
"""
Decorator for retrying a function if exception occurs
tries -- num tries
exceptions -- exceptions to catch