<commit_before>﻿using QuadTreeTDD;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace QuadTreeVisualizerWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private QuadTree quadTree;

        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Randomize();
        }

        private void DrawQuadTreePositions(QuadTree quad)
        {
            //Get all the points
            List<QuadTreeTDD.Vector> allPositions = quad.ToList();

            //Draw the points
            foreach (QuadTreeTDD.Vector pos in allPositions)
            {
                Ellipse ellipse = new Ellipse
                {
                    StrokeThickness = 1,
                    Stroke = Brushes.Black,
                    Width = 3,
                    Height = 3
                };
                VisualizerCanvas.Children.Add(ellipse);
                Canvas.SetLeft(ellipse, pos.X - ellipse.Width * 0.5);
                Canvas.SetTop(ellipse, pos.Y - ellipse.Height * 0.5);
            }
        }

        private void DrawQuadTreeBounds(QuadTree quad)
        {
            //Draw the bounding rectanlges
            Rectangle rect = new Rectangle
            {
                StrokeThickness = 1,
                Stroke = Brushes.Black,
                Width = quad.Bounds.Width,
                Height = quad.Bounds.Height
            };
            VisualizerCanvas.Children.Add(rect);
            Canvas.SetLeft(rect, quad.Bounds.TopLeft.X);
            Canvas.SetTop(rect, quad.Bounds.TopLeft.Y);
                
            //Recusrively draw the children of this quad
            if (quad.NorthWest != null)
                DrawQuadTreeBounds(quad.NorthWest);

            if (quad.NorthEast != null)
                DrawQuadTreeBounds(quad.NorthEast);

            if (quad.SouthWest != null)
                DrawQuadTreeBounds(quad.SouthWest);
<commit_msg>Fixed a typo in comments.<commit_after>﻿using QuadTreeTDD;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace QuadTreeVisualizerWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private QuadTree quadTree;

        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Randomize();
        }

        private void DrawQuadTreePositions(QuadTree quad)
        {
            //Get all the points
            List<QuadTreeTDD.Vector> allPositions = quad.ToList();

            //Draw the points
            foreach (QuadTreeTDD.Vector pos in allPositions)
            {
                Ellipse ellipse = new Ellipse
                {
                    StrokeThickness = 1,
                    Stroke = Brushes.Black,
                    Width = 3,
                    Height = 3
                };
                VisualizerCanvas.Children.Add(ellipse);
                Canvas.SetLeft(ellipse, pos.X - ellipse.Width * 0.5);
                Canvas.SetTop(ellipse, pos.Y - ellipse.Height * 0.5);
            }
        }

        private void DrawQuadTreeBounds(QuadTree quad)
        {
            //Draw the bounding rectangles
            Rectangle rect = new Rectangle
            {
                StrokeThickness = 1,
                Stroke = Brushes.Black,
                Width = quad.Bounds.Width,
                Height = quad.Bounds.Height
            };
            VisualizerCanvas.Children.Add(rect);
            Canvas.SetLeft(rect, quad.Bounds.TopLeft.X);
            Canvas.SetTop(rect, quad.Bounds.TopLeft.Y);
                
            //Recusrively draw the children of this quad
            if (quad.NorthWest != null)
                DrawQuadTreeBounds(quad.NorthWest);

            if (quad.NorthEast != null)
                DrawQuadTreeBounds(quad.NorthEast);

            if (quad.SouthWest != null)
                DrawQuadTreeBounds(quad.SouthWest);

{'fraction_non_alphanumeric': 0.08526011560693642, 'fraction_numerical': 0.0033030553261767133, 'mean_word_length': 1.6417666303162486, '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': '5558149', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1259, 'n_words': 284}