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 controllers | |
import javax.inject._ | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.mvc.Results._ | |
import PlayNativeActions._ | |
import Workaround._ | |
import WorkAroundImplementations._ |
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 org.nd4j.linalg.util.NDArrayUtil | |
val arr = Array(Array(0, 0), Array(0, 0), Array(0, 0)) | |
println(s"width: ${arr.length}") // 3 | |
println(s"height: ${arr(0).length}") // 2 | |
val ndArr = NDArrayUtil.toNDArray(arr) | |
println(s"width: ${ndArr.columns()}") // 3 | |
println(s"height: ${ndArr.rows()}") // 1 | |
println(ndArr.data().toString) // [0.0,0.0,0.0,0.0,0.0,0.0] | |
println(ndArr.shapeInfoToString()) // [1, 3] |
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.data.ReaderT | |
import cats.implicits.{catsStdInstancesForFuture, _} | |
import cats.{Applicative, Monad} | |
import scala.concurrent.ExecutionContext.global | |
import scala.concurrent.duration._ | |
import scala.concurrent.{Await, ExecutionContext, Future} | |
object Foo extends App { |
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
for { | |
num <- 1 to 100 | |
} yield { | |
if (num % 3 == 0) print("Fizz") | |
if (num % 5 == 0) print("Buzz") | |
if (num % 3 != 0 && num % 5 != 0) print(num) | |
print("\n") | |
} | |
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 akka.util.Timeout | |
import scala.concurrent.duration._ | |
import scala.concurrent.{Await, Future} | |
object Foo extends App { | |
Classic.run() | |
Typed.run() |
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.data.Coproduct | |
import cats.free.{Free, Inject} | |
import cats.{Id, ~>} | |
object another extends App { | |
sealed trait CRUD[A] | |
case class Create(a: Foo) extends CRUD[Int] | |
case class Read(id: Int) extends CRUD[Foo] | |
case class Update(a: Foo) extends CRUD[Unit] |
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.free.Free | |
import cats.{Id, ~>} | |
import freek._ | |
object freekfoo extends App { | |
sealed trait CRUD[A] | |
case class Create(a: Foo) extends CRUD[Int] | |
case class Read(id: Int) extends CRUD[Foo] | |
case class Update(a: Foo) extends CRUD[Unit] |
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.{Id, Monad} | |
import cats.free.Free | |
import io.aecor.liberator.{FreeAlgebra, ProductKK} | |
import io.aecor.liberator.macros.free | |
import cats.implicits._ | |
object Main extends App { | |
case class Foo(id: Int, content: 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
import cats.Id | |
import cats.free.Free | |
import freestyle._ | |
import freestyle.implicits._ | |
import cats.implicits._ | |
object Main extends App { | |
case class Foo(id: Int, content: 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
import io.circe.Encoder | |
import shapeless.Unwrapped | |
import io.circe.derivation | |
import io.circe.syntax._ | |
object Main extends App { | |
case class FooId(value: String) extends AnyVal | |
case class Foo(id: FooId, bar: String) |
OlderNewer