Java developers Scala cheatsheet specs api
twitter effective scala
twitter scala school
Scala official specs, api reference, Artima book, Twitter Scala school Scala’s type hierarchy and object equality sth Very nice article on Scala types from Github user ktoso
Scala examples from Java to Scala cheatsheet When you see a field in a Scala class, remember that it's not the same as Java sma
It's either a private field together with a getter (for a val field)
Or a getter and a setter (for a var field) Concurrency in Scala
The Actor Model proposed by Carl Hewitt in 1973
Actors are objects which encapsulate state and behavior, Examples Enterprise Application Interface (EAI) Patterns with Actor Model
Akka akka Examples,
Fiber based Actor framework: Quasar thread Predef class gives aliases for commonly used types, such as Map, Set, and the List How Scala's == differs from Java's
On primitive types, Java's == compares value equality, as in Scala
On reference types, however, Java's == compares reference equality
Scala provides a facility for comparing reference equality, using eq() and its opposite, ne()
Accessor and mutator methods in Scala Every array is an object in Scala. array(0) = "Hello" converts to:-> array.update(0, "Hello") The Scala 2.8 Collections API cls clsm clsimm
All automatic imports in every Scala entity
  • import
  • import _root_.scala._
  • import _root_.scala.Predef._
All symbolic operators Difference between case object (can be serialized) and object (can't be serialized)
Difference between private and private[this]
final abstract class Int private extends AnyVal
abstract forbids instantiation (new Int), whereas final forbids subclassing (new Int {})
String Interpolation in Scala
Scala provides three string interpolation methods [ s, f, raw ] Reason for having val someVariable : Int instead of val Int someVariable in Scala
Difference of var and val. val is a final value
Case Classes Scala use '_' operator for package import instead of '*' as in Java
In Scala, the * is a valid identifier. val * = "trollin"; println(*) Scala uses '::' operator as the list cons operator
It creates a new list whose head is first argument and whose tail is contents of the second argument Explanation of Scala’s (_+_) Syntax
Accessors and Mutators (getters/setter) in Scala
Scala context and view bounds. Purpose of operator: < % Private scoping with square brackets (private[…])
Scala constructor overload using Auxiliary constructors Scala import statement at top and inside scala class Understand how to use apply() & unapply()
Scala trait is equivalent to a Java interface
Scala sealed trait is equivalent to a Java enum interface
Scala allows traits to be partially implemented
Purpose of sealed abstract class
Scala Tuple on REPL (Read-Evaluate-Print Loop)
Scala Either: Either works just like Option
Equivalent of Java Object Class in Scala is AnyRef Why Scala lacks static members and primitives nps A dedicated space for Scala based Machine Learning Examples
Operator Overloading in Scala. Operators are nothing just methods
Implicit Parameters and Functions in Scala
stackoverflow.wom Understanding type keyword and Anonymous functions
Tail calls, @tailrec in Scala
lazy val in Scala: A lazy val is most easily understood as a memoized def
val is executed when it is defined
lazy val is executed when accessed first time and result is saved for future invocation
Difference between object and class in Scala
Class is a blueprint for objects. objects are program entry point
Difference between object and case object in Scala
Companion object shares the same name of class and stay in same class
Scala build tool: SBT
'run' command to compile. 'package' command to generate jar
Library dependencies | Organizing the build How to have Eclipse recognize dependencies from SBT
Add sbt plugin info at project/plugins.sbt
[addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")]
Typesafe Config library
Anagram in Java/Scala
Word frequency in a statement in Java/Scala
Stack in Java/Scala
Queue in Java/Scala
CircularQueue in Java/Scala
Reverse the word using Stack in Java/Scala Ninety-Nine Scala Problems A Hands-On Introduction to ScalaTest Concurrent Programming in Scala Ditching Guice's @Singleton in Favour of Scala's Companion Object
Jacek Laskowski is working at DeepSense. Spark Open book by him
DeepSense won Kaggle Right Whale Recognition Compitition