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.example.tryRxVertx; | |
import io.vertx.core.AbstractVerticle; | |
import io.vertx.core.shareddata.AsyncMap; | |
public class CallbackHellSetter extends AbstractVerticle { | |
@Override | |
public void start() throws Exception { | |
vertx.setPeriodic(300, event -> { | |
vertx.sharedData().<String,Long>getClusterWideMap("mymap", resOfGetMap -> { |
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.example; | |
import io.vertx.core.AbstractVerticle; | |
import io.vertx.core.eventbus.Message; | |
import io.vertx.core.json.JsonObject; | |
import io.vertx.core.logging.Logger; | |
import io.vertx.core.logging.LoggerFactory; | |
import java.util.HashSet; |
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.example; | |
import io.vertx.core.Vertx; | |
/** | |
* Created by developer on 29.04.16. | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
Vertx vertx = Vertx.vertx(); |
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
import java.util.Arrays; | |
import java.util.stream.IntStream; | |
public class Puzzle { | |
public static int[] unpack(int x){ | |
return IntStream.iterate(x, i -> i/10).limit(8).map(i->i%10).toArray(); | |
} | |
private static boolean isSolution(int[] variables) { | |
return (variables[5]!=0) && | |
(variables[0] + variables[1] - 9 == 4) |
NewerOlder