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/bash | |
# This script must be run from within the working copy of the repository | |
# Get the revision number for the HEAD of the repository | |
svn info -r HEAD | awk '/^Revision:/ {print $2}' |
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/bash | |
# This script is going to find all files below the current directory of the given type | |
ftype=$1 | |
find ./ | awk "/${ftype}$/ {print \$0}" | sed -e 's/\/\//\//' | |
exit 0 |
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/bash | |
# Given a filename and a revision number, find the revision number previous to this one. | |
fname=$1 | |
curr=$2 | |
prev="" | |
for revnum in `svn log -q $fname | awk '/^r/ {print $1}' | sed -e 's/r//' | sort -n` | |
do |
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/bash | |
# Given a file, output a sorted list of unique items with the number of occurrences for each item next to it | |
fname=$1 | |
cat $fname | sort | uniq -c | |
exit 0 |
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
public char[] getFileContents(File file) { | |
// char array to store the file contents in | |
char[] contents = null; | |
try { | |
// Read in the contents line by line storing them in a StringBuffer | |
BufferedReader br = new BufferedReader(new FileReader(file)); | |
StringBuffer sb = new StringBuffer(); | |
String line = ""; |
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
public CompilationUnit createParser(char[] contents) { | |
// Create the ASTParser which will be a CompilationUnit | |
ASTParser parser = ASTParser.newParser(AST.JLS4); | |
parser.setKind(ASTParser.K_COMPILATION_UNIT); | |
parser.setSource(contents); | |
parser.setResolveBindings(true); | |
CompilationUnit parse = (CompilationUnit) parser.createAST(null); | |
return parse; |
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
# Convert a CSV like the following: | |
# a,b,c,d,e,f,g | |
# To the LaTeX table format like the following: | |
# {a} & {b} & {c} & {d} & {e} & {f} & {g} \\\hline | |
sed 's/,/} \& {/g' Table1.csv | sed 's/^/{/' | sed 's/$/} \\\\\\hline/' > Table1Format.txt |
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
cat rsvpresults.yaml | grep 'totalPeople' | sed 's/totalPeople: //' | awk '{s+=$1} END {print s}' |
OlderNewer