switch to structured objects for logging

--- src/Validation/Default/TokenRequestValidator.cs
+++ src/Validation/Default/TokenRequestValidator.cs
@@ -99,10 +99,14 @@
             /////////////////////////////////////////////
             if (_validatedRequest.Client.ProtocolType != IdentityServerConstants.ProtocolTypes.OpenIdConnect)
             {
-                LogError("Client {clientId} has invalid protocol type for token endpoint: expected {expectedProtocolType} but found {protocolType}",
-                    _validatedRequest.Client.ClientId,
-                    IdentityServerConstants.ProtocolTypes.OpenIdConnect,
-                    _validatedRequest.Client.ProtocolType);
+                LogError("Invalid protocol type for client",
+                    new
+                    {
+                        clientId = _validatedRequest.Client.ClientId,
+                        expectedProtocolType = IdentityServerConstants.ProtocolTypes.OpenIdConnect,
+                        actualProtocolType = _validatedRequest.Client.ProtocolType
+                    });
+
                 return Invalid(OidcConstants.TokenErrors.InvalidClient);
             }

@@ -160,7 +164,7 @@
             {
                 if (customValidationContext.Result.Error.IsPresent())
                 {
-                    LogError("Custom token request validator error {error}", customValidationContext.Result.Error);
+                    LogError("Custom token request validator", new { error = customValidationContext.Result.Error });
                 }
                 else
                 {
@@ -209,7 +213,7 @@
             var authZcode = await _authorizationCodeStore.GetAuthorizationCodeAsync(code);
             if (authZcode == null)
             {
-                LogError("Invalid authorization code: {code}", code);
+                LogError("Invalid authorization code", new { code });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -217,7 +221,7 @@

             if (authZcode.CreationTime.HasExceeded(authZcode.Lifetime, _clock.UtcNow.UtcDateTime))
             {
-                LogError("Authorization code expired: {code}", code);
+                LogError("Authorization code expired", new { code });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -234,7 +238,7 @@
             /////////////////////////////////////////////
             if (authZcode.ClientId != _validatedRequest.Client.ClientId)
             {
-                LogError("Client {0} is trying to use a code from client {1}", _validatedRequest.Client.ClientId, authZcode.ClientId);
+                LogError("Client is trying to use a code from a different client", new { clientId = _validatedRequest.Client.ClientId, codeClient = authZcode.ClientId });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -261,8 +265,7 @@

             if (redirectUri.Equals(_validatedRequest.AuthorizationCode.RedirectUri, StringComparison.Ordinal) == false)
             {
-                LogError("Invalid redirect_uri: {redirectUri}, expected {exceptRedirectUri}",
-                    redirectUri, _validatedRequest.AuthorizationCode.RedirectUri);
+                LogError("Invalid redirect_uri", new { redirectUri, expectedRedirectUri = _validatedRequest.AuthorizationCode.RedirectUri });
                 return Invalid(OidcConstants.TokenErrors.UnauthorizedClient);
             }

@@ -309,7 +312,7 @@

             if (isActiveCtx.IsActive == false)
             {
-                LogError("User has been disabled: {subjectId}", _validatedRequest.AuthorizationCode.Subject.GetSubjectId());
+                LogError("User has been disabled", new { subjectId = _validatedRequest.AuthorizationCode.Subject.GetSubjectId() });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -327,7 +330,7 @@
             /////////////////////////////////////////////
             if (!_validatedRequest.Client.AllowedGrantTypes.ToList().Contains(GrantType.ClientCredentials))
             {
-                LogError("{clientId} not authorized for client credentials flow, check the AllowedGrantTypes of the client", _validatedRequest.Client.ClientId);
+                LogError("Client not authorized for client credentials flow, check the AllowedGrantTypes setting", new { clientId = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.UnauthorizedClient);
             }

@@ -341,13 +344,13 @@

             if (_validatedRequest.ValidatedScopes.ContainsOpenIdScopes)
             {
-                LogError("{clientId} cannot request OpenID scopes in client credentials flow", _validatedRequest.Client.ClientId);
+                LogError("Client cannot request OpenID scopes in client credentials flow", new { clientId = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.InvalidScope);
             }

             if (_validatedRequest.ValidatedScopes.ContainsOfflineAccessScope)
             {
-                LogError("{clientId} cannot request a refresh token in client credentials flow", _validatedRequest.Client.ClientId);
+                LogError("Client cannot request a refresh token in client credentials flow", new { clientId = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.InvalidScope);
             }

@@ -364,7 +367,7 @@
             /////////////////////////////////////////////
             if (!_validatedRequest.Client.AllowedGrantTypes.Contains(GrantType.ResourceOwnerPassword))
             {
-                LogError("{clientId} not authorized for resource owner flow, check the AllowedGrantTypes of client", _validatedRequest.Client.ClientId);
+                LogError("Client not authorized for resource owner flow, check the AllowedGrantTypes setting", new { client_id = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.UnauthorizedClient);
             }

@@ -426,7 +429,7 @@
                     errorDescription = resourceOwnerContext.Result.ErrorDescription;
                 }

-                LogInfo("User authentication failed: {error}", errorDescription ?? resourceOwnerContext.Result.Error);
+                _logger.LogInformation("User authentication failed: {error}", errorDescription ?? resourceOwnerContext.Result.Error);
                 await RaiseFailedResourceOwnerAuthenticationEventAsync(userName, errorDescription);

                 return Invalid(resourceOwnerContext.Result.Error, errorDescription, resourceOwnerContext.Result.CustomResponse);
@@ -449,7 +452,7 @@

             if (isActiveCtx.IsActive == false)
             {
-                LogError("User has been disabled: {subjectId}", resourceOwnerContext.Result.Subject.GetSubjectId());
+                LogError("User has been disabled", new { subjectId = resourceOwnerContext.Result.Subject.GetSubjectId() });
                 await RaiseFailedResourceOwnerAuthenticationEventAsync(userName, "user is inactive");

                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
@@ -484,7 +487,7 @@

             if (result.IsError)
             {
-                LogWarning("Refresh token validation failed. aborting.");
+                _logger.LogWarning("Refresh token validation failed. aborting.");
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -547,7 +550,7 @@
             /////////////////////////////////////////////
             if (!_validatedRequest.Client.AllowedGrantTypes.Contains(_validatedRequest.GrantType))
             {
-                LogError("{clientId} does not have the custom grant type in the allowed list, therefore requested grant is not allowed", _validatedRequest.Client.ClientId);
+                LogError("Client does not have the custom grant type in the allowed list, therefore requested grant is not allowed", new { clientId = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.UnsupportedGrantType);
             }

@@ -556,7 +559,7 @@
             /////////////////////////////////////////////
             if (!_extensionGrantValidator.GetAvailableGrantTypes().Contains(_validatedRequest.GrantType, StringComparer.Ordinal))
             {
-                LogError("No validator is registered for the grant type: {grantType}", _validatedRequest.GrantType);
+                LogError("No validator is registered for the grant type", new { grantType = _validatedRequest.GrantType });
                 return Invalid(OidcConstants.TokenErrors.UnsupportedGrantType);
             }

@@ -583,7 +586,7 @@
             {
                 if (result.Error.IsPresent())
                 {
-                    LogError("Invalid extension grant: {error}", result.Error);
+                    LogError("Invalid extension grant", new { error = result.Error });
                     return Invalid(result.Error, result.ErrorDescription, result.CustomResponse);
                 }
                 else
@@ -609,7 +612,7 @@
                 {
                     // todo: raise event?

-                    LogError("User has been disabled: {subjectId}", result.Subject.GetSubjectId());
+                    LogError("User has been disabled", new { subjectId = result.Subject.GetSubjectId() });
                     return Invalid(OidcConstants.TokenErrors.InvalidGrant);
                 }

@@ -650,7 +653,7 @@
                 }
                 else
                 {
-                    LogError("No allowed scopes configured for {clientId}", _validatedRequest.Client.ClientId);
+                    LogError("No allowed scopes configured for client", new { clientId = _validatedRequest.Client.ClientId });
                     return false;
                 }
             }
@@ -690,7 +693,7 @@
         {
             if (authZcode.CodeChallenge.IsMissing() || authZcode.CodeChallengeMethod.IsMissing())
             {
-                LogError("{clientId} is missing code challenge or code challenge method", _validatedRequest.Client.ClientId);
+                LogError("Client is missing code challenge or code challenge method", new { clientId = _validatedRequest.Client.ClientId });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -709,7 +712,7 @@

             if (Constants.SupportedCodeChallengeMethods.Contains(authZcode.CodeChallengeMethod) == false)
             {
-                LogError("Unsupported code challenge method: {codeChallengeMethod}", authZcode.CodeChallengeMethod);
+                LogError("Unsupported code challenge method", new { codeChallengeMethod = authZcode.CodeChallengeMethod });
                 return Invalid(OidcConstants.TokenErrors.InvalidGrant);
             }

@@ -746,14 +749,24 @@
             return new TokenRequestValidationResult(_validatedRequest, error, errorDescription, customResponse);
         }

-        private void LogError(string message = null, params object[] values)
+        private void LogError(string message = null, object values = null)
         {
             var details = new TokenRequestValidationLog(_validatedRequest);
+
             if (message.IsPresent())
             {
+
                 try
                 {
-                    _logger.LogError(message + ", request details: {@details}", values, details);
+                    if (values == null)
+                    {
+                        _logger.LogError(message + ", {@details}", details);
+                    }
+                    else
+                    {
+                        _logger.LogError(message + "{@values}, {@details}", values, details);
+                    }
+
                 }
                 catch (Exception ex)
                 {
@@ -763,46 +776,6 @@
             else
             {
                 _logger.LogError("{@details}", details);
-            }
-        }
-
-        private void LogWarning(string message = null, params object[] values)
-        {
-            var details = new TokenRequestValidationLog(_validatedRequest);
-            if (message.IsPresent())
-            {
-                try
-                {
-                    _logger.LogWarning(message + ", request details: {details}", values, details);
-                }
-                catch (Exception ex)
-                {
-                    _logger.LogError("Error logging {exception}, request details: {details}", ex.Message, details);
-                }
-            }
-            else
-            {
-                _logger.LogWarning("{details}", details);
-            }
-        }
-
-        private void LogInfo(string message = null, params object[] values)
-        {
-            var details = new TokenRequestValidationLog(_validatedRequest);
-            if (message.IsPresent())
-            {
-                try
-                {
-                    _logger.LogInformation(message + ", request details: {@details}", values, details);
-                }
-                catch (Exception ex)
-                {
-                    _logger.LogError("Error logging {exception}", ex.Message);
-                }
-            }
-            else
-            {
-                _logger.LogInformation("{@details}", details);
             }
         }


get purchase orders bugs fixed

get purchase orders bugs fixed

--- src/QuickBooksOnlineAccess/Services/QuickBooksOnlineServiceSdk.cs
+++ src/QuickBooksOnlineAccess/Services/QuickBooksOnlineServiceSdk.cs
@@ -130,7 +130,7 @@

 		public async Task< GetPurchaseOrdersResponse > GetPurchseOrders( DateTime from, DateTime to )
 		{
-			var itemsQuery = string.Format( "Select * FROM PurchaseOrder  WHERE MetaData.CreateTime >= '{0}' && MetaData.CreateTime <= '{1}'", from.ToStringUtcIso8601(), to.ToStringUtcIso8601() );
+			var itemsQuery = string.Format("Select * FROM PurchaseOrder  WHERE MetaData.LastUpdatedTime >= '{0}' && MetaData.LastUpdatedTime <= '{1}'", from.ToStringUtcIso8601(), to.ToStringUtcIso8601());

 			return await Task.Factory.StartNew( () =>
 			{


Updated namespace

Updated namespace

--- src/RouteUrlRedirector.Tests/IntegrationTests/IntegrationTests.cs
+++ src/RouteUrlRedirector.Tests/IntegrationTests/IntegrationTests.cs
@@ -1,13 +1,10 @@
-using System.Collections.Generic;
-using System.Net;
+using System.Net;
 using System.Net.Http;
-using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.TestHost;
 using Xunit;

-namespace RouteUrlRedirector.Tests
+namespace RouteUrlRedirector.Tests.IntegrationTests
 {
     public class IntegrationTests
     {
@@ -18,7 +15,8 @@
             var builder = new WebHostBuilder()
                 .Configure(app => {
                     app.UseRequestRedirect(r => r.ForPath("/old/").RedirectTo("/new/").Permanently());
-            });
+                }
+            );

             var server = new TestServer(builder);


Did I do this right?

Did I do this right?

--- src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs
+++ src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs
@@ -48,7 +48,13 @@
 				dMOutputDisplayType = DiscordDMOutputDisplayType.Always;
 			DMOutputDisplay = dMOutputDisplayType;
 			if (splits.Length > 1 && Int32.TryParse(splits[2], out Int32 basedMeme))
+			{
 				BasedMeme = Convert.ToBoolean(basedMeme);
+			}
+			else
+			{
+				BasedMeme = true; // Oranges said this needs to be true by default :pensive:
+			}
 		}

 		/// <inheritdoc />


Fix ObjectDisposedException

Fix ObjectDisposedException

--- src/Tgstation.Server.Host/Components/Session/SessionController.cs
+++ src/Tgstation.Server.Host/Components/Session/SessionController.cs
@@ -293,7 +293,7 @@

 					process.Dispose();
 					bridgeRegistration.Dispose();
-					Dmb?.Dispose(); // will be null when released
+					reattachInformation.Dmb?.Dispose(); // will be null when released
 					chatTrackingContext.Dispose();
 					reattachTopicCts.Dispose();
 				}


Unintentional class move

Unintentional class move

--- src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs
@@ -123,30 +123,6 @@
         }
     }

-    [Location("cache/gitlog.yaml", LocationAttribute.Location.LibraryFolder)]
-    sealed class GitLogCache : ScriptObjectSingleton<GitLogCache>, IGitLogCache
-    {
-        [SerializeField]
-        private List<GitLogEntry> log;
-        public GitLogCache()
-        { }
-
-        public List<GitLogEntry> Log
-        {
-            get
-            {
-                if (log == null)
-                    log = new List<GitLogEntry>();
-                return log;
-            }
-            set
-            {
-                log = value;
-                Save(true);
-            }
-        }
-    }
-
     [Location("views/branches.yaml", LocationAttribute.Location.LibraryFolder)]
     sealed class Favorites : ScriptObjectSingleton<Favorites>
     {
@@ -196,4 +172,28 @@
             return FavoriteBranches.Contains(branchName);
         }
     }
+
+    [Location("cache/gitlog.yaml", LocationAttribute.Location.LibraryFolder)]
+    sealed class GitLogCache : ScriptObjectSingleton<GitLogCache>, IGitLogCache
+    {
+        [SerializeField]
+        private List<GitLogEntry> log;
+        public GitLogCache()
+        { }
+
+        public List<GitLogEntry> Log
+        {
+            get
+            {
+                if (log == null)
+                    log = new List<GitLogEntry>();
+                return log;
+            }
+            set
+            {
+                log = value;
+                Save(true);
+            }
+        }
+    }
 }


Add a dropdown for selecting organizations

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishWindow.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishWindow.cs
@@ -8,7 +8,10 @@
         private const string PublishTitle = "Publish this repository to GitHub";
         private string repoName = "";
         private string repoDescription = "";
+        private int selectedOrg = 0;
         private bool togglePrivate = false;
+
+        private string[] orgs = { "donokuda", "github", "donokudallc", "another-org" };

         static void Init()
         {
@@ -31,6 +34,7 @@
                 togglePrivate = GUILayout.Toggle(togglePrivate, "Keep my code private");
             }
             GUILayout.EndHorizontal();
+            selectedOrg = EditorGUILayout.Popup("Organization", 0, orgs);

             GUILayout.Space(5);


[Merge] Some error occured during merging the test projects

--- src/XrmFramework.Plugin/NewtonSoft.Json/JsonSerializerSettings.cs
+++ src/XrmFramework.Plugin/NewtonSoft.Json/JsonSerializerSettings.cs
@@ -23,14 +23,15 @@
 // OTHER DEALINGS IN THE SOFTWARE.
 #endregion

+using Newtonsoft.Json.Serialization;
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Globalization;
+using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters;
-using Newtonsoft.Json.Serialization;
-using System.Runtime.Serialization;
-using System.Diagnostics;
+using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;

 namespace Newtonsoft.Json
 {


Added support for writing Hid feature data.


fix saving breeding weights.

fix saving breeding weights.

--- ARKBreedingStats/uiControls/StatWeighting.cs
+++ ARKBreedingStats/uiControls/StatWeighting.cs
@@ -167,6 +167,8 @@
         public void SetSpecies(Species species)
         {
             if (species == null) return;
+
+            currentSpecies = species;
             for (int s = 0; s < Values.STATS_COUNT; s++)
                 if (statLabels[s] != null)
                     statLabels[s].Text = Utils.statName(s, true, species.IsGlowSpecies);


Support TF without Socket.Poll(...) and Socket.Select(...).


Respond to feedback

Respond to feedback

--- src/mscorlib/src/System/Array.cs
+++ src/mscorlib/src/System/Array.cs
@@ -1103,7 +1103,7 @@
                 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
             }

-            for (int i = startIndex, end = startIndex + count; i < end; i++)
+            for (int i = startIndex; i < startIndex + count; i++)
             {
                 array[i] = value;
             }


initial dijkstra implementation, seems to work...

--- AiPathFinding/Algorithm/DijkstraAlgorithm.cs
+++ AiPathFinding/Algorithm/DijkstraAlgorithm.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using AiPathFinding.Model;

 namespace AiPathFinding.Algorithm
@@ -32,29 +33,43 @@
             PrepareData(from);

             ProcessNode(from);
+
+            while (_nodeDataMap[to].Item2 == int.MaxValue && _unvisitedNodes.Count > 0)
+                ProcessNode(_unvisitedNodes[0]);
         }

         private void ProcessNode(Node node)
         {
-            foreach (var e in node.Edges)
+            // update distance to all neighbors (if shorter)
+            foreach (var e in node.Edges.Where(ee => ee != null && ee.GetOtherNode(node).Cost != int.MaxValue))
             {
+                // get other node
                 var otherNode = e.GetOtherNode(node);
-
-                //if (_nodeDataMap[otherNode].Item2 > _nodeDataMap[node].Item2 + otherNode.)
-                //_nodeDataMap[otherNode] = new Tuple<bool, int>(false, );
+
+                if (_nodeDataMap[otherNode].Item2 == int.MaxValue)
+                    _unvisitedNodes.Add(otherNode);
+
+                if (_nodeDataMap[otherNode].Item2 > _nodeDataMap[node].Item2 + otherNode.Cost)
+                    _nodeDataMap[otherNode] = new Tuple<bool, int>(false, _nodeDataMap[node].Item2 + otherNode.Cost);
             }

+            // mark current node as visited and move it to the other list
+            _nodeDataMap[node] = new Tuple<bool, int>(true, _nodeDataMap[node].Item2);
+            _visitedNodes.Add(node);
+            _unvisitedNodes.Remove(node);
         }

         private void PrepareData(Node startNode)
         {
             // add all nodes to the unvisited-node-list and tag nodes as unvisited with max cost
-            foreach (var nn in _graph.Nodes)
+            foreach (var nn in _graph.Nodes.Where(n => n != null))
             {
-                _unvisitedNodes.AddRange(nn);
-                foreach (var n in nn)
+                //_unvisitedNodes.AddRange(nn);
+                foreach (var n in nn.Where(n => n != null))
                     _nodeDataMap.Add(n, new Tuple<bool, int>(false, n == startNode ? 0 : int.MaxValue));
             }
+
+            _unvisitedNodes.Add(startNode);
         }

         #endregion


Исправление получения настроек

Исправление получения настроек

--- src/bgTeam.Core/Impl/AppConfigurationDefault.cs
+++ src/bgTeam.Core/Impl/AppConfigurationDefault.cs
@@ -89,19 +89,20 @@
                 }

                 //var secondConf = builder.Build();
-                var confsPath = addtionalConf?.AppConfigsPath ?? mainConf.AppConfigsPath;
-
-                if (!string.IsNullOrEmpty(mainConf.AppConfigsAdditional))
-                {
-                    if (string.IsNullOrEmpty(confsPath))
-                    {
-                        throw new ArgumentNullException(nameof(mainConf.AppConfigsPath));
-                    }
-
-                    foreach (var item in mainConf.AppConfigsAdditional.Split(',').Select(x => x.Trim()))
-                    {
-                        builder.AddJsonFile(Path.Combine(confsPath, $"{item}.{buildConfigure}.json"));
-                    }
+                var confsPath = string.IsNullOrEmpty(addtionalConf?.AppConfigsPath) ? mainConf.AppConfigsPath : addtionalConf.AppConfigsPath;
+                var appConfigsAdditional = string.IsNullOrEmpty(addtionalConf?.AppConfigsAdditional) ? mainConf.AppConfigsAdditional : addtionalConf.AppConfigsAdditional;
+
+                if (!string.IsNullOrEmpty(appConfigsAdditional))
+                {
+                    if (string.IsNullOrEmpty(confsPath))
+                    {
+                        throw new ArgumentNullException(nameof(mainConf.AppConfigsPath));
+                    }
+
+                    foreach (var item in appConfigsAdditional.Split(',').Select(x => x.Trim()))
+                    {
+                        builder.AddJsonFile(Path.Combine(confsPath, $"{item}.{buildConfigure}.json"));
+                    }
                 }
             }


Added ability to callback

Added ability to callback

--- AngleSharp.Core.Tests/Mocks/EventReceiver.cs
+++ AngleSharp.Core.Tests/Mocks/EventReceiver.cs
@@ -1,8 +1,8 @@
 namespace AngleSharp.Core.Tests.Mocks
 {
+    using AngleSharp.Events;
     using System;
     using System.Collections.Generic;
-    using AngleSharp.Events;

     class EventReceiver<TReceivingEvent> : IEventAggregator
     {
@@ -13,10 +13,24 @@
             get { return _received; }
         }

+        public Action<TReceivingEvent> OnReceived
+        {
+            get;
+            set;
+        }
+
         public void Publish<TEvent>(TEvent data)
         {
             if (typeof(TEvent) == typeof(TReceivingEvent))
-                _received.Add((TReceivingEvent)(data as Object));
+                Receive((TReceivingEvent)(data as Object));
+        }
+
+        void Receive(TReceivingEvent data)
+        {
+            if (OnReceived != null)
+                OnReceived(data);
+
+            _received.Add(data);
         }

         public void Subscribe<TEvent>(ISubscriber<TEvent> listener)


Added the static property JsonSerializer.Default.

--- src/cmstar/Serialization/Json/JsonSerializer.cs
+++ src/cmstar/Serialization/Json/JsonSerializer.cs
@@ -32,6 +32,16 @@
     /// </summary>
     public class JsonSerializer
     {
+        private static JsonSerializer _defaultSerializer;
+
+        /// <summary>
+        /// Gets the default instance of <see cref="JsonSerializer"/>.
+        /// </summary>
+        public static JsonSerializer Default
+        {
+            get { return _defaultSerializer ?? (_defaultSerializer = new JsonSerializer()); }
+        }
+
         /// <summary>
         /// Initializes a new instance of <see cref="JsonSerializer"/>.
         /// </summary>


Explodable

Explodable

--- src/Pipes/Abstraction/Pipeline.cs
+++ src/Pipes/Abstraction/Pipeline.cs
@@ -295,6 +295,7 @@
                         return;
                     }

+
                     if (targets.Length > 1)
                     {
                         await Task.WhenAll(targets.Select(each => each.Invoke(message)));
@@ -308,7 +309,16 @@
                     if (_exceptionHandler == null)
                         throw;

-                    _exceptionHandler(pipelineException);
+                    if (!_exceptionHandler(pipelineException))
+                        throw;
+                }
+                catch (Exception exception)
+                {
+                    if (_exceptionHandler == null)
+                        throw;
+
+                    if (!_exceptionHandler(new PipelineException<TContext>(this, exception, message)))
+                        throw;
                 }
             }
             finally


date fix

date fix

--- src/Qwack.Dates/DateExtensions.cs
+++ src/Qwack.Dates/DateExtensions.cs
@@ -703,7 +703,7 @@
                 case string p when p.Length == 3 && int.TryParse(p.Substring(1, 2), out var yr) && FutureMonths.Contains(p.Substring(0, 1)): //X18
                     var m2 = Array.IndexOf(FutureMonths, p.Substring(0, 1)) + 1;
                     return (Start: new DateTime(2000 + yr, m2, 1), End: (new DateTime(2000 + yr, m2, 1)).LastDayOfMonth(), valid:true); ;
-                case string p when p.StartsWith("Q"):
+                case string p when p.StartsWith("Q") && p.Length > 2:
                     if (!int.TryParse(p.Substring(1, 1), out var q))
                         return (Start: default(DateTime), End: default(DateTime), valid: false);
                     if (!int.TryParse(p.Substring(2).Trim('-', ' '), out var yq))


Update name GY to "The Co-operative Repub...."

To new full name: "The Co-operative Republic of Guyana"

--- src/core/main/Globalization/Iso3166Countries.cs
+++ src/core/main/Globalization/Iso3166Countries.cs
@@ -105,7 +105,7 @@
             new CountryIso3166 { CodeAlpha2 = "GG", CodeAlpha3 = "GGY", CodeNumeric = 831, NameEnglish = "Guernsey" },
             new CountryIso3166 { CodeAlpha2 = "GN", CodeAlpha3 = "GIN", CodeNumeric = 324, NameEnglish = "Guinea" },
             new CountryIso3166 { CodeAlpha2 = "GW", CodeAlpha3 = "GNB", CodeNumeric = 624, NameEnglish = "Guinea-Bissau" },
-            new CountryIso3166 { CodeAlpha2 = "GY", CodeAlpha3 = "GUY", CodeNumeric = 328, NameEnglish = "Guyana" },
+            new CountryIso3166 { CodeAlpha2 = "GY", CodeAlpha3 = "GUY", CodeNumeric = 328, NameEnglish = "The Co-operative Republic of Guyana" },
             new CountryIso3166 { CodeAlpha2 = "HT", CodeAlpha3 = "HTI", CodeNumeric = 332, NameEnglish = "Haiti" },
             new CountryIso3166 { CodeAlpha2 = "HM", CodeAlpha3 = "HMD", CodeNumeric = 334, NameEnglish = "Heard Island and McDonald Islands" },
             new CountryIso3166 { CodeAlpha2 = "VA", CodeAlpha3 = "VAT", CodeNumeric = 336, NameEnglish = "Holy See" },


See below

See below

--- Assets/Levels/Testing/Scripts/PlayerBrain.cs
+++ Assets/Levels/Testing/Scripts/PlayerBrain.cs
@@ -150,14 +150,8 @@
 		//shooting
 		if (Input.GetMouseButtonDown(0) && canShoot == true)
 		{
-//			//NOTE: move to gun swap function
-//			if (equipedGun == gunLocker.assaultRifle)
-//			{
-//				heat = 1f;
-//				HeatGain (heat);
-//			}
-//
-//			//instantiate the bullet as a clone so i can access its variables
+
+			//instantiate the bullet as a clone so i can access its variables
 			bulletClone = Instantiate (bullet, bulletSpawn.transform.position, bulletSpawn.transform.rotation) as GameObject;

 			HeatGain(weapons [currentWeapon].GetComponent<WeaponController> ().Shoot ());
@@ -227,19 +221,19 @@
 		//Credit: Peter Carey
 	}

-	//NOTE: need to find a better way of doing this, player goes trough the floor!!
+
 	void Boost()
 	{
 		if (Input.GetAxis("Vertical") != 0f)
 		{
-			//rb.position = transform.position + (transform.forward * Input.GetAxis("Vertical")  * boost * Time.deltaTime);
-			transform.Translate(transform.position + (-transform.forward * Input.GetAxis("Vertical")  * boost * Time.deltaTime));
+			//teleport in forward or backwards
+			transform.Translate((Vector3.forward * Input.GetAxis("Vertical")  * boost * Time.deltaTime));
 		}

 		else if (Input.GetAxis("Horizontal")!= 0f)
 		{
-			//rb.position = transform.position + (transform.right * Input.GetAxis("Horizontal")  * boost * Time.deltaTime);
-			transform.Translate(transform.position + (transform.right * Input.GetAxis("Horizontal")  * boost * Time.deltaTime));
+			//teleport left or right
+			transform.Translate((Vector3.right * Input.GetAxis("Horizontal")  * boost * Time.deltaTime));
 		}
 		//add heat
 		currentHeat += 20f;
@@ -342,38 +336,66 @@
 		}
 	}

-	//NOTE: Need to improve this. Shield still goes down even if overshield is on,
-	//      shield goes down when health also goes down
 	public void TakeDamage(float damage)
 	{
 		blood.Play();
+
+		//total of overshield+shield+hp - the damage
+		float total = currentHP + currentShield + currentOvershield - damage;

 		//if player has overshield
 		if (currentOvershield > 0f)
 		{
-			//take overshield off
-			currentOvershield -= damage;
-		}
-
-		//else if there is no overshield
-		else if (currentOvershield <= 0f)
-		{
-			//take off shield
-			currentShield -= damage;
+			//if overshield becomes less than 0
+			if (currentOvershield - (currentHP + currentShield + currentOvershield - total) < 0)
+			{
+				//take off that amount
+				currentOvershield -= currentHP + currentShield + currentOvershield - total;
+
+				//and take the remainder of the damage done to overshield off of shield
+				currentShield -= Mathf.Abs (currentOvershield);
+
+				//set overshield to 0
+				currentOvershield = 0;
+			}
+
+			else
+			{
+				//take overshield off
+				currentOvershield -= currentHP + currentShield + currentOvershield - total;
+			}
+
 		}

 		//if player has shield
 		if (currentShield > 0f)
 		{
-			//take shield off
-			currentShield -= damage;
+			//if shield becomes less than 0
+			if (currentShield - (currentHP + currentShield - total) < 0)
+			{
+				//take off that amount
+				currentShield -= currentHP + currentShield - total;
+
+				//and take the remainder of the damage done to shield off of HP
+				currentHP -= Mathf.Abs (currentShield);
+
+				//set shield to 0
+				currentShield = 0;
+			}
+
+			else
+			{
+				//take shield off
+				currentShield -= currentHP + currentShield - total;
+			}
+
 		}

 		//else if there is no shield
 		else if (currentShield <= 0f)
 		{
 			//take off health
-			currentHP -= damage;
+			currentHP -= currentHP - total;
 		}

 		//stop current HP go above maxHP
@@ -390,6 +412,8 @@

 			//go to game over
 		}
+
+		//CREDIT: Jacob Kreck and Xblivior
 	}

 	public void HealthChanges(float hPChange)


readonly fields now

readonly fields now

--- Assets/Scripts/Model/Characters/Character.cs
+++ Assets/Scripts/Model/Characters/Character.cs
@@ -21,12 +21,13 @@
     /// </summary>
     public class Character : IComparable<Character> {

-        public Stats Stats;
-        public Buffs Buffs;
-        public Look Look;
-        public Spells Spells;
+        public readonly Stats Stats;
+        public readonly Buffs Buffs;
+        public readonly Look Look;
+        public readonly Spells Spells;
+        public readonly Brain Brain;
+
         public CharacterPresenter Presenter;
-        public Brain Brain;

         private static int idCounter;
         private int id;


Fixed block selection!

Fixed block selection!

--- Assets/resources/Scripts/PlayerController.cs
+++ Assets/resources/Scripts/PlayerController.cs
@@ -158,12 +158,13 @@
 	/// <summary>
 	/// Gets the block from camera's look vector.
 	/// </summary>
-	/// <returns>The block from look vector. NOTE: This may return null</returns>
+	/// <returns>The block from look vector</returns>
 	Block GetBlockFromLookVector() // This needs some tuning
 	{
 		RaycastHit hit;
 		Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, RANGE);

+
 		if (hit.transform == null)
 		{
 			return null;
@@ -173,9 +174,31 @@
 		{
 			Chunk chunk = hit.transform.gameObject.GetComponent<Chunk>();

-
 			Vector3 newPoint = hit.point;
-			newPoint -= new Vector3(0, 0.1f, 0);
+			//newPoint -= new Vector3(0, 0.1f, 0);
+			//newPoint += cam.transform.forward;
+
+			switch (GetBlockSide(hit))
+			{
+				case BlockFace.Top:
+					newPoint -= new Vector3(0, 0.1f, 0);
+					break;
+				case BlockFace.Bottom:
+					newPoint += new Vector3(0, 0.1f, 0);
+					break;
+				case BlockFace.Right:
+					newPoint -= new Vector3(0.1f, 0, 0);
+					break;
+				case BlockFace.Left:
+					newPoint += new Vector3(0.1f, 0, 0);
+					break;
+				case BlockFace.Near:
+					newPoint += new Vector3(0, 0, 0.1f);
+					break;
+				case BlockFace.Far:
+					newPoint -= new Vector3(0, 0, 0.1f);
+					break;
+			}

 			GameObject collMark = GameObject.Find("CollMark");
 			if (collMark != null)
@@ -220,4 +243,39 @@

 		return null;
 	}
+
+	BlockFace GetBlockSide(RaycastHit hit) {
+		BlockFace face = BlockFace.All;
+
+		Vector3 normal = hit.normal;
+
+		normal = hit.transform.TransformDirection(normal);
+
+		if (normal == hit.transform.up)
+		{
+			face = BlockFace.Top;
+		}
+		else if (normal == -hit.transform.up)
+		{
+			face = BlockFace.Bottom;
+		}
+		else if (normal == hit.transform.right)
+		{
+			face = BlockFace.Right;
+		}
+		else if (normal == -hit.transform.right)
+		{
+			face = BlockFace.Left;
+		}
+		else if (normal == hit.transform.forward)
+		{
+			face = BlockFace.Far;
+		}
+		else if (normal == -hit.transform.forward)
+		{
+			face = BlockFace.Near;
+		}
+
+		return face;
+	}
 }


Using MvcAbsoluteUrlConverter in XmlResult

--- src/SimpleMvcSitemap/XmlResult.cs
+++ src/SimpleMvcSitemap/XmlResult.cs
@@ -49,6 +49,9 @@
 #if Mvc
         public override void ExecuteResult(ControllerContext context)
         {
+            IAbsoluteUrlConverter absoluteUrlConverter = new MvcAbsoluteUrlConverter(context.HttpContext);
+            _urlValidator.ValidateUrls(_data, absoluteUrlConverter);
+
             HttpResponseBase response = context.HttpContext.Response;
             response.ContentType = "text/xml";
             response.ContentEncoding = Encoding.UTF8;


Fixes compatibility with 5.6 and 2017.1

Fixes compatibility with 5.6 and 2017.1

--- Assets/HoloToolkit/Boundary/Scripts/SceneContentAdjuster.cs
+++ Assets/HoloToolkit/Boundary/Scripts/SceneContentAdjuster.cs
@@ -1,10 +1,10 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License. See LICENSE in the project root for license information.

-using System.Collections;
 using UnityEngine;

 #if UNITY_2017_2_OR_NEWER
+using System.Collections;
 using UnityEngine.XR;
 #else
 using UnityEngine.VR;
@@ -63,19 +63,16 @@
             // If no XR device is present, the editor will default to (0, 0, 0) and no adjustment is needed.
             // This script runs on both opaque and transparent display devices, since the floor offset is based on
             // TrackingSpaceType and not display type.
-            if (!XRDevice.isPresent)
-#else
-            if (true)
-#endif
-            {
-                Destroy(this);
-            }
-            else
+            if (XRDevice.isPresent)
             {
                 StartCoroutine(SetContentHeight());
+                return;
             }
+#endif
+            Destroy(this);
         }

+#if UNITY_2017_2_OR_NEWER
         private IEnumerator SetContentHeight()
         {
             if (frameWaitHack < 1)
@@ -106,5 +103,6 @@
                 containerObject.position = contentPosition;
             }
         }
+#endif
     }
 }


Optimize getCycleProgress()

Optimize getCycleProgress()

got the float getCycleProgress() down to one line.

--- Assets/Resources/Microgames/Wrench/Scripts/WrenchTighten.cs
+++ Assets/Resources/Microgames/Wrench/Scripts/WrenchTighten.cs
@@ -53,9 +53,7 @@

 	float getCycleProgress()
 	{
-		float progress = getRotation() - minRotation;
-		progress /= maxRotation - minRotation;
-		return progress;
+		return (getRotation() - minRotation)/(maxRotation - minRotation);
 	}

 	void finish()


replaced buffermanager with byte[]

replaced buffermanager with byte[]

--- BeardedManStudios/Source/Forge/Networking/ETCPClientBase.cs
+++ BeardedManStudios/Source/Forge/Networking/ETCPClientBase.cs
@@ -17,14 +17,11 @@
 #endif
         // save the hash for upgrade validation
         private string headerHash;
-        private BufferManager bufferManager;
         public event BaseNetworkEvent ConnectAttemptFailed;
+        byte[] buffer;
         public ETCPClientBase(int maxConnections) : base(maxConnections)
         {
-            if (maxConnections > 128)
-                bufferManager = new BufferManager(8192, 128, (maxConnections / 128) + 1);
-            else
-                bufferManager = new BufferManager(8192, maxConnections, 2);
+            buffer = new byte[1024];
         }

         /// <summary>
@@ -63,35 +60,17 @@
             // Send the upgrade request to the server
             RawWrite(connectionHeader);

-            ArraySegment<byte> segment;
-            if(!bufferManager.TryTakeBuffer(out segment))  {
-                // should probably do something more here //eriknielsen
-                throw new OutOfMemoryException("Buffer manager has run out of allocated memory (possible memory leak).");
-            }
-
-            ReceiveToken token = new ReceiveToken
-            {
-                internalBuffer = segment,
-                player = server,
-                bytesReceived = 0,
-                dataHolder = null,
-                maxAllowedBytes = 8192
-            };

             // Read from the server async
-
-
             SocketAsyncEventArgs e = new SocketAsyncEventArgs();
             e.Completed += new EventHandler<SocketAsyncEventArgs>(ReceiveAsync_Completed);
-            e.UserToken = token;
-            e.BufferList = new List<ArraySegment<byte>> { token.internalBuffer };

             client.Client.ReceiveAsync(e);
         }
         // Should validate the handshake response from the server
         private void ReceiveAsync_Completed(object sender, SocketAsyncEventArgs e)
         {
-
+            // use this.buffer here
         }
         private void RawWrite(byte[] data)
         {


Fix for account type dropdown in edit vs new mode.

--- BoozeHoundCloud/Areas/Core/Views/Account/AccountForm.cshtml
+++ BoozeHoundCloud/Areas/Core/Views/Account/AccountForm.cshtml
@@ -27,15 +27,25 @@
   </div>
   <div class="form-group">
     @Html.LabelFor(m => m.AccountTypeId)
-    @Html.DropDownListFor(
-      m => m.AccountTypeId,
-      new SelectList(
-        Model.AccountTypes,
-        "Id",
-        "Name"),
-      "Select one...",
-      new {@class = "form-control", @readonly = "true" })
-    @Html.ValidationMessageFor(m => m.AccountTypeId)
+
+    @if (isNewAccount)
+    {
+      @Html.DropDownListFor(
+        m => m.AccountTypeId,
+        new SelectList(
+          Model.AccountTypes,
+          "Id",
+          "Name"),
+        "Select one...",
+        new { @class = "form-control" })
+      @Html.ValidationMessageFor(m => m.AccountTypeId)
+    }
+    else
+    {
+      @Html.TextBoxFor(
+        m => m.AccountTypes.First(x => x.Id == Model.AccountTypeId).Name,
+        new { @class = "form-control", @readonly = "true" } )
+    }
   </div>

   @Html.HiddenFor(m => m.Id);


Update namespace for InputHints

Update namespace for InputHints

--- CSharp/Library/Microsoft.Bot.Connector.Shared/InputHints.cs
+++ CSharp/Library/Microsoft.Bot.Connector.Shared/InputHints.cs
@@ -1,7 +1,7 @@
 using System;
 using System.Linq;

-namespace Microsoft.Bot.Schema
+namespace Microsoft.Bot.Connector
 {
     /// <summary>
     /// Indicates whether the bot is accepting, expecting, or ignoring input


fix debug info

fix debug info

--- src/Sir.Store/VectorNodeWriter.cs
+++ src/Sir.Store/VectorNodeWriter.cs
@@ -15,8 +15,6 @@
             {
                 var angle = node.Vector.CosAngle(cursor.Vector);

-                cursor.AngleWhenAdded = angle;
-
                 if (angle >= similarity.identicalAngle)
                 {
                     lock (cursor.Sync)
@@ -34,6 +32,7 @@
                         {
                             if (cursor.Left == null)
                             {
+                                node.AngleWhenAdded = angle;
                                 cursor.Left = node;

                                 return true;
@@ -57,6 +56,7 @@
                         {
                             if (cursor.Right == null)
                             {
+                                node.AngleWhenAdded = angle;
                                 cursor.Right = node;

                                 return true;


mainline: changed back to use Socket.ConnectAsync to start a connect in ClientEngine

--- mainline/ClientEngine/TcpClientSession.cs
+++ mainline/ClientEngine/TcpClientSession.cs
@@ -46,19 +46,17 @@

         protected override void Connect()
         {
-            var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-
             m_SocketEventArgs.RemoteEndPoint = RemoteEndPoint;
-            m_SocketEventArgs.UserToken = client;
-
-            if(!client.ConnectAsync(m_SocketEventArgs))
+
+            Socket.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, m_SocketEventArgs);
+
+            if (!Socket.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, m_SocketEventArgs))
                 ProcessAccept(m_SocketEventArgs);
         }

         private void ProcessAccept(SocketAsyncEventArgs e)
         {
-            Client = e.UserToken as Socket;
-            e.UserToken = null;
+            Client = e.ConnectSocket;

             int receiveBufferSize = 1024;
             m_ReceiveBuffer = new byte[receiveBufferSize];


Add failing test coverage for tournament startup states

--- osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs
+++ osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs
@@ -4,8 +4,10 @@
 using System.Linq;
 using NUnit.Framework;
 using osu.Framework.Allocation;
+using osu.Framework.Graphics;
 using osu.Framework.Testing;
 using osu.Game.Tournament.Components;
+using osu.Game.Tournament.IPC;
 using osu.Game.Tournament.Screens.Gameplay;
 using osu.Game.Tournament.Screens.Gameplay.Components;

@@ -16,16 +18,18 @@
         [Cached]
         private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay { Width = 0.5f };

-        [BackgroundDependencyLoader]
-        private void load()
+        [Test]
+        public void TestStartupState([Values] TourneyState state)
         {
-            Add(new GameplayScreen());
-            Add(chat);
+            AddStep("set state", () => IPCInfo.State.Value = state);
+            createScreen();
         }

         [Test]
         public void TestWarmup()
         {
+            createScreen();
+
             checkScoreVisibility(false);

             toggleWarmup();
@@ -33,6 +37,20 @@

             toggleWarmup();
             checkScoreVisibility(false);
+        }
+
+        private void createScreen()
+        {
+            AddStep("setup screen", () =>
+            {
+                Remove(chat);
+
+                Children = new Drawable[]
+                {
+                    new GameplayScreen(),
+                    chat,
+                };
+            });
         }

         private void checkScoreVisibility(bool visible)


Clamp relative position of judgement ticks in range [0;1]

--- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
+++ osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
 using System.Linq;
 using osu.Framework.Allocation;
 using osu.Framework.Extensions.Color4Extensions;
@@ -224,7 +225,7 @@
                 , arrow_move_duration, Easing.Out);
         }

-        private float getRelativeJudgementPosition(double value) => (float)((value / maxHitWindow) + 1) / 2;
+        private float getRelativeJudgementPosition(double value) => Math.Clamp((float)((value / maxHitWindow) + 1) / 2, 0, 1);

         private class JudgementLine : CompositeDrawable
         {


Further metrics tweaking

Further metrics tweaking

--- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
+++ osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
@@ -18,8 +18,8 @@
 {
     public class BarHitErrorMeter : HitErrorMeter
     {
-        private const int judgement_line_width = 10;
-        private const int judgement_line_height = 3;
+        private const int judgement_line_width = 14;
+        private const int judgement_line_height = 4;

         private SpriteIcon arrow;
         private SpriteIcon iconEarly;
@@ -40,7 +40,7 @@
         [BackgroundDependencyLoader]
         private void load()
         {
-            const int centre_marker_size = 6;
+            const int centre_marker_size = 8;
             const int bar_height = 200;
             const int bar_width = 2;
             const float chevron_size = 8;
@@ -98,6 +98,14 @@
                                 RelativeSizeAxes = Axes.Y,
                                 Height = 0.5f,
                             },
+                            new Circle
+                            {
+                                Name = "middle marker behind",
+                                Colour = GetColourForHitResult(hitWindows.Last().result),
+                                Anchor = Anchor.Centre,
+                                Origin = Anchor.Centre,
+                                Size = new Vector2(centre_marker_size),
+                            },
                             judgementsContainer = new Container
                             {
                                 Name = "judgements",
@@ -108,16 +116,8 @@
                             },
                             new Circle
                             {
-                                Name = "middle marker behind",
-                                Colour = GetColourForHitResult(hitWindows.Last().result),
-                                Anchor = Anchor.Centre,
-                                Origin = Anchor.Centre,
-                                Size = new Vector2(centre_marker_size),
-                            },
-                            new Circle
-                            {
                                 Name = "middle marker in front",
-                                Colour = GetColourForHitResult(hitWindows.Last().result).Darken(0.5f),
+                                Colour = GetColourForHitResult(hitWindows.Last().result).Darken(0.3f),
                                 Anchor = Anchor.Centre,
                                 Origin = Anchor.Centre,
                                 Size = new Vector2(centre_marker_size),
@@ -231,7 +231,7 @@

         protected override void OnNewJudgement(JudgementResult judgement)
         {
-            const int arrow_move_duration = 400;
+            const int arrow_move_duration = 800;

             if (!judgement.IsHit || judgement.HitObject.HitWindows?.WindowFor(HitResult.Miss) == 0)
                 return;
@@ -261,7 +261,7 @@

             arrow.MoveToY(
                 getRelativeJudgementPosition(floatingAverage = floatingAverage * 0.9 + judgement.TimeOffset * 0.1)
-                , arrow_move_duration, Easing.Out);
+                , arrow_move_duration, Easing.OutQuint);
         }

         private float getRelativeJudgementPosition(double value) => Math.Clamp((float)((value / maxHitWindow) + 1) / 2, 0, 1);
@@ -296,11 +296,11 @@
                 Width = 0;

                 this
-                    .FadeTo(0.8f, judgement_fade_in_duration, Easing.OutQuint)
+                    .FadeTo(0.6f, judgement_fade_in_duration, Easing.OutQuint)
                     .ResizeWidthTo(1, judgement_fade_in_duration, Easing.OutQuint)
                     .Then()
-                    .FadeOut(judgement_fade_out_duration, Easing.In)
-                    .ResizeWidthTo(0, judgement_fade_out_duration, Easing.In)
+                    .FadeOut(judgement_fade_out_duration)
+                    .ResizeWidthTo(0, judgement_fade_out_duration, Easing.InQuint)
                     .Expire();
             }
         }


Fix score panel not showing silver s/ss badges on hd/fl plays

--- osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs
+++ osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs
@@ -2,6 +2,7 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
+using System.Linq;
 using osu.Framework.Allocation;
 using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Graphics;
@@ -9,6 +10,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Utils;
 using osu.Game.Graphics;
+using osu.Game.Rulesets.Mods;
 using osu.Game.Scoring;
 using osuTK;

@@ -191,8 +193,8 @@
                     Padding = new MarginPadding { Vertical = -15, Horizontal = -20 },
                     Children = new[]
                     {
-                        new RankBadge(1f, ScoreRank.X),
-                        new RankBadge(0.95f, ScoreRank.S),
+                        new RankBadge(1f, score.Mods.Any(m => m is ModHidden || m is ModFlashlight) ? ScoreRank.XH : ScoreRank.X),
+                        new RankBadge(0.95f, score.Mods.Any(m => m is ModHidden || m is ModFlashlight) ? ScoreRank.SH : ScoreRank.S),
                         new RankBadge(0.9f, ScoreRank.A),
                         new RankBadge(0.8f, ScoreRank.B),
                         new RankBadge(0.7f, ScoreRank.C),


Fix for U4-3908 YSOD on frontend after being logged out

--- src/Umbraco.Web/UmbracoContext.cs
+++ src/Umbraco.Web/UmbracoContext.cs
@@ -425,7 +425,8 @@
         {
             get
             {
-                return new User(Security.CurrentUser);
+                var user = Security.CurrentUser;
+                return user == null ? null : new User(user);
             }

         }


Fixed stripping of generic second generation.

--- Compiler/Analyzers/DeadCodeAnalyzer/DeadCodeInfoProvider.cs
+++ Compiler/Analyzers/DeadCodeAnalyzer/DeadCodeInfoProvider.cs
@@ -221,24 +221,15 @@
                 return;
             }

-            TypeDefinition resolvedType;
-
             if (type.IsGenericInstance)
             {
                 var genericType = (GenericInstanceType)type;
-                foreach (var genericArgument in genericType.GenericArguments)
-                {
-                    resolvedType = genericArgument.Resolve();
-
-                    if (resolvedType != null)
-                    {
-                        AddType(resolvedType);
-                    }
-                }
-            }
-
-            resolvedType = type.Resolve();
-
+                foreach (var genericArgument in genericType.GenericArguments) {
+                    AddType(genericArgument);
+                }
+            }
+
+            TypeDefinition resolvedType = type.Resolve();
             if (resolvedType != null)
             {
                 AddType(resolvedType);
@@ -393,18 +384,18 @@
                 }
             }

+            AddType(method.DeclaringType);
+            AddType(method.ReturnType);
+            foreach (var parameterDefinition in method.Parameters)
+            {
+                AddType(parameterDefinition.ParameterType);
+            }
+
             MethodDefinition resolvedMethod = method.Resolve();

             if (resolvedMethod == null)
             {
                 return false;
-            }
-
-            AddType(resolvedMethod.DeclaringType);
-            AddType(resolvedMethod.ReturnType);
-            foreach (var parameterDefinition in resolvedMethod.Parameters)
-            {
-                AddType(parameterDefinition.ParameterType);
             }

             if (Methods.Add(resolvedMethod) && resolvedMethod.HasBody) {
@@ -434,7 +425,9 @@
             AddType(field.DeclaringType);
             FieldDefinition resolvedField = field.Resolve();

-            Fields.Add(resolvedField);
+            if (resolvedField != null) {
+                Fields.Add(resolvedField);
+            }
         }

         private bool IsMemberWhiteListed(MemberReference member) {


Fixbug user prediction point

Fixbug user prediction point

Signed-off-by: Kritsada Dechawantana <ed42de6e2c19798b4aaa2418300d1952b8acfbeb@perfenterprise.com>

--- DailySoccer2015/ApiApp/Controllers/PredictionsController.cs
+++ DailySoccer2015/ApiApp/Controllers/PredictionsController.cs
@@ -110,14 +110,13 @@
                       let isPredictTeamHome = selectedMatch.TeamHomeId == predict.PredictionTeamId
                       let isPredictTeamAway = selectedMatch.TeamAwayId == predict.PredictionTeamId
                       let isPredictDraw = string.IsNullOrEmpty(predict.PredictionTeamId)
-                      let isDisplayActualPoints = selectedMatch.CompletedDate.HasValue && predict.CompletedDate.HasValue
                       select new PredictionInformation
                       {
                           MatchId = matchId,
                           IsPredictionTeamHome = isPredictTeamHome,
                           IsPredictionTeamAway = isPredictTeamAway,
                           IsPredictionDraw = isPredictDraw,
-                          PredictionPoints = isDisplayActualPoints ? predict.ActualPoints : predict.PredictionPoints
+                          PredictionPoints = predict.PredictionPoints
                       };
             var result = qry.ToList();
             return result;


Move on. Nothing interesting here. Ignore my stupidity

svn path=/trunk/heap-prof/; revision=42477


Able to convert Nullable<> types

Able to convert Nullable<> types


feat(models)

feat(models)

change property type of success

--- src/skadisteam.inventory/Models/Json/RootInventory.cs
+++ src/skadisteam.inventory/Models/Json/RootInventory.cs
@@ -21,6 +21,6 @@
         internal Dictionary<string, object> Inventory { get; set; }

         [JsonProperty(PropertyName = "success")]
-        internal List<object> Success { get; set; }
+        internal bool Success { get; set; }
     }
 }


Fix for U4-650 was incorrect, removing ASCII filters out øåæ and probably other letters as well. It's now very exact, just look if the first letter is not in a list of 26 letters.

--- src/umbraco.cms/businesslogic/member/Member.cs
+++ src/umbraco.cms/businesslogic/member/Member.cs
@@ -125,7 +125,7 @@

             var tmp = new List<Member>();
             using (IRecordsReader dr = SqlHelper.ExecuteReader(
-                                        string.Format(m_SQLOptimizedMany.Trim(), "(SUBSTRING(text, 1, 1) NOT BETWEEN 'a' AND 'z') AND (SUBSTRING(text, 1, 1) NOT BETWEEN 'A' AND 'Z')", "umbracoNode.text"),
+                                        string.Format(m_SQLOptimizedMany.Trim(), "AND LOWER(SUBSTRING(text, 1, 1)) not in ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')", "umbracoNode.text"),
                                             SqlHelper.CreateParameter("@nodeObjectType", Member._objectType)))
             {
                 while (dr.Read())


Fixes U4-1092 - TinyMce breaks script tags by double wrapping in CDATA on save

--- src/umbraco.editorControls/tinyMCE3/TinyMCE.cs
+++ src/umbraco.editorControls/tinyMCE3/TinyMCE.cs
@@ -324,6 +324,7 @@
         public virtual void Save()
         {
             string parsedString = base.Text.Trim();
+            string parsedStringForTinyMce = parsedString;
             if (parsedString != string.Empty)
             {
                 parsedString = replaceMacroTags(parsedString).Trim();
@@ -370,19 +371,22 @@
                     parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current) + "/#", "#");
                     parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current), "");
                 }
+	            // if a paragraph is empty, remove it
+	            if (parsedString.ToLower() == "

")
+                parsedString = "";
+
+	            // save string after all parsing is done, but before CDATA replacement - to put back into TinyMCE
+	            parsedStringForTinyMce = parsedString;

                 //Allow CDATA nested into RTE without exceptions
                 // GE 2012-01-18
                 parsedString = parsedString.Replace("<![CDATA[", "").Replace("]]>", "");
-
-                // if text is an empty parargraph, make it all empty
-                if (parsedString.ToLower() == "

")
-                    parsedString = "";
-            }
+            }
+
             _data.Value = parsedString;

             // update internal webcontrol value with parsed result
-            base.Text = parsedString;
+            base.Text = parsedStringForTinyMce;
         }

         #endregion


Removed warning causes by unused variable.

--- sgmlreaderdll/SgmlParser.cs
+++ sgmlreaderdll/SgmlParser.cs
@@ -756,7 +756,6 @@
             if (this.m_isHtml && v >= 0x80 & v <= 0x9F)
             {
                 // This range of control characters is mapped to Windows-1252!
-                int size = CtrlMap.Length;
                 int i = v - 0x80;
                 int unicode = CtrlMap[i];
                 return Convert.ToChar(unicode).ToString();


make GetCTP public

make GetCTP public

fix issue #259

--- ooxml/XWPF/Usermodel/XWPFParagraph.cs
+++ ooxml/XWPF/Usermodel/XWPFParagraph.cs
@@ -189,7 +189,7 @@
         }

-        internal CT_P GetCTP()
+        public CT_P GetCTP()
         {
             return paragraph;
         }


HttpHeaderInfo

HttpHeaderInfo

--- websocket-sharp.clone/Net/HttpHeaderInfo.cs
+++ websocket-sharp.clone/Net/HttpHeaderInfo.cs
@@ -30,59 +30,21 @@
 {
 	internal class HttpHeaderInfo
 	{
-		#region Private Fields
+	    private HttpHeaderType _type;

-		private HttpHeaderType _type;
-
-		#endregion
-
-		#region Public Constructors
-
-		public HttpHeaderInfo()
+	    public HttpHeaderInfo()
 		{
 		}

-		#endregion
+	    internal bool IsMultiValueInRequest => (_type & HttpHeaderType.MultiValueInRequest) == HttpHeaderType.MultiValueInRequest;

-		#region Internal Properties
+	    internal bool IsMultiValueInResponse => (_type & HttpHeaderType.MultiValueInResponse) == HttpHeaderType.MultiValueInResponse;

-		internal bool IsMultiValueInRequest
-		{
-			get
-			{
-				return (_type & HttpHeaderType.MultiValueInRequest) == HttpHeaderType.MultiValueInRequest;
-			}
-		}
+	    public bool IsRequest => (_type & HttpHeaderType.Request) == HttpHeaderType.Request;

-		internal bool IsMultiValueInResponse
-		{
-			get
-			{
-				return (_type & HttpHeaderType.MultiValueInResponse) == HttpHeaderType.MultiValueInResponse;
-			}
-		}
+	    public bool IsResponse => (_type & HttpHeaderType.Response) == HttpHeaderType.Response;

-		#endregion
-
-		#region Public Properties
-
-		public bool IsRequest
-		{
-			get
-			{
-				return (_type & HttpHeaderType.Request) == HttpHeaderType.Request;
-			}
-		}
-
-		public bool IsResponse
-		{
-			get
-			{
-				return (_type & HttpHeaderType.Response) == HttpHeaderType.Response;
-			}
-		}
-
-		public string Name
+	    public string Name
 		{
 			get;
 			set;
@@ -101,11 +63,7 @@
 			}
 		}

-		#endregion
-
-		#region Public Methods
-
-		public bool IsMultiValue(bool response)
+	    public bool IsMultiValue(bool response)
 		{
 			return (_type & HttpHeaderType.MultiValue) != HttpHeaderType.MultiValue
 				   ? response
@@ -118,13 +76,9 @@

 		public bool IsRestricted(bool response)
 		{
-			return (_type & HttpHeaderType.Restricted) != HttpHeaderType.Restricted
-				   ? false
-				   : response
-					 ? IsResponse
-					 : IsRequest;
+			return (_type & HttpHeaderType.Restricted) == HttpHeaderType.Restricted && (response
+			                                                                             ? IsResponse
+			                                                                             : IsRequest);
 		}
-
-		#endregion
 	}
 }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpListenerResponse.cs
+++ websocket-sharp/Net/HttpListenerResponse.cs
@@ -960,8 +960,10 @@
       if (cookie == null)
         throw new ArgumentNullException ("cookie");

-      if (!canAddOrUpdate (cookie))
-        throw new ArgumentException ("Cannot be replaced.", "cookie");
+      if (!canAddOrUpdate (cookie)) {
+        var msg = "It cannot be replaced.";
+        throw new ArgumentException (msg, "cookie");
+      }

       Cookies.Add (cookie);
     }


Appease codefactor

Appease codefactor

--- osu.Framework/Graphics/Video/Video.cs
+++ osu.Framework/Graphics/Video/Video.cs
@@ -121,8 +121,8 @@
             {
                 bool tooFarBehind = Math.Abs(PlaybackPosition - nextFrame.Time) > lenience_before_seek &&
                                     (!Loop ||
-                                     Math.Abs(PlaybackPosition - decoder.Duration - nextFrame.Time) > lenience_before_seek &&
-                                     Math.Abs(PlaybackPosition + decoder.Duration - nextFrame.Time) > lenience_before_seek
+                                     (Math.Abs(PlaybackPosition - decoder.Duration - nextFrame.Time) > lenience_before_seek &&
+                                      Math.Abs(PlaybackPosition + decoder.Duration - nextFrame.Time) > lenience_before_seek)
                                     );

                 // we are too far ahead or too far behind


Fix line making its way from benchmarks

Fix line making its way from benchmarks

--- osu.Framework/IO/Stores/GlyphStore.cs
+++ osu.Framework/IO/Stores/GlyphStore.cs
@@ -171,7 +171,7 @@

             var image = new Image<Rgba32>(SixLabors.ImageSharp.Configuration.Default, charWidth, charHeight, new Rgba32(255, 255, 255, 0));

-            using (var stream = System.IO.File.OpenRead(pageInfo.Filename))
+            using (var stream = CacheStorage.GetStream(pageInfo.Filename))
             {
                 var pixels = image.GetPixelSpan();
                 stream.Seek(pageWidth * c.Y, SeekOrigin.Current);


Fix mismapped guide button

Fix mismapped guide button

--- osu.Framework/Input/JoystickButton.cs
+++ osu.Framework/Input/JoystickButton.cs
@@ -296,7 +296,7 @@
         GamePadStart = Button10,
         GamePadLeftStick = Button11,
         GamePadRightStick = Button12,
-        GamePadGuide = Button6,
+        GamePadGuide = Button13,
         GamePadDPadUp = Hat1Up,
         GamePadDPadDown = Hat1Down,
         GamePadDPadLeft = Hat1Left,


add basic content wiki sidebar

add basic content wiki sidebar

--- osu.Game/Overlays/Wiki/WikiSidebar.cs
+++ osu.Game/Overlays/Wiki/WikiSidebar.cs
@@ -1,9 +1,36 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Game.Graphics;
+using osu.Game.Graphics.Sprites;

 namespace osu.Game.Overlays.Wiki
 {
     public class WikiSidebar : OverlaySidebar
     {
+        private FillFlowContainer tableOfContents;
+
+        protected override Drawable CreateContent() => new FillFlowContainer
+        {
+            Direction = FillDirection.Vertical,
+            RelativeSizeAxes = Axes.X,
+            AutoSizeAxes = Axes.Y,
+            Children = new Drawable[]
+            {
+                new OsuSpriteText
+                {
+                    Text = "CONTENTS",
+                    Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
+                },
+                tableOfContents = new FillFlowContainer
+                {
+                    Direction = FillDirection.Vertical,
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
+                }
+            },
+        };
     }
 }


Fix SongSelect binding to ruleset too early

Causes music to stop playing while at main menu.

--- osu.Game/Screens/Select/SongSelect.cs
+++ osu.Game/Screens/Select/SongSelect.cs
@@ -193,8 +193,6 @@
             dependencies.CacheAs(Ruleset);
             dependencies.CacheAs<IBindable<RulesetInfo>>(Ruleset);

-            base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce);
-
             if (Footer != null)
             {
                 Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2);
@@ -220,6 +218,12 @@

             Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true);
             Beatmap.BindValueChanged(workingBeatmapChanged);
+        }
+
+        protected override void LoadComplete()
+        {
+            base.LoadComplete();
+            base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce);
         }

         public void Edit(BeatmapInfo beatmap)


Fix null condition inhibiting deselection events

--- osu.Game/Screens/Select/SongSelect.cs
+++ osu.Game/Screens/Select/SongSelect.cs
@@ -428,7 +428,10 @@

         private void updateSelectedBeatmap(BeatmapInfo beatmap)
         {
-            if (beatmap == null || beatmap.Equals(beatmapNoDebounce))
+            if (beatmap == null && beatmapNoDebounce == null)
+                return;
+
+            if (beatmap?.Equals(beatmapNoDebounce) == true)
                 return;

             beatmapNoDebounce = beatmap;


[V2] Some toolchains (linkers) assume a specific order is required for libraries, i.e. to satisfy all dependencies, those dependencies must be listed last. Don't just blindly add forwarded modules, check first, and move them if necessary

--- packages/C/dev/Scripts/Application.cs
+++ packages/C/dev/Scripts/Application.cs
@@ -403,7 +403,13 @@
             foreach (var forwarded in withForwarded.ForwardedLibraries)
             {
                 this.DependsOn(forwarded);
-                this.linkedModules.AddUnique(forwarded);
+                // some linkers require a specific order of libraries in order to resolve symbols
+                // so that if an existing library is later referenced, it needs to be moved later
+                if (this.linkedModules.Contains(forwarded))
+                {
+                    this.linkedModules.Remove(forwarded);
+                }
+                this.linkedModules.Add(forwarded);
                 this.LinkAllForwardedDependenciesFromLibraries(forwarded);
             }
         }


Fix test.

Fix test.

--- test/Microsoft.AspNet.PipelineCore.Tests/HeaderDictionaryTests.cs
+++ test/Microsoft.AspNet.PipelineCore.Tests/HeaderDictionaryTests.cs
@@ -20,9 +20,9 @@
                 });

             Assert.Equal(1, headers.Count);
