<commit_before>// (C) 2016 <NAME>

#include "db.hpp"
#include "serial.hpp"

#include <iostream>

#include <unistd.h>


int main(int argc, char** argv) {
  std::string passwd;

  getline(std::cin, passwd);

  Db db(passwd);
  Serial serial;
  boost::signals2::scoped_connection connection(
      serial.lineReceived.connect([&db](std::string const& line) {
        db.addSerialLine(line);
      }));

  for (;;) {
    sleep(1);
  }

  return 0;
}<commit_msg>fixed termination by disappearing database<commit_after>// (C) 2016 <NAME>

#include "db.hpp"
#include "serial.hpp"

#include <memory>
#include <iostream>

#include <unistd.h>


int main(int argc, char** argv) {
  std::string passwd;

  getline(std::cin, passwd);

  std::unique_ptr<Db> dbPtr;
  Serial serial;
  boost::signals2::scoped_connection connection(
      serial.lineReceived.connect(
          [&dbPtr, &passwd](std::string const& line) {
            try {
              if (!dbPtr) {
                dbPtr.reset(new Db(passwd));
              }

              auto& db(*dbPtr);

              db.addSerialLine(line);
            } catch (...) {
              dbPtr.reset();
            }
          }));

  for (;;) {
    sleep(1);
  }

  return 0;
}
{'fraction_non_alphanumeric': 0.1592775041050903, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 2.4241573033707864, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '578672', 'n_tokens_mistral': 441, 'n_tokens_neox': 414, 'n_words': 87}