Skip to content

Instantly share code, notes, and snippets.

@ashelly
ashelly / mediator.c
Created May 28, 2013
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
View mediator.c
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
@staltz
staltz / introrx.md
Last active Oct 24, 2021
The introduction to Reactive Programming you've been missing
View introrx.md