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
/** | |
* reads the data from the composite column family. | |
* | |
* @param rowKey unique key which identifies a row in cassandra column family. | |
* @param columnFamilyName represents the column family which contains the data to be looked up. | |
* @param startValue range query start parameter | |
* @param endValue range query end parameter | |
* @param compositeColumnSerializer represents mapping from column name to {@link Serializer} | |
* @param startComparator holds the comparator value to start the range query | |
* @param endComparator holds the comparator value to end the range query |
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
var http = require('http'); | |
/* | |
- Make sure you have downloaded node-cassandra-client and related dependencies and made it available | |
- at the suitable place. | |
*/ | |
var cassandraClient = require('./node-cassandra-client.js'); | |
var hosts = ['host1:port1','host2:port2','host3:port3']; | |
var connection_pool = new cassandraClient.PooledConnection({'hosts': hosts, 'keyspace': 'keyspacename'}); | |
http.createServer( |
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
public interface IPenFactory { | |
IPen getInstance(String type); | |
} |
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
package learn.scala | |
object LearnSyntaxSheet { | |
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet | |
var x = 1 //> x : Int = 1 | |
def incr(counter: Int) = counter + 1 //> incr: (counter: Int)Int | |
incr(100) //> res0: Int = 101 | |
//================================================================================ | |
// 11/07/2013 |
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
package learn.scala | |
object Exercise { | |
println("Welcome to the Exercises") //> Welcome to the Exercises | |
// EXERCISE 1: | |
// Write a product function that calculate product of values of a function for the points | |
// on a given interval | |
def prod(f: Int=>Int, a: Int, b: Int): Int = { |
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
package learn.scala | |
object Exercise { | |
// Exercise on implementing Higher order functions in Scala. | |
// All these examples are taken from Martin Odersky teachings on coursera. | |
// EXERCISE 1: | |
// Write a product function that calculate product of values of a function for the points | |
// on a given interval |
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
package learn.scala | |
/** | |
* Datastructures in Scala | |
* The example below shows abstracting Rational numbers and implementing | |
* rational number arithmetics. | |
* | |
* Similar to java scala does provide toString for printing the datastructure representation. | |
* In the example below we override toString method. Also, we make use of this construct which | |
* is also available in Scala. |
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
public class ConfigurationService { | |
/** | |
* The process engine configuration impl. | |
**/ | |
private ProcessEngineConfigurationImpl processEngineConfigurationImpl; | |
/** | |
* The Custom vars. | |
*/ | |
private List<CustomVariableType> CustomVars; | |
/** |
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
package learn.scala | |
/** | |
* Herein we'll discuss class hierarchies in Scala. | |
* The first concept in this is about Abstract classes. This is very similar to how it is in Java. | |
* Next we discuss about the persistent data structures and creation of binary search tree. | |
*/ | |
object ClassHierarchy { | |
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet | |
val node = new NonEmpty(4, new Empty, new Empty)//> node : learn.scala.NonEmpty = {.4.} |
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
package learn.scala | |
object OperatorOverloading { | |
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet | |
/** | |
* We wish to use operators for rational number. | |
* Example: r1 < r2 instead of using r1.less(r2) | |
* This can be acheived in scala by understanding below two properties | |
* a) Infix methods Notation |
OlderNewer