Change log level

Change log level

--- samples/unity-plugin/Assets/Bhaptics/SDK/Scripts/BhapticsUtils.cs
+++ samples/unity-plugin/Assets/Bhaptics/SDK/Scripts/BhapticsUtils.cs
@@ -126,7 +126,7 @@
             }
             catch (Exception e)
             {
-                BhapticsLogger.LogError("LaunchPlayer() " + e.Message);
+                BhapticsLogger.LogInfo("LaunchPlayer() " + e.Message);
             }
 #endif
         }


Add locking around boundaries

Add locking around boundaries

--- Stylet/StyletIoC.cs
+++ Stylet/StyletIoC.cs
@@ -46,6 +46,7 @@
         private Dictionary<Type, List<IRegistration>> registrations = new Dictionary<Type, List<IRegistration>>();
         private Dictionary<Type, List<IRegistration>> getAllRegistrations = new Dictionary<Type, List<IRegistration>>();
         private Dictionary<Type, List<UnboundGeneric>> unboundGenerics = new Dictionary<Type, List<UnboundGeneric>>();
+        private object globalLock = new object();

         private bool compilationStarted;

@@ -99,42 +100,54 @@
         public void Compile()
         {
             this.compilationStarted = true;
-            foreach (var kvp in this.registrations)
-            {
-                foreach (var registration in kvp.Value)
-                {
-                    try
+            lock (this.globalLock)
+            {
+                foreach (var kvp in this.registrations)
+                {
+                    foreach (var registration in kvp.Value)
                     {
-                        registration.GetGenerator(this);
+                        try
+                        {
+                            registration.GetGenerator(this);
+                        }
+                        catch (StyletIoCFindConstructorException)
+                        {
+                            // If we can't resolve an auto-created type, that's fine
+                            // Don't remove it from the list of types - that way they'll get a
+                            // decent error message if they actually try and resolve it
+                            if (!registration.WasAutoCreated)
+                                throw;
+                        }
                     }
-                    catch (StyletIoCFindConstructorException)
-                    {
-                        // If we can't resolve an auto-created type, that's fine
-                        // Don't remove it from the list of types - that way they'll get a
-                        // decent error message if they actually try and resolve it
-                        if (!registration.WasAutoCreated)
-                            throw;
-                    }
                 }
             }
         }

         public object Get(Type type, string key = null)
         {
-            return this.GetRegistration(type, key, false).GetGenerator(this)();
+            Func<object> generator;
+            lock (this.globalLock)
+            {
+                generator =  this.GetRegistration(type, key, false).GetGenerator(this);
+            }
+            return generator();
         }

         public T Get<T>(string key = null)
         {
-
             return (T)this.Get(typeof(T), key);
         }

         public IEnumerable<object> GetAll(Type type, string key = null)
         {
-            if (!this.TryEnsureGetAllRegistrationCreatedFromElementType(type, null, key))
-                throw new StyletIoCRegistrationException(String.Format("Could not find registration for type {0} and key '{1}'", type.Name));
-            return (IEnumerable<object>)this.getAllRegistrations[type].Single(x => x.Key == key).GetGenerator(this)();
+            Func<object> generator;
+            lock (this.globalLock)
+            {
+                if (!this.TryEnsureGetAllRegistrationCreatedFromElementType(type, null, key))
+                    throw new StyletIoCRegistrationException(String.Format("Could not find registration for type {0} and key '{1}'", type.Name));
+                generator = this.getAllRegistrations[type].Single(x => x.Key == key).GetGenerator(this);
+            }
+            return (IEnumerable<object>)generator();
         }

         public IEnumerable<T> GetAll<T>(string key = null)
@@ -285,38 +298,44 @@

         private void AddRegistration(Type type, IRegistration registration)
         {
-            if (!this.registrations.ContainsKey(type))
-                this.registrations[type] = new List<IRegistration>();
-
-            // Is there an auto-registration for this type? If so, remove it
-            var existingRegistration = this.registrations[type].Where(x => x.Key == registration.Key && x.Type == registration.Type).FirstOrDefault();
-            if (existingRegistration != null)
-            {
-                if (existingRegistration.WasAutoCreated)
-                    this.registrations[type].Remove(existingRegistration);
-                else
-                    throw new StyletIoCRegistrationException(String.Format("Multiple registrations for type {0} found", type.Name));
-            }
-
-            this.registrations[type].Add(registration);
+            lock (this.globalLock)
+            {
+                if (!this.registrations.ContainsKey(type))
+                    this.registrations[type] = new List<IRegistration>();
+
+                // Is there an auto-registration for this type? If so, remove it
+                var existingRegistration = this.registrations[type].Where(x => x.Key == registration.Key && x.Type == registration.Type).FirstOrDefault();
+                if (existingRegistration != null)
+                {
+                    if (existingRegistration.WasAutoCreated)
+                        this.registrations[type].Remove(existingRegistration);
+                    else
+                        throw new StyletIoCRegistrationException(String.Format("Multiple registrations for type {0} found", type.Name));
+                }
+
+                this.registrations[type].Add(registration);
+            }
         }

         private void AddUnboundGeneric(Type type, UnboundGeneric unboundGeneric)
         {
-            if (!this.unboundGenerics.ContainsKey(type))
-                this.unboundGenerics[type] = new List<UnboundGeneric>();
-
-            // Is there an auto-registration for this type? If so, remove it
-            var existingEntry = this.unboundGenerics[type].Where(x => x.Key == unboundGeneric.Key && x.Type == unboundGeneric.Type).FirstOrDefault();
-            if (existingEntry != null)
-            {
-                if (existingEntry.WasAutoCreated)
-                    this.unboundGenerics[type].Remove(existingEntry);
-                else
-                    throw new StyletIoCRegistrationException(String.Format("Multiple registrations for type {0} found", type.Name));
-            }
-
-            this.unboundGenerics[type].Add(unboundGeneric);
+            lock (this.globalLock)
+            {
+                if (!this.unboundGenerics.ContainsKey(type))
+                    this.unboundGenerics[type] = new List<UnboundGeneric>();
+
+                // Is there an auto-registration for this type? If so, remove it
+                var existingEntry = this.unboundGenerics[type].Where(x => x.Key == unboundGeneric.Key && x.Type == unboundGeneric.Type).FirstOrDefault();
+                if (existingEntry != null)
+                {
+                    if (existingEntry.WasAutoCreated)
+                        this.unboundGenerics[type].Remove(existingEntry);
+                    else
+                        throw new StyletIoCRegistrationException(String.Format("Multiple registrations for type {0} found", type.Name));
+                }
+
+                this.unboundGenerics[type].Add(unboundGeneric);
+            }
         }

         private void AddGetAllRegistration(Type type, IRegistration registration)


Update testing code

Update testing code

--- TVGLTest/Program.cs
+++ TVGLTest/Program.cs
@@ -99,11 +99,11 @@
                 dir = new DirectoryInfo("../../../TestFiles");
             }
             var random = new Random();
-            //var fileNames = dir.GetFiles("*").OrderBy(x => random.Next()).ToArray();
-            var fileNames = dir.GetFiles("*SquareSupportWithAdditionsForSegmentationTesting*").ToArray();
+            var fileNames = dir.GetFiles("*").OrderBy(x => random.Next()).ToArray();
+            //var fileNames = dir.GetFiles("*SquareSupportWithAdditionsForSegmentationTesting*").ToArray();
             //Casing = 18
             //SquareSupport = 75
-            for (var i = 0; i < fileNames.Count(); i+=76)
+            for (var i = 0; i < fileNames.Count(); i++)
             {
                 //var filename = FileNames[i];
                 var filename = fileNames[i].FullName;
@@ -149,11 +149,12 @@
             stopwatch.Start();
             var vs1 = new VoxelizedSolid(ts,8);
             //var dir = new List<double>(new double[] { 1, 1, 1 }).normalize();
-            var dir = new List<double>(new double[] { 1, 2, 3 }).normalize(); //Second voxel is skipped in CreateProjectionMask
+            var dir = new List<double>(new double[] { 1, 2, 3 }).normalize();
             var neg = vs1.InvertToNewSolid();
             var erd = neg.ErodeVoxelSolid(vs1, dir);
             erd.SolidColor = new Color(KnownColors.Magenta);
             Presenter.ShowAndHang(vs1, erd);
+            return;
             Console.WriteLine("done constructing, now ...");
             //Presenter.ShowAndHang(vs1,2);
             //var vs1ts = vs1.ConvertToTessellatedSolid(color);


add validate local credentials API (to allow for email as username)

--- source/MembershipRebootUserService/MembershipRebootUserService.cs
+++ source/MembershipRebootUserService/MembershipRebootUserService.cs
@@ -116,11 +116,16 @@
         {
             return Task.FromResult<AuthenticateResult>(null);
         }
+
+        protected virtual bool ValidateLocalCredentials(string username, string password, SignInMessage message, out TAccount account)
+        {
+            return userAccountService.Authenticate(username, password, out account);
+        }

         public virtual async Task<AuthenticateResult> AuthenticateLocalAsync(string username, string password, SignInMessage message)
         {
             TAccount account;
-            if (userAccountService.Authenticate(username, password, out account))
+            if (ValidateLocalCredentials(username, password, message, out account))
             {
                 var result = await PostAuthenticateLocalAsync(account, message);
                 if (result != null) return result;


TODO for making generated/reflection hooks tests.

We do not implement this now, because GeneratingObjectReader is not ready yet.

--- Tests/HooksTests.cs
+++ Tests/HooksTests.cs
@@ -33,6 +33,8 @@
 	[TestFixture]
 	public class HooksTests
 	{
+		// TODO: do this tests for generated/reflection serializer
+
 		[Test]
 		public void ShouldInvokePreSerialization()
 		{


try threaded

try threaded

--- Tests/TestConfig.cs
+++ Tests/TestConfig.cs
@@ -1,3 +0,0 @@
-using Xunit;
-
-[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]


Fix failing tests.

Fix failing tests.

--- src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs
+++ src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs
@@ -153,7 +153,7 @@
             Mapper.Map(dtos, items.ToList()).Should().HaveElementAt(0, items.First());
         }

-        public void Should_Be_Fast_With_Large_Lists_SubObject_WrongCollectionType_Should_Throw()
+        public void Should_Be_Fast_With_Large_Lists_SubObject_switch_left_and_right_expression()
         {
             Mapper.Reset();
             Mapper.Initialize(x =>
@@ -166,8 +166,7 @@

             var items = new object[100000].Select((_, i) => new Thing { ID = i }).ToList();

-            Action a = () => Mapper.Map(dtos, items.ToList()).Should().HaveElementAt(0, items.First());
-            a.ShouldThrow<ArgumentException>().Where(x => x.Message.Contains(typeof(ThingSubDto).FullName) && x.Message.Contains(typeof(ThingDto).FullName));
+            Mapper.Map(dtos, items.ToList()).Should().HaveElementAt(0, items.First());
         }

         public void Should_Work_With_Conditionals()


Update ControlFlowGraphBuilder.cs

Update ControlFlowGraphBuilder.cs

--- src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
+++ src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs
@@ -646,7 +646,7 @@
             {
                 // We set this local to true during the loop below when we make some changes that might enable
                 // transformations for basic blocks that were already looked at. We simply keep repeating the
-                // pass untill no such changes are made.
+                // pass until no such changes are made.
                 retry = false;

                 int count = blocks.Count - 1;


Add C#-like events to WebView

Add C#-like events to WebView

--- src/webkit.cs
+++ src/webkit.cs
@@ -1031,7 +1031,7 @@
 		[Export ("clear")]
 		void Clear ();

-		[Export ("captureEvents")]
+		[Export ("captureEvent")]
 		void CaptureEvents ();

 		[Export ("releaseEvents")]
@@ -1274,6 +1274,18 @@
 //		void ViewDidMoveToHostWindow ();
 //	}

+
+	[BaseType (typeof (NSUrlDownload))]
+	interface WebDownload {
+	}
+
+	[BaseType (typeof (NSObject))]
+	[Model]
+	interface WebDownloadDelegate {
+		[Export ("downloadWindowForAuthenticationSheet:"), EventArgs ("WebDownloadRequestEventArgs"), DefaultValue (null)]
+		NSWindow DownloadWindowForSheet (WebDownload download);
+	}
+
 	[BaseType (typeof (NSObject))]
 	interface WebFrame {
 		[Export ("initWithName:webFrameView:webView:")]
@@ -1341,6 +1353,52 @@

 	}

+	[Model]
+	[BaseType (typeof (NSObject))]
+	interface WebFrameLoadDelegate {
+		[Export ("webView:didStartProvisionalLoadForFrame:"), EventArgs ("WebFrame")]
+		void StartedProvisionalLoad (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:didReceiveServerRedirectForProvisionalLoadForFrame:"), EventArgs ("WebFrame")]
+		void ReceivedServerRedirectForProvisionalLoad (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:didFailProvisionalLoadWithError:forFrame:"), EventArgs ("WebFrameErrorEventArgs")]
+		void FailedProvisionalLoad (WebView sender, NSError error, WebFrame forFrame);
+
+		[Export ("webView:didCommitLoadForFrame:"), EventArgs ("WebFrameEventArgs")]
+		void CommitedLoad (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:didReceiveTitle:forFrame:"), EventArgs ("WebFrameTitle")]
+		void ReceivedTitle (WebView sender, string title, WebFrame forFrame);
+
+		[Export ("webView:didReceiveIcon:forFrame:"), EventArgs ("WebFrameImage")]
+		void ReceivedIcon (WebView sender, NSImage image, WebFrame forFrame);
+
+		[Export ("webView:didFinishLoadForFrame:"), EventArgs ("WebFrame")]
+		void FinishedLoad (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:didFailLoadWithError:forFrame:"), EventArgs ("WebFrameError")]
+		void FailedLoadWithError (WebView sender, NSError error, WebFrame forFrame);
+
+		[Export ("webView:didChangeLocationWithinPageForFrame:"), EventArgs ("WebFrame")]
+		void ChangedLocationWithinPage (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:"), EventArgs ("WebFrameClientRedirect")]
+		void WillPerformClientRedirectToUrl (WebView sender, NSUrl toUrl, double secondsDelay, NSDate fireDate, WebFrame forFrame);
+
+		[Export ("webView:didCancelClientRedirectForFrame:"), EventArgs ("WebFrame")]
+		void CanceledClientRedirect (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:willCloseFrame:"), EventArgs ("WebFrame")]
+		void WillCloseFrame (WebView sender, WebFrame forFrame);
+
+		[Export ("webView:didClearWindowObject:forFrame:"), EventArgs ("WebFrameScriptFrame")]
+		void ClearedWindowObject (WebView webView, WebScriptObject windowObject, WebFrame forFrame);
+
+		[Export ("webView:windowScriptObjectAvailable:"), EventArgs ("WebFrameScriptObject")]
+		void WindowScriptObjectAvailable (WebView webView, WebScriptObject windowScriptObject);
+	}
+
 	[BaseType (typeof (NSView))]
 	interface WebFrameView {
 		[Export ("webFrame")]
@@ -1506,6 +1564,37 @@
 	}

 	[BaseType (typeof (NSObject))]
+	[Model]
+	interface WebResourceLoadDelegate {
+		[Export ("webView:identifierForInitialRequest:fromDataSource:"), EventArgs ("WebResourceIdentifierRequest"), DefaultValue (null)]
+		NSObject IdentifierForInitialRequest (WebView sender, NSUrlRequest request, WebDataSource dataSource);
+
+		[Export ("webView:resource:willSendRequest:redirectResponse:fromDataSource:"), EventArgs ("WebResourceOnRequestSend"), DefaultValueFromArgument ("request")]
+		NSUrlRequest OnSendRequest (WebView sender, NSObject identifier, NSUrlRequest request, NSUrlResponse redirectResponse, WebDataSource dataSource);
+
+		[Export ("webView:resource:didReceiveAuthenticationChallenge:fromDataSource:"), EventArgs ("WebResourceAuthenticationChallenge")]
+		void ReceivedAuthenticationChallenge (WebView sender, NSObject identifier, NSUrlAuthenticationChallenge challenge, WebDataSource dataSource);
+
+		[Export ("webView:resource:didCancelAuthenticationChallenge:fromDataSource:"), EventArgs ("WebResourceCancelledChallenge")]
+		void CancelledAuthenticationChallenge (WebView sender, NSObject identifier, NSUrlAuthenticationChallenge challenge, WebDataSource dataSource);
+
+		[Export ("webView:resource:didReceiveResponse:fromDataSource:"), EventArgs ("WebResourceReceivedResponse")]
+		void ReceivedResponse (WebView sender, NSObject identifier, NSUrlResponse responseReceived, WebDataSource dataSource);
+
+		[Export ("webView:resource:didReceiveContentLength:fromDataSource:"), EventArgs ("WebResourceReceivedContentLength")]
+		void ReceivedContentLength (WebView sender, NSObject identifier, int length, WebDataSource dataSource);
+
+		[Export ("webView:resource:didFinishLoadingFromDataSource:"), EventArgs ("WebResourceCompleted")]
+		void FinishedLoading (WebView sender, NSObject identifier, WebDataSource dataSource);
+
+		[Export ("webView:resource:didFailLoadingWithError:fromDataSource:"), EventArgs ("WebResourceError")]
+		void FailedLoading (WebView sender, NSObject identifier, NSError withError, WebDataSource dataSource);
+
+		[Export ("webView:plugInFailedWithError:dataSource:"), EventArgs ("WebResourcePluginError")]
+		void PlugInFailed (WebView sender, NSError error, WebDataSource dataSource);
+	}
+
+	[BaseType (typeof (NSObject))]
 	interface WebScriptObject {
 		[Static, Export ("throwException:")]
 		bool ThrowException (string exceptionMessage);
@@ -1535,7 +1624,9 @@
 		void SetException (string description);
 	}

-	[BaseType (typeof (NSView))]
+	[BaseType (typeof (NSView),
+		   Events=new Type [] {typeof (WebFrameLoadDelegate), typeof (WebDownloadDelegate), typeof (WebResourceLoadDelegate) },
+		   Delegates=new string [] { "WeakFrameLoadDelegate", "WeakDownloadDelegate", "WeakResourceLoadDelegate"})]
 	interface WebView {
 		[Export ("canShowMIMEType:")]
 		bool CanShowMimeType (string MimeType);
@@ -1649,14 +1740,23 @@
 		[Export ("shouldCloseWithWindow")]
 		bool ShouldCloseWithWindow { get; set; }

-		[Export ("resourceLoadDelegate")]
-		NSObject ResourceLoadDelegate { get; set; }
-
-		[Export ("downloadDelegate")]
-		NSObject DownloadDelegate { get; set; }
-
-		[Export ("frameLoadDelegate")]
-		NSObject FrameLoadDelegate { get; set; }
+		[Export ("resourceLoadDelegate"), NullAllowed]
+		NSObject WeakResourceLoadDelegate { get; set; }
+
+		[Wrap ("WeakResourceLoadDelegate")]
+		WebResourceLoadDelegate ResourceLoadDelegate { get; set; }
+
+		[Export ("downloadDelegate"), NullAllowed]
+		NSObject WeakDownloadDelegate { get; set; }
+
+		[Wrap ("WeakDownloadDelegate")]
+		WebDownloadDelegate DownloadDelegate { get; set; }
+
+		[Export ("frameLoadDelegate"), NullAllowed]
+		NSObject WeakFrameLoadDelegate { get; set; }
+
+		[Wrap ("WeakFrameLoadDelegate")]
+		WebFrameLoadDelegate FrameLoadDelegate { get; set; }

 		[Export ("policyDelegate")]
 		NSObject PolicyDelegate { get; set; }


InlineCommentThreads can be null.

InlineCommentThreads can be null.

For example when opening a solution that is not a git repo.

--- src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs
+++ src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs
@@ -145,7 +145,7 @@
             var lineAndLeftBuffer = peekService.GetLineNumber(peekSession, triggerPoint);
             var lineNumber = lineAndLeftBuffer.Item1;
             var leftBuffer = lineAndLeftBuffer.Item2;
-            var thread = file.InlineCommentThreads.FirstOrDefault(x =>
+            var thread = file.InlineCommentThreads?.FirstOrDefault(x =>
                 x.LineNumber == lineNumber &&
                 ((leftBuffer && x.DiffLineType == DiffChangeType.Delete) || (!leftBuffer && x.DiffLineType != DiffChangeType.Delete)));


Add HostRunner embryo

Add HostRunner embryo

--- Wafer/HostRunner.cs
+++ Wafer/HostRunner.cs
@@ -1,12 +1,34 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Net.Http;
+using System.Web.Http;

 namespace Wafer
 {
     public class HostRunner
     {
+        private readonly HttpServer _server;
+        private readonly HttpClient _client;
+        private readonly Uri _baseUri;
+
+        public HostRunner(Uri baseUri, Action<HttpConfiguration> webApiConfigRegistration)
+            : this(baseUri, webApiConfigRegistration, null)
+        {
+        }
+
+        public HostRunner(Uri baseUri, Action<HttpConfiguration> webApiConfigRegistration, Action<HttpConfiguration> dependencyResolverConfigRegistration)
+        {
+            _baseUri = baseUri;
+            var config = new HttpConfiguration { IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always };
+            webApiConfigRegistration(config);
+            dependencyResolverConfigRegistration?.Invoke(config);
+            _server = new HttpServer(config);
+            _client = new HttpClient(_server);
+        }
+
+        ~HostRunner()
+        {
+            _client.Dispose();
+            _server.Dispose();
+        }
     }
 }


Fix API, redundant EventArgs

Fix API, redundant EventArgs

--- src/webkit.cs
+++ src/webkit.cs
@@ -1363,10 +1363,10 @@
 		[Export ("webView:didReceiveServerRedirectForProvisionalLoadForFrame:"), EventArgs ("WebFrame")]
 		void ReceivedServerRedirectForProvisionalLoad (WebView sender, WebFrame forFrame);

-		[Export ("webView:didFailProvisionalLoadWithError:forFrame:"), EventArgs ("WebFrameErrorEventArgs")]
+		[Export ("webView:didFailProvisionalLoadWithError:forFrame:"), EventArgs ("WebFrameError")]
 		void FailedProvisionalLoad (WebView sender, NSError error, WebFrame forFrame);

-		[Export ("webView:didCommitLoadForFrame:"), EventArgs ("WebFrameEventArgs")]
+		[Export ("webView:didCommitLoadForFrame:"), EventArgs ("WebFrame")]
 		void CommitedLoad (WebView sender, WebFrame forFrame);

 		[Export ("webView:didReceiveTitle:forFrame:"), EventArgs ("WebFrameTitle")]


handle concurrency errors when deleting grants

--- src/IdentityServer4.EntityFramework/Stores/PersistedGrantStore.cs
+++ src/IdentityServer4.EntityFramework/Stores/PersistedGrantStore.cs
@@ -11,6 +11,7 @@
 using IdentityServer4.Models;
 using IdentityServer4.Stores;
 using Microsoft.Extensions.Logging;
+using Microsoft.EntityFrameworkCore;

 namespace IdentityServer4.EntityFramework.Stores
 {
@@ -45,6 +46,10 @@
             try
             {
                 _context.SaveChanges();
+            }
+            catch (DbUpdateConcurrencyException ex)
+            {
+                _logger.LogWarning("exception updating {persistedGrantKey} persisted grant in database: {error}", token.Key, ex.Message);
             }
             catch (Exception ex)
             {
@@ -82,7 +87,14 @@
                 _logger.LogDebug("removing {persistedGrantKey} persisted grant from database", key);

                 _context.PersistedGrants.Remove(persistedGrant);
-                _context.SaveChanges();
+                try
+                {
+                    _context.SaveChanges();
+                }
+                catch(DbUpdateConcurrencyException ex)
+                {
+                    _logger.LogWarning("exception removing {persistedGrantKey} persisted grant from database: {error}", key, ex.Message);
+                }
             }
             else
             {
@@ -99,7 +111,14 @@
             _logger.LogDebug("removing {persistedGrantCount} persisted grants from database for subject {subjectId}, clientId {clientId}", persistedGrants.Count, subjectId, clientId);

             _context.PersistedGrants.RemoveRange(persistedGrants);
-            _context.SaveChanges();
+            try
+            {
+                _context.SaveChanges();
+            }
+            catch (DbUpdateConcurrencyException ex)
+            {
+                _logger.LogWarning("removing {persistedGrantCount} persisted grants from database for subject {subjectId}, clientId {clientId}: {error}", persistedGrants.Count, subjectId, clientId, ex.Message);
+            }

             return Task.FromResult(0);
         }
@@ -114,8 +133,14 @@
             _logger.LogDebug("removing {persistedGrantCount} persisted grants from database for subject {subjectId}, clientId {clientId}, grantType {persistedGrantType}", persistedGrants.Count, subjectId, clientId, type);

             _context.PersistedGrants.RemoveRange(persistedGrants);
-            _context.SaveChanges();
-
+            try
+            {
+                _context.SaveChanges();
+            }
+            catch (DbUpdateConcurrencyException ex)
+            {
+                _logger.LogWarning("exception removing {persistedGrantCount} persisted grants from database for subject {subjectId}, clientId {clientId}, grantType {persistedGrantType}: {error}", persistedGrants.Count, subjectId, clientId, type, ex.Message);
+            }
             return Task.FromResult(0);
         }
     }


Fix some bugs.

Fix some bugs.

--- XMutator/Program.cs
+++ XMutator/Program.cs
@@ -13,9 +13,15 @@
 using Paraiba.Text;

 namespace XMutator {
+    internal enum TestResult {
+        Passed,
+        Failed,
+        TimeOver,
+    }
+
     internal class Program {
         // run maven test
-        private static bool MavenTest(string dirPath, int maxMilliseconds) {
+        private static TestResult MavenTest(string dirPath, int maxMilliseconds) {
             Directory.SetCurrentDirectory(dirPath);

             using (var p = new Process {
@@ -35,16 +41,22 @@
                 }

                 p.Start();
-                Console.WriteLine("Executing mvn test with the time limitation: " + (maxMilliseconds * 1.0 / 60 / 1000) + "[mins]");
                 if (!p.WaitForExit(maxMilliseconds)) {
                     p.Kill();
-                    return false;
+                    return TestResult.TimeOver;
                 }
                 //Console.WriteLine(res);

-                var passed = p.ExitCode == 0;
-                return passed;
-            }
+                return p.ExitCode == 0 ? TestResult.Passed : TestResult.Failed;
+            }
+        }
+
+        private static IEnumerable<FileInfo> GetAllPomFiles(string dirPath) {
+            var pomFilePath = Path.Combine(dirPath, "pom.xml");
+            if (File.Exists(pomFilePath)) {
+                return GetSubmoduleDirectoryPaths(new FileInfo(pomFilePath));
+            }
+            return Enumerable.Empty<FileInfo>();
         }

         private static IEnumerable<string> GetAllJavaFiles(string dirPath) {
@@ -104,6 +116,20 @@
             // コピー元のディレクトリをコピー
             foreach (var dir in Directory.GetDirectories(sourceDirName)) {
                 CopyDirectory(dir, Path.Combine(destDirName, Path.GetFileName(dir)));
+            }
+        }
+
+        private static IEnumerable<FileInfo> GetSubmoduleDirectoryPaths(FileInfo pomFileInfo) {
+            yield return pomFileInfo;
+            using (var fs = pomFileInfo.OpenRead()) {
+                var doc = XDocument.Load(fs);
+                var modules = doc.Descendants("modules").FirstOrDefault();
+                if (modules != null) {
+                    foreach (var e in modules.Elements("module")) {
+                        yield return new FileInfo(
+                                Path.Combine(pomFileInfo.DirectoryName, e.Value, "pom.xml"));
+                    }
+                }
             }
         }

@@ -152,8 +178,8 @@
                     //var projName = Path.GetFileName(dirPath);
                     //CopyDirectory(dirPath, Path.Combine("backup", projName));

-                    var files = Directory.GetFiles(dirPath, "pom.xml", SearchOption.AllDirectories)
-                            .Select(pomPath => GetSourceDirectoryPath(new FileInfo(pomPath)))
+                    var files = GetAllPomFiles(dirPath)
+                            .Select(GetSourceDirectoryPath)
                             .SelectMany(GetAllJavaFiles)
                             .ToList();
                     var statementCount = files.Select(
@@ -161,29 +187,35 @@
                             .SelectMany(cst => cst.Descendants("statement"))
                             .Count();

-                    if (!MavenTest(dirPath, maxMinutes * 60 * 1000 / 10)) {
-                        Console.Error.WriteLine("Test cases have already failed.");
+                    if (statementCount < 10) {
+                        Console.Error.WriteLine("Too small project (" + statementCount
+                                                + "[statements]).");
+                        ShowResultInCsv(statementCount);
                         Environment.Exit(-1);
                     }

-                    var maxMillisecondsForTesting = maxMinutes * 60 * 1000 / statementCount;
-                    var time = Environment.TickCount;
-                    MavenTest(dirPath, maxMillisecondsForTesting);
-                    time = (Environment.TickCount - time);
+                    TryMavenTest(dirPath, maxMinutes * 60 * 1000 / 10, statementCount);
+
+                    var maxMillisecondsToTest = maxMinutes * 60 * 1000 / statementCount;
+                    var millisecondsToTest = Environment.TickCount;
+                    TryMavenTest(dirPath, maxMillisecondsToTest, statementCount);
+                    millisecondsToTest = (Environment.TickCount - millisecondsToTest);

                     var generatedMutatns = 0;
                     var killedMutants = 0;

-                    var estimatedMinutes = time * statementCount / 60 / 1000;
+                    var estimatedMinutes = millisecondsToTest * statementCount / 60 / 1000;
                     if (!csv) {
                         Console.WriteLine("Statements: " + statementCount);
                         Console.WriteLine("Minutes (max: " + maxMinutes + "): " + estimatedMinutes
-                                          + " (" + time + "[ms] * " + statementCount + ") / ");
+                                          + " (" + millisecondsToTest + "[ms] * " + statementCount
+                                          + ") / ");
                     }

                     if (estimatedMinutes > maxMinutes) {
                         Console.Error.WriteLine("Too long time (" + estimatedMinutes + "[min]).");
-                        Environment.Exit(-1);
+                        ShowResultInCsv(statementCount, millisecondsToTest);
+                        Environment.Exit(-2);
                     }

                     foreach (var filePath in files) {
@@ -212,20 +244,21 @@
                             }
                             node.Replacement = "{}";

-                            using (var mutant = new StreamWriter(filePath, false, encoding))
+                            using (var mutant = new StreamWriter(filePath, false, encoding)) {
                                 mutant.WriteLine(tree.Code);
+                            }
                             //Console.WriteLine(tree.Code);
                             node.Replacement = null;
                             generatedMutatns++;

-                            var passed = MavenTest(dirPath, maxMillisecondsForTesting * 5);
-                            if (!passed) {
+                            if (MavenTest(dirPath, maxMillisecondsToTest * 5) != TestResult.Passed) {
                                 killedMutants++;
                             }
                         }

-                        using (var original = new StreamWriter(filePath, false, encoding))
+                        using (var original = new StreamWriter(filePath, false, encoding)) {
                             original.WriteLine(tree.Code);
+                        }
                         if (!csv) {
                             Console.WriteLine("");
                         }
@@ -234,7 +267,8 @@
                     // Measure mutation scores
                     var percentage = killedMutants * 100 / generatedMutatns;
                     if (csv) {
-                        Console.WriteLine(killedMutants + "," + generatedMutatns + "," + percentage);
+                        ShowResultInCsv(statementCount, millisecondsToTest, killedMutants,
+                                generatedMutatns, percentage);
                     } else {
                         Console.WriteLine(dirPath + ": " + killedMutants + " / " + generatedMutatns
                                           + ": " + percentage + "%");
@@ -244,5 +278,31 @@
                 p.WriteOptionDescriptions(Console.Out);
             }
         }
+
+        private static void TryMavenTest(string dirPath, int maxMilliseconds, int statementCount) {
+            switch (MavenTest(dirPath, maxMilliseconds)) {
+            case TestResult.Passed:
+                break;
+            case TestResult.Failed:
+                Console.Error.WriteLine("Failed.");
+                ShowResultInCsv(statementCount);
+                Environment.Exit(-1);
+                break;
+            case TestResult.TimeOver:
+                Console.Error.WriteLine("Timeover.");
+                ShowResultInCsv(statementCount);
+                Environment.Exit(-1);
+                break;
+            default:
+                throw new ArgumentOutOfRangeException();
+            }
+        }
+
+        private static void ShowResultInCsv(
+                int statementCount, int millisecondsToTest = -2,
+                int killedMutants = -2, int generatedMutatns = -2, int percentage = -2) {
+            Console.WriteLine(killedMutants + "," + generatedMutatns + "," + percentage + ","
+                              + statementCount + "," + millisecondsToTest);
+        }
     }
 }


Remove NETStandard inference in package Validation

Previously we'd validate that a package exposes a netstandard ref for
the netstandard version supported by any framework that the package
supported.

This check was based on policy which we no longer wish to keep.

--- src/Microsoft.DotNet.Build.Tasks.Packaging/src/ValidatePackage.cs
+++ src/Microsoft.DotNet.Build.Tasks.Packaging/src/ValidatePackage.cs
@@ -728,49 +728,6 @@
                     }
                 }
             }
-
-            // for every framework we know about, also infer it's netstandard version to ensure it can
-            // be targeted by PCL.  Even if a package only supports a single framework we still
-            // want to include a portable reference assembly.  This allows 3rd parties to add
-            // their own implementation via a lineup/runtime.json.
-
-            // only consider frameworks that support the contract at a specific version
-            var inferFrameworks = _frameworks.Values.Where(fx => fx.SupportedVersion != null && fx.SupportedVersion != VersionUtility.MaxVersion).ToArray();
-
-            var genVersionSuppression = GetSuppressionValues(Suppression.PermitPortableVersionMismatch) ?? new HashSet<string>();
-            var inferNETStandardSuppression = GetSuppressionValues(Suppression.SuppressNETStandardInference) ?? new HashSet<string>();
-            Dictionary<NuGetFramework, ValidationFramework> generationsToValidate = new Dictionary<NuGetFramework, ValidationFramework>();
-            foreach (var inferFramework in inferFrameworks)
-            {
-                var inferFrameworkMoniker = inferFramework.Framework.ToString();
-                if (inferNETStandardSuppression.Contains(inferFrameworkMoniker))
-                {
-                    continue;
-                }
-
-                NuGetFramework generation = new NuGetFramework(_generationIdentifier, Generations.DetermineGenerationForFramework(inferFramework.Framework, UseNetPlatform));
-                Log.LogMessage(LogImportance.Low, $"Validating {generation} for {ContractName}, {inferFramework.SupportedVersion} since it is supported by {inferFrameworkMoniker}");
-
-                ValidationFramework existingGeneration = null;
-                if (generationsToValidate.TryGetValue(generation, out existingGeneration))
-                {
-                    // the netstandard version should be the minimum version supported by all platforms that support that netstandard version.
-                    if (inferFramework.SupportedVersion < existingGeneration.SupportedVersion)
-                    {
-                        Log.LogMessage($"Framework {inferFramework.Framework} supports {ContractName} at {inferFramework.SupportedVersion} which is lower than {existingGeneration.SupportedVersion} supported by generation {generation.GetShortFolderName()}.  Lowering the version supported by {generation.GetShortFolderName()}.");
-                        existingGeneration.SupportedVersion = inferFramework.SupportedVersion;
-                    }
-                }
-                else
-                {
-                    generationsToValidate.Add(generation, new ValidationFramework(generation) { SupportedVersion = inferFramework.SupportedVersion });
-                }
-            }
-
-            foreach (var generation in generationsToValidate)
-            {
-                _frameworks.Add(generation.Key, generation.Value);
-            }
         }

         private class ValidationFramework
@@ -822,15 +779,6 @@
         /// <summary>
         /// Permits a non-matching targetFramework asset to be used even when a matching one exists.
         /// </summary>
-        PermitRuntimeTargetMonikerMismatch,
-        /// <summary>
-        /// Suppresses a particular set of SupportedFrameworks from inferring NETStandard support.
-        /// EG: package supports netcore45, wp8, net451, wpa81.
-        ///     package cannot support net45, and thus doesn't wish to expose netstandard1.0 or netstandard1.1
-        ///     reference assemblies.
-        ///     It can use SuppressNETStandardInference=WindowsPhone,Version=v8.0;.NETCore,Version=v4.5 to still
-        ///     validate support for wp8 and netcore45 without forcing it to support netstandard1.0 and 1.1.
-        /// </summary>
-        SuppressNETStandardInference
+        PermitRuntimeTargetMonikerMismatch
     }
 }


Fix warning as error on travis

Fix warning as error on travis

--- src/NUnitFramework/framework/Internal/Execution/SimpleWorkItem.cs
+++ src/NUnitFramework/framework/Internal/Execution/SimpleWorkItem.cs
@@ -99,8 +99,7 @@
                 // Try to locate the parent fixture. In current implementations, the test method
                 // is either one or two levels levels below the TestFixture - if this changes,
                 // so should the following code.
-                TestFixture parentFixture =
-                    parentFixture = Test.Parent as TestFixture ?? Test.Parent?.Parent as TestFixture;
+                TestFixture parentFixture = Test.Parent as TestFixture ?? Test.Parent?.Parent as TestFixture;

                 // In normal operation we should always get the methods from the parent fixture.
                 // However, some of NUnit's own tests can create a TestMethod without a parent


Yes/No read better than True/False in the console.

--- src/NewRelic.Microsoft.SqlServer.Plugin/Configuration/Settings.cs
+++ src/NewRelic.Microsoft.SqlServer.Plugin/Configuration/Settings.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Data.SqlClient;
 using System.Linq;
 using System.Reflection;
 using System.Security.Principal;
@@ -81,15 +80,15 @@
 		public void ToLog(ILog log)
 		{
 			// Pending review by New Relic before adding this information
-//			log.Info("  New Relic Key: " + LicenseKey);
+			//			log.Info("  New Relic Key: " + LicenseKey);

 			log.Info("  Version: " + Version);
-			log.Info("  Poll Interval Seconds: " + PollIntervalSeconds);
-			log.Info("  Test Mode: " + TestMode);
+			log.Info("  Test Mode: " + (TestMode ? "Yes" : "No"));
 			log.Info("  Windows Service: " + (Environment.UserInteractive ? "No" : "Yes"));
 			log.InfoFormat(@"  User: {0}\{1}", Environment.UserDomainName, Environment.UserName);
-			log.Info("  Run as Administrator: " + IsProcessElevated);
+			log.Info("  Run as Administrator: " + (IsProcessElevated ? "Yes" : "No"));
 			log.Info("  Total Endpoints: " + Endpoints.Length);
+			log.Info("  Poll Interval Seconds: " + PollIntervalSeconds);

 			var sqlServerEndpoints = Endpoints.OfType<SqlServerEndpoint>().ToArray();
 			if (sqlServerEndpoints.Any())


Loading Core assembly

Loading Core assembly

--- src/Orchard.Environment.Extensions/Loaders/CoreExtensionLoader.cs
+++ src/Orchard.Environment.Extensions/Loaders/CoreExtensionLoader.cs
@@ -6,6 +6,9 @@
 using Orchard.Environment.Extensions.Models;
 using Microsoft.Extensions.Logging;
 using Orchard.FileSystem;
+using System.IO;
+using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.ProjectModel.Loader;

 namespace Orchard.Environment.Extensions.Loaders
 {
@@ -15,6 +18,7 @@
         private readonly IHostEnvironment _hostEnvironment;
         private readonly IOrchardFileSystem _fileSystem;
         private readonly ILogger _logger;
+        private Assembly _assembly;

         public CoreExtensionLoader(
             IHostEnvironment hostEnvironment,
@@ -50,9 +54,7 @@
                 return null;
             }

-            var directory = _fileSystem.GetDirectoryInfo("Core");
-
-            var assembly = Assembly.Load(new AssemblyName(CoreAssemblyName));
+            var assembly = LoadCoreAssembly();

             if (_logger.IsEnabled(LogLevel.Information))
             {
@@ -82,5 +84,19 @@
         {
             return (type.Namespace + ".").StartsWith(CoreAssemblyName + "." + descriptor.Id + ".");
         }
+
+        private Assembly LoadCoreAssembly()
+        {
+            if (_assembly == null)
+            {
+                var projectContext = ProjectContext.CreateContextForEachFramework("Core/Orchard.Core").FirstOrDefault();
+
+                var loadContext = projectContext.CreateLoadContext();
+
+                _assembly = loadContext.LoadFromAssemblyName(new AssemblyName(CoreAssemblyName));
+            }
+
+            return _assembly;
+        }
     }
 }


1657: expose PaintFx (pdn) MemHolder

1657: expose PaintFx (pdn) MemHolder

--- src/PixelFarm/BackEnd.PaintFx/PdnSharedProject/01_Core/Surface.cs
+++ src/PixelFarm/BackEnd.PaintFx/PdnSharedProject/01_Core/Surface.cs
@@ -14,7 +14,7 @@
 namespace PaintFx
 {

-    class MemHolder
+    public class MemHolder
     {
         unsafe int* memAddress;
         int len; //len of int32 array
@@ -73,7 +73,7 @@
         int width;
         int height;
         int stride;
-        MemHolder memHolder;
+        MemHolder memHolder;
         bool disposed = false;

         /// <summary>
@@ -81,7 +81,7 @@
         /// </summary>
         /// <param name="width">The width, in pixels, of the new Surface.</param>
         /// <param name="height">The height, in pixels, of the new Surface.</param>
-        internal Surface(int stride, int width, int height, MemHolder memHolder)
+        public Surface(int stride, int width, int height, MemHolder memHolder)
         {
             this.stride = stride;
             this.width = width;


Fixed accessibility issue with the errors messages ids and aria attributes

--- src/SFA.DAS.EmployerUsers.Web/Views/Account/ChangePassword.cshtml
+++ src/SFA.DAS.EmployerUsers.Web/Views/Account/ChangePassword.cshtml
@@ -49,7 +49,7 @@
                 @Model.Data.CurrentPasswordError

             <input type="password" autocomplete="off" autofocus="autofocus" aria-required="true" class="form-control" id="CurrentPassword" name="CurrentPassword"
-                    @(!string.IsNullOrEmpty(Model.Data.CurrentPasswordError) ? "aria-invalid=true aria-describedby=error-password" : "" )>
+                    @(!string.IsNullOrEmpty(Model.Data.CurrentPasswordError) ? "aria-invalid=true aria-describedby=error-current-password" : "" )>

@@ -58,7 +58,7 @@
                 @Model.Data.NewPasswordError

             <input type="password" aria-required="true" class="form-control" id="NewPassword" name="NewPassword"
-                    @(!string.IsNullOrEmpty(Model.Data.NewPasswordError) ? "aria-invalid=true aria-describedby=error-password" : "" )>
+                    @(!string.IsNullOrEmpty(Model.Data.NewPasswordError) ? "aria-invalid=true aria-describedby=error-new-password" : "" )>

@@ -66,7 +66,7 @@
                 @Model.Data.ConfirmPasswordError

             <input type="password" aria-required="true" class="form-control" id="ConfirmPassword" name="ConfirmPassword"
-                    @(!string.IsNullOrEmpty(Model.Data.ConfirmPasswordError) ? "aria-invalid=true aria-describedby=error-password" : "" )>
+                    @(!string.IsNullOrEmpty(Model.Data.ConfirmPasswordError) ? "aria-invalid=true aria-describedby=error-confirm-password" : "" )>

     </fieldset>
     <button type="submit" class="button">Continue</button>


Tests: Disable TGDB Tests for now

Tests: Disable TGDB Tests for now

--- src/Snowflake.Framework.Tests/Scraping/ScraperIntegrationTests.cs
+++ src/Snowflake.Framework.Tests/Scraping/ScraperIntegrationTests.cs
@@ -12,15 +12,15 @@
 {
     public class ScraperIntegrationTests
     {
-        [Fact]
-        public async Task TGDBScraping_Test()
-        {
-            var tgdb = new TheGamesDbScraper();
-            var scrapeJob = new ScrapeJob(new SeedContent[] {
-                ("platform", "NINTENDO_NES"),
-                ("search_title", "Super Mario Bros."),
-            }, new[] { tgdb }, new ICuller[] { });
-            while (await scrapeJob.Proceed());
-        }
+        // [Fact]
+        // public async Task TGDBScraping_Test()
+        // {
+        //     var tgdb = new TheGamesDbScraper();
+        //     var scrapeJob = new ScrapeJob(new SeedContent[] {
+        //         ("platform", "NINTENDO_NES"),
+        //         ("search_title", "Super Mario Bros."),
+        //     }, new[] { tgdb }, new ICuller[] { });
+        //     while (await scrapeJob.Proceed());
+        // }
     }
 }


Fixed unknown char in comments

Fixed unknown char in comments

Cosmetic change.

--- src/System.Management.Automation/namespaces/FileSystemProvider.cs
+++ src/System.Management.Automation/namespaces/FileSystemProvider.cs
@@ -7799,7 +7799,7 @@
         private bool wait;

         /// <summary>
-        /// When the �Raw switch is present, we don�t do any breaks on newlines,
+        /// When the Raw switch is present, we don't do any breaks on newlines,
         /// and only emit one object to the pipeline: all of the content.
         /// </summary>
         [Parameter]


Correcting DELETE FROM query so it works with sql ce as well.

--- src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs
@@ -116,9 +116,12 @@

         private string FormatDeleteStatement(string tableName, string keyName)
         {
+            //This query works with sql ce and sql server:
+            //DELETE FROM umbracoUser2NodeNotify WHERE umbracoUser2NodeNotify.nodeId IN
+            //(SELECT nodeId FROM umbracoUser2NodeNotify as TB1 INNER JOIN umbracoNode as TB2 ON TB1.nodeId = TB2.id WHERE TB2.trashed = '1' AND TB2.nodeObjectType = 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972')
             return
                 string.Format(
-                    "DELETE FROM {0} FROM {0} as TB1 INNER JOIN umbracoNode as TB2 ON TB1.{1} = TB2.id WHERE TB2.trashed = '1' AND TB2.nodeObjectType = @NodeObjectType",
+                    "DELETE FROM {0} WHERE {0}.{1} IN (SELECT TB1.{1} FROM {0} as TB1 INNER JOIN umbracoNode as TB2 ON TB1.{1} = TB2.id WHERE TB2.trashed = '1' AND TB2.nodeObjectType = @NodeObjectType)",
                     tableName, keyName);
         }


fix casing for remote api challenge verb

--- src/Unicorn/ControlPanel/Remote/UnicornRemotePipelineProcessor.cs
+++ src/Unicorn/ControlPanel/Remote/UnicornRemotePipelineProcessor.cs
@@ -30,7 +30,7 @@

 			var verb = (context.Request.QueryString["verb"] ?? string.Empty).ToLowerInvariant();

-			if (verb == "Challenge")
+			if (verb == "challenge")
 			{
 				context.Response.ContentType = "text/plain";
 				context.Response.Write(AuthenticationProvider.GetChallengeToken());


Removing reset during invalidation

Removing reset during invalidation

--- src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
@@ -113,7 +113,6 @@
         {
             Logger.Trace("Invalidated");
             CacheInvalidated.SafeInvoke();
-            ResetData();
             SaveData(DateTimeOffset.Now, true);
         }


fix coordinate centromappa

fix coordinate centromappa

--- src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
+++ src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
@@ -1,16 +1,19 @@
 using SO115App.API.Models.Classi.Condivise;
 using SO115App.API.Models.Classi.Geo;
 using SO115App.Models.Servizi.Infrastruttura.Marker;
+using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Distaccamenti;

 namespace SO115App.Persistence.MongoDB.Marker
 {
     public class GetCentroMappa : IGetCentroMappaMarker
     {
+        private readonly IGetCoordinateByCodSede _service;
+        public GetCentroMappa(IGetCoordinateByCodSede service) => _service = service;
+
         public CentroMappa GetCentroMappaMarker(string codiceSede)
         {
-            if (!(codiceSede.Equals("00") || codiceSede.Equals("001")))
-            {
-                var coordinate = new Coordinate(0.0, 0.0);
+
+                var coordinate = _service.Get(codiceSede);

                 var centroMappa = new CentroMappa()
                 {
@@ -19,19 +22,7 @@
                 };

                 return centroMappa;
-            }
-            else
-            {
-                var coordinate = new Coordinate(41.87194, 12.56738);
-
-                var centroMappa = new CentroMappa()
-                {
-                    CoordinateCentro = coordinate,
-                    Zoom = 6
-                };
-
-                return centroMappa;
-            }
+
         }
     }
 }


Refactored creation of RabbitConnectionBase instance.

--- SignalR.RabbitMQ/RabbitMqMessageBus.cs
+++ SignalR.RabbitMQ/RabbitMqMessageBus.cs
@@ -14,7 +14,7 @@

 	    private static readonly BlockingCollection<RabbitMqMessageWrapper> Sendingbuffer
                 = new BlockingCollection<RabbitMqMessageWrapper>(new ConcurrentQueue<RabbitMqMessageWrapper>());
-        private static readonly BlockingCollection<RabbitMqMessageWrapper> Recievingbuffer
+        private static readonly BlockingCollection<RabbitMqMessageWrapper> Receivingbuffer
                 = new BlockingCollection<RabbitMqMessageWrapper>(new ConcurrentQueue<RabbitMqMessageWrapper>());

 	    private int _resource;
@@ -29,24 +29,10 @@
                 throw new ArgumentNullException("configuration");
             }

-	        if (advancedConnectionInstance != null)
-            {
-                advancedConnectionInstance.OnDisconnectionAction = OnConnectionLost;
-                advancedConnectionInstance.OnReconnectionAction = ConnectToRabbit;
-                advancedConnectionInstance.OnMessageReceived =
-                    wrapper => Recievingbuffer.Add(wrapper);
-
-                _rabbitConnectionBase = advancedConnectionInstance;
-            }
-            else
-            {
-                _rabbitConnectionBase = new EasyNetQRabbitConnection(configuration)
-                                            {
-                                                OnDisconnectionAction = OnConnectionLost,
-                                                OnReconnectionAction = ConnectToRabbit,
-                                                OnMessageReceived = wrapper => Recievingbuffer.Add(wrapper)
-                                            };
-            }
+            _rabbitConnectionBase = advancedConnectionInstance ?? new EasyNetQRabbitConnection(configuration);
+            _rabbitConnectionBase.OnDisconnectionAction = OnConnectionLost;
+            _rabbitConnectionBase.OnReconnectionAction = ConnectToRabbit;
+            _rabbitConnectionBase.OnMessageReceived = wrapper => Receivingbuffer.Add(wrapper);

             ConnectToRabbit();

@@ -54,7 +40,7 @@
             {
 	            while (true)
 	            {
-		            foreach (var message in Recievingbuffer.GetConsumingEnumerable())
+		            foreach (var message in Receivingbuffer.GetConsumingEnumerable())
 		            {
 			            try
 			            {


Remove unused using statements

Remove unused using statements

Remove using statements that are now redundant.

--- tests/AdventOfCode.Tests/Api/HttpServerFixture.cs
+++ tests/AdventOfCode.Tests/Api/HttpServerFixture.cs
@@ -4,9 +4,7 @@
 using System;
 using System.IO;
 using System.Linq;
-using System.Net.Http;
 using System.Security.Cryptography.X509Certificates;
-using System.Threading.Tasks;
 using MartinCostello.Logging.XUnit;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting.Server;
@@ -16,7 +14,6 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Xunit;
 using Xunit.Abstractions;

 namespace MartinCostello.AdventOfCode.Api


Virtual MList Bugfix

Virtual MList Bugfix

--- Signum.Engine/Patterns/VirtualMList.cs
+++ Signum.Engine/Patterns/VirtualMList.cs
@@ -91,10 +91,8 @@
             if (fi.SchemaBuilder.Settings.FieldAttribute<IgnoreAttribute>(mListPropertRoute) == null)
                 throw new InvalidOperationException($"The property {mListPropertRoute} should have an IgnoreAttribute to be used as Virtual MList");

-            QueryLogic.Expressions.Register(mListField, () => mListPropertRoute.PropertyInfo!.NiceName());
             RegisteredVirtualMLists.GetOrCreate(typeof(T)).Add(typeof(L), mListPropertRoute);

-
             var defLazyRetrieve = lazyRetrieve ?? (typeof(L) == typeof(T));
             var defLazyDelete = lazyDelete ?? (typeof(L) == typeof(T));


skip new unit test in SILVERLIGHT

skip new unit test in SILVERLIGHT

--- tests/NLog.UnitTests/LayoutRenderers/DateTests.cs
+++ tests/NLog.UnitTests/LayoutRenderers/DateTests.cs
@@ -58,6 +58,7 @@
             Assert.True(Math.Abs((dt - now).TotalSeconds) < 5);
         }

+#if !SILVERLIGHT

         [Fact]
         public void TimeZoneTest()
@@ -84,6 +85,8 @@
             }

         }
+
+#endif

         [Fact]
         public void UniversalTimeTest()


remove prints from keyboardhook

remove prints from keyboardhook

--- TCC.Core/KeyboardHook.cs
+++ TCC.Core/KeyboardHook.cs
@@ -35,7 +35,6 @@
         public void Enable()
         {
             if (_isInitialized) return;
-            Console.WriteLine("Enabling keyhook");
             App.BaseDispatcher.Invoke(() =>
             {
                 // register the event that is fired after the key press.
@@ -51,7 +50,6 @@
         public void Disable()
         {
             if (!_isInitialized) return;
-            Console.WriteLine("Disabling keyhook");
             App.BaseDispatcher.Invoke(() =>
             {
                 if (_isRegistered) ClearHotkeys();


removed commented code

removed commented code

--- TCC.Core/SkillManager.cs
+++ TCC.Core/SkillManager.cs
@@ -61,6 +61,7 @@
         }

+
         public static void AddSkill(uint id, uint cd)
         {
             if (SkillsDatabase.TryGetSkill(id, SessionManager.CurrentPlayer.Class, out Skill skill))
@@ -92,12 +93,7 @@

         public static void Clear()
         {
-            //App.Current.Dispatcher.BeginInvoke(new Action(() =>
-            //{
-            //    SessionManager.CurrentPlayer.Buffs.Clear();
-            //    SessionManager.CurrentPlayer.Debuffs.Clear();
-            //    SessionManager.CurrentPlayer.InfBuffs.Clear();
-            //}));
+
             CooldownBarWindowManager.Instance.ShortSkills.Clear();
             CooldownBarWindowManager.Instance.LongSkills.Clear();


Remove IMetaDataComponent dependency from DirtyUi in GasCanisterSystem Just so I don't need to make this use MetaDataComponent for now.

--- Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
+++ Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
@@ -73,9 +73,9 @@

         private void DirtyUI(EntityUid uid,
             GasCanisterComponent? canister = null, NodeContainerComponent? nodeContainer = null,
-            ContainerManagerComponent? containerManager = null, IMetaDataComponent? metadata = null)
-        {
-            if (!Resolve(uid, ref metadata, ref canister, ref nodeContainer, ref containerManager))
+            ContainerManagerComponent? containerManager = null)
+        {
+            if (!Resolve(uid, ref canister, ref nodeContainer, ref containerManager))
                 return;

             var portStatus = false;
@@ -95,7 +95,7 @@
             }

             _userInterfaceSystem.TrySetUiState(uid, GasCanisterUiKey.Key,
-                new GasCanisterBoundUserInterfaceState(metadata.EntityName,
+                new GasCanisterBoundUserInterfaceState(canister.Owner.Name,
                     canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure,
                     canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure));
         }


Disable a stray debug dump.

Disable a stray debug dump.

--- tests/fixtures/TagLib.Tests.Images/XmpSpecTest.cs
+++ tests/fixtures/TagLib.Tests.Images/XmpSpecTest.cs
@@ -277,7 +277,6 @@

 			XmpTag tag = new XmpTag (metadata);
 			var tree = tag.NodeTree;
-			tree.Dump ();

 			Assert.IsTrue (tree != null);
 			Assert.AreEqual (1, tree.Children.Count);


unity: fix default geocoder string

unity: fix default geocoder string

--- unity/library/UtyMap.Unity/Infrastructure/Config/ConfigBuilder.cs
+++ unity/library/UtyMap.Unity/Infrastructure/Config/ConfigBuilder.cs
@@ -90,7 +90,7 @@
                 .SetRemoteElevationData("http://dds.cr.usgs.gov/srtm/version2_1/SRTM3", "Config/srtm.schema.txt")
                 .SetRemoteMapData("http://api.openstreetmap.org/api/0.6/map?bbox=", "{1},{0},{3},{2}", "xml")
                 .SetCache("Cache")
-                .SetGeocodingServer("http://nominatim.openstreetmap.org/search");
+                .SetGeocodingServer("http://nominatim.openstreetmap.org/search?");
         }

         #endregion


Get user by Id instead of querying by Id

Get a user document directly by Id, instead of a query to match the Id.

--- src/LondonTravel.Site/Identity/UserStore.cs
+++ src/LondonTravel.Site/Identity/UserStore.cs
@@ -138,8 +138,7 @@
                 throw new ArgumentNullException(nameof(userId));
             }

-            var results = await _client.GetAsync<LondonTravelUser>((p) => p.Id == userId, cancellationToken);
-            return results.FirstOrDefault();
+            return await _client.GetAsync<LondonTravelUser>(userId);
         }

         /// <inheritdoc />


Lucene.Net.Core.Search.IndexSearcher.Search() > Changed NullReferenceException to ArgumentNullException for null check on argument

--- src/Lucene.Net.Core/Search/IndexSearcher.cs
+++ src/Lucene.Net.Core/Search/IndexSearcher.cs
@@ -549,7 +549,7 @@
         {
             if (sort == null)
             {
-                throw new System.NullReferenceException("Sort must not be null"); // LUCENENET TODO: Should this be ArgumentNullException??
+                throw new System.ArgumentNullException("Sort must not be null");
             }

             int limit = reader.MaxDoc;


Lucene.Net.Core.Util.Fst.PairOutputs: If the generic type is a reference type, we use Collections.Equals() and Collections.GetHashCode() so its values are compared if it happens to be a collection

--- src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
+++ src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
@@ -40,11 +40,21 @@
             public A Output1 { get; private set; }
             public B Output2 { get; private set; }

+            // LUCENENET specific - track whether we have value or reference types
+            // for optimization of Equals and GetHashCode()
+            private readonly bool output1IsValueType;
+            private readonly bool output2IsValueType;
+
             // use newPair
             internal Pair(A output1, B output2)
             {
                 this.Output1 = output1;
                 this.Output2 = output2;
+
+                // LUCENENET specific - track whether we have value or reference types
+                // for optimization of Equals and GetHashCode()
+                this.output1IsValueType = typeof(A).IsValueType;
+                this.output2IsValueType = typeof(B).IsValueType;
             }

             public override bool Equals(object other)
@@ -56,7 +66,11 @@
                 else if (other is Pair)
                 {
                     var pair = (Pair)other;
-                    return Output1.Equals(pair.Output1) && Output2.Equals(pair.Output2);
+
+                    // LUCENENET specific - if we have reference types, they might be collections that need to be compared
+                    // as sets of values.
+                    return output1IsValueType ? Output1.Equals(pair.Output1) : Collections.Equals(Output1, pair.Output1)
+                        && output2IsValueType ? Output2.Equals(pair.Output2) : Collections.Equals(Output2, pair.Output2);
                 }
                 else
                 {
@@ -66,7 +80,10 @@

             public override int GetHashCode()
             {
-                return Output1.GetHashCode() + Output2.GetHashCode();
+                // LUCENENET specific - if we have reference types, they might be collections that need to be compared
+                // as sets of values.
+                return (output1IsValueType ? Output1.GetHashCode() : Collections.GetHashCode(Output1))
+                    + (output2IsValueType ? Output2.GetHashCode() : Collections.GetHashCode(Output2));
             }
         }


Removed duplicates

Removed duplicates

--- src/Markdig/Extensions/Emoji/EmojiParser.cs
+++ src/Markdig/Extensions/Emoji/EmojiParser.cs
@@ -1033,7 +1033,6 @@
                 {":no_good_woman:","🙅♀"},
                 {":ok_person:","🙆"},
                 {":ok_man:","🙆♂"},
-                {":ok_woman:","🙆♀"},
                 {":tipping_hand_person:","💁"},
                 {":tipping_hand_man:","💁♂"},
                 {":tipping_hand_woman:","💁♀"},
@@ -1086,13 +1085,11 @@
                 {":male_detective:","🕵♂"},
                 {":female_detective:","🕵♀"},
                 {":guard:","💂"},
-                {":guardsman:","💂♂"},
                 {":guardswoman:","💂♀"},
                 {":construction_worker_man:","👷♂"},
                 {":construction_worker_woman:","👷♀"},
                 {":prince:","🤴"},
                 {":person_with_turban:","👳"},
-                {":man_with_turban:","👳♂"},
                 {":woman_with_turban:","👳♀"},
                 {":woman_with_headscarf:","🧕"},
                 {":man_in_tuxedo:","🤵"},
@@ -1261,7 +1258,6 @@
                 {":taco:","🌮"},
                 {":burrito:","🌯"},
                 {":stuffed_flatbread:","🥙"},
-                {":egg:","🥚"},
                 {":fried_egg:","🍳"},
                 {":shallow_pan_of_food:","🥘"},
                 {":bowl_with_spoon:","🥣"},
@@ -1345,7 +1341,6 @@
                 {":1st_place_medal:","🥇"},
                 {":2nd_place_medal:","🥈"},
                 {":3rd_place_medal:","🥉"},
-                {":baseball:","⚾"},
                 {":volleyball:","🏐"},
                 {":cricket_game:","🏏"},
                 {":field_hockey:","🏑"},


Add short delay before showing category picker when description was confirmed be enter.

--- src/Money.UI/Views/Dialogs/OutcomeCreate.cs
+++ src/Money.UI/Views/Dialogs/OutcomeCreate.cs
@@ -59,6 +59,9 @@
                 description = descriptionDialog.Value;
                 if (result == ContentDialogResult.Primary || descriptionDialog.IsEnterPressed)
                 {
+                    if (descriptionDialog.IsEnterPressed)
+                        await Task.Delay(50);
+
                     CategoryPicker categoryDialog = new CategoryPicker();
                     categoryDialog.PrimaryButtonText = "Next";
                     categoryDialog.SecondaryButtonText = "Create today";


version upped to 1.3

version upped to 1.3

--- src/NadekoBot/Services/Impl/StatsService.cs
+++ src/NadekoBot/Services/Impl/StatsService.cs
@@ -16,7 +16,7 @@
         private readonly DiscordShardedClient _client;
         private readonly DateTime _started;

-        public const string BotVersion = "1.26a";
+        public const string BotVersion = "1.3";

         public string Author => "Kwoth#2560";
         public string Library => "Discord.Net";


Don't update AbsoluteBoneTransforms is nothing has changed

--- src/OpenSage.Game/Graphics/ModelInstance.cs
+++ src/OpenSage.Game/Graphics/ModelInstance.cs
@@ -17,12 +17,12 @@
         /// <summary>
         /// Bone transforms relative to root bone.
         /// </summary>
-        internal Matrix4x4[] RelativeBoneTransforms;
+        internal readonly Matrix4x4[] RelativeBoneTransforms;

         /// <summary>
         /// Bone transforms in world space.
         /// </summary>
-        internal Matrix4x4[] AbsoluteBoneTransforms;
+        internal readonly Matrix4x4[] AbsoluteBoneTransforms;

         private Matrix4x4 _worldMatrix;

@@ -30,7 +30,7 @@
         /// Calculated bone visibilities. Child bones will be hidden
         /// if their parent bones are hidden.
         /// </summary>
-        internal bool[] BoneVisibilities;
+        internal readonly bool[] BoneVisibilities;

         private readonly bool _hasSkinnedMeshes;

@@ -40,11 +40,11 @@

         internal readonly ResourceSet SkinningBufferResourceSet;

-        public Model Model { get; }
+        public readonly Model Model;

-        public ModelBoneInstance[] ModelBoneInstances { get; }
+        public readonly ModelBoneInstance[] ModelBoneInstances;

-        public List<AnimationInstance> AnimationInstances { get; }
+        public readonly List<AnimationInstance> AnimationInstances;

         internal ModelInstance(Model model, ContentManager contentManager)
         {
@@ -142,11 +142,14 @@

         public void SetWorldMatrix(in Matrix4x4 worldMatrix)
         {
-            _worldMatrix = worldMatrix;
+            if (worldMatrix != _worldMatrix)
+            {
+                _worldMatrix = worldMatrix;

-            for (var i = 0; i < Model.BoneHierarchy.Bones.Length; i++)
-            {
-                AbsoluteBoneTransforms[i] = RelativeBoneTransforms[i] * worldMatrix;
+                for (var i = 0; i < Model.BoneHierarchy.Bones.Length; i++)
+                {
+                    AbsoluteBoneTransforms[i] = RelativeBoneTransforms[i] * worldMatrix;
+                }
             }
         }


Renamed unit test

Renamed unit test

--- src/Picturepark.SDK.V1.Tests/SchemaTests.cs
+++ src/Picturepark.SDK.V1.Tests/SchemaTests.cs
@@ -70,7 +70,7 @@

 		[Fact]
 		[Trait("Stack", "Schema")]
-		public void ShouldInvoke()
+		public void ShouldInvokeSchemaIndexingInfoProvider()
 		{
 			/// Act
 			var allTypes = _client.Schemas.GenerateSchemaFromPOCO(typeof(ClassWithSimpleRelationAndSchemaIndexingInfoProvider));


418: minor

418: minor

--- src/SharpConnect.MySql_SH/Internal/Query.cs
+++ src/SharpConnect.MySql_SH/Internal/Query.cs
@@ -69,8 +69,13 @@
         }
         internal Query(Connection conn, SqlStringTemplate sql, CommandParams cmdParams)
         {
-            //*** query use conn resource such as parser,writer
-            //so 1 query 1 connection
+            //***a query uses conn resource such as parser,writer
+            //so 1 query=> 1 connection
+            if (sql == null)
+            {
+                throw new Exception("Sql command can not null.");
+            }
+
             Query bindingQuery = conn.BindingQuery;
             if (bindingQuery != null)
             {
@@ -83,11 +88,6 @@
             }
             //--------------------------------------------------------------
             conn.BindingQuery = this;
-            //--------------------------------------------------------------
-            if (sql == null)
-            {
-                throw new Exception("Sql command can not null.");
-            }
             //--------------------------------------------------------------
             _conn = conn;
             _cmdParams = cmdParams;


Corrected void primitive type mapping in Shanq

--- src/SharpVk.Shanq/ShanqExpressionVisitor.cs
+++ src/SharpVk.Shanq/ShanqExpressionVisitor.cs
@@ -24,17 +24,17 @@
             [typeof(byte)] = (Op.OpTypeInt, new[] { 8, 0 }),
             [typeof(double)] = (Op.OpTypeFloat, new[] { 64 }),
             [typeof(float)] = (Op.OpTypeFloat, new[] { 32 }),
-            [typeof(void)] = (Op.OpTypeFloat, new int[0])
+            [typeof(void)] = (Op.OpTypeVoid, new int[0])
         };

         private readonly SpirvFile file;
         private readonly IVectorTypeLibrary vectorLibrary;

-        private Dictionary<ExpressionType, Func<Expression, ResultId>> expressionVisitors = new Dictionary<ExpressionType, Func<Expression, ResultId>>();
-        private Dictionary<SpirvStatement, ResultId> expressionResults = new Dictionary<SpirvStatement, ResultId>();
-        private Dictionary<FieldInfo, ResultId> inputMappings = new Dictionary<FieldInfo, ResultId>();
-        private Dictionary<FieldInfo, Tuple<ResultId, int>> bindingMappings = new Dictionary<FieldInfo, Tuple<ResultId, int>>();
-        private Dictionary<IFromClause, ResultId> samplerMappings = new Dictionary<IFromClause, ResultId>();
+        private readonly Dictionary<ExpressionType, Func<Expression, ResultId>> expressionVisitors = new Dictionary<ExpressionType, Func<Expression, ResultId>>();
+        private readonly Dictionary<SpirvStatement, ResultId> expressionResults = new Dictionary<SpirvStatement, ResultId>();
+        private readonly Dictionary<FieldInfo, ResultId> inputMappings = new Dictionary<FieldInfo, ResultId>();
+        private readonly Dictionary<FieldInfo, Tuple<ResultId, int>> bindingMappings = new Dictionary<FieldInfo, Tuple<ResultId, int>>();
+        private readonly Dictionary<IFromClause, ResultId> samplerMappings = new Dictionary<IFromClause, ResultId>();

         public ShanqExpressionVisitor(SpirvFile file, IVectorTypeLibrary vectorLibrary)
         {
@@ -94,9 +94,9 @@
                 [(typeof(uint), typeof(int))] = Op.OpUConvert,
             };

-            if (mapping.TryGetValue((expression.Operand.Type, expression.Type), out Op convertOp))
-            {
-                ResultId result = this.file.GetNextResultId();
+            if (mapping.TryGetValue((expression.Operand.Type, expression.Type), out var convertOp))
+            {
+                var result = this.file.GetNextResultId();

                 var subExpressionId = this.Visit(expression.Operand);

@@ -118,18 +118,18 @@
             if (IsSampler(methodDeclaringType))
             {
                 var sourceReference = (QuerySourceReferenceExpression)expression.Object;
-                ResultId samplerTypeId = this.Visit(Expression.Constant(expression.Object.Type));
-                ResultId samplerId = this.samplerMappings[(IFromClause)sourceReference.ReferencedQuerySource];
-                ResultId loadedSamplerId = this.file.GetNextResultId();
+                var samplerTypeId = this.Visit(Expression.Constant(expression.Object.Type));
+                var samplerId = this.samplerMappings[(IFromClause)sourceReference.ReferencedQuerySource];
+                var loadedSamplerId = this.file.GetNextResultId();
                 this.file.AddFunctionStatement(loadedSamplerId, Op.OpLoad, samplerTypeId, samplerId);

                 if (expression.Method.Name == nameof(Sampler2d<float, float>.Sample))
                 {
-                    ResultId resultTypeId = this.Visit(Expression.Constant(expression.Method.ReturnType));
-
-                    ResultId coordId = this.Visit(expression.Arguments[0]);
-
-                    ResultId sampleId = this.file.GetNextResultId();
+                    var resultTypeId = this.Visit(Expression.Constant(expression.Method.ReturnType));
+
+                    var coordId = this.Visit(expression.Arguments[0]);
+
+                    var sampleId = this.file.GetNextResultId();

                     this.file.AddFunctionStatement(sampleId, Op.OpImageSampleImplicitLod, resultTypeId, loadedSamplerId, coordId);

@@ -149,28 +149,28 @@
         [NodeType(ExpressionType.Negate)]
         private ResultId VisitNegate(UnaryExpression expression)
         {
-            if (GetElementType(expression.Type) != typeof(float))
+            if (this.GetElementType(expression.Type) != typeof(float))
             {
                 throw new NotSupportedException($"Expressions of type {expression.Type} are not supported.");
             }

-            return VisitUnary(expression, Op.OpFNegate);
+            return this.VisitUnary(expression, Op.OpFNegate);
         }

         [NodeType(ExpressionType.Add)]
         private ResultId VisitAdd(BinaryExpression expression)
         {
-            Op additionOp = SelectByType(expression.Type, Op.OpFAdd, Op.OpIAdd);
-
-            return VisitBinary(expression, additionOp);
+            var additionOp = this.SelectByType(expression.Type, Op.OpFAdd, Op.OpIAdd);
+
+            return this.VisitBinary(expression, additionOp);
         }

         [NodeType(ExpressionType.Subtract)]
         private ResultId VisitSubtract(BinaryExpression expression)
         {
-            Op subtractionOp = SelectByType(expression.Type, Op.OpFSub, Op.OpISub);
-
-            return VisitBinary(expression, subtractionOp);
+            var subtractionOp = this.SelectByType(expression.Type, Op.OpFSub, Op.OpISub);
+
+            return this.VisitBinary(expression, subtractionOp);
         }

         [NodeType(ExpressionType.Multiply)]
@@ -181,7 +181,7 @@
             if (this.vectorLibrary.IsVectorType(expression.Left.Type) && !this.vectorLibrary.IsVectorType(expression.Right.Type))
             {
                 if (!IsFloatingPoint(this.vectorLibrary.GetVectorElementType(expression.Left.Type))
-                        || !IsFloatingPoint(GetElementType(expression.Right.Type)))
+                        || !IsFloatingPoint(this.GetElementType(expression.Right.Type)))
                 {
                     throw new NotSupportedException("Vector by scalar multiplication is only supported for floating point types.");
                 }
@@ -197,7 +197,7 @@
             }
             else if (this.vectorLibrary.IsMatrixType(expression.Left.Type))
             {
-                if (!IsFloatingPoint(GetElementType(expression.Right.Type)))
+                if (!IsFloatingPoint(this.GetElementType(expression.Right.Type)))
                 {
                     throw new NotSupportedException("Matrix by scalar multiplication is only supported for floating point types.");
                 }
@@ -217,34 +217,34 @@
             }
             else
             {
-                multiplicationOp = SelectByType(expression.Type, Op.OpFMul, Op.OpIMul);
-            }
-
-            return VisitBinary(expression, multiplicationOp);
+                multiplicationOp = this.SelectByType(expression.Type, Op.OpFMul, Op.OpIMul);
+            }
+
+            return this.VisitBinary(expression, multiplicationOp);
         }

         [NodeType(ExpressionType.Modulo)]
         private ResultId VisitModulo(BinaryExpression expression)
         {
-            Op moduloOp = SelectByType(expression.Type, Op.OpFMod, Op.OpSMod, Op.OpUMod);
-
-            return VisitBinary(expression, moduloOp);
+            var moduloOp = this.SelectByType(expression.Type, Op.OpFMod, Op.OpSMod, Op.OpUMod);
+
+            return this.VisitBinary(expression, moduloOp);
         }

         [NodeType(ExpressionType.Divide)]
         private ResultId VisitDivide(BinaryExpression expression)
         {
-            Op divisionOp = SelectByType(expression.Type, Op.OpFDiv, Op.OpSDiv, Op.OpUDiv);
-
-            return VisitBinary(expression, divisionOp);
+            var divisionOp = this.SelectByType(expression.Type, Op.OpFDiv, Op.OpSDiv, Op.OpUDiv);
+
+            return this.VisitBinary(expression, divisionOp);
         }

         private ResultId VisitUnary(UnaryExpression expression, Op unaryOp)
         {
-            ResultId resultTypeId = this.Visit(Expression.Constant(expression.Type));
-
-            ResultId operand = this.Visit(expression.Operand);
-            ResultId result = this.file.GetNextResultId();
+            var resultTypeId = this.Visit(Expression.Constant(expression.Type));
+
+            var operand = this.Visit(expression.Operand);
+            var result = this.file.GetNextResultId();

             this.file.AddFunctionStatement(result, unaryOp, resultTypeId, operand);

@@ -253,10 +253,10 @@

         private ResultId VisitBinary(BinaryExpression expression, Op binaryOp)
         {
-            ResultId resultTypeId = this.Visit(Expression.Constant(expression.Type));
-
-            ResultId left = this.Visit(expression.Left);
-            ResultId right = this.Visit(expression.Right);
+            var resultTypeId = this.Visit(Expression.Constant(expression.Type));
+
+            var left = this.Visit(expression.Left);
+            var right = this.Visit(expression.Right);

             if (this.vectorLibrary.IsVectorType(expression.Left.Type) && !this.vectorLibrary.IsVectorType(expression.Right.Type))
             {
@@ -268,7 +268,7 @@
                 this.file.AddFunctionStatement(right, statement);
             }

-            ResultId result = this.file.GetNextResultId();
+            var result = this.file.GetNextResultId();

             this.file.AddFunctionStatement(result, binaryOp, resultTypeId, left, right);

@@ -296,11 +296,11 @@

                     if (fieldIndices.Count() == 1)
                     {
-                        ResultId targetId = this.Visit(expression.Expression);
-
-                        ResultId typeId = this.Visit(Expression.Constant(type));
-
-                        ResultId accessId = this.file.GetNextResultId();
+                        var targetId = this.Visit(expression.Expression);
+
+                        var typeId = this.Visit(Expression.Constant(type));
+
+                        var accessId = this.file.GetNextResultId();

                         this.file.AddFunctionStatement(accessId, Op.OpCompositeExtract, typeId, targetId, fieldIndices.First());

@@ -337,13 +337,13 @@

         private ResultId GetInputId(FieldInfo fieldInfo)
         {
-            ResultId typeId = this.Visit(Expression.Constant(fieldInfo.FieldType));
+            var typeId = this.Visit(Expression.Constant(fieldInfo.FieldType));

             if (this.inputMappings.ContainsKey(fieldInfo))
             {
-                ResultId fieldId = this.inputMappings[fieldInfo];
-
-                ResultId resultId = this.file.GetNextResultId();
+                var fieldId = this.inputMappings[fieldInfo];
+
+                var resultId = this.file.GetNextResultId();

                 this.file.AddFunctionStatement(resultId, Op.OpLoad, typeId, fieldId);

@@ -351,15 +351,15 @@
             }
             else
             {
-                ResultId pointerTypeId = this.Visit(Expression.Constant(typeof(UniformPointer<>).MakeGenericType(fieldInfo.FieldType)));
+                var pointerTypeId = this.Visit(Expression.Constant(typeof(UniformPointer<>).MakeGenericType(fieldInfo.FieldType)));

                 var binding = this.bindingMappings[fieldInfo];

-                ResultId accessId = this.file.GetNextResultId();
+                var accessId = this.file.GetNextResultId();

                 this.file.AddFunctionStatement(accessId, Op.OpAccessChain, pointerTypeId, binding.Item1, this.Visit(Expression.Constant(binding.Item2)));

-                ResultId resultId = this.file.GetNextResultId();
+                var resultId = this.file.GetNextResultId();

                 this.file.AddFunctionStatement(resultId, Op.OpLoad, typeId, accessId);

@@ -384,7 +384,7 @@
                 throw new NotImplementedException("New expressions are only implemented for vector types.");
             }

-            ResultId resultId = this.file.GetNextResultId();
+            var resultId = this.file.GetNextResultId();

             this.file.AddFunctionStatement(resultId, statement);

@@ -395,15 +395,15 @@
         {
             foreach (var argument in arguments)
             {
-                ResultId argumentId = this.Visit(argument);
+                var argumentId = this.Visit(argument);

                 if (this.vectorLibrary.IsVectorType(argument.Type))
                 {
-                    ResultId typeId = this.Visit(Expression.Constant(this.vectorLibrary.GetVectorElementType(argument.Type)));
+                    var typeId = this.Visit(Expression.Constant(this.vectorLibrary.GetVectorElementType(argument.Type)));

                     for (int index = 0; index < this.vectorLibrary.GetVectorLength(argument.Type); index++)
                     {
-                        ResultId fieldId = this.file.GetNextResultId();
+                        var fieldId = this.file.GetNextResultId();

                         this.file.AddFunctionStatement(fieldId, Op.OpCompositeExtract, typeId, argumentId, index);

@@ -432,16 +432,16 @@
             }
             else if (typeof(Type).IsAssignableFrom(expression.Type))
             {
-                statement = VisitTypeConstant(expression);
-            }
-            else
-            {
-                ResultId typeOperand = this.Visit(Expression.Constant(expression.Type));
+                statement = this.VisitTypeConstant(expression);
+            }
+            else
+            {
+                var typeOperand = this.Visit(Expression.Constant(expression.Type));
                 statement = new SpirvStatement(Op.OpConstant, typeOperand, expression.Value);
             }

-            if (!this.expressionResults.TryGetValue(statement, out ResultId resultId))
+            if (!this.expressionResults.TryGetValue(statement, out var resultId))
             {
                 resultId = this.file.GetNextResultId();

@@ -455,23 +455,23 @@

         private SpirvStatement VisitTypeConstant(ConstantExpression expression)
         {
-            Type value = (Type)expression.Value;
+            var value = (Type)expression.Value;

             if (this.vectorLibrary.IsMatrixType(value))
             {
-                Type rowType = this.vectorLibrary.GetMatrixRowType(value);
+                var rowType = this.vectorLibrary.GetMatrixRowType(value);
                 int[] dimensions = this.vectorLibrary.GetMatrixDimensions(value);

-                ResultId rowTypeId = this.Visit(Expression.Constant(rowType));
+                var rowTypeId = this.Visit(Expression.Constant(rowType));

                 return new SpirvStatement(Op.OpTypeMatrix, rowTypeId, dimensions[0]);
             }
             else if (this.vectorLibrary.IsVectorType(value))
             {
-                Type elementType = this.vectorLibrary.GetVectorElementType(value);
+                var elementType = this.vectorLibrary.GetVectorElementType(value);
                 int length = this.vectorLibrary.GetVectorLength(value);

-                ResultId elementTypeId = this.Visit(Expression.Constant(elementType));
+                var elementTypeId = this.Visit(Expression.Constant(elementType));

                 return new SpirvStatement(Op.OpTypeVector, elementTypeId, length);
             }
@@ -479,7 +479,7 @@
             {
                 var returnType = value.GetMethod("Invoke").ReturnType;

-                ResultId returnTypeId = this.Visit(Expression.Constant(returnType));
+                var returnTypeId = this.Visit(Expression.Constant(returnType));

                 if (value.GetMethod("Invoke").GetParameters().Length > 0)
                 {
@@ -490,16 +490,16 @@
             }
             else if (value.BaseType.IsGenericType && value.BaseType.GetGenericTypeDefinition() == typeof(Pointer<>))
             {
-                StorageClass storage = (StorageClass)value.GetProperty("Storage").GetValue(null);
-                ResultId typeId = this.Visit(Expression.Constant(value.GetGenericArguments()[0]));
+                var storage = (StorageClass)value.GetProperty("Storage").GetValue(null);
+                var typeId = this.Visit(Expression.Constant(value.GetGenericArguments()[0]));

                 return new SpirvStatement(Op.OpTypePointer, storage, typeId);
             }
-            else if (IsTupleType(value))
+            else if (this.IsTupleType(value))
             {
                 var fieldTypes = value.GetGenericArguments();

-                var fieldTypeIds = fieldTypes.Select(x => (object)this.Visit(Expression.Constant(x))).ToArray();
+                object[] fieldTypeIds = fieldTypes.Select(x => (object)this.Visit(Expression.Constant(x))).ToArray();

                 return new SpirvStatement(Op.OpTypeStruct, fieldTypeIds);
             }
@@ -509,19 +509,19 @@
             }
             else if (value.IsValueType)
             {
-                var fieldTypeIds = value.GetFieldsByOffset().Select(x => (object)this.Visit(Expression.Constant(x.FieldType))).ToArray();
+                object[] fieldTypeIds = value.GetFieldsByOffset().Select(x => (object)this.Visit(Expression.Constant(x.FieldType))).ToArray();

                 return new SpirvStatement(Op.OpTypeStruct, fieldTypeIds);
             }
             else if (IsSampler(value))
             {
-                ResultId imageTypeId = this.Visit(Expression.Constant(typeof(ImageType2d<>).MakeGenericType(value.GetGenericArguments()[0])));
+                var imageTypeId = this.Visit(Expression.Constant(typeof(ImageType2d<>).MakeGenericType(value.GetGenericArguments()[0])));

                 return new SpirvStatement(Op.OpTypeSampledImage, imageTypeId);
             }
             else if (IsImage(value))
             {
-                ResultId pixelTypeId = this.Visit(Expression.Constant(this.vectorLibrary.GetVectorElementType(value.GetGenericArguments()[0])));
+                var pixelTypeId = this.Visit(Expression.Constant(this.vectorLibrary.GetVectorElementType(value.GetGenericArguments()[0])));

                 return new SpirvStatement(Op.OpTypeImage, pixelTypeId, Dim.Dim2D, 0, 0, 0, 1, ImageFormat.Unknown);
             }
@@ -543,12 +543,12 @@

         private Op SelectByType(Type type, Op floatingPointOp, Op integerOp)
         {
-            return SelectByType(type, floatingPointOp, integerOp, integerOp);
+            return this.SelectByType(type, floatingPointOp, integerOp, integerOp);
         }

         private Op SelectByType(Type type, Op floatingPointOp, Op signedIntegerOp, Op unsignedIntegerOp)
         {
-            type = GetElementType(type);
+            type = this.GetElementType(type);

             if (IsFloatingPoint(type))
             {


Clean up the package directory on cleanup

--- src/Squirrel/UpdateManager.ApplyReleases.cs
+++ src/Squirrel/UpdateManager.ApplyReleases.cs
@@ -500,6 +500,23 @@
                         this.Log().WarnException("Couldn't delete directory: " + x.FullName, ex);
                     }
                 });
+
+                // Clean up the packages directory too
+                var releasesFile = Utility.LocalReleaseFileForAppDir(rootAppDirectory);
+                var entries = ReleaseEntry.ParseReleaseFile(File.ReadAllText(releasesFile, Encoding.UTF8));
+                var pkgDir = Utility.PackageDirectoryForAppDir(rootAppDirectory);
+                var releaseEntry = default(ReleaseEntry);
+
+                foreach (var entry in entries) {
+                    if (entry.Version == currentVersion) {
+                        releaseEntry = ReleaseEntry.GenerateFromFile(Path.Combine(pkgDir, entry.Filename));
+                        continue;
+                    }
+
+                    File.Delete(Path.Combine(pkgDir, entry.Filename));
+                }
+
+                ReleaseEntry.WriteReleaseFile(new[] { releaseEntry }, releasesFile);
             }

             internal async Task<List<ReleaseEntry>> updateLocalReleasesFile()


XHR, Silverlight: Support requests with empty body.

--- src/silverlight/Com/XMLHttpRequest.cs
+++ src/silverlight/Com/XMLHttpRequest.cs
@@ -154,11 +154,6 @@
 		{
 			_options = _extractOptions(args);

-			if (_options["method"] != "POST" && _options["method"] != "GET") {
-				// trigger error
-				return;
-			}
-
 			if (_options["transport"] == "browser") {
 				_req = (HttpWebRequest)WebRequestCreator.BrowserHttp.Create(new Uri(_options["url"]));
 			} else {
@@ -251,15 +246,16 @@
 				_req.ContentLength += _multipartHeader.Length + _multipartFooter.Length;
 				_req.ContentType = "multipart/form-data; boundary=" + boundary;
 			}
-			else
-			{
-				_req.ContentType = "application/octet-stream";
-			}

 			LoadStart(this, null);

 			_syncContext = SynchronizationContext.Current;
-			IAsyncResult asyncResult = _req.BeginGetRequestStream(new AsyncCallback(_beginRequestStreamCallback), _req);
+
+			if (_req.ContentLength == 0) {
+				_req.BeginGetResponse(new AsyncCallback(_responseCallback), _req);
+			} else {
+				_req.BeginGetRequestStream(new AsyncCallback(_beginRequestStreamCallback), _req);
+			}
 		}


(GH-824) Update Cake.MicrosoftTeams reference from 1.0.0 to 1.0.1

--- Source/Cake.Recipe/Content/addins.cake
+++ Source/Cake.Recipe/Content/addins.cake
@@ -15,7 +15,7 @@
 #addin nuget:?package=Cake.Gitter&version=1.0.2
 #addin nuget:?package=Cake.Incubator&version=6.0.0
 #addin nuget:?package=Cake.Kudu&version=1.0.1
-#addin nuget:?package=Cake.MicrosoftTeams&version=1.0.0
+#addin nuget:?package=Cake.MicrosoftTeams&version=1.0.1
 #addin nuget:?package=Cake.Slack&version=1.0.1
 #addin nuget:?package=Cake.Transifex&version=1.0.0
 #addin nuget:?package=Cake.Twitter&version=1.0.0