<commit_before>﻿using System;
using System.Collections.Generic;
using System.Data;

namespace Pingo
{
    //Stores a List of all hosts and a ToString of each host as a DataTable
    public class HostList
    {
        //Lock so data is not updated by multiple threads at once
        protected Object updateLock = new Object();

        //DataTable source for ListView
        protected DataTable data = new DataTable();

        //List to store all hosts
        protected List<Host> hosts;

        //Constructor
        public HostList()
        {
            //Initialize hosts
            hosts = new List<Host>();

            //Initialize DataTable with columns
            data.Columns.Add("Hostname", typeof(string));
            data.Columns.Add("Status", typeof(string));
            data.Columns.Add("Timestamp", typeof(string));
        }

        //Updates DataTable with contents of hosts
        public void UpdateData()
        {
            lock (updateLock)
            {
                //Clear old rows of DataTable
                data.Rows.Clear();

                //Create new rows with contents of hosts
                foreach (Host host in hosts)
                {
                    data.Rows.Add(host.ToString()[0], host.ToString()[1], host.ToString()[2]);
                }
            }
        }

        public List<Host> GetHostsAsList()
        {
            return hosts;
        }

        public DataTable GetHostsAsDataTable()
        {
            return data;
        }

        //Adds host
        public void AddHost(String hostname)
        {
            hosts.Add(new Host(hostname));
        }

        //Checks for duplicate host
        public bool IsDuplicate(string line)
        {
            foreach (Host host in hosts)
            {
                if (host.ToString()[0] == line)
                {
                    return true;
                }
            }

            return false;
        }
    }
}
<commit_msg>Duplicates no longer case sensitive<commit_after>﻿using System;
using System.Collections.Generic;
using System.Data;

namespace Pingo
{
    //Stores a List of all hosts and a ToString of each host as a DataTable
    public class HostList
    {
        //Lock so data is not updated by multiple threads at once
        protected Object updateLock = new Object();

        //DataTable source for ListView
        protected DataTable data = new DataTable();

        //List to store all hosts
        protected List<Host> hosts;

        //Constructor
        public HostList()
        {
            //Initialize hosts
            hosts = new List<Host>();

            //Initialize DataTable with columns
            data.Columns.Add("Hostname", typeof(string));
            data.Columns.Add("Status", typeof(string));
            data.Columns.Add("Timestamp", typeof(string));
        }

        //Updates DataTable with contents of hosts
        public void UpdateData()
        {
            lock (updateLock)
            {
                //Clear old rows of DataTable
                data.Rows.Clear();

                //Create new rows with contents of hosts
                foreach (Host host in hosts)
                {
                    data.Rows.Add(host.ToString()[0], host.ToString()[1], host.ToString()[2]);
                }
            }
        }

        public List<Host> GetHostsAsList()
        {
            return hosts;
        }

        public DataTable GetHostsAsDataTable()
        {
            return data;
        }

        //Adds host
        public void AddHost(String hostname)
        {
            hosts.Add(new Host(hostname));
        }

        //Checks for duplicate host
        public bool IsDuplicate(string line)
        {
            foreach (Host host in hosts)
            {
                if (host.ToString()[0].ToUpper() == line.ToUpper())
                {
                    return true;
                }
            }

            return false;
        }
    }
}

{'fraction_non_alphanumeric': 0.08708708708708708, 'fraction_numerical': 0.002002002002002002, 'mean_word_length': 1.3553329404832057, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1747610', 'n_tokens_mistral': 991, 'n_tokens_neox': 950, 'n_words': 298}