This file contains 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 | |
import requests | |
from urllib.parse import urlparse | |
import sys | |
from lxml import html | |
doi2bib_url = "https://www.doi2bib.org/2/doi2bib" | |
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36' | |
def get_headers(referrer=None): |
This file contains 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
# python -m tikz plot_something.py args > output.tex | |
import matplotlib.pyplot as plt | |
from matplotlib2tikz import get_tikz_code | |
import sys | |
import os | |
from contextlib import contextmanager | |
def print_tikz(file): | |
code = get_tikz_code(filepath="test.tex") |
This file contains 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 | |
import h5py | |
import sys | |
def usage(): | |
print(""" | |
h5del: delete datasets from hdf5 file | |
Usage: h5del <hdf5 file> <datasets...> |
This file contains 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
using DataFrames,MCMC | |
#ReverseDiffSource.@deriv_rule logistic(x::AbstractArray) x dx = (exp(x) / (exp(x) + 1).^2) .* ds | |
function translate_winbugs!(ex::Expr) | |
if ex.head == :macrocall && ex.args[1] == symbol("@~") | |
ex2 = ex.args[3] | |
length(ex.args) == 3 || error("Syntax error in ($ex)") | |
if ex2.head == :call | |
if ex2.args[1] == :dnorm | |
ex2.args[1] = :Normal |