-            Assert.Equal(new[] { "Headers1" }, headers.Keys);
-            Assert.True(headers.ContainsKey("headers1"));
-            Assert.False(headers.ContainsKey("headers2"));
+            Assert.Equal(new[] { "Header1" }, headers.Keys);
+            Assert.True(headers.ContainsKey("header1"));
+            Assert.False(headers.ContainsKey("header2"));
             Assert.Equal("Value1", headers["header1"]);
             Assert.Equal("Value1", headers.Get("header1"));
             Assert.Equal(new[] { "Value1" }, headers.GetValues("header1"));


*** empty log message ***

*** empty log message ***

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@518 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom/Engine/Serialization/OgreMeshReader.cs
+++ Axiom/Engine/Serialization/OgreMeshReader.cs
@@ -241,7 +241,7 @@

         public void ReadSubMeshOperation(SubMesh subMesh) {
             short op = ReadInt16();
-            subMesh.operationType = (RenderMode)op;
+            subMesh.operationType = (OperationType)op;
         }

         public void ReadSubMesh() {
@@ -683,29 +683,4 @@
         #endregion
     }

-    /// <summary>
-    ///		Values that mark data chunks in the .mesh file.
-    /// </summary>
-    public enum MeshChunkID : ushort {
-        Header						= 0x1000,
-        Mesh						= 0x3000,
-        SubMesh                     = 0x4000,
-        SubMeshOperation            = 0x4010,
-        SubMeshBoneAssignment		= 0x4100,
-        Geometry                    = 0x5000,
-        GeometryNormals             = 0x5100,    //(Optional)
-        GeometryColors              = 0x5200,    //(Optional)
-        GeometryTexCoords           = 0x5300,    //(Optional, REPEATABLE, each one adds an extra set)
-        MeshSkeletonLink            = 0x6000,
-        MeshBoneAssignment          = 0x7000,
-        MeshLOD                     = 0x8000,
-        MeshLODUsage                = 0x8100,
-        MeshLODManual               = 0x8110,
-        MeshLODGenerated            = 0x8120,
-        MeshBounds                  = 0x9000,
-        Material                    = 0x2000,
-        TextureLayer                = 0x2200 // optional, repeat per layer
-        // TODO - scale, offset, effects
-
-    };
 }


Work in progress commit of ATIFS conversion, not yet complete.

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@252 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom/RenderSystem_OpenGL/ATI/PixelShader.cs
+++ Axiom/RenderSystem_OpenGL/ATI/PixelShader.cs
@@ -774,8 +774,8 @@
             new RegModOffset(33, Symbol.C_BASE, 2)
         };

-        static MacroRegModify texm3x3tex_MacroMods =
-            new MacroRegModify(texm3x3tex, texm3xxtex_RegMods);
+        static MacroRegModify texm3x3spec_MacroMods =
+            new MacroRegModify(texm3x3spec, texm3x3spec_RegMods);

         #endregion Static Fields


The PayButton should select the default currency of the store as default

--- BTCPayServer/Controllers/StoresController.cs
+++ BTCPayServer/Controllers/StoresController.cs
@@ -973,15 +973,10 @@
             return _UserManager.GetUserId(User);
         }

-        // TODO: Need to have talk about how architect default currency implementation
-        // For now we have also hardcoded USD for Store creation and then Invoice creation
-        const string DEFAULT_CURRENCY = "USD";
-
         [Route("{storeId}/paybutton")]
         public async Task<IActionResult> PayButton()
         {
             var store = CurrentStore;
-
             var storeBlob = store.GetStoreBlob();
             if (!storeBlob.AnyoneCanInvoice)
             {
@@ -993,7 +988,7 @@
             var model = new PayButtonViewModel
             {
                 Price = null,
-                Currency = DEFAULT_CURRENCY,
+                Currency = storeBlob.DefaultCurrency,
                 ButtonSize = 2,
                 UrlRoot = appUrl,
                 PayButtonImageUrl = appUrl + "img/paybutton/pay.svg",


Fix: Impossible to send to two more than two destination (Fix #2825)

--- BTCPayServer/Views/Wallets/WalletSend.cshtml
+++ BTCPayServer/Views/Wallets/WalletSend.cshtml
@@ -66,7 +66,7 @@

-                        <button type="submit" name="command" value="add-output" class="d-inline-block ms-2 btn text-secondary btn-link p-0 mb-2">Add another destination</button>
+                        <button type="submit" name="command" value="add-output" class="d-inline-block ms-2 btn text-primary btn-link p-0 mb-2"> Add another destination</button>

                     <input asp-for="Outputs[0].DestinationAddress" class="form-control font-monospace" autofocus autocomplete="off" />

@@ -101,7 +101,17 @@

-
+                                        @if (index == Model.Outputs.Count - 1)
+                                        {
+

+
+                                                <button type="submit" name="command" value="add-output" class="d-inline-block ms-2 btn text-primary btn-link p-0 mb-2"> Add another destination</button>
+

+                                        }
+                                        else
+                                        {
+
+                                        }
                                         <input asp-for="Outputs[index].DestinationAddress" class="form-control" autocomplete="off" />


Prevent Context from being collected at start.

--- Bindings/Portable/Runtime/RefCountedCache.cs
+++ Bindings/Portable/Runtime/RefCountedCache.cs
@@ -38,7 +38,7 @@
 				if (knownObjects.TryGetValue(refCounted.Handle, out knownObject))
 				{
 					var existingObj = knownObject?.Reference;
-					if (existingObj != null && !TypesInRelations(existingObj.GetType(), refCounted.GetType()))
+					if (existingObj != null && !IsInHeirarchy(existingObj.GetType(), refCounted.GetType()))
 						throw new InvalidOperationException($"Handle '{refCounted.Handle}' is in use by '{existingObj.GetType().Name}' (IsDeleted={existingObj.IsDeleted}). {refCounted.GetType()}");
 				}

@@ -97,12 +97,12 @@

 		bool StrongRefByDefault(RefCounted refCounted)
 		{
-			if (refCounted is Scene)
-				return true;
+			if (refCounted is Scene) return true;
+			if (refCounted is Context) return true;
 			return false;
 		}

-		bool TypesInRelations(Type t1, Type t2)
+		bool IsInHeirarchy(Type t1, Type t2)
 		{
 			if (t1 == t2) return true;
 			if (t1.GetTypeInfo().IsSubclassOf(t2)) return true;


remove unecessary code

remove unecessary code

--- Blueprint41.Modeller/Controls/GraphEditor.cs
+++ Blueprint41.Modeller/Controls/GraphEditor.cs
@@ -80,7 +80,7 @@
         readonly Dictionary<object, DrawingColor> draggedObjectOriginalColors = new Dictionary<object, DrawingColor>();

         void GraphEditor_Load(object sender, EventArgs e)
-        {
+        {
             (gViewer as IViewer).MouseDown += GraphEditor_MouseDown;
             (gViewer as IViewer).MouseMove += GraphEditor_MouseMove;

@@ -216,7 +216,7 @@
         {
             EdgeRemoved?.Invoke(this, new EdgeEventArgs(sender as Edge));
         }
-
+
         private ContextMenuStrip contextMenuStrip;
         void GraphEditor_MouseDown(object sender, MsaglMouseEventArgs e)
         {
@@ -235,27 +235,10 @@
         }

         void AnaylyzeLeftButtonClick(IViewerObject obj)
-        {
-            DrawingNode node = null;
-            Edge edge = null;
-            var dnode = obj as DNode;
-            var dedge = obj as DEdge;
-            var dl = obj as DLabel;
-            if (dnode != null)
-                node = dnode.DrawingNode;
-            else if (dedge != null)
-                edge = dedge.DrawingEdge;
-            else if (dl != null)
-            {
-                if (dl.Parent is DNode)
-                    node = (dl.Parent as DNode).DrawingNode;
-                else if (dl.Parent is DEdge)
-                    edge = (dl.Parent as DEdge).DrawingEdge;
-            }
-
-            if (node != null)
-            {
-                NodeSelected?.Invoke(this, new NodeEventArgs(node, new GeometryPoint(0, 0)));
+        {
+            if (obj is DNode dNode)
+            {
+                NodeSelected?.Invoke(this, new NodeEventArgs(dNode.DrawingNode, new GeometryPoint(0, 0)));
             }
         }


Fix double implementation of ErrorResilientDialogContextStore after the merge from develop

--- CSharp/Library/Dialogs/DialogContextStore.cs
+++ CSharp/Library/Dialogs/DialogContextStore.cs
@@ -150,33 +150,4 @@
             this.store.Save(context);
         }
     }
-
-    public sealed class ErrorResilientDialogContextStore : IDialogContextStore
-    {
-        private readonly IDialogContextStore store;
-
-        public ErrorResilientDialogContextStore(IDialogContextStore store)
-        {
-            SetField.NotNull(out this.store, nameof(store), store);
-        }
-
-        public void Save(IDialogContext context, IBotDataBag bag, string key)
-        {
-            this.store.Save(context, bag, key);
-        }
-
-        public bool TryLoad(IBotDataBag bag, string key, out IDialogContext context)
-        {
-            try
-            {
-                return this.store.TryLoad(bag, key, out context);
-            }
-            catch (Exception)
-            {
-                // exception in loading the serialized context data
-                context = null;
-                return false;
-            }
-        }
-    }
 }


Outputting info about the package

Outputting info about the package

--- Chauffeur/Deliverables/PackageDeliverable.cs
+++ Chauffeur/Deliverables/PackageDeliverable.cs
@@ -61,13 +61,29 @@
             {
                 var xml = XDocument.Load(stream);

-                var info = xml.Root.Element("Info");
+                var info = xml.Root.Element("info");
+
+                if (info != null)
+                    await PrintInfo(info);

                 var documentTypesElement = xml.Root.Element("DocumentTypes");

                 if (documentTypesElement != null)
                     await UnpackDocumentTypes(documentTypesElement.Elements("DocumentType"));
             }
+        }
+
+        private async Task PrintInfo(XElement info)
+        {
+            var pkg = info.Element("package");
+
+            if (pkg != null)
+                return;
+
+            var name = (string)pkg.Element("name");
+            var version = (string)pkg.Element("version");
+
+            await Out.WriteLineFormattedAsync("Installing package {0} v{1}", name, version);
         }

         private async Task UnpackDocumentTypes(IEnumerable<XElement> elements)


Unit tests.

Unit tests.

--- test/Core.UnitTests/UniformResourceIdentifierTests.cs
+++ test/Core.UnitTests/UniformResourceIdentifierTests.cs
@@ -27,6 +27,9 @@

         [Fact]
         public void Construct_NullPathSegments_Throws() => Assert.Throws<ArgumentNullException>(() => CreateUri(null));
+
+        [Fact]
+        public void Construct_PathWithNullSegments_Throws() => Assert.Throws<ArgumentException>(() => CreateUri(new string[] { null }));

         [Fact]
         public void Construct_HostAndPathWithoutLeadingSlash_Throws() => Assert.Throws<ArgumentException>(() => CreateUri(new[] { "x" }));


Implemented the well-known change password URL redirection.

--- Chavah.NetCore/Controllers/HomeController.cs
+++ Chavah.NetCore/Controllers/HomeController.cs
@@ -100,5 +100,19 @@
         {
             return RedirectToActionPermanent("ActivityFeed", "Activities");
         }
+
+        /// <summary>
+        /// Implements the upcoming web standard that helps password managers change a user's password.
+        /// </summary>
+        /// <remarks>
+        /// https://github.com/WICG/change-password-url/blob/gh-pages/explainer.md
+        /// </remarks>
+        /// <returns></returns>
+        [HttpGet]
+        [Route(".well-known/change-password")]
+        public IActionResult ChangePassword()
+        {
+            return RedirectPermanent("/#/forgotpassword");
+        }
     }
 }


Fixed crash when there are no outputs

Fixed crash when there are no outputs

--- Circuit/Simulation/LinqCompiledSimulation.cs
+++ Circuit/Simulation/LinqCompiledSimulation.cs
@@ -381,10 +381,11 @@
                     body.Add(LinqExpr.Assign(LinqExpr.ArrayAccess(i.Value, n), LinqExpr.Multiply(Vo[i.Key], LinqExpr.Constant(1.0 / (double)Oversample))));

                 // Every 256 samples, check for divergence.
-                body.Add(LinqExpr.IfThen(LinqExpr.Equal(LinqExpr.And(n, LinqExpr.Constant(0xFF)), Zero),
-                    LinqExpr.Block(Vo.Select(i => LinqExpr.IfThenElse(IsNotReal(i.Value),
-                        ThrowSimulationDiverged(n),
-                        LinqExpr.Assign(i.Value, RoundDenormToZero(i.Value)))))));
+                if (Vo.Any())
+                    body.Add(LinqExpr.IfThen(LinqExpr.Equal(LinqExpr.And(n, LinqExpr.Constant(0xFF)), Zero),
+                        LinqExpr.Block(Vo.Select(i => LinqExpr.IfThenElse(IsNotReal(i.Value),
+                            ThrowSimulationDiverged(n),
+                            LinqExpr.Assign(i.Value, RoundDenormToZero(i.Value)))))));
             });

             // Copy the global state variables back to the globals.


Corrected failed release test

Corrected failed release test

--- test/Bugsnag.Core.Test/ExceptionParserTests.cs
+++ test/Bugsnag.Core.Test/ExceptionParserTests.cs
@@ -144,9 +144,12 @@
             Assert.NotNull(actInfo);
             Assert.Equal("RankException", actInfo.ExceptionClass);
             Assert.True(actInfo.Description.Contains(testExp.Message));
+#if DEBUG
+            // We can only be certain of this frame when in Debug mode. Optimisers are enabled in Release mode
             Assert.True(actInfo.StackTrace[0].File.EndsWith("ExceptionParserTests.cs"));
             Assert.Equal("TestNamespace.TestClass.ThrowException()", actInfo.StackTrace[0].Method);
             Assert.Equal(expInProject, actInfo.StackTrace[0].InProject);
+#endif
         }

         [Theory]


