Minor fix to Unit Tests

Minor fix to Unit Tests

--- FastSms.Tests/UnitTest1.cs
+++ FastSms.Tests/UnitTest1.cs
@@ -103,39 +103,39 @@

 		[TestMethod]
 		public void CheckImportContactsCsvSuccess () {
-			Assert.AreEqual( "Success", ImportContactsCsvResults[0].Status );
+			Assert.AreEqual( "Success", ImportContactsCsvResults[0].Status , "Status must be Success" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvNoName () {
-			Assert.AreEqual( "Failed", ImportContactsCsvResults[2].Status );
+			Assert.AreEqual( "Failed", ImportContactsCsvResults[2].Status , "Status must be Failed" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvNoNumber () {
-			Assert.AreEqual( "Failed", ImportContactsCsvResults[3].Status );
+			Assert.AreEqual( "Failed", ImportContactsCsvResults[3].Status, "Status must be Failed" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvDuplicateName () {
-			Assert.AreEqual( "Duplicate Name", ImportContactsCsvResults[6].Status );
+			Assert.AreEqual( "DuplicateName", ImportContactsCsvResults[6].Status, "Status must be DuplicateName" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvDuplicateNumber () {
-			Assert.AreEqual( "Duplicate Number", ImportContactsCsvResults[7].Status );
+			Assert.AreEqual( "DuplicateNumber", ImportContactsCsvResults[7].Status, "Status must be DuplicateName" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvWithIgnoreDupes () {
 			Client.DeleteAllContacts();
 			ImportContactsCsvResults = Client.ImportContactsCsv( ContactModelList, 1 );
-			Assert.AreEqual( "Success", ImportContactsCsvResults[6].Status );
+			Assert.AreEqual( "Success", ImportContactsCsvResults[6].Status, "Status must be Success" );
 		}

 		[TestMethod]
 		public void CheckImportContactsCsvBadNumber () {
-			Assert.AreEqual( "Failed", ImportContactsCsvResults[4].Status );
+			Assert.AreEqual( "Failed", ImportContactsCsvResults[4].Status, "Status must be Failed" );
 		}

 		[TestMethod]
@@ -183,12 +183,12 @@

 		[TestMethod]
 		public void CheckMessageStatusDelivered () {
-			Assert.AreEqual( "Delivered", Client.CheckMessageStatus( "73786923" ) );
+			Assert.AreEqual( "Delivered", Client.CheckMessageStatus( "73786923" ), "This message is delivered");
 		}

 		[TestMethod]
 		public void CheckMessageStatusUndeliverable () {
-			Assert.AreEqual( "Undeliverable", Client.CheckMessageStatus( "73959607" ) );
+			Assert.AreEqual( "Undeliverable", Client.CheckMessageStatus( "73959607" ), "This message is undelivereble" );
 		}

 		[TestMethod]


Small development

Small development

--- FormEngine/ClassFactory.cs
+++ FormEngine/ClassFactory.cs
@@ -1,6 +1,7 @@
 using FormEngine.Interfaces;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Text;
@@ -12,8 +13,15 @@
     {
         public static T Instanciate(string dllName = "", string className = "")
         {
+            List<Assembly> allAssemblies = new List<Assembly>();
+            string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+            string searchPattern = string.IsNullOrEmpty(dllName) ? "*.dll" : string.Format("*{0}*.dll", dllName.Trim());
+
+            foreach (string dll in Directory.GetFiles(path, searchPattern))
+                allAssemblies.Add(Assembly.LoadFile(dll));
+
             Type interfaceType = typeof(T);
-            List<Assembly> assemblies = AppDomain.CurrentDomain.GetAssemblies()
+            List<Assembly> assemblies = allAssemblies
                 .Where(a => a.GetName().Name.ToLower().Contains(dllName.ToLower())
                     && a.GetTypes().FirstOrDefault(c => interfaceType.IsAssignableFrom(c)) != null).ToList();

@@ -21,7 +29,7 @@

             Type implementationType = assemblies
                 .SelectMany(s => s.GetTypes())
-                .FirstOrDefault(c => interfaceType.IsAssignableFrom(c) && c.Name.ToLower().Contains(className.ToLower()));
+                .FirstOrDefault(c => interfaceType.IsAssignableFrom(c) && c != interfaceType && c.Name.ToLower().Contains(className.ToLower()));

             return (T)Activator.CreateInstance(implementationType);
         }


update

update

--- software/cs/dotnet/SensorClock/Workers/SensorWorker.cs
+++ software/cs/dotnet/SensorClock/Workers/SensorWorker.cs
@@ -13,7 +13,7 @@
         private readonly InfluxDBClient _client;
         private readonly ILogger<Apa102Worker> _logger;

-        public SensorWorker(ILogger<Apa102Worker> logger)
+        public SensorWorker(ILogger<Apa102Worker> logger, IConfiguration configuration)
         {
             _logger = logger;

@@ -31,7 +31,8 @@
                 Gain = Gain.Normal
             };

-            _client = InfluxDBClientFactory.Create("http://localhost:8086");
+            // export CONNECTIONSTRINGS__INFLUXDB="http://localhost:8086?org=&bucket=&token="
+            _client = InfluxDBClientFactory.Create(configuration.GetConnectionString("InfluxDB"));
         }

         protected override async Task ExecuteAsync(CancellationToken stoppingToken)


Fix bug with LevelDataPacket

Fix bug with LevelDataPacket

--- source/Classic/Craft.Net.Classic.Networking/Packets.cs
+++ source/Classic/Craft.Net.Classic.Networking/Packets.cs
@@ -101,7 +101,7 @@
             var length = stream.ReadInt16();
             var data = stream.ReadArray();
             Data = new byte[length];
-            Array.Copy(data, data, length);
+            Array.Copy(data, Data, length);
             Complete = stream.ReadUInt8() / 100.0;
         }


todo ai

todo ai

--- slnLatrunculi/Latrunculi.Impl/Player/LatrunculiBrain.cs
+++ slnLatrunculi/Latrunculi.Impl/Player/LatrunculiBrain.cs
@@ -23,7 +23,7 @@
         {
             Position cur = new Position(color, Board);

-            BestMove = getBestMove(cur, 3, ct);
+            BestMove = getBestMove(cur, level + 1, ct);
         }

         static private int get_max(int ohod1, int ohod2)
@@ -119,51 +119,39 @@
             for (char x = 'A'; x <= 'H'; x++ )
             {
                 c.Set(x, 3);
-                if (pos.Board[c] == own)
+                if (pos.Board[c] == Pieces.pcWhite)
                     result = result + 1 + (x % 2) * 2;

                 c.Set(x, 4);
-                if (pos.Board[c] == own)
+                if (pos.Board[c] == Pieces.pcWhite)
                     result = result + 2 + (x % 2) * 2;

                 c.Set(x, 5);
-                if (pos.Board[c] == own)
+                if (pos.Board[c] == Pieces.pcWhite)
                     result = result + 3 + (x % 2) * 2;
             }
             for (char x = 'A'; x <= 'H'; x++)
             {
                 c.Set(x, 3);
-                if (pos.Board[c] == enem)
+                if (pos.Board[c] == Pieces.pcBlack)
                     result = result - 1 - (x % 2) * 2;

                 c.Set(x, 4);
-                if (pos.Board[c] == enem)
+                if (pos.Board[c] == Pieces.pcBlack)
                     result = result - 2 - (x % 2) * 2;

                 c.Set(x, 5);
-                if (pos.Board[c] == enem)
+                if (pos.Board[c] == Pieces.pcBlack)
                     result = result - 3 - (x % 2) * 2;
             }

-            if (pos.ActivePlayerColor == GameColorsEnum.plrWhite)
+
+            for (char x = 'A'; x <= 'H'; x++)
             {
-                for (char x = 'A'; x <= 'H'; x++)
-                {
-                    c.Set(x, 1);
-                    c2.Set(x, 2);
-                    if (pos.Board[c] == own && pos.Board[c2] == Pieces.pcNone)
-                        result = result + 5;
-                }
-            }
-            else
-            {
-                for (char x = 'A'; x <= 'H'; x++)
-                {
-                    c.Set(x, 7);
-                    c2.Set(x, 6);
-                    if (pos.Board[c] == own && pos.Board[c2] == Pieces.pcNone)
-                        result = result + 5;
-                }
+                c.Set(x, 1);
+                c2.Set(x, 2);
+                if (pos.Board[c] == Pieces.pcWhite && pos.Board[c2] == Pieces.pcNone)
+                    result = result + 1;
             }

             if (pos.MyNumOfPieces - pos.EnemyNumOfPieces > 1)


Throw an exception if D3D12_RESOURCE_HEAP_TIER is not 2

--- sources/Providers/Graphics/D3D12/D3D12GraphicsDevice.cs
+++ sources/Providers/Graphics/D3D12/D3D12GraphicsDevice.cs
@@ -8,11 +8,14 @@
 using static TerraFX.Interop.D3D_FEATURE_LEVEL;
 using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_FLAGS;
 using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE;
+using static TerraFX.Interop.D3D12_FEATURE;
+using static TerraFX.Interop.D3D12_RESOURCE_HEAP_TIER;
 using static TerraFX.Interop.DXGI_FORMAT;
 using static TerraFX.Interop.DXGI_SWAP_EFFECT;
 using static TerraFX.Interop.Windows;
 using static TerraFX.Utilities.DisposeUtilities;
 using static TerraFX.Utilities.ExceptionUtilities;
+using static TerraFX.Utilities.InteropUtilities;
 using static TerraFX.Utilities.State;

 namespace TerraFX.Graphics.Providers.D3D12
@@ -235,6 +238,13 @@
             var iid = IID_ID3D12Device;
             ThrowExternalExceptionIfFailed(nameof(D3D12CreateDevice), D3D12CreateDevice((IUnknown*)D3D12GraphicsAdapter.DxgiAdapter, D3D_FEATURE_LEVEL_11_0, &iid, (void**)&d3d12Device));

+            D3D12_FEATURE_DATA_D3D12_OPTIONS d3d12Options;
+            ThrowExternalExceptionIfFailed(nameof(ID3D12Device.CheckFeatureSupport), d3d12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &d3d12Options, SizeOf<D3D12_FEATURE_DATA_D3D12_OPTIONS>());
+
+            if (d3d12Options.ResourceHeapTier != D3D12_RESOURCE_HEAP_TIER_2)
+            {
+                throw new NotSupportedException("TerraFX currently requires a device that supports Resource Heap Tier 2");
+            }
             return d3d12Device;
         }


forgot to save script

forgot to save script

--- Game/Assets/Player_move.cs
+++ Game/Assets/Player_move.cs
@@ -54,9 +54,25 @@
     {
         Vector3 rootDir = root.forward;

-        Vector3 moveDir = new Vector3(horizontal, 0, vertical);
+        Vector3 moveKeyDir = new Vector3(horizontal, 0, vertical);

-        speedOut = moveDir.sqrMagnitude;
+        speedOut = moveKeyDir.sqrMagnitude;
+
+        //get camera rotation
+        Vector3 cameraDirection = cam.forward;
+        cameraDirection.y = 0.0f; // kill y
+        Quaternion referentislShift = Quaternion.FromToRotation(Vector3.forward, cameraDirection);
+
+        //convert movekeys to worldspace cords
+        Vector3 moveDir = referentislShift * moveKeyDir;
+        Vector3 axisSign = Vector3.Cross(moveDir, rootDir);
+
+        float angleRootToMove = Vector3.Angle(rootDir, moveDir) * (axisSign.y >= 0 ? -1f : 1f);
+
+        angleRootToMove /= 180f;
+
+        dirOut = angleRootToMove * speed;
+
     }


have drag drop working in glfw

have drag drop working in glfw

--- Glfw/GlfwPlatformWindow.cs
+++ Glfw/GlfwPlatformWindow.cs
@@ -18,6 +18,8 @@
 //----------------------------------------------------------------------------
 using System;
 using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
 using GLFW;
 using MatterHackers.Agg;
 using MatterHackers.Agg.Image;
@@ -54,9 +56,9 @@
 		}

 		private bool iconified;
-        private static GlfwPlatformWindow staticThis;
-
-        public GlfwPlatformWindow()
+		private static GlfwPlatformWindow staticThis;
+
+		public GlfwPlatformWindow()
 		{
 		}

@@ -649,10 +651,11 @@
 			// Set a key callback
 			Glfw.SetKeyCallback(glfwWindow, (a, b, c, d, e) => staticThis.KeyCallback(a, b, c, d, e));
 			Glfw.SetCharCallback(glfwWindow, (a, b) => staticThis.CharCallback(a, b));
-			Glfw.SetCursorPositionCallback(glfwWindow, (a, b, c) =>	staticThis.CursorPositionCallback(a, b, c));
+			Glfw.SetCursorPositionCallback(glfwWindow, (a, b, c) => staticThis.CursorPositionCallback(a, b, c));
 			Glfw.SetMouseButtonCallback(glfwWindow, (a, b, c, d) => staticThis.MouseButtonCallback(a, b, c, d));
 			Glfw.SetScrollCallback(glfwWindow, (a, b, c) => staticThis.ScrollCallback(a, b, c));
 			Glfw.SetCloseCallback(glfwWindow, (a) => staticThis.CloseCallback(a));
+			Glfw.SetDropCallback(glfwWindow, (a, b, c) => staticThis.DropCallback(a, b, c));

 			var applicationIcon = AggContext.StaticData.LoadIcon("application.png");

@@ -682,6 +685,39 @@
 				// keep the event thread running
 				UiThread.InvokePendingActions();
 			}
+		}
+
+		public static string[] IntPtrToStringArray<TGenChar>(int size, IntPtr rRoot) where TGenChar : struct
+		{
+			// get the output array of pointers
+			var outPointers = new IntPtr[size];
+			Marshal.Copy(rRoot, outPointers, 0, size);
+			string[] outputStrArray = new string[size];
+			for (int i = 0; i < size; i++)
+			{
+				if (typeof(TGenChar) == typeof(char))
+				{
+					outputStrArray[i] = Marshal.PtrToStringUni(outPointers[i]);
+				}
+				else
+				{
+					outputStrArray[i] = Marshal.PtrToStringAnsi(outPointers[i]);
+				}
+			}
+
+			return outputStrArray;
+		}
+
+		private void DropCallback(Window window, int count, IntPtr array)
+		{
+			var files = IntPtrToStringArray<byte>(count, array).ToList();
+
+			UiThread.RunOnIdle(() =>
+			{
+				var dropEvent = new MouseEventArgs(Agg.UI.MouseButtons.None, 0, mouseX, mouseX, 0, files);
+				aggSystemWindow.OnMouseMove(dropEvent);
+				aggSystemWindow.OnMouseUp(dropEvent);
+			});
 		}

 		private Image ConvertImageBufferToImage(ImageBuffer sourceImage)


sortLayer and color setting

sortLayer and color setting

--- experimental_preview_demo/Assets/TileMapConvertor.cs
+++ experimental_preview_demo/Assets/TileMapConvertor.cs
@@ -5,7 +5,7 @@
 public class TilemapConvertor
 {
     [MenuItem("Assets/Convert TileMap to Sprites")]
-    public static void Convert()
+    public static void ConvertTilemap()
     {
         foreach (var grid in GameObject.FindObjectsOfType<Grid>())
         {
@@ -23,6 +23,7 @@
         var parent = new GameObject(tilemap.name).transform;
         parent.transform.parent = gridGameObject.transform;

+        var tileRenderer = tilemap.GetComponent<TilemapRenderer>();
         var tilemapRotation = tilemap.orientationMatrix.rotation;
         var tileAnchor = CalculateTilemapAnchor(tilemap);

@@ -40,6 +41,8 @@
                 spriteRenderer.transform.localScale = matrix.scale;
                 spriteRenderer.sprite = tilemap.GetSprite(position);
                 spriteRenderer.sortingOrder = CalculateSortingOrder(tilemap, position);
+                spriteRenderer.color = tilemap.color;
+                spriteRenderer.sortingLayerName = tileRenderer.sortingLayerName;
             }
         }
     }


aspnetcore:  ef compiled queries (#5906)

aspnetcore:  ef compiled queries (#5906)

* aspcore: add platform multiple queries

* Add missing console output

* tweak postgresql connectionstring

* aspnetcore: ef compiled queries

Co-authored-by: Stefan Negulescu <d299e64876f4b529bb64b7f3236ad8052734f9f0@hotmail.com>

--- frameworks/CSharp/aspnetcore/Benchmarks/Data/EfDb.cs
+++ frameworks/CSharp/aspnetcore/Benchmarks/Data/EfDb.cs
@@ -1,14 +1,13 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

+using Benchmarks.Configuration;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Options;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
-using Benchmarks.Configuration;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Query;
-using Microsoft.Extensions.Options;

 namespace Benchmarks.Data
 {
@@ -31,10 +30,7 @@
         {
             var id = _random.Next(1, 10001);

-            // TODO: compiled queries are not supported in EF 3.0-preview7
-            // return _firstWorldQuery(_dbContext, id);
-
-            return _dbContext.World.FirstAsync(w => w.Id == id);
+            return _firstWorldQuery(_dbContext, id);
         }

         public async Task<World[]> LoadMultipleQueriesRows(int count)
@@ -45,10 +41,7 @@
             {
                 var id = _random.Next(1, 10001);

-                // TODO: compiled queries are not supported in EF 3.0-preview7
-                // result[i] = await _firstWorldQuery(_dbContext, id);
-
-                result[i] = await _dbContext.World.FirstAsync(w => w.Id == id);
+                result[i] = await _firstWorldQuery(_dbContext, id);
             }

             return result;
@@ -64,25 +57,23 @@
             var random = new Random();
             int i = 0;

-            var ids = Enumerable.Range(1,10000).OrderBy(x => random.Next()).Take(count);
+            var ids = Enumerable.Range(1, 10000).OrderBy(x => random.Next()).Take(count);

-            foreach(int id in ids)
+            foreach (int id in ids)
             {
-                // TODO: compiled queries are not supported in EF 3.0-preview7
-                // var result = await _firstWorldTrackedQuery(_dbContext, id);
+                var result = await _firstWorldTrackedQuery(_dbContext, id);

-                var result = await _dbContext.World.AsTracking().FirstAsync(w => w.Id == id);
+                int oldId = (int)_dbContext.Entry(result).Property("RandomNumber").CurrentValue;
+                int newId;

-                int oldId = (int) _dbContext.Entry(result).Property("RandomNumber").CurrentValue;
-                int newId;
-
-                do{
-                   newId = _random.Next(1, 10001);
+                do
+                {
+                    newId = _random.Next(1, 10001);
                 } while (oldId == newId);
-
+
                 _dbContext.Entry(result).Property("RandomNumber").CurrentValue = newId;
-
-                results[i++] = result;
+
+                results[i++] = result;
             }

             await _dbContext.SaveChangesAsync();
@@ -95,10 +86,12 @@

         public async Task<List<Fortune>> LoadFortunesRows()
         {
-            var result = await _dbContext.Fortune.ToListAsync();
+            var result = new List<Fortune>();

-            // TODO: compiled queries are not supported in EF 3.0-preview7
-            // await foreach (var element in _fortunesQuery(_dbContext))
+            await foreach (var element in _fortunesQuery(_dbContext))
+            {
+                result.Add(element);
+            }

             result.Add(new Fortune { Message = "Additional fortune added at request time." });
             result.Sort();


Fixed #917: AbpDbContext should use SequentialGuidGenerator.Instance if GuidGenerator is not set.

--- src/Abp.EntityFramework/EntityFramework/AbpDbContext.cs
+++ src/Abp.EntityFramework/EntityFramework/AbpDbContext.cs
@@ -51,76 +51,69 @@
         /// </summary>
         protected AbpDbContext()
         {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(string nameOrConnectionString)
+            : base(nameOrConnectionString)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(DbCompiledModel model)
+            : base(model)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(DbConnection existingConnection, bool contextOwnsConnection)
+            : base(existingConnection, contextOwnsConnection)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(string nameOrConnectionString, DbCompiledModel model)
+            : base(nameOrConnectionString, model)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(ObjectContext objectContext, bool dbContextOwnsObjectContext)
+            : base(objectContext, dbContextOwnsObjectContext)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        protected AbpDbContext(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
+            : base(existingConnection, model, contextOwnsConnection)
+        {
+            SetNullsForInjectedProperties();
+        }
+
+        private void SetNullsForInjectedProperties()
+        {
             Logger = NullLogger.Instance;
             AbpSession = NullAbpSession.Instance;
             EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
             GuidGenerator = SequentialGuidGenerator.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(string nameOrConnectionString)
-            : base(nameOrConnectionString)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(DbCompiledModel model)
-            : base(model)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(DbConnection existingConnection, bool contextOwnsConnection)
-            : base(existingConnection, contextOwnsConnection)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(string nameOrConnectionString, DbCompiledModel model)
-            : base(nameOrConnectionString, model)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(ObjectContext objectContext, bool dbContextOwnsObjectContext)
-            : base(objectContext, dbContextOwnsObjectContext)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
-        }
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        protected AbpDbContext(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
-            : base(existingConnection, model, contextOwnsConnection)
-        {
-            Logger = NullLogger.Instance;
-            AbpSession = NullAbpSession.Instance;
-            EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
         }

         public virtual void Initialize()


Update CallMethodAction.cs

Update CallMethodAction.cs

--- src/Avalonia.Xaml.Interactions/Core/CallMethodAction.cs
+++ src/Avalonia.Xaml.Interactions/Core/CallMethodAction.cs
@@ -208,16 +208,14 @@
                         _cachedMethodDescriptor = null;
                         return;
                     }
-                    else
-                    {
-                        _cachedMethodDescriptor = method;
-                    }
-                }
-            }
-        }
-    }
-
-    [DebuggerDisplay("{" + nameof(MethodInfo) + "}")]
+
+                    _cachedMethodDescriptor = method;
+                }
+            }
+        }
+    }
+
+    [DebuggerDisplay($"{{{nameof(MethodInfo)}}}")]
     private class MethodDescriptor
     {
         public MethodDescriptor(MethodInfo methodInfo, ParameterInfo[] methodParameters)
@@ -234,15 +232,7 @@

         public TypeInfo? SecondParameterTypeInfo
         {
-            get
-            {
-                if (ParameterCount < 2)
-                {
-                    return null;
-                }
-
-                return Parameters[1].ParameterType.GetTypeInfo();
-            }
+            get => ParameterCount < 2 ? null : Parameters[1].ParameterType.GetTypeInfo();
         }
     }
 }


Fixed Unit Test issue

Fixed Unit Test issue

--- src/BankA.Api.Tests/Controllers/ValuesControllerTest.cs
+++ src/BankA.Api.Tests/Controllers/ValuesControllerTest.cs
@@ -3,7 +3,6 @@
 using System.Linq;
 using System.Net.Http;
 using System.Text;
-using System.Web.Http;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using BankA.Api;
 using BankA.Api.Controllers;


Zoombox.MaintainAspectRatio

Zoombox.MaintainAspectRatio

--- Gu.Wpf.Geometry/Zoombox.cs
+++ Gu.Wpf.Geometry/Zoombox.cs
@@ -28,6 +28,12 @@
             typeof(Zoombox),
             new PropertyMetadata(double.PositiveInfinity));

+        public static readonly DependencyProperty MaintainAspectRatioProperty = DependencyProperty.Register(
+            "MaintainAspectRatio",
+            typeof(bool),
+            typeof(Zoombox),
+            new PropertyMetadata(true));
+
         private static readonly ScaleTransform ScaleTransform = new ScaleTransform();
         private static readonly TranslateTransform TranslateTransform = new TranslateTransform();
         private static readonly double DefaultScaleIncrement = 2.0;
@@ -104,6 +110,15 @@
         {
             get => (double)this.GetValue(MaxZoomProperty);
             set => this.SetValue(MaxZoomProperty, value);
+        }
+
+        /// <summary>
+        /// If pinch zooming shoul maintain aspect ratio
+        /// </summary>
+        public bool MaintainAspectRatio
+        {
+            get => (bool)this.GetValue(MaintainAspectRatioProperty);
+            set => this.SetValue(MaintainAspectRatioProperty, value);
         }

         /// <inheritdoc />
@@ -228,12 +243,6 @@
         public void Zoom(Point center, Vector scale)
         {
             scale = this.CoerceScale(scale);
-            if (Math.Abs(scale.LengthSquared - 2) < MinScaleDelta)
-            {
-                CommandManager.InvalidateRequerySuggested();
-                return;
-            }
-
             ScaleTransform.SetCurrentValue(ScaleTransform.CenterXProperty, center.X);
             ScaleTransform.SetCurrentValue(ScaleTransform.CenterYProperty, center.Y);
             ScaleTransform.SetCurrentValue(ScaleTransform.ScaleXProperty, scale.X);
@@ -279,7 +288,15 @@
             if (delta.Scale.LengthSquared > 0)
             {
                 var p = ((FrameworkElement)e.ManipulationContainer).TranslatePoint(e.ManipulationOrigin, this);
-                this.Zoom(p, delta.Scale);
+                if (this.MaintainAspectRatio)
+                {
+                    var scale = Math.Sqrt(delta.Scale.LengthSquared);
+                    this.Zoom(p, new Vector(scale, scale));
+                }
+                else
+                {
+                    this.Zoom(p, delta.Scale);
+                }
             }

             if (delta.Translation.LengthSquared > 0)
@@ -289,6 +306,7 @@
                 this.ContentTransform.SetCurrentValue(MatrixTransform.MatrixProperty, Matrix.Multiply(this.ContentTransform.Value, TranslateTransform.Value));
             }

+            CommandManager.InvalidateRequerySuggested();
             base.OnManipulationDelta(e);
         }

@@ -305,6 +323,7 @@
                 : 1.0 / this.WheelZoomFactor;
             var p = e.GetPosition(this);
             this.Zoom(p, new Vector(scale, scale));
+            CommandManager.InvalidateRequerySuggested();
             base.OnMouseWheel(e);
         }


