<commit_before>#include <boost/asio/serial_port.hpp> 
#include <boost/asio.hpp> 
#include <stdlib.h>

#include "XimuReceiver.h"

using namespace boost;


int main(int argc, char** argv) {
	asio::io_service io;
	asio::serial_port port(io);

	port.open("/dev/tty.usbserial-AM01L4KI");
	port.set_option(asio::serial_port_base::baud_rate(115200));

	XimuReceiver receiver;

	char c;

	while (true) {
		// Read 1 character into c, this will block
		// forever if no character arrives.
		asio::read(port, asio::buffer(&c,1));
		receiver.processNewChar(c);

		if (receiver.isInertialAndMagGetReady() && receiver.isQuaternionGetReady()) {
			DrumSet drum = receiver.getDrum();
			if (drum.drumID > 0 && drum.strength > 1) {
				std::string command = "python ../../frontend/midiPlayer.py ";
				command.append(std::to_string(drum.drumID));
				command.append(" ");
				command.append(std::to_string(drum.strength));
				char* commands;
				std::strcpy(commands,command.c_str());
				// System call to run python codes
				std::system(commands);
			}
		}
	}
	
	return 0;
}<commit_msg>Probably solved segment fault issue<commit_after>#include <boost/asio/serial_port.hpp> 
#include <boost/asio.hpp> 
#include <stdlib.h>

#include "XimuReceiver.h"

using namespace boost;


int main(int argc, char** argv) {
	asio::io_service io;
	asio::serial_port port(io);

	port.open("/dev/tty.usbserial-AM01L4KI");
	port.set_option(asio::serial_port_base::baud_rate(115200));

	XimuReceiver receiver;

	char c;

	while (true) {
		// Read 1 character into c, this will block
		// forever if no character arrives.
		asio::read(port, asio::buffer(&c,1));
		receiver.processNewChar(c);

		if (receiver.isInertialAndMagGetReady() && receiver.isQuaternionGetReady()) {
			DrumSet drum = receiver.getDrum();
			if (drum.drumID > 0 && drum.strength > 1) {
				std::string command = "python ../../frontend/midiPlayer.py ";
				command.append(std::to_string(drum.drumID));
				command.append(" ");
				command.append(std::to_string(drum.strength));
				// System call to run python codes
				std::system(commands.c_str());
			}
		}
	}
	
	return 0;
}
{'fraction_non_alphanumeric': 0.15697399527186762, 'fraction_numerical': 0.013238770685579196, 'mean_word_length': 4.186274509803922, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4900055', 'n_tokens_mistral': 871, 'n_tokens_neox': 748, 'n_words': 149}