Skip to content

Instantly share code, notes, and snippets.

@scottcagno
scottcagno / gist:f5728d90446fd080ed87
Created November 14, 2015 00:13 — forked from mcastilho/gist:e051898d129b44e2f502
Cheap MapReduce in Go
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
package misc;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
public class ArrayTools
{
private static class ValueComparator<K , V extends Comparable<V>> implements Comparator<K>
{
public class CodeModelIfForExample {
private static final String CLASS_NAME = "TestClass";
public static void main(String args[]) throws Exception{
JCodeModel codeModel = new JCodeModel();
JDefinedClass c = codeModel._class(CLASS_NAME);
writeIfElse(codeModel, c);
@scottcagno
scottcagno / btree.py
Created December 9, 2013 23:31 — forked from teepark/btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
#!/usr/bin/env python
# Copyright (c) 2008 Carnegie Mellon University.
#
# You may modify and redistribute this file under the same terms as
# the CMU Sphinx system. See
# http://cmusphinx.sourceforge.net/html/LICENSE for more information.
import pygtk
pygtk.require('2.0')