This file contains hidden or 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
/** | |
* முதல் தமிழ் நிரல் வர்ணணை | |
* இவற்றுக்கு ஒரு gist உருவக்கப்படும் | |
* இதன் gist முகவரி | |
*/ | |
object CPSIntUnit { | |
var valCon: (Int => Unit) = null | |
def computCont = { | |
shift { | |
k: (Int => Unit) => valCon = k |
This file contains hidden or 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
object ReadFileCPS { | |
var fileName: String = "a.txt" | |
var cont: (Unit => Unit) = null | |
def capture = { | |
shift { k: (Unit => Unit) => cont = k | |
} | |
} | |
def readFailSafe { | |
var contents: String = "" | |
reset { |
This file contains hidden or 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
object Monademo extends App { | |
val f = new Foo("foo") | |
val br = new Bar(f) | |
val bs = new Bas(br) | |
def evalBas(bs: Bas) = { | |
for { | |
b <- bs.getBar | |
c <- b.getFoo | |
} yield c.getName |
This file contains hidden or 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 ch3 | |
object FListDemo extends App { | |
/* | |
val list = FList("a", "b", "c") | |
println("printing tail of non empty list " + FList.tail(list)) | |
println(FList.setHead("z", list)) |
This file contains hidden or 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 demo | |
import java.sql.DriverManager | |
import java.util.Properties | |
import java.sql.ResultSet | |
object RuleQueryProcessor extends App { | |
val nestedSelect = """select cpu from ruleData where cpu > (select cpu from ruleData limit 1) and mem < (select mem from ruleData limit 1)""" |
This file contains hidden or 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
https://github.com/prassee/vaerCholScala |
This file contains hidden or 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.actor._ | |
case class Feed(name: String) | |
class FeedSubscriber extends Actor { | |
def receive = { | |
case feed: Feed => println(s"""feed received at ${feed} ${self.path}""") | |
} |
This file contains hidden or 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
http://kiwenlau.blogspot.in/2015/05/quickly-build-arbitrary-size-hadoop.html |
This file contains hidden or 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
object chapter3 { | |
println("chapter 3") //> chapter 3 | |
import Basket._ | |
val emptyBag = Empty //> emptyBag : Basket.Empty.type = Empty | |
val intBag = Cons[Int](23, Cons[Int](12, Empty))//> intBag : Basket.Cons[Int] = Cons(23,Cons(12,Empty)) |
This file contains hidden or 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 service | |
import _root_.util.Configurations | |
import _root_.util.futures.SafeFutures._ | |
import akka.actor.{Actor, ActorSystem, Props} | |
import com.google.inject.{Inject, Singleton} | |
import com.typesafe.config.ConfigRenderOptions | |
import org.joda.time.DateTime | |
import play.api.Logger | |
import play.api.libs.json._ |