- Batches for a given txid are always the same. Replays of batches for a txid will exact same set of tuples as the first time that batch was emitted for that txid.
- There's no overlap between batches of tuples (tuples are in one batch or another, never multiple).
- Every tuple is in a batch (no tuples are skipped)
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
from functools import wraps | |
import csv | |
import os.path | |
def save_dict_list(filename, **kwargs): | |
"""Decorator to take the results of a function call (assumed to be a | |
``list`` of ``dicts``) and cache them in a local file via | |
csv.DictWriter and serialize them with csv.DictReader""" | |
def decorator(f): |
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
# ported from https://github.com/jvirkki/libbloom | |
from cpython cimport bool | |
from libc.stdlib cimport malloc, calloc, free | |
from libc.string cimport memset | |
from libc.stdio cimport printf | |
from libc.math cimport log, ceil | |
from cpython.mem cimport PyMem_Malloc, PyMem_Free | |
DEF LN2_SQUARED = 0.480453013918201 # ln(2)^2 |
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:d0e242ec0ee3bf0798a38aba54eda99ab710de1890ddab0f0b6fd91939170314" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
import urlparse | |
import urllib | |
import urllib2 | |
def patch_unquote(): | |
urllib.unquote = unquote | |
urllib2.unquote = unquote | |
urlparse.unquote = unquote |
Python 2.7 contains a bug when dealing with percent-encoded Unicode strings such as:
>>> import urlparse
>>> url = u"http%3A%2F%2F%C5%A1%C4%BC%C5%AB%C4%8D.org%2F"
>>> print "{!r}".format(urlparse.unquote(url))
u'http://\xc5\xa1\xc4\xbc\xc5\xab\xc4\x8d.org/'
>>> print urlparse.unquote(url)
http://šļū�.org/
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>TODO</title> | |
<!-- CSS --> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<style> | |
.done { | |
text-decoration: line-through; |
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
import logging | |
from streamparse.bolt import Bolt | |
log = logging.getLogger("custom_code_bolt") | |
class CustomCodeBolt(Bolt): |
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
import re | |
class InvalidVersionException(Exception): pass | |
class StormVersion(object): | |
VERSION_RE = re.compile(r"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)" | |
"(?P<older_patch>\.\d+)?(?P<other>.*)") | |
RC_RE = re.compile(r"-rc(?P<release_candidate>\d+)", re.IGNORECASE) |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
OlderNewer