KVDBLayer: commented assert on overflow of cache, in case of high load it can happen

--- BTDB/KVDBLayer/Implementation/KeyValueDB.cs
+++ BTDB/KVDBLayer/Implementation/KeyValueDB.cs
@@ -1991,7 +1991,7 @@

         void NewSectorAddedToCache(int sectorsInCache, int bytesInCache)
         {
-            Debug.Assert((sectorsInCache * 64 + bytesInCache) / (1024 * 1024) < _cacheSizeInMB + 2);
+            //Debug.Assert((sectorsInCache * 64 + bytesInCache) / (1024 * 1024) < _cacheSizeInMB + 2);
         }

         bool CheckDB(State state)


#17237: Multiple clicks of Sign-in link cause multiple ReturnUrl values to be appended

--HG--
branch : dev

--- src/Orchard.Web/Core/Shapes/Views/User.cshtml
+++ src/Orchard.Web/Core/Shapes/Views/User.cshtml
@@ -10,6 +10,6 @@
             @Html.ActionLink("Dashboard", "Index", new { Area = "Dashboard", Controller = "Admin" })

     } else {
-        @Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
+        @Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = (Request.QueryString["ReturnUrl"] ?? Request.RawUrl) })
     }


Testing for PreferLocalPlacementGrain failure recovery.

- Test case PreferLocalPlacementGrain_ShouldMigrateWhenHostSiloKilled

- Test case PreferLocalPlacementGrain_ShouldNotMigrateWhenOtherSiloKilled

Make test cases fail more reliably

- Test all combinations of placement of Primary / Secondary silos for each test case.

- Now always get 2 fails and 2 succeeds.

- Mark test cases as Skip for the moment.

--- test/TesterInternal/General/GrainPlacementTests.cs
+++ test/TesterInternal/General/GrainPlacementTests.cs
@@ -7,15 +7,24 @@
 using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
 using Orleans;
 using Orleans.Runtime;
+using Orleans.Runtime.Configuration;
 using Orleans.TestingHost;
 using UnitTests.GrainInterfaces;
 using Xunit;
-using UnitTests.Tester;
+using Xunit.Abstractions;

 namespace UnitTests.General
 {
     public class GrainPlacementTests : HostedTestClusterPerTest
     {
+        private readonly ITestOutputHelper output;
+
+        public GrainPlacementTests(ITestOutputHelper output)
+        {
+            this.output = output;
+            output.WriteLine("GrainPlacementTests - constructor");
+        }
+
         public override TestingSiloHost CreateSiloHost()
         {
             return new TestingSiloHost(
@@ -179,5 +188,119 @@
             Assert.IsTrue(actual.All(expected.Equals),
                 "A grain instantiated with the local placement strategy should create activations on the local silo.");
         }
+
+        [Theory(Skip = "Repo test case for gateway silo connection issue #1859")]
+        [InlineData("Primary")]
+        [InlineData("Secondary")]
+        [TestCategory("BVT"), TestCategory("Placement")]
+        public async Task PreferLocalPlacementGrain_ShouldMigrateWhenHostSiloKilled(string value)
+        {
+            await HostedCluster.WaitForLivenessToStabilizeAsync();
+            output.WriteLine("******************** Starting test ({0}) ********************", value);
+            TestSilosStarted(2);
+
+            foreach (SiloHandle silo in HostedCluster.GetActiveSilos())
+            {
+                NodeConfiguration cfg = silo.Silo.LocalConfig;
+                Assert.IsNotNull(cfg, "NodeConfiguration should be present for silo " + silo);
+                output.WriteLine(
+                    "Silo {0} : Address = {1} Proxy gateway: {2}",
+                    cfg.SiloName, cfg.Endpoint, cfg.ProxyGatewayEndpoint);
+            }
+
+            IPEndPoint targetSilo;
+            if (value == "Primary")
+            {
+                targetSilo = HostedCluster.Primary.Endpoint;
+            }
+            else
+            {
+                targetSilo = HostedCluster.Secondary.Endpoint;
+            }
+            Guid proxyKey;
+            IRandomPlacementTestGrain proxy;
+            IPEndPoint expected;
+            do
+            {
+                proxyKey = Guid.NewGuid();
+                proxy = GrainFactory.GetGrain<IRandomPlacementTestGrain>(proxyKey);
+                expected = await proxy.GetEndpoint();
+            } while (!targetSilo.Equals(expected));
+            output.WriteLine("Proxy grain was originally located on silo {0}", expected);
+
+            Guid grainKey = proxyKey;
+            await proxy.StartPreferLocalGrain(grainKey);
+            IPreferLocalPlacementTestGrain grain = GrainFactory.GetGrain<IPreferLocalPlacementTestGrain>(grainKey);
+            IPEndPoint actual = await grain.GetEndpoint();
+            output.WriteLine("PreferLocalPlacement grain was originally located on silo {0}", actual);
+            Assert.AreEqual(expected, actual,
+                "PreferLocalPlacement strategy should create activations on the local silo.");
+
+            SiloHandle siloToKill = HostedCluster.GetActiveSilos().First(s => s.Endpoint.Equals(expected));
+            output.WriteLine("Killing silo {0} hosting locally placed grain", siloToKill);
+            HostedCluster.StopSilo(siloToKill);
+
+            IPEndPoint newActual = await grain.GetEndpoint();
+            output.WriteLine("PreferLocalPlacement grain was recreated on silo {0}", newActual);
+            Assert.AreNotEqual(expected, newActual,
+                "PreferLocalPlacement strategy should recreate activations on other silo if local fails.");
+        }
+
+        [Theory(Skip = "Repo test case for gateway silo connection issue #1859")]
+        [InlineData("Primary")]
+        [InlineData("Secondary")]
+        [TestCategory("BVT"), TestCategory("Placement")]
+        public async Task PreferLocalPlacementGrain_ShouldNotMigrateWhenOtherSiloKilled(string value)
+        {
+            await HostedCluster.WaitForLivenessToStabilizeAsync();
+            output.WriteLine("******************** Starting test ({0}) ********************", value);
+            TestSilosStarted(2);
+
+            foreach (SiloHandle silo in HostedCluster.GetActiveSilos())
+            {
+                NodeConfiguration cfg = silo.Silo.LocalConfig;
+                Assert.IsNotNull(cfg, "NodeConfiguration should be present for silo " + silo);
+                output.WriteLine(
+                    "Silo {0} : Address = {1} Proxy gateway: {2}",
+                    cfg.SiloName, cfg.Endpoint, cfg.ProxyGatewayEndpoint);
+            }
+
+            IPEndPoint targetSilo;
+            if (value == "Primary")
+            {
+                targetSilo = HostedCluster.Primary.Endpoint;
+            }
+            else
+            {
+                targetSilo = HostedCluster.Secondary.Endpoint;
+            }
+            Guid proxyKey;
+            IRandomPlacementTestGrain proxy;
+            IPEndPoint expected;
+            do
+            {
+                proxyKey = Guid.NewGuid();
+                proxy = GrainFactory.GetGrain<IRandomPlacementTestGrain>(proxyKey);
+                expected = await proxy.GetEndpoint();
+            } while (!targetSilo.Equals(expected));
+            output.WriteLine("Proxy grain was originally located on silo {0}", expected);
+
+            Guid grainKey = proxyKey;
+            await proxy.StartPreferLocalGrain(grainKey);
+            IPreferLocalPlacementTestGrain grain = GrainFactory.GetGrain<IPreferLocalPlacementTestGrain>(grainKey);
+            IPEndPoint actual = await grain.GetEndpoint();
+            output.WriteLine("PreferLocalPlacement grain was originally located on silo {0}", actual);
+            Assert.AreEqual(expected, actual,
+                "PreferLocalPlacement strategy should create activations on the local silo.");
+
+            SiloHandle siloToKill = HostedCluster.GetActiveSilos().First(s => !s.Endpoint.Equals(expected));
+            output.WriteLine("Killing other silo {0} not hosting locally placed grain", siloToKill);
+            HostedCluster.StopSilo(siloToKill);
+
+            IPEndPoint newActual = await grain.GetEndpoint();
+            output.WriteLine("PreferLocalPlacement grain is now located on silo {0}", newActual);
+            Assert.AreEqual(expected, newActual,
+                "PreferLocalPlacement strategy should not move activations when other non-hosting silo fails.");
+        }
     }
-}+}


Update InAppBilling.apple.cs

Update InAppBilling.apple.cs

Hopefully will return a Token for a restored purchase on iOS

--- src/Plugin.InAppBilling/InAppBilling.apple.cs
+++ src/Plugin.InAppBilling/InAppBilling.apple.cs
@@ -505,15 +505,24 @@
 			if (p == null)
 				return null;

-
-			return new InAppBillingPurchase
+            string _purchaseToken = null;
+            if (String.IsNullOrEmpty(p.TransactionReceipt?.GetBase64EncodedString(NSDataBase64EncodingOptions.None)))
+            {
+                _purchaseToken = transaction.TransactionReceipt?.GetBase64EncodedString(NSDataBase64EncodingOptions.None);
+			}
+            else
+            {
+                _purchaseToken = p.TransactionReceipt?.GetBase64EncodedString(NSDataBase64EncodingOptions.None);
+			}
+
+            return new InAppBillingPurchase
 			{
 				TransactionDateUtc = NSDateToDateTimeUtc(transaction.TransactionDate),
 				Id = p.TransactionIdentifier,
 				ProductId = p.Payment?.ProductIdentifier ?? string.Empty,
 				State = p.GetPurchaseState(),
-				PurchaseToken = p.TransactionReceipt?.GetBase64EncodedString(NSDataBase64EncodingOptions.None) ?? string.Empty
-			};
+				PurchaseToken = _purchaseToken
+            };
 		}

 		static DateTime NSDateToDateTimeUtc(NSDate date)


exception handling for cheatsheet.md not found

--- GitTool/MainForm.cs
+++ GitTool/MainForm.cs
@@ -34,8 +34,16 @@

         private void PopulateCheats()
         {
-            string[] lines = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + "cheatsheet.md");
-            foreach(string line in lines)
+            string[] lines;
+            try
+            {
+                lines = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + "cheatsheet.md");
+            }
+            catch
+            {
+                return;
+            }
+            foreach (string line in lines)
             {
                 if (line.StartsWith(CHEATSHEET_COMMAND_START))
                 {


Update code

Update code

--- BindingSample/DynamicBindingWpf/AppModel.cs
+++ BindingSample/DynamicBindingWpf/AppModel.cs
@@ -4,19 +4,20 @@
 {
     public class AppModel
     {
-        public dynamic TextModel { get; } = new TextModel().ToDynamicNotifiable();
+        public dynamic TextModel { get; } = new TextModel().ToDynamicNotifiable(300);
     }

     public class TextModel
     {
-        string input;
+        string _Input;
+
         public string Input
         {
-            get { return input; }
+            get { return _Input; }
             set
             {
-                input = value;
-                Output = input?.ToUpper();
+                _Input = value;
+                Output = _Input?.ToUpper();
             }
         }


use paralell foreach instead of creating a large number of tasks

--- BitSharp.Node/Workers/BlockRequestWorker.cs
+++ BitSharp.Node/Workers/BlockRequestWorker.cs
@@ -215,42 +215,35 @@
                 }
             }

-            // reset target queue index
-            this.targetChainQueueIndex = 0;
-
             // get blocks from secondary source, if specified
             if (SecondaryBlockFolders != null && SecondaryBlockFolders.Length > 0)
             {
-                var getBlockTasks = new List<Task>();
-
                 var allRetrieved = true;
-                for (; this.targetChainQueueIndex < this.targetChainQueue.Count; this.targetChainQueueIndex++)
-                {
-                    if (!this.IsStarted)
-                        break;
-
-                    var requestBlock = this.targetChainQueue[this.targetChainQueueIndex];
-
-                    if (!this.flushBlocks.Contains(requestBlock.Hash)
-                        && !this.coreStorage.ContainsBlockTxes(requestBlock.Hash))
+                Parallel.ForEach(this.targetChainQueue,
+                    (requestBlock, loopState) =>
                     {
-                        getBlockTasks.Add(Task.Run(() =>
-                            {
-                                var block = GetBlock(requestBlock.Hash);
-                                if (block != null)
-                                    HandleBlock(null, block);
-                                else
-                                    allRetrieved = false;
-                            }));
-                    }
-                }
-
-                await Task.WhenAll(getBlockTasks.ToArray());
+                        if (!this.IsStarted)
+                        {
+                            loopState.Stop();
+                            return;
+                        }
+
+                        if (!this.flushBlocks.Contains(requestBlock.Hash)
+                            && !this.coreStorage.ContainsBlockTxes(requestBlock.Hash))
+                        {
+                            var block = GetBlock(requestBlock.Hash);
+                            if (block != null)
+                                HandleBlock(null, block);
+                            else
+                                allRetrieved = false;
+                        }
+                    });

                 // all blocks retrieved from secondary source
                 // return now so that the target chain queue can be updated
-                if (allRetrieved && this.targetChainQueueIndex >= this.targetChainQueue.Count)
-                {
+                if (allRetrieved)
+                {
+                    this.targetChainQueueIndex = this.targetChainQueue.Count;
                     this.NotifyWork();
                     return;
                 }


Add XML doc comments.

Add XML doc comments.

--- GtfsService/Feed.cs
+++ GtfsService/Feed.cs
@@ -8,12 +8,18 @@

 namespace GtfsService
 {
+	/// <summary>
+	/// Request for an agencies GTFS feed.
+	/// </summary>
 	[Route("/feed/{agency}")]
 	public class Feed
 	{
 		public string agency { get; set; }
 	}

+	/// <summary>
+	/// Retrieves a GTFS ZIP file and converts the CSV files to objects.
+	/// </summary>
 	public class FeedService : Service
 	{
 		public GtfsFeed Any(Feed request)


updated

updated

--- H3Control/H3Main.cs
+++ H3Control/H3Main.cs
@@ -69,7 +69,7 @@

             if (!nologo)
             {
-                Console.WriteLine(@"H3Control " + H3Environment.VerAsPublic + @"is a console/daemon which
+                Console.WriteLine(@"H3Control " + H3Environment.VerAsPublic + @" is a console/daemon which
    * ""Shows"" temperature, frequency and usage via built-in http server.
    * Allows to control CPU & DDR frequency
    * Allows to control number of online CPU cores


Updated return messages

Updated return messages

--- CAPPamari.Web/Controllers/UserController.cs
+++ CAPPamari.Web/Controllers/UserController.cs
@@ -23,7 +23,7 @@
             }
             bool success = UserHelper.UpdateUser(request.Username, request.Password, request.Major);
             ApplicationUserModel userData = success ? UserHelper.GetApplicationUser(request.Username) : null;
-            string message = success ? "Major changed successfully" : "Could not change major";
+            string message = success ? "Account updated successfully" : "Could not update account";
             return ApiResponse<ApplicationUserModel>.From(success, message, userData);
         }

@@ -69,7 +69,7 @@
         public ApiResponse<bool> UpdateAdvisor([FromBody] AdvisorModel request)
         {
             bool success = UserHelper.UpdateAdvisor(request);
-            string message = success ? "Advisor updated successfully" : "Could not update advisor email";
+            string message = success ? "Advisor updated successfully" : "Could not update advisor";
             return ApiResponse<bool>.SuccessResponse(message, success);
         }


fixing warnings

fixing warnings

--- PolygonMesh/Mesh.cs
+++ PolygonMesh/Mesh.cs
@@ -241,7 +241,7 @@
 				return;
 			}

-			AxisAlignedBoundingBox totalBounds = new AxisAlignedBoundingBox(Vertices[0], Vertices[0]);
+			var totalBounds = new AxisAlignedBoundingBox(Vertices[0], Vertices[0]);

 			foreach (var vertex in Vertices)
 			{
@@ -250,6 +250,7 @@

 			totalBounds.Expand(treatAsSameDistance);
 			var sameDistance = new Vector3Float(treatAsSameDistance, treatAsSameDistance, treatAsSameDistance);
+			var tinyDistance = new Vector3Float(.001, .001, .001);

 			var newVertices = new List<Vector3Float>();
 			var newFaces = new FaceList();
@@ -259,11 +260,11 @@
 			for (int i = 0; i < Vertices.Count; i++)
 			{
 				var vertex = Vertices[i];
-				positionToIndex.SearchPoint(vertex.X, vertex.Y, vertex.Z);
+				positionToIndex.SearchBounds(new AxisAlignedBoundingBox(vertex - sameDistance, vertex + sameDistance));
 				if (positionToIndex.QueryResults.Count == 0)
 				{
 					// we did not find a point close to this point so add it
-					positionToIndex.Insert(newVertices.Count, new AxisAlignedBoundingBox(vertex - sameDistance, vertex + sameDistance));
+					positionToIndex.Insert(newVertices.Count, new AxisAlignedBoundingBox(vertex - tinyDistance, vertex + tinyDistance));
 					positionToIndexFast.Add((vertex.X, vertex.Y, vertex.Z), newVertices.Count);
 					newVertices.Add(vertex);
 				}
@@ -277,7 +278,7 @@
 					return index;
 				}

-				positionToIndex.SearchPoint(position.X, position.Y, position.Z);
+				positionToIndex.SearchBounds(new AxisAlignedBoundingBox(position - sameDistance, position + sameDistance));
 				return positionToIndex.QueryResults[0];
 			}

@@ -295,15 +296,18 @@

 		/// <summary>
 		/// Split the given face on the given plane. Remove the original face
-		/// and add as many new faces as required for the split
+		/// and add as many new faces as required for the split.
 		/// </summary>
-		/// <param name="faceIndex"></param>
-		/// <param name="plane"></param>
-		/// <returns></returns>
+		/// <param name="faceIndex">The index of the face to split.</param>
+		/// <param name="plane">The plane to split the face on. The face will not be split
+		/// if it is not intersected by this plane.</param>
+		/// <param name="onPlaneDistance">If a given edge of the face has a vertex that is within
+		/// this distance of the plane, the edge will not be split.</param>
+		/// <returns>Returns if the edge was actually split.</returns>
 		public bool SplitFace(int faceIndex, Plane plane, double onPlaneDistance = .001)
 		{
-			List<Vector3Float> newVertices = new List<Vector3Float>();
-			List<Face> newFaces = new List<Face>();
+			var newVertices = new List<Vector3Float>();
+			var newFaces = new List<Face>();
 			if (Faces[faceIndex].Split(this.Vertices, plane, newFaces, newVertices, onPlaneDistance))
 			{
 				var vertexCount = Vertices.Count;
@@ -475,8 +479,6 @@
 			}
 		}

-		#region Public Members
-
 		public AxisAlignedBoundingBox GetAxisAlignedBoundingBox()
 		{
 			if (Vertices.Count == 0)
@@ -537,8 +539,6 @@
 				this.Faces.Add(firstVertex, firstVertex + i + 1, firstVertex + i + 2, this.Vertices);
 			}
 		}
-
-		#endregion Public Members
 	}

 	public static class FaceExtensionMethods
@@ -555,13 +555,15 @@
 		/// <summary>
 		/// Split the face at the given plane.
 		/// </summary>
-		/// <param name="face">The face to split</param>
-		/// <param name="faceVertices">The list containing the vertices for the face</param>
-		/// <param name="plane">The plane to split at</param>
+		/// <param name="face">The face to split.</param>
+		/// <param name="faceVertices">The list containing the vertices for the face.</param>
+		/// <param name="plane">The plane to split at.</param>
 		/// <param name="newFaces">The new faces created will be added to this list, not the mesh.</param>
 		/// <param name="newVertices">The new vertices will be added to this list, not the mesh.</param>
-		/// <param name="onPlaneDistance">Treat any distance less than this as not crossing the plane</param>
-		/// <returns>True if the face crosses the plane else false</returns>
+		/// <param name="onPlaneDistance">Treat any distance less than this as not crossing the plane.</param>
+		/// <param name="clipFace">An optional function that can be called to check if the given
+		/// face should be clipped.</param>
+		/// <returns>True if the face crosses the plane else false.</returns>
 		public static bool Split(this Face face, List<Vector3Float> faceVertices, Plane plane, List<Face> newFaces, List<Vector3Float> newVertices, double onPlaneDistance, Func<Mesh.SplitData, bool> clipFace = null)
 		{
 			var v = new Vector3Float[]
@@ -780,7 +782,6 @@
 			mesh.PlaceTextureOnFace(face, textureToUse, mesh.GetMaxPlaneProjection(face, textureToUse));
 		}

-
 		public static void PlaceTextureOnFace(this Mesh mesh, int face, ImageBuffer textureToUse, Matrix4X4 textureCoordinateMapping)
 		{
 			var uvs = new Vector2Float[3];


Added test for Spark issue #9 (search on gender:missing).

--- Sprinkler/Tests/SearchTest.cs
+++ Sprinkler/Tests/SearchTest.cs
@@ -23,10 +23,10 @@
     {
         private Bundle allPatients;

-       // [SprinklerTest("search full system without criteria")]
+        // [SprinklerTest("search full system without criteria")]
         public void SearchWithoutCriteria()
         {
-            var result = client.WholeSystemSearch(pageSize:10);
+            var result = client.WholeSystemSearch(pageSize: 10);
         }

         [SprinklerTest("SE01", "Search resource type without criteria")]
@@ -38,10 +38,10 @@
             if (result.Entries.Count == 0)
                 TestResult.Fail("search did not return any results");

-            if(result.Entries.Count > 10)
+            if (result.Entries.Count > 10)
                 TestResult.Fail("search returned more patients than specified in _count");

-            if(result.Entries.ByResourceType<Patient>().Count() ==0)
+            if (result.Entries.ByResourceType<Patient>().Count() == 0)
                 TestResult.Fail("search returned entries other than patient");

             allPatients = result;
@@ -54,7 +54,7 @@
         }

-
+

         [SprinklerTest("SE03", "Search patient resource on partial familyname")]
         public void SearchResourcesWithNameCriterium()
@@ -72,8 +72,8 @@
             // Take the first three characters
             name = name.Substring(0, 3);

-
-            var result = client.Search<Patient>(new string[] { "family="+name });
+
+            var result = client.Search<Patient>(new string[] { "family=" + name });
             HttpTests.AssertEntryIdsArePresentAndAbsoluteUrls(result);

             if (result.Entries.Count == 0)
@@ -82,7 +82,7 @@
             // Each patient returned should have a family name with the
             // criterium
             var names = result.Entries.ByResourceType<Patient>()
-                .Where(p=>p.Resource.Name != null)
+                .Where(p => p.Resource.Name != null)
                    .SelectMany(p => p.Resource.Name)
                     .Where(hn => hn.Family != null)
                         .SelectMany(hn => hn.Family);
@@ -109,7 +109,7 @@
             bool found = bundle.ResourcesOf<Patient>().Where(p => p.HasGiven("Fester")).Count() > 0;

             TestResult.Assert(found, "Patient was not found with given name");
-
+
         }

         [SprinklerTest("SE05", "Search condition by subject (patient) reference")]
@@ -144,7 +144,7 @@

             var patient = client.Read<Patient>(patientRef);

-            if(patient == null)
+            if (patient == null)
                 TestResult.Fail("failed to find patient condition is referring to");

             var result = client.Search<Condition>(new string[] { "subject=" + patientRef });
@@ -166,7 +166,7 @@
             string patFirstName = patient.Resource.Name[0].Family.First();
             //.Substring(2, 3);
             var param = "subject.name=" + patFirstName;
-
+
             result = client.Search<Condition>(new string[] { param });
             HttpTests.AssertEntryIdsArePresentAndAbsoluteUrls(result);

@@ -174,8 +174,8 @@
                 TestResult.Fail("failed to find any conditions (using subject.name)");

             string identifier = patient.Resource.Identifier[0].Value;
-            result = client.Search<Condition>(new string[] {  "subject.identifier=" + identifier });
-
+            result = client.Search<Condition>(new string[] { "subject.identifier=" + identifier });
+
             if (result.Entries.Count() == 0)
                 TestResult.Fail("failed to find any conditions (using subject.identifier)");
         }
@@ -183,7 +183,7 @@
         [SprinklerTest("SE06", "Search with includes")]
         public void SearchWithIncludes()
         {
-            Bundle bundle  = client.Search<Condition>(new string[] { "_include=Condition.subject" });
+            Bundle bundle = client.Search<Condition>(new string[] { "_include=Condition.subject" });

             var patients = bundle.Entries.ByResourceType<Patient>();
             TestResult.Assert(patients.Count() > 0, "Search Conditions with _include=Condition.subject should have patients");
@@ -228,8 +228,33 @@
             TestResult.Assert(!bundle.Has(id0), "Search greater than quantity should not return lesser value.");
             TestResult.Assert(bundle.Has(id1), "Search greater than quantity should return greater value");
             TestResult.Assert(bundle.Has(id2), "Search greater than quantity should return greater value");
-
-        }
+
+        }
+
+        [SprinklerTest("SE23", "Search with quantifier :missing, on Patient.gender.")]
+        public void SearchPatientByGenderMissing()
+        {
+            var patients = client.Search<Patient>().Entries.ByResourceType<Patient>();
+            var patientsNoGender = patients.Where(p => p.Resource.Gender.CodeableConceptNull());
+            var nrOfPatientsWithMissingGender = patientsNoGender.Count();
+
+            Bundle actual = client.Search("Patient", new string[] { "gender:missing=true" });
+
+            HttpTests.AssertCorrectNumberOfResults(nrOfPatientsWithMissingGender, actual.Entries.Count(), String.Format("Expected {0} patients without gender, but got {1}.", nrOfPatientsWithMissingGender, actual.Entries.Count()));
+        }
+
     }

+    internal static class TestExtensions
+    {
+        public static bool CodeableConceptNull(this CodeableConcept cc)
+        {
+            return cc == null ||
+                cc.Text == null &&
+                (cc.Coding == null ||
+                cc.Coding.Count() == 0 ||
+                cc.Coding.All(c => c.Code == null));
+        }
+
+    }
 }


Added display of AppSettings "SoftballTeam"

--- AspNetMvc/AspNetMvc/Views/Home/Index.cshtml
+++ AspNetMvc/AspNetMvc/Views/Home/Index.cshtml
@@ -6,6 +6,7 @@

ASP.NET

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

Learn more »

+
From AppSettings: @System.Configuration.ConfigurationManager.AppSettings["SoftballTeam"]

@@ -28,4 +29,4 @@

You can easily find a web hosting company that offers the right mix of features and price for your applications.

Learn more »

-
+


change the role of oauth manager’s

change the role of oauth manager’s

--- Assets/CloudBread/API/OAuth/OAuthManager.cs
+++ Assets/CloudBread/API/OAuth/OAuthManager.cs
@@ -5,32 +5,45 @@
 {
     public class OAuthManager
     {
-        public BaseConnector Connector;

-        private bool isUseOAuth = true;
+		public static BaseOAuth2Services OAuthService;
+
+		public enum OAuthServices
+		{
+			facebook,
+			google
+		}
+
+		public static BaseOAuth2Services GetServices(OAuthServices services){
+
+			switch (services) {
+
+			case OAuthServices.facebook:
+				if (OAuth2Setting.UseFacebook) {
+					return new FaceBookServices ();
+				} else {
+					Debug.LogError ("You have to check 'use facebook' checkbox. It's in CloudBread-CBAuthentication, Facebook Tab");
+					return null;
+				}
+
+			case OAuthServices.google:
+				if (OAuth2Setting.UseGooglePlay) {
+					return new GooglePlayServices ();
+				} else {
+					Debug.LogError ("You have to check 'use google play' checkbox. It's in CloudBread-CBAuthentication, Google Tab");
+					return null;
+				}
+
+			default:
+				return null;
+			}
+		}

         public OAuthManager()
         {

         }
-
-        public OAuthManager(BaseConnector _connector)
-        {
-            Connector = _connector;
-
-        }
-
-
-        public void Clear()
-        {
-
-        }
-
-
-        public void ReGet()
-        {
-
-        }
+
     }

 }


Re-gaurd the interop

Re-gaurd the interop

--- TGServiceInterface/Interop.cs
+++ TGServiceInterface/Interop.cs
@@ -37,7 +37,11 @@
 			try
 			{
 				var channel = Server.CreateChannel<ITGInterop>();
-				channel.CreateChannel().InteropMessage(String.Join(" ", args));
+                try
+                {
+                    channel.CreateChannel().InteropMessage(String.Join(" ", args));
+                }
+                catch { }
 				Server.CloseChannel(channel);

 			}


Fallback for Command Search Popup height - Fixes a null ref caused changes in Unity Editor UI where EditorWindow.focusedWindow would be null

--- Assets/Fungus/Scripts/Editor/BlockEditor.cs
+++ Assets/Fungus/Scripts/Editor/BlockEditor.cs
@@ -319,9 +319,15 @@
             // Add Button
             if (GUILayout.Button(addIcon))
             {
+                //this may be less reliable for HDPI scaling but previous method using editor window height is now returning
+                //  null in 2019.2 suspect ongoing ui changes, so default to screen.height and then attempt to get the better result
+                int h = Screen.height;
+                if (EditorWindow.focusedWindow != null) h = (int)EditorWindow.focusedWindow.position.height;
+                else if (EditorWindow.mouseOverWindow != null) h = (int)EditorWindow.mouseOverWindow.position.height;
+
                 CommandSelectorPopupWindowContent.ShowCommandMenu(lastCMDpopupPos, "", target as Block,
                     (int)(EditorGUIUtility.currentViewWidth),
-                    (int)(EditorWindow.focusedWindow.position.height - lastCMDpopupPos.y));
+                    (int)(h - lastCMDpopupPos.y));
             }

             // Duplicate Button


Code review

Code review

--- src/Proyecto26.RestClient/Helpers/HttpBase.cs
+++ src/Proyecto26.RestClient/Helpers/HttpBase.cs
@@ -8,7 +8,7 @@
 {
     public static class HttpBase
     {
-        public static int HTTP_NO_CONTENT = 204;
+        private const int HTTP_NO_CONTENT = 204;

         public static IEnumerator CreateRequestAndRetry(RequestHelper options, Action<RequestException, ResponseHelper> callback)
         {


Added policy flag

Added policy flag

--- Assets/LeapMotion/Scripts/HandController.cs
+++ Assets/LeapMotion/Scripts/HandController.cs
@@ -45,6 +45,7 @@
   protected Dictionary<int, HandModel> hand_physics_;
   protected Dictionary<int, ToolModel> tools_;

+  private bool flag_initialized_ = false;
   private bool show_hands_ = true;
   private long prev_graphics_id_ = 0;
   private long prev_physics_id_ = 0;
@@ -55,9 +56,8 @@
     Gizmos.DrawIcon(transform.position, "leap_motion.png");
   }

-  void Awake() {
-    leap_controller_ = new Controller();
-
+  void InitializeFlags()
+  {
     // Optimize for top-down tracking if on head mounted display.
     Controller.PolicyFlag policy_flags = leap_controller_.PolicyFlags;
     if (isHeadMounted)
@@ -66,6 +66,10 @@
       policy_flags &= ~Controller.PolicyFlag.POLICY_OPTIMIZE_HMD;

     leap_controller_.SetPolicyFlags(policy_flags);
+  }
+
+  void Awake() {
+    leap_controller_ = new Controller();
   }

   void Start() {
@@ -229,7 +233,12 @@

     UpdateRecorder();
     Frame frame = GetFrame();
-
+
+    if (frame != null && !flag_initialized_)
+    {
+      InitializeFlags();
+    }
+
     if (Input.GetKeyDown(KeyCode.H))
     {
       show_hands_ = !show_hands_;


Fixed a missing name for lever when making the sign for it

--- Assets/UI/Scripts/PokeDexUI/UiController.cs
+++ Assets/UI/Scripts/PokeDexUI/UiController.cs
@@ -73,7 +73,7 @@
                 signText.text = LanguageManager.Instance.Get("Phrases/CreateASignFor") +
                                 LanguageManager.Instance.Get("Phrases/CallOver");
                 break;
-            case 1:
+            case 2:
                 signText.text = LanguageManager.Instance.Get("Phrases/CreateASignFor") +
                                 LanguageManager.Instance.Get("Phrases/Lever");
                 break;


clean up

clean up

--- Assets/UniHttp/Support/File/IFileHandler.cs
+++ Assets/UniHttp/Support/File/IFileHandler.cs
@@ -8,13 +8,13 @@

 		void Write(string path, byte[] data);

-		void WriteObject<T>(string path, T obj) where T : class;
+		byte[] Read(string path);

 		FileStream OpenWriteStream(string path);

-		byte[] Read(string path);
+		FileStream OpenReadStream(string path);

-		FileStream OpenReadStream(string path);
+		void WriteObject<T>(string path, T obj) where T : class;

 		T ReadObject<T>(string path) where T : class;
 	}


Cue inutile

Cue inutile

--- BBTA/BBTA/Classe/GestionAudio/GestionSon.cs
+++ BBTA/BBTA/Classe/GestionAudio/GestionSon.cs
@@ -18,7 +18,6 @@
         private AudioEngine moteur;
         private SoundBank banqueSon;
         private WaveBank banqueVague;
-        private Cue cue;

         public GestionSon(Game jeu)


handle rollback chain in transaction methods

--- BitSharp.Core/Builders/ChainStateBuilder.cs
+++ BitSharp.Core/Builders/ChainStateBuilder.cs
@@ -37,6 +37,7 @@
         private readonly DisposeHandle<IChainStateCursor> chainStateCursorHandle;
         private readonly IChainStateCursor chainStateCursor;
         private ChainBuilder chain;
+        private Chain rollbackChain;
         private readonly UtxoBuilder utxoBuilder;

         private readonly ReaderWriterLockSlim commitLock;
@@ -88,79 +89,80 @@

         public void AddBlock(ChainedHeader chainedHeader, IEnumerable<BlockTx> blockTxes)
         {
-            var savedChain = this.chain.ToImmutable();
-            this.BeginTransaction();
-            try
-            {
-                using (this.blockValidator.StartValidation(chainedHeader))
+            this.commitLock.DoWrite(() =>
+            {
+                this.BeginTransaction();
+                try
                 {
-                    // add the block to the chain
-                    this.chain.AddBlock(chainedHeader);
-                    this.chainStateCursor.AddChainedHeader(chainedHeader);
-
-                    // ignore transactions on geneis block
-                    if (chainedHeader.Height > 0)
+                    using (this.blockValidator.StartValidation(chainedHeader))
                     {
-                        // calculate the new block utxo, only output availability is checked and updated
-                        foreach (var pendingTx in this.utxoBuilder.CalculateUtxo(this.chain.ToImmutable(), blockTxes.Select(x => x.Transaction)))
+                        // add the block to the chain
+                        this.chain.AddBlock(chainedHeader);
+                        this.chainStateCursor.AddChainedHeader(chainedHeader);
+
+                        // ignore transactions on geneis block
+                        if (chainedHeader.Height > 0)
                         {
-                            this.blockValidator.AddPendingTx(pendingTx);
-
-                            // track stats
-                            this.stats.txCount++;
-                            this.stats.inputCount += pendingTx.Transaction.Inputs.Length;
-                            this.stats.txRateMeasure.Tick();
-                            this.stats.inputRateMeasure.Tick(pendingTx.Transaction.Inputs.Length);
+                            // calculate the new block utxo, only output availability is checked and updated
+                            foreach (var pendingTx in this.utxoBuilder.CalculateUtxo(this.chain.ToImmutable(), blockTxes.Select(x => x.Transaction)))
+                            {
+                                this.blockValidator.AddPendingTx(pendingTx);
+
+                                // track stats
+                                this.stats.txCount++;
+                                this.stats.inputCount += pendingTx.Transaction.Inputs.Length;
+                                this.stats.txRateMeasure.Tick();
+                                this.stats.inputRateMeasure.Tick(pendingTx.Transaction.Inputs.Length);
+                            }
+                        }
+
+                        // finished queuing up block's txes
+                        this.blockValidator.CompleteAdding();
+
+                        // track stats
+                        this.stats.blockCount++;
+
+                        // wait for block validation to complete
+                        this.blockValidator.WaitToComplete();
+
+                        // check tx loader results
+                        if (this.blockValidator.TxLoaderExceptions.Count > 0)
+                        {
+                            throw new AggregateException(this.blockValidator.TxLoaderExceptions);
+                        }
+
+                        // check tx validation results
+                        if (this.blockValidator.TxValidatorExceptions.Count > 0)
+                        {
+                            throw new AggregateException(this.blockValidator.TxValidatorExceptions);
+                        }
+
+                        // check script validation results
+                        if (this.blockValidator.ScriptValidatorExceptions.Count > 0)
+                        {
+                            if (!this.rules.IgnoreScriptErrors)
+                                throw new AggregateException(this.blockValidator.ScriptValidatorExceptions);
+                            else
+                                this.logger.Debug("Ignoring script errors in block: {0,9:#,##0}, errors: {1:#,##0}".Format2(chainedHeader.Height, this.blockValidator.ScriptValidatorExceptions.Count));
                         }
                     }

-                    // finished queuing up block's txes
-                    this.blockValidator.CompleteAdding();
-
-                    // track stats
-                    this.stats.blockCount++;
-
-                    // wait for block validation to complete
-                    this.blockValidator.WaitToComplete();
-
-                    // check tx loader results
-                    if (this.blockValidator.TxLoaderExceptions.Count > 0)
-                    {
-                        throw new AggregateException(this.blockValidator.TxLoaderExceptions);
-                    }
-
-                    // check tx validation results
-                    if (this.blockValidator.TxValidatorExceptions.Count > 0)
-                    {
-                        throw new AggregateException(this.blockValidator.TxValidatorExceptions);
-                    }
-
-                    // check script validation results
-                    if (this.blockValidator.ScriptValidatorExceptions.Count > 0)
-                    {
-                        if (!this.rules.IgnoreScriptErrors)
-                            throw new AggregateException(this.blockValidator.ScriptValidatorExceptions);
-                        else
-                            this.logger.Debug("Ignoring script errors in block: {0,9:#,##0}, errors: {1:#,##0}".Format2(chainedHeader.Height, this.blockValidator.ScriptValidatorExceptions.Count));
-                    }
+                    // commit the chain state
+                    this.CommitTransaction();
                 }
-
-                // commit the chain state
-                this.CommitTransaction();
-            }
-            catch (Exception)
-            {
-                // rollback the chain state on error
-                this.RollbackTransaction();
-                this.chain = savedChain.ToBuilder();
-                throw;
-            }
-
-            // MEASURE: Block Rate
-            this.stats.blockRateMeasure.Tick();
-
-            // blockchain processing statistics
-            this.Stats.blockCount++;
+                catch (Exception)
+                {
+                    // rollback the chain state on error
+                    this.RollbackTransaction();
+                    throw;
+                }
+
+                // MEASURE: Block Rate
+                this.stats.blockRateMeasure.Tick();
+
+                // blockchain processing statistics
+                this.Stats.blockCount++;
+            });

             var logInterval = TimeSpan.FromSeconds(15);
             if (DateTime.UtcNow - this.Stats.lastLogTime >= logInterval)
@@ -172,46 +174,47 @@

         public void RollbackBlock(ChainedHeader chainedHeader, IEnumerable<BlockTx> blockTxes)
         {
-            var savedChain = this.chain.ToImmutable();
-            this.BeginTransaction();
-            try
-            {
-                // remove the block from the chain
-                this.chain.RemoveBlock(chainedHeader);
-                this.chainStateCursor.RemoveChainedHeader(chainedHeader);
-
-                // read spent transaction rollback information
-                IImmutableList<SpentTx> spentTxes;
-                if (!this.chainStateCursor.TryGetBlockSpentTxes(chainedHeader.Height, out spentTxes))
-                    throw new ValidationException(chainedHeader.Height);
-
-                //TODO this can be read in reverse instead of doing a dictionary
-                var spentTxesDictionary =
-                    ImmutableDictionary.CreateRange(
-                        spentTxes.Select(spentTx => new KeyValuePair<UInt256, SpentTx>(spentTx.TxHash, spentTx)));
-
-                // keep track of the previoux tx output information for all unminted transactions
-                // the information is removed and will be needed to enable a replay of the rolled back block
-                var unmintedTxes = ImmutableList.CreateBuilder<UnmintedTx>();
-
-                // rollback the utxo
-                this.utxoBuilder.RollbackUtxo(this.chain.ToImmutable(), chainedHeader, blockTxes, spentTxesDictionary, unmintedTxes);
-
-                // remove the rollback information
-                this.chainStateCursor.TryRemoveBlockSpentTxes(chainedHeader.Height);
-
-                // store the replay information
-                this.chainStateCursor.TryAddBlockUnmintedTxes(chainedHeader.Hash, unmintedTxes.ToImmutable());
-
-                // commit the chain state
-                this.CommitTransaction();
-            }
-            catch (Exception)
-            {
-                this.chain = savedChain.ToBuilder();
-                this.RollbackTransaction();
-                throw;
-            }
+            this.commitLock.DoWrite(() =>
+            {
+                this.BeginTransaction();
+                try
+                {
+                    // remove the block from the chain
+                    this.chain.RemoveBlock(chainedHeader);
+                    this.chainStateCursor.RemoveChainedHeader(chainedHeader);
+
+                    // read spent transaction rollback information
+                    IImmutableList<SpentTx> spentTxes;
+                    if (!this.chainStateCursor.TryGetBlockSpentTxes(chainedHeader.Height, out spentTxes))
+                        throw new ValidationException(chainedHeader.Height);
+
+                    //TODO this can be read in reverse instead of doing a dictionary
+                    var spentTxesDictionary =
+                        ImmutableDictionary.CreateRange(
+                            spentTxes.Select(spentTx => new KeyValuePair<UInt256, SpentTx>(spentTx.TxHash, spentTx)));
+
+                    // keep track of the previoux tx output information for all unminted transactions
+                    // the information is removed and will be needed to enable a replay of the rolled back block
+                    var unmintedTxes = ImmutableList.CreateBuilder<UnmintedTx>();
+
+                    // rollback the utxo
+                    this.utxoBuilder.RollbackUtxo(this.chain.ToImmutable(), chainedHeader, blockTxes, spentTxesDictionary, unmintedTxes);
+
+                    // remove the rollback information
+                    this.chainStateCursor.TryRemoveBlockSpentTxes(chainedHeader.Height);
+
+                    // store the replay information
+                    this.chainStateCursor.TryAddBlockUnmintedTxes(chainedHeader.Hash, unmintedTxes.ToImmutable());
+
+                    // commit the chain state
+                    this.CommitTransaction();
+                }
+                catch (Exception)
+                {
+                    this.RollbackTransaction();
+                    throw;
+                }
+            });
         }

         public void LogBlockchainProgress()
@@ -262,8 +265,8 @@
             if (this.inTransaction)
                 throw new InvalidOperationException();

-            this.commitLock.EnterWriteLock();
             this.chainStateCursor.BeginTransaction();
+            this.rollbackChain = this.chain.ToImmutable();
             this.inTransaction = true;
         }

@@ -273,8 +276,8 @@
                 throw new InvalidOperationException();

             this.chainStateCursor.CommitTransaction();
+            this.rollbackChain = null;
             this.inTransaction = false;
-            this.commitLock.ExitWriteLock();
         }

         private void RollbackTransaction()
@@ -283,8 +286,8 @@
                 throw new InvalidOperationException();

             this.chainStateCursor.RollbackTransaction();
+            this.chain = this.rollbackChain.ToBuilder();
             this.inTransaction = false;
-            this.commitLock.ExitWriteLock();
         }

         public sealed class BuilderStats : IDisposable


Remove IDisposabel from SqliteAsync, because there is not Disposable SqliteConnectionAsync

--- CIC.IDatabase.SQLite/SQLiteAsyncDatabase.cs
+++ CIC.IDatabase.SQLite/SQLiteAsyncDatabase.cs
@@ -6,7 +6,7 @@

 namespace CIC.IDatabase.SQLite
 {
-	public class SQLiteAsyncDatabase : IDatabaseAsync
+	public class SQLiteAsyncDatabase
 	{
 		SQLiteAsyncConnection sqliteAsyncConnection;

@@ -17,9 +17,6 @@

 		#region IDatabaseAsync implementation

-		public void Dispose ()
-		{
-		}
 		/*
 		public Task<CreateTablesResult> CreateTableAsync<T> (CancellationToken cancellationToken = default(CancellationToken)) where T : new()
 		{


[SKIA] Call NotifyPixelsChanged when WritableBitmap gets unlocked

--- src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs
+++ src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs
@@ -126,6 +126,7 @@
             /// <inheritdoc />
             public void Dispose()
             {
+                _bitmap.NotifyPixelsChanged();
                 _bitmap = null;
             }


added the ability to select an audio clip from a list of tags to assist in making the attribute grammar more robust

--- Assets/Prototype/Scripts/TheVoice.cs
+++ Assets/Prototype/Scripts/TheVoice.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;

 using UnityEngine;

@@ -100,6 +101,53 @@
         return clipsWithTag[randomIndex];
     }

+    private AudioClip SelectAudioClipByTagList(IEnumerable<string> tags)
+    {
+        // get all the voice lines with at least one of the tags
+        List<List<TaggedVoiceLine>> taggedLines = new List<List<TaggedVoiceLine>>();
+        foreach (var tag in tags)
+        {
+            taggedLines.Add(GetVoiceLinesWithTag(tag));
+        }
+
+        // this is the list we will select from
+        List<AudioClip> clipsWithAllTags = new List<AudioClip>();
+
+        // find the AudioClip(s) that have all tags in the list in order to construct the list of clips to select from
+        bool hasAllTags = false;
+        // iterate through every list of TaggedVoiceLine(s) with at least one tag in common with the tag list
+        foreach (var lineList in taggedLines)
+        {
+            // iterate through each line with a specific tag
+            foreach (var line in lineList)
+            {
+                // assume it meets the criteria
+                hasAllTags = true;
+                foreach (var tag in tags)
+                {
+                    // if a line does not have every tag required, it does not meet the criteria, so break
+                    // out of the loop
+                    if (!line._tags.Contains(tag))
+                    {
+                        hasAllTags = false;
+                        break;
+                    }
+                }
+
+                // if we have not already added the clip (e.g. there is overlap)
+                // and the clip is tagged with every tag in the collection,
+                // add it to the list of clips to select from
+                if (hasAllTags && !clipsWithAllTags.Contains(line._audioClip))
+                {
+                    clipsWithAllTags.Add(line._audioClip);
+                }
+            }
+        }
+
+        // select a random clip from the list
+        return clipsWithAllTags[Random.Range(0, clipsWithAllTags.Count)];
+    }
+
     private List<TaggedVoiceLine> GetVoiceLinesWithTag(string tag)
     {
         List<TaggedVoiceLine> toReturn = new List<TaggedVoiceLine>();


Try a different approach to see if we have registry access

Fixes #378

--- src/SyncTrayzor/Services/AutostartProvider.cs
+++ src/SyncTrayzor/Services/AutostartProvider.cs
@@ -57,28 +57,47 @@
             // Default
             this.IsEnabled = true;

-            this.CheckAccess();
-
             // Find a key, if we can, which points to our current location
-            if (this.CanRead)
-                this.keyName = this.FindKeyName();
-        }
-
-        private void CheckAccess()
-        {
+            this.keyName = this.FindKeyNameAndCheckAccess();
+        }
+
+        private string FindKeyNameAndCheckAccess()
+        {
+            string keyName = null;
+
+            try
+            {
+                keyName = this.FindKeyName();
+            }
+            catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
+            {
+                // Can't even get the key name?
+                logger.Warn("Unable to find registry key name: do not have read access to the registry");
+                return null;
+            }
+
             try
             {
                 using (var key = this.OpenRegistryKey(true))
                 {
                     if (key != null) // It's null if "there was an error"
                     {
-                        // We can open it, but not have access to create subkeys, I think
-                        new RegistryPermission(RegistryPermissionAccess.AllAccess, runPathWithHive).Demand();
+                        // We can open it, but not have access to edit this value
+                        var value = key.GetValue(keyName);
+                        if (value != null)
+                        {
+                            key.SetValue(keyName, value);
+                        }
+                        else
+                        {
+                            key.SetValue(keyName, string.Empty);
+                            key.DeleteValue(keyName);
+                        }

                         this._canWrite = true;
                         this._canRead = true;
                         logger.Debug("Have read/write access to the registry");
-                        return;
+                        return keyName;
                     }
                 }
             }
@@ -91,19 +110,20 @@
                 {
                     if (key != null) // It's null if "there was an error"
                     {
-                        // We can open it, but not have access to read subkeys, I think
-                        new RegistryPermission(RegistryPermissionAccess.Read, runPathWithHive).Demand();
+                        // We can open it, but not have access to read this value
+                        var value = key.GetValue(keyName);

                         this._canRead = true;
                         logger.Warn("Have read-only access to the registry");
-                        return;
+                        return keyName;
                     }
                 }
             }
             catch (SecurityException) { }
             catch (UnauthorizedAccessException) { }

-            logger.Warn("Have no access to the registry");
+            logger.Warn("Could find registry key name, but have no access to the registry");
+            return null;
         }

         private string FindKeyName()


Other versions that migth work for rotate

--- Assets/Scripts/LevelAccelerometer.cs
+++ Assets/Scripts/LevelAccelerometer.cs
@@ -3,26 +3,48 @@
 // Script that will rotate the game object according to the input acceleration
 public class LevelAccelerometer : MonoBehaviour
 {
+    public float Speed;
+
+    private Quaternion _rot;
+
+    void Start()
+    {
+        _rot = transform.rotation;
+    }
+
     void Update()
     {
         AccelerationMovement();
+
+        //transform.Rotate(Input.acceleration);
     }

     #region TiltMovement

+    //private Vector3 AccelerationInput()
+    //{
+    //    Vector3 acceleration = Input.acceleration;
+    //    if (acceleration.magnitude < -0.1f || acceleration.magnitude > 0.1f)
+    //    {
+    //        return acceleration;
+    //    }
+    //    return Vector3.zero;
+    //}
+
     private Vector3 AccelerationInput()
     {
-        Vector3 acceleration = Input.acceleration;
-        if (acceleration.magnitude < -0.1f || acceleration.magnitude > 0.1f)
-        {
-            return acceleration;
-        }
-        return Vector3.zero;
+        return Input.acceleration * (Time.deltaTime * Speed);
     }

     private void AccelerationMovement()
     {
-        transform.rotation = Quaternion.Euler(AccelerationInput());
+        //transform.rotation = Quaternion.Euler(AccelerationInput());
+
+        _rot.x += AccelerationInput().x;
+        _rot.y += AccelerationInput().y;
+        transform.rotation = _rot;
+
+
     }

     #endregion TiltMovement


* Removed log SPAM.

* Removed log SPAM.

--- Assets/Watson/Editor/ConfigEditor.cs
+++ Assets/Watson/Editor/ConfigEditor.cs
@@ -104,8 +104,6 @@
         private static void ShowHelp()
         {
             string helpFile = "file://" + Application.dataPath + API_REFERENCE;
-            Log.Debug( "ConfigEditor", "helpFile = {0}", helpFile );
-
             Application.OpenURL( helpFile );
         }


...

Disallow unit selection if PostRenderer is disabled.

--- Assets/new_multiplayer/NewSpawner.cs
+++ Assets/new_multiplayer/NewSpawner.cs
@@ -123,6 +123,7 @@
 		private Vector3 initialClick;
 		private Vector3 screenPoint;
 		private NewChanges changes;
+		private PostRenderer selectionBoxRenderer;

 		public static int colorCode = 0;

@@ -166,6 +167,10 @@

 				//NOTE(Thompson): See NOTE in NetworkManagerActions.StartLANClient().
 				renderer.enabled = false;
+
+				//NOTE(Thompson): Setting the renderer to a variable, so I can later on check to see
+				//if the renderer is disabled or not. If disabled, disallow unit selection.
+				this.selectionBoxRenderer = renderer;
 			}

 			this.selectionBox = new Rect();
@@ -539,7 +544,7 @@
 		}

 		private void HandleSelection() {
-			if (this.minimapCamera == null) {
+			if (this.minimapCamera == null || !this.selectionBoxRenderer.enabled) {
 				return;
 			}


Logic error : Should limit splitting by level.

--- Assets/new_multiplayer/NewSpawner.cs
+++ Assets/new_multiplayer/NewSpawner.cs
@@ -256,7 +256,7 @@
 			if (Input.GetKeyUp(KeyCode.S)) {
 				foreach (NewUnitStruct temp in this.selectedList) {
 					NewGameUnit newUnit = temp.unit.GetComponent<NewGameUnit>();
-					if (!newUnit.properties.isSplitting && this.unitList.Count < 50) {
+					if (!newUnit.properties.isSplitting && this.unitList.Count < 50 && newUnit.properties.level == 1) {
 						CmdSpawn(temp.unit, temp.unit.GetComponent<NetworkIdentity>());
 					}
 				}


Improve reporting of a scenario (problem with false-failures)

--- CSF.Screenplay.Reporting/Models/Scenario.cs
+++ CSF.Screenplay.Reporting/Models/Scenario.cs
@@ -9,11 +9,6 @@
   /// </summary>
   public class Scenario
   {
-    readonly static Outcome[] SuccessOutcomes = new [] {
-      Outcome.Success,
-      Outcome.SuccessWithResult,
-    };
-
     readonly string name;
     readonly IList<Reportable> children;

@@ -40,16 +35,7 @@
     /// Gets a value indicating whether this <see cref="T:CSF.Screenplay.Reporting.Models.Scenario"/> is a success.
     /// </summary>
     /// <value><c>true</c> if is success; otherwise, <c>false</c>.</value>
-    public virtual bool IsSuccess
-    {
-      get {
-        if(IsFailure)
-          return false;
-
-        var reportables = FindReportables();
-        return reportables.All(x => SuccessOutcomes.Contains(x.Outcome));
-      }
-    }
+    public virtual bool IsSuccess => !IsFailure;

     IEnumerable<Reportable> FindReportables()
     {


Don't allow Spam to be set to values we don't have permission for

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -723,12 +723,22 @@
                         switch(set[2])
                         {
                             case "ban":
-                                chatRoom.Spam = "Ban";
-                                SendChatMessage(chatRoomID, "Spam will now ban");
+                                if (CheckPermission("ban", bot.Permission))
+                                {
+                                    chatRoom.Spam = "Ban";
+                                    SendChatMessage(chatRoomID, "Spam will now ban");
+                                }
+                                else
+                                    SendChatMessage(chatRoomID, "I don't have permission to ban users");
                                 break;
                             case "kick":
-                                chatRoom.Spam = "Kick";
-                                SendChatMessage(chatRoomID, "Spam will now kick");
+                                if (CheckPermission("kick", bot.Permission))
+                                {
+                                    chatRoom.Spam = "Kick";
+                                    SendChatMessage(chatRoomID, "Spam will now kick");
+                                }
+                                else
+                                    SendChatMessage(chatRoomID, "I don't have permission to kick users");
                                 break;
                             case "none":
                                 chatRoom.Spam = "None";


Poke!

Poke!

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -572,7 +572,29 @@
             {
                 if (message.StartsWith("!poke "))
                 {
-                    // TODO: Add function to search for users in a chat
+                    if (isMod || chatRoom.AllPoke)
+                    {
+                        string search = message.Substring(6);
+                        List<SteamID> results = new List<SteamID>();
+                        foreach (UserInfo user in chatRoom.Users)
+                            if (friends.GetFriendPersonaName(user.SteamID).ToLower().IndexOf(search.ToLower()) > -1)
+                                results.Add(user.SteamID);
+
+                        if (results.Count > 1)
+                            SendChatMessage(chatRoomID, "Found multiple users, try to be more specific");
+                        else if (results.Count == 0)
+                            SendChatMessage(chatRoomID, "No user found");
+                        else if (results[0] == chatRoom.LastPoke)
+                            SendChatMessage(chatRoomID, "You have already poked that user");
+                        else if (results[0] == client.SteamID)
+                            SendChatMessage(chatRoomID, "Poked myself, *poke*");
+                        else
+                        {
+                            SendMessage(results[0], string.Format("Hey you! {0} poked you in {1}", friends.GetFriendPersonaName(userID), chatRoom.ChatName));
+                            SendChatMessage(chatRoomID, string.Format("Poked {0}", friends.GetFriendPersonaName(results[0])));
+                            chatRoom.LastPoke = userID;
+                        }
+                    }
                 }
                 else if (message.StartsWith("!random"))
                 {


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/WebSockets/WebSocketContext.cs
+++ websocket-sharp/Net/WebSockets/WebSocketContext.cs
@@ -147,15 +147,18 @@
     public abstract string SecWebSocketKey { get; }

     /// <summary>
-    /// Gets the values of the Sec-WebSocket-Protocol header included in the request.
-    /// </summary>
-    /// <remarks>
-    /// This property represents the subprotocols requested by the client.
-    /// </remarks>
-    /// <value>
-    /// An <see cref="T:System.Collections.Generic.IEnumerable{string}"/> instance that provides
-    /// an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol
-    /// header.
+    /// Gets the value of the Sec-WebSocket-Protocol header included in
+    /// the handshake request.
+    /// </summary>
+    /// <value>
+    ///   <para>
+    ///   An <see cref="T:System.Collections.Generic.IEnumerable{string}"/>
+    ///   instance.
+    ///   </para>
+    ///   <para>
+    ///   It provides an enumerator which supports the iteration over
+    ///   the collection of the names of the subprotocols.
+    ///   </para>
     /// </value>
     public abstract IEnumerable<string> SecWebSocketProtocols { get; }


fix compilation problems

fix compilation problems

--- Cassandra.Data.Linq/CqlExpressionVisitor.cs
+++ Cassandra.Data.Linq/CqlExpressionVisitor.cs
@@ -391,12 +391,6 @@
 			{ExpressionType.LessThanOrEqual,"<="}
         };

-        static readonly HashSet<ExpressionType> CQLUnsupTags = new HashSet<ExpressionType>()
-        {
-            {ExpressionType.Or},
-            {ExpressionType.OrElse},
-        };
-
         static readonly Dictionary<ExpressionType, ExpressionType> CQLInvTags = new Dictionary<ExpressionType, ExpressionType>()
         {
 			{ExpressionType.Equal,ExpressionType.Equal},
@@ -483,12 +477,6 @@
                         return node;
                     }
                 }
-                else if (!CQLUnsupTags.Contains(node.NodeType))
-                {
-                    var val = Expression.Lambda(node).Compile().DynamicInvoke();
-                    currentConditionBuilder.get().Append(cqlTool.AddValue(val));
-                    return node;
-                }
             }
             else if (phasePhase.get() == ParsePhase.SelectBinding)
             {


fix check

fix check

--- core/Engine/Engine.Core/Engine.cs
+++ core/Engine/Engine.Core/Engine.cs
@@ -24,8 +24,8 @@
             GetRuleValue getRuleValue = null;
             GetContextValue recursiveContext = key =>
             {
-                if (key.StartsWith("@@key")){
-                    key = key.Replace("@@key", "keys.");
+                if (key.StartsWith("@@key:")){
+                    key = key.Replace("@@key:", "keys.");
                 }
                 if (!key.StartsWith("keys.")) return Option<JsonValue>.None;
                 var path = new ConfigurationPath(key.Split('.')[1]);


Added example to TaskCollection (#844) and reformatted and refactored code.

--- TaskService/TaskCollection.cs
+++ TaskService/TaskCollection.cs
@@ -1,23 +1,158 @@
-using System;
+using JetBrains.Annotations;
+using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Text.RegularExpressions;
-using JetBrains.Annotations;

 namespace Microsoft.Win32.TaskScheduler
 {
 	///
-	/// Contains all the tasks that are registered.
+	/// Collection of running tasks in a <see cref="TaskService"/>. This class has no public constructor and can only be accessed via the
+	/// properties and functions within <see cref="TaskService"/>.
 	///
-	/// <remarks>Potentially breaking change in 1.6.2 and later where under V1 the list previously included the '.job' extension on the task name. This has been removed so that it is consistent with V2.</remarks>
+	public sealed class RunningTaskCollection : IReadOnlyList<RunningTask>, IDisposable
+	{
+		private readonly TaskService svc;
+		private readonly V2Interop.IRunningTaskCollection v2Coll;
+
+		internal RunningTaskCollection([NotNull] TaskService svc) => this.svc = svc;
+
+		internal RunningTaskCollection([NotNull] TaskService svc, [NotNull] V2Interop.IRunningTaskCollection iTaskColl)
+		{
+			this.svc = svc;
+			v2Coll = iTaskColl;
+		}
+
+		/// Gets the number of registered tasks in the collection.
+		public int Count
+		{
+			get
+			{
+				if (v2Coll != null)
+					return v2Coll.Count;
+				var i = 0;
+				var v1Enum = new V1RunningTaskEnumerator(svc);
+				while (v1Enum.MoveNext())
+					i++;
+				return i;
+			}
+		}
+
+		/// Gets the specified running task from the collection.
+		/// <param name="index">The index of the running task to be retrieved.</param>
+		/// <returns>A <see cref="RunningTask"/> instance.</returns>
+		public RunningTask this[int index]
+		{
+			get
+			{
+				if (v2Coll != null)
+				{
+					var irt = v2Coll[++index];
+					return new RunningTask(svc, TaskService.GetTask(svc.v2TaskService, irt.Path), irt);
+				}
+
+				var i = 0;
+				var v1Enum = new V1RunningTaskEnumerator(svc);
+				while (v1Enum.MoveNext())
+					if (i++ == index)
+						return v1Enum.Current;
+				throw new ArgumentOutOfRangeException(nameof(index));
+			}
+		}
+
+		/// Releases all resources used by this class.
+		public void Dispose()
+		{
+			if (v2Coll != null)
+				Marshal.ReleaseComObject(v2Coll);
+		}
+
+		/// Gets an IEnumerator instance for this collection.
+		/// <returns>An enumerator.</returns>
+		public IEnumerator<RunningTask> GetEnumerator()
+		{
+			if (v2Coll != null)
+				return new ComEnumerator<RunningTask, V2Interop.IRunningTask>(() => v2Coll.Count, (object o) => v2Coll[o], o =>
+				{
+					V2Interop.IRegisteredTask task = null;
+					try { task = TaskService.GetTask(svc.v2TaskService, o.Path); } catch { }
+					return task == null ? null : new RunningTask(svc, task, o);
+				});
+			return new V1RunningTaskEnumerator(svc);
+		}
+
+		/// Returns a <see cref="System.String"/> that represents this instance.
+		/// <returns>A <see cref="System.String"/> that represents this instance.</returns>
+		public override string ToString() => $"RunningTaskCollection; Count: {Count}";
+
+		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();
+
+		private class V1RunningTaskEnumerator : IEnumerator<RunningTask>
+		{
+			private readonly TaskService svc;
+			private readonly TaskCollection.V1TaskEnumerator tEnum;
+
+			internal V1RunningTaskEnumerator([NotNull] TaskService svc)
+			{
+				this.svc = svc;
+				tEnum = new TaskCollection.V1TaskEnumerator(svc);
+			}
+
+			public RunningTask Current => new RunningTask(svc, tEnum.ICurrent);
+
+			object System.Collections.IEnumerator.Current => Current;
+
+			/// Releases all resources used by this class.
+			public void Dispose() => tEnum.Dispose();
+
+			public bool MoveNext() => tEnum.MoveNext() && (tEnum.Current?.State == TaskState.Running || MoveNext());
+
+			public void Reset() => tEnum.Reset();
+		}
+	}
+
+	///
+	/// Contains all the tasks that are registered within a <see cref="TaskFolder"/>. This class has no public constructor and can only be
+	/// accessed via the properties and functions within <see cref="TaskFolder"/>.
+	///
+	/// <remarks>
+	/// Potentially breaking change in 1.6.2 and later where under V1 the list previously included the '.job' extension on the task name.
+	/// This has been removed so that it is consistent with V2.
+	/// </remarks>
+	/// <example>
+	///   public class Program
+	/// {
+	///    bool RootFolderHasTask(string taskName)
+	///    {
+	///       if (TaskService.Instance.RootFolder.Tasks.Count > 0)
+	///       {
+	///          return TaskService.Instance.RootFolder.Tasks.Exists(taskName);
+	///       }
+	///       return false;
+	///    }
+	///
+	///    TaskCollection GetRootTasksStartingWith(string value)
+	///    {
+	///       var pattern = $"^{Regex.Escape(value)}.*$";
+	///       return TaskService.Instance.RootFolder.GetTasks(new Regex(pattern));
+	///    }
+	///
+	///    public static void Main()
+	///    {
+	///       foreach (var task in GetRootTasksStartingWith("MyCo"))
+	///          if (RootFolderHasTask(task.Name))
+	///             Console.WriteLine(task.Name);
+	///    }
+	/// }
+	/// </example>
 	[PublicAPI]
 	public sealed class TaskCollection : IReadOnlyList<Task>, IDisposable
 	{
+		private readonly TaskFolder fld;
 		private readonly TaskService svc;
+		private readonly V2Interop.IRegisteredTaskCollection v2Coll;
 		private Regex filter;
-		private readonly TaskFolder fld;
 		private V1Interop.ITaskScheduler v1TS;
-		private readonly V2Interop.IRegisteredTaskCollection v2Coll;

 		internal TaskCollection([NotNull] TaskService svc, Regex filter = null)
 		{
@@ -34,9 +169,82 @@
 			v2Coll = iTaskColl;
 		}

-		///
-		/// Releases all resources used by this class.
-		///
+		/// Gets the number of registered tasks in the collection.
+		public int Count
+		{
+			get
+			{
+				var i = 0;
+				if (v2Coll != null)
+				{
+					var v2Enum = new V2TaskEnumerator(fld, v2Coll, filter);
+					while (v2Enum.MoveNext())
+						i++;
+				}
+				else
+				{
+					var v1Enum = new V1TaskEnumerator(svc, filter);
+					return v1Enum.Count;
+				}
+				return i;
+			}
+		}
+
+		/// Gets or sets the regular expression filter for task names.
+		/// <value>The regular expression filter.</value>
+		private Regex Filter
+		{
+			get => filter;
+			set
+			{
+				var sfilter = value?.ToString().TrimStart('^').TrimEnd('$') ?? string.Empty;
+				if (sfilter == string.Empty || sfilter == "*")
+					filter = null;
+				else
+				{
+					if (value != null && value.ToString().TrimEnd('$').EndsWith("\\.job", StringComparison.InvariantCultureIgnoreCase))
+						filter = new Regex(value.ToString().Replace("\\.job", ""));
+					else
+						filter = value;
+				}
+			}
+		}
+
+		/// Gets the specified registered task from the collection.
+		/// <param name="index">The index of the registered task to be retrieved.</param>
+		/// <returns>A <see cref="Task"/> instance that contains the requested context.</returns>
+		public Task this[int index]
+		{
+			get
+			{
+				var i = 0;
+				var te = GetEnumerator();
+				while (te.MoveNext())
+					if (i++ == index)
+						return te.Current;
+				throw new ArgumentOutOfRangeException(nameof(index));
+			}
+		}
+
+		/// Gets the named registered task from the collection.
+		/// <param name="name">The name of the registered task to be retrieved.</param>
+		/// <returns>A <see cref="Task"/> instance that contains the requested context.</returns>
+		public Task this[string name]
+		{
+			get
+			{
+				if (v2Coll != null)
+					return Task.CreateTask(svc, v2Coll[name]);
+
+				var v1Task = svc.GetTask(name);
+				if (v1Task != null)
+					return v1Task;
+
+				throw new ArgumentOutOfRangeException(nameof(name));
+			}
+		}
+
+		/// Releases all resources used by this class.
 		public void Dispose()
 		{
 			v1TS = null;
@@ -44,9 +252,23 @@
 				Marshal.ReleaseComObject(v2Coll);
 		}

-		///
-		/// Gets the collection enumerator for the register task collection.
-		///
+		/// Determines whether the specified task exists.
+		/// <param name="taskName">The name of the task.</param>
+		/// <returns>true if task exists; otherwise, false.</returns>
+		public bool Exists([NotNull] string taskName)
+		{
+			try
+			{
+				if (v2Coll != null)
+					return v2Coll[taskName] != null;
+
+				return svc.GetTask(taskName) != null;
+			}
+			catch { }
+			return false;
+		}
+
+		/// Gets the collection enumerator for the register task collection.
 		/// <returns>An <see cref="System.Collections.IEnumerator"/> for this collection.</returns>
 		public IEnumerator<Task> GetEnumerator()
 		{
@@ -55,19 +277,21 @@
 			return new V2TaskEnumerator(fld, v2Coll, filter);
 		}

+		/// Returns a <see cref="System.String"/> that represents this instance.
+		/// <returns>A <see cref="System.String"/> that represents this instance.</returns>
+		public override string ToString() => $"TaskCollection; Count: {Count}";
+
 		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();

 		internal class V1TaskEnumerator : IEnumerator<Task>
 		{
+			private readonly Regex filter;
 			private readonly TaskService svc;
 			private readonly V1Interop.IEnumWorkItems wienum;
+			private string curItem;
 			private V1Interop.ITaskScheduler ts;
-			private string curItem;
-			private readonly Regex filter;
-
-			///
-			/// Internal constructor
-			///
+
+			/// Internal constructor
 			/// <param name="svc">TaskService instance</param>
 			/// <param name="filter">The filter.</param>
 			internal V1TaskEnumerator(TaskService svc, Regex filter = null)
@@ -79,27 +303,34 @@
 				Reset();
 			}

-			///
-			/// Retrieves the current task.  See <see cref="System.Collections.IEnumerator.Current"/> for more information.
-			///
+			/// Retrieves the current task. See <see cref="System.Collections.IEnumerator.Current"/> for more information.
 			public Task Current => new Task(svc, ICurrent);

+			object System.Collections.IEnumerator.Current => Current;
+
+			internal int Count
+			{
+				get
+				{
+					var i = 0;
+					Reset();
+					while (MoveNext())
+						i++;
+					Reset();
+					return i;
+				}
+			}
+
 			internal V1Interop.ITask ICurrent => TaskService.GetTask(ts, curItem);

-			///
-			/// Releases all resources used by this class.
-			///
+			/// Releases all resources used by this class.
 			public void Dispose()
 			{
 				if (wienum != null) Marshal.ReleaseComObject(wienum);
 				ts = null;
 			}

-			object System.Collections.IEnumerator.Current => Current;
-
-			///
-			/// Moves to the next task. See MoveNext for more information.
-			///
+			/// Moves to the next task. See MoveNext for more information.
 			/// <returns>true if next task found, false if no more tasks.</returns>
 			public bool MoveNext()
 			{
@@ -132,33 +363,18 @@
 					V1Interop.ITask itask = null;
 					try { itask = ICurrent; valid = true; }
 					catch { valid = false; }
-					finally { itask = null; }
+					finally { Marshal.ReleaseComObject(itask); }
 				} while (!valid);

 				return (curItem != null);
 			}

-			///
-			/// Reset task enumeration. See Reset for more information.
-			///
+			/// Reset task enumeration. See Reset for more information.
 			public void Reset()
 			{
 				curItem = null;
 				wienum?.Reset();
 			}
-
-			internal int Count
-			{
-				get
-				{
-					var i = 0;
-					Reset();
-					while (MoveNext())
-						i++;
-					Reset();
-					return i;
-				}
-			}
 		}

 		private class V2TaskEnumerator : ComEnumerator<Task, V2Interop.IRegisteredTask>
@@ -166,257 +382,19 @@
 			private readonly Regex filter;

 			internal V2TaskEnumerator(TaskFolder folder, V2Interop.IRegisteredTaskCollection iTaskColl, Regex filter = null) :
-				base(() => iTaskColl.Count, (object o) => iTaskColl[o], o => Task.CreateTask(folder.TaskService, o))
-			{
-				this.filter = filter;
-			}
+				base(() => iTaskColl.Count, (object o) => iTaskColl[o], o => Task.CreateTask(folder.TaskService, o)) => this.filter = filter;

 			public override bool MoveNext()
 			{
 				var hasNext = base.MoveNext();
 				while (hasNext)
 				{
-					if (filter == null || filter.IsMatch(((V2Interop.IRegisteredTask)iEnum?.Current)?.Name ?? ""))
+					if (filter == null || filter.IsMatch(iEnum?.Current?.Name ?? ""))
 						break;
 					hasNext = base.MoveNext();
 				}
 				return hasNext;
 			}
 		}
-
-		///
-		/// Gets the number of registered tasks in the collection.
-		///
-		public int Count
-		{
-			get
-			{
-				var i = 0;
-				if (v2Coll != null)
-				{
-					var v2Enum = new V2TaskEnumerator(fld, v2Coll, filter);
-					while (v2Enum.MoveNext())
-						i++;
-				}
-				else
-				{
-					var v1Enum = new V1TaskEnumerator(svc, filter);
-					return v1Enum.Count;
-				}
-				return i;
-			}
-		}
-
-		///
-		/// Gets or sets the regular expression filter for task names.
-		///
-		/// <value>The regular expression filter.</value>
-		private Regex Filter
-		{
-			get { return filter; }
-			set
-			{
-				var sfilter = value?.ToString().TrimStart('^').TrimEnd('$') ?? string.Empty;
-				if (sfilter == string.Empty || sfilter == "*")
-					filter = null;
-				else
-				{
-					if (value != null && value.ToString().TrimEnd('$').EndsWith("\\.job", StringComparison.InvariantCultureIgnoreCase))
-						filter = new Regex(value.ToString().Replace("\\.job", ""));
-					else
-						filter = value;
-				}
-			}
-		}
-
-		///
-		/// Gets the specified registered task from the collection.
-		///
-		/// <param name="index">The index of the registered task to be retrieved.</param>
-		/// <returns>A <see cref="Task"/> instance that contains the requested context.</returns>
-		public Task this[int index]
-		{
-			get
-			{
-				var i = 0;
-				var te = GetEnumerator();
-				while (te.MoveNext())
-					if (i++ == index)
-						return te.Current;
-				throw new ArgumentOutOfRangeException(nameof(index));
-			}
-		}
-
-		///
-		/// Gets the named registered task from the collection.
-		///
-		/// <param name="name">The name of the registered task to be retrieved.</param>
-		/// <returns>A <see cref="Task"/> instance that contains the requested context.</returns>
-		public Task this[string name]
-		{
-			get
-			{
-				if (v2Coll != null)
-					return Task.CreateTask(svc, v2Coll[name]);
-
-				var v1Task = svc.GetTask(name);
-				if (v1Task != null)
-					return v1Task;
-
-				throw new ArgumentOutOfRangeException(nameof(name));
-			}
-		}
-
-		///
-		/// Determines whether the specified task exists.
-		///
-		/// <param name="taskName">The name of the task.</param>
-		/// <returns>true if task exists; otherwise, false.</returns>
-		public bool Exists([NotNull] string taskName)
-		{
-			try
-			{
-				if (v2Coll != null)
-					return v2Coll[taskName] != null;
-
-				return svc.GetTask(taskName) != null;
-			}
-			catch { }
-			return false;
-		}
-
-		///
-		/// Returns a <see cref="System.String" /> that represents this instance.
-		///
-		/// <returns>
-		/// A <see cref="System.String" /> that represents this instance.
-		/// </returns>
-		public override string ToString() => $"TaskCollection; Count: {Count}";
 	}
-
-	///
-	/// Collection of running tasks.
-	///
-	public sealed class RunningTaskCollection : IReadOnlyList<RunningTask>, IDisposable
-	{
-		private readonly TaskService svc;
-		private readonly V2Interop.IRunningTaskCollection v2Coll;
-
-		internal RunningTaskCollection([NotNull] TaskService svc)
-		{
-			this.svc = svc;
-		}
-
-		internal RunningTaskCollection([NotNull] TaskService svc, [NotNull] V2Interop.IRunningTaskCollection iTaskColl)
-		{
-			this.svc = svc;
-			v2Coll = iTaskColl;
-		}
-
-		///
-		/// Releases all resources used by this class.
-		///
-		public void Dispose()
-		{
-			if (v2Coll != null)
-				Marshal.ReleaseComObject(v2Coll);
-		}
-
-		///
-		/// Gets an IEnumerator instance for this collection.
-		///
-		/// <returns>An enumerator.</returns>
-		public IEnumerator<RunningTask> GetEnumerator()
-		{
-			if (v2Coll != null)
-				return new ComEnumerator<RunningTask, V2Interop.IRunningTask>(() => v2Coll.Count, (object o) => v2Coll[o], o =>
-				{
-					V2Interop.IRegisteredTask task = null;
-					try { task = TaskService.GetTask(svc.v2TaskService, o.Path); } catch { }
-					return task == null ? null : new RunningTask(svc, task, o);
-				});
-			return new V1RunningTaskEnumerator(svc);
-		}
-
-		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();
-
-		private class V1RunningTaskEnumerator : IEnumerator<RunningTask>
-		{
-			private readonly TaskService svc;
-			private readonly TaskCollection.V1TaskEnumerator tEnum;
-
-			internal V1RunningTaskEnumerator([NotNull] TaskService svc)
-			{
-				this.svc = svc;
-				tEnum = new TaskCollection.V1TaskEnumerator(svc);
-			}
-
-			public bool MoveNext() => tEnum.MoveNext() && (tEnum.Current?.State == TaskState.Running || MoveNext());
-
-			public RunningTask Current => new RunningTask(svc, tEnum.ICurrent);
-
-			///
-			/// Releases all resources used by this class.
-			///
-			public void Dispose()
-			{
-				tEnum.Dispose();
-			}
-
-			object System.Collections.IEnumerator.Current => Current;
-
-			public void Reset()
-			{
-				tEnum.Reset();
-			}
-		}
-
-		///
-		/// Gets the number of registered tasks in the collection.
-		///
-		public int Count
-		{
-			get
-			{
-				if (v2Coll != null)
-					return v2Coll.Count;
-				var i = 0;
-				var v1Enum = new V1RunningTaskEnumerator(svc);
-				while (v1Enum.MoveNext())
-					i++;
-				return i;
-			}
-		}
-
-		///
-		/// Gets the specified running task from the collection.
-		///
-		/// <param name="index">The index of the running task to be retrieved.</param>
-		/// <returns>A <see cref="RunningTask"/> instance.</returns>
-		public RunningTask this[int index]
-		{
-			get
-			{
-				if (v2Coll != null)
-				{
-					var irt = v2Coll[++index];
-					return new RunningTask(svc, TaskService.GetTask(svc.v2TaskService, irt.Path), irt);
-				}
-
-				var i = 0;
-				var v1Enum = new V1RunningTaskEnumerator(svc);
-				while (v1Enum.MoveNext())
-					if (i++ == index)
-						return v1Enum.Current;
-				throw new ArgumentOutOfRangeException(nameof(index));
-			}
-		}
-		///
-		/// Returns a <see cref="System.String" /> that represents this instance.
-		///
-		/// <returns>
-		/// A <see cref="System.String" /> that represents this instance.
-		/// </returns>
-		public override string ToString() => $"RunningTaskCollection; Count: {Count}";
-	}
-}
+}


handle null stack trace case

handle null stack trace case

--- Additions/TraceWriter.cs
+++ Additions/TraceWriter.cs
@@ -134,45 +134,48 @@

                                 var e = (Exception)exception;
                                 sw.WriteLine("{0}: {1}", e.GetType().FullName, e.Message);
-                                var trace = e.StackTrace;
-                                foreach (Match m in _StackTraceLine.Matches(trace))
-                                {
-                                    var method = m.Groups[1].Value;
-                                    if (AppNamespaces != null)
-                                    {
-                                        //use an application provided list of classes to determine which namespaces
-                                        //should be mapped into the package name so hockey app can pick out the correct
-                                        //top stacktrace line.  It unfortunately means you end up with an extra copy of
-                                        //package name at the beginning of your c# crash traces
-                                        foreach (var prefix in AppNamespaces)
-                                        {
-                                            if (method.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
-                                            {
-                                                method = _AppPackage + "." + method;
-                                                break;
-                                            }
-                                        }
-                                    }
-                                    else
-                                    {
-                                        //default to things that don't match mono/android/java, again, this forces an extra copy of
-                                        //package name at the beginning of your c# crash traces
-                                        if (!method.StartsWith("mono", StringComparison.OrdinalIgnoreCase) &&
-                                            !method.StartsWith("android", StringComparison.OrdinalIgnoreCase) &&
-                                            !method.StartsWith("system", StringComparison.OrdinalIgnoreCase) &&
-                                            !method.StartsWith("java", StringComparison.OrdinalIgnoreCase))
-                                        {
-                                            method = _AppPackage + "." + method;
-                                        }
-                                    }
-                                    //this forces the arguments part to look more like the file line number part that
-                                    //android stack traces normally have
-                                    var arguments = m.Groups[2].Value.Trim();
-                                    arguments = arguments.Replace(' ', '_');
-                                    arguments = arguments.Replace(',', '_');
-
-                                    sw.WriteLine("\tat {0}({1}.args:1337)", method, arguments);
-                                }
+                                var trace = e.StackTrace
+								if (trace != null)
+								{
+									foreach (Match m in _StackTraceLine.Matches(trace))
+									{
+										var method = m.Groups[1].Value;
+										if (AppNamespaces != null)
+										{
+											//use an application provided list of classes to determine which namespaces
+											//should be mapped into the package name so hockey app can pick out the correct
+											//top stacktrace line.  It unfortunately means you end up with an extra copy of
+											//package name at the beginning of your c# crash traces
+											foreach (var prefix in AppNamespaces)
+											{
+												if (method.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
+												{
+													method = _AppPackage + "." + method;
+													break;
+												}
+											}
+										}
+										else
+										{
+											//default to things that don't match mono/android/java, again, this forces an extra copy of
+											//package name at the beginning of your c# crash traces
+											if (!method.StartsWith("mono", StringComparison.OrdinalIgnoreCase) &&
+												!method.StartsWith("android", StringComparison.OrdinalIgnoreCase) &&
+												!method.StartsWith("system", StringComparison.OrdinalIgnoreCase) &&
+												!method.StartsWith("java", StringComparison.OrdinalIgnoreCase))
+											{
+												method = _AppPackage + "." + method;
+											}
+										}
+										//this forces the arguments part to look more like the file line number part that
+										//android stack traces normally have
+										var arguments = m.Groups[2].Value.Trim();
+										arguments = arguments.Replace(' ', '_');
+										arguments = arguments.Replace(',', '_');
+
+										sw.WriteLine("\tat {0}({1}.args:1337)", method, arguments);
+									}
+								}
                             }
                         }
                         catch (Exception e)


change class name.

change class name.

--- AdmxPolicy/AdmxPolicy.cs
+++ AdmxPolicy/AdmxPolicy.cs
@@ -187,7 +187,7 @@
         string RegistryValueName { get; }
     }

-    public abstract class ValueDefinitionBase : IValueDefinitionElement
+    public abstract class ValueDefinitionElementBase : IValueDefinitionElement
     {
         public virtual ElementTypes ElementType { get { return ElementTypes.Unknown; } }
         private string _Id;
@@ -196,7 +196,7 @@
         public string RegistryPath { get { return _RegistryPath; } }
         private string _RegistryValueName;
         public string RegistryValueName { get { return _RegistryValueName; } }
-        public ValueDefinitionBase(string id, string registryPath, string registryValueName)
+        public ValueDefinitionElementBase(string id, string registryPath, string registryValueName)
         {
             _Id = id;
             _RegistryPath = registryPath;
@@ -204,7 +204,7 @@
         }
     }

-    public sealed class BooleanDefinitionElement : ValueDefinitionBase
+    public sealed class BooleanDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.Boolean; } }
         private ValueDefinition _TrueValue;
@@ -223,7 +223,7 @@
         }
     }

-    public sealed class DecimalDefinitionElement : ValueDefinitionBase
+    public sealed class DecimalDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.Decimal; } }
         private bool _Required;
@@ -250,7 +250,7 @@
         }
     }

-    public sealed class LongDecimalDefinitionElement : ValueDefinitionBase
+    public sealed class LongDecimalDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.LongDecimal; } }
         private bool _Required;
@@ -277,7 +277,7 @@
         }
     }

-    public sealed class TextDefinitionElement : ValueDefinitionBase
+    public sealed class TextDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.Text; } }
         private bool _Required;
@@ -301,7 +301,7 @@
         }
     }

-    public sealed class MultiTextDefinitionElement : ValueDefinitionBase
+    public sealed class MultiTextDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.MultiText; } }
         private bool _Required;
@@ -342,7 +342,7 @@
         }
     }

-    public sealed class EnumDefinitionElement : ValueDefinitionBase
+    public sealed class EnumDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.Enum; } }
         private bool _Required;
@@ -369,7 +369,7 @@
         }
     }

-    public sealed class ListDefinitionElement : ValueDefinitionBase
+    public sealed class ListDefinitionElement : ValueDefinitionElementBase
     {
         public override ElementTypes ElementType { get { return ElementTypes.List; } }
         private string _ValuePrefix;


respect multipage limit

respect multipage limit

--- ReadSharp/Reader.cs
+++ ReadSharp/Reader.cs
@@ -35,6 +35,11 @@
     protected NReadabilityTranscoder _transcoder;

     /// <summary>
+    /// The HTTP options
+    /// </summary>
+    protected HttpOptions _options;
+
+    /// <summary>
     /// Redirect faulty mobile URIs to desktop equivalents
     /// </summary>
     private static readonly Dictionary<string, string> _redirectFaultyMobileURIs = new Dictionary<string, string>
@@ -65,6 +70,8 @@
       {
         options = HttpOptions.CreateDefault();
       }
+
+      _options = options;

       // initialize custom encoder
       _encoder = new Encodings.Encoder(true);
@@ -133,10 +140,9 @@

       // get images from article
       int id = 1;
-
-      List<ArticleImage> images = response.TranscodingResult.Images.Select<XElement, ArticleImage>(image =>
-      {
-        Uri imageUri;
+      List<ArticleImage> images = response.TranscodingResult.Images.Select(image =>
+      {
+        Uri imageUri = null;
         Uri.TryCreate(image.GetAttributeValue("src", null), UriKind.Absolute, out imageUri);

         return new ArticleImage()
@@ -146,7 +152,7 @@
           Title = image.GetAttributeValue("title", null),
           AlternativeText = image.GetAttributeValue("alt", null)
         };
-      }).ToList();
+      }).GroupBy(image => image.Uri).Select(g => g.First()).Where(image => image.Uri != null).ToList();

       // get word count and plain text
       string plainContent;
@@ -349,7 +355,7 @@
       // multiple pages are available
       try
       {
-        if (options.MultipageDownload && transcodingResult.NextPageUrl != null && (previousResponse == null || (previousResponse != null && previousResponse.PageCount < 10)))
+        if (options.MultipageDownload && transcodingResult.NextPageUrl != null && (previousResponse == null || (previousResponse != null && previousResponse.PageCount < _options.MultipageLimit)))
         {
           return await Request(new Uri(transcodingResult.NextPageUrl), new ReadOptions()
           {


Fixed an incorrect asset path in TestBench0

--- TestBench0/Main_setupScene.cs
+++ TestBench0/Main_setupScene.cs
@@ -99,7 +99,7 @@
 				sunBillboard.renderState.castsShadow = false;
 				sunDiskScene.AddObject(sunBillboard);

-				SSTexture flareTex = SSAssetManager.GetInstance<SSTextureWithAlpha>("./Planets/", "sun_flare.png");
+				SSTexture flareTex = SSAssetManager.GetInstance<SSTextureWithAlpha>(".", "sun_flare.png");
 				const float bigOffset = 0.8889f;
 				const float smallOffset = 0.125f;
 				RectangleF[] flareSpriteRects = {


fix country codes not being found for EAN13

--- BarcodeStandard/Symbologies/EAN13.cs
+++ BarcodeStandard/Symbologies/EAN13.cs
@@ -75,21 +75,28 @@
             _countryAssigningManufacturerCode = "N/A";
             var twodigitCode = Raw_Data.Substring(0, 2);
             var threedigitCode = Raw_Data.Substring(0, 3);
-            try
-            {
-                _countryAssigningManufacturerCode = _countryCodes[threedigitCode].ToString();
-            }//try
-            catch
-            {
-                try
+
+			try
+            {
+				var cc = _countryCodes[threedigitCode];
+				if (cc == null)
                 {
-                    _countryAssigningManufacturerCode = _countryCodes[twodigitCode].ToString();
-                }//try
-                catch
+					cc = _countryCodes[twodigitCode].ToString();
+					if (cc == null)
+                    {
+						Error("EEAN13-3: Country assigning manufacturer code not found.");
+					}
+					else
+                    {
+						_countryAssigningManufacturerCode = cc.ToString();
+					}
+				}
+				else
                 {
-                    Error("EEAN13-3: Country assigning manufacturer code not found.");
-                }//catch
-            }//catch
+					_countryAssigningManufacturerCode = cc.ToString();
+				}
+
+            }
             finally { _countryCodes.Clear(); }

             return result;


Tests: add ConcurrentDictionary_BinarySerialization_Fail test to framework safety tests category

--- Tests/FrameworkSafetyTests.cs
+++ Tests/FrameworkSafetyTests.cs
@@ -1,11 +1,13 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Concurrent;
+using System.IO;
 using System.Net;
 using System.Net.Sockets;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Runtime.CompilerServices;
+using System.Runtime.Serialization.Formatters.Binary;
 using NUnit.Framework;

 namespace Tests
@@ -321,5 +323,21 @@
 			if(result != 3)
 				throw new Exception("Triggered!");
 		}
+
+		//Failing on Mono 5.10+ because of using new corefx sources that is less compatible with .NET 4.5
+		//More info:
+		//https://github.com/mono/mono/issues/7822
+		//https://github.com/dotnet/corefx/issues/28137
+		//https://github.com/dotnet/corefx/pull/19742
+		[Test]
+		public void ConcurrentDictionary_BinarySerialization_Fail()
+		{
+			var target = new ConcurrentDictionary<int, int>();
+			using (var stream = new MemoryStream())
+			{
+				var formatter = new BinaryFormatter();
+				formatter.Serialize(stream, target);  //exception will be thrown here
+			}
+		}
 	}
 }


DrawOrder bugfix

DrawOrder bugfix

"topdown" and "index" were incorrectly assigned, with their values
swapped.  This patch fixes the order.

Much thanks to @Pluige for reporting this error.

--- TiledSharp/src/ObjectGroup.cs
+++ TiledSharp/src/ObjectGroup.cs
@@ -40,8 +40,8 @@

             var drawOrderDict = new Dictionary<string, DrawOrderType> {
                 {"unknown", DrawOrderType.UnknownOrder},
-                {"topdown", DrawOrderType.IndexOrder},
-                {"index", DrawOrderType.TopDown}
+                {"topdown", DrawOrderType.TopDown},
+                {"index", DrawOrderType.IndexOrder}
             };

             var drawOrderValue = (string) xObjectGroup.Attribute("draworder");


if not tls11 or higher, set tls11

if not tls11 or higher, set tls11

--- SODA/SodaRequest.cs
+++ SODA/SodaRequest.cs
@@ -172,6 +172,8 @@
         {
             System.Net.ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3;
             System.Net.ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls;
+            if (System.Net.ServicePointManager.SecurityProtocol == 0)
+                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11;
         }
     }
 }


Implemented and tested Seq sort functions

Seq.SortVelocityIncreasing();
Seq.SortVelocityDecreasing();
Seq.SortRootNotatedPitchAscending();
Seq.SortRootNotatedPitchDescending();
These just call the corresponding function on all
the trks contained in the Seq.
Reorganised Seq.cs

--- Moritz.Spec/Seq.cs
+++ Moritz.Spec/Seq.cs
@@ -337,5 +337,38 @@
 			}
 		}

-	}
+        #region sort functions
+        public void SortVelocityIncreasing()
+        {
+            foreach(Trk trk in Trks)
+            {
+                trk.SortVelocityIncreasing();
+            }
+        }
+
+        public void SortVelocityDecreasing()
+        {
+            foreach(Trk trk in Trks)
+            {
+                trk.SortVelocityDecreasing();
+            }
+        }
+
+        public void SortRootNotatedPitchAscending()
+        {
+            foreach(Trk trk in Trks)
+            {
+                trk.SortRootNotatedPitchAscending();
+            }
+        }
+
+        public void SortRootNotatedPitchDescending()
+        {
+            foreach(Trk trk in Trks)
+            {
+                trk.SortRootNotatedPitchDescending();
+            }
+        }
+        #endregion sort functions
+    }
 }