duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.
As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import gevent | |
import gevent.pool | |
class TestPool(object): | |
def __init__(self, maxsize=10): |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Learn a variety of programming paradigms:
(function b() { | |
//The file goes through heuristics that turn object properties into | |
//a hash table | |
//run with | |
//d8 --enable-natives-syntax prop_heuristics.js | |
//Note that even if object has fast properties, there are still 2 kinds of | |
//fast properties (in and out of object) and only one of them is even faster. |
from time import time | |
from logging.config import fileConfig | |
from twisted.internet import epollreactor | |
epollreactor.install() | |
from flask import Flask, request | |
app = Flask(__name__) | |
fileConfig("logging.ini") |
#!/usr/bin/env python | |
""" | |
Tail-Recursion helper in Python. | |
Inspired by the trampoline function at | |
http://jasonmbaker.com/tail-recursion-in-python-using-pysistence | |
Tail-recursive functions return calls to tail-recursive functions | |
(themselves, most of the time). For example, this is tail-recursive: |
""" | |
Inspired by: | |
http://eli.thegreenplace.net/2009/08/29/co-routines-as-an-alternative-to-state-machines/ | |
""" | |
def parse_args(target): | |
"""A generator that parses a stream of arguments one character at a time. | |
As soon as a flag, or flag value pair ("-a" or "-a value") is processed | |
the pair is sent off as a tuple to the 'target' generator. |
""" | |
Simple forking echo server built with Python's SocketServer library. A more | |
Pythonic version of http://gist.github.com/203520, which itself was inspired | |
by http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import SocketServer | |
class EchoHandler(SocketServer.StreamRequestHandler): |
""" | |
Simple preforking echo server in Python. | |
Python port of http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import sys | |
import socket |