<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using RxApp;
using Android.App;
using Android.Runtime;

namespace RxApp.Example
{
    [Application]
    public sealed class RxAppExampleApplication : RxApplication
    {
        private readonly RxAppExampleApplicationController applicationController;

        public RxAppExampleApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
        {
            applicationController = new RxAppExampleApplicationController(this.NavigationStack);
        }

        public override Type GetActivityType(object model)
        {
            // This is a lot prettier in F# using pattern matching
            if (model is IMainViewModel)
            {
                return typeof(MainActivity);
            } 

            throw new Exception("No view for view model");
        }

        public override IDisposable ProvideController(object model)
        {
            return applicationController.Bind(model);
        }

        public override void OnCreate()
        {
            base.OnCreate();

            AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
                {
                    var path = Context.GetExternalFilesDir("exceptions").Path;
                    StreamWriter file = File.CreateText(path, "exception.txt");
                    file.Write(args.Exception.StackTrace); // save the exception description and clean stack trace
                    file.Close();
                };
        }

        public override void Start()
        {
            applicationController.Start();
        }

        public override void Stop()
        {
            applicationController.Stop();
        }
    }
}<commit_msg>fix exception file path<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using RxApp;
using Android.App;
using Android.Runtime;

namespace RxApp.Example
{
    [Application]
    public sealed class RxAppExampleApplication : RxApplication
    {
        private readonly RxAppExampleApplicationController applicationController;

        public RxAppExampleApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
        {
            applicationController = new RxAppExampleApplicationController(this.NavigationStack);
        }

        public override Type GetActivityType(object model)
        {
            // This is a lot prettier in F# using pattern matching
            if (model is IMainViewModel)
            {
                return typeof(MainActivity);
            } 

            throw new Exception("No view for view model");
        }

        public override IDisposable ProvideController(object model)
        {
            return applicationController.Bind(model);
        }

        public override void OnCreate()
        {
            base.OnCreate();

            AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
                {
                    var path = Context.GetExternalFilesDir("exceptions").Path;
                    StreamWriter file = File.CreateText(path + "/exception.txt");
                    file.Write(args.Exception.StackTrace); // save the exception description and clean stack trace
                    file.Close();
                };
        }

        public override void Start()
        {
            applicationController.Start();
        }

        public override void Stop()
        {
            applicationController.Stop();
        }
    }
}
{'fraction_non_alphanumeric': 0.07368134855899945, 'fraction_numerical': 0.0, 'mean_word_length': 2.040495867768595, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2551733', 'n_tokens_mistral': 868, 'n_tokens_neox': 818, 'n_words': 219}