Refactor [ParseMode.Strict] error code tests.

--- McSherry.SemanticVersioning.Testing/SemanticVersionIntlParsingTests.cs
+++ McSherry.SemanticVersioning.Testing/SemanticVersionIntlParsingTests.cs
@@ -360,7 +360,6 @@
             Assert.IsTrue(meta.SequenceEqual(pr.Version.Metadata));
         }

-
         /// <summary>
         /// <para>
         /// Ensures that the <see cref="SemanticVersion"/> parser
@@ -385,6 +384,115 @@
             Assert.AreEqual(basic, padded);
         }

+        [DataRow(null)]
+        [DataRow("")]
+        [DataRow("  \t  ")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_NullString(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.NullString, pi.Type);
+        }
+
+        [DataRow("ẅ1.0.0")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_PreTrioInvalidChar(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.PreTrioInvalidChar, pi.Type);
+        }
+
+        [DataRow("1ñ.0.0")]
+        [DataRow("1.û0.0")]
+        [DataRow("1.0.ç0")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_TrioInvalidChar(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.TrioInvalidChar, pi.Type);
+        }
+
+        [DataRow("01.0.0")]
+        [DataRow("1.00.0")]
+        [DataRow("1.0.00")]
+        public void Parse_Strict_TrioItemLeadingZero(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.TrioItemLeadingZero, pi.Type);
+        }
+
+        [DataRow("1.0")]
+        [DataRow("1.0-rc")]
+        [DataRow("1.0+rc")]
+        [DataRow("1")]
+        [DataRow("1-rc")]
+        [DataRow("1+rc")]
+        [DataRow("1..0")]
+        [DataRow("1.0.")]
+        [DataRow("1.0.-rc")]
+        [DataRow("1.0.+rc")]
+        public void Parse_Strict_TrioItemMissing(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.TrioItemMissing, pi.Type);
+        }
+
+        [DataRow("2147483649.0.0")]
+        [DataRow("1.2147483649.0")]
+        [DataRow("1.1.2147483649")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_TrioItemOverflow(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.TrioItemOverflow, pi.Type);
+        }
+
+        [DataRow("1.0.0-")]
+        [DataRow("1.0.0-rc.")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_IdentifierMissing(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.IdentifierMissing, pi.Type);
+        }
+
+        [DataRow("1.0.0-öffentlich")]
+        [DataRow("1.0.0-00.2")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_IdentifierInvalid(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.IdentifierInvalid, pi.Type);
+        }
+
+        [DataRow("1.0.0+")]
+        [DataRow("1.0.0+a972bae.")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_MetadataMissing(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.MetadataMissing, pi.Type);
+        }
+
+        [DataRow("1.0.0+schlüssel.534a")]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_Strict_MetadataInvalid(string input)
+        {
+            var pi = Parser.Parse(input, ParseMode.Strict);
+
+            Assert.AreEqual(ParseResultType.MetadataInvalid, pi.Type);
+        }
+
+
         /// <summary>
         /// <para>
         /// Tests that parsing with the <see cref="ParseMode.AllowPrefix"/>
@@ -473,6 +581,20 @@
             Assert.AreEqual(basic, noPatch);
         }

+        [DataRow("1.0.", ParseResultType.TrioItemMissing)]
+        [DataRow("1.0.-rc", ParseResultType.TrioItemMissing)]
+        [DataRow("1.0.+a972bae", ParseResultType.TrioItemMissing)]
+        [DataTestMethod, TestCategory(Category)]
+        public void Parse_OptionalPatch_Failure(string input, int result)
+        {
+            var pi = Parser.Parse(input, ParseMode.OptionalPatch);
+
+            // The [ParseResultType] enum isn't publicly accessible and the test
+            // runner seems to ignore non-public tests, so a cast is the workaround.
+            Assert.AreEqual((ParseResultType)result, pi.Type);
+        }
+
+
         /// <summary>
         /// <para>
         /// Tests that parsing with the <see cref="InternalModes.OptionalMinor"/>
@@ -513,6 +635,7 @@
             Assert.ThrowsException<ArgumentException>(() => SemanticVersion.Parse(input, mode));
         }

+
         /// <summary>
         /// Tests that <see cref="SemanticVersion.ParseInfo"/> provides the correct
         /// component states when all components are present.
@@ -792,157 +915,6 @@

         /// <summary>
         /// <para>
-        /// Tests that parsing <see cref="SemanticVersion"/> strings works
-        /// as expected when the parser is given an invalid string.
-        /// </para>
-        /// </summary>
-        [TestMethod, TestCategory(Category)]
-        public void Parse_Invalid()
-        {
-            string[] versionStrings =
-            {
-                // These ones are testing "Strict" specifically, but
-                // should apply to all modes.
-
-                // NullString
-                null,                   // 0
-                String.Empty,           // 1
-                " \t ",                 // 2
-
-                // PreTrioInvalidChar
-                "ẅ1.0.0",               // 3
-
-                // TrioInvalidChar
-                "1ñ.0.0",               // 4
-                "1.û0.0",               // 5
-                "1.0.ç0",               // 6
-
-                // TrioItemLeadingZero
-                "01.0.0",               // 7
-                "1.00.0",               // 8
-                "1.0.00",               // 9
-
-                // TrioItemMissing
-                "1.0-rc",               // 10
-                "1-rc",                 // 11
-                "1..0",                 // 12
-
-                // TrioItemOverflow
-                "1.2147483649.0",       // 13
-
-                // IdentifierMissing
-                "1.0.0-",               // 14
-                "1.0.0-rc.",            // 15
-
-                // IdentifierInvalid
-                "1.0.0-öffentlich",     // 16
-                "1.0.0-00.2",           // 17
-
-                // MetadataMissing
-                "1.0.0+",               // 18
-                "1.0.0+a972bae.",       // 19
-
-                // MetadataInvalid
-                "1.0.0+schlüssel.534a", // 20
-
-
-                // These ones are testing [OptionalPatch]-specific
-                // behaviour.
-
-                // This specifically makes sure that it won't count
-                // a patch omitted but with the period separator
-                // present valid.
-
-                // TrioItemMissing
-                "1.0.",                 // 21
-                "1.0.-rc",              // 22
-                "1.0.+a972bae",         // 23
-            };
-            ParseMode[] modes =
-            {
-                ParseMode.Strict,       // 0
-                ParseMode.Strict,       // 1
-                ParseMode.Strict,       // 2
-                ParseMode.Strict,       // 3
-                ParseMode.Strict,       // 4
-                ParseMode.Strict,       // 5
-                ParseMode.Strict,       // 6
-                ParseMode.Strict,       // 7
-                ParseMode.Strict,       // 8
-                ParseMode.Strict,       // 9
-                ParseMode.Strict,       // 10
-                ParseMode.Strict,       // 11
-                ParseMode.Strict,       // 12
-                ParseMode.Strict,       // 13
-                ParseMode.Strict,       // 14
-                ParseMode.Strict,       // 15
-                ParseMode.Strict,       // 16
-                ParseMode.Strict,       // 17
-                ParseMode.Strict,       // 18
-                ParseMode.Strict,       // 19
-                ParseMode.Strict,       // 20
-
-                ParseMode.OptionalPatch,// 21
-                ParseMode.OptionalPatch,// 22
-                ParseMode.OptionalPatch,// 23
-            };
-            ParseResultType[] results =
-            {
-                ParseResultType.NullString,         // 0
-                ParseResultType.NullString,         // 1
-                ParseResultType.NullString,         // 2
-
-                ParseResultType.PreTrioInvalidChar, // 3
-
-                ParseResultType.TrioInvalidChar,    // 4
-                ParseResultType.TrioInvalidChar,    // 5
-                ParseResultType.TrioInvalidChar,    // 6
-
-                ParseResultType.TrioItemLeadingZero,// 7
-                ParseResultType.TrioItemLeadingZero,// 8
-                ParseResultType.TrioItemLeadingZero,// 9
-
-                ParseResultType.TrioItemMissing,    // 10
-                ParseResultType.TrioItemMissing,    // 11
-                ParseResultType.TrioItemMissing,    // 12
-
-                ParseResultType.TrioItemOverflow,   // 13
-
-                ParseResultType.IdentifierMissing,  // 14
-                ParseResultType.IdentifierMissing,  // 15
-
-                ParseResultType.IdentifierInvalid,  // 16
-                ParseResultType.IdentifierInvalid,  // 17
-
-                ParseResultType.MetadataMissing,    // 18
-                ParseResultType.MetadataMissing,    // 19
-
-                ParseResultType.MetadataInvalid,    // 20
-
-
-                ParseResultType.TrioItemMissing,    // 21
-                ParseResultType.TrioItemMissing,    // 22
-                ParseResultType.TrioItemMissing,    // 23
-            };
-
-            // We can't do the test if we don't have a result for
-            // each version string we put in.
-            Assert.IsTrue(versionStrings.Length == results.Length,
-                          "Unit test incorrectly configured.");
-
-            // Iterate through the test strings and compare them to
-            // the expected result.
-            for (int i = 0; i < results.Length; i++)
-            {
-                Assert.AreEqual(
-                    results[i], Parser.Parse(versionStrings[i], modes[i]).Type,
-                    $"Did not produce expected status ({i})."
-                    );
-            }
-        }
-
-        /// <summary>
-        /// <para>
         /// Tests that the regular values of <see cref="ParseMode"/> do not
         /// overlap with the <see cref="InternalModes"/> values.
         /// </para>


Prevent a buffer overflow in asset receiving

--- OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -100,18 +100,27 @@

             if (XferID == xferID)
             {
-                if (m_asset.Data.Length > 1)
-                {
-                    byte[] destinationArray = new byte[m_asset.Data.Length + data.Length];
-                    Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length);
-                    Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length);
-                    m_asset.Data = destinationArray;
-                }
-                else
-                {
-                    byte[] buffer2 = new byte[data.Length - 4];
-                    Array.Copy(data, 4, buffer2, 0, data.Length - 4);
-                    m_asset.Data = buffer2;
+                lock (this)
+                {
+                    int assetLength = m_asset.Data.Length;
+                    int dataLength = data.Length;
+
+                    if (m_asset.Data.Length > 1)
+                    {
+                        byte[] destinationArray = new byte[assetLength + dataLength];
+                        Array.Copy(m_asset.Data, 0, destinationArray, 0, assetLength);
+                        Array.Copy(data, 0, destinationArray, assetLength, dataLength);
+                        m_asset.Data = destinationArray;
+                    }
+                    else
+                    {
+                        if (dataLength > 4)
+                        {
+                            byte[] buffer2 = new byte[dataLength - 4];
+                            Array.Copy(data, 4, buffer2, 0, dataLength - 4);
+                            m_asset.Data = buffer2;
+                        }
+                    }
                 }

                 ourClient.SendConfirmXfer(xferID, packetID);


fix(View): Declare generic bubbling event for touch cancel

React Native Fiber asserts that any event invoked from a native component has either a direct or bubbling registration. This adds the missing registration for touch cancel events, i.e., `onTouchCancel`.

--- ReactWindows/ReactNative.Shared/UIManager/UIManagerModule.Constants.cs
+++ ReactWindows/ReactNative.Shared/UIManager/UIManagerModule.Constants.cs
@@ -206,6 +206,20 @@
                     }
                 },
                 {
+                    TouchEventType.Cancel.GetJavaScriptEventName(),
+                    new Map
+                    {
+                        {
+                            "phasedRegistrationNames",
+                            new Map
+                            {
+                                { "bubbled", "onTouchCancel" },
+                                { "captured", "onTouchCancelCapture" },
+                            }
+                        }
+                    }
+                },
+                {
                     TouchEventType.Entered.GetJavaScriptEventName(),
                     new Map
                     {


Maintaining Original Template sample now only fires for documents.

--- Samples/Processes/MaintainOriginalTemplate/vaf/src/VaultApplication.cs
+++ Samples/Processes/MaintainOriginalTemplate/vaf/src/VaultApplication.cs
@@ -31,8 +31,10 @@
 		/// Ensures that the "Original Template" property is maintained on templates.
 		/// </summary>
 		/// <param name="env">The vault/object environment.</param>
-		[EventHandler(MFEventHandlerType.MFEventHandlerBeforeCreateNewObjectFinalize)]
-		[EventHandler(MFEventHandlerType.MFEventHandlerBeforeCheckInChangesFinalize)]
+		[EventHandler(MFEventHandlerType.MFEventHandlerBeforeCreateNewObjectFinalize,
+			ObjectType=(int)MFBuiltInObjectType.MFBuiltInObjectTypeDocument)]
+		[EventHandler(MFEventHandlerType.MFEventHandlerBeforeCheckInChangesFinalize,
+			ObjectType = (int)MFBuiltInObjectType.MFBuiltInObjectTypeDocument)]
 		public void MaintainOriginalTemplateProperty(EventHandlerEnvironment env)
 		{
 			// Sanity.


Sort WalletState in descending order

Sort WalletState in descending order

--- WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -46,7 +46,7 @@
 			_wallets
 				.ToObservableChangeSet()
 				.Filter(selectedWalletFilter)
-				.Sort(SortExpressionComparer<WalletViewModelBase>.Ascending(i => i.WalletState).ThenByDescending(i => i.IsLoggedIn).ThenByAscending(i => i.Title))
+				.Sort(SortExpressionComparer<WalletViewModelBase>.Descending(i => i.WalletState).ThenByDescending(i => i.IsLoggedIn).ThenByAscending(i => i.Title))
 				.Transform(x => x as NavBarItemViewModel)
 				.ObserveOn(RxApp.MainThreadScheduler)
 				.Bind(out _items)


Fix unit test

Fix unit test

--- Solution/WorkingFilesList.Core.Test/Model/UserPreferencesModelTests.cs
+++ Solution/WorkingFilesList.Core.Test/Model/UserPreferencesModelTests.cs
@@ -1,7 +1,7 @@
 // Working Files List
 // Visual Studio extension tool window that shows a selectable list of files
 // that are open in the editor
-// Copyright © 2016 Anthony Fung
+// Copyright © 2016 - 2020 Anthony Fung

 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -486,7 +486,7 @@

             // Act

-            preferences.PathSegmentCount = 100;
+            preferences.UnityRefreshDelay = 100;
             preferences.PropertyChanged -= handler;

             // Assert


Incorrect assertion for that extension method.

--- Source/Specifications/Machine.Specifications.XUnit/ExtensionMethods.cs
+++ Source/Specifications/Machine.Specifications.XUnit/ExtensionMethods.cs
@@ -93,7 +93,7 @@

     public static void ShouldNotBeOfType(this object actual, Type expected)
     {
-      Assert.IsType(expected, actual);
+      Assert.IsNotType(expected, actual);
     }

     public static void ShouldContain(this IList actual, params object[] expected)


Nicer footer

Nicer footer

--- LMP.MasterServer/Http/ServerListHandler.cs
+++ LMP.MasterServer/Http/ServerListHandler.cs
@@ -78,7 +78,14 @@
         {
             writer.RenderBeginTag(HtmlTextWriterTag.P);
             writer.RenderBeginTag(HtmlTextWriterTag.Small);
-            writer.Write("Luna Multiplayer - ");
+
+            writer.AddAttribute(HtmlTextWriterAttribute.Href, "http://www.lunamultiplayer.com/");
+            writer.RenderBeginTag(HtmlTextWriterTag.A);
+            writer.Write("Luna Multiplayer");
+            writer.RenderEndTag();
+
+            writer.Write(" - ");
+
             writer.AddAttribute(HtmlTextWriterAttribute.Href, "https://github.com/LunaMultiplayer/LunaMultiplayer");
             writer.RenderBeginTag(HtmlTextWriterTag.A);
             writer.Write("Github repo");


Make SendSourceCode enable

Make SendSourceCode enable

--- project/dexter-vs/Dexter/PeerReview/Core/PeerReviewTagger.cs
+++ project/dexter-vs/Dexter/PeerReview/Core/PeerReviewTagger.cs
@@ -81,7 +81,7 @@
                 if (isCommentDirty)
                 {
                     await SendAnalysisResult(textDocument, comments);
-                    //await SendSourceCode(textDocument.FilePath, textBuffer.CurrentSnapshot.GetText());
+                    await SendSourceCode(textDocument.FilePath, textBuffer.CurrentSnapshot.GetText());

                     isCommentDirty = false;
                 }


Added VALUES(document) method

Added VALUES(document) method

--- LiteDB/Document/Expression/Methods/Misc.cs
+++ LiteDB/Document/Expression/Methods/Misc.cs
@@ -104,6 +104,20 @@
         }

         /// <summary>
+        /// Get all values from a document
+        /// </summary>
+        public static IEnumerable<BsonValue> VALUES(BsonValue document)
+        {
+            if(document.IsDocument)
+            {
+                foreach(var value in document.AsDocument.Values)
+                {
+                    yield return value;
+                }
+            }
+        }
+
+        /// <summary>
         /// Return CreationTime from ObjectId value - returns null if not an ObjectId
         /// </summary>
         public static BsonValue OID_CREATIONTIME(BsonValue objectId)


Only load Default Layout once

Only load Default Layout once

Also removed TimerOnlyRun and TimerOnlyLayout properties since they're
not really used for anything

--- LiveSplit/LiveSplit.View/View/TimerForm.cs
+++ LiveSplit/LiveSplit.View/View/TimerForm.cs
@@ -55,10 +55,9 @@
         }
         protected float OldSize { get; set; }
         public ISettings Settings { get; set; }
-        protected ILayout TimerOnlyLayout;
-        protected IRun TimerOnlyRun { get; set; }
         protected Invalidator Invalidator { get; set; }
         protected bool InTimerOnlyMode { get; set; }
+        protected ILayout DefaultLayout { get; set; }

         protected GraphicsCache GlobalCache { get; set; }

@@ -134,10 +133,6 @@
             CurrentState = new LiveSplitState(null, this, null, null, null);

             ComparisonGeneratorsFactory = new StandardComparisonGeneratorsFactory();
-
-            TimerOnlyLayout = new TimerOnlyLayoutFactory().Create(CurrentState);
-            TimerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
-            InTimerOnlyMode = false;

             Model = new DoubleTapPrevention(new TimerModel());
             //LiveSplit.Web.Share.Twitch.Instance.AutoUpdateModel = Model;
@@ -151,7 +146,10 @@
             UpdateRecentSplits();
             UpdateRecentLayouts();

-            IRun run = TimerOnlyRun;
+            InTimerOnlyMode = false;
+            var timerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
+
+            IRun run = timerOnlyRun;
             try
             {
                 if (!string.IsNullOrEmpty(splitsPath))
@@ -186,21 +184,23 @@
                     {
                         Layout = LoadLayoutFromFile(Settings.RecentLayouts.Last());
                     }
-                    else if (run == TimerOnlyRun)
-                    {
-                        Layout = TimerOnlyLayout;
+                    else if (run == timerOnlyRun)
+                    {
+                        Layout = new TimerOnlyLayoutFactory().Create(CurrentState);
                         InTimerOnlyMode = true;
                     }
                     else
                     {
-                        Layout = new StandardLayoutFactory().Create(CurrentState);
+                        DefaultLayout = new StandardLayoutFactory().Create(CurrentState);
+                        Layout = (ILayout)DefaultLayout.Clone();
                     }
                 }
             }
             catch (Exception e)
             {
                 Log.Error(e);
-                Layout = new StandardLayoutFactory().Create(CurrentState);
+                DefaultLayout = new StandardLayoutFactory().Create(CurrentState);
+                Layout = (ILayout)DefaultLayout.Clone();
             }

             CurrentState.LayoutSettings = Layout.Settings;
@@ -610,12 +610,10 @@
             {
                 if (InTimerOnlyMode)
                 {
-                    var offset = CurrentState.Run.Offset;
-                    TimerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
-                    TimerOnlyRun.Offset = offset;
-                    var run = TimerOnlyRun;
-
-                    SetRun(run);
+                    var timerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
+                    timerOnlyRun.Offset = CurrentState.Run.Offset;
+
+                    SetRun(timerOnlyRun);
                 }
                 resetMenuItem.Enabled = false;
                 pauseMenuItem.Enabled = false;
@@ -1711,23 +1709,24 @@
         protected void RemoveTimerOnly()
         {
             InTimerOnlyMode = false;
-            ILayout layout;
             try
             {
                 var lastLayoutPath = Settings.RecentLayouts.LastOrDefault(x => !string.IsNullOrEmpty(x));
                 if (lastLayoutPath != null)
-                    layout = LoadLayoutFromFile(lastLayoutPath);
+                {
+                    var layout = LoadLayoutFromFile(lastLayoutPath);
+                    layout.X = Location.X;
+                    layout.Y = Location.Y;
+                    SetLayout(layout);
+                }
                 else
-                    layout = new StandardLayoutFactory().Create(CurrentState);
+                    LoadDefaultLayout();
             }
             catch (Exception ex)
             {
                 Log.Error(ex);
-                layout = new StandardLayoutFactory().Create(CurrentState);
-            }
-            layout.X = Location.X;
-            layout.Y = Location.Y;
-            SetLayout(layout);
+                LoadDefaultLayout();
+            }
         }

         private void EditLayout()
@@ -1912,8 +1911,12 @@
         {
             if (WarnUserAboutLayoutSave())
             {
-                var layoutFactory = new StandardLayoutFactory();
-                var layout = layoutFactory.Create(CurrentState);
+                if (DefaultLayout == null)
+                {
+                    DefaultLayout = new StandardLayoutFactory().Create(CurrentState);
+                }
+
+                var layout = (ILayout)DefaultLayout.Clone();
                 layout.X = Location.X;
                 layout.Y = Location.Y;
                 SetLayout(layout);
@@ -1962,16 +1965,14 @@
                 return;
             if (!WarnUserAboutLayoutSave())
                 return;
-            TimerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
-            var run = TimerOnlyRun;
+            var run = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
             Model.Reset();
             SetRun(run);
             Settings.AddToRecentSplits("", null);
             InTimerOnlyMode = true;
             if (Layout.Components.Count() != 1 || Layout.Components.FirstOrDefault().ComponentName != "Timer")
             {
-                TimerOnlyLayout = new TimerOnlyLayoutFactory().Create(CurrentState);
-                var layout = TimerOnlyLayout;
+                var layout = new TimerOnlyLayoutFactory().Create(CurrentState);
                 layout.Settings = Layout.Settings;
                 layout.X = Location.X;
                 layout.Y = Location.Y;


Don't log exception with image not set properly

--- LiveSplit/LiveSplit.View/View/TimerForm.cs
+++ LiveSplit/LiveSplit.View/View/TimerForm.cs
@@ -457,10 +457,7 @@
                         {
                             item.Image = image;
                         }
-                        catch (Exception ex)
-                        {
-                            Log.Error(ex);
-                        }
+                        catch { }
                     };
                     if (InvokeRequired)
                         Invoke(setImage);


Refactor Unit Tests for Clarity

Refactor Unit Tests for Clarity

--- LogBook.Services.Tests/ReadServiceTests.cs
+++ LogBook.Services.Tests/ReadServiceTests.cs
@@ -74,7 +74,7 @@
             _writeService.WriteLog(LogType.Error, nameof(GetLatestLogEntries_ReturnsLogEntries), null, "Test Log Entry 2", string.Empty);

             // ACT
-            var logEntries = _readService.GetLatestLogEntries(LogType.Error, 1);
+            var logEntries = _readService.GetLatestLogEntries(LogType.Error, 10);

             // ASSERT
             Assert.IsTrue(logEntries.All(le => le.LogType == LOG_TYPE_ERROR));


Button events implemented

Button events implemented

--- Mastermind/Source/Modules/ButtonHandler.cs
+++ Mastermind/Source/Modules/ButtonHandler.cs
@@ -1,5 +1,7 @@
 using System;
+using System.Threading;
 using Microsoft.SPOT;
+using Gadgeteer.Modules.GHIElectronics;

 namespace Mastermind.Modules
 {
@@ -10,7 +12,83 @@
          */
         public const int BTN_PRESS = 1;
         public const int BTN_RELEASE = 2;
+        public const int BTN_LONGPRESS = 3;

-        // -TODO- Implement this module similar to JoystickHandler
+        private const int LONGPRESS_TIME = 1000; // Press 'at least' this long to interpret as long press
+
+        /**
+         * Button event handler delegate / type
+         */
+        public delegate void BtnEventCallback(int btnEvent);
+        event BtnEventCallback eventCallback;
+
+        Button mButton;
+        Thread mBtnThread;
+        Boolean longPressing = false;
+
+        public ButtonHandler(Button mBtn)
+        {
+            this.mButton = mBtn;
+        }
+
+        /**
+         * This callback will be called when ever a button event occurs
+         */
+        public void SetCallback(BtnEventCallback btnEventHandle)
+        {
+            this.eventCallback = btnEventHandle;
+        }
+
+        /**
+         * Called by gadgeteer when Button state changes
+         */
+        void ButtonStateChanged(Button sender, Button.ButtonState state)
+        {
+            if (state == Button.ButtonState.Pressed)
+            {
+                SendEventToCallback(BTN_PRESS);
+            }
+            else if (state == Button.ButtonState.Released)
+            {
+                this.longPressing = false;
+                SendEventToCallback(BTN_RELEASE);
+            }
+        }
+
+        private void SendEventToCallback(int action)
+        {
+            if (eventCallback != null)
+                eventCallback(action);
+        }
+
+        /**
+         * Start handling Button long press events.
+         */
+        void StartButton()
+        {
+            while (true)
+            {
+                longPressing = mButton.Pressed;
+                Thread.Sleep(LONGPRESS_TIME);
+                if (longPressing && mButton.Pressed)
+                {
+                    SendEventToCallback(BTN_LONGPRESS);
+                    longPressing = false;
+                }
+            }
+        }
+
+        public void Start()
+        {
+            mButton.ButtonReleased += ButtonStateChanged;
+            mButton.ButtonPressed += ButtonStateChanged;
+            mBtnThread = new Thread(StartButton);
+            mBtnThread.Start();
+        }
+
+        public void Stop()
+        {
+            mBtnThread.Suspend();
+        }
     }
 }


version fix.

version fix.

--- MinifierLibrary/Properties/AssemblyInfo.cs
+++ MinifierLibrary/Properties/AssemblyInfo.cs
@@ -1,10 +1,6 @@
 using System.Reflection;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
 [assembly: AssemblyTitle("MinifierLibrary")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
@@ -14,23 +10,9 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
 [assembly: ComVisible(false)]

-// The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("46ad4b3f-29b2-4165-bd31-752ee3c685ad")]

-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]


Added logging for cases where PDB information is not available

--- Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
+++ Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
@@ -921,8 +921,11 @@
 						PortablePdbData.SoftScope [] scopes;
 						if (!methodScopeCache.TryGetValue (cx.Frame.Method, out scopes)) {
 							scopes = cx.Session.GetPdbData (cx.Frame.Method)?.GetHoistedScopes (cx.Frame.Method);
-							if (scopes == null || scopes.Length == 0)// If hoisted scopes are empty use normal scopes
+							if (scopes == null || scopes.Length == 0) {
+								// If hoisted scopes are empty use normal scopes
 								scopes = cx.Frame.Method.GetScopes ().Select (s => new PortablePdbData.SoftScope () { LiveRangeStart = s.LiveRangeStart, LiveRangeEnd = s.LiveRangeEnd }).ToArray ();
+								DebuggerLoggingService.LogMessage ("PDB data not found for frame: {0}", cx.Frame.Method.FullName);
+							}
 							methodScopeCache [cx.Frame.Method] = scopes;
 						}
 						if (scopeIndex < scopes.Length) {


Catching exceptions during create object value caused by old version of mono runtime

--- Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
+++ Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
@@ -35,6 +35,7 @@
 using System.Threading;

 using Mono.Debugger.Soft;
+using Mono.Debugging.Backend;
 using Mono.Debugging.Evaluation;
 using Mono.Debugging.Client;

@@ -1241,6 +1242,16 @@
 			types.CopyTo (childTypes);
 		}

+		protected override ObjectValue CreateObjectValueImpl (EvaluationContext ctx, IObjectValueSource source, ObjectPath path, object obj, ObjectValueFlags flags)
+		{
+			try {
+				return base.CreateObjectValueImpl (ctx, source, path, obj, flags);
+			}
+			catch (NotSupportedException e) {
+				throw new EvaluatorException ("Evaluation failed: {0}", e.Message);
+			}
+		}
+
 		protected override IEnumerable<ValueReference> OnGetParameters (EvaluationContext ctx)
 		{
 			var soft = (SoftEvaluationContext) ctx;


code cleanup

code cleanup

--- Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
+++ Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
@@ -321,9 +321,8 @@
 				if (toType != null) {
 					if (toType.IsEnum) {
 						var casted = TryCast (ctx, val, toType.EnumUnderlyingType) as PrimitiveValue;
-						if (casted == null)
-							return null;
-						return cx.Session.VirtualMachine.CreateEnumMirror (toType, casted);
+
+						return casted != null ? cx.Session.VirtualMachine.CreateEnumMirror (toType, casted) : null;
 					}

 					type = Type.GetType (toType.FullName, false);
@@ -455,10 +454,7 @@
 			var cx = (SoftEvaluationContext) ctx;
 			var str = value as string;

-			if (str != null)
-				return cx.Domain.CreateString (str);
-
-			return cx.Session.VirtualMachine.CreateValue (value);
+			return str != null ? cx.Domain.CreateString (str) : cx.Session.VirtualMachine.CreateValue (value);
 		}

 		public override object GetBaseValue (EvaluationContext ctx, object val)
@@ -624,6 +620,7 @@
 					return field.Name.Substring (1, i - 1);
 				}
 			}
+
 			return null;
 		}

@@ -636,29 +633,33 @@
 			if (IsNull (cx, val))
 				return new ValueReference [0];

-			TypeMirror tm = (TypeMirror) vthis.Type;
-			bool isIterator = IsGeneratedType (tm);
+			var tm = (TypeMirror) vthis.Type;
+			var isIterator = IsGeneratedType (tm);

 			var list = new List<ValueReference> ();
-			TypeMirror type = (TypeMirror) vthis.Type;
+			var type = (TypeMirror) vthis.Type;
+
 			foreach (FieldInfoMirror field in type.GetFields ()) {
 				if (IsHoistedThisReference (field))
 					continue;
+
 				if (IsClosureReferenceField (field)) {
 					list.AddRange (GetHoistedLocalVariables (cx, new FieldValueReference (cx, field, val, type)));
 					continue;
 				}
+
 				if (field.Name[0] == '<') {
 					if (isIterator) {
 						var name = GetHoistedIteratorLocalName (field);
-						if (!string.IsNullOrEmpty (name)) {
+
+						if (!string.IsNullOrEmpty (name))
 							list.Add (new FieldValueReference (cx, field, val, type, name, ObjectValueFlags.Variable));
-						}
 					}
 				} else if (!field.Name.Contains ("$")) {
 					list.Add (new FieldValueReference (cx, field, val, type, field.Name, ObjectValueFlags.Variable));
 				}
 			}
+
 			return list;
 		}

@@ -695,6 +696,7 @@
 		{
 			if (!string.IsNullOrEmpty (local.Name) || cx.SourceCodeAvailable)
 				return local.Name;
+
 			return "loc" + local.Index;
 		}

@@ -707,9 +709,11 @@

 			try {
 				LocalVariable local = null;
+
 				if (!cx.SourceCodeAvailable) {
 					if (name.StartsWith ("loc", StringComparison.Ordinal)) {
 						int idx;
+
 						if (int.TryParse (name.Substring (3), out idx))
 							local = cx.Frame.Method.GetLocals ().FirstOrDefault (loc => loc.Index == idx);
 					}
@@ -718,9 +722,10 @@
 						? cx.Frame.GetVisibleVariableByName (name)
 						: FindByName (cx.Frame.GetVisibleVariables(), v => v.Name, name, false);
 				}
-				if (local != null) {
+
+				if (local != null)
 					return new VariableValueReference (ctx, GetLocalName (cx, local), local);
-				}
+
 				return FindByName (OnGetLocalVariables (ctx), v => v.Name, name, ctx.CaseSensitive);
 			} catch (AbsentInformationException) {
 				return null;
@@ -762,16 +767,18 @@

 		public override bool HasMember (EvaluationContext ctx, object type, string memberName, BindingFlags bindingFlags)
 		{
-			TypeMirror tm = (TypeMirror) type;
+			var tm = (TypeMirror) type;

 			while (tm != null) {
-				FieldInfoMirror field = FindByName (tm.GetFields (), f => f.Name, memberName, ctx.CaseSensitive);
+				var field = FindByName (tm.GetFields (), f => f.Name, memberName, ctx.CaseSensitive);
+
 				if (field != null)
 					return true;

-				PropertyInfoMirror prop = FindByName (tm.GetProperties (), p => p.Name, memberName, ctx.CaseSensitive);
+				var prop = FindByName (tm.GetProperties (), p => p.Name, memberName, ctx.CaseSensitive);
+
 				if (prop != null) {
-					MethodMirror getter = prop.GetGetMethod (bindingFlags.HasFlag (BindingFlags.NonPublic));
+					var getter = prop.GetGetMethod (bindingFlags.HasFlag (BindingFlags.NonPublic));
 					if (getter != null)
 						return true;
 				}
@@ -792,14 +799,16 @@

 		protected override ValueReference GetMember (EvaluationContext ctx, object t, object co, string name)
 		{
-			TypeMirror type = t as TypeMirror;
+			var type = t as TypeMirror;

 			while (type != null) {
-				FieldInfoMirror field = FindByName (type.GetFields (), f => f.Name, name, ctx.CaseSensitive);
+				var field = FindByName (type.GetFields (), f => f.Name, name, ctx.CaseSensitive);
+
 				if (field != null && (field.IsStatic || co != null))
 					return new FieldValueReference (ctx, field, co, type);

-				PropertyInfoMirror prop = FindByName (type.GetProperties (), p => p.Name, name, ctx.CaseSensitive);
+				var prop = FindByName (type.GetProperties (), p => p.Name, name, ctx.CaseSensitive);
+
 				if (prop != null && (IsStatic (prop) || co != null)) {
 					// Optimization: if the property has a CompilerGenerated backing field, use that instead.
 					// This way we avoid overhead of invoking methods on the debugee when the value is requested.
@@ -808,11 +817,9 @@
 						return new FieldValueReference (ctx, field, co, type, prop.Name, ObjectValueFlags.Property);

 					// Backing field not available, so do things the old fashioned way.
-					MethodMirror getter = prop.GetGetMethod (true);
-					if (getter == null)
-						return null;
+					var getter = prop.GetGetMethod (true);

-					return new PropertyValueReference (ctx, prop, co, type, getter, null);
+					return getter != null ? new PropertyValueReference (ctx, prop, co, type, getter, null) : null;
 				}

 				type = type.BaseType;
@@ -831,68 +838,89 @@

 		static bool IsStatic (PropertyInfoMirror prop)
 		{
-			MethodMirror met = prop.GetGetMethod (true) ?? prop.GetSetMethod (true);
+			var met = prop.GetGetMethod (true) ?? prop.GetSetMethod (true);
+
 			return met.IsStatic;
 		}

-		static T FindByName<T> (IEnumerable<T> elems, Func<T,string> getName, string name, bool caseSensitive)
+		static T FindByName<T> (IEnumerable<T> items, Func<T,string> getName, string name, bool caseSensitive)
 		{
 			T best = default(T);
-			foreach (T t in elems) {
-				string n = getName (t);
-				if (n == name)
-					return t;
-				if (!caseSensitive && n.Equals (name, StringComparison.CurrentCultureIgnoreCase))
-					best = t;
-			}
+
+			foreach (T item in items) {
+				string itemName = getName (item);
+
+				if (itemName == name)
+					return item;
+
+				if (!caseSensitive && itemName.Equals (name, StringComparison.CurrentCultureIgnoreCase))
+					best = item;
+			}
+
 			return best;
 		}

 		protected override IEnumerable<ValueReference> GetMembers (EvaluationContext ctx, object t, object co, BindingFlags bindingFlags)
 		{
-			Dictionary<string, PropertyInfoMirror> subProps = new Dictionary<string, PropertyInfoMirror> ();
-			TypeMirror type = t as TypeMirror;
+			var subProps = new Dictionary<string, PropertyInfoMirror> ();
+			var type = t as TypeMirror;
 			TypeMirror realType = null;
+
 			if (co != null && (bindingFlags & BindingFlags.Instance) != 0)
 				realType = GetValueType (ctx, co) as TypeMirror;

 			// First of all, get a list of properties overriden in sub-types
 			while (realType != null && realType != type) {
-				foreach (PropertyInfoMirror prop in realType.GetProperties (bindingFlags | BindingFlags.DeclaredOnly)) {
-					MethodMirror met = prop.GetGetMethod (true);
+				foreach (var prop in realType.GetProperties (bindingFlags | BindingFlags.DeclaredOnly)) {
+					var met = prop.GetGetMethod (true);
+
 					if (met == null || met.GetParameters ().Length != 0 || met.IsAbstract || !met.IsVirtual || met.IsStatic)
 						continue;
+
 					if (met.IsPublic && ((bindingFlags & BindingFlags.Public) == 0))
 						continue;
+
 					if (!met.IsPublic && ((bindingFlags & BindingFlags.NonPublic) == 0))
 						continue;
+
 					subProps [prop.Name] = prop;
 				}
+
 				realType = realType.BaseType;
 			}
-
+
 			while (type != null) {
-				foreach (FieldInfoMirror field in type.GetFields ()) {
+				foreach (var field in type.GetFields ()) {
 					if (field.IsStatic && ((bindingFlags & BindingFlags.Static) == 0))
 						continue;
+
 					if (!field.IsStatic && ((bindingFlags & BindingFlags.Instance) == 0))
 						continue;
+
 					if (field.IsPublic && ((bindingFlags & BindingFlags.Public) == 0))
 						continue;
+
 					if (!field.IsPublic && ((bindingFlags & BindingFlags.NonPublic) == 0))
 						continue;
+
 					yield return new FieldValueReference (ctx, field, co, type);
 				}
+
 				foreach (PropertyInfoMirror prop in type.GetProperties (bindingFlags)) {
-					MethodMirror getter = prop.GetGetMethod (true);
+					var getter = prop.GetGetMethod (true);
+
 					if (getter == null || getter.GetParameters ().Length != 0 || getter.IsAbstract)
 						continue;
+
 					if (getter.IsStatic && ((bindingFlags & BindingFlags.Static) == 0))
 						continue;
+
 					if (!getter.IsStatic && ((bindingFlags & BindingFlags.Instance) == 0))
 						continue;
+
 					if (getter.IsPublic && ((bindingFlags & BindingFlags.Public) == 0))
 						continue;
+
 					if (!getter.IsPublic && ((bindingFlags & BindingFlags.NonPublic) == 0))
 						continue;

@@ -908,8 +936,10 @@
 						yield return new PropertyValueReference (ctx, prop, co, type, getter, null);
 					}
 				}
+
 				if ((bindingFlags & BindingFlags.DeclaredOnly) != 0)
 					break;
+
 				type = type.BaseType;
 			}
 		}
@@ -1040,19 +1070,22 @@

 		protected override ValueReference OnGetThisReference (EvaluationContext ctx)
 		{
-			SoftEvaluationContext cx = (SoftEvaluationContext) ctx;
+			var cx = (SoftEvaluationContext) ctx;
+
 			if (InGeneratedClosureOrIteratorType (cx))
 				return GetHoistedThisReference (cx);

 			return GetThisReference (cx);
 		}

-		ValueReference GetThisReference (SoftEvaluationContext cx)
+		static ValueReference GetThisReference (SoftEvaluationContext cx)
 		{
 			try {
 				if (cx.Frame.Method.IsStatic)
 					return null;
-				Value val = cx.Frame.GetThis ();
+
+				var val = cx.Frame.GetThis ();
+
 				return LiteralValueReference.CreateTargetObjectLiteral (cx, "this", val);
 			} catch (AbsentInformationException) {
 				return null;
@@ -1062,12 +1095,10 @@
 		public override ValueReference GetCurrentException (EvaluationContext ctx)
 		{
 			try {
-				SoftEvaluationContext cx = (SoftEvaluationContext) ctx;
-				ObjectMirror exc = cx.Session.GetExceptionObject (cx.Thread);
-				if (exc != null)
-					return LiteralValueReference.CreateTargetObjectLiteral (ctx, ctx.Options.CurrentExceptionTag, exc);
-
-				return null;
+				var cx = (SoftEvaluationContext) ctx;
+				var exc = cx.Session.GetExceptionObject (cx.Thread);
+
+				return exc != null ? LiteralValueReference.CreateTargetObjectLiteral (ctx, ctx.Options.CurrentExceptionTag, exc) : null;
 			} catch (AbsentInformationException) {
 				return null;
 			}
@@ -1080,7 +1111,7 @@

 		public override object[] GetTypeArgs (EvaluationContext ctx, object type)
 		{
-			TypeMirror tm = (TypeMirror) type;
+			var tm = (TypeMirror) type;

 			if (tm.VirtualMachine.Version.AtLeast (2, 15))
 				return tm.GetGenericArguments ();


[Soft] Fixed "Bug 24998 - Debugging local vars after an 'await' does not work"

--- Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
+++ Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
@@ -600,10 +600,14 @@

 		static bool IsClosureReferenceField (FieldInfoMirror field)
 		{
-			// mcs is "<>f__ref"
+			// mcs is "$locvar"
+			// old mcs is "<>f__ref"
 			// csc is "CS$<>"
+			// roslyn is "<>8__"
 			return field.Name.StartsWith ("CS$<>", StringComparison.Ordinal) ||
-				field.Name.StartsWith ("<>f__ref", StringComparison.Ordinal);
+				        field.Name.StartsWith ("<>f__ref", StringComparison.Ordinal) ||
+				        field.Name.StartsWith ("$locvar", StringComparison.Ordinal) ||
+				        field.Name.StartsWith ("<>8__", StringComparison.Ordinal);
 		}

 		static bool IsClosureReferenceLocal (LocalVariable local)
@@ -641,7 +645,7 @@
 			return null;
 		}

-		IEnumerable<ValueReference> GetHoistedLocalVariables (SoftEvaluationContext cx, ValueReference vthis)
+		IEnumerable<ValueReference> GetHoistedLocalVariables (SoftEvaluationContext cx, ValueReference vthis, HashSet<FieldInfoMirror> alreadyVisited = null)
 		{
 			if (vthis == null)
 				return new ValueReference [0];
@@ -661,7 +665,11 @@
 					continue;

 				if (IsClosureReferenceField (field)) {
-					list.AddRange (GetHoistedLocalVariables (cx, new FieldValueReference (cx, field, val, type)));
+					alreadyVisited = alreadyVisited ?? new HashSet<FieldInfoMirror> ();
+					if (alreadyVisited.Contains (field))
+						continue;
+					alreadyVisited.Add (field);
+					list.AddRange (GetHoistedLocalVariables (cx, new FieldValueReference (cx, field, val, type), alreadyVisited));
 					continue;
 				}

@@ -691,13 +699,17 @@
 			return null;
 		}

-		ValueReference GetHoistedThisReference (SoftEvaluationContext cx, TypeMirror type, object val)
+		ValueReference GetHoistedThisReference (SoftEvaluationContext cx, TypeMirror type, object val, HashSet<FieldInfoMirror> alreadyVisited = null)
 		{
 			foreach (var field in type.GetFields ()) {
 				if (IsHoistedThisReference (field))
 					return new FieldValueReference (cx, field, val, type, "this", ObjectValueFlags.Literal);

 				if (IsClosureReferenceField (field)) {
+					alreadyVisited = alreadyVisited ?? new HashSet<FieldInfoMirror> ();
+					if (alreadyVisited.Contains (field))
+						continue;
+					alreadyVisited.Add (field);
 					var fieldRef = new FieldValueReference (cx, field, val, type);
 					var thisRef = GetHoistedThisReference (cx, field.FieldType, fieldRef.Value);
 					if (thisRef != null)


Fix compilation error.

Fix compilation error.

--- Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
+++ Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
@@ -570,6 +570,7 @@

 		public object CreateByteArray (EvaluationContext ctx, byte [] byts)
 		{
+			var cx = (SoftEvaluationContext)ctx;
 			if (Session.VirtualMachine.Version.AtLeast (2, 52)) {
 				return cx.Domain.CreateByteArray (byts);
 			}


SoftDebuggerSession.cs: Send OnStarted(ThreadInfo) after receiving the VMStart event.

--- Mono.Debugging.Soft/SoftDebuggerSession.cs
+++ Mono.Debugging.Soft/SoftDebuggerSession.cs
@@ -365,7 +365,6 @@
 				//Mono < 2.6.3 doesn't support catching unhandled exceptions
 			}

-			OnStarted ();
 			started = true;

 			/* Wait for the VMStart event */
@@ -917,6 +916,7 @@
 				OnDebuggerOutput (false, string.Format ("Unloaded assembly: {0}\n", aue.Assembly.Location));
 			}
 			else if (e is VMStartEvent) {
+				OnStarted (new ThreadInfo (0, GetId (e.Thread), e.Thread.Name, null));
 				//HACK: 2.6.1 VM doesn't emit type load event, so work around it
 				var t = vm.RootDomain.Corlib.GetType ("System.Exception", false, false);
 				if (t != null)


screenshot.cs: fixed screenshot box inside screenshot_MouseMove()

--- kagv/screenshot.cs
+++ kagv/screenshot.cs
@@ -17,15 +17,15 @@
             InitializeComponent();
         }
         Size size;
-        Point l;
+        Point loc;
         Graphics gp;
         private string resources_path = System.IO.Directory.GetCurrentDirectory();
         int shotcounter = 0;
         private void screenshot_Load(object sender, EventArgs e)
         {
-            l.X = Owner.Location.X+7 ;
-            l.Y = Owner.Location.Y+50;
-            this.Location = l;
+            loc.X = Owner.Location.X+7 ;
+            loc.Y = Owner.Location.Y+50;
+            this.Location = loc;

             size.Height = Owner.Height -60;
             size.Width = Owner.Width-15;
@@ -112,6 +112,18 @@
                     , rec_width
                     , rec_height);
                 }
+                else
+                {
+                    shot = new Rectangle(
+                        ClickedCoords.X
+                    , ClickedCoords.Y
+                    , rec_width
+                    , rec_height);
+                    shot = new Rectangle(e.X, ClickedCoords.Y,
+                                         ClickedCoords.X-e.X, e.Y-ClickedCoords.Y
+                                            );
+
+                }

                 if (shot.Width <= 0 || shot.Height <= 0)
                 {


Update autogenerated file

Update autogenerated file

--- MastoomXF/MastoomXF.Droid/Resources/Resource.designer.cs
+++ MastoomXF/MastoomXF.Droid/Resources/Resource.designer.cs
@@ -2072,6 +2072,7 @@
 			global::CarouselView.FormsPlugin.Android.Resource.Styleable.ViewStubCompat_android_id = global::Mastoom.Droid.Resource.Styleable.ViewStubCompat_android_id;
 			global::CarouselView.FormsPlugin.Android.Resource.Styleable.ViewStubCompat_android_inflatedId = global::Mastoom.Droid.Resource.Styleable.ViewStubCompat_android_inflatedId;
 			global::CarouselView.FormsPlugin.Android.Resource.Styleable.ViewStubCompat_android_layout = global::Mastoom.Droid.Resource.Styleable.ViewStubCompat_android_layout;
+			global::Splat.Resource.String.library_name = global::Mastoom.Droid.Resource.String.library_name;
 		}

 		public partial class Animation
@@ -5584,6 +5585,9 @@

 			// aapt resource value: 0x7f060016
 			public const int character_counter_pattern = 2131099670;
+
+			// aapt resource value: 0x7f060038
+			public const int library_name = 2131099704;

 			// aapt resource value: 0x7f060000
 			public const int mr_button_content_description = 2131099648;


I added test generating documentation of GetFriendlyName() extension method

--- Synergy.Catalogue/Reflection/Tests/ReflectionExtensionDocumentation.cs
+++ Synergy.Catalogue/Reflection/Tests/ReflectionExtensionDocumentation.cs
@@ -25,7 +25,7 @@
             typeof(decimal),
             typeof(bool),
         };
-
+
         private readonly List<Type> primitiveTypesNullable = new List<Type>()
         {
             typeof(byte?),
@@ -42,7 +42,7 @@
             typeof(decimal?),
             typeof(bool?),
         };
-
+
         private readonly List<Type> complexTypes = new List<Type>()
         {
             typeof(object),
@@ -53,7 +53,7 @@
             typeof(int[]),
             typeof(Dictionary<string, long>),
         };
-
+
         [Fact]
         public void GetFriendlyTypeName()
         {
@@ -77,7 +77,7 @@

             documentation.Append(new Markdown.Header2("Remarks"))
                          .Append(new Markdown.Paragraph("This method is intended to be used mainly for testing purposes."));
-
+
             var writer = new MarkdownTextWriter(documentation);
             Approvals.Verify(writer);
         }
@@ -89,6 +89,7 @@
             {
                 table.Append(type.ToString(), type.GetFriendlyTypeName());
             }
+
             return table;
         }
     }


small up job status

small up job status

--- Terradue.Tep/Terradue/Tep/Controller/Service/ProductionResultHelper.cs
+++ Terradue.Tep/Terradue/Tep/Controller/Service/ProductionResultHelper.cs
@@ -204,7 +204,7 @@
                 //case url is supervisor status url
                 if(url.Host == new Uri(supervisorBaseUrl).Host){
                     wpsjob.StatusLocation = resultUrl;
-					wpsjob.Status = WpsJobStatus.SUCCEEDED;
+					// wpsjob.Status = WpsJobStatus.SUCCEEDED;
 					wpsjob.Store();
                     return wpsjob.GetExecuteResponseForSucceededJob(execResponse);
                 //case url is recast describe url


Improve some logging in LandConnector

Improve some logging in LandConnector

This also eliminate the last 'OGS1' logging message (in this case, an erroneous one)

--- OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -88,7 +88,7 @@
                     XmlRpcResponse response = request.Send(uri, 10000);
                     if (response.IsFault)
                     {
-                        m_log.ErrorFormat("[LAND CONNECTOR] remote call returned an error: {0}", response.FaultString);
+                        m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString);
                     }
                     else
                     {
@@ -110,22 +110,26 @@
                             landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
                             if (hash["RegionAccess"] != null)
                                 regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
-                            m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
+                            m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name);
                         }
                         catch (Exception e)
                         {
-                            m_log.Error("[LAND CONNECTOR] Got exception while parsing land-data:", e);
+                            m_log.ErrorFormat(
+                                "[LAND CONNECTOR]: Got exception while parsing land-data: {0} {1}",
+                                e.Message, e.StackTrace);
                         }
                     }
                 }
-                else m_log.WarnFormat("[LAND CONNECTOR] Couldn't find region with handle {0}", regionHandle);
+                else
+                    m_log.WarnFormat("[LAND CONNECTOR]: Couldn't find region with handle {0}", regionHandle);
             }
             catch (Exception e)
             {
-                m_log.ErrorFormat("[LAND CONNECTOR] Couldn't contact region {0}: {1}", regionHandle, e);
+                m_log.ErrorFormat(
+                    "[LAND CONNECTOR]: Couldn't contact region {0}: {1} {2}", regionHandle, e.Message, e.StackTrace);
             }

             return landData;
         }
     }
-}
+}


Use menu theme

Use menu theme

--- PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs
+++ PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs
@@ -178,7 +178,7 @@
 			this.OverflowButton.Name = "Printer Overflow Menu";
 			this.ExtendOverflowMenu = (popupMenu) =>
 			{
-				this.GeneratePrinterOverflowMenu(popupMenu, theme);
+				this.GeneratePrinterOverflowMenu(popupMenu, ApplicationController.Instance.MenuTheme);
 			};

 			printer.ViewState.ViewModeChanged += (s, e) =>


added entry for BigmodsFTPModpackInstallStats

--- RelhaxModpack/RelhaxModpack/PrivateStuff/PrivateStuff.cs
+++ RelhaxModpack/RelhaxModpack/PrivateStuff/PrivateStuff.cs
@@ -13,6 +13,7 @@

         #region bigmods FTP modpack addresses
         public const string BigmodsFTPModpackRoot = null;
+        public const string BigmodsFTPModpackInstallStats = null;
         public const string BigmodsFTPModpackMedias = null;
         public const string BigmodsFTPModpackRelhaxModpack = null;
         public const string BigmodsFTPRootWoT = null;


Added checking when physical monitor handle has been closed

--- Source/Monitorian/Models/Monitor/MonitorConfiguration.cs
+++ Source/Monitorian/Models/Monitor/MonitorConfiguration.cs
@@ -210,7 +210,7 @@
 			}
 			finally
 			{
-				// Physical monitors should be destroyed at a later stage.
+				// The physical monitor handles should be destroyed at a later stage.
 			}
 		}

@@ -218,6 +218,12 @@
 		{
 			if (physicalMonitorHandle == null)
 				throw new ArgumentNullException(nameof(physicalMonitorHandle));
+
+			if (physicalMonitorHandle.IsClosed)
+			{
+				Debug.WriteLine("Failed to get brightness. The physical monitor handle has been closed.");
+				return -1;
+			}

 			uint minimumBrightness;
 			uint currentBrightness;
@@ -242,10 +248,15 @@
 		{
 			if (physicalMonitorHandle == null)
 				throw new ArgumentNullException(nameof(physicalMonitorHandle));
-
 			if ((brightness < 0) || (100 < brightness))
 				throw new ArgumentOutOfRangeException(nameof(brightness), $"{nameof(brightness)} must be in the range of 0 to 100.");

+			if (physicalMonitorHandle.IsClosed)
+			{
+				Debug.WriteLine("Failed to set brightness. The physical monitor handle has been closed.");
+				return false;
+			}
+
 			if (!SetMonitorBrightness(physicalMonitorHandle, (uint)brightness))
 			{
 				Debug.WriteLine($"Failed to set brightness. ({Error.CreateMessage()})");


Fix save image in file e use the file for the animation

--- TestAppUWP/UserControls/CartAnimationUserControl.xaml.cs
+++ TestAppUWP/UserControls/CartAnimationUserControl.xaml.cs
@@ -18,7 +18,6 @@
 using Windows.UI.Xaml.Hosting;
 using Windows.UI.Xaml.Media;
 using Windows.UI.Xaml.Media.Imaging;
-using Microsoft.Toolkit.Uwp.UI;

 namespace TestAppUWP.UserControls
 {
@@ -58,7 +57,7 @@
             if (frameworkElement == null) return;

             DependencyObject dependencyObject = VisualTreeHelper.GetParent(frameworkElement);
-            Image image = (Image) VisualTreeHelper.GetChild(dependencyObject, 0);
+            var image = (ContentPresenter) VisualTreeHelper.GetChild(dependencyObject, 0);

             Point point = image.TransformToVisual(this).TransformPoint(new Point(0,0));
             Point targetPoint = CartPlaceholder.TransformToVisual(this).TransformPoint(new Point(CartPlaceholder.ActualWidth / 2, CartPlaceholder.ActualHeight / 2));
@@ -66,7 +65,7 @@
             DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();

             var renderTargetBitmap = new RenderTargetBitmap();
-            await renderTargetBitmap.RenderAsync(frameworkElement);
+            await renderTargetBitmap.RenderAsync(image);
             IBuffer buffer = await renderTargetBitmap.GetPixelsAsync();

             StorageFile storageFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync("temp.bmp", CreationCollisionOption.OpenIfExists);
@@ -81,14 +80,14 @@
             }

             CompositionDrawingSurface surface;
-            using (CanvasBitmap canvasBitmap = await CanvasBitmap.LoadAsync(_canvasDevice, new Uri("ms-appx:///Assets/Photos/pic00.jpg")))
+            using (CanvasBitmap canvasBitmap = await CanvasBitmap.LoadAsync(_canvasDevice, new Uri("ms-appdata:///temp/temp.bmp")))
             {
-                surface = _graphicsDevice.CreateDrawingSurface(new Size(frameworkElement.ActualWidth, frameworkElement.ActualHeight),
+                surface = _graphicsDevice.CreateDrawingSurface(new Size(renderTargetBitmap.PixelWidth, renderTargetBitmap.PixelHeight),
                     DirectXPixelFormat.B8G8R8A8UIntNormalized, DirectXAlphaMode.Ignore);
                 using (CanvasDrawingSession session = CanvasComposition.CreateDrawingSession(surface))
                 {
                     session.Clear(Color.FromArgb(0, 0, 0, 0));
-                    session.DrawImage(canvasBitmap, new Rect(0, 0, surface.Size.Width, surface.Size.Height),
+                    session.DrawImage(canvasBitmap, new Rect(0, 0, renderTargetBitmap.PixelWidth, renderTargetBitmap.PixelHeight),
                         new Rect(0, 0, canvasBitmap.Size.Width, canvasBitmap.Size.Height));
                 }
             }


Delete Type.cs

Delete Type.cs

--- TextEditor/TestConsole/CommandProcessor/Commands/Type.cs
+++ TextEditor/TestConsole/CommandProcessor/Commands/Type.cs
@@ -1,49 +0,0 @@
-using System;
-using System.IO;
-
-namespace Kernel.CommandProcessor.Commands
-{
-    public class Type : BaseCommand
-    {
-        public Type()
-        {
-            name = "type";
-            description = "Display contents of a text file.";
-            parameterCount = 2;
-        }
-
-        public override void Do(params string[] args)
-        {
-            string file = args[1];
-
-            if(!file.Contains(Global.CurrentPath))
-                file = Path.Combine(Global.CurrentPath, args[1]);
-
-            string[] content;
-
-            try
-            {
-                if(File.Exists(file))
-                {
-                    content = File.ReadAllLines(file);
-                    foreach (string s in content)
-                        CommandResult.AddSuccessMessage(s);
-                }
-                else
-                {
-                    CommandResult.AddErrorMessage("Invalid filename '" + file + "'");
-                }
-            }
-            catch (Exception ex)
-            {
-                CommandResult.AddErrorMessage("Unable to type file.");
-                CommandResult.Exception = ex;
-            }
-        }
-
-        public override BaseCommand Create()
-        {
-            return new Type();
-        }
-    }
-}


minor code maintenance

minor code maintenance

git-tfs-id: [http://falcon:8080/tfs/Projects]$/Phalanger/Main;C3124

--- Source/Core/Parsers/Parser.cs
+++ Source/Core/Parsers/Parser.cs
@@ -1035,7 +1035,11 @@
                 !(item is NamespaceDecl))
             {
                 // adding a statement after simple namespace declaration => add the statement into the namespace:
-                ListAdd<T>(nsitem.Statements, (T)item);
+                Debug.Assert(item is T);
+                Debug.Assert(item is Statement);
+
+                nsitem.Statements.Add((Statement)item);
+                //nsitem.UpdatePosition(Position.CombinePositions(nsitem.Position, ((Statement)item).Position));
             }
             else if (item is List<T>)
             {
@@ -1053,6 +1057,8 @@
         private static void ListPrepend<T>(object/*!*/list, object/*!*/item)
         {
             Debug.Assert(list != null);
+            Debug.Assert(item != null);
+            Debug.Assert(item is T);

             var tlist = (List<T>)list;

@@ -1065,12 +1071,18 @@
             NamespaceDecl nsitem = item as NamespaceDecl;
             if (nsitem != null && nsitem.IsSimpleSyntax)
             {
+                Debug.Assert(list is List<Statement>);
+                var slist = (List<Statement>)list;
+
                 // move statements into nsitem namespace:
                 int i = 0;  // find how many Statements from tlist move to nsitem.Statements
-                for (; i < tlist.Count && !(tlist[i] is NamespaceDecl); ++i) ;
+                while (i < slist.Count && !(slist[i] is NamespaceDecl))
+                    ++i;
+
                 if (i > 0)
                 {
-                    nsitem.Statements.AddRange((tlist as List<Statement>).Take(i));
+                    nsitem.Statements.AddRange(slist.Take(i));
+                    //nsitem.UpdatePosition(Position.CombinePositions(nsitem.Position, slist[i - 1].Position));
                     tlist.RemoveRange(0, i);
                 }
             }


[*] Расшарены методы выполнения запроса

[*] Расшарены методы выполнения запроса

--- Source/Data/DataConnection.cs
+++ Source/Data/DataConnection.cs
@@ -577,7 +577,7 @@
 			}
 		}

-		protected virtual int ExecuteNonQuery()
+        protected internal virtual int ExecuteNonQuery()
 		{
 			if (TraceSwitch.Level == TraceLevel.Off)
 				return Command.ExecuteNonQuery();
@@ -629,7 +629,7 @@
 			}
 		}

-        protected virtual object ExecuteScalar()
+        protected internal virtual object ExecuteScalar()
 		{
 			if (TraceSwitch.Level == TraceLevel.Off)
 				return Command.ExecuteScalar();
@@ -685,7 +685,7 @@
 			return ExecuteReader(CommandBehavior.Default);
 		}

-        protected virtual IDataReader ExecuteReader(CommandBehavior commandBehavior)
+        protected internal virtual IDataReader ExecuteReader(CommandBehavior commandBehavior)
 		{
 			if (TraceSwitch.Level == TraceLevel.Off)
 				return Command.ExecuteReader(commandBehavior);


Fixed prepare file fragment protocol being violated :O

--- Source/Fragment/Fragmenter.cs
+++ Source/Fragment/Fragmenter.cs
@@ -65,9 +65,12 @@
       return fragment.Skip(5).ToArray();
     }

+    /// <summary>
+    /// Get file name from a prepare file fragment.
+    /// </summary>
     public static string GetFileName(byte[] fragment) {
       // get file name size
-      var size = BitConverter.ToUInt16(fragment.Skip(3).Take(2).ToArray(), 0);
+      var size = fragment.Skip(3).ToArray()[0];

       // get bytes
       var bytes = fragment.Skip(5).Take(size).ToArray();
@@ -142,9 +145,12 @@
       return Encoding.ASCII.GetString(bytes);
     }

+    /// <summary>
+    /// Gets remote name from a prepare file fragment.
+    /// </summary>
     public static string GetPrepareFileName(byte[] fragment) {
       // get file name size
-      var size = BitConverter.ToUInt16(fragment.Skip(3).Take(2).ToArray(), 0);
+      var size = fragment.Skip(3).ToArray()[0];

       // get bytes
       var bytes = fragment.Skip(5).Skip(size).ToArray();


Refactoring.

Refactoring.

--- Source/SsdeepNET/FuzzyHash.cs
+++ Source/SsdeepNET/FuzzyHash.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Security.Cryptography;
 using System.Text;

@@ -91,7 +92,6 @@
             // There is very little information content is sequences of the same character like 'LLLLL'.
             // Eliminate any sequences longer than 3. This is especially important when combined
             // with the has_common_substring() test below.
-            // NOTE: This function duplciates str1 and str2.
             s1_1 = EliminateSequences(s1_1);
             s2_1 = EliminateSequences(s2_1);
             s1_2 = EliminateSequences(s1_2);
@@ -235,9 +235,9 @@
         /// <returns>True if the two strings do have a common substring, false otherwise.</returns>
         private static bool HasCommonSubstring(char[] s1, char[] s2)
         {
-            var hashes = new uint[Constants.SpamSumLength];
-
-            // Tthere are many possible algorithms for common substring
+            var hashes = new List<uint>(Constants.SpamSumLength);
+
+            // There are many possible algorithms for common substring
             // detection. In this case I am re-using the rolling hash code
             // to act as a filter for possible substring matches.

@@ -245,13 +245,11 @@
             // the first string.
             var state = new Roll();

-            int i;
-            for (i = 0; i < s1.Length && s1[i] != '\0'; i++)
+            for (int i = 0; i < s1.Length; i++)
             {
                 state.Hash((byte)s1[i]);
-                hashes[i] = state.Sum;
-            }
-            var num_hashes = i;
+                hashes.Add(state.Sum);
+            }

             state = new Roll();

@@ -260,20 +258,20 @@
             // for the first string. If one matches then we have a
             // candidate substring match. We then confirm that match with
             // a direct string comparison.
-            for (i = 0; i < s2.Length && s2[i] != '\0'; i++)
+            for (int i = 0; i < s2.Length; i++)
             {
                 state.Hash((byte)s2[i]);
                 uint h = state.Sum;
                 if (i < Constants.RollingWindow - 1)
                     continue;
-                for (int j = Constants.RollingWindow - 1; j < num_hashes; j++)
+                for (int j = Constants.RollingWindow - 1; j < hashes.Count; j++)
                 {
                     if (hashes[j] != 0 && hashes[j] == h)
                     {
                         // We have a potential match - confirm it.
                         var s2StartPos = i - Constants.RollingWindow + 1;
                         int len = 0;
-                        while (len + s2StartPos < s2.Length && s2[len + s2StartPos] != '\0')
+                        while (len + s2StartPos < s2.Length)
                             len++;
                         if (len < Constants.RollingWindow)
                             continue;
@@ -289,9 +287,6 @@
                                 matched = false;
                                 break;
                             }
-
-                            if (s1char is '\0')
-                                break;
                         }

                         if (matched)


Minor tweaks to the unity version enum

Minor tweaks to the unity version enum


Add MD5 Hash check on archive download

Add MD5 Hash check on archive download

--- ValidationPipeline.LogStorage/Services/StorageService.cs
+++ ValidationPipeline.LogStorage/Services/StorageService.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Security.Cryptography;
 using System.Threading.Tasks;
 using Microsoft.Extensions.Options;
 using Microsoft.WindowsAzure.Storage;
@@ -32,15 +33,6 @@
                 GetLatestRequestOptions(), new OperationContext()).Wait();
         }

-        private BlobRequestOptions GetLatestRequestOptions()
-        {
-            return new BlobRequestOptions
-            {
-                SingleBlobUploadThresholdInBytes = _options.Value.SingleBlobUploadThresholdInBytes,
-                ParallelOperationThreadCount = _options.Value.ParallelOperationThreadCount
-            };
-        }
-
         #region IStorageService Implementation

         public async Task UploadAsync(string archiveFileName, Stream archiveStream,
@@ -60,7 +52,8 @@
             blockBlob.Metadata.AddRange(metaData.ToDictionary(
                 entry => entry.Key, entry => JsonConvert.SerializeObject(entry.Value)));

-            archiveStream.Position = 0;
+            blockBlob.Properties.ContentType = CommonConstants.ZipContentType;
+            blockBlob.Properties.ContentMD5 = ComputeContentMd5(archiveStream);

             await blockBlob.UploadFromStreamAsync(archiveStream,
                 AccessCondition.GenerateEmptyCondition(),
@@ -82,8 +75,7 @@
                 throw new ArgumentNullException(nameof(archiveFileName));

             var blob = _blobContainer.GetBlobReference(archiveFileName);
-            await blob.FetchAttributesAsync(AccessCondition.GenerateEmptyCondition(),
-                GetLatestRequestOptions(), new OperationContext());
+            await FetchAttributesAsync(blob);

             return blob.Metadata.ToDictionary(entry => entry.Key,
                 entry => JsonConvert.DeserializeObject<MetaData>(entry.Value));
@@ -99,8 +91,7 @@
                 throw new ArgumentNullException(nameof(innerFileName));

             var blob = _blobContainer.GetBlobReference(archiveFileName);
-            await blob.FetchAttributesAsync(AccessCondition.GenerateEmptyCondition(),
-                GetLatestRequestOptions(), new OperationContext());
+            await FetchAttributesAsync(blob);

             return blob.Metadata.ContainsKey(innerFileName) ?
                 JsonConvert.DeserializeObject<MetaData>(blob.Metadata[innerFileName]) : null;
@@ -117,7 +108,43 @@
             await blockBlob.DownloadToStreamAsync(memoryStream, AccessCondition.GenerateEmptyCondition(),
                 GetLatestRequestOptions(), new OperationContext());

+            if (ComputeContentMd5(memoryStream) != blockBlob.Properties.ContentMD5)
+                throw new InvalidDataException($"{archiveFileName} is corrupt!");
+
             return memoryStream;
+        }
+
+        #endregion
+
+        #region Helpers
+
+        private BlobRequestOptions GetLatestRequestOptions()
+        {
+            return new BlobRequestOptions
+            {
+                SingleBlobUploadThresholdInBytes = _options.Value.SingleBlobUploadThresholdInBytes,
+                ParallelOperationThreadCount = _options.Value.ParallelOperationThreadCount
+            };
+        }
+
+        private async Task FetchAttributesAsync(CloudBlob blob)
+        {
+            await blob.FetchAttributesAsync(AccessCondition.GenerateEmptyCondition(),
+                GetLatestRequestOptions(), new OperationContext());
+        }
+
+        private static string ComputeContentMd5(Stream stream)
+        {
+            stream.Position = 0;
+
+            using (var md5 = MD5.Create())
+            {
+                md5.Initialize();
+                var bytes = md5.ComputeHash(stream);
+
+                stream.Position = 0;
+                return Convert.ToBase64String(bytes);
+            }
         }

         #endregion


mark class sealed & disposable

mark class sealed & disposable

--- Src/Metrics/MetricsReports.cs
+++ Src/Metrics/MetricsReports.cs
@@ -6,7 +6,7 @@
 using Metrics.Visualization;
 namespace Metrics
 {
-    public class MetricsReports : Utils.IHideObjectMembers
+    public sealed class MetricsReports : Utils.IHideObjectMembers, IDisposable
     {
         private readonly MetricsRegistry metricsRegistry;

@@ -83,5 +83,11 @@
             using (this.listener) { }
             this.listener = null;
         }
+
+        public void Dispose()
+        {
+            using (this.listener) { }
+            this.listener = null;
+        }
     }
 }


Properly use try/finally for releasing locks in ValidatingModelBase

--- Stylet/ValidatingModelBase.cs
+++ Stylet/ValidatingModelBase.cs
@@ -110,6 +110,7 @@

             var changedProperties = new List<string>();
             await this.propertyErrorsLock.WaitAsync().ConfigureAwait(false);
+            try
             {
                 foreach (var kvp in results)
                 {
@@ -130,7 +131,10 @@
                     changedProperties.Add(removedKey);
                 }
             }
-            this.propertyErrorsLock.Release();
+            finally
+            {
+                this.propertyErrorsLock.Release();
+            }

             if (changedProperties.Count > 0)
                 this.OnValidationStateChanged(changedProperties);
@@ -199,6 +203,7 @@
             bool propertyErrorsChanged = false;

             await this.propertyErrorsLock.WaitAsync().ConfigureAwait(false);
+            try
             {
                 if (!this.propertyErrors.ContainsKey(propertyName))
                     this.propertyErrors.Add(propertyName, null);
@@ -209,7 +214,10 @@
                     propertyErrorsChanged = true;
                 }
             }
-            this.propertyErrorsLock.Release();
+            finally
+            {
+                this.propertyErrorsLock.Release();
+            }

             if (propertyErrorsChanged)
                 this.OnValidationStateChanged(new[] { propertyName });
@@ -271,10 +279,14 @@
             // We'll just have to wait synchronously for this. Oh well. The lock shouldn't be long.
             // Everything that awaits uses ConfigureAwait(false), so we shouldn't deadlock if someone calls this on the main thread
             this.propertyErrorsLock.Wait();
+            try
             {
                 this.propertyErrors.TryGetValue(propertyName, out errors);
             }
-            this.propertyErrorsLock.Release();
+            finally
+            {
+                this.propertyErrorsLock.Release();
+            }

             return errors;
         }


Throw an exception of Unknown hotel is given

--- Sulakore/Habbo/HExtensions.cs
+++ Sulakore/Habbo/HExtensions.cs
@@ -33,14 +33,18 @@
             return (HDirection)(((int)facing + 1) & 7);
         }

-        public static string ToDomain(this HHotel hotel)
-        {
-            string value = hotel.ToString().ToLower();
-            return (value.Length != 5 ? value : value.Insert(3, "."));
-        }
         public static Uri ToUri(this HHotel hotel)
         {
             return new Uri($"https://www.habbo.{hotel.ToDomain()}");
+        }
+        public static string ToDomain(this HHotel hotel)
+        {
+            if (hotel == HHotel.Unknown)
+            {
+                throw new ArgumentException("Hotel cannot be 'Unknown'.", nameof(hotel));
+            }
+            string value = hotel.ToString().ToLower();
+            return (value.Length != 5 ? value : value.Insert(3, "."));
         }

         public static IEnumerable<MethodInfo> GetAllMethods(this Type type)


Preview: Fixed MemoryLeak

Preview: Fixed MemoryLeak

http://stackoverflow.com/questions/1546091/wpf-createbitmapsourcefromhbitmap-memory-leak

--- Suplanus.Sepla/Gui/Preview.cs
+++ Suplanus.Sepla/Gui/Preview.cs
@@ -6,6 +6,7 @@
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using Eplan.EplApi.DataModel;
+using System.Runtime.InteropServices;
 using Eplan.EplApi.DataModel.MasterData;
 using Eplan.EplApi.HEServices;

@@ -14,7 +15,7 @@
 	public class Preview
 	{
 		private readonly Border _border;
-		private DrawingService _drawingService;
+		private readonly DrawingService _drawingService;
 		private readonly Project _project;

 		public Preview(Border border, string projectFile)
@@ -23,18 +24,14 @@
 			projectManager.LockProjectByDefault = false;
 			_project = projectManager.OpenProject(projectFile, ProjectManager.OpenMode.Exclusive);

-			//_drawingService = new DrawingService();
-			//_drawingService.DrawConnections = true;
+			_drawingService = new DrawingService();
+			_drawingService.DrawConnections = true;

 			_border = border;
 		}

 		public void Display(string path, PreviewType previewType)
 		{
-			// new instance, cause of memory leak
-			_drawingService = new DrawingService();
-			_drawingService.DrawConnections = true;
-
 			switch (previewType)
 			{
 				case PreviewType.WindowMacro:
@@ -81,15 +78,16 @@

 				_drawingService.DrawDisplayList(paintEventArgs);

-				BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(),
+				IntPtr hBitmap = bitmap.GetHbitmap();
+				BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(hBitmap,
 					IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
+
 				_border.Background = new ImageBrush(bitmapSource);

-				// needed cause of memory leak
 				bitmap.Dispose();
 				graphics.Dispose();
 				paintEventArgs.Dispose();
-                _drawingService.Dispose();
+				DeleteObject(hBitmap);
 			}
 			else
 			{
@@ -97,7 +95,17 @@
 			}

 		}
+
+		/// <summary>
+		/// Memory Leak: http://stackoverflow.com/questions/1546091/wpf-createbitmapsourcefromhbitmap-memory-leak
+		/// </summary>
+		/// <param name="hObject"></param>
+		/// <returns></returns>
+		[DllImport("gdi32.dll")]
+		public static extern bool DeleteObject(IntPtr hObject);
 	}
+
+

 	public enum PreviewType
 	{


Fix loader

Fix loader

--- Sync/Plugins/PluginManager.cs
+++ Sync/Plugins/PluginManager.cs
@@ -270,13 +270,10 @@
                     if (asmList.Any(a => a.Location == file))
                         continue;
                     //Load assembly directly
-#if RELEASE || TEST_UPDATE
                     string temp = Path.Combine(cache, Path.GetFileName(file));
                     File.Copy(file, temp);
                     Assembly asm = Assembly.LoadFrom(temp);
-#else
-                    Assembly asm = Assembly.LoadFrom(file);
-#endif
+
                     asmList.Add(asm);
                 }
                 catch(Exception e)


Some xml comments has been added.

Some xml comments has been added.

--- TAlex.MathCore/NumericUtil.cs
+++ TAlex.MathCore/NumericUtil.cs
@@ -123,6 +123,13 @@
             return ZeroThreshold(ComplexThreshold(value, complexThreshold), zeroThreshold);
         }

+        /// <summary>
+        /// Returns a value that indicates whether the two double numbers are equal with the specified relative tolerance.
+        /// </summary>
+        /// <param name="value1">The first double value to fuzzy compare.</param>
+        /// <param name="value2">The second double value to fuzzy compare.</param>
+        /// <param name="relativeTolerance">A double value that represents the relative tolerance for compare.</param>
+        /// <returns>true if the value1 and value2 are fuzzy equal with the specified relative tolerance; otherwise false.</returns>
         public static bool FuzzyEquals(double value1, double value2, double relativeTolerance)
         {
             if (value1 == value2) return true;
@@ -135,6 +142,13 @@
             return Math.Abs(value1 - value2) <= relativeTolerance * Math.Max(Math.Abs(value1), Math.Abs(value2));
         }

+        /// <summary>
+        /// Returns a value that indicates whether the two complex numbers are equal with the specified relative tolerance.
+        /// </summary>
+        /// <param name="value1">The first complex number to fuzzy compare.</param>
+        /// <param name="value2">The second complex number to fuzzy compare.</param>
+        /// <param name="relativeTolerance">A double value that represents the relative tolerance for compare.</param>
+        /// <returns>true if the value1 and value2 are fuzzy equal with the specified relative tolerance; otherwise false.</returns>
         public static bool FuzzyEquals(Complex value1, Complex value2, double relativeTolerance)
         {
             if (value1 == value2) return true;
@@ -155,8 +169,8 @@
         /// are theoretically identical, so no code calling this should fail to work if this
         /// returns false.
         /// </summary>
-        /// <param name="value1"> The first double to compare. </param>
-        /// <param name="value2"> The second double to compare. </param>
+        /// <param name="value1">The first double value to compare.</param>
+        /// <param name="value2">The second double value to compare.</param>
         /// <returns>result of the AreClose comparision.</returns>
         public static bool AreClose(double value1, double value2)
         {


Almost nothing - start of Renamer.RenameSingle(...)

--- TVS-Player/Classes/Renamer.cs
+++ TVS-Player/Classes/Renamer.cs
@@ -115,10 +115,8 @@
                 int season = t.Item1;
                 int episode = t.Item2;
                 var selectedEP = EPNames.FirstOrDefault(o => o.season == season && o.episode == episode);
-                var EObject = EPNames.FirstOrDefault(o => o.episode == episode);
                 if (selectedEP == null) {
                     MessageBox.Show("This TV Show doesnt have that amount of Episodes/Seasons", "Error");
-                    break;
                 } else {
                     string output = GetValidName(path, GetName(showName, selectedEP.season, selectedEP.episode, selectedEP.name), Path.GetExtension(file));
                     File.Move(file, output);
@@ -147,6 +145,14 @@
             }
             return count;
         }
+        public static void RenameSingle(string file, string lib, int id) {
+            string showName = Api.getName(id);
+            Tuple<int, int> t = GetInfo(file);
+            int season = t.Item1;
+            int episode = t.Item2;
+            string info = Api.apiGet(season, episode, id);
+
+        }

         public static List<string> FilterExtensions(List<string> files) {


Fix mod button not showing up

Fix mod button not showing up

Checking for mod status should happen when we get a mod list.

--- TwitchChat/MainWindow.xaml.cs
+++ TwitchChat/MainWindow.xaml.cs
@@ -266,14 +266,24 @@
             channel.SlowModeEnd += SlowModeEndHandler;
             channel.SubModeBegin += SubModeBeginHandler;
             channel.SubModeEnd += SubModeEndHandler;
+            channel.ModListReceived += ModListReceived;

+            return channel;
+        }
+
+        void ModListReceived(TwitchChannel channel, TwitchUser[] moderators)
+        {
+            Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action<TwitchChannel>(ModListReceivedWorker), channel);
+        }
+
+        private void ModListReceivedWorker(TwitchChannel channel)
+        {
             // Setting initial state, it's ok we haven't joined the channel yet.
             var currUser = CurrentUser = channel.GetUser(m_options.User);
             if (currUser.IsModerator)
                 ModJoined(channel, currUser);
             else
                 ModLeft(channel, currUser);
-            return channel;
         }

@@ -306,6 +316,7 @@
             channel.SlowModeEnd -= SlowModeEndHandler;
             channel.SubModeBegin -= SubModeBeginHandler;
             channel.SubModeEnd -= SubModeEndHandler;
+            channel.ModListReceived -= ModListReceived;

             return channel.Connection;
         }


Testes de casos

Testes de casos

--- UnitTestProject1/UnitTest1.cs
+++ UnitTestProject1/UnitTest1.cs
@@ -9,16 +9,83 @@
     public class DateCalculatorTest
     {
         [TestMethod]
-        public void Testbissextile()
+        public void Testbissextile_when_is_bissextile()
         {
             bool test = DateCalculator.bissextile(2016);
             Assert.AreEqual(true, test);
         }
+
         [TestMethod]
-        public void TestjulianDay()
+        public void Testbissextile_when_is_not_bissextile()
+        {
+            bool test = DateCalculator.bissextile(2015);
+            Assert.AreEqual(false, test);
+        }
+
+        [TestMethod]
+        public void TestjulianDay_when_month_is_less_than_3()
+        {
+            int test = DateCalculator.julianDay(23, 01, 2015);
+            Assert.AreEqual(2457046, test);
+        }
+
+        [TestMethod]
+        public void TestjulianDay_when_month_is_greater_than_3()
         {
             int test = DateCalculator.julianDay(23, 09, 2015);
             Assert.AreEqual(2457289, test);
         }
+
+        [TestMethod]
+        public void TestjulianDay_when_year_is_greater_than_1582()
+        {
+            int test = DateCalculator.julianDay(23, 09, 2015);
+            Assert.AreEqual(2457289, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_less_than_1582()
+        {
+            int test = DateCalculator.julianDay(23, 09, 1581);
+            Assert.AreEqual(2298784, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_1582_and_month_greater_than_10()
+        {
+            int test = DateCalculator.julianDay(23, 11, 1582);
+            Assert.AreEqual(2299200, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_1582_and_month_less_than_10()
+        {
+            int test = DateCalculator.julianDay(23, 09, 1582);
+            Assert.AreEqual(2299149, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_1582_and_month_is_10_and_day_is_15()
+        {
+            int test = DateCalculator.julianDay(15, 10, 1582);
+            Assert.AreEqual(2299161, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_1582_and_month_is_10_and_day_is_4()
+        {
+            int test = DateCalculator.julianDay(4, 10, 1582);
+            Assert.AreEqual(2299160, test);
+        }
+        [TestMethod]
+        public void TestjulianDay_when_year_is_1582_and_month_is_10_and_day_is_7()
+        {
+
+            var test = false;
+            try
+            {
+                DateCalculator.julianDay(7, 10, 1582);
+            } catch (DateCalculator.NoJulianDay)
+            {
+                test = true;
+            }
+            Assert.AreEqual(true, test);
+        }
+
     }
 }


Added IP test

Added IP test

--- UnitTests/Library/Location.cs
+++ UnitTests/Library/Location.cs
@@ -419,6 +419,23 @@
         }

         [TestMethod]
+        public void AbsoluteLocationIpExample()
+        {
+            var url = "http://127.0.0.1:8080/mypath";
+            var location = new Location(url);
+            Assert.AreEqual("", location.Hash);
+            Assert.AreEqual("8080", location.Port);
+            Assert.AreEqual("", location.Search);
+            Assert.AreEqual("/mypath", location.PathName);
+            Assert.AreEqual("http:", location.Protocol);
+            Assert.AreEqual("127.0.0.1:8080", location.Host);
+            Assert.AreEqual("127.0.0.1", location.HostName);
+            Assert.AreEqual("", location.Data);
+            Assert.AreEqual(url, location.Href);
+            Assert.IsFalse(location.IsRelative);
+        }
+
+        [TestMethod]
         public void AbsoluteLocationW3Project()
         {
             var url = "http://www.w3.org/pub/WWW/TheProject.html";


Google Maps => Link function

Google Maps => Link function

--- WUI/Views/Race/Details.cshtml
+++ WUI/Views/Race/Details.cshtml
@@ -63,7 +63,8 @@

         function populateTable(result) {
             console.log(result);
-            points = result;
+            points = result;
+            initialize();
         }

         function initialize() {
@@ -136,7 +137,7 @@
                 }
             }
         }
-        google.maps.event.addDomListener(window, "load", initialize);
+

     </script>


Disable text localization

Disable text localization

--- Web/Helpers/LanguageHelper.cs
+++ Web/Helpers/LanguageHelper.cs
@@ -12,6 +12,7 @@
     {
         public static string Translate(this HtmlHelper html, string phrase, string language = "EN")
         {
+            //TODO: By pass phrase translation to see the impact of localization module on performance
             return phrase;
             var currentLanguage = language;


Prefer IsEmpty over Length checks

Prefer IsEmpty over Length checks

--- src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs
+++ src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs
@@ -305,7 +305,7 @@
                     // We should only ever get a default array (meaning, update the root), or a
                     // non-empty array.  We should never be asked to update exactly '0' nodes.
                     Debug.Assert(documentToUpdate.NodesToUpdate.IsDefault ||
-                                 documentToUpdate.NodesToUpdate.Length >= 1);
+                                !documentToUpdate.NodesToUpdate.IsEmpty);

                     // If we were given specific nodes to update, only update those.  Otherwise
                     // updated everything from the root down.
@@ -347,7 +347,7 @@
                 structNameToken = structNameToken.WithAdditionalAnnotations(RenameAnnotation.Create());
             }

-            return typeParameters.Length == 0
+            return typeParameters.IsEmpty
                 ? (TNameSyntax)generator.IdentifierName(structNameToken)
                 : (TNameSyntax)generator.GenericName(structNameToken, typeParameters.Select(tp => generator.IdentifierName(tp.Name)));
         }


Removed accidental change

Removed accidental change

--- src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableControlEventProcessorProvider.cs
+++ src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableControlEventProcessorProvider.cs
@@ -45,8 +45,6 @@
                 // that can happen if error is staled build error or user used #line pragma in C#
                 // to point to some random file in error or more.
                 e.Handled = roslynSnapshot.TryNavigateTo(index, e.IsPreview);
-
-                e.Handled = false;
             }
         }
     }


Updated logging with path and method

Updated logging with path and method

--- CompleteSample/CompleteSample.Logging/LoggingMiddleware.cs
+++ CompleteSample/CompleteSample.Logging/LoggingMiddleware.cs
@@ -17,10 +17,12 @@
             var sw = new Stopwatch();
             sw.Start();

+            Console.Write("{0} {1}", context.Request.Method, context.Request.Path);
+
             await Next.Invoke(context);
             sw.Stop();

-            Console.WriteLine("Request elapsed time: {0} ms", sw.ElapsedMilliseconds);
+            Console.WriteLine(" ({0} ms)", sw.ElapsedMilliseconds);
         }
     }
 }


Remove if DEBUG directives

Remove if DEBUG directives

--- Utility.Logging.Log4Net/Log4NetLogger.cs
+++ Utility.Logging.Log4Net/Log4NetLogger.cs
@@ -16,30 +16,22 @@

         public void Debug(string message)
         {
-#if DEBUG
             _logger.Debug(message);
-#endif
         }

         public void Debug(string format, params object[] args)
         {
-#if DEBUG
             _logger.DebugFormat(format, args);
-#endif
         }

         public void Debug(Exception exception, string message)
         {
-#if DEBUG
             _logger.Debug(message, exception);
-#endif
         }

         public void Debug(Exception exception, string format, params object[] args)
         {
-#if DEBUG
             _logger.Debug(string.Format(format, args), exception);
-#endif
         }

         public void Info(string message)


Change normal messages to Debug

Change normal messages to Debug

--- VeraLuupNet.Framework/VeraMasterClass.cs
+++ VeraLuupNet.Framework/VeraMasterClass.cs
@@ -156,7 +156,7 @@
         {
             try
             {
-                this.AddMessage(MessageTypeEnum.Information, "Vera - Authorizing");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Authorizing");

                 var authModel = this.GetAuthModel();

@@ -165,22 +165,22 @@

                 var authTokenModel = this.DeserializeAuthTokenModel(authToken);

-                this.AddMessage(MessageTypeEnum.Information, "Vera - Get Authorize Session");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Get Authorize Session");
                 var sessionToken = this.GetSessionToken(authTokenModel.Server_Auth, authToken, authSigToken);

-                this.AddMessage(MessageTypeEnum.Information, "Vera - Get Devices");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Get Devices");
                 var devicesReply = this.GetDevicesModel(authTokenModel.Server_Auth, sessionToken, authTokenModel.PK_Account);

                 var device = devicesReply.Devices.First();
                 this.PK_device = device.PK_Device;

-                this.AddMessage(MessageTypeEnum.Information, "Vera - Get Device Session");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Get Device Session");
                 var deviceSessionToken = this.GetSessionToken(device.Server_Device, authToken, authSigToken);

-                this.AddMessage(MessageTypeEnum.Information, "Vera - Get Specific Device");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Get Specific Device");
                 var deviceDevice = this.GetDeviceDeviceModel(deviceSessionToken, device.Server_Device, this.PK_device);

-                this.AddMessage(MessageTypeEnum.Information, "Vera - Get Relay Session");
+                this.AddMessage(MessageTypeEnum.Debug, "Vera - Get Relay Session");
                 var relaySessionToken = this.GetSessionToken(deviceDevice.Server_Relay, authToken, authSigToken);
                 this.RelaySessionToken = relaySessionToken;
                 this.ServerRelay = deviceDevice.Server_Relay;


Update the Dogehouse URLs for the recent server change

--- MultiMiner.Engine/Helpers/DonationPools.cs
+++ MultiMiner.Engine/Helpers/DonationPools.cs
@@ -51,11 +51,11 @@
             configurations.Add(donationConfiguration);

             //DOGE
-            donationConfiguration = CreateCoinConfiguration("DOGE", "stratum+tcp://stratum11.dogehouse.org", 8081);
+            donationConfiguration = CreateCoinConfiguration("DOGE", "stratum+tcp://shibe.dogehouse.org", 3333);
             configurations.Add(donationConfiguration);

             //DOG
-            donationConfiguration = CreateCoinConfiguration("DOG", "stratum+tcp://stratum11.dogehouse.org", 8081);
+            donationConfiguration = CreateCoinConfiguration("DOG", "stratum+tcp://shibe.dogehouse.org", 3333);
             configurations.Add(donationConfiguration);

             //ASC


CoreTest: Added new TT perf test

CoreTest: Added new TT perf test

--- Mzinga.CoreTest/TranspositionTableTests.cs
+++ Mzinga.CoreTest/TranspositionTableTests.cs
@@ -45,7 +45,7 @@
         [TestMethod]
         public void TranspositionTable_MaxMemoryTest()
         {
-            long expectedSizeInBytes =TranspositionTable.DefaultSizeInBytes;
+            long expectedSizeInBytes = TranspositionTable.DefaultSizeInBytes;

             TranspositionTable tt = new TranspositionTable(expectedSizeInBytes);
             Assert.IsNotNull(tt);
@@ -65,11 +65,46 @@
             long actualSizeInBytes = endMemoryUsage - startMemoryUsage;

             double usageRatio = actualSizeInBytes / (double)expectedSizeInBytes;
-            Trace.WriteLine(string.Format("Usage: {0} ({1:P2})", actualSizeInBytes, usageRatio));
+            Trace.WriteLine(string.Format("Usage: {0}/{1} ({2:P2})", actualSizeInBytes, expectedSizeInBytes, usageRatio));

             Assert.IsTrue(usageRatio - 1.0 <= 0.01, string.Format("Table is too big {0:P2}: {1} bytes (~{2} bytes per entry)", usageRatio, actualSizeInBytes - expectedSizeInBytes, (actualSizeInBytes - expectedSizeInBytes) / tt.Count));
         }

+        [TestMethod]
+        [TestCategory("Performance")]
+        public void TranspositionTable_FillAndReplacePerfTest()
+        {
+            TimeSpan sum = TimeSpan.Zero;
+            int iterations = 10;
+
+            for (int i = 0; i < iterations; i++)
+            {
+                TranspositionTable tt = new TranspositionTable();
+                Assert.IsNotNull(tt);
+
+                Stopwatch sw = Stopwatch.StartNew();
+
+                // Fill
+                for (int j = 0; j < tt.Capacity; j++)
+                {
+                    string key = j.ToString().PadLeft(204);
+                    tt.Store(key, CreateMaxEntry(j));
+                }
+
+                // Replace
+                for (int j = tt.Capacity - 1; j >= 0; j--)
+                {
+                    string key = j.ToString().PadLeft(204);
+                    tt.Store(key, CreateMaxEntry(j));
+                }
+
+                sw.Stop();
+
+                sum += sw.Elapsed;
+            }
+
+            Trace.WriteLine(string.Format("Average Ticks: {0}", sum.Ticks / iterations));
+        }

         private TranspositionTableEntry CreateMaxEntry(int id)
         {


Fix reading sdf eol is crlf

Fix reading sdf eol is crlf

--- NCDK/IO/RandomAccess/RandomAccessReader.cs
+++ NCDK/IO/RandomAccess/RandomAccessReader.cs
@@ -350,7 +350,11 @@
             while (true)
             {
                 if (c == '\n')
+                {
+                    if (sb.Length > 0 && sb[sb.Length - 1] == '\r')
+                        sb.Remove(sb.Length - 1, 1);
                     break;
+                }
                 if (c == -1)
                     break;
                 sb.Append((char)c);


version bump

version bump

--- WDMRC.Console/Properties/AssemblyInfo.cs
+++ WDMRC.Console/Properties/AssemblyInfo.cs
@@ -31,8 +31,8 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.1.4")]
-[assembly: AssemblyFileVersion("1.6.1.4")]
+[assembly: AssemblyVersion("1.6.1.5")]
+[assembly: AssemblyFileVersion("1.6.1.5")]

 [assembly: log4net.Config.XmlConfigurator(Watch = true)]