new log methods used

new log methods used

--- src/ChannelAdvisorAccess/Services/Items/ItemsService.cs
+++ src/ChannelAdvisorAccess/Services/Items/ItemsService.cs
@@ -80,7 +80,7 @@

 			try
 			{
-				ChannelAdvisorLogger.LogTraceStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
+				ChannelAdvisorLogger.LogStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
 				AP.Query.Do( () =>
 				{
 					ChannelAdvisorLogger.LogTraceRetryStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
@@ -88,7 +88,7 @@
 					ChannelAdvisorLogger.LogTraceRetryEnd( this.CreateMethodCallInfo( mark : mark, methodResult : result.ToJson(), additionalInfo : this.AdditionalLogInfoString ) );
 					this.CheckCaSuccess( result );
 				} );
-				ChannelAdvisorLogger.LogTraceEnd( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
+				ChannelAdvisorLogger.LogEnd( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
 			}
 			catch( Exception exception )
 			{
@@ -105,7 +105,7 @@

 			try
 			{
-				ChannelAdvisorLogger.LogTraceStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
+				ChannelAdvisorLogger.LogStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
 				await AP.QueryAsync.Do( async () =>
 				{
 					ChannelAdvisorLogger.LogTraceRetryStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
@@ -113,7 +113,7 @@
 					ChannelAdvisorLogger.LogTraceRetryEnd( this.CreateMethodCallInfo( mark : mark, methodResult : result.ToJson(), additionalInfo : this.AdditionalLogInfoString ) );
 					this.CheckCaSuccess( result.PingResult );
 				} ).ConfigureAwait( false );
-				ChannelAdvisorLogger.LogTraceEnd( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
+				ChannelAdvisorLogger.LogEnd( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ) );
 			}
 			catch( Exception exception )
 			{


Added DoNotDisturb to colors.

Added DoNotDisturb to colors.

--- src/Client/PresenceNotifier/PresenceNotifier/frmMain.cs
+++ src/Client/PresenceNotifier/PresenceNotifier/frmMain.cs
@@ -118,6 +118,7 @@
                     case ContactAvailability.Away:
                         this.lblCurrentStatus.ForeColor = System.Drawing.Color.Orange;
                         break;
+                    case ContactAvailability.DoNotDisturb:
                     case ContactAvailability.Busy:
                         this.lblCurrentStatus.ForeColor = System.Drawing.Color.Red;
                         break;


more data for 'parse long value seq w/out rang' test


Add test to verify code generation for the discard designator in a pattern Fixes #15437

--- src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs
+++ src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs
@@ -863,5 +863,31 @@
   IL_004c:  ret
 }");
         }
-    }
-}
+
+        [Fact, WorkItem(15437, "https://github.com/dotnet/roslyn/issues/15437")]
+        public void IsTypeDiscard()
+        {
+            var source =
+@"public class C
+{
+    public bool IsString(object o)
+    {
+        return o is string _;
+    }
+}";
+            var compilation = CreateCompilation(source, options: TestOptions.ReleaseDll);
+            compilation.VerifyDiagnostics();
+            var compVerifier = CompileAndVerify(compilation);
+            compVerifier.VerifyIL("C.IsString",
+@"{
+  // Code size       10 (0xa)
+  .maxstack  2
+  IL_0000:  ldarg.1
+  IL_0001:  isinst     ""string""
+  IL_0006:  ldnull
+  IL_0007:  cgt.un
+  IL_0009:  ret
+}");
+        }
+    }
+}


fix bug in ModuleAttribute

fix bug in ModuleAttribute

--- src/CorvusAlba.MyLittleLispy.Runtime/ModuleAttribute.cs
+++ src/CorvusAlba.MyLittleLispy.Runtime/ModuleAttribute.cs
@@ -21,6 +21,7 @@
 	{
 	    if (_modules == null)
 	    {
+		_modules = new Dictionary<string, IModule>();
 		var assemblies = AppDomain.CurrentDomain.GetAssemblies();
 		foreach (var type in assemblies.SelectMany(a => a.GetTypes()))
 		{


Tidied settings.

Tidied settings.

--- Hearts.Console/Settings.cs
+++ Hearts.Console/Settings.cs
@@ -27,27 +27,27 @@
         public static SimulationType SimulationType = SimulationType.Standard;

         // True:    Shows full game breakdown
-        // True:    Shows summary
+        // False:   Shows summary
         public static bool ShowFullOutput = GameSimulationCount == 1
             && SimulationType == SimulationType.Standard;

-        // Available bots: (* = Doesn't currently build against current IAgent signature)
-        //
-        //    • TerribleRandomAiAgent                                       0ms
-        //    • Noob1AiExampleAgent                                         0ms
-        //    • Noob2AiExampleAgent                                         0ms
-        //    • Noob3AiExampleAgent                                         0ms
-        //    • SuicideNoob1AiExampleAgent                                  0ms
-        //    • SavageBeast                                 Adam Hill       3ms
-        //    • NoobCrusherV1                               Tony Beasley    0ms
-        //    • NoobCrusherV2                               Tony Beasley    0ms
-        //    • NoobCrusherV3                               Tony Beasley    0ms
-        //    • ShootCrusher                                Tony Beasley    0ms
-        //    • Craghoul                                    Craig Rowe      0ms
-        //    • Deathstar                                   James Robinson  0ms
-        //    • QueenCatcher                                Dan White       0ms
-        //    • DefensiveAfter90							Ben Read		0ms
-        //    • TrashBot                                    Mary Hyde       0ms
+        // Available Bots:
+        //      CLASS                                       AUTHOR              TIME PER ROUND
+        //      TerribleRandomAiAgent                                           0ms
+        //      Noob1AiExampleAgent                                             0ms
+        //      Noob2AiExampleAgent                                             0ms
+        //      Noob3AiExampleAgent                                             0ms
+        //      SuicideNoob1AiExampleAgent                                      0ms
+        //      SavageBeast                                 Adam Hill           3ms
+        //      NoobCrusherV1                               Tony Beasley        0ms
+        //      NoobCrusherV2                               Tony Beasley        0ms
+        //      NoobCrusherV3                               Tony Beasley        0ms
+        //      ShootCrusher                                Tony Beasley        0ms
+        //      Craghoul                                    Craig Rowe          0ms
+        //      Deathstar                                   James Robinson      0ms
+        //      QueenCatcher                                Dan White           0ms
+        //      DefensiveAfter90							Ben Read		    0ms
+        //      TrashBot                                    Mary Hyde           0ms

         public static HeartsPlayerList Bots = new HeartsPlayerList
             {


Ported RevisionInternal changes.

Ported RevisionInternal changes.

--- src/Couchbase.Lite.Shared/Revisions/RevisionInternal.cs
+++ src/Couchbase.Lite.Shared/Revisions/RevisionInternal.cs
@@ -213,7 +213,7 @@

         public RevisionInternal CopyWithDocID(String docId, String revId)
 		{
-			System.Diagnostics.Debug.Assert(((docId != null) && (revId != null)));
+			System.Diagnostics.Debug.Assert((docId != null));
 			System.Diagnostics.Debug.Assert(((this.docId == null) || (this.docId.Equals(docId))));

             var result = new RevisionInternal(docId, revId, deleted, database);
@@ -353,9 +353,8 @@
             {
                 foreach(var kvp in attachments)
                 {
-                    IDictionary<string, object> attachment =
-                        new Dictionary<string, object>(kvp.Value.AsDictionary<string, object>());
-                    IDictionary<string, object> editedAttachment = mutator(kvp.Key, attachment);
+                    var attachment = new Dictionary<string, object>(kvp.Value.AsDictionary<string, object>());
+                    var editedAttachment = mutator(kvp.Key, attachment);
                     if (editedAttachment == null)
                     {
                         return false;


Added a type check before casting to a bool.  Fixes issue #414.

--- src/Couchbase.Lite.Shared/Revisions/RevisionInternal.cs
+++ src/Couchbase.Lite.Shared/Revisions/RevisionInternal.cs
@@ -79,7 +79,7 @@
         }

         internal RevisionInternal(Body body)
-            : this((string)body.GetPropertyForKey("_id"), (string)body.GetPropertyForKey("_rev"), (body.HasValueForKey("_deleted") && (bool)body.GetPropertyForKey("_deleted")))
+            : this((string)body.GetPropertyForKey("_id"), (string)body.GetPropertyForKey("_rev"), (body.HasValueForKey("_deleted") && body.GetPropertyForKey("_deleted") is bool && (bool)body.GetPropertyForKey("_deleted")))
         {
             this.body = body;
         }


Remove unnecessary using methods

Remove unnecessary using methods

--- HpToolsLauncher/Program.cs
+++ HpToolsLauncher/Program.cs
@@ -22,9 +22,7 @@

 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Linq;
-using System.Threading;
 using HpToolsLauncher.Properties;

 namespace HpToolsLauncher


Fixed more unknown user errors

Fixed more unknown user errors

--- src/Discord.Net/Entities/WebSocket/CachedTextChannel.cs
+++ src/Discord.Net/Entities/WebSocket/CachedTextChannel.cs
@@ -30,7 +30,9 @@
         public CachedGuildUser GetUser(ulong id, bool skipCheck = false)
         {
             var user = Guild.GetUser(id);
-            if (user != null && !skipCheck)
+            if (skipCheck) return user;
+
+            if (user != null)
             {
                 ulong perms = Permissions.ResolveChannel(user, this, user.GuildPermissions.RawValue);
                 if (Permissions.GetValue(perms, ChannelPermission.ReadMessages))


Load package with solution, else build notification won't work

--- ITweakMyBuild/VSPackage.cs
+++ ITweakMyBuild/VSPackage.cs
@@ -12,6 +12,7 @@
     using JetBrains.Annotations;

     using Microsoft.VisualStudio.Shell;
+    using Microsoft.VisualStudio.Shell.Interop;

     using TomsToolbox.Desktop.Composition;

@@ -22,6 +23,7 @@
     [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
     [ProvideMenuResource("Menus.ctmenu", 1)]
     [ProvideToolWindow(typeof(ToolWindow))]
+    [ProvideAutoLoad(UIContextGuids.SolutionExists)]
     public sealed class VSPackage : Package
     {
         /// <summary>


fix: Build fix

fix: Build fix

--- src/Elders.Cronus/Hosting/Heartbeat/CronusHeartbeat.cs
+++ src/Elders.Cronus/Hosting/Heartbeat/CronusHeartbeat.cs
@@ -19,13 +19,12 @@

         //public string Name { get; set; } = "cronus";

-        public CronusHeartbeat(IPublisher<ISignal> publisher, IOptionsMonitor<BoundedContext> boundedContext, IOptions<TenantsOptions> tenantsOptions, ILogger<CronusHeartbeat> logger)
+        public CronusHeartbeat(IPublisher<ISignal> publisher, IOptionsMonitor<BoundedContext> boundedContext, IOptionsMonitor<HeartbeatOptions> HeartbeatOptions, IOptions<TenantsOptions> tenantsOptions, ILogger<CronusHeartbeat> logger)
         {
             this.publisher = publisher;
             this.boundedContext = boundedContext.CurrentValue;
             tenants = tenantsOptions.Value.Tenants.ToList();
-            options = monitor.CurrentValue;
-            this.publisher = publisher;
+            options = HeartbeatOptions.CurrentValue;
             this.logger = logger;
         }


Add Autofac implementation of factory method.

--- src/Engine/MvcTurbine.Autofac/AutofacServiceLocator.cs
+++ src/Engine/MvcTurbine.Autofac/AutofacServiceLocator.cs
@@ -165,7 +165,7 @@

         public void Register<Interface>(Func<Interface> func) where Interface : class
         {
-            throw new NotImplementedException();
+            Builder.Register(c => func.Invoke());
         }

         [Obsolete("Not used with this implementation of IServiceLocator.")]


Got "Tags" property editor persisting, however need to find a way to persist tags to the cmsTags db table as this is done via a tagsRepository in core which is marked as internal and there is no public api for saving tags otherwise

--- src/Fluidity/Web/Models/Mappers/FluidityEntityMapper.cs
+++ src/Fluidity/Web/Models/Mappers/FluidityEntityMapper.cs
@@ -271,7 +271,16 @@
                         }

                         var propVal = dataTypeInfo.PropertyEditor.ValueEditor.ConvertEditorToDb(data, currentValue);
-                        if (propConfig.ValueMapper != null) {
+                        var supportTagsAttribute = TagExtractor.GetAttribute(dataTypeInfo.PropertyEditor);
+                        if (supportTagsAttribute != null)
+                        {
+                            var dummyProp = new Property(new PropertyType(dataTypeInfo.DataTypeDefinition), propVal);
+                            TagExtractor.SetPropertyTags(dummyProp, data, propVal, supportTagsAttribute);
+                            propVal = dummyProp.Value;
+                        }
+
+                        if (propConfig.ValueMapper != null)
+                        {
                             propVal = propConfig.ValueMapper.EditorToModel(propVal);
                         }

@@ -282,13 +291,7 @@
                             }
                         }

-                        var supportTagsAttribute = TagExtractor.GetAttribute(dataTypeInfo.PropertyEditor);
-                        if (supportTagsAttribute != null) {
-                            var dummyProp = new Property(new PropertyType(dataTypeInfo.DataTypeDefinition), propVal);
-                            TagExtractor.SetPropertyTags(dummyProp, data, propVal, supportTagsAttribute);
-                        } else {
-                            entity.SetPropertyValue(propConfig.Property, propVal);
-                        }
+                        entity.SetPropertyValue(propConfig.Property, propVal);
                     }
                 }
             }


Adding IsAcceptingFeedback flag to events

--- src/Eurofurence.App.Domain.Model/Events/EventRecord.cs
+++ src/Eurofurence.App.Domain.Model/Events/EventRecord.cs
@@ -53,6 +53,9 @@
         [DataMember]
         public bool IsDeviatingFromConBook { get; set; }

+        [DataMember]
+        public bool IsAcceptingFeedback { get; set; }
+
         /// <summary>
         ///     If set, refers to a banner ([3-4]:1 aspect ratio) that can be used when little
         ///     vertical space is available (e.G. event schedule, or a header section).


WIP: Passing primitive test.

WIP: Passing primitive test.

--- src/ExtendedXmlSerializer/ElementModel/Options/_WIP.cs
+++ src/ExtendedXmlSerializer/ElementModel/Options/_WIP.cs
@@ -187,8 +187,8 @@
 			{
 				case XmlNodeType.Element:
 					var name = XName.Get(parameter.LocalName, parameter.NamespaceURI);
-					var type = _types.Get(name);
-					return type;
+					var result = _types.Get(name);
+					return result;
 			}

 			throw new InvalidOperationException($"Could not locate the type from the current Xml reader '{parameter}.'");


#41 Added HSTS support.

#41 Added HSTS support.

--- src/Fan.Web/Extensions/ApplicationBuilderExtensions.cs
+++ src/Fan.Web/Extensions/ApplicationBuilderExtensions.cs
@@ -25,5 +25,28 @@
         {
             return builder.UseMiddleware<HttpWwwRewriteMiddleware>();
         }
+
+        /// <summary>
+        /// Add middleware that sets HSTS response header for ensuring subsequent requests are made over HTTPS only.
+        /// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security for more details.
+        /// </summary>
+        /// <param name="builder">The <see cref="IApplicationBuilder"/>.</param>
+        /// <returns>The <see cref="IApplicationBuilder"/>.</returns>
+        public static IApplicationBuilder UseHsts(this IApplicationBuilder builder)
+        {
+            return builder.UseMiddleware<HstsMiddleware>(new HstsOptions());
+        }
+
+        /// <summary>
+        /// Add middleware that sets HSTS response header for ensuring subsequent requests are made over HTTPS only.
+        /// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security for more details.
+        /// </summary>
+        /// <param name="builder">The <see cref="IApplicationBuilder"/>.</param>
+        /// <param name="options">The <see cref="HstsOptions"/> to use.</param>
+        /// <returns>The <see cref="IApplicationBuilder"/>.</returns>
+        public static IApplicationBuilder UseHsts(this IApplicationBuilder builder, HstsOptions options)
+        {
+            return builder.UseMiddleware<HstsMiddleware>(options);
+        }
     }
 }


Minor cleanup within AppVeyorListenerTests to ease comparisons between active branches.

--- src/Fixie.Tests/ConsoleRunner/AppVeyorListenerTests.cs
+++ src/Fixie.Tests/ConsoleRunner/AppVeyorListenerTests.cs
@@ -93,17 +93,17 @@
             }
         }

-        static string PathToThisFile([CallerFilePath] string path = null)
-        {
-            return path;
-        }
-
         static string CleanBrittleValues(string actualRawContent)
         {
             //Avoid brittle assertion introduced by stack trace line numbers.
             var cleaned = Regex.Replace(actualRawContent, @":line \d+", ":line #");

             return cleaned;
+        }
+
+        static string PathToThisFile([CallerFilePath] string path = null)
+        {
+            return path;
         }

         class PassFailTestClass
@@ -133,7 +133,7 @@
             }
         }

