Insights and perspectives to keep you updated.

ScalaKnol: Understanding Traits as Stackable Modifications

Traits can be used to modify the methods of a class. The way such modifications are carried out is such that they can stack modifications with each other. Let us take an example. Say, there is a class called ImageProcessor which processes images. Now there are a few modifications required before the image is actually uploaded to your server. If you are using Facebook then Continue Reading

Extract a frame image from video in scala

Sometimes it becomes a general requirement to show the preview of a video wherever video gets displayed. Like on YouTube , If you’ll right click on almost any video , you’d find that each video contains a preview image of a frame of that video. Here is a short tutorial for doing the same i.e extracting a frame image from a video in Scala via Continue Reading

Working With Elasticsearch In Scala

Elasticsearch is an open-source, restful, distributed, search engine built on top of apache-lucene. You can read it more on their website. We have an application built in scala with sbt as our build tool. Now we required to have a search capability on the output created by the application. We chose to use elasticsearch for our application. In this post, we will learn to use Continue Reading

ScalaKnol: Understanding Uniform Access Principle

The ScalaKnol series attempts to share a nugget of Scala wisdom every few days or sometimes few times a day. Keep tuned. Today we would look at the Uniform Access Principle. The principle states that the client code or the calling code should not be affected by the decision to implement an attribute as a field or a method. Hence essentially irrespective of whether the Continue Reading

ScalaKnol: Understanding Loan Pattern

Loan Pattern as the name suggests would loan a resource to your function. So if you break out the sentence. It would Create a resource which you can use Loan the resources to the function which would use it This function would be passed by the caller The resource would be destroyed As you would see, the advantages are multifold. First, I am not constrained Continue Reading

ScalaKnol: Why returning a value in finally is a bad idea

For those of us who are coming from an imperative background, we are used to using try catch rather losely. Ok, I am not trying to generalize here but a majority of us do so. When we come to the Scala world, we realise that like other expressions in scala, try-catch-finally would result in a value. The general practice recommended is that finally should be Continue Reading

Object Equality in Scala

Object Equality In Scala, means comparing two objects by their values and references.Generally, equality is ubiquitous in programming. It is also more tricky than it looks at first glance. This presentation looks at object equality in detail and gives some recommendations to consider when we design our own equality tests.

SICP Chapter 1 Solved with Scala

Ok, let us get the facts right. We have not provided solution to each exercise but the solutions that we have provided would be good for you to understand the concepts. It would also help you realize how efficiently we can use higher order functions in Scala. The Structure and Interpretation of Computer Programs (http://mitpress.mit.edu/sicp/full-text/book/book.html) is a seminal book which helps you reason and understand Continue Reading

Play with Lift’s Autocomplete Widget using Scala-One of the Best Feature of LiftWeb Framework

The AutoComplete widget provides a flexible and accessible way to offer suggestions or some kind of filtering information as a user type text information in an input field . If you have used Google , you might see that Google starts providing autocomplete suggestion with entries depending on user’s current input . Lift provides a very easy way to implement Autocomplete using Scala . Here Continue Reading

Empower Scala with Apache Solr

Solr is ready to use enterprise search server. Here I am going to show you how we can use both of them together to empower your scala application with solr. Solr is able to achieve fast search responses because, instead of searching the text directly, it searches an index instead. This is like retrieving pages in a book related to a keyword by scanning the index Continue Reading

Annotations in Scala

In this session, we will learn about annotations. Firstly, we will see the definition of annotation, standard annotations and then we will learn to write our own annotations. As of now, with Scala we can create compile time annotations (could we create runtime ones without resorting to Java?). For example, if you look at the @tailrec annotation in Scala then it would verify that the Continue Reading

SOLID Principles with Scala

It is quite evident what SOLID principles mean for class typed object oriented languages like Java. However, what do they mean for hybrid languages like Scala which merge the Object oriented and functional approaches. In this KnolX session, we tried to decipher what SOLID principles meant for Scala. Though much of what we know about them can be applied to Scala if we code in Continue Reading

Knoldus Pune Careers - Hiring Freshers

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