The N-Queens Problem in Scala

Recently at my office I had a discussion about algorithms and the N-Queens problem came up. I didn’t know about it, so I decided to check it out and then I felt like I wanted to write an implementation in Scala. This blog post documents all of this.

Continue reading “The N-Queens Problem in Scala”

Spark Caching – RDD vs Dataset

Apache Spark (https://spark.apache.org/) is one of the most popular analytics engines used nowadays. It has been around since 2009 and one of the reasons it became so popular is its speed compared to traditional MapReduce and specifically Hadoop, which it was inspired by.

Continue reading “Spark Caching – RDD vs Dataset”

Smallest Enclosing Circle Algorithm in Scala

In the last couple of years I have been using the Scala programming language for a large chunk of projects at work. I use it to write batch processing jobs with Spark, APIs using the Play Framework, different Akka programs as well as apps and tools. I’ve even written a book about design patterns in Scala in 2 editions.

Scala is an awesome programming language and I enjoy using it. It is very quick to write complex and efficient code. Of course, if you’re not careful or familiar enough with the language you might pay some price in terms of efficiency, but any programming language is like that. It is a multi-paradigm language that combines object-oriented and functional programming. It runs on the JVM and in theory it is compatible with Java and Java bytecode. And it practically is in most cases.

Continue reading “Smallest Enclosing Circle Algorithm in Scala”