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 sbt.Keys._ | |
lazy val commonSettings = Seq( | |
name := "shading-issue", | |
version := "0.1", | |
scalaVersion in ThisBuild := "2.11.8" | |
) | |
lazy val `dummy` = (project in file(".")) | |
.settings(commonSettings: _*) |
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 com.lightbend.lagom.scaladsl.testkit.ServiceTest._ | |
private def withDefaultClient(testCode: (MyService) => Any): Unit = { | |
withServer(ServiceTest.defaultSetup) { ctx => | |
new MyApplication(ctx) with LocalServiceLocator { | |
// whatever your Application Cake should look like... | |
} | |
} { server => | |
// Client for your service | |
val client = server.serviceClient.implement[MyService] |
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
from unittest import TestCase | |
from nltk import FeatureEarleyChartParser, load, word_tokenize | |
class ParserTestCase(TestCase): | |
def setUp(self): | |
self.grammar = load("file:{0}".format("./grammar.fcfg")) | |
self.parser = FeatureEarleyChartParser(self.grammar, trace=0) | |
def __should_parse(self, sentence): |
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 com.lightbend.lagom.scaladsl.api.transport.Forbidden | |
import com.lightbend.lagom.scaladsl.api.{Service, ServiceCall} | |
import com.lightbend.lagom.scaladsl.server.PlayServiceCall | |
import play.api.libs.openid.{OpenIdClient, UserInfo} | |
import play.api.mvc.EssentialAction | |
import scala.concurrent.{ExecutionContext, Future} | |
/** | |
* A trait which will provide OpenID authentication when provided with an OpenID client. |
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
// Tried with 2.11.8, 2.12.3, 2.12.4 | |
scalaVersion in ThisBuild := "2.12.3" | |
// Tried with scoverage 1.5.1, 1.6.0-M3 | |
// Tried with sbt 1.0.4, 1.1.1 | |
lazy val commonSettings = Seq( | |
parallelExecution in Test := false, | |
organization := "com.example.blah" | |
) |
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
override def registerUser(): ServiceCall[requests.RegisterUser, UUID] = ServerServiceCall { req => | |
repository.emailHasBeenRegistered(req.email).flatMap { beenRegistered => | |
logger.debug(s"Email ${req.email} has been registered? $beenRegistered") | |
if (!beenRegistered) { | |
val id = UUID.randomUUID() | |
logger.debug(s"Registering user $id") | |
userEntityFor(id) | |
.ask(InternalRegisterCommand(id, req.firstName, req.lastName, req.email, req.password)) | |
} else { | |
logger.warn(s"Email ${req.email} has already been registered") |
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 faust | |
from faust import TopicT | |
import asyncio | |
class MyBlockingService(faust.Service): | |
def __init__(self, success_topic: TopicT, *args): | |
super().__init__(*args) | |
self.success_topic = success_topic |
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
use "ponytest" | |
use "ponycheck" | |
class iso AdditionAssociativeProperty is UnitTest | |
fun name(): String => "u8/addition-associative" | |
fun apply(h: TestHelper)? => | |
let g = recover val Generators.zip3[U8, U8, U8]( | |
Generators.u8(), Generators.u8(), Generators.u8() |
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
use "ponytest" | |
use "ponycheck" | |
use ".." | |
interface val _TestSemigroupAssociativity[T] is UnitTest | |
fun semigroup(): Semigroup[T] | |
fun t(): String |
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
<!DOCTYPE html> | |
<html lang="fa"> | |
<head> | |
<title>displaCy</title> | |
</head> | |
<body style="font-size: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; padding: 4rem 2rem; direction: rtl"> | |
<figure style="margin-bottom: 6rem"> | |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="fa" id="6cc1af9f34a64a4592fa784da0aa419f-0" class="displacy" width="3650" height="887.0" direction="rtl" style="max-width: none; height: 887.0px; color: #000000; background: #ffffff; font-family: Arial; direction: rtl"> | |
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="797.0"> |
OlderNewer