- http://gavin/accounting/fraud_unit_test/
- http://gavin/accounting/ajax/fraud_check/
- http://gavin/accounting/ajax/fraud_check/?async=True
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Fri, 15 Oct 2010 09:06:37 GMT | |
Content-Type: application/xml; charset=utf-8 | |
Connection: keep-alive | |
X-Runtime: 21 | |
ETag: "c1caac3666276b6bb0f67480977dd98c" | |
Cache-Control: private, max-age=0, must-revalidate | |
Content-Length: 2040 | |
Access-Control-Allow-Origin: * |
HTTP/1.1 302 Moved Temporarily | |
Server: nginx | |
Date: Fri, 15 Oct 2010 09:43:54 GMT | |
Content-Type: text/html; charset=utf-8 | |
Connection: keep-alive | |
Cache-Control: no-cache | |
Location: http://ak-media.soundcloud.com/9Y5jQY82MWn0.128.mp3?AWSAccessKeyId=0ZD | |
ZC4RXJ8N15Y1R1M82&Expires=1287135854&Signature=52c%2Bvqsw%2BCM382YPE9%2BBRidNPyI | |
%3D&__gda__=1287135854_dbb2843578dd02702c7f1dc326df87bc | |
X-Runtime: 5 |
dir=`dirname $0` | |
stty -icanon min 1 -echo > /dev/null 2>&1 | |
java -Djline.terminal=jline.UnixTerminal -Xmx512M -jar `cygpath -w $dir`/sbt-launch-0.7.4.jar "$@" | |
stty icanon echo > /dev/null 2>&1 |
""" | |
Producer produces numbers 1..10 | |
Consumer runs first & then blocks | |
Solution: uses semaphores | |
""" | |
from threading import Thread | |
from threading import Semaphore |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
try: | |
raise ValueError('babi') | |
except: | |
import sys | |
a = sys.exc_info() | |
print a | |
(<type 'exceptions.ValueError'>, ValueError('babi',), <traceback object at 0x95e80a4>) |
In [21]: log.fogbugz('a44 %s', 'hello') | |
CRITICAL 2011-08-05 09:07:09,316 handler 11742 -1215838528 a44 hello | |
name=2fb | |
msg=a44 %s | |
<type 'str'> | |
CRITICAL a44 hello | |
record.__dict__=>{'threadName': 'MainThread', 'name': '2fb', 'thread': -1215838528, 'created': 1312528029.316421, 'process': 11742, 'processName': 'MainProcess', 'args': ('hello',), 'module': 'handler', 'filename': 'handler.py', 'levelno': 50, 'exc_text': None, 'pathname': '/var/www/BIS/django-sites/p/utils/logging/handler.py', 'lineno': 79, 'msg': 'a44 %s', 'exc_info': None, 'message': 'a44 hello', 'funcName': 'fogbugz', 'relativeCreated': 2657279.0589332581, 'levelname': 'CRITICAL', 'msecs': 316.4210319519043} |
IOError: sys.stdin access restricted by mod_wsgi
class GavinLogHandler(logging.Handler): | |
""" my experiment """ | |
def emit(self, record): | |
print "name=" + str(record.name) | |
if record.exc_info: | |
print "exc_info=" + str(record.exc_info) | |
if record.exc_text: | |
print "exc_text=" + str(record.exc_text) |