Skip to content

Instantly share code, notes, and snippets.

View ivportilla's full-sized avatar

Ivan Portilla ivportilla

View GitHub Profile
case class Dni(src: String, parsed: String) {
override def equals(obj: scala.Any): Boolean = obj match {
case dni: Dni => dni.src == src || dni.parsed == parsed
case dni: String => dni == src || dni == parsed
case _ => false
}
override def toString: String = src
}
/* Data definition */
trait DocumentInfo {
val title: String
}
case class D1(title: String, content: String) extends DocumentInfo
case class D2(title: String, count: Int) extends DocumentInfo
/* -------------- */
/* Type Class */
import java.awt.Dimension
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import javax.swing.JFrame
import scala.collection.immutable
import scala.concurrent.duration._
import akka.actor._
import akka.stream._
import scala.util._
import akka.actor._
import akka.stream._
import akka.stream.scaladsl._
import akka.util._
object SimpleTcpServer extends App {
val address = "127.0.0.1"