Search Results for: future

Scala in Business | Knoldus Newsletter – September 2014

Reading Time: < 1 minute Hello Folks We are back again with September 2014, Newsletter. Here is this Scala in Business | Knoldus Newsletter – September 2014 In this newsletter you will get to know how organizations are getting benefits by using Typesafe Reactive Platform, how Scala can be beneficial for you and what trends are going in industries. So, if you haven’t subscribed to the newsletter yet then make Continue Reading

Scala in Business | Knoldus Newsletter – November 2014

Reading Time: < 1 minute Hello Folks We are back again with November 2014, Newsletter. Here is this Scala in Business | Knoldus Newsletter – November 2014 In this newsletter, you will get to know the popularity of Spark in big data. Spark is getting more attention in all over the world for fast data processing. People are getting much faster data processing speed with Spark. You will get to Continue Reading

Getting close to Apache Flink, albeit in a Träge manner – 1

Reading Time: 7 minutes Of late, I have begun to read about Apache Flink. Apache Flink (just Flink hereafter), is an ‘open source platform for distributed stream and batch data processing’, to quote from the homepage.  What has caught my interest is Flink’s idea that, the ability operate on unit of data streaming in gives one the flexibility to decide what constitutes a batch: count of events or events Continue Reading

Play Framework 2.2 with WebJars client-side web libraries

Reading Time: < 1 minute WebJars are client-side web libraries (e.g. jQuery & Bootstrap) packaged into JAR (Java Archive) files. WebJars can be added as dependencies to an app by simply adding them to the build.sbt file. There is also a helper library named webjars-play that makes it easy to reference WebJar assets. Here is an example build.sbt file with webjars-play and the bootstrap WebJar as dependencies. Do the following Continue Reading

And you thought the App trait is just a convenient way of creating an executable Scala program

Reading Time: 3 minutes Ok,  Let’s start discussion about the App trait uses in our code segment. Here I will try to demonstrate some use cases for the better use of App trait in our Scala code. To read more about the App trait you can refer to the documentation here Let’s go with our daily uses of App trait 🙂 Just want to print something on console: object Continue Reading

Password Encryption in Play

Reading Time: < 1 minute Today,in this blog I would like to tell you about Password encryption in Play. As you know that saving password in its plain form can lead to future problems, so its better to use an encryption technique before saving them to your database.I will be using ‘SHA-256’ encyption in the code given below. In your project inside the util package, create a scala object named: Continue Reading

Employee-Self-Service: Reactive and Non-Blocking Database Access using Play Framework and Anorm – (Part-3)

Reading Time: 1 minute Last week, We have added Reactive and Non-Blocking behaviour in Employee-Self-Service  application. Now we have implemented Database Access as Reactive and Non-Blocking: Before def list() = Action.async { implicit request => Employee.list match { case Right(data) => Promise.timeout(Ok(html.list(data)), 1 seconds) case Left(error) => Promise.timeout(Ok(html.list(Nil)), 1 seconds) } } After def list() = Action.async { implicit request => val futureEmpList = scala.concurrent.Future { Employee.list } val timeoutFuture = Promise.timeout(“Oops”, 10.second) Continue Reading

Bridging the Communication between Lift Comet Actor and Akka Actor in Scala

Reading Time: 2 minutes In this blog, I would explain how to create bridge between Lift Comet Actor and Akka Actor. Since Lift has its own actor model, so a bridge is needed to fill communication gap between LiftComet and Akka Actor, so that Akka actor would be able send message to comet, once comet has been set. This bridging concept would be more useful for those web applications, Continue Reading

A Simple Remote Chat application using Lift Comet and Akka Actor in Scala

Reading Time: 2 minutes If you are running an application and there are lot of chances for a huge traffic to come in future, a single server would not be capable to handle this. In that case you would have two choices: A) Replace existing server with an advance server with better configuration B) Building a global node in the cluster to be used by other nodes. We know Continue Reading

Easiest Way to Recover Akka Actor for Remote Application JVM Failure Scenario in Scala

Reading Time: 2 minutes In this blog, I would explain how easily you can recover Akka actor for Remote Application JVM failure scenario in Scala. I have implemented this in one of my project and it is working fine. Suppose there is a remote application, which is being used by multi JVMs, and JVMs are passing message to each other through Akka actor, then there must be an Akka Continue Reading

Getting Longitude & Latitude for a address using Play Framework 2.1 WS API

Reading Time: 2 minutes This blog post serves the two purposes : First , We’ll learn about getting the latitude & longitude for an address using Google Geocoding API. Second , We’ll do the same as mentioned above using Play 2.1 WS API & learn about how to call the web services in Play 2.1. On order to call the other HTTP services within Play 2.1 we use play.api.libs.ws.WS Continue Reading

Static code analysis via CPD from within SBT with Scala

Reading Time: 2 minutes CPD, SBT plug-in enables you to analyze your code with the help of the great PMD Copy/Paste Detector tool. It defines a cpd sbt action for that purpose. CPD used to detect duplicate code in the project. Code duplication is generally considered a mark of poor or lazy programming style. Good coding style is generally associated with code reuse. It may be slightly faster to Continue Reading

Connection pooling in Scala

Reading Time: 3 minutes In this blog I am going to describe connection pooling in scala. Before going into the details I want to explain why and when connection pooling should be used. Why connection pooling ?? For efficient use of database connection we need to care about following two things. 1. Creating a connection is an expensive operation. It is not senseful to create new connection each and Continue Reading

:)