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 org.mikeneck.twr.api; | |
import org.mikeneck.twr.exception.*; | |
/** | |
* @author : mike | |
* @since : 12/12/26 | |
*/ | |
public enum ExecutionPatterns { |
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.Arrays; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
public class ComparatorSample { | |
public static void main(String... args) throws Exception { | |
List<String> list = Arrays.asList("bbbb", "a", "aaa", "bb"); |
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.*; | |
public class Hoge { | |
static class Fuga { | |
final String color; | |
final int weight; | |
Fuga(String color, int weight) { | |
this.color = color; | |
this.weight = weight; |
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 Hoge extends RuntimeException implements Fuga.Hoge<Hoge> { | |
Hoge Hoge; | |
Hoge() { | |
throw Hoge(Hoge); | |
} | |
public Hoge Hoge() { | |
Hoge Hoge = new Hoge(); | |
return Hoge.Hoge(this.Hoge); |
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
"xxxxx".tr('a-z', 'c-xab') |
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 httpserver; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
import java.io.Writer; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; |
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
// プログラミングGROOVY P69 | |
list = ['x'] | |
def gs = "$list ${list[0]}" | |
assert gs instanceof GString | |
assert gs == '[x] x' | |
list[0]='y' | |
assert gs == '[y] 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
RubyでJavaのpackage-info.javaを一括生成するスクリプト | |
http://d.hatena.ne.jp/tbpg/20120808/1344447924 | |
をGroovyにしてみた。 |
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
@Grab('junit:junit:4.10') | |
import org.junit.* | |
public class HogeTest { | |
@Test | |
public void ふつうのテスト() { | |
assert 1 == 2 | |
} |
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
type Tuna = String | |
type Tea = String | |
type Ginger = String | |
gab_km :: Tuna -> Tea -> Ginger | |
gab_km "中トロ" "緑茶" = "ガリ" | |
gab_km "中トロ" _ = "緑茶よこせ" | |
gab_km _ "緑茶" = "中トロよこせ" | |
gab_km _ _ = "こんなもん喰えるか!" |