Skip to content

Instantly share code, notes, and snippets.

@timvieira
timvieira / jiawei.py
Created February 18, 2017 20:18
Cartoon version of Jiawei's optimization problem.
"""
Cartoon version of Jiawei's optimization problem.
Created [2017-02-17 Fri]
"""
import numpy as np
from scipy.optimize import fmin_bfgs
import autograd
import numpy as np
import pylab as pl
from numpy import exp, cos, sin, sqrt
from arsenal.math import compare
def run_tests():
tests = """
x**2
2*x
@timvieira
timvieira / make-wrapper.bash
Created November 19, 2016 19:38
Make wrapper - Guesses what I meant when there was no Makefile in the current directory.
function yellow { echo -e "\e[33m$@\e[0m"; }
# Wrapper around make, which covers building different project types, when an
# actual Makefile isn't present.
function make {
if [[ -e Makefile ]]; then
yellow "[make] found Makefile"
/usr/bin/make $@
else
yellow "[make] No Makefile found"