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
public class GenericsTest { | |
public void doesNotCompile() { | |
Container<String> container = new Container<String>(); | |
assertThat(container, hasSomethingWhich(is("foo"))); | |
} | |
public static class Container<T> { |
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
/** | |
* Testing claims made in | |
* http://stackoverflow.com/questions/4346521/what-are-the | |
* -dangers-in-upgrading-to-java-1-5-and-beyond/4346599#4346599 | |
* | |
* @date Dec 3, 2010 | |
*/ | |
public class ClassLoadingTest { |
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
# window 1 | |
chdir /home/matt/code/project/logs | |
screen -t 'logs' | |
# window 2 | |
chdir /home/matt/code/project/logs | |
screen -t 'errors' | |
# window 3 | |
chdir /home/matt/code/project |
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
screen -t 'logs' tail -F current.log |
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
screen -t 'errors' tail -F current.log | grep -A 3 "ERROR" |
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
screen -t 'errors' | |
stuff 'tail -F /var/ec/current.log | grep -A 3 "ERROR"^M' |
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
/** | |
* Code sample for http://stackoverflow.com/questions/5877226/better-way-to-check-if-a-joda-time-interval-spans-exactly-1-calendar-week-accoun | |
* @author: matt b | |
* @since: 5/4/11 | |
*/ | |
public class JodaTimeWeekPeriodTest { | |
public static void main(String[] args) { | |
DateTime start = new DateTime(2011, 5, 4, 0, 0, 0, 0); |
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
octave-3.4.0:1> a = [ 1 2 3 4] | |
a = | |
1 2 3 4 | |
octave-3.4.0:2> mean(a) | |
ans = 2.5000 | |
octave-3.4.0:3> b = (a == 2) | |
b = |
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
fs = require 'fs' | |
unless process.argv.length > 2 | |
console.error "Usage: print_times <file>" | |
process.exit -1 | |
fileName = process.argv[2] | |
String::endsWith = (ch) -> | |
return @length - 1 == @lastIndexOf(ch) |
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
InputStream inputstream = process.getInputStream(); | |
BufferedReader br = new BufferedReader(new InputStreamReader(inputstream)); | |
String line; | |
while ((line = br.readLine()) != null) { | |
// handle the new line of input from the process however you want | |
gsc.mainWindow.printf("Got another line! " + line); | |
// do anything else you want with the input - send it as many places as you like | |
} |
OlderNewer