<commit_before>#include <iostream>                                         /* allows to perform standard input and output operations */
#include <stdio.h>                                          /* Standard input/output definitions */
#include <stdint.h>                                         /* Standard input/output definitions */
#include <stdlib.h>                                         /* defines several general purpose functions */
#include <unistd.h>                                         /* UNIX standard function definitions */
#include <fcntl.h>                                          /* File control definitions */
#include <ctype.h>                                          /* isxxx() */
#include <sqlite3.h>
#include <ros/ros.h>                                        /* ROS */
#include <md49_messages/md49_encoders.h>
#include <md49_messages//md49_data.h>                       /* Custom message /encoders */

md49_messages::md49_encoders md49_encoders;
md49_messages::md49_data md49_data;

// sqlite globals
sqlite3 *db;
char *zErrMsg = 0;
int  rc;
int cx;
const char *sql;
char sql_buffer[400];

void open_sqlite_db_md49data(void);
void execute_update_sqlite(void);

void md49_encoders_callback(const md49_messages::md49_encoders& md49_encoders){

    // Write data read from MD49 into
    // sqlite3 database md49data.db
    // ******************************
    // EncoderL & EncoderR
    cx = snprintf (sql_buffer,400,"UPDATE md49data SET EncoderL=%i, EncoderR=%i WHERE ID=1;", md49_encoders.encoder_l, md49_encoders.encoder_r);
    execute_update_sqlite();
    // Encoderbytes 1-4 left
    cx = snprintf (sql_buffer,400,"UPDATE md49data SET Encoderbyte1L=%i, Encoderbyte2L=%i, " \
     "Encoderbyte3L=%i, Encoderbyte4L=%i WHERE ID=1;", md49_encoders.encoderbyte1l, md49_encoders.encoderbyte2l, md49_encoders.encoderbyte3l, md49_encoders.encoderbyte4l);
    execute_update_sqlite();
    // Encoderbytes 1-4 right<commit_msg>Update CMakeLists to use renamed package md49_messages instead of custom_messages<commit_after>#include <iostream>                                         /* allows to perform standard input and output operations */
#include <stdio.h>                                          /* Standard input/output definitions */
#include <stdint.h>                                         /* Standard input/output definitions */
#include <stdlib.h>                                         /* defines several general purpose functions */
#include <unistd.h>                                         /* UNIX standard function definitions */
#include <fcntl.h>                                          /* File control definitions */
#include <ctype.h>                                          /* isxxx() */
#include <sqlite3.h>
#include <ros/ros.h>                                        /* ROS */
#include <md49_messages/md49_encoders.h>
#include <md49_messages/md49_data.h>                       /* Custom message /encoders */

md49_messages::md49_encoders md49_encoders;
md49_messages::md49_data md49_data;

// sqlite globals
sqlite3 *db;
char *zErrMsg = 0;
int  rc;
int cx;
const char *sql;
char sql_buffer[400];

void open_sqlite_db_md49data(void);
void execute_update_sqlite(void);

void md49_encoders_callback(const md49_messages::md49_encoders& md49_encoders){

    // Write data read from MD49 into
    // sqlite3 database md49data.db
    // ******************************
    // EncoderL & EncoderR
    cx = snprintf (sql_buffer,400,"UPDATE md49data SET EncoderL=%i, EncoderR=%i WHERE ID=1;", md49_encoders.encoder_l, md49_encoders.encoder_r);
    execute_update_sqlite();
    // Encoderbytes 1-4 left
    cx = snprintf (sql_buffer,400,"UPDATE md49data SET Encoderbyte1L=%i, Encoderbyte2L=%i, " \
     "Encoderbyte3L=%i, Encoderbyte4L=%i WHERE ID=1;", md49_encoders.encoderbyte1l, md49_encoders.encoderbyte2l, md49_encoders.encoderbyte3l, md49_encoders.encoderbyte4l);
    execute_update_sqlite();
    // Encoderbytes 1-4 right
{'fraction_non_alphanumeric': 0.11351623458343821, 'fraction_numerical': 0.039265039013340046, 'mean_word_length': 2.2282696994313564, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4442012', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1134, 'n_words': 260}