Studio-Scala

A simple way to implement Retry Support For Akka Future in Scala

Reading Time: < 1 minute [Note: This blog has been updated on 22nd August 2013, after the valuable feedback of readers.] In this blog, I have explained a simple way to implement retry support for Akka future in Scala. When Akka actor dies for any reason and we try to receive response from Akka future, this implementation would work. Here is the logic: object RetrySupport { def retry(actorRef: ActorRef, message: Continue Reading

Integrating Google Drive infrastructure in Play Scala application

Reading Time: 3 minutes This blog talks about integrating the Google Drive infrastructure in Play Scala application as like Assembla and some others. We used oauth2 in order to communicate with the Google using Access Token and Refresh Token. Let us see the process step by step. 1. Prepare the browser request URL in order to get the authorization code. val redirectURI = "http://localhost:9000/driveAuth&quot; def authenticateToGoogle = Action { Continue Reading

Knoldus Big Data Presentation at National Big Data Conference

Reading Time: < 1 minute Recently, I was at the Big Data conference where I was speaking on the subject of attacking the Big Data riddle with Scala and Akka. The ambience was awesome with big consulting companies rubbing shoulders with niche providers like Knoldus. There were some great initiatives which came to light in the fields of social big data gathering, in genomics and how the auto industry is 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

Building Quality into Scala Development

Reading Time: 3 minutes The argument and debates regarding writing quality code have mostly rested in the favour of writing clean code. Cleanliness fosters quality. Clean code is straightforward, direct, reads like a story and makes it very understandable. As a rule that we have at Knoldus, if your code does not read like a story and we have to interrupt in between to understand wtf is going around Continue Reading

Integrating Scala Code Coverage Tool (SCCT) in Play Scala project

Reading Time: 2 minutes In my last blog i’ve elaborated the steps to integrate the JaCoCo with your Play Scala project. This time we’ll learn about how to integrate the Scala Code Coverage Tool ( SCCT ) in your Play Scala project. Just some easy steps and you’re done with SCCT integration. Lets see it in action. 1. Add the following resolvers in your plugin.sbt file. resolvers += Classpaths.typesafeResolver Continue Reading

Integrate SCCT (Scala Code Coverage Tool) with Lift Scala project

Reading Time: < 1 minute Its always a good practice to have a fine test coverage in any project. I am working on Lift framework. I have tried to integrate the SCCT with my lift scala project. Here, I am going to elaborate a few easy steps to integrate the SCCT in Lift Scala project. I am using scala 2.10.0 and sbt 0.12 version.

KnolX Session: Testing Akka Actors Using TestKit

Reading Time: < 1 minute In the presentation which is the part of our ongoing Knolx session, we discussed about how to test Akka actors using Testkit. By using testkit we can test Actor’s behaviour, apply time assertions on actor’s reply and we can also do integration testing of actors. We also discussed how to use TestProbe to test actors which are supposed to send messages to different destinatations.   Continue Reading

Integrating JaCoCo in your Play Scala project

Reading Time: 2 minutes Its always good to have a fine test coverage in any project. I am working on Play framework & this time i’ve tried to integrate the JaCoCo with my play scala project & it’s cool to have it in my project. I am going to elaborate a few easy steps to integrate the JaCoCo in Play Scala project. 1. Add the following lines of code Continue Reading

Pattern Matching – at a glance

Reading Time: < 1 minute I presented types of Pattern Matching at Knolx session at Knoldus. The presentation talks about the type of pattern matching in Scala with small examples.

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

KnolX Session: FitNesse With Scala

Reading Time: < 1 minute This time I gave KnolX session on FitNesse. We have been using it for BDD and acceptance tests for projects at Knoldus. FitNesse is excellent for increasing collaboration between developers, testers and customers. Making FitNesse work with Scala does not require any special configuration. It works out of the box. In this presentation you will learn using FitNesse for a Scala project with a DoFixture Continue Reading