<commit_before>/**
 * Copyright (c) 2015 - The CM Authors <<EMAIL>>
 *   All Rights Reserved.
 *
 * This file is CONFIDENTIAL -- Distribution or duplication of this material or
 * the information contained herein is strictly forbidden unless prior written
 * permission is obtained.
 */
#include <fnord-base/util/BinaryMessageReader.h>
#include <fnord-base/util/BinaryMessageWriter.h>
#include "CTRCounter.h"

using namespace fnord;

namespace cm {

CTRCounter CTRCounter::load(const Buffer& buf) {
  CTRCounter counter;

  util::BinaryMessageReader reader(buf.data(), buf.size());
  counter.num_views = *reader.readUInt64();
  counter.num_clicks = *reader.readUInt64();

  return counter;
}

void CTRCounter::write(const CTRCounter& counter, Buffer* buf) {
  util::BinaryMessageWriter writer(sizeof(CTRCounter));
  writer.appendUInt64(counter.num_views);
  writer.appendUInt64(counter.num_clicks);
  buf->append(writer.data(), writer.size());
}

CTRCounter::CTRCounter() :
    num_views(0),
    num_clicks(0) {}
<commit_msg>include fix<commit_after>/**
 * Copyright (c) 2015 - The CM Authors <<EMAIL>>
 *   All Rights Reserved.
 *
 * This file is CONFIDENTIAL -- Distribution or duplication of this material or
 * the information contained herein is strictly forbidden unless prior written
 * permission is obtained.
 */
#include <fnord-base/util/binarymessagereader.h>
#include <fnord-base/util/binarymessagewriter.h>
#include "CTRCounter.h"

using namespace fnord;

namespace cm {

CTRCounter CTRCounter::load(const Buffer& buf) {
  CTRCounter counter;

  util::BinaryMessageReader reader(buf.data(), buf.size());
  counter.num_views = *reader.readUInt64();
  counter.num_clicks = *reader.readUInt64();

  return counter;
}

void CTRCounter::write(const CTRCounter& counter, Buffer* buf) {
  util::BinaryMessageWriter writer(sizeof(CTRCounter));
  writer.appendUInt64(counter.num_views);
  writer.appendUInt64(counter.num_clicks);
  buf->append(writer.data(), writer.size());
}

CTRCounter::CTRCounter() :
    num_views(0),
    num_clicks(0) {}

{'fraction_non_alphanumeric': 0.126953125, 'fraction_numerical': 0.013671875, 'mean_word_length': 5.171686746987952, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6298041', 'n_tokens_mistral': 663, 'n_tokens_neox': 627, 'n_words': 153}