-        private class FakeHandler : DelegatingHandler
+        class FakeHandler : DelegatingHandler
         {
             readonly Func<HttpRequestMessage, HttpResponseMessage> func;


Open at line number from GitHub URL

Open at line number from GitHub URL

--- src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs
+++ src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs
@@ -8,6 +8,7 @@
 using GitHub.Primitives;
 using GitHub.Services.Vssdk.Commands;
 using EnvDTE;
+using Microsoft.VisualStudio;

 namespace GitHub.VisualStudio.Commands
 {
@@ -15,6 +16,7 @@
     public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand
     {
         readonly Lazy<IRepositoryCloneService> repositoryCloneService;
+        readonly Lazy<IPullRequestEditorService> pullRequestEditorService;
         readonly Lazy<IGitHubToolWindowManager> gitHubToolWindowManager;
         readonly Lazy<DTE> dte;

@@ -31,10 +33,12 @@
         [ImportingConstructor]
         public OpenFromUrlCommand(
             Lazy<IRepositoryCloneService> repositoryCloneService,
+            Lazy<IPullRequestEditorService> pullRequestEditorService,
             [Import(typeof(Microsoft.VisualStudio.Shell.SVsServiceProvider))] IServiceProvider sp) :
             base(CommandSet, CommandId)
         {
             this.repositoryCloneService = repositoryCloneService;
+            this.pullRequestEditorService = pullRequestEditorService;
             dte = new Lazy<DTE>(() => (DTE)sp.GetService(typeof(DTE)));
             gitHubToolWindowManager = new Lazy<IGitHubToolWindowManager>(
                 () => (IGitHubToolWindowManager)sp.GetService(typeof(IGitHubToolWindowManager)));
@@ -128,6 +132,15 @@
             }

             dte.Value.ItemOperations.OpenFile(fullPath);
+
+            var lineNumber = FindLineNumber(gitHubUrl);
+            if (lineNumber != -1)
+            {
+                var activeView = pullRequestEditorService.Value.FindActiveView();
+                ErrorHandler.ThrowOnFailure(activeView.SetCaretPos(lineNumber, 0));
+                ErrorHandler.ThrowOnFailure(activeView.CenterLines(lineNumber, 1));
+            }
+
             return true;
         }

@@ -167,5 +180,23 @@
             var path = url.Substring(prefix.Length, endIndex - prefix.Length);
             return path;
         }
+
+        static int FindLineNumber(UriString gitHubUrl)
+        {
+            var prefix = "#L";
+            var url = gitHubUrl.ToString();
+            var index = url.LastIndexOf(prefix);
+            if (index == -1)
+            {
+                return -1;
+            }
+
+            if (!int.TryParse(url.Substring(index + prefix.Length), out int lineNumber))
+            {
+                return -1;
+            }
+
+            return lineNumber - 1;
+        }
     }
 }


