<commit_before>#include "clientracemodel.h"

#include <QStringList>
#include <QTimer>

#include <iostream>

ClientRaceModel::ClientRaceModel(float trackLength, int horseCount, QObject *parent)
    : RaceModel(trackLength, horseCount, parent), client("127.0.0.1", 4000) {
    connect(&client, SIGNAL(msgReceived(QByteArray)), this, SLOT(receivePositionsMessage(QByteArray)));
}

void ClientRaceModel::startRace() {
}

void ClientRaceModel::nextModelStep() {
    // emit signal about changed positions
    emit positionsChanged(horsePositions, cameraPosition);
}

void ClientRaceModel::receivePositionsMessage(QByteArray msg) {
    // extract camera data
    QStringList split1 = QString::fromUtf8(msg).split("C@", QString::SkipEmptyParts);
    cameraPosition = split1.at(1).toFloat();
    // extract horses data
    QStringList split2 = split1.at(0).split("H@", QString::SkipEmptyParts);
    for (int i = 0; i < split2.size(); i++) {
        horsePositions.at(i) =  split2.at(i).toFloat();
    }

    // keep calculating next steps of the model
    nextModelStep();
    updateRaceStatus();

    // keep running for 3 seconds after the race is finished
    if (finished) {
        QTimer::singleShot(3000, this, SLOT(delayedStop()));
    }
}<commit_msg>fix dead client, wrong signal name after refactoring<commit_after>#include "clientracemodel.h"

#include <QStringList>
#include <QTimer>

ClientRaceModel::ClientRaceModel(float trackLength, int horseCount, QObject *parent)
    : RaceModel(trackLength, horseCount, parent), client("127.0.0.1", 4000) {
    connect(&client, SIGNAL(dataReceived(QByteArray)), this, SLOT(receivePositionsMessage(QByteArray)));
}

void ClientRaceModel::startRace() {
}

void ClientRaceModel::nextModelStep() {
    // emit signal about changed positions
    emit positionsChanged(horsePositions, cameraPosition);
}

void ClientRaceModel::receivePositionsMessage(QByteArray msg) {
    // extract camera data
    QStringList split1 = QString::fromUtf8(msg).split("C@", QString::SkipEmptyParts);
    cameraPosition = split1.at(1).toFloat();
    // extract horses data
    QStringList split2 = split1.at(0).split("H@", QString::SkipEmptyParts);
    for (int i = 0; i < split2.size(); i++) {
        horsePositions.at(i) =  split2.at(i).toFloat();
    }

    // keep calculating next steps of the model
    nextModelStep();
    updateRaceStatus();

    // keep running for 3 seconds after the race is finished
    if (finished) {
        QTimer::singleShot(3000, this, SLOT(delayedStop()));
    }
}
{'fraction_non_alphanumeric': 0.13248710829036098, 'fraction_numerical': 0.019833399444664817, 'mean_word_length': 4.518599562363239, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1677128', 'n_tokens_mistral': 815, 'n_tokens_neox': 779, 'n_words': 179}