Skip to content

Instantly share code, notes, and snippets.

View dominictarr's full-sized avatar

Dominic Tarr dominictarr

View GitHub Profile
@dominictarr
dominictarr / readme.md
Created March 11, 2015 21:05
Strongly ordered programming

programming is hard, but async programming is harder. Don't listen to people tell you about "callback hell". They are only in the most outer circles of async programming hell. As you get deeper into async systems, you'll see that what makes it hard is that there are many possible orderings for events to occur in. How many? well if the time taken for N processes is independant, then there are N! (factorial) possible orderings!

but what if we could at least be precise about what sort of orderings are expected?

so, forEach is a function that takes a function and calls it maybe many times.

Array.prototype.forEach = function (<many> fn) {
  var l = this.length
 for(var i = 0; i &lt; l; i++)
@dominictarr
dominictarr / papers.md
Last active January 12, 2024 08:19
Distributed Systems Papers

(dominic: this list of papers was originally recommended to me by Brain Noguchi @bnoguchi, and was a great start to understanding distributed systems)

Here's a selection of papers that I think you would find helpful and interesting:

Time, Clocks, and the Ordering of Events in a Distributed System

The seminal paper about event ordering and concurrency. The important result is that events in a distributed system define a partially ordered set. The connection to what we're working on is fundamental, as this defines how to detect concurrent updates. Moreover, the chosen algorithm to turn the partially ordered set into a totally ordered set defines the conflict resolution algorithm.

http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf

ubuntu@ip-172-30-0-124|14:28|~ $ service megafunnel-view start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.12" (uid=1000 pid=5133 comm="start megafunnel-view ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")
@dominictarr
dominictarr / error.tap
Created October 3, 2014 16:40
node test/coffee_bin.js
TAP version 13
# compiling coffee with -c
not ok 1 should be equal
---
file: /home/dominic/c/browserify/test/coffee_bin.js
line: 23
column: 11
stack:
- |
getCaller (/home/dominic/c/browserify/node_modules/tap/lib/tap-assert.js:418:17)

So you want to help with secure-scuttlebutt?

secure-scuttlebutt is a do-ocracy. that means ruled by doers. If you want to help, you need to figure out what you need to do and then do it. There are no managers. The best way to do this is probably to discuss with other contributors. for this use issues and irc (find us in #stackvm on irc)

Make a pull request, and once there is a consensus amongst the contributors a maintainer can merge. (A maintainer is just a role - they just merge patches and apply semver and then release. a maintainer does not have special powers, just special responsibilities. They do not cast a breaking vote,

@dominictarr
dominictarr / architecture.md
Last active August 29, 2015 14:06
architectural patterns on the internet

patterns in "social networks"

static sites

content is edited by a single/few author and accessed by urls. each site links to other sites they like, in a 'cool links' section. or via a web ring.

examples: geocities, tripod, just hosting a site yourself, etc

@dominictarr
dominictarr / readme.md
Created September 25, 2014 12:58
What is the Chi Squared Test?

The Chi Squared test is used when you want to decide if a dice is fair (random) or not, or for problems that fit that pattern. Sometimes we want to know that some event is equally likely, a the probability that a dice comes up 6 should be equal to the probability that it comes up 1. Some times we want to show the opposite, that two categories are actually different. Say, there are a series of races - is the winner of the most races actually better, or was it just a fluke?

Of course, we can roll a dice many, many times until we are sure it's fair, but it takes too long to have many races. So for the race need to calculate whether the random variables (the times that each participant won) are independent (random, fair) while only looking at a few examples. Depending on the number of participants, how many times do we need to race before we know that the winner is actually faster?

@dominictarr
dominictarr / signatures.md
Created August 18, 2014 08:16
use of signatures in secure datastructures

Camlistore is a simple secure datastructure, but it uses signatures in a way that exposes it to implicit trust. camlistore uses one way hashes to link json objects to make immutable datastructures, this is completely fine. But camlistore also uses signatures to make mutable datastructures, but this isn't done in a completely safe way.

To make a mutable datastructure a camlistore user creates a permanode this is just a json object with some entropy in it, and a pointer to the owner (the key who will sign updates). Then, the permanode owner can create claims (which are just signed json objects, that point back at the permanode) with which add or remove attributes from the permanode (things like set a key, or remove a key, add tags, or add something to a set)

Since claims are signed, it's infeasible for an attacker to forge a claim.

@dominictarr
dominictarr / places_with_songs.md
Created August 7, 2014 18:21
good places to go