Skip to content

Instantly share code, notes, and snippets.

[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@whoishu
whoishu / app.py
Last active August 29, 2015 14:10 — forked from ayang/app.py
class Application(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(self, handlers, **settings)
self.db_session = db_session
self.redis = redis.StrictRedis()
self.session_store = RedisSessionStore(self.redis)
class BaseHandler(tornado.web.RequestHandler):
@whoishu
whoishu / cluster
Created July 3, 2014 12:02 — forked from jdeng/cluster
auto dist = [n, &dists](size_t i, size_t j) { return dists[i * n + j]; } // dists is pre-calculated n x n distances matrix
auto index = seq(n); //[0,...,n-1]
std::vector<size_t> rho(n);
for (size_t i=0; i<n; ++i) {
rho[i] = std::count_if(index.begin(), index.end(), [&](size_t j) { return dist(i,j) < dist_cutoff; });
}
std::vector<D> delta(n);
for (size_t i=0; i<n; ++i) {