Reorganized BenchmarkerTests

Reorganized BenchmarkerTests

--- src/NBenchmarker/NBenchmarker.Tests/BenchmarkerTests.cs
+++ src/NBenchmarker/NBenchmarker.Tests/BenchmarkerTests.cs
@@ -19,144 +19,152 @@
             result = new BenchmarkResult("");
         }

-        [TestMethod]
-        public void BenchmarkExecutesTrialActionsInSequence()
+        [TestClass]
+        public class TheRunMethod : BenchmarkerTests
         {
-            benchmarker.Run(trial);
+            [TestMethod]
+            public void ExecutesTrialActionsInSequence()
+            {
+                benchmarker.Run(trial);

-            Assert.AreEqual("12345", trial.CallOrder);
+                Assert.AreEqual("12345", trial.CallOrder);
+            }
+
+            [TestMethod]
+            public void RecordsStopwatchElapsedTimeInResult()
+            {
+                trial.SetElapsedTime(TimeSpan.FromSeconds(1));
+
+                var result = benchmarker.Run(trial);
+
+                Assert.AreEqual(TimeSpan.FromSeconds(1), result.ElapsedTime);
+            }
+
+            [TestMethod]
+            public void AddsIterationToResult()
+            {
+                var wasCalled = false;
+                trial.AfterEachIteration = result =>
+                {
+                    Assert.AreEqual(1, result.NumberOfIterations);
+                    wasCalled = true;
+                };
+
+                benchmarker.Run(trial);
+
+                Assert.IsTrue(wasCalled);
+            }
+
+            [TestMethod]
+            public void SetsElapsedTimeEachIteration()
+            {
+                var wasCalled = false;
+                trial.SetElapsedTime(TimeSpan.FromSeconds(1));
+                trial.AfterEachIteration = result =>
+                {
+                    Assert.AreEqual(TimeSpan.FromSeconds(1), result.ElapsedTime);
+                    wasCalled = true;
+                };
+
+                benchmarker.Run(trial);
+
+                Assert.IsTrue(wasCalled);
+            }
+
+            [TestMethod]
+            public void ExecutesStopwatchInSequence()
+            {
+                benchmarker.Run(trial);
+
+                var stopwatch = (Fakes.FakeStopwatch)trial.Stopwatch;
+                Assert.AreEqual("1323", stopwatch.CallOrder);
+            }
+
+            [TestMethod]
+            public void IteratesOneTimeByDefault()
+            {
+                var result = benchmarker.Run(trial);
+
+                Assert.AreEqual(1, result.NumberOfIterations);
+            }
+
+            [TestMethod]
+            public void ReturnsResultForEachTrial()
+            {
+                var trial1 = new Fakes.FakeTrial("1");
+                var trial2 = new Fakes.FakeTrial("2");
+                var trial3 = new Fakes.FakeTrial("3");
+
+                var results = benchmarker.Run(trial1, trial2, trial3);
+
+                Assert.AreEqual(3, results.Count);
+                Assert.AreEqual("1", results[0].TrialName);
+                Assert.AreEqual("2", results[1].TrialName);
+                Assert.AreEqual("3", results[2].TrialName);
+            }
+
+            [TestMethod]
+            public void AllowEnumerableOfTrialsToBeRun()
+            {
+                var trial1 = new Fakes.FakeTrial("1");
+                var trial2 = new Fakes.FakeTrial("2");
+                var trial3 = new Fakes.FakeTrial("3");
+                IEnumerable<Trial> trials = new Trial[] { trial1, trial2, trial3 };
+
+                var results = benchmarker.Run(trials);
+
+                Assert.AreEqual(3, results.Count);
+            }
         }

-        [TestMethod]
-        public void ResultRecordsStopwatchElapsedTime()
+        [TestClass]
+        public class TheShouldContinueMethod : BenchmarkerTests
         {
-            trial.SetElapsedTime(TimeSpan.FromSeconds(1));
+            [TestMethod]
+            public void ContinuesForOneIterationByDefault()
+            {
+                Assert.IsTrue(benchmarker.ShouldContinue(result));

-            var result = benchmarker.Run(trial);
+                result.NumberOfIterations = 1;

-            Assert.AreEqual(TimeSpan.FromSeconds(1), result.ElapsedTime);
-        }
+                Assert.IsFalse(benchmarker.ShouldContinue(result));
+            }

-        [TestMethod]
-        public void AddsIterationToResult()
-        {
-            var wasCalled = false;
-            trial.AfterEachIteration = result =>
+            [TestMethod]
+            public void IfConstraintIsAddedContinuesAccordingToNew()
             {
-                Assert.AreEqual(1, result.NumberOfIterations);
-                wasCalled = true;
-            };
+                result.NumberOfIterations = 1;

-            benchmarker.Run(trial);
+                Assert.IsFalse(benchmarker.ShouldContinue(result));

-            Assert.IsTrue(wasCalled);
-        }
+                benchmarker.AddConstraint(new NumberOfIterationsConstraint(2));

-        [TestMethod]
-        public void SetsElapsedTimeEachIteration()
-        {
-            var wasCalled = false;
-            trial.SetElapsedTime(TimeSpan.FromSeconds(1));
-            trial.AfterEachIteration = result =>
+                Assert.IsTrue(benchmarker.ShouldContinue(result));
+            }
+
+            [TestMethod]
+            public void ContinueWithNumberOfIterationsConstraint()
             {
-                Assert.AreEqual(TimeSpan.FromSeconds(1), result.ElapsedTime);
-                wasCalled = true;
-            };
+                benchmarker.AddConstraint(new NumberOfIterationsConstraint(2));

-            benchmarker.Run(trial);
+                result.NumberOfIterations = 1;
+                Assert.IsTrue(benchmarker.ShouldContinue(result));

-            Assert.IsTrue(wasCalled);
-        }
+                result.NumberOfIterations = 2;
+                Assert.IsFalse(benchmarker.ShouldContinue(result));
+            }

-        [TestMethod]
-        public void ExecutesStopwatchInSequence()
-        {
-            benchmarker.Run(trial);
+            [TestMethod]
+            public void ContinueWithSecondsConstraint()
+            {
+                benchmarker.AddConstraint(new SecondsConstraint(5));

-            var stopwatch = (Fakes.FakeStopwatch)trial.Stopwatch;
-            Assert.AreEqual("1323", stopwatch.CallOrder);
-        }
+                result.ElapsedTime = TimeSpan.FromSeconds(4.9);
+                Assert.IsTrue(benchmarker.ShouldContinue(result));

-        [TestMethod]
-        public void DefaultIteratesOneTime()
-        {
-            var result = benchmarker.Run(trial);
-
-            Assert.AreEqual(1, result.NumberOfIterations);
-        }
-
-        [TestMethod]
-        public void ContinuesForOneIterationByDefault()
-        {
-            Assert.IsTrue(benchmarker.ShouldContinue(result));
-
-            result.NumberOfIterations = 1;
-
-            Assert.IsFalse(benchmarker.ShouldContinue(result));
-        }
-
-        [TestMethod]
-        public void IfConstraintIsAddedContinuesAccordingToNew()
-        {
-            result.NumberOfIterations = 1;
-
-            Assert.IsFalse(benchmarker.ShouldContinue(result));
-
-            benchmarker.AddConstraint(new NumberOfIterationsConstraint(2));
-
-            Assert.IsTrue(benchmarker.ShouldContinue(result));
-        }
-
-        [TestMethod]
-        public void ContinueWithNumberOfIterationsConstraint()
-        {
-            benchmarker.AddConstraint(new NumberOfIterationsConstraint(2));
-
-            result.NumberOfIterations = 1;
-            Assert.IsTrue(benchmarker.ShouldContinue(result));
-
-            result.NumberOfIterations = 2;
-            Assert.IsFalse(benchmarker.ShouldContinue(result));
-        }
-
-        [TestMethod]
-        public void ContinueWithSecondsConstraint()
-        {
-            benchmarker.AddConstraint(new SecondsConstraint(5));
-
-            result.ElapsedTime = TimeSpan.FromSeconds(4.9);
-            Assert.IsTrue(benchmarker.ShouldContinue(result));
-
-            result.ElapsedTime = TimeSpan.FromSeconds(5.0);
-            Assert.IsFalse(benchmarker.ShouldContinue(result));
-        }
-
-        [TestMethod]
-        public void ReturnsResultForEachTrial()
-        {
-            var trial1 = new Fakes.FakeTrial("1");
-            var trial2 = new Fakes.FakeTrial("2");
-            var trial3 = new Fakes.FakeTrial("3");
-
-            var results = benchmarker.Run(trial1, trial2, trial3);
-
-            Assert.AreEqual(3, results.Count);
-            Assert.AreEqual("1", results[0].TrialName);
-            Assert.AreEqual("2", results[1].TrialName);
-            Assert.AreEqual("3", results[2].TrialName);
-        }
-
-        [TestMethod]
-        public void AllowEnumerableOfTrialsToBeRun()
-        {
-            var trial1 = new Fakes.FakeTrial("1");
-            var trial2 = new Fakes.FakeTrial("2");
-            var trial3 = new Fakes.FakeTrial("3");
-            IEnumerable<Trial> trials = new Trial[] { trial1, trial2, trial3 };
-
-            var results = benchmarker.Run(trials);
-
-            Assert.AreEqual(3, results.Count);
+                result.ElapsedTime = TimeSpan.FromSeconds(5.0);
+                Assert.IsFalse(benchmarker.ShouldContinue(result));
+            }
         }
     }
 }


Update src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs

Co-authored-by: David Zidar <031ab3b255c70d5271a861b75bc4458e2de4a1af@users.noreply.github.com>

--- src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
+++ src/OmniSharp.Shared/Options/RoslynExtensionsOptions.cs
@@ -12,9 +12,7 @@
         public bool EnableImportCompletion { get; set; }
         public bool EnableAsyncCompletion { get; set; }
         public int DocumentAnalysisTimeoutMs { get; set; } = 10 * 1000;
-        public int ThreadsToUseForAnalyzers { get; set; } = Environment.ProcessorCount == 1
-            ? 1
-            : Environment.ProcessorCount / 2;
+        public int AnalyzerThreadCount { get; set; } = Math.Max(1, Environment.ProcessorCount / 2);
     }

     public class OmniSharpExtensionsOptions


Fix formatting

Fix formatting

--- src/Orchard/ContentManagement/Handlers/StorageFilter.cs
+++ src/Orchard/ContentManagement/Handlers/StorageFilter.cs
@@ -30,8 +30,7 @@
             return _repository.Get(versionRecord.ContentItemRecord.Id);
         }