Added timeout to long running test (~45 sec) in Core.Util.Packed.TestPackedInts

--- src/Lucene.Net.Tests/core/Util/Packed/TestPackedInts.cs
+++ src/Lucene.Net.Tests/core/Util/Packed/TestPackedInts.cs
@@ -1472,7 +1472,7 @@
             }
         }

-        [Test]
+        [Test, Timeout(180000)]
         public virtual void TestBlockReaderOverflow()
         {
             long valueCount = TestUtil.NextLong(Random(), 1L + int.MaxValue, (long)int.MaxValue * 2);


handle files with same name

handle files with same name

--- api/Modules/SearchModule.cs
+++ api/Modules/SearchModule.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Net.Http;
 using daq_api.Contracts;
@@ -57,15 +58,21 @@
                     return Response.AsJson(result);
                 }

-                var filenames = response.Result.AttachmentGroups[0].AttachmentInfos.ToDictionary(key => key.Name, value => value.Id);
+                var filenames = response.Result.AttachmentGroups[0].AttachmentInfos.ToDictionary(key => string.Format("{0}?{1}", key.Name, key.Id), value => value.Id);

                 return Response.AsJson(result.Select(mapped =>
                 {
                     var updated = new EDocEntry(mapped, facilityId);
-                    updated.Uploaded = filenames.ContainsKey(updated.File);
+                    var uploads = filenames.Where(key =>
+                    {
+                        var name = key.Key.Split('?')[0];
+                        return string.Compare(name, updated.File, StringComparison.InvariantCultureIgnoreCase) == 0;
+                    }).ToList();
+
+                    updated.Uploaded = uploads.Any();
                     if (updated.Uploaded)
                     {
-                        updated.UploadId = filenames[updated.File];
+                        updated.UploadId = uploads.First().Value;
                     }

                     return updated;


Fixed ElapsedGameTime being negative

Fixed ElapsedGameTime being negative

--- Jeden/Engine/GameEngine.cs
+++ Jeden/Engine/GameEngine.cs
@@ -85,7 +85,7 @@
             {
                 Window.DispatchEvents();

-                DeltaTime.ElapsedGameTime = DeltaTime.TotalGameTime - stopwatch.Elapsed;
+                DeltaTime.ElapsedGameTime = stopwatch.Elapsed - DeltaTime.TotalGameTime;
                 DeltaTime.TotalGameTime = stopwatch.Elapsed;
                 Update(DeltaTime);
                 Draw();


React to aspnet/Razor#721.

React to aspnet/Razor#721.

--- src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorHost.cs
+++ src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorHost.cs
@@ -112,7 +112,7 @@
                     TagHelperContentGetContentMethodName = nameof(TagHelperContent.GetContent),
                     TagHelperOutputIsContentModifiedPropertyName = nameof(TagHelperOutput.IsContentModified),
                     TagHelperOutputContentPropertyName = nameof(TagHelperOutput.Content),
-                    TagHelperOutputGetChildContentAsyncMethodName = nameof(TagHelperOutput.GetChildContentAsync)
+                    ExecutionContextSetOutputContentAsyncMethodName = nameof(TagHelperExecutionContext.SetOutputContentAsync),
                 })
             {
                 BeginContextMethodName = "BeginContext",


Reduce the allocations and string concats when encoding BEncodedStrings.

svn path=/trunk/bitsharp/; revision=132682

--- src/MonoTorrent/MonoTorrent.BEncoding/BEncodedString.cs
+++ src/MonoTorrent/MonoTorrent.BEncoding/BEncodedString.cs
@@ -33,6 +33,7 @@
 using System.Collections;
 using System.Text;
 using MonoTorrent.Common;
+using MonoTorrent.Client.Messages;

 namespace MonoTorrent.BEncoding
 {
@@ -128,10 +129,11 @@
         /// <returns>The number of bytes encoded</returns>
         public override int Encode(byte[] buffer, int offset)
         {
-            string output = this.textBytes.Length + ":";
-            int written = System.Text.Encoding.UTF8.GetBytes(output, 0, output.Length, buffer, offset);
-            Buffer.BlockCopy(this.textBytes, 0, buffer, offset + written, this.textBytes.Length);
-            return written + this.textBytes.Length;
+            int written = offset;
+            written += Message.WriteAscii(buffer, written, textBytes.Length.ToString ());
+            written += Message.WriteAscii(buffer, written, ":");
+            written += Message.Write(buffer, written, textBytes);
+            return written - offset;
         }


Change: Swapped the Forest reference with a Desert reference

--- src/MysticChronicles.Engine/GameStates/InBattleState.cs
+++ src/MysticChronicles.Engine/GameStates/InBattleState.cs
@@ -19,7 +19,7 @@

         public override void LoadContent()
         {
-            AddGraphicElement(new BackgroundImage(EContainer, "BattleBackgrounds/Forest"));
+            AddGraphicElement(new BackgroundImage(EContainer, "BattleBackgrounds/Desert"));
             AddGraphicElement(new BackgroundImage(EContainer, "UI/BattleOverlay"));

             AddGraphicElement(new PartyMember(EContainer, "characters/knight", 1));


Fixed connect4 weird wins

Fixed connect4 weird wins

--- src/NadekoBot/Modules/Games/Common/Connect4/Connect4.cs
+++ src/NadekoBot/Modules/Games/Common/Connect4/Connect4.cs
@@ -274,6 +274,8 @@
                                 break;
                             }

+                            same = 1;
+
                             //top right
                             for (int i = 1; i < 4; i++)
                             {


LV-5 use ValueConverterBase instead of ValueConverterBase<DateTime>.

--- src/LogViewer/Converters/TimestampToStringConverter.cs
+++ src/LogViewer/Converters/TimestampToStringConverter.cs
@@ -10,12 +10,18 @@
     using System;
     using Catel.MVVM.Converters;

-    public class TimestampToStringConverter : ValueConverterBase<DateTime>
+    public class TimestampToStringConverter : ValueConverterBase
     {
         #region Methods
-        protected override object Convert(DateTime value, Type targetType, object parameter)
+        protected override object Convert(object value, Type targetType, object parameter)
         {
-            return value.ToString(CurrentCulture.DateTimeFormat);
+            if (!(value is DateTime))
+            {
+                return null;
+            }
+
+            var dateTimeValue = (DateTime) value;
+            return dateTimeValue.ToString(CurrentCulture.DateTimeFormat);
         }
         #endregion
     }


Lucene.Net.Core.Util.Packed.Packed16ThreeBlocks refactor: renamed private/internal fields camelCase

--- src/Lucene.Net.Core/Util/Packed/Packed16ThreeBlocks.cs
+++ src/Lucene.Net.Core/Util/Packed/Packed16ThreeBlocks.cs
@@ -31,7 +31,7 @@
     /// </summary>
     internal sealed class Packed16ThreeBlocks : PackedInts.MutableImpl
     {
-        internal readonly short[] Blocks;
+        internal readonly short[] blocks;

         public static readonly int MAX_SIZE = int.MaxValue / 3;

@@ -42,7 +42,7 @@
             {
                 throw new System.IndexOutOfRangeException("MAX_SIZE exceeded");
             }
-            Blocks = new short[valueCount * 3];
+            blocks = new short[valueCount * 3];
         }

         internal Packed16ThreeBlocks(int packedIntsVersion, DataInput @in, int valueCount)
@@ -50,7 +50,7 @@
         {
             for (int i = 0; i < 3 * valueCount; ++i)
             {
-                Blocks[i] = @in.ReadShort();
+                blocks[i] = @in.ReadShort();
             }
             // because packed ints have not always been byte-aligned
             int remaining = (int)(PackedInts.Format.PACKED.ByteCount(packedIntsVersion, valueCount, 48) - 3L * valueCount * 2);
@@ -63,7 +63,7 @@
         public override long Get(int index)
         {
             int o = index * 3;
-            return (Blocks[o] & 0xFFFFL) << 32 | (Blocks[o + 1] & 0xFFFFL) << 16 | (Blocks[o + 2] & 0xFFFFL);
+            return (blocks[o] & 0xFFFFL) << 32 | (blocks[o + 1] & 0xFFFFL) << 16 | (blocks[o + 2] & 0xFFFFL);
         }

         public override int Get(int index, long[] arr, int off, int len)
@@ -75,7 +75,7 @@
             int gets = Math.Min(m_valueCount - index, len);
             for (int i = index * 3, end = (index + gets) * 3; i < end; i += 3)
             {
-                arr[off++] = (Blocks[i] & 0xFFFFL) << 32 | (Blocks[i + 1] & 0xFFFFL) << 16 | (Blocks[i + 2] & 0xFFFFL);
+                arr[off++] = (blocks[i] & 0xFFFFL) << 32 | (blocks[i + 1] & 0xFFFFL) << 16 | (blocks[i + 2] & 0xFFFFL);
             }
             return gets;
         }
@@ -83,9 +83,9 @@
         public override void Set(int index, long value)
         {
             int o = index * 3;
-            Blocks[o] = (short)((long)((ulong)value >> 32));
-            Blocks[o + 1] = (short)((long)((ulong)value >> 16));
-            Blocks[o + 2] = (short)value;
+            blocks[o] = (short)((long)((ulong)value >> 32));
+            blocks[o + 1] = (short)((long)((ulong)value >> 16));
+            blocks[o + 2] = (short)value;
         }

         public override int Set(int index, long[] arr, int off, int len)
@@ -98,9 +98,9 @@
             for (int i = off, o = index * 3, end = off + sets; i < end; ++i)
             {
                 long value = arr[i];
-                Blocks[o++] = (short)((long)((ulong)value >> 32));
-                Blocks[o++] = (short)((long)((ulong)value >> 16));
-                Blocks[o++] = (short)value;
+                blocks[o++] = (short)((long)((ulong)value >> 32));
+                blocks[o++] = (short)((long)((ulong)value >> 16));
+                blocks[o++] = (short)value;
             }
             return sets;
         }
@@ -112,15 +112,15 @@
             short block3 = (short)val;
             for (int i = fromIndex * 3, end = toIndex * 3; i < end; i += 3)
             {
-                Blocks[i] = block1;
-                Blocks[i + 1] = block2;
-                Blocks[i + 2] = block3;
+                blocks[i] = block1;
+                blocks[i + 1] = block2;
+                blocks[i + 2] = block3;
             }
         }

         public override void Clear()
         {
-            Arrays.Fill(Blocks, (short)0);
+            Arrays.Fill(blocks, (short)0);
         }

         public override long RamBytesUsed()
@@ -129,12 +129,12 @@
                 RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
                 + 2 * RamUsageEstimator.NUM_BYTES_INT // valueCount,bitsPerValue
                 + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // blocks ref
-                + RamUsageEstimator.SizeOf(Blocks);
+                + RamUsageEstimator.SizeOf(blocks);
         }

         public override string ToString()
         {
-            return this.GetType().Name + "(bitsPerValue=" + m_bitsPerValue + ", size=" + Size + ", elements.length=" + Blocks.Length + ")";
+            return this.GetType().Name + "(bitsPerValue=" + m_bitsPerValue + ", size=" + Size + ", elements.length=" + blocks.Length + ")";
         }
     }
 }


