Use `IApplicableToDrawableHitObject` for `OsuModApproachDifferent`

Replacing the obsolete interface.

--- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs
@@ -1,9 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

-using System.Collections.Generic;
 using osu.Framework.Bindables;
-using osu.Framework.Extensions.IEnumerableExtensions;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Sprites;
 using osu.Game.Configuration;
@@ -13,7 +11,7 @@

 namespace osu.Game.Rulesets.Osu.Mods
 {
-    public class OsuModApproachDifferent : Mod, IApplicableToDrawableHitObjects
+    public class OsuModApproachDifferent : Mod, IApplicableToDrawableHitObject
     {
         public override string Name => "Approach Different";
         public override string Acronym => "AD";
@@ -32,22 +30,19 @@
         [SettingSource("Style", "Change the animation style of the approach circles.", 1)]
         public Bindable<AnimationStyle> Style { get; } = new Bindable<AnimationStyle>();

-        public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
+        public void ApplyToDrawableHitObject(DrawableHitObject drawable)
         {
-            drawables.ForEach(drawable =>
+            drawable.ApplyCustomUpdateState += (drawableObject, state) =>
             {
-                drawable.ApplyCustomUpdateState += (drawableObject, state) =>
-                {
-                    if (!(drawableObject is DrawableHitCircle drawableHitCircle)) return;
+                if (!(drawableObject is DrawableHitCircle drawableHitCircle)) return;

-                    var hitCircle = drawableHitCircle.HitObject;
+                var hitCircle = drawableHitCircle.HitObject;

-                    drawableHitCircle.ApproachCircle.ClearTransforms(targetMember: nameof(Scale));
+                drawableHitCircle.ApproachCircle.ClearTransforms(targetMember: nameof(Scale));

-                    using (drawableHitCircle.BeginAbsoluteSequence(hitCircle.StartTime - hitCircle.TimePreempt))
-                        drawableHitCircle.ApproachCircle.ScaleTo(Scale.Value).ScaleTo(1f, hitCircle.TimePreempt, getEasing(Style.Value));
-                };
-            });
+                using (drawableHitCircle.BeginAbsoluteSequence(hitCircle.StartTime - hitCircle.TimePreempt))
+                    drawableHitCircle.ApproachCircle.ScaleTo(Scale.Value).ScaleTo(1f, hitCircle.TimePreempt, getEasing(Style.Value));
+            };
         }

         private Easing getEasing(AnimationStyle style)


Reorder easing mapping to match enum order and throw on unknown animation style

--- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs
@@ -52,23 +52,26 @@
         {
             switch (style)
             {
-                default:
+                case AnimationStyle.Linear:
                     return Easing.None;
+
+                case AnimationStyle.Gravity:
+                    return Easing.InBack;
+
+                case AnimationStyle.InOut1:
+                    return Easing.InOutCubic;
+
+                case AnimationStyle.InOut2:
+                    return Easing.InOutQuint;

                 case AnimationStyle.Accelerate1:
                     return Easing.In;
-
-                case AnimationStyle.Linear:
-                    return Easing.None;

                 case AnimationStyle.Accelerate2:
                     return Easing.InCubic;

                 case AnimationStyle.Accelerate3:
                     return Easing.InQuint;
-
-                case AnimationStyle.Gravity:
-                    return Easing.InBack;

                 case AnimationStyle.Decelerate1:
                     return Easing.Out;
@@ -79,11 +82,8 @@
                 case AnimationStyle.Decelerate3:
                     return Easing.OutQuint;

-                case AnimationStyle.InOut1:
-                    return Easing.InOutCubic;
-
-                case AnimationStyle.InOut2:
-                    return Easing.InOutQuint;
+                default:
+                    throw new ArgumentOutOfRangeException(nameof(style), style, @"Unsupported animation style");
             }
         }


Changed variable names

Changed variable names

--- osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
+++ osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
@@ -137,15 +137,15 @@
             {
                 var legacyDecoded = new LegacyBeatmapDecoder { ApplyOffsets = false }.Decode(sr);

-                using (var ms = new MemoryStream())
-                using (var sw = new StreamWriter(ms))
-                using (var sr2 = new LineBufferedReader(ms))
+                using (var memStream = new MemoryStream())
+                using (var memWriter = new StreamWriter(memStream))
+                using (var memReader = new LineBufferedReader(memStream))
                 {
-                    sw.Write(legacyDecoded.Serialize());
-                    sw.Flush();
+                    memWriter.Write(legacyDecoded.Serialize());
+                    memWriter.Flush();

-                    ms.Position = 0;
-                    decoder = Decoder.GetDecoder<Beatmap>(sr2);
+                    memStream.Position = 0;
+                    decoder = Decoder.GetDecoder<Beatmap>(memReader);
                 }
             }


Clarify test math even further

Clarify test math even further

--- osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs
+++ osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs
@@ -65,7 +65,7 @@
         /// This test intentionally misses the 3rd hitobject to achieve lower than 75% accuracy and exactly 50% max combo.
         /// <para>
         /// For standardised scoring, <paramref name="expectedScore"/> is calculated using the following formula:
-        /// 1_000_000 * ((3 * <paramref name="hitResult"/> / 4 * <paramref name="maxResult"/>) * 30% + 50% * 70%)
+        /// 1_000_000 * (((3 * <paramref name="hitResult"/>) / (4 * <paramref name="maxResult"/>)) * 30% + 50% * 70%)
         /// </para>
         /// <para>
         /// For classic scoring, <paramref name="expectedScore"/> is calculated using the following formula:
@@ -74,30 +74,30 @@
         /// 75% * 4 * 300 * (1 + 1/25)
         /// </para>
         /// </remarks>
-        [TestCase(ScoringMode.Standardised, HitResult.Miss, HitResult.Great, 0)]
-        [TestCase(ScoringMode.Standardised, HitResult.Meh, HitResult.Great, 387_500)]
-        [TestCase(ScoringMode.Standardised, HitResult.Ok, HitResult.Great, 425_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.Good, HitResult.Perfect, 478_571)]
-        [TestCase(ScoringMode.Standardised, HitResult.Great, HitResult.Great, 575_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.Perfect, HitResult.Perfect, 575_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.SmallTickMiss, HitResult.SmallTickHit, 700_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 925_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)]
-        [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 575_000)]
-        [TestCase(ScoringMode.Standardised, HitResult.SmallBonus, HitResult.SmallBonus, 700_030)]
-        [TestCase(ScoringMode.Standardised, HitResult.LargeBonus, HitResult.LargeBonus, 700_150)]
-        [TestCase(ScoringMode.Classic, HitResult.Miss, HitResult.Great, 0)]
-        [TestCase(ScoringMode.Classic, HitResult.Meh, HitResult.Great, 156)]
-        [TestCase(ScoringMode.Classic, HitResult.Ok, HitResult.Great, 312)]
-        [TestCase(ScoringMode.Classic, HitResult.Good, HitResult.Perfect, 535)]
-        [TestCase(ScoringMode.Classic, HitResult.Great, HitResult.Great, 936)]
-        [TestCase(ScoringMode.Classic, HitResult.Perfect, HitResult.Perfect, 936)]
-        [TestCase(ScoringMode.Classic, HitResult.SmallTickMiss, HitResult.SmallTickHit, 0)]
-        [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 225)]
-        [TestCase(ScoringMode.Classic, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)]
-        [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 936)]
-        [TestCase(ScoringMode.Classic, HitResult.SmallBonus, HitResult.SmallBonus, 30)]
-        [TestCase(ScoringMode.Classic, HitResult.LargeBonus, HitResult.LargeBonus, 150)]
+        [TestCase(ScoringMode.Standardised, HitResult.Miss, HitResult.Great, 0)] // (3 * 0) / (4 * 300) * 300_000 + (0 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.Meh, HitResult.Great, 387_500)] // (3 * 50) / (4 * 300) * 300_000 + (2 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.Ok, HitResult.Great, 425_000)] // (3 * 100) / (4 * 300) * 300_000 + (2 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.Good, HitResult.Perfect, 478_571)] // (3 * 200) / (4 * 350) * 300_000 + (2 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.Great, HitResult.Great, 575_000)] // (3 * 300) / (4 * 300) * 300_000 + (2 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.Perfect, HitResult.Perfect, 575_000)] // (3 * 350) / (4 * 350) * 300_000 + (2 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.SmallTickMiss, HitResult.SmallTickHit, 700_000)] // (3 * 0) / (4 * 10) * 300_000 + 700_000 (max combo 0)
+        [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 925_000)] // (3 * 10) / (4 * 10) * 300_000 + 700_000 (max combo 0)
+        [TestCase(ScoringMode.Standardised, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] // (3 * 0) / (4 * 30) * 300_000 + (0 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 575_000)] // (3 * 30) / (4 * 30) * 300_000 + (0 / 4) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.SmallBonus, HitResult.SmallBonus, 700_030)] // 0 * 300_000 + 700_000 (max combo 0) + 3 * 10 (bonus points)
+        [TestCase(ScoringMode.Standardised, HitResult.LargeBonus, HitResult.LargeBonus, 700_150)] // 0 * 300_000 + 700_000 (max combo 0) + 3 * 50 (bonus points)
+        [TestCase(ScoringMode.Classic, HitResult.Miss, HitResult.Great, 0)] // (0 * 4 * 300) * (1 + 0 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.Meh, HitResult.Great, 156)] // (((3 * 50) / (4 * 300)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.Ok, HitResult.Great, 312)] // (((3 * 100) / (4 * 300)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.Good, HitResult.Perfect, 535)] // (((3 * 200) / (4 * 350)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.Great, HitResult.Great, 936)] // (((3 * 300) / (4 * 300)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.Perfect, HitResult.Perfect, 936)] // (((3 * 350) / (4 * 350)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.SmallTickMiss, HitResult.SmallTickHit, 0)] // (0 * 1 * 300) * (1 + 0 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 225)] // (((3 * 10) / (4 * 10)) * 1 * 300) * (1 + 0 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] // (0 * 4 * 300) * (1 + 0 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 936)] // (((3 * 50) / (4 * 50)) * 4 * 300) * (1 + 1 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.SmallBonus, HitResult.SmallBonus, 30)] // (0 * 1 * 300) * (1 + 0 / 25) + 3 * 10 (bonus points)
+        [TestCase(ScoringMode.Classic, HitResult.LargeBonus, HitResult.LargeBonus, 150)] // (0 * 1 * 300) * (1 + 0 / 25) * 3 * 50 (bonus points)
         public void TestFourVariousResultsOneMiss(ScoringMode scoringMode, HitResult hitResult, HitResult maxResult, int expectedScore)
         {
             var minResult = new TestJudgement(hitResult).MinResult;
@@ -121,10 +121,10 @@
             Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value, 0.5));
         }

-        [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, 978_571)]
-        [TestCase(ScoringMode.Standardised, HitResult.SmallTickMiss, 914_286)]
-        [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, 279)]
-        [TestCase(ScoringMode.Classic, HitResult.SmallTickMiss, 214)]
+        [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, 978_571)] // (3 * 10 + 100) / (4 * 10 + 100) * 300_000 + (1 / 1) * 700_000
+        [TestCase(ScoringMode.Standardised, HitResult.SmallTickMiss, 914_286)] // (3 * 0 + 100) / (4 * 10 + 100) * 300_000 + (1 / 1) * 700_000
+        [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, 279)] // (((3 * 10 + 100) / (4 * 10 + 100)) * 1 * 300) * (1 + 0 / 25)
+        [TestCase(ScoringMode.Classic, HitResult.SmallTickMiss, 214)] // (((3 * 0 + 100) / (4 * 10 + 100)) * 1 * 300) * (1 + 0 / 25)
         public void TestSmallTicksAccuracy(ScoringMode scoringMode, HitResult hitResult, int expectedScore)
         {
             IEnumerable<HitObject> hitObjects = Enumerable


Write xmldoc for TestFourVariousResultsOneMiss

--- osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs
+++ osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs
@@ -54,6 +54,21 @@
             Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value));
         }

