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
#include <cstdio> | |
#include <boost/optional.hpp> | |
template <class T> | |
using Maybe = boost::optional<T>; | |
Maybe<int> isYouPositive(int val) | |
{ | |
return val > 0 ? Maybe<int>(val) : Maybe<int>(); | |
} |
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
#include <cstdio> | |
#include <stdexcept> | |
template <class T> | |
struct Maybe { | |
Maybe( const T& val ) : val_(val), valid_(true) { } | |
Maybe() : valid_(false) { } | |
const T& get() const { | |
if (valid_) return val_; | |
throw std::logic_error("lol type systems"); |
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
vclock_to_binary([], Acc, Size) -> | |
VclockSize = size(Acc), | |
<<VclockSize:32/integer, Acc/binary>>; | |
vclock_to_binary([{AId, {Count, TS}}|T], Acc, Size) -> | |
AIdSize = size(AId), | |
vclock_to_binary(T, <<AIdSize:8/integer, AId:AIdSize/binary, Count:64/integer, TS:32/integer, Acc/binary>>, Size+1). | |
binary_to_vclock(<<VclockSize:32/integer, VclockBin:VclockSize/binary, Rest/binary>>) -> | |
binary_to_vclock(VclockBin, []). |
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
AC_DEFUN([AC_HEADER_SHARED_PTR], [ | |
AC_CACHE_CHECK(for tr1/shared_ptr, | |
ac_cv_cxx_tr1_shared_ptr, | |
[AC_LANG_SAVE | |
AC_LANG_CPLUSPLUS | |
AC_TRY_COMPILE([#include <tr1/memory>], [using std::tr1::shared_ptr;], | |
ac_cv_cxx_tr1_shared_ptr=yes, ac_cv_cxx_tr1_shared_ptr=no) | |
AC_LANG_RESTORE | |
]) | |
if test "$ac_cv_cxx_tr1_shared_ptr" = yes; then |
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 random, sys | |
NONWORD = "\n" | |
STARTKEY = NONWORD, NONWORD | |
MAXGEN=1000 | |
class MarkovChainer(object): | |
def __init__(self): | |
self.state = dict() |
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
(riak@127.0.0.1)1> {ok, C} = riak:local_client(). | |
{ok,{riak_client,'riak@127.0.0.1',undefined}} | |
(riak@127.0.0.1)2> Object = riak_object:new(<<"testbucket">>, <<"testkey">>, <<"testvalue">>). | |
{r_object,<<"testbucket">>,<<"testkey">>, | |
[{r_content,{dict,0,16,16,8,80,48, | |
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],...}, | |
{{[],[],[],[],[],[],[],[],[],[],[],[],...}}}, | |
<<"testvalue">>}], | |
[], | |
{dict,1,16,16,8,80,48, |
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
PCAP error: 'truncated dump file; tried to read 973 captured bytes, only got 61' | |
5316395 packets seen, 5316395 TCP packets traced | |
elapsed wallclock time: 0:06:39.340798, 13312 pkts/sec analyzed | |
trace file elapsed time: 0:07:29.206448 | |
TCP connection info: | |
1 TCP connection traced: | |
TCP connection 1: | |
host a: 17.154.234.156:43011 | |
host b: 17.173.26.148:8010 | |
complete conn: no (SYNs: 2) (FINs: 0) |
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
Subject: /var/hg/repos/webmachine: testing notify hook | |
From: hg-commit@basho-1.argv0.net | |
To: andy@andygross.org | |
Date: Thu, 17 Jan 2008 20:59:17 +0000 | |
details: https://basho-1.argv0.net/hg//var/hg/repos/webmachine/rev/c39a5a60ba01 | |
changeset: 115:c39a5a60ba01 | |
user: andy@thedude.local | |
date: Thu Jan 17 15:59:13 2008 -0500 | |
description: |
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
Date: Wed, 28 Dec 2011 18:16:57 +0000 (GMT) | |
From: Jordan Vandenberg <jordan@couchbase.com> | |
To: "andy@basho.com" <andy@basho.com> | |
Subject: Couchbase NoSQL @ Basho Technologies | |
Hi Andy, | |
Thanks for your interest in Couchbase. A NoSQL database could help Basho Technologies create a fast, scalable data tier. |
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
(setq erlang-root-dir "/usr/local/lib/erlang") | |
(setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.6.6.5/emacs" load-path)) | |
(setq load-path (cons "/Users/andy/.elisp" load-path)) | |
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path)) | |
(require 'column-marker) | |
;; Local el path | |
(setq indent-tabs-mode nil) | |
(setq-default indent-tabs-mode nil) |