Skip to content

Instantly share code, notes, and snippets.

Oleg Skovpen oskoi

Block or report user

Report or block oskoi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View slick-example.scala
object Main extends App {
val category = TableQuery[Category]
val db = Database.forURL("jdbc:mysql://", driver="com.mysql.jdbc.Driver", user="user1", password="")
val setup = DBIO.seq(
category += (1, "ELECTRONICS", None),
category += (2, "TELEVISIONS", Some(1)),
category += (3, "TUBE", Some(2)),
category += (4, "LCD", Some(2)),
category += (5, "PLASMA", Some(2)),
oskoi / simple-akka-streams.scala
Created Nov 14, 2015
Realisation simple akka-streams with broadcast.
View simple-akka-streams.scala
import{ClosedShape, ActorMaterializer}
import akka.util.ByteString
* Created by oskovpen on 15/11/2015.
oskoi / n-queen.scala
Last active Nov 13, 2015
Solution to n-queen problem on Scala. PS. From book Scala by Example, Martin Odersky, 2014
View n-queen.scala
def queens(n: Int): List[List[Int]] = {
def placeQueens(k: Int): List[List[Int]] =
if (k == 0) List(List())
else for { queens <- placeQueens(k - 1)
column <- List.range(1, n + 1)
if isSafe(column, queens, 1) } yield column :: queens
def isSafe(col: Int, queens: List[Int], delta: Int): Boolean =
You can’t perform that action at this time.