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.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.ByteBufUtil; | |
import io.netty.buffer.Unpooled; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelFutureListener; | |
import io.netty.channel.ChannelHandlerContext; |
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.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import java.util.List; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelFutureListener; | |
import io.netty.channel.ChannelHandler.Sharable; | |
import io.netty.channel.ChannelHandlerContext; |
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.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import java.util.List; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelFutureListener; | |
import io.netty.channel.ChannelHandler.Sharable; |
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
data MyStateT s m a = MyStateT (s -> m (a, s)) | |
runStateT :: MyStateT s m a -> s -> m (a, s) | |
runStateT = \ (MyStateT f) s -> f s | |
get :: Monad m => MyStateT s m s | |
get = MyStateT $ \ s -> return (s, s) | |
put :: Monad m => s -> MyStateT s m () | |
put = \ s -> MyStateT $ \ s' -> return ((), s) |
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
case class Foo(s: String, n: Int) | |
class MyClient(url: URL) extends featherbed.Client(url) { | |
override def clientTransform(client: Http.Client) = { | |
client.withSessionPool.maxSize(1) | |
} | |
} | |
val client = new MyClient(new URL("http://localhost:8766/api/")) | |
val req = client.post("foo/bar") |
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 | |
def input_fn(): | |
def parse(tensor): | |
return tensor[:3], tensor[-1:] | |
ds = tf.data.Dataset.from_tensor_slices(np.random.random_sample([10,4])) | |
ds = ds.map(parse).batch(10).repeat(5) | |
return ds |
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 | |
def input_fn(): | |
def parse(tensor): | |
return tensor[:3], tensor[-1:] | |
ds = tf.data.Dataset.from_tensor_slices(np.random.random_sample([10,4])) | |
ds = ds.map(parse).batch(10).repeat(5) | |
return ds |
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 dask.array as da | |
import numpy as np | |
arr = da.from_array(np.arange(9).reshape(3,3)) | |
a = da.min(arr) | |
b = da.max(arr) | |
quantiles = da.linspace(a, b, 4) | |
print(np.array(quantiles)) | |
# Traceback (most recent call last): |
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
with import <nixpkgs> {}; | |
(let | |
my-python = | |
let packageOverrides = self: super: { | |
dask = super.dask.overridePythonAttrs (old: rec { | |
version = "2.15.0"; | |
src = super.fetchPypi { | |
inherit (old) pname; |
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
{ lib | |
, stdenv | |
, patchelf | |
, fetchurl | |
, coreutils | |
, python3 | |
, writeTextFile | |
, makeWrapper | |
, requireFile | |
, alsa-lib |
OlderNewer