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 groovyx.gpars.GParsPool.*; | |
IntRange.metaClass.define{ | |
random{ | |
int from = delegate.isReverse() ? to : from | |
int to = delegate.isReverse() ? from : to | |
int size = to - from + 1 | |
(Math.floor(Math.random() * size) + from) as int | |
} | |
randomList{size -> |
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 jp.group.android.atec.testter; | |
import twitter4j.http.AccessToken; | |
import jp.group.android.atec.testter.constants.Constants; | |
import jp.group.android.atec.testter.test.utility.TestConfigurationUtil; | |
import jp.group.android.atec.testter.test.utility.TestterTestResourceUtil; | |
import android.app.Activity; | |
import android.app.Instrumentation; | |
import android.app.Instrumentation.ActivityMonitor; | |
import android.content.Context; |
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(group='com.googlecode.charts4j', module='charts4j', version='1.3') | |
import com.googlecode.charts4j.*; | |
def plot1 = Plots.newBarChartPlot(Data.newData(20, 100, 10, 30), Color.BLUE) | |
def plot2 = Plots.newBarChartPlot(Data.newData(50, 80, 30, 70), Color.RED) | |
def chart = GCharts.newBarChart(plot1, plot2) | |
chart.setTitle('Sample') | |
chart.setSize(400, 300) |
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
int cVar = 51 | |
int nVar = 3 | |
import groovy.xml.MarkupBuilder | |
def writer = new StringWriter() | |
def xml = new MarkupBuilder(writer) | |
writer << '<?xml version="1.0" encoding="utf-8"?>' | |
xml.resources{ | |
(0..5).each{ r -> | |
(0..5).each{ g -> |
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 groovy.xml.MarkupBuilder | |
def writer = new StringWriter() | |
def manifest = new MarkupBuilder(writer) | |
writer << '<?xml version="1.0" encoding="utf-8"?>\n' | |
manifest.manifest( | |
'xmlns:android' : 'http://schemas.android.com/apk/res/android', | |
'package' : 'orz.mikeneck.android.inst', | |
'android:version' : '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
package orz.mikeneck.sample.bowling; | |
public class Frame { | |
public static final int MAX = 10; | |
public static final int MIN = 0; | |
private int first = 0; |
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(group='org.twitter4j', module='twitter4j-core', version='2.2.4') | |
import twitter4j.* | |
import twitter4j.auth.* | |
import twitter4j.conf.* | |
OAuthAuthorization.metaClass.define { | |
consumer {key, secret -> | |
delegate.consumerKey = key | |
delegate.consumerSecret = secret | |
delegate |
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
// define your project path | |
def projectPath = '/home/your/path/to/project' | |
// get an instance of Slim3WebXmlBuilder | |
def slim3 = new Slim3WebXmlBuilder() | |
// set your root package and create web.xml file. | |
slim3.rootPackage('your.root.package').buildXml(projectPath) |
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(group='org.twitter4j', module='twitter4j-core', version='2.2.4') | |
import twitter4j.* | |
import twitter4j.auth.* | |
import twitter4j.conf.* | |
import java.text.* | |
import java.util.TimeZone | |
def consumerKey = 'consumerKey' |
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(group='org.twitter4j', module='twitter4j-core', version='2.2.4') | |
import twitter4j.* | |
import twitter4j.auth.* | |
import twitter4j.conf.* | |
import java.text.* | |
import java.util.TimeZone | |
import static groovyx.gpars.GParsPool.*; |