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
/// <summary>Used to enforce type nesting</summary> | |
public interface HList { } | |
public class Empty : HList { } | |
public class Stack<T, TChild> : HList where TChild : HList | |
{ | |
public T Item { get; private set; } | |
public TChild Child { get; private set; } |
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
var aggregate_scores_by_lol = function(votes, lols, users){ | |
var vote_count = lols.reduce(function(p,lol,i,r){ return p[lol.id] = 0, p; }, {}); | |
var lol_dictionary = lols.reduce(function(p,lol,i,r){ return p[lol.id] = lol, p}, {}); | |
votes.forEach(function(vote){ vote_count[vote.lol_id]++; }); | |
var vote_count_keys = vote_count.map(function(el,ix){ return ix;}); | |
var sorted_lol_ids = vote_count_keys.sort(function(a, b){ | |
return vote_count[b] - vote_count[a]; |