Skip to content

Instantly share code, notes, and snippets.

View rramsden's full-sized avatar
♨️
Keep On Keeping On

Richard Ramsden rramsden

♨️
Keep On Keeping On
View GitHub Profile
@rramsden
rramsden / gist:4333596
Created December 19, 2012 01:10
quick benchmark of ets:lookup_element
% bench:start().
% {result1,57663,result2,43880}
-module(bench).
-export([start/0]).
-record(record, {
key,
one = 1.0,
## syncronous panes
# open up multiple panes and hit Ctrl-B a then start typing :O !!!
bind a set-window-option synchronize-panes
require "annoystream/version"
module Annoystream
-module(spsp).
-export([sum/0, average/0, add_peers/2]).
-record(node, {
value,
weight,
peers = []
}).
sum() ->
% Symmetric Push-Sum Protocol
loop(#node{name=Name, value=Value, weight=Weight} = State) ->
receive
{push, From, {V0, W0}} ->
V1 = Value/2,
W1 = Weight/2,
From ! {symmetric_push, self(), {V1, W1}},
loop(update(V0 + V1 , W0 + W1, State));
{symmetric_push, {V0, W0}} ->
other_arr = ["four"]
["one","two","four"].reject {|element| other_arr.include?(element) }
=> ["four"]
Title: Distributed Rate Limiting
Time: Tuesday April 3rd, 2012 @ 4:00 – 5:00 PM, followed by a Q&A and refreshments
Location: Building 356, Room 109
Speaker: Richard Ramsden (4th CSCI Student, Vancouver Island University)
Abstract:
The Distributed Rate Limiting (DRL) problem can be described as trying to distribute service capacity (“service rate”), expressed as a number of service requests per time interval, over a group of N servers in such a way that the amount given to each server C_i is dependent on the job population D_i at each server. We want to find a fair distribution of the service rate such that (D_i / C_i) is equal at every server. Creating a distributed algorithm to solve this problem is non-trivial since demand at each server is dynamic, i.e., changes with time. Furthermore, servers can fail for numerous reasons. Designing an algorithm which adapts quickly to change and is fault-tolerant is the main contribution of my research.
Uncaught exit(0) called, at Error
at Error (unknown source)
at __exit (http://interbutt.com/temp/motherofgod.html:30956:340)
at _exit (http://interbutt.com/temp/motherofgod.html:30956:373)
at _main (http://interbutt.com/temp/motherofgod.html:391:185)
at Object.callMain (http://interbutt.com/temp/motherofgod.html:31053:373)
at run (http://interbutt.com/temp/motherofgod.html:36077:176)
at http://interbutt.com/temp/motherofgod.html:36197:167
ruby-1.9.2-p290 :002 > X11::Display.new
00000000 01 00 0b 00 00 00 f3 00 a8 dc a7 00 00 00 00 05 |................|
00000010 ff ff 1f 00 00 01 00 00 14 00 ff ff 01 07 00 00 |................|
00000020 20 20 08 ff 00 00 00 00 54 68 65 20 58 2e 4f 72 | ......The X.Or|
00000030 67 20 46 6f 75 6e 64 61 74 69 6f 6e 01 01 20 00 |g Foundation.. .|
00000040 00 00 00 00 04 08 20 00 00 00 00 00 08 08 20 00 |...... ....... .|
00000050 00 00 00 00 0f 10 20 00 00 00 00 00 10 10 20 00 |...... ....... .|
00000060 00 00 00 00 18 20 20 00 00 00 00 00 20 20 20 00 |..... ..... .|
00000070 00 00 00 00 ac 00 00 00 20 00 00 00 ff ff ff 00 |........ .......|
00000080 00 00 00 00 34 00 5a 00 50 05 00 03 68 01 cb 00 |....4.Z.P...h...|
# Information sent by the client at connection setup
#
# 1 byte-order
# #x42 MSB first
# #x6C LSB first
# 1 unused
# 2 CARD16 protocol-major-version
# 2 CARD16 protocol-minor-version
# 2 n length of authorization-protocol-name
# 2 d length of authorization-protocol-data