launching node using tools option

launching node using tools option


Made ProblemGroup DeletableEntity Closes https://github.com/SoftUni-Internal/suls-issues/issues/3778


Propagate logger's ErrorHandler when reloading


Fix nullreference exception when generating routes for controller without RoutAttribute by replacing routtemplate tokens in constructor of Controller model


Moved the call to ProjectModel.Walk to make sure all nodes are parsed


Use linq

Use linq


MonthPickerViewModel refactored

MonthPickerViewModel refactored


Renamed SQL "Execute" methods internally to better explain intent.

--- src/proj/EventStore.Persistence.SqlPersistence/SqlPersistenceEngine.cs
+++ src/proj/EventStore.Persistence.SqlPersistence/SqlPersistenceEngine.cs
@@ -33,13 +33,13 @@

 		public virtual void Initialize()
 		{
-			this.Execute(Guid.Empty, statement =>
+			this.ExecuteCommand(Guid.Empty, statement =>
 				statement.ExecuteWithSuppression(this.dialect.InitializeStorage));
 		}

 		public virtual IEnumerable<Commit> GetFrom(Guid streamId, int minRevision, int maxRevision)
 		{
-			return this.Execute(streamId, query =>
+			return this.ExecuteQuery(streamId, query =>
 			{
 				query.AddParameter(this.dialect.StreamId, streamId);
 				query.AddParameter(this.dialect.StreamRevision, minRevision);
@@ -49,7 +49,7 @@
 		}
 		public virtual IEnumerable<Commit> GetFrom(DateTime start)
 		{
-			return this.Execute(Guid.Empty, query =>
+			return this.ExecuteQuery(Guid.Empty, query =>
 			{
 				var statement = this.dialect.GetCommitsFromInstant;
 				query.AddParameter(this.dialect.CommitStamp, start);
@@ -59,7 +59,7 @@

 		public virtual void Commit(Commit attempt)
 		{
-			this.Execute(attempt.StreamId, cmd =>
+			this.ExecuteCommand(attempt.StreamId, cmd =>
 			{
 				cmd.AddParameter(this.dialect.StreamId, attempt.StreamId);
 				cmd.AddParameter(this.dialect.StreamRevision, attempt.StreamRevision);
@@ -81,12 +81,12 @@

 		public virtual IEnumerable<Commit> GetUndispatchedCommits()
 		{
-			return this.Execute(Guid.Empty, query =>
+			return this.ExecuteQuery(Guid.Empty, query =>
 				query.ExecuteWithQuery(this.dialect.GetUndispatchedCommits, x => x.GetCommit(this.serializer)));
 		}
 		public virtual void MarkCommitAsDispatched(Commit commit)
 		{
-			this.Execute(commit.StreamId, cmd =>
+			this.ExecuteCommand(commit.StreamId, cmd =>
 			{
 				cmd.AddParameter(this.dialect.StreamId, commit.StreamId);
 				cmd.AddParameter(this.dialect.CommitSequence, commit.CommitSequence);
@@ -96,7 +96,7 @@

 		public virtual IEnumerable<StreamHead> GetStreamsToSnapshot(int maxThreshold)
 		{
-			return this.Execute(Guid.Empty, query =>
+			return this.ExecuteQuery(Guid.Empty, query =>
 			{
 				var statement = this.dialect.GetStreamsRequiringSnaphots;
 				query.AddParameter(this.dialect.Threshold, maxThreshold);
@@ -105,17 +105,18 @@
 		}
 		public Snapshot GetSnapshot(Guid streamId, int maxRevision)
 		{
-			return this.Execute(streamId, query =>
+			return this.ExecuteQuery(streamId, query =>
 			{
+				var queryText = this.dialect.GetSnapshot;
 				query.AddParameter(this.dialect.StreamId, streamId);
 				query.AddParameter(this.dialect.StreamRevision, maxRevision);
-				return query.ExecuteWithQuery(this.dialect.GetSnapshot, x => x.GetSnapshot(this.serializer));
-			}).FirstOrDefault();
+				return query.ExecuteWithQuery(queryText, x => x.GetSnapshot(this.serializer)).FirstOrDefault();
+			});
 		}
 		public bool AddSnapshot(Snapshot snapshot)
 		{
 			var rowsAffected = 0;
-			this.Execute(snapshot.StreamId, cmd =>
+			this.ExecuteCommand(snapshot.StreamId, cmd =>
 			{
 				cmd.AddParameter(this.dialect.StreamId, snapshot.StreamId);
 				cmd.AddParameter(this.dialect.StreamRevision, snapshot.StreamRevision);
@@ -125,7 +126,7 @@
 			return rowsAffected > 0;
 		}

-		protected virtual IEnumerable<T> Execute<T>(Guid streamId, Func<IDbStatement, IEnumerable<T>> query)
+		protected virtual T ExecuteQuery<T>(Guid streamId, Func<IDbStatement, T> query)
 		{
 			var scope = new TransactionScope(TransactionScopeOption.Suppress);
 			IDbConnection connection = null;
@@ -152,7 +153,7 @@
 				throw new StorageException(e.Message, e);
 			}
 		}
-		protected virtual void Execute(Guid streamId, Action<IDbStatement> command)
+		protected virtual void ExecuteCommand(Guid streamId, Action<IDbStatement> command)
 		{
 			using (var scope = new TransactionScope(TransactionScopeOption.Suppress))
 			using (var connection = this.factory.OpenForWriting(streamId))


Add missing tooltip

Add missing tooltip

--- AllReadyApp/Web-App/AllReady/Areas/Admin/Views/Campaign/Details.cshtml
+++ AllReadyApp/Web-App/AllReady/Areas/Admin/Views/Campaign/Details.cshtml
@@ -28,7 +28,7 @@
                 @Model.Name

-
+
             @if (!Model.Published)
             {


Add summary tags

Add summary tags

--- Assets/MRTK/Core/Inspectors/Profiles/MixedRealityProfileCloneWindow.cs
+++ Assets/MRTK/Core/Inspectors/Profiles/MixedRealityProfileCloneWindow.cs
@@ -14,10 +14,25 @@
     {
         public enum ProfileCloneBehavior
         {
-            UseExisting,        // Use the existing reference
-            CloneExisting,      // Create a clone of the sub-profile
-            UseSubstitution,    // Manually select a profile
-            LeaveEmpty,         // Set the reference to null
+            /// <summary>
+            /// Use the existing reference.
+            /// </summary>
+            UseExisting,
+
+            /// <summary>
+            /// Create a clone of the sub-profile.
+            /// </summary>
+            CloneExisting,
+
+            /// <summary>
+            /// Manually select a profile.
+            /// </summary>
+            UseSubstitution,
+
+            /// <summary>
+            /// Set the reference to null.
+            /// </summary>
+            LeaveEmpty,
         }

         private struct SubProfileAction


Fixed bug with MinValue attribute

Fixed bug with MinValue attribute

--- Assets/Scripts/Atlas/Editor/Utils/Attributes/MinValuePropertyDrawer.cs
+++ Assets/Scripts/Atlas/Editor/Utils/Attributes/MinValuePropertyDrawer.cs
@@ -21,7 +21,7 @@
                     break;

                 case SerializedPropertyType.Float:
-                    property.floatValue = Mathf.Min( minAttribute.MinValue, property.floatValue );
+                    property.floatValue = Mathf.Max( minAttribute.MinValue, property.floatValue );
                     break;

                 default:


MovePositions

MovePositions

--- CSharpGL/OpenGLObjects/ModernRendering/ModernRenderer.MovePositions.cs
+++ CSharpGL/OpenGLObjects/ModernRendering/ModernRenderer.MovePositions.cs
@@ -21,7 +21,7 @@
         /// <param name="viewport"></param>
         /// <param name="positionIndexes"></param>
         public void MovePositions(Point differenceOnScreen,
-            mat4 viewMatrix, mat4 projectionMatrix, vec4 viewport, uint[] positionIndexes)
+            mat4 viewMatrix, mat4 projectionMatrix, vec4 viewport, params uint[] positionIndexes)
         {
             if (positionIndexes == null) { return; }
             if (positionIndexes.Length == 0) { return; }
@@ -37,7 +37,7 @@
                         viewMatrix, projectionMatrix, viewport);
                     vec3 newProjected = new vec3(projected.x + differenceOnScreen.X,
                         projected.y + differenceOnScreen.Y, projected.z);
-                    array[positionIndexes[i]]=glm.unProject(newProjected,
+                    array[positionIndexes[i]] = glm.unProject(newProjected,
                         viewMatrix, projectionMatrix, viewport);
                 }
             }


Change: Return object if DereferencedAligned does not really change type

--- src/reni2/Result.cs
+++ src/reni2/Result.cs
@@ -926,6 +926,10 @@
         {
             var destinationType = Type
                 .AutomaticDereferenceType.Align;
+
+            if (destinationType == Type)
+                return this;
+
             return Type
                 .Conversion(CompleteCategory, destinationType)
                 .ReplaceArg(this);


Picking now works correctly on 3D camera.


Fixed the problem bullet-bonus

Fixed the problem bullet-bonus

--- KaiFighter/KaiFighterGame/Objects/DynamicObjects/Projectiles/Bullet.cs
+++ KaiFighter/KaiFighterGame/Objects/DynamicObjects/Projectiles/Bullet.cs
@@ -39,18 +39,27 @@
             this.MoveWithoutStop(this.targetDir);
         }

+        /// <summary>
+        /// If the bullet shound not react when colliding with other bullet and bonus
+        /// Also the shooter shoud not be affected
+        /// </summary>
+        /// <param name="gameObject"></param>
         public override void RespondToCollision(ICollidable gameObject)
         {
             if (this.IsPlayerFire == true)
             {
-                if (gameObject.ObjType != ObjectType.Player && gameObject.ObjType != ObjectType.Bullet)
+                if (gameObject.ObjType != ObjectType.Player
+                    && gameObject.ObjType != ObjectType.Bullet
+                    && gameObject.ObjType != ObjectType.Bonus)
                 {
                     SceneManager.DestroyObject(this);
                 }
             }
             else
             {
-                if (gameObject.ObjType != ObjectType.Archer && gameObject.ObjType != ObjectType.Bullet)
+                if (gameObject.ObjType != ObjectType.Archer
+                    && gameObject.ObjType != ObjectType.Bullet
+                    && gameObject.ObjType != ObjectType.Bonus)
                 {
                     SceneManager.DestroyObject(this);
                 }


Made the check for texture assets asynchronous. This is one part of a bigger clean up that needs to happen around locks on appearance.

--- OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -84,6 +84,15 @@
             // client.OnAvatarNowWearing -= AvatarIsWearing;
         }

+        public void CheckBakedTextureAssets(IClientAPI client, UUID textureID, int idx)
+        {
+            if (m_scene.AssetService.Get(textureID.ToString()) == null)
+            {
+                m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",textureID,idx,client.Name);
+                client.SendRebakeAvatarTextures(textureID);
+            }
+        }
+
         /// <summary>
         /// Set appearance data (textureentry and slider settings) received from the client
         /// </summary>
@@ -133,13 +142,7 @@
                     Primitive.TextureEntryFace face = textureEntry.FaceTextures[j];

                     if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
-                    {
-                        if (m_scene.AssetService.Get(face.TextureID.ToString()) == null)
-                        {
-                            m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",face.TextureID,j,client.Name);
-                            client.SendRebakeAvatarTextures(face.TextureID);
-                        }
-                    }
+                        Util.FireAndForget(delegate(object o) { CheckBakedTextureAssets(client,face.TextureID,j); });
                 }
                 changed = sp.Appearance.SetTextureEntries(textureEntry);


If parsing fails in the primitive base shape (which prints out a debug log message), also print out the name and uuid of the part containing this shape.

This is to help in diagnosing parsing failures.

--- OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -570,7 +570,13 @@

         private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
         {
-            obj.Shape = ReadShape(reader, "Shape");
+            bool errors = false;
+            obj.Shape = ReadShape(reader, "Shape", out errors);
+
+            if (errors)
+                m_log.DebugFormat(
+                    "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors.  Please see earlier log entries.",
+                    obj.Name, obj.UUID);
         }

         private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1470,7 +1476,9 @@
                     }
                     catch (Exception e)
                     {
-                        m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing {0}: {1}", nodeName, e);
+                        m_log.DebugFormat(
+                            "[SceneObjectSerializer]: exception while parsing {0} in object {1} {2}: {3}{4}",
+                            obj.Name, obj.UUID, nodeName, e.Message, e.StackTrace);
                         if (reader.NodeType == XmlNodeType.EndElement)
                             reader.Read();
                     }
@@ -1528,8 +1536,17 @@
             return tinv;
         }

-        static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
-        {
+        /// <summary>
+        /// Read a shape from xml input
+        /// </summary>
+        /// <param name="reader"></param>
+        /// <param name="name">The name of the xml element containing the shape</param>
+        /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param>
+        /// <returns>The shape parsed</returns>
+        static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors)
+        {
+            errors = false;
+
             PrimitiveBaseShape shape = new PrimitiveBaseShape();

             if (reader.IsEmptyElement)
@@ -1554,7 +1571,11 @@
                     }
                     catch (Exception e)
                     {
-                        m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e);
+                        errors = true;
+                        m_log.DebugFormat(
+                            "[SceneObjectSerializer]: exception while parsing Shape property {0}: {1}{2}",
+                            nodeName, e.Message, e.StackTrace);
+
                         if (reader.NodeType == XmlNodeType.EndElement)
                             reader.Read();
                     }


Add new unit test¨

Add new unit test¨

--- PortableExtensions.Testing/System.Action/Action.ExecuteIfFalse.Test.cs
+++ PortableExtensions.Testing/System.Action/Action.ExecuteIfFalse.Test.cs
@@ -202,7 +202,6 @@
             ActionEx.ExecuteIfFalse(null, RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), null, false, false);
         }

-
         [Test]
         public void ExecuteIfFalseTestCase3()
         {
@@ -275,5 +274,79 @@
         {
             ActionEx.ExecuteIfFalse(null, RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), null, false, false);
         }
+
+        [Test]
+        public void ExecuteIfFalseTestCase4()
+        {
+            var parameter1 = RandomValueEx.GetRandomString();
+            var parameter2 = RandomValueEx.GetRandomString();
+            var parameter3 = RandomValueEx.GetRandomString();
+            var parameter4 = RandomValueEx.GetRandomString();
+
+            //Case 1
+            var falseActionExecuted = false;
+            var trueActionExecuted = false;
+            ActionEx.ExecuteIfFalse(
+                (p1, p2, p3, p4) => falseActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                parameter1, parameter2, parameter3, parameter4,
+                null,
+                false, false);
+
+            Assert.IsTrue(falseActionExecuted);
+            Assert.IsFalse(trueActionExecuted);
+
+            //Case 2
+            falseActionExecuted = false;
+            trueActionExecuted = false;
+            ActionEx.ExecuteIfFalse(
+                (p1, p2, p3, p4) => falseActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                parameter1, parameter2, parameter3, parameter4,
+                (p1, p2, p3, p4) => trueActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                false, false);
+
+            Assert.IsTrue(falseActionExecuted);
+            Assert.IsFalse(trueActionExecuted);
+
+            //Case 3
+            falseActionExecuted = false;
+            trueActionExecuted = false;
+            ActionEx.ExecuteIfFalse(
+                (p1, p2, p3, p4) => falseActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                parameter1, parameter2, parameter3, parameter4,
+                (p1, p2, p3, p4) => trueActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                true, false);
+
+            Assert.IsFalse(falseActionExecuted);
+            Assert.IsTrue(trueActionExecuted);
+
+            //Case 4
+            falseActionExecuted = false;
+            trueActionExecuted = false;
+            ActionEx.ExecuteIfFalse(
+                (p1, p2, p3, p4) => falseActionExecuted = p1 == parameter1 && p2 == parameter2 && p3 == parameter3 && p4 == parameter4,
+                parameter1, parameter2, parameter3, parameter4,
+                null,
+                true, false);
+
+            Assert.IsFalse(falseActionExecuted);
+            Assert.IsFalse(trueActionExecuted);
+
+            //Case 5
+            falseActionExecuted = false;
+            trueActionExecuted = false;
+            ActionEx.ExecuteIfFalse(null,
+                parameter1, parameter2, parameter3, parameter4,
+                null, true, false);
+
+            Assert.IsFalse(falseActionExecuted);
+            Assert.IsFalse(trueActionExecuted);
+        }
+
+        [Test]
+        [ExpectedException(typeof(ArgumentNullException))]
+        public void ExecuteIfFalseTestCase4NullCheck()
+        {
+            ActionEx.ExecuteIfFalse(null, RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), RandomValueEx.GetRandomString(), null, false, false);
+        }
     }
 }


(maint) Fix broken build

(maint) Fix broken build

In the develop branch, there isn't a progressService method for showing
a message anymore, this was moved to the dialogService, so had to fix
this up after the merge happened.

--- Source/ChocolateyGui.Common.Windows/ViewModels/LocalSourceViewModel.cs
+++ Source/ChocolateyGui.Common.Windows/ViewModels/LocalSourceViewModel.cs
@@ -245,10 +245,10 @@

                 await _chocolateyService.ExportPackages(exportFilePath, true);

-#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
-                _progressService.ShowMessageAsync(Resources.LocalSourceView_ButtonExport, string.Format(Resources.LocalSourceViewModel_ExportComplete, exportFilePath))
+                await _dialogService.ShowMessageAsync(
+                        Resources.LocalSourceView_ButtonExport,
+                        string.Format(Resources.LocalSourceViewModel_ExportComplete, exportFilePath))
                     .ConfigureAwait(false);
-#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
             }
             catch (Exception ex)
             {


Remove crossgenning mscorlib on Unix platforms, since the CoreCLR nuget package now carries the crossgenned mscorlib on non-Windows platforms.

--- scripts/dotnet-cli-build/CompileTargets.cs
+++ scripts/dotnet-cli-build/CompileTargets.cs
@@ -335,7 +335,7 @@

         private static List<string> GetAssembliesToCrossGen()
         {
-            var list = new List<string>
+            return new List<string>
             {
                 "System.Collections.Immutable.dll",
                 "System.Reflection.Metadata.dll",
@@ -345,15 +345,6 @@
                 "csc.dll",
                 "vbc.dll"
             };
-
-            // mscorlib is already crossgenned on Windows
-            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
-            {
-                // mscorlib has to be crossgenned first
-                list.Insert(0, "mscorlib.dll");
-            }
-
-            return list;
         }
     }
 }


finished indexing integration tests

finished indexing integration tests

--- src/Tests/Document/Single/Indexing.cs
+++ src/Tests/Document/Single/Indexing.cs
@@ -67,11 +67,11 @@
 	}

 	[Collection(IntegrationContext.Indexing)]
-	public class Creation : SimpleIntegration
+	public class IndexIntegrationTests : SimpleIntegration
 	{
-		public Creation(IndexingCluster cluster) : base(cluster) { }
+		public IndexIntegrationTests(IndexingCluster cluster) : base(cluster) { }

-		[I] public void Create()
+		[I] public void OpTypeCreate()
 		{
 			var indexName = this.RandomString();
 			var project = Project.Generator.Generate(1).First();
@@ -94,7 +94,27 @@
 			indexResult.IsValid.Should().BeFalse();
 			indexResult.Created.Should().BeFalse();
 			indexResult.ApiCall.HttpStatusCode.Should().Be(409);
+		}

+		[I] public void Index()
+		{
+			var indexName = this.RandomString();
+			var project = Project.Generator.Generate(1).First();
+			var indexResult = this.Client.Index(project, f => f .Index(indexName));
+			indexResult.IsValid.Should().BeTrue();
+			indexResult.ApiCall.HttpStatusCode.Should().Be(201);
+			indexResult.Created.Should().BeTrue();
+			indexResult.Index.Should().Be(indexName);
+			indexResult.Type.Should().Be(this.Client.Infer.TypeName<Project>());
+			indexResult.Id.Should().Be(project.Name);
+			indexResult.Version.Should().Be(1);
+
+			indexResult = this.Client.Index(project, f => f .Index(indexName));
+
+			indexResult.IsValid.Should().BeTrue();
+			indexResult.Created.Should().BeFalse();
+			indexResult.ApiCall.HttpStatusCode.Should().Be(200);
+			indexResult.Version.Should().Be(2);
 		}

 	}


Fixed brackets.

Fixed brackets.

--- src/Types/CassandraObjectConverter.cs
+++ src/Types/CassandraObjectConverter.cs
@@ -53,9 +53,8 @@
 		public virtual T FromBigEndian(byte[] value)
 		{
 			if (value == null)
-			{
 				return default(T);
-			}
+
 			var bytes = ConvertEndian(value);
 			var obj = ConvertFromInternal(bytes);
 			return obj;


removed replacement of directory separators from OutputFilenameFactory


Use new JobHost.CallAsync(string) overload. This also lets script ignore the ITypeLocator to lookup method Infos.

--- src/WebJobs.Script/Host/ScriptHost.cs
+++ src/WebJobs.Script/Host/ScriptHost.cs
@@ -246,13 +246,7 @@

         public virtual async Task CallAsync(string method, Dictionary<string, object> arguments, CancellationToken cancellationToken = default(CancellationToken))
         {
-            // TODO: Validate inputs
-            // TODO: Cache this lookup result
-            method = method.ToLowerInvariant();
-            Type type = ScriptConfig.HostConfig.TypeLocator.GetTypes().SingleOrDefault(p => p.Name == ScriptHost.GeneratedTypeName);
-            var methodInfo = type.GetMethods().SingleOrDefault(p => p.Name.ToLowerInvariant() == method);
-
-            await CallAsync(methodInfo, arguments, cancellationToken);
+            await base.CallAsync(method, arguments, cancellationToken);
         }

         protected virtual void Initialize()


Fixes #138

Fixes #138

--- source/Pulsar/Graphics/Debugger/MeshBoundingBox.cs
+++ source/Pulsar/Graphics/Debugger/MeshBoundingBox.cs
@@ -17,13 +17,21 @@
     {
         #region Fields

-        private const int VerticesCount = 24;
+        private const int IndexCount = 24;
         private const int PrimitiveCount = 12;
+        private const int VertexCount = 8;
+        private const short FrontTopLeft = 0;
+        private const short FrontTopRight = 1;
+        private const short FrontBottomLeft = 2;
+        private const short FrontBottomRight = 3;
+        private const short BackTopLeft = 4;
+        private const short BackTopRight = 5;
+        private const short BackBottomLeft = 6;
+        private const short BackBottomRight = 7;

         private VertexBufferObject _vbo;
         private IndexBufferObject _ibo;
-        private readonly short[] _indices = new short[VerticesCount];
-        private readonly VertexPositionNormalTexture[] _vertices = new VertexPositionNormalTexture[VerticesCount];
+        private readonly VertexPositionNormalTexture[] _vertices = new VertexPositionNormalTexture[VertexCount];

         #endregion

@@ -35,6 +43,47 @@
         internal MeshBoundingBox()
         {
             InitBuffers();
+        }
+
+        #endregion
+
+        #region Static methods
+
+        private static void GenerateIndices(IndexBufferObject ibo)
+        {
+            short[] indices = new short[IndexCount];
+
+            // Top
+            indices[0] = FrontTopLeft;
+            indices[1] = FrontTopRight;
+            indices[2] = FrontTopLeft;
+            indices[3] = BackTopLeft;
+            indices[4] = BackTopRight;
+            indices[5] = FrontTopRight;
+            indices[6] = BackTopRight;
+            indices[7] = BackTopLeft;
+
+            // Bottom
+            indices[8] = FrontBottomLeft;
+            indices[9] = FrontBottomRight;
+            indices[10] = FrontBottomLeft;
+            indices[11] = BackBottomLeft;
+            indices[12] = BackBottomRight;
+            indices[13] = FrontBottomRight;
+            indices[14] = BackBottomRight;
+            indices[15] = BackBottomLeft;
+
+            //Sides
+            indices[16] = FrontTopRight;
+            indices[17] = FrontBottomRight;
+            indices[18] = FrontTopLeft;
+            indices[19] = FrontBottomLeft;
+            indices[20] = BackTopRight;
+            indices[21] = BackBottomRight;
+            indices[22] = BackTopLeft;
+            indices[23] = BackBottomLeft;
+
+            ibo.SetData(indices);
         }

         #endregion
@@ -54,23 +103,22 @@
             BufferManager bufferMngr = engineService.Engine.BufferManager;
             VertexData vData = new VertexData();
             _vbo = bufferMngr.CreateVertexBuffer(BufferType.DynamicWriteOnly, typeof(VertexPositionNormalTexture),
-                VerticesCount);
+                VertexCount);
             vData.SetBinding(_vbo);

             IndexData iData = new IndexData();
             _ibo = bufferMngr.CreateIndexBuffer(BufferType.DynamicWriteOnly, IndexElementSize.SixteenBits,
-                VerticesCount);
-            _ibo.SetData(_indices);
+                IndexCount);
+            GenerateIndices(_ibo);
             iData.IndexBuffer = _ibo;
-
-            for (short i = 0; i < VerticesCount; i++) _indices[i] = i;

             RenderInfo = new RenderingInfo
             {
                 PrimitiveType = PrimitiveType.LineList,
                 VertexData = vData,
                 IndexData = iData,
-                VertexCount = VerticesCount,
+                UseIndexes = true,
+                VertexCount = VertexCount,
                 PrimitiveCount = PrimitiveCount
             };
             Material = MaterialManager.Instance.LoadDefault();
@@ -83,41 +131,28 @@
         /// <param name="box">Boundig box used to update buffers data</param>
         internal void UpdateBox(ref BoundingBox box)
         {
-            Vector3 xOffset = new Vector3((box.Max.X - box.Min.X), 0, 0);
-            Vector3 yOffset = new Vector3(0, (box.Max.Y - box.Min.Y), 0);
-            Vector3 zOffset = new Vector3(0, 0, (box.Max.Z - box.Min.Z));
-            Vector3 minOpposite = box.Min + (xOffset + zOffset);
-            Vector3 maxOpposite = box.Max - (xOffset + zOffset);
-
-            //// Top
-            _vertices[0].Position = box.Min;
-            _vertices[1].Position = box.Min + xOffset;
-            _vertices[2].Position = box.Min;
-            _vertices[3].Position = box.Min + zOffset;
-            _vertices[4].Position = minOpposite;
-            _vertices[5].Position = box.Min + xOffset;
-            _vertices[6].Position = minOpposite;
-            _vertices[7].Position = box.Min + zOffset;
-
-            //// Bottom
-            _vertices[8].Position = box.Max;
-            _vertices[9].Position = box.Max - xOffset;
-            _vertices[10].Position = box.Max;
-            _vertices[11].Position = box.Max - zOffset;
-            _vertices[12].Position = maxOpposite;
-            _vertices[13].Position = box.Max - xOffset;
-            _vertices[14].Position = maxOpposite;
-            _vertices[15].Position = box.Max - zOffset;
-
-            //// Sides
-            _vertices[16].Position = box.Min;
-            _vertices[17].Position = box.Min + yOffset;
-            _vertices[18].Position = box.Min + xOffset;
-            _vertices[19].Position = (box.Min + xOffset) + yOffset;
-            _vertices[20].Position = box.Max;
-            _vertices[21].Position = box.Max - yOffset;
-            _vertices[22].Position = box.Max - xOffset;
-            _vertices[23].Position = (box.Max - xOffset) - yOffset;
+            Vector3 min = box.Min;
+            Vector3 max = box.Max;
+            Vector3 xOffset = new Vector3((max.X - min.X), 0, 0);
+            Vector3 zOffset = new Vector3(0, 0, (max.Z - min.Z));
+
+            Vector3 minOpposite;
+            Vector3 maxOpposite;
+            Vector3.Add(ref xOffset, ref zOffset, out minOpposite);
+            Vector3.Subtract(ref max, ref minOpposite, out maxOpposite);
+            Vector3.Add(ref min, ref minOpposite, out minOpposite);
+
+            // Front vertices
+            _vertices[FrontTopRight].Position = max;
+            _vertices[FrontBottomRight].Position = minOpposite;
+            Vector3.Subtract(ref max, ref xOffset, out _vertices[FrontTopLeft].Position);
+            Vector3.Subtract(ref minOpposite, ref xOffset, out _vertices[FrontBottomLeft].Position);
+
+            // Bottom vertices
+            _vertices[BackBottomLeft].Position = min;
+            _vertices[BackTopLeft].Position = maxOpposite;
+            Vector3.Add(ref min, ref xOffset, out _vertices[BackBottomRight].Position);
+            Vector3.Add(ref maxOpposite, ref xOffset, out _vertices[BackTopRight].Position);

             _vbo.SetData(_vertices);
         }
@@ -140,7 +175,7 @@
         public bool UseInstancing
         {
             get { return false; }
-            set { throw new NotImplementedException(); }
+            set { throw new NotSupportedException(); }
         }

         /// <summary>


SEMPERA-1518 - fixing warnings

SEMPERA-1518
- fixing warnings

--- dotnet/Util/SharePoint/trunk/src/I/SharePointClient.cs
+++ dotnet/Util/SharePoint/trunk/src/I/SharePointClient.cs
@@ -591,10 +591,10 @@
                    }
                     string listName = foldernames[1];

-                    if (foldernames.Length < 3 || foldernames.Length == 3 && string.IsNullOrEmpty(foldernames[2]))
-                    {
-                        string errorInformation = string.Format("Path [{0}] is not valid",theNewFolderName);
-                        throw new Exception(string.Format("Error in creating form [{0}].Exeption({1})", theNewFolderName,errorInformation));
+                    if ((foldernames.Length < 3) || ((foldernames.Length == 3) && string.IsNullOrEmpty(foldernames[2])))
+                    {
+                        string errorInformation = string.Format("Path [{0}] is not valid", theNewFolderName);
+                        throw new Exception(string.Format("Error in creating form [{0}].Exeption({1})", theNewFolderName, errorInformation));
                     }
                     if (CheckExistenceOfFolderWithExactPath(newFolderName))
                     {
@@ -682,7 +682,7 @@
         //all subfolders will be deleted
         //if parameter deleteChildren is false
         //folder will only by deleted if folder has no children
-        public void DeleteFolder(string folderNameToDelete , bool deleteChildren)
+        public void DeleteFolder(string folderNameToDelete, bool deleteChildren)
         {
             try
             {
@@ -844,7 +844,6 @@
                     if (string.IsNullOrEmpty(foldernames[foldernames.Length - 1]))
                     {
                         baseRelativeUrl = ExtractRelativeUrlFromBaseRelativeUrl(baseRelativeUrl);
-
                     }
                     string relativeUrl = ExtractRelativeUrlFromBaseRelativeUrl(baseRelativeUrl);


AutoSizeContainer: invalidate autoSize on changes

--- osu.Framework/Graphics/Containers/AutoSizeContainer.cs
+++ osu.Framework/Graphics/Containers/AutoSizeContainer.cs
@@ -22,7 +22,11 @@
                 Debug.Assert((RelativeSizeAxes & Axes.X) > 0 || value.X == -1, @"The Size of an AutoSizeContainer should never be manually set.");
                 Debug.Assert((RelativeSizeAxes & Axes.Y) > 0 || value.Y == -1, @"The Size of an AutoSizeContainer should never be manually set.");

-                base.Size = value;
+                if (value != base.Size)
+                {
+                    base.Size = value;
+                    autoSize.Invalidate();
+                }
             }
         }


reverted some ...

reverted some ...

--- src/com/codename1/impl/SilverlightImplementation.cs
+++ src/com/codename1/impl/SilverlightImplementation.cs
@@ -1663,6 +1663,7 @@

                     return nf;
                 }
+                catch (Exception err)
                 {
                 }
             }
@@ -2008,6 +2009,7 @@
                 StorageFile file = store.GetFileAsync(uri).AsTask().ConfigureAwait(false).GetAwaiter().GetResult();
                 fileExists = file != null;
             }
+            catch (Exception e)
             {
                 fileExists = false;
             }


try to speed up common auth checks

try to speed up common auth checks

--- src/auth-web/Services/RolesService.cs
+++ src/auth-web/Services/RolesService.cs
@@ -14,6 +14,8 @@
     private readonly ILogger _log;
     private readonly object cacheLock = new object();
     private Dictionary<string, Role> cache = null;
+    private Dictionary<Guid, string[]> accountToRolesCache = null;
+    DateTime cacheTime = DateTime.MinValue;

     public RolesService(Func<IAuthDbContext> dbFactory, ILogger log)
     {
@@ -23,16 +25,21 @@

     public List<string> ListAllRolesForAccount(Guid accountId)
     {
+      List<string> roles = null;
+      string[] directRoleList = new string[0];
+
       EnsureCache();

-      using (var db = _dbFactory())
+      lock (cacheLock)
       {
-        var roles = new List<string>();
+        accountToRolesCache.TryGetValue(accountId, out directRoleList);
+
+        roles = new List<string>();
         BuildRoleList(
           roles,
-          db.Accounts.Where(f => f.Id == accountId).SelectMany(f => f.Roles).Select(f => f.Id));
-        return roles;
+          directRoleList);
       }
+      return roles;
     }

     private void BuildRoleList(List<string> list, IEnumerable<string> newRoles)
@@ -53,33 +60,40 @@

       using (var db = _dbFactory())
       {
-        return db.Accounts.Where(f => f.Id == accountId)
-                 .SelectMany(f => f.Roles).Select(f => f.Id).ToList()
+        var part = db.Accounts.Where(f => f.Id == accountId)
+                 .SelectMany(f => f.Roles).Select(f => f.Id).ToList();
+        lock (cacheLock)
+        {
+          return part
                  .Select(f => cache[f])
                  .ToList();
+        }
       }
     }

     private void EnsureCache()
     {
-      if (cache == null)
+      if (cacheTime < DateTime.UtcNow)
       {
         lock (cacheLock)
         {
-          if (cache == null)
+          if (cacheTime < DateTime.UtcNow)
           {
             using (var db = _dbFactory())
             {
               cache = db.Roles.ToDictionary(
                 f => f.Id,
-                f => new Role { Id = f.Id, Name = f.Name, Description = f.Description}
+                f => new Role { Id = f.Id, Name = f.Name, Description = f.Description }
               );

               foreach (var link in db.Roles.SelectMany(role => role.Children, (parent, child) => new { P = parent.Id, C = child.Id }))
               {
                 cache[link.P].Includes.Add(cache[link.C]);
               }
+
+              accountToRolesCache = db.Accounts.ToDictionary(f => f.Id, f => f.Roles.Select(g => g.Id).ToArray());
             }
+            cacheTime = DateTime.UtcNow.AddMinutes(5);
           }
         }
       }


Preemptively schedule a scene update when rendering an updated SceneInvalidated

Effective FPS is now 60 instead of 30

--- src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
+++ src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
@@ -318,16 +318,24 @@
                         _lastSceneId = scene.Generation;

+                    var isUiThread = Dispatcher.UIThread.CheckAccess();
                     // We have consumed the previously available scene, but there might be some dirty
                     // rects since the last update. *If* we are on UI thread, we can force immediate scene
                     // rebuild before rendering anything on-screen
                     // We are calling the same method recursively here
-                    if (!recursiveCall && Dispatcher.UIThread.CheckAccess() && NeedsUpdate)
+                    if (!recursiveCall && isUiThread && NeedsUpdate)
                     {
                         UpdateScene();
                         var (rs, _) = UpdateRenderLayersAndConsumeSceneIfNeeded(ref context, true);
                         return (rs, true);
                     }
+
+                    // We are rendering a new scene version, so it's highly likely
+                    // that there is already a pending update for animations
+                    // So we are scheduling an update call so UI thread could prepare a scene before
+                    // the next render timer tick
+                    if (!recursiveCall && !isUiThread)
+                        Dispatcher.UIThread.InvokeAsync(UpdateSceneIfNeeded, DispatcherPriority.Render);

                     // Indicate that we have updated the layers
                     return (sceneRef.Clone(), true);
@@ -534,6 +542,12 @@
             context = RenderTarget.CreateDrawingContext(this);
         }

+        private void UpdateSceneIfNeeded()
+        {
+            if(NeedsUpdate)
+                UpdateScene();
+        }
+
         private void UpdateScene()
         {
             Dispatcher.UIThread.VerifyAccess();


Fix concert edit form submission URL.

Fix concert edit form submission URL.

Ensure the form POSTs to the Create Action when adding a new concert, and
to the Edit Action when modifying an existing one.

--- src/CGO.Web/Views/Concerts/_ConcertEditForm.cshtml
+++ src/CGO.Web/Views/Concerts/_ConcertEditForm.cshtml
@@ -1,7 +1,7 @@
 @model CGO.Web.ViewModels.ConcertViewModel

 @{ Html.EnableClientValidation(); }
-@using (Html.BeginForm("Create", "Concerts", FormMethod.Post, new { id = "CreateConcert" }))
+@using (Html.BeginForm())
 {
     @Html.ValidationSummary(false, "Oh dear, the violas made a boo-boo. Please go back and fix the following mistakes:")

@@ -43,8 +43,8 @@

         <p>
             @Html.HiddenFor(c => c.IsPublished)
-            <input type="submit" value="Publish Concert" class="btn btn-primary" onclick="$('#IsPublished').val(true);$('#CreateConcert').submit();" />
-            <input type="submit" value="Save for later" class="btn" onclick="$('#IsPublished').val(false);$('#CreateConcert').submit();" />
+            <input type="submit" value="Publish Concert" class="btn btn-primary" onclick="$('#IsPublished').val(true);$(this).submit();" />
+            <input type="submit" value="Save for later" class="btn" onclick="$('#IsPublished').val(false);$(this).submit();" />
             <input type="reset" value="Discard" class="btn" />
         </p>
     </fieldset>


Add RemoveEmployee endpoint for Pay RUns

--- src/keypay-dotnet/ApiFunctions/V2/PayRunFunction.cs
+++ src/keypay-dotnet/ApiFunctions/V2/PayRunFunction.cs
@@ -84,5 +84,10 @@
         {
             return ApiJsonRequest(string.Format("/business/{0}/payrun/{1}/file/aba/{2}", businessId, payRunId, abaId));
         }
+
+        public string RemoveEmployee(int businessId, int payRunId, int employeeId)
+        {
+            return ApiJsonRequest(string.Format("/business/{0}/payrun/{1}/employee/{2}", businessId, payRunId, employeeId), Method.DELETE);
+        }
     }
 }


Update BoundsRectangle.cs

Update BoundsRectangle.cs

--- src/Core2D/Editor/Bounds/Shapes/BoundsRectangle.cs
+++ src/Core2D/Editor/Bounds/Shapes/BoundsRectangle.cs
@@ -14,7 +14,9 @@
         public IPointShape TryToGetPoint(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered)
         {
             if (!(shape is IRectangleShape rectangle))
+            {
                 throw new ArgumentNullException(nameof(shape));
+            }

             var pointHitTest = registered[typeof(IPointShape)];

@@ -34,7 +36,9 @@
         public bool Contains(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered)
         {
             if (!(shape is IRectangleShape rectangle))
+            {
                 throw new ArgumentNullException(nameof(shape));
+            }

             return Rect2.FromPoints(
                 rectangle.TopLeft.X,
@@ -46,7 +50,9 @@
         public bool Overlaps(IBaseShape shape, Rect2 target, double radius, IDictionary<Type, IBounds> registered)
         {
             if (!(shape is IRectangleShape rectangle))
+            {
                 throw new ArgumentNullException(nameof(shape));
+            }

             return Rect2.FromPoints(
                 rectangle.TopLeft.X,


migration config updated

migration config updated

--- src/Data/MyServer.Data/Migrations/Configuration.cs
+++ src/Data/MyServer.Data/Migrations/Configuration.cs
@@ -15,8 +15,13 @@
     {
         public Configuration()
         {
+
             this.AutomaticMigrationsEnabled = true;
+#if DEBUG
             this.AutomaticMigrationDataLossAllowed = true;
+#else
+            this.AutomaticMigrationDataLossAllowed = false;
+#endif
         }

         protected override void Seed(MyServerDbContext context)


Update PointDecorator.cs

Update PointDecorator.cs

--- src/Draw2D/ViewModels/Decorators/PointDecorator.cs
+++ src/Draw2D/ViewModels/Decorators/PointDecorator.cs
@@ -17,7 +17,7 @@
 #if USE_POINT_DECORATOR
             if (shape is IPointShape pointShape)
             {
-                Draw(dc, renderer, pointShape, dx, dy, scale, mode);
+                Draw(dc, renderer, pointShape, dx, dy, scale);
             }
 #endif
         }


Struct types also need to have a default constructor taking the native instance.

--- src/Generator/Generators/CLI/CLIHeadersTemplate.cs
+++ src/Generator/Generators/CLI/CLIHeadersTemplate.cs
@@ -198,19 +198,20 @@
             WriteLine("{");
             WriteLine("public:");

-            if (!@class.IsValueType)
+            var nativeType = string.Format("::{0}*", @class.OriginalName);
+
+            if (@class.IsRefType)
             {
                 PushIndent();
-                var nativeType = string.Format("::{0}*", @class.OriginalName);
                 WriteLine("property {0} NativePtr;", nativeType);
                 PopIndent();
                 NewLine();
-
-                // Output a default constructor that takes the native pointer.
-                PushIndent();
-                WriteLine("{0}({1} native);", SafeIdentifier(@class.Name), nativeType);
-                PopIndent();
-            }
+            }
+
+            // Output a default constructor that takes the native pointer.
+            PushIndent();
+            WriteLine("{0}({1} native);", SafeIdentifier(@class.Name), nativeType);
+            PopIndent();

             if (@class.IsValueType)
             {


Yay C# 6!

Yay C# 6!

--- src/GitHub.Exports/Models/SimpleRepositoryModel.cs
+++ src/GitHub.Exports/Models/SimpleRepositoryModel.cs
@@ -24,10 +24,10 @@
         public SimpleRepositoryModel(string path)
         {
             if (path == null)
-                throw new ArgumentNullException("path");
+                throw new ArgumentNullException(nameof(path));
             var dir = new DirectoryInfo(path);
             if (!dir.Exists)
-                throw new ArgumentException("Path does not exist", path);
+                throw new ArgumentException("Path does not exist", nameof(path));
             var uri = GitHelpers.GetRepoFromPath(path)?.GetUri();
             var name = uri?.NameWithOwner;
             if (name == null)


Suppress CA1823 for IVSServices used in VS2015

--- src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
+++ src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
@@ -36,6 +36,7 @@

         [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2017")]
         readonly Lazy<IStatusBarNotificationService> statusBar;
+        [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2015")]
         readonly Lazy<IVSServices> vsServices;

         /// <summary>


CCS for embedded templated request.

CCS for embedded templated request.

--- src/HelloSignApi/Internal/HttpContentExtensions.cs
+++ src/HelloSignApi/Internal/HttpContentExtensions.cs
@@ -248,7 +248,7 @@
             content.AddParameter(log, "requesting_redirect_url", draft.RequestingRedirectUrl);
             foreach (var cc in draft.Ccs)
             {
-                content.AddParameter(log, $"ccs[{cc.Role}]", cc.Email);
+                content.AddParameter(log, $"ccs[{cc.Role}][email_address]", cc.Email);
             }
             if (draft.CustomFields.Count > 0)
             {


Use Task.Delay instead of manually creating a task from the wait handle

--- src/MR.AspNetCore.Jobs/Server/ProcessingContext.cs
+++ src/MR.AspNetCore.Jobs/Server/ProcessingContext.cs
@@ -55,14 +55,9 @@
 			return n;
 		}

-		public void Wait(TimeSpan timeout)
+		public Task WaitAsync(TimeSpan timeout)
 		{
-			CancellationToken.WaitHandle.WaitOne(timeout);
-		}
-
-		public Task<bool> WaitAsync(TimeSpan timeout)
-		{
-			return CancellationToken.WaitHandle.WaitOneAsync(timeout);
+			return Task.Delay(timeout, CancellationToken);
 		}

 		public void Dispose()


ref #157 Lift export std hierarchy (ps/sn). Added test.


Using 'nameof' operator instead of magic strings

--- src/Microsoft.AspNet.Session/DistributedSession.cs
+++ src/Microsoft.AspNet.Session/DistributedSession.cs
@@ -60,12 +60,12 @@
             var encodedKey = new EncodedKey(key);
             if (encodedKey.KeyBytes.Length > KeyLengthLimit)
             {
-                throw new ArgumentOutOfRangeException("key", key,
+                throw new ArgumentOutOfRangeException(nameof(key),
                     string.Format("The key cannot be longer than '{0}' when encoded with UTF-8.", KeyLengthLimit));
             }
             if (value.Array == null)
             {
-                throw new ArgumentException("The ArraySegment<byte>.Array cannot be null.", "value");
+                throw new ArgumentException("The ArraySegment<byte>.Array cannot be null.", nameof(value));
             }

             Load();
@@ -174,7 +174,7 @@
         {
             if (num < 0 || ushort.MaxValue < num)
             {
-                throw new ArgumentOutOfRangeException("num", num, "The value cannot be serialized in two bytes.");
+                throw new ArgumentOutOfRangeException(nameof(num), "The value cannot be serialized in two bytes.");
             }
             output.WriteByte((byte)(num >> 8));
             output.WriteByte((byte)(0xFF & num));
@@ -189,7 +189,7 @@
         {
             if (num < 0 || 0xFFFFFF < num)
             {
-                throw new ArgumentOutOfRangeException("num", num, "The value cannot be serialized in three bytes.");
+                throw new ArgumentOutOfRangeException(nameof(num), "The value cannot be serialized in three bytes.");
             }
             output.WriteByte((byte)(num >> 16));
             output.WriteByte((byte)(0xFF & (num >> 8)));
@@ -205,7 +205,7 @@
         {
             if (num < 0)
             {
-                throw new ArgumentOutOfRangeException("num", num, "The value cannot be negative.");
+                throw new ArgumentOutOfRangeException(nameof(num), "The value cannot be negative.");
             }
             output.WriteByte((byte)(num >> 24));
             output.WriteByte((byte)(0xFF & (num >> 16)));


Don't access the clipboard from a unit-test by default.

--- src/Microsoft.Language.Xml.Tests/TestClassifier.cs
+++ src/Microsoft.Language.Xml.Tests/TestClassifier.cs
@@ -255,7 +255,7 @@
                 var prefix = new string(' ', 16) + "XmlClassificationTypes.";
                 var actualText = string.Join(",\r\n", actualClassifications
                     .Select(s => prefix + s)) + ");";
-                Clipboard.SetText(actualText);
+                // Clipboard.SetText(actualText);
                 Assert.True(equal, "classifications differ. Actual:\r\n" + actualText);
             }
         }


Consolidate ban logging

Consolidate ban logging

--- src/Miningcore/Blockchain/Equihash/EquihashPool.cs
+++ src/Miningcore/Blockchain/Equihash/EquihashPool.cs
@@ -195,7 +195,7 @@
                 await connection.RespondErrorAsync(StratumError.UnauthorizedWorker, "Authorization failed", request.Id, context.IsAuthorized);

                 // issue short-time ban if unauthorized to prevent DDos on daemon (validateaddress RPC)
-                logger.Info(() => $"[{connection.ConnectionId}] Banning unauthorized worker for {loginFailureBanTimeout.TotalSeconds} sec");
+                logger.Info(() => $"[{connection.ConnectionId}] Banning unauthorized worker {minerName} for {loginFailureBanTimeout.TotalSeconds} sec");

                 banManager.Ban(connection.RemoteEndpoint.Address, loginFailureBanTimeout);


Mobile client: upload image in background

--- src/Mobile/ContosoMoments/Views/ImagesList.xaml.cs
+++ src/Mobile/ContosoMoments/Views/ImagesList.xaml.cs
@@ -65,7 +65,11 @@

                     if (sourceImagePath != null) {
                         var image = await _app.AddImageAsync(_app.CurrentUserId, viewModel.Album, sourceImagePath);
-                        await SyncItemsAsync(true, refreshView: false);
+
+                        #pragma warning disable CS4014  // should not await call so that it happens in the background
+                        SyncItemsAsync(true, refreshView: false);
+                        #pragma warning restore CS4014
+
                         viewModel.Images.Add(image);
                     }


Do not use Wait() to wait for polling client

--- src/NEventStore.Tests/Client/PollingClientTests.cs
+++ src/NEventStore.Tests/Client/PollingClientTests.cs
@@ -319,10 +319,10 @@
         }

         [Fact]
-        public void should_observe_commit_from_bucket1()
-        {
-            //throw new NotImplementedException();
-            _commitObserved.Wait(PollingInterval * 2).Should().Be(true);
+        public async Task should_observe_commit_from_bucket1()
+        {
+            var result = await Task.WhenAny(_commitObserved, Task.Delay(PollingInterval * 2));
+            result.Should().Be(_commitObserved);
             _commitObserved.Result.BucketId.Should().Be("bucket_1");
         }
     }


Add missing EditorBrowsable attributes

Add missing EditorBrowsable attributes

--- src/FakeItEasy/A.cs
+++ src/FakeItEasy/A.cs
@@ -113,6 +113,7 @@
         /// <param name="typeOfDummy">The type of dummy to return.</param>
         /// <returns>A dummy object of the specified type.</returns>
         /// <exception cref="ArgumentException">Dummies of the specified type can not be created.</exception>
+        [EditorBrowsable(EditorBrowsableState.Advanced)]
         public static object Dummy(Type typeOfDummy)
         {
             return FakeCreator.CreateDummy(typeOfDummy);
@@ -126,6 +127,7 @@
         /// <returns>A collection of dummy objects of the specified type.</returns>
         /// <exception cref="ArgumentException">Dummies of the specified type can not be created.</exception>
         [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Used to specify the type of dummy.")]
+        [EditorBrowsable(EditorBrowsableState.Advanced)]
         public static IList<T> CollectionOfDummy<T>(int numberOfDummies)
         {
             return FakeCreator.CollectionOfDummy<T>(numberOfDummies);
@@ -138,6 +140,7 @@
         /// <param name="numberOfDummies">The number of dummies in the collection.</param>
         /// <returns>A collection of dummy objects of the specified type.</returns>
         /// <exception cref="ArgumentException">Dummies of the specified type can not be created.</exception>
+        [EditorBrowsable(EditorBrowsableState.Advanced)]
         public static IList<object> CollectionOfDummy(Type typeOfDummy, int numberOfDummies)
         {
             return FakeCreator.CollectionOfDummy(typeOfDummy, numberOfDummies);


When a Convention class is present in the test assembly, stop assuming the DefaultConvention. When a TestAssembly class is present in the test assembly, stop assuming that all local Convention classes should be applied.

--- src/Fixie/Runner.cs
+++ src/Fixie/Runner.cs
@@ -83,22 +83,14 @@

         static Convention[] GetConventions(RunContext runContext)
         {
-            var explicitlyAppliedConventionTypes =
-                runContext.Assembly
-                    .GetTypes()
-                    .Where(t => t.IsSubclassOf(typeof(TestAssembly)) && !t.IsAbstract)
-                    .Select(t => Construct<TestAssembly>(t, runContext))
-                    .ToArray().SelectMany(x => x.ConventionTypes);
+            var testAssemblyTypes = ConcreteTestAssemblyTypes(runContext);

-            var localConventionTypes =
-                runContext.Assembly
-                    .GetTypes()
-                    .Where(t => t.IsSubclassOf(typeof(Convention)) && !t.IsAbstract);
+            var conventionTypes = testAssemblyTypes.Any()
+                ? ExplicitlyAppliedConventionTypes(runContext, testAssemblyTypes)
+                : LocallyDeclaredConventionTypes(runContext);

             var customConventions =
-                localConventionTypes
-                    .Concat(explicitlyAppliedConventionTypes)
-                    .Distinct()
+                conventionTypes
                     .Select(t => Construct<Convention>(t, runContext))
                     .ToArray();

@@ -106,6 +98,30 @@
                 return customConventions;

             return new[] { (Convention) new DefaultConvention() };
+        }
+
+        static Type[] ConcreteTestAssemblyTypes(RunContext runContext)
+        {
+            return runContext.Assembly
+                .GetTypes()
+                .Where(t => t.IsSubclassOf(typeof(TestAssembly)) && !t.IsAbstract)
+                .ToArray();
+        }
+
+        static Type[] ExplicitlyAppliedConventionTypes(RunContext runContext, Type[] testAssemblyTypes)
+        {
+            return testAssemblyTypes
+                .Select(t => Construct<TestAssembly>(t, runContext))
+                .SelectMany(x => x.ConventionTypes)
+                .ToArray();
+        }
+
+        static Type[] LocallyDeclaredConventionTypes(RunContext runContext)
+        {
+            return runContext.Assembly
+                .GetTypes()
+                .Where(t => t.IsSubclassOf(typeof(Convention)) && !t.IsAbstract)
+                .ToArray();
         }

         AssemblyResult Run(RunContext runContext, IEnumerable<Convention> conventions, params Type[] candidateTypes)


简单增强了一下MS-SQL序列函数的转义。 :zap:

简单增强了一下MS-SQL序列函数的转义。 :zap:

--- drivers/mssql/MsSqlExpressionVisitor.cs
+++ drivers/mssql/MsSqlExpressionVisitor.cs
@@ -243,10 +243,21 @@
 			[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
 			private string GetSequenceName(SequenceExpression sequence)
 			{
-				if(sequence.Method != SequenceMethod.Current)
-					throw new DataException($"The SQL Server driver does not support the '{sequence.Method.ToString()}' sequence function.");
-
-				return "SCOPE_IDENTITY()";
+				if(string.IsNullOrEmpty(sequence.Name))
+				{
+					if(sequence.Method == SequenceMethod.Current)
+						return "SCOPE_IDENTITY()";
+
+					throw new DataException($"The SQL Server driver does not support the '{sequence.Method.ToString()}' sequence function without a name argument.");
+				}
+
+				switch(sequence.Method)
+				{
+					case SequenceMethod.Next:
+						return "NEXT VALUE FOR " + sequence.Name;
+					default:
+						throw new DataException($"The SQL Server driver does not support the '{sequence.Method.ToString()}' sequence function with a name argument.");
+				}
 			}
 			#endregion
 		}


Missed a key press

Missed a key press

--- dwCheckApi.Tests/DatabaseSeederTests.cs
+++ dwCheckApi.Tests/DatabaseSeederTests.cs
@@ -1,5 +1,5 @@
 using System.Collections.Generic;
-using dwCheckApt.Tests.Helpers;
+using dwCheckApi.Tests.Helpers;
 using Moq;
 using Xunit;
 using System.IO;


fix: 修复数据模式解析器对多级导航的处理逻辑问题。 :fish_cake: :mushroom:

--- src/SchemaParser.cs
+++ src/SchemaParser.cs
@@ -78,8 +78,10 @@

 				data.Entity = ((IEntityComplexPropertyMetadata)parent.Token.Property).GetForeignEntity(out var foreignProperty);

-				if(foreignProperty != null && foreignProperty.IsComplex)
-					data.Entity = ((IEntityComplexPropertyMetadata)foreignProperty).GetForeignEntity(out _);
+				while(foreignProperty != null && foreignProperty.IsComplex)
+				{
+					data.Entity = ((IEntityComplexPropertyMetadata)foreignProperty).GetForeignEntity(out foreignProperty);
+				}

 				if(parent.Token.Member != null)
 				{


changes.

changes.

--- src/TWCore/Watch.cs
+++ src/TWCore/Watch.cs
@@ -217,6 +217,34 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static WItem Create(string startMessage, string endMessage, LogLevel level) => WItem.CreateItem(startMessage, endMessage, level);
         /// <summary>
+        /// Create a new watch item to log execution times
+        /// </summary>
+        /// <param name="message">Message before disposal</param>
+        /// <param name="level">Log level</param>
+        /// <param name="group">Group value</param>
+        /// <returns>Watch item</returns>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public static WItem Create(string message, LogLevel level, string group) => WItem.CreateItem(message, level, group);
+        /// <summary>
+        /// Create a new watch item to log execution times
+        /// </summary>
+        /// <param name="startMessage">Message start</param>
+        /// <param name="endMessage">Message before disposal</param>
+        /// <param name="group">Group value</param>
+        /// <returns>Watch item</returns>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public static WItem Create(string startMessage, string endMessage, string group) => WItem.CreateItem(startMessage, endMessage, group);
+        /// <summary>
+        /// Create a new watch item to log execution times
+        /// </summary>
+        /// <param name="startMessage">Message start</param>
+        /// <param name="endMessage">Message before disposal</param>
+        /// <param name="level">Log level</param>
+        /// <param name="group">Group value</param>
+        /// <returns>Watch item</returns>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public static WItem Create(string startMessage, string endMessage, LogLevel level, string group) => WItem.CreateItem(startMessage, endMessage, level, group);
+        /// <summary>
         /// Enable Watch stats lines indent
         /// </summary>
         public static bool EnableIndent { get; set; } = true;
@@ -243,11 +271,12 @@
             {
                 double gTime;
                 double cTime;
+                var gValue = string.IsNullOrEmpty(item.Group) ? item.Id.ToString("00") : item.Group;
                 var indent = EnableIndent ? IndentTexts.GetOrAdd(item.Id, num => new string(' ', (num - 1) * 2)) : string.Empty;
                 switch (item.Type)
                 {
                     case 0:
-                        Core.Log.Write(item.Level, indent + "[" + item.Id.ToString("00") + "-START] " + item.Message);
+                        Core.Log.Write(item.Level, indent + "[" + gValue + "-START] " + item.Message);
                         break;
                     case 1:
                         cTime = item.LastTapTicks * FrequencyTime;
@@ -255,11 +284,11 @@
                         if (Math.Abs(item.LastTapTicks - item.GlobalTicks) > 0.0000001)
                         {
                             gTime = item.GlobalTicks * FrequencyTime;
-                            Core.Log.Write(item.Level, indent + string.Format("  [{0:00}-TAP, Time = {1:0.0000}ms, Cumulated = {2:0.0000}ms] {3}", item.Id, cTime, gTime, item.Message));
+                            Core.Log.Write(item.Level, indent + string.Format("  [{0}-TAP, Time = {1:0.0000}ms, Cumulated = {2:0.0000}ms] {3}", gValue, cTime, gTime, item.Message));
                         }
                         else
                         {
-                            Core.Log.Write(item.Level, indent + string.Format("  [{0:00}-TAP, Time = {1:0.0000}ms] {2}", item.Id, cTime, item.Message));
+                            Core.Log.Write(item.Level, indent + string.Format("  [{0}-TAP, Time = {1:0.0000}ms] {2}", gValue, cTime, item.Message));
                         }
                         break;
                     case 2:
@@ -267,9 +296,9 @@
                         gTime = item.GlobalTicks * FrequencyTime;
                         item.Counter?.Register(item.Counter.Name == CounterPreffix + item.Message ? "Total" : item.Message, cTime);
                         if (Math.Abs(cTime - gTime) > 0.0000001)
-                            Core.Log.Write(item.Level, indent + string.Format("[{0:00}-END, Time = {1:0.0000}ms, Total Time = {2:0.0000}ms] {3}", item.Id, cTime, gTime, item.Message));
+                            Core.Log.Write(item.Level, indent + string.Format("[{0}-END, Time = {1:0.0000}ms, Total Time = {2:0.0000}ms] {3}", gValue, cTime, gTime, item.Message));
                         else
-                            Core.Log.Write(item.Level, indent + string.Format("[{0:00}-END, Total Time = {1:0.0000}ms] {2}", item.Id, gTime, item.Message));
+                            Core.Log.Write(item.Level, indent + string.Format("[{0}-END, Total Time = {1:0.0000}ms] {2}", gValue, gTime, item.Message));
                         break;
                 }
             }
@@ -283,6 +312,7 @@
             [DebuggerBrowsable(DebuggerBrowsableState.Never)] private double _ticksTimestamp;
             [DebuggerBrowsable(DebuggerBrowsableState.Never)] private double _lastTapTicks;
             [DebuggerBrowsable(DebuggerBrowsableState.Never)] private LogLevel _level;
+            [DebuggerBrowsable(DebuggerBrowsableState.Never)] private string _groupValue;
             private int _id;
             private string _lastMessage;
             private StatusCounter _counter;
@@ -312,10 +342,11 @@
                 public readonly string Message;
                 public readonly int Type;
                 public readonly LogLevel Level;
+                public readonly string Group;
                 public readonly StatusCounter Counter;

                 [MethodImpl(MethodImplOptions.AggressiveInlining)]
-                public LogStatItem(int id, LogLevel level, double globalTicks, double lastTapTicks, string message, StatusCounter counter, int type)
+                public LogStatItem(int id, LogLevel level, double globalTicks, double lastTapTicks, string message, string group, StatusCounter counter, int type)
                 {
                     Id = id;
                     Level = level;
@@ -324,6 +355,7 @@
                     Message = message;
                     Counter = counter;
                     Type = type;
+                    Group = group;
                 }
             }
             #endregion
@@ -337,6 +369,7 @@
                 _initTicks = _ticksTimestamp;
                 _lastTapTicks = _ticksTimestamp;
                 _level = LogLevel.Stats;
+                _groupValue = null;
             }

             [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -344,6 +377,7 @@
             {
                 var item = ItemPools.New();
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._counter = null;
                 return item;
             }
@@ -352,6 +386,7 @@
             {
                 var item = ItemPools.New();
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._level = level;
                 item._counter = null;
                 return item;
@@ -362,6 +397,7 @@
                 var item = ItemPools.New();
                 item._lastMessage = message;
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._counter = Counters.GetOrAdd(message, msg =>  new StatusCounter(CounterPreffix + msg));
                 item.StartedTap(message);
                 return item;
@@ -372,6 +408,7 @@
                 var item = ItemPools.New();
                 item._lastMessage = message;
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._level = level;
                 item._counter = Counters.GetOrAdd(message, msg =>  new StatusCounter(CounterPreffix + msg));
                 item.StartedTap(message);
@@ -383,6 +420,7 @@
                 var item = ItemPools.New();
                 item._lastMessage = lastMessage;
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._counter = Counters.GetOrAdd(startMessage, msg =>  new StatusCounter(CounterPreffix + msg));
                 item.StartedTap(startMessage);
                 return item;
@@ -393,11 +431,47 @@
                 var item = ItemPools.New();
                 item._lastMessage = lastMessage;
                 item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = null;
                 item._level = level;
                 item._counter = Counters.GetOrAdd(startMessage, msg =>  new StatusCounter(CounterPreffix + msg));
                 item.StartedTap(startMessage);
                 return item;
             }
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            internal static WItem CreateItem(string message, LogLevel level, string groupValue)
+            {
+                var item = ItemPools.New();
+                item._lastMessage = message;
+                item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = groupValue;
+                item._level = level;
+                item._counter = Counters.GetOrAdd(message, msg => new StatusCounter(CounterPreffix + msg));
+                item.StartedTap(message);
+                return item;
+            }
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            internal static WItem CreateItem(string startMessage, string lastMessage, string groupValue)
+            {
+                var item = ItemPools.New();
+                item._lastMessage = lastMessage;
+                item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = groupValue;
+                item._counter = Counters.GetOrAdd(startMessage, msg => new StatusCounter(CounterPreffix + msg));
+                item.StartedTap(startMessage);
+                return item;
+            }
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
+            internal static WItem CreateItem(string startMessage, string lastMessage, LogLevel level, string groupValue)
+            {
+                var item = ItemPools.New();
+                item._lastMessage = lastMessage;
+                item._id = Interlocked.Increment(ref _watcherCount);
+                item._groupValue = groupValue;
+                item._level = level;
+                item._counter = Counters.GetOrAdd(startMessage, msg => new StatusCounter(CounterPreffix + msg));
+                item.StartedTap(startMessage);
+                return item;
+            }
             #endregion

@@ -412,7 +486,7 @@
                 var currentTicks = Stopwatch.GetTimestamp();
                 _lastTapTicks = currentTicks - _ticksTimestamp;
                 if (Core.Log.MaxLogLevel.HasFlag(_level))
-                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _counter, 1));
+                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _groupValue, _counter, 1));
                 _ticksTimestamp = currentTicks;
             }
             /// <summary>
@@ -425,7 +499,7 @@
                 var currentTicks = Stopwatch.GetTimestamp();
                 _lastTapTicks = currentTicks - _ticksTimestamp;
                 if (message != null && Core.Log.MaxLogLevel.HasFlag(_level))
-                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _counter, 0));
+                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _groupValue, _counter, 0));
                 _ticksTimestamp = currentTicks;
             }
             /// <summary>
@@ -438,7 +512,7 @@
                 var currentTicks = Stopwatch.GetTimestamp();
                 _lastTapTicks = currentTicks - _ticksTimestamp;
                 if (message != null && Core.Log.MaxLogLevel.HasFlag(_level))
-                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _counter, 2));
+                    LogStatsWorker.Enqueue(new LogStatItem(_id, _level, currentTicks - _initTicks, _lastTapTicks, message, _groupValue, _counter, 2));
                 _ticksTimestamp = currentTicks;
             }
             /// <summary>


Restore tags in durable objects

Restore tags in durable objects

--- src/Totem/Notion.cs
+++ src/Totem/Notion.cs
@@ -12,14 +12,11 @@
 	/// </summary>
 	public abstract class Notion : IWritable, ITaggable
 	{
-		protected Notion()
-		{
-			Tags = new Tags();
-		}
+		private Tags _tags;

 		Tags ITaggable.Tags { get { return Tags; } }

-		protected Tags Tags { get; private set; }
+		protected Tags Tags { get { return _tags ?? (_tags = new Tags()); } }

 		protected IClock Clock { get { return Traits.Clock.Get(this); } }
 		protected ILog Log { get { return Traits.Log.Get(this); } }


#945 Nick / Raj - Addding unit tests for reoccurring events

--- test/StockportContentApiTests/Unit/Repositories/EventRepositoryTest.cs
+++ test/StockportContentApiTests/Unit/Repositories/EventRepositoryTest.cs
@@ -76,6 +76,24 @@
         }

         [Fact]
+        public void GetReoccuringEventsNextEventOnly()
+        {
+            // Arrange - mock reoccurring event, starting in the past that passes today
+            _mockTimeProvider.Setup(o => o.Now()).Returns(new DateTime(2017, 07, 01));
+            var rawEvent = new ContentfulEventBuilder().EventCategory(new List<string>() { "category" }).EventDate(new DateTime(2017, 06, 01)).Occurrences(10).Frequency(EventFrequency.Weekly).Build();
+            var events = new List<ContentfulEvent> { rawEvent };
+            _contentfulClient.Setup(
+                   o => o.GetEntriesAsync<ContentfulEvent>(It.IsAny<QueryBuilder<ContentfulEvent>>(), It.IsAny<CancellationToken>()))
+               .ReturnsAsync(events);
+
+            // Act - return events using a method which checks occurances
+            var result = AsyncTestHelper.Resolve(_repository.GetEventsByCategory("category"));
+
+            // Assert - Check event date is first date that occurs in the future
+            result[0].EventDate.Should().Be(new DateTime(2017, 07, 06));
+        }
+
+        [Fact]
         public void GetsASingleEventItemFromASlug()
         {
             const string slug = "event-of-the-century";


Reorganizing BinaryTree tests: Pre Order Depth First Iterative Traversal

--- tests/DataStructuresAlgorithms.Tests/DataStructures/BinaryTreeTests.cs
+++ tests/DataStructuresAlgorithms.Tests/DataStructures/BinaryTreeTests.cs
@@ -183,6 +183,24 @@
         }
     }

+    [Collection("Binary Tree Traversal Collection")]
+    public class BinaryTreePreOrderTraversalIterativeIteratorTests
+    : BinaryTreeTraversalTests
+    {
+        public BinaryTreePreOrderTraversalIterativeIteratorTests(
+            BinaryTreeTraversalFixture fixture)
+        {
+            this.fixture = fixture;
+            traversalType = "dft-pre";
+            TraversalAlgorithmChar = (INode<char> node)
+                => BinaryTree<char>.PreOrderTraversalIterativeIterator(node,
+                new StackSinglyLinkedList<INode<char>>());
+            TraversalAlgorithmInt = (INode<int> node)
+                => BinaryTree<int>.PreOrderTraversalIterativeIterator(node,
+                new StackSinglyLinkedList<INode<int>>());
+        }
+    }
+
     public class BinaryTreeTests
     {
         BinaryTree<int> travTree0;
@@ -241,34 +259,6 @@
         }

         [Fact]
-        public void InOrderTraversalRecursiveIteratorTest()
-        {
-            Console.WriteLine("\nInOrderTraversalRecursionTest1");
-            var orderedVals = new int[] { 25, 50, 75, 100, 110, 125, 150, 175 };
-            var orderedLetters = "HJIDBLMKEAFCSRNGOPQ".ToCharArray();
-
-            int i = 0;
-            foreach (var nodeVal in BinaryTree<int>.InOrderTraversalRecursiveIterator(travTree0.Root))
-            {
-                Assert.True(nodeVal.Value == orderedVals[i++]);
-            }
-            foreach(var nodeVal in BinaryTree<int>.InOrderTraversalRecursiveIterator(null))
-            {
-                Assert.True(false);
-            }
-
-            i = 0;
-            foreach (var nodeLetter in BinaryTree<char>.InOrderTraversalRecursiveIterator(treeLetters.Root))
-            {
-                Assert.True(nodeLetter.Value == orderedLetters[i++]);
-            }
-            foreach (var nodeLetter in BinaryTree<char>.InOrderTraversalRecursiveIterator(null))
-            {
-                Assert.True(false);
-            }
-        }
-
-        [Fact]
         public void HeightTest()
         {
             Console.WriteLine("\nHeightTest");
@@ -297,42 +287,6 @@
         }

         [Fact]
-        public void PreOrderTraversalIterativeIteratorTest()
-        {
-            Console.WriteLine("\nPreOrderTraversalIterativeIteratorTest");
-            var orderedVals = new int[] { 100, 50, 25, 75, 150, 125, 110, 175 };
-            var orderedLetters = "ABDHIJEKLMCFGNRSOPQ".ToCharArray();
-
-            int i = 0;
-            foreach (var nodeVal in BinaryTree<int>
-                .PreOrderTraversalIterativeIterator(travTree0.Root,
-                new StackSinglyLinkedList<INode<int>>()))
-            {
-                Assert.True(nodeVal.Value == orderedVals[i++]);
-            }
-            foreach (var nodeVal in BinaryTree<int>
-                .PreOrderTraversalIterativeIterator(null,
-                new StackSinglyLinkedList<INode<int>>()))
-            {
-                Assert.True(false);
-            }
-
-            i = 0;
-            foreach (var nodeLetter in BinaryTree<char>
-                .PreOrderTraversalIterativeIterator(treeLetters.Root,
-                new StackSinglyLinkedList<INode<char>>()))
-            {
-                Assert.True(nodeLetter.Value == orderedLetters[i++]);
-            }
-            foreach (var nodeLetter in BinaryTree<char>
-                .PreOrderTraversalIterativeIterator(null,
-                new StackSinglyLinkedList<INode<char>>()))
-            {
-                Assert.True(false);
-            }
-        }
-
-        [Fact]
         public void InOrderTraversalIterativeIteratorTest()
         {
             Console.WriteLine("\nInOrderTraversalIterativeIteratorTest");


NR Use ExtendedExecutionSession to get more time to save and upload data

--- src/NewsReader/NewsReader.Presentation/App.xaml.cs
+++ src/NewsReader/NewsReader.Presentation/App.xaml.cs
@@ -2,6 +2,7 @@
 using Jbe.NewsReader.Applications.Services;
 using Jbe.NewsReader.Applications.ViewModels;
 using Jbe.NewsReader.ExternalServices;
+using System;
 using System.Collections.Generic;
 using System.Composition.Hosting;
 using System.Globalization;
@@ -10,6 +11,7 @@
 using System.Threading.Tasks;
 using Windows.ApplicationModel;
 using Windows.ApplicationModel.Activation;
+using Windows.ApplicationModel.ExtendedExecution;
 using Windows.Globalization;
 using Windows.Storage;
 using Windows.System.UserProfile;
@@ -79,7 +81,12 @@
         private async void OnSuspending(object sender, SuspendingEventArgs e)
         {
             var deferral = e.SuspendingOperation.GetDeferral();
-            await Task.WhenAll(appControllers.Select(x => x.SuspendingAsync())).ConfigureAwait(false);
+            using (var session = new ExtendedExecutionSession())
+            {
+                session.Reason = ExtendedExecutionReason.SavingData;
+                var requestTask = session.RequestExtensionAsync().AsTask();
+                await Task.WhenAll(appControllers.Select(x => x.SuspendingAsync()).Concat(new[] { requestTask }).ToArray()).ConfigureAwait(false);
+            }
             deferral.Complete();
         }
     }


Brought over some extension methods on IContentManager to simplify the API

--HG--
branch : dev

--- src/Orchard/ContentManagement/ContentExtensions.cs
+++ src/Orchard/ContentManagement/ContentExtensions.cs
@@ -21,6 +21,14 @@
             return part;
         }

+        public static void Create(this IContentManager manager, IContent content) {
+            manager.Create(content.ContentItem, VersionOptions.Draft);
+            manager.Publish(content.ContentItem);
+        }
+
+        public static void Create(this IContentManager manager, IContent content, VersionOptions options) {
+            manager.Create(content.ContentItem, options);
+        }

         public static ContentItem Create(this IContentManager manager, string contentType) {
             return manager.Create<ContentItem>(contentType, init => { });


HttpTransport shuould still default to 12201

--- src/Serilog.Sinks.Graylog.Core/TransportFactory.cs
+++ src/Serilog.Sinks.Graylog.Core/TransportFactory.cs
@@ -65,7 +65,7 @@
                 case SinkTransportType.Http: {
                     var builder = new UriBuilder {
                         Host = _options.HostnameOrAddress,
-                        Port = _options.Port ?? -1,
+                        Port = _options.Port.GetValueOrDefault(12201),
                         Path = "gelf"
                     };


Register the IMessageFactory if it's not registered but IMessageService is.

--- src/ServiceStack/WebHost.Endpoints/EndpointHost.cs
+++ src/ServiceStack/WebHost.Endpoints/EndpointHost.cs
@@ -8,6 +8,7 @@
 using ServiceStack.Common.Web;
 using ServiceStack.Html;
 using ServiceStack.IO;
+using ServiceStack.Messaging;
 using ServiceStack.MiniProfiler;
 using ServiceStack.ServiceHost;
 using ServiceStack.VirtualPath;
@@ -185,6 +186,13 @@
                 }
             }

+            var registeredMqService = AppHost.TryResolve<IMessageService>();
+            var registeredMqFactory = AppHost.TryResolve<IMessageFactory>();
+            if (registeredMqService != null && registeredMqFactory == null)
+            {
+                Container.Register(c => registeredMqService.MessageFactory);
+            }
+
             ReadyAt = DateTime.UtcNow;
         }


release type not track type on the track schema

--- src/SevenDigital.Api.Schema/TrackEndpoint/Track.cs
+++ src/SevenDigital.Api.Schema/TrackEndpoint/Track.cs
@@ -48,6 +48,6 @@
 		public Price Price { get; set; }

 		[XmlElement("type")]
-		public ItemType Type { get; set; }
+		public ReleaseType Type { get; set; }
 	}
 }


(GH-356) Resolve sources by name

(GH-356) Resolve sources by name

When passing -source, allow passing the name of the source and choco
will resolve the actual source value and update the actual sources
appropriately.

--- src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
+++ src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
@@ -17,7 +17,10 @@
 {
     using System;
     using System.Collections.Generic;
+    using System.Linq;
     using System.Net;
+    using System.Text;
+    using infrastructure.configuration;
     using NuGet;
     using configuration;
     using logging;
@@ -71,8 +74,26 @@
                 ProxyCache.Instance.Override(proxy);
             }

-            foreach (var source in sources.or_empty_list_if_null())
-            {
+            var updatedSources = new StringBuilder();
+            foreach (var sourceValue in sources.or_empty_list_if_null())
+            {
+
+                var source = sourceValue;
+                if (configuration.MachineSources.Any(m => m.Name.is_equal_to(source)))
+                {
+                    "chocolatey".Log().Debug("Switching source name {0} to actual source value.".format_with(sourceValue));
+                    try
+                    {
+                        source = configuration.MachineSources.FirstOrDefault(m => m.Name.is_equal_to(source)).Key;
+                    }
+                    catch (Exception ex)
+                    {
+                        "chocolatey".Log().Warn("Attempted to use a source name {0} to get default source but failed:{1} {2}".format_with(sourceValue, Environment.NewLine, ex.Message));
+                    }
+                }
+
+                updatedSources.AppendFormat("{0};", source);
+
                 try
                 {
                     var uri = new Uri(source);
@@ -89,6 +110,11 @@
                 {
                     repositories.Add(new ChocolateyLocalPackageRepository(source));
                 }
+            }
+
+            if (updatedSources.Length != 0)
+            {
+                configuration.Sources = updatedSources.Remove(updatedSources.Length - 1, 1).to_string();
             }

             //todo well that didn't work on failing repos... grrr


Check the state before fetching the thread id

To be consistent with a similar change to LINQ's Iterator.

--- src/System.IO.FileSystem/src/System/IO/Iterator.cs
+++ src/System.IO.FileSystem/src/System/IO/Iterator.cs
@@ -41,7 +41,7 @@

         public IEnumerator<TSource> GetEnumerator()
         {
-            if (_threadId == Environment.CurrentManagedThreadId && state == 0)
+            if (state == 0 && _threadId == Environment.CurrentManagedThreadId)
             {
                 state = 1;
                 return this;


Reduce time taken to test StackGuard and move to innerloop.

We have a test that verifies that Expression compilation is protected
against stack overflow in the case of compiling deep expression trees,
but forcing a case that would cause such a problem by necessity
requires a large tree that takes a long time to compiile, so the test
is outerloop only.

Forcing the compilation to happen on the smallest possible stack
reduces the size of tree that would risk a stack overflow, and so can
test the same functionality in less than a second.

Do this, and move the test to innerloop.

--- src/System.Linq.Expressions/tests/CompilerTests.cs
+++ src/System.Linq.Expressions/tests/CompilerTests.cs
@@ -3,6 +3,7 @@
 // See the LICENSE file in the project root for more information.

 using System.Runtime.CompilerServices;
+using System.Threading;
 using Xunit;

 namespace System.Linq.Expressions.Tests
@@ -22,6 +23,28 @@
                 e = Expression.Add(e, Expression.Constant(1));

             Func<int> f = Expression.Lambda<Func<int>>(e).Compile(useInterpreter);
+
+            Assert.Equal(n, f());
+        }
+
+        [Theory, ClassData(typeof(CompilationTypes))]
+        public static void CompileDeepTree_NoStackOverflowFast(bool useInterpreter)
+        {
+            Expression e = Expression.Constant(0);
+
+            int n = 100;
+
+            for (int i = 0; i < n; i++)
+                e = Expression.Add(e, Expression.Constant(1));
+
+            Func<int> f = null;
+            // Request a stack size of 1 to get the minimum size allowed.
+            // This reduces the size of tree needed to risk a stack overflow.
+            // This though will only risk overflow once, so the outerloop test
+            // above is still needed.
+            Thread t = new Thread(() => f = Expression.Lambda<Func<int>>(e).Compile(useInterpreter), 1);
+            t.Start();
+            t.Join();

             Assert.Equal(n, f());
         }


NS2.0 Complete System.IO.Stream surface area (#3238)

ObjectInvariant - an obsolete method for supporting
contracts...

CreateWaitHandle - not too useful by itself,
but I assume this was meant to be overridden
by something more useful.

Synchronized - creates SyncStream.

-

Keeping Stream structured the same as the
CoreCLR version. Not going to attempt to share
this as there still lots of scary looking
async differences. I'll leave this to the
area owner.

--- src/System.Private.CoreLib/src/System/IO/Stream.cs
+++ src/System.Private.CoreLib/src/System/IO/Stream.cs
@@ -233,6 +233,12 @@
                 cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
         }

+        [Obsolete("CreateWaitHandle will be removed eventually.  Please use \"new ManualResetEvent(false)\" instead.")]
+        protected virtual WaitHandle CreateWaitHandle()
+        {
+            return new ManualResetEvent(initialState: false);
+        }
+
         public Task<int> ReadAsync(Byte[] buffer, int offset, int count)
         {
             return ReadAsync(buffer, offset, count, CancellationToken.None);
@@ -364,6 +370,22 @@
             Write(oneByteArray, 0, 1);
         }

+        public static Stream Synchronized(Stream stream)
+        {
+            if (stream == null)
+                throw new ArgumentNullException(nameof(stream));
+
+            if (stream is SyncStream)
+                return stream;
+
+            return new SyncStream(stream);
+        }
+
+        [Obsolete("Do not call or override this method.")]
+        protected virtual void ObjectInvariant()
+        {
+        }
+
         private sealed class NullStream : Stream
         {
             internal NullStream() { }
@@ -488,5 +510,233 @@
             {
             }
         }
+
+        // SyncStream is a wrapper around a stream that takes
+        // a lock for every operation making it thread safe.
+        [Serializable]
+        private sealed class SyncStream : Stream, IDisposable
+        {
+            private Stream _stream;
+
+            internal SyncStream(Stream stream)
+            {
+                if (stream == null)
+                    throw new ArgumentNullException(nameof(stream));
+
+                _stream = stream;
+            }
+
+            public override bool CanRead
+            {
+                [Pure]
+                get { return _stream.CanRead; }
+            }
+
+            public override bool CanWrite
+            {
+                [Pure]
+                get { return _stream.CanWrite; }
+            }
+
+            public override bool CanSeek
+            {
+                [Pure]
+                get { return _stream.CanSeek; }
+            }
+
+            public override bool CanTimeout
+            {
+                [Pure]
+                get
+                {
+                    return _stream.CanTimeout;
+                }
+            }
+
+            public override long Length
+            {
+                get
+                {
+                    lock (_stream)
+                    {
+                        return _stream.Length;
+                    }
+                }
+            }
+
+            public override long Position
+            {
+                get
+                {
+                    lock (_stream)
+                    {
+                        return _stream.Position;
+                    }
+                }
+                set
+                {
+                    lock (_stream)
+                    {
+                        _stream.Position = value;
+                    }
+                }
+            }
+
+            public override int ReadTimeout
+            {
+                get
+                {
+                    return _stream.ReadTimeout;
+                }
+                set
+                {
+                    _stream.ReadTimeout = value;
+                }
+            }
+
+            public override int WriteTimeout
+            {
+                get
+                {
+                    return _stream.WriteTimeout;
+                }
+                set
+                {
+                    _stream.WriteTimeout = value;
+                }
+            }
+
+            // In the off chance that some wrapped stream has different
+            // semantics for Close vs. Dispose, let's preserve that.
+            public override void Close()
+            {
+                lock (_stream)
+                {
+                    try
+                    {
+                        _stream.Close();
+                    }
+                    finally
+                    {
+                        base.Dispose(true);
+                    }
+                }
+            }
+
+            protected override void Dispose(bool disposing)
+            {
+                lock (_stream)
+                {
+                    try
+                    {
+                        // Explicitly pick up a potentially methodimpl'ed Dispose
+                        if (disposing)
+                            ((IDisposable)_stream).Dispose();
+                    }
+                    finally
+                    {
+                        base.Dispose(disposing);
+                    }
+                }
+            }
+
+            public override void Flush()
+            {
+                lock (_stream)
+                    _stream.Flush();
+            }
+
+            public override int Read(byte[] bytes, int offset, int count)
+            {
+                lock (_stream)
+                    return _stream.Read(bytes, offset, count);
+            }
+
+            public override int ReadByte()
+            {
+                lock (_stream)
+                    return _stream.ReadByte();
+            }
+
+            public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state)
+            {
+                throw new NotImplementedException();
+                //bool overridesBeginRead = _stream.HasOverriddenBeginEndRead();
+
+                //lock (_stream)
+                //{
+                //    // If the Stream does have its own BeginRead implementation, then we must use that override.
+                //    // If it doesn't, then we'll use the base implementation, but we'll make sure that the logic
+                //    // which ensures only one asynchronous operation does so with an asynchronous wait rather
+                //    // than a synchronous wait.  A synchronous wait will result in a deadlock condition, because
+                //    // the EndXx method for the outstanding async operation won't be able to acquire the lock on
+                //    // _stream due to this call blocked while holding the lock.
+                //    return overridesBeginRead ?
+                //        _stream.BeginRead(buffer, offset, count, callback, state) :
+                //        _stream.BeginReadInternal(buffer, offset, count, callback, state, serializeAsynchronously: true, apm: true);
+                //}
+            }
+
+            public override int EndRead(IAsyncResult asyncResult)
+            {
+                if (asyncResult == null)
+                    throw new ArgumentNullException(nameof(asyncResult));
+
+                lock (_stream)
+                    return _stream.EndRead(asyncResult);
+            }
+
+            public override long Seek(long offset, SeekOrigin origin)
+            {
+                lock (_stream)
+                    return _stream.Seek(offset, origin);
+            }
+
+            public override void SetLength(long length)
+            {
+                lock (_stream)
+                    _stream.SetLength(length);
+            }
+
+            public override void Write(byte[] bytes, int offset, int count)
+            {
+                lock (_stream)
+                    _stream.Write(bytes, offset, count);
+            }
+
+            public override void WriteByte(byte b)
+            {
+                lock (_stream)
+                    _stream.WriteByte(b);
+            }
+
+            public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state)
+            {
+                throw new NotImplementedException();
+                //bool overridesBeginWrite = _stream.HasOverriddenBeginEndWrite();
+
+                //lock (_stream)
+                //{
+                //    // If the Stream does have its own BeginWrite implementation, then we must use that override.
+                //    // If it doesn't, then we'll use the base implementation, but we'll make sure that the logic
+                //    // which ensures only one asynchronous operation does so with an asynchronous wait rather
+                //    // than a synchronous wait.  A synchronous wait will result in a deadlock condition, because
+                //    // the EndXx method for the outstanding async operation won't be able to acquire the lock on
+                //    // _stream due to this call blocked while holding the lock.
+                //    return overridesBeginWrite ?
+                //        _stream.BeginWrite(buffer, offset, count, callback, state) :
+                //        _stream.BeginWriteInternal(buffer, offset, count, callback, state, serializeAsynchronously: true, apm: true);
+                //}
+            }
+
+            public override void EndWrite(IAsyncResult asyncResult)
+            {
+                if (asyncResult == null)
+                    throw new ArgumentNullException(nameof(asyncResult));
+
+                lock (_stream)
+                    _stream.EndWrite(asyncResult);
+            }
+        }
     }
 }


Rollup job was only ignoring 6.5.0 not <6.5.0

(cherry picked from commit f632ae768ef8d7ec620a84d73819d6f493224430)

--- src/Tests/Tests/XPack/Rollup/RollupJobCrudTests.cs
+++ src/Tests/Tests/XPack/Rollup/RollupJobCrudTests.cs
@@ -13,7 +13,7 @@

 namespace Tests.XPack.Rollup
 {
-	[SkipVersion("6.5.0", "")]
+	[SkipVersion("<6.5.0", "")]
 	public class RollupJobCrudTests
 		: CrudTestBase<TimeSeriesCluster, ICreateRollupJobResponse, IGetRollupJobResponse, ICreateRollupJobResponse, IDeleteRollupJobResponse>
 	{


OnContinue logging corrections

OnContinue logging corrections

--- src/Topshelf/Runtime/Windows/WindowsServiceHost.cs
+++ src/Topshelf/Runtime/Windows/WindowsServiceHost.cs
@@ -163,18 +163,18 @@
         {
             try
             {
-                _log.Info("[Topshelf] Pausing service");
+                _log.Info("[Topshelf] Resuming service");

                 _serviceHandle.Continue(this);
             }
             catch (Exception ex)
             {
-                _log.Fatal("The service did not shut down gracefully", ex);
-                throw;
-            }
-            finally
-            {
-                _log.Info("[Topshelf] Paused");
+                _log.Fatal("The service did not start successfully", ex);
+                throw;
+            }
+            finally
+            {
+                _log.Info("[Topshelf] Resumed");
             }
         }


Removes the 'else' so that 'wait' is always checked.

--- src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs
+++ src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs
@@ -231,12 +231,11 @@
                 // truncate running queues
                 _tokenSource.Cancel(false); // false is the default
             }
-            else
-            {
-                // tasks in the queue will be executed...
-                if (wait == false) return;
-                _runningTask.Wait(); // wait for whatever is running to end...
-            }
+
+            // tasks in the queue will be executed...
+            if (wait == false) return;
+            _runningTask.Wait(); // wait for whatever is running to end...
+
         }

         /// <summary>


fix double execution of event handlers

fix double execution of event handlers

--- src/Weakly.MVVM/EventAggregator/EventAggregator.cs
+++ src/Weakly.MVVM/EventAggregator/EventAggregator.cs
@@ -158,15 +158,16 @@
                     Task.Factory.StartNew(() => InvokeInternal(target, message),
                         CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
                 }
-
-                if (_threadOption == ThreadOption.PublisherThread ||
+                else if (_threadOption == ThreadOption.PublisherThread ||
                     _threadOption == ThreadOption.UIThread && UIContext.CheckAccess())
                 {
                     InvokeInternal(target, message);
                 }
-
-                Task.Factory.StartNew(() => InvokeInternal(target, message),
-                    CancellationToken.None, TaskCreationOptions.None, UIContext.TaskScheduler);
+                else if (_threadOption == ThreadOption.UIThread)
+                {
+                    Task.Factory.StartNew(() => InvokeInternal(target, message),
+                        CancellationToken.None, TaskCreationOptions.None, UIContext.TaskScheduler);
+                }
             }

             private void InvokeInternal(object target, object message)