background preloader

Scala

Facebook Twitter

Between Zero & Hero - Scala Tips and Tricks for the intermediate Scala developer. Extreme Cleverness: Functional Data Structures in Scala.

Akka

Scala vs Clojure - Round 2: Concurrency! The time for ignoring concurrency has almost passed.

Scala vs Clojure - Round 2: Concurrency!

If you read my last post you'll know that I'm looking at Scala Vs Clojure and a big part of both of these languages is their support for concurrency. Scala uses an Erlang inspired actor model, which is a distributed approach to concurrency. An Introduction To Scala Parser Combinators - Part 1: Parser Basics. Matt Malone's Old-Fashioned Software Development Blog. In my last post I reviewed the implementation of scala.List’s foldLeft and foldRight methods.

Matt Malone's Old-Fashioned Software Development Blog

That post included a couple of simple examples, but today I’d like to give you a whole lot more. The foldLeft method is extremely versatile. It can do thousands of jobs. Of course, it’s not the best tool for EVERY job, but when working on a list problem it’s a good idea to stop and think, “Should I be using foldLeft?” Below, I’ll present a list of problem descriptions and solutions. Sum Write a function called ‘sum’ which takes a List[Int] and returns the sum of the Ints in the list. I’ll explain this first example in a bit more depth than the others, just to make sure we all know how foldLeft works.

These two definitions above are equivalent. Scalacheat. Scala Collections for the Easily Bored Part 2: One at a Time. 28 Jul 2008 As I hinted previously, this series is intended to delve into Scala’s extensive collections API and the many ways in which it can make your life easier.

Scala Collections for the Easily Bored Part 2: One at a Time

Probably the most important operations you could ever perform on collections are those which examine each element, one at a time. After all, what’s a more common array idiom than looping over all values? In that vein, this article starts by looking at foreach, the imperative programmer’s bread-and-butter when it comes to types like Array and List. But rather than just stopping there, we also will look at more powerful, higher-order operations like fold, map and the ever-mysterious: flatMap. Scala in practice: Composing Traits – Lego style. As a kid, i loved to play with Lego bricks, especially to build freaky spacecrafts.

Scala in practice: Composing Traits – Lego style

At that time it was easy to let my phantasy go (where noone has gone before) and build completely new models simply by composing some standard bricks. Those bricks weren’t too specialized, meaning that there weren’t too many constraints on how to combine them. On the other side you always had to compose a new spacecraft from the very ground up as there weren’t some more higher organized units like engines or control cabins. Nowadays, you’ll find such units. There are engines, control cabins or a whole commando bridge, Wings, Field Generators and so on – a whole set of higher organized units whithin a single domain.

Joauth

Steve.vinoski.net/pdf/IC-Scala_Web_Frameworks.pdf. RFC 5849 - The OAuth 1.0 Protocol. [Docs] [txt|pdf] [draft-hammer-oauth] [Diff1] [Diff2] [Errata] Obsoleted by: 6749 INFORMATIONAL Errata Exist Internet Engineering Task Force (IETF) E.

RFC 5849 - The OAuth 1.0 Protocol

Hammer-Lahav, Ed. Request for Comments: 5849 April 2010 Category: Informational ISSN: 2070-1721 Abstract OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end- user). It also provides a process for end-users to authorize third- party access to their server resources without sharing their credentials (typically, a username and password pair), using user- agent redirections. Status of This Memo This document is not an Internet Standards Track specification; it is published for informational purposes. RFC 5849 OAuth 1.0 April 2010 Table of Contents 1. RFC 5849 OAuth 1.0 April 2010. Oauth - Revision 1271: /code/java.

Finagle

Damn Cool Algorithms, Part 1: BK-Trees. Posted by Nick Johnson | Filed under coding, tech, damn-cool-algorithms.

Damn Cool Algorithms, Part 1: BK-Trees

A Tale of 3 Nightclubs. * Part Zero : 10:15 Saturday Night * (In which we will see how to let the type system help you handle failure)... * First let's define a domain.

A Tale of 3 Nightclubs

(All the following requires scala 2.9.x and scalaz 6.0) import scalaz. Monads, Monoids and Scala. Revolute (Lightning Talk @ Big Data Scala meetup) Akka Future vs. Twitter's Finagle Future.

Play framework

Functional Scala: Polymorphic Functions ?!? Scala Style Guide. Iterating over Map with Scala. Lift. Scala Days 2012 17-04-12. Scala Days 2011. JCR with Scala « contentGoesHere. Writing modules for Play 2, part 1: Get something working. A couple of weeks ago, I migrated the Play!

Writing modules for Play 2, part 1: Get something working

Framework 1.x version of Deadbolt to the Play 2 platform, and was surprised at the lack of information on creating modules. This topic was covered in detail in the Play 1.x docs, and this made creating modules very simple. Clearly, something needed to be done – and so this is the first in a three-part series on creating modules and plugins for Play 2. Functional IO in Scala with Scalaz. All that jazz. How do I apply the pimp-my-library pattern to Scala collections.

Dependency injection in Scala with Play 2: it’s free. When you write a software you generally split it into several modules with no hardcoded dependencies between them so you can reuse and test them more easily: you just need to wire the different modules together at startup according to your desired configuration. In the Java world, some tools help to perform the wiring task, e.g. Spring or Guice, but in Scala you can perform dependency injection without having to rely on an external tool, as you’ll see in this post where I’ll show how to apply the Cake pattern in the context of a Play 2 application. @codemonkeyism Scala Goodness: Tuples. January 11, 2010 by Stephan Schmidt Scala has a wonderful feature: Tuples.

@codemonkeyism Scala Goodness: Tuples

As others have already written, tuples are very simple but powerful. Especially if you come from Java, they solve some problems easily, that were ugly in Java. What are tuples? Tuples are containers for values. Infinite Lists for the Finitely Patient. 17 Nov 2008 Functional programming has a lot of weird and abstract concepts.

Infinite Lists for the Finitely Patient

Monads of course are the poster child for all that is strange and confusing in functional languages, but there are other examples. At first glance, it seems that the concept of an infinite list would be just as bizarre and incomprehensible as anything else in the paradigm, but really things aren’t as bad as all that. In fact, even the die-hard imperative programmer can likely benefit from the patterns and techniques enabled by this obtuse construct. For the first part of the article, I’m going to use a lot of examples involving numbers.

If you’re already familiar with the semantics of infinite lists, feel free to skip to the section answering that all-important question: Why Do We Care? Syntax. Scala or Java? Exploring myths and facts. The popularization of the Scala programming language, noticeable by the abundance of opinions and criticism on blogs and social networks (like this one by Nikita Ivanov from GridGain and the popular Yammer case), greatly increased the amount of information about the language. However, the quality of such information often leaves much to be desired. Whether those opinions are favorable or contrary to the Scala, they often contain outdated, superficial or biased statements. The goal of this article is to help those learning or evaluating Scala to come into their own conclusions. It presents the most common questions about language and its environment and, for each one, added clarifications, examples and links, favoring the formation of a better opinion or a more accurate assessment.

Scala is a compiled language, designed to run on a managed environment, most likely the JVM, and offers the union of the functional and object-oriented paradigms.