SlideShare a Scribd company logo
1 of 104
Download to read offline
Settembre 2015
@filippovitale
Polimorfismo parametrico,
polimorfismo su misura e
polimorfismo cosa?
3 semplici
Data Structure
Seq Set Map
package scala.collection
Seq Set Map
package scala.collection
v v v v
Seq Set Map
package scala.collection
valueA
valueB
valueC
Seq Set Map
package scala.collection
key value
key value
key value
Seq Set Map
package scala.collection
base trait per implementazioni
mutable e immutable
package scala.collection
Seq Set Map
package scala.collection.mutable
ArrayBuffer HashSet HashMap
package scala.collection.mutable
ArrayBuffer HashSet HashMap
“Mutability is an optimisation – perhaps premature”
package scala.collection
Seq Set
package scala.collection.immutable
Map
List HashSet HashMap
package scala.collection.mutable
ArrayBuffer HashSet HashMap
http://docs.scala-lang.org/tutorials/FAQ/collections.html
package scala.collection.immutable
List HashSet HashMap
Immutabilità implica:
- equational reasoning
- sharing with referential integrity
- thread safety
- …
“When you get used to immutable data,
ya kinda forget how to use mutable data
in a sensible way.” – Jessica Kerr
package scala.collection
Traversable
Seq Set Map
Quali metodi offre
Traversable?
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
def map[B](f: A => B)
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
def foreach(f: (A) => Unit): Unit
def map[B](f: A => B)
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
def foldLeft[B](z: B)(f: (B, A) => B): B
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
def foldLeft[B](z: B)(f: (B, A) => B): B
def /:[B](z: B)(op: (B, A) => B): B = foldLeft(z)(op)
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
def foldLeft[B](z: B)(f: (B, A) => B): B
def /:[B](z: B)(op: (B, A) => B): B = foldLeft(z)(op)
Theorems for free! – http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf
Parametricity – http://yowconference.com.au/slides/yowlambdajam2014/Morris-ParametricityTypesAreDocumentation.pdf
Unire Strutture Dati
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
def ++[B](that: Traversable[B]): Traversable[B]
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
def ++[B](that: Traversable[B]): Traversable[B]
Traversable Seq List
List(1, 2, 3) ++ List(4, 5, 6) == ???
List(1, 2, 3) ++ List(4, 5, 6) == List(1, 2, 3, 4, 5, 6)
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
def ++[B](that: Traversable[B]): Traversable[B]
Traversable Set HashSet
Set(1, 2, 3) ++ Set(4, 5, 6) == ???
Set(1, 2, 3) ++ Set(4, 5, 6) == Set(5, 1, 6, 2, 3, 4)
Set(1, 2, 3) ++ Set(4, 5, 6) == Set(5, 1, 6, 2, 3, 4)
Set(1, 2) ++ Set(2, 3) == Set(1, 2, 3)
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
def ++[B](that: Traversable[B]): Traversable[B]
Traversable Map HashMap
Map("a" -> 1) ++ Map("b" -> 2) == Map("a" -> 1, "b" -> 2)
E in casi più complessi?
Map[String, Set[Int]]
Map[String, Set[Int]]
“a” Set(1, 2)
“key b” Set(4, 7, 5)
“key c” Set(9, 4)
“a” Set(2, 3)
“key c” Set(3, 4)
“key d” Set(5, 6)
Map("a" -> Set(1, 2)) ++ Map("a" -> Set(2, 3)) == ???
Map("a" -> Set(1, 2)) ++ Map("a" -> Set(2, 3)) == ???
1: Map("a" -> Set(1, 2))
2: Map("a" -> Set(1, 2, 3))
3: Map("a" -> Set(2, 3))
4: RuntimeException
5: Compiler Error
Map("a" -> Set(1, 2)) ++ Map("a" -> Set(2, 3)) == ???
1:
2:
3: Map("a" -> Set(2, 3))
4:
5:
Map("a" -> Set(1, 2)) ??? Map("a" -> Set(2, 3))
Map("a" -> Set(1, 2, 3))
Metodi offerti da Traversable
isEmpty
size
hasDefiniteSize
++
map
flatMap
filter
remove
partition
groupBy
foreach
reduceRightOpt
head
headOption
tail
last
lastOption
init
take
drop
slice
takeWhile
forall
exists
count
find
foldLeft
/:
foldRight
:
reduceLeft
reduceLeftOpt
reduceRight
dropWhile
span
splitAt
toArray
toList
toIterable
toSeq
toStream
sortWith
mkString
toString
Seq Set Map
✔ ✔ ✘
Quando vuoi
un lavoro fatto bene…
“a” Set(1, 2) “a” Set(2, 3)
“a” Set(1, 2) ++ Set(2, 3)
“a” Set(1, 2) “a” Set(2, 3)
“a” Set(1, 2, 3)
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]]
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = {
mb foreach { case (k, v) =>
???
}
}
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = {
val result = mutable.Map() ++ ma
mb foreach { case (k, v) =>
???
}
result.toMap
}
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = {
val result = mutable.Map() ++ ma
mb foreach { case (k, v) =>
if (result.contains(k))
result += k -> (result(k) ++ v)
else
result += k -> v
}
result.toMap
}
Implementazione
con Map immutable
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = {
}
(ma /: mb) { case (result,(k, v)) =>
if (result.contains(k))
result + (k -> (result(k) ++ v))
else
result + (k -> v)
}
val result = mutable.Map() ++ ma
mb foreach { case (k, v) =>
if (result.contains(k))
result += k -> (result(k) ++ v)
else
result += k -> v
}
result.toMap
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = {
(ma /: mb) { case (result,(k, v)) =>
if (result.contains(k))
result + (k -> (result(k) ++ v))
else
result + (k -> v)
}
}
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
}
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
}}
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
// .some(_ ++ v).none(v)
}}
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
// .some(_ ++ v).none(v)
// .fold(v)(_ ++ v)
}}
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
// .some(_ ++ v).none(v)
// .fold(v)(_ ++ v)
// .cata(_ ++ v, v)
}}
“FP with Bananas, Lenses, Envelopes and Barbed Wire” – http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.125
http://en.wikipedia.org/wiki/Catamorphism
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
// .some(_ ++ v).none(v)
// .fold(v)(_ ++ v)
// .cata(_ ++ v, v)
}}
http://stackoverflow.com/questions/5328007/why-doesnt-option-have-a-fold-method
(ma /: mb) { case (result,(k, v)) =>
result + (k -> {
result.get(k) match {
case Some(vr) => vr ++ v
case None => v
}
// .map(_ ++ v).getOrElse(v)
// .some(_ ++ v).none(v)
// .fold(v)(_ ++ v)
// .cata(_ ++ v, v)
}}
http://stackoverflow.com/questions/5328007/why-doesnt-option-have-a-fold-method
(ma /: mb) { case (result, (k, v)) =>
result + (k -> result.get(k).cata(_ ++ v, v))
}
mb foreach { case (k, v) =>
result += (k -> result.get(k).cata(_ ++ v, v))
}
(ma /: mb) { case (result, (k, v)) =>
result + (k -> result.get(k).cata(_ ++ v, v))
}
mb foreach { case (k, v) =>
result += (k -> result.get(k).cata(_ ++ v, v))
}
E se volessimo unire due
mappe con type diversi?
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
def blend(ma: Map[String, Set[Int]],
mb: Map[String, Set[Int]])
: Map[String, Set[Int]] = ???
def blend(ma: Map[String, Map[Int, Set[Int]]],
mb: Map[String, Map[Int, Set[Int]]])
: Map[String, Map[Int, Set[Int]]] = ???
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
(ma /: mb) { case (result, (k, v)) =>
result + (k -> result.get(k).cata(_ ++ v, v))
}
(ma /: mb) { case (result, (k, v)) =>
result + ??? // { ??? => { ??? } }
}
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
trait Blendable[A] {
def blend(ma: A, mb: A): A
}
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
trait Blendable[A] {
def blend(ma: A, mb: A): A
}
new Blendable[...] {
def blend(ma: ..., mb: ...): ... = ???
}
Map[String, Set[Int]] Map[String, Map[Int, Set[Int]]]
trait Blendable[A] {
def blend(ma: A, mb: A): A
}
new Blendable[...] {
def blend(ma: ..., mb: ...): ... = ???
}
x10 Developer
Cosa intendiamo
veramente per “blend”
List utilizzando l’operatore binario ++
Set utilizzando l’operatore binario ++
List(1, 2, 3) ++ List(4, 5, 6) == List(1, 2, 3, 4, 5, 6)
Set(1, 2) ++ Set(2, 3) == Set(1, 2, 3)
(List, ++)
(Set, ++)
(1 blend 2) == ???
(List, ++)
(Set, ++)
(Int, +)
(1 blend 2) == 1 + 2 == 3
(List, ++)
(Set, ++)
(Int, +)
(String, +)("ab" blend "cd") == ("ab" + "cd") == "abcd"
(List, ++)
(Set, ++)
(Int, +)
(String, +)
(Map[...], Blendable[...].blend)
Blendable[Map[String, Set[Int]]].blend(ma, mb)
Cosa potrebbe
consigliarci un
Matematico?
WARNING
Algebra ahead
☣
https://it.wikipedia.org/wiki/Semigruppo
“Un semigruppo è un insieme S munito di una
operazione binaria associativa m: S × S → S”
https://it.wikipedia.org/wiki/Propriet%C3%A0_di_chiusura
Proprietà di chiusura ≝ ∀a, b ∈ T : a∙b ∈ T
Per ogni a, b in T, il risultato dell’operazione a⋅b è in T:
trait Semigroup[T] {
def op(a: T, b: T): T
}
def op(a: Boolean, b: Boolean): Boolean
def op(a: Int, b: Int): Boolean
✓
✘
https://it.wikipedia.org/wiki/Associativit%C3%A0
Legge Associativa ≝ ∀a, b, c ∈ T : (a∙b)∙c = a∙(b∙c)
Ogni a, b e c in T soddisfano (a∙b)∙c = a∙(b∙c)
trait Semigroup[T] {
def op(a: T, b: T): T
}
((a op b) op c) == (a op (b op c))
https://it.wikipedia.org/wiki/Semigruppo
“Un semigruppo è un insieme S munito di una
operazione binaria associativa m: S × S → S”
Scalaz e Semigruppi
import scalaz.std.set._
implicit def setSemigroup[A]:Semigroup[Set[A]] =
new Semigroup[Set[A]] {
def append(f1: Set[A], f2: => Set[A]) = f1 ++ f2
}
implicit def setSemigroup[A]:Semigroup[Set[A]] =
new Semigroup[Set[A]] {
def append(f1: Set[A], f2: => Set[A]) = f1 ++ f2
}
op
import scalaz.syntax.semigroup._
import scalaz.std.list._
List(1, 2) |+| List(3, 4)
res: List[Int] = List(1, 2, 3, 4)
import scalaz.syntax.semigroup._
import scalaz.std.set._
Set(1, 2) |+| Set(2, 3)
res: Set[Int] = Set(1, 2, 3)
import scalaz.syntax.semigroup._
import scalaz.std.anyVal._
1 |+| 2 |+| 3
res: Int = 6
import scalaz.syntax.semigroup._
import scalaz.std.string._
"a" |+| "b" |+| "c"
res: String = "abc"
/**
* A semigroup in type F must satisfy two laws:
*
* - '''closure''': `∀ a, b in F, append(a, b)` is also in `F`.
* - '''associativity''': `∀ a, b, c` in `F`, the equation
* `append(append(a, b), c) = append(a, append(b , c))` holds.
*/
trait SemigroupLaw {
def associative(f1: F, f2: F, f3: F)(implicit F: Equal[F]): Boolean =
F.equal(append(f1, append(f2, f3)), append(append(f1, f2), f3))
}
import scalaz.scalacheck.ScalazProperties._
import scalaz.std.anyVal._
semigroup.laws[Int].check
+ semigroup.associative: OK, passed 100 tests.
semigroup.laws[String].check
semigroup.laws[Set[Int]].check
semigroup.laws[List[String]].check
semigroup.laws[Map[Int, Int]].check
+ semigroup.associative: OK, passed 100 tests.
+ semigroup.associative: OK, passed 100 tests.
+ semigroup.associative: OK, passed 100 tests.
+ semigroup.associative: OK, passed 100 tests.
La nostra Map[_, Set[Int]]
è un semigruppo?
Map("a" -> 1, "b" -> 4) |+| Map("a" -> 2)
res: Map[…] = Map(a -> 3, b -> 4)
“Some data structures form interesting semigroups as long as
the types of the elements they contain also form semigroups.”
import scalaz.scalacheck.ScalazProperties._
semigroup.laws[Map[String, Set[Int]]].check
+ semigroup.associative: OK, passed 100 tests. ✓
Map("a" -> Set(1, 2)) |+| Map("a" -> Set(2, 3))
res: Map[…] = Map(a -> Set(1, 2, 3))
“adattato” da: Functional Programming in Scala - Part 3 - Chapter 10 Monoids
✓
Ma nel mio codebase
non ho Map così semplici…
Map("a" ->
Map("aa" ->
Map("aaa" ->
Map("aaaa" -> List(1, 3),
"aaab" -> List(2, 4))))) |+| Map("a" ->
Map("aa" ->
Map("aaa" ->
Map("aaaa" -> List(5, 7),
"aaab" -> List(6, 8)))))
Map(a->Map(aa->Map(aaa->Map(aaaa->List(1, 3, 5, 7), aaab->List(2, 4, 6, 8)))))
Benchmarking
“Experience indicates that nearly everybody
has the wrong idea about the real bottlenecks
in his programs” – Donald Knuth
Computer programming as an art (1974) – http://dl.acm.org/citation.cfm?id=361612
Map[String, Set[Int]]
Settembre 2015
@filippovitale
$ tail -f domande

More Related Content

What's hot

Table of Useful R commands.
Table of Useful R commands.Table of Useful R commands.
Table of Useful R commands.Dr. Volkan OBAN
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with RDr. Volkan OBAN
 
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...Accumulo Summit
 
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님AI Robotics KR
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Ram Narasimhan
 
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterACSG Section Montréal
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyrRomain Francois
 
Scala parallel-collections
Scala parallel-collectionsScala parallel-collections
Scala parallel-collectionsKnoldus Inc.
 
13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic ProgrammingNeeldhara Misra
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkMartin Goodson
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019Aerospike
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 

What's hot (20)

Table of Useful R commands.
Table of Useful R commands.Table of Useful R commands.
Table of Useful R commands.
 
Script jantung copy
Script jantung   copyScript jantung   copy
Script jantung copy
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
 
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...
Accumulo Summit 2016: Introducing Accumulo Collections: A Practical Accumulo ...
 
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
 
Rsplit apply combine
Rsplit apply combineRsplit apply combine
Rsplit apply combine
 
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Scala parallel-collections
Scala parallel-collectionsScala parallel-collections
Scala parallel-collections
 
13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
 
ClusterAnalysis
ClusterAnalysisClusterAnalysis
ClusterAnalysis
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Relatório
RelatórioRelatório
Relatório
 
Topological sorting
Topological sortingTopological sorting
Topological sorting
 

Viewers also liked (18)

Sickle Cell Ministries PP-1
Sickle Cell Ministries PP-1Sickle Cell Ministries PP-1
Sickle Cell Ministries PP-1
 
La tierra
La tierraLa tierra
La tierra
 
Marketing Brochure Smart Campus
Marketing Brochure Smart CampusMarketing Brochure Smart Campus
Marketing Brochure Smart Campus
 
ล่าสุดทาง
ล่าสุดทางล่าสุดทาง
ล่าสุดทาง
 
Rock the deals
Rock the dealsRock the deals
Rock the deals
 
model
modelmodel
model
 
Not just popups- Jaffna meetup
Not just popups- Jaffna meetupNot just popups- Jaffna meetup
Not just popups- Jaffna meetup
 
general media kit 9-16-15
general media kit 9-16-15general media kit 9-16-15
general media kit 9-16-15
 
Revelacion de la Cena del Senor
Revelacion de la Cena del SenorRevelacion de la Cena del Senor
Revelacion de la Cena del Senor
 
Control freaks nieslens10heuristics_1215.pptx
Control freaks nieslens10heuristics_1215.pptxControl freaks nieslens10heuristics_1215.pptx
Control freaks nieslens10heuristics_1215.pptx
 
CONCURSO DE HABILIDADES MATEMÁTICAS II
CONCURSO DE HABILIDADES MATEMÁTICAS IICONCURSO DE HABILIDADES MATEMÁTICAS II
CONCURSO DE HABILIDADES MATEMÁTICAS II
 
model 2
model 2model 2
model 2
 
SLIDESHARE
SLIDESHARESLIDESHARE
SLIDESHARE
 
Katherine mallqui saenz
Katherine mallqui saenzKatherine mallqui saenz
Katherine mallqui saenz
 
Presentación1
Presentación1Presentación1
Presentación1
 
Management of innovations : from idea to effect
Management of innovations : from idea to effectManagement of innovations : from idea to effect
Management of innovations : from idea to effect
 
Yobitel communicaitons Smart Campus
Yobitel communicaitons   Smart CampusYobitel communicaitons   Smart Campus
Yobitel communicaitons Smart Campus
 
Tratado de versalles
Tratado de versallesTratado de versalles
Tratado de versalles
 

Similar to Polimorfismo cosa?

Will it Blend? - ScalaSyd February 2015
Will it Blend? - ScalaSyd February 2015Will it Blend? - ScalaSyd February 2015
Will it Blend? - ScalaSyd February 2015Filippo Vitale
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About RubyIan Bishop
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Konrad Malawski
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik ErlandsonDatabricks
 
JSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why notJSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why notChengHui Weng
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Leonardo Borges
 
Sequence and Traverse - Part 2
Sequence and Traverse - Part 2Sequence and Traverse - Part 2
Sequence and Traverse - Part 2Philip Schwarz
 
Hash map (java platform se 8 )
Hash map (java platform se 8 )Hash map (java platform se 8 )
Hash map (java platform se 8 )charan kumar
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Bryan O'Sullivan
 

Similar to Polimorfismo cosa? (20)

Will it Blend? - ScalaSyd February 2015
Will it Blend? - ScalaSyd February 2015Will it Blend? - ScalaSyd February 2015
Will it Blend? - ScalaSyd February 2015
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
 
Scala collections
Scala collectionsScala collections
Scala collections
 
Scala Collections
Scala CollectionsScala Collections
Scala Collections
 
R code for data manipulation
R code for data manipulationR code for data manipulation
R code for data manipulation
 
R code for data manipulation
R code for data manipulationR code for data manipulation
R code for data manipulation
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About Ruby
 
Internal workshop es6_2015
Internal workshop es6_2015Internal workshop es6_2015
Internal workshop es6_2015
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014
 
Scala.io
Scala.ioScala.io
Scala.io
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik Erlandson
 
JSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why notJSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why not
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
 
Sequence and Traverse - Part 2
Sequence and Traverse - Part 2Sequence and Traverse - Part 2
Sequence and Traverse - Part 2
 
Hash map (java platform se 8 )
Hash map (java platform se 8 )Hash map (java platform se 8 )
Hash map (java platform se 8 )
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
py_AutoMapMaker
py_AutoMapMakerpy_AutoMapMaker
py_AutoMapMaker
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

Polimorfismo cosa?