This file contains hidden or 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
[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 |
This file contains hidden or 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
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): |
This file contains hidden or 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
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) { |