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 scagex | |
object CurriedFilter { | |
private val strList = List("scala is asdf","scalaxia is beta","akka is wonderful","sbt is build tools","some text which is not related to skala") | |
def yieldFilteredItems(filtFn: String => Boolean) = strList.filter(filtFn) | |
def dofilter(name: String)(filter: String) = filter.contains(name) | |
def main(args: Array[String]) { |
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
val controlsView = new TreeView[String]() { | |
hgrow = javafx.scene.layout.Priority.ALWAYS | |
minWidth = 200 | |
editable = true | |
root = rootTreeItem | |
id = "page-tree" | |
} | |
controlsView.getSelectionModel.setSelectionMode(SelectionMode.SINGLE) | |
controlsView.getSelectionModel.selectedItemProperty.addListener(new ChangeListener[Any] { | |
def changed(observable: ObservableValue[_], oldValue: Any, newValue: Any) { |
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
/** | |
* This class is an illustration of using loan pattern(a.k.a lender-lendee pattern) | |
* @author prassee | |
*/ | |
public class IOResourceLender { | |
/** | |
* Interface to write data to the buffer. Clients using this | |
* class should provide impl of this interface | |
* @author sysadmin |
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
/** | |
* The Class LimitedInputStream. | |
* | |
* @author sysadmin | |
*/ | |
public class LimitedInputStream extends FileInputStream { | |
/** The length. */ | |
private long length; | |
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._ | |
import akka.pattern.ask | |
import akka.util.duration._ | |
import akka.util.Timeout | |
import akka.dispatch.Await | |
case class PlayerAddRequest(name: String) | |
class PlayerBuffer extends Actor { |
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 java.util.Hashtable; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import javax.jms.Connection; | |
import javax.jms.ConnectionFactory; | |
import javax.jms.DeliveryMode; | |
import javax.jms.Destination; | |
import javax.jms.JMSException; | |
import javax.jms.Message; | |
import javax.jms.MessageConsumer; |
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
scala code |
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 nlpapp | |
import chalk.tools.sentdetect.SentenceDetectorME | |
import chalk.tools.sentdetect.SentenceModel | |
import java.io.FileInputStream | |
import chalk.tools.postag.POSModel | |
import chalk.tools.postag.POSTaggerME | |
import chalk.tools.tokenize.TokenizerModel | |
import chalk.tools.tokenize.TokenizerME |
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
establish ssh cxn between master node and slave nodes (pwd less login) | |
On master node | |
download & install zookeeper on master (http://mirror.symnds.com/software/Apache/zookeeper/stable/zookeeper-3.4.5.tar.gz) | |
after installing zookeeper update the zoo.cfg file | |
contents of zoo.cfg file | |
======================== | |
tickTime=2000 | |
dataDir=/var/lib/zookeeper | |
clientPort=2181 |
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
/** | |
* populate n * n @Double array | |
* using math.random | |
*/ | |
object FillingAnArray extends App { | |
println("in scala") | |
for (x <- 1 to 3) { | |
val l: Int = Math.pow(10, x).toInt | |
val startTime = Double.valueOf(System.currentTimeMillis()) | |
val random = new Random() |
OlderNewer