Skip to content

Instantly share code, notes, and snippets.

@lenary
lenary / 00-intro.md
Last active August 29, 2015 13:56
Guidance Notes for CRDT Performance Issues

I've had one question about subpar performance in Riak 2.0's CRDTs. I thought I'd write this so that people can more easily diagnose these issues, without the CRDT team having to step in every time.

An Example: A Client was having problems with the performance fetching and updating sets. The issue manifested itself with poor fetch performance.

So, how do you go about debugging/diagnosing this?

@aphyr
aphyr / gist:95fb19173e9817f15f10
Created May 6, 2014 01:05
lol jruby stacktraces
com.factual.polyglot.JSFunction.call(JSFunction.java:54)
com.factual.scarecrow.rules.Function.call(Function.java:27)
com.factual.scarecrow.rules.FunctionContainer.call(FunctionContainer.java:42)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:425)
org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:292)
org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44)
@lenary
lenary / gist:2b84ae3a24ce0f557864
Last active August 29, 2015 14:01
Travelling

I'm going travelling this summer. Here's to where:

  • Washington DC (~ 3 nights)
  • Austin, TX (~ 3 nights)
  • San Diego (~ 3 nights)
  • San Francisco (~ 1 week)
  • Portland (~ 3 nights)
  • Seattle (~ 3 nights)
  • NYC (more than 3 nights, less than a week)
  • Boston (~ 1.5 weeks)
%% @doc Reports on percentage of modules, functions and types that are
%% documented.
-module(edoc_stats).
-export([file/1, file/2, files/1, files/2, aggregate/1, report/1, report_files/1, report_files/2]).
-include_lib("xmerl/include/xmerl.hrl").
-import(xmerl_xpath, [string/2]).
-define(QUERY_FUNS, [ fun module_has_description/2
, fun functions_have_descriptions/2
, fun types_have_descriptions/2
@lkuper
lkuper / peter-alvaro-halpern-pwl-notes.md
Last active August 29, 2015 14:05
Notes from Peter Alvaro's talk at PWL, August 21, 2014

"Consensus is impossible" is a gloss for "there's always an execution that doesn't terminate".

Once you've internalized that you can't distinguish slow nodes from dead nodes, how do you deal with that?

"When you're engaged in a battle of wits with a Sicilian and death is on the line, you certainly need to think about epistemic logic."

A correct distributed program achieves (nontrivial) distributed property X. So we need to ask:

  1. is X even attainable?
  2. what's the cheapest* protocol that gets me X? (* according to some cost metric)

autoscale: true build-lists: true slidenumbers: true

Tracing Riak with Redbug

An example of how to use Redbug to trace Riak internals, taking as an example an inexplicably failing secondary index range query.


@phred
phred / tiny.markdown
Created October 14, 2012 12:30
Solving Embarrasingly Simple Problems in Factor

Solving Embarrasingly Simple Problems in Factor

This Article has struck a chord with me. I'm not an Erlang-er, but the style he describes of "writing many tiny functions" strongly reminds me of why I've come to love Factor.

Drink Beer when Delicious

@ericmoritz
ericmoritz / erlmonad.erl
Last active December 18, 2015 05:39
I think I finally understand monads!
-module(erlmonad).
-compile(export_all).
half(X) when X rem 2 =/= 0 ->
nothing;
half(X) ->
X div 2.
@bookshelfdave
bookshelfdave / contact.md
Last active December 19, 2015 21:58
Contact language
/* comments */
// comments

Connections, misc

// default connection, this is used if a named connection 
// is not specified in a fetch, put, delete
simple_test() ->
{ok, EC} = erasuerl:new(),
{ok, Bin} = file:read_file("/usr/share/dict/words"),
{MD, KBins, MBins} = erasuerl:encode(EC, Bin),
[K1, K2, K3, K4, K5, K6, K7, K8, K9] = KBins,
[M1, M2, M3, M4] = MBins,
KBins2 = [undefined, undefined, undefined, K4, K5, K6, K7, K8, K9],
MBins2 = [undefined, M2, M3, M4],
Bin = iolist_to_binary(erasuerl:decode(EC, MD, KBins2, MBins2)).