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 SimpleBuilder().html { | |
head { | |
title ("Simple Groovy HTML builder") | |
body { | |
h1 ("Simple Groovy HTML builder") | |
p ("this format can be used as an alternative markup to HTML") | |
a(href: "http://groovy-lang.org","Groovy") | |
p { | |
_ ("This is some") | |
b ("mixed") |
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 indy; | |
import org.junit.Test; | |
import org.objectweb.asm.*; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.lang.invoke.*; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; |
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
def min=100000,max=0, sum=0 | |
def iterations = 10 | |
iterations.times { | |
def n = 10 | |
long t1 = System.nanoTime() | |
def r = fannkuch(n) | |
long t2 = System.nanoTime() | |
//println("Pfannkuchen(" + n + ") = " + r) | |
def t = (t2 - t1) / 1_000_000 |
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
def list = [] | |
try { | |
list.noSuchMethod() | |
assert false | |
} catch (MissingMethodException mme) { | |
assert true | |
} | |
ExpandoMetaClass.enableGlobally() |