<commit_before>﻿using System;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Client
{
    public partial class s : Form
    {
        private MessageHandler messageHandler;
        private Task connectionTask;
        private RfidManager rfidManager;

        public s()
        {
            InitializeComponent();
            messageHandler = new MessageHandler();
            nudRFIDSpeed.Minimum = Rfid.MinSpeed;
            nudRFIDSpeed.Maximum = Rfid.MaxSpeed;
            connectionTask = null;
            messageHandler.MessageReceived += messageHandler_MessageReceived;
            rfidManager = new RfidManager();
            rfidManager.CollectionChanged += RfidManagerOnCollectionChanged;
        }

        private void RfidManagerOnCollectionChanged(object sender, EventArgs eventArgs)
        {
            lbRfids.Items.Clear();
            foreach (var rfid in rfidManager.Rfids)
            {
                lbRfids.Items.Add(rfid);
            }
        }

        private void messageHandler_MessageReceived(object sender, MessageReceivedEventArgs e)
        {
            AddToInfo(e.Message);
        }
        


        private void btnAddToDatabase_Click(object sender, EventArgs e)
        {
            string serialNumber = tbRFIDNumber.Text;
            int speed = Convert.ToInt32(nudRFIDSpeed.Value);

            if (speed >= Rfid.MinSpeed && speed <= Rfid.MaxSpeed && !string.IsNullOrWhiteSpace(serialNumber) &&
                messageHandler != null)
            {
                Rfid rfid = new Rfid(serialNumber, speed);
                string message = $"ADDRFID:{rfid.ToNumberString()}";
                try
                {
                    messageHandler.SendMessage(message);
                    AddToInfo($"Sent message:{message}, with RFID(hex):{rfid.SerialNumber}");<commit_msg>Fixed the string for hex, it was decimal instead of hex<commit_after>﻿using System;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Client
{
    public partial class s : Form
    {
        private MessageHandler messageHandler;
        private Task connectionTask;
        private RfidManager rfidManager;

        public s()
        {
            InitializeComponent();
            messageHandler = new MessageHandler();
            nudRFIDSpeed.Minimum = Rfid.MinSpeed;
            nudRFIDSpeed.Maximum = Rfid.MaxSpeed;
            connectionTask = null;
            messageHandler.MessageReceived += messageHandler_MessageReceived;
            rfidManager = new RfidManager();
            rfidManager.CollectionChanged += RfidManagerOnCollectionChanged;
        }

        private void RfidManagerOnCollectionChanged(object sender, EventArgs eventArgs)
        {
            lbRfids.Items.Clear();
            foreach (var rfid in rfidManager.Rfids)
            {
                lbRfids.Items.Add(rfid);
            }
        }

        private void messageHandler_MessageReceived(object sender, MessageReceivedEventArgs e)
        {
            AddToInfo(e.Message);
        }
        


        private void btnAddToDatabase_Click(object sender, EventArgs e)
        {
            string serialNumber = tbRFIDNumber.Text;
            int speed = Convert.ToInt32(nudRFIDSpeed.Value);

            if (speed >= Rfid.MinSpeed && speed <= Rfid.MaxSpeed && !string.IsNullOrWhiteSpace(serialNumber) &&
                messageHandler != null)
            {
                Rfid rfid = new Rfid(serialNumber, speed);
                string message = $"ADDRFID:{rfid.ToNumberString()}";
                try
                {
                    messageHandler.SendMessage(message);
                    AddToInfo($"Sent message:{message}, with RFID(hex):{rfid}");
{'fraction_non_alphanumeric': 0.08141592920353982, 'fraction_numerical': 0.001011378002528445, 'mean_word_length': 2.0571870170015454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2938250', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1024, 'n_words': 219}