Reduce allocations in RequestInfo

Reduce allocations in RequestInfo

By default, RequestInfo creates new lists for all type of collection params,
even though most of them weren't used most of the time. Instead, construct
these collections lazily

--- src/RestEase/Implementation/RequestInfo.cs
+++ src/RestEase/Implementation/RequestInfo.cs
@@ -1,6 +1,6 @@
 using System;
-using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 using System.Net.Http;
 using System.Threading;

@@ -15,92 +15,74 @@
         /// <summary>
         /// Gets the HttpMethod which should be used to make the request
         /// </summary>
-        public HttpMethod Method { get; private set; }
+        public HttpMethod Method { get; }

         /// <summary>
         /// Gets the relative path to the resource to request
         /// </summary>
-        public string Path { get; private set; }
+        public string Path { get; }

         /// <summary>
         /// Gets or sets the CancellationToken used to cancel the request
         /// </summary>
-        public CancellationToken CancellationToken { get; set; }
+        public CancellationToken CancellationToken { get; set; } = CancellationToken.None;

         /// <summary>
         /// Gets or sets a value indicating whether to suppress the exception on invalid status codes
         /// </summary>
         public bool AllowAnyStatusCode { get; set; }

-        private readonly List<QueryParameterInfo> _queryParams;
+        private List<QueryParameterInfo> _queryParams;

         /// <summary>
         /// Gets the query parameters to append to the request URI
         /// </summary>
-        public IEnumerable<QueryParameterInfo> QueryParams
-        {
-            get { return this._queryParams; }
-        }
+        public IEnumerable<QueryParameterInfo> QueryParams => this._queryParams ?? Enumerable.Empty<QueryParameterInfo>();

         /// <summary>
         /// Gets the raw query parameter provider
         /// </summary>
         public RawQueryParameterInfo RawQueryParameter { get; private set; }

-        private readonly List<PathParameterInfo> _pathParams;
+        private List<PathParameterInfo> _pathParams;

         /// <summary>
         /// Gets the parameters which should be substituted into placeholders in the Path
         /// </summary>
-        public IEnumerable<PathParameterInfo> PathParams
-        {
-            get { return this._pathParams; }
-        }
-
-        private readonly List<PathParameterInfo> _pathProperties;
+        public IEnumerable<PathParameterInfo> PathParams => this._pathParams ?? Enumerable.Empty<PathParameterInfo>();
+
+        private List<PathParameterInfo> _pathProperties;

         /// <summary>
         /// Gets the values from headers which should be substituted into placeholders in the Path
         /// </summary>
-        public IEnumerable<PathParameterInfo> PathProperties
-        {
-            get { return this._pathProperties; }
-        }
+        public IEnumerable<PathParameterInfo> PathProperties => this._pathProperties ?? Enumerable.Empty<PathParameterInfo>();

         /// <summary>
         /// Gets or sets the headers which were applied to the interface
         /// </summary>
         public IEnumerable<KeyValuePair<string, string>> ClassHeaders { get; set; }

-        private readonly List<KeyValuePair<string, string>> _propertyHeaders;
+        private List<KeyValuePair<string, string>> _propertyHeaders;

         /// <summary>
         /// Gets the headers which were applied using properties
         /// </summary>
-        public IEnumerable<KeyValuePair<string, string>> PropertyHeaders
-        {
-            get { return this._propertyHeaders; }
-        }
-
-        private readonly List<KeyValuePair<string, string>> _methodHeaders;
+        public IEnumerable<KeyValuePair<string, string>> PropertyHeaders => this._propertyHeaders ?? Enumerable.Empty<KeyValuePair<string, string>>();
+
+        private List<KeyValuePair<string, string>> _methodHeaders;

         /// <summary>
         /// Gets the headers which were applied to the method being called
         /// </summary>
-        public IEnumerable<KeyValuePair<string, string>> MethodHeaders
-        {
-            get { return this._methodHeaders; }
-        }
-
-        private readonly List<KeyValuePair<string, string>> _headerParams;
+        public IEnumerable<KeyValuePair<string, string>> MethodHeaders => this._methodHeaders ?? Enumerable.Empty<KeyValuePair<string, string>>();
+
+        private List<KeyValuePair<string, string>> _headerParams;

         /// <summary>
         /// Gets the headers which were passed to the method as parameters
         /// </summary>
-        public IEnumerable<KeyValuePair<string, string>> HeaderParams
-        {
-            get { return this._headerParams; }
-        }
+        public IEnumerable<KeyValuePair<string, string>> HeaderParams => this._headerParams ?? Enumerable.Empty<KeyValuePair<string, string>>();

         /// <summary>
         /// Gets information the [Body] method parameter, if it exists
@@ -116,14 +98,6 @@
         {
             this.Method = method;
             this.Path = path;
-            this.CancellationToken = CancellationToken.None;
-
-            this._queryParams = new List<QueryParameterInfo>();
-            this._pathParams = new List<PathParameterInfo>();
-            this._pathProperties = new List<PathParameterInfo>();
-            this._methodHeaders = new List<KeyValuePair<string, string>>();
-            this._propertyHeaders = new List<KeyValuePair<string, string>>();
-            this._headerParams = new List<KeyValuePair<string, string>>();
         }

         /// <summary>
@@ -141,6 +115,9 @@
         /// </param>
         public void AddQueryParameter<T>(QuerySerializationMethod serializationMethod, string name, T value, string format = null)
         {
+            if (this._queryParams == null)
+                this._queryParams = new List<QueryParameterInfo>();
+
             this._queryParams.Add(new QueryParameterInfo<T>(serializationMethod, name, value, format));
         }

@@ -158,6 +135,9 @@
         /// </param>
         public void AddQueryCollectionParameter<T>(QuerySerializationMethod serializationMethod, string name, IEnumerable<T> values, string format = null)
         {
+            if (this._queryParams == null)
+                this._queryParams = new List<QueryParameterInfo>();
+
             this._queryParams.Add(new QueryCollectionParameterInfo<T>(serializationMethod, name, values, format));
         }

@@ -172,6 +152,9 @@
         {
             if (queryMap == null)
                 return;
+
+            if (this._queryParams == null)
+                this._queryParams = new List<QueryParameterInfo>();

             foreach (var kvp in queryMap)
             {
@@ -207,6 +190,9 @@
             if (queryMap == null)
                 return;

+            if (this._queryParams == null)
+                this._queryParams = new List<QueryParameterInfo>();
+
             foreach (var kvp in queryMap)
             {
                 if (kvp.Key != null)
@@ -233,6 +219,9 @@
         /// <param name="format">Format string to pass to ToString(), if the value implements <see cref="IFormattable"/></param>
         public void AddPathParameter<T>(string name, T value, string format = null)
         {
+            if (this._pathParams == null)
+                this._pathParams = new List<PathParameterInfo>();
+
             this._pathParams.Add(new PathParameterInfo(name, value, format));
         }

@@ -245,6 +234,9 @@
         /// <param name="format">Format string to pass to ToString(), if the value implements <see cref="IFormattable"/></param>
         public void AddPathProperty<T>(string name, T value, string format = null)
         {
+            if (this._pathProperties == null)
+                this._pathProperties = new List<PathParameterInfo>();
+
             this._pathProperties.Add(new PathParameterInfo(name, value, format));
         }

@@ -257,6 +249,9 @@
         /// <param name="defaultValue">Value to use if 'value' == null</param>
         public void AddPropertyHeader<T>(string name, T value, string defaultValue)
         {
+            if (this._propertyHeaders == null)
+                this._propertyHeaders = new List<KeyValuePair<string, string>>();
+
             string stringValue = defaultValue;
             if (value != null)
                 stringValue = value.ToString();
@@ -270,6 +265,9 @@
         /// <param name="value">Value of the header to add</param>
         public void AddMethodHeader(string name, string value)
         {
+            if (this._methodHeaders == null)
+                this._methodHeaders = new List<KeyValuePair<string, string>>();
+
             this._methodHeaders.Add(new KeyValuePair<string, string>(name, value));
         }

@@ -281,6 +279,9 @@
         /// <param name="value">Value of the header (value of the parameter)</param>
         public void AddHeaderParameter<T>(string name, T value)
         {
+            if (this._headerParams == null)
+                this._headerParams = new List<KeyValuePair<string, string>>();
+
             string stringValue = null;
             if (value != null)
                 stringValue = value.ToString();


Change to use / separator for Git path

Change to use / separator for Git path

The new version of LibGit2Sharp expects / separators in Git paths. The
previous version wasn't fussy.


DataImporter: CSV and TSV importer improve

--- samples/DataImporter/GraphEngine.DataImporter/CsvImporter.cs
+++ samples/DataImporter/GraphEngine.DataImporter/CsvImporter.cs
@@ -96,17 +96,16 @@
                     cDoubleQuotes = 0;
                     beginWithDoubleQuote = true;
                 }
-                else if (c == delimiter && cDoubleQuotes % 2 == 0 && beginWithDoubleQuote && line[curIndex - 1] == '"' && curIndex > 0)
+                else if (c == delimiter && cDoubleQuotes % 2 == 0 && beginWithDoubleQuote && curIndex > 0)
                 {
-                    fields.Add(SanitizeCsvField(CheckDoubleQuote(line.Substring(beginIndex, curIndex - beginIndex))));
+                    fields.Add(SanitizeCsvField(line.Substring(beginIndex, curIndex - beginIndex)));
                     beginIndex = curIndex + 1;
                     cDoubleQuotes = 0;
                     beginWithDoubleQuote = true;
                 }
-                else if (c == delimiter && (!beginWithDoubleQuote || line[curIndex - 1] != '"' || beginIndex + 1 == curIndex || curIndex == 0))
+                else if (c == delimiter && (!beginWithDoubleQuote || curIndex == 0))
                 {
-                    fields.Add(CheckDoubleQuote(line.Substring(beginIndex, curIndex - beginIndex)));
-
+                    fields.Add((line.Substring(beginIndex, curIndex - beginIndex)));
                     beginIndex = curIndex + 1;
                     cDoubleQuotes = 0;
                     beginWithDoubleQuote = true;
@@ -120,17 +119,17 @@
                         //throw new ImporterException("Unexpected double-quote at position {0} of {1}", curIndex, line);
                     }
                 }
-            }
+            }

             if (beginIndex < curIndex)
             {
-                if (!beginWithDoubleQuote || line[curIndex - 1] != '"' || beginIndex + 1 == curIndex)
+                if (!beginWithDoubleQuote)
                 {
-                    fields.Add(CheckDoubleQuote(line.Substring(beginIndex, curIndex - beginIndex)));
+                    fields.Add(line.Substring(beginIndex, curIndex - beginIndex));
                 }
                 else
                 {
-                       fields.Add(SanitizeCsvField(CheckDoubleQuote(line.Substring(beginIndex, curIndex - beginIndex))));
+                    fields.Add(SanitizeCsvField(line.Substring(beginIndex, curIndex - beginIndex)));
                 }
             }
             if (beginIndex == curIndex && beginIndex == line.Length)
@@ -149,28 +148,21 @@
             string sanitized = trim ? field.Trim() : field;
             if (sanitized == "" && treatEmptyAsNull)
                 return null;
-            if (sanitized.StartsWith("\""))
+            if (sanitized.StartsWith("\"") && sanitized.EndsWith("\""))
             {
-                if (!sanitized.EndsWith("\""))
-                    throw new ImporterException("Field is not properly quoted: {0}", field);
-
                 sanitized = sanitized.Substring(1, sanitized.Length - 2);
-                if(sanitized.Count(c => c=='\"') % 4 !=0)
+                if(sanitized.Count(c => c=='\"') % 2 !=0)
+                {
+                   throw new ImporterException("Field is not properly quoted: {0}", field);
+                }
+                if (sanitized.Count(c=> c=='\"') != sanitized.Replace("\"\"", "\"").Count(c=> c=='\"') * 2)
                 {
                     throw new ImporterException("Field is not properly quoted: {0}", field);
                 }
+            sanitized = sanitized.Replace("\"\"", "\"");
             }
-            sanitized = sanitized.Replace("\"\"", "\"");

             return sanitized;
-        }
-        private static string CheckDoubleQuote(string source)
-        {
-            if (source.Count(c => c == '"') % 2 == 1)
-            {
-                throw new ImporterException("Field is not properly quoted: {0}", source);
-            }
-            return source;
         }

         public bool IgnoreType()


