Skip to content

Instantly share code, notes, and snippets.

Peerapat A nuboat

Block or report user

Report or block nuboat

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
fancellu / ConsumerExample.scala
Last active Nov 14, 2019
Kafka Producer/Consumer Example in Scala
View ConsumerExample.scala
import java.util
import org.apache.kafka.clients.consumer.KafkaConsumer
import scala.collection.JavaConverters._
object ConsumerExample extends App {
import java.util.Properties
pathikrit / SudokuSolver.scala
Last active Oct 16, 2019
Sudoku Solver in Scala
View SudokuSolver.scala
val n = 9
val s = Math.sqrt(n).toInt
type Board = IndexedSeq[IndexedSeq[Int]]
def solve(board: Board, cell: Int = 0): Option[Board] = (cell%n, cell/n) match {
case (r, `n`) => Some(board)
case (r, c) if board(r)(c) > 0 => solve(board, cell + 1)
case (r, c) =>
def cells(i: Int) = Seq(board(r)(i), board(i)(c), board(s*(r/s) + i/s)(s*(c/s) + i%s))
def guess(x: Int) = solve(board.updated(r, board(r).updated(c, x)), cell + 1)
juniorz /
Created Jul 14, 2011
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
You can’t perform that action at this time.