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
package main | |
import "net" | |
func main() { | |
net.Dial("tcp", "google.com:80") | |
} |
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
ldd test | |
not a dynamic executable |
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
[raft] 2015/05/12 22:34:35 leader[2]: leaderLoop: send heartbeat: index: idx=4, idxs=[4] | |
[raft] 2015/05/12 22:34:35 leader[2]: leaderLoop: send heartbeat: index: idx=4, idxs=[4 4] | |
panic: test timed out after 1m0s | |
goroutine 503 [running]: | |
testing.func·008() | |
/usr/local/Cellar/go/1.4.2/libexec/src/testing/testing.go:681 +0x12f | |
created by time.goFunc | |
/usr/local/Cellar/go/1.4.2/libexec/src/time/sleep.go:129 +0x4b |
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 TooSmall { | |
public static void main(String[] args) { | |
double start = 0.1; | |
double tooSmall = 1.0e-18; | |
for (int i = 0; i < 1_000_000_000; i++) { | |
start += tooSmall; | |
} | |
System.out.println(start == 0.1); // TRUE | |
} | |
} |
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 java.util.Comparator; | |
public class Quicksort { | |
public static void sort(Comparable<?>[] data, int left, int right) { | |
if (left < right) { | |
int pi = partition(data, left, right); | |
sort(data, left, pi-1); | |
sort(data, pi+1, right); | |
} | |
} |
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 java.util.Stack; | |
public class StackedQuicksort { | |
public static void sort(Comparable<?>[] data, int left, int right) { | |
Stack<Integer> stack = new Stack<>(); | |
stack.push(left); | |
stack.push(right); | |
while (!stack.empty()) { | |
right = stack.pop(); | |
left = stack.pop(); |
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 java.util.ArrayList; | |
import java.util.Iterator; | |
public class ForEach { | |
public ForEach() { | |
} | |
public static void main(String[] var0) { | |
ArrayList var1 = new ArrayList(); | |
Iterator var2 = var1.iterator(); |
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 static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
public class ProgrammaticJUnit { | |
@Test public void test1() { | |
assertEquals(3, 1+2); | |
} | |
@Test public void test2() { | |
assertEquals(8, 3*3); // INTENTIONAL FAIL | |
} |
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
package main | |
import ( | |
"flag" | |
"log" | |
"runtime" | |
"sync" | |
"testing" | |
) |
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
class Ninja{private final String test="This is just a test String";private Ninja(){}public String getTest(){return test;}} |