stopwatch toegevoegd aan applicatie

stopwatch toegevoegd aan applicatie

--- ProjecEulerAnswers/Program.cs
+++ ProjecEulerAnswers/Program.cs
@@ -63,7 +63,14 @@
                                 Console.WriteLine("Problem don't exists");
                             }
                             else
+                            {
+                                System.Diagnostics.Stopwatch stp = new System.Diagnostics.Stopwatch();
+                                stp.Start();
                                 Console.WriteLine(problems.First(p => p.GetType().Name == "Problem" + answer).GetAnswer());
+                                stp.Stop();
+                                Console.WriteLine(stp.Elapsed.ToString());
+                                Console.WriteLine();
+                            }
                         }
                         break;
                 }


Fixed another small build error

Fixed another small build error

--- Quilt4.Service.Entity/User.cs
+++ Quilt4.Service.Entity/User.cs
@@ -9,8 +9,8 @@
             PasswordHash = passwordHash;
         }

-        public string Username { get; }
-        public string Email { get; }
-        public string PasswordHash { get; }
+        public string Username { get; private set; }
+        public string Email { get; private set; }
+        public string PasswordHash { get; private set; }
     }
 }


Add SentUTC to PrivateMessage

Add SentUTC to PrivateMessage

--- RedditSharp/PrivateMessage.cs
+++ RedditSharp/PrivateMessage.cs
@@ -24,6 +24,9 @@
         [JsonProperty("created")]
         [JsonConverter(typeof(UnixTimestampConverter))]
         public DateTime Sent { get; set; }
+        [JsonProperty("created_utc")]
+        [JsonConverter(typeof(UnixTimestampConverter))]
+        public DateTime SentUTC { get; set; }
         [JsonProperty("dest")]
         public string Destination { get; set; }
         [JsonProperty("author")]


Made monster dash spells optional.

Made monster dash spells optional.

--- References/AssemblyVersion.cs
+++ References/AssemblyVersion.cs
@@ -1,5 +1,5 @@
 //Copyright (c) 2012 Gaslamp Games Inc. See license.txt for license information.
 using System.Reflection;

-[assembly: AssemblyVersion( "1.1.0.0" )]
-[assembly: AssemblyFileVersion( "1.1.0.0" )]
+[assembly: AssemblyVersion( "1.1.1.0" )]
+[assembly: AssemblyFileVersion( "1.1.1.0" )]


fixed example

fixed example

--- VisaCheckout.Example/Views/Home/Index.cshtml
+++ VisaCheckout.Example/Views/Home/Index.cshtml
@@ -43,7 +43,7 @@
                 Tax = 1.27M,
                 Total = 10.73M
             },
-            Settings = new VisaCheckout.VisaHelper.Options.Settings
+            Settings = new VisaCheckout.VisaHelper.Options.SettingOptions
             {
                 Payment = new VisaCheckout.VisaHelper.Options.PaymentOptions
                 {


#28 Привел в актуальный вид метод photos.getWallUploadServer тесты

--- VkNet.Tests/Categories/PhotosCategoryTest.cs
+++ VkNet.Tests/Categories/PhotosCategoryTest.cs
@@ -462,8 +462,8 @@
         [Test]
         public void SaveWallPhoto_NormalCase()
         {
-            const string url = @"https://api.vk.com/method/photos.saveWallPhoto?user_id=1234&group_id=123&photo=photo&server=5678&hash=hash_hash&v=5.9&access_token=token";
-            const string json = @"{
+			const string url = "https://api.vk.com/method/photos.saveWallPhoto?user_id=1234&group_id=123&photo=photo&server=5678&hash=hash_hash&v=5.37&access_token=token";
+			const string json = @"{
     'response': [
         {
             'id': 3446123,


Version number increased

Version number increased

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


add new known assemblies path for .app

add new known assemblies path for .app

--- Installer/Installer.cs
+++ Installer/Installer.cs
@@ -42,7 +42,7 @@
 				Patcher = null;

 				// look for a .app in the directory if we didn't find anything
-				if (recursive && Utils.IsUnix() && Directory.Exists(path))
+				if (recursive && Directory.Exists(path))
 				{
 					var dir = Directory.EnumerateDirectories(path)
 						.FirstOrDefault(d => Path.GetFileName(d.TrimEnd(Path.DirectorySeparatorChar)).EndsWith(".app"));
@@ -127,8 +127,16 @@
 		{
 			if (Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar))?.EndsWith(".app") ?? false)
 			{
-				var assembliesPath = Path.Combine(path, "Contents", "Data", "Managed");
-				var gameDllPath = Path.Combine(assembliesPath, "Assembly-CSharp.dll");
+				string assembliesPath;
+				string gameDllPath;
+
+				assembliesPath = Path.Combine(path, "Contents", "Resources", "Data", "Managed");
+				gameDllPath = Path.Combine(assembliesPath, "Assembly-CSharp.dll");
+				if (Directory.Exists(assembliesPath) && File.Exists(gameDllPath))
+					return assembliesPath;
+
+				assembliesPath = Path.Combine(path, "Contents", "Data", "Managed");
+				gameDllPath = Path.Combine(assembliesPath, "Assembly-CSharp.dll");
 				if (Directory.Exists(assembliesPath) && File.Exists(gameDllPath))
 					return assembliesPath;
 			}


changed the view result object to return empty lists rather than throw null reference exceptions on empty or non existent views


TestLinkedFilesStayInSync unit test

TestLinkedFilesStayInSync unit test

--- src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs
+++ src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs
@@ -1,6 +1,8 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

 using System;
+using System.Collections.Generic;
+using System.Composition;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
@@ -11,11 +13,10 @@
 using Microsoft.CodeAnalysis.Shared.Extensions;
 using Microsoft.CodeAnalysis.Shared.TestHooks;
 using Microsoft.CodeAnalysis.Text;
+using Microsoft.VisualStudio.Composition;
 using Microsoft.VisualStudio.Text;
 using Roslyn.Test.Utilities;
 using Xunit;
-using System.Composition;
-using Microsoft.VisualStudio.Composition;

 namespace Microsoft.CodeAnalysis.UnitTests.Workspaces
 {
@@ -1003,5 +1004,51 @@
                 Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().Name);
             }
         }
+
+        [Fact, WorkItem(209299, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=209299")]
+        public async Task TestLinkedFilesStayInSync()
+        {
+            var originalText = "class Program1 { }";
+            var updatedText = "class Program2 { }";
+
+            var input = $@"
+<Workspace>
+    <Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true"">
+        <Document FilePath=""Test.cs"">{ originalText }</Document>
+    </Project>
+    <Project Language=""C#"" AssemblyName=""Assembly2"" CommonReferences=""true"">
+        <Document IsLinkFile=""true"" LinkAssemblyName=""Assembly1"" LinkFilePath=""Test.cs"" />
+    </Project>
+</Workspace>";
+
+            using (var workspace = TestWorkspace.Create(input, exportProvider: s_exportProvider.Value))
+            {
+                var eventArgs = new List<WorkspaceChangeEventArgs>();
+
+                workspace.WorkspaceChanged += (s, e) =>
+                {
+                    Assert.Equal(WorkspaceChangeKind.DocumentChanged, e.Kind);
+                    eventArgs.Add(e);
+                };
+
+                var originalDocumentId = workspace.GetOpenDocumentIds().Single(id => !workspace.GetTestDocument(id).IsLinkFile);
+                var linkedDocumentId = workspace.GetOpenDocumentIds().Single(id => workspace.GetTestDocument(id).IsLinkFile);
+
+                workspace.GetTestDocument(originalDocumentId).Update(SourceText.From("class Program2 { }"));
+                await WaitForWorkspaceOperationsToComplete(workspace);
+
+                Assert.Equal(2, eventArgs.Count);
+                AssertEx.SetEqual(workspace.Projects.SelectMany(p => p.Documents).Select(d => d.Id), eventArgs.Select(e => e.DocumentId));
+
+                Assert.Equal(eventArgs[0].OldSolution, eventArgs[1].OldSolution);
+                Assert.Equal(eventArgs[0].NewSolution, eventArgs[1].NewSolution);
+
+                Assert.Equal(originalText, (await eventArgs[0].OldSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString());
+                Assert.Equal(originalText, (await eventArgs[1].OldSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString());
+
+                Assert.Equal(updatedText, (await eventArgs[0].NewSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString());
+                Assert.Equal(updatedText, (await eventArgs[1].NewSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString());
+            }
+        }
     }
 }


fix failing test

fix failing test

--- source/Appccelerate.StateMachine.Specs/Async/Extensions.cs
+++ source/Appccelerate.StateMachine.Specs/Async/Extensions.cs
@@ -41,6 +41,7 @@
                         .On(1)
                         .Goto("1");
                 machine = stateMachineDefinitionBuilder
+                    .WithInitialState("0")
                     .Build()
                     .CreatePassiveStateMachine(Name);

@@ -80,6 +81,7 @@
                         .On("A0")
                         .Goto("A0");
                 machine = stateMachineDefinitionBuilder
+                    .WithInitialState("0")
                     .Build()
                     .CreatePassiveStateMachine(Name);


Fix one other place in preview workspace where we need to handle additional document.

--- src/EditorFeatures/Core/Shared/Preview/PreviewWorkspace.cs
+++ src/EditorFeatures/Core/Shared/Preview/PreviewWorkspace.cs
@@ -1,12 +1,9 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

-using System.Collections.Generic;
 using System.Threading;
-using Microsoft.CodeAnalysis.Diagnostics;
 using Microsoft.CodeAnalysis.Host;
 using Microsoft.CodeAnalysis.Host.Mef;
 using Microsoft.CodeAnalysis.SolutionCrawler;
-using Microsoft.CodeAnalysis.Text;
 using Roslyn.Utilities;

 namespace Microsoft.CodeAnalysis.Editor.Shared.Preview
@@ -51,6 +48,12 @@

         public override void OpenDocument(DocumentId documentId, bool activate = true)
         {
+            if (this.CurrentSolution.ContainsAdditionalDocument(documentId))
+            {
+                OpenAdditionalDocument(documentId, activate);
+                return;
+            }
+
             var document = this.CurrentSolution.GetDocument(documentId);
             var text = document.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None);


Added delta calculation of mouse gui position

--- source/CjClutter.OpenGl/Input/Mouse/MouseInputProcessor.cs
+++ source/CjClutter.OpenGl/Input/Mouse/MouseInputProcessor.cs
@@ -12,6 +12,8 @@

         private MouseState _previousFrameMouseState;
         private MouseState _currentFrameMouseState;
+        private Vector2d _currentRelativeMousePosition;
+        private Vector2d _previousRelativeMousePosition;

         public MouseInputProcessor(GameWindow gameWindow, IGuiToRelativeCoordinateTransformer guiToRelativeCoordinateTransformer)
         {
@@ -29,6 +31,20 @@
         {
             _previousFrameMouseState = _currentFrameMouseState;
             _currentFrameMouseState = mouseState;
+
+            CalculateRelativeMousePosition();
+        }
+
+        private void CalculateRelativeMousePosition()
+        {
+            var mouseDevice = _gameWindow.Mouse;
+
+            var x = mouseDevice.X;
+            var y = mouseDevice.Y;
+            var absoluteMouseCoordinates = new Vector2d(x, y);
+
+            _previousRelativeMousePosition = _currentRelativeMousePosition;
+            _currentRelativeMousePosition = _guiToRelativeCoordinateTransformer.TransformToRelative(absoluteMouseCoordinates);
         }

         public bool WasButtonReleased(MouseButton button)
@@ -72,13 +88,12 @@

         public Vector2d GetRelativeMousePosition()
         {
-            var mouseDevice = _gameWindow.Mouse;
-
-            var x = mouseDevice.X;
-            var y = mouseDevice.Y;
-            var absoluteMouseCoordinates = new Vector2d(x, y);
+            return _currentRelativeMousePosition;
+        }

-            return _guiToRelativeCoordinateTransformer.TransformToRelative(absoluteMouseCoordinates);
+        public Vector2d GetRelativeMousePositionDelta()
+        {
+            return _currentRelativeMousePosition - _previousRelativeMousePosition;
         }

         public float GetMouseWheelDelta()


Fix for memory leak in UWP SKXamlCanvas that holds reference to WriteableBitmap

--- source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKXamlCanvas.cs
+++ source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKXamlCanvas.cs
@@ -152,6 +152,7 @@

 		private void FreeBitmap(bool freeArray)
 		{
+		    Background = null;
 			if (bitmap != null)
 			{
 				bitmap = null;


Fix crash that would occur if --save-program was supplied but they output directory didn't exist.

--- DaikonDotNetFrontEnd/DotNetFrontEnd/DeclarationPrinter.cs
+++ DaikonDotNetFrontEnd/DotNetFrontEnd/DeclarationPrinter.cs
@@ -133,6 +133,10 @@
       }
       else
       {
+        if (!Directory.Exists(frontEndArgs.OutputLocation))
+        {
+          Directory.CreateDirectory(Path.GetDirectoryName(frontEndArgs.OutputLocation));
+        }
         this.fileWriter = new StreamWriter(this.frontEndArgs.OutputLocation);
       }


ManagedClient: Use system proxy

ManagedClient: Use system proxy

--- Docker.DotNet/Microsoft.Net.Http.Client/ManagedHandler.cs
+++ Docker.DotNet/Microsoft.Net.Http.Client/ManagedHandler.cs
@@ -26,11 +26,23 @@
             }
         }

-        public Uri ProxyAddress
-        {
-            // TODO: Validate that only an absolute http address is specified. Path, query, and fragment are ignored
-            get; set;
-        }
+        public IWebProxy Proxy
+        {
+            get
+            {
+                if (_proxy == null)
+                {
+                    _proxy = WebRequest.GetSystemWebProxy();
+                }
+                return _proxy;
+            }
+            set
+            {
+                _proxy = value;
+            }
+        }
+
+        public bool UseProxy { get; set; } = true;

         public int MaxAutomaticRedirects { get; set; } = 20;

@@ -41,6 +53,7 @@
         public RemoteCertificateValidationCallback ServerCertificateValidationCallback { get; set; }

         private StreamOpener _opener;
+        private IWebProxy _proxy;

         protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         {
@@ -243,10 +256,17 @@
                 request.SetAddressLineProperty(pathAndQuery);
             }

-            if (ProxyAddress == null)
+            if (!UseProxy || Proxy.IsBypassed(request.RequestUri))
             {
                 return ProxyMode.None;
             }
+
+            var proxyUri = Proxy.GetProxy(request.RequestUri);
+            if (proxyUri == null)
+            {
+                return ProxyMode.None;
+            }
+
             if (request.IsHttp())
             {
                 if (string.IsNullOrEmpty(addressLine))
@@ -254,13 +274,13 @@
                     addressLine = scheme + "://" + host + ":" + port.Value + pathAndQuery;
                     request.SetAddressLineProperty(addressLine);
                 }
-                request.SetConnectionHostProperty(ProxyAddress.DnsSafeHost);
-                request.SetConnectionPortProperty(ProxyAddress.Port);
+                request.SetConnectionHostProperty(proxyUri.DnsSafeHost);
+                request.SetConnectionPortProperty(proxyUri.Port);
                 return ProxyMode.Http;
             }
             // Tunneling generates a completely seperate request, don't alter the original, just the connection address.
-            request.SetConnectionHostProperty(ProxyAddress.DnsSafeHost);
-            request.SetConnectionPortProperty(ProxyAddress.Port);
+            request.SetConnectionHostProperty(proxyUri.DnsSafeHost);
+            request.SetConnectionPortProperty(proxyUri.Port);
             return ProxyMode.Tunnel;
         }


First pass at supporting paramterized test cases whose inputs are not known during discovery time but are known at execution time.

--- src/Fixie.VisualStudio.TestAdapter/VisualStudioListener.cs
+++ src/Fixie.VisualStudio.TestAdapter/VisualStudioListener.cs
@@ -21,7 +21,7 @@

         public void CaseSkipped(SkipResult result)
         {
-            var testCase = new TestCase(result.Name, Executor.Uri, source);
+            var testCase = new TestCase(TestMethodName(result.Name), Executor.Uri, source);
             log.RecordResult(new TestResult(testCase)
             {
                 DisplayName = result.Name,
@@ -32,7 +32,7 @@

         public void CasePassed(PassResult result)
         {
-            var testCase = new TestCase(result.Name, Executor.Uri, source);
+            var testCase = new TestCase(TestMethodName(result.Name), Executor.Uri, source);
             log.RecordResult(new TestResult(testCase)
             {
                 DisplayName = result.Name,
@@ -44,7 +44,7 @@

         public void CaseFailed(FailResult result)
         {
-            var testCase = new TestCase(result.Name, Executor.Uri, source);
+            var testCase = new TestCase(TestMethodName(result.Name), Executor.Uri, source);
             log.RecordResult(new TestResult(testCase)
             {
                 DisplayName = result.Name,
@@ -72,5 +72,23 @@
                     return TestOutcome.None;
             }
         }
+
+        static string TestMethodName(string caseName)
+        {
+            //The Visual Studio test runner has poor support for parameterized test methods,
+            //when the arguments are not known ahead of time. It assumes that the TestCase
+            //FullyQualifyName strings will pefectly match between the discovery phase and
+            //the execution phase. The best thing that can be done for parameterized tests
+            //is to include the full name of the class/method (without parameter information)
+            //as the TestCase's FullyQualifiedName while providing the full Case name
+            //(including parameter information) as the TestResult's DisplayName.  This
+            //combination allows the Visual Studio test runner to display each individual
+            //test case's success or failure, grouped under the method name.
+
+            if (caseName.Contains("("))
+                return caseName.Substring(0, caseName.IndexOf("("));
+
+            return caseName;
+        }
     }
 }


Add documentation to Node class

Add documentation to Node class

--- compiler/middleend/ir/Node.cs
+++ compiler/middleend/ir/Node.cs
@@ -21,6 +21,10 @@

+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="pBB">A Basic block</param>
 		public Node(BasicBlock pBB)
 		{
 			BB = pBB;
@@ -29,13 +33,20 @@

 		}

-
+        /// <summary>
+        /// Checks if this node is a root with no parents
+        /// </summary>
+        /// <returns>True if this node has no parents</returns>
 	    public bool IsRoot()
 	    {
 	        return (Parent == null);
 	    }

+        /// <summary>
+        /// Inserts a node/subgraph into the CFG
+        /// </summary>
+        /// <param name="other">The root of the other CFG</param>
 	    public virtual void Insert(Node other)
 	    {
 	        if (Child == null)


Update Feature1.cs

Update Feature1.cs

--- ConsoleApp1/ConsoleApp1/Feature1.cs
+++ ConsoleApp1/ConsoleApp1/Feature1.cs
@@ -8,9 +8,10 @@
 {
     class Feature1
     {
-        Feature1()
+        int _x;
+        Feature1(int x)
         {
-
+            _x=x;
         }
     }
 }


Reverse size + - buttons

Reverse size + - buttons

--- Source/CapComSettingsWindow.cs
+++ Source/CapComSettingsWindow.cs
@@ -48,6 +48,8 @@

 		protected override void Awake()
 		{
+			base.Awake();
+
 			if (CapCom.Instance != null)
 			{
 				Rect r = CapCom.Instance.Window.WindowRect;
@@ -200,19 +202,19 @@
 			GUILayout.BeginHorizontal();
 			GUILayout.Label("Window Scale: " + CapCom.Settings.windowScale.ToString("P0"), GUILayout.Width(150));

+			if (GUILayout.Button("Size -", CapComSkins.keycodeButton, GUILayout.Width(50)))
+			{
+				if (CapCom.Settings.windowScale > 0.7f)
+					CapCom.Settings.windowScale -= 0.1f;
+
+				Scale = CapCom.Settings.windowScale;
+				CapCom.Instance.Window.Scale = CapCom.Settings.windowScale;
+			}
+
 			if (GUILayout.Button("Size +", CapComSkins.keycodeButton, GUILayout.Width(50)))
 			{
 				if (CapCom.Settings.windowScale < 2)
 					CapCom.Settings.windowScale += 0.1f;
-
-				Scale = CapCom.Settings.windowScale;
-				CapCom.Instance.Window.Scale = CapCom.Settings.windowScale;
-			}
-
-			if (GUILayout.Button("Size -", CapComSkins.keycodeButton, GUILayout.Width(50)))
-			{
-				if (CapCom.Settings.windowScale > 0.7f)
-					CapCom.Settings.windowScale -= 0.1f;

 				Scale = CapCom.Settings.windowScale;
 				CapCom.Instance.Window.Scale = CapCom.Settings.windowScale;
@@ -400,6 +402,7 @@
 					if (CapCom.Instance.Toolbar != null)
 					{
 						Destroy(CapCom.Instance.Toolbar);
+						CapCom.Instance.Toolbar = null;
 					}
 				}
 				else
@@ -408,6 +411,7 @@
 					if (CapCom.Instance.StockToolbar != null)
 					{
 						Destroy(CapCom.Instance.StockToolbar);
+						CapCom.Instance.StockToolbar = null;
 					}
 				}
 			}


Falta de instanciar a variável methodCache

quando não iniciamos a variável methodCache dá um erro, pois no código é feito um contains nela e quando ela está nula o contains dá um erro pois a variável não foi iniciada

--- src/ACBr.Net.Core.Shared/InteropServices/ACBrSafeHandle.cs
+++ src/ACBr.Net.Core.Shared/InteropServices/ACBrSafeHandle.cs
@@ -205,6 +205,7 @@
             : base(IntPtr.Zero, true)
         {
             methodList = new Dictionary<Type, string>();
+            methodCache = new Dictionary<string, Delegate>();
             className = GetType().Name;

             var pNewSession = LibLoader.LoadLibrary(dllPath);
@@ -352,4 +353,4 @@

         #endregion Methods
     }
-}+}


VW version bump

VW version bump

--- Controllers/DeploymentController.cs
+++ Controllers/DeploymentController.cs
@@ -47,7 +47,7 @@
                         // Copy the .cspkg to user blob and generate SAS tokens for deployment
                         // NOTE: this has to live in blob storage, cannot be any random URL
                         // TODO: take the link URL as parameter
-                        string cspkgLink = $"https://github.com/eisber/vowpal_wabbit/releases/download/v8.0.0.66/VowpalWabbit.Azure.8.0.0.66.{trainerSize}.cspkg";
+                        string cspkgLink = $"https://github.com/eisber/vowpal_wabbit/releases/download/v8.2.0.0/VowpalWabbit.Azure.8.2.0.0.{trainerSize}.cspkg";
                         var cspkgUri = ApplicationMetadataStore.CreateOnlineTrainerCspkgBlobIfNotExists(cspkgLink);

                         telemetry.TrackTrace($"SASToken: clSASTokenUri: '{clSASTokenUri}' webSASTokenUri: '{webSASTokenUri}' cspkgUri: '{cspkgUri}'");


reconnect and logging fix

reconnect and logging fix

--- beParser/frmMain.cs
+++ beParser/frmMain.cs
@@ -135,7 +135,7 @@

             if (!appendLogs)
             {
-                // We're not appending to create/overwrite program log files
+                // We're not appending so create/overwrite program log files
                 try
                 {
                     FileStream fs = new FileStream(logFileOutput, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
@@ -294,22 +294,6 @@
             Thread tLinesQueued = new Thread(DoLinesQueued);
             tLinesQueued.IsBackground = true;
             tLinesQueued.Start();
-
-            // create timer to keep RCON connection open if needed
-            // TODO: make RCON connection functionality into a nice, elegant class
-            var timerRCON = new System.Timers.Timer();
-            timerRCON.AutoReset = true;
-            timerRCON.SynchronizingObject = this;
-            timerRCON.Interval = 5000;
-            timerRCON.Elapsed +=
-                (sender, args) =>
-                {
-                    if (!connected && reconnecting)
-                    {
-                        beClient.Connect();
-                    }
-                };
-            timerRCON.Start();
         }

         private bool LoadFileChecks()
@@ -368,7 +352,7 @@
             beClient.BattlEyeMessageReceived += BattlEyeMessageReceived;
             beClient.BattlEyeConnected += BattlEyeConnected;
             beClient.BattlEyeDisconnected += BattlEyeDisconnected;
-            beClient.ReconnectOnPacketLoss = true;
+            beClient.ReconnectOnPacketLoss = false;
             beClient.Connect();
         }

@@ -380,16 +364,36 @@
             }
         }

+        private void BEReconnect()
+        {
+            reconnecting = true;
+            new Thread(new ThreadStart(HandleBEReconnect))
+            {
+                IsBackground = true
+            }.Start();
+        }
+
+        private void HandleBEReconnect()
+        {
+            while(reconnecting && !beClient.Connected)
+            {
+                Thread.Sleep(5000);
+                BEDisconnect();
+                BEConnect();
+            }
+            reconnecting = false;
+        }
+
         private void BattlEyeConnected(BattlEyeConnectEventArgs args)
         {
             switch (args.ConnectionResult)
             {
                 case BattlEyeConnectionResult.Success:
-                    SetConnectChecked(true);
                     connected = true;
                     if (reconnecting)
                     {
                         LogDebug("RCON Reconnected");
+                        reconnecting = false;
                     }
                     else
                     {
@@ -398,17 +402,14 @@
                     reconnecting = false;
                     return;
                 case BattlEyeConnectionResult.ConnectionFailed:
-                    SetConnectChecked(false);
                     connected = false;
                     LogDebug("RCON Failed to connect, please check server is running and beserver.cfg password is correct");
                     return;
                 case BattlEyeConnectionResult.InvalidLogin:
-                    SetConnectChecked(false);
                     connected = false;
                     LogDebug("RCON Login is invalid");
                     return;
                 default:
-                    SetConnectChecked(false);
                     connected = false;
                     LogDebug("RCON Unknown error");
                     return;
@@ -429,8 +430,8 @@
                     case BattlEyeDisconnectionType.ConnectionLost:
                         if (!reconnecting)
                         {
-                            LogDebug("RCON Connection lost, attempting to recoonect");
-                            reconnecting = true;
+                            LogDebug("RCON Connection lost, attempting to reconnect");
+                            BEReconnect();
                             return;
                         }
                         return;
@@ -444,8 +445,8 @@
                         {
                             if (!reconnecting)
                             {
-                                LogDebug("RCON Connection lost, attempting to recoonect");
-                                reconnecting = true;
+                                LogDebug("RCON Server appears down, attempting to reconnect");
+                                BEReconnect();
                                 return;
                             }
                             return;
@@ -677,17 +678,21 @@

         internal void LogDebug(String s)
         {
-            UpdateDebugText(String.Format("{0} {1}", GetDateString(), s));
+            s = String.Format("{0} {1}", GetDateString(), s);
+            UpdateDebugText(s);
+            WriteLogFile("debug", s);
         }

         internal void LogOutput(String s)
         {
             UpdateOutputText(s);
+            WriteLogFile("output", s);
         }

         internal void LogRcon(String s)
         {
             UpdateRconText(s);
+            WriteLogFile("rcon", s);
         }

         private void DoLinesQueued()


Update MySqlTypeMap.cs

Update MySqlTypeMap.cs

version 1.1.2 causes error when migrating 'versioninfo' table by adding a 'description' column on MySQL database.
This error caused by method 'Up' in 'VersionDescriptionMigration' class. The method calls .AsString(int.MaxValue) which is beyond
definition in MySqlTypeMap class

--- src/FluentMigrator.Runner/Generators/MySql/MySqlTypeMap.cs
+++ src/FluentMigrator.Runner/Generators/MySql/MySqlTypeMap.cs
@@ -9,6 +9,7 @@
         public const int StringCapacity = 255;
         public const int TextCapacity = 65535;
         public const int MediumTextCapacity = 16777215;
+        public const int LongTextCapacity = int.MaxValue;
         public const int DecimalCapacity = 19;

         protected override void SetupTypeMaps()
@@ -17,10 +18,12 @@
             SetTypeMap(DbType.AnsiStringFixedLength, "CHAR($size)", StringCapacity);
             SetTypeMap(DbType.AnsiStringFixedLength, "TEXT", TextCapacity);
             SetTypeMap(DbType.AnsiStringFixedLength, "MEDIUMTEXT", MediumTextCapacity);
+            SetTypeMap(DbType.AnsiStringFixedLength, "LONGTEXT", LongTextCapacity);
             SetTypeMap(DbType.AnsiString, "VARCHAR(255)");
             SetTypeMap(DbType.AnsiString, "VARCHAR($size)", StringCapacity);
             SetTypeMap(DbType.AnsiString, "TEXT", TextCapacity);
             SetTypeMap(DbType.AnsiString, "MEDIUMTEXT", MediumTextCapacity);
+            SetTypeMap(DbType.AnsiString, "LONGTEXT", LongTextCapacity);
             SetTypeMap(DbType.Binary, "LONGBLOB");
             SetTypeMap(DbType.Binary, "TINYBLOB", AnsiTinyStringCapacity);
             SetTypeMap(DbType.Binary, "BLOB", TextCapacity);
@@ -42,10 +45,12 @@
             SetTypeMap(DbType.StringFixedLength, "CHAR($size)", StringCapacity);
             SetTypeMap(DbType.StringFixedLength, "TEXT", TextCapacity);
             SetTypeMap(DbType.StringFixedLength, "MEDIUMTEXT", MediumTextCapacity);
+            SetTypeMap(DbType.StringFixedLength, "LONGTEXT", LongTextCapacity);
             SetTypeMap(DbType.String, "VARCHAR(255)");
             SetTypeMap(DbType.String, "VARCHAR($size)", StringCapacity);
             SetTypeMap(DbType.String, "TEXT", TextCapacity);
             SetTypeMap(DbType.String, "MEDIUMTEXT", MediumTextCapacity);
+            SetTypeMap(DbType.String, "LONGTEXT", LongTextCapacity);
             SetTypeMap(DbType.Time, "DATETIME");
         }
     }


add UserConnections.Replace to Signum.Test

--- Signum.Test/Starter.cs
+++ Signum.Test/Starter.cs
@@ -23,7 +23,7 @@
         {
             if (!startedAndLoaded)
             {
-                Start(Settings.Default.SignumTest);
+                Start(UserConnections.Replace(Settings.Default.SignumTest));

                 Administrator.TotalGeneration();


Fix transient property selection

Fix transient property selection

--- Facade/NakedObjects.Facade.Impl/Facade/FrameworkFacade.cs
+++ Facade/NakedObjects.Facade.Impl/Facade/FrameworkFacade.cs
@@ -395,23 +395,21 @@
                 return valueNakedObject.Object.ToString();
             }

-            var tt = ObjectFacade.Wrap(valueNakedObject, this, Framework);
-
-            return OidStrategy.FrameworkFacade.OidTranslator.GetOidTranslation(tt).Encode();
+            var objectFacade = ObjectFacade.Wrap(valueNakedObject, this, Framework);
+            return OidStrategy.FrameworkFacade.OidTranslator.GetOidTranslation(objectFacade).Encode();
         }

         protected string GetTransientSecurityHash(ObjectContext target) {
             IObjectSpec spec = target.Specification as IObjectSpec;
-            string propertiesValue = Framework.Session.Principal.Identity.Name ?? "";
+            string propertiesValue = "UserName:" + (Framework.Session.Principal.Identity.Name ?? "");

             if (spec != null) {
                 var nakedObject = target.Target;

                 var allProperties = spec.Properties.OfType<IOneToOneAssociationSpec>().Where(p => !p.IsInline);
-                var unusableProperties = allProperties.Where(p => p.IsUsable(nakedObject).IsVetoed && !p.IsVisible(nakedObject));
-
-                var propertyValues = unusableProperties.ToDictionary(p => p.Id, p => GetPropertyValueForEtag(p, nakedObject));
+                var userUnsettableProperties = allProperties.Where(p => p.IsUsable(nakedObject).IsVetoed || !p.IsVisible(nakedObject));
+                var propertyValues = userUnsettableProperties.ToDictionary(p => p.Id, p => GetPropertyValueForEtag(p, nakedObject));

                 propertiesValue +=  propertyValues.Aggregate("", (s, kvp) => s + kvp.Key + ":" + kvp.Value);
             }


Added some command-line options. Not implemented yet

--- Simulator/Simulator.cs
+++ Simulator/Simulator.cs
@@ -1,11 +1,6 @@
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
 using System.Linq;
-using System.Security.Policy;
-using System.Text;
-using System.Threading.Tasks;
 using Engine;
 using Botclient;

@@ -13,71 +8,167 @@
 {
     class Simulator
     {
+
         static Game game;
-        private static bool tie = false;
+        private static int width = 7;
+        private static int height = 6;
+        private static int max_games = 1;
+        private static int games_played;
+        private static int games_won_alice;
+        private static int games_won_bob;
+        private enum log_mode
+        {
+            silent,         //Nothing is logged
+            only_errors,    //Only errors are logged
+            essential,      //Loggs all less common messages and errors (default)
+            verbose,        //Loggs a lot of things
+            debug           //Loggs everything
+        }

-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="args"></param>
-        private static void Main(string[] args)
-        {
-            while (true)
-            {
-                game = new Game(7, 6);
-                Console.WriteLine($"Created new game of {game.get_field().Width} by {game.get_field().Height}");
-                List<IPlayer> players = new List<IPlayer>()
-                {
-                    new Bot(Engine.players.Alice),
-                    new Bot(Engine.players.Bob)
-                };
-
-                do
-                {
-                    do_turn(players.Find(player => player.player == game.next_players)); //Execute the turn the player who's turn it is
-                } while (!(check_for_win() || tie));
-                if (tie)
-                {
-                    Console.WriteLine("The game is a tie");
-                }
-                else if (game.has_won(Engine.players.Alice))
-                {
-                    Console.WriteLine("Alice won the game");
-                }
-                else
-                {
-                    Console.WriteLine("Bob won the game");
-                }
-                Console.ReadLine();
-            }
-
-        }
+        static private log_mode mode = log_mode.essential;
         /// <summary>
         /// Tries to execute the given turn from the given player.
         /// If the given turn is not possible for whatever reason, the player is asked again.
+        /// Returns false if it fails to drop a stone;
         /// </summary>
         /// <param name="player"></param>
-        static void do_turn(IPlayer player)
+        static bool do_turn(IPlayer player)
         {
+            if (game.stones_count == game.width * game.height) //If the whole field is full of stones and no one has won, it's a tie
+            {
+                return false;
+            }
             string s = "";
             int counter = 0;
-            while (!game.add_stone(player.get_turn(game.get_field()), player.player, ref s))
+            while (!game.add_stone(player.get_turn(game.get_field()), player.player, ref s)) //Try to add a stone fails. If that fails, log the error and try it again.
             {
-                if (s != "")
+                counter++;
+                Console.WriteLine($"{s} ({counter} tries)");
+                if (counter >= 100) //If we tried enough times to add a stone, exit the game to prevent infinite looping
                 {
-                    counter++;
-                    Console.WriteLine($"{s} ({counter} tries)");
-                    if (counter > 100) //Lazy way to prevent the simulator from locking itself if it can't add any new stones
+                    Console.WriteLine("Exceeded maximum of tries for a turn");
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        static void do_game()
+        {
+            game = new Game((byte)width, (byte)height);
+            Console.WriteLine($"Created new game of {game.get_field().Width} by {game.get_field().Height}");
+            List<IPlayer> _players = new List<IPlayer>() //A fancy list to prevent the use of if-statements
+                {
+                    new Bot(players.Alice),
+                    new Bot(players.Bob)
+                };
+            bool tie = false;
+            do
+            {
+                tie = !do_turn(_players.Find(player => player.player == game.next_players)); //Execute the turn the player who's turn it is. If do_turn returns false, it is a tie;
+            } while (!(game.has_won(players.Alice) || game.has_won(players.Bob) || !tie)); //Keep processing turns if no one has won and it isn't a tie
+            if (tie)
+            {
+                Console.WriteLine("The game is a tie");
+            }
+            else if (game.has_won(players.Alice))
+            {
+                Console.WriteLine("Alice won the game");
+            }
+            else
+            {
+                Console.WriteLine("Bob won the game");
+            }
+            Console.ReadLine();
+        }
+
+        private static void init(string[] _args)
+        {
+            List<string> args = new List<string>(_args);
+            int log_mode_index = (args.IndexOf("-l"));
+            if (log_mode_index != -1)
+            {
+                try
+                {
+                    byte log_mode_arg = byte.Parse(args[log_mode_index + 1]);
+                    if (log_mode_arg < 5)
                     {
-                        tie = true;
-                        break;
+                        mode = (log_mode) log_mode_arg;
+                        Console.WriteLine($"Log mode set to {mode}");
+                    }
+                    else
+                    {
+                        Console.WriteLine($"{log_mode_arg} is no valid log mode.");
+                        Console.WriteLine($"Log mode defaulted to {mode} (essential)");
                     }
                 }
+                catch (FormatException)
+                {
+                    Console.WriteLine("log mode wasn't given in the right format.");
+                    Console.WriteLine($"Log mode defaulted to {mode}");
+                }
             }
+
+            int width_index = (args.IndexOf("-w"));
+            if (width_index != -1)
+            {
+                try
+                {
+                    width = byte.Parse(args[width_index + 1]);
+                    Console.WriteLine($"Set width to {width}");
+                }
+                catch (FormatException)
+                {
+                    Console.WriteLine("Width wasn't given in the right format.");
+                    Console.WriteLine($"Width defaulted to {width}");
+                }
+            }
+
+            int height_index = (args.IndexOf("-h"));
+            if (height_index != -1)
+            {
+                try
+                {
+                    height = byte.Parse(args[height_index + 1]);
+                    Console.WriteLine($"Set height to {height}");
+                }
+                catch (FormatException)
+                {
+                    Console.WriteLine("Height wasn't given in the right format.");
+                    Console.WriteLine($"Height defaulted to {height}");
+                }
+            }
+
+            int max_games_index = (args.IndexOf("-g"));
+            if (max_games_index != -1)
+            {
+                try
+                {
+                    max_games = byte.Parse(args[max_games_index + 1]);
+                    Console.WriteLine($"Set amount of games to {max_games}");
+                }
+                catch (FormatException)
+                {
+                    Console.WriteLine("Amount of games wasn't given in the right format.");
+                    Console.WriteLine($"Amount of games defaulted to {max_games}");
+                }
+            }
+
+            Console.ReadLine();
         }
-        static bool check_for_win()
+
+
+        /// <param name="args">
+        /// -l  [0-5]   log mode (default 2) <see cref="log_mode"/>
+        /// -w  [>0]    width  of the playing field (default 7)
+        /// -h  [>0]    height of the playing field (default 6)
+        /// -g  [>0]    amount of games to simulate (default 1)
+        /// </param>
+        private static void Main(string[] args)
         {
-            return game.has_won(players.Alice) || game.has_won(players.Bob);
+            init(args);
+            do_game();
+
         }
     }
 }


Extracted IBitmapFont interface from BitmapFont.

--- FenixLib/FenixLib.Core.Tests/UnitTests/BitmapFontTests.cs
+++ FenixLib/FenixLib.Core.Tests/UnitTests/BitmapFontTests.cs
@@ -24,17 +24,15 @@
         private BitmapFont stubFont32;
         private BitmapFont stubFont16;

-        private Glyph stubGlyph32;
-        private Glyph stubGlyph16;
+        private IGlyph stubGlyph32;
+        private IGlyph stubGlyph16;

         [SetUp]
         public void SetUp ()
         {
-            stubFont32 = BitmapFont.Create ( GraphicFormat.ArgbInt32,
-                FontEncoding.ISO85591 );
+            stubFont32 = new BitmapFont ( FontEncoding.ISO85591, GraphicFormat.ArgbInt32 );

-            stubFont16 = BitmapFont.Create ( GraphicFormat.RgbInt16,
-                FontEncoding.ISO85591 );
+            stubFont16 = new BitmapFont ( FontEncoding.ISO85591, GraphicFormat.RgbInt16  );

             stubGlyph32 = new Glyph ( CreateFakeGraphic ( 32 ) );
             stubGlyph16 = new Glyph ( CreateFakeGraphic ( 16 ) );


Adds equality interface to PotentialUrl

Adds equality interface to PotentialUrl

--- main/PotentialUrl.cs
+++ main/PotentialUrl.cs
@@ -10,11 +10,13 @@
 // -----------------------------------------------------------------------
 namespace Dysphoria.Net.UrlRouting
 {
+	using System;
+
 	/// <summary>
 	/// (Frankly weird) abstraction of a URL's path and querystring.
 	/// Allows at least <see cref="HtmlHelperExtensions.Link"/> to be strongly typed.
 	/// </summary>
-	public class PotentialUrl
+	public class PotentialUrl: IEquatable<PotentialUrl>
 	{
 		private readonly string path;
 		private readonly string querystring;
@@ -43,5 +45,34 @@
 		{
 			return this.ApplicationAbsoluteUrl;
 		}
+
+		public override bool Equals(object obj)
+		{
+			return this.Equals(obj as PotentialUrl);
+		}
+
+		public static bool operator !=(PotentialUrl first, PotentialUrl second)
+		{
+			return !(first == second);
+		}
+
+		public static bool operator ==(PotentialUrl first, PotentialUrl second)
+		{
+			return (object)first == null
+				? (object)second == null
+				: first.Equals(second);
+		}
+
+		public bool Equals(PotentialUrl other)
+		{
+			return (object)other != null
+				&& this.Path == other.Path
+				&& this.Querystring == other.Querystring;
+		}
+
+		public override int GetHashCode()
+		{
+			return unchecked((this.Path.GetHashCode() * 41) ^ (this.Querystring ?? "").GetHashCode());
+		}
 	}
 }


fixed +7/8/9 messages

fixed +7/8/9 messages

--- TCC.Core/Data/ChatMessage.cs
+++ TCC.Core/Data/ChatMessage.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Globalization;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
@@ -761,7 +762,7 @@
                 rawLink.Append("@" + username);
             }
             MessagePiece mp = new MessagePiece(id.ToString());
-            if (SessionManager.ItemsDatabase.Items.TryGetValue(id, out Item i))
+            if (ItemsDatabase.Instance.Items.TryGetValue(id, out Item i))
             {
                 var txt = String.Format("<{0}>", i.Name);
                 mp = new MessagePiece(txt)
@@ -1011,17 +1012,23 @@
                 mw = " Awakened ";
                 e = "+15";
             }
-            else if (systemMessage.Contains("Added 8"))
+            else if (systemMessage.Contains("enchantCount:7"))
+            {
+                msg.Channel = ChatChannel.Enchant7;
+                mw = "";
+                e = "+7 ";
+            }
+            else if (systemMessage.Contains("enchantCount:8"))
             {
                 msg.Channel = ChatChannel.Enchant8;
                 mw = "";
-                e = "+8";
-            }
-            else if (systemMessage.Contains("Added 9"))
+                e = "+8 ";
+            }
+            else if (systemMessage.Contains("enchantCount:9"))
             {
                 msg.Channel = ChatChannel.Enchant9;
                 mw = "";
-                e = "+9";
+                e = "+9 ";
             }
             var prm = SplitDirectives(systemMessage);


parse money message pieces

parse money message pieces

--- TCC.Core/Data/ChatMessage.cs
+++ TCC.Core/Data/ChatMessage.cs
@@ -396,27 +396,42 @@
                     onlySimple = false;
                 }
             }
-            if (onlySimple) return;
+            //if (onlySimple) return;

             for (var i = 0; i < simplePieces.Count; i++)
             {
                 simplePieces[i].Text = simplePieces[i].Text.Replace(" ", " [[");
                 var split = simplePieces[i].Text.Split(new[] { "[[" }, StringSplitOptions.RemoveEmptyEntries);
-
                 var index = chatMessage.Pieces.IndexOf(simplePieces[i]);
                 for (var j = 0; j < split.Length; j++)
                 {
-                    var mp = new MessagePiece(split[j])
-                    {
-                        Color = simplePieces[i].Color,
-                        Type = simplePieces[i].Type,
-                        ItemId = simplePieces[i].ItemId,
-                        ItemUid = simplePieces[i].ItemUid,
-                        BoundType = simplePieces[i].BoundType,
-                        OwnerName = simplePieces[i].OwnerName,
-                        RawLink = simplePieces[i].RawLink,
-                        Size = simplePieces[i].Size
-                    };
+
+                    var endsWithK = split[j].ToLower().EndsWith("k ", StringComparison.InvariantCultureIgnoreCase) ||
+                                    split[j].ToLower().EndsWith("k", StringComparison.InvariantCultureIgnoreCase);
+                    var isNumber = int.TryParse(split[j].ToLower().Replace("k " , "").Replace("k", ""), out var money);
+
+                    //var isEmoji = split[j].StartsWith(":") && (split[j].EndsWith(":") || split[j].EndsWith(": "));
+
+                    var mp = endsWithK && isNumber && (chatMessage.Channel == ChatChannel.Trade ||
+                                                        chatMessage.Channel == ChatChannel.TradeRedirect ||
+                                                        chatMessage.Channel == ChatChannel.Megaphone ||
+                                                        chatMessage.Channel == ChatChannel.Global)?
+                        new MessagePiece(new Money(money*1000, 0, 0))
+                        //:
+                        //isEmoji?
+                        //new MessagePiece(split[j]) { Type = MessagePieceType.Emoji}
+                        :
+                        new MessagePiece(split[j])
+                        {
+                            Color = simplePieces[i].Color,
+                            Type = simplePieces[i].Type,
+                            ItemId = simplePieces[i].ItemId,
+                            ItemUid = simplePieces[i].ItemUid,
+                            BoundType = simplePieces[i].BoundType,
+                            OwnerName = simplePieces[i].OwnerName,
+                            RawLink = simplePieces[i].RawLink,
+                            Size = simplePieces[i].Size
+                        };
                     chatMessage.InsertPiece(mp, index);
                     index = chatMessage.Pieces.IndexOf(mp) + 1;
                 }


partial headers download - backend

partial headers download - backend

--- Core/Models/Mail/ImapClientModel.cs
+++ Core/Models/Mail/ImapClientModel.cs
@@ -18,6 +18,7 @@
             set
             {
                 _activeFolder = value;
+                Page = 0;
                 HeadersToShow = Headers;
             }
         }
@@ -56,6 +57,21 @@
         public IList<IMessageSummary> HeadersToShow { get; set; }

         public bool IsConnected => _client.IsConnected;
+
+        public int HeadersPerPage { get; set; } = 25;
+        public int Page
+        {
+            get
+            {
+                return _page;
+            }
+            set
+            {
+                IList<IMessageSummary> tmp;
+                _headers.TryRemove(ActiveFolder, out tmp);
+                _page = value;
+            }
+        }

         private readonly string _login;
         private readonly string _password;
@@ -72,6 +88,7 @@
         private Thread _idleThread;
         private CancellationTokenSource _idleThreadDone;
         private bool _disposed;
+        private int _page = 0;

         public ImapClientModel(string login, string password, string host, int port, bool useSsl)
         {
@@ -190,9 +207,17 @@
             {
                 var folder = _client.GetFolder(folderName);
                 folder.Open(FolderAccess.ReadOnly);
-                _headers[folderName] = folder.Fetch(0, -1, MessageSummaryItems.Full | MessageSummaryItems.UniqueId);
+
+                int min = Page * HeadersPerPage;
+                int max = min + HeadersPerPage - 1;
+                int count = folder.Count;
+                min = min >= count ? 0 : min;
+                max = max >= count ? -1 : max;
+
+                _headers[folderName] = folder.Fetch(min, max, MessageSummaryItems.Full | MessageSummaryItems.UniqueId);
                 folder.Close();
-                ActiveFolder = folderName;
+                _activeFolder = folderName;
+                HeadersToShow = Headers;
             }
         }


Tweaking GCMonitor

Tweaking GCMonitor

Increased the maxprobing for the delegate set that holds the Colleceted
event handlers. This mitigates the growth of the mentioned delegate set,
reducing memory usage.

--- Core/Theraot/Threading/GCMonitor.cs
+++ Core/Theraot/Threading/GCMonitor.cs
@@ -9,7 +9,7 @@
     public static class GCMonitor
     {
         private const int INT_CapacityHint = 1024;
-        private const int INT_MaxProbingHint = 32;
+        private const int INT_MaxProbingHint = 128;
         private const int INT_StatusFinished = 1;
         private const int INT_StatusNotReady = -2;
         private const int INT_StatusPending = -1;


resolved bug for randommail

resolved bug for randommail

--- DataGen/Types/Mail/MailGenerator.cs
+++ DataGen/Types/Mail/MailGenerator.cs
@@ -60,9 +60,11 @@
         /// <returns></returns>
         private string RandomMail(params string[] strings) {
             foreach (var name in strings) {
-                Builder.Append(name).Append(Separators[Randomizer(Separators.Count)].ToString());
+                Builder.Append(name);
                 if (name == strings[strings.Length - 1])
                     Builder.Append("@").Append(_emailDomains[Randomizer(_emailDomains.Count)]);
+                else
+                    Builder.Append(Separators[Randomizer(Separators.Count)].ToString());
             }
             var address = Builder.ToString();
             Builder.Clear();


Add filter on control interface

Add filter on control interface

--- WidgetControl/WidgetControl/WidgetControl.cs
+++ WidgetControl/WidgetControl/WidgetControl.cs
@@ -119,7 +119,8 @@
             {
                 if (
                     (deviceInfo.Common.Vid == vendorid1 || deviceInfo.Common.Vid == vendorid2) &&
-                    (deviceInfo.Common.Pid == productid1 || deviceInfo.Common.Pid == productid2 || deviceInfo.Common.Pid == productid3 || deviceInfo.Common.Pid == productid4)
+                    (deviceInfo.Common.Pid == productid1 || deviceInfo.Common.Pid == productid2 || deviceInfo.Common.Pid == productid3 || deviceInfo.Common.Pid == productid4) &&
+                     deviceInfo.DeviceInterfaceGUID.ToUpper() == "{D49AB938-53BA-498A-A848-8E2780A4A75F}"
                     )
                 {
                     if (deviceInfo.Connected)


Undid comment

Undid comment

--- Widgets/WidgetBase/VarmintWidgetRendering.cs
+++ Widgets/WidgetBase/VarmintWidgetRendering.cs
@@ -35,7 +35,7 @@
         {
             if(Renderer == null)
             {
-                //throw new InvalidOperationException("The Renderer property is null on " + this.GetType().Name + " with Name=" + Name);
+                throw new InvalidOperationException("The Renderer property is null on " + this.GetType().Name + " with Name=" + Name);
             }

             Update();


Updating links and fixing names

Updating links and fixing names

--- Derby/Views/Membership/Index.cshtml
+++ Derby/Views/Membership/Index.cshtml
@@ -14,10 +14,10 @@

         @Html.ActionLink("Create New", "Create")

-

+

-                @Html.DisplayNameFor(model => model.Pack.Name)
+                @Html.DisplayNameFor(model => model.Pack.Name) - @Html.DisplayNameFor(model => model.Pack.Region)

                 User Name
@@ -27,11 +27,12 @@

-
-    @foreach (var item in Model) {
+
+        @foreach (var item in Model)
+        {

-                @Html.DisplayFor(modelItem => item.Pack.Name)
+                @Html.DisplayFor(modelItem => item.Pack.Name) - @Html.DisplayFor(modelItem => item.Pack.Region)

                 @Html.DisplayFor(modelItem => item.User.UserName)
@@ -40,13 +41,16 @@
                 @Html.DisplayFor(modelItem => item.AccessLevel)

-                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
-                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
-                @Html.ActionLink("Delete", "Delete", new { id=item.Id })
+                  Edit
+
+                  Details
+
+                  Delete

+

-    }
-
+        }
+


Only draw glyph where text is

Only draw glyph where text is

This fixes an issue when there's a removed line above some text in the diff view. The height of the glyph now doesn't include the height of the removed line.

--- src/GitHub.InlineReviews/Glyph/GlyphMarginVisualManager.cs
+++ src/GitHub.InlineReviews/Glyph/GlyphMarginVisualManager.cs
@@ -66,17 +66,22 @@
                     var element = (FrameworkElement)glyphFactory.GenerateGlyph(startingLine, tag);
                     if (element != null)
                     {
+                        var data = new GlyphData<TGlyphTag>(span, tag, element);
+                        element.Width = glyphMarginGrid.Width;
+
+                        // draw where text is
+                        element.Height = startingLine.TextHeight + 1; // HACK: +1 to fill gaps
+                        data.SetTop(startingLine.TextTop - textView.ViewportTop);
+
+                        // draw where line is
+                        //element.Height = startingLine.Height;
+                        //data.SetTop(startingLine.Top - textView.ViewportTop);
+
                         // center on margin
                         //element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                         //double length = (17.0 - element.DesiredSize.Width) / 2.0;
                         //Canvas.SetLeft(element, length);

-                        // size to margin
-                        element.Width = glyphMarginGrid.Width;
-                        element.Height = startingLine.Height;
-
-                        var data = new GlyphData<TGlyphTag>(span, tag, element);
-                        data.SetTop(startingLine.TextTop - textView.ViewportTop);
                         glyphs[element] = data;
                         visuals[glyphType].Children.Add(element);
                     }


Use double-quotes to delimit path in embedded R code.

--- src/Host/Client/Impl/Session/RSessionEvaluationCommands.cs
+++ src/Host/Client/Impl/Session/RSessionEvaluationCommands.cs
@@ -78,17 +78,17 @@
         }

         public static Task<REvaluationResult> ExportToBitmap(this IRSessionEvaluation evaluation, string deviceName, string outputFilePath, int widthInPixels, int heightInPixels) {
-            string script = string.Format(".rtvs.vsgdexportimage('{0}', {1}, {2}, {3})", outputFilePath.Replace("\\", "/"), deviceName, widthInPixels, heightInPixels);
+            string script = string.Format(".rtvs.vsgdexportimage(\"{0}\", {1}, {2}, {3})", outputFilePath.Replace("\\", "/"), deviceName, widthInPixels, heightInPixels);
             return evaluation.EvaluateAsync(script);
         }

         public static Task<REvaluationResult> ExportToMetafile(this IRSessionEvaluation evaluation, string outputFilePath, double widthInInches, double heightInInches) {
-            string script = string.Format(".rtvs.vsgdexportimage('{0}', win.metafile, {1}, {2})", outputFilePath.Replace("\\", "/"), widthInInches, heightInInches);
+            string script = string.Format(".rtvs.vsgdexportimage(\"{0}\", win.metafile, {1}, {2})", outputFilePath.Replace("\\", "/"), widthInInches, heightInInches);
             return evaluation.EvaluateAsync(script);
         }

         public static Task<REvaluationResult> ExportToPdf(this IRSessionEvaluation evaluation, string outputFilePath, double widthInInches, double heightInInches, string paper) {
-            string script = string.Format(".rtvs.vsgdexportpdf('{0}', {1}, {2}, '{3}')", outputFilePath.Replace("\\", "/"), widthInInches, heightInInches, paper);
+            string script = string.Format(".rtvs.vsgdexportpdf(\"{0}\", {1}, {2}, '{3}')", outputFilePath.Replace("\\", "/"), widthInInches, heightInInches, paper);
             return evaluation.EvaluateAsync(script);
         }


Tabified FontBackendHandler.cs

Tabified FontBackendHandler.cs

--- Xwt.WPF/Xwt.WPFBackend/FontBackendHandler.cs
+++ Xwt.WPF/Xwt.WPFBackend/FontBackendHandler.cs
@@ -42,7 +42,7 @@
 {
 	public class WpfFontBackendHandler : FontBackendHandler
 	{
-        readonly ConcurrentDictionary<string, FontFamily> registeredFonts = new ConcurrentDictionary<string, FontFamily>();
+		readonly ConcurrentDictionary<string, FontFamily> registeredFonts = new ConcurrentDictionary<string, FontFamily>();

 		public override object GetSystemDefaultFont ()
 		{
@@ -56,13 +56,13 @@

 		public override IEnumerable<string> GetInstalledFonts ()
 		{
-		    foreach (var fontName in Fonts.SystemFontFamilies.Select(f => f.Source)) {
-		        yield return fontName;
-		    }
-
-		    foreach (var fontName in registeredFonts.Keys) {
-		        yield return fontName;
-		    }
+			foreach (var fontName in Fonts.SystemFontFamilies.Select(f => f.Source)) {
+				yield return fontName;
+			}
+
+			foreach (var fontName in registeredFonts.Keys) {
+				yield return fontName;
+			}
 		}

 		public override IEnumerable<KeyValuePair<string, object>> GetAvailableFamilyFaces (string family)
@@ -86,13 +86,13 @@

 		public override object Create (string fontName, double size, FontStyle style, FontWeight weight, FontStretch stretch)
 		{
-		    FontFamily fontFamily;
-		    if (!registeredFonts.TryGetValue (fontName, out fontFamily)) {
-		        fontFamily = new FontFamily (fontName);
-		    }
+			FontFamily fontFamily;
+			if (!registeredFonts.TryGetValue (fontName, out fontFamily)) {
+				fontFamily = new FontFamily (fontName);
+			}

 			size = GetPointsFromDeviceUnits (size);
-            return new FontData (fontFamily, size) {
+			return new FontData (fontFamily, size) {
 				Style = style.ToWpfFontStyle (),
 				Weight = weight.ToWpfFontWeight (),
 				Stretch = stretch.ToWpfFontStretch ()
@@ -101,24 +101,24 @@

 		public override bool RegisterFontFromFile (string fontPath)
 		{
-		    string absoluteFontPath = Path.GetFullPath (fontPath);
-
-            // Get font name from font file.
-            ICollection<FontFamily> fontInfo = Fonts.GetFontFamilies (absoluteFontPath);
-
-		    var fontFamily = fontInfo.SingleOrDefault ();
-		    if (fontFamily == null) {
-		        return false;
-		    }
-
-		    if (fontFamily.FamilyNames.Count == 0) {
-		        return false;
-		    }
-
-		    string fontName = fontFamily.FamilyNames.First ().Value;
-		    registeredFonts[fontName] = fontFamily;
-
-		    return true;
+			string absoluteFontPath = Path.GetFullPath (fontPath);
+
+			// Get font name from font file.
+			ICollection<FontFamily> fontInfo = Fonts.GetFontFamilies (absoluteFontPath);
+
+			var fontFamily = fontInfo.SingleOrDefault ();
+			if (fontFamily == null) {
+				return false;
+			}
+
+			if (fontFamily.FamilyNames.Count == 0) {
+				return false;
+			}
+
+			string fontName = fontFamily.FamilyNames.First ().Value;
+			registeredFonts[fontName] = fontFamily;
+
+			return true;
 		}

 		public override object Copy (object handle)
@@ -242,7 +242,7 @@
 			double size = WpfFontBackendHandler.GetPointsFromDeviceUnits (control.FontSize);

 			return new FontData (control.FontFamily, size) {
-				Style = control.FontStyle,
+				Style = control.FontStyle,
 				Stretch = control.FontStretch,
 				Weight = control.FontWeight
 			};


Fix test.

Fix test.

--- ZimmerBot.Core.Tests/BotTests/DefineTests.cs
+++ ZimmerBot.Core.Tests/BotTests/DefineTests.cs
@@ -91,15 +91,15 @@

 ! rdf_prefix rdf ""http://www.w3.org/1999/02/22-rdf-syntax-ns#""
 ! rdf_prefix rdfs ""http://www.w3.org/2000/01/rdf-schema#""
-! rdf_prefix ztype ""http://zimmerbot.org/fact/type/""
-! rdf_prefix zatt ""http://zimmerbot.org/fact/att/""
+! rdf_prefix zr ""http://zimmerbot.org/resource/""
+! rdf_prefix zp ""http://zimmerbot.org/property/""

 > show animals
 ! call RDF.Query(""
 SELECT ?name
 WHERE
 {
-  ?animal rdf:type ztype:animal.
+  ?animal rdf:type zr:animal.
   ?animal rdfs:label ?name
 }
 ORDER BY ?name
@@ -111,7 +111,7 @@
 SELECT ?country
 WHERE
 {
-  ?country a ztype:country.
+  ?country a zr:country.
 }
 ORDER BY ?country
 "")
@@ -122,10 +122,10 @@
 SELECT ?name
 WHERE
 {
-  ?country a ztype:country.
-  ?animal a ztype:animal.
+  ?country a zr:country.
+  ?animal a zr:animal.
   ?animal rdfs:label ?aname.
-  ?animal zatt:location ?country.
+  ?animal zp:location ?country.
   ?country rdfs:label ?name.
   FILTER (?aname = 'Elephant')
 }
@@ -134,8 +134,8 @@
 : <result:{r |<r.name>}; separator="", "">.
 ");

-      //AssertDialog("show animals", "Bison Elephant Horse .");
-      //AssertDialog("show countries", "http://zimmerbot.org/fact/id/Africa http://zimmerbot.org/fact/id/Earth http://zimmerbot.org/fact/id/India http://zimmerbot.org/fact/id/North_America .");
+      AssertDialog("show animals", "Bison Elephant Horse .");
+      AssertDialog("show countries", "http://zimmerbot.org/resource/Africa http://zimmerbot.org/resource/Earth http://zimmerbot.org/resource/India http://zimmerbot.org/resource/North_America .");
       AssertDialog("where can I find elephants", "Africa, India.");
     }
   }


MainApp

MainApp

--- examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
+++ examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
@@ -33,7 +33,8 @@
                 PostWireMockMiddlewareInit = app => { System.Console.WriteLine($"PostWireMockMiddlewareInit : {app.GetType()}"); },
                 Logger = new WireMockConsoleLogger(),

-                FileSystemHandler = new CustomFileSystemFileHandler()
+                // Uncomment below if you want to use the CustomFileSystemFileHandler
+                // FileSystemHandler = new CustomFileSystemFileHandler()
             });
             System.Console.WriteLine("FluentMockServer listening at {0}", string.Join(",", server.Urls));


Tweak the leakage monitor graph to make it more user friendly.

--- EDMHardwareControl/ControlWindow.cs
+++ EDMHardwareControl/ControlWindow.cs
@@ -316,6 +316,15 @@
             this.label15 = new System.Windows.Forms.Label();
             this.cMinusVMonitorTextBox = new System.Windows.Forms.TextBox();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
+            this.label63 = new System.Windows.Forms.Label();
+            this.stopIMonitorPollButton = new System.Windows.Forms.Button();
+            this.iMonitorPollPeriod = new System.Windows.Forms.TextBox();
+            this.startIMonitorPollButton = new System.Windows.Forms.Button();
+            this.leakageGraph = new NationalInstruments.UI.WindowsForms.WaveformGraph();
+            this.northLeakagePlot = new NationalInstruments.UI.WaveformPlot();
+            this.xAxis1 = new NationalInstruments.UI.XAxis();
+            this.yAxis1 = new NationalInstruments.UI.YAxis();
+            this.southLeakagePlot = new NationalInstruments.UI.WaveformPlot();
             this.IMonitorMeasurementLengthTextBox = new System.Windows.Forms.TextBox();
             this.label35 = new System.Windows.Forms.Label();
             this.label17 = new System.Windows.Forms.Label();
@@ -452,15 +461,6 @@
             this.updateFlashlampVButton = new System.Windows.Forms.Button();
             this.label33 = new System.Windows.Forms.Label();
             this.yagFlashlampVTextBox = new System.Windows.Forms.TextBox();
-            this.leakageGraph = new NationalInstruments.UI.WindowsForms.WaveformGraph();
-            this.xAxis1 = new NationalInstruments.UI.XAxis();
-            this.yAxis1 = new NationalInstruments.UI.YAxis();
-            this.northLeakagePlot = new NationalInstruments.UI.WaveformPlot();
-            this.southLeakagePlot = new NationalInstruments.UI.WaveformPlot();
-            this.iMonitorPollPeriod = new System.Windows.Forms.TextBox();
-            this.startIMonitorPollButton = new System.Windows.Forms.Button();
-            this.stopIMonitorPollButton = new System.Windows.Forms.Button();
-            this.label63 = new System.Windows.Forms.Label();
             this.groupBox2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.switchingLED)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.rampLED)).BeginInit();
@@ -472,6 +472,7 @@
             this.groupBox13.SuspendLayout();
             this.groupBox6.SuspendLayout();
             this.groupBox7.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.leakageGraph)).BeginInit();
             this.tabPage2.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox16.SuspendLayout();
@@ -487,7 +488,6 @@
             this.groupBox11.SuspendLayout();
             this.groupBox10.SuspendLayout();
             this.tabPage5.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.leakageGraph)).BeginInit();
             this.SuspendLayout();
             //
             // groupBox2
@@ -1078,6 +1078,92 @@
             this.groupBox7.TabIndex = 44;
             this.groupBox7.TabStop = false;
             this.groupBox7.Text = "Current monitors";
+            //
+            // label63
+            //
+            this.label63.Location = new System.Drawing.Point(485, 27);
+            this.label63.Name = "label63";
+            this.label63.Size = new System.Drawing.Size(99, 23);
+            this.label63.TabIndex = 56;
+            this.label63.Text = "Poll period (ms)";
+            //
+            // stopIMonitorPollButton
+            //
+            this.stopIMonitorPollButton.Enabled = false;
+            this.stopIMonitorPollButton.Location = new System.Drawing.Point(579, 80);
+            this.stopIMonitorPollButton.Name = "stopIMonitorPollButton";
+            this.stopIMonitorPollButton.Size = new System.Drawing.Size(75, 23);
+            this.stopIMonitorPollButton.TabIndex = 55;
+            this.stopIMonitorPollButton.Text = "Stop poll";
+            this.stopIMonitorPollButton.UseVisualStyleBackColor = true;
+            this.stopIMonitorPollButton.Click += new System.EventHandler(this.stopIMonitorPollButton_Click);
+            //
+            // iMonitorPollPeriod
+            //
+            this.iMonitorPollPeriod.Location = new System.Drawing.Point(590, 25);
+            this.iMonitorPollPeriod.Name = "iMonitorPollPeriod";
+            this.iMonitorPollPeriod.Size = new System.Drawing.Size(64, 20);
+            this.iMonitorPollPeriod.TabIndex = 54;
+            this.iMonitorPollPeriod.Text = "200";
+            //
+            // startIMonitorPollButton
+            //
+            this.startIMonitorPollButton.Location = new System.Drawing.Point(579, 51);
+            this.startIMonitorPollButton.Name = "startIMonitorPollButton";
+            this.startIMonitorPollButton.Size = new System.Drawing.Size(75, 23);
+            this.startIMonitorPollButton.TabIndex = 53;
+            this.startIMonitorPollButton.Text = "Start poll";
+            this.startIMonitorPollButton.UseVisualStyleBackColor = true;
+            this.startIMonitorPollButton.Click += new System.EventHandler(this.startIMonitorPollButton_Click);
+            //
+            // leakageGraph
+            //
+            this.leakageGraph.InteractionMode = ((NationalInstruments.UI.GraphInteractionModes)((((((((NationalInstruments.UI.GraphInteractionModes.ZoomX | NationalInstruments.UI.GraphInteractionModes.ZoomY)
+                        | NationalInstruments.UI.GraphInteractionModes.ZoomAroundPoint)
+                        | NationalInstruments.UI.GraphInteractionModes.PanX)
+                        | NationalInstruments.UI.GraphInteractionModes.PanY)
+                        | NationalInstruments.UI.GraphInteractionModes.DragCursor)
+                        | NationalInstruments.UI.GraphInteractionModes.DragAnnotationCaption)
+                        | NationalInstruments.UI.GraphInteractionModes.EditRange)));
+            this.leakageGraph.Location = new System.Drawing.Point(17, 111);
+            this.leakageGraph.Name = "leakageGraph";
+            this.leakageGraph.Plots.AddRange(new NationalInstruments.UI.WaveformPlot[] {
+            this.northLeakagePlot,
+            this.southLeakagePlot});
+            this.leakageGraph.Size = new System.Drawing.Size(637, 153);
+            this.leakageGraph.TabIndex = 45;
+            this.leakageGraph.XAxes.AddRange(new NationalInstruments.UI.XAxis[] {
+            this.xAxis1});
+            this.leakageGraph.YAxes.AddRange(new NationalInstruments.UI.YAxis[] {
+            this.yAxis1});
+            //
+            // northLeakagePlot
+            //
+            this.northLeakagePlot.AntiAliased = true;
+            this.northLeakagePlot.HistoryCapacity = 10000;
+            this.northLeakagePlot.LineColor = System.Drawing.Color.Crimson;
+            this.northLeakagePlot.LineWidth = 2F;
+            this.northLeakagePlot.XAxis = this.xAxis1;
+            this.northLeakagePlot.YAxis = this.yAxis1;
+            //
+            // xAxis1
+            //
+            this.xAxis1.Mode = NationalInstruments.UI.AxisMode.StripChart;
+            this.xAxis1.Range = new NationalInstruments.UI.Range(0, 500);
+            //
+            // yAxis1
+            //
+            this.yAxis1.Mode = NationalInstruments.UI.AxisMode.Fixed;
+            this.yAxis1.OriginLineVisible = true;
+            this.yAxis1.Range = new NationalInstruments.UI.Range(-500, 500);
+            //
+            // southLeakagePlot
+            //
+            this.southLeakagePlot.HistoryCapacity = 10000;
+            this.southLeakagePlot.LineColor = System.Drawing.Color.DodgerBlue;
+            this.southLeakagePlot.LineWidth = 2F;
+            this.southLeakagePlot.XAxis = this.xAxis1;
+            this.southLeakagePlot.YAxis = this.yAxis1;
             //
             // IMonitorMeasurementLengthTextBox
             //
@@ -2444,79 +2530,6 @@
             this.yagFlashlampVTextBox.TabIndex = 12;
             this.yagFlashlampVTextBox.Text = "1220";
             //
-            // leakageGraph
-            //
-            this.leakageGraph.Location = new System.Drawing.Point(17, 111);
-            this.leakageGraph.Name = "leakageGraph";
-            this.leakageGraph.Plots.AddRange(new NationalInstruments.UI.WaveformPlot[] {
-            this.northLeakagePlot,
-            this.southLeakagePlot});
-            this.leakageGraph.Size = new System.Drawing.Size(637, 153);
-            this.leakageGraph.TabIndex = 45;
-            this.leakageGraph.XAxes.AddRange(new NationalInstruments.UI.XAxis[] {
-            this.xAxis1});
-            this.leakageGraph.YAxes.AddRange(new NationalInstruments.UI.YAxis[] {
-            this.yAxis1});
-            //
-            // xAxis1
-            //
-            this.xAxis1.Mode = NationalInstruments.UI.AxisMode.StripChart;
-            this.xAxis1.Range = new NationalInstruments.UI.Range(0, 1500);
-            //
-            // northLeakagePlot
-            //
-            this.northLeakagePlot.AntiAliased = true;
-            this.northLeakagePlot.HistoryCapacity = 10000;
-            this.northLeakagePlot.LineColor = System.Drawing.Color.Crimson;
-            this.northLeakagePlot.LineWidth = 2F;
-            this.northLeakagePlot.XAxis = this.xAxis1;
-            this.northLeakagePlot.YAxis = this.yAxis1;
-            //
-            // southLeakagePlot
-            //
-            this.southLeakagePlot.HistoryCapacity = 10000;
-            this.southLeakagePlot.LineColor = System.Drawing.Color.DodgerBlue;
-            this.southLeakagePlot.LineWidth = 2F;
-            this.southLeakagePlot.XAxis = this.xAxis1;
-            this.southLeakagePlot.YAxis = this.yAxis1;
-            //
-            // iMonitorPollPeriod
-            //
-            this.iMonitorPollPeriod.Location = new System.Drawing.Point(590, 25);
-            this.iMonitorPollPeriod.Name = "iMonitorPollPeriod";
-            this.iMonitorPollPeriod.Size = new System.Drawing.Size(64, 20);
-            this.iMonitorPollPeriod.TabIndex = 54;
-            this.iMonitorPollPeriod.Text = "200";
-            //
-            // startIMonitorPollButton
-            //
-            this.startIMonitorPollButton.Location = new System.Drawing.Point(579, 51);
-            this.startIMonitorPollButton.Name = "startIMonitorPollButton";
-            this.startIMonitorPollButton.Size = new System.Drawing.Size(75, 23);
-            this.startIMonitorPollButton.TabIndex = 53;
-            this.startIMonitorPollButton.Text = "Start poll";
-            this.startIMonitorPollButton.UseVisualStyleBackColor = true;
-            this.startIMonitorPollButton.Click += new System.EventHandler(this.startIMonitorPollButton_Click);
-            //
-            // stopIMonitorPollButton
-            //
-            this.stopIMonitorPollButton.Enabled = false;
-            this.stopIMonitorPollButton.Location = new System.Drawing.Point(579, 80);
-            this.stopIMonitorPollButton.Name = "stopIMonitorPollButton";
-            this.stopIMonitorPollButton.Size = new System.Drawing.Size(75, 23);
-            this.stopIMonitorPollButton.TabIndex = 55;
-            this.stopIMonitorPollButton.Text = "Stop poll";
-            this.stopIMonitorPollButton.UseVisualStyleBackColor = true;
-            this.stopIMonitorPollButton.Click += new System.EventHandler(this.stopIMonitorPollButton_Click);
-            //
-            // label63
-            //
-            this.label63.Location = new System.Drawing.Point(485, 27);
-            this.label63.Name = "label63";
-            this.label63.Size = new System.Drawing.Size(99, 23);
-            this.label63.TabIndex = 56;
-            this.label63.Text = "Poll period (ms)";
-            //
             // ControlWindow
             //
             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
@@ -2544,6 +2557,7 @@
             this.groupBox6.PerformLayout();
             this.groupBox7.ResumeLayout(false);
             this.groupBox7.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.leakageGraph)).EndInit();
             this.tabPage2.ResumeLayout(false);
             this.groupBox4.ResumeLayout(false);
             this.groupBox4.PerformLayout();
@@ -2569,7 +2583,6 @@
             this.groupBox10.ResumeLayout(false);
             this.tabPage5.ResumeLayout(false);
             this.tabPage5.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.leakageGraph)).EndInit();
             this.ResumeLayout(false);

 		}


Remove obsolete Linux build architectures on 2019.2+

--- Editor/Build/Platform/BuildLinux.cs
+++ Editor/Build/Platform/BuildLinux.cs
@@ -29,17 +29,22 @@
         if (architectures == null || architectures.Length == 0)
         {
             architectures = new BuildArchitecture[] {
+                new BuildArchitecture(BuildTarget.StandaloneLinux64, "Linux x64", false, "{0}.x86_64"),
+#if !UNITY_2019_2_OR_NEWER
                 new BuildArchitecture(BuildTarget.StandaloneLinuxUniversal, "Linux Universal", true, "{0}"),
                 new BuildArchitecture(BuildTarget.StandaloneLinux, "Linux x86", false, "{0}.x86"),
-                new BuildArchitecture(BuildTarget.StandaloneLinux64, "Linux x64", false, "{0}.x86_64")
+#endif
             };
-
+
 #if UNITY_2018_3_OR_NEWER
-            architectures[0].enabled = false;
-            architectures[2].enabled = true;
+            architectures[0].enabled = true;
 #endif
+
+#if UNITY_2018_3_OR_NEWER && !UNITY_2019_2_OR_NEWER
+            architectures[1].enabled = false;
+#endif
+            }
         }
     }
+
 }
-
-}


- Use hash instead of string name in BTActionPlayAnimation

--- Ex/Actions/BTActionPlayAnimation.cs
+++ Ex/Actions/BTActionPlayAnimation.cs
@@ -4,7 +4,6 @@
 namespace BT.Ex {

 	public class BTActionPlayAnimation : BTAction {
-		private string stateName;
 		private Animator _animator;
 		private int _stateHash;
 		private bool _justEntered;
@@ -12,7 +11,6 @@

 		public BTActionPlayAnimation (Animator animator, string stateName, string layerName = "Base Layer") {
-			this.stateName = stateName;
 			_animator = animator;
 			_stateHash = Animator.StringToHash(layerName + "." + stateName);
 		}
@@ -20,14 +18,14 @@
 		protected override void Enter () {
 			base.Enter ();

-			_animator.Play(stateName);
+			_animator.Play(_stateHash);
 			_justEntered = true;
 		}

 		protected override BTResult Execute () {
 			// If an animation is not loop, and to make it return success after one play,
 			// you needs to set the transition in animator controller.
-			if (_justEntered || _animator.GetCurrentAnimatorStateInfo(0).IsName(stateName)) {
+			if (_justEntered || _animator.GetCurrentAnimatorStateInfo(0).nameHash == _stateHash) {
 				if (_justEntered) {
 					_justEntered = false;
 				}


Trying to fix game client crashes during looting.

--- ExampleScripts/UOErebor/looting.csx
+++ ExampleScripts/UOErebor/looting.csx
@@ -91,12 +91,37 @@

         if (corpse != null)
         {
-            Rip(corpse);
-            Loot(corpse);
-            if (corpses.Length - 1 > 0)
-                HighlightLootableCorpses(corpses.Except(new[] { corpse }));
-            else
-                UO.ClientPrint($"No more corpses to loot remaining");
+            Layer itemInHandLayer;
+
+            var itemInHand = UO.Items.OnLayer(Layer.OneHandedWeapon).FirstOrDefault();
+            if (itemInHand == null)
+            {
+                itemInHand = UO.Items.OnLayer(Layer.TwoHandedWeapon).FirstOrDefault();
+                itemInHandLayer = Layer.TwoHandedWeapon;
+            }
+            else
+                itemInHandLayer = Layer.OneHandedWeapon;
+
+            try
+            {
+                Rip(corpse);
+                Loot(corpse);
+                if (corpses.Length - 1 > 0)
+                    HighlightLootableCorpses(corpses.Except(new[] { corpse }));
+                else
+                    UO.ClientPrint($"No more corpses to loot remaining");
+            }
+            finally
+            {
+                // It seems that re-wearing an item directly
+                // after ripping a body and right before
+                // looting may crash the game client.
+                if (itemInHand != null)
+                {
+                    UO.TryWear(itemInHand, itemInHandLayer);
+                    UO.Wait(100);
+                }
+            }
         }
         else
         {
@@ -178,6 +203,15 @@
             UO.ClientPrint("no container for loot");
     }

+    public static void Loot(ObjectId containerId)
+    {
+        var container = UO.Items[containerId];
+        if (container == null)
+            UO.ClientPrint($"Cannot find {containerId} container");
+
+        Loot(container);
+    }
+
     public static void Loot(Item container)
     {
         var originalLocation = UO.Me.Location;
@@ -188,14 +222,6 @@

         foreach (var itemToPickup in UO.Items.InContainer(container).ToArray())
         {
-            // If you are too far away from a looted body, then the game client might crash.
-            // Stop looting when the player moves to avoid it.
-            // NOTE: Some older versions of Injection have the same problem but Injection 2015 seems
-            // immune to this problem. Maybe this can be fixed in Infusion itself by filtering
-            // out the Drag item response packets.
-            if (originalLocation != UO.Me.Location)
-                throw new CommandInvocationException("Cancel looting, player has moved.");
-
             if (!IgnoredLoot.Matches(itemToPickup))
             {
                 UO.ClientPrint($"Looting {Specs.TranslateToName(itemToPickup)} ({itemToPickup.Amount})");
@@ -225,18 +251,11 @@
     public static void Rip(Item container)
     {
         UO.ClientPrint("Ripping");
-        var itemInHand = UO.Items.OnLayer(Layer.OneHandedWeapon).FirstOrDefault() ?? UO.Items.OnLayer(Layer.TwoHandedWeapon).FirstOrDefault();
         UO.Use(Specs.Knives);

         UO.WaitForTarget();
         UO.Target(container);
         journal.WaitAny("Rozrezal jsi mrtvolu.");
-
-        if (itemInHand != null)
-        {
-            UO.TryWear(itemInHand, Layer.OneHandedWeapon);
-            UO.Wait(100);
-        }
     }

 }


Lucene.Net.Tests.Core.Index.TestTransactionRollback: Made RollbackDeletionPolicy, DeleteLastCommitPolicy, and KeepAllDeletionPolicy classes non-generic as they were in Lucene. The generic closing type name was colliding with the name used on their methods.

--- src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
+++ src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
@@ -70,7 +70,7 @@
                 throw new Exception("Couldn't find commit point " + id);
             }

-            IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new RollbackDeletionPolicy<IndexCommit>(this, id)).SetIndexCommit(last));
+            IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new RollbackDeletionPolicy(this, id)).SetIndexCommit(last));
             IDictionary<string, string> data = new Dictionary<string, string>();
             data["index"] = "Rolled back to 1-" + id;
             w.CommitData = data;
@@ -139,7 +139,7 @@
             Dir = NewDirectory();

             //Build index, of records 1 to 100, committing after each batch of 10
-            IndexDeletionPolicy sdp = new KeepAllDeletionPolicy<IndexCommit>(this);
+            IndexDeletionPolicy sdp = new KeepAllDeletionPolicy(this);
             IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(sdp));

             for (int currentRecordId = 1; currentRecordId <= 100; currentRecordId++)
@@ -168,8 +168,7 @@
         }

         // Rolls back to previous commit point
-        internal class RollbackDeletionPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class RollbackDeletionPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;

@@ -217,8 +216,7 @@
             }
         }

-        internal class DeleteLastCommitPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class DeleteLastCommitPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;

@@ -244,7 +242,7 @@
             {
                 // Unless you specify a prior commit point, rollback
                 // should not work:
-                (new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new DeleteLastCommitPolicy<IndexCommit>(this)))).Dispose();
+                (new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new DeleteLastCommitPolicy(this)))).Dispose();
                 IndexReader r = DirectoryReader.Open(Dir);
                 Assert.AreEqual(100, r.NumDocs);
                 r.Dispose();
@@ -252,8 +250,7 @@
         }

         // Keeps all commit points (used to build index)
-        internal class KeepAllDeletionPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class KeepAllDeletionPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;


Remove more pointless console errors

Remove more pointless console errors

--- SteamTrade/ForeignInventory.cs
+++ SteamTrade/ForeignInventory.cs
@@ -58,9 +58,8 @@
             {
                 return rawJson.rgInventory[i].classid;
             }
-            catch (Exception e)
+            catch
             {
-                Console.WriteLine(e);
                 return 0;
             }
         }
@@ -78,9 +77,8 @@
             {
                 return rawJson.rgInventory[i].instanceid;
             }
-            catch (Exception e)
+            catch
             {
-                Console.WriteLine(e);
                 return 0;
             }
         }
@@ -93,20 +91,22 @@
         /// <returns>A defindex or -1 if there is an error.</returns>
         public int GetDefIndex(ulong itemId)
         {
-            uint classId = GetClassIdForItemId(itemId);
-            ulong iid = GetInstanceIdForItemId(itemId);
-
-            string index = classId + "_" + iid;
-
-            string r;
-
             try
             {
+                uint classId = GetClassIdForItemId(itemId);
+                ulong iid = GetInstanceIdForItemId(itemId);
+
+                if (classId == 0 || iid == 0)
+                {
+                    return -1;
+                }
+
                 // for tf2 the def index is in the app_data section in the
                 // descriptions object. this may not be the case for all
                 // games and therefore this may be non-portable.
-                r = rawJson.rgDescriptions[index].app_data.def_index;
-                return int.Parse(r);
+                string index = classId + "_" + iid;
+                string defIndex = rawJson.rgDescriptions[index].app_data.def_index;
+                return int.Parse(defIndex);
             }
             catch
             {