+        /// <summary>
+        /// Test to see that all <see cref="HitResult"/> contribute to score portions in correct amounts.
+        /// </summary>
+        /// <param name="scoringMode">Scoring mode to test</param>
+        /// <param name="hitResult">HitResult that will be applied to HitObjects</param>
+        /// <param name="maxResult">HitResult used for accuracy calcualtion</param>
+        /// <param name="expectedScore">Expected score after 3/4 hitobjects have been hit</param>
+        /// <remarks>
+        /// This test intentionally misses the 3rd hitobject to achieve lower than 75% accuracy and 50% max combo
+        /// expectedScore is calcualted using this algorithm for standardised scoring: 1_000_000 * ((75% * score_per_hitobject / max_per_hitobject * 30%) + (50% * 70%))
+        /// "75% * score_per_hitobject / max_per_hitobject" is the accuracy we would get for hitting 3/4 hitobjects that award "score_per_hitobject / max_per_hitobject" accuracy each hit
+        ///
+        /// expectedScore is calculated using this algorithm for classic scoring: score_per_hitobject / max_per_hitobject * 936
+        /// "936" is simplified from "75% * 4 * 300 * (1 + 1/25)"
+        /// </remarks>
         [TestCase(ScoringMode.Standardised, HitResult.Miss, HitResult.Great, 0)]
         [TestCase(ScoringMode.Standardised, HitResult.Meh, HitResult.Great, 387_500)]
         [TestCase(ScoringMode.Standardised, HitResult.Ok, HitResult.Great, 425_000)]


Remove notification upon copy

Remove notification upon copy

--- osu.Game/Graphics/UserInterface/ExternalLinkButton.cs
+++ osu.Game/Graphics/UserInterface/ExternalLinkButton.cs
@@ -13,8 +13,6 @@
 using osu.Framework.Input.Events;
 using osu.Framework.Localisation;
 using osu.Framework.Platform;
-using osu.Game.Overlays;
-using osu.Game.Overlays.Notifications;
 using osuTK;
 using osuTK.Graphics;

@@ -23,9 +21,6 @@
     public class ExternalLinkButton : CompositeDrawable, IHasTooltip, IHasContextMenu
     {
         public string Link { get; set; }
-
-        [Resolved]
-        private INotificationOverlay notificationOverlay { get; set; }

         private Color4 hoverColour;

@@ -49,15 +44,6 @@
             };
         }

-        private void copyUrl()
-        {
-            host.GetClipboard()?.SetText(Link);
-            notificationOverlay.Post(new SimpleNotification
-            {
-                Text = "Copied URL!"
-            });
-        }
-
         public MenuItem[] ContextMenuItems
         {
             get
@@ -67,7 +53,7 @@
                 if (Link != null)
                 {
                     items.Add(new OsuMenuItem("Open", MenuItemType.Standard, () => host.OpenUrlExternally(Link)));
-                    items.Add(new OsuMenuItem("Copy URL", MenuItemType.Standard, () => copyUrl()));
+                    items.Add(new OsuMenuItem("Copy URL", MenuItemType.Standard, () => host.GetClipboard()?.SetText(Link)));
                 }

                 return items.ToArray();


CI fixes.

CI fixes.

--- osu.Game/Storyboards/Drawables/DrawablesExtensions.cs
+++ osu.Game/Storyboards/Drawables/DrawablesExtensions.cs
@@ -1,4 +1,7 @@
-using osu.Framework.Graphics;
+// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Graphics;
 using osu.Framework.Graphics.Transforms;

 namespace osu.Game.Storyboards.Drawables
@@ -6,7 +9,7 @@
     public static class DrawablesExtensions
     {
         /// <summary>
-        /// Adjusts <see cref="Drawable.BlendingMode"/> after a delay.
+        /// Adjusts <see cref="Drawable.Blending"/> after a delay.
         /// </summary>
         /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns>
         public static TransformSequence<T> TransformBlendingMode<T>(this T drawable, BlendingMode newValue, double delay = 0)


chg monoandroid_tfm from 8.0 to 9.0

chg monoandroid_tfm from 8.0 to 9.0

--- version_stamp/version_stamp.cs
+++ version_stamp/version_stamp.cs
@@ -106,7 +106,7 @@
             f.WriteElementString("depversion_xunit", "2.4.1");
             f.WriteElementString("depversion_xunit_runner_visualstudio", "2.4.1");
             f.WriteElementString("depversion_microsoft_net_test_sdk", "15.0.0");
-            f.WriteElementString("monoandroid_tfm", "monoandroid8.0");
+            f.WriteElementString("monoandroid_tfm", "monoandroid9.0");

             f.WriteEndElement(); // PropertyGroup
             f.WriteEndElement(); // project


[xml] Fixing some really old syntax changes. Really need to institute some more unit testing!

--- packages/Gcc/4.1/Scripts/CCompilerOptionCollection.cs
+++ packages/Gcc/4.1/Scripts/CCompilerOptionCollection.cs
@@ -43,19 +43,19 @@
             switch (enumOption.Value)
             {
                 case EVisibility.Default:
-                    commandLineBuilder.Append("-fvisibility=default ");
+                    commandLineBuilder.Add("-fvisibility=default ");
                     break;

                 case EVisibility.Hidden:
-                    commandLineBuilder.Append("-fvisibility=hidden ");
+                    commandLineBuilder.Add("-fvisibility=hidden ");
                     break;

                 case EVisibility.Internal:
-                    commandLineBuilder.Append("-fvisibility=internal ");
+                    commandLineBuilder.Add("-fvisibility=internal ");
                     break;

                 case EVisibility.Protected:
-                    commandLineBuilder.Append("-fvisibility=protected ");
+                    commandLineBuilder.Add("-fvisibility=protected ");
                     break;

                 default:


Started looking at an issue with the Say( ... ) fade parameter been wrong.

--- plugins/AMPowerShellCmdLets/core.cs
+++ plugins/AMPowerShellCmdLets/core.cs
@@ -56,7 +56,7 @@
       var ipcResponse = Connector.Send(ipcRequest);
       if (null == ipcResponse)
       {
-        throw new Exception("Unable to get the version number of the powershell plugin");
+        throw new Exception("There was a problem sending the 'Say(...) messages over to the monitor.'");
       }
       var i = ipcResponse.Get<int>(0);
       return i == 1;


Register component for AuthInfo

Register component for AuthInfo

--- src/AppHarbor/AppHarborInstaller.cs
+++ src/AppHarbor/AppHarborInstaller.cs
@@ -9,7 +9,13 @@
 	{
 		public void Install(IWindsorContainer container, IConfigurationStore store)
 		{
-			throw new NotImplementedException();
+			container.Register(Component
+				.For<AuthInfo>()
+				.UsingFactoryMethod(x =>
+				{
+					var token = Environment.GetEnvironmentVariable("AppHarborToken", EnvironmentVariableTarget.User);
+					return new AuthInfo { AccessToken = token };
+				}));
 		}
 	}
 }


Remove whitespace

Remove whitespace

--- src/AppHarbor/ConsoleProgressBar.cs
+++ src/AppHarbor/ConsoleProgressBar.cs
@@ -79,7 +79,6 @@
 			}
 		}

-
 		private static void OverwriteConsoleMessage(string message)
 		{
 			Console.CursorLeft = 0;


Don't use LayoutUpdated sender. Fixes #56

--- src/Caliburn.Micro.Platform/View.cs
+++ src/Caliburn.Micro.Platform/View.cs
@@ -180,7 +180,7 @@
 #endif
             onLayoutUpdate = (s, e) => {
                 element.LayoutUpdated -= onLayoutUpdate;
-                handler(s, e);
+                handler(element, e);
             };
             element.LayoutUpdated += onLayoutUpdate;
         }


Fix ContainsCase() so that if 'text' is null, we return false (since
the null string can't contain anything...).

Fixes a NullReferenceException found by	Andrus Moor.

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

--- src/DbLinq/Util/StringExtensions.cs
+++ src/DbLinq/Util/StringExtensions.cs
@@ -69,6 +69,8 @@

         public static bool ContainsCase(this string text, string find, bool ignoreCase)
         {
+            if (text == null)
+                return false;
             var comparison = ignoreCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture;
             var endIndex = text.IndexOf(find, 0, comparison);
             return endIndex >= 0;


Remove outdated todo comment

Remove outdated todo comment

--- src/HBitcoin.Tests/TrackingTests.cs
+++ src/HBitcoin.Tests/TrackingTests.cs
@@ -25,7 +25,6 @@

 			// todo fix default constructor byte serialization in NBitcoin MerkleBlock
 			// todo implement equality comparators for NBitcoin MerkleBlock
-			// todo implement equality comparators for TrackingBlock

 			var block = Network.Main.GetGenesis();
 			var tx = new Transaction(


Missing using fix in release mode

Missing using fix in release mode

--- VLCMediaElement/MediaElement.cs
+++ VLCMediaElement/MediaElement.cs
@@ -1,9 +1,7 @@
 using libVLCX;
 using System;
 using System.Collections.Generic;
-#if DEBUG
 using System.Diagnostics;
-#endif
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;


Improve visual of checkouts list

Improve visual of checkouts list

--- VssSvnConverter/LinksBuilder.cs
+++ VssSvnConverter/LinksBuilder.cs
@@ -58,10 +58,10 @@
 			{
 				foreach (var kvp in coDict.OrderByDescending(kvp => kvp.Key))
 				{
-					tw.WriteLine("{0}", kvp.Key);
+					tw.WriteLine("{0:yyyy-MM-dd} ({1} days ago)", kvp.Key, (int)(DateTime.Now - kvp.Key).TotalDays);
 					foreach (var tuple in kvp.Value)
 					{
-						tw.WriteLine("{0} at {1}", tuple.Item1, tuple.Item2);
+						tw.WriteLine("\t{0} at {1}", tuple.Item1, tuple.Item2);
 					}
 					tw.WriteLine();
 				}


adjust owl slide

adjust owl slide

--- Web/Web/Views/Home/Index.cshtml
+++ Web/Web/Views/Home/Index.cshtml
@@ -13,9 +13,9 @@

-

-
-                <div class="owl-carousel pagination-1 dark-switch" data-pagination="true" data-autoplay="true"
+

+
+

@@ -79,8 +79,7 @@

-

-
+

                            Our Resin8 Advantage
@@ -103,11 +102,13 @@

All of Resin8 Systems have been formulated by Ralph Sacks with time proven materials to withstand the corrosive chemicals that attack resin coatings.

With Ralph's 50-plus years of experience in the Epoxy field, Resin8 can offer his Innovative High Performance Epoxy Systems to—

-
 Breweries. Food and Beverage Plants. Dairies. Pharmaceutical. Meat Packing. Poultry Plants.
 Heavy Industrial. Government. Municipalities. Railcars. Steel I-Beams. Metal Pipes and Tanks. Steel Decking.

+
 Breweries. Food & Beverage Plants. Dairies. Pharmaceutical. Meat Packing. Poultry Plants.
 Heavy Industrial. Government. Municipalities. Railcars. Steel I-Beams. Metal Pipes and Tanks. Steel Decking.

-

-

+

+

+
hover to pause

+

@@ -536,7 +537,7 @@

ResFloor-TL #2000

-
ResFloor-TL30 is a User Friendly, Time Saving Flooring System with a 30-40 Min Pot Life that will Set up for Foot Traffic within 4 Hrs(73ºF)

+
ResFloor-TL is a User Friendly, Time Saving Flooring System with a 30-40 Min Pot Life that will Set up for Foot Traffic within 4 Hrs(73ºF)

Best Uses. Breweries. Food and Beverage Plants. Dairies. Pharmaceutical. Meat Packing. Poultry. Heavy Industrial.


Fixed DisplayConfig request: now all queries use the same request.

--- code/DisplayDeviceManager.cs
+++ code/DisplayDeviceManager.cs
@@ -11,7 +11,7 @@
 	// "GDI": Graphics Device Interface

-	/// ManagedX GDI display device manager.
+	/// ManagedX GDI (Graphics Device Interface) device manager.
 	public static class DisplayDeviceManager
 	{

@@ -21,12 +21,16 @@

 		/// Defines the maximum length, in chars, of a GDI device name.
 		public const int MaxDeviceNameChars = DisplayDeviceBase.MaxDeviceNameChars;
+
+
+		private const QueryDisplayConfigRequest DisplayConfigRequest = QueryDisplayConfigRequest.OnlyActivePaths;
+

 		private static readonly Dictionary<string, DisplayAdapter> adaptersByDeviceName = new Dictionary<string, DisplayAdapter>( MaxAdapterCount );
 		private static string primaryAdapterDeviceName;
 		private static bool isInitialized;
-		private static DisplayConfiguration currentConfiguration;	// not supported on Windows Vista
+		private static DisplayConfiguration currentConfiguration;
 		//private static DisplayConfiguration registryConfiguration;

@@ -68,7 +72,7 @@
 			if( DisplayConfiguration.IsSupported )
 			{
 				if( currentConfiguration == null )
-					currentConfiguration = DisplayConfiguration.Query( QueryDisplayConfigRequest.OnlyActivePaths );
+					currentConfiguration = DisplayConfiguration.Query( DisplayConfigRequest );
 				else
 					currentConfiguration.Refresh();
 			}
@@ -86,23 +90,18 @@
 					adaptersByDeviceName.Remove( s );

 					adapter.OnRemoved();
-					if( adapterRemovedEvent != null )
-						adapterRemovedEvent.Invoke( null, new DisplayDeviceEventArgs( adapter.DeviceIdentifier ) );
+					adapterRemovedEvent( null, new DisplayDeviceEventArgs( adapter.DeviceIdentifier ) );
 				}
 			}

 			if( addedAdapters.Count > 0 )
 			{
 				var adapterAddedEvent = AdapterAdded;
-				if( adapterAddedEvent != null )
-				{
-					while( addedAdapters.Count > 0 )
-					{
-						adapterAddedEvent.Invoke( null, new DisplayDeviceEventArgs( addedAdapters[ 0 ] ) );
-						addedAdapters.RemoveAt( 0 );
-					}
-				}
-				addedAdapters.Clear();
+				while( addedAdapters.Count > 0 )
+				{
+					adapterAddedEvent( null, new DisplayDeviceEventArgs( addedAdapters[ 0 ] ) );
+					addedAdapters.RemoveAt( 0 );
+				}
 			}

@@ -116,11 +115,7 @@

 			if( primaryAdapterChanged )
-			{
-				var primaryAdapterChangedEvent = PrimaryAdapterChanged;
-				if( primaryAdapterChangedEvent != null )
-					primaryAdapterChangedEvent.Invoke( null, EventArgs.Empty );
-			}
+				PrimaryAdapterChanged( null, EventArgs.Empty );

 			isInitialized = true;
 		}
@@ -129,7 +124,6 @@
 		#region Display adapters

 		/// Gets the primary display adapter.
-		///// <exception cref="InvalidOperationException"/>
 		public static DisplayAdapter PrimaryAdapter
 		{
 			get
@@ -144,7 +138,6 @@
 						return adapter;
 				}
 				return null;
-				//throw new InvalidOperationException( "Failed to retrieve primary display adapter." );
 			}
 		}

@@ -336,7 +329,7 @@
 			if( DisplayConfiguration.IsSupported )
 			{
 				if( currentConfiguration == null )
-					currentConfiguration = DisplayConfiguration.Query( QueryDisplayConfigRequest.DatabaseCurrent );
+					currentConfiguration = DisplayConfiguration.Query( DisplayConfigRequest );
 				else
 					currentConfiguration.Refresh();

@@ -372,7 +365,7 @@
 			if( DisplayConfiguration.IsSupported )
 			{
 				if( currentConfiguration == null )
-					currentConfiguration = DisplayConfiguration.Query( QueryDisplayConfigRequest.DatabaseCurrent );
+					currentConfiguration = DisplayConfiguration.Query( DisplayConfigRequest );
 				else
 					currentConfiguration.Refresh();


little change in splash screen text

little change in splash screen text

--- src/LookingGlass.View/ViewSplash.cs
+++ src/LookingGlass.View/ViewSplash.cs
@@ -20,8 +20,8 @@

             string[] ContentLines = new String[30];
             int line = 0;
-            ContentLines[line++] = LookingGlassBase.ApplicationName + "  " + LookingGlassBase.ApplicationVersion;
-            ContentLines[line++] = "http://lookingglassviewer.org/";
+            ContentLines[line++] = LookingGlassBase.ApplicationName + "  " + LookingGlassBase.ApplicationVersion
+                + "        http://lookingglassviewer.org/";
             ContentLines[line++] = "";
             ContentLines[line++] = "Copyright (c) 2008-2010 Robert Adams (LookingGlass)";
             ContentLines[line++] = "Copyright (c) 2000-2006 Torus Knot Software Ltd (Ogre)";


:+1: LuryObjectが送出する例外の種類を変更

:+1: LuryObjectが送出する例外の種類を変更

--- src/Lury.Core/Runtime/LuryObject.cs
+++ src/Lury.Core/Runtime/LuryObject.cs
@@ -108,7 +108,7 @@
                 if (targetObject.BaseObject != null)
                     targetObject = targetObject.BaseObject;
                 else
-                    throw new NotDefinedException(target, ownerName);
+                    throw new AttributeNotDefinedException(target, ownerName);
             }
         }


Various fixes

Various fixes

--- src/Miningcore/Native/LibRandomX.cs
+++ src/Miningcore/Native/LibRandomX.cs
@@ -161,8 +161,8 @@

         private class RxVm : IDisposable
         {
+            private IntPtr cache = IntPtr.Zero;
             private IntPtr vm = IntPtr.Zero;
-            private IntPtr cache = IntPtr.Zero;
             private RxDataSet ds;
             private randomx_flags flags;
             private DateTime lastAccess;
@@ -193,6 +193,7 @@
                 lastAccess = DateTime.Now;

                 flags = randomx_get_flags();
+
                 cache = randomx_alloc_cache(flags);

                 fixed(byte* key_ptr = key)
@@ -208,8 +209,6 @@

             public void CalculateHash(ReadOnlySpan<byte> data, Span<byte> result)
             {
-                Contract.Requires<ArgumentException>(result.Length >= 32, $"{nameof(result)} must be greater or equal 32 bytes");
-
                 fixed (byte* input = data)
                 {
                     fixed (byte* output = result)
@@ -233,7 +232,7 @@
                 if(!vms.TryGetValue(keyString, out var vm))
                 {
                     var start = DateTime.Now;
-                    logger.Info(()=> $"Creating VM for seed hash {keyString}. This may take a while ...");
+                    logger.Info(()=> $"Creating VM for seed hash {keyString} ...");

                     vm = new RxVm();
                     vm.Init(key);
@@ -243,13 +242,7 @@
                     vms[keyString] = vm;
                 }

-                fixed (byte* input = data)
-                {
-                    fixed (byte* output = result)
-                    {
-                        randomx_calculate_hash(vm.Handle, input, data.Length, output);
-                    }
-                }
+                vm.CalculateHash(data, result);
             }
         }
     }


Marked property as obsolete

Marked property as obsolete

--- RiotNet/Models/ChampionMastery.cs
+++ RiotNet/Models/ChampionMastery.cs
@@ -48,6 +48,7 @@
         /// <summary>
         /// Gets or sets the highest grade (e.g. B+, S-, etc.) that the player has earned for this champion in the current season.
         /// </summary>
+        [Obsolete("This property is no longer returned by the Riot Games API. Do not use it.")]
         public string HighestGrade { get; set; }

         /// <summary>


Added Google authentication.

Added Google authentication.

--- RiskApp/App_Start/Startup.Auth.cs
+++ RiskApp/App_Start/Startup.Auth.cs
@@ -58,11 +58,11 @@
             //   appId: "",
             //   appSecret: "");

-            //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
-            //{
-            //    ClientId = "",
-            //    ClientSecret = ""
-            //});
+            app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
+            {
+                ClientId = "260893344565-9899gcd8ttia3peg6s4f8rb0s5l5ilad.apps.googleusercontent.com",
+                ClientSecret = "Jm5xe1DCsyN-XVQSqppE48XH"
+            });
         }
     }
 }


Fix inverted logic in MySqlBulkCopy.

Fix inverted logic in MySqlBulkCopy.

This appears to be a typo introduced in the original version in dd853ff30cd7a894d89e473e97506c5a11cff20a.

--- src/MySqlConnector/MySqlBulkCopy.cs
+++ src/MySqlConnector/MySqlBulkCopy.cs
@@ -543,7 +543,7 @@
 						connection.GuidFormat == MySqlGuidFormat.LittleEndianBinary16)
 					{
 						var bytes = guidValue.ToByteArray();
-						if (connection.GuidFormat == MySqlGuidFormat.LittleEndianBinary16)
+						if (connection.GuidFormat != MySqlGuidFormat.LittleEndianBinary16)
 						{
 							Utility.SwapBytes(bytes, 0, 3);
 							Utility.SwapBytes(bytes, 1, 2);


SyncBlocks have thread affinity. That's stupid. Fix it.

--- src/Shimmer.Client/UpdateManager.cs
+++ src/Shimmer.Client/UpdateManager.cs
@@ -7,12 +7,14 @@
 using System.IO.Abstractions;
 using System.Linq;
 using System.Reactive;
+using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Reactive.Subjects;
 using System.Reflection;
 using System.Text;
 using System.Text.RegularExpressions;
+using System.Threading;
 using NuGet;
 using ReactiveUI;
 using Shimmer.Core;
@@ -28,7 +30,7 @@
 namespace Shimmer.Client
 {
     [Serializable]
-    public class UpdateManager : IEnableLogger, IUpdateManager
+    public sealed class UpdateManager : IEnableLogger, IUpdateManager, IDisposable
     {
         readonly IFileSystemFactory fileSystem;
         readonly string rootAppDirectory;
@@ -36,6 +38,7 @@
         readonly IUrlDownloader urlDownloader;
         readonly string updateUrlOrPath;
         readonly FrameworkVersion appFrameworkVersion;
+        EventLoopScheduler lockScheduler = new EventLoopScheduler();

         bool hasUpdateLock;

@@ -179,11 +182,11 @@
         public IDisposable AcquireUpdateLock()
         {
             var key = Utility.CalculateStreamSHA1(new MemoryStream(Encoding.UTF8.GetBytes(rootAppDirectory)));
-            var ret = new SingleGlobalInstance(key, 500);
+            var ret = Observable.Start(() => new SingleGlobalInstance(key, 500), lockScheduler).First();

             hasUpdateLock = true;
             return Disposable.Create(() => {
-                ret.Dispose();
+                Observable.Start(ret.Dispose, lockScheduler).First();
                 hasUpdateLock = false;
             });
         }
@@ -206,6 +209,14 @@
                 cleanUpOldVersions(new Version(255, 255, 255, 255));
                 Utility.DeleteDirectoryAtNextReboot(rootAppDirectory);
             }, RxApp.TaskpoolScheduler);
+        }
+
+        public void Dispose()
+        {
+            var disp = Interlocked.Exchange(ref lockScheduler, null);
+            if (disp != null) {
+                disp.Dispose();
+            }
         }

         IObservable<TRet> checkForLock<TRet>()


Changing logging level

Changing logging level

--- src/TfsAdvanced.Updater/GetAsync.cs
+++ src/TfsAdvanced.Updater/GetAsync.cs
@@ -38,7 +38,7 @@
                 var log = $"[{url}]  ";
                 DateTime start = DateTime.Now;
                 var response = await requestData.HttpClient.GetAsync(url);
-                log += "Connetion Time: " + (DateTime.Now - start).TotalMilliseconds;
+                log += "Connection Time: " + (DateTime.Now - start).TotalMilliseconds;
                 if (!response.IsSuccessStatusCode)
                     throw new BadRequestException(url, response.StatusCode);

@@ -56,15 +56,17 @@
                 log += " List Time: " + (DateTime.Now - start).TotalMilliseconds;

                 if (logger != null)
-                    logger.LogWarning(log);
+                    logger.LogDebug(log);
                 return list;
             }
-            catch (BadRequestException)
+            catch (BadRequestException ex)
             {
+                logger.LogError(ex, $"Bad Request to {url}");
                 throw;
             }
             catch (Exception ex)
             {
+                logger.LogError(ex, $"Error making request to {url}");
                 return new List<T>();
             }
         }


Using factory...

Using factory...

git-svn-id: fb418c05146d7d73e8e43178c8c6500e5efdaad4@1284 90d2b0b2-0e11-ba47-89f1-85e69862abc4

--- src/Uncas.Core/Data/OleDbContext.cs
+++ src/Uncas.Core/Data/OleDbContext.cs
@@ -10,8 +10,11 @@
     {
         private readonly string _connectionString;

+        private readonly DbProviderFactory _factory;
+
         public OleDbContext(string connectionString)
         {
+            _factory = OleDbFactory.Instance;
             _connectionString = connectionString;
         }

@@ -20,28 +23,36 @@
         {
             DataTable dt = new DataTable("uncas-data");
             dt.Locale = CultureInfo.InvariantCulture;
-            using (OleDbConnection connection = new OleDbConnection(_connectionString))
+            using (DbConnection connection = _factory.CreateConnection())
             {
-                using (OleDbCommand command = new OleDbCommand(commandText, connection))
+                connection.ConnectionString = _connectionString;
+                using (DbCommand command = _factory.CreateCommand())
                 {
+                    command.CommandText = commandText;
+                    command.Connection = connection;
                     foreach (DbParameter parameter in parameters)
                         command.Parameters.Add(parameter);
-                    using (DbDataAdapter adapter = new OleDbDataAdapter(command))
+                    using (DbDataAdapter adapter = _factory.CreateDataAdapter())
                     {
+                        adapter.SelectCommand = command;
                         connection.Open();
                         adapter.Fill(dt);
                         connection.Close();
                     }
                 }
             }
+
             return dt;
         }

         public DbDataReader GetReader(string commandText,
             params DbParameter[] parameters)
         {
-            OleDbConnection connection = new OleDbConnection(_connectionString);
-            DbCommand command = new OleDbCommand(commandText, connection);
+            DbConnection connection = _factory.CreateConnection();
+            connection.ConnectionString = _connectionString;
+            DbCommand command = _factory.CreateCommand();
+            command.CommandText = commandText;
+            command.Connection = connection;
             foreach (DbParameter parameter in parameters)
                 command.Parameters.Add(parameter);
             connection.Open();
@@ -52,10 +63,13 @@
             params DbParameter[] parameters)
         {
             int iOut = 0;
-            using (OleDbConnection connection = new OleDbConnection(_connectionString))
+            using (DbConnection connection = _factory.CreateConnection())
             {
-                using (DbCommand command = new OleDbCommand(commandText, connection))
+                connection.ConnectionString = _connectionString;
+                using (DbCommand command = _factory.CreateCommand())
                 {
+                    command.CommandText = commandText;
+                    command.Connection = connection;
                     foreach (DbParameter parameter in parameters)
                         command.Parameters.Add(parameter);
                     connection.Open();
@@ -75,12 +89,13 @@
         public T GetScalar<T>(string commandText,
             params DbParameter[] parameters)
         {
-            using (OleDbConnection connection =
-                new OleDbConnection(_connectionString))
+            using (DbConnection connection =_factory.CreateConnection())
             {
-                using (DbCommand command =
-                    new OleDbCommand(commandText, connection))
+                connection.ConnectionString = _connectionString;
+                using (DbCommand command =_factory.CreateCommand())
                 {
+                    command.CommandText= commandText;
+                    command.Connection = connection;
                     foreach (DbParameter parameter in parameters)
                         command.Parameters.Add(parameter);
                     connection.Open();


sync

sync

git-svn-id: 57e2a4f375ce32c9c82471a795ad1c23acd8087e@233 ea3e6beb-b7ab-da11-bdaa-00e0814018bc

--- SCSharp/SCSharp.Gui/GameScreen.cs
+++ SCSharp/SCSharp.Gui/GameScreen.cs
@@ -228,8 +228,8 @@

 			// load the targeting cursors
 			string[] targetcursornames = new string[] {
-				"cursor\\TargG.grp"
-				"cursor\\TargY.grp"
+				"cursor\\TargG.grp",
+				"cursor\\TargY.grp",
 				"cursor\\TargR.grp"
 			};
 			TargetCursors = new CursorAnimator [targetcursornames.Length];
@@ -261,15 +261,20 @@

 		bool buttonDownInMinimap;

+		void Recenter (int x, int y)
+		{
+			topleft_x = x - Game.SCREEN_RES_X / 2;
+			topleft_y = y - Game.SCREEN_RES_Y / 2;
+
+			ClipTopLeft ();
+		}
+
 		void RecenterFromMinimap (int x, int y)
 		{
 			int map_x = (int)((float)(x - MINIMAP_X) / MINIMAP_WIDTH * map_surf.Width);
 			int map_y = (int)((float)(y - MINIMAP_Y) / MINIMAP_HEIGHT * map_surf.Height);

-			topleft_x = map_x - Game.SCREEN_RES_X / 2;
-			topleft_y = map_y - Game.SCREEN_RES_Y / 2;
-
-			ClipTopLeft ();
+			Recenter (map_x, map_y);
 		}

 		public override void MouseButtonDown (MouseButtonEventArgs args)
@@ -421,6 +426,9 @@

 				sprite.RunAnimation (AnimationType.Init);
 			}
+
+			/* for now assume the player is at startLocations[0], and center the view there */
+			Recenter (startLocations[0].x, startLocations[0].y);
 		}
 	}
 }


WzLib: Fix legal node name regex

WzLib: Fix legal node name regex

--- WzComparerR2.WzLib/Wz_Crypto.cs
+++ WzComparerR2.WzLib/Wz_Crypto.cs
@@ -157,7 +157,7 @@

         private bool IsLegalNodeName(string nodeName)
         {
-            return nodeName.EndsWith(".img") || Regex.IsMatch(nodeName, @"^[A-Za-z-9_]+$");
+            return nodeName.EndsWith(".img") || nodeName.EndsWith(".lua") || Regex.IsMatch(nodeName, @"^[A-Za-z0-9_]+$");
         }

         static readonly byte[] iv_gms = { 0x4d, 0x23, 0xc7, 0x2b };


Update Index.cshtml

Update Index.cshtml

--- webapp/src/webapp/Views/Home/Index.cshtml
+++ webapp/src/webapp/Views/Home/Index.cshtml
@@ -4,7 +4,6 @@
     <title>webapp</title>
     <base href="~/">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="stylesheet" href="node_modules/material-design-lite/dist/material.css" />
     <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
     <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,100" />
     <link rel="stylesheet" href="styles.css" />
@@ -20,4 +19,4 @@

     <app-root>Loading...</app-root>

-+


Update SceneSwitcher.cs

Update SceneSwitcher.cs

Small word/grammar changes in comments.

--- SceneTransitions/SceneSwitcher.cs
+++ SceneTransitions/SceneSwitcher.cs
@@ -10,11 +10,11 @@
 {
     /// <summary>
     /// This static class provides functions related to scenes, such as switching,
-    /// dispos then switch, and scene reloading.
+    /// dispose then switch, and scene reloading.
     /// </summary>
     public static class SceneSwitcher
     {
-        // We are  going to use ContentRefs instead of using Scene directly
+        // We are going to use ContentRefs instead of using Scene Resources directly

         /// <summary>
         /// Function to switch to another scene.


不要な改行を削除

不要な改行を削除

--- SetupCustomAction/CustomAction.cs
+++ SetupCustomAction/CustomAction.cs
@@ -19,7 +19,6 @@
             {
                 throw new InstallException();
             }
-
         }

         public override void Uninstall(IDictionary savedState)
@@ -39,7 +38,6 @@
                     //throw new InstallException();
                 }
             }
-
         }

         public override void Commit(IDictionary savedState)


Fix mistype

Fix mistype

--- src/WebSite/Views/Home/Index.cshtml
+++ src/WebSite/Views/Home/Index.cshtml
@@ -23,7 +23,7 @@

Welcome to the Developers Digest!

-
All news and event will be here!

+
All news and events will be here!

                     Project supported by .NET Core Ukrainian User Group,  Microsoft Azure Ukraine User Group and Xamarin Ukraine User Group !


JimEvans: Fixing .NET bindings for IE driver so that native code P/Invoke expects CDecl calling convention instead of StdCall. Fixes issue #2356

r13644

--- dotnet/src/WebDriver/IE/InternetExplorerDriverServer.cs
+++ dotnet/src/WebDriver/IE/InternetExplorerDriverServer.cs
@@ -20,6 +20,7 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Runtime.InteropServices;
 using System.Security.Permissions;
 using System.Text;
 using OpenQA.Selenium.Internal;
@@ -61,14 +62,19 @@
         }

         #region Private delegates
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate IntPtr StartServerFunction(int port);

+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate void StopServerFunction(IntPtr serverHandle);

+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate int GetServerSessionCountFunction();

+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate int GetServerPortFunction();
-
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate bool ServerIsRunningFunction();
         #endregion


remove empty lines

remove empty lines

--- src/build.cake
+++ src/build.cake
@@ -104,7 +104,6 @@
 // The default task to run if none is explicitly specified. In this case, we want
 // to run everything starting from Clean, all the way up to Pack.

-
 Task("NuGet-Push")
     .IsDependentOn("Pack")
     .Does(() =>
@@ -133,8 +132,6 @@

 });

-
-
 Task("Default")
     .IsDependentOn("Pack");
 // Executes the task specified in the target argument.


Disabled truncation of log values

Disabled truncation of log values

--- Source/NWheels/Logging/LogNode.cs
+++ Source/NWheels/Logging/LogNode.cs
@@ -270,7 +270,7 @@
         public static string FormatNameValuePair(string name, string value)
         {
             name = name.TruncateAt(50);
-            value = (value != null ? value.TruncateAt(50).Replace('"', '\'') : "null");
+            value = (value != null ? value./*TruncateAt(1024).*/Replace('"', '\'') : "null");

             if ( value.Any(c => char.IsWhiteSpace(c) || c == '=') )
             {


CI: updated AssemblyInfo version to 2.6.106.1

git-svn-id: 7f05ad86c4f4f5ca50611136d23b835364929451@393 b33fba48-7441-0410-8d5c-f397f7ceaa6c

--- Source/Properties/AssemblyInfo.cs
+++ Source/Properties/AssemblyInfo.cs
@@ -7,7 +7,7 @@
 [assembly: AssemblyProduct("Moq")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("2.6.105.2")]
+[assembly: AssemblyVersion("2.6.106.1")]
 [assembly: AssemblyFileVersion("2.6.0.0")]

 [assembly: InternalsVisibleTo("Moq.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009f7a95086500f8f66d892174803850fed9c22225c2ccfff21f39c8af8abfa5415b1664efd0d8e0a6f7f2513b1c11659bd84723dc7900c3d481b833a73a2bcf1ed94c16c4be64d54352c86956c89930444e9ac15124d3693e3f029818e8410f167399d6b995324b635e95353ba97bfab856abbaeb9b40c9b160070c6325e22ddc")]


Version updated

Version updated

--- Source/Properties/AssemblyInfo.cs
+++ Source/Properties/AssemblyInfo.cs
@@ -12,5 +12,5 @@
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: Guid("f3e16ed9-dbf7-4e7b-b04b-9b24b11891d3")]
-[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyVersion("1.3.1.0")]


Expose Exit()

Expose Exit()

--- osu.Framework/Screens/IScreen.cs
+++ osu.Framework/Screens/IScreen.cs
@@ -74,6 +74,14 @@
         public void Push(IScreen screen)
         {
             Push(null, screen);
+        }
+
+        /// <summary>
+        /// Exits from the current <see cref="IScreen"/>.
+        /// </summary>
+        public void Exit()
+        {
+            Exit(CurrentScreen);
         }

         internal void Push(IScreen source, IScreen newScreen)


Allow ChatOverlay resize only if it dragged by the tabs area only

--- osu.Game/Overlays/ChatOverlay.cs
+++ osu.Game/Overlays/ChatOverlay.cs
@@ -52,6 +52,7 @@
         private readonly ChatTabControl channelTabs;

         private readonly Container chatContainer;
+        private readonly Container tabsArea;
         private readonly Box chatBackground;
         private readonly Box tabBackground;

@@ -144,7 +145,7 @@
                                 loading = new LoadingAnimation(),
                             }
                         },
-                        new Container
+                        tabsArea = new Container
                         {
                             Name = @"tabs area",
                             RelativeSizeAxes = Axes.X,
@@ -191,9 +192,12 @@
         }

         private double startDragChatHeight;
+        private bool canBeDragged;

         protected override bool OnDragStart(InputState state)
         {
+            canBeDragged = tabsArea.IsHovered;
+
             if (!channelTabs.IsHovered)
                 return base.OnDragStart(state);

@@ -203,10 +207,21 @@

         protected override bool OnDrag(InputState state)
         {
-            Trace.Assert(state.Mouse.PositionMouseDown != null);
-
-            chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
-            return base.OnDrag(state);
+            if (canBeDragged)
+            {
+                Trace.Assert(state.Mouse.PositionMouseDown != null);
+
+                chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
+                return base.OnDrag(state);
+            }
+
+            return true;
+        }
+
+        protected override bool OnDragEnd(InputState state)
+        {
+            canBeDragged = false;
+            return base.OnDragEnd(state);
         }

         public void APIStateChanged(APIAccess api, APIState state)


Prevent another instance from starting to avoid overwriting files to be created

--- Source/SnowyImageCopy/App.xaml.cs
+++ Source/SnowyImageCopy/App.xaml.cs
@@ -4,6 +4,7 @@
 using System.Data;
 using System.Diagnostics;
 using System.Linq;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
@@ -35,6 +36,12 @@
 				return;
 			}

+			if (!TryCreateSemaphore(SnowyImageCopy.Properties.Settings.Default.AppId))
+			{
+				this.Shutdown(0);
+				return;
+			}
+
 			Settings.Current.Start();
 			ResourceService.Current.ChangeCulture(Settings.Current.CultureName);

@@ -45,9 +52,27 @@
 		protected override void OnExit(ExitEventArgs e)
 		{
 			Settings.Current.Stop();
+			CloseSemaphore();

 			base.OnExit(e);
 		}
+
+		#region Semaphore
+
+		private Semaphore _semaphore;
+
+		private bool TryCreateSemaphore(string name)
+		{
+			if (string.IsNullOrEmpty(name))
+				throw new ArgumentNullException(nameof(name));
+
+			_semaphore = new Semaphore(1, 1, name, out bool createdNew);
+			return createdNew;
+		}
+
+		private void CloseSemaphore() => _semaphore?.Dispose();
+
+		#endregion

 		#region Exception


Added another test to the parser unit tests, which checks whether custom duplicate resolution policies work.

--- test/ParserTests.cs
+++ test/ParserTests.cs
@@ -464,10 +464,10 @@
                 .AddNamedArgument<bool>("feature", "f")
                 .AddNamedArgument<int>("number-of-iterations", "i");

-            // Parses the command line arguments with the Unix style argument prefixes
+            // Parses the command line arguments with the switched Unix style argument prefixes
             parsingResults = parser.Parse(new string[] { "test.exe", "-feature", "off", "--i", "987" });

-            // Validates that the parsed values with the Unix style argument prefixes are correct
+            // Validates that the parsed values with the switched Unix style argument prefixes are correct
             Assert.Equal(false, parsingResults.GetParsedValue<bool>("Feature"));
             Assert.Equal(987, parsingResults.GetParsedValue<int>("NumberOfIterations"));
         }
@@ -494,7 +494,7 @@
         }

         /// <summary>
-        /// Tests whether the duplicate resolution policy works, which is used if a single named argument is provided more than once.
+        /// Tests whether the default duplicate resolution policy works, which is used if a single named argument is provided more than once.
         /// </summary>
         [Fact]
         public void TestDuplicateResolutionPolicy()
@@ -512,6 +512,27 @@

             // Validates that the parsed values are correct
             Assert.Equal(16, parsingResults.GetParsedValue<int>("Age"));
+        }
+
+        /// <summary>
+        /// Tests whether a custom duplicate resolution policy works, which is used if a single named argument is provided more than once.
+        /// </summary>
+        [Fact]
+        public void TestCustomDuplicateResolutionPolicy()
+        {
+            // Sets up the parser
+            Parser parser = new Parser(new ParserOptions
+            {
+                ArgumentPrefix = "--",
+                ArgumentAliasPrefix = "-"
+            });
+            parser.AddNamedArgument<int>("add", "a", "Add", "Adds numbers together", 0, (a, b) => a + b);
+
+            // Parses the command line arguments
+            ParsingResults parsingResults = parser.Parse(new string[] { "test.exe", "--add", "1", "-a", "2", "--add", "3" });
+
+            // Validates that the parsed values are correct
+            Assert.Equal(6, parsingResults.GetParsedValue<int>("Add"));
         }

         /// <summary>


POI：Avoid NPE in cleanup if NPOIFSFileSystem is opened on a locked File under Windows, and add a note on Java 7 possible cleanup #58098

--- main/POIFS/FileSystem/NPOIFSFileSystem.cs
+++ main/POIFS/FileSystem/NPOIFSFileSystem.cs
@@ -216,22 +216,22 @@
             }
             catch (IOException e)
             {
-                if (closeChannelOnError)
-                {
-                    if (channel != null)
-                        channel.Close();
+                if (closeChannelOnError && channel != null)
+                {
+                    channel.Close();
+                    channel = null;
                 }
                 throw e;
             }
-            catch (Exception e)
+            catch (RuntimeException e)
             {
                 // Comes from Iterators etc.
                 // TODO Decide if we can handle these better whilst
                 //  still sticking to the iterator contract
-                if (closeChannelOnError)
-                {
-                    if (channel != null)
+                if (closeChannelOnError && channel != null)
+                {
                     channel.Close();
+                    channel = null;
                 }
                 throw e;
             }


Improvement: Break parameter for inner method dump functions

git-svn-id: a19970c34a6d245b7676a95e088c32601af4e48b@4781 c0adb3ac-85ad-b347-9a16-a660ac379d24


- Updated the PointForceController to set the controller to track the planetoid (even the planetoid doesn't currently move).

--- modules/PointForceControllerToy/1/main.cs
+++ modules/PointForceControllerToy/1/main.cs
@@ -112,6 +112,9 @@

 function PointForceControllerToy::createPlanetoid( %this )
 {
+    // Choose a position for the planetoid.
+    %position = 0;
+
     if ( PointForceControllerToy.showPlanetoid )
     {
         // Create the planetoid.
@@ -119,7 +122,7 @@
         {
             class = "Planetoid";
         };
-        //%object.BodyType = static;
+        %object.Position = %position;
         %object.Size = PointForceControllerToy.planetoidSize;
         %object.Image = "ToyAssets:Planetoid";
         %object.AngularVelocity = -5;
@@ -132,6 +135,7 @@
     // Create planetoid bubble.
     %player = new ParticlePlayer();
     %player.BodyType = static;
+    %player.Position = %position;
     %player.Particle = "ToyAssets:ForceBubble";
     %player.SceneLayer = 0;
     SandboxScene.add( %player );
@@ -145,6 +149,11 @@
     %controller.LinearDrag = PointForceControllerToy.controllerLinearDrag;
     %controller.AngularDrag = PointForceControllerToy.controllerAngularDrag;
     SandboxScene.Controllers.add( %controller );
+
+    if ( isObject(%object) )
+        %controller.setTrackedObject( %object );
+    else
+        %controller.Position = %position;

     // This is so we can reference it in the toy, no other reason.
     PointForceControllerToy.Controller = %controller;


POI：bug 59383: getFormat should cache data formatter (fix from Nick C), accidentally deleted in bug 58532 r1710407.

--- main/SS/UserModel/DataFormatter.cs
+++ main/SS/UserModel/DataFormatter.cs
@@ -346,7 +346,7 @@

             // Build a formatter, and cache it
             format = CreateFormat(cellValue, formatIndex, formatStr);
-            //formats[formatStr] = format;
+            formats[formatStr] = format;
             return format;
         }


Remove unnecessary override

Remove unnecessary override

--- osu.Framework/Graphics/UserInterface/BasicTabControl.cs
+++ osu.Framework/Graphics/UserInterface/BasicTabControl.cs
@@ -17,8 +17,6 @@
         public class BasicTabItem : TabItem<T>
         {
             private readonly SpriteText text;
-
-            public override bool IsRemovable => true;

             public BasicTabItem(T value)
                 : base(value)


More simplifies

More simplifies

--- osu.Game.Tests/Visual/Gameplay/TestSceneBreakOverlay.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneBreakOverlay.cs
@@ -21,7 +21,7 @@
         };

         private readonly BreakOverlay breakOverlay, manualBreakOverlay;
-        private readonly ManualClock manualClock = new ManualClock();
+        private readonly ManualClock manualClock;

         private readonly IReadOnlyList<BreakPeriod> testBreaks = new List<BreakPeriod>
         {
@@ -43,7 +43,7 @@
             Add(manualBreakOverlay = new BreakOverlay(true)
             {
                 Alpha = 0,
-                Clock = new FramedClock(manualClock),
+                Clock = new FramedClock(manualClock = new ManualClock()),
             });
         }

@@ -94,8 +94,7 @@
             loadClockStep(true);
             loadBreaksStep("multiple breaks", testBreaks);

-            var b = testBreaks.Last();
-            addBreakSeeks(b, false);
+            addBreakSeeks(testBreaks.Last(), false);
         }

         private void addShowBreakStep(double seconds)


Load seasonal backgrounds according to setting

--- osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs
+++ osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs
@@ -106,6 +106,18 @@
             else
                 newBackground = new Background(backgroundName);

+            switch (showSeasonalBackgrounds.Value)
+            {
+                case SeasonalBackgrounds.Sometimes:
+                    if (RNG.NextBool())
+                        goto case SeasonalBackgrounds.Always;
+                    break;
+
+                case SeasonalBackgrounds.Always:
+                    newBackground = seasonalBackgroundLoader.LoadBackground() ?? newBackground;
+                    break;
+            }
+
             newBackground.Depth = currentDisplay;

             return newBackground;


Fixed screenName max length.

Fixed screenName max length.

--- parts/0000-core/Assets/Vendor/GoogleAnalytics/Client.cs
+++ parts/0000-core/Assets/Vendor/GoogleAnalytics/Client.cs
@@ -229,7 +229,7 @@
       f.AddField("an", appName);
       f.AddField("av", appVersion);
       f.AddField("sr", screenResolution);
-      f.add("screenName", screenName, "cd", 1500);
+      f.add("screenName", screenName, "cd", 2048);
       return f;
     }


Switch to autoAcking

Switch to autoAcking

--- src/Aggregates.NET.Consumer/Internal/EventSubscriber.cs
+++ src/Aggregates.NET.Consumer/Internal/EventSubscriber.cs
@@ -46,11 +46,7 @@
         public static bool Live { get; set; }

         private readonly List<Thread> _eventThreads;
-
-        private readonly object _acknowledgedLock = new object();
-        private readonly Dictionary<int, List<ResolvedEvent>> _toBeAcknowledged = new Dictionary<int, List<ResolvedEvent>>();
-        private Timer _acknowledger;
-
+
         private string _endpoint;
         private int _readsize;
         private bool _extraStats;
@@ -79,37 +75,7 @@
                 Binder = new EventSerializationBinder(mapper),
                 ContractResolver = new EventContractResolver(mapper)
             };
-
-            _acknowledger = new Timer(_ =>
-            {
-                if (!ProcessingLive) return;
-
-                for (var i = 0; i < _subscriptions.Count(); i++)
-                {
-
-                    List<ResolvedEvent> willAcknowledge;
-                    lock (_acknowledgedLock)
-                    {
-                        if (_toBeAcknowledged[i].Count == 0) return;
-
-                        willAcknowledge = _toBeAcknowledged[i];
-                        _toBeAcknowledged[i] = new List<ResolvedEvent>();
-                    }
-
-
-                    Acknowledging.Update(willAcknowledge.Count);
-                    Logger.Write(LogLevel.Info, () => $"Acknowledging {willAcknowledge.Count} events");
-
-                    var page = 0;
-                    while (page < willAcknowledge.Count)
-                    {
-                        var working = willAcknowledge.Skip(page).Take(1000);
-                        _subscriptions[i].Acknowledge(working);
-                        page += 1000;
-                    }
-                }
-            }, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5));
-
+
         }

         public async Task Setup(string endpoint, int readsize, bool extraStats)
@@ -179,12 +145,7 @@

             var cancelSource = new CancellationTokenSource();
-
-            lock (_acknowledgedLock)
-            {
-                for (var i = 0; i < _clients.Count(); i++)
-                    _toBeAcknowledged[i] = new List<ResolvedEvent>();
-            }
+

             Task.Run(async () =>
             {
@@ -207,7 +168,6 @@
                             .WithMaxRetriesOf(0)
                             .WithReadBatchOf(_readsize)
                             .WithLiveBufferSizeOf(_readsize)
-                            .WithMessageTimeoutOf(TimeSpan.FromSeconds(30))
                             .CheckPointAfter(TimeSpan.FromSeconds(2))
                             .ResolveLinkTos()
                             .WithNamedConsumerStrategy(SystemConsumerStrategies.Pinned);
@@ -221,7 +181,12 @@
                     {
                     }

-
+                    // Todo: with autoAck on ES will assume once the event is delivered it will be processed
+                    // This is OK for us because if the event fails it will be moved onto the error queue and doesn't need to be handled by ES
+                    // But in reality if this instance crashes with 100 events waiting in memory those events will be lost.
+                    // So something better is needed.
+                    // The problem comes with manually acking if ES doesn't receive an ACK within a timeframe it retries the message.  When the problem
+                    // is just that the consumers are too backed up.  Causing a double event
                     Logger.Write(LogLevel.Info, () => $"Endpoint [{_endpoint}] connecting to subscription group [{group}] on client {client.Settings.GossipSeeds[0].EndPoint.Address}");
                     subscriptions.Add(
                         client.ConnectToPersistentSubscriptionAsync(stream, group, EventProcessor(count, cancelToken),
@@ -235,7 +200,7 @@
                                 _eventThreads.ForEach(x => x.Join());
                                 _eventThreads.Clear();
                                 Dropped?.Invoke(reason.ToString(), e);
-                            }, bufferSize: _readsize * 10, autoAck: false));
+                            }, bufferSize: _readsize * 10, autoAck: true));
                     count++;
                 }
                 await Task.WhenAll(subscriptions).ConfigureAwait(false);
@@ -311,16 +276,7 @@

                                     }
                                 }
-
-
-                                // If user decided to cancel receive - don't schedule an ACK
-                                if (tokenSource.IsCancellationRequested)
-                                    continue;
-
-                                Logger.Write(LogLevel.Debug,
-                                    () => $"Queueing acknowledge for event {@event.EventId}");
-                                lock (_acknowledgedLock) _toBeAcknowledged[e.Item1].Add(e.Item2);
-                                //subscription.Acknowledge(e);
+
                             }
                         }

@@ -343,10 +299,8 @@
             {
                 var @event = e.Event;
                 if (!@event.IsJson)
-                {
-                    lock (_acknowledgedLock) _toBeAcknowledged[index].Add(e);
                     return;
-                }
+
                 Logger.Write(LogLevel.Debug,
                     () => $"Received event {@event.EventId} type {@event.EventType} stream [{@event.EventStreamId}] number {@event.EventNumber}");


Update comment

Update comment

Co-authored-by: Steven Kirk <ac6a5dd95d6e22de43a0511c4fb069330b6b03f0@users.noreply.github.com>

--- src/Avalonia.Controls/Diagnostics/ToolTipDiagnostics.cs
+++ src/Avalonia.Controls/Diagnostics/ToolTipDiagnostics.cs
@@ -7,6 +7,9 @@
     /// </summary>
     public static class ToolTipDiagnostics
     {
+        /// <summary>
+        /// Provides access to the internal <see cref="ToolTip.ToolTipProperty"/> for use in DevTools.
+        /// </summary>
         public static AvaloniaProperty<ToolTip?> ToolTipProperty = ToolTip.ToolTipProperty;
     }
 }


A little cleanup for parallel builds when creating a workspace (#91)

--- src/Buildalyzer.Workspaces/AnalyzerManagerExtensions.cs
+++ src/Buildalyzer.Workspaces/AnalyzerManagerExtensions.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.CodeAnalysis;

@@ -8,15 +9,18 @@
     {
         public static AdhocWorkspace GetWorkspace(this AnalyzerManager manager)
         {
+            // Run builds in parallel
+            List<AnalyzerResult> results = manager.Projects.Values
+                .AsParallel()
+                .Select(p => p.Build().FirstOrDefault())
+                .Where(x => x != null)
+                .ToList();
+
+            // Add each result to a new workspace
             AdhocWorkspace workspace = new AdhocWorkspace();
-
-            var builds = manager.Projects.Values
-                .AsParallel()
-                .Select(p => p.Build())
-                .ToList();
-            foreach (var build in builds)
+            foreach (AnalyzerResult result in results)
             {
-                build.FirstOrDefault().AddToWorkspace(workspace);
+                result.AddToWorkspace(workspace);
             }
             return workspace;
         }


Set GoDaddy API to max limit

Set GoDaddy API to max limit

--- src/Certify.Providers/DNS/GoDaddy/DnsProviderGoDaddy.cs
+++ src/Certify.Providers/DNS/GoDaddy/DnsProviderGoDaddy.cs
@@ -38,7 +38,7 @@
         private readonly string _authKey;
         private readonly string _authSecret;
         private const string _baseUri = "https://api.godaddy.com/v1/";
-        private const string _listZonesUri = _baseUri + "domains?limit=500";
+        private const string _listZonesUri = _baseUri + "domains?limit=1000";
         private const string _createRecordUri = _baseUri + "domains/{0}/records";
         private const string _listRecordsUri = _baseUri + "domains/{0}/records/{1}";
         private const string _deleteRecordUri = _baseUri + "domains/{0}/records/{1}";


added long runing test

--- src/Cogworks.ExamineFileIndexerTests/ExtractionTests.cs
+++ src/Cogworks.ExamineFileIndexerTests/ExtractionTests.cs
@@ -70,13 +70,17 @@
             return buff;
         }

+
+        /// <summary>
+        /// this test mimics extracting large no of docs we should nto get out of memory exceptions
+        /// this test is long running takes approx 6 mins
+        /// </summary>
+        /// <param name="noOfDocs">no of docs to mimic</param>
         [Test]
-        [TestCase]
-        public void Given_Large_No_Of_Docs_Expect_No_Out_Of_Memory_Exceptions_Thrown()
+        [TestCase(1000)]
+        public void Given_Large_No_Of_Docs_Expect_No_Out_Of_Memory_Exceptions_Thrown(int noOfDocs)
         {
             string pdfFileToTest = Path.Combine(TestContext.CurrentContext.TestDirectory, TestHelper.PdfToTest);
-
-            int noOfDocs = 1000;

             var totalTimer = new Stopwatch();


Added (successful) test for Issue #147

Added (successful) test for Issue #147

--- src/CommandLine.Tests/Unit/Core/InstanceBuilderTests.cs
+++ src/CommandLine.Tests/Unit/Core/InstanceBuilderTests.cs
@@ -670,6 +670,28 @@
         }

         [Theory]
+        [InlineData(new[] { "--stringvalue", "中文" }, "中文")] // Chinese
+        [InlineData(new[] { "--stringvalue=中文" }, "中文")]
+        [InlineData(new[] { "--stringvalue", "日本人" }, "日本人")] // Japanese
+        [InlineData(new[] { "--stringvalue=日本人" }, "日本人")]
+        public void Parse_utf8_string_correcty(string[] arguments, string expected)
+        {
+            // Fixture setup in attributes
+
+            // Exercize system
+            var result = InstanceBuilder.Build(
+                () => new FakeOptions(),
+                arguments,
+                StringComparer.Ordinal,
+                CultureInfo.InvariantCulture);
+
+            // Verify outcome
+            expected.ShouldBeEquivalentTo(result.Value.StringValue);
+
+            // Teardown
+        }
+
+        [Theory]
         [MemberData("RequiredValueStringData")]
         public void Parse_string_scalar_with_required_constraint_as_value(string[] arguments, FakeOptionWithRequiredValue expected)
         {


Add another log message saying no open sessions to check

--- src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs
+++ src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs
@@ -38,6 +38,8 @@
             var results = await _eventRepository.GetOpenSessionsAsync(SystemClock.UtcNow.SubtractMinutes(1), o => o.SnapshotPaging().PageLimit(100)).AnyContext();
             int sessionsClosed = 0;
             int totalSessions = 0;
+            if (results.Documents.Count == 0)
+                _logger.LogInformation("No open sessions to check.");

             while (results.Documents.Count > 0 && !context.CancellationToken.IsCancellationRequested) {
                 var inactivePeriodUtc = SystemClock.UtcNow.Subtract(DefaultInactivePeriod);


Revert "Revert "Set Jobs base folder to be appcontext.base folder""

This reverts commit 3eaa167f25211419129cf151899b073de6e42fcc.

--- src/Exceptionless.Insulation/Jobs/JobServiceProvider.cs
+++ src/Exceptionless.Insulation/Jobs/JobServiceProvider.cs
@@ -22,7 +22,7 @@
             if (String.IsNullOrWhiteSpace(environment))
                 environment = "Production";

-            string currentDirectory = Directory.GetCurrentDirectory();
+            string currentDirectory = AppContext.BaseDirectory;
             var config = new ConfigurationBuilder()
                 .SetBasePath(currentDirectory)
                 .AddYamlFile("appsettings.yml", optional: true, reloadOnChange: true)


List remotes in settings view.

List remotes in settings view.

--- src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Window.cs
+++ src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Window.cs
@@ -148,7 +148,12 @@
 			OneChangedFileLabel = "1 changed file",
 			NoChangedFilesLabel = "No changed files",
 			BasePathLabel = "{0}",
-			NoChangesLabel = "No changes found";
+			NoChangesLabel = "No changes found",
+			RemotesTitle = "Remotes",
+			RemoteNameTitle = "Name",
+			RemoteUserTitle = "User",
+			RemoteHostTitle = "Host",
+			RemoteAccessTitle = "Access";
 		const float
 			NoActiveRepositoryWidth = 200f,
 			BrowseFolderButtonHorizontalPadding = -4f,
@@ -164,7 +169,12 @@
 			TreeIndentation = 18f,
 			CommitIconSize = 16f,
 			CommitIconHorizontalPadding = -5f,
-			CommitFilePrefixSpacing = 2;
+			CommitFilePrefixSpacing = 2,
+			RemotesTotalHorizontalMargin = 37,
+			RemotesNameRatio = 0.2f,
+			RemotesUserRatio = 0.2f,
+			RemotesHostRation = 0.5f,
+			RemotesAccessRatio = 0.1f;
 		const int
 			HistoryExtraItemCount = 10;

@@ -368,6 +378,7 @@
 		[SerializeField] List<GitLogEntry> history = new List<GitLogEntry>();
 		[SerializeField] bool historyLocked = true;
 		[SerializeField] Object historyTarget = null;
+		[SerializeField] List<GitRemote> remotes = new List<GitRemote>();

 		bool lockCommit = true;
@@ -384,12 +395,14 @@
 		{
 			GitStatusTask.RegisterCallback(OnStatusUpdate);
 			GitLogTask.RegisterCallback(OnLogUpdate);
+			GitListRemotesTask.RegisterCallback(OnRemotesUpdate);
 			Refresh();
 		}

 		void OnDisable()
 		{
+			GitListRemotesTask.UnregisterCallback(OnRemotesUpdate);
 			GitLogTask.UnregisterCallback(OnLogUpdate);
 			GitStatusTask.UnregisterCallback(OnStatusUpdate);
 		}
@@ -461,6 +474,14 @@
 			history.Clear();
 			history.AddRange(entries);
 			CullHistory();
+			Repaint();
+		}
+
+
+		void OnRemotesUpdate(IList<GitRemote> entries)
+		{
+			remotes.Clear();
+			remotes.AddRange(entries);
 			Repaint();
 		}

@@ -573,16 +594,21 @@
 				return;
 			}

-			if (viewMode == ViewMode.History)
-			{
-				if (historyTarget != null)
-				{
-					GitLogTask.Schedule(Utility.AssetPathToRepository(AssetDatabase.GetAssetPath(historyTarget)));
-				}
-				else
-				{
-					GitLogTask.Schedule();
-				}
+			switch (viewMode)
+			{
+				case ViewMode.History:
+					if (historyTarget != null)
+					{
+						GitLogTask.Schedule(Utility.AssetPathToRepository(AssetDatabase.GetAssetPath(historyTarget)));
+					}
+					else
+					{
+						GitLogTask.Schedule();
+					}
+				break;
+				case ViewMode.Settings:
+					GitListRemotesTask.Schedule();
+				break;
 			}

 			GitStatusTask.Schedule();
@@ -650,6 +676,40 @@

 				return;
 			}
+
+			GUILayout.Label("TODO: Favourite branches settings?");
+
+			float remotesWith = position.width - RemotesTotalHorizontalMargin;
+			float
+				nameWidth = remotesWith * RemotesNameRatio,
+				userWidth = remotesWith * RemotesUserRatio,
+				hostWidth = remotesWith * RemotesHostRation,
+				accessWidth = remotesWith * RemotesAccessRatio;
+
+			GUILayout.Label(RemotesTitle, EditorStyles.boldLabel);
+			GUILayout.BeginVertical(GUI.skin.box);
+				GUILayout.BeginHorizontal(EditorStyles.toolbar);
+					GUILayout.Label(RemoteNameTitle, EditorStyles.miniLabel, GUILayout.Width(nameWidth), GUILayout.MaxWidth(nameWidth));
+					GUILayout.Label(RemoteUserTitle, EditorStyles.miniLabel, GUILayout.Width(userWidth), GUILayout.MaxWidth(userWidth));
+					GUILayout.Label(RemoteHostTitle, EditorStyles.miniLabel, GUILayout.Width(hostWidth), GUILayout.MaxWidth(hostWidth));
+					GUILayout.Label(RemoteAccessTitle, EditorStyles.miniLabel, GUILayout.Width(accessWidth), GUILayout.MaxWidth(accessWidth));
+				GUILayout.EndHorizontal();
+
+				for (int index = 0; index < remotes.Count; ++index)
+				{
+					GitRemote remote = remotes[index];
+					GUILayout.BeginHorizontal();
+						GUILayout.Label(remote.Name, EditorStyles.miniLabel, GUILayout.Width(nameWidth), GUILayout.MaxWidth(nameWidth));
+						GUILayout.Label(remote.User, EditorStyles.miniLabel, GUILayout.Width(userWidth), GUILayout.MaxWidth(userWidth));
+						GUILayout.Label(remote.Host, EditorStyles.miniLabel, GUILayout.Width(hostWidth), GUILayout.MaxWidth(hostWidth));
+						GUILayout.Label(remote.Function.ToString(), EditorStyles.miniLabel, GUILayout.Width(accessWidth), GUILayout.MaxWidth(accessWidth));
+					GUILayout.EndHorizontal();
+				}
+			GUILayout.EndVertical();
+
+			GUILayout.Label("TODO: GitHub login settings");
+			GUILayout.Label("TODO: Auto-fetch toggle");
+			GUILayout.Label("TODO: Auto-push toggle");
 		}


App: registering the keyboard

App: registering the keyboard

--- projects/RagingBool.Carcosa.App_cs/MainWindow.xaml.cs
+++ projects/RagingBool.Carcosa.App_cs/MainWindow.xaml.cs
@@ -48,6 +48,7 @@
             InitKeyboardControlBoard();

             _carcosa.RegisterControlBoard(_keyboardControlBoard);
+            _carcosa.RegisterWindowsKeyboard(_keyboardManager);

             //RegisterMidiLpd8();


The DefaultOrchestrationManager will not wait for an answer on StopAppMessage, instead of an AppStoppedEvent.

--- src/Kephas.Orchestration/DefaultOrchestrationManager.cs
+++ src/Kephas.Orchestration/DefaultOrchestrationManager.cs
@@ -13,6 +13,7 @@
     using System;
     using System.Collections.Concurrent;
     using System.Collections.Generic;
+    using System.Diagnostics;
     using System.Linq;
     using System.Reflection;
     using System.Threading;
@@ -26,6 +27,7 @@
     using Kephas.Dynamic;
     using Kephas.Interaction;
     using Kephas.Logging;
+    using Kephas.Messaging;
     using Kephas.Messaging.Distributed;
     using Kephas.Messaging.Events;
     using Kephas.Operations;
@@ -54,21 +56,25 @@
         /// <param name="appRuntime">The application runtime.</param>
         /// <param name="eventHub">The event hub.</param>
         /// <param name="messageBroker">The message broker.</param>
+        /// <param name="messageProcessor">The message processor.</param>
         /// <param name="processStarterFactoryFactory">Factory for the process starter factory.</param>
         public DefaultOrchestrationManager(
             IAppRuntime appRuntime,
             IEventHub eventHub,
             IMessageBroker messageBroker,
+            IMessageProcessor messageProcessor,
             IExportFactory<IProcessStarterFactory> processStarterFactoryFactory)
         {
             Requires.NotNull(appRuntime, nameof(appRuntime));
             Requires.NotNull(eventHub, nameof(eventHub));
             Requires.NotNull(messageBroker, nameof(messageBroker));
+            Requires.NotNull(messageProcessor, nameof(messageProcessor));
             Requires.NotNull(processStarterFactoryFactory, nameof(processStarterFactoryFactory));

             this.AppRuntime = appRuntime;
             this.EventHub = eventHub;
             this.MessageBroker = messageBroker;
+            this.MessageProcessor = messageProcessor;
             this.processStarterFactoryFactory = processStarterFactoryFactory;
         }

@@ -103,6 +109,14 @@
         /// The message broker.
         /// </value>
         public IMessageBroker MessageBroker { get; }
+
+        /// <summary>
+        /// Gets the message processor.
+        /// </summary>
+        /// <value>
+        /// The message processor.
+        /// </value>
+        public IMessageProcessor MessageProcessor { get; }

         /// <summary>
         /// Gets or sets the timer due time.
@@ -230,15 +244,49 @@

             try
             {
-                await this.MessageBroker.ProcessOneWayAsync(
-                    stopMessage,
-                    new Endpoint(appId: runtimeAppInfo.AppId, appInstanceId: runtimeAppInfo.AppInstanceId),
-                    ctx => ctx.Impersonate(this.AppContext),
-                    cancellationToken).PreserveThreadContext();
-                return new OperationResult
+                if (runtimeAppInfo.AppId == this.AppRuntime.GetAppId() && runtimeAppInfo.AppInstanceId == this.AppRuntime.GetAppInstanceId())
                 {
-                    OperationState = OperationState.InProgress,
-                };
+                    // terminate this instance
+                    var response = await this.MessageProcessor.ProcessAsync(
+                        stopMessage,
+                        ctx => ctx.Impersonate(this.AppContext),
+                        cancellationToken).PreserveThreadContext();
+                    return new OperationResult
+                    {
+                        OperationState = OperationState.Completed,
+                        [nameof(StopAppResponseMessage)] = response,
+                    };
+                }
+                else
+                {
+                    // terminate a remote application
+                    var stopped = false;
+                    using (var sub = this.EventHub.Subscribe<AppStoppedEvent>((e, ctx) => { if (e.AppInfo.AppInstanceId == runtimeAppInfo.AppInstanceId) stopped = true; }))
+                    {
+                        // initiate stop
+                        await this.MessageBroker.ProcessOneWayAsync(
+                            stopMessage,
+                            new Endpoint(appId: runtimeAppInfo.AppId, appInstanceId: runtimeAppInfo.AppInstanceId),
+                            ctx => ctx.Impersonate(this.AppContext),
+                            cancellationToken).PreserveThreadContext();
+
+                        // wait for the notification or process termination
+                        const int delayms = 100;
+                        var elapsed = TimeSpan.Zero;
+                        var timeout = TaskHelper.DefaultTimeout;
+                        var process = this.TryGetProcess(runtimeAppInfo);
+                        while (!stopped && elapsed < timeout && !(process?.HasExited ?? false))
+                        {
+                            await Task.Delay(delayms).PreserveThreadContext();
+                        }
+                    }
+
+                    return new OperationResult
+                    {
+                        OperationState = stopped ? OperationState.Completed : OperationState.InProgress,
+                        [nameof(StopAppResponseMessage)] = stopped ? new StopAppResponseMessage { ProcessId = runtimeAppInfo.ProcessId } : null,
+                    };
+                }
             }
             catch (Exception ex)
             {
@@ -252,6 +300,26 @@
         }

         /// <summary>
+        /// Tries to get the OS process.
+        /// </summary>
+        /// <param name="runtimeAppInfo">Information describing the runtime application.</param>
+        /// <returns>
+        /// The OS process.
+        /// </returns>
+        protected virtual Process TryGetProcess(IRuntimeAppInfo runtimeAppInfo)
+        {
+            try
+            {
+                return runtimeAppInfo.ProcessId != 0 ? Process.GetProcessById(runtimeAppInfo.ProcessId) : null;
+            }
+            catch (Exception ex)
+            {
+                this.Logger.Warn(ex, $"Could not get the process with ID: {runtimeAppInfo.ProcessId}.");
+                return null;
+            }
+        }
+
+        /// <summary>
         /// Initializes the live apps cache asynchronously.
         /// </summary>
         /// <param name="cancellationToken">The cancellation token.</param>


Lucene.Net.Core.Search.Similarities.IBSimilarity refactor: renamed protected fields camelCase prefixed with m_

--- src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
+++ src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
@@ -68,15 +68,15 @@
     {
         ///
         /// The probabilistic distribution used to model term occurrence.
-        protected internal readonly Distribution Distribution_Renamed; // LUCENENET TODO: Rename
+        protected internal readonly Distribution m_distribution;

         ///
         /// The lambda (λw) parameter.
-        protected internal readonly Lambda Lambda_Renamed; // LUCENENET TODO: Rename
+        protected internal readonly Lambda m_lambda;

         ///
         /// The term frequency normalization.
-        protected internal readonly Normalization Normalization_Renamed; // LUCENENET TODO: Rename
+        protected internal readonly Normalization m_normalization;

         ///
         /// Creates IBSimilarity from the three components.
@@ -89,14 +89,14 @@
         /// <param name="normalization"> term frequency normalization </param>
         public IBSimilarity(Distribution distribution, Lambda lambda, Normalization normalization)
         {
-            this.Distribution_Renamed = distribution;
-            this.Lambda_Renamed = lambda;
-            this.Normalization_Renamed = normalization;
+            this.m_distribution = distribution;
+            this.m_lambda = lambda;
+            this.m_normalization = normalization;
         }

         public override float Score(BasicStats stats, float freq, float docLen)
         {
-            return stats.TotalBoost * Distribution_Renamed.Score(stats, Normalization_Renamed.Tfn(stats, freq, docLen), Lambda_Renamed.CalculateLambda(stats));
+            return stats.TotalBoost * m_distribution.Score(stats, m_normalization.Tfn(stats, freq, docLen), m_lambda.CalculateLambda(stats));
         }

         protected internal override void Explain(Explanation expl, BasicStats stats, int doc, float freq, float docLen)
@@ -105,11 +105,11 @@
             {
                 expl.AddDetail(new Explanation(stats.TotalBoost, "boost"));
             }
-            Explanation normExpl = Normalization_Renamed.Explain(stats, freq, docLen);
-            Explanation lambdaExpl = Lambda_Renamed.Explain(stats);
+            Explanation normExpl = m_normalization.Explain(stats, freq, docLen);
+            Explanation lambdaExpl = m_lambda.Explain(stats);
             expl.AddDetail(normExpl);
             expl.AddDetail(lambdaExpl);
-            expl.AddDetail(Distribution_Renamed.Explain(stats, normExpl.Value, lambdaExpl.Value));
+            expl.AddDetail(m_distribution.Explain(stats, normExpl.Value, lambdaExpl.Value));
         }

         ///
@@ -120,7 +120,7 @@
         ///
         public override string ToString()
         {
-            return "IB " + Distribution_Renamed.ToString() + "-" + Lambda_Renamed.ToString() + Normalization_Renamed.ToString();
+            return "IB " + m_distribution.ToString() + "-" + m_lambda.ToString() + m_normalization.ToString();
         }

         ///
@@ -130,7 +130,7 @@
         {
             get
             {
-                return Distribution_Renamed;
+                return m_distribution;
             }
         }

@@ -141,7 +141,7 @@
         {
             get
             {
-                return Lambda_Renamed;
+                return m_lambda;
             }
         }

@@ -152,7 +152,7 @@
         {
             get
             {
-                return Normalization_Renamed;
+                return m_normalization;
             }
         }
     }


Fixed a typo.

Fixed a typo.

--- src/MbUnit/MbUnit.Tests/Framework/ParallelizableTest.cs
+++ src/MbUnit/MbUnit.Tests/Framework/ParallelizableTest.cs
@@ -59,7 +59,7 @@
             Pair<DateTime, DateTime> batch2 = GetEarliestAndLatestStartAndEndTimes("Five");
             Pair<DateTime, DateTime> batch3 = GetEarliestAndLatestStartAndEndTimes("Six");
             Pair<DateTime, DateTime> batch4 = GetEarliestAndLatestStartAndEndTimes("Seven", "Eight", "Nine", "Ten");
-            Pair<DateTime, DateTime> batch5 = GetEarliestAndLatestStartAndEndTimes("Elevent");
+            Pair<DateTime, DateTime> batch5 = GetEarliestAndLatestStartAndEndTimes("Eleven");
             Pair<DateTime, DateTime> batch6 = GetEarliestAndLatestStartAndEndTimes("Twelve");

             Assert.LessThanOrEqualTo(batch1.Second, batch2.First);


refactor: remove Identity boilerplate

refactor: remove Identity boilerplate

--- src/MonopolyWeb/Models/ASPNETIdentity/IdentityModels.cs
+++ src/MonopolyWeb/Models/ASPNETIdentity/IdentityModels.cs
@@ -1,129 +1,54 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
 using System.Data.Entity;
 using System.Data.Entity.Infrastructure;
 using System.Data.Entity.Validation;
 using System.Linq;
 using Microsoft.AspNet.Identity;
-using Microsoft.AspNet.Identity.EntityFramework;

-namespace ASPNETIdentity
+namespace ASPNETIdentity
 {
-    // Modify the User class to add extra user information
-    public class User : IUser
+  // Modify the User class to add extra user information
+  public class User : IUser
+  {
+    public User() : this(String.Empty) { }
+
+    public User(string userName)
     {
-        public User()
-            : this(String.Empty)
-        {
-        }
-
-        public User(string userName)
-        {
-            UserName = userName;
-            Id = Guid.NewGuid().ToString();
-        }
-
-        [Key]
-        public string Id { get; set; }
-
-        public string UserName { get; set; }
+      UserName = userName;
+      Id = Guid.NewGuid().ToString();
     }

-    public class UserLogin : IUserLogin
+    [Key]
+    public string Id { get; set; }
+
+    public string UserName { get; set; }
+  }
+
+  public class IdentityDbContext : DbContext
+  {
+    public IdentityDbContext() : base("DefaultConnection") { }
+
+    public IdentityDbContext(string nameOrConnectionString) : base(nameOrConnectionString) { }
+
+    // This method ensures that user names are always unique
+    protected override DbEntityValidationResult ValidateEntity(DbEntityEntry entityEntry, IDictionary<object, object> items)
     {
-        [Key, Column(Order = 0)]
-        public string LoginProvider { get; set; }
-        [Key, Column(Order = 1)]
-        public string ProviderKey { get; set; }
-
-        public string UserId { get; set; }
-
-        public UserLogin() { }
-
-        public UserLogin(string userId, string loginProvider, string providerKey)
+      if (entityEntry.State == EntityState.Added)
+      {
+        User user = entityEntry.Entity as User;
+        // Check for uniqueness of user name
+        if (user != null && Users.Where(u => u.UserName.ToUpper() == user.UserName.ToUpper()).Count() > 0)
         {
-            LoginProvider = loginProvider;
-            ProviderKey = providerKey;
-            UserId = userId;
+          var result = new DbEntityValidationResult(entityEntry, new List<DbValidationError>());
+          result.ValidationErrors.Add(new DbValidationError("User", "User name must be unique."));
+          return result;
         }
+      }
+      return base.ValidateEntity(entityEntry, items);
     }

-    public class UserSecret : IUserSecret
-    {
-        public UserSecret()
-        {
-        }
-
-        public UserSecret(string userName, string secret)
-        {
-            UserName = userName;
-            Secret = secret;
-        }
-
-        [Key]
-        public string UserName { get; set; }
-        public string Secret { get; set; }
-    }
-
-    public class UserRole : IUserRole
-    {
-        [Key, Column(Order = 0)]
-        public string RoleId { get; set; }
-        [Key, Column(Order = 1)]
-        public string UserId { get; set; }
-    }
-
-    public class Role : IRole
-    {
-        public Role()
-            : this(String.Empty)
-        {
-        }
-
-        public Role(string roleName)
-        {
-            Id = roleName;
-        }
-
-        [Key]
-        public string Id { get; set; }
-    }
-
-    public class IdentityDbContext : DbContext
-    {
-        public IdentityDbContext()
-            : base("DefaultConnection")
-        {
-        }
-
-        public IdentityDbContext(string nameOrConnectionString)
-            : base(nameOrConnectionString)
-        {
-        }
-
-        // This method ensures that user names are always unique
-        protected override DbEntityValidationResult ValidateEntity(DbEntityEntry entityEntry, IDictionary<object, object> items)
-        {
-            if (entityEntry.State == EntityState.Added)
-            {
-                User user = entityEntry.Entity as User;
-                // Check for uniqueness of user name
-                if (user != null && Users.Where(u => u.UserName.ToUpper() == user.UserName.ToUpper()).Count() > 0)
-                {
-                    var result = new DbEntityValidationResult(entityEntry, new List<DbValidationError>());
-                    result.ValidationErrors.Add(new DbValidationError("User", "User name must be unique."));
-                    return result;
-                }
-            }
-            return base.ValidateEntity(entityEntry, items);
-        }
-
-        public DbSet<User> Users { get; set; }
-        public DbSet<UserSecret> Secrets { get; set; }
-        public DbSet<UserLogin> UserLogins { get; set; }
-        public DbSet<Role> Roles { get; set; }
-        public DbSet<UserRole> UserRoles { get; set; }
-    }
+    private DbSet<User> Users { get; set; }
+  }
 }