Web

Play with Cookies using Scala and Lift

Reading Time: < 1 minute As we know , Cookie is a small piece of data which is sent from a website and stored in a user’s web browser while a user is browsing a website. Next time , when user browses , cookie can be retrieved . Cookies are essentially a token of string data that is stored on the user’s machine. In this section , I will explain Continue Reading

Knolx Session: Functional Object in Scala

Reading Time: < 1 minute Welcome to another week of KnolX sessions .The emphasis in this session  is on classes that define functional objects, that is,objects that do not have any mutable state.Along the way, this session will  show you more aspects of object-oriented programming in Scala: class parameters and constructors, methods and operators, private members, overriding, checking preconditions, overloading, and self references.

Quick Tip : Pagination in MongoDB using Scala

Reading Time: < 1 minute Here is the example of how you can do Pagination or Paging in MongoDB using Scala. /* * Pagination For messages */ def getAllMessages(pageNumber: Int, messagesPerPage: Int): List[Message] = { val messsagesRetrieved = MessageDAO.find(MongoDBObject()). skip((pageNumber – 1) * messagesPerPage).limit(messagesPerPage).toList messsagesRetrieved } Note :- 1. pageNumber : Page No. like 1st Page , 2nd Page and so on. 2. messagesPerPage : No of messages to be Continue Reading

Providing a “Sign-in with Google” functionality using Scala

Reading Time: 4 minutes Continuing our series on providing authentication via third party OAuth/Open ID providers, in this post we look at Google. We have already covered sign in with Facebook and Sign in with Twitter in the past. We walk through a step by step scenario to make it work for a Lift based application. Most of the steps would be the same for Play as well. 1) Continue Reading

Working with Play framework using Scala and MongoDB

Reading Time: 2 minutes Scala : Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. More… Play Framework : Play 2.0 is a high-productivity Scala web application framework that integrates the components and APIs you need for modern web application development. Play is based on a lightweight, stateless, web-friendly architecture. More… MongoDB : MongoDB is a scalable, high-performance, Continue Reading

URL shortening with bit.ly in Scala

Reading Time: < 1 minute Short URL’s are becoming the need of most of the application. We’ve used the bit.ly for the URL shortening in our application. Just a little bit work to do for achieving the URL shortening with bit.ly. Here are the steps to do that : You should have the following credentials in order to call the bit.ly API. i. apiKey : You’d get it on registering Continue Reading

Building Massively Scalable Applications with Akka 2.0

Reading Time: < 1 minute Recently Knoldus, presented at the IndicThreads conference, New Delhi on the power of Akka 2.0. The case study involved a demonstration on how a major white goods company is able to analyse their social feeds in real time and respond back to customers needs. The solution currently runs on a cluster of 40 nodes with 16 cores on each node. The presentation emphasized on the Continue Reading

Harnessing the Power of Nutch with Scala

Reading Time: < 1 minute Knoldus was recently speaking at the IndicThreads conference in New Delhi, India. Here, we talked about Nutch and how easy it was for us to integrate it with Scala and build a scalable web crawler with less than 900 lines of code. The case study and the demonstration made the attendees aware of the power of Scala as a language of choice.

Storing files on Amazon S3 using Scala

Reading Time: 2 minutes Amazon S3 serves the purpose of “storage for the Internet” . S3 stand for ” Simple Storage Service”. Amazon S3 can be used for storing and retrieving any amount of data at any time, from anywhere on the web. You can use simple interface “AWS Management Console” provided by Amazon for creating buckets for storage , adding files in those buckets and for many other Continue Reading

Introducing inheritance and traits in scala

Reading Time: < 1 minute We believe in experiential learning. This knolx session has code examples which Knolders tried while I was explaining it. The objective was to  the to introduce Inheritance and Traits. in this presentation i told about  mixin composition of traits into classes ,ordered traits,traits as stackable modification, and option pattern Here is the presentation I gave.

Some strong “building-blocks” of scala (Tutorial 1 : Lists)

Reading Time: 3 minutes Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. Scala supports functional programming & is a pure object-oriented language in the sense that every value is an object. Let us discuss about some of the strongest building blocks of Scala. Scala Lists: Lists are an important data structure in many Scala programs. A list Continue Reading