Scala

Knolx Session: Introducing Scala

Reading Time: 1 minute We organize KnolX sessions regularly at Knoldus so that our learning spreads in our organisation. This KnolX session had Scala flavor written all over it. We believe in experiential learning. This session has code examples which Knolders tried while I was explaining it. I combined sbt, Scala, Scala collections and ScalaTest together in this presentation. The objective was that by the end of Knolx session Continue Reading

Liftweb JSON serialization and deserialization using Scala

Reading Time: 2 minutes We are working on a Scala project using Play framework. We had written the Serializers and Deserialzers for parsing the JSON data that contains different data types like ObjectId , Scala Enumeration etc. We are using net.liftweb.json for writing and parsing the JSON data. We were having the JSON looks like as : [{“id”:1,”school”:”Cambridge”,”year”:{“name”:”FirstYear”},”major”:”Science”,”degree”:{“name”:”Bachelor’s”},”Date”:”01/05/2011″}] The year field here is an scala enumeration and the Date Continue Reading

Using GridFS within Scala to store large files in MongoDB

Reading Time: 1 minute GridFS is a specification for storing large files in MongoDB. Some of the features of GridFS are : * GridFS tends to handle large numbers of files better than many file systems. * Query Support is good. * If you have certain files that change a lot then it makes sense to store them in GridFS so you can modify them in one place and Continue Reading

QuickKnol: Reading Configuration Files in Scala

Reading Time: 2 minutes There are several ways of reading configuration files in Scala including the java properties way with the deprecated Configgy and quite some more. One way which is easy and comes in handy is with the Typesafe Config project which is also used in Akka. Let us quickly see how to set it up, You would need to include the following dependency in your build.sbt or Continue Reading

Deploying the Play 2.0 application on Heroku

Reading Time: 2 minutes We are working on a project using Play freamework with Scala programming language. Here we’ll discuss about the deployment of the play application on Heroku. This is a very straightforward process. You just have need to follow some simple steps and your application will be on Heroku in minutes. 1. Heroku needs a file named ‘Procfile‘ for each application to be deployed on it. Procfile Continue Reading

ZeroMQ Module In AKKA 2.0 Some Gotchas

Reading Time: 5 minutes Akka framework supports ZeroMQ in its ZeroMQ extensions module. Akka is a great framework and we have our product built on its version 1.3x. We were looking at ZeroMQ support in our product and we stumbled on this issue. We found that ZeroMQ applications built on Akka extensions are running slower than an application built in plain scala. Please read about our discussion thread on Continue Reading

QuickKnol: Integrating Logback with Scala

Reading Time: 2 minutes Logback is the successor of Log4j and is one of the better logging frameworks around. In this post, we would quickly see how to set it up on a Scala project and how to start using it. The relevant dependency to be included in your build.sbt is libraryDependencies += “ch.qos.logback” % “logback-classic” % “1.0.1” Once, you have this set, next you have to get a Continue Reading

Integrating Twitter Bootstrap with Play 2.0 using Scala

Reading Time: 1 minute We spent more than a few hours in getting the boostrapping right for Play 2.0 RC3 and twitter bootstrap. Following is a summary of steps we followed and some pitfalls that we encountered. For starters, you can start by having a look to the sample play application for a todo list. Here we are going to discuss about the twitter bootstrap integration using ‘Build.scala‘ file. Continue Reading

Handling Large Data File Using Scala and Akka

Reading Time: 6 minutes We needed to handle large data files reaching size Gigabytes in scala based Akka application of ours. We are interested in reading data from the file and then operating on it. In our application a single line in a file forms a unit of data to be worked upon. That means that we can only operate on lines in our big data file. These are Continue Reading

Intercepting Nutch Crawl Flow with a Scala Plugin

Reading Time: 4 minutes Apache Nutch, is an open source web search project. One of the interesting things that it can be used for is a crawler. The interesting thing about Nutch is that it provides several extension points through which we can plugin our custom functionality. Some of the existing extension points can be found here. It supports a plugin system which is used in Eclipse as well. Continue Reading

Using MongoDB in Scala with Salat

Reading Time: 2 minutes In our last post, we had seen how easily we could access MongoDB with the Casbah driver. In this post, we would have a sneak peak at Salat. Salat is a bidirectional, serialization library which helps us work with MongoDB’s DBObject. To quicly get started with Salat, you would need to include the following dependency in your Build.scala We would also need the dependency for Continue Reading

Getting Started with MongoDB using Scala

Reading Time: 3 minutes MongoDB is a document oriented NoSQL database which has gained tremendous popularity on account of its performance and scalability characteristics. It positions itself in the sweet spot near RDBMS which provide depth of functionality and memcache for scalability and performance characteristics. In this post, we would look at connecting with MongoDB running on the local system with a Scala client. To install MongoDB, follow the Continue Reading

Capsules for recovering Scala fever.

Reading Time: 2 minutes Scala is a multi-paradigm programming language that combines the features of object-oriented programming and functional programming. The word “Scala” refers to “Sca(Scalable)+la(Language)” i.e designed to grow with the demands of its users. Scala runs on the Java Virtual Machine. Here We’ll discuss about some of the basic concepts in Scala that make it distinct from other programming languages.Let us start with some of the following: Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!