Skip to content

Instantly share code, notes, and snippets.

View colmmacc's full-sized avatar

Colm MacCárthaigh colmmacc

View GitHub Profile
@colmmacc
colmmacc / tester.c
Last active December 27, 2015 13:19
Trivial test program to investigate multiple addresses returned by gethostbyname. To run do: gcc -o tester tester.c ; ./tester beta.allcosts.net
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main(int argc, char ** argv)
{
@colmmacc
colmmacc / Denominator-rrset-config.md
Last active December 16, 2015 11:08
Denominator rrset configuration feedback

Original thread; https://groups.google.com/forum/#!topic/denominator-dev/aOtc4r9TLTI

Just wanted to chime in with some brief suggestions.

Routing precedence

I think the proposals are both ambiguous about the precedence applied between weighting and geo selection. Some providers support just one precedence order between weighted and geo, some support both, and obviously we can never predict what future providers may support.

Geo->Weighted as a use-case makes intuitive sense, a good example is routing everyone on the East coast of the US to a datacenter on the east coast, but then balancing load across multiple endpoints "within" that selection. I think all the providers support this precedence order today.

import random
def choose_N(matrix):
"""Choose N elements from an N x N square matrix, such that;
1. The elements are chosen at-random
2. One element per row
3. One element per column
"""
assert isinstance(matrix, list)
columns = range( len(matrix) )
import random
def choose_unique_N(matrix):
"""Choose N elements from an N x N square matrix, such that;
1. The elements are chosen at-random
2. One element per row
3. One element per column
4. No duplicate elements
Returns None if and only if there is no set of N elements