Scala : Beginners Tutorial

If you are a beginner in scala and you want it learn it and feed it to your veins then here are some of the steps that you can perform.

Step 1: Join this course on Coursera. Its a wonderful course and its taught by Martin Odersky himself. After completing this course there is another course following it which you can find here. After completing these two you have a pretty good insight on how to do things and you are ready to do some real coding.

Step 2 : To start coding in scala you can join HackerRank and start coding. It has a pretty good problems to move forward and these problems are divided into various levels. Complete each level and test your Skills..!

Step 3: If you have a Java background and you think that you can skip these videos, and you want to code in scala immediately then, Twitter School Scala  or Experts is the thing you are looking for. Go through these easy steps and start coding.

Step 4: If you have not installed scala then you can simply try it online here.

Step 5: Now you are an intermediate coder in scala and you can code easily. You can join the SCALA Community to get more help. And for reference you can easily download, Programming in Scala by Martin Odersky Book. Its bible of scala.

Hope you enjoy coding in Scala..!!!! 🙂

Advertisements

Couchbase: Quering data bucket with Partial id.

Introduction:

In this article I am going to explain how to get documents from data bucket, if you only have partial Id, in other words using LIKE operation of Sql in couchbase by using Views of Couchbase.

For Example:

I have these four documents in my bucket, and I want to get all the documents having starting “abc”, then it must retrieve all the three documents.

Screenshot from 2015-07-07 13:36:18

Result must contain all the three documents :

abc::1, abc::2, abc::3

Then to implement this we can use the View functionality of Couchbase, and then we can fire the query on the view accordingly.

Step 1: Create view on the data bucket, by clicking on create Development View in View option.

Step 2 : Edit the function of view accordingly :

function (doc, meta) {
emit(meta.id,doc.name);
}

You can use different functions like emit() in this function accordingly and the list of functions can be found here.

Its result can be seen using Show Result

Screenshot from 2015-07-07 13:57:04

Step 3: Now in your code firstly to enable queries you need to enable them

System.setProperty(“com.couchbase.queryEnabled”, “true”)

Step 4:

Now run the query to get the output having your required value in key and you can perform function startKey() on that.

val queryResult = openedBucket.get.query(ViewQuery.from("dev_name", "name").startKey("abc::").stale(Stale.FALSE))
val totalResult=queryResult.allRows

Here startKey(dynamicKey: String) is performed on key returned from that function in view, and stale.FALSE is written so the view gets updated each and every time.

Now it returns an object of List[ViewRow] and you can perform different operations accordingly on the result.

How the Interns at Knoldus Caused a Flutter at Scala Days 2015 !

Knoldus

Knoldus is a select Typesafe partner and has been engaged in delivering reactive, scalable products for the last 4.5 years. The company boasts of well rounded full stack developers who engage with the clients and take their reactive product dream to reality. A lot of case studies can be accessed here. An integral part of the Knoldus Internship Program (KIP) is to introduce great minds on Java to the beautiful Scala language. There are 2 months worth of classroom sessions held for engineers who want to leap to Scala after having worked for a few years on Java. These sessions include Scala, Akka, Play framework, Spark, Spray, Design Patterns, Good coding practices, TDD with Scala, Selenium DSL, Angular js, Backbone and much more. The batch of KIP-2015 was no different. We had a set of very capable interns join us and we started brain washing them on Scala.

Interestingly…

View original post 739 more words