Skip to content

Instantly share code, notes, and snippets.

import akka.actor._
import akka.pattern.{after, ask, pipe}
import akka.util.Timeout
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent._
import scala.concurrent.duration._
class Job(jobTracker: ActorRef) extends Actor {
var count = 0
// a ∨ (b ∨ c) = (a ∨ b) ∨ c, a ∧ (b ∧ c) = (a ∧ b) ∧ c associativity
// a ∨ b = b ∨ a, a ∧ b = b ∧ a commutativity
// a ∨ (a ∧ b) = a, a ∧ (a ∨ b) = a absorption
// a ∨ 0 = a, a ∧ 1 = a identity
// a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c), a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) distributivity
// a ∨ ¬a = 1, a ∧ ¬a = 0 complements
class AlgebraPoliceman[A : BooleanAlgebra : Arbitrary : Eq]() extends Properties("BooleanAlgebra") {
def zero = implicitly[BooleanAlgebra[A]].zero
def one = implicitly[BooleanAlgebra[A]].one
package psp
import sbt._, Keys._, scala.util.Try
package object stub extends stub.LibSbtStub {
lazy val props = new SbtBuildProps()
lazy val pspBintray = new Bintray("paulp")
def buildSettings = quietSettings ++ Seq(resolvers ++= pspBintray.repos) ++ addSbtPlugin(pspOrg % "psp-libsbt" % dependVersion)
def projectSettings = quietSettings
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits._
import scala.util.{ Success, Failure }
import akka.actor._
import akka.pattern.{ after, ask, pipe }
import akka.util.Timeout
object LogSearch extends App {
require 'openssl'
key = "SYMETRIC KEY"
data = "DATA TO SIGN"
p OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha1'), key, data)
diff --git a/README.md b/README.md
index 0782789..0cb6f6a 100644
--- a/README.md
+++ b/README.md
@@ -172,7 +172,7 @@ in Scala flows from left-to-right, can require fewer type annotations.
every possible extension method. This should also help compiler performance,
by reducing the implicit search space.
* Syntax is layered in the same way as type classes. Importing the syntax for, say, `Applicative`
- will also provide the syntax for `Pointed` and `Functor`.
+ will also provide the syntax for `Apply` and `Functor`.
diff --git a/README.md b/README.md
index 0782789..0cb6f6a 100644
--- a/README.md
+++ b/README.md
@@ -172,7 +172,7 @@ in Scala flows from left-to-right, can require fewer type annotations.
every possible extension method. This should also help compiler performance,
by reducing the implicit search space.
* Syntax is layered in the same way as type classes. Importing the syntax for, say, `Applicative`
- will also provide the syntax for `Pointed` and `Functor`.
+ will also provide the syntax for `Apply` and `Functor`.
Recurly.subdomain = ENV['RECURLY_SUBDOMAIN']
Recurly.api_key = ENV['RECURLY_API_KEY']
Recurly.js.private_key = ENV['RECURLY_JS_PRIVATE_KEY']
Recurly.default_currency = 'USD'
import scalaz._
import Scalaz._
object monads {
def fix[A](f: (=> A) => A): A = f(fix(f)) //> fix: [A](f: => A => A)A
type Gen[A] = (=> A) => A
def gFib: Gen[Int => Int] = (self) => n =>

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation: