$ tmux attach
protocol version mismatch (client 7, server 6)
#$^#^# what now?? Aha...
Test bed for what is now Tornadose
With the Mercurial convert
extention, you can rename branches, move,
and filter files. As an example, say we have a repo with only the
default
branch which is to be imported into a super-repository.
For starters, we will want all our files in the child repo to be in a subdirectory of the parent repo and not include the child's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
from tornado import gen | |
from tornado.concurrent import run_on_executor, futures | |
from tornado.ioloop import IOLoop | |
class TaskRunner(object): | |
def __init__(self, loop=None): | |
self.executor = futures.ThreadPoolExecutor(4) | |
self.loop = loop or IOLoop.instance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__pycache__ | |
*.pyc | |
*.ipynb | |
.ipynb_checkpoints | |
*.json | |
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstration of server-sent events with Tornado. To see the | |
stream, you can either point your browser to ``http://localhost:8080`` | |
or use ``curl`` like so:: | |
$ curl http://localhost:8080/events | |
""" | |
import signal | |
from tornado import web, gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A simple demonstration of running background tasks with Tornado. | |
Here I am using a basic TCP server which handles streams and keeps | |
them open while asynchronously performing a fake task in the | |
background. In order to test it, simply telnet to localhost port 8080 | |
and start typing things to see that the server receives the messages. | |
The advantage to running on an executor instead of conventional | |
threads is that we can more easily shut it down by stopping the | |
tornado IO loop. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstration of combining the Qt and Tornado event loops.""" | |
from PyQt4 import QtGui, QtCore | |
from tornado.ioloop import IOLoop | |
from tornado import gen | |
from tornado.httpclient import AsyncHTTPClient | |
URL = "https://www.random.org/integers/?num=1&min=100&max=999&col=1&base=10&format=plain&rnd=new" | |
class MainWindow(QtGui.QMainWindow): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simple jQuery calls to replace RST admonitions with Bootstrap | |
alerts. | |
This is intended to work with the pelican-bootstrap3 Pelican theme, | |
but may also work with others. | |
This script is public domain. | |
*/ |
Usually, the numpydoc format is the easiest to use and read for docstrings.
In order to make things Just Work, use the following in conf.py
: