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
module Foo | |
end | |
remove_const ::Foo |
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
// Make sure you have a directory which has a space in it's name, e.g: | |
File f = new File("/home/tim/dir foo/foo.txt"); | |
System.out.println("exists?" + f.exists()); // 'exists?true' | |
// Convert it to a file URL | |
URL url = f.toURI().toURL(); | |
System.out.println("url is:" + url); // 'url is:file:/home/tim/dir%20foo/foo.txt' - space has been correctly URL encoded | |
// Now convert the url back to a file name |
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
function foo() { | |
// do something | |
console.log("hello"); | |
bar(); | |
} | |
function bar() { | |
nettyEventLoop.runTaskOnLoop(foo) | |
} |
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
// Clearly this won't actually work since obs2 would need to be final but then you can't assign it inside the handler | |
MyEventBus eb = new MyEventBus(); | |
Observable obs1 = eb.send("foo", "msg1"); | |
Observable obs2; | |
obs1.subscribe(new Action1<String>() { | |
@Override | |
public void call(String str) { |
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
io.netty.channel.ChannelException: Unable to create Channel from class class io.netty.channel.socket.nio.NioServerSocketChannel | |
at io.netty.bootstrap.AbstractBootstrap$BootstrapChannelFactory.newChannel(AbstractBootstrap.java:436) | |
at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:289) | |
at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:271) | |
at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:267) | |
at io.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:43) | |
at org.vertx.java.core.http.impl.DefaultHttpServer.listen(DefaultHttpServer.java:205) | |
at org.vertx.mods.WebServer.start(WebServer.java:80) | |
at org.vertx.java.platform.impl.DefaultPlatformManager$16.run(DefaultPlatformManager.java:1122) | |
at org.vertx.java.core.impl.DefaultContext$2.run(DefaultContext.java:143) |
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 deployModule(String moduleName, Map<String, Object> config = [:], int instances = 1, Closure doneHandler = {}) { | |
} | |
deployModule("foo", {} ) | |
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
tim@tim-laptop ~/projects/dynjs-vertx-module $ rm -rf ~/.m2/repository/org/projectodd/rephract ~/.m2/repository/org/dynjs/dynjs | |
tim@tim-laptop ~/projects/dynjs-vertx-module $ mvn clean install -s support/settings.xml -B -q | |
------------------------------------------------------- | |
T E S T S | |
------------------------------------------------------- | |
Running org.vertx.lang.dynjs.integration.APIIntegrationTests | |
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory). | |
log4j:WARN Please initialize the log4j system properly. | |
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. |
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.vertx.java.core.Handler; | |
import org.vertx.java.core.net.NetSocket; | |
import org.vertx.java.core.streams.Pump; | |
import org.vertx.java.core.sockjs.*; | |
import org.vertx.java.platform.Verticle; | |
import org.vertx.java.core.buffer.*; | |
import org.vertx.java.core.json.*; | |
import org.vertx.java.core.http.*; | |
public class Example extends Verticle { |
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
SEVERE: Unhandled exception | |
java.lang.UnsupportedOperationException | |
at io.netty.buffer.DefaultCompositeByteBuf.nioBuffer(DefaultCompositeByteBuf.java:990) | |
at io.netty.buffer.SlicedByteBuf.nioBuffer(SlicedByteBuf.java:262) | |
at io.netty.buffer.DefaultCompositeByteBuf.nioBuffer(DefaultCompositeByteBuf.java:988) | |
at io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:967) | |
at io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:956) | |
at io.netty.handler.codec.http.multipart.MemoryAttribute.getValue(MemoryAttribute.java:47) | |
at org.vertx.java.core.http.impl.DefaultHttpServerRequest$InternalMemoryAttribute.attributeCreated(DefaultHttpServerRequest.java:527) | |
at org.vertx.java.core.http.impl.DefaultHttpServerRequest$InternalMemoryAttribute.addContent(DefaultHttpServerRequest.java:552) |
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 someAsyncOperation(String str, Handler<Void> handler) {} | |
public void foo() { | |
int count = 10; | |
final MyBarrier barrier = new MyBarrier(new VoidHandler() { | |
@Override | |
protected void handle() { |