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
#!/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) |
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
#!/bin/bash -eu | |
# Translate a LaTeX formula on-the-fly | |
echo ${1} | |
template=$(mktemp) | |
echo ${template} |
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/env python | |
### Print the main __init__.py file location of a python module | |
def pwhich(): | |
import optparse | |
parser = optparse.OptionParser(usage="""%prog <module-name>""") | |
options, args = parser.parse_args() |
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/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() |
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/env python | |
### List current import path for python | |
def ppath(): | |
import sys | |
for p in sys.path: | |
print(p) | |
if __name__ == '__main__': |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.