Skip to content

Instantly share code, notes, and snippets.

L-BFGS-B 0.0 0.000000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.1 0.100000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.2 0.200000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.3 0.300000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.4 0.400000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.5 0.500000 True: b'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
L-BFGS-B 0.6 0.500000 True: b'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
L-BFGS-B 0.7 0.500000 True: b'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
L-BFGS-B 0.8 0.500000 True: b'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
L-BFGS-B 0.9 0.656250 True: b'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
@jeetsukumaran
jeetsukumaran / version.py
Created April 11, 2018 19:21
PEP 440 Python Versioning Compliance/Parsing
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
VERSION_PATTERN = r"""
v?
(?:
(?:(?P<epoch>[0-9]+)!)? # epoch
@jeetsukumaran
jeetsukumaran / fb.obs.tsv
Created September 6, 2017 23:23
Distribution of Birthdays on FB (n=198) Raw
Date Count
01-01 1
01-03 2
01-06 2
01-09 1
01-10 1
01-13 1
01-14 1
01-25 2
01-27 3
@jeetsukumaran
jeetsukumaran / dirichlet_partition.py
Created July 14, 2017 18:42
Randomly partitions a set of elements using the Dirichlet process
#! /usr/bin/env python
###############################################################################
##
## Copyright 2017 Jeet Sukumaran.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
@jeetsukumaran
jeetsukumaran / 00iii.py
Last active May 19, 2017 00:12
Implicit Interface Discovery
#! /usr/bin/env python
import inspect
import sys
import collections
import re
class CallInfo(object):
def __init__(self,
@jeetsukumaran
jeetsukumaran / gist:42f7dfb67c4670f1ac150e10e76b5ace
Created January 6, 2017 04:07
Track history of commands together with directory in which they were executed
# History {{{1
# ==============================================================================
export HISTSIZE=10000 # limit of history loaded in memory
export HISTFILESIZE=1000000 # limit of history stored in file
_loghistory() {
# Detailed history log of shell activities, including time stamps, working directory etc.
#
@jeetsukumaran
jeetsukumaran / test1.tex
Created September 2, 2016 14:31
BibLaTeX customizations (emphasize author name when rendering bibliography, etc.)
%% emphasize author name when rendering bibliography
% Note: requires: \usepackagage{biblatex}
\newcommand{\emphasizeAuthorName}[1]{%
\DeclareNameFormat{author}{%
\edef\tempname{{#1}}%
\ifnumequal{\value{listcount}}{1}
{\ifnumequal{\value{liststop}}{1}
{\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\isdot}}{##1\addcomma\addspace ##4\addcomma\isdot}}
{\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\isdot}}{##1\addcomma\addspace ##4}}}
" Discovered via: https://github.com/davidhalter/jedi-vim/issues/217
" Original: http://stackoverflow.com/questions/12213597/how-to-see-which-plugins-are-making-vim-slow
" Thanks @alicee and @Zyx!
:profile start profile.log
:profile func *
:profile file *
" At this point do slow actions
:profile pause
:noautocmd qall!
# Problem:
# You want to use DendroPy's rich parsing infrastructure to read/write trees,
# but you have your own classes of Trees/Nodes that you want to use.
# Solution:
# Don't just derive from DendroPy's Node/Tree/TreeList class, but at each
# level, specify the appropriate type and/or factory function for the
# component types.
# Derive from dendropy.Node, delegating most work there,
@jeetsukumaran
jeetsukumaran / gist:da3e03578fd2744a35d4
Last active November 15, 2015 16:45
Git: show tips of local, remote, or all branches
Add the following to the [alias] section of your ``~/.gitconfig`` to give your self ``git tips``, ``git rtips``, and ``git atips`` commands.
# show tips of every branch; modified from: https://gist.github.com/jasonrudolph/1810768#gistcomment-1391494
tips = !"for k in `git branch | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"
rtips = !"for k in `git branch -r | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"
atips = !"for k in `git branch -a | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"