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
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 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
/** | |
* 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 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
screen -t 'errors' | |
stuff 'tail -F /var/ec/current.log | grep -A 3 "ERROR"^M' |
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
screen -t 'errors' tail -F current.log | grep -A 3 "ERROR" |
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
screen -t 'logs' tail -F current.log |
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
# 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 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
/** | |
* 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 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 class GenericsTest { | |
public void doesNotCompile() { | |
Container<String> container = new Container<String>(); | |
assertThat(container, hasSomethingWhich(is("foo"))); | |
} | |
public static class Container<T> { |
NewerOlder