increase test code coverage

increase test code coverage

License: MIT
Signed-off-by: Trond Bråthen <24909d0abdb726efcd9db31fa5847f85688f140f@gmail.com>

--- test/Multiformats.Hash.Tests/MultihashTests.cs
+++ test/Multiformats.Hash.Tests/MultihashTests.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -67,28 +68,10 @@
             Assert.Equal(dec.Digest, ob);
         }

+        public static IEnumerable<object[]> GetSupportedHashTable() => Multihash.SupportedHashCodes.Select(h => new object[] { (int)h, Multihash.GetName(h) });
+
         [Theory]
-        [InlineData(0x00, "id")]
-        [InlineData(0xd4, "md4")]
-        [InlineData(0xd5, "md5")]
-        [InlineData(0x11, "sha1")]
-        [InlineData(0x12, "sha2-256")]
-        [InlineData(0x13, "sha2-512")]
-        [InlineData(0x14, "sha3-512")]
-        [InlineData(0x15, "sha3-384")]
-        [InlineData(0x16, "sha3-256")]
-        [InlineData(0x17, "sha3-224")]
-        [InlineData(0x18, "shake-128")]
-        [InlineData(0x19, "shake-256")]
-        [InlineData(0x1A, "keccak-224")]
-        [InlineData(0x1B, "keccak-256")]
-        [InlineData(0x1C, "keccak-384")]
-        [InlineData(0x1D, "keccak-512")]
-        [InlineData(0xb240, "blake2b-512")]
-        [InlineData(0xb260, "blake2s-256")]
-        [InlineData(0x56, "dbl-sha2-256")]
-        [InlineData(0x22, "murmur3-32")]
-        [InlineData(0x23, "murmur3-128")]
+        [MemberData(nameof(GetSupportedHashTable), DisableDiscoveryEnumeration = false)]
         public void TestTable(int code, string name)
         {
             if (Multihash.GetName(code) != name)
@@ -111,26 +94,10 @@
             Assert.True(mh.Verify(bytes));
         }

