language is representation (data structures) and combination (control structures)
goals of a language: simplification => easy to express "what" it is you're trying to do
simplification => generalization
towards composability
| # | |
| # This script will install the following Textmate bundles | |
| # | |
| # Languages | |
| # - c https://github.com/textmate/c.tmbundle | |
| # - coffeescript https://github.com/jashkenas/coffee-script-tmbundle | |
| # - context free https://github.com/textmate/context-free.tmbundle | |
| # - erlang https://github.com/textmate/erlang.tmbundle | |
| # - haskell https://github.com/textmate/haskell.tmbundle.git | |
| # - html https://github.com/textmate/html.tmbundle |
| package com.banksimple.testing.util | |
| import akka.actor._ | |
| class ReplayActor extends Actor { | |
| var lastSeen: List[Any] = List() | |
| override def receive: Receive = { | |
| case 'dump => { self.reply(lastSeen) ; lastSeen = List() } | |
| case a => lastSeen = a :: lastSeen | |
| } | |
| } |
| import scala.collection.mutable.ListBuffer | |
| import akka.actor.{Actor,ActorRef} | |
| import akka.actor.Actor._ | |
| import akka.routing.{ Listeners, Listen } | |
| //Represents a domain event | |
| trait Event | |
| //A builder to create domain entities | |
| trait EntityBuilder[Entity] { |
| // ########################################################### | |
| // | |
| // Demonstrates how to supervise an Akka consumer actor. | |
| // | |
| // The consumer consumes messages from a file endpoint: | |
| // - successful message processing by the consumer will | |
| // positively acknowledge the message receipt, causing | |
| // the file endpoint to delete the file. | |
| // - an exception during message processing will cause a | |
| // supervisor to restart the consumer. Before restart, |
| trait Builder[M[_], N[_]] { | |
| type Apply[T] = M[N[T]] | |
| } | |
| implicit def optionIntListBuilder: Builder[List, Option]#Apply[Int] = List.empty[Option[Int]] | |
| // make a list of option[T] | |
| def make[T](implicit p: Builder[List, Option]#Apply[T]): List[Option[T]] = p | |
| make[Int] // List[Option[Int]] |
| // initial version | |
| import scala.collection.immutable.TreeSet | |
| class TreeMember[A] { | |
| // some really important stuff here, of course! ;~) | |
| } | |
| class Main { | |
| implicit val treeOrder = new Ordering[TreeMember[A]] { | |
| def compare(a: TreeMember[A], b: TreeMember[A]) = { | |
| // elided for simplicity's sake | |
| } |
| import java.io.File | |
| import sbt._ | |
| class Project(info: ProjectInfo) extends ParentProject(info) with IdeaProject { | |
| lazy val mavenLocal = "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository" | |
| lazy val geotoolsRepository = "Open Source Geospatial Foundation Repository" at "http://download.osgeo.org/webdav/geotools/" | |
| lazy val javanetRepository = "Java.net Repository" at "http://download.java.net/maven/2" | |
| lazy val iglootoolsRepository = "Iglootools Releases Repository" at "http://developers.sirika.com/maven2/releases/" | |
| lazy val jbossRepository = "JBoss Releases Repository" at "https://repository.jboss.org/nexus/content/groups/public-jboss" | |
| lazy val hibernateSpatial = "Hibernate Spatial Repository" at "http://www.hibernatespatial.org/repository" |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>org.mongodb.mongod</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/mongodb/bin/mongod</string> | |
| <string>run</string> |
| import akka.amqp.AMQP._ | |
| import akka.amqp._ | |
| import akka.actor._ | |
| import java.util.concurrent.{TimeUnit, CountDownLatch} | |
| import util.Random | |
| object LoadBalancingDemo { | |
| def main(args: Array[String]) { |