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 ai.djl.modality.nlp.DefaultVocabulary; | |
import ai.djl.modality.nlp.Vocabulary; | |
import ai.djl.modality.nlp.bert.BertToken; | |
import ai.djl.modality.nlp.bert.BertTokenizer; | |
import ai.djl.modality.nlp.qa.QAInput; | |
import ai.djl.ndarray.NDArray; | |
import ai.djl.ndarray.NDList; | |
import ai.djl.ndarray.NDManager; | |
import ai.djl.translate.Batchifier; | |
import ai.djl.translate.Translator; |
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
license: gpl-3.0 | |
height: 600 |
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 doobie._ | |
import doobie.implicits._ | |
import cats.data.NonEmptyList | |
import cats.implicits._ | |
sealed abstract class UnexpectedResultSetSize(msg: String) extends Exception(msg) | |
final case object UnexpectedOptionalContinuation | |
extends UnexpectedResultSetSize(s"Expected ResultSet with zero or one row, but more rows were available.") |
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 cats.effect.syntax.all.* | |
import cats.syntax.all.* | |
import cats.effect.* | |
import fs2.Stream | |
import cats.effect.std.Queue | |
import scala.concurrent.duration.* | |
import lib.FSM | |
import lib.actor.{Actor, AskMsg} |
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
# How Akka maps to EAI Patterns | |
Might be up for debate or just plain wrong. Just some notes I scribbled down some time ago. | |
----------------------------------------------------------------------------------------------------------------- | |
EAI PATTERN AKKA PATTERN REFERENCE | |
----------------------------------------------------------------------------------------------------------------- | |
Point to Point Channel Regular Actor Communication http://www.eaipatterns.com/PointToPointChannel.html | |
Event-Driven Consumer Regular Actor Receive http://www.eaipatterns.com/EventDrivenConsumer.html | |
Message Selector Actor with Stash http://www.eaipatterns.com/MessageSelector.html |
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
package demo | |
import akka.actor.{Props, ActorSystem} | |
import akka.persistence.PersistentActor | |
object PingPong extends App { | |
case object Ball // The Command | |
case object BallReceived // The Domain Event, represents a Fact, something that have already happened | |
class Ping extends PersistentActor { |
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
package demo | |
import akka.actor.{Actor, Props, ActorSystem} | |
object PingPong extends App { | |
case object Ball | |
class Ping extends Actor { | |
var counter = 0 |
NewerOlder