- SQL => Parse Tree => Execution plan
- The execution plan is a data structure, not byte-code
- The executor makes storage engine calls
"Deep left tree" -- always
class AppendOnlyModelMeta(DeclarativeMeta): | |
@staticmethod | |
def _get_append_only_attributes(cls): | |
'''A helper method to get a list of append-only attributes | |
declared on the class.''' | |
[...] | |
def __init__(cls, classname, bases, dict_): | |
if hasattr(cls, '__history_class__'): | |
cls._history_fields = cls._get_append_only_attributes(cls) |
verisign,PayPal Payflow Pro,Lucre | |
paypaldirect,PayPal direct,lucre | |
paypalexpress,PayPal Express,offsite | |
paypaladaptive,PayPal,asynchronous | |
paypaladaptiveb2b,PayPal,asynchronous |
from pretenders.server.server import run | |
import multiprocessing | |
ml = multiprocessing.Process(name='ml', target=run) | |
ml.start() | |
def _init(): | |
from pretenders.client.http import HTTPMock |
** Reason for termination == | |
** {{badmatch, | |
{{msg_status,13, | |
<<247,153,167,208,33,41,98,109,106,45,132,14,79,220,50,7>>, | |
{basic_message, | |
{resource,<<"/.../trunk">>,exchange,<<"...">>}, | |
[<<"cardapp.txnfailed">>], | |
{content,60,none, | |
<<248,0,16,97,112,112,108,105,99,97,116,105,111,110,47,106,115,111, | |
110,5,117,116,102,45,56,0,0,0,0,2,0>>, |
def words(): | |
with open('/usr/share/dict/words', 'r') as f: | |
return (x.strip().upper() for x in f.readlines()) | |
MAPPING = {'A':'A', 'B':'B', 'C':'C', 'D':'D', | |
'E':'E', 'F':'F', 'O':'0', 'S':'5', 'I':'1'} | |
def main(): | |
is_hexword = lambda word: all(ch in MAPPING for ch in word) | |
for word in filter(is_hexword, words()): |
(defn fizzbuzz [] | |
(map #(cond (= 0 (mod % 15)) "wibblefish" (= 0 (mod % 3)) "wibble" (= 0 (mod % 5)) "fish" :else %) (range 1 101))) |
import random | |
import sys | |
def pick(switch): | |
doors = ['car', 'goat', 'goat'] | |
random.shuffle(doors) | |
choices = zip(range(len(doors)), doors) | |
my_choice = random.choice(choices) | |
rest_choices = filter(lambda x: x!=my_choice, choices) |
#! /usr/bin/env python | |
import sys | |
import json | |
print json.dumps(json.loads(sys.stdin.read()), sort_keys=True, indent=4) |