We've recently moved hosts! Please report any weirdness with the wiki (or spam) on Utopia.
Conspire Development Scratchpad
From BBSWiki
Contents |
Python
- http://en.wikipedia.org/wiki/Python_programming_language
- O'Reilly: Python Cookbook
- O'Reilly: Learning Python
- PyDev documentation - Eclipse Python integration
Twisted
- Twisted - Python event-driven network services framework
- Core Documentation
- O'Reilly: Twisted Network Programming Essentials
- Twisted is primarily event driven but has some thread support.
- Deferred reference
Multi-client communication
- http://twistedmatrix.com/projects/core/documentation/examples/chatserver.py
- Twisted Application Framework HOWTO / twistd
- Proxy example
UI
- invective CVS decode how he does it, especially here - from twisted.conch.stdio import runWithProtocol
- user input (old, but a clue)... twisted.internet.stdio and twisted.conch.insults.
- mentions curses
Database
- Use of an RDBMS must be done through Twisted like this to prevent blocking.
Misc
- Python 2.5 is going to have an interesting feature (look up PEP 342) that'll make Twisted (and other code like it) more readable
- SingletonMixin - broken for 2.5?
- twisted.python.failure.Failure API
- http://www.pragma2000.com/wiki/index.php?GThreadless - This may be of some help. It's a stackless python hack that adds continuations, making twisted code look like blocking code.
Unicode
- http://docs.python.org/lib/standard-encodings.html codecs module for converting unicode to other character sets (unicode is supported natively: s = u"I am a unicode string.")
- http://www.amk.ca/python/howto/unicode
- http://www.diveintopython.org/xml_processing/unicode.html
XML
- lxml - Python wrapper for the C libxml2 and libxslt libraries. 1.x version depending on libxml2 2.x -- looks stable.
- XML Schema validation
- XML document parsing using an API very similar to ElementTree
- The API extends ElementTree API to expose libxml2 and libxslt specific functionality, such as XPath, Relax NG, XML Schema, XSLT, and c14n. Python code can be called from XPath expressions and XSLT stylesheets through the use of extension functions. lxml also offers a SAX compliant API, that works with the SAX support in the standard library.
- SimpleXMLWriter module for ElementTree
- XML anti-bozo page
Compression
- gzip (using StringIO and included gzip)
Unit testing
PostgreSQL
- PL/pgSQL stored procedure language
- PL/Python. nuff said. Check the preload option for efficiency.
- full-text indexing possible.. but how?
Programming paradigms
Event-driven programming
- http://en.wikipedia.org/wiki/Event-driven_programming - see links here
- http://eventdrivenpgm.sourceforge.net/ - Good Event-driven overview, tutorial doc
-
One idea is to program a hybrid server in the following way: One thread does all network I/O (using event systems), and the other threads execute the operations the server provides. For example, consider a server doing remote procedures (as most servers do). Such a server receives requests, and every request is responded. When the server starts up, the networking thread begins to wait for requests. When a complete request has been received, a new thread is started performing the requested operation. The network thread continues immediately, normally doing other network I/O. When the operation is over, an artificial event is generated indicating this situation (see below on artificial events). The artificial event carries the result of the operation, and is added to the event system directly from the thread that executed the operation. This thread can now stop working. The network thread receives this artificial event like every other event, and can start sending the result over the network back to the client.
http://ocaml-programming.de/packages/documentation/equeue/users-guide/c494.html
Design patterns
- Read up on MVC (see CS 320 notes)
- Observer, aka publish/subscribe
Wire protocol
Transmission
Packaging
- SOAP complex and requires polling
- JSON-RPC very preliminary Twisted support and async
- XML-RPC what SOAP came from; simple. requires polling. wide support.
- XMPP bidirectional XML stream protocol used by Jabber, with Twisted support ..ish?
- NetStrings extremely simple, 8-bit clean, supported by Twisted
General XML stuff, software, etc
Web Front End
- JQuery (shh...)
License
- BSD license
- CPL (common public license)
- comparison chart
Forum Threads, Polls, etc.
- read this thread, Java vs. Python, PEP 342 etc.
Django
- http://lethain.com/entry/2008/jul/23/replacing-django-s-orm-with-sqlalchemy/
- http://gitorious.org/projects/django-sqlalchemy
- http://codespatter.com/2008/10/15/setting-up-apache2-mod_python-mysql-and-django-on-debian-lenny-or-ubuntu-hardy-heron/
- http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/

