Skip to content

Instantly share code, notes, and snippets.

Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false] [dtrace]
Eshell V5.10.3 (abort with ^G)
1> {ok, Tokens, Line} = erl_scan:string("-type foo() :: any().").
{ok,[{'-',1},
{atom,1,type},
{atom,1,foo},
{'(',1},
{')',1},
{'::',1},
## Default ring creation size. Make sure it is a power of 2,
## e.g. 16, 32, 64, 128, 256, 512 etc
## ring_size = 64
## enable active anti-entropy subsystem
anti_entropy = on
## location of the console log
log.console.file = ./log/console.log
@seancribbs
seancribbs / crdt.py
Last active December 22, 2015 02:58
WIP Client-side Riak CRDT API for Python
from collections import MutableSet, MutableMapping, Mapping
class DataType(object):
def __init__(self, value=None, context=None):
if value is not None:
self._check_value(value)
self.value = value
if context:
self.context = context
export PATH="$HOME/erlang/current/bin:$PATH"
erlcur() {
DIR=`ls -lr $HOME/erlang | awk '/current/ { print $NF }'`
echo -n ${DIR##*/}
}
erlsw() {
TARGET=`find $HOME/erlang -depth 1 -type d -name "*$1*" | head -1`
if [ -z "$TARGET" ]; then
$ test
> Connected!
> Stored test object!
> Fetched stored object: this is a test
%% This clause matches
classify_address(<<0:80, 16#ffff:16, V4:32/bits>>) -> {ipv4_mapped, V4};
%% This clause does not match
classify_address(<<0:80, 16#ffff:16, V4:32/binary>>) -> {ipv4_mapped, V4};
Ruby 1.9.3 x86_64-darwin12.2.1
2013-06-07 11:47:28 -0500
Count 10000
Threads 2
Rehearsal ----------------------------------------------
individual 10.800000 0.310000 11.110000 ( 23.950182)
multiget 12.450000 0.430000 12.880000 ( 14.213369)
------------------------------------ total: 23.990000sec
user system total real
-define(case_inf(E, E0, FC, E1, AC, E2, A, F, E3),
begin
AInf = (E),
if
not AInf ->
E0;
is_function(AInf) ->
FC = AInf,
E1;
is_tuple(AInf) andalso size(AInf) == 2 andalso is_function(element(2,AInf)) ->
{ok,[#option{key = "java_package",
value = "com.basho.riak.protobuf",line = 29},
#option{key = "java_outer_classname",value = "RiakPB",
line = 30},
#message{name = #id{names = ["RpbErrorResp"],line = 34},
decls = [#field{id = 1,name = "errmsg",type = bytes,
rule = required,options = undefined,line = 35},
#field{id = 2,name = "errcode",type = uint32,
rule = required,options = undefined,line = 36}],
line = 34},
@seancribbs
seancribbs / 00demo.md
Last active December 16, 2015 17:09
Demo code from NoSQL Matters Cologne 2013