Auditorium
Josh Suereth, Dick Wall, Auditorium
Josh and Dick will take a deep dive into one of Scala's more advanced language constructs: the for expression. In this coding-example-heavy talk we will cover topics like:
- For, it's not about looping
| (module | |
| (type $t0 (func)) | |
| (type $t1 (func (result i32))) | |
| (func $__wasm_call_ctors (type $t0)) | |
| (func $main (export "main") (type $t1) (result i32) | |
| i32.const 42) | |
| (table $T0 1 1 anyfunc) | |
| (memory $memory (export "memory") 0) | |
| (global $g0 (mut i32) (i32.const 66560)) | |
| (global $__heap_base (export "__heap_base") i32 (i32.const 66560)) |
| import scala.reflect.ClassTag | |
| /** A typeclass that describes how to instantiate an array for the given type `T`. | |
| * | |
| * This is a class tag on steroids. | |
| * It is used in reactive containers that have to do a lot of array allocations. |
| > test | |
| [warn] Scala version was updated by one of library dependencies: | |
| [warn] * org.scala-lang:scala-library:(2.11.4, 2.11.6, 2.11.0) -> 2.11.7 | |
| [warn] To force scalaVersion, add the following: | |
| [warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) } | |
| [warn] Run 'evicted' to see detailed eviction warnings | |
| [info] Fast optimizing /home/axel22/workspaces/scala/super-storm-enroute/reactors/reactors-common/js/target/scala-2.11/reactors-common-test-fastopt.js | |
| [info] + QuadMatrix.remove elements in a rectangle: OK, passed 200 tests. | |
| [info] Elapsed time: 9.485 sec | |
| [info] + QuadMatrix.update and apply in random order: OK, passed 200 tests. |
| import scala.language.experimental.macros | |
| object Input { | |
| //val universe: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe | |
| //import universe._ | |
| import scala.reflect.macros.whitebox.Context | |
| type Query[T] = () => Option[T] |
| import scala.collection._ | |
| import scala.concurrent._ | |
| import ExecutionContext.global | |
| object Ex1 { | |
| var x: List[Int] = null | |
| def foo() { | |
| val buffer = mutable.ListBuffer[Int]() | |
| buffer ++= (0 until 100) |
| import sbt._ | |
| import Keys._ | |
| import Process._ | |
| import java.io.File | |
| object ReactiveCollectionsBuild extends Build { | |
| val publishUser = "SONATYPE_USER" |
| val publishCreds: Seq[Setting[_]] = Seq(userPass match { | |
| case Some((user, pass)) => | |
| credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass) | |
| case None => | |
| val errorMessage = | |
| "Publishing to Sonatype is disabled since the \"" + | |
| publishUser + "\" and/or \"" + publishPass + "\" environment variables are not set." | |
| publish <<= streams.map(_.log.info(errorMessage)) |
As compiled by Kevin Wright a.k.a @thecoda
(executive producer of the movie, and I didn't even know it... clever huh?)
please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!
This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!
Monday June 16th
| import org.scala.optimized.test.par.ParImmutableTreeSetSnippets | |
| object snippets extends ParImmutableTreeSetSnippets | |
| import scala.collection.par._ | |
| implicit val s = new workstealing.Scheduler.ForkJoin(new workstealing.Scheduler.Config.Default(8)) | |
| snippets.aggregateParallel(collection.immutable.TreeSet((0 until 30000).map(_.toString): _*)) | |