- Message yourself
/slackdevtools
- In the DevTools console:
function addStyle (styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
}
addStyle(`
import asyncio | |
from concurrent import futures | |
import functools | |
import inspect | |
import threading | |
from grpc import _server | |
def _loop_mgr(loop: asyncio.AbstractEventLoop): |
class AttentionWithContext(Layer): | |
""" | |
Attention operation, with a context/query vector, for temporal data. | |
Supports Masking. | |
Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] | |
"Hierarchical Attention Networks for Document Classification" | |
by using a context vector to assist the attention | |
# Input shape | |
3D tensor with shape: `(samples, steps, features)`. | |
# Output shape |
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor): | |
""" | |
A version of :class:`concurrent.futures.ThreadPoolExecutor` that | |
always uses native threads, even when threading is monkey-patched. | |
.. versionadded:: 1.2a1 | |
""" | |
def __init__(self, max_workers): | |
super(ThreadPoolExecutor, self).__init__(max_workers) |
#author : Sujit Pal | |
#Note: this is a python3 updated version of http://sujitpal.blogspot.fr/2014/12/semantic-similarity-for-short-sentences.html | |
# by mathieu Chrétien ([email protected]) | |
#contributor : Mathieu Chrétien | |
from __future__ import division | |
import nltk | |
from nltk.corpus import wordnet as wn |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Control.Applicative | |
import Control.Monad.IO.Class | |
import Data.Aeson |
import cats._ | |
import cats.data._ | |
import cats.implicits._ | |
trait IO[A]{self => | |
def run: A | |
def map[B](f: A =>B): IO[B] = { | |
new IO[B]{def run = f(self.run)} | |
} |
type Game[A] = StateT[IO,GameState, A] | |
val initState = GameState("apples","",10,3) | |
def liftIO[A](ioa: IO[A]) = StateT.lift[IO, GameState,A](ioa) | |
def runGame(): Game[Unit] = { | |
for { |
using UnityEngine; | |
using System.Collections; | |
public class Shooter : MonoBehaviour { | |
public Rigidbody bullet; | |
public float power = 1500f; | |
public float moveSpeed = 2f; | |
// Update is called once per frame | |
void Update () { |
import Control.Applicative | |
import Data.Traversable | |
import Lens.Family (to) | |
import Control.Foldl (Fold) | |
import Data.Text (Text) | |
import Prelude hiding (lines, words) | |
import qualified Control.Foldl as Fold | |
import qualified Control.Foldl.Text as Fold.Text | |
import qualified Data.Text as Text |