What is Scala?
Créé par Martin en 2003 -- Son nom vient de l'anglais Scalable language Scala intègre les paradigmes de programmation orientée objet et de programmation fonctionnelle, avec un typage statique
- Fonctionnel basique
a) Immutability
What is Scala?
Créé par Martin en 2003 -- Son nom vient de l'anglais Scalable language Scala intègre les paradigmes de programmation orientée objet et de programmation fonctionnelle, avec un typage statique
a) Immutability
case class Banque(nom:String) {banque => | |
def accepte(m:Montant) = | |
CompteBuilder(banque, m) | |
} | |
implicit def stringToBanque(s:String) = Banque(s) | |
implicit def intWithDevise(i:Int) = new { |
```{r setup, echo=FALSE, results='hide'} | |
chunkref <- local({ | |
function(chunklabel) { | |
sprintf('[%s](#%s)', chunklabel, chunklabel ) | |
} | |
}) | |
secref <- local({ | |
function(seclabel) { | |
sprintf('[%s](#%s)', seclabel, seclabel ) |
import scala.collection.immutable | |
import scala.collection.immutable.Queue | |
import akka.actor._ | |
/** | |
* Rough, initial cut of a trait to mixin when an Actor requires | |
* initalization, where the initialization is long and arduous (for | |
* example, data initialization related). This strategy allows the | |
* implementing actor to delegate the work to another Actor, on a | |
* separate, dedicated Dispatcher, and not block any other related |
module Bob (responseFor) where | |
import Data.Char (isSpace, isLower, isAlpha) | |
import Control.Applicative ((<$>), (<*>), (<|>)) | |
data Prompt = Silence | Yell | Question | Other | |
deriving (Show, Eq) | |
data P a = P { pCanParse :: Char -> Bool | |
, pParse :: Char -> Either (P a) (Maybe a) | |
, pParseEOF :: Maybe a | |
} |
##Building and using Spark Notebook for MapR
The spark-notebook is a useful browser-based REPL that can be used to explore data and build visualizations. This guide will illustrate the MapR-specific requirements for building, and using the spark notebook on MapR clusters.
###Building Checkout the source:
$ git clone https://github.com/andypetrella/spark-notebook.git
import scalaz.Applicative | |
import scalaz.concurrent.Task | |
/** | |
* This `Applicative[Task]` runs tasks in parallel, by defining | |
* `ap` and `apply2` in terms of `mapBoth`. This differs from the | |
* default `Applicative[Task]`, where effects are sequenced | |
* deterministically, in left to right order. | |
*/ | |
val T = new Applicative[Task] { |
package foo.bar | |
import spray.routing._ | |
import spray.http._ | |
import spray.http.StatusCodes.Forbidden | |
// See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS | |
case class Origin(origin: String) extends HttpHeader { |
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer
run /opt/sublime_text/sublime_text
or sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
with ubuntu bash on Windows 10 and Xming: