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
String askUser(String question) { | |
process.write(question); | |
return process.readLine(); | |
} | |
Float? askUserForNumber(String question) => parseFloat(askUser(question)); | |
void printResult(Float(Float, Float=, Float=) operation, Float x, Float? y, Float? z) { | |
Float result; | |
if (exists y) { |
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.jclouds.ContextBuilder; | |
import org.jclouds.compute.ComputeService; | |
import org.jclouds.compute.ComputeServiceContext; | |
import org.jclouds.compute.RunNodesException; | |
import org.jclouds.compute.domain.ComputeMetadata; | |
import org.jclouds.compute.domain.NodeMetadata; | |
import org.jclouds.compute.domain.OsFamily; | |
import org.jclouds.compute.domain.Template; | |
import org.jclouds.ec2.domain.InstanceType; |
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
if (!session) { | |
session = request.getSession(true); | |
} | |
if (!session.counter) { | |
session.counter = 1 | |
} | |
html.html { | |
head { |
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
#!/usr/bin/env groovy | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.servlet.* | |
import groovy.servlet.* | |
@Grab(group='org.eclipse.jetty.aggregate', module='jetty-all', version='7.6.15.v20140411') | |
def startJetty() { | |
def server = new Server(8080) |
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
//#!/usr/bin/env groovy | |
// Change this to your projects home | |
home = "D:/Programming/Projects" | |
// Change this to where your Maven installation is located | |
mvn = "C:/Program Files (x86)/Maven/apache-maven-3.0.4" | |
if ('help' in args || 'h' in args) { | |
println """ |
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
{ | |
"results": [ | |
{ | |
"max": 1245, | |
"min": 1245, | |
"count": 3352, | |
"variable": "responseSize", | |
"resource": "http://win-srvmontest.sthlm.smartbear.local/welcome.png", | |
"average": 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
{ | |
"results": [ | |
{ | |
"resource": "http://win-srvmontest.sthlm.smartbear.local/welcome.png", | |
"minLatency": 1, | |
"maxLatency": 2, | |
"averageLatency": 1, | |
"percentile90thLatency": 2, | |
"minTimeElapsed": 1, | |
"maxTimeElapsed": 9, |
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
void traverse(Integer level, Node node, MutableMap<Integer, MutableList<Node>> nodes) { | |
value list = nodes[level] else ArrayList<Node>(); | |
nodes.put(level, list); | |
list.add(node); | |
if (exists l = node.left) { | |
print("Left of ``node.key`` is ``l.key``"); | |
traverse(level + 1, l, nodes); | |
} | |
if (exists r = node.right) { |
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
// no assets | |
{ | |
"results": [ | |
{ | |
"sent": ${sent}, | |
"averageTimeElapsed": ${avgTe}, | |
"minTimeElapsed": ${minTe}, | |
"maxTimeElapsed": ${maxTe}, | |
"averageLatency": ${avgLatency}, |
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
{"timestamp":1398694754046,"source":"main","variable":"sent","total":0,"perSecond":0} | |
{"timestamp":1398694754049,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"sent","total":0,"perSecond":0} | |
{"timestamp":1398694754477,"resource":"http://win-srvmontest.sthlm.smartbear.local/welcome.png","source":"main","variable":"sent","total":0,"perSecond":0} | |
{"timestamp":1398694754494,"source":"main","variable":"timeElapsed","count":1,"average":445,"min":445,"max":445,"percentile90th":445} | |
{"timestamp":1398694754504,"source":"main","variable":"responseSize","count":1,"average":0,"min":0,"max":0,"percentile90th":0} | |
{"timestamp":1398694755047,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"timeElapsed","count":2,"average":42,"min":5,"max":80,"percentile90th":72} | |
{"timestamp":1398694755055,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"responseSize","count":2,"average":689,"min":689,"max":689,"percentile90th":689} | |
{ |