<commit_before>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
using ToClipboard.Model;

namespace ToClipboard
{
    /// <summary>
    /// This is set in ToClipboard properties to be the start of the application. If
    /// there are arguments (IE someone clicked a JumpList item) set that item to the
    /// clipboard and exit. Fast and easy. (and / or update database to reflect item clicked for sorting)
    /// </summary>
    public class EntryPoint
    {
        [STAThread]
        public static void Main(string[] args)
        {
            Window window = null;
            //Debugger.Launch();
            // Args has the format of "ITEMID" if lanched from JumpList item
            if (args != null && args.Length == 1)
            {
                long itemId;
                if (long.TryParse(args[0] ?? "0", out itemId) && itemId > 0)
                {
                    window = new SortJumpList();
                    IItem item = null;
                    IData db;
                    using (db = new Data.DataSQLite())
                    {
                        item = db.Item_Clicked(itemId);
                        db.SaveChanges();
                        if (null != item)
                        {
                            if (!string.IsNullOrWhiteSpace(item.Text))
                                System.Windows.Clipboard.SetText(item.Text);

                            // If set to launch the app after copying text to clipboard
                            if (item.DoLaunchApp && !string.IsNullOrWhiteSpace(item.LaunchApp))
                            {
                                if (!App.Try_AppAndIcon_IsSteam(item, icon => Process.Start(item.LaunchApp)))
                                    try
                                    {
                                        // Throws NotSupportedException for URI's
                                        FileInfo file = new FileInfo(item.LaunchApp);
                                        if (file.Exists)
                                            file.OpenLocation();
                                    }
                                    catch (NotSupportedException)
                                    {
                                        string http = item.LaunchApp.ToLower();
                                        if (!http.Contains("http"))
                                            http = "http://" + http;
                                        Process.Start(http);
                                    }
                            }
                        }
                    }
                }
            }
            var app = new App();
            app.InitializeComponent();
            app.Run(window);
        }
    }
}
<commit_msg>reversed some code. Thought I might use the db reference for sorting, but didn't end up needing it. This will show up in the next build.<commit_after>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
using ToClipboard.Model;

namespace ToClipboard
{
    /// <summary>
    /// This is set in ToClipboard properties to be the start of the application. If
    /// there are arguments (IE someone clicked a JumpList item) set that item to the
    /// clipboard and exit. Fast and easy. (and / or update database to reflect item clicked for sorting)
    /// </summary>
    public class EntryPoint
    {
        [STAThread]
        public static void Main(string[] args)
        {
            Window window = null;
            //Debugger.Launch();
            // Args has the format of "ITEMID" if lanched from JumpList item
            if (args != null && args.Length == 1)
            {
                long itemId;
                if (long.TryParse(args[0] ?? "0", out itemId) && itemId > 0)
                {
                    window = new SortJumpList();
                    IItem item = null;
                    using (var db = new Data.DataSQLite())
                    {
                        item = db.Item_Clicked(itemId);
                        db.SaveChanges();
                    }
                    if (null != item)
                    {
                        if (!string.IsNullOrWhiteSpace(item.Text))
                            System.Windows.Clipboard.SetText(item.Text);

                        // If set to launch the app after copying text to clipboard
                        if (item.DoLaunchApp && !string.IsNullOrWhiteSpace(item.LaunchApp))
                        {
                            if (!App.Try_AppAndIcon_IsSteam(item, icon => Process.Start(item.LaunchApp)))
                                try
                                {
                                    // Throws NotSupportedException for URI's
                                    FileInfo file = new FileInfo(item.LaunchApp);
                                    if (file.Exists)
                                        file.OpenLocation();
                                }
                                catch (NotSupportedException)
                                {
                                    string http = item.LaunchApp.ToLower();
                                    if (!http.Contains("http"))
                                        http = "http://" + http;
                                    Process.Start(http);
                                }
                        }
                    }
                }
            }
            var app = new App();
            app.InitializeComponent();
            app.Run(window);
        }
    }
}

{'fraction_non_alphanumeric': 0.080613518815766, 'fraction_numerical': 0.0014267879436418763, 'mean_word_length': 0.9271477663230241, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 29, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3187143', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1184, 'n_words': 352}