This file contains hidden or 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
object FunSets { | |
/** | |
* We represent a set by its characteristic function, i.e. | |
* its `contains` predicate. | |
*/ | |
type Set = Int => Boolean | |
/** | |
* Indicates whether a set contains a given element. | |
*/ |
This file contains hidden or 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 com.openwager.rtp; | |
import org.vertx.java.core.Handler; | |
import org.vertx.java.core.buffer.Buffer; | |
import org.vertx.java.core.eventbus.Message; | |
import org.vertx.java.core.http.ServerWebSocket; | |
import org.vertx.java.core.json.JsonObject; | |
import org.vertx.java.core.streams.Pump; | |
import org.vertx.java.platform.Verticle; |
This file contains hidden or 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
@Test | |
public void testWebSocketServer() { | |
long startTime; | |
long endTime; | |
startTime = System.currentTimeMillis(); | |
container.logger().info("Starting web socket test"); | |
HttpClient client = vertx.createHttpClient().setPort(8081).setHost("localhost").setMaxPoolSize(CONNS); | |
for (int i = 0; i < CONNS; i++) { |
This file contains hidden or 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
/* | |
* Example JavaScript integration test that deploys the module that this project builds. | |
* | |
* Quite often in integration tests you want to deploy the same module for all tests and you don't want tests | |
* to start before the module has been deployed. | |
* | |
* This test demonstrates how to do that. | |
*/ | |
load("util.js"); |
This file contains hidden or 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 map-reduce example | |
// declare a closure | |
def half = { it -> | |
it / 2 | |
} | |
// declare another closure | |
def sum = { result, i -> | |
result + i |