Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| import gevent | |
| from thrift.server.TServer import TServer | |
| # XXX Hackish, but should be safe: monkey patch gevent socket support into | |
| # Thrift. Overall I think this is cleaner than reimplementing all of TSocket. | |
| from thrift.transport import TSocket; TSocket.socket = gevent.socket | |
| from thrift.transport.TTransport import TTransportException | |
| class TGEventServer(TServer): | |
| """Gevent socket server.""" |
| from sqlalchemy.ext.compiler import compiles | |
| from sqlalchemy.sql.expression import Insert | |
| @compiles(Insert) | |
| def append_string(insert, compiler, **kw): | |
| s = compiler.visit_insert(insert, **kw) | |
| if 'append_string' in insert.kwargs: | |
| return s + " " + insert.kwargs['append_string'] | |
| return s |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # | |
| # 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 |
A friend asked me for a few pointers to interesting, mostly recent papers on data warehousing and "big data" database systems, with an eye towards real-world deployments. I figured I'd share the list. It's biased and rather incomplete but maybe of interest to someone. While many are obvious choices (I've omitted several, like MapReduce), I think there are a few underappreciated gems.
###Dataflow Engines:
Dryad--general-purpose distributed parallel dataflow engine
http://research.microsoft.com/en-us/projects/dryad/eurosys07.pdf
Spark--in memory dataflow
http://www.cs.berkeley.edu/~matei/papers/2012/nsdi_spark.pdf
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <!-- not sure which one it is, so set both --> | |
| <key>Ensemble</key> | |
| <dict> | |
| <key>Enabled</key> | |
| <true/> | |
| </dict> |
Side-by-side comparison of the best AI coding subscriptions: Claude Code, GLM, MiniMax, Kimi, and Qwen
🔗 Full comparison: https://codingplan.org/en