Added LuceneNetSpecific attribute to Core.Support.TestToStringUtils.TestBoost()

--- src/Lucene.Net.Tests/core/Support/TestToStringUtils.cs
+++ src/Lucene.Net.Tests/core/Support/TestToStringUtils.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Util;
+using Lucene.Net.Attributes;
+using Lucene.Net.Util;
 using NUnit.Framework;
 using System.Globalization;
 using System.Threading;
@@ -29,7 +30,7 @@
         /// <summary>
         /// Check to ensure that the Boost function is properly converted in every possible culture.
         /// </summary>
-        [Test]
+        [Test, LuceneNetSpecific]
         public void TestBoost()
         {
             float boostNormal = 1f;


refactor: newState will always have a value

--- src/MR.AspNetCore.Jobs/Server/IProcessor.DelayedJob.cs
+++ src/MR.AspNetCore.Jobs/Server/IProcessor.DelayedJob.cs
@@ -104,7 +104,7 @@
 							var result = await ExecuteJob(method, instance);
 							sp.Stop();

-							IState newState = null;
+							var newState = default(IState);
 							if (!result.Succeeded)
 							{
 								var shouldRetry = await UpdateJobForRetryAsync(instance, job, connection);
@@ -124,21 +124,7 @@
 								newState = new SucceededState();
 							}

-							if (newState != null)
-							{
-								using (var transaction = connection.CreateTransaction())
-								{
-									if (newState != null)
-									{
-										_stateChanger.ChangeState(job, newState, transaction);
-									}
-									else
-									{
-										transaction.UpdateJob(job);
-									}
-									await transaction.CommitAsync();
-								}
-							}
+							await _stateChanger.ChangeStateAsync(job, newState, connection);

 							fetched.RemoveFromQueue();
 							if (result.Succeeded)


Ensure additional middleware can write to the response (cfr fix by MarinkoSpasojevic)

--- src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
+++ src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
@@ -143,14 +143,21 @@
             // otherwise we are unable to read it out (and thus cannot generate strong etags
             // correctly)
             // cfr: http://stackoverflow.com/questions/35458737/implement-http-cache-etag-in-asp-net-core-web-api
-            using (var buffer = new MemoryStream())
+
+            // ensure additional middleware can write to the response (cfr fix by MarinkoSpasojevic)
+            var buffer = new MemoryStream();
+            Stream stream = null;
+            bool isContinuation = false;
+            try
             {
                 // replace the context response with a temporary buffer
-                var stream = httpContext.Response.Body;
+                stream = httpContext.Response.Body;
                 httpContext.Response.Body = buffer;

                 // Call the next middleware delegate in the pipeline
                 await _next.Invoke(httpContext);
+
+                isContinuation = true;

                 // Grab possible cache overrides from the method
                 var expirationModelOptions = httpContext.ExpirationModelOptionsOrDefault(_expirationModelOptions);
@@ -188,6 +195,17 @@

                     // set the response body back to the original stream
                     httpContext.Response.Body = stream;
+                }
+            }
+            finally
+            {
+                if (!isContinuation)
+                {
+                    httpContext.Response.Body = stream;
+                }
+                if (buffer != null)
+                {
+                    buffer.Dispose();
                 }
             }


Updated the user agent info in the comment

--- lib/TransferManager.cs
+++ lib/TransferManager.cs
@@ -45,7 +45,7 @@
             {
                 // User agent string format: [UserAgentPrefix] <DMLib product token> <XSCL product token>
                 // e.g. Suppose UserAgentPrefix is "MyApp", the overall user agent string would be like
-                // 'MyApp DataMovement/0.4.1.0 WA-Storage/7.2.1 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)'
+                // 'MyApp DataMovement/0.5.0.0 WA-Storage/8.0.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)'
                 string userAgent = Constants.UserAgent + " " + Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.HeaderConstants.UserAgent;

                 if (!string.IsNullOrEmpty(configurations.UserAgentPrefix))


Fixed condition in rolecolor command

Fixed condition in rolecolor command

--- src/NadekoBot/Modules/Administration/Administration.cs
+++ src/NadekoBot/Modules/Administration/Administration.cs
@@ -176,7 +176,7 @@
             }

             var gu = (IGuildUser) Context.User;
-            if (!gu.GuildPermissions.Administrator && (!gu.RoleIds.Any() || gu.GetRoles().Max(r => r.Position) >= role.Position))
+            if (!gu.GuildPermissions.Administrator && (!gu.RoleIds.Any() || gu.GetRoles().Max(r => r.Position) < role.Position))
             {
                 await ReplyErrorLocalized("rc_perms_pos").ConfigureAwait(false);
                 return;