-        protected virtual TRecord CreateRecordCore(ContentItemVersionRecord versionRecord, TRecord record = null)
-        {
+        protected virtual TRecord CreateRecordCore(ContentItemVersionRecord versionRecord, TRecord record = null) {
             if (record == null) {
                 record = new TRecord();
             }


1353.1

--- src/PixelFarm/PixelFarm.Painter/3_Cpu_Blit/MemBitmap.cs
+++ src/PixelFarm/PixelFarm.Painter/3_Cpu_Blit/MemBitmap.cs
@@ -112,7 +112,7 @@
             public TempMemBitmapMonitor(string detail) => _detail = detail;
             public bool IsAlive() => _memBmp.IsAlive;
             public override string ToString() => _detail;
-            public bool InternalNativePtrIsFreed()
+            public bool InternalNativePtrIsReleased()
             {
                 if (_memBmp.IsAlive)
                 {
@@ -143,7 +143,7 @@
                         s_stbuilder.AppendLine((s_count++).ToString());
                         for (int i = _registerMemBmp.Count - 1; i >= 0; --i)
                         {
-                            if (!_registerMemBmp[i].IsAlive() || _registerMemBmp[i].InternalNativePtrIsFreed())
+                            if (!_registerMemBmp[i].IsAlive() || _registerMemBmp[i].InternalNativePtrIsReleased())
                             {
                                 //remove
                                 _registerMemBmp.RemoveAt(i);


Moved the inner if of the dequeuing while loop into the while statement.

--- src/Polly.Shared/CircuitBreaker/RollingHealthMetrics.cs
+++ src/Polly.Shared/CircuitBreaker/RollingHealthMetrics.cs
@@ -69,16 +69,8 @@
                 _windows.Enqueue(_currentWindow);
             }

-            while (_windows.Count > 0)
-            {
-                // If the time between now and when the window started is below the timesliceDuration
-                // then it and the rest in the queue are still within the timesliceDuration and should
-                // therefore not be removed from the queue.
-                if (now - _windows.Peek().StartedAt < _timesliceDuration)
-                    break;
-
+            while (_windows.Count > 0 && (now - _windows.Peek().StartedAt >= _timesliceDuration))
                 _windows.Dequeue();
-            }
         }
     }
 }


Fix genre lookups

Fix genre lookups

--- src/Resonance.Data.Storage.SQLite/MetadataRepository.cs
+++ src/Resonance.Data.Storage.SQLite/MetadataRepository.cs
@@ -1612,7 +1612,7 @@

             if (!string.IsNullOrWhiteSpace(genre))
             {
-                builder.Join("[GenreToTrack] gtt ON gtt.TrackId = tta.TrackId");
+                builder.Join("[GenreToTrack] gtt ON gtt.TrackId = t.TrackId");
                 builder.Join("[Genre] g ON g.Id = gtt.GenreId");
                 builder.Where("g.Name IN(@Genre)", new { Genre = genre });
             }
@@ -1678,7 +1678,8 @@
             var builder = new SqlBuilder();

             var query = builder.AddTemplate(GetScript("Track_Select"), new { UserId = userId });
-            builder.Where("g.Id = @GenreId", new { GenreId = genreId });
+            builder.Join("[GenreToTrack] gtt ON gtt.TrackId = t.TrackId");
+            builder.Where("gtt.GenreId = @GenreId", new { GenreId = genreId });

             var commandDefinition = new CommandDefinition(query.RawSql, transaction: _transaction, parameters: query.Parameters, cancellationToken: cancellationToken);


Remove unnecessary using directive

Remove unnecessary using directive

--- src/Roslyn.Diagnostics.Analyzers/Core/DoNotCopyValue.cs
+++ src/Roslyn.Diagnostics.Analyzers/Core/DoNotCopyValue.cs
@@ -6,7 +6,6 @@
 using System.Collections.Immutable;
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
-using System.Threading.Tasks;
 using Analyzer.Utilities;
 using Analyzer.Utilities.Extensions;
 using Microsoft.CodeAnalysis;


Don't show create prompt during file saving

--- src/SharpGraphEditor/Services/WindowDialogsPresenter.cs
+++ src/SharpGraphEditor/Services/WindowDialogsPresenter.cs
@@ -64,7 +64,6 @@
                 ValidateNames = true,
                 DereferenceLinks = true,
                 OverwritePrompt = true,
-                CreatePrompt = true,
                 AddExtension = true,
                 Filter = filter
             };


Readd startup version log message

Readd startup version log message

--- src/Tgstation.Server.Host/Components/InstanceManager.cs
+++ src/Tgstation.Server.Host/Components/InstanceManager.cs
@@ -211,17 +211,19 @@
 		#pragma warning disable CA1506 // TODO: Decomplexify
 		public Task StartAsync(CancellationToken cancellationToken) => databaseContextFactory.UseContext(async databaseContext =>
 		{
+			logger.LogInformation(assemblyInformationProvider.VersionString);
+
 			try
 			{
 				var factoryStartup = instanceFactory.StartAsync(cancellationToken);
 				await databaseContext.Initialize(cancellationToken).ConfigureAwait(false);
 				await jobManager.StartAsync(cancellationToken).ConfigureAwait(false);
 				var dbInstances = databaseContext.Instances.Where(x => x.Online.Value)
-				.Include(x => x.RepositorySettings)
-				.Include(x => x.ChatSettings)
-				.ThenInclude(x => x.Channels)
-				.Include(x => x.DreamDaemonSettings)
-				.ToAsyncEnumerable();
+					.Include(x => x.RepositorySettings)
+					.Include(x => x.ChatSettings)
+					.ThenInclude(x => x.Channels)
+					.Include(x => x.DreamDaemonSettings)
+					.ToAsyncEnumerable();
 				var tasks = new List<Task>();
 				await factoryStartup.ConfigureAwait(false);
 				await dbInstances.ForEachAsync(metadata => tasks.Add(metadata.Online.Value ? OnlineInstance(metadata, cancellationToken) : Task.CompletedTask), cancellationToken).ConfigureAwait(false);


fix URL redirection creation - was failing when save and save+publish as save creates new URL, which is compared to itself in save+publish (#5036)

--- src/Umbraco.Web/Routing/RedirectTrackingEventHandler.cs
+++ src/Umbraco.Web/Routing/RedirectTrackingEventHandler.cs
@@ -177,11 +177,13 @@
                     // change the IUrlSegmentProvider to support being able to determine if a
                     // segment is going to change for an entity. See notes in IUrlSegmentProvider.

-                    var oldEntity = ApplicationContext.Current.Services.ContentService.GetById(entity.Id);
-                    if (oldEntity == null) continue;
-                    var oldSegment = oldEntity.GetUrlSegment();
+                    // we want the last published version, not the last saved
+                    // otherwise redirects aren't created if content is saved, with save+publish happening later
+                    var publishedEntity = ApplicationContext.Current.Services.ContentService.GetPublishedVersion(entity.Id);
+                    if (publishedEntity == null) continue;
+                    var publishedSegment = publishedEntity.GetUrlSegment();
                     var newSegment = entity.GetUrlSegment();
-                    process = oldSegment != newSegment;
+                    process = publishedSegment != newSegment;
                 }

                 // skip if no segment change


make it a little easier to turn the strongname builds on or off

--- gen_build.cs
+++ gen_build.cs
@@ -44,10 +44,12 @@
 		//init_cppinterop(true);

         init_csproj(false);
-        init_csproj(true);
+		//SNK
+        //init_csproj(true);

 		init_tests(false);
-		init_tests(true);
+		//SNK
+		//init_tests(true);

 		init_testapps();

@@ -2030,7 +2032,7 @@
             {
                 //f.WriteElementString("WindowsMetadataLinkKeyFile", Path.Combine(top, "..", "sn", string.Format("{0}.snk", "SQLitePCL_sn.cppinterop")));
                 f.WriteElementString("SignAssembly", "true");
-                f.WriteElementString("AssemblyOriginatorKeyFile", Path.Combine(top, "..", "sn", string.Format("{0}.snk", "SQLitePCL_sn.cppinterop")));
+                f.WriteElementString("AssemblyOriginatorKeyFile", Path.Combine(top, "..", "sn", string.Format("{0}.snk", string.Format("{0}.cppinterop", gen.get_root_name(true)))));
             }
 #endif
 			f.WriteEndElement(); // PropertyGroup
@@ -4372,22 +4374,21 @@

 		// --------------------------------

-		gen_nuspec_raw(false, top, root);
-		gen_nuspec_raw(true, top, root);
-
-		gen_nuspec_ugly(false, top);
-		gen_nuspec_ugly(true, top);
-
-		gen_nuspec_tests(false, top);
-		gen_nuspec_tests(true, top);
-
-		gen_nuspec_bundle_green(false, top);
-		gen_nuspec_bundle_e_sqlite3(false, top);
-		gen_nuspec_bundle_winsqlite3(false, top);
-
-		gen_nuspec_bundle_green(true, top);
-		gen_nuspec_bundle_e_sqlite3(true, top);
-		gen_nuspec_bundle_winsqlite3(true, top);
+        {
+            Action<bool> gens = strongname => {
+                gen_nuspec_raw(strongname, top, root);
+                gen_nuspec_ugly(strongname, top);
+                gen_nuspec_bundle_green(strongname, top);
+                gen_nuspec_bundle_e_sqlite3(strongname, top);
+                gen_nuspec_bundle_winsqlite3(strongname, top);
+                gen_nuspec_provider_wp80(strongname, top, root, "e_sqlite3");
+                gen_nuspec_tests(strongname, top);
+            };
+
+            gens(false);
+    		//SNK
+            //gens(true);
+        }

 		foreach (config_csproj cfg in projects.items_csproj)
 		{
@@ -4396,8 +4397,6 @@
                 gen_nuspec_provider(top, root, cfg);
             }
 		}
-        gen_nuspec_provider_wp80(false, top, root, "e_sqlite3");
-        gen_nuspec_provider_wp80(true, top, root, "e_sqlite3");

 		foreach (config_csproj cfg in projects.items_csproj)
 		{
@@ -4424,28 +4423,23 @@

 		using (TextWriter tw = new StreamWriter(Path.Combine(top, "pack.ps1")))
 		{
-			tw.WriteLine("../../nuget pack SQLitePCL.raw.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL.ugly.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL.bundle_green.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL.bundle_e_sqlite3.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL.bundle_winsqlite3.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL.provider.e_sqlite3.wp80.nuspec");
-
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.raw.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.ugly.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.bundle_green.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.bundle_e_sqlite3.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.bundle_winsqlite3.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.provider.e_sqlite3.wp80.nuspec");
+            Action<bool> packs = strongname => {
+                tw.WriteLine("../../nuget pack {0}.raw.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.ugly.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.bundle_green.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.bundle_e_sqlite3.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.bundle_winsqlite3.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.provider.e_sqlite3.wp80.nuspec", gen.get_root_name(strongname));
+                tw.WriteLine("../../nuget pack {0}.tests.nuspec", gen.get_root_name(strongname));
+            };
+
+            packs(false);
+    		//SNK
+            //packs(true);

 			tw.WriteLine("../../nuget pack SQLitePCL.lib.sqlcipher.windows.nuspec");
 			tw.WriteLine("../../nuget pack SQLitePCL.lib.sqlcipher.osx.nuspec");
 			tw.WriteLine("../../nuget pack SQLitePCL.lib.sqlcipher.linux.nuspec");
-
-            // TODO probably give this a different kind of
-            // name since it shouldn't be pushed
-			tw.WriteLine("../../nuget pack SQLitePCL.tests.nuspec");
-			tw.WriteLine("../../nuget pack SQLitePCL_sn.tests.nuspec");

 			foreach (config_csproj cfg in projects.items_csproj)
 			{


rm some leftover cruft from back when we supported iOS classic (as opposed to iOS Unified)

--- gen_build.cs
+++ gen_build.cs
@@ -653,8 +653,6 @@
         // framework name is full enough for project.json/frameworks.
 		switch (env)
 		{
-			case "ios_classic":
-				return "MonoTouch,Version=v1.0";
 			case "ios_unified":
 				return "Xamarin.iOS10";
 			case "macos":
@@ -700,8 +698,6 @@
 	{
 		switch (env)
 		{
-			case "ios_classic":
-				return "MonoTouch";
 			case "ios_unified":
 				return "Xamarin.iOS10";
 			case "macos":
@@ -828,7 +824,6 @@
         switch (env)
         {
             case "ios_unified":
-            case "ios_classic":
 			case "watchos":
                 cfg.name = string.Format("{0}.lib.{1}.{2}.{3}", cfg.root_name, what, env, "static");
                 break;
@@ -841,7 +836,6 @@
         cfg.env = env;
         switch (cfg.env)
         {
-            case "ios_classic":
             case "ios_unified":
             case "watchos":
                 switch (what)
@@ -864,7 +858,6 @@
         switch (cfg.env)
         {
             case "ios_unified":
-            case "ios_classic":
             case "watchos":
                 switch (what)
                 {
@@ -906,7 +899,6 @@
         switch (cfg.env)
         {
             case "ios_unified":
-            case "ios_classic":
             case "watchos":
                 switch (what)
                 {
@@ -1171,7 +1163,6 @@
 	private const string GUID_CPP = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
 	private const string GUID_FOLDER = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}";
 	private const string GUID_PCL = "{786C830F-07A1-408B-BD7F-6EE04809D6DB}";
-	private const string GUID_IOS = "{6BC8ED88-2882-458C-8E55-DFD12B67127B}";
 	private const string GUID_WATCHOS = "{FC940695-DFE0-4552-9F25-99AF4A5619A1}";
 	private const string GUID_UNIFIED_IOS = "{FEACFBD2-3405-455C-9665-78FE426C6842}";
 	private const string GUID_UNIFIED_MAC = "{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1}";
@@ -1400,12 +1391,6 @@
 					f.WriteEndElement(); // Import

 					break;
-				case "ios_classic":
-					f.WriteStartElement("Import");
-					f.WriteAttributeString("Project", "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.MonoTouch.CSharp.targets");
-					f.WriteEndElement(); // Import
-
-					break;
 				case "android":
 					f.WriteStartElement("Import");
 					f.WriteAttributeString("Project", "$(MSBuildExtensionsPath)\\Novell\\Novell.MonoDroid.CSharp.targets");
@@ -1446,7 +1431,6 @@
 	{
 		switch (env)
 		{
-			case "ios_classic":
 			case "ios_unified":
 			case "macos":
 			case "watchos":
@@ -1469,9 +1453,6 @@
 			case "macos":
 				write_reference(f, "Xamarin.Mac");
 				break;
-			case "ios_classic":
-				write_reference(f, "monotouch");
-				break;
 			case "android":
 				write_reference(f, "Mono.Android");
 				break;
@@ -1522,9 +1503,6 @@
 		{
 			case "profile136":
 				defines.Add("OLD_REFLECTION");
-				break;
-			case "ios_classic":
-				defines.Add("PLATFORM_IOS");
 				break;
 			case "macos":
 				f.WriteElementString("TargetFrameworkIdentifier", "Xamarin.Mac");
@@ -1651,9 +1629,6 @@
 		{
 			switch (env)
 			{
-				case "ios_classic":
-					write_project_type_guids(f, GUID_IOS, GUID_CSHARP);
-					break;
 				case "ios_unified":
 					write_project_type_guids(f, GUID_UNIFIED_IOS, GUID_CSHARP);
 					break;
@@ -3528,7 +3503,7 @@
         add_dep_core(f);

         if (
-                ((env_deps == "ios_unified") || (env_deps == "ios_classic") || (env_deps == "watchos"))
+                ((env_deps == "ios_unified") || (env_deps == "watchos"))
                 && (what != "sqlite3")
            )
         {
@@ -3564,7 +3539,6 @@
                     f.WriteEndElement(); // dependency
                     break;
                 case "ios_unified":
-                case "ios_classic":
                 case "watchos":
                     f.WriteStartElement("dependency");
                     f.WriteAttributeString("id", string.Format("{0}.lib.e_sqlite3.{1}.static", gen.ROOT_NAME, env_deps));
@@ -3615,7 +3589,6 @@
                     f.WriteEndElement(); // dependency
                     break;
                 case "ios_unified":
-                case "ios_classic":
                 case "watchos":
                     f.WriteStartElement("dependency");
                     f.WriteAttributeString("id", string.Format("{0}.lib.sqlcipher.{1}.static", gen.ROOT_NAME, env_deps));


fixes to the bundle's targetFramework nuspec dependencies

--- gen_build.cs
+++ gen_build.cs
@@ -395,7 +395,7 @@
 		case "wpa81":
 			return "v120_wp81";
 		case "uwp10":
-			return "v140";
+			return "uwp";
 		case "win8":
 			return "v110";
 		case "win81":
@@ -4084,7 +4084,7 @@
                 case "net45":
                 case "netstandard11": // TODO because this is used for netcoreapp, kinda hackish
                     f.WriteStartElement("dependency");
-                    f.WriteAttributeString("id", string.Format("{0}.lib.{1}.v110_xp", gen.ROOT_NAME, what));
+                    f.WriteAttributeString("id", string.Format("{0}.lib.{1}.windows", gen.ROOT_NAME, what));
                     f.WriteAttributeString("version", NUSPEC_VERSION);
                     f.WriteEndElement(); // dependency


Ensure we automatically continue paused render when Flush is true.

--- RenderEngine.cs
+++ RenderEngine.cs
@@ -198,6 +198,7 @@
 		/// </summary>
 		public void CheckFlushQueue()
 		{
+			if (State == State.Waiting && Flush) ContinueRendering();
 			// not rendering, nor flush needed, bail
 			if (State != State.Rendering || Database == null || !Flush) return;


Remove unnecessary cast by changing method siganture

--- osu.Game.Rulesets.Catch/UI/CatcherArea.cs
+++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs
@@ -221,9 +221,9 @@
             /// Add a caught fruit to the catcher's stack.
             /// </summary>
             /// <param name="fruit">The fruit that was caught.</param>
-            public void PlaceOnPlate(DrawableHitObject fruit)
-            {
-                float ourRadius = ((DrawableCatchHitObject)fruit).DisplayRadius;
+            public void PlaceOnPlate(DrawableCatchHitObject fruit)
+            {
+                float ourRadius = fruit.DisplayRadius;
                 float theirRadius = 0;

                 const float allowance = 6;


Exit handling flow

Exit handling flow

--- osu.Game/Screens/Play/SubmittingPlayer.cs
+++ osu.Game/Screens/Play/SubmittingPlayer.cs
@@ -102,6 +102,11 @@
         /// <returns>Whether gameplay should be immediately exited as a result. Returning false allows the gameplay session to continue. Defaults to true.</returns>
         protected virtual bool HandleTokenRetrievalFailure(Exception exception) => true;

+        public override bool OnExiting(IScreen next)
+        {
+            return base.OnExiting(next);
+        }
+
         protected override async Task PrepareScoreForResultsAsync(Score score)
         {
             await base.PrepareScoreForResultsAsync(score).ConfigureAwait(false);


Remove double handling of restart allowance on results screen (already handled locally)

--- osu.Game/Screens/Ranking/ResultsScreen.cs
+++ osu.Game/Screens/Ranking/ResultsScreen.cs
@@ -164,18 +164,15 @@
             {
                 buttons.Add(new RetryButton { Width = 300 });

-                if (player?.Configuration.AllowRestart == true)
-                {
-                    AddInternal(new HotkeyRetryOverlay
+                AddInternal(new HotkeyRetryOverlay
+                {
+                    Action = () =>
                     {
-                        Action = () =>
-                        {
-                            if (!this.IsCurrentScreen()) return;
-
-                            player?.Restart();
-                        },
-                    });
-                }
+                        if (!this.IsCurrentScreen()) return;
+
+                        player?.Restart();
+                    },
+                });
             }
         }


Updated to work with Blender Source Tools 2.4.0

--- S2GSMDC/Main.cs
+++ S2GSMDC/Main.cs
@@ -31,6 +31,7 @@
 				}
 				*/

+                int successes = 0;
 				foreach(string file in args)
 				{
 					Console.WriteLine("Opening {0} for conversion...\n", file);
@@ -76,11 +77,13 @@
 									}
 								}
 								*/
-								Match match = Regex.Match(line, @"0 (-*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+) \d+ (\d+) .*$");
-								{
+								//Match match = Regex.Match(line, @"0 (-*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+ -*\d+\.?\d+) \d+ (\d+) .*$");
+                                Match match = Regex.Match(line, @"\d+(?<vertex> +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+ +-?\d+\.\d+) +\d+ +(?<bone>\d+) +-?\d+\.\d+");
+                                {
 									if(match.Success)
 									{
-										line = match.Groups[2].Value + " " + match.Groups[1].Value;
+										line = match.Groups["bone"].Value + match.Groups["vertex"].Value;
+                                        successes++;
 									}
 								}
 								w.WriteLine(line);
@@ -90,6 +93,7 @@
 					}
 				}
 				Console.WriteLine("All files converted.\nPress any key to exit.");  // {0} successes, {1} failures.", successes, failures);
+                Console.WriteLine(successes + " successes.");
 				//Console.WriteLine("Converting {0} failed.\n", file);
 				Console.Read();
 				Console.Read();


Fix RS1024 instances in APIView (#504)

Fix RS1024 instances in APIView (#504)

--- src/dotnet/APIView/APIView/Languages/CodeFileBuilder.cs
+++ src/dotnet/APIView/APIView/Languages/CodeFileBuilder.cs
@@ -511,15 +511,15 @@
             var symbol = symbolDisplayPart.Symbol;

             if (symbol is INamedTypeSymbol &&
-                (definedSymbol == null || !definedSymbol.Equals(symbol)) &&
-                _assembly.Equals(symbol.ContainingAssembly))
+                (definedSymbol == null || !SymbolEqualityComparer.Default.Equals(definedSymbol, symbol)) &&
+                SymbolEqualityComparer.Default.Equals(_assembly, symbol.ContainingAssembly))
             {
                 navigateToId = symbol.GetId();
             }

             return new CodeFileToken()
             {
-                DefinitionId = definedSymbol?.Equals(symbol) == true ? definedSymbol.GetId() : null,
+                DefinitionId = (definedSymbol != null && SymbolEqualityComparer.Default.Equals(definedSymbol, symbol)) ? definedSymbol.GetId() : null,
                 NavigateToId = navigateToId,
                 Value = symbolDisplayPart.ToString(),
                 Kind = kind


Release 1.0.0-rc7

Release 1.0.0-rc7

--- SolutionInfo.cs
+++ SolutionInfo.cs
@@ -13,7 +13,7 @@

 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0-rc6")]
+[assembly: AssemblyInformationalVersion("1.0.0-rc7")]

 // Setting ComVisible to false makes the types in this assembly not visible
 // to COM components.  If you need to access a type in this assembly from


Call SentrySdk.CaptureException when Application.Run catches (BL-10000)

--- src/BloomExe/Program.cs
+++ src/BloomExe/Program.cs
@@ -693,15 +693,19 @@
 			catch (System.Reflection.TargetInvocationException bad)
 			{
 				if (bad.InnerException is System.AccessViolationException)
-					Logger.ShowUserATextFileRelatedToCatastrophicError(bad.InnerException);
+					Logger.WriteError("Exception caught at outermost level of Bloom: ", bad.InnerException);
 				else
-					Logger.ShowUserATextFileRelatedToCatastrophicError(bad);
-				System.Environment.FailFast("TargetInvocationException");
+					Logger.WriteError("Exception caught at outermost level of Bloom:", bad);
+				var exceptMsg = "TargetInvocationException";
+				try { SentrySdk.CaptureException(bad); } catch (Exception e) { exceptMsg += $" (SentrySdk.CaptureException failed: {e})"; }
+				System.Environment.FailFast(exceptMsg);
 			}
 			catch (System.AccessViolationException nasty)
 			{
-				Logger.ShowUserATextFileRelatedToCatastrophicError(nasty);
-				System.Environment.FailFast("AccessViolationException");
+				Logger.WriteError("Exception caught at outermost level of Bloom: ", nasty);
+				var exceptMsg = "AccessViolationException";
+				try { SentrySdk.CaptureException(nasty); } catch (Exception e) { exceptMsg += $" (SentrySdk.CaptureException failed: {e})"; }
+				System.Environment.FailFast(exceptMsg);
 			}

 			Settings.Default.Save();


Print certain debug messages only if Verbose is enabled

--- src/Connection.cs
+++ src/Connection.cs
@@ -375,7 +375,8 @@

 			} else {
 				//TODO: how should we handle this condition? sending an Error may not be appropriate in this case
-				Console.Error.WriteLine ("Warning: No signal handler for " + signal.Member);
+				if (Protocol.Verbose)
+					Console.Error.WriteLine ("Warning: No signal handler for " + signal.Member);
 			}
 		}

@@ -496,9 +497,11 @@
 					//TODO: complete exception sending support
 					//TODO: method not found etc. exceptions
 					Exception ie = e.InnerException;
-					Console.Error.WriteLine ();
-					Console.Error.WriteLine (ie);
-					Console.Error.WriteLine ();
+					if (Protocol.Verbose) {
+						Console.Error.WriteLine ();
+						Console.Error.WriteLine (ie);
+						Console.Error.WriteLine ();
+					}

 					if (!method_call.message.ReplyExpected) {
 						Console.Error.WriteLine ();


Add IsARM prop

Add IsARM prop

--- src/DotNet/ModuleDef.cs
+++ src/DotNet/ModuleDef.cs
@@ -740,6 +740,11 @@
 		/// <c>true</c> if <see cref="Machine"/> is <see cref="PE.Machine.AMD64"/>, <see cref="PE.Machine.AMD64_Native_Apple"/>, ...
 		/// </summary>
 		public bool IsAMD64 => Machine.IsAMD64();
+
+		/// <summary>
+		/// <c>true</c> if <see cref="Machine"/> is <see cref="PE.Machine.ARMNT"/>, <see cref="PE.Machine.ARMNT_Native_Apple"/>, ...
+		/// </summary>
+		public bool IsARM => Machine.IsARMNT();

 		/// <summary>
 		/// <c>true</c> if <see cref="Machine"/> is <see cref="PE.Machine.ARM64"/>, <see cref="PE.Machine.ARM64_Native_Apple"/>, ...


Fixed the sorting of modules to also work with manually added dependencies.

Signed-off-by: Dimitar Dobrev <ca751a5c976abad79158718440750fc638d19ebc@protonmail.com>

--- src/Generator/Driver.cs
+++ src/Generator/Driver.cs
@@ -222,9 +222,6 @@

         public void SortModulesByDependencies()
         {
-            if (!Options.DoAllModulesHaveLibraries())
-                return;
-
             var sortedModules = Options.Modules.TopologicalSort(m =>
             {
                 var dependencies = (from library in Context.Symbols.Libraries
@@ -235,7 +232,7 @@
                 if (m != Options.SystemModule)
                     m.Dependencies.Add(Options.SystemModule);
                 m.Dependencies.AddRange(dependencies);
-                return dependencies;
+                return m.Dependencies;
             });
             Options.Modules.Clear();
             Options.Modules.AddRange(sortedModules);


Return focus to proper places after actions. bgo#458554

This patch gives the focus to the photo_view or icon_view objects ( for Edit
mode and Browse mode ) after a tag is dragged on a photo (or selection). It
also gives the focus to the photo_view object when switching to edit mode.

--- src/MainWindow.cs
+++ src/MainWindow.cs
@@ -593,6 +593,8 @@

 			JumpTo (icon_view.FocusCell);
 			zoom_scale.Value = photo_view.NormalizedZoom;
+
+			photo_view.View.GrabFocus();
 			break;
 		}
 		Selection.MarkChanged ();
@@ -1380,6 +1382,8 @@
 		HandleAttachTagCommand (sender, null);

 		Gtk.Drag.Finish (args.Context, true, false, args.Time);
+
+ 		photo_view.View.GrabFocus();
 	}

 	//
@@ -2502,6 +2506,8 @@
 						JumpTo (query.IndexOf (photo));
 				} catch (Exception) {}
 			}
+
+			icon_view.GrabFocus ();
 			break;
 		case Preferences.SIDEBAR_POSITION:
 			if (main_hpaned.Position !=Preferences.Get<int> (key) )


Housekeeping: fix line endings.

Housekeeping: fix line endings.

--- src/Iso9660/CDReader.cs
+++ src/Iso9660/CDReader.cs
@@ -25,17 +25,17 @@

 namespace DiscUtils.Iso9660
 {
-    /// <summary>
-    /// Class for reading existing ISO images.
+    /// <summary>
+    /// Class for reading existing ISO images.
     /// </summary>
     public class CDReader : VfsFileSystemFacade
     {

-        /// <summary>
-        /// Creates a new instance.
-        /// </summary>
-        /// <param name="data">The stream to read the ISO image from.</param>
-        /// <param name="joliet">Whether to read Joliet extensions.</param>
+        /// <summary>
+        /// Creates a new instance.
+        /// </summary>
+        /// <param name="data">The stream to read the ISO image from.</param>
+        /// <param name="joliet">Whether to read Joliet extensions.</param>
         public CDReader(Stream data, bool joliet)
             : base(new VfsCDReader(data, joliet, false))
         {
@@ -46,7 +46,7 @@
         /// </summary>
         /// <param name="data">The stream to read the ISO image from.</param>
         /// <param name="joliet">Whether to read Joliet extensions.</param>
-        /// <param name="hideVersions">Hides version numbers (e.g. ";1") from the end of files</param>
+        /// <param name="hideVersions">Hides version numbers (e.g. ";1") from the end of files</param>
         public CDReader(Stream data, bool joliet, bool hideVersions)
             : base(new VfsCDReader(data, joliet, hideVersions))
         {


NTFS: Fix support for small cluster sizes, reported by markridley [#5277]

--- src/Ntfs/Index.cs
+++ src/Ntfs/Index.cs
@@ -296,13 +296,13 @@

         internal long IndexBlockVcnToPosition(long vcn)
         {
-            if(_bpb.BytesPerCluster <= _root.IndexAllocationSize)
-            {
-                if(_root.RawClustersPerIndexRecord != 1)
-                {
-                    throw new NotSupportedException("Unexpected RawClustersPerIndexRecord (multiple clusters per index block): " + _root.RawClustersPerIndexRecord);
-                }
-
+            if (vcn % _root.RawClustersPerIndexRecord != 0)
+            {
+                throw new NotSupportedException("Unexpected vcn (not a multiple of clusters-per-index-record): vcn=" + vcn + " rcpir=" + _root.RawClustersPerIndexRecord);
+            }
+
+            if (_bpb.BytesPerCluster <= _root.IndexAllocationSize)
+            {
                 return vcn * (long)_bpb.BytesPerCluster;
             }
             else


More correct string length handling

More correct string length handling

This makes it explicit that what we're trying to do is encode the string length in little-endian format, handles strings longer than 255 characters (which the app shouldn't do), and handles the case of running the app on a big-endian host (which I don't think exists for UWP).

--- TvConnection.cs
+++ TvConnection.cs
@@ -358,7 +358,13 @@

         private StringBuilder WriteText(StringBuilder writer, String text)
         {
-            return writer.Append((char)text.Length).Append((char)0x0).Append(text);
+            var bytes = BitConverter.GetBytes((UInt16)text.Length);
+            if (!BitConverter.IsLittleEndian)
+            {
+                Array.Reverse(bytes);
+            }
+
+            return writer.Append(Encoding.ASCII.GetChars(bytes)).Append(text);
         }

         private StringBuilder WriteBase64Text(StringBuilder writer, String text)


should fix #2

should fix #2

--- src/Rusticle/Reticle.cs
+++ src/Rusticle/Reticle.cs
@@ -239,7 +239,7 @@

         void ToggleAutorun(object sender, HandledEventArgs e) {
             _inRunMode = !_inRunMode;
-            ShowWindow(_rustHandle, 1);
+            //ShowWindow(_rustHandle, 1);

             if (!_inRunMode) {
                 StartAutorun(sender, e);


enable disposing native memory in finalizers

 - improves #40

--- src/Vulkan/Additions.cs
+++ src/Vulkan/Additions.cs
@@ -231,5 +231,10 @@
 		public virtual void VirtualDispose ()
 		{
 		}
+
+		~MarshalledObject ()
+		{
+			Dispose ();
+		}
 	}
 }


Fix a syntax error regarding String.Join(string, string[])

--- src/Summa/Feed.cs
+++ src/Summa/Feed.cs
@@ -89,7 +89,7 @@
                 return stags;
             }
             set {
-                string tags = value.Join(',');
+                string tags = String.Join(",", value);
                 feed.SetProperty("tags", tags);
             }
         }


Disable matching tiles when changing a tile, as it might make no sense.

--- src/TabGodMode.cs
+++ src/TabGodMode.cs
@@ -137,6 +137,8 @@
                     return;
                 }

+                PrepareLanding.Instance.TileFilter.ClearMatchingTiles();
+
                 _gameData.GodModeData.SetupTile();
                 LogTemperatureInfo(_gameData.GodModeData.SelectedTileId);
             }


wp7: fix cookie issue

wp7: fix cookie issue

--- platform/wp7/RhoRubyLib/net/NetRequest.cs
+++ platform/wp7/RhoRubyLib/net/NetRequest.cs
@@ -128,9 +128,15 @@

             if (response.Cookies != null)
             {
-                CookieContainer container = new CookieContainer();
-                container.Add(new Uri(m_strUrl), response.Cookies);
-                strRes = container.GetCookieHeader(new Uri(m_strUrl));
+                try
+                {
+                    CookieContainer container = new CookieContainer();
+                    container.Add(new Uri(m_strUrl), response.Cookies);
+                    strRes = container.GetCookieHeader(new Uri(m_strUrl));
+                }catch (Exception exc)
+                {
+                    LOG.WARNING("CookieContainer failed: " + exc.ToString());
+                }
             }

             if (strRes != null && strRes.Length > 0)
@@ -326,7 +332,58 @@
             try
             {
                 stream = m_webRequest.EndGetRequestStream(asyncResult);
-                stream.Write(new UTF8Encoding().GetBytes(m_strBody), 0, m_strBody.length());//TODO ASCII ???
+                if(m_strBody != null)
+                    stream.Write(new UTF8Encoding().GetBytes(m_strBody), 0, m_strBody.length());//TODO ASCII ???
+                else if (m_isMultiPart)
+                {
+                    for (int i = 0; i < (int)m_arItems.size(); i++)
+                    {
+                        MultipartItem oItem = (MultipartItem)m_arItems.elementAt(i);
+                        stream.Write(new UTF8Encoding().GetBytes(oItem.m_strDataPrefix), 0, oItem.m_strDataPrefix.length());
+
+                        if (oItem.m_strFilePath.length() > 0)
+                        {
+                            IInputStream fis = null;
+                            CRhoFile file = RhoClassFactory.createFile();
+                            try
+                            {
+
+                                file.open(oItem.m_strFilePath, CRhoFile.EOpenModes.OpenReadOnly);
+                                if (!file.isOpened())
+                                {
+                                    LOG.ERROR("File not found: " + oItem.m_strFilePath);
+                                    throw new Exception("File not found:" + oItem.m_strFilePath);
+                                }
+
+                                fis = file.getInputStream();
+                                byte[] byteBuffer = new byte[1024 * 4];
+                                int nRead = 0;
+                                do
+                                {
+                                    nRead = fis.read(byteBuffer, 0, 1024 * 4);
+                                    if (nRead > 0)
+                                        stream.Write(byteBuffer, 0, nRead);
+                                } while (nRead > 0);
+                            }
+                            finally
+                            {
+                                if (file != null)
+                                    try { file.close(); }
+                                    catch (IOException e)
+                                    {
+                                        LOG.ERROR("GetRequestStreamCallback: file close failed.", e);
+                                    }
+                            }
+
+                        }
+                        else
+                        {
+                            stream.Write(new UTF8Encoding().GetBytes(oItem.m_strBody), 0, oItem.m_strBody.length());
+                        }
+                    }
+                    stream.Write(new UTF8Encoding().GetBytes(szMultipartPostfix), 0, szMultipartPostfix.length());
+                }
+                LOG.INFO("write body done");
             }
             finally
             {


improve versioning for artifacts

improve versioning for artifacts

--- build/version.cake
+++ build/version.cake
@@ -14,10 +14,8 @@
         var semVersion = gitVersion.LegacySemVerPadded;
         var dotnetVersion = version;

-        if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) {
-            semVersion += "." + gitVersion.BuildMetaDataPadded;
-            dotnetVersion += "." + gitVersion.BuildMetaDataPadded;
-        }
+        semVersion += "." + gitVersion.CommitsSinceVersionSource;
+        dotnetVersion += "." + gitVersion.CommitsSinceVersionSource;

         return new BuildVersion
         {


Fixed bad downcasts in SLProxy's BackgroundTasks and SeparateAck

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

--- applications/SLProxy/SLProxy.cs
+++ applications/SLProxy/SLProxy.cs
@@ -546,7 +546,7 @@
 			for (int i = 0; i < ackCount; ++i) {
 				Hashtable fields = new Hashtable();
 				int offset = packet.Data.Length - (ackCount - i) * 4 - 1;
-				fields["ID"] = (int)
+				fields["ID"] = (uint)
 					  (packet.Data[offset++] <<  0)
 					+ (packet.Data[offset++] <<  8)
 					+ (packet.Data[offset++] << 16)
@@ -697,7 +697,7 @@
 								SendPacket(packet);
 							}

-						foreach (ushort id in outgoingAcks.Values)
+						foreach (ushort id in outgoingAcks.Keys)
 							if (!outgoingSeenAcks.Contains(id)) {
 								Packet packet = (Packet)outgoingAcks[id];
 								packet.Data[0] |= Helpers.MSG_RESENT;


Update IAssemblyController.cs

Update IAssemblyController.cs

--- 6502.Net/IAssemblyController.cs
+++ 6502.Net/IAssemblyController.cs
@@ -1,4 +1,4 @@
-//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 // Copyright (c) 2017 informedcitizenry <informedcitizenry@gmail.com>
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -50,7 +50,7 @@
         /// <param name="label">The label to lookup the value.</param>
         /// <param name="line">The SourceLine where the label is being referenced.</param>
         /// <returns>The label value as a string, otherwise an empty string.</returns>
-        string GetLabelValue(string label, SourceLine line);
+        string GetScopedLabelValue(string label, SourceLine line);

         /// <summary>
         /// Indicates if the instruction in the given source line


del obsolete

del obsolete

--- src/HjsonValue.cs
+++ src/HjsonValue.cs
@@ -75,14 +75,5 @@
       new HjsonWriter(options).Save(json, textWriter, 0, false, "", true, true);
       textWriter.Flush();
     }
-
-    /// <summary>Saves Hjson to a string, adding whitespace and comments.</summary>
-    [Obsolete("Use Save() with options.")]
-    public static void SaveWsc(JsonValue json, TextWriter textWriter)
-    {
-      if (textWriter==null) throw new ArgumentNullException("textWriter");
-      new HjsonWriter(new HjsonOptions { KeepWsc=true }).Save(json, textWriter, 0, false, "", true, true);
-      textWriter.Flush();
-    }
   }
 }


IPlayer.cs : Maintenance of comments.

IPlayer.cs : Maintenance of comments.

--- AIWolfLibCommon/Data/IPlayer.cs
+++ AIWolfLibCommon/Data/IPlayer.cs
@@ -14,21 +14,18 @@
     /// <summary>
     /// Defines a generalized methods that a class implements to be a player of AIWolf.
     /// </summary>
-    /// <remarks></remarks>
     public interface IPlayer
     {
         /// <summary>
         /// This player's name.
         /// </summary>
         /// <value>This player's name.</value>
-        /// <remarks></remarks>
         string Name { get; }

         /// <summary>
         /// Called when the game information is updated.
         /// </summary>
         /// <param name="gameInfo">The current information of this game.</param>
-        /// <remarks></remarks>
         void Update(GameInfo gameInfo);

         /// <summary>
@@ -36,13 +33,11 @@
         /// </summary>
         /// <param name="gameInfo">The current information of this game.</param>
         /// <param name="gameSetting">The setting of this game.</param>
-        /// <remarks></remarks>
         void Initialize(GameInfo gameInfo, GameSetting gameSetting);

         /// <summary>
         /// Called when the day started.
         /// </summary>
-        /// <remarks></remarks>
         void DayStart();

         /// <summary>
@@ -69,28 +64,28 @@
         /// Returns the agent this player wants to execute.
         /// </summary>
         /// <returns>The agent this player wants to execute.</returns>
-        /// <remarks></remarks>
+        /// <remarks>Null results in random vote.</remarks>
         Agent Vote();

         /// <summary>
         /// Returns the agent this werewolf wants to attack.
         /// </summary>
         /// <returns>The agent this werewolf wants to attack.</returns>
-        /// <remarks></remarks>
+        /// <remarks>No attack in case of null.</remarks>
         Agent Attack();

         /// <summary>
         /// Returns the agent this seer wants to divine.
         /// </summary>
         /// <returns>The agent this seer wants to divine.</returns>
-        /// <remarks></remarks>
+        /// <remarks>Null is not allowed.</remarks>
         Agent Divine();

         /// <summary>
         /// Returns the agent this bodyguard wants to guard.
         /// </summary>
         /// <returns>The agent this bodyguard wants to guard.</returns>
-        /// <remarks></remarks>
+        /// <remarks>No guard in case of null.</remarks>
         Agent Guard();

         /// <summary>


Convert loop to linq

Convert loop to linq

--- APAnimatorComponent/PathData.cs
+++ APAnimatorComponent/PathData.cs
@@ -609,22 +609,12 @@

             // For each timestamp in the path..
             foreach (var pathTimestamp in pathTimestamps) {
-                // Helper variable.
-                var keyExists = false;
-                // For each timestamp in rotation path..
-                for (var j = 0; j < rotationPathTimestamps.Length; j++) {
-                    // If both timestamps are the same..
-                    if (Utilities.FloatsEqual(
-                        rotationPathTimestamps[j],
-                        pathTimestamp,
-                        GlobalConstants.FloatPrecision)) {
-
-                        keyExists = true;
-                        break;
-                    }
-                }
-
-                // If both timestamps are different..
+                // Check if same timestamp exists in rotation path.
+                var keyExists = rotationPathTimestamps.Any(
+                    t => Utilities.FloatsEqual(
+                        t, pathTimestamp, GlobalConstants.FloatPrecision));
+
+                // If not..
                 if (!keyExists) {
                     CreateRotationPoint(pathTimestamp);
                 }


Updating the timeout to be consistent

Updating the timeout to be consistent

--- APE.Language/APE.Language/Language.cs
+++ APE.Language/APE.Language/Language.cs
@@ -845,7 +845,7 @@
                     break;
                 }

-                if (timer.ElapsedMilliseconds > GUI.m_APE.TimeOut)
+                if (timer.ElapsedMilliseconds > GUI.GetTimeOut())
                 {
                     throw GUI.ApeException("Window is not visible");
                 }
@@ -928,7 +928,7 @@
                         i--;
                     }

-                    if (timer.ElapsedMilliseconds > GUI.m_APE.TimeOut)
+                    if (timer.ElapsedMilliseconds > GUI.GetTimeOut())
                     {
                         timer.Stop();
                         throw GUI.ApeException("Failed to detect window finishing animation");
@@ -1005,7 +1005,7 @@
                     }
                 }

-                if (timer.ElapsedMilliseconds > 3000)
+                if (timer.ElapsedMilliseconds > GUI.GetTimeOut())
                 {
                     if (!isVisible)
                     {
@@ -1169,7 +1169,7 @@
                     }
                 }

-                if (timer.ElapsedMilliseconds > 3000)
+                if (timer.ElapsedMilliseconds > GUI.GetTimeOut())
                 {
                     //Failed to find it
                     throw GUI.ApeException("Failed to find menu item [" + menuItem + "]");


Fix commit 9c45d6f8519196c2350aca32998a965cf74dd711

--- Algo/Connector_SubscriptionManager.cs
+++ Algo/Connector_SubscriptionManager.cs
@@ -178,12 +178,25 @@
 			{
 				var time = message is IServerTimeMessage timeMsg ? timeMsg.ServerTime : (DateTimeOffset?)null;

+				var processed = new HashSet<SubscriptionInfo>();
+
 				foreach (var id in message.GetSubscriptionIds())
 				{
-					var info = TryGetSubscription(id, true, false, time);
-
-					if (info != null)
+					var info = TryGetSubscription(id, false, false, time);
+
+					if (info == null)
+						continue;
+
+					if (!processed.Add(info))
+						continue;
+
+					if (info.Parent == null)
 						yield return info.Subscription;
+
+					if (!processed.Add(info.Parent))
+						continue;
+
+					yield return info.Parent.Subscription;
 				}
 			}

@@ -257,6 +270,8 @@
 			{
 				originalMsg = null;

+				SubscriptionInfo info = null;
+
 				try
 				{
 					lock (_syncObject)
@@ -274,7 +289,7 @@

 						originalMsg = tuple.Item1;

-						var info = originalMsg.IsSubscribe
+						info = originalMsg.IsSubscribe
 							? TryGetInfo(originalMsg.TransactionId, false, false, null, false)
 							: TryGetInfo(originalMsg.OriginalTransactionId, false, true, null, false);

@@ -325,7 +340,7 @@
 				}
 				finally
 				{
-					if (originalMsg == null)
+					if (info == null)
 						TryWriteLog(response.OriginalTransactionId);
 				}
 			}


Use Stack instead of IDeque and ArrayDeque

--- Antlr4.Runtime/Atn/ATNConfig.cs
+++ Antlr4.Runtime/Atn/ATNConfig.cs
@@ -293,11 +293,11 @@
             {
                 return false;
             }
-            IDeque<PredictionContext> leftWorkList = new ArrayDeque<PredictionContext>();
-            IDeque<PredictionContext> rightWorkList = new ArrayDeque<PredictionContext>();
-            leftWorkList.AddItem(GetContext());
-            rightWorkList.AddItem(subconfig.GetContext());
-            while (!leftWorkList.IsEmpty())
+            Stack<PredictionContext> leftWorkList = new Stack<PredictionContext>();
+            Stack<PredictionContext> rightWorkList = new Stack<PredictionContext>();
+            leftWorkList.Push(GetContext());
+            rightWorkList.Push(subconfig.GetContext());
+            while (leftWorkList.Count > 0)
             {
                 PredictionContext left = leftWorkList.Pop();
                 PredictionContext right = rightWorkList.Pop();
@@ -386,12 +386,11 @@
             StringBuilder builder = new StringBuilder();
             builder.Append("digraph G {\n");
             builder.Append("rankdir=LR;\n");
-            IDictionary<PredictionContext, PredictionContext> visited = new IdentityHashMap<PredictionContext
-                , PredictionContext>();
-            IDeque<PredictionContext> workList = new ArrayDeque<PredictionContext>();
-            workList.AddItem(GetContext());
-            visited.Put(GetContext(), GetContext());
-            while (!workList.IsEmpty())
+            ISet<PredictionContext> visited = new HashSet<PredictionContext>();
+            Stack<PredictionContext> workList = new Stack<PredictionContext>();
+            workList.Push(GetContext());
+            visited.Add(GetContext());
+            while (workList.Count > 0)
             {
                 PredictionContext current = workList.Pop();
                 for (int i = 0; i < current.Size; i++)
@@ -402,7 +401,7 @@
                     builder.Append("s").Append(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode
                         (current.GetParent(i)));
                     builder.Append("[label=\"").Append(current.GetReturnState(i)).Append("\"];\n");
-                    if (visited.Put(current.GetParent(i), current.GetParent(i)) == null)
+                    if (visited.Add(current.GetParent(i)))
                     {
                         workList.Push(current.GetParent(i));
                     }


Update the caching change.

Update the caching change.

--- Anytao.Common.Caching/ICache.cs
+++ Anytao.Common.Caching/ICache.cs
@@ -13,5 +13,7 @@
     /// https://github.com/anytao/atcache
     public interface ICache<TKey, TValue>
     {
+        // Define the cache abstractioin
+
     }
 }


This one works

This one works

--- App/Sunny.Core/Business/News.cs
+++ App/Sunny.Core/Business/News.cs
@@ -19,7 +19,7 @@
             {

                 var news = await Mvx.Resolve<INewsService>().GetNewsForMissionId(id);
-                if (NewsForMission[id] != null)
+                if (NewsForMission.ContainsKey(id))
                 {
                     NewsForMission[id] = news;
                 }


(Cyberworks): generalized archive name parsing.

--- ArcFormats/Cyberworks/ArcDAT.cs
+++ ArcFormats/Cyberworks/ArcDAT.cs
@@ -27,6 +27,7 @@
 using System.Collections.Generic;
 using System.ComponentModel.Composition;
 using System.IO;
+using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
 using GameRes.Compression;
@@ -47,6 +48,74 @@
         }
     }

+    internal abstract class ArchiveNameParser
+    {
+        protected Regex m_regex;
+
+        protected ArchiveNameParser (string pattern)
+        {
+            m_regex = new Regex (pattern, RegexOptions.IgnoreCase);
+        }
+
+        public Tuple<string, int> ParseName (string arc_name)
+        {
+            var match = m_regex.Match (arc_name);
+            if (!match.Success)
+                return null;
+            int arc_idx;
+            var toc_name = ParseMatch (match, out arc_idx);
+            if (null == toc_name)
+                return null;
+            return Tuple.Create (toc_name, arc_idx);
+        }
+
+        protected abstract string ParseMatch (Match match, out int arc_idx);
+    }
+
+    internal class ArcNameParser : ArchiveNameParser
+    {
+        public ArcNameParser () : base (@"^.+0(?<id>(?<num>\d)(?<idx>[a-z])?)(?:|\..*)$") { }
+
+        protected override string ParseMatch (Match match, out int arc_idx)
+        {
+            arc_idx = 0;
+            char num = match.Groups["num"].Value[0];
+            if (num < '4' || num > '6')
+                return null;
+            if (match.Groups["idx"].Success)
+                arc_idx = char.ToUpper (match.Groups["idx"].Value[0]) - '@';
+
+            var toc_name_builder = new StringBuilder (match.Value);
+            var num_pos = match.Groups["id"].Index;
+            toc_name_builder.Remove (num_pos, match.Groups["id"].Length);
+            toc_name_builder.Insert (num_pos, num-'3');
+            return toc_name_builder.ToString();
+        }
+    }
+
+    internal class DatNameParser : ArchiveNameParser
+    {
+        public DatNameParser () : base (@"^(?<name>d[a-z]+?)(?<idx>[ah])?\.dat$") { }
+
+        protected override string ParseMatch (Match match, out int arc_idx)
+        {
+            var toc_name_builder = new StringBuilder (match.Groups["name"].Value);
+            arc_idx = 0;
+            if (match.Groups["idx"].Success)
+            {
+                if ('a' == match.Groups["idx"].Value[0])
+                {
+                    arc_idx = 1;
+                    toc_name_builder.Append ('h');
+                }
+            }
+            else
+                toc_name_builder.Append ('h');
+            toc_name_builder.Append (".dat");
+            return toc_name_builder.ToString();
+        }
+    }
+
     [Export(typeof(ArchiveFormat))]
     public class DatOpener : ArchiveFormat
     {
@@ -61,47 +130,17 @@
             Extensions = new string[] { "dat", "04", "05", "06" };
         }

-        static Regex s_arcname_re = new Regex (@"^.+0(?<id>(?<num>\d)(?<idx>[a-z])?)(?:|\..*)$", RegexOptions.IgnoreCase);
-        static Regex s_datname_re = new Regex (@"^(?<name>d[a-z]+?)(?<idx>[ah])?\.dat$", RegexOptions.IgnoreCase);
+        static readonly ArchiveNameParser[] s_name_parsers = { new ArcNameParser(), new DatNameParser() };

         public override ArcFile TryOpen (ArcView file)
         {
             var arc_name = Path.GetFileName (file.Name);
-            int arc_idx = 0;
-            StringBuilder toc_name_builder;
-            var match = s_arcname_re.Match (arc_name);
-            if (match.Success)
-            {
-                char num = match.Groups["num"].Value[0];
-                if (num < '4' || num > '6')
-                    return null;
-                if (match.Groups["idx"].Success)
-                    arc_idx = char.ToUpper (match.Groups["idx"].Value[0]) - '@';
-
-                toc_name_builder = new StringBuilder (arc_name);
-                var num_pos = match.Groups["id"].Index;
-                toc_name_builder.Remove (num_pos, match.Groups["id"].Length);
-                toc_name_builder.Insert (num_pos, num-'3');
-            }
-            else if ((match = s_datname_re.Match (arc_name)).Success)
-            {
-                toc_name_builder = new StringBuilder (match.Groups["name"].Value);
-                if (match.Groups["idx"].Success)
-                {
-                    if ('a' == match.Groups["idx"].Value[0])
-                    {
-                        arc_idx = 1;
-                        toc_name_builder.Append ('h');
-                    }
-                }
-                else
-                    toc_name_builder.Append ('h');
-                toc_name_builder.Append (".dat");
-            }
-            else
-                return null;
-
-            var toc_name = toc_name_builder.ToString();
+            var result = s_name_parsers.Select (p => p.ParseName (arc_name)).FirstOrDefault (p => p != null);
+            if (null == result)
+                return null;
+            string toc_name = result.Item1;
+            int arc_idx = result.Item2;
+
             toc_name = VFS.CombinePath (VFS.GetDirectoryName (file.Name), toc_name);
             if (!VFS.FileExists (toc_name))
                 return null;


Default or custom ?

Default or custom ?

--- AngleSharp/DOM/Css/Media/CSSMedium.cs
+++ AngleSharp/DOM/Css/Media/CSSMedium.cs
@@ -209,6 +209,11 @@
             {
                 _name = name;
                 _value = value;
+
+                if (value == null)
+                    TakeDefault();
+                else
+                    Consider(value);
             }

             /// <summary>
@@ -225,6 +230,16 @@
             public CSSValue Value
             {
                 get { return _value; }
+            }
+
+            protected virtual void TakeDefault()
+            {
+                //TODO
+            }
+
+            protected virtual void Consider(CSSValue value)
+            {
+                //TODO
             }

             /// <summary>


Fix setting value

Fix setting value

--- AnimatorComponent/AnimatorSettings.cs
+++ AnimatorComponent/AnimatorSettings.cs
@@ -216,7 +216,7 @@
         [SerializeField]
         private Texture[] gizmoIcons;

-        private string gizmosSubfolder = "PathAnimator/";
+        private string gizmosSubfolder = "AnimationPathAnimator/";

         [SerializeField]
         private float maxPositionLerpSpeed = 1;


Release 1.12.1

Release 1.12.1

--- ArxOne.Ftp/Properties/AssemblyInfo.cs
+++ ArxOne.Ftp/Properties/AssemblyInfo.cs
@@ -21,8 +21,8 @@
 [assembly: AssemblyCulture("")]
 [assembly: NeutralResourcesLanguage("en")]

-[assembly: AssemblyVersion("1.12")]
-[assembly: AssemblyFileVersion("1.12")]
+[assembly: AssemblyVersion("1.12.1")]
+[assembly: AssemblyFileVersion("1.12.1")]

 [assembly: CLSCompliant(true)]


Reverted back to old rolling resistance calculation

--- Assets/Plugins/PrimeTyre/PrimeTyre.cs
+++ Assets/Plugins/PrimeTyre/PrimeTyre.cs
@@ -27,7 +27,7 @@
         private float _rollingResistance = 0.001f;

         [SerializeField]
-        private FrictionCurve ForwardFriction = new FrictionCurve
+        private FrictionCurve _forwardFriction = new FrictionCurve
         {
             ExtremumSlip = 0.4f,
             ExtremumValue = 1.0f,
@@ -37,7 +37,7 @@
         };

         [SerializeField]
-        private FrictionCurve SidewaysFriction = new FrictionCurve
+        private FrictionCurve _sidewaysFriction = new FrictionCurve
         {
             ExtremumSlip = 0.2f,
             ExtremumValue = 1.0f,
@@ -119,10 +119,8 @@
         private float GetLongitudinalForce(float normalForce, float longitudinalSpeed)
         {
             _differentialSlipRatio += CalculateSlipDelta(_differentialSlipRatio, longitudinalSpeed) * Time.fixedDeltaTime;
-            var rollingResistanceForce = _angularSpeed * _wheelRadius * _rollingResistance * normalForce;
-            var frictionForce = Mathf.Sign(_differentialSlipRatio) * normalForce *
-                                ForwardFriction.CalculateCoefficient(_differentialSlipRatio);
-            return frictionForce - rollingResistanceForce;
+            return Mathf.Sign(_differentialSlipRatio) * normalForce *
+                                _forwardFriction.CalculateCoefficient(_differentialSlipRatio);
         }

         private float CalculateSlipDelta(float differentialSlipRatio, float longitudinalSpeed)
@@ -136,19 +134,20 @@
         private float GetLateralForce(float normalForce, float longitudinalSpeed, float lateralSpeed)
         {
             var slipAngle = CalculateSlipAngle(longitudinalSpeed, lateralSpeed);
-            var coefficient = SidewaysFriction.CalculateCoefficient(slipAngle);
+            var coefficient = _sidewaysFriction.CalculateCoefficient(slipAngle);
             return Mathf.Sign(slipAngle) * coefficient * normalForce;
         }

-        private float CalculateSlipAngle(float longitudinalSpeed, float lateralSpeed)
+        private static float CalculateSlipAngle(float longitudinalSpeed, float lateralSpeed)
         {
             return Mathf.Atan2(lateralSpeed, Mathf.Abs(longitudinalSpeed));
         }

         private void UpdateAngularSpeed(float longitudinalForce)
         {
+            var rollingResistanceForce = _angularSpeed * _wheelRadius * _rollingResistance * _normalForce;
             var angularAcceleration = (MotorTorque - Mathf.Sign(_angularSpeed)* BrakeTorque -
-                 longitudinalForce * _wheelRadius) / _inertia;
+                 (rollingResistanceForce + longitudinalForce) * _wheelRadius) / _inertia;
             _angularSpeed += angularAcceleration * Time.fixedDeltaTime;
             _rotation = (_rotation + _angularSpeed * Time.fixedDeltaTime) % (2 * Mathf.PI);
         }


God mode in progress

God mode in progress


fixed

fixed

--- AutoSharpporting/Autoplay/Autoplay.cs
+++ AutoSharpporting/Autoplay/Autoplay.cs
@@ -49,6 +49,7 @@
         private static bool _overrideAttackUnitAction = false;
         private static int _lastSwitched = 0;
         private static bool _tookRecallDecision = false;
+        private static int _lastTimeTookRecallDecision = 0;

         public Autoplay()
         {
@@ -60,7 +61,7 @@

         public static bool RandomDecision()
         {
-            return Rand.Next(0, 20) > 13; //Hi there riot games ^^
+            return Rand.Next(0, 20) > 10; //Hi there riot games ^^
         }

         private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
@@ -123,7 +124,12 @@
             MetaHandler.DoChecks();
             MetaHandler.UpdateObjects();
             if (Bot.InFountain()) _tookRecallDecision = false;
-            if (Carry != null && Carry.IsDead && RandomDecision()) _tookRecallDecision = true;
+            if (Carry != null && Carry.IsDead && RandomDecision() &&
+                Environment.TickCount - _lastTimeTookRecallDecision > Rand.Next(60000, 300000))
+            {
+                _tookRecallDecision = true;
+                _lastTimeTookRecallDecision = Environment.TickCount;
+            }
         }

         public static void OnGameEnd(EventArgs args)


rename rectIsNotContainedInRectangles=>doesNotContain

--- src/Rectangles.cs
+++ src/Rectangles.cs
@@ -17,7 +17,7 @@

         public void AddRectangle(Rectangle r)
         {
-			if (rectIsNotContainedInRectangles (r)) {
+			if (doesNotContain (r)) {
 				list.Add (r);
 				boundsUpToDate = false;
 			}
@@ -28,7 +28,7 @@
 			_bounds = Rectangle.Empty;
 			boundsUpToDate = true;
         }
-        bool rectIsNotContainedInRectangles(Rectangle r)
+        bool doesNotContain(Rectangle r)
         {
             foreach (Rectangle rInList in list)
                 if (rInList.ContainsOrIsEqual(r))


fixed ButtonGroupInternal typo

fixed ButtonGroupInternal typo

--- BForms/Html/SelectExtensions.cs
+++ BForms/Html/SelectExtensions.cs
@@ -174,7 +174,7 @@
                     case BsControlType.ButtonGroup:
                         allowMultiple = false;
                         htmlSelect =
-                            BsButtonGroupIternal(htmlHelper, name, selectList,
+                            BsButtonGroupInternal(htmlHelper, name, selectList,
                             optionLabel, htmlAttributes, bsCssClass, metadata).ToHtmlString();
                         break;
                     default:
@@ -510,7 +510,7 @@
             return MvcHtmlString.Create(tagBuilder.ToString());
         }

-        private static MvcHtmlString BsButtonGroupIternal<TKey>(this HtmlHelper htmlHelper, string name,
+        private static MvcHtmlString BsButtonGroupInternal<TKey>(this HtmlHelper htmlHelper, string name,
            BsSelectList<TKey> selectList, string optionLabel, IDictionary<string, object> htmlAttributes, string bsCssClass, ModelMetadata metadata = null)
         {
             name += ".SelectedValues";


Fixed Radio List Validation Properties

Fixed Radio List Validation Properties

--- BForms/Html/SelectExtensions.cs
+++ BForms/Html/SelectExtensions.cs
@@ -304,7 +304,7 @@
         }

         private static MvcHtmlString BsRadioListInternal<TKey>(this HtmlHelper htmlHelper, string name,
-            BsSelectList<TKey> radioList, IDictionary<string, object> htmlAttributes, bool allowMultiple, string bsCssClass, ModelMetadata metadata = null)
+           BsSelectList<TKey> radioList, IDictionary<string, object> htmlAttributes, bool allowMultiple, string bsCssClass, ModelMetadata metadata = null)
         {
             //TODO: refactoring
             //bind the selected values BsSelectList.SelectedValues
@@ -316,11 +316,18 @@
             divTag.MergeAttribute("id", fullName, true);
             divTag.AddCssClass(bsCssClass);
             divTag.AddCssClass("form-control");
-
+

             if (htmlAttributes != null)
             {
                 divTag.MergeAttributes(htmlAttributes);
+            }
+
+            // Create a radio button temporary to get the common SelectListValidation (hack to preverv them)
+            var commonRadioBuilder = new TagBuilder("input");
+            if (radioList.Items.Any())
+            {
+                commonRadioBuilder.BsSelectListValidation(htmlHelper, name, metadata);
             }

             // Create a radio button for each item in the list
@@ -345,14 +352,18 @@
                     });
                 }

-                //build radio or checkbox input
+                // build radio or checkbox input
                 var input = string.Empty;
                 var radioBuilder = new TagBuilder("input");
                 radioBuilder.MergeAttribute("name", fullName, true);
                 radioBuilder.MergeAttributes(radioHtmlAttributes);
-                if (item.Selected) radioBuilder.MergeAttribute("checked", "checked");
-
-                radioBuilder.BsSelectListValidation(htmlHelper, name, metadata);
+                if (item.Selected)
+                {
+                    radioBuilder.MergeAttribute("checked", "checked");
+                }
+
+                // merge common atributes
+                radioBuilder.MergeAttributes(commonRadioBuilder.Attributes);

                 if (allowMultiple)
                 {


Adding validation to ensure unified QR code works as expected

--- BTCPayServer.Tests/UnitTest1.cs
+++ BTCPayServer.Tests/UnitTest1.cs
@@ -1995,6 +1995,56 @@
             }
         }

+        [Fact]
+        [Trait("Integration", "Integration")]
+        public async Task CanSetUnifiedQrCode()
+        {
+            using (var tester = ServerTester.Create())
+            {
+                tester.ActivateLightning();
+                await tester.StartAsync();
+                await tester.EnsureChannelsSetup();
+                var user = tester.NewAccount();
+                user.GrantAccess();
+                user.RegisterDerivationScheme("BTC");
+                user.RegisterLightningNode("BTC", LightningConnectionType.CLightning);
+
+                var invoice = user.BitPay.CreateInvoice(
+                    new Invoice()
+                    {
+                        Price = 5.5m,
+                        Currency = "USD",
+                        PosData = "posData",
+                        OrderId = "orderId",
+                        ItemDesc = "Some description",
+                        FullNotifications = true
+                    }, Facade.Merchant);
+
+                // validate that invoice data model doesn't have lightning string initially
+                var res = await user.GetController<InvoiceController>().Checkout(invoice.Id);
+                var paymentMethodFirst = Assert.IsType<PaymentModel>(
+                    Assert.IsType<ViewResult>(res).Model
+                );
+                Assert.DoesNotContain("&lightning=", paymentMethodFirst.InvoiceBitcoinUrlQR);
+
+                // enable unified QR code in settings
+                var vm = Assert.IsType<CheckoutExperienceViewModel>(Assert
+                    .IsType<ViewResult>(user.GetController<StoresController>().CheckoutExperience()).Model
+                );
+                vm.OnChainWithLnInvoiceFallback = true;
+                Assert.IsType<RedirectToActionResult>(
+                    user.GetController<StoresController>().CheckoutExperience(vm).Result
+                );
+
+                // validate that QR code now has both onchain and offchain payment urls
+                res = await user.GetController<InvoiceController>().Checkout(invoice.Id);
+                var paymentMethodSecond = Assert.IsType<PaymentModel>(
+                    Assert.IsType<ViewResult>(res).Model
+                );
+                Assert.Contains("&lightning=", paymentMethodSecond.InvoiceBitcoinUrlQR);
+            }
+        }
+
         [Fact(Timeout = 60 * 2 * 1000)]
         [Trait("Integration", "Integration")]
         [Trait("Lightning", "Lightning")]


Delete redundant wrapper methods

Delete redundant wrapper methods

--- BobTheBuilder/DynamicBuilder.cs
+++ BobTheBuilder/DynamicBuilder.cs
@@ -34,39 +34,24 @@
             var destinationType = typeof(T);
             EvaluateMissingMembers(destinationType);

-            var constructorArguments = GetConstructorArguments(destinationType);
+            var constructorArguments = new ConstructorArgumentsQuery(argumentStore).Execute(destinationType);

-            var propertyValues = GetPropertyValues(destinationType);
+            var propertyValues = new PropertyValuesQuery(argumentStore).Execute(destinationType);

             var instance = CreateInstanceOfType(constructorArguments);
             PopulatePublicSettableProperties(instance, propertyValues);
             return instance;
         }

-        private IEnumerable<MemberNameAndValue> GetConstructorArguments(Type destinationType)
-        {
-            return new ConstructorArgumentsQuery(argumentStore).Execute(destinationType);
-        }
-
-        private IEnumerable<MemberNameAndValue> GetPropertyValues(Type destinationType)
-        {
-            return new PropertyValuesQuery(argumentStore).Execute(destinationType);
-        }
-
         private void EvaluateMissingMembers(Type destinationType)
         {
-            var missingArguments = GetMissingMembers(destinationType);
+            var missingArguments = new MissingArgumentsQuery(argumentStore).Execute(destinationType);
             if (missingArguments.Any())
             {
                 var missingMember = missingArguments.First();
                 throw new MissingMemberException(string.Format(@"The property ""{0}"" does not exist on ""{1}""",
                     missingMember.Name, destinationType.Name));
             }
-        }
-
-        private IEnumerable<MemberNameAndValue> GetMissingMembers(Type destinationType)
-        {
-            return new MissingArgumentsQuery(argumentStore).Execute(destinationType);
         }

         private static T CreateInstanceOfType(IEnumerable<MemberNameAndValue> constructorArguments)


update

update

--- CSharpGL/Scene/Scene.Picking.cs
+++ CSharpGL/Scene/Scene.Picking.cs
@@ -10,30 +10,35 @@
         /// <summary>
         /// Pick
         /// </summary>
-        /// <param name="mousePosition">mouse position.</param>
+        /// <param name="mousePosition">mouse position in windows coordinate system.(Left Up is (0, 0))</param>
         /// <param name="pickingGeometryType">target's geometry type.</param>
         /// <returns></returns>
         public PickedGeometry ColorCodedPicking(Point mousePosition, GeometryType pickingGeometryType)
         {
             Rectangle clientRectangle = this.Canvas.ClientRectangle;
+            // if mouse is out of window's area, nothing picked.
             if (mousePosition.X < 0 || clientRectangle.Width <= mousePosition.X || mousePosition.Y < 0 || clientRectangle.Height <= mousePosition.Y) { return null; }

-            Rectangle target = new Rectangle(mousePosition.X, mousePosition.Y, 1, 1);
-            Rectangle target2 = new Rectangle(mousePosition.X, clientRectangle.Height - mousePosition.Y - 1, 1, 1);
-            if (!PickedSomething(target2)) { return null; }
+            int height = clientRectangle.Height;
+
+            // rect in OpenGL's window coordinate system.
+            Rectangle rect = new Rectangle(mousePosition.X, height - mousePosition.Y - 1, 1, 1);
+            if (!PickedSomething(rect)) // if depth buffer is invalid in specified rect, nothing picked.
+            { return null; }

             lock (this.synObj)
             {
                 var arg = new RenderEventArgs(RenderModes.ColorCodedPicking, clientRectangle, this.FirstCamera, pickingGeometryType);
+                // Render all PickableRenderers for color-coded picking.
                 List<IColorCodedPicking> pickableRendererList = Render4Picking(arg);
-
-                List<Tuple<Point, uint>> stageVertexIdList = ReadPixels(target, target2);
-
+                // Read pixels in specified rect and get the VertexIds they represent.
+                List<Tuple<Point, uint>> stageVertexIdList = ReadPixels(rect);
+                // Get all picked geometrys.
                 var result = new List<Tuple<Point, PickedGeometry>>();
                 foreach (var tuple in stageVertexIdList)
                 {
                     int x = tuple.Item1.X;
-                    int y = tuple.Item1.Y;
+                    int y = height - tuple.Item1.Y - 1;// turn back to windows coordinate system.
                     //if (x < 0 || clientRectangle.Width <= x || y < 0 || clientRectangle.Height <= y) { continue; }

                     uint stageVertexId = tuple.Item2;
@@ -51,14 +56,19 @@
             return null;
         }

-        private static unsafe bool PickedSomething(Rectangle target2)
-        {
-            if (target2.Width <= 0 || target2.Height <= 0) { return false; }
+        /// <summary>
+        /// Maybe something is picked because depth buffer is valid.
+        /// </summary>
+        /// <param name="rect"></param>
+        /// <returns></returns>
+        private static unsafe bool PickedSomething(Rectangle rect)
+        {
+            if (rect.Width <= 0 || rect.Height <= 0) { return false; }

             bool result = false;
-            using (var codedColor = new UnmanagedArray<byte>(target2.Width * target2.Height))
-            {
-                OpenGL.ReadPixels(target2.X, target2.Y, target2.Width, target2.Height,
+            using (var codedColor = new UnmanagedArray<byte>(rect.Width * rect.Height))
+            {
+                OpenGL.ReadPixels(rect.X, rect.Y, rect.Width, rect.Height,
                     OpenGL.GL_DEPTH_COMPONENT, OpenGL.GL_UNSIGNED_BYTE, codedColor.Header);

                 var array = (byte*)codedColor.Header.ToPointer();
@@ -75,6 +85,11 @@
             return result;
         }

+        /// <summary>
+        /// Render all <see cref="PickableRenderer"/>s for color-coded picking.
+        /// </summary>
+        /// <param name="arg"></param>
+        /// <returns></returns>
         private List<IColorCodedPicking> Render4Picking(RenderEventArgs arg)
         {
             // record clear color
@@ -168,20 +183,18 @@
         }

         /// <summary>
-        /// <para>Read pixels in specified rect and get the VertexIds they represent.</para>
+        /// Read pixels in specified rect and get the VertexIds they represent.
         /// </summary>
         /// <param name="target"></param>
-        /// <param name="canvasHeight"></param>
-        /// <returns></returns>
-        private static unsafe List<Tuple<Point, uint>> ReadPixels(
-            Rectangle target, Rectangle target2)
+        /// <returns></returns>
+        private static unsafe List<Tuple<Point, uint>> ReadPixels(Rectangle target)
         {
             var result = new List<Tuple<Point, uint>>();

             // get coded color.
             using (var codedColor = new UnmanagedArray<Pixel>(target.Width * target.Height))
             {
-                OpenGL.ReadPixels(target.X, target2.Y, target.Width, target.Height,
+                OpenGL.ReadPixels(target.X, target.Y, target.Width, target.Height,
                     OpenGL.GL_RGBA, OpenGL.GL_UNSIGNED_BYTE, codedColor.Header);

                 var array = (Pixel*)codedColor.Header.ToPointer();


Update Cake.Issues.Recipe to 0.4.2

Update Cake.Issues.Recipe to 0.4.2

--- Cake.Recipe/Content/addins.cake
+++ Cake.Recipe/Content/addins.cake
@@ -21,7 +21,7 @@
 #addin nuget:?package=Cake.Twitter&version=0.10.1
 #addin nuget:?package=Cake.Wyam&version=2.2.9

-#load nuget:?package=Cake.Issues.Recipe&version=0.4.1
+#load nuget:?package=Cake.Issues.Recipe&version=0.4.2

 Action<string, IDictionary<string, string>> RequireAddin = (code, envVars) => {
     var script = MakeAbsolute(File(string.Format("./{0}.cake", Guid.NewGuid())));


Remove #if directives from AssemblyLoader.cs.

--- ClientStarter/AssemblyLoader.cs
+++ ClientStarter/AssemblyLoader.cs
@@ -7,17 +7,14 @@
 // http://opensource.org/licenses/mit-license.php
 //

-#if NETCOREAPP1_1
 using Microsoft.Extensions.DependencyModel;
 using System.Runtime.Loader;
-#endif
 using System.IO;
 using System.Linq;
 using System.Reflection;

 namespace AIWolf
 {
-#if NETCOREAPP1_1
     public class AssemblyLoader : AssemblyLoadContext
     {
         string folderPath;
@@ -43,5 +40,4 @@
             return Assembly.Load(assemblyName);
         }
     }
-#endif
 }