- Going Reactive: Event-Driven, Scalable & Resilient Systems - Jonas Bonér
- Effective sbt - Josh Suereth
- A Walk Down the Beach, How Kiama Helps Implementing Distributed Collections on Top of Hadoop
- Concurrency: The Good, The Bad and The Ugly - Viktor Klang & Roland Kuhn
- Lift 3 and client side JavaScript frameworks - Torsten Uhlmann
- Confessions of a Ruby Developer Whose Heart was Stolen by Scala - Ryan LeCompte
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 { | |
a <- 1 until 1000 | |
b <- a + 1 until 1000 | |
c = 1000 - a - b | |
if (c > b) | |
if (a * a + b * b == c * c) | |
} yield (a, b, c)).map( x => x._1 * x._2 * x._3) | |
// Vector(31875000) |
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
val data = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450" | |
val resul |
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 scala.language.implicitConversions | |
import scala.language.postfixOps | |
class Prime(val i: Int) { | |
def isPrime = { | |
if (i <= 1) false | |
else if (i == 2) true | |
else { !(2 to (i-1)).exists(i % _ == 0)} | |
} | |
} |
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
val size = 100 | |
def sumOfPow(size:Int) = (1 to size).map( math.pow(_, 2) ).sum.toInt | |
def powOfSum(size:Int) = math.pow((1 to size).sum, 2).toInt | |
val result = powOfSum(size) - sumOfPow(size) | |
println(result) // 25164150 |
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
def factorize(n: Int, divider:Int = 2, accum:List[Int] = Nil):List[Int] = { | |
n match { | |
case a if a == 1 => accum | |
case a if a == 2 => n :: accum | |
case b if b % divider == 0 => factorize(b / divider, divider, divider :: accum) | |
case _ => factorize(n, divider + 1, accum) | |
} | |
} | |
def getMap(l:List[Int]) = l.groupBy(_.toString).mapValues(_.length) |
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
// from https://github.com/mperham/sidekiq/commit/c1127165f8157807e7855c60f9849d20fb9fec24?utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer&utm_content=buffer0a96b | |
def self.(╯°□°)╯︵┻━┻ | |
puts "Calm down, bro" | |
end |
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
user outsider; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { |
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
# PostgreSql (homebrew로 설치) | |
$ initdb /usr/local/var/postgres -E utf8 | |
## to Start | |
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
## 상태확인 | |
$ pg_ctl -D /usr/local/var/postgres status | |
## stop | |
pg_ctl -D /usr/local/var/postgres stop -s -m fast |
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
# 사용자 추가 | |
$ sudo adduser USERNAME | |
# sudoers에 사용자 추가 ( outsider ALL=(ALL:ALL) ALL ) | |
$ visudo -f /etc/sudoers | |
# 기본 우분투용 의존성설치 | |
$ sudo apt-get install build-essential libssl-dev libev-dev | |
$ sudo apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev | |
# add-apt-repository 사용 |