This file contains hidden or 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 | |
| from xml.etree.ElementTree import * | |
| from optparse import OptionParser | |
| def get_xypoints(node): | |
| xpoints = [] | |
| ypoints = [] | |
| for e in node.findall(".//void[@class='java.awt.Point'][@method='getField']"): | |
| e_name = e.find("string") |
This file contains hidden or 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 | |
| found=false | |
| for file in /etc/redhat-release /etc/SuSE-release; do | |
| if [ -f "$file" ]; then | |
| cat "$file" | head -1 | |
| found=: | |
| break | |
| fi | |
| done |
This file contains hidden or 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
| # my_system($command, $timeout = 10) [Unix] | |
| sub my_system($;$) { | |
| use POSIX qw(:sys_wait_h); | |
| my $command = $_[0]; | |
| my $timeout = $_[1] || 10; | |
| my $pid = fork(); | |
| if (!defined($pid)) { | |
| return -1; # failed to fork |
This file contains hidden or 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
| (* | |
| * FORM.m | |
| * | |
| * Executes a FORM program in Mathematica. | |
| * | |
| * https://gist.githubusercontent.com/tueda/e3a2cc73fbed2a8e2ae4/raw/FORM.m | |
| * | |
| * Example: | |
| * | |
| * << FORM` |
This file contains hidden or 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 perl | |
| ## | |
| # @file pform | |
| # | |
| # pform - (pre)preprocessor of FORM | |
| # | |
| # Copyright (c) 2011 Takahiro Ueda | |
| # |
This file contains hidden or 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 | |
| """:" . | |
| exec python "$0" "$@" | |
| """ | |
| import argparse | |
| import math | |
| import os | |
| import sys |
This file contains hidden or 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 | |
| # Get the last commit date from the repository. | |
| if [ -d .git ] || [ -d ../.git ] || [ -d ../../.git ] || [ -d ../../../.git ] || [ -d ../../../../.git ] ; then | |
| date=`git log -1 --format=%ci` | |
| elif [ -d .svn ]; then | |
| date=`svn info | grep '^Last Changed Date:' | sed 's/.*Last Changed Date: *\([^(]*\)(.*/\1/'` | |
| elif [ -d CVS ]; then | |
| date=`cvs log -N 2>/dev/null | grep '^date:' | sort | tail -n 1 | sed 's/.*date: *\([^;]*\);.*/\1/' | sed 's|/|-|g'`' +0000' | |
| else |
This file contains hidden or 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 | |
| # | |
| # @file math.sh | |
| # | |
| # A launcher for Mathematica programs. | |
| # | |
| # Example: | |
| # math.sh variable=string-value file.m | |
| # | |
| set -e |
This file contains hidden or 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 | |
| """:" . | |
| exec python "$0" "$@" | |
| """ | |
| from __future__ import print_function | |
| import argparse | |
| import copy |
This file contains hidden or 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 cProfile -o output.pstats path/to/your/script arg1 arg2 | |
| gprof2dot.py -f pstats output.pstats | dot -Tpdf -o output.pdf |