Skip to content

Instantly share code, notes, and snippets.

View oluies's full-sized avatar

Örjan Angré (Lundberg) oluies

  • Sweden
  • 05:57 (UTC +02:00)
  • X @oluies
View GitHub Profile
# bash function
defcomp () {
local name="$1" && shift
local functionName="$( echo "${name}_completion" | tr - _ )"
source <(cat <<EOM
$functionName () {
local cur
_get_comp_words_by_ref -n =: cur
COMPREPLY=( \$(compgen -W "\$( $@ )" -- "\$cur") )
}
@debasishg
debasishg / gist:8172796
Last active April 20, 2025 12:45
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@jboner
jboner / akka-cluster-implementation-notes.md
Last active October 9, 2024 11:34
Akka Cluster Implementation Notes

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:

@krishnanraman
krishnanraman / Stats
Last active April 6, 2016 17:48
Trivia: Generate primes between 1 and 100 million with Scalding Map-reduce ( well, just Map :) thanks @squarecog
Trivia problem: Generate primes between 1 and 100 million with Scalding
Input: Numbers from 1 to 100 million, 1 per line - use a simple C program for this
Output: Filter input for primes using the filter function on pipes in Scalding
Execution time: 13:11:00 to 13:25:54 = 15 minutes in hdfs-local mode
Part files: 27
$ ls
part-00000 part-00002 part-00004 part-00006 part-00008 part-00010 part-00012 part-00014 part-00016 part-00018 part-00020 part-00022 part-00024 part-00026 part-00001 part-00003 part-00005 part-00007 part-00009 part-00011 part-00013 part-00015 part-00017 part-00019 part-00021 part-00023 part-00025
$ tail part-00026
99999787
@halcat0x15a
halcat0x15a / gist:5376994
Created April 13, 2013 04:57
Maybe Monad with Church Encoding in Scala
import scala.language.higherKinds
import scala.language.implicitConversions
import scala.language.reflectiveCalls
trait Forall[M[_]] {
def apply[A]: M[A]
}
object Maybe {
@milessabin
milessabin / gist:4973733
Created February 17, 2013 21:59
Lazy pattern matching in Scala.
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_05).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def foo = { println("foo"); "foo" }
foo: String
scala> def bar = { println("bar"); "bar" }
bar: String
@viktorklang
viktorklang / NonblockingCache.scala
Last active December 11, 2015 23:38
Nonblocking cache
/*©2013 Viktor Klang*/
package akka.util
import java.util.concurrent.atomic.AtomicReference
import scala.concurrent.{ Future, ExecutionContext }
import scala.annotation.tailrec
class Cache[K, V](__ec: ExecutionContext, throughput: Int) extends AtomicReference[Map[K, V]] {
implicit val executor = SerializedSuspendableExecutionContext(throughput)(__ec)
@tailrec final def update(f: Map[K, V] ⇒ Map[K, V]): Map[K, V] = {
val v = get
val nv = f(v)
@ymasory
ymasory / bay-scala-jobs
Last active February 18, 2020 20:48
Companies hiring Scala developers in the Bay Area.
Companies hiring Scala developers in the Bay Area.
Created in response to a thread on scala-base.
My favorites:
- CloudPhysics
- Wordnik
Unbiased list:
- 10Gen
- Audax Health
@propensive
propensive / quaternions.scala
Created August 1, 2012 02:01
Quaternions in Scala
object Algebra {
// Build up increasingly complex algebras
trait Magma[T] {
def add(x : T, y : T) : T
}
trait Monoid[T] extends Magma[T] {
def zero : T
}