Skip to content

Instantly share code, notes, and snippets.

View mhoffman's full-sized avatar

Max Hoffmann mhoffman

View GitHub Profile
#!/usr/bin/env python
### Print the installed location of a python module
def pwhichd():
import optparse
import os
parser = optparse.OptionParser(usage="""%prog <module-name>""")
options, args = parser.parse_args()
#!/usr/bin/env python
### List current import path for python
def ppath():
import sys
for p in sys.path:
print(p)
if __name__ == '__main__':
#!/usr/bin/env python
import os
import os.path
import optparse
import tempfile
parser = optparse.OptionParser(usage='%script <cube-filename>')
#!/usr/bin/env python
import pickle
import optparse
import espresso.io
import sys
import os.path
import ase.io.cube
import ase.units
@mhoffman
mhoffman / bs
Created November 7, 2017 17:53
#!/usr/bin/env python
import sys
import optparse
parser = optparse.OptionParser(
usage="""
usage: %prog [low] hi
Do an (integer) binary on the command line. Initial arguments are a lower and upper bound.
If only one argument is given, the lower bound will be assume 0. Iteratively state
#!/bin/bash
# Turn scientic notation of rational number
in="$(echo ${*} | sed -e 's/\([0-9.]\)[eE]\([0-9+-]\)/\1*10^\2/g' -e 's/--/+/g' )"
# calculate and turn back to scientific notation
printf "%.7f\n" $(echo "scale=63; ${in}" | bc ;exit)
#!/usr/bin/python
import os
import sys
import json
from collections import defaultdict
sys.path.append('/nfs/slac/g/suncatfs/data_catapp')
from tools import extract_atoms, check_reaction
#!/usr/bin/python
import os
import sys
import json
from collections import defaultdict
sys.path.append('/nfs/slac/g/suncatfs/data_catapp')
from tools import extract_atoms, check_reaction
This file has been truncated, but you can view the full file.
@article{krug_boundary-induced_1991,
title = {Boundary-induced phase transitions in driven diffusive systems},
volume = {67},
url = {http://link.aps.org/doi/10.1103/PhysRevLett.67.1882},
doi = {10.1103/PhysRevLett.67.1882},
abstract = {Steady states of driven lattice gases with open boundaries are investigated. Particles are fed into the system at one edge, travel under the action of an external field, and leave the system at the opposite edge. Two types of phase transitions involving nonanalytic changes in the density profiles and the particle number fluctuation spectra are encountered upon varying the feeding rate and the particle interactions, and associated diverging length scales are identified. The principle governing the transitions is the tendency of the system to maximize the transported current.},
number = {14},
urldate = {2014-03-06},
journal = {Physical Review Letters},
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 13 2016 11:34:49)
MacOS X (unix) version
Included patches: 1-1129
Compiled by MacPorts
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl