Also add slight adjustment to score display

--- osu.Game/Skinning/LegacyScoreCounter.cs
+++ osu.Game/Skinning/LegacyScoreCounter.cs
@@ -5,6 +5,7 @@
 using osu.Framework.Graphics;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
+using osuTK;

 namespace osu.Game.Skinning
 {
@@ -28,6 +29,7 @@
             // base class uses int for display, but externally we bind to ScoreProcesssor as a double for now.
             Current.BindValueChanged(v => base.Current.Value = (int)v.NewValue);

+            Scale = new Vector2(0.96f);
             Margin = new MarginPadding(10);
         }


Add multiple check

Add multiple check

--- timeSignal/Program.cs
+++ timeSignal/Program.cs
@@ -1,8 +1,6 @@

 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using System.Threading;
 using System.Windows.Forms;

 namespace timeSignal
@@ -18,7 +16,25 @@
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             new Form1();
-            Application.Run();
+            checkMultiple();
         }
+
+        /// <summary>
+        /// Multiple start check
+        /// </summary>
+        static void checkMultiple()
+        {
+            Mutex objMutex = new System.Threading.Mutex(false, Application.ProductName);
+
+            if (objMutex.WaitOne(0, false))
+            {
+                Application.Run();
+            }
+
+            GC.KeepAlive(objMutex);
+
+            objMutex.Close();
+        }
+
     }
 }


Clear iOS data is not a scenario [full ci]

--- features/fixtures/maze_runner/Assets/Scripts/MobileScenarioRunner.cs
+++ features/fixtures/maze_runner/Assets/Scripts/MobileScenarioRunner.cs
@@ -27,7 +27,6 @@
         {"12", "Disable Native Errors" },
         {"13", "throw Exception with breadcrumbs" },
         {"14", "Start SDK no errors" },
-        {"15", "Clear iOS Data" }
     };

     private string GetScenarioNameFromDialCode(string code)


Undo accidental disabling of the laser hit flare


remove extra async/await when requesting files from server


Fix KVO properties

Fix KVO properties

--- samples/QTRecorder/QTRDocument.cs
+++ samples/QTRecorder/QTRDocument.cs
@@ -63,13 +63,17 @@
 		//
 		// Connections
 		//
-		[Connect ("VideoDevices")]
 		public QTCaptureDevice [] VideoDevices {
+			[Export ("VideoDevices")]
 			get {
 			Console.WriteLine ("Bar");
 				if (videoDevices == null)
 					RefreshDevices ();
 				return videoDevices;
+			}
+			[Export ("setVideoDevices:")]
+			set {
+				videoDevices = value;
 			}
 		}


Missed creating index on Unique saga columns

--- NServiceBus.PostgreSQL/Saga/SagaPersister.cs
+++ NServiceBus.PostgreSQL/Saga/SagaPersister.cs
@@ -97,31 +97,23 @@
             {
                 conn.Execute(
                     "CREATE TABLE IF NOT EXISTS sagas(type TEXT, id UUID, originalmessageid TEXT, originator TEXT, sagadata JSONB, PRIMARY KEY (type, id))");
-                conn.Execute("DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_sagas_json' AND n.nspname = CURRENT_SCHEMA()) THEN CREATE INDEX idx_sagas_json ON sagas USING gin (sagadata jsonb_path_ops); END IF;END $$");
+                conn.Execute(
+                    "DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_sagas_json' AND n.nspname = CURRENT_SCHEMA()) THEN CREATE INDEX idx_sagas_json ON sagas USING gin (sagadata jsonb_path_ops); END IF;END $$");

                 foreach (var sagaType in sagaTypes.Where(t => UniqueAttribute.GetUniqueProperties(t).Any()))
                 {
                     var typeName = TypeMapper(sagaType);
-                    var typeCollapsedName = typeName.Replace('.', '_');
+                    var typeCollapsedName = typeName.Replace('.', '_').ToLower();

                     var jsonFieldsExpression = String.Join(", ", UniqueAttribute.GetUniqueProperties(sagaType)
                         .Select(f => String.Format("(sagadata -> '{0}')", f.Name)));
                     var indexCreationStatement = String.Format(
-                        "CREATE UNIQUE INDEX CONCURRENTLY idx_sagas_json_{0} ON sagas({1}) WHERE type = '{2}'",
+                        "DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_sagas_json_{0}' AND n.nspname = CURRENT_SCHEMA()) THEN CREATE UNIQUE INDEX idx_sagas_json_{0} ON sagas({1}) WHERE type = '{2}'; END IF;END $$",
                         typeCollapsedName, jsonFieldsExpression, typeName
                         );
                     // Create Unique constraint for type
-                    try
-                    {
-                        conn.Execute(indexCreationStatement);
-                    }
-                    catch (Exception ex)
-                    {
-                        if (!ex.Message.Contains("already exists"))
-                        {
-                            throw;
-                        }
-                    }
+                    Console.WriteLine(indexCreationStatement);
+                    conn.Execute(indexCreationStatement);
                 }
             }
         }


Update Percentage.cs

Update Percentage.cs

Reverted to ol version.


changed the runtime TaskWrapperScheduler field to TaskScheduler


fix nre

fix nre

--- Client/Systems/VesselProtoSys/VesselProtoEvents.cs
+++ Client/Systems/VesselProtoSys/VesselProtoEvents.cs
@@ -49,7 +49,7 @@
                 return;

             //This happens when vessel crashes
-            if (string.IsNullOrEmpty(data.name))
+            if (string.IsNullOrEmpty(data.vesselName))
                 return;

             //The vessel is NEW as it's not in the store. It might be a debris...


建立CommandClass指令類別

建立CommandClass指令類別

建立CommandClass指令類別


forgotten extension methods

forgotten extension methods


Growth

Growth

--- src/Features/Core/Portable/TodoComments/AbstractTodoCommentsIncrementalAnalyzer.cs
+++ src/Features/Core/Portable/TodoComments/AbstractTodoCommentsIncrementalAnalyzer.cs
@@ -37,8 +37,17 @@

         public override Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken)
         {
-            // Just report this back as there being no more comments for this document.
-            return ReportTodoCommentDataIfChangedAsync(documentId, ImmutableArray<TodoCommentData>.Empty, cancellationToken).AsTask();
+            // Remove the doc id from what we're tracking to prevent unbounded growth in the set.
+            lock (_gate)
+            {
+                // If the doc was already in the set, then we know the client believes there are zero comments for it.
+                // So we don't have to redundantly tell it that again.
+                if (_documentsWithNoTodoComments.Remove(documentId))
+                    return Task.CompletedTask;
+            }
+
+            // Otherwise, report that there should now be no todo comments for this doc.
+            return ReportTodoCommentDataAsync(documentId, ImmutableArray<TodoCommentData>.Empty, cancellationToken).AsTask();
         }

         private ImmutableArray<TodoCommentDescriptor> GetTodoCommentDescriptors(Document document)
@@ -74,31 +83,27 @@
             await TodoComment.ConvertAsync(
                 document, todoComments, converted, cancellationToken).ConfigureAwait(false);

-            // Now inform VS about this new information
-            await ReportTodoCommentDataIfChangedAsync(document.Id, converted.ToImmutable(), cancellationToken).ConfigureAwait(false);
-        }
-
-        private ValueTask ReportTodoCommentDataIfChangedAsync(DocumentId documentId, ImmutableArray<TodoCommentData> data, CancellationToken cancellationToken)
-        {
+            var data = converted.ToImmutable();
             lock (_gate)
             {
                 if (data.IsDefaultOrEmpty)
                 {
                     // If we already reported this doc has no todo comments, don't bother doing it again. Otherwise,
                     // notify the client.
-                    if (!_documentsWithNoTodoComments.Add(documentId))
+                    if (!_documentsWithNoTodoComments.Add(document.Id))
                     {
-                        return default;
+                        return;
                     }
                 }
                 else
                 {
                     // Doc has some todo comments, remove the 'do not report' list and notify the client.
-                    _documentsWithNoTodoComments.Remove(documentId);
+                    _documentsWithNoTodoComments.Remove(document.Id);
                 }
             }

-            return ReportTodoCommentDataAsync(documentId, data, cancellationToken);
+            // Now inform VS about this new information
+            await ReportTodoCommentDataAsync(document.Id, data, cancellationToken).ConfigureAwait(false);
         }
     }
 }


Allow dataloss... shouldn't be necesssary?

--- alert-roster.web/Migrations/Configuration.cs
+++ alert-roster.web/Migrations/Configuration.cs
@@ -11,7 +11,7 @@
         public Configuration()
         {
             AutomaticMigrationsEnabled = true;
-            AutomaticMigrationDataLossAllowed = false;
+            AutomaticMigrationDataLossAllowed = true;
             ContextKey = "alert_roster.web.Models.AlertRosterDbContext";
         }


Don't try to teleport if login failed.

Don't try to teleport if login failed.

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@348 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife-cs/examples/Teleport/Teleport.cs
+++ libsecondlife-cs/examples/Teleport/Teleport.cs
@@ -36,10 +36,12 @@
             Console.WriteLine();

             Teleport app = new Teleport();
-            app.Connect(args[0], args[1], args[2]);
-            app.doStuff(sim, new LLVector3(x,y,z));
-            app.Disconnect();
-
+            bool success = app.Connect(args[0], args[1], args[2]);
+            if (success)
+            {
+                app.doStuff(sim, new LLVector3(x, y, z));
+                app.Disconnect();
+            }
         }

         protected Teleport()
@@ -56,7 +58,7 @@
             }
 		}

-        protected void Connect(string FirstName, string LastName, string Password)
+        protected bool Connect(string FirstName, string LastName, string Password)
         {
             Console.WriteLine("Attempting to connect and login to SecondLife.");

@@ -70,13 +72,15 @@
             {
                 // Login failed
                 Console.WriteLine("Error logging in: " + client.Network.LoginError);
-                return;
+                return false;
             }

             // Login was successful
             Console.WriteLine("Login was successful.");
             Console.WriteLine("AgentID:   " + client.Network.AgentID);
             Console.WriteLine("SessionID: " + client.Network.SessionID);
+
+            return true;
         }

         protected void Disconnect()


[FIX] [#883] Class ordering issue

[FIX] [#883] Class ordering issue

--- Compiler/Translator/Emitter/Emitter.TypeHelpers.cs
+++ Compiler/Translator/Emitter/Emitter.TypeHelpers.cs
@@ -121,8 +121,8 @@

                     if (this.IsInheritedFrom(t, x))
                     {
-                        this.Types.Remove(t);
-                        this.Types.Insert(this.Types.IndexOf(x) + 1, t);
+                        this.Types.Remove(x);
+                        this.Types.Insert(this.Types.IndexOf(t), x);
                         break;
                     }
                 }


Changes OS bitness check to Environment rather than System.Runtime.InteropServices.RuntimeInformation (#1286)

--- src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs
+++ src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs
@@ -47,8 +47,7 @@
         {
             get
             {
-                return RuntimeInformation.OSArchitecture == Architecture.X64
-                    || RuntimeInformation.OSArchitecture == Architecture.Arm64;
+                return Environment.Is64BitOperatingSystem;
             }
         }


Resolve #864 -- Fixing typo (#868)

Resolve #864 -- Fixing typo (#868)

* BaseHp does not exist but a variable called baseHp yes so it was a misspelling

--- Content/LeagueSandbox-Scripts/Champions/Taric/Q.cs
+++ Content/LeagueSandbox-Scripts/Champions/Taric/Q.cs
@@ -44,7 +44,7 @@
         {
             var ap = owner.Stats.AbilityPower.Total * 0.3f;
             var baseHp = (owner.Stats.HealthPoints.Total - owner.Stats.HealthPoints.BaseValue) * 0.05f;
-            float healthGain = 20 + spell.Level * 40 + ap + BaseHp;
+            float healthGain = 20 + spell.Level * 40 + ap + baseHp;

             if (target == owner && spell.Target == owner)
             {


DbContextOptionsExtension bug: pass connection string. fixes #221

--- src/Pomelo.EntityFrameworkCore.MySql/Extensions/MySqlDbContextOptionsExtensions.cs
+++ src/Pomelo.EntityFrameworkCore.MySql/Extensions/MySqlDbContextOptionsExtensions.cs
@@ -77,10 +77,8 @@
             [NotNull] string connectionString,
             [CanBeNull] Action<MySqlDbContextOptionsBuilder> mySqlOptionsAction = null)
             where TContext : DbContext
-        {
-            return (DbContextOptionsBuilder<TContext>)UseMySql(
-                (DbContextOptionsBuilder)optionsBuilder, new MySqlConnection(connectionString), mySqlOptionsAction);
-        }
+            => (DbContextOptionsBuilder<TContext>)UseMySql(
+                (DbContextOptionsBuilder)optionsBuilder, connectionString, mySqlOptionsAction);

         public static DbContextOptionsBuilder<TContext> UseMySql<TContext>(
             [NotNull] this DbContextOptionsBuilder<TContext> optionsBuilder,


When formatting, if collection is modified, don't fail the entire pipeline (#14438)

--- src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs
+++ src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs
@@ -7,6 +7,7 @@
 using System.Collections.ObjectModel;
 using System.Globalization;
 using System.Management.Automation;
+using System.Management.Automation.Internal;
 using System.Management.Automation.Runspaces;
 using System.Reflection;
 using System.Text;
@@ -19,6 +20,11 @@
     /// </summary>
     internal static class PSObjectHelper
     {
+        #region tracer
+        [TraceSource("PSObjectHelper", "PSObjectHelper")]
+        private static readonly PSTraceSource s_tracer = PSTraceSource.GetTracer("PSObjectHelper", "PSObjectHelper");
+        #endregion tracer
+
         internal const char Ellipsis = '\u2026';

         internal static string PSObjectIsOfExactType(Collection<string> typeNames)
@@ -290,10 +296,12 @@
                 // take care of the case there is no base object
                 return so.ToString();
             }
-            catch (ExtendedTypeSystemException e)
-            {
-                // NOTE: we catch all the exceptions, since we do not know
-                // what the underlying object access would throw
+            catch (Exception e) when (e is ExtendedTypeSystemException || e is InvalidOperationException)
+            {
+                // These exceptions are being caught and handled by returning an empty string when
+                // the object cannot be stringified due to ETS or an instance in the collection has been modified
+                s_tracer.TraceWarning($"SmartToString method: Exception during conversion to string, emitting empty string: {e.Message}");
+
                 if (formatErrorObject != null)
                 {
                     formatErrorObject.sourceObject = so;


Add some test to CommandReceiverBase

Add some test to CommandReceiverBase

--- src/Takenet.MessagingHub.Client.Test/MessagingHubClientTests_AddCommandReceiver.cs
+++ src/Takenet.MessagingHub.Client.Test/MessagingHubClientTests_AddCommandReceiver.cs
@@ -76,8 +76,7 @@
         }

         [Test]
-        [Ignore]
-        public async Task WhenClientAddACommandReceiverBaseAndReceiveACommandTheReceiverShouldHandleAndBeSet()
+        public void WhenClientAddACommandReceiverBaseAndReceiveACommandTheReceiverShouldHandleAndBeSet()
         {
             //Arrange

@@ -86,18 +85,12 @@
             _messagingHubClient.UsingAccount("login", "pass");
             _messagingHubClient.AddCommandReceiver(commandReceiver);

-            _semaphore = new SemaphoreSlim(1);
-
-            _clientChannel.ReceiveCommandAsync(Arg.Any<CancellationToken>()).ReturnsForAnyArgs(async (_) =>
-            {
-                await _semaphore.WaitAsync().ConfigureAwait(false);
-                return SomeCommand;
-            });
+            _semaphore = new SemaphoreSlim(2);

             //Act
-            await _messagingHubClient.StartAsync().ConfigureAwait(false);
+            _messagingHubClient.StartAsync().ConfigureAwait(false);

-            await Task.Delay(3000);
+            Task.Delay(3000).Wait();

             //Assert
             commandReceiver.ReceivedWithAnyArgs().ReceiveAsync(null);


Remove caching

Remove caching

--- src/Workspaces/Core/Portable/FindSymbols/FindReferences/DependentProjectsFinder.cs
+++ src/Workspaces/Core/Portable/FindSymbols/FindReferences/DependentProjectsFinder.cs
@@ -20,22 +20,11 @@

 namespace Microsoft.CodeAnalysis.FindSymbols
 {
-    using DependentProjectMap = ConcurrentDictionary<DefinitionProject, AsyncLazy<ImmutableArray<DependentProject>>>;
-
     /// <summary>
     /// Provides helper methods for finding dependent projects across a solution that a given symbol can be referenced within.
     /// </summary>
     internal static partial class DependentProjectsFinder
     {
-        /// <summary>
-        /// Dependent projects cache.
-        /// For a given solution, maps from an assembly (source-project or metadata-assembly) to the set of projects referencing it.
-        ///     Key: DefinitionProject, which contains the project-id for a source-project-assembly, or assembly-name for a metadata-assembly.
-        ///     Value: List of DependentProjects, where each DependentProject contains a dependent project ID and a flag indicating whether the dependent project has internals access to definition project.
-        /// </summary>
-        private static readonly ConditionalWeakTable<Solution, DependentProjectMap> s_dependentProjectsCache =
-            new ConditionalWeakTable<Solution, DependentProjectMap>();
-
         public static async Task<ImmutableArray<Project>> GetDependentProjectsAsync(
             Solution solution, ISymbol symbol, IImmutableSet<Project>? projects, CancellationToken cancellationToken)
         {
@@ -79,26 +68,11 @@
                 return ImmutableArray<Project>.Empty;

             // 1) Compute all the dependent projects (submission + non-submission) and their InternalsVisibleTo semantics to the definition project.
-
-            var visibility = symbol.GetResultantVisibility();
-            if (visibility == SymbolVisibility.Private)
-            {
-                // For private symbols, we only need the current project (and related submissions).  No need to cache
-                // that, just simply compute and return the result.
-                return GetProjects(solution, await ComputeDependentProjectsAsync(solution, symbolOrigination, visibility, cancellationToken).ConfigureAwait(false));
-            }
-
-            // Otherwise, for non-private symbols, we cache the dependent projects for non-private symbols to speed up
-            // future calls.
-            var dependentProjectsMap = s_dependentProjectsCache.GetValue(solution, _ => new DependentProjectMap());
-
-            var asyncLazy = dependentProjectsMap.GetOrAdd(
-                new DefinitionProject(symbolOrigination.sourceProject?.Id, symbolOrigination.assembly.Name.ToLower()),
-                _ => AsyncLazy.Create(c => ComputeDependentProjectsAsync(solution, symbolOrigination, visibility, c), cacheResult: true));
-            var dependentProjects = await asyncLazy.GetValueAsync(cancellationToken).ConfigureAwait(false);
+            var dependentProjects = await ComputeDependentProjectsAsync(
+                solution, symbolOrigination, symbol.GetResultantVisibility(), cancellationToken).ConfigureAwait(false);

             // 2) Filter the above computed dependent projects based on symbol visibility.
-            return GetProjects(solution, visibility == SymbolVisibility.Internal
+            return GetProjects(solution, symbol.GetResultantVisibility() == SymbolVisibility.Internal
                 ? dependentProjects.WhereAsArray(dp => dp.HasInternalsAccess)
                 : dependentProjects);
         }


Added more Trie unit tests

Added more Trie unit tests

Added unit tests for checking if prefix is contained and getting words
by prefix

--- DSA/DSAUnitTests/DataStructures/Trees/TrieTests.cs
+++ DSA/DSAUnitTests/DataStructures/Trees/TrieTests.cs
@@ -268,5 +268,82 @@

             Assert.IsTrue(trie.Count == words.Length - removedWords);
         }
+
+        [TestMethod]
+        public void CheckIfPrefixIsContained()
+        {
+            var trie = new Trie();
+
+            var words = new string[]
+            {
+                "One", "one", "oNe", "two", "hello",
+                "test", "here", "there", "?!??!?!?!?",
+                "VeryVeryVeryLoooooooooooooooooong",
+                ".k[2c3-9024g-u,9weg,ouimwt", "3q2tgwadh",
+                "`+rv`+*1v+vt23*1`vt*1v", "!@#)(*^$!%@_",
+                "  bum  ", "  bam  ", "  bum  bam  ",
+                "1", "12", "123", "1234", "12345", "123456"
+            };
+
+
+            for (int i = 0; i < words.Length; i++)
+            {
+                trie.Add(words[i]);
+
+                for (int j = 1; j <= words[i].Length; j++)
+                {
+                    if (!trie.ContainsPrefix(words[i].Substring(0, j))) Assert.Fail();
+                }
+                if (!trie.Contains(words[i])) Assert.Fail();
+
+            }
+
+            Assert.IsTrue(trie.Count == words.Length);
+        }
+
+        [TestMethod]
+        public void GetWordsByPrefixAndCheckIfSorted()
+        {
+            var trie = new Trie();
+
+            var words = new string[]
+            {
+                "prefix afa", "prefix abaa", "prefix asd",
+                "prefix ase", "prefix rfda", "prefix rtfs",
+                "prefix efad", "prefix Abaa", "prefix fasrg",
+                "prefix test", "prefix t3st", "prefix tEst",
+                "prefix TEST", "prefix Test", "prefix T3st",
+                "prefix Test123", "prefix aheyj", "prefix gwecgs",
+                "prefix .,gml;k", "prefix rbkp;r", "prefix wopger'lb",
+                "prefix   zzz", "prefix ^&*(&", "prefix кирилица",
+                "no prefix"
+            };
+
+            for (int i = 0; i < words.Length; i++)
+            {
+                if (trie.Contains(words[i])) Assert.Fail();
+
+                trie.Add(words[i]);
+
+                if (!trie.Contains(words[i])) Assert.Fail();
+
+            }
+
+            var previousWord = string.Empty;
+            int prefixWords = 0;
+
+            foreach (var word in trie.GetWordsByPrefix("prefix"))
+            {
+                if (string.CompareOrdinal(previousWord, word) > 0) Assert.Fail();
+
+                System.Diagnostics.Trace.WriteLine(word);
+
+                previousWord = word;
+                prefixWords++;
+            }
+
+            Assert.IsTrue(trie.Count == words.Length
+                            && prefixWords < words.Length);
+        }
     }
 }


For completeness

For completeness

--- src/Workspaces/Core/Portable/Storage/SQLite/v2/SQLitePersistentStorage.Accessor.cs
+++ src/Workspaces/Core/Portable/Storage/SQLite/v2/SQLitePersistentStorage.Accessor.cs
@@ -87,79 +87,57 @@
             [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
             public async Task<bool> ChecksumMatchesAsync(TKey key, Checksum checksum, CancellationToken cancellationToken)
             {
-                var (succeeded, dataId) = await TryGetDatabaseIdAsync(key, cancellationToken).ConfigureAwait(false);
-                if (!succeeded)
-                    return false;
-
-                return await Storage.PerformReadAsync(
-                    static t => t.self.ChecksumMatches(t.dataId, t.checksum, t.cancellationToken),
-                    (self: this, dataId, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
-            }
-
-            private bool ChecksumMatches(TDatabaseId dataId, Checksum checksum, CancellationToken cancellationToken)
-            {
-                var hashData = ReadChecksumColumn(dataId, cancellationToken);
-                return hashData != null && checksum == hashData.Value;
+                // First, attempt to do the check just on the concurrent, read-only, queue.  This will succeed
+                // if the data-id for the provided key is already in the db and
+                var (missingDataId, matches) = await Storage.PerformReadAsync(
+                    static t => t.self.ChecksumMatches(t.key, t.checksum, allowWrite: false, t.cancellationToken),
+                    (self: this, key, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
+
+                if (missingDataId)
+                {
+                    (missingDataId, matches) = await Storage.PerformWriteAsync(
+                        static t => t.self.ChecksumMatches(t.key, t.checksum, allowWrite: true, t.cancellationToken),
+                        (self: this, key, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
+                }
+
+                return matches;
+            }
+
+            private (bool missingDataId, bool matches) ChecksumMatches(TKey key, Checksum checksum, bool allowWrite, CancellationToken cancellationToken)
+            {
+                var (missingDataId, hashData) = ReadChecksumColumn(key, allowWrite, cancellationToken);
+                if (missingDataId)
+                    return (missingDataId, false);
+
+                return (missingDataId: false, hashData != null && checksum == hashData.Value);
             }

             [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
             public async Task<Stream?> ReadStreamAsync(TKey key, Checksum? checksum, CancellationToken cancellationToken)
             {
-                var (succeeded, dataId) = await TryGetDatabaseIdAsync(key, cancellationToken).ConfigureAwait(false);
-                if (!succeeded)
-                    return null;
-
-                return await Storage.PerformReadAsync(
-                    static t => t.self.ReadStream(t.dataId, t.checksum, t.cancellationToken),
-                    (self: this, dataId, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
-            }
-
-            private async Task<(bool succeeded, TDatabaseId dataId)> TryGetDatabaseIdAsync(TKey key, CancellationToken cancellationToken)
-            {
-                if (Storage._shutdownTokenSource.IsCancellationRequested)
-                    return default;
-
-                // Getting the database ID may end up needing to write to the DB (to create a unique DB key corresponding
-                // to the data-key the client is passing in).  As such, we have to try to acquire the DB-key in a fashion
-                // that has exclusive write access to the DB to prevent locking errors.
-
-                // First, just try to optimistically read the data id from the db.  This can be done with
-                // just a read connection, so we can run concurrently with all other readers.
-                var (succeeded, dataId) = await Storage.PerformReadAsync(
-                    static t => TryGetDatabaseId(t.self, t.key, allowWrite: false, t.cancellationToken),
-                    (self: this, key, cancellationToken), cancellationToken).ConfigureAwait(false);
-
-                if (succeeded)
-                    return (succeeded, dataId);
-
-                // Data id was not in the db.  Switch over to an exclusive write lock to add it.  This will
-                // always happen the first time we write anything new into the DB.  But from that point on
-                // will very rarely be hit as most read requests will be to a key already written in the past.
-                return await Storage.PerformWriteAsync(
-                    static t => TryGetDatabaseId(t.self, t.key, allowWrite: true, t.cancellationToken),
-                    (self: this, key, cancellationToken), cancellationToken).ConfigureAwait(false);
-
-                static (bool succeeded, TDatabaseId dataId) TryGetDatabaseId(
-                    Accessor<TKey, TWriteQueueKey, TDatabaseId> self, TKey key, bool allowWrite, CancellationToken cancellationToken)
-                {
-                    cancellationToken.ThrowIfCancellationRequested();
-
-                    using var _ = self.Storage._connectionPool.Target.GetPooledConnection(out var connection);
-
-                    // Determine the appropriate data-id to store this stream at.
-                    var succeeded = self.TryGetDatabaseId(connection, key, allowWrite, out var dataId);
-                    return (succeeded, dataId);
-                }
+                var (missingDataId, stream) = await Storage.PerformReadAsync(
+                    static t => t.self.ReadStream(t.key, t.checksum, allowWrite: false, t.cancellationToken),
+                    (self: this, key, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
+
+                if (missingDataId)
+                {
+                    (missingDataId, stream) = await Storage.PerformWriteAsync(
+                        static t => t.self.ReadStream(t.key, t.checksum, allowWrite: true, t.cancellationToken),
+                        (self: this, key, checksum, cancellationToken), cancellationToken).ConfigureAwait(false);
+                }
+
+                return stream;
             }

             [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
-            private Stream? ReadStream(TDatabaseId dataId, Checksum? checksum, CancellationToken cancellationToken)
-                => ReadDataBlobColumn(dataId, checksum, cancellationToken);
-
-            private Optional<T> ReadColumn<T, TData>(
-                TDatabaseId dataId,
+            private (bool missingDataId, Stream? stream) ReadStream(TKey key, Checksum? checksum, bool allowWrite, CancellationToken cancellationToken)
+                => ReadDataBlobColumn(key, checksum, allowWrite, cancellationToken);
+
+            private (bool missingDataId, Optional<T>) ReadColumn<T, TData>(
+                TKey key,
                 Func<TData, SqlConnection, Database, long, Optional<T>> readColumn,
                 TData data,
+                bool allowWrite,
                 CancellationToken cancellationToken)
             {
                 cancellationToken.ThrowIfCancellationRequested();
@@ -167,6 +145,9 @@
                 if (!Storage._shutdownTokenSource.IsCancellationRequested)
                 {
                     using var _ = Storage._connectionPool.Target.GetPooledConnection(out var connection);
+                    if (!TryGetDatabaseId(connection, key, allowWrite, out var dataId))
+                        return (missingDataId: true, default);
+
                     try
                     {
                         // First, try to see if there was a write to this key in our in-memory db.
@@ -174,11 +155,11 @@

                         var optional = ReadColumnHelper(connection, Database.WriteCache, dataId);
                         if (optional.HasValue)
-                            return optional;
+                            return (missingDataId: false, optional);

                         optional = ReadColumnHelper(connection, Database.Main, dataId);
                         if (optional.HasValue)
-                            return optional;
+                            return (missingDataId: false, optional);
                     }
                     catch (Exception ex)
                     {
@@ -201,27 +182,35 @@
                 }
             }

-            private Stream? ReadDataBlobColumn(
-                TDatabaseId dataId, Checksum? checksum, CancellationToken cancellationToken)
-            {
-                var optional = ReadColumn(
-                    dataId,
+            private (bool missingDataId, Stream? stream) ReadDataBlobColumn(
+                TKey key, Checksum? checksum, bool allowWrite, CancellationToken cancellationToken)
+            {
+                var (missingDataId, optional) = ReadColumn(
+                    key,
                     static (t, connection, database, rowId) => t.self.ReadDataBlob(connection, database, rowId, t.checksum),
                     (self: this, checksum),
+                    allowWrite,
                     cancellationToken);
+                if (missingDataId)
+                    return (missingDataId, null);

                 Contract.ThrowIfTrue(optional.HasValue && optional.Value == null);
-                return optional.HasValue ? optional.Value : null;
-            }
-
-            private Checksum.HashData? ReadChecksumColumn(TDatabaseId dataId, CancellationToken cancellationToken)
-            {
-                var optional = ReadColumn(
-                    dataId,
+                return (missingDataId: false, optional.HasValue ? optional.Value : null);
+            }
+
+            private (bool missingDataId, Checksum.HashData? data) ReadChecksumColumn(
+                TKey key, bool allowWrite, CancellationToken cancellationToken)
+            {
+                var (missingDataId, optional) = ReadColumn(
+                    key,
                     static (self, connection, database, rowId) => self.ReadChecksum(connection, database, rowId),
-                    this, cancellationToken);
-
-                return optional.HasValue ? optional.Value : null;
+                    this,
+                    allowWrite,
+                    cancellationToken);
+                if (missingDataId)
+                    return (missingDataId, null);
+
+                return (missingDataId: false, optional.HasValue ? optional.Value : null);
             }

             public Task<bool> WriteStreamAsync(TKey key, Stream stream, Checksum? checksum, CancellationToken cancellationToken)


Began Adding Support for Custom World Generators

--- DivineRightConcept/DivineRightConcept/GameWorld.cs
+++ DivineRightConcept/DivineRightConcept/GameWorld.cs
@@ -5,6 +5,7 @@
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework;
 using System.IO;
+using DivineRightConcept.Generators;

 namespace DivineRightConcept
 {
@@ -16,6 +17,7 @@
         public Texture2D GroundTextures { get; set; }
         public Texture2D StickManTexture { get; set; }

+        //interface for retreiving the generated minimap
         public Texture2D MiniMapTexture
         {
             get { return _miniMap; }
@@ -35,22 +37,14 @@

         public override void Initialize()
         {
-            //Initialise a (Currently) Random World Map
-            Random random = new Random();
-            _worldMap = new int[WorldHeight][];
-            for (int i = 0; i < _worldMap.Length; i++)
-            {
-                _worldMap[i] = new int[WorldWidth];
-                for (int j = 0; j < _worldMap[i].Length; j++)
-                    _worldMap[i][j] = random.Next(0, 4);
-
-            }
+            RandomWorldGenerator generator = new RandomWorldGenerator();
+            _worldMap = generator.Generate(WorldWidth, WorldHeight);

             //DUMP MAP COORDINATES FOR DEBUGGING
             TextWriter writer = new StreamWriter("map_coord.txt");
-            for (int i = 0; i < _worldMap.Length; i++)
+            for (int j = 0; j < WorldHeight; j++)
             {
-                for (int j = 0; j < _worldMap.Length; j++)
+                for (int i = 0; i < WorldWidth; i++)
                     writer.Write(_worldMap[i][j].ToString());

                 writer.WriteLine();
@@ -60,9 +54,9 @@
             //create a small scale map for the user (The MiniMap)
             Color[] mapColors = new Color[WorldWidth * WorldHeight];
             _miniMap = new Texture2D(Game.GraphicsDevice, WorldWidth, WorldHeight, false, SurfaceFormat.Color);
-            for (int i = 0; i < _worldMap.Length; i++)
-                for (int j = 0; j < _worldMap[i].Length; j++)
-                    mapColors[i * _worldMap.Length + j] = Ground.TextureColors[_worldMap[i][j]];
+            for (int i = 0; i < WorldWidth; i++)
+                for (int j = 0; j < WorldHeight; j++)
+                    mapColors[j * _worldMap.Length + i] = Ground.TextureColors[_worldMap[i][j]];
             _miniMap.SetData<Color>(mapColors);

             base.Initialize();


pulizia codice manager richieste

pulizia codice manager richieste

--- src/backend/SO115App.FakePersistance.ExternalAPI/HttpManager/HttpRequestManager.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/HttpManager/HttpRequestManager.cs
@@ -17,7 +17,6 @@
         private readonly HttpClient _client;

         private AsyncPolicyWrap<HttpResponseMessage> policies;
-        private OutputData Result = default;

         public HttpRequestManager(IMemoryCache memoryCache, HttpClient client)
         {


Add MenuCaptionBarForm subclass adorned with a type argument requiring it to be both Control and IDockableControl.

--- Eutherion/Win.MdiAppTemplate/MenuCaptionBarForm.cs
+++ Eutherion/Win.MdiAppTemplate/MenuCaptionBarForm.cs
@@ -32,15 +32,6 @@

 namespace Eutherion.Win.MdiAppTemplate
 {
-    /// <summary>
-    /// <see cref="UIActionForm"/> which displays a main menu inside a custom caption bar.
-    /// It is advisable to give the main menu strip a back color so it does not display
-    /// a gradient which clashes with the custom drawn caption bar area.
-    /// </summary>
-    /// <remarks>
-    /// Some non-client area handling code is adapted from:
-    /// https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Shell/WindowChromeWorker.cs,369313199b0de06c
-    /// </remarks>
     public class OldMenuCaptionBarForm : UIActionForm, IWeakEventTarget
     {
         private struct Metrics
@@ -707,4 +698,27 @@
     public class MenuCaptionBarForm : OldMenuCaptionBarForm
     {
     }
+
+    /// <summary>
+    /// <see cref="UIActionForm"/> which contains a single client control, and displays a main menu in the top left area of a custom caption bar.
+    /// </summary>
+    /// <typeparam name="TDockableControl">
+    /// The type of the client control. It must derive from <see cref="Control"/> and implements the <see cref="IDockableControl"/>
+    /// interface, which allows it to be hosted in a <see cref="MdiTabControl"/> as well.
+    /// </typeparam>
+    /// <remarks>
+    /// Some non-client area handling code is adapted from:
+    /// https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Shell/WindowChromeWorker.cs,369313199b0de06c
+    /// </remarks>
+    public sealed class MenuCaptionBarForm<TDockableControl> : MenuCaptionBarForm
+        where TDockableControl : Control, IDockableControl
+    {
+        public TDockableControl DockedControl { get; }
+
+        public MenuCaptionBarForm(TDockableControl dockableControl)
+        {
+            DockedControl = dockableControl ?? throw new ArgumentNullException(nameof(dockableControl));
+            Controls.Add(DockedControl);
+        }
+    }
 }


revert isMainThread

revert isMainThread

--- ExcelAsync/ExcelOperator/ExcelUIThreadProtecter.cs
+++ ExcelAsync/ExcelOperator/ExcelUIThreadProtecter.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;

 namespace ExcelAsync.ExcelOperator
 {
@@ -9,7 +10,8 @@
     {
         public static void CheckIsExcelUIMainThread()
         {
-            if (ExcelDna.Integration.ExcelDnaUtil.IsMainThread == false)
+            //In practice the managed Main thread id is 1.
+            if (Thread.CurrentThread.ManagedThreadId != 1)
             {
                 throw new Exception("All excel operation must be run at excel UI main thread");
             }


Removed unnecessary asserts in exception tests.

--- ExpressionEvaluatorTests/SubstringFunctionTests.cs
+++ ExpressionEvaluatorTests/SubstringFunctionTests.cs
@@ -30,7 +30,7 @@
         public void SubstringOperator_CalledWithNegativeIndex_IsCorrect()
         {
             func.Function = "substring('hello', -1, 3)";
-            NUnit.Framework.Assert.AreEqual("hel", func.Evaluate<String>());
+            func.Evaluate<String>();
         }

         [Test]
@@ -38,7 +38,7 @@
         public void SubstringOperator_CalledWithFloat_IsNotCorrect()
         {
             func.Function = "substring('hello', 0.1, 3)";
-            NUnit.Framework.Assert.AreEqual("hel", func.Evaluate<String>());
+            func.Evaluate<String>();
         }

         [Test]
@@ -47,7 +47,7 @@
         {
             func.Function = "substring('hello', 0, a)";
             func.AddSetVariable("a", 2.1);
-            NUnit.Framework.Assert.AreEqual(2.1d, func.Evaluate<String>());
+            func.Evaluate<String>();
         }

         [Test]
@@ -56,7 +56,7 @@
         {
             func.Function = "substring('hello', 0, a)";
             func.AddSetVariable("a", "b");
-            NUnit.Framework.Assert.AreEqual(0.5d, func.Evaluate<String>());
+            func.Evaluate<String>();
         }

         [Test]


Abort tests that cause stackoverflow to make development easier.

--- ExpressionToCodeTest/CSharpFriendlyTypeNameTest.cs
+++ ExpressionToCodeTest/CSharpFriendlyTypeNameTest.cs
@@ -1,8 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Linq.Expressions;
-using System.Text;
 using System.Text.RegularExpressions;
 using ExpressionToCodeLib;
 using NUnit.Framework;
@@ -98,24 +96,28 @@
         [Test] //TODO:Regression!
         public void UnboundNested()
         {
+            Assert.Fail("Aborting to avoid stackoverflow");
             Assert.AreEqual("Outer<X,Y>.Nested<Z>", ObjectToCode.GetCSharpFriendlyTypeName(typeof(Outer<,>.Nested<>)));
         }

         [Test] //TODO:Regression!
         public void UnboundGenericList()
         {
+            Assert.Fail("Aborting to avoid stackoverflow");
             Assert.AreEqual("List<T>", ObjectToCode.GetCSharpFriendlyTypeName(typeof(List<>)));
         }

         [Test] //TODO: this never worked, but it shouldn't crash
         public void UnboundGenericListInTypeof()
         {
+            Assert.Fail("Aborting to avoid stackoverflow");
             Assert.AreEqual("() => typeof(List<>)", ExpressionToCode.ToCode(() => typeof(List<>)));
         }

         [Test] //TODO: this never worked, but it shouldn't crash
         public void UnboundNestedInTypeof()
         {
+            Assert.Fail("Aborting to avoid stackoverflow");
             Assert.AreEqual("() => typeof(Outer<,>.Nested<>)", ExpressionToCode.ToCode(() => typeof(Outer<,>.Nested<>)));
         }
     }


Refactoring: adatpate to ajax

Refactoring: adatpate to ajax

--- GalleryMVC_With_Auth/Controllers/HomeController.cs
+++ GalleryMVC_With_Auth/Controllers/HomeController.cs
@@ -31,6 +31,15 @@

         public ActionResult Found(string search)
         {
+            var s = Request.IsAjaxRequest();
+            if (Request.IsAjaxRequest())
+            {
+                if (search == "") return PartialView();
+                return PartialView("Found",
+                    search[0] == '#'
+                        ? _repository.Pictures.Where(p => p.Tag.Name.Contains(search)).ToList()
+                        : _repository.Pictures.Where(p => p.Name.Contains(search)).ToList());
+            }
             if (search == "") return View();
             return View("Found",
                 search[0] == '#'


state transition event hookup alter

state transition event hookup alter

--- GameWork.Core.States/Event/EventStateController.cs
+++ GameWork.Core.States/Event/EventStateController.cs
@@ -18,12 +18,9 @@
 				States[ActiveStateName].DisconnectTransisions(this);
 			}

+			States[toStateName].ConnectTransitions(this);
+
 			base.OnChangeState(toStateName);
-
-			if (ActiveStateName != null)
-			{
-				States[ActiveStateName].ConnectTransitions(this);
-			}
 		}
 	}
 }


Added a couple lines to a Group Generation test that was relying on a side-effect of another test in the same fixture.

--- GlyssenTests/Rules/CharacterGroupGeneratorTests.cs
+++ GlyssenTests/Rules/CharacterGroupGeneratorTests.cs
@@ -1175,6 +1175,8 @@
 			m_testProject.CharacterGroupGenerationPreferences.NumberOfMaleNarrators = numMale;
 			m_testProject.CharacterGroupGenerationPreferences.NumberOfFemaleNarrators = numFemale;
 			m_testProject.CharacterGroupGenerationPreferences.IsSetByUser = true;
+			m_testProject.DramatizationPreferences.BookTitleAndChapterDramatization = ExtraBiblicalMaterialSpeakerOption.FemaleActor;
+			m_testProject.DramatizationPreferences.SectionHeadDramatization = ExtraBiblicalMaterialSpeakerOption.ActorOfEitherGender;

 			SetVoiceActors(6, 2);
 			var gen = new CharacterGroupGenerator(m_testProject);


Inner stats tabs will trigger on Statistics tab

--- HeroesParserData/ViewModels/MainWindowViewModel.cs
+++ HeroesParserData/ViewModels/MainWindowViewModel.cs
@@ -26,6 +26,11 @@
                     Messenger.Default.Send(new HomeTabMessage() { Trigger = Trigger.Update });
                 else
                     Messenger.Default.Send(new HomeTabMessage() { Trigger = Trigger.Stop });
+
+                if (value == 5) // stats tab
+                {
+                    SelectedStatisticsTab = SelectedStatisticsTab;
+                }
                 RaisePropertyChangedEvent(nameof(SelectedMainTab));
             }
         }


DataEnter属性を追加。

DataEnter属性を追加。

--- Implem.Pleasanter/Libraries/Html/HtmlAttributes.cs
+++ Implem.Pleasanter/Libraries/Html/HtmlAttributes.cs
@@ -404,6 +404,16 @@
             return this;
         }

+        public HtmlAttributes DataEnter(string value, bool _using = true)
+        {
+            if (value != null && _using)
+            {
+                Add("data-enter");
+                Add(value);
+            }
+            return this;
+        }
+
         public HtmlAttributes DataVer(int value, bool _using = true)
         {
             if (_using)


Added Flatten(..., Either<>)

Added Flatten(..., Either<>)

--- KitchenSink.Lib/Extensions/EnumerableExtensions.cs
+++ KitchenSink.Lib/Extensions/EnumerableExtensions.cs
@@ -164,6 +164,14 @@
             seq.SelectMany(x => x);

         /// <summary>
+        /// Combines sub-sequences of arbitrary and varied depth, as determined
+        /// by given <c>Either</c> function.
+        /// Example: <c>[[1, [2, 3]], [[4], 5], [[6, 7], 8]] => [1, 2, 3, 4, 5, 6, 7, 8]</c>
+        /// </summary>
+        public static IEnumerable<A> Flatten<A>(this IEnumerable<A> seq, Func<A, Either<A, IEnumerable<A>>> f) =>
+            seq.SelectMany(x => f(x).Branch(y => SeqOf(y), ys => Flatten(ys, f)));
+
+        /// <summary>
         /// Returns sequence of overlapping pairs of elements in given sequence.
         /// Example: <c>[1, 2, 3, 4, 5] => [[1, 2], [2, 3], [3, 4], [4, 5]]</c>
         /// </summary>


added api to delete account

added api to delete account

--- KryptPadWebApp/Controllers/AccountApiController.cs
+++ KryptPadWebApp/Controllers/AccountApiController.cs
@@ -247,6 +247,36 @@
         }

         /// <summary>
+        /// Deletes the user's account
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("Delete-Account")]
+        [Authorize]
+        public async Task<IHttpActionResult> DeleteAccount()
+        {
+            // Find user by id
+            var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
+            if (user != null)
+            {
+
+                await UserManager.DeleteAsync(user);
+
+                // Send the email
+                await UserManager.SendEmailAsync(userId, "Your account has been deleted", "You're account has been successfully deleted. If you did not initiate this. Conact support immediately.");
+
+                // All is ok
+                return Ok();
+            }
+            else
+            {
+                return BadRequest("User does not exist.");
+            }
+
+
+        }
+
+        /// <summary>
         /// This method does nothing except return OK (200)
         /// </summary>
         /// <returns></returns>


Utilize TestCaseData and have a bit more type safety

--- Leaf/Leaf.Tests/IO/EndianAwareBinaryReaderTests.cs
+++ Leaf/Leaf.Tests/IO/EndianAwareBinaryReaderTests.cs
@@ -1,10 +1,9 @@
 using System;
-using System.Collections;
+using System.Collections.Generic;
 using System.IO;
 using System.Text;
 using Leaf.IO;
 using NUnit.Framework;
-using System.Linq;
 using static System.Linq.Enumerable;

 namespace Leaf.Tests.IO
@@ -119,163 +118,163 @@
         [Test(Description =
             "Check that a decimal value can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(DecimalTestCases))]
-        public void ReadDecimalNoFlipTest(decimal value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadDecimal(), Is.EqualTo(value));
+        public decimal ReadDecimalNoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadDecimal();
         }

         [Test(Description =
             "Check that a decimal value can be read when the stream is in the opposite endian as the system's.")]
         [TestCaseSource(nameof(DecimalFlipTestCases))]
-        public void ReadDecimalFlipTest(decimal value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadDecimal(), Is.EqualTo(value));
+        public decimal ReadDecimalFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadDecimal();
         }

         [Test(Description =
             "Check that a single-precision floating-point value can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(SingleTestCases))]
-        public void ReadSingleNoFlipTest(float value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadSingle(), Is.EqualTo(value));
+        public float ReadSingleNoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadSingle();
         }

         [Test(Description =
             "Check that a single-precision floating-point value can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(SingleFlipTestCases))]
-        public void ReadSingleFlipTest(float value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadSingle(), Is.EqualTo(value));
+        public float ReadSingleFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadSingle();
         }

         [Test(Description =
             "Check that a double-precision floating-point value can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(DoubleTestCases))]
-        public void ReadDoubleNoFlipTest(double value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadDouble(), Is.EqualTo(value));
+        public double ReadDoubleNoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadDouble();
         }

         [Test(Description =
             "Check that a double-precision floating-point value can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(DoubleFlipTestCases))]
-        public void ReadDoubleFlipTest(double value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadDouble(), Is.EqualTo(value));
+        public double ReadDoubleFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadDouble();
         }

         [Test(Description =
             "Check that a 16-bit integer can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(Int16TestCases))]
-        public void ReadInt16NoFlipTest(short value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadInt16(), Is.EqualTo(value));
+        public short ReadInt16NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadInt16();
         }

         [Test(Description =
             "Check that a 16-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(Int16FlipTestCases))]
-        public void ReadInt16FlipTest(short value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadInt16(), Is.EqualTo(value));
+        public short ReadInt16FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadInt16();
         }

         [Test(Description =
             "Check that a 32-bit integer can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(Int32TestCases))]
-        public void ReadInt32NoFlipTest(int value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadInt32(), Is.EqualTo(value));
+        public int ReadInt32NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadInt32();
         }

         [Test(Description =
             "Check that a 32-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(Int32FlipTestCases))]
-        public void ReadInt32FlipTest(int value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadInt32(), Is.EqualTo(value));
+        public int ReadInt32FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadInt32();
         }

         [Test(Description =
             "Check that a 64-bit integer can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(Int64TestCases))]
-        public void ReadInt64NoFlipTest(long value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadInt64(), Is.EqualTo(value));
+        public long ReadInt64NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadInt64();
         }

         [Test(Description =
             "Check that a 64-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(Int64FlipTestCases))]
-        public void ReadInt64FlipTest(long value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadInt64(), Is.EqualTo(value));
+        public long ReadInt64FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadInt64();
         }

         [Test(Description =
             "Check that an unsigned 16-bit integer can be read when the stream is the same endian as the system's.")]
         [TestCaseSource(nameof(UInt16TestCases))]
-        public void ReadUInt16NoFlipTest(ushort value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadUInt16(), Is.EqualTo(value));
+        public ushort ReadUInt16NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadUInt16();
         }

         [Test(Description =
             "Check that an unsigned 16-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(UInt16FlipTestCases))]
-        public void ReadUInt16FlipTest(ushort value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadUInt16(), Is.EqualTo(value));
+        public ushort ReadUInt16FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadUInt16();
         }

         [Test(Description =
             "Check that an unsigned 32-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(UInt32TestCases))]
-        public void ReadUInt32NoFlipTest(uint value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadUInt32(), Is.EqualTo(value));
+        public uint ReadUInt32NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadUInt32();
         }

         [Test(Description =
             "Check that an unsigned 32-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(UInt32FlipTestCases))]
-        public void ReadUInt32FlipTest(uint value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadUInt32(), Is.EqualTo(value));
+        public uint ReadUInt32FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadUInt32();
         }

         [Test(Description =
             "Check that an unsigned 64-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(UInt64TestCases))]
-        public void ReadUInt64NoFlipTest(ulong value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes))
-                Assert.That(reader.ReadUInt64(), Is.EqualTo(value));
+        public ulong ReadUInt64NoFlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes))
+                return reader.ReadUInt64();
         }

         [Test(Description =
             "Check that an unsigned 64-bit integer can be read when the stream is the opposite endian as the system's.")]
         [TestCaseSource(nameof(UInt64FlipTestCases))]
-        public void ReadUInt64FlipTest(ulong value, byte[] bytes)
-        {
-            using (var reader = PrepareReader(bytes, true))
-                Assert.That(reader.ReadUInt64(), Is.EqualTo(value));
+        public ulong ReadUInt64FlipTest(byte[] bytes)
+        {
+            using (var reader = PrepareReader(bytes, true))
+                return reader.ReadUInt64();
         }

         private static EndianAwareBinaryReader PrepareReader(byte[] bytes, bool flip = false)
@@ -290,7 +289,7 @@
             decimal.Zero, decimal.One, decimal.MinusOne, decimal.MinValue, decimal.MaxValue
         };

-        private static IEnumerable DecimalTestCases()
+        private static IEnumerable<TestCaseData> DecimalTestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -299,11 +298,11 @@
             foreach (var value in values)
             {
                 var bytes = GetDecimalBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable DecimalFlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> DecimalFlipTestCases()
         {
             return FlipTestCaseBytes(DecimalTestCases());
         }
@@ -314,7 +313,7 @@
             float.NaN, float.NegativeInfinity, float.PositiveInfinity
         };

-        private static IEnumerable SingleTestCases()
+        private static IEnumerable<TestCaseData> SingleTestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -323,11 +322,11 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable SingleFlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> SingleFlipTestCases()
         {
             return FlipTestCaseBytes(SingleTestCases());
         }
@@ -338,7 +337,7 @@
             double.NaN, double.NegativeInfinity, double.PositiveInfinity
         };

-        private static IEnumerable DoubleTestCases()
+        private static IEnumerable<TestCaseData> DoubleTestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -347,18 +346,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable DoubleFlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> DoubleFlipTestCases()
         {
             return FlipTestCaseBytes(DoubleTestCases());
         }

         private static readonly short[] SpecialInt16Values = {0, short.MinValue, short.MaxValue};

-        private static IEnumerable Int16TestCases()
+        private static IEnumerable<TestCaseData> Int16TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -367,18 +366,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable Int16FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> Int16FlipTestCases()
         {
             return FlipTestCaseBytes(Int16TestCases());
         }

         private static readonly int[] SpecialInt32Values = {0, int.MinValue, int.MaxValue};

-        private static IEnumerable Int32TestCases()
+        private static IEnumerable<TestCaseData> Int32TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -387,18 +386,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable Int32FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> Int32FlipTestCases()
         {
             return FlipTestCaseBytes(Int32TestCases());
         }

         private static readonly long[] SpecialInt64Values = {0, long.MinValue, long.MaxValue};

-        private static IEnumerable Int64TestCases()
+        private static IEnumerable<TestCaseData> Int64TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -407,18 +406,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable Int64FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> Int64FlipTestCases()
         {
             return FlipTestCaseBytes(Int64TestCases());
         }

         private static readonly ushort[] SpecialUInt16Values = {0, ushort.MinValue, ushort.MaxValue};

-        private static IEnumerable UInt16TestCases()
+        private static IEnumerable<TestCaseData> UInt16TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -427,18 +426,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable UInt16FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> UInt16FlipTestCases()
         {
             return FlipTestCaseBytes(UInt16TestCases());
         }

         private static readonly uint[] SpecialUInt32Values = {0, uint.MinValue, uint.MaxValue};

-        private static IEnumerable UInt32TestCases()
+        private static IEnumerable<TestCaseData> UInt32TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -447,18 +446,18 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable UInt32FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> UInt32FlipTestCases()
         {
             return FlipTestCaseBytes(UInt32TestCases());
         }

         private static readonly ulong[] SpecialUInt64Values = {0, ulong.MinValue, ulong.MaxValue};

-        private static IEnumerable UInt64TestCases()
+        private static IEnumerable<TestCaseData> UInt64TestCases()
         {
             var randomizer = TestContext.CurrentContext.Random;
             var values = Range(0, Constants.RandomTestCount)
@@ -467,21 +466,21 @@
             foreach (var value in values)
             {
                 var bytes = BitConverter.GetBytes(value);
-                yield return new object[] {value, bytes};
-            }
-        }
-
-        private static IEnumerable UInt64FlipTestCases()
+                yield return new TestCaseData(bytes).Returns(value);
+            }
+        }
+
+        private static IEnumerable<TestCaseData> UInt64FlipTestCases()
         {
             return FlipTestCaseBytes(UInt64TestCases());
         }

-        private static IEnumerable FlipTestCaseBytes(IEnumerable sets)
-        {
-            foreach (object[] args in sets)
-            {
-                FlipByteArray((byte[])args[1]);
-                yield return args;
+        private static IEnumerable<TestCaseData> FlipTestCaseBytes(IEnumerable<TestCaseData> sets)
+        {
+            foreach (var caseData in sets)
+            {
+                FlipByteArray((byte[])caseData.Arguments[0]);
+                yield return caseData;
             }
         }


fixed transaction name case being ignored

--- Maileon/Transactions/MaileonTransactionsService.cs
+++ Maileon/Transactions/MaileonTransactionsService.cs
@@ -164,7 +164,7 @@
             {
                 foreach (TransactionType type in page.Items)
                 {
-                    if (type.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase))
+                    if (type.Name.Equals(name, StringComparison.InvariantCulture))
                     {
                         return type.Id.Value;
                     }


fixing parsing and tests

fixing parsing and tests

--- MatterControl.Printing/Settings/PrinterSettings.cs
+++ MatterControl.Printing/Settings/PrinterSettings.cs
@@ -1071,7 +1071,7 @@
 					MigrateProbeOffset(settings.OemLayer);
 				}

-				// if we have not copied the oem layer settigns key
+				// if we have not copied the oem layer settings key
 				if (settings.OemLayer.ContainsKey("z_probe_z_offset"))
 				{
 					MigrateProbeOffset(settings.UserLayer);
@@ -1084,19 +1084,32 @@
 			{
 				var valueAsVector3 = new Vector3();
 				// read it out of the legacy data
-				valueAsVector3.Z = -agg_basics.ParseDouble(settingsLayer["z_probe_z_offset"], false);
-				var probeXyOffset = settingsLayer["z_probe_xy_offset"];
-				if (!string.IsNullOrEmpty(probeXyOffset))
-				{
-					var split = probeXyOffset.Split(',');
-					if (split.Length == 2)
-					{
-						valueAsVector3.X = agg_basics.ParseDouble(split[0], false);
-						valueAsVector3.Y = agg_basics.ParseDouble(split[1], false);
-					}
-				}
-
-				settingsLayer[SettingsKey.probe_offset] = $"{valueAsVector3.X},{valueAsVector3.Y},{valueAsVector3.Z}";
+				double.TryParse(settingsLayer["z_probe_z_offset"], out valueAsVector3.Z);
+				// and negate it as it was stored in the opposite direction before
+				valueAsVector3.Z = -valueAsVector3.Z;
+				if (settingsLayer.ContainsKey("z_probe_xy_offset"))
+				{
+					var probeXyOffset = settingsLayer["z_probe_xy_offset"];
+					if (!string.IsNullOrEmpty(probeXyOffset))
+					{
+						var split = probeXyOffset.Split(',');
+						if (split.Length == 2)
+						{
+							double.TryParse(split[0], out valueAsVector3.X);
+							double.TryParse(split[1], out valueAsVector3.Y);
+						}
+					}
+				}
+
+				var newValue = $"{valueAsVector3.X},{valueAsVector3.Y},{valueAsVector3.Z}";
+				if (!settingsLayer.ContainsKey(SettingsKey.probe_offset))
+				{
+					settingsLayer.Add(SettingsKey.probe_offset, newValue);
+				}
+				else
+				{
+					settingsLayer[SettingsKey.probe_offset] = newValue;
+				}

 				// clear it
 				settingsLayer.Remove("z_probe_z_offset");


Only recover MaterialSettingsKeys if ActiveMaterialKey unset

--- MatterControl.Printing/Settings/PrinterSettings.cs
+++ MatterControl.Printing/Settings/PrinterSettings.cs
@@ -1037,8 +1037,9 @@
 				// Deserialize using default serializer
 				var settings = jObject.ToObject<PrinterSettings>();

-				// Look for and import retired MaterialSettingsKeys property
-				if (jObject["MaterialSettingsKeys"] is JArray materialSettingsKeys
+				// Look for and import retired MaterialSettingsKeys property if ActiveMaterialKey unset
+				if (string.IsNullOrWhiteSpace(settings.ActiveMaterialKey)
+					&& jObject["MaterialSettingsKeys"] is JArray materialSettingsKeys
 					&& materialSettingsKeys.Count > 0)
 				{
 					string firstValue = materialSettingsKeys[0].Value<string>();


Ensure toggle widget observes active state

--- MatterControlLib/ActionBar/TemperatureWidgetBed.cs
+++ MatterControlLib/ActionBar/TemperatureWidgetBed.cs
@@ -94,7 +94,7 @@
 				menuTheme,
 				new SettingsItem.ToggleSwitchConfig()
 				{
-					Checked = false,
+					Checked = printer.Connection.TargetBedTemperature > 0,
 					ToggleAction = (itemChecked) =>
 					{
 						var goalTemp = itemChecked ? printer.Settings.GetValue<double>(SettingsKey.bed_temperature) : 0;


Return exit code 1 in case of error

Return exit code 1 in case of error

--- NetLicensingClient-demo/NetLicensingClient-demo.cs
+++ NetLicensingClient-demo/NetLicensingClient-demo.cs
@@ -259,6 +259,7 @@

                 #endregion

+                Console.WriteLine("All done.");
             }
             catch (NetLicensingException e)
             {
@@ -284,6 +285,8 @@
                     }
                     // delete test product with all its related items
                     ProductService.delete(context, demoProductNumber, true);
+
+                    Environment.Exit(1);
                 }
                 catch (NetLicensingException e)
                 {
@@ -296,10 +299,6 @@
                     Console.WriteLine(e);
                 }
             }
-
-            Console.WriteLine("All done.");
-            // Console.WriteLine("Press <Enter> to exit...");
-            // Console.ReadLine();
         }
     }
 }


cleanup

cleanup

--- Node/Node/Timers/TrySendJobDetailToManagerTimer.cs
+++ Node/Node/Timers/TrySendJobDetailToManagerTimer.cs
@@ -62,18 +62,7 @@
 				}
 			}
 		}
-
-		//only used by test
-		public int TotalNumberOfJobProgresses(Guid jobId)
-		{
-			if (_jobDetails == null || _jobDetails.Count == 0)
-			{
-				return 0;
-			}
-			return _jobDetails.Count(pair => pair.Value.JobId == jobId);
-		}

-
 		public bool HasAllProgressesBeenSent(Guid jobId)
 		{
 			if (_jobDetails == null)
@@ -84,20 +73,6 @@
 			var allSent =
 				_jobDetails.Values.Count(model => model.JobId == jobId) == 0;

-			return allSent;
-		}
-
-		//only used by test
-		public bool HasAllProgressesBeenSent()
-		{
-
-			if (_jobDetails == null)
-			{
-				return true;
-			}
-
-			var allSent = _jobDetails.Values.Count == 0;
-
 			return allSent;
 		}

@@ -155,7 +130,6 @@
 		private void OnTimedEvent(object sender, ElapsedEventArgs e)
 		{
 			Stop();
-
 			try
 			{
 				TrySendJobProgress();
@@ -167,10 +141,8 @@
 			}
 		}

-		public void SendProgress(Guid jobid,
-		                         string progressMessage)
+		public void SendProgress(Guid jobid, string progressMessage)
 		{
-
 			var progressModel = new JobDetailEntity
 			{
 				JobId = jobid,
@@ -191,10 +163,33 @@
 			base.Dispose(disposing);
 		}

+
+		//-------------------
 		//only used by test
+		//-------------------
+
 		public int TotalNumberOfJobProgresses()
 		{
 			return _jobDetails.Count;
 		}
+
+		public bool HasAllProgressesBeenSent()
+		{
+			if (_jobDetails == null)
+			{
+				return true;
+			}
+			var allSent = _jobDetails.Values.Count == 0;
+			return allSent;
+		}
+
+		public int TotalNumberOfJobProgresses(Guid jobId)
+		{
+			if (_jobDetails == null || _jobDetails.Count == 0)
+			{
+				return 0;
+			}
+			return _jobDetails.Count(pair => pair.Value.JobId == jobId);
+		}
 	}
 }


Send default inventory along with the normal inventory since the viewer wants to reject all sending of default inventory properly...

--- OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -264,7 +264,7 @@

             try
             {
-                inventData = GetInventorySkeleton(invSkel);
+                inventData = GetInventorySkeleton(libService, invService, invSkel);
             }
             catch (Exception e)
             {
@@ -729,7 +729,7 @@
             return buddylistreturn;
         }

-        private InventoryData GetInventorySkeleton(List<InventoryFolderBase> folders)
+        private InventoryData GetInventorySkeleton(ILibraryService library, IInventoryService inventoryService, List<InventoryFolderBase> folders)
         {
             UUID rootID = UUID.Zero;
             ArrayList AgentInventoryArray = new ArrayList();
@@ -749,6 +749,31 @@
                 AgentInventoryArray.Add(TempHash);
             }

+            List<InventoryFolderBase> rootFolders = inventoryService.GetRootFolders(library.LibraryOwner);
+            Hashtable RootHash = new Hashtable();
+            RootHash["name"] = library.LibraryName;
+            RootHash["parent_id"] = UUID.Zero.ToString();
+            RootHash["version"] = (Int32)1;
+            RootHash["type_default"] = (Int32)9;
+            RootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
+            AgentInventoryArray.Add(RootHash);
+
+            List<UUID> rootFolderUUIDs = new List<UUID>();
+            foreach (InventoryFolderBase rootFolder in rootFolders)
+            {
+                if (rootFolder.Name != "My Inventory")
+                {
+                    rootFolderUUIDs.Add(rootFolder.ID);
+                }
+            }
+
+            if (rootFolderUUIDs.Count != 0)
+            {
+                foreach (UUID rootfolderID in rootFolderUUIDs)
+                {
+                    TraverseFolder(library.LibraryOwner, rootfolderID, inventoryService, true, ref AgentInventoryArray);
+                }
+            }
             return new InventoryData(AgentInventoryArray, rootID);

         }
@@ -762,9 +787,9 @@
             //Dictionary<UUID, InventoryFolderImpl> rootFolders = library.GetAllFolders();
             //m_log.DebugFormat("[LLOGIN]: Library has {0} folders", rootFolders.Count);
             //Dictionary<UUID, InventoryFolderImpl> rootFolders = new Dictionary<UUID,InventoryFolderImpl>();
-            List<InventoryFolderBase> rootFolders = invService.GetRootFolders(library.LibraryOwner);
             ArrayList folderHashes = new ArrayList();

+            /*List<InventoryFolderBase> rootFolders = invService.GetRootFolders(library.LibraryOwner);
             Hashtable TempHash = new Hashtable();
             TempHash["name"] = library.LibraryName;
             TempHash["parent_id"] = UUID.Zero.ToString();
@@ -788,7 +813,7 @@
             foreach (UUID rootID in rootFolderUUIDs)
             {
                 TraverseFolder(library.LibraryOwner, rootID, invService, true, ref folderHashes);
-            }
+            }*/
             return folderHashes;
         }

@@ -804,7 +829,7 @@
                 else
                     TempHash["parent_id"] = folder.ParentID.ToString();
                 TempHash["version"] = (Int32)folder.Version;
-                TempHash["type_default"] = (Int32)8;
+                TempHash["type_default"] = (Int32)folder.Type;
                 TempHash["folder_id"] = folder.ID.ToString();
                 table.Add(TempHash);
                 TraverseFolder(agentID, folder.ID, invService, false, ref table);


Making urls not work with cross streets reg

--- PokemonGoRaidBot/Services/Parsing/MessageParser.cs
+++ PokemonGoRaidBot/Services/Parsing/MessageParser.cs
@@ -545,12 +545,14 @@
             if (endReg.IsMatch(message))
                 return endReg.Match(message).Groups[1].Value;

+            var urlReg = Language.RegularExpressions["url"];
             var crossStreetsReg = Language.RegularExpressions["locationCrossStreets"]; //pretty reliable but can have some missed matches
             if (crossStreetsReg.IsMatch(message))
             {
                 var groups = crossStreetsReg.Match(message).Groups;

-                return groups[1].Value.Replace(groups[3].Value, $" {Language.Strings["and"]} ");
+                if(!urlReg.IsMatch(groups[1].Value))
+                    return groups[1].Value.Replace(groups[3].Value, $" {Language.Strings["and"]} ");
             }

             var startReg = Language.CombineRegex(" ", "locationStartPre", "locationStart");//basically "at [foo] [bar].


Add some more tests for the [ObjectLiteral] Equals handling

--- ProductiveRage.Immutable.Extensions.Tests/Tests.cs
+++ ProductiveRage.Immutable.Extensions.Tests/Tests.cs
@@ -17,6 +17,15 @@
 			ToStringTests();
 			EqualsTests();
 			DictionaryTests();
+
+			// TODO:
+			//  x 0. ToString()
+			//  x 1. String interpolation
+			//  x 2. String concatenation
+			//  x 3. Equals
+			//  x 4. Equals for returning false - both different values and different types
+			//    5. Optional<NonBlankTrimmedString> Equals
+			//    6. Optional<NonBlankTrimmedString> Equals for returning false
 		}

 		private static void ToStringTests()
@@ -41,26 +50,47 @@
 			QUnit.Test("An instance of NonBlankTrimmedString is found to be equal to itself", assert =>
 			{
 				var x = new NonBlankTrimmedString("xyz");
-				AssertEqualsViaNonBlankTrimmedStringEqualsCall(assert, x, x);
+				AssertEqualsViaNonBlankTrimmedStringEqualsCall(assert, x, x, shouldBeEqual: true);
 			});
+
 			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are found to be equal when compared as NonBlankTrimmedString", assert =>
 			{
 				var x = new NonBlankTrimmedString("xyz");
 				var y = new NonBlankTrimmedString("xyz");
-				AssertEqualsViaNonBlankTrimmedStringEqualsCall(assert, x, y);
+				AssertEqualsViaNonBlankTrimmedStringEqualsCall(assert, x, y, shouldBeEqual: true);
 			});
 			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are found to be equal when compared as generic type param of NonBlankTrimmedString", assert =>
 			{
 				var x = new NonBlankTrimmedString("xyz");
 				var y = new NonBlankTrimmedString("xyz");
-				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y);
+				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y, shouldBeEqual: true);
 			});
 			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are found to be equal when compared as Object", assert =>
 			{
 				var x = new NonBlankTrimmedString("xyz");
 				var y = new NonBlankTrimmedString("xyz");
-				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y);
+				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y, shouldBeEqual: true);
 			});
+
+			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are NOT equal if they are of different types when compared as NonBlankTrimmedString", assert =>
+			{
+				var x = new NonBlankTrimmedString("xyz");
+				var y = new ClassName("xyz");
+				AssertEqualsViaNonBlankTrimmedStringEqualsCall(assert, x, y, shouldBeEqual: false);
+			});
+			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are NOT equal if they are of different types when compared as generic type param of NonBlankTrimmedString", assert =>
+			{
+				var x = new NonBlankTrimmedString("xyz");
+				var y = new ClassName("xyz");
+				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y, shouldBeEqual: false);
+			});
+			QUnit.Test("Two instances of NonBlankTrimmedString with the same value are NOT equal if they are of different types when compared as Object", assert =>
+			{
+				var x = new NonBlankTrimmedString("xyz");
+				var y = new ClassName("xyz");
+				AssertEqualsViaSharedGenericTypeEqualsCall(assert, x, y, shouldBeEqual: false);
+			});
+
 		}

 		private static void DictionaryTests()
@@ -78,31 +108,43 @@
 			});
 		}

-		private static void AssertEqualsViaObjectEqualsCall(Assert assert, object x, object y)
+		private static void AssertEqualsViaObjectEqualsCall(Assert assert, object x, object y, bool shouldBeEqual)
 		{
 			if ((x == null) && (y == null))
 				return;

 			assert.Ok((x != null) && (y != null), "Unless both x and y are null, they must both NOT be null in order to be equal");
-			assert.Ok(x.Equals(y));
+			var result = x.Equals(y);
+			if (shouldBeEqual)
+				assert.Ok(x.Equals(y));
+			else
+				assert.NotOk(x.Equals(y));
 		}

-		private static void AssertEqualsViaNonBlankTrimmedStringEqualsCall(Assert assert, NonBlankTrimmedString x, NonBlankTrimmedString y)
+		private static void AssertEqualsViaNonBlankTrimmedStringEqualsCall(Assert assert, NonBlankTrimmedString x, NonBlankTrimmedString y, bool shouldBeEqual)
 		{
 			if ((x == null) && (y == null))
 				return;

 			assert.Ok((x != null) && (y != null), "Unless both x and y are null, they must both NOT be null in order to be equal");
-			assert.Ok(x.Equals(y));
+			var result = x.Equals(y);
+			if (shouldBeEqual)
+				assert.Ok(x.Equals(y));
+			else
+				assert.NotOk(x.Equals(y));
 		}

-		private static void AssertEqualsViaSharedGenericTypeEqualsCall<T>(Assert assert, T x, T y) where T : NonBlankTrimmedString
+		private static void AssertEqualsViaSharedGenericTypeEqualsCall<T>(Assert assert, T x, T y, bool shouldBeEqual) where T : NonBlankTrimmedString
 		{
 			if ((x == null) && (y == null))
 				return;

 			assert.Ok((x != null) && (y != null), "Unless both x and y are null, they must both NOT be null in order to be equal");
-			assert.Ok(x.Equals(y));
+			var result = x.Equals(y);
+			if (shouldBeEqual)
+				assert.Ok(x.Equals(y));
+			else
+				assert.NotOk(x.Equals(y));
 		}

 		// This class is part of the second reproduce case in https://forums.bridge.net/forum/community/help/6001


Fix GoPrtg WriteColorOutput to be compatible with Linux/macOS

--- PrtgAPI.PowerShell/PowerShell/Base/GoPrtgCmdlet.cs
+++ PrtgAPI.PowerShell/PowerShell/Base/GoPrtgCmdlet.cs
@@ -73,18 +73,17 @@

         internal void WriteColorOutput(string message, ConsoleColor color)
         {
-            var initialColor = Host.UI.RawUI.ForegroundColor;
-
-            if ((int)initialColor != -1)
-            {
-                Host.UI.RawUI.ForegroundColor = color;
-            }
-
-            WriteObject(message);
-
-            if ((int)initialColor != -1)
-            {
-                Host.UI.RawUI.ForegroundColor = initialColor;
+            ConsoleColor fg = Host.UI.RawUI.ForegroundColor;
+
+            Host.UI.RawUI.ForegroundColor = color;
+
+            try
+            {
+                WriteObject(message);
+            }
+            finally
+            {
+                Host.UI.RawUI.ForegroundColor = fg;
             }
         }


minor - cleaned up unused namespaces

minor - cleaned up unused namespaces

--- RxExamples/NotificationPatterns/UnalteredStream.cs
+++ RxExamples/NotificationPatterns/UnalteredStream.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Reactive.Linq;
 using System.Reactive.Subjects;
-using System.Windows.Forms;

 namespace RxExamples.NotificationPatterns
 {


[CFM_310] Call in the Finishers

[CFM_310] Call in the Finishers

--- SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
+++ SabberStoneCore/CardSets/Standard/GangsCardsGen.cs
@@ -1296,11 +1296,10 @@
 			// - REQ_NUM_MINION_SLOTS = 1
 			// --------------------------------------------------------
 			cards.Add("CFM_310", new List<Enchantment> {
-				// TODO [CFM_310] Call in the Finishers && Test: Call in the Finishers_CFM_310
-				new Enchantment
-				{
-					Activation = EnchantmentActivation.SPELL,
-					SingleTask = null,
+				new Enchantment
+				{
+					Activation = EnchantmentActivation.SPELL,
+					SingleTask = new EnqueueTask(4, new SummonTask("CFM_310t")),
 				},
 			});


Fix license header

Fix license header

--- osu.Framework.Tests/Threading/SchedulerTest.cs
+++ osu.Framework.Tests/Threading/SchedulerTest.cs
@@ -1,5 +1,5 @@
-// Copyright (c) 2007-2019 ppy Pty Ltd <contact@ppy.sh>.
-// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.

 using System;
 using System.Threading;


Add back missing beatmap results button

Add back missing beatmap results button

--- osu.Game/Screens/Multi/Match/MatchSubScreen.cs
+++ osu.Game/Screens/Multi/Match/MatchSubScreen.cs
@@ -11,6 +11,7 @@
 using osu.Framework.Screens;
 using osu.Game.Audio;
 using osu.Game.Beatmaps;
+using osu.Game.Graphics.UserInterface;
 using osu.Game.Online.API;
 using osu.Game.Online.Multiplayer;
 using osu.Game.Online.Multiplayer.GameTypes;
@@ -118,10 +119,36 @@
                                                         {
                                                             RelativeSizeAxes = Axes.Both,
                                                             Padding = new MarginPadding { Right = 5 },
-                                                            Child = new OverlinedPlaylist(true) // Temporarily always allow selection
+                                                            Child = new GridContainer
                                                             {
                                                                 RelativeSizeAxes = Axes.Both,
-                                                                SelectedItem = { BindTarget = SelectedItem }
+                                                                Content = new[]
+                                                                {
+                                                                    new Drawable[]
+                                                                    {
+                                                                        new OverlinedPlaylist(true) // Temporarily always allow selection
+                                                                        {
+                                                                            RelativeSizeAxes = Axes.Both,
+                                                                            SelectedItem = { BindTarget = SelectedItem }
+                                                                        }
+                                                                    },
+                                                                    null,
+                                                                    new Drawable[]
+                                                                    {
+                                                                        new TriangleButton
+                                                                        {
+                                                                            RelativeSizeAxes = Axes.X,
+                                                                            Text = "Show beatmap results",
+                                                                            Action = showBeatmapResults
+                                                                        }
+                                                                    }
+                                                                },
+                                                                RowDimensions = new[]
+                                                                {
+                                                                    new Dimension(),
+                                                                    new Dimension(GridSizeMode.Absolute, 5),
+                                                                    new Dimension(GridSizeMode.AutoSize)
+                                                                }
                                                             }
                                                         },
                                                         new Container


added ChildcareAI

added ChildcareAI

added EldercareAI
added MarketAI

--- ServiceRadiusAdjuster/Service/GameEngineService.cs
+++ ServiceRadiusAdjuster/Service/GameEngineService.cs
@@ -158,6 +158,15 @@
                         break;
                     case LibraryAI libraryAi:
                         educationOptionItems.Add(new OptionItem(ServiceType.Building, bi.name, bi.GetUncheckedLocalizedTitle(), libraryAi.m_libraryAccumulation, libraryAi.m_libraryAccumulation, libraryAi.m_libraryRadius, libraryAi.m_libraryRadius));
+                        break;
+                    case ChildcareAI childcareAI:
+                        healthCareOptionItems.Add(new OptionItem(ServiceType.Building, bi.name, bi.GetUncheckedLocalizedTitle(), childcareAI.m_healthCareAccumulation, childcareAI.m_healthCareAccumulation, childcareAI.m_healthCareRadius, childcareAI.m_healthCareRadius));
+                        break;
+                    case EldercareAI eldercareAI:
+                        healthCareOptionItems.Add(new OptionItem(ServiceType.Building, bi.name, bi.GetUncheckedLocalizedTitle(), eldercareAI.m_healthCareAccumulation, eldercareAI.m_healthCareAccumulation, eldercareAI.m_healthCareRadius, eldercareAI.m_healthCareRadius));
+                        break;
+                    case MarketAI marketAI:
+                        healthCareOptionItems.Add(new OptionItem(ServiceType.Building, bi.name, bi.GetUncheckedLocalizedTitle(), marketAI.m_healthCareAccumulation, marketAI.m_healthCareAccumulation, marketAI.m_healthCareRadius, marketAI.m_healthCareRadius));
                         break;
                 }
             }
@@ -422,6 +431,18 @@
                         return Result.Ok<Maybe<OptionItemDefaultValues>>(
                             new OptionItemDefaultValues(systemName, libraryAi.m_libraryAccumulation, libraryAi.m_libraryRadius)
                         );
+                    case ChildcareAI childcareAI:
+                        return Result.Ok<Maybe<OptionItemDefaultValues>>(
+                            new OptionItemDefaultValues(systemName, childcareAI.m_healthCareAccumulation, childcareAI.m_healthCareAccumulation)
+                        );
+                    case EldercareAI eldercareAI:
+                        return Result.Ok<Maybe<OptionItemDefaultValues>>(
+                            new OptionItemDefaultValues(systemName, eldercareAI.m_healthCareAccumulation, eldercareAI.m_healthCareAccumulation)
+                        );
+                    case MarketAI martketAI:
+                        return Result.Ok<Maybe<OptionItemDefaultValues>>(
+                            new OptionItemDefaultValues(systemName, martketAI.m_healthCareAccumulation, martketAI.m_healthCareAccumulation)
+                        );
                     default:
                         return Result.Fail<Maybe<OptionItemDefaultValues>>(
                             $"Can't handle ai of type '{ai.GetType().FullName}'."
@@ -621,6 +642,18 @@
                     libraryAi.m_libraryAccumulation = optionItem.Accumulation.Value;
                     libraryAi.m_libraryRadius = optionItem.Radius.Value;
                     break;
+                case ChildcareAI childcareAi:
+                    childcareAi.m_healthCareAccumulation = optionItem.Accumulation.Value;
+                    childcareAi.m_healthCareRadius = optionItem.Radius.Value;
+                    break;
+                case EldercareAI eldercareAi:
+                    eldercareAi.m_healthCareAccumulation = optionItem.Accumulation.Value;
+                    eldercareAi.m_healthCareRadius = optionItem.Radius.Value;
+                    break;
+                case MarketAI marketAi:
+                    marketAi.m_healthCareAccumulation = optionItem.Accumulation.Value;
+                    marketAi.m_healthCareRadius = optionItem.Radius.Value;
+                    break;
                 default:
                     return; //Unknown AI is ok, just not supported.
             }


fix EvalEmbedded to support CS8 compiling

--- Signum.Entities.Extensions/Dynamic/EvalEmbedded.cs
+++ Signum.Entities.Extensions/Dynamic/EvalEmbedded.cs
@@ -73,10 +73,10 @@
                 {
                     try
                     {
-                        var tree = SyntaxFactory.ParseSyntaxTree(code);
+                        var tree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharpParseOptions(LanguageVersion.CSharp8));

                         var compilation = CSharpCompilation.Create($"{Guid.NewGuid()}.dll")
-                         .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
+                         .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.Enable))
                          .AddReferences(references)
                          .AddSyntaxTrees(tree);


dank shopping

dank shopping

--- SimpleYetSoSharpBot/SimpleYetSoSharpBot/Program.cs
+++ SimpleYetSoSharpBot/SimpleYetSoSharpBot/Program.cs
@@ -366,7 +366,7 @@
                     boughtItemThree = true;
                     boughtItemTwo = false;
                 }
-                if (Utility.InShopRange() && ObjectManager.Player.Gold > 2800 && !boughtItemThree)
+                if (Utility.InShopRange() && ObjectManager.Player.Gold > 2800)
                 {
                     Packet.C2S.BuyItem.Encoded(new Packet.C2S.BuyItem.Struct(3027)).Send();
                     Game.PrintChat("Buying RoA");