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
@nuboat
nuboat / Main.scala
Created Oct 1, 2018
Hangman 2 with Scala Akka
View Main.scala
package in.norbor.bigbears.hangman2
import akka.actor.{ActorRef, ActorSystem, Props}
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.io.StdIn
import scala.language.postfixOps
View Natherine.scala
print(100*(1-readLine.split(' ').map(_.toFloat).reduceLeft(_/_)))
View Hangman.scala
def f(w: String, l: List[String]) = l.foldLeft(w)((x,y) => x.replace(y,"")).isEmpty
f("bigbears", List("b", "i", "g", "e", "a", "r", "s"))
View Account.scala
@TableSchema(pk = "id", name = "accounts")
case class AccountEntity(id: Long
, clientId: Long
, isActive: Boolean
, isVerify: Boolean
, accountRole: Int
, username: String
, passwordHash: String = ""
, email: String = ""
, firstname: String = ""
@nuboat
nuboat / README.txt
Last active Aug 19, 2016
Print A n^n
View README.txt
n = 3
2,2,2
2,2,1
2,2,0
2,1,2
2,1,1
2,1,0
2,0,2
2,0,1
2,0,0
@nuboat
nuboat / pom.xml
Last active Jul 1, 2016
OA-Training
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>thjug</groupId>
<artifactId>Trainging</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
View application.properties
server.port = 9090
spring.thymeleaf.cache = false
spring.datasource.url=jdbc:oracle:thin://@10.202.100.151:1521/AAAA
spring.datasource.username=xxx
spring.datasource.password=xxx
spring.datasource.driverClassName=oracle.jdbc.OracleDriver
View application.properties
spring.datasource.url=jdbc:postgresql://localhost/training
spring.datasource.username=postgres
spring.datasource.password=
spring.datasource.driverClassName=org.postgresql.Driver
@nuboat
nuboat / ApiSpec.scala
Last active Aug 29, 2015
Spec of Section in Parsley
View ApiSpec.scala
import org.scalatest.{FlatSpec, Matchers}
import play.api.test.Helpers._
import play.api.test._
class ApiSpec extends FlatSpec with Matchers {
"GET /api/get/:username" should
"return json result" in new WithApplication {
val home = route(FakeRequest(GET, "/api/get/nb")).get
View SlickSubscriberService.scala
...
def groupJobLevel(): List[GroupJobLevel] = {
val cache = Cache.get("GROUPJOBLEVEL")
if (cache.isDefined) {
return cache.get.asInstanceOf[List[GroupJobLevel]]
}
val result = queryGroupJobLevel()
if (result != null) {
Cache.set("GROUPJOBLEVEL", result)
You can’t perform that action at this time.