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 final class DynamicClassLoader { | |
private final URLClassLoader classLoader; | |
private final Method addUrlMethod; | |
public DynamicClassLoader(URLClassLoader loader) { | |
classLoader = loader; | |
addUrlMethod = getAddUrlMethod(); | |
} |
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 logging | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.contrib import layers | |
GO_TOKEN = 0 | |
END_TOKEN = 1 | |
UNK_TOKEN = 2 |
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 numpy as np | |
import tensorflow as tf | |
from tensorflow.python.layers import core as layers_core | |
hparams = tf.contrib.training.HParams( | |
batch_size=3, | |
encoder_length=4, | |
decoder_length=5, | |
num_units=6, | |
src_vocab_size=7, |
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.util.* | |
inline fun <T, R> T.ifNotNull(callback: T.() -> R): R? { | |
return this?.callback() | |
} | |
sealed class Tree<T> { | |
abstract val value: T; |
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
interface VersionedTable { | |
val versionColumn: Column<Int> | |
} | |
fun <T> T.updateWithVersion(where: (SqlExpressionBuilder.() -> Op<Boolean>)? = null, | |
version: Int, | |
limit: Int? = null, | |
body: T.(UpdateStatement) -> Unit | |
): Int where T : Table, T : VersionedTable { | |
val whereClauseWithVersion: (SqlExpressionBuilder.() -> Op<Boolean>) = { |