Skip to content

Instantly share code, notes, and snippets.

Teggy / four-solutions-to-a-trivial-problem.hs
Last active Sep 23, 2022
A Haskell "transcript" of Guy Steele's talk "Four Solutions to a Trivial Problem" (
View four-solutions-to-a-trivial-problem.hs
{-# LANGUAGE TypeSynonymInstances #-}
import Data.Monoid
import Data.Maybe
-- How much water does a "histogram" hold?
-- Inspired by Guy Steele's talk "Four Solutions to a Trivial Problem"
jadeallenx /
Last active Nov 25, 2015
Yeah, I think I See What You Mean

tl;dr You should watch this.

It's interesting to me that a significant number of talks in this year's Strange Loop conference referenced a 1966 paper by Peter Landin called (somewhat tongue in cheek) "The Next 700 Programming Languages". In this paper, Landin describes a programming language which he says in a footnote might be aptly called "Church without the lambda" - but which in the paper is called "If You See What I Mean" (ISWIM).

Alvaro's talk delved deeply into the question of "What is the semantics or meaning of a program?" Alvaro's thesis is that the meaning of a program is to produce desired outcomes from a computing system but that current languages focus on

johnynek / AliceInAggregatorLand.scala
Last active Jun 5, 2020
A REPL Example of using Aggregators in scala
View AliceInAggregatorLand.scala
* To get started:
* git clone
* cd algebird
* ./sbt algebird-core/console
* Let's get some data. Here is Alice in Wonderland, line by line
azymnis / KMeansJob.scala
Created Oct 23, 2014
K-Means in scalding
View KMeansJob.scala
import com.twitter.algebird.{Aggregator, Semigroup}
import com.twitter.scalding._
import scala.util.Random
* This job is a tutorial of sorts for scalding's Execution[T] abstraction.
* It is a simple implementation of Lloyd's algorithm for k-means on 2D data.
acolyer /
Last active Nov 18, 2022
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

staltz /
Last active Dec 8, 2022
The introduction to Reactive Programming you've been missing
redapple /
Created Jun 19, 2014 with XPath blog post
from scrapy.selector import Selector
selector = Selector(text="""
<div itemscope itemtype ="">
<h1 itemprop="name">Avatar</h1>
<span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
<span itemprop="genre">Science fiction</span>
<a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>""", type="html")