Deploy play 2.0 app on cloudfoundry
For last few days I was trying to find a to deploy my play 2.0 application. I have already deployed my app at heroku(http://ooki.herokuapp.com/). But heroku offers very limited resources for free...
View ArticlePlay2.0 and cloudfoundry database connectivity
Right at the outset, an honest confession - I am no good at shell script. When I tried to deploy my play2.0 - scala application in cloudfoundry - and connect to the provisioned database service - I...
View ArticleCloud Foundry Now Supports Play!
Cloudfoundry now has now incorporated support for play 2.0. Following is the link:http://blog.cloudfoundry.com/2012/05/31/cloud-foundry-now-supports-play/Have fun!
View Articlescala xml wrapper utility
XDoc is a utility wrapper over scala.xml.Elem. It's simplifies xml processing. Following needs to be considered while using this utility:1) It does not support namespaces. That can easily incorporated...
View ArticleAsynch concurrency: In the promised land of scala futures
The basics:The concept of future is not new - java added them in 1.5 -scala actors had futures from the start, lift webframework had its own futures. As more and more libraries and toolkits sprang up...
View ArticleBasics of actors in scala/Akka part 1
Starting with Scala 2.10.0 - scala actors will be replaced by akka actors.Since we are already using scala actors in production - the need arose to get familiarised with akka in general and specially...
View ArticleBasics of Actors in akka/scala part 2
Hot swap of akka's actors behaviourAkka actors' receive method accepts a partial function from Any to Unit(i.e. PartialFunction[Any, Unit]) and this function can be dynamically changed at runtime....
View ArticleIteratee fundamentals for the beginer
Iteratees are an alternative to commonly prevalent, imperative blocking IO. While reading from a stream, if is data is not available - the reading thread blocks - which is not desirable. The alernative...
View ArticleScala for the uninitiated java developer: 22 scala things you may not have known
Scala's popularity is rising among developers. Yet, many java developers have hardly paid any attention to it - thinking it is some sort of esoteric programming langauge isolated from the java main...
View ArticleRecovering from scala delimited continuation encounter
As I have said before, delimited continuations are wild beasts. Its one of those things that bends and hurts the mind. You might have to spend months in a state of delirium trying to figure them out!...
View ArticleFun with scala's for comprehension: Solving sudoku in 11 lines!
Scala's for loop(comprehension) may look deceptively similar to java's for loop, but it is much more powerful than java's for loop. While java's for loop is just to repeat some computation for...
View ArticleThe essence of a monad
Many people when they encounter the term 'monad' for the the first time, they decide to look it up, at least the curious bunch. But when they do consult the blogs, articles, Wikipedia, haskell...
View ArticleScala dose #3: Constructors
We have not talked about constructors yet. It's time we do so now. Let's type in the following to the scala prompt:scala> class ScalaDose3 {| println("I am getting constructed")| }defined class...
View ArticleScala auxillary constructors
As we have said before - the body of the class defintion is constructor code for a scala class. So,in the following class:scala> class Person(name: String) {|println("This will be printed when the...
View ArticleScala constructor params
scala> //'x' not prefixed with val or var and hence x can not be accessed outside.scala> scala> class ConsArgDemo(x: String) {| def getX = x| }defined class ConsArgDemoscala> scala> val...
View ArticleMatch making with scala pattern matching
One very elegant feature of scala is - pattern matching. It's not to be confused with regular expressions(scala has regular expressions too). One way to look at scala pattern matching as java 'case'...
View ArticleScala lists
Scala has wide variety of collections classes. List is one of them. Let's get familiar with List.scala> val xs=List(1,2,3,4,5)xs: List[Int] = List(1, 2, 3, 4, 5)Here we have created a List which...
View ArticleMore about List's higher order functions
Scala List has a method called 'filter' which accepts a predicate. The predicate needs to return true or false. Let's use filter to get the list of odd integers between 1 to 20.scala> (1 to...
View ArticleMore fun with functions
Scala functions are object instances and hence they can be tossed around like any object instance.scala> val func: String=> Int = x => Integer.parseInt(x) func: (String) => Int = For the...
View ArticleDelimited continuations
There have been a lot of blog posts, questions & answers about scala's delimited continuation. I would not again try to confuse the reader with another lame-duck explaination. I would, instead,...
View Article