+        public static IEnumerable<object[]> GetSupportedHashes() => Multihash.SupportedHashCodes.Select(h => new object[] { h });
+
         [Theory]
-        [InlineData(HashType.ID)]
-        [InlineData(HashType.SHA1)]
-        [InlineData(HashType.SHA2_256)]
-        [InlineData(HashType.SHA2_512)]
-        [InlineData(HashType.SHA3_224)]
-        [InlineData(HashType.SHA3_256)]
-        [InlineData(HashType.SHA3_384)]
-        [InlineData(HashType.SHA3_512)]
-        [InlineData(HashType.KECCAK_224)]
-        [InlineData(HashType.KECCAK_256)]
-        [InlineData(HashType.KECCAK_384)]
-        [InlineData(HashType.KECCAK_512)]
-        [InlineData(HashType.SHAKE_128)]
-        [InlineData(HashType.SHAKE_256)]
-        [InlineData(HashType.BLAKE2B_256)]
-        [InlineData(HashType.BLAKE2S_128)]
-        [InlineData(HashType.DBL_SHA2_256)]
-        [InlineData(HashType.MURMUR3_32)]
-        [InlineData(HashType.MURMUR3_128)]
+        [MemberData(nameof(GetSupportedHashes), DisableDiscoveryEnumeration = false)]
         public void VerifyRoundTrip(HashType type)
         {
             var rand = new Random(Environment.TickCount);
@@ -145,25 +112,7 @@
         }

         [Theory]
-        [InlineData(HashType.ID)]
-        [InlineData(HashType.SHA1)]
-        [InlineData(HashType.SHA2_256)]
-        [InlineData(HashType.SHA2_512)]
-        [InlineData(HashType.SHA3_224)]
-        [InlineData(HashType.SHA3_256)]
-        [InlineData(HashType.SHA3_384)]
-        [InlineData(HashType.SHA3_512)]
-        [InlineData(HashType.KECCAK_224)]
-        [InlineData(HashType.KECCAK_256)]
-        [InlineData(HashType.KECCAK_384)]
-        [InlineData(HashType.KECCAK_512)]
-        [InlineData(HashType.SHAKE_128)]
-        [InlineData(HashType.SHAKE_256)]
-        [InlineData(HashType.BLAKE2B_256)]
-        [InlineData(HashType.BLAKE2S_128)]
-        [InlineData(HashType.DBL_SHA2_256)]
-        [InlineData(HashType.MURMUR3_32)]
-        [InlineData(HashType.MURMUR3_128)]
+        [MemberData(nameof(GetSupportedHashes), DisableDiscoveryEnumeration = false)]
         public async Task VerifyRoundTripAsync(HashType type)
         {
             var rand = new Random(Environment.TickCount);
@@ -178,25 +127,7 @@
         }

         [Theory]
-        [InlineData(HashType.ID)]
-        [InlineData(HashType.SHA1)]
-        [InlineData(HashType.SHA2_256)]
-        [InlineData(HashType.SHA2_512)]
-        [InlineData(HashType.SHA3_224)]
-        [InlineData(HashType.SHA3_256)]
-        [InlineData(HashType.SHA3_384)]
-        [InlineData(HashType.SHA3_512)]
-        [InlineData(HashType.KECCAK_224)]
-        [InlineData(HashType.KECCAK_256)]
-        [InlineData(HashType.KECCAK_384)]
-        [InlineData(HashType.KECCAK_512)]
-        [InlineData(HashType.SHAKE_128)]
-        [InlineData(HashType.SHAKE_256)]
-        [InlineData(HashType.BLAKE2B_256)]
-        [InlineData(HashType.BLAKE2S_128)]
-        [InlineData(HashType.DBL_SHA2_256)]
-        [InlineData(HashType.MURMUR3_32)]
-        [InlineData(HashType.MURMUR3_128)]
+        [MemberData(nameof(GetSupportedHashes), DisableDiscoveryEnumeration = false)]
         public void TestMultithreadedEnvironment(HashType type)
         {
             var rand = new Random(Environment.TickCount);


add FileStorageTest using

add FileStorageTest using

--- test/OpenCvSharp.Tests/core/FileStorageTest.cs
+++ test/OpenCvSharp.Tests/core/FileStorageTest.cs
@@ -120,19 +120,20 @@
                     Assert.NotNull(node);
                     Assert.Equal(FileNode.Types.Seq, node.Type);

-                    var elem0 = node.ElementAt(0);
-                    var elem1 = node.ElementAt(1);
-
-                    Assert.Equal(mapSequence.vec3b, elem0["vec3b"].ReadVec3b());
-                    Assert.Equal(mapSequence.rect, elem0["rect"].ReadRect());
-                    Assert.Equal(mapSequence.size, elem1["size"].ReadSize());
-                    Assert.Equal(mapSequence.point, elem1["point"].ReadPoint());
+                    using (var elem0 = node.ElementAt(0))
+                    using (var elem1 = node.ElementAt(1))
+                    {
+                        Assert.Equal(mapSequence.vec3b, elem0["vec3b"].ReadVec3b());
+                        Assert.Equal(mapSequence.rect, elem0["rect"].ReadRect());
+                        Assert.Equal(mapSequence.size, elem1["size"].ReadSize());
+                        Assert.Equal(mapSequence.point, elem1["point"].ReadPoint());
+                    }
                 }

                 // mat
+                using (Mat r = fs["R"].ReadMat())
+                using (Mat t = fs["T"].ReadMat())
                 {
-                    Mat r = fs["R"].ReadMat();
-                    Mat t = fs["T"].ReadMat();
                     Console.WriteLine("R = {0}", r);
                     Console.WriteLine("T = {0}", t);


Fixing flaky test

Fixing flaky test

--- test/WebJobs.Script.Tests/NodeEndToEndTests.cs
+++ test/WebJobs.Script.Tests/NodeEndToEndTests.cs
@@ -260,14 +260,14 @@
                 await Fixture.Host.CallAsync("Scenarios", arguments);
             }

-            var blobs = container.ListBlobs().Cast<CloudBlockBlob>().OrderBy(p => p.Properties.LastModified).ToArray();
+            var blobs = container.ListBlobs().Cast<CloudBlockBlob>().ToArray();
             Assert.Equal(3, blobs.Length);
-            for (int i = 0; i < 3; i++)
-            {
-                var blob = (CloudBlockBlob)blobs[i];
+            foreach (var blob in blobs)
+            {
                 byte[] contents = new byte[4];
                 await blob.DownloadToByteArrayAsync(contents, 0);
-                Assert.Equal(i, BitConverter.ToInt32(contents, 0));
+                int blobInt = BitConverter.ToInt32(contents, 0);
+                Assert.True(blobInt >= 0 && blobInt <= 3);
             }
         }


add another alias

add another alias

--- CompatBot/Commands/Sudo.Bot.Configuration.cs
+++ CompatBot/Commands/Sudo.Bot.Configuration.cs
@@ -62,7 +62,7 @@
                     await ctx.ReactWithAsync(Config.Reactions.Success, "Set variable successfully").ConfigureAwait(false);
                 }

-                [Command("clear"), Aliases("unset", "remove")]
+                [Command("clear"), Aliases("unset", "remove", "reset")]
                 [Description("Removes configuration variable")]
                 public async Task Clear(CommandContext ctx, string key)
                 {


fix potential issue with piracy reporting, maybe?

--- CompatBot/EventHandlers/LogParsingHandler.cs
+++ CompatBot/EventHandlers/LogParsingHandler.cs
@@ -112,11 +112,17 @@
                                                 severity = ReportSeverity.High;
                                                 Config.Log.Warn(e, $"Unable to delete message in {channel.Name}");
                                             }
-                                            await channel.SendMessageAsync($"{message.Author.Mention}, please read carefully:", embed: await result.AsEmbedAsync(client, message).ConfigureAwait(false)).ConfigureAwait(false);
+                                            try
+                                            {
+                                                await channel.SendMessageAsync($"{message.Author.Mention}, please read carefully:", embed: await result.AsEmbedAsync(client, message).ConfigureAwait(false)).ConfigureAwait(false);
+                                            }
+                                            catch (Exception e)
+                                            {
+                                                Config.Log.Error(e, "Failed to send piracy warning");
+                                            }
                                             await Task.WhenAll(
                                                 client.ReportAsync("Pirated Release", message, result.PiracyTrigger, result.PiracyContext, severity),
-                                                Warnings.AddAsync(client, message, message.Author.Id, message.Author.Username, client.CurrentUser,
-                                                    "Pirated Release", $"{message.Content.Sanitize()} - {result.PiracyTrigger}")
+                                                Warnings.AddAsync(client, message, message.Author.Id, message.Author.Username, client.CurrentUser, "Pirated Release", $"{message.Content.Sanitize()} - {result.PiracyTrigger}")
                                             );
                                         }
                                     }


Fix ParallaxGenerator dying (#2637)

Fix ParallaxGenerator dying (#2637)

--- Content.Client/Parallax/ParallaxGenerator.cs
+++ Content.Client/Parallax/ParallaxGenerator.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
@@ -27,7 +27,7 @@
             sawmill.Debug("Timing start!");
             var sw = new Stopwatch();
             sw.Start();
-            var image = new Image<Rgba32>(Configuration.Default, size.Width, size.Height, new Rgba32(0,0,0,255));
+            var image = new Image<Rgba32>(Configuration.Default, size.Width, size.Height, new Rgba32(0, 0, 0, 255));
             var count = 0;
             foreach (var layer in generator.Layers)
             {
@@ -44,7 +44,7 @@

         private void _loadConfig(TomlTable config)
         {
-            foreach (var layerArray in ((TomlTableArray)config.Get("layers")).Items)
+            foreach (var layerArray in ((TomlTableArray) config.Get("layers")).Items)
             {
                 switch (((TomlValue<string>) layerArray.Get("type")).Value)
                 {
@@ -98,7 +98,7 @@

                 if (table.TryGetValue("seed", out tomlObject))
                 {
-                    Seed = (uint) ((TomlValue<int>) tomlObject).Value;
+                    Seed = (uint) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("persistence", out tomlObject))
@@ -118,7 +118,7 @@

                 if (table.TryGetValue("octaves", out tomlObject))
                 {
-                    Octaves = (uint) ((TomlValue<int>) tomlObject).Value;
+                    Octaves = (uint) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("threshold", out tomlObject))
@@ -225,12 +225,12 @@
             {
                 if (table.TryGetValue("seed", out var tomlObject))
                 {
-                    Seed = ((TomlValue<int>) tomlObject).Value;
+                    Seed = (int) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("count", out tomlObject))
                 {
-                    PointCount = ((TomlValue<int>) tomlObject).Value;
+                    PointCount = (int) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("sourcefactor", out tomlObject))
@@ -255,7 +255,7 @@

                 if (table.TryGetValue("pointsize", out tomlObject))
                 {
-                    PointSize = ((TomlValue<int>) tomlObject).Value;
+                    PointSize = (int) ((TomlValue<long>) tomlObject).Value;
                 }

                 // Noise mask stuff.
@@ -266,7 +266,7 @@

                 if (table.TryGetValue("maskseed", out tomlObject))
                 {
-                    MaskSeed = (uint) ((TomlValue<int>) tomlObject).Value;
+                    MaskSeed = (uint) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("maskpersistence", out tomlObject))
@@ -286,7 +286,7 @@

                 if (table.TryGetValue("maskoctaves", out tomlObject))
                 {
-                    MaskOctaves = (uint) ((TomlValue<int>) tomlObject).Value;
+                    MaskOctaves = (uint) ((TomlValue<long>) tomlObject).Value;
                 }

                 if (table.TryGetValue("maskthreshold", out tomlObject))
@@ -318,7 +318,7 @@
             public override void Apply(Image<Rgba32> bitmap)
             {
                 // Temporary buffer so we don't mess up blending.
-                using (var buffer = new Image<Rgba32>(Configuration.Default, bitmap.Width, bitmap.Height, new Rgba32(0,0,0,0)))
+                using (var buffer = new Image<Rgba32>(Configuration.Default, bitmap.Width, bitmap.Height, new Rgba32(0, 0, 0, 0)))
                 {
                     if (Masked)
                     {