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 | |
# etime intrinsic cannot be declared as EXTERNAL with gfortran on OSX. | |
files_with_etime=`find . -name "*.[fF]" | xargs grep -l -i 'etime'` | |
for fname in $files_with_etime | |
do | |
mv $fname ${fname}.backup | |
sed -e 's/^ \(EXTERNAL[ ]*ETIME.*\)/C \1/' ${fname}.backup > $fname | |
rm ${fname}.backup | |
done |
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 | |
outfile="profile-$$" | |
python -m cProfile -o ${outfile}.pstats $@ | |
if [[ $? ]]; then | |
gprof2dot.py -f pstats ${outfile}.pstats | dot -Tpdf -o ${outfile}.png | |
echo "Profile graph is in ${outfile}.png" | |
else | |
echo "Profile creation aborted." | |
fi |
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/sh | |
# | |
# This script helps save keystrokes when decoding AMPL models. | |
# | |
# "amplog name.mod" means "ampl -ogname name.mod" | |
# "amplog name2 name.mod" means "ampl -ogname2 name.mod" | |
# "amplog name2 name.mod name.dat" means "ampl -ogname2 name.mod name.dat" | |
# | |
dat= | |
if (( $# == 1 )); then |
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
import numpy as np | |
import functools | |
import hashlib | |
class Memoized(object): | |
""" | |
Decorator class used to cache the most recent value of a function or method | |
based on the signature of its arguments. If any single argument changes, | |
the function or method is evaluated afresh. | |
""" |
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
# Install with --without-ruby if you observe segfaults. | |
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
# Get the base 7.4 tarball from Vim.org. But once patches start again, go | |
# back to tracking Debian unstable here: | |
# http://ftp.de.debian.org/debian/pool/main/v/vim/ | |
url 'http://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2' |
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
require 'formula' | |
class ASLDownloadStrategy < NoUnzipCurlDownloadStrategy | |
def _fetch | |
# The Netlib FTP server is picky about the password | |
# used for anonymous access; an @-terminated string isn't enough. | |
curl '-u', 'anonymous:[email protected]', @url, | |
'--output', @tarball_path | |
end |
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
Show hidden characters
{ | |
"cmd": ["bibtex", "$project_path/$project_base_name"], | |
"working_dir": "$project_path", | |
"path": "$PATH:/usr/texbin:/usr/local/bin", | |
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)", | |
"selector": "text.tex.latex" | |
} |
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
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex 2012.6.30) 15 FEB 2013 11:50 | |
entering extended mode | |
restricted \write18 enabled. | |
%&-line parsing enabled. | |
**pkrylov.tex | |
(./pkrylov.tex | |
LaTeX2e <2011/06/27> | |
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge | |
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi | |
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis |
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
on run {input, parameters} | |
set todoList to {} | |
repeat with theMessage in input | |
-- Grab message info. | |
tell application "Mail" | |
-- Remove apostrophes from Subject as they wreak havoc. | |
set AppleScript's text item delimiters to {"'"} |
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 | |
np=4 | |
tmpfile=`mktemp -t scalapack` | |
(( $# > 0 )) && execs="$@" || execs=`find . -type f -perm +111` | |
fmt='%12s %4s %4s\n' | |
printf "$fmt" "test" "fail" "skip" | |
for exec in ${execs[@]} | |
do | |
mpirun -np ${np} ${exec} > $tmpfile 2>&1 |
OlderNewer