Insights and perspectives to keep you updated.

Sign-Up with Facebook, Twitter and Google using Node.js and MongoDB

Reading Time: < 1 minute Last week, we created a simple login application, which has sign up and login facility after successfully registration. Now we have added one more feature, i.e. Sign-up with Facebook, Twitter and Google. You can login with your facebook, twitter and google account. We’ll be adding some more features in this application very soon such as birthday reminder functionality. We have used Passport[authentication middleware for Node.js] Continue Reading

How to integrate Ehcache with Scala

Reading Time: 2 minutes Ehcache is a widely used open source Java distributed cache for general purpose caching, Java EE and light-weight containers. Ehcache was originally developed by Greg Luck, starting in 2003.In 2009, the project was purchased by Terracotta, who provides paid support. For integrating Ehcache in scala steps are : 1) First we need to Download BigMemory GO from http://terracotta.org/downloads/bigmemorygo. 2) Once it is downloaded we will Continue Reading

How to perform auto complete textbox operation in Selenium

Reading Time: < 1 minute I am going to demonstrate how to do automation testing a Lift application with Selenium IDE. In some scenario there is an auto complete textbox, where we need to put the entity name, as the auto complete textbox work where browser select the element from drp down list. Follow the below steps: 1) Type the required auto-complete name like Laptop (use TypeAndWait command & add Continue Reading

How to use scct and Scala Style in Scala-Sbt project

Reading Time: < 1 minute In this blog, I’ll explain the use of scct and scalastyle in your Scala-Sbt project. scct is Scala code coverage tool. It tests the code coverage using test cases. It measures that how much code is covered by test cases and then it creates test coverage report (index.html) which resides at following position : project/target/scala-2.10/coverage-report/index.html For good programming, code coverage should be greater that 90 Continue Reading

Password Recovery in Clojure

Reading Time: 2 minutes This Blog post will help you to add the password recovery functionalities in your clojure web application. Firstly, create html file containing textbox for getting email address, on which a new passowrd will be sent. Next, add this in your project.clj File :repositories [["central-proxy" "http://repository.sonatype.org/content/repositories/central/">http://repository.sonatype.org/content/repositories/central/]] :dependencies [[org.apache.commons/commons-email "1.2"]] Now follow the given steps to add password recovery functionality: Let’s define a forgot-password.clj namespace and import Continue Reading

Spray with Akka Starter Kit

Reading Time: 3 minutes Over the last few months, Spray is fast becoming the de-facto for all the products that we are working on. Irrespective of whether it is a product which has a full featured UI or a gaming component which needs to provide services for the game to execute in a performant way, Spray has found its use. The best part about Spray being that is very Continue Reading

Test Case Of Data Access Layer Function in Play:-

Reading Time: < 1 minute In this blog I am trying to show how to create test case of data access layer function. Lets have following function of DAL (data access layer) as an example in models packegae of play. All the necessary files must be imported to avoid errors. package model.dals import scala.slick.driver.PostgresDriver.simple._ import scala.slick.session.Session import model.domains.Domain._ import play.api.Logger import utils.Connection trait MobileDALComponent { def getMobileRecordByIMEID(imeid: String): List[Mobile] } 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

Validity Checks using Clojure

Reading Time: 2 minutes For putting Validation checks using Clojure code, clojure noir library checks are used. One needs to first create a form page using basic html for placing the checks.As an Example here, I am using a registration page text boxes to put the validation checks over the required fields. <label for="id"> {% if id-error %} <div>{{id-error}}</div> {% endif %} <input id="id" name="id" placeholder="User Name" type="text" value={{id}}></input> Continue Reading

Adding an Email sending functionality in Play using Scala

Reading Time: < 1 minute To provide an Email Sending functionality in your Play App that is being built with Play 2.2.1, follow these steps ( this post summarizes the work done step by step). 1) Add following dependency in build.sbt (or in Build.scala for Play 2.1.x or older versions) “com.typesafe” %% “play-plugins-mailer” % “2.1-RC2”

Facebook Sign-in using Clojure

Reading Time: 2 minutes In order to provide Facebook sign-in functionality you need to create a new Facebook App from this url: https://developers.facebook.com/docs/facebook-login. Provide the redirection URI that you’ll use for the App. After setting up the app you’ll get an App ID and App Secret key. We’ll use “clj-oauth2.client” to redirect a user to the authentication page, “clj-http.client” for HTTP requests, “cheshire.core” to parse Json string in order Continue Reading

How to create a priority based mailbox for an akka actor

Reading Time: 2 minutes There are some situations when you want an actor to process certain messages first and then other ones. So, I am going to demonstrate how to create a priority based mailbox for an actor. Suppose we have an actor. class MyPriorityActor extends Actor { def receive: PartialFunction[Any, Unit] = { // Int Messages case x: Int => println(x) // String Messages case x: String => Continue Reading

Easiest Way to Implement JOINs in MongoDB 2.4

Reading Time: 2 minutes Last year, I wrote a blog to implement JOINs in MongoDB. But this solution was applicable only for versions below Mongo 2.4. According to the release log of 2.4, this feature is removed. We could not use another collection on map reduce, which is invoked against a particular collection. Earlier it was permitted. MongoDB is a no-SQL database and doesn’t support joins. But if you Continue Reading