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 A<E extends A> { | |
private String name; | |
E withName(String name) { | |
this.name = name; | |
return (E) this; | |
} | |
} | |
class B extends A<B> { | |
private String job; |
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 Example { | |
public void example() { | |
Map<String, String> map = MapUtil.asMap("key", "value").entry("key2", "value2"); | |
} | |
} |
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.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class MapUtils { | |
public static <K, V> Map<K, V> listToMap(Class<K> keyClass, List<V> list, String valueToKeyFunctionName) { | |
HashMap<K, V> map = new HashMap<K, V>(); | |
for (V value : list) { |
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
(ns testproj.exercise1 | |
(:use [clojure.test]) | |
(:use [midje.sweet]) | |
) | |
(unfinished procedures animals in-use? can-be-done?) | |
(defn on-animal [predicate arg] | |
(fn [x] (predicate arg x))) |
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
(ns test.life | |
(:use [clojure.test]) | |
(:use [midje.sweet]) | |
) | |
(unfinished ) | |
(defn neighbours [cell] | |
(map (fn [offset] (map + cell offset)) [[-1 -1] [-1 0] [-1 1] [0 -1] [0 1] [1 -1] [1 0] [1 1] ])) |
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 Test { | |
private String text; | |
public String getText() { | |
return text; | |
} | |
public class Builder { | |
boolean isBuilt = false; |
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 org.apache.commons.lang.NotImplementedException; | |
import org.apache.commons.lang.StringUtils; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
import java.sql.ResultSet; | |
import java.util.HashMap; | |
public class ResultSetMock { |
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
#!/bin/sh | |
tmux new-session -d -s miniapp -n 'Miniapp' 'ssh host1' | |
tmux split-window -t miniapp 'ssh host2' | |
#tmux split-window -t miniapp 'ssh host3' | |
tmux select-layout -t miniapp even-vertical | |
tmux set-window-option -t miniapp synchronize-panes on |
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 org.apache.commons.lang.NotImplementedException; | |
import org.apache.commons.lang.StringUtils; | |
import org.apache.commons.lang.WordUtils; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
import java.util.HashMap; | |
public class ProxyGenerator { |
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
<project> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<!-- outputFile doesn't work in the regular v1.2 (see MEXEC-86) --> | |
<version>1.2.1-BRING</version> | |
<executions> | |
<execution> |
OlderNewer