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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>asgard</groupId> | |
<artifactId>asgard</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<inceptionYear>2008</inceptionYear> | |
<licenses> | |
<license> |
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.apache.commons.lang3.builder.ToStringBuilder; | |
import org.apache.commons.lang3.builder.ToStringStyle; | |
import org.deeplearning4j.nn.api.OptimizationAlgorithm; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.deeplearning4j.nn.conf.layers.DenseLayer; | |
import org.deeplearning4j.nn.gradient.Gradient; | |
import org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.deeplearning4j.nn.weights.WeightInit; | |
import org.deeplearning4j.nn.workspace.LayerWorkspaceMgr; | |
import org.deeplearning4j.optimize.listeners.ScoreIterationListener; |
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.deeplearning4j.nn.conf.ComputationGraphConfiguration; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.deeplearning4j.nn.conf.layers.DenseLayer; | |
import org.deeplearning4j.nn.gradient.Gradient; | |
import org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.deeplearning4j.nn.weights.WeightInit; | |
import org.deeplearning4j.nn.workspace.LayerWorkspaceMgr; | |
import org.deeplearning4j.optimize.listeners.ScoreIterationListener; | |
import org.nd4j.linalg.activations.Activation; | |
import org.nd4j.linalg.api.ndarray.INDArray; |
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
/** | |
* > arr = {1, 2, 3}, size = 5 | |
* < [1.0, 1.5, 2.0, 2.5, 3.0] | |
* @param arr | |
* @param newSize | |
* @return | |
*/ | |
public static double[] growIntermediate(double[] arr, int newSize) { | |
if (newSize < arr.length) { | |
throw new IllegalArgumentException("newSize lower than array length"); |
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 __main__ (int var0) | |
vars: int var1, int var2, int var3 | |
var2 = 2 | |
if (((var0 - 2) % 3) == 0) | |
var1 = 1 | |
else | |
var1 = 0 | |
var3 = 1 | |
for(; (var3<var0); var3 = (var3 + 1)) | |
if (var2<var0) |
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
static class CacheOp implements Op<Double> { | |
private final AtomicDouble ref; | |
public CacheOp(int i) { | |
ref = new AtomicDouble(i); | |
} | |
public CacheOp() { | |
this(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
import static java.util.stream.IntStream.range; | |
import static java.util.stream.IntStream.rangeClosed; | |
private List<String> possibleNgrams(String[] words) { | |
return rangeClosed(1, words.length) | |
.mapToObj( | |
window -> | |
rangeClosed(0, words.length - window) | |
.mapToObj( | |
i -> |
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
public static Observable<Long> write(Path target, InputStream inputStream) { | |
return Observable.create(subscriber -> { | |
try { | |
final AtomicLong offset = new AtomicLong(0); | |
AsynchronousFileChannel afc = AsynchronousFileChannel.open(Utils.home.resolve(target), StandardOpenOption.WRITE, | |
StandardOpenOption.CREATE); | |
afc.lock(new Object(), new CompletionHandler<FileLock, Object>() { | |
@Override | |
public void completed(final FileLock lock, final Object attachment) { | |
log.debug("write:{} acquired lock", target); |
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 io.netty.buffer.ByteBuf; | |
import io.netty.handler.codec.http.HttpMethod; | |
import io.netty.handler.logging.LogLevel; | |
import io.netty.handler.proxy.HttpProxyHandler; | |
import io.reactivex.netty.protocol.http.client.HttpClient; | |
import io.reactivex.netty.protocol.http.client.HttpClientResponse; | |
import org.junit.Ignore; | |
import org.junit.Test; | |
import rx.Observable; |
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 java.net.MalformedURLException; | |
import java.nio.charset.Charset; | |
import java.util.Random; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.Unpooled; | |
import io.reactivex.netty.RxNetty; | |
import io.reactivex.netty.protocol.http.client.HttpClientRequest; | |
import rx.Observable; |
NewerOlder