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 DiamondProblem implements IHoge, IPiyo { | |
public static void main(String[] args) { | |
System.out.println(new DiamondProblem().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
mkdir ~/hoge | |
mkdir work | |
cd work | |
echo "class Hoge { public static void main(String... args) { System.out.println(1); } }" > Hoge.java | |
echo "class Fuga { public static void main(String... args) { System.out.println(2); } }" > Fuga.java | |
javac Hoge.java Fuga.java | |
jar cvf Hoge.jar Hoge.class | |
jar cvf Fuga.jar Fuga.class | |
mv ./*.jar ~/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
(https://github.com/irof/sandbox/tree/blog/20150501/jaxrs/jersey をちょっと削ったの) | |
% gradle dependencies --configuration testCompile :jersey:dependencies | |
------------------------------------------------------------ | |
Project :jersey | |
------------------------------------------------------------ | |
testCompile - Compile classpath for source set 'test'. | |
+--- org.glassfish.jersey.core:jersey-server:2.17 |
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.time.LocalDateTime; | |
import java.util.Date; | |
import static org.junit.Assert.assertFalse; | |
/** | |
* @author irof | |
*/ | |
public class DateAndDateTimeTest { | |
@org.junit.Test |
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 tddbc; | |
import static org.junit.Assert.*; | |
import static org.hamcrest.CoreMatchers.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.junit.Test; |
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 Hello {void hello(){println "1"}} | |
def a = new Hello() | |
def b = new Hello() | |
b.metaClass.hello = { println "2" } | |
a.hello() | |
b.hello() | |
a.metaClass.hello = {b.metaClass.hello} | |
a.hello() |
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 Hello {void hello(){println "1"}} | |
def a = new Hello() | |
a.hello() | |
a.metaClass.hello = { println "2" } | |
a.hello() | |
a.metaClass.hello = { a.&hello() } | |
a.hello() |
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 C {int m(){1}} | |
C.metaClass.m = {9} | |
def a = new C() | |
assert 9 == a.m() | |
a.metaClass.m = {2} | |
assert 2 == a.m() | |
C.metaClass.m = {8} |
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
new File("src").eachFileRecurse(groovy.io.FileType.FILES) { | |
def s = it.text.replaceAll(/\r\n?/,'\n') | |
it.withWriter("UTF-8") {it << s} | |
} |
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("org.twitter4j:twitter4j-core:2.2.3") | |
import twitter4j.* | |
def twitter = new TwitterFactory().instance | |
twitter.getUserListStatuses( | |
twitter.getAllUserLists('kyon_mm').find{it.name == 'groovy'}.id, new Paging() | |
).each { println "<@${it.user.screenName}> $it.text" } |
OlderNewer