]> git.sesse.net Git - wloh/blobdiff - bayeswf.cpp
Remove password that leaked out into the git repository. (It has also been changed...
[wloh] / bayeswf.cpp
index c7aad7dbe349d3dc0ee3ccf07266dd5552d12f2b..1e954b282342fb2306933b7149aad4bd2dd51f2f 100644 (file)
@@ -15,7 +15,7 @@ using namespace Eigen;
 
 #define PRIOR_MU 500
 #define PRIOR_WEIGHT 1.0
-#define MAX_PLAYERS 4096
+#define MAX_PLAYERS 8192
 #define DUMP_RAW 0
 #define USE_DB 1
 
@@ -406,7 +406,7 @@ void process_file(const char *filename)
 int main(int argc, char **argv)
 {
 #if USE_DB
-       pqxx::connection conn("dbname=wloh host=127.0.0.1 user=wloh password=oto4iCh5");
+       pqxx::connection conn("dbname=wloh host=127.0.0.1 user=wloh password=censored");
 #endif
        
        for (int i = 1; i < argc; ++i) {
@@ -422,6 +422,23 @@ int main(int argc, char **argv)
        pqxx::work txn(conn);
        txn.exec("SET client_min_messages TO WARNING");
 
+       // Dump aux_params.
+       {
+               txn.exec("TRUNCATE aux_params");
+               pqxx::tablewriter writer(txn, "aux_params");
+               for (map<pair<string, string>, float>::const_iterator it = aux_params.begin(); it != aux_params.end(); ++it) {
+                       char str[128];
+                       snprintf(str, 128, "%f", it->second);
+
+                       vector<string> tuple;
+                       tuple.push_back(it->first.first);  // locale
+                       tuple.push_back(it->first.second);  // parameter name
+                       tuple.push_back(str);
+                       writer.push_back(tuple);
+               }
+               writer.complete();
+       }
+
        // Dump ratings.        
        {
                txn.exec("TRUNCATE ratings");
@@ -464,23 +481,6 @@ int main(int argc, char **argv)
        txn.exec("ALTER TABLE new_covariance ADD PRIMARY KEY ( player1, player2 );");
        txn.exec("DROP TABLE IF EXISTS covariance");
        txn.exec("ALTER TABLE new_covariance RENAME TO covariance");
-
-       // Dump aux_params.
-       {
-               txn.exec("TRUNCATE aux_params");
-               pqxx::tablewriter writer(txn, "aux_params");
-               for (map<pair<string, string>, float>::const_iterator it = aux_params.begin(); it != aux_params.end(); ++it) {
-                       char str[128];
-                       snprintf(str, 128, "%f", it->second);
-
-                       vector<string> tuple;
-                       tuple.push_back(it->first.first);  // locale
-                       tuple.push_back(it->first.second);  // parameter name
-                       tuple.push_back(str);
-                       writer.push_back(tuple);
-               }
-               writer.complete();
-       }
 #else
        //fprintf(stderr, "Optimal sigma: %f (two-player: %f)\n", sigma[0], sigma[0] * sqrt(2.0f));
        for (map<pair<string, string>, float>::const_iterator it = aux_params.begin(); it != aux_params.end(); ++it) {