bail from auto prop analyzer for attributes unless they are suppressions

--- src/Analyzers/Core/Analyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
+++ src/Analyzers/Core/Analyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
@@ -222,9 +222,14 @@
             }

             // Can't remove the field if it has attributes on it.
-            if (getterField.GetAttributes().Length > 0)
-            {
-                return;
+            var attributes = getterField.GetAttributes();
+            var suppressMessageAttributeType = semanticModel.Compilation.SuppressMessageAttributeType();
+            foreach (var attribute in attributes)
+            {
+                if (attribute.AttributeClass != suppressMessageAttributeType)
+                {
+                    return;
+                }
             }

             if (!CanConvert(property))


Remove

Remove

--- src/Compilers/CSharp/Portable/SourceGeneration/SyntaxValueProviderExtensions.cs
+++ src/Compilers/CSharp/Portable/SourceGeneration/SyntaxValueProviderExtensions.cs
@@ -1,17 +0,0 @@
-//// Licensed to the .NET Foundation under one or more agreements.
-//// The .NET Foundation licenses this file to you under the MIT license.
-//// See the LICENSE file in the project root for more information.
-
-//using Microsoft.CodeAnalysis.SourceGeneration;
-
-//namespace Microsoft.CodeAnalysis.CSharp.SourceGeneration;
-
-//internal static partial class SyntaxValueProviderExtensions
-//{
-//    /// <inheritdoc cref="Microsoft.CodeAnalysis.SyntaxValueProviderExtensions.CreateSyntaxProviderForAttribute{T}"/>
-//    internal static IncrementalValuesProvider<T> CreateSyntaxProviderForAttribute<T>(this SyntaxValueProvider provider, string simpleName)
-//        where T : SyntaxNode
-//    {
-//        return provider.CreateSyntaxProviderForAttribute<T>(simpleName, CSharpSyntaxHelper.Instance, compilationGlobalAliases: null);
-//    }
-//}


check for null

check for null


Corrected parameter name from "primaryTableName" to "foreignTableName"

--- src/FluentMigrator/Builders/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs
+++ src/FluentMigrator/Builders/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs
@@ -22,6 +22,6 @@
 {
     public interface IDeleteForeignKeyOnTableSyntax : IFluentSyntax
     {
-        IInSchemaSyntax OnTable(string primaryTableName);
+        IInSchemaSyntax OnTable(string foreignTableName);
     }
 }


Cosmetic changes

Cosmetic changes

--- src/Kephas.Serialization.ServiceStack.Text/DefaultJsonSerializerConfigurator.cs
+++ src/Kephas.Serialization.ServiceStack.Text/DefaultJsonSerializerConfigurator.cs
@@ -133,7 +133,7 @@
                 this.Logger.Error(exception, $"Error on deserializing {instance}, type: {type}, name: {name}, str: {str}.");
                 throw exception;
             };
-
+
             this.ConfigureTypeFinder();

             foreach (var typeSerializerFactory in this.typeSerializerFactories)
@@ -192,7 +192,7 @@
                                () => new ExpandoSerializer(),
                                new TypeJsonSerializerMetadata(typeof(Expando))),
                            new ExportFactory<ITypeJsonSerializer, TypeJsonSerializerMetadata>(
-                               () => new ExpandoInterfaceSerializer(),
+                               () => new ExpandoInterfaceSerializer(),
                                new TypeJsonSerializerMetadata(typeof(IExpando))),
                            new ExportFactory<ITypeJsonSerializer, TypeJsonSerializerMetadata>(
                                () => new JsonExpandoSerializer(),


Update Index.cshtml

Update Index.cshtml

--- Anlab.Mvc/Views/Home/Index.cshtml
+++ Anlab.Mvc/Views/Home/Index.cshtml
@@ -8,7 +8,7 @@
     Update posted: December 8, 2020

       Please Note Holiday Closure Information:

        The Lab will be closed from December 24 - January 1

-       Please arrange sample delieveries by noon on December 23 if possible.

+       Please arrange sample deliveries by noon on December 23 if possible.

        We will reopen with normal business hours on Monday, January 4.

         Also Note:

             The emergency arrangement for wine testing is concluding.


Activate skipped test to get more info on CI intermittent failure.

--- src/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs
+++ src/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs
@@ -158,7 +158,6 @@
             Assert.Throws<ArgumentNullException>("obj", () => new CaseInsensitiveHashCodeProvider().GetHashCode(null));
         }

-        [ActiveIssue(11598)]
         [Theory]
         [InlineData("hello", "HELLO", true)]
         [InlineData("hello", "hello", true)]


using local machine (#29009)

using local machine (#29009)

--- src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs
+++ src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs
@@ -163,7 +163,11 @@

             try
             {
-                baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machineName);
+                if (machineName == ".")
+                    baseKey = Registry.LocalMachine;
+                else
+                    baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machineName);
+
                 if (baseKey == null)
                     throw new InvalidOperationException(SR.Format(SR.RegKeyMissingShort, "HKEY_LOCAL_MACHINE", machineName));


Disable test that appears to be causing a hang in System.Net.Http tests. (#32048)

--- src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Cancellation.cs
+++ src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Cancellation.cs
@@ -288,6 +288,7 @@
             }
         }

+        [ActiveIssue(32000)]
         [SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "WinRT stack can't set MaxConnectionsPerServer < 2")]
         [Fact]
         public async Task MaxConnectionsPerServer_WaitingConnectionsAreCancelable()


Automatic reconnect logic when making requests

--- Assets/Metagame/MetagameClient.cs
+++ Assets/Metagame/MetagameClient.cs
@@ -15,6 +15,8 @@

 	public class MetagameClient : MonoBehaviour
 	{
+		public int ReconnectAttempts = 3;
+
 		private WebSocket m_socket;
 		private bool m_connected;
 		private string m_connectError;
@@ -106,8 +108,21 @@

 			if (!m_socket.IsAlive)
 			{
-				task.OnClientError(MetagameClientError.NotConnected);
-				yield break;
+				var connectTask = new MetagameRef<ConnectResponse>();
+				for (var i = 0; i < ReconnectAttempts; i++)
+				{
+					yield return StartCoroutine(Connect(connectTask, m_socket.Url.ToString()));
+					if (connectTask.Error == null)
+					{
+						break;
+					}
+				}
+
+				if (connectTask.Error != null)
+				{
+					task.OnClientError(MetagameClientError.NotConnected);
+					yield break;
+				}
 			}

 			var correlation = Guid.NewGuid().ToString("N");


Update BackgroundMusic.cs

Update BackgroundMusic.cs

--- Assets/Scripts/BackgroundMusic.cs
+++ Assets/Scripts/BackgroundMusic.cs
@@ -1,6 +1,6 @@
 //
 //  BackgroundMusic.cs
-//  A Vaila Ball - Computer
+//  Venture
 //
 //  Created by Batuhan Erden.
 //  Copyright © 2016 Batuhan Erden. All rights reserved.
@@ -27,4 +27,4 @@
 	private void Awake() {
 		DontDestroyOnLoad(transform.gameObject);
 	}
-}+}


Commented Playerbase

Commented Playerbase

--- Assets/Scripts/Base/PlayerBase.cs
+++ Assets/Scripts/Base/PlayerBase.cs
@@ -9,6 +9,7 @@
     [SerializeField] public List<FoundObject> Intuition = new List<FoundObject>();
     [SerializeField] public float lifePoints = 100;
     [SerializeField] public PlayerCommands playerCommands;
+    private int comboCount;

     private Vector3 originalSize;
     public bool topState;
@@ -168,6 +169,11 @@
         }
     }

+    /// <summary>
+    /// Character Looks at assigned opponent
+    /// It was written so if we get multiple opponents we could look at the closest
+    /// (This idea got scrept)
+    /// </summary>
     public virtual void LookAtOpponent()
     {
         if (opponent != null)
@@ -187,6 +193,12 @@
         }
     }

+    /// <summary>
+    /// The Collition that makes sure that we hit the invisible ground of the battle field
+    /// This was writen so that the player could jump
+    /// **--IDEA SCRAPTED--**
+    /// </summary>
+    /// <param name="col"></param>
     private void OnCollisionEnter2D(Collision2D col)
     {
         if (col.transform.tag == "Platform")
@@ -195,7 +207,25 @@
         }

     }
-
+    /// <summary>
+    /// The Collition that makes sure that we could leave the invisible ground of the battle field
+    /// This was writen so that the player could jump
+    /// **--IDEA SCRAPTED--**
+    /// </summary>
+    /// <param name="col"></param>
+    private void OnCollisionExit2D(Collision2D col)
+    {
+        if (col.transform.tag == "Platform")
+        {
+            OnPlatform = false;
+        }
+    }
+
+    /// <summary>
+    /// Collition Trigger to show that you hit the opponent
+    /// This function also calls the camera to shacke, Life to go down and the player to knock back
+    /// </summary>
+    /// <param name="col"></param>
     private void OnTriggerEnter2D(Collider2D col)
     {
         if (blocking == false)
@@ -210,14 +240,11 @@
         }
     }

-    private void OnCollisionExit2D(Collision2D col)
-    {
-        if (col.transform.tag == "Platform")
-        {
-            OnPlatform = false;
-        }
-    }
-
+
+    /// <summary>
+    /// Script that shows if the player has health left to live.
+    /// </summary>
+    /// <returns>Returns boolean if he's still alive</returns>
     public bool Alive()
     {
         if(lifePoints > 0)
@@ -231,6 +258,10 @@
         }
     }

+    /// <summary>
+    /// Script that blocks so he can't receive damage anymore
+    /// </summary>
+    /// <param name="activation">The boolean that calls this option</param>
     private void block(bool activation)
     {
         if(activation == true)
@@ -253,11 +284,12 @@
             animator.ConditionsOff();
         }
     }
+
     public string attack()
     {
-        if (animator.currentAnimation == CharacterAnimationsStates.Idle)
-        {
-            if (gameRunning)
+        if (gameRunning)
+        {
+            if (animator.currentAnimation == CharacterAnimationsStates.Idle)
             {
                 if (topState)
                 {
@@ -320,6 +352,10 @@
         }
     }

+    public IEnumerator ComboCounter()
+    {
+
+    }

 }


Small refactoring

Small refactoring

--- Assets/Scripts/Room/RoomLoader.cs
+++ Assets/Scripts/Room/RoomLoader.cs
@@ -439,6 +439,7 @@
 		GetComponent<DosBox>().UpdateAllActors();
 		GetComponent<DosBox>().UpdateBoxInfo();
 		RefreshHighLightedBox();
+		RefreshSelectedBox();

 		if (!GetComponent<WarpDialog>().warpMenuEnabled)
 		{
@@ -485,9 +486,9 @@
 	private void RefreshHighLightedBox()
 	{
 		Vector3 mousePosition = Input.mousePosition;
-
 		RaycastHit[] hitInfos = null;

+		//check screen boundaries
 		if (mousePosition.x > 0 && mousePosition.x < Screen.width &&
 			mousePosition.y > 0 && mousePosition.y < Screen.height)
 		{
@@ -517,20 +518,20 @@
 			//text
 			box.UpdateText(BoxInfo, GetComponent<DosBox>().InternalTimer, GetComponent<DosBox>().InternalTimerForKeyFrame);
 		}
-		else
-		{
-			if (HighLightedBox != null)
-			{
-				HighLightedBox.HighLight = false;
-				HighLightedBox = null;
-				BoxInfo.Clear();
-			}
-		}
-
+		else if (HighLightedBox != null)
+		{
+			HighLightedBox.HighLight = false;
+			HighLightedBox = null;
+			BoxInfo.Clear();
+		}
+	}
+
+	private void RefreshSelectedBox()
+	{
 		//toggle selected box
 		if (Input.GetMouseButtonDown(0) && HighLightedBox != null
 			&& !(GetComponent<WarpDialog>().warpMenuEnabled	 //make sure it not possible to change actor when there is a click inside warp menu
-				  && RectTransformUtility.RectangleContainsScreenPoint(GetComponent<WarpDialog>().Panel, Input.mousePosition)))
+				&& RectTransformUtility.RectangleContainsScreenPoint(GetComponent<WarpDialog>().Panel, Input.mousePosition)))
 		{
 			if (SelectedBox != HighLightedBox)
 			{
@@ -542,12 +543,12 @@
 				SelectedBox = null;
 			}
 		}
-
+
 		if (!DosBoxEnabled)
 		{
 			SelectedBox = null;
 		}
-
+
 		if (SelectedBox != null)
 		{
 			if (SelectedBox.ID == SelectedBoxId)


Fix bug where actor would appears in wrong room for one frame after floor switch

--- Assets/Scripts/Room/RoomLoader.cs
+++ Assets/Scripts/Room/RoomLoader.cs
@@ -701,7 +701,8 @@
 	{
 		if (floor == newfloor && newroom >= 0 && newroom < transform.childCount)
 		{
-			return transform.GetChild(newroom);
+			return transform.Cast<Transform>()
+				.FirstOrDefault(x => x.name == "ROOM" + newroom);
 		}
 		return null;
 	}


Fixed runtime dep handling after refactor

--- src/dotnetplugins/Bari.Plugins.VsCore/cs/Build/OptimizingBuildContextFactory.cs
+++ src/dotnetplugins/Bari.Plugins.VsCore/cs/Build/OptimizingBuildContextFactory.cs
@@ -95,7 +95,7 @@
         }

-        void ReplaceWithInSolutionReference(ISet<EquatableEdge<IBuilder>> graph, HashSet<ISlnProjectBuilder> childProjectBuilders, SuiteReferenceBuilder dep)
+        void ReplaceWithInSolutionReference(ISet<EquatableEdge<IBuilder>> graph, IEnumerable<ISlnProjectBuilder> childProjectBuilders, SuiteReferenceBuilder dep)
         {
             var inSolutionRef = inSolutionReferenceBuilderFactory.CreateInSolutionReferenceBuilder(dep.ReferencedProject);
             inSolutionRef.Reference = dep.Reference;
@@ -121,6 +121,7 @@
             private readonly MSBuildRunner msbuildRunner;
             private readonly SlnBuilder slnBuilder;
             private readonly ISet<ISlnProjectBuilder> projectBuilders = new HashSet<ISlnProjectBuilder>();
+            private readonly ISet<Project> projects = new HashSet<Project>();

             public SolutionBuildPattern(MSBuildRunner msbuildRunner, SlnBuilder slnBuilder)
             {
@@ -141,6 +142,11 @@
             public ISet<ISlnProjectBuilder> ProjectBuilders
             {
                 get { return projectBuilders; }
+            }
+
+            public ISet<Project> Projects
+            {
+                get { return projects; }
             }
         }

@@ -163,7 +169,9 @@
                     SolutionBuildPattern pattern;
                     if (patterns.TryGetValue((SlnBuilder)edge.Source, out pattern))
                     {
-                        pattern.ProjectBuilders.Add((ISlnProjectBuilder) edge.Target);
+                        var targetBuilder = (ISlnProjectBuilder) edge.Target;
+                        pattern.ProjectBuilders.Add(targetBuilder);
+                        pattern.Projects.Add(targetBuilder.Project);
                     }
                 }
             }
@@ -191,13 +199,24 @@
                 {
                     log.DebugFormat("Merging project builders of module {0} into a single solution", module.Name);

-                    // Creating the new [MSBuildRunner] -> [SlnBuilder] -> ... branches
-                    var mergedRoot = CreateMergedBuild(graph, module.Projects);
+                    var existingPattern = patterns.Values.FirstOrDefault(
+                        p => module.Projects.All(p.Projects.Contains));
+                    IBuilder mergedRoot;
+                    if (existingPattern == null)
+                    {
+                        // Creating the new [MSBuildRunner] -> [SlnBuilder] -> ... branches
+                        mergedRoot = CreateMergedBuild(graph, module.Projects);
+                    }
+                    else
+                    {
+                        mergedRoot = existingPattern.MsbuildRunner;
+                    }

                     // Redirecting all * -> [MSBuildRunner] edges to the merged [MSBuildRunner]
                     RerouteEdgesTargeting(
                         graph,
                         new HashSet<IBuilder>(patterns.Values
+                            .Where(p => p.MsbuildRunner != mergedRoot)
                             .Where(p => p.ProjectBuilders.All(pb => pb.Project.Module == module))
                             .Select(p => p.MsbuildRunner)),
                         mergedRoot);


Updates member indexer to consume less memory on rebuild, iterates over collection already in memory and just adds nodes as the are iterated, before was re-adding to memory in order to do counts, now we iteratively count.

--- src/UmbracoExamine/UmbracoMemberIndexer.cs
+++ src/UmbracoExamine/UmbracoMemberIndexer.cs
@@ -115,9 +115,10 @@
                 return;

             //Re-index all members in batches of 5000
-            IMember[] members;
-            const int pageSize = 5000;
+	        int memberCount = 0;
+            const int pageSize = 1000;
             var pageIndex = 0;
+            var serializer = new EntityXmlSerializer();

 	        if (IndexerData.IncludeNodeTypes.Any())
 	        {
@@ -127,10 +128,15 @@
                     do
                     {
                         int total;
-                        members = _memberService.GetAll(pageIndex, pageSize, out total, "LoginName", Direction.Ascending, nodeType).ToArray();
-                        AddNodesToIndex(GetSerializedMembers(members), type);
+                        var members = _memberService.GetAll(pageIndex, pageSize, out total, "LoginName", Direction.Ascending, nodeType);
+                        memberCount = 0;
+                        foreach (var member in members)
+                        {
+                            AddNodesToIndex(new[] { serializer.Serialize(_dataTypeService, member) }, type);
+                            memberCount++;
+                        }
                         pageIndex++;
-                    } while (members.Length == pageSize);
+                    } while (memberCount == pageSize);
 	            }
 	        }
 	        else
@@ -139,21 +145,17 @@
                 do
                 {
                     int total;
-                    members = _memberService.GetAll(pageIndex, pageSize, out total).ToArray();
-                    AddNodesToIndex(GetSerializedMembers(members), type);
+                    var members = _memberService.GetAll(pageIndex, pageSize, out total);
+                    memberCount = 0;
+                    foreach (var member in members)
+                    {
+                        AddNodesToIndex(new[] {serializer.Serialize(_dataTypeService, member)}, type);
+                        memberCount++;
+                    }
                     pageIndex++;
-                } while (members.Length == pageSize);
+                } while (memberCount == pageSize);
 	        }
 	    }
-
-	    private IEnumerable<XElement> GetSerializedMembers(IEnumerable<IMember> members)
-        {
-            var serializer = new EntityXmlSerializer();
-            foreach (var member in members)
-            {
-                yield return serializer.Serialize(_dataTypeService, member);
-            }
-	    }

 	    protected override XDocument GetXDocument(string xPath, string type)
 	    {


Probably fixes issue #1

Probably fixes issue #1

--- BrainFCSharp/Class/Interpreter.cs
+++ BrainFCSharp/Class/Interpreter.cs
@@ -160,6 +160,8 @@
                 InputProgress++;
         }

+        private int NestLevel;
+
         /// <summary>
         /// If the cerrently selected byte is 0, than skip to the char after the next ]
         /// </summary>
@@ -169,9 +171,17 @@
                 while (true)
                 {
                     Progress++;
-                    if (ProgramData[Progress] == ']')       // Basically, if the cerrently selected byte is 0, than skip to the char after the next ]
+                    if (ProgramData[Progress] == '[')
+                        NestLevel++;
+
+                    else if (ProgramData[Progress] == ']' && NestLevel == 0)       // Basically, if the cerrently selected byte is 0, than skip to the char after the next ]
+                    {
                         Progress++;
                         break;
+                    }
+
+                    else if (ProgramData[Progress] == ']' && NestLevel != 0)
+                        NestLevel--;
                 }
         }

@@ -184,8 +194,14 @@
                 while (true)
                 {
                     Progress--;
-                    if (ProgramData[Progress] == '[')       // Skips back to the last [ unless the byte at the pointer is 0.
+                    if (ProgramData[Progress] == '[' && NestLevel == 0)       // Skips back to the last [ unless the byte at the pointer is 0.
                         break;
+
+                    else if (ProgramData[Progress] == ']')
+                        NestLevel++;
+
+                    else if (ProgramData[Progress] == '[' && NestLevel != 0)
+                        NestLevel--;
                 }
         }
     }


(GH-2652) Improve documentation for TFBuildPullRequestInfo.Id and TFBuildPullRequestInfo.Number

--- src/Cake.Common/Build/TFBuild/Data/TFBuildPullRequestInfo.cs
+++ src/Cake.Common/Build/TFBuild/Data/TFBuildPullRequestInfo.cs
@@ -35,18 +35,20 @@
         public bool IsPullRequest => Id > 0;

         /// <summary>
-        /// Gets the pull request id.
+        /// Gets the ID of the pull request that caused this build.
+        /// This value is set only if the build ran because of a Git PR affected by a branch policy.
         /// </summary>
         /// <value>
-        ///   The pull request id.
+        ///   The ID of the pull request that caused this build.
         /// </value>
         public int Id => GetEnvironmentInteger("SYSTEM_PULLREQUEST_PULLREQUESTID");

         /// <summary>
-        /// Gets the GitHub pull request number.
+        /// Gets the number of the pull request that caused this build.
+        /// This value is set for pull requests from GitHub which have a different pull request ID and pull request number.
         /// </summary>
         /// <value>
-        ///   The GitHub pull request number.
+        ///   The number of the pull request that caused this build.
         /// </value>
         public int Number => GetEnvironmentInteger("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER");


Output retry as warnings instead of errors, let library clients decide level of error.

--- src/Cimpress.Extensions.Http/MessageHandlers/RetryHandler.cs
+++ src/Cimpress.Extensions.Http/MessageHandlers/RetryHandler.cs
@@ -102,19 +102,12 @@
             string msg = $"Error returned when invoking URL '{request.RequestUri}' with HTTP status {response?.StatusCode}.";
             var content = await TryGetContent(response);
             msg += $"This is attempt #{attempt + 1}. Response content was: '{content}'.";
-            if (error)
-            {
-                logger.LogError(msg);
-            }
-            else
-            {
-                logger.LogWarning(msg);
-            }
+            logger.LogWarning(msg);
         }

         private void LogAttemptsExceeded(HttpRequestMessage request, HttpResponseMessage response, int attempt)
         {
-            logger?.LogError($"Maximum amount of {attempt + 1} attempts has been reached while invoking URL '{request.RequestUri}'. Returning the last response of status code {response?.StatusCode}.");
+            logger?.LogWarning($"Maximum amount of {attempt + 1} attempts has been reached while invoking URL '{request.RequestUri}'. Returning the last response of status code {response?.StatusCode}.");
         }

         private async Task<string> TryGetContent(HttpResponseMessage response)


Update template.cshtml

Update template.cshtml

--- misc/templates/template.cshtml
+++ misc/templates/template.cshtml
@@ -5,7 +5,7 @@
     <title>@Title</title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="description" content="@Description">
-    <meta name="author" content=""@Properties["project-author"]">
+    <meta name="author" content="@Properties["project-author"]">

@@ -55,4 +55,4 @@

-  +


Run nullable analysis unconditionally in debug compilers (#40261)

--- src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs
+++ src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs
@@ -571,7 +571,13 @@
             var compilation = binder.Compilation;
             if (compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion() || !compilation.ShouldRunNullableWalker)
             {
+#if DEBUG
+                // Always run analysis in debug builds so that we can more reliably catch
+                // nullable regressions e.g. https://github.com/dotnet/roslyn/issues/40136
+                diagnostics = new DiagnosticBag();
+#else
                 return;
+#endif
             }

             Analyze(


Update BaseShapeViewModelExtensions.cs

Update BaseShapeViewModelExtensions.cs

--- src/Core2D/ViewModels/Shapes/BaseShapeViewModelExtensions.cs
+++ src/Core2D/ViewModels/Shapes/BaseShapeViewModelExtensions.cs
@@ -1,4 +1,4 @@
-#nullable disable
+#nullable enable
 using System.Collections.Generic;
 using System.Linq;

@@ -6,7 +6,7 @@
 {
     public static class BaseShapeViewModelExtensions
     {
-        public static IEnumerable<BaseShapeViewModel> GetAllShapes(this IEnumerable<BaseShapeViewModel> shapes)
+        public static IEnumerable<BaseShapeViewModel> GetAllShapes(this IEnumerable<BaseShapeViewModel>? shapes)
         {
             if (shapes is null)
             {
@@ -31,9 +31,9 @@
             }
         }

-        public static IEnumerable<T> GetAllShapes<T>(this IEnumerable<BaseShapeViewModel> shapes)
+        public static IEnumerable<T> GetAllShapes<T>(this IEnumerable<BaseShapeViewModel>? shapes)
         {
-            return GetAllShapes(shapes)?.Where(s => s is T).Cast<T>();
+            return GetAllShapes(shapes).Where(s => s is T).Cast<T>();
         }
     }
 }


Add a type mapping for the 'mediumtext' SQL type.

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1270 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs
+++ src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs
@@ -86,6 +86,7 @@
             case "long":
             case "longtext":
             case "long varchar":
+            case "mediumtext":
             case "nchar":
             case "ntext":
             case "nvarchar":


Changed to Full name in account dropdown

--- src/Feature/Accounts/code/Views/Accounts/AccountsMenu.cshtml
+++ src/Feature/Accounts/code/Views/Accounts/AccountsMenu.cshtml
@@ -25,8 +25,7 @@
                     @if (!string.IsNullOrWhiteSpace(Sitecore.Context.User.Profile.FullName))
                     {

@Captions.Name

-
@Sitecore.Context.User.Profile["FirstName"]
@Sitecore.Context.User.Profile["LastName"]

-
+
@Sitecore.Context.User.Profile.FullName

                     }

@Captions.Email

@Sitecore.Context.User.Profile.Email


Using InternalRedirect for redirecting to index documents in FileHandler

--- Ceen.Httpd/Handler/FileHandler.cs
+++ Ceen.Httpd/Handler/FileHandler.cs
@@ -96,7 +96,10 @@

 				var ix = m_indexfiles.Where(p => File.Exists(Path.Combine(path, p))).FirstOrDefault();
 				if (!string.IsNullOrWhiteSpace(ix))
-					path = Path.Combine(path, ix);
+				{
+					context.Response.InternalRedirect(context.Request.Path + ix);
+					return true;
+				}
 			}

 			if (!File.Exists(path))


Remove need to call Close()

Remove need to call Close()

--- CmcLibNet.Export/IExportEngine.cs
+++ CmcLibNet.Export/IExportEngine.cs
@@ -29,12 +29,8 @@
         void ExportCategory(string categoryName, string fileName, IExportSettings settings = null);

         /// <summary>
-        /// Close any references to Commence. The object should be disposed after this.
+        /// Not needed, does nothing.
         /// </summary>
-        /// <remarks>When used from within a Commence Form Script, failing to call the <c>Close</c> method will leave the commence.exe process running in the background when the user closes Commence. IMPORTANT: this also happens when an unhandled exception (a 'script error') occurs. The Commence process then has to be closed manually from the Windows Task Manager. Be careful to implement proper error handling.
-        /// <para>When the assembly is called from a.NET application, there is rarely a need to call this method, unless you want to explicitly release COM references and/or release memory. It can be useful in some cases, because Commence may complain about running out of memory before the Garbage Collector has a chance to kick in.</para>
-        /// <para>Technical details: calling this method tells the assembly to release all COM handles (called 'RCW' for 'runtime callable wrapper') to Commence that are open. This is needed because when the object reference to this assembly is set to Nothing (in VB), the .NET assembly may not be notified and will think they are still in use. Garbage Collection will therefore not release them, and the commence.exe process will not be terminated.</para>
-        /// </remarks>
         void Close();
     }
 }


Fixed function node not getting generated.

--- CodeGenerator/CppCodeGenerator.cs
+++ CodeGenerator/CppCodeGenerator.cs
@@ -51,7 +51,7 @@
 			sb.AppendLine(
 				string.Join(
 					Environment.NewLine + Environment.NewLine,
-					OrderByInheritance(classNodes.Where(c => c.Nodes.None(n => n is FunctionNode))).Select(c =>
+					OrderByInheritance(classNodes).Select(c =>
 					{
 						var csb = new StringBuilder();
 						csb.Append($"class {c.Name}");


fix routing from rider to driver [#136036659]

--- revashare-svc-webapi/revashare-svc-webapi.Client/Controllers/DriverController.cs
+++ revashare-svc-webapi/revashare-svc-webapi.Client/Controllers/DriverController.cs
@@ -8,7 +8,7 @@
 using System.Web.Http;

 namespace revashare_svc_webapi.Client.Controllers {
-  [RoutePrefix("rider")]
+  [RoutePrefix("driver")]
   public class DriverController : ApiController {
     private readonly IDriverRepository repo;


Attempts to improve performance of selecting products by tag.

This still eagerly downloads most of the database, but at least the product query itself should be fast.

--- Controllers/ProductsController.cs
+++ Controllers/ProductsController.cs
@@ -75,16 +75,48 @@
 			if (!ModelState.IsValid)
 				return HttpResult.BadRequest(ModelState);

+			var tagIdsList = tagIds.ToList();
+
+			var query = @"
+SELECT product.Id as Id, product.Name as Name, product.Price as Price
+	FROM ProductTag productTag0
+	";
+			query += String.Join("\r\n	", tagIds
+				.Select((guid, i) => new { guid, i })
+				.Skip(1)
+				.Select(item => $"JOIN ProductTag productTag{item.i} ON productTag0.ProductId = productTag{item.i}.ProductId"));
+			query += @"
+	JOIN Product product ON productTag0.ProductId = product.Id
+	";
+			if (tagIds.Count() != 0)
+				query += "WHERE ";
+			query += String.Join("\r\n		AND ", tagIds
+				.Select((guid, i) => new { guid, i })
+				.Select(item => $"productTag{item.i}.TagId = @p{item.i}"));
+
 			// locate matching products
 			var matchingProducts = _bagsContext.Products
 				.WithUnsafeIncludes()
-				.Where(product => tagIds
-					.All(expectedTagId => product.Tags
-						.Select(productTag => productTag.TagId)
-						.Contains(expectedTagId)))
+				.FromSql(query, tagIds.Select(guid => guid as Object).ToArray())
+				.Select(product => new
+				{
+					id = product.Id,
+					name = product.Name,
+					price = product.Price,
+					image_urls = product.ImageUrls.Select(imageUrl => imageUrl.Url),
+					purchase_urls = product.PurchaseUrls.Select(purchaseUrl => purchaseUrl.Url),
+					tags = product.Tags.Select(productTag => productTag.Tag).Select(tag => new
+					{
+						id = tag.Id,
+						name = tag.Name,
+						category = new
+						{
+							id = tag.TagCategory.Id,
+							name = tag.TagCategory.Name
+						}
+					})
+				})
 				// FIXME: This should be `ToListAsync` or `AsAsyncEnumerable` https://github.com/aspnet/EntityFramework/issues/5640
-				.ToList()
-				.Select(product => product.ToUnsafeExpandedWireFormat())
 				.ToList();

 			return HttpResult.Ok(matchingProducts);


Fix bug in Record() introduced by last commit

See review http://review.criteois.lan/#/c/81553/

Change-Id: Iccb3b8eaf4ae70438bc902570a9884cbf3b1862e

--- Criteo.Profiling.Tracing/Trace.cs
+++ Criteo.Profiling.Tracing/Trace.cs
@@ -203,7 +203,8 @@
         public static Task Record(this Trace trace, IAnnotation annotation)
         {
             if (trace != null && Trace.TracingEnabled)
-                trace.RecordAnnotation(annotation);
+                return trace.RecordAnnotation(annotation);
+
             return Task.FromResult(0);
         }
     }


Async: bugfix at AsyncRunner class - fix task counter, use separate field to track recursion

--- CustomBlocks/Async/AsyncRunner.cs
+++ CustomBlocks/Async/AsyncRunner.cs
@@ -52,7 +52,7 @@
 			}

 			private int taskCount = 0;
-			private bool done = false;
+			private bool isRunning = false;
 			private readonly ConcurrentQueue<TaskChunk> items = new ConcurrentQueue<TaskChunk>();
 			private readonly AutoResetEvent workItemsWaiting = new AutoResetEvent(false);
 			private readonly List<Exception> innerExceptions = new List<Exception>();
@@ -63,11 +63,11 @@

 			public void AddTask<T>(Func<Task<T>> task, Action<T> callback = null)
 			{
-				if (taskCount > 0)
+				if (isRunning)
 					throw new NotSupportedException("Cannot add new task while already running async task queue, recursive approach is not supported!");
+				++taskCount;
 				Post(async x =>
 				{
-					++taskCount;
 					try
 					{
 						T result=await task();
@@ -100,16 +100,16 @@

 			private void EndMessageLoop()
 			{
-				Post(x => done = true, null);
+				Post(x => isRunning = false, null);
 			}

 			public void BeginMessageLoop()
 			{
-				if (taskCount > 0)
+				if (isRunning)
 					throw new NotSupportedException("Cannot start new task loop while already running async task queue, recursive approach is not supported!");
 				innerExceptions.Clear();
-				done = false;
-				while (!done)
+				isRunning = true;
+				while (isRunning)
 				{
 					if (items.TryDequeue(out TaskChunk task))
 						task.Execute();


WIP: SafeEvent class

WIP: SafeEvent class

--- CustomBlocks/Events/SafeEvents.cs
+++ CustomBlocks/Events/SafeEvents.cs
@@ -47,17 +47,17 @@
 	public class SafeEventPublisher<T> : IEventPublisher<T> where T : EventArgs
 	{
 		private delegate bool Forwarder(object sender, T args);
-		private static readonly Type[] forwarderTypes = new Type[] { typeof(WeakDelegate)/*this*/, typeof(object)/*sender*/, typeof(T)/*event args*/ };
-		private static readonly FieldInfo targetField = typeof(WeakDelegate).GetField("target", BindingFlags.NonPublic | BindingFlags.Instance);
+		private static readonly Type[] forwarderTypes = new Type[] { typeof(DynamicWrapper)/*this*/, typeof(object)/*sender*/, typeof(T)/*event args*/ };
+		private static readonly FieldInfo weakRefField = typeof(DynamicWrapper).GetField("target", BindingFlags.NonPublic | BindingFlags.Instance);

-		private sealed class WeakDelegate
+		private sealed class DynamicWrapper
 		{
 			private readonly MethodInfo method;
 			private readonly WeakReference target;

 			public readonly Forwarder forwarder;

-			public WeakDelegate(MethodInfo method, object target, bool generateForwarder=true)
+			public DynamicWrapper(MethodInfo method, object target, bool generateForwarder=true)
 			{
 				if(target == null)
 					this.target = null;
@@ -72,7 +72,7 @@

 			private Forwarder GenerateForwarder(bool isStatic)
 			{
-				var dynMethod = new DynamicMethod("InvokeEventOnObject", typeof(bool), forwarderTypes, typeof(WeakDelegate), true);
+				var dynMethod = new DynamicMethod("InvokeEventOnObject", typeof(bool), forwarderTypes, typeof(DynamicWrapper), true);
 				var generator = dynMethod.GetILGenerator();
 				if(isStatic)
 				{
@@ -81,7 +81,7 @@
 				else
 				{
 					generator.Emit(OpCodes.Ldarg_0); //stack: this
-					generator.Emit(OpCodes.Ldfld, targetField); //stack: this.target
+					generator.Emit(OpCodes.Ldfld, weakRefField); //stack: this.target
 					generator.Emit(OpCodes.Call, SafeEventPublisher.GetStrongRef); //stack: this.target.Target
 					generator.Emit(OpCodes.Dup); //stack: this.target.Target, this.target.Target
 					var continueLabel = generator.DefineLabel();
@@ -102,9 +102,9 @@

 			public override bool Equals(object obj)
 			{
-				if(!(obj is WeakDelegate))
+				if(!(obj is DynamicWrapper))
 					return false;
-				var other = (WeakDelegate)obj;
+				var other = (DynamicWrapper)obj;
 				if(target==null && other.target==null)
 					return method == other.method;
 				if(target != null && other.target != null)
@@ -119,7 +119,7 @@
 		}

 		//TODO: check other structures for effectiveness
-		private readonly HashSet<WeakDelegate> subscribers = new HashSet<WeakDelegate>();
+		private readonly HashSet<DynamicWrapper> subscribers = new HashSet<DynamicWrapper>();

 		private readonly object locker = new object();

@@ -128,7 +128,7 @@
 			if(subscriber == null)
 				throw new EventSubscriptionException(null, "Failed to add a null subscriber of type " + typeof(T).FullName, null);
 			lock(locker)
-				subscribers.Add(new WeakDelegate(subscriber.Method, subscriber.Target));
+				subscribers.Add(new DynamicWrapper(subscriber.Method, subscriber.Target));
 		}

 		public void Unsubscribe(EventHandler<T> subscriber)
@@ -136,7 +136,7 @@
 			if(subscriber == null)
 				throw new EventSubscriptionException(null, "Failed to add a null subscriber of type " + typeof(T).FullName, null);
 			lock(locker)
-				subscribers.Remove(new WeakDelegate(subscriber.Method, subscriber.Target, false));
+				subscribers.Remove(new DynamicWrapper(subscriber.Method, subscriber.Target, false));
 		}

 		//TODO: remove obsolete elements


Converted all public fields into public properties

git-svn-id: 95472bb50cfb75dbf91fed26dc933cae36d5c45c@72 1ca100b6-b014-4248-a4f8-5dbb9f49130a

--- DDay.iCal/DataTypes/UTC_Offset.cs
+++ DDay.iCal/DataTypes/UTC_Offset.cs
@@ -10,12 +10,40 @@
     /// </summary>
     public class UTC_Offset : iCalDataType
     {
-        #region Public Fields
+        #region Private Fields

-        public bool Positive = false;
-        public int Hours;
-        public int Minutes;
-        public int Seconds = 0;
+        private bool m_Positive = false;
+        private int m_Hours;
+        private int m_Minutes;
+        private int m_Seconds = 0;
+
+        #endregion
+
+        #region Public Properties
+
+        public bool Positive
+        {
+            get { return m_Positive; }
+            set { m_Positive = value; }
+        }
+
+        public int Hours
+        {
+            get { return m_Hours; }
+            set { m_Hours = value; }
+        }
+
+        public int Minutes
+        {
+            get { return m_Minutes; }
+            set { m_Minutes = value; }
+        }
+
+        public int Seconds
+        {
+            get { return m_Seconds; }
+            set { m_Seconds = value; }
+        }

         #endregion


count DFA etc

count DFA etc

--- DamageMeter.Core/DamageTracker.cs
+++ DamageMeter.Core/DamageTracker.cs
@@ -110,11 +110,11 @@

         private void InsertSkill(Entity entityTarget, Entity entitySource, Entity petSource, SkillResult message)
         {
-            if (!IsValidSkill(message)) { return; }

             var skillType = Database.Database.Type.Mana;
             if (message.IsHp) { skillType = message.IsHeal ? Database.Database.Type.Heal : Database.Database.Type.Damage; }
             if (message.Amount == 0) { skillType = Database.Database.Type.Counter; }
+            if (!IsValidSkill(message)) { skillType = Database.Database.Type.Counter; }// count DFA etc

             if (entityTarget is NpcEntity entity)
             {


fix #89 Can't find why it is happening, but should be fixed.

--- DamageMeter.Core/DamageTracker.cs
+++ DamageMeter.Core/DamageTracker.cs
@@ -200,14 +200,14 @@
             {
                 var newEntityStat = new EntityInfo();
                 newEntityStat.AbnormalityTime = entity.Value.AbnormalityTime;
-                newEntityStats.Add(entity.Key, newEntityStat);
+                newEntityStats[entity.Key] = newEntityStat;
             }

             foreach (var user in UsersStats)
             {
                 var newUserStat = new PlayerInfo(user.Key);
                 newUserStat.AbnormalityTime = user.Value.AbnormalityTime;
-                newUserStats.Add(user.Key, newUserStat);
+                newUserStats[user.Key] = newUserStat;
             }

             UsersStats = newUserStats;


Bumped to v1.15

Bumped to v1.15

--- Diesel/Properties/AssemblyInfo.cs
+++ Diesel/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.14.0")]
-[assembly: AssemblyFileVersion("1.14.0.0")]
+[assembly: AssemblyVersion("1.15.0")]
+[assembly: AssemblyFileVersion("1.15.0.0")]


Adding launcher functionality that doesn't depend on Duality (nearly nothing)

--- DualityLauncher/ProgramAndroid.cs
+++ DualityLauncher/ProgramAndroid.cs
@@ -11,10 +11,17 @@
 using Android.Util;
 using System.Diagnostics;

+
 namespace DualityLauncher.Android
 {
 	public class ProgramAndroid : AndroidGameView
 	{
+		private static bool _isDebugging = false;
+		private static bool _isProfiling = false;
+		private static bool _isRunFromEditor = false;
+		private Stopwatch _frameLimiterWatch = new Stopwatch();
+		Random r = new Random();
+
 		public ProgramAndroid (Context context) : base (context)
 		{
 		}
@@ -23,19 +30,61 @@
 		protected override void OnLoad (EventArgs e)
 		{
 			base.OnLoad (e);
-
-			// Run the render loop
-
+/* DEBT: waiting for Duality x 3
+ */
+			_isDebugging = System.Diagnostics.Debugger.IsAttached ;// || args.Contains(DualityApp.CmdArgDebug);
+//			isRunFromEditor = args.Contains(DualityApp.CmdArgEditor);
+//			isProfiling = args.Contains(DualityApp.CmdArgProfiling);
+			if (_isDebugging || _isRunFromEditor) ShowConsole();
 		}

+		private static bool hasConsole = false;
+		public static void ShowConsole()
+		{
+			/* DEBT: Not sure we need this console
+			 */
+			if (hasConsole) return;
+		//	NativeMethods.AllocConsole();
+			hasConsole = true;
+		}

 		protected override void OnUpdateFrame(FrameEventArgs e)
 		{
 			base.OnUpdateFrame(e);
+
+			if (!_isDebugging && !_isProfiling) // Don't limit frame rate when debugging or profiling.
+			{
+				//// Assure we'll at least wait 16 ms until updating again.
+				//if (this.frameLimiterWatch.IsRunning)
+				//{
+				//    while (this.frameLimiterWatch.Elapsed.TotalSeconds < 0.016d)
+				//    {
+				//        // Go to sleep if we'd have to wait too long
+				//        if (this.frameLimiterWatch.Elapsed.TotalSeconds < 0.01d)
+				//            System.Threading.Thread.Sleep(1);
+				//    }
+				//}
+
+				// Give the processor a rest if we have the time, don't use 100% CPU even without VSync
+				/* DEBT: waiting for Duality time is defined in duality, not sure what to do about VSync,
+				 * is it available on android?
+ */
+//				if (_frameLimiterWatch.IsRunning && this.VSync == VSyncMode.Off)
+//				{
+//					while (_frameLimiterWatch.Elapsed.TotalMilliseconds < Time.MsPFMult)
+//					{
+//						// Enough leftover time? Risk a millisecond sleep.
+//						if (_frameLimiterWatch.Elapsed.TotalMilliseconds < Time.MsPFMult * 0.75f)
+//							System.Threading.Thread.Sleep(1);
+//					}
+//				}
+				_frameLimiterWatch.Restart();
+			}
+
 		}

-		Random r = new Random ();
-		// This gets called on each frame render
+
+
 		protected override void OnRenderFrame (FrameEventArgs e)
 		{
 			// you only need to call this if you have delegates


Switch address to same as restore dialog in UI

--- Duplicati/CommandLine/Commands.cs
+++ Duplicati/CommandLine/Commands.cs
@@ -481,7 +481,7 @@
                             output.MessageEvent("Did we help save your files? If so, please support Duplicati with a donation. We suggest 10€ for private use and 100€ for commercial use.");
                             output.MessageEvent("");
                             output.MessageEvent("Paypal: http://goo.gl/P4XJ6S");
-                            output.MessageEvent("Bitcoin: 1NVFTyj9NRA4pbrEPa5VkNqjviqVoKhBMt");
+                            output.MessageEvent("Bitcoin: 18Qt6ddwg1g3PfjFgJLthQpXjYDyyrQdX1");
                             output.MessageEvent("***********************************************");
                         }


Disabling caches pr. default, use the temporary option --old-lookup-memory-defaults to re-enable caches

--- Duplicati/Library/Main/Options.cs
+++ Duplicati/Library/Main/Options.cs
@@ -461,12 +461,13 @@

                     new CommandLineArgument("dbpath", CommandLineArgument.ArgumentType.Path, Strings.Options.DbpathShort, Strings.Options.DbpathLong),
                     new CommandLineArgument("blocksize", CommandLineArgument.ArgumentType.Size, Strings.Options.BlocksizeShort, Strings.Options.BlocksizeLong, DEFAULT_BLOCKSIZE),
-                    new CommandLineArgument("file-read-buffer-size", CommandLineArgument.ArgumentType.Size, Strings.Options.FilereadbuffersizeShort, Strings.Options.FilereadbuffersizeLong, DEFAULT_READ_BUFFER_SIZE),
+                    new CommandLineArgument("file-read-buffer-size", CommandLineArgument.ArgumentType.Size, Strings.Options.FilereadbuffersizeShort, Strings.Options.FilereadbuffersizeLong, "0"),
                     new CommandLineArgument("store-metadata", CommandLineArgument.ArgumentType.Boolean, Strings.Options.StoremetadataShort, Strings.Options.StoremetadataLong, "false"),
-                    new CommandLineArgument("blockhash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.BlockhashlookupsizeShort, Strings.Options.BlockhashlookupsizeLong, DEFAULT_BLOCK_HASH_LOOKUP_SIZE),
-                    new CommandLineArgument("filehash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.FilehashlookupsizeShort, Strings.Options.FilehashlookupsizeLong, DEFAULT_FILE_HASH_LOOKUP_SIZE),
-                    new CommandLineArgument("metadatahash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.MetadatahashlookupsizeShort, Strings.Options.MetadatahashlookupsizeLong, DEFAULT_METADATA_HASH_LOOKUP_SIZE),
-                    new CommandLineArgument("disable-filepath-cache", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DisablefilepathcacheShort, Strings.Options.DisablefilepathcacheLong, "false"),
+                    new CommandLineArgument("blockhash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.BlockhashlookupsizeShort, Strings.Options.BlockhashlookupsizeLong, "0"),
+                    new CommandLineArgument("filehash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.FilehashlookupsizeShort, Strings.Options.FilehashlookupsizeLong, "0"),
+                    new CommandLineArgument("metadatahash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.MetadatahashlookupsizeShort, Strings.Options.MetadatahashlookupsizeLong, "0"),
+                    new CommandLineArgument("old-lookup-memory-defaults", CommandLineArgument.ArgumentType.Size, LC.L("Activate caches"), LC.L("Activate in-memory caches, which are now off by default"), "false"),
+                    new CommandLineArgument("disable-filepath-cache", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DisablefilepathcacheShort, Strings.Options.DisablefilepathcacheLong, "true"),
                     new CommandLineArgument("changed-files", CommandLineArgument.ArgumentType.Path, Strings.Options.ChangedfilesShort, Strings.Options.ChangedfilesLong),
                     new CommandLineArgument("deleted-files", CommandLineArgument.ArgumentType.Path, Strings.Options.DeletedfilesShort, string.Format(Strings.Options.DeletedfilesLong, "changed-files")),

@@ -1319,6 +1320,14 @@
         }

         /// <summary>
+        /// Gets a flag indicating whether this <see cref="Duplicati.Library.Main.Options"/> old memory defaults.
+        /// </summary>
+        public bool OldMemoryDefaults
+        {
+            get { return Library.Utility.Utility.ParseBoolOption(m_options, "old-lookup-memory-defaults"); }
+        }
+
+        /// <summary>
         /// Gets the block hash lookup size
         /// </summary>
         public long BlockHashLookupMemory
@@ -1328,7 +1337,7 @@
                 string v;
                 m_options.TryGetValue("blockhash-lookup-memory", out v);
                 if (string.IsNullOrEmpty(v))
-                    v = DEFAULT_BLOCK_HASH_LOOKUP_SIZE;
+                    v = OldMemoryDefaults ? DEFAULT_BLOCK_HASH_LOOKUP_SIZE : "0";

                 return Library.Utility.Sizeparser.ParseSize(v, "mb");
             }
@@ -1344,7 +1353,7 @@
                 string v;
                 m_options.TryGetValue("filehash-lookup-memory", out v);
                 if (string.IsNullOrEmpty(v))
-                    v = DEFAULT_FILE_HASH_LOOKUP_SIZE;
+                    v = OldMemoryDefaults ? DEFAULT_FILE_HASH_LOOKUP_SIZE : "0";

                 return Library.Utility.Sizeparser.ParseSize(v, "mb");
             }
@@ -1360,7 +1369,7 @@
                 string v;
                 m_options.TryGetValue("metadatahash-lookup-memory", out v);
                 if (string.IsNullOrEmpty(v))
-                    v = DEFAULT_METADATA_HASH_LOOKUP_SIZE;
+                    v = OldMemoryDefaults ? DEFAULT_METADATA_HASH_LOOKUP_SIZE : "0";

                 return Library.Utility.Sizeparser.ParseSize(v, "mb");
             }
@@ -1373,7 +1382,15 @@
         {
             get
             {
-                return !Library.Utility.Utility.ParseBoolOption(m_options, "disable-filepath-cache");
+
+                if (OldMemoryDefaults)
+                    return !Library.Utility.Utility.ParseBoolOption(m_options, "disable-filepath-cache");
+                else
+                {
+                    string s;
+                    m_options.TryGetValue("disable-filepath-cache", out s);
+                    return !Library.Utility.Utility.ParseBool(s, true);
+                }
             }
         }


Change private properties to variables

Change private properties to variables

--- src/FluentMigrator.Runner/Initialization/NetConfigManager.cs
+++ src/FluentMigrator.Runner/Initialization/NetConfigManager.cs
@@ -12,44 +12,41 @@
     /// </summary>
     public class NetConfigManager
     {
+        private string configPath;
+        private string target;
+        private string connection;
+        private string configFile;
+        private bool notUsingConfig;

         public NetConfigManager(string connection, string configPath, string target, string database)
         {
-            ConfigPath = configPath;
-            Database = database;
-            NotUsingConfig = true;
+            this.configPath = configPath;
+            this.Database = database;
+            this.notUsingConfig = true;
         }
-
-        private string ConfigPath { get; private set; }
-        private string Target { get; private set; }
-        private string Connection { get; private set; }
-        private string ConnectionString { get; private set; }
-        private string Database { get; private set; }
-        private string ConfigFile { get; private set; }
-        private bool NotUsingConfig { get; private set; }

         public void LoadConnectionString()
         {
-            if (!String.IsNullOrEmpty(Connection))
+            if (!String.IsNullOrEmpty(connection))
             {
-                if (NotUsingConfig)
-                    LoadFromFile(ConfigPath);
+                if (notUsingConfig)
+                    LoadFromFile(configPath);

-                if (NotUsingConfig)
+                if (notUsingConfig)
                 {
-                    string defaultConfigFile = Environment.CurrentDirectory + Target;
+                    string defaultConfigFile = Environment.CurrentDirectory + target;

                     LoadFromFile(defaultConfigFile);
                 }

-                if (NotUsingConfig)
+                if (notUsingConfig)
                     LoadFromMachineConfig(false);

-                if (NotUsingConfig)
+                if (notUsingConfig)
                 {
-                    if (NotUsingConfig && !string.IsNullOrEmpty(Connection))
+                    if (notUsingConfig && !string.IsNullOrEmpty(connection))
                     {
-                        ConnectionString = Connection;
+                        ConnectionString = connection;
                     }
                 }
             }
@@ -67,13 +64,13 @@
                     "Database Type is required \"/db [db type]\". Available db types is [sqlserver], [sqlite]");
             }

-            if (NotUsingConfig)
+            if (notUsingConfig)
             {
                 Console.WriteLine("Using Database {0} and Connection String {1}", Database, ConnectionString);
             }
             else
             {
-                Console.WriteLine("Using Connection {0} from Configuration file {1}", Connection, ConfigFile);
+                Console.WriteLine("Using Connection {0} from Configuration file {1}", connection, configFile);
             }
         }

@@ -87,7 +84,7 @@
                     machineConnectionString = ConfigurationManager.ConnectionStrings[0];
                 else
                     machineConnectionString = (from cnn in ConfigurationManager.ConnectionStrings.OfType<ConnectionStringSettings>()
-                                               where cnn.Name == Connection
+                                               where cnn.Name == connection
                                                select cnn).FirstOrDefault();

                 ReadConnectionString(machineConnectionString, "machine.config");
@@ -108,13 +105,13 @@

                 if (connections != null && connections.Count > 0)
                 {
-                    if (string.IsNullOrEmpty(Connection))
+                    if (string.IsNullOrEmpty(connection))
                     {
                         ReadConnectionString(connections[Environment.MachineName], config.FilePath);
                     }
                     else
                     {
-                        ReadConnectionString(connections[Connection], config.FilePath);
+                        ReadConnectionString(connections[connection], config.FilePath);
                     }
                 }
             }
@@ -129,10 +126,10 @@
                 if (factory != null)
                 {
                     Database = factory.Name;
-                    Connection = connection.Name;
+                    connection = connection.Name;
                     ConnectionString = connection.ConnectionString;
-                    ConfigFile = configurationFile;
-                    NotUsingConfig = false;
+                    configFile = configurationFile;
+                    notUsingConfig = false;
                 }
             }
             else
@@ -141,5 +138,8 @@
             }
         }

+        public string ConnectionString { get; private set; }
+        public string Database { get; private set; }
+
     }
 }


Move ordering if types around

Move ordering if types around

--- src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
+++ src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
@@ -7,10 +7,10 @@

         public string DisplayName { get; set; }

-        public RouteData RouteData { get; set; }
-
         public string ActionName { get; set; }

         public string ControllerName { get; set; }
+
+        public RouteData RouteData { get; set; }
     }
 }


fixing reduntant code

fixing reduntant code

--- src/Grace/DependencyInjection/Impl/TypesThatConfiguration.cs
+++ src/Grace/DependencyInjection/Impl/TypesThatConfiguration.cs
@@ -118,7 +118,7 @@
                     {
                         if (typeFilter(implementedInterface))
                         {
-                            return true == notValue;
+                            return notValue;
                         }
                     }

@@ -264,7 +264,7 @@

                 newFilter = t => t.GetTypeInfo().GetCustomAttributes(true).
                                                  Where(a => ReflectionService.CheckTypeIsBasedOnAnotherType(a.GetType(), attributeType)).
-                                                 Any(a => attributeFilter((Attribute)a)) == notValue;
+                                                 Any(a => localFunc(a) == notValue);
             }
             else
             {


Dont display "Remember consent" if offline_access

--- src/IdentityBase.Public/Actions/Consent/ConsentController.cs
+++ src/IdentityBase.Public/Actions/Consent/ConsentController.cs
@@ -152,9 +152,11 @@
         }

         private ConsentViewModel CreateConsentViewModel(
-            ConsentInputModel model, string returnUrl,
+            ConsentInputModel model,
+            string returnUrl,
             AuthorizationRequest request,
-            Client client, Resources resources)
+            Client client,
+            Resources resources)
         {
             ConsentViewModel vm = new ConsentViewModel()
             {
@@ -186,11 +188,14 @@
             {
                 vm.ResourceScopes = vm.ResourceScopes
                     .Union(new ScopeViewModel[] {
-                        GetOfflineAccessScope(vm.ScopesConsented.Contains(
+                        this.GetOfflineAccessScope(vm.ScopesConsented.Contains(
                             IdentityServerConstants.StandardScopes.OfflineAccess) ||
                             model == null
                         )
                     });
+
+                // You must prompt for consent every time offline_access is requested.
+                vm.AllowRememberConsent = false;
             }

             return vm;


Initial support for tracking project items excluded by condition.

--- src/LanguageServer.Engine/MSBuild/PositionalMSBuildLookup.cs
+++ src/LanguageServer.Engine/MSBuild/PositionalMSBuildLookup.cs
@@ -112,32 +112,27 @@
                 }
             }

-            // AF: Consider using:
-            //
-            // var itemsByElement =
-            //     _project.Items.Where(
-            //         item => item.Xml != null && String.Equals(item.Xml.Location.File, projectFilePath, StringComparison.OrdinalIgnoreCase)
-            //     )
-            //     .GroupBy(item => item.Xml);
-
-            var itemsByElement = new Dictionary<ProjectItemElement, List<ProjectItem>>();
+            HashSet<ProjectItem> itemsExcludedByCondition = new HashSet<ProjectItem>(_project.ItemsIgnoringCondition);
+            itemsExcludedByCondition.ExceptWith(_project.Items);
+
+            var itemsByXml = new Dictionary<ProjectItemElement, List<ProjectItem>>();
             foreach (ProjectItem item in _project.Items)
             {
                 if (item.Xml == null || !String.Equals(item.Xml.Location.File, projectFilePath, StringComparison.OrdinalIgnoreCase))
                     continue; // Not declared in main project file.

-                List<ProjectItem> itemsFromElement;
-                if (!itemsByElement.TryGetValue(item.Xml, out itemsFromElement))
-                {
-                    itemsFromElement = new List<ProjectItem>();
-                    itemsByElement.Add(item.Xml, itemsFromElement);
-                }
-
-                itemsFromElement.Add(item);
-            }
-            foreach (ProjectItemElement item in itemsByElement.Keys)
-            {
-                Position itemStart = item.Location.ToNative();
+                List<ProjectItem> itemsFromXml;
+                if (!itemsByXml.TryGetValue(item.Xml, out itemsFromXml))
+                {
+                    itemsFromXml = new List<ProjectItem>();
+                    itemsByXml.Add(item.Xml, itemsFromXml);
+                }
+
+                itemsFromXml.Add(item);
+            }
+            foreach (ProjectItemElement itemXml in itemsByXml.Keys)
+            {
+                Position itemStart = itemXml.Location.ToNative();

                 SyntaxNode xmlAtPosition = projectXml.FindNode(itemStart, xmlPositions);
                 if (xmlAtPosition == null)
@@ -149,9 +144,13 @@

                 Range itemRange = itemElement.Span.ToNative(xmlPositions);

+                List<ProjectItem> itemsFromXml;
+                if (!itemsByXml.TryGetValue(itemXml, out itemsFromXml))
+                    continue; // TODO: Implement MSBuildUnevaluatedItemGroup representing items excluded by condition.
+
                 _objectRanges.Add(itemRange);
                 _objectsByStartPosition.Add(itemRange.Start,
-                    new MSBuildItemGroup(itemsByElement[item], item, itemElement, itemRange)
+                    new MSBuildItemGroup(itemsByXml[itemXml], itemXml, itemElement, itemRange)
                 );
             }


Capture LoggedTest.Initialize exception and re-trow in Dispose (#770)

--- src/Logging/Logging.Testing/src/LoggedTest/LoggedTestBase.cs
+++ src/Logging/Logging.Testing/src/LoggedTest/LoggedTestBase.cs
@@ -5,6 +5,7 @@
 using System.Linq;
 using System.Reflection;
 using System.Runtime.CompilerServices;
+using System.Runtime.ExceptionServices;
 using Microsoft.Extensions.DependencyInjection;
 using Xunit.Abstractions;

@@ -12,6 +13,8 @@
 {
     public class LoggedTestBase : ILoggedTest
     {
+        private ExceptionDispatchInfo _initializationException;
+
         private IDisposable _testLog;

         // Obsolete but keeping for back compat
@@ -48,37 +51,48 @@

         public virtual void Initialize(MethodInfo methodInfo, object[] testMethodArguments, ITestOutputHelper testOutputHelper)
         {
-            TestOutputHelper = testOutputHelper;
+            try
+            {
+                TestOutputHelper = testOutputHelper;

-            var classType = GetType();
-            var logLevelAttribute = methodInfo.GetCustomAttribute<LogLevelAttribute>()
-                ?? methodInfo.DeclaringType.GetCustomAttribute<LogLevelAttribute>()
-                ?? methodInfo.DeclaringType.Assembly.GetCustomAttribute<LogLevelAttribute>();
-            var testName = testMethodArguments.Aggregate(methodInfo.Name, (a, b) => $"{a}-{(b ?? "null")}");
+                var classType = GetType();
+                var logLevelAttribute = methodInfo.GetCustomAttribute<LogLevelAttribute>()
+                                        ?? methodInfo.DeclaringType.GetCustomAttribute<LogLevelAttribute>()
+                                        ?? methodInfo.DeclaringType.Assembly.GetCustomAttribute<LogLevelAttribute>();
+                var testName = testMethodArguments.Aggregate(methodInfo.Name, (a, b) => $"{a}-{(b ?? "null")}");

-            var useShortClassName = methodInfo.DeclaringType.GetCustomAttribute<ShortClassNameAttribute>()
-                ?? methodInfo.DeclaringType.Assembly.GetCustomAttribute<ShortClassNameAttribute>();
-            // internal for testing
-            ResolvedTestClassName = useShortClassName == null ? classType.FullName : classType.Name;
+                var useShortClassName = methodInfo.DeclaringType.GetCustomAttribute<ShortClassNameAttribute>()
+                                        ?? methodInfo.DeclaringType.Assembly.GetCustomAttribute<ShortClassNameAttribute>();
+                // internal for testing
+                ResolvedTestClassName = useShortClassName == null ? classType.FullName : classType.Name;

-            _testLog = AssemblyTestLog
-                .ForAssembly(classType.GetTypeInfo().Assembly)
-                .StartTestLog(
-                    TestOutputHelper,
-                    ResolvedTestClassName,
-                    out var loggerFactory,
-                    logLevelAttribute?.LogLevel ?? LogLevel.Debug,
-                    out var resolvedTestName,
-                    out var logOutputDirectory,
-                    testName);
+                _testLog = AssemblyTestLog
+                    .ForAssembly(classType.GetTypeInfo().Assembly)
+                    .StartTestLog(
+                        TestOutputHelper,
+                        ResolvedTestClassName,
+                        out var loggerFactory,
+                        logLevelAttribute?.LogLevel ?? LogLevel.Debug,
+                        out var resolvedTestName,
+                        out var logOutputDirectory,
+                        testName);

-            ResolvedLogOutputDirectory = logOutputDirectory;
-            ResolvedTestMethodName = resolvedTestName;
+                ResolvedLogOutputDirectory = logOutputDirectory;
+                ResolvedTestMethodName = resolvedTestName;

-            LoggerFactory = loggerFactory;
-            Logger = loggerFactory.CreateLogger(classType);
+                LoggerFactory = loggerFactory;
+                Logger = loggerFactory.CreateLogger(classType);
+            }
+            catch (Exception e)
+            {
+                _initializationException = ExceptionDispatchInfo.Capture(e);
+            }
         }

-        public virtual void Dispose() => _testLog.Dispose();
+        public virtual void Dispose()
+        {
+            _initializationException?.Throw();
+            _testLog.Dispose();
+        }
     }
 }


default landing view

default landing view

--- Eventizer/Views/Home/Index.cshtml
+++ Eventizer/Views/Home/Index.cshtml
@@ -4,16 +4,21 @@

-

+

+
Eventizer

+

-

+

                     Geez. Wrong Email/Password.

-

+

                     Redirecting you to your dashboard.

-

+

                     Something went wrong. Try again later.
+

+

+                    Yo. You've been logged out.

             <form role="form" id="login-form">
@@ -27,15 +32,31 @@
                     <input type="password" class="form-control" name="password" id="password" placeholder="Password">

-                <button type="submit" class="btn btn-primary">Submit</button>
-                Register
+                <button type="submit" class="btn btn-primary btn-block">Submit</button>
             </form>


prevent VS from crashing if VS got shutdown while build error reporting is in progress.

--- src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs
+++ src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs
@@ -91,7 +91,10 @@
                 var coordinator = default(WorkCoordinator);
                 if (!_documentWorkCoordinatorMap.TryGetValue(workspace, out coordinator))
                 {
-                    throw new ArgumentException("workspace");
+                    // this can happen if solution crawler is already unregistered from workspace.
+                    // one of those example will be VS shutting down so roslyn package is disposed but there is a pending
+                    // async operation.
+                    return;
                 }

                 // no specific projects or documents provided


null id check might introduce argumentnull exception (#633)

when event type isn't defined in a namespace, resolving its parent might throw null reference exception

--- src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/YamlModelGenerator.cs
+++ src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/YamlModelGenerator.cs
@@ -85,7 +85,7 @@
             var id = SpecIdHelper.GetSpecId(symbol, typeGenericParameters, methodGenericParameters);
             if (string.IsNullOrEmpty(id))
             {
-                throw new InvalidDataException($"Fail to parse id for symbol {symbol.MetadataName} in namespace {symbol.ContainingNamespace.MetadataName}.");
+                throw new InvalidDataException($"Fail to parse id for symbol {symbol.MetadataName} in namespace {symbol.ContainingSymbol?.MetadataName}.");
             }
             ReferenceItem reference = new ReferenceItem();
             reference.Parts = new SortedList<SyntaxLanguage, List<LinkItem>>();
@@ -137,6 +137,10 @@
                         {
                             parentSymbol = parentSymbol.ContainingSymbol;
                         } while (parentSymbol.Kind == symbol.Kind); // the parent of nested type is namespace.
+                        if (IsGlobalNamespace(parentSymbol))
+                        {
+                            return null;
+                        }
                         return AddSpecReference(parentSymbol, typeGenericParameters, methodGenericParameters, references, adapter); ;
                     }
                 default:
@@ -144,6 +148,11 @@
             }
         }

+        private static bool IsGlobalNamespace(ISymbol symbol)
+        {
+            return (symbol as INamespaceSymbol)?.IsGlobalNamespace == true;
+        }
+
         internal abstract void GenerateReferenceInternal(ISymbol symbol, ReferenceItem reference, SymbolVisitorAdapter adapter);

         internal abstract void GenerateSyntax(MemberType type, ISymbol symbol, SyntaxDetail syntax, SymbolVisitorAdapter adapter);


Disable this rule by now.

Disable this rule by now.

--- src/Microsoft.NetCore.Analyzers/Core/Security/UseAutoValidateAntiforgeryToken.cs
+++ src/Microsoft.NetCore.Analyzers/Core/Security/UseAutoValidateAntiforgeryToken.cs
@@ -32,13 +32,16 @@
             SystemSecurityCryptographyResources.ResourceManager,
             typeof(SystemSecurityCryptographyResources));

+        private static readonly Regex s_AntiForgeryAttributeRegex = new Regex(@"[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute", RegexOptions.Compiled);
+        private static readonly Regex s_AntiForgeryRegex = new Regex(@"[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*", RegexOptions.Compiled);
+
         internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(
                 DiagnosticId,
                 s_Title,
                 s_Message,
                 DiagnosticCategory.Security,
                 DiagnosticHelpers.DefaultDiagnosticSeverity,
-                isEnabledByDefault: DiagnosticHelpers.EnabledByDefaultIfNotBuildingVSIX,
+                isEnabledByDefault: false,
                 description: s_Description,
                 helpLinkUri: null,
                 customTags: WellKnownDiagnosticTags.Telemetry);
@@ -126,7 +129,7 @@
                         foreach (var potentialAntiForgeryFilter in potentialAntiForgeryFilters)
                         {
                             if (potentialAntiForgeryFilter.AllInterfaces.Contains(iFilterMetadataTypeSymbol) &&
-                                IsValidateAntiForgery(potentialAntiForgeryFilter.Name))
+                                s_AntiForgeryRegex.IsMatch(potentialAntiForgeryFilter.Name))
                             {
                                 hasGlobalAntiForgeryFilter = true;

@@ -153,7 +156,7 @@
                     var controllerTypeSymbol = (INamedTypeSymbol)symbolAnalysisContext.Symbol;

                     // The controller class is protected by a validate anti forgery token attribute
-                    if (controllerTypeSymbol.GetAttributes().Any(s => IsValidateAntiForgeryAttribute(s.AttributeClass.Name)))
+                    if (controllerTypeSymbol.GetAttributes().Any(s => s_AntiForgeryAttributeRegex.IsMatch(s.AttributeClass.Name)))
                     {
                         usingValidateAntiForgeryAttribute = true;

@@ -164,7 +167,7 @@
                     {

                         // The method is protected by a validate anti forgery token attribute
-                        if (actionMethodSymbol.GetAttributes().Any(s => IsValidateAntiForgeryAttribute(s.AttributeClass.Name)))
+                        if (actionMethodSymbol.GetAttributes().Any(s => s_AntiForgeryAttributeRegex.IsMatch(s.AttributeClass.Name)))
                         {
                             usingValidateAntiForgeryAttribute = true;

@@ -269,19 +272,5 @@
                 }
             });
         }
-
-        public static bool IsValidateAntiForgeryAttribute(string attributeName)
-        {
-            var pattern = @"[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute";
-
-            return Regex.Match(attributeName, pattern).Success;
-        }
-
-        public static bool IsValidateAntiForgery(string attributeName)
-        {
-            var pattern = @"[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*";
-
-            return Regex.Match(attributeName, pattern).Success;
-        }
     }
 }


PAE-24: returned some status for disabling localized content response.

--- src/Modules/Settings/Dnn.PersonaBar.SiteSettings/Services/LanguagesController.cs
+++ src/Modules/Settings/Dnn.PersonaBar.SiteSettings/Services/LanguagesController.cs
@@ -358,7 +358,7 @@
                 PortalController.UpdatePortalSetting(PortalId, "ContentLocalizationEnabled", "False");
                 DataCache.ClearPortalCache(PortalId, true);

-                return Request.CreateResponse(HttpStatusCode.OK);
+                return Request.CreateResponse(HttpStatusCode.OK, new { Success = true });
             }
             catch (Exception ex)
             {


Fix spelling and whitespace

Fix spelling and whitespace

--- src/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs
+++ src/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs
@@ -474,14 +474,14 @@
                         uint langid = GetVarEntry(memIntPtr);
                         if (!versionInfo.GetVersionInfoForCodePage(memIntPtr, ConvertTo8DigitHex(langid)))
                         {
-                            // Some dlls might not contain correct codepage information. In this case we will fail during lookup.
-                            // Explorer will take a few shots in dark by trying following ID:
+                            // Some dlls might not contain correct codepage information. In this case we will fail during lookup.
+                            // Explorer will take a few shots in dark by trying following lang-codepages:
                             //
                             // 040904B0 // US English + CP_UNICODE
                             // 040904E4 // US English + CP_USASCII
                             // 04090000 // US English + unknown codepage
-                            // Explorer also randomly guess 041D04B0=Swedish+CP_UNICODE and 040704B0=German+CP_UNICODE) sometimes.
-                            // We will try to simulate similiar behavior here.
+                            // Explorer also randomly guesses 041D04B0=Swedish+CP_UNICODE and 040704B0=German+CP_UNICODE sometimes.
+                            // We will try to simulate similar behavior here.
                             uint[] ids = new uint[] { 0x040904B0, 0x040904E4, 0x04090000 };
                             foreach (uint id in ids)
                             {


Fix compilation failure in Utf16Utility

Fix compilation failure in Utf16Utility

--- src/System.Private.CoreLib/shared/System/Text/Unicode/Utf16Utility.Validation.cs
+++ src/System.Private.CoreLib/shared/System/Text/Unicode/Utf16Utility.Validation.cs
@@ -226,7 +226,7 @@
                             else
                             {
                                 // Take the hit of the 64-bit extension now.
-                                tempUtf8CodeUnitCountAdjustment -= 2 * surrogatePairsCountNuint;
+                                tempUtf8CodeUnitCountAdjustment -= 2 * (uint)surrogatePairsCountNuint;
                             }
                         }


Fix SQLite migration defaulting RequireDMApiValidation to false

--- src/Tgstation.Server.Host/Database/Migrations/20200705163700_SLAllowNullDMApi.cs
+++ src/Tgstation.Server.Host/Database/Migrations/20200705163700_SLAllowNullDMApi.cs
@@ -19,7 +19,7 @@
 				name: "RequireDMApiValidation",
 				table: "DreamMakerSettings",
 				nullable: false,
-				defaultValue: false);
+				defaultValue: true);

 			migrationBuilder.RenameTable(
 				name: "CompileJobs",


Include error code for downstream exception handling

--- src/MySqlConnector/MySql.Data.MySqlClient/MySqlConnection.cs
+++ src/MySqlConnector/MySql.Data.MySqlClient/MySqlConnection.cs
@@ -528,7 +528,7 @@
 			}
 			catch (OperationCanceledException ex) when (timeoutSource?.IsCancellationRequested ?? false)
 			{
-				throw new MySqlException("Connect Timeout expired.", ex);
+				throw new MySqlException((int) MySqlErrorCode.UnableToConnectToHost, null, "Connect Timeout expired.", ex);
 			}
 			finally
 			{


:art: clean up unnecessary console logging from test generator

--- src/NExpect.Tests/ObjectEquality/MultipleIComparableTypes.cs
+++ src/NExpect.Tests/ObjectEquality/MultipleIComparableTypes.cs
@@ -162,13 +162,8 @@
                     {
                         return mi.Invoke(null, new[] { testCase.actual });
                     }
-                    catch (Exception ex)
-                    {
-                        if (mi.GetParameters()[0].ParameterType == typeof(long))
-                        {
-                            Console.WriteLine(ex.Message);
-                        }
-
+                    catch (Exception)
+                    {
                         return null;
                     }
                 })


Fix HandleQueuedPackageEditsJob to use ExecuteTask

Because some idiot made it so you have to execute tasks this way in order for logging to work. Who was that? Oh... right... me...

--- src/NuGetGallery.Backend/Jobs/HandleQueuedPackageEditsJob.cs
+++ src/NuGetGallery.Backend/Jobs/HandleQueuedPackageEditsJob.cs
@@ -18,12 +18,12 @@

         public override void RunOnce()
         {
-            new HandleQueuedPackageEditsTask
+            ExecuteTask(new HandleQueuedPackageEditsTask
             {
                 ConnectionString = new SqlConnectionStringBuilder(Settings.MainConnectionString),
                 StorageAccount = Settings.MainStorage,
                 WhatIf = Settings.WhatIf
-            }.Execute();
+            });
         }
     }
 }


Fix 'IsLowVoilence' Typo

Fix 'IsLowVoilence' Typo

--- Facepunch.Steamworks/SteamApps.cs
+++ Facepunch.Steamworks/SteamApps.cs
@@ -53,7 +53,7 @@
 		/// Checks if the license owned by the user provides low violence depots.
 		/// Low violence depots are useful for copies sold in countries that have content restrictions
 		/// </summary>
-		public static bool IsLowVoilence => Internal.BIsLowViolence();
+		public static bool IsLowViolence => Internal.BIsLowViolence();

 		/// <summary>
 		/// Checks whether the current App ID license is for Cyber Cafes.


fixed token positions

fixed token positions

--- FlameWars/FlameWars/Core/World.cs
+++ FlameWars/FlameWars/Core/World.cs
@@ -1,14 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Collections.Generic;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;

 namespace FlameWars
 {
-    class World
+	class World
     {
 		// ============================================================================
 		// ================================ Variables =================================
@@ -213,39 +209,46 @@
 				// Do things to all players here.
 				// Set the draw position for the player token.
 				Path playerLocation = board.GetPath(players[index].BoardPosition);
-				Vector2 pathLocation = playerLocation.Center; // Center vector position of the board.
+				Rectangle pathLocation = new Rectangle(playerLocation.Bounds.X, playerLocation.Bounds.Y, playerLocation.Bounds.Width, playerLocation.Bounds.Height);

 				// Find the origin of the player.
-				float tokenScale = 0.24f; // This will be scale of the token.
+				float tokenScale = 0.25f; // This will be scale of the token.
+				float divisor = 1f / tokenScale; // This is the divisor.

 				// Find the centered corners of the path.
-				int playerHeight = (int)(players[index].Token.Height * tokenScale);
-				int playerWidth = (int)(players[index].Token.Width * tokenScale);
-
+				int playerHeight = (int)(players[index].Token.Height);
+				int playerWidth = (int)(players[index].Token.Width);
+
+				playerHeight = (int)(tokenScale * playerHeight);
+				playerWidth = (int)(tokenScale * playerWidth);
+
+				int playerQuarterOffsetX = (int)(playerWidth / divisor);
+				int playerQuarterOffsetY = (int)(playerHeight / divisor);
+				int playerOffsetX = (int)(playerWidth / 2f);
+				int playerOffsetY = (int)(playerHeight / 2f);
+
+				int margin = (int)(75 * tokenScale);
+
+				Vector2 topLeft = new Vector2(pathLocation.X - playerQuarterOffsetX, pathLocation.Y - playerQuarterOffsetY);
 				Vector2 playerPosition = new Vector2(0, 0);
-				float divisor = 1f;

 				switch (index)
 				{
 					case 0:
 						// Player One gets TOP LEFT.
-						Vector2 topLeft = new Vector2(pathLocation.X, pathLocation.Y);
-						playerPosition = new Vector2(topLeft.X + (playerWidth / divisor), topLeft.Y - (playerHeight / divisor));
+						playerPosition = new Vector2(topLeft.X + margin, topLeft.Y + margin);
 						break;
 					case 1:
 						// Player Two gets TOP RIGHT.
-						Vector2 topRight = new Vector2(pathLocation.X + playerLocation.Bounds.Width, pathLocation.Y);
-						playerPosition = new Vector2(topRight.X + (playerWidth / divisor), topRight.Y - (playerHeight / divisor));
+						playerPosition = new Vector2(topLeft.X + (pathLocation.Width - playerOffsetX) - margin, topLeft.Y + margin);
 						break;
 					case 2:
 						// Player Three gets BOTTOM LEFT.
-						Vector2 bottomLeft = new Vector2(pathLocation.X, pathLocation.Y + playerLocation.Bounds.Height);
-						playerPosition = new Vector2(bottomLeft.X + (playerWidth / divisor), bottomLeft.Y - (playerHeight / divisor));
+						playerPosition = new Vector2(topLeft.X + margin, topLeft.Y + (pathLocation.Height - playerOffsetY) - margin);
 						break;
 					case 3:
 						// Player Four gets BOTTOM RIGHT.
-						Vector2 bottomRight = new Vector2(pathLocation.X + playerLocation.Bounds.Width, pathLocation.Y + playerLocation.Bounds.Height);
-						playerPosition = new Vector2(bottomRight.X + (playerWidth / divisor), bottomRight.Y - (playerHeight / divisor));
+						playerPosition = new Vector2(topLeft.X + (pathLocation.Width - playerOffsetX) - margin, topLeft.Y + (pathLocation.Height - playerOffsetY) - margin);
 						break;
 				}


Fix to prevent GeoViewTapped from firing twice

Hook event in ViewDidLoad (which only fires once!).

--- src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.cs
+++ src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/IdentifyGraphics/IdentifyGraphics.cs
@@ -36,9 +36,9 @@
             Title = "Identify graphics";
         }

-        public override void ViewDidLayoutSubviews()
+        public override void ViewDidLoad()
         {
-            base.ViewDidLayoutSubviews();
+            base.ViewDidLoad();

             // Create the UI, setup the control references and execute initialization
             CreateLayout();
@@ -125,4 +125,4 @@
             View.AddSubviews(_myMapView);
         }
     }
-}+}


Update method signature for TypeRowSet();

--- Framework/Application/GridData.cs
+++ Framework/Application/GridData.cs
@@ -143,10 +143,10 @@
             return result;
         }

-        private void TypeRowSet(GridName gridName, Type typeRow)
-        {
-            typeRowList[gridName] = typeRow;
-            if (typeRow == null)
+        private void TypeRowSet(GridNameTypeRow gridName)
+        {
+            typeRowList[gridName] = gridName.TypeRow;
+            if (gridName.TypeRow == null)
             {
                 typeRowList.Remove(gridName);
             }
@@ -479,7 +479,7 @@
         /// </summary>
         internal void LoadDatabase(GridNameTypeRow gridName, List<Filter> filterList, string fieldNameOrderBy, bool isOrderByDesc)
         {
-            TypeRowSet(gridName, gridName.TypeRow);
+            TypeRowSet(gridName);
             Row rowTable = UtilDataAccessLayer.RowCreate(gridName.TypeRow);
             IQueryable query = rowTable.Where(App, gridName);
             List<Row> rowList = new List<Row>();
@@ -588,7 +588,7 @@
         {
             if (rowList == null)
             {
-                TypeRowSet(gridName, gridName.TypeRow);
+                TypeRowSet(gridName);
                 cellList.Remove(gridName);
                 this.rowList.Remove(gridName);
             }
@@ -606,7 +606,7 @@
                 }
                 cellList.Remove(gridName); // Clear user modified text and attached errors.
                 this.rowList[gridName] = new Dictionary<Index, GridRowInternal>(); // Clear data
-                TypeRowSet(gridName, gridName.TypeRow);
+                TypeRowSet(gridName);
                 //
                 RowFilterAdd(gridName);
                 for (int index = 0; index < rowList.Count; index++)
@@ -897,7 +897,7 @@
             //
             string typeRowString = gridDataJson.GridQueryList[gridName.Value].TypeRow;
             Type typeRow = UtilDataAccessLayer.TypeRowFromName(typeRowString, UtilApplication.TypeRowInAssembly(App));
-            TypeRowSet(gridName, typeRow);
+            TypeRowSet(new GridNameTypeRow(typeRow, gridName));
             //
             foreach (GridRow row in gridDataJson.RowList[gridName.Value])
             {