This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
public class Main { | |
public static void main(String[] args) { | |
Predicate<Integer> isOdd = i -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns test-bench.core) | |
(defprotocol BinaryTree | |
(member? [_ e] "Check if e is a member of the BinaryTree") | |
(insert [_ e] "Insert an element in the tree") | |
(delete [_ e] "Remove element from tree")) | |
;; Need to forward declare factory functions. | |
(declare leaf node delete) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns amaze-me.core | |
(:require [quil.core :as q] | |
[quil.middleware :as m])) | |
(defn ball-setup | |
"initial state of tha ball." | |
[] | |
(q/smooth) | |
(q/background 255) | |
{:direction {:x 4 :y 5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
;; Configuration Layers | |
;; -------------------- | |
(setq-default | |
;; List of additional paths where to look for configuration layers. | |
;; Paths must have a trailing slash (ie. `~/.mycontribs/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Remove fly-spell for markdown and text-files. | |
(remove-hook 'text-mode-hook 'enable-flyspell-mode) | |
(remove-hook 'markdown-mode-hook 'enable-flyspell-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.io.IO | |
import akka.io._ | |
object Boot extends App { | |
import akka.io.Tcp._ | |
implicit val sys = ActorSystem("io") | |
import akka.actor.{Actor, Props, ActorRef} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class RegisterDispatcher(ref: ActorRef, matcher: String) | |
class MasterActor extends Actor { | |
def receive = { | |
case RegisterDispatcher(ref, matcher) => //.. add ref to registry. watch the ref to remove the entry should the actor terminate. | |
case s: String => // look in the registry for a match amd dispatch accordingly. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[INFO] [12/05/2012 19:11:03.478] [Resume-akka.actor.default-dispatcher-1] [akka://Resume/user/super/manager] Relaying to node: MESSAGE_1 | |
[INFO] [12/05/2012 19:11:03.478] [Resume-akka.actor.default-dispatcher-3] [akka://Resume/user/super/manager/node] Node got message: MESSAGE_1 | |
[ERROR] [12/05/2012 19:11:03.479] [Resume-akka.actor.default-dispatcher-1] [akka://Resume/user/super/manager] java.lang.Exception: Crash | |
java.lang.RuntimeException: java.lang.Exception: Crash | |
at foo.Manager$$anonfun$receive$2.apply(Resume.scala:42) | |
at foo.Manager$$anonfun$receive$2.apply(Resume.scala:41) | |
at akka.actor.Actor$class.apply(Actor.scala:318) | |
at foo.Manager.apply(Resume.scala:37) | |
at akka.actor.ActorCell.invoke(ActorCell.scala:626) | |
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ring | |
import akka.actor._ | |
import akka.routing.NoRouter | |
import akka.remote.{RemoteScope, UnparsedTransportAddress, UnparsedSystemAddress} | |
/** | |
// application.conf: | |
akka { | |
actor { |