Clean up logic and variables

Clean up logic and variables

--- osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs
@@ -7,13 +7,14 @@
 using osu.Framework.Input.States;
 using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Objects.Types;
+using osu.Game.Rulesets.Osu.Objects;
 using osu.Game.Rulesets.Osu.Objects.Drawables;
 using osu.Game.Rulesets.UI;
 using static osu.Game.Input.Handlers.ReplayInputHandler;

 namespace osu.Game.Rulesets.Osu.Mods
 {
-    public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield
+    public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToRulesetContainer<OsuHitObject>
     {
         public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
         public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
@@ -22,8 +23,8 @@

         public void Update(Playfield playfield)
         {
-            bool hitStill = false;
-            bool hitOnce = false;
+            bool requiresHold = false;
+            bool requiresHit = false;

             const float relax_leniency = 3;

@@ -35,45 +36,54 @@
                 double time = osuHit.Clock.CurrentTime;
                 double relativetime = time - osuHit.HitObject.StartTime;

-                if (osuHit.IsAlive && time >= osuHit.HitObject.StartTime - relax_leniency)
-                {
-                    if (osuHit.HitObject is IHasEndTime hasEnd && time > hasEnd.EndTime || osuHit.IsHit)
-                        continue;
+                if (time < osuHit.HitObject.StartTime - relax_leniency) continue;

-                    hitStill |= osuHit is DrawableSlider slider && (slider.Ball.IsHovered || osuHit.IsHovered) || osuHit is DrawableSpinner;
+                if (osuHit.HitObject is IHasEndTime hasEnd && time > hasEnd.EndTime || osuHit.IsHit)
+                    continue;

-                    hitOnce |= osuHit is DrawableHitCircle && osuHit.IsHovered && osuHit.HitObject.HitWindows.CanBeHit(relativetime);
-                }
+                requiresHit |= osuHit is DrawableHitCircle && osuHit.IsHovered && osuHit.HitObject.HitWindows.CanBeHit(relativetime);
+                requiresHold |= osuHit is DrawableSlider slider && (slider.Ball.IsHovered || osuHit.IsHovered) || osuHit is DrawableSpinner;
             }

-            var osuHitSample = playfield.HitObjects.Objects.First(d => d is DrawableOsuHitObject) as DrawableOsuHitObject;
-            if (hitOnce)
+            if (requiresHit)
             {
-                hit(osuHitSample, false);
-                hit(osuHitSample, true);
+                addAction(false);
+                addAction(true);
             }
-            hit(osuHitSample, hitStill);
+
+            addAction(requiresHold);
         }

         private bool wasHit;
         private bool wasLeft;

-        private void hit(DrawableOsuHitObject osuHit, bool hitting)
+        private OsuInputManager osuInputManager;
+
+        private void addAction(bool hitting)
         {
             if (wasHit == hitting)
                 return;
+
             wasHit = hitting;

             var state = new ReplayState<OsuAction>
             {
                 PressedActions = new List<OsuAction>()
             };
+
             if (hitting)
             {
                 state.PressedActions.Add(wasLeft ? OsuAction.LeftButton : OsuAction.RightButton);
                 wasLeft = !wasLeft;
             }
-            osuHit.OsuActionInputManager.HandleCustomInput(new InputState(), state);
+
+            osuInputManager.HandleCustomInput(new InputState(), state);
+        }
+
+        public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
+        {
+            // grab the input manager for future use.
+            osuInputManager = (OsuInputManager)rulesetContainer.KeyBindingInputManager;
         }
     }
 }


Add test coverage for batch-import path

Add test coverage for batch-import path

--- osu.Game.Tests/Skins/IO/ImportSkinTest.cs
+++ osu.Game.Tests/Skins/IO/ImportSkinTest.cs
@@ -83,20 +83,20 @@
         #region Cases where imports should match existing

         [Test]
-        public Task TestImportTwiceWithSameMetadataAndFilename() => runSkinTest(async osu =>
-        {
-            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("test skin", "skinner"), "skin.osk"));
-            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("test skin", "skinner"), "skin.osk"));
-
-            assertImportedOnce(import1, import2);
-        });
-
-        [Test]
-        public Task TestImportTwiceWithNoMetadataSameDownloadFilename() => runSkinTest(async osu =>
+        public Task TestImportTwiceWithSameMetadataAndFilename([Values] bool batchImport) => runSkinTest(async osu =>
+        {
+            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("test skin", "skinner"), "skin.osk"), batchImport);
+            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("test skin", "skinner"), "skin.osk"), batchImport);
+
+            assertImportedOnce(import1, import2);
+        });
+
+        [Test]
+        public Task TestImportTwiceWithNoMetadataSameDownloadFilename([Values] bool batchImport) => runSkinTest(async osu =>
         {
             // if a user downloads two skins that do have skin.ini files but don't have any creator metadata in the skin.ini, they should both import separately just for safety.
-            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni(string.Empty, string.Empty), "download.osk"));
-            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni(string.Empty, string.Empty), "download.osk"));
+            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni(string.Empty, string.Empty), "download.osk"), batchImport);
+            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni(string.Empty, string.Empty), "download.osk"), batchImport);

             assertImportedOnce(import1, import2);
         });
@@ -134,10 +134,10 @@
         });

         [Test]
-        public Task TestSameMetadataNameSameFolderName() => runSkinTest(async osu =>
-        {
-            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("name 1", "author 1"), "my custom skin 1"));
-            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("name 1", "author 1"), "my custom skin 1"));
+        public Task TestSameMetadataNameSameFolderName([Values] bool batchImport) => runSkinTest(async osu =>
+        {
+            var import1 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("name 1", "author 1"), "my custom skin 1"), batchImport);
+            var import2 = await loadSkinIntoOsu(osu, new ImportTask(createOskWithIni("name 1", "author 1"), "my custom skin 1"), batchImport);

             assertImportedOnce(import1, import2);
             assertCorrectMetadata(import1, "name 1 [my custom skin 1]", "author 1", osu);
@@ -357,10 +357,10 @@
             }
         }

-        private async Task<Live<SkinInfo>> loadSkinIntoOsu(OsuGameBase osu, ImportTask import)
+        private async Task<Live<SkinInfo>> loadSkinIntoOsu(OsuGameBase osu, ImportTask import, bool batchImport = false)
         {
             var skinManager = osu.Dependencies.Get<SkinManager>();
-            return await skinManager.Import(import);
+            return await skinManager.Import(import, batchImport);
         }
     }
 }


Move wedgeContainer transition to OnEntering

--- osu.Game/GameModes/Play/PlaySongSelect.cs
+++ osu.Game/GameModes/Play/PlaySongSelect.cs
@@ -142,14 +142,13 @@
             trackManager = game.Audio.Track;

             Task.Factory.StartNew(addBeatmapSets);
-
-            wedgeContainer.FadeInFromZero(250);
         }

         protected override void OnEntering(GameMode last)
         {
             base.OnEntering(last);
             ensurePlayingSelected();
+            wedgeContainer.FadeInFromZero(250);
         }

         protected override void OnResuming(GameMode last)


removed flakey tests

removed flakey tests

--- test/Condenser.Tests.Integration/ConfigFacts.cs
+++ test/Condenser.Tests.Integration/ConfigFacts.cs
@@ -67,7 +67,7 @@
             }
         }

-        [Fact]
+        [Fact(Skip = "Flakey")]
         public async Task GetCallbackForSpecificKey()
         {
             Console.WriteLine(nameof(GetCallbackForSpecificKey));
@@ -87,7 +87,7 @@
             }
         }

-        [Fact]
+        [Fact(Skip = "Flakey")]
         public async Task GetCallbackForKeyThatIsAdded()
         {
             string keyid = Guid.NewGuid().ToString();
@@ -105,7 +105,7 @@
             }
         }

-        [Fact]
+        [Fact(Skip = "Flakey")]
         public async Task GetCallbackForAnyKey()
         {
             Console.WriteLine(nameof(GetCallbackForAnyKey));


Problem 11 complete.

Problem 11 complete.

--- EulerProblems/Problems/Problem11.cs
+++ EulerProblems/Problems/Problem11.cs
@@ -42,7 +42,11 @@
         {
             long maxHoriz = MaxProductHorizontal(productLength);
             long maxVert = MaxProductVertical(productLength);
-            result = Math.Max(maxHoriz, maxVert);
+            long maxDiagR = MaxProductDiagonalRight(productLength);
+            long maxDiagL = MaxProductDiagonalLeft(productLength);
+            long temp1 = Math.Max(maxHoriz, maxVert);
+            long temp2 = Math.Max(maxDiagR, maxDiagL);
+            long result = Math.Max(temp1, temp2);

             stringResult = string.Format(format, result);
         }
@@ -56,17 +60,20 @@
                 //Console.WriteLine("line {0} is {1}", y, string.Join(",", data[y]));
                 for (int x = 0; x <= data[y].Length - length; x++)
                 {
-                    long product = data[y].Where((val, index) => (index >= x && index < x + length)).Aggregate((sum, element) => sum * element);
-                    //Console.WriteLine("Product is {0}.", product);
-                    if (product > maxProduct)
-                    {
-                        maxProduct = product;
-                        Console.WriteLine("New max product horizontal is {0}.", maxProduct);
-                    }
-                }
-            }
-
-            Console.WriteLine("MaxProductHorizontal: {0}.", maxProduct);
+                    long[] temp = HorizontalSlice(data, x, y, length);
+                    //long product = data[y].Where((val, index) => (index >= x && index < x + length)).Aggregate((sum, element) => sum * element);
+                    long product = temp.Aggregate((sum, element) => sum * element);
+
+                    //Console.WriteLine("Product is {0}.", product);
+                    if (product > maxProduct)
+                    {
+                        maxProduct = product;
+                        //Console.WriteLine("New max product horizontal is {0}.", maxProduct);
+                    }
+                }
+            }
+
+            //Console.WriteLine("MaxProductHorizontal: {0}.", maxProduct);
             return maxProduct;
         }

@@ -74,7 +81,7 @@
         {
             long maxProduct = -1;

-            for (int y = 0; y <= data.Length-length; y++)
+            for (int y = 0; y <= data.Length - length; y++)
             {
                 //Console.WriteLine("line {0} is {1}", y, string.Join(",", data[y]));
                 for (int x = 0; x < data[y].Length; x++)
@@ -87,22 +94,152 @@
                     if (product > maxProduct)
                     {
                         maxProduct = product;
-                        Console.WriteLine("New max product vertical is {0}.", maxProduct);
-                    }
-                }
-            }
-
-            Console.WriteLine("MaxProductVertical: {0}.", maxProduct);
-            return maxProduct;
+                        //Console.WriteLine("New max product vertical is {0}.", maxProduct);
+                    }
+                }
+            }
+
+            //Console.WriteLine("MaxProductVertical: {0}.", maxProduct);
+            return maxProduct;
+        }
+
+        private long MaxProductDiagonalRight(int length)
+        {
+            long maxProduct = -1;
+
+            for (int y = 0; y <= data.Length - length; y++)
+            {
+                //Console.WriteLine("line {0} is {1}", y, string.Join(",", data[y]));
+                for (int x = 0; x <= data[y].Length - length; x++)
+                {
+                    long[] temp = DiagonalRightSlice(data, x, y, length);
+
+                    //string asString = string.Join(",", temp);
+                    //Console.WriteLine("A {0} long diagonal right slice starting at [{1},{2}] is {3}", length, x, y, asString);
+                    long product = temp.Aggregate((sum, element) => sum * element);
+                    //Console.WriteLine("Product is {0}.", product);
+                    if (product > maxProduct)
+                    {
+                        maxProduct = product;
+                        //Console.WriteLine("New max product diagonal right is {0}.", maxProduct);
+                    }
+                }
+            }
+
+            //Console.WriteLine("MaxProductDiagonalRight: {0}.", maxProduct);
+            return maxProduct;
+        }
+
+        private long MaxProductDiagonalLeft(int length)
+        {
+            long maxProduct = -1;
+
+            for (int y = 0; y <= data.Length - length; y++)
+            {
+                //Console.WriteLine("line {0} is {1}", y, string.Join(",", data[y]));
+                for (int x = length-1; x < data[y].Length; x++)
+                {
+                    long[] temp = DiagonalLeftSlice(data, x, y, length);
+                    if (null == temp)
+                    {
+                        Console.WriteLine("wat? null");
+                    }
+                    //string asString = string.Join(",", temp);
+                    //Console.WriteLine("A {0} long diagonal left slice starting at [{1},{2}] is {3}", length, x, y, asString);
+                    long product = temp.Aggregate((sum, element) => sum * element);
+                    //Console.WriteLine("Product is {0}.", product);
+                    if (product > maxProduct)
+                    {
+                        maxProduct = product;
+                        //Console.WriteLine("New max product diagonal right is {0}.", maxProduct);
+                    }
+                }
+            }
+
+            //Console.WriteLine("MaxProductDiagonalLeft: {0}.", maxProduct);
+            return maxProduct;
+        }
+
+        private long[] DiagonalRightSlice(long[][] data, int x, int y, int length)
+        {
+            if (null == data || data.Length < y + length)
+            {
+                return null;
+            }
+            if (null == data[y] || data[y].Length < x + length)
+            {
+                return null;
+            }
+            long[] result = new long[length];
+
+            for (int i = 0; i < length; i++)
+            {
+                result[i] = data[y + i][x + i];
+            }
+
+            return result;
+        }
+
+        private long[] DiagonalLeftSlice(long[][] data, int x, int y, int length)
+        {
+            if (null == data || data.Length < y + length)
+            {
+                return null;
+            }
+            if (null == data[y] || data[y].Length <= x)
+            {
+                return null;
+            }
+            if (x < length-1)
+            {
+                return null;
+            }
+            long[] result = new long[length];
+
+            for (int i = 0; i < length; i++)
+            {
+                result[i] = data[y + i][x - i];
+            }
+
+            return result;
         }

         private long[] VerticalSlice(long[][] data, int x, int y, int length)
         {
+            if (null == data || data.Length < y + length)
+            {
+                return null;
+            }
+            if (null == data[y] || data[y].Length <= x)
+            {
+                return null;
+            }
             long[] result = new long[length];

             for (int i = 0; i < length; i++)
             {
                 result[i] = data[y + i][x];
+            }
+
+            return result;
+        }
+
+        private long[] HorizontalSlice(long[][] data, int x, int y, int length)
+        {
+            if (null == data || data.Length <= y)
+            {
+                return null;
+            }
+            if (null == data[y] || data[y].Length < x + length)
+            {
+                return null;
+            }
+
+            long[] result = new long[length];
+
+            for (int i = 0; i < length; i++)
+            {
+                result[i] = data[y][x + i];
             }

             return result;


Add ValueTypeErrorAtItemIndex on top of GetLocalizedTypeErrorAtItemIndexMessage().

--- Eutherion/Win/Storage/PTypeError.cs
+++ Eutherion/Win/Storage/PTypeError.cs
@@ -2,7 +2,7 @@
 /*********************************************************************************
  * PTypeError.cs
  *
- * Copyright (c) 2004-2020 Henk Nicolai
+ * Copyright (c) 2004-2022 Henk Nicolai
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -257,4 +257,82 @@
                 valueNode.Length);
         }
     }
+
+    /// <summary>
+    /// Represents an error caused by an array value being of a different type than expected.
+    /// </summary>
+    public class ValueTypeErrorAtItemIndex : ValueTypeError
+    {
+        /// <summary>
+        /// Gets the index of the array where the error occurred.
+        /// </summary>
+        public int ItemIndex { get; }
+
+        /// <summary>
+        /// Gets the localized, context sensitive message for this error.
+        /// </summary>
+        /// <param name="localizer">
+        /// The localizer to use.
+        /// </param>
+        /// <returns>
+        /// The localized error message.
+        /// </returns>
+        public override string GetLocalizedMessage(Localizer localizer)
+            => TypeErrorBuilder.GetLocalizedTypeErrorAtItemIndexMessage(
+                localizer,
+                ActualValueString ?? localizer.Localize(PType.JsonUndefinedValue),
+                ItemIndex);
+
+        private ValueTypeErrorAtItemIndex(
+            ITypeErrorBuilder typeErrorBuilder,
+            int itemIndex,
+            string actualValueString,
+            int start,
+            int length)
+            : base(typeErrorBuilder, actualValueString, start, length)
+        {
+            ItemIndex = itemIndex;
+        }
+
+        /// <summary>
+        /// Initializes a new instance of <see cref="ValueTypeErrorAtItemIndex"/>.
+        /// </summary>
+        /// <param name="typeErrorBuilder">
+        /// The context insensitive information for this error message.
+        /// </param>
+        /// <param name="itemIndex">
+        /// The index of the array where the error occurred.
+        /// </param>
+        /// <param name="valueNode">
+        /// The value node corresponding to the value that was typechecked.
+        /// </param>
+        /// <param name="json">
+        /// The source json which contains the type error.
+        /// </param>
+        /// <param name="valueNodeStart">
+        /// The start position of the value node in the source json.
+        /// </param>
+        /// <returns>
+        /// A <see cref="ValueTypeErrorAtItemIndex"/> instance which generates a localized error message.
+        /// </returns>
+        /// <exception cref="ArgumentNullException">
+        /// <paramref name="typeErrorBuilder"/> and/or <paramref name="valueNode"/> and/or <paramref name="json"/> are null.
+        /// </exception>
+        public static ValueTypeErrorAtItemIndex Create(
+            ITypeErrorBuilder typeErrorBuilder,
+            int itemIndex,
+            GreenJsonValueSyntax valueNode,
+            string json,
+            int valueNodeStart)
+        {
+            if (typeErrorBuilder == null) throw new ArgumentNullException(nameof(typeErrorBuilder));
+
+            return new ValueTypeErrorAtItemIndex(
+                typeErrorBuilder,
+                itemIndex,
+                PTypeErrorBuilder.GetValueDisplayString(valueNode, json, valueNodeStart),
+                valueNodeStart,
+                valueNode.Length);
+        }
+    }
 }


removing extra field

removing extra field

--- adal/automation/WinFormsAutomationApp/MainForm.cs
+++ adal/automation/WinFormsAutomationApp/MainForm.cs
@@ -21,7 +21,6 @@
         }

         private Command _commandToRun = null;
-        private const string AuthResultFile = "AuthResult.txt";

         //This is the location of the automation app during UI Testing on the test agents
         private const string AuthResultFile = "C:\\UITest\\AuthResult.txt";


Added SteamClient.RestartAppIfNecessary

Added SteamClient.RestartAppIfNecessary

--- Facepunch.Steamworks/SteamClient.cs
+++ Facepunch.Steamworks/SteamClient.cs
@@ -168,5 +168,24 @@
 		/// returns the appID of the current process
 		/// </summary>
 		public static AppId AppId { get; internal set; }
+
+		/// <summary>
+		/// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't
+		///  this returns true then it starts the Steam client if required and launches your game again through it,
+		///  and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it
+		///  may not relaunch the exact executable that called it, as it will always relaunch from the version
+		///  installed in your Steam library folder/
+		///  Note that during development, when not launching via Steam, this might always return true.
+		/// </summary>
+		public static bool RestartAppIfNecessary( uint appid )
+		{
+			// Having these here would probably mean it always returns false?
+
+			//System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() );
+			//System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() );
+
+			return SteamAPI.RestartAppIfNecessary( appid );
+		}
+
 	}
 }


WPF - Change NotifyDpiChange to accept float instead of double

- Double was being cast to float
- If newDpi is same as old DPI do nothing, no extra floating point comparison is being used, so in some cases
it's possible the DPI change will be triggered when the DPI's are actually the same


Detach from KeyDown event to match code in Show()

--- Fluent.Ribbon/Controls/Backstage.cs
+++ Fluent.Ribbon/Controls/Backstage.cs
@@ -610,7 +610,7 @@

             if (this.ownerWindow is not null)
             {
-                this.ownerWindow.PreviewKeyDown -= this.HandleOwnerWindowKeyDown;
+                this.ownerWindow.KeyDown -= this.HandleOwnerWindowKeyDown;
                 this.ownerWindow.SizeChanged -= this.HandleOwnerWindowSizeChanged;

                 if (double.IsNaN(this.savedWindowMinWidth) == false


Fixes #489 by preventing backstage hide on application shutdown

--- Fluent.Ribbon/Controls/Backstage.cs
+++ Fluent.Ribbon/Controls/Backstage.cs
@@ -514,6 +514,13 @@
         /// </summary>
         protected virtual void Hide()
         {
+            // potentially fixes https://github.com/fluentribbon/Fluent.Ribbon/issues/489
+            if (this.Dispatcher.HasShutdownStarted
+                || this.Dispatcher.HasShutdownFinished)
+            {
+                return;
+            }
+
             this.Loaded -= this.OnDelayedShow;

             if (this.Content == null)


POI：bug 57840: add unit tests for XSSFTable methods;

--- testcases/ooxml/XSSF/UserModel/TestXSSFTable.cs
+++ testcases/ooxml/XSSF/UserModel/TestXSSFTable.cs
@@ -21,6 +21,7 @@
     using System.Collections.Generic;
     using NPOI.OpenXmlFormats.Spreadsheet;
     using NPOI.SS.UserModel;
+    using NPOI.SS.Util;
     using NPOI.XSSF;
     using NUnit.Framework;

@@ -114,6 +115,92 @@
             Assert.AreEqual(-1, table.FindColumnIndex("one"));
             wb.Close();
         }
+        [Test]
+        public void GetSheetName()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual("Table", table.SheetName);
+            wb.Close();
+        }
+        [Test]
+        public void IsHasTotalsRow()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.IsFalse(table.IsHasTotalsRow);
+            wb.Close();
+        }
+        [Test]
+        public void GetStartColIndex()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(0, table.StartColIndex);
+            wb.Close();
+        }
+        [Test]
+        public void GetEndColIndex()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(2, table.EndColIndex);
+            wb.Close();
+        }
+        [Test]
+        public void GetStartRowIndex()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(0, table.StartRowIndex);
+            wb.Close();
+        }
+        [Test]
+        public void GetEndRowIndex()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(6, table.EndRowIndex);
+            wb.Close();
+        }
+        [Test]
+        public void GetStartCellReference()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(new CellReference("A1"), table.StartCellReference);
+            wb.Close();
+        }
+        [Test]
+        public void GetEndCellReference()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(new CellReference("C7"), table.EndCellReference);
+            wb.Close();
+        }
+        [Test]
+        public void GetNumberOfMappedColumns()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual(3, table.NumberOfMappedColumns);
+            wb.Close();
+        }
+        [Test]
+        public void GetAndSetDisplayName()
+        {
+            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("StructuredReferences.xlsx");
+            XSSFTable table = wb.GetTable("\\_Prime.1");
+            Assert.AreEqual("\\_Prime.1", table.DisplayName);
+            table.DisplayName = null;
+            Assert.IsNull(table.DisplayName);
+            Assert.AreEqual("\\_Prime.1", table.Name); // name and display name are different
+            table.DisplayName = "Display name";
+            Assert.AreEqual("Display name", table.DisplayName);
+            Assert.AreEqual("\\_Prime.1", table.Name); // name and display name are different
+            wb.Close();
+        }

     }
 }


* Fixed a memory leak on disconnect

 * Fixed a memory leak on disconnect

git-svn-id: e2945e6dc2723cb01f425b5a7c3c201ce5019a89@204 080cfd25-d5d9-4c59-82ea-70d02a200d8b

--- Gablarski/Client/GablarskiClient.cs
+++ Gablarski/Client/GablarskiClient.cs
@@ -100,7 +100,8 @@
 		/// </summary>
 		public void Disconnect()
 		{
-			this.Connection.Disconnect();
+			Connection.MessageReceived -= this.OnMessageReceived;
+			Connection.Disconnect();
 			this.running = false;
 			this.messageRunnerThread.Join ();
 		}


Added argument validation to Constraints.GenerateIntegers


Last commit info on tree node is based on viewing commit, not head commit

--- GitAspx/Views/TreeView/Index.cshtml
+++ GitAspx/Views/TreeView/Index.cshtml
@@ -107,7 +107,7 @@

@Resources.RightClickToDownload

 		@foreach (var loDir in Model.Directories) {
-            var loCommit = Model.PageSettings.ShowTreeNodeDetails ? loDir.GetLastCommit() : null;
+            var loCommit = Model.PageSettings.ShowTreeNodeDetails ? loDir.GetLastCommitBefore(Model.Commit) : null;

@@ -124,7 +124,7 @@

         }
 		@foreach (var loFile in Model.Files) {
-            var loCommit = Model.PageSettings.ShowTreeNodeDetails ? loFile.GetLastCommit() : null;
+            var loCommit = Model.PageSettings.ShowTreeNodeDetails ? loFile.GetLastCommitBefore(Model.Commit) : null;


Remove unused username field

Remove unused username field

--- HaveIBeenPwned/CloudbleedChecker.cs
+++ HaveIBeenPwned/CloudbleedChecker.cs
@@ -58,7 +58,6 @@
                     {
                         uri = uri.Skip(4).ToString();
                     }
-                    var userName = entry.Strings.ReadSafe(PwDefs.UserNameField);
                     var lastModified = entry.GetPasswordLastModified();
                     var domainBreaches = breaches.Where(b => uri == b && (!oldEntriesOnly || lastModified < new DateTime(2017, 02, 17)));
                     if (domainBreaches.Any())


xmldoc clean-up

xmldoc clean-up

--- osu.Framework/Threading/GameThread.cs
+++ osu.Framework/Threading/GameThread.cs
@@ -32,7 +32,7 @@
         public ThrottledFrameClock Clock { get; }

         /// <summary>
-        /// The dedicated OS thread for this <see cref="GameThread"/>.
+        /// The current dedicated OS thread for this <see cref="GameThread"/>.
         /// A value of <see langword="null"/> does not necessarily mean that this thread is not running;
         /// in <see cref="ExecutionMode.SingleThread"/> execution mode <see cref="ThreadRunner"/> drives its <see cref="GameThread"/>s
         /// manually and sequentially on the main OS thread of the game process.
@@ -104,6 +104,11 @@
         /// </summary>
         private volatile bool exitRequested;

+        /// <summary>
+        /// Prepare this thread for performing work.
+        /// Must be called when entering a running state.
+        /// </summary>
+        /// <param name="withThrottling">Whether this thread's clock should be throttling via thread sleeps.</param>
         internal void Initialize(bool withThrottling)
         {
             lock (startStopLock)


Also lock in `Cleanup`

Also lock in `Cleanup`

--- osu.Framework/Threading/GameThread.cs
+++ osu.Framework/Threading/GameThread.cs
@@ -242,8 +242,11 @@

         protected virtual void Cleanup()
         {
-            Thread = null;
-            Running = false;
+            lock (startStopLock)
+            {
+                Thread = null;
+                Running = false;
+            }
         }

         public void Exit() => exitRequested = true;


Remove unnecessary null check

Remove unnecessary null check

--- osu.Game/Audio/PreviewTrackManager.cs
+++ osu.Game/Audio/PreviewTrackManager.cs
@@ -114,7 +114,7 @@
                 Logger.Log($"A {nameof(PreviewTrack)} was created without a containing {nameof(IPreviewTrackOwner)}. An owner should be added for correct behaviour.");
             }

-            protected override Track GetTrack() => trackManager.Get($"https://b.ppy.sh/preview/{beatmapSetInfo?.OnlineID}.mp3");
+            protected override Track GetTrack() => trackManager.Get($"https://b.ppy.sh/preview/{beatmapSetInfo.OnlineID}.mp3");
         }

         private class PreviewTrackStore : AudioCollectionManager<AdjustableAudioComponent>, ITrackStore


Fix incorrect task being returned for changelog continuations

--- osu.Game/Overlays/ChangelogOverlay.cs
+++ osu.Game/Overlays/ChangelogOverlay.cs
@@ -163,7 +163,7 @@
                 await API.PerformAsync(req).ConfigureAwait(false);

                 return tcs.Task;
-            });
+            }).Unwrap();
         }

         private CancellationTokenSource loadContentCancellation;


Fix key config search not clearing after pressing escape

--- osu.Game/Overlays/SettingsSubPanel.cs
+++ osu.Game/Overlays/SettingsSubPanel.cs
@@ -4,12 +4,10 @@
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Sprites;
-using osu.Framework.Input.Bindings;
 using osu.Framework.Input.Events;
 using osu.Game.Graphics;
 using osu.Game.Graphics.Containers;
 using osu.Game.Graphics.Sprites;
-using osu.Game.Input.Bindings;
 using osu.Game.Overlays.Settings;
 using osu.Game.Screens.Ranking;
 using osuTK;
@@ -36,7 +34,7 @@

         protected override bool DimMainContent => false; // dimming is handled by main overlay

-        private class BackButton : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
+        private class BackButton : OsuClickableContainer
         {
             private AspectContainer aspect;

@@ -85,20 +83,6 @@
                 aspect.ScaleTo(1, 1000, Easing.OutElastic);
                 return base.OnMouseUp(e);
             }
-
-            public bool OnPressed(GlobalAction action)
-            {
-                switch (action)
-                {
-                    case GlobalAction.Back:
-                        Click();
-                        return true;
-                }
-
-                return false;
-            }
-
-            public bool OnReleased(GlobalAction action) => false;
         }
     }
 }


Fix osu! logo on main menu ending up in the wrong place

Also switch to using BeginDelayedSequence where possible.

--- osu.Game/Screens/Menu/ButtonSystem.cs
+++ osu.Game/Screens/Menu/ButtonSystem.cs
@@ -213,88 +213,89 @@
                 backButton.ContractStyle = 0;
                 settingsButton.ContractStyle = 0;

-                switch (state)
+                bool fromInitial = lastState == MenuState.Initial;
+
+                if (state == MenuState.TopLevel)
+                    buttonArea.Flush(true);
+
+                using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true))
                 {
-                    case MenuState.Exit:
-                    case MenuState.Initial:
-                        toolbar?.Hide();
-
-                        buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
-                        buttonArea.FadeOut(300);
-
-                        osuLogo.Delay(150);
-                        osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
-                        osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
-
-                        foreach (Button b in buttonsTopLevel)
-                            b.State = ButtonState.Contracted;
-
-                        foreach (Button b in buttonsPlay)
-                            b.State = ButtonState.Contracted;
-
-                        if (state == MenuState.Exit)
-                        {
-                            osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
-                            osuLogo.FadeOut(EXIT_DELAY);
-                        }
-                        else if (lastState == MenuState.TopLevel)
-                            sampleBack?.Play();
-                        break;
-                    case MenuState.TopLevel:
-                        buttonArea.Flush(true);
-
-                        buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
-
-                        osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
-                        osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
-
-                        buttonArea.FadeIn(300);
-
-                        if (lastState == MenuState.Initial)
-                        {
-                            buttonArea.Delay(150, true);
-
-                            if (osuLogo.Scale.X > 0.5f)
+                    switch (state)
+                    {
+                        case MenuState.Exit:
+                        case MenuState.Initial:
+                            toolbar?.Hide();
+
+                            buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
+                            buttonArea.FadeOut(300);
+
+                            using (osuLogo.BeginDelayedSequence(150))
+                            {
+                                osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
+                                osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
+                            }
+
+                            foreach (Button b in buttonsTopLevel)
+                                b.State = ButtonState.Contracted;
+
+                            foreach (Button b in buttonsPlay)
+                                b.State = ButtonState.Contracted;
+
+                            if (state == MenuState.Exit)
+                            {
+                                osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
+                                osuLogo.FadeOut(EXIT_DELAY);
+                            }
+                            else if (lastState == MenuState.TopLevel)
+                                sampleBack?.Play();
+                            break;
+                        case MenuState.TopLevel:
+                            buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
+
+                            osuLogo.ClearTransforms();
+                            osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
+                            osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
+
+                            buttonArea.FadeIn(300);
+
+                            if (fromInitial && osuLogo.Scale.X > 0.5f)
                                 using (osuLogo.BeginDelayedSequence(200, true))
                                     osuLogo.Impact();
-                        }
-
-                        Scheduler.AddDelayed(() => toolbar?.Show(), 150);
-
-                        foreach (Button b in buttonsTopLevel)
-                            b.State = ButtonState.Expanded;
-
-                        foreach (Button b in buttonsPlay)
-                            b.State = ButtonState.Contracted;
-                        break;
-                    case MenuState.Play:
-                        foreach (Button b in buttonsTopLevel)
-                            b.State = ButtonState.Exploded;
-
-                        foreach (Button b in buttonsPlay)
-                            b.State = ButtonState.Expanded;
-                        break;
-                    case MenuState.EnteringMode:
-                        buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
-
-                        buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
-                        buttonsPlay.ForEach(b => b.ContractStyle = 1);
-                        backButton.ContractStyle = 1;
-                        settingsButton.ContractStyle = 1;
-
-                        foreach (Button b in buttonsTopLevel)
-                            b.State = ButtonState.Contracted;
-
-                        foreach (Button b in buttonsPlay)
-                            b.State = ButtonState.Contracted;
-                        break;
+
+                            Scheduler.AddDelayed(() => toolbar?.Show(), 150);
+
+                            foreach (Button b in buttonsTopLevel)
+                                b.State = ButtonState.Expanded;
+
+                            foreach (Button b in buttonsPlay)
+                                b.State = ButtonState.Contracted;
+                            break;
+                        case MenuState.Play:
+                            foreach (Button b in buttonsTopLevel)
+                                b.State = ButtonState.Exploded;
+
+                            foreach (Button b in buttonsPlay)
+                                b.State = ButtonState.Expanded;
+                            break;
+                        case MenuState.EnteringMode:
+                            buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
+
+                            buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
+                            buttonsPlay.ForEach(b => b.ContractStyle = 1);
+                            backButton.ContractStyle = 1;
+                            settingsButton.ContractStyle = 1;
+
+                            foreach (Button b in buttonsTopLevel)
+                                b.State = ButtonState.Contracted;
+
+                            foreach (Button b in buttonsPlay)
+                                b.State = ButtonState.Contracted;
+                            break;
+                    }
+
+                    backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
+                    settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
                 }
-
-                backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
-                settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
-
-                if (lastState == MenuState.Initial)
-                    buttonArea.DelayReset();
             }
         }


Bullets now rotate correctly

Bullets now rotate correctly

--- HoardeGame/Entities/EntityBullet.cs
+++ HoardeGame/Entities/EntityBullet.cs
@@ -2,6 +2,7 @@
 // Copyright (c) Kuub Studios. All rights reserved.
 // </copyright>

+using System;
 using FarseerPhysics;
 using FarseerPhysics.Dynamics;
 using FarseerPhysics.Dynamics.Contacts;
@@ -19,6 +20,7 @@
     public class EntityBullet : EntityBase
     {
         private readonly IResourceProvider resourceProvider;
+        private readonly float rotation;

         /// <summary>
         /// Initializes a new instance of the <see cref="EntityBullet"/> class.
@@ -39,6 +41,8 @@
             Body.LinearDamping = 0f;
             Body.ApplyForce(direction * 20);
             Body.OnCollision += OnShoot;
+
+            rotation = (float)Math.Atan2(direction.Y, direction.X);
         }

         /// <inheritdoc/>
@@ -50,7 +54,8 @@
         public override void Draw(SpriteBatch spriteBatch, Effect effect)
         {
             Vector2 screenPos = ConvertUnits.ToDisplayUnits(Position);
-            spriteBatch.Draw(resourceProvider.GetTexture("Bullet"), screenPos, Color.White);
+
+            spriteBatch.Draw(resourceProvider.GetTexture("Bullet"), new Rectangle((int)screenPos.X + 16, (int)screenPos.Y + 16, 32, 32), null, Color.White, rotation, new Vector2(16, 16), SpriteEffects.None, 0f);
         }

         /// <summary>


manual mode

manual mode

--- Indicator/SeasonalDate_Indicator.cs
+++ Indicator/SeasonalDate_Indicator.cs
@@ -14,10 +14,9 @@

 /// <summary>
-/// Version: 1.1.2
+/// Version: 1.1.3
 /// -------------------------------------------------------------------------
 /// Simon Pucher 2016
-/// Christian Kovar 2016
 /// -------------------------------------------------------------------------
 /// The initial version was inspired by this link: http://emini-watch.com/stock-market-seasonal-trades/5701/
 /// -------------------------------------------------------------------------
@@ -40,7 +39,8 @@
     {
         SellInMay = 1,
         SantaClausRally = 2,
-        fourthofjuly = 3
+        fourthofjuly = 3,
+        manual = 100
     }

     [Description("Show seasonal trends")]
@@ -51,7 +51,8 @@

         //input
         private SeasonalDateType _seasonal = SeasonalDateType.SellInMay;
-
+        private int _start_month = 2;
+        private int _end_month = 10;

         //output

@@ -70,11 +71,14 @@
         //4th of july
         private IEnumerable<IBar> _list_fourthofjuly_buy = null;
         private IBar _last_start_fourthofjuly = null;
+        //manual
+        private IEnumerable<IBar> _list_manual_buy = null;
+        private IBar _last_start_manual = null;

         #endregion

-		protected override void OnInit()
+        protected override void OnInit()
 		{
 			//Add(new Plot(Color.FromKnownColor(KnownColor.Orange), "MyPlot1"));
 			IsOverlay = true;
@@ -109,6 +113,12 @@
                                                 select b;
                     hashset = new HashSet<DateTime>(_list_fourthofjuly_buy.Select(x => x.Time));
                     break;
+                case SeasonalDateType.manual:
+                    _list_manual_buy = from b in Bars
+                                             where (b.Time.Month >= this.Start_Month  && b.Time.Month <= this.End_Month)
+                                             select b;
+                    hashset = new HashSet<DateTime>(_list_manual_buy.Select(x => x.Time));
+                    break;
                 default:
                     break;
             }
@@ -135,6 +145,9 @@
                     break;
                 case SeasonalDateType.fourthofjuly:
                     this.calculate_4th_of_July_Rally();
+                    break;
+                case SeasonalDateType.manual:
+                    this.calculate_manual();
                     break;
                 default:
                     break;
@@ -162,7 +175,32 @@

         #region calculate methods
-
+
+
+        /// <summary>
+        /// Calculate the seasonal indicator for "manual".
+        /// </summary>
+        private void calculate_manual()
+        {
+            if (hashset.Contains(Bars[0].Time))
+            {
+                if (this._last_start_manual == null)
+                {
+                    this._last_start_manual = Bars[0];
+                }
+            }
+            else
+            {
+                if (this._last_start_manual != null)
+                {
+                    DrawAreaRectangle(this._list_manual_buy.Where(x => x.Time >= this._last_start_manual.Time).Where(x => x.Time <= Bars[0].Time), Color.Green, "manual_buy");
+
+                    this._last_start_manual = null;
+                }
+            }
+
+        }
+
         /// <summary>
         /// Calculate the seasonal indicator for "4th of July".
         /// </summary>
@@ -301,7 +339,29 @@
                 set { _seasonal = value; }
             }

-	    #endregion
+
+
+
+
+        [Description("Start month of the manual seasonal type")]
+        [Category("Parameters")]
+        [DisplayName("Start month (manual)")]
+        public int Start_Month
+        {
+            get { return _start_month; }
+            set { _start_month = value; }
+        }
+
+        [Description("End month of the manual seasonal type")]
+        [Category("Parameters")]
+        [DisplayName("End month (manual)")]
+        public int End_Month
+        {
+            get { return _end_month; }
+            set { _end_month = value; }
+        }
+
+        #endregion

         //[Browsable(false)]
         //[XmlIgnore()]
@@ -311,10 +371,10 @@
         //}

-
-
-		#endregion
-	}
+
+
+        #endregion
+    }
 }
 #region AgenaTrader Automaticaly Generated Code. Do not change it manualy

@@ -327,17 +387,17 @@
 		/// <summary>
 		/// Show seasonal trends
 		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType)
-        {
-			return SeasonalDate_Indicator(InSeries, seasonalDateType);
-		}
-
-		/// <summary>
-		/// Show seasonal trends
-		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType)
-		{
-			var indicator = CachedCalculationUnits.GetCachedIndicator<SeasonalDate_Indicator>(input, i => i.SeasonalDateType == seasonalDateType);
+		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+        {
+			return SeasonalDate_Indicator(InSeries, seasonalDateType, start_Month, end_Month);
+		}
+
+		/// <summary>
+		/// Show seasonal trends
+		/// </summary>
+		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			var indicator = CachedCalculationUnits.GetCachedIndicator<SeasonalDate_Indicator>(input, i => i.SeasonalDateType == seasonalDateType && i.Start_Month == start_Month && i.End_Month == end_Month);

 			if (indicator != null)
 				return indicator;
@@ -347,7 +407,9 @@
 							RequiredBarsCount = RequiredBarsCount,
 							CalculateOnClosedBar = CalculateOnClosedBar,
 							InSeries = input,
-							SeasonalDateType = seasonalDateType
+							SeasonalDateType = seasonalDateType,
+							Start_Month = start_Month,
+							End_Month = end_Month
 						};
 			indicator.SetUp();

@@ -366,20 +428,20 @@
 		/// <summary>
 		/// Show seasonal trends
 		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType)
-		{
-			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType);
-		}
-
-		/// <summary>
-		/// Show seasonal trends
-		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType)
+		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType, start_Month, end_Month);
+		}
+
+		/// <summary>
+		/// Show seasonal trends
+		/// </summary>
+		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
 		{
 			if (IsInInit && input == null)
-				throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
-
-			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType);
+				throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'OnInit()' method");
+
+			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType, start_Month, end_Month);
 		}
 	}

@@ -392,17 +454,17 @@
 		/// <summary>
 		/// Show seasonal trends
 		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType)
-		{
-			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType);
-		}
-
-		/// <summary>
-		/// Show seasonal trends
-		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType)
-		{
-			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType);
+		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType, start_Month, end_Month);
+		}
+
+		/// <summary>
+		/// Show seasonal trends
+		/// </summary>
+		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType, start_Month, end_Month);
 		}
 	}

@@ -415,17 +477,17 @@
 		/// <summary>
 		/// Show seasonal trends
 		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType)
-		{
-			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType);
-		}
-
-		/// <summary>
-		/// Show seasonal trends
-		/// </summary>
-		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType)
-		{
-			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType);
+		public SeasonalDate_Indicator SeasonalDate_Indicator(SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			return LeadIndicator.SeasonalDate_Indicator(InSeries, seasonalDateType, start_Month, end_Month);
+		}
+
+		/// <summary>
+		/// Show seasonal trends
+		/// </summary>
+		public SeasonalDate_Indicator SeasonalDate_Indicator(IDataSeries input, SeasonalDateType seasonalDateType, System.Int32 start_Month, System.Int32 end_Month)
+		{
+			return LeadIndicator.SeasonalDate_Indicator(input, seasonalDateType, start_Month, end_Month);
 		}
 	}


test for #316

test for #316

--- JilTests/DeserializeDynamicTests.cs
+++ JilTests/DeserializeDynamicTests.cs
@@ -193,8 +193,9 @@
                     string key = kv.Key;
                     dynamic val = kv.Value;

-                    switch(c){
-                        case 0:
+                    switch (c)
+                    {
+                        case 0:
                             Assert.Equal("hello", key);
                             Assert.Equal(123, (int)val);
                             break;
@@ -1495,7 +1496,7 @@
         }

         [Fact]
-        public void Issue143DateTime()
+        public void Issue143DateTime()
         {
             var date = new DateTime(21, DateTimeKind.Utc);
             var str = JSON.Serialize(date, Options.ISO8601);
@@ -1504,7 +1505,7 @@
         }

         [Fact]
-        public void Issue143DateTimeFractionOverflow()
+        public void Issue143DateTimeFractionOverflow()
         {
             var date = new DateTime(21, DateTimeKind.Utc);
             var str = "\"0001-01-01T00:00:00.000002100001Z\"";
@@ -1513,7 +1514,7 @@
         }

         [Fact]
-        public void Issue143TimeSpan()
+        public void Issue143TimeSpan()
         {
             var span = new TimeSpan(21);
             var str = JSON.Serialize(span, Options.ISO8601);
@@ -1522,7 +1523,7 @@
         }

         [Fact]
-        public void Issue143TimeSpanFractionOverflow()
+        public void Issue143TimeSpanFractionOverflow()
         {
             var span = new TimeSpan(21);
             var str = "\"PT0.000002100001S\"";
@@ -1531,7 +1532,7 @@
         }

         [Fact]
-        public void Issue143DateTimeOffset()
+        public void Issue143DateTimeOffset()
         {
             var offset = new DateTimeOffset(new DateTime(21, DateTimeKind.Utc), TimeSpan.Zero);
             var str = JSON.Serialize(offset, Options.ISO8601);
@@ -1541,7 +1542,7 @@

         [Fact]
-        public void Issue143DateTimeOffsetFractionOverflow()
+        public void Issue143DateTimeOffsetFractionOverflow()
         {
             var offset = new DateTimeOffset(new DateTime(21, DateTimeKind.Utc), TimeSpan.Zero);
             var str = "\"0001-01-01T00:00:00.000002100001Z\"";
@@ -2303,7 +2304,7 @@
                     string key = kv.Key;
                     dynamic val = kv.Value;

-                    if(key == "hello")
+                    if (key == "hello")
                     {
                         if (hello)
                         {
@@ -2355,7 +2356,7 @@
                 var str1 = JSON.Serialize(now, Options.MillisecondsSinceUnixEpoch);
                 var dyn = JSON.DeserializeDynamic(str1, Options.MillisecondsSinceUnixEpoch);
                 var dto = (DateTimeOffset)dyn;
-
+
                 var str2 = JSON.Serialize(dto, Options.MillisecondsSinceUnixEpoch);

                 Assert.Equal(str1, str2);
@@ -2705,11 +2706,11 @@
             {
                 var dyn = JSON.DeserializeDynamic("[123, \"hello\", 456.7]");
                 System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(dyn);
-
+
                 Assert.True(tc.CanConvertTo(typeof(System.Collections.IEnumerable)));
                 var e = (System.Collections.IEnumerable)tc.ConvertTo(dyn, typeof(System.Collections.IEnumerable));
                 Assert.Equal(3, e.Cast<dynamic>().Count());
-
+
                 tc = System.ComponentModel.TypeDescriptor.GetConverter(e.Cast<dynamic>().ElementAt(0));
                 Assert.True(tc.CanConvertTo(typeof(int)));
                 Assert.Equal(123, (int)tc.ConvertTo(e.Cast<dynamic>().ElementAt(0), typeof(int)));
@@ -2744,7 +2745,7 @@
                 Assert.True(tc.CanConvertTo(typeof(IDictionary<string, dynamic>)));
                 var d = (Dictionary<string, dynamic>)tc.ConvertTo(dyn, typeof(IDictionary<string, dynamic>));
                 Assert.Equal(3, d.Count);
-                Assert.True(d.ContainsKey("hello"));
+                Assert.True(d.ContainsKey("hello"));
                 Assert.True(d.ContainsKey("world"));
                 Assert.True(d.ContainsKey("goodbye"));

@@ -2850,11 +2851,18 @@
 #endif

         [Fact]
-        public void Issue134() {
+        public void Issue134()
+        {
             var json = "{\"data\":{\"id\":\"1\",\"name\":null,\"url\":\"http://www.google.com\"}}";
             var result = JSON.DeserializeDynamic(json); // or JSON.DeserializeDynamic(json);
             var name = result.data["name"];
             Assert.Null(name);
         }
+
+        [Fact]
+        public void Issue316()
+        {
+            Assert.Throws<DeserializationException>(() => JSON.DeserializeDynamic(@"{""menu"":{""id"":1,""pop"":""X"",""pop"":{""a"":[{""click"":""Open()""},{""click"":""Close()""}]}}}"));
+        }
     }
 }


Add a menu to make the dev tools not show up by default

--- Knockout.Binding.Sample/MainForm.cs
+++ Knockout.Binding.Sample/MainForm.cs
@@ -27,6 +27,8 @@
             m_WebView.PropertyChanged += OnWebBrowserInitialized;

             Controls.Add(m_WebView);
+
+            Menu = GetMenu();
         }

         private void OnWebBrowserInitialized(object sender, PropertyChangedEventArgs args)
@@ -34,7 +36,6 @@
             if (String.Equals(args.PropertyName, "IsBrowserInitialized", StringComparison.OrdinalIgnoreCase))
             {
                 m_WebView.Load(GetPageLocation());
-                m_WebView.ShowDevTools();
             }
         }

@@ -44,5 +45,19 @@

             return Path.Combine(runtimeDirectory, "SomePage.htm");
         }
+
+        private MainMenu GetMenu()
+        {
+            var showDevToolsItem = new MenuItem("Show Dev Tools");
+            showDevToolsItem.Click += (sender, args) => m_WebView.ShowDevTools();
+
+            var fileMenu = new MenuItem("File");
+            fileMenu.MenuItems.Add(showDevToolsItem);
+
+            return new MainMenu(new[]
+                {
+                    fileMenu,
+                });
+        }
     }
 }


Fix the IsLoopback check

Fix the IsLoopback check

- IsLoopback() is an incorrect check. It will be true if a local proxy (on the same machine as the Kudu server) forwards requests to Kudu as it would be a local connection.
- Instead, checking for the Host header is a better check for mocking APIs

--- Kudu.Services/Error404Controller.cs
+++ Kudu.Services/Error404Controller.cs
@@ -1,4 +1,5 @@
-using System.Net;
+using System;
+using System.Net;
 using System.Net.Http;
 using System.Web.Http;

@@ -10,7 +11,7 @@
         public HttpResponseMessage Handle()
         {
             // Mock few paths. For development purposes only.
-            if (this.Request.RequestUri.IsLoopback)
+            if (this.Request.RequestUri.Host.Equals("localhost", StringComparison.OrdinalIgnoreCase))
             {
                 if (this.Request.RequestUri.AbsolutePath.Equals(Constants.RestartApiPath, System.StringComparison.OrdinalIgnoreCase))
                 {


Fix incorrect flag order in announce game packet.

--- LazerTagHostLibrary/PacketPacker.cs
+++ LazerTagHostLibrary/PacketPacker.cs
@@ -48,8 +48,8 @@
 			packet.Data.Add(new Signature(SignatureType.Data, HexCodedDecimal.FromDecimal((byte)gameDefinition.Mega)));

 	        var flags1 = (byte) ((gameDefinition.ExtendedTagging ? 1 : 0) << 7 |
-								 (gameDefinition.LimitedReloads ? 1 : 0) << 5 |
-								 (gameDefinition.LimitedMega ? 1 : 0) << 6 |
+								 (gameDefinition.LimitedReloads ? 1 : 0) << 6 |
+								 (gameDefinition.LimitedMega ? 1 : 0) << 5 |
 	                             (gameDefinition.TeamTags ? 1 : 0) << 4 |
 	                             (gameDefinition.MedicMode ? 1 : 0) << 3 |
 	                             (gameDefinition.RapidTags ? 1 : 0) << 2 |


Make CommandBar contents aligned right

Make CommandBar contents aligned right

--- Locana/Utility/CommandBarManager.cs
+++ Locana/Utility/CommandBarManager.cs
@@ -244,6 +244,7 @@
             {
                 Opacity = opacity,
                 // ClosedDisplayMode = AppBarClosedDisplayMode.Minimal,
+                HorizontalContentAlignment = HorizontalAlignment.Right,
             };
             foreach (AppBarItem item in EnabledItems[AppBarItemType.Command])
             {


Added missing Raspadinhas

Added missing Raspadinhas

--- LuckyMe/Migrations/Configuration.cs
+++ LuckyMe/Migrations/Configuration.cs
@@ -31,15 +31,26 @@
                 new Game { Name = "Euromilhes", IsActive = true, BasePrice = 2, Category = sorteio },
                 new Game { Name = "Totoloto", IsActive = true, BasePrice = .9m, Category = sorteio },
                 new Game { Name = "Totobola", IsActive = true, BasePrice = .4m, Category = sorteio },
-                new Game { Name = "Super P de Meia", IsActive = true, BasePrice = 5, ImageUrl = "https://www.jogossantacasa.pt/Game/images/raspadinha/Imagem_286.png", Category = raspadinha },
-                new Game { Name = "P de Meia", IsActive = true, BasePrice = 3, Category = raspadinha },
-                new Game { Name = "Mini P de Meia", IsActive = true, BasePrice = 1, Category = raspadinha },
+                new Game { Name = "Super P-de-Meia", IsActive = true, BasePrice = 5, ImageUrl = "https://www.jogossantacasa.pt/Game/images/raspadinha/Imagem_286.png", Category = raspadinha },
+                new Game { Name = "P-de-Meia", IsActive = true, BasePrice = 3, Category = raspadinha },
+                new Game { Name = "Mini P-de-Meia", IsActive = true, BasePrice = 1, Category = raspadinha },
                 new Game { Name = "Frias", IsActive = true, BasePrice = 1, Category = raspadinha },
                 new Game { Name = "Grande Sorte", IsActive = true, BasePrice = 2, ImageUrl = "https://www.jogossantacasa.pt/Game/images/raspadinha/Imagem_341.png", Category = raspadinha },
                 new Game { Name = "Zodaco da Sorte", IsActive = true, BasePrice = 2, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/11123/Raspadinha237.jpg", Category = raspadinha },
                 new Game { Name = "20x", IsActive = true, BasePrice = 2, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/8388/Raspadinha216.jpg", Category = raspadinha },
                 new Game { Name = "50x", IsActive = true, BasePrice = 5, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/11386/Raspadinha234.jpg", Category = raspadinha },
-                new Game { Name = "100x", IsActive = true, BasePrice = 10, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/12369/Raspadinha242.jpg", Category = raspadinha }
+                new Game { Name = "100x", IsActive = true, BasePrice = 10, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/12369/Raspadinha242.jpg", Category = raspadinha },
+                new Game { Name = "Trevo da Sorte", IsActive = true, BasePrice = 1, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/7209/Raspadinha207.jpg", Category = raspadinha },
+                new Game { Name = "Procura-se", IsActive = true, BasePrice = 1, ImageUrl = "https://www.jogossantacasa.pt/Content/images/uploadedImages/content/pjmc/gc/cont/7698/Raspadinha226.jpg", Category = raspadinha },
+                new Game { Name = "Dias da Semana", IsActive = true, BasePrice = 1, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Portas da Sorte", IsActive = true, BasePrice = 1, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Ano da Cabra", IsActive = true, BasePrice = 1, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Aranha da Sorte", IsActive = true, BasePrice = 1, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Msica", IsActive = true, BasePrice = 2, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Fogosos", IsActive = true, BasePrice = 2, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Recompensa", IsActive = true, BasePrice = 3, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "20 Anos", IsActive = true, BasePrice = 3, ImageUrl = "", Category = raspadinha },
+                new Game { Name = "Mega P-de-Meia", IsActive = true, BasePrice = 10, ImageUrl = "", Category = raspadinha }
                 );

             if (!(context.Roles.Any(u => u.Name == "Admin")))


Move the download function into SourceRouter

--- MainDemo.Wpf/Helper/SourceRouter.cs
+++ MainDemo.Wpf/Helper/SourceRouter.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Threading.Tasks;
 using System.Xml;
@@ -10,7 +11,7 @@
 namespace MaterialDesignDemo.Helper {
     public class SourceRouter {
         private string _typeName;
-        private const bool GetFromLocalSource = true;
+        private const bool GetFromLocalSource = false;
         public SourceRouter(string typeName) {
             _typeName = typeName;
         }
@@ -29,8 +30,34 @@
         }

         public XmlDocument Remote() {
-            return new MaterialDesignInXamlToolkitGitHubFile(_typeName).GetXmlDocument();
+            string ownerName = "wongjiahau";
+            string branchName = "New-Demo-2";
+            string sourceCode = DownloadFile(
+                @"https://raw.githubusercontent.com/" +
+                    $"{ownerName}/" +
+                    "MaterialDesignInXamlToolkit/" +
+                    $"{branchName}/"+
+                    "MainDemo.Wpf/" +
+                    $"{_typeName}.xaml"
+                );
+            var xmlDoc = new XmlDocument();
+            xmlDoc.LoadXml(sourceCode);
+            return xmlDoc;
+        }

+        private static string DownloadFile(string sourceUrl)
+        //Refered from : https://gist.github.com/nboubakr/7812375
+        {
+
+            long existLen = 0;
+            var httpReq = (HttpWebRequest)WebRequest.Create(sourceUrl);
+            httpReq.AddRange((int)existLen);
+            var httpRes = (HttpWebResponse)httpReq.GetResponse();
+            var responseStream = httpRes.GetResponseStream();
+            if (responseStream == null) return "Fail to fetch file";
+            var streamReader = new StreamReader(responseStream);
+            return streamReader.ReadToEnd();
         }
+
     }
 }


Lengthen sleep time to make TestKill() a bit less flaky.

--- MedallionShell.Tests/GeneralTest.cs
+++ MedallionShell.Tests/GeneralTest.cs
@@ -305,7 +305,7 @@
             var command = TestShell.Run(SampleCommand, "pipe");
             command.StandardInput.WriteLine("abc");
             command.StandardInput.Flush();
-            Thread.Sleep(100);
+            Thread.Sleep(300);
             command.Task.IsCompleted.ShouldEqual(false);

             command.Kill();


Added Cancallation to promise

Added Cancallation to promise

--- Miruken/Concurrency/Promise.Task.cs
+++ Miruken/Concurrency/Promise.Task.cs
@@ -87,16 +87,33 @@
     {
         public static Promise ToPromise(this Task task)
         {
-            return new Promise<object>(task.ContinueWith(async t =>
+            return task.ContinueWith(async t =>
             {
                 await t;
                 return (object) null;
-            }).Unwrap());
+            }).Unwrap().ToPromise();
         }

+        public static Promise ToPromise(
+            this Task task, CancellationToken cancellationToken)
+        {
+            return task.ContinueWith(async t =>
+            {
+                await t;
+                return (object) null;
+            }, cancellationToken).Unwrap()
+            .ToPromise(cancellationToken);
+        }
+
         public static Promise<T> ToPromise<T>(this Task<T> task)
         {
             return new Promise<T>(task);
         }
+
+        public static Promise<T> ToPromise<T>(
+            this Task<T> task, CancellationToken cancellationToken)
+        {
+            return new Promise<T>(task, cancellationToken);
+        }
     }
 }


Changed <= to <

Changed <= to <

--- MotorwaySimulator/CustomControls.cs
+++ MotorwaySimulator/CustomControls.cs
@@ -394,7 +394,7 @@
                     // Calculate the overlap allowed in pixels
                     int previousVehicleStoppingDistanceChangeByChangingSpeedsPixels = (int)Math.Round(MainForm.MetresToPixels(MainForm.StoppingDistance(previousVehicle.ActualSpeedMetresHour)), 0) - vehicleProjectedStopppingDistancePixels;

-                    if (previousVehicle.ProgressPixels + previousVehicleStoppingDistancePixels <= backOfOtherLaneVehicle + previousVehicleStoppingDistanceChangeByChangingSpeedsPixels)
+                    if (previousVehicle.ProgressPixels + previousVehicleStoppingDistancePixels < backOfOtherLaneVehicle + previousVehicleStoppingDistanceChangeByChangingSpeedsPixels)
                     {
                         // The stopping distance overlaps, but only by less than or equal to the overlap allowed


Remove breaking test

Remove breaking test

--- NBitcoin.Tests/transaction_tests.cs
+++ NBitcoin.Tests/transaction_tests.cs
@@ -3329,7 +3329,6 @@
 		[Fact]
 		public void Play()
 		{
-			PSBT.Parse("cHNidP8BAO4CAAAAA1l0qlcorgQkiCw7qmaHqsDOqqXIH3nhUg1SKBfjokVxAQAAAAD/////VBglU5rrOqXZuwUMDDukTUDf1AD2g7ewuEYi1yootokCAAAAAP////+ZYgiMHuw5qtUuD+zv8+zwEoyyA+rg8NP1z4sXLFaigwAAAAAA/////wPaSA8AAAAAACIAIPEXP/HT8TRnOgaz1sBpiXzc37jIvWoHq7zI2JNwxcVwmeHdAAAAAAAWABTRmkMJqEgQ9xCFzoiTXKqpqdJijIIJEwAAAAAAFgAUF36qeq69om977gjsNmFJjWMe2eMAAAAATwEENYfPA2PpuymAAAAAGlMAWhlgJOXf3pjU2zq/XPnm4YTjZ0RfbQLFt3FY7YMDFJvWYZWwtoXqQIe/XJZINGbXTo9URCfmlPHfsxG8jSIQAC9qsVQAAIABAACAAAAAgAABAR8SDeQAAAAAABYAFMXFFPJyOc/CE2b3Bb6CxBtBurD4IgIDlcDR93KkFfs4VOsrItkmgInE+NHQlxU51O3U00Qv2l5HMEQCIEyYerSDk3Vf9lB3XDJwBuOU+cyJwzTrKOjdSaOlfZ33AiApHWeGaCKZcBYVb7VlFO7v5JMWEGf0Uct+sP4QaVgnsQEiBgOVwNH3cqQV+zhU6ysi2SaAicT40dCXFTnU7dTTRC/aXhgAL2qxVAAAgAEAAIAAAACAAQAAAAMAAAAAAQEfY1APAAAAAAAWABSGCYgolb12JN+hbTsmhMqFSBI+pQABAR/Y8QwAAAAAABYAFN0X/NjFP5/Aql1sY3xmzuIxLr2nAAAiAgJ88iXlQpQWdrF8pazMEjnVpZALOnd2iPLVa0p4+YtxcBgAL2qxVAAAgAEAAIAAAACAAQAAAAQAAAAAAA==", Network.Main);
 		}

 		class BrokenCoinSelector : ICoinSelector


Fix for _namedFlows null ref when not using multi flow and loading state

--- ink-engine-runtime/StoryState.cs
+++ ink-engine-runtime/StoryState.cs
@@ -623,7 +623,7 @@
                     }
                 }

-                if( _namedFlows.Count > 1 ) {
+                if( _namedFlows != null && _namedFlows.Count > 1 ) {
                     var currFlowName = (string)jObject["currentFlowName"];
                     _currentFlow = _namedFlows[currFlowName];
                 }


Change NdapiMetaProperty.Description to a lazy property

--- Ndapi/Metadata/NdapiMetaProperty.cs
+++ Ndapi/Metadata/NdapiMetaProperty.cs
@@ -14,6 +14,7 @@
         private static Dictionary<int, NdapiMetaProperty> _cache = new Dictionary<int, NdapiMetaProperty>();
         private Lazy<Dictionary<int, string>> _allowedValues;
         private Lazy<PropertyType> _propertyType;
+        private Lazy<string> _description;

         /// <summary>
         /// Gets the property id;
@@ -53,7 +54,7 @@
         /// <summary>
         /// Gets the property description.
         /// </summary>
-        public string Description => GetName(PropertyId);
+        public string Description => _description.Value;

         /// <summary>
         /// Gets the allowed values for the property
@@ -77,6 +78,7 @@

             _allowedValues = new Lazy<Dictionary<int, string>>(LoadAllowedValues);
             _propertyType = new Lazy<PropertyType>(() => GetPropertyType(propertyId));
+            _description = new Lazy<string>(() => GetName(PropertyId));
         }

         internal static NdapiMetaProperty GetOrCreate(int propertyId, string name, bool allowGet, bool allowSet, Type propertyType)
@@ -94,7 +96,7 @@

         private Dictionary<int, string> LoadAllowedValues()
         {
-            if (RawPropertyType.IsEnum)
+            if (AcceptConstants)
             {
                 return Enum.GetValues(RawPropertyType).Cast<int>().ToDictionary(e => e, e => Enum.GetName(RawPropertyType, e));
             }


Add supression for generated xaml class

Add supression for generated xaml class

--HG--
extra : rebase_source : 4c3bb4f12c4e333546b0eca536616e3bf8c33b7b

--- NuPack.Dialog/GlobalSuppressions.cs
+++ NuPack.Dialog/GlobalSuppressions.cs
@@ -11,3 +11,4 @@
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "NuPack.Dialog.Providers")]
 [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "NuPack.Dialog.ToolsOptionsUI")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "XamlGeneratedNamespace")]


Fix a merge issue

Fix a merge issue

--- OpenSim/Framework/EstateSettings.cs
+++ OpenSim/Framework/EstateSettings.cs
@@ -419,11 +419,11 @@

         public void SetFromFlags(ulong regionFlags)
         {
-            ResetHomeOnTeleport = ((regionFlags & (ulong)RegionFlags.ResetHomeOnTeleport) == (ulong)RegionFlags.ResetHomeOnTeleport);
-            BlockDwell = ((regionFlags & (ulong)RegionFlags.BlockDwell) == (ulong)RegionFlags.BlockDwell);
-            AllowLandmark = ((regionFlags & (ulong)RegionFlags.AllowLandmark) == (ulong)RegionFlags.AllowLandmark);
-            AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges);
-            AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome);
+            ResetHomeOnTeleport = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.ResetHomeOnTeleport) == (ulong)OpenMetaverse.RegionFlags.ResetHomeOnTeleport);
+            BlockDwell = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.BlockDwell) == (ulong)OpenMetaverse.RegionFlags.BlockDwell);
+            AllowLandmark = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowLandmark) == (ulong)OpenMetaverse.RegionFlags.AllowLandmark);
+            AllowParcelChanges = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowParcelChanges) == (ulong)OpenMetaverse.RegionFlags.AllowParcelChanges);
+            AllowSetHome = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowSetHome) == (ulong)OpenMetaverse.RegionFlags.AllowSetHome);
         }

         public bool GroupAccess(UUID groupID)


Selection unite commencee

Selection unite commencee

--- PositronNova/PositronNova/sprite.cs
+++ PositronNova/PositronNova/sprite.cs
@@ -14,6 +14,8 @@
 {
         public class sprite
         {
+            //Booleen de selection
+            private bool selected = false;
             private bool moving;
             public Texture2D Texture
             {
@@ -76,7 +78,7 @@
                 {
                     moving = false;
                 }
-                if (moving)
+                if (moving && selected)
                 {
                     _position += _direction * _speed * (float)gameTime.ElapsedGameTime.TotalMilliseconds;
                 }
@@ -106,6 +108,10 @@
                 {
                     _position.X--;
                 }
+                if (mouseState.LeftButton == ButtonState.Pressed)
+                {
+                    selected = Math.Abs(mouseState.X - _position.X) <= 40 && Math.Abs(mouseState.Y - _position.Y) <= 26;
+                }
                 if (mouseState.RightButton == ButtonState.Pressed)
                 {
                     moving = true;


Updated collision

Updated collision

--- RTSGame/RTSEngine/Data/Collision.cs
+++ RTSGame/RTSEngine/Data/Collision.cs
@@ -3,18 +3,96 @@
 using System.Linq;
 using System.Text;
 using RTSEngine.Interfaces;
+using Microsoft.Xna.Framework;

-namespace RTSEngine.Data {
+namespace RTSEngine.Data
+{
+    #region CollisionCircle Class
     public class CollisionCircle : ICollidable {

+        public CollisionType type;
+        public float radius;
+        public Vector2 location;
+
         public CollisionType CollisionType {
-            get { throw new NotImplementedException(); }
+            get { return type; }
+        }
+
+        // Constructor
+        public CollisionCircle(float radius, Vector2 location){
+            type = CollisionType.Circle;
+            this.radius = radius;
+            this.location = location;
         }
     }
-    public class CollisionRect : ICollidable {
+    #endregion

-        public CollisionType CollisionType {
-            get { throw new NotImplementedException(); }
+    #region CollisionRect Class
+        public class CollisionRect : ICollidable {
+
+            public CollisionType type;
+            public float width;
+            public float height;
+            public Vector2 location;
+
+            public CollisionType CollisionType {
+                get { return type; }
+            }
+
+            // Constructor
+            public CollisionRect(float width, float height, Vector2 location) {
+                type = CollisionType.Rectangle;
+                this.width = width;
+                this.height = height;
+                this.location = location;
+            }
         }
-    }
+    #endregion
+
+    #region CollisionController Class
+        public class CollisionController {
+
+            // Constructor
+            public CollisionController() { }
+
+            // Process collision between two objects
+            // Match the types of two objects before calling HandleCollision()
+            public void ProcessCollision(ICollidable o1, ICollidable o2) {
+                switch (o1.CollisionType) {
+                    case (CollisionType.Circle):
+                        switch (o2.CollisionType) {
+                            case (CollisionType.Circle):
+                                HandleCollision((CollisionCircle)o1, (CollisionCircle)o2);
+                                break;
+                            case (CollisionType.Rectangle):
+                                HandleCollision((CollisionCircle)o1, (CollisionRect)o2);
+                                break;
+                        }
+                        break;
+                    case (CollisionType.Rectangle):
+                        switch (o2.CollisionType){
+                            case (CollisionType.Circle):
+                                HandleCollision((CollisionCircle)o2, (CollisionRect)o1);
+                                break;
+                            case (CollisionType.Rectangle):
+                                HandleCollision((CollisionRect)o1, (CollisionRect)o2);
+                                break;
+                        }
+                        break;
+                }
+            }
+
+            protected void HandleCollision(CollisionCircle circle1, CollisionCircle circle2) {
+
+            }
+
+            protected void HandleCollision(CollisionCircle circle, CollisionRect rect) {
+
+            }
+            protected void HandleCollision(CollisionRect rect1, CollisionRect rect2) {
+
+            }
+        }
+
+    #endregion
 }


Don't raise PSAvoidUninitalizedVariables for parameters outside a param block

--- Rules/AvoidUninitializedVariable.cs
+++ Rules/AvoidUninitializedVariable.cs
@@ -69,6 +69,12 @@
                 if (funcAst.Body != null && funcAst.Body.ParamBlock != null && funcAst.Body.ParamBlock.Parameters != null)
                 {
                     paramVariables.UnionWith(funcAst.Body.ParamBlock.Parameters.Select(paramAst => paramAst.Name.VariablePath.UserPath));
+                }
+
+                //don't raise the rules for parameters outside the param block
+                if(funcAst.Parameters != null)
+                {
+                    paramVariables.UnionWith(funcAst.Parameters.Select(paramAst => paramAst.Name.VariablePath.UserPath));
                 }

                 // Iterates all VariableExpressionAst and check the command name.


change

change

--- SSPES/SSPES/Models/ProyectoModel.cs
+++ SSPES/SSPES/Models/ProyectoModel.cs
@@ -39,7 +39,7 @@
             return data;
         }
         public string CantidadProyectos(string pk_user) {
-            string sql = "select count(*) as numero from proyecto where fk_cuenta_proyecto='" + pk_user + "';";
+            string sql = "select count(*) as numero from integrante_proyecto where fk_cuenta='" + pk_user + "';";
             return con.EjecutarConsulta(sql, CommandType.Text).Rows[0]["numero"].ToString();
         }

@@ -94,7 +94,7 @@

         public bool eliminarIntegrante(string pk_cuenta, string pk_pro) {
             string[] sql = new string[1];
-            sql[0] = @"DELETE FROM integrante_proyecto WHERE FK_CUENTA = '" + pk_cuenta +
+            sql[0] = @"DELETE FROM integrante_proyecto WHERE FK_CUENTA = '" + pk_cuenta +
                 @"' AND FK_PROYECTO = '" + pk_pro + "';";
             return con.RealizarTransaccion(sql);
         }
@@ -108,7 +108,7 @@
             } catch (Exception) {
                 return null;
             }
-         }
+        }

         public string getPk() {
             string sql = @"SELECT PK_PROYECTO FROM proyecto WHERE NOMBRE = '" + nombre + @"' AND ESTADO = 'A'


Fix duplicate ongoing operation tracker

Fix duplicate ongoing operation tracker

--- osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs
+++ osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs
@@ -3,12 +3,10 @@

 using System.Linq;
 using NUnit.Framework;
-using osu.Framework.Allocation;
 using osu.Framework.Screens;
 using osu.Framework.Testing;
 using osu.Game.Online.Rooms;
 using osu.Game.Rulesets.Osu;
-using osu.Game.Screens.OnlinePlay;
 using osu.Game.Screens.OnlinePlay.Multiplayer;
 using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
 using osu.Game.Tests.Beatmaps;
@@ -19,9 +17,6 @@
     public class TestSceneMultiplayerMatchSubScreen : MultiplayerTestScene
     {
         private MultiplayerMatchSubScreen screen;
-
-        [Cached]
-        private OngoingOperationTracker ongoingOperationTracker = new OngoingOperationTracker();

         public TestSceneMultiplayerMatchSubScreen()
             : base(false)


[Samples] Fix issue #342. WP8 MiniCube SharpDXBase should use new SharpDX.ViewportF

--- Samples/WP8/MiniCube/SharpDXBase.cs
+++ Samples/WP8/MiniCube/SharpDXBase.cs
@@ -98,7 +98,7 @@
             _windowBounds.Height = _renderTargetSize.Height;

             // Create a viewport descriptor of the full window size.
-             var viewport = new SharpDX.Direct3D11.Viewport(0, 0, (float)_renderTargetSize.Width, (float)_renderTargetSize.Height );
+             var viewport = new SharpDX.ViewportF(0, 0, (float)_renderTargetSize.Width, (float)_renderTargetSize.Height );

             _deviceContext.Rasterizer.SetViewports(viewport);
         }


#23 show hide based on empty values is working

--- Scrambles/Views/Scores/Index.cshtml
+++ Scrambles/Views/Scores/Index.cshtml
@@ -1,6 +1,14 @@
 @model System.Collections.Generic.IEnumerable<Scrambles.Models.ScoresListRow>

+

+

+
+            Show All
+            Show Empty
+
+

+

@@ -17,10 +25,11 @@

     @foreach (var item in Model)
     {
+        var scoreDisplay = item.Score != null ? item.Score.ToString() : " ";

-            @Html.ActionLink("Edit", "Edit", new { id = item.ID })
+            @Html.ActionLink("Edit", "Edit", new {id = item.ID})
             @Html.DisplayFor(model => item.RoundNumber)
-            @Html.DisplayFor(model => item.Score)
+            @scoreDisplay
             @Html.DisplayFor(model => item.Jumper1)
             @Html.DisplayFor(model => item.Jumper2)
             @Html.DisplayFor(model => item.Jumper3)
@@ -30,16 +39,32 @@
     }

-
 @section scripts
 {

 }


Resolve local invoke parameters.

Resolve local invoke parameters.

--- Scripting/Parser/Helpers/Invokes.cs
+++ Scripting/Parser/Helpers/Invokes.cs
@@ -75,7 +75,16 @@
             {
                 string name = invoke.Method.MethodName;

-                if (invoke.Method.TargetObject != null || IsLocalMethodReference(name))
+                if (IsLocalMethodReference(name))
+                {
+                    var obj = new CodeArrayCreateExpression { Size = invoke.Parameters.Count, CreateType = new CodeTypeReference(typeof(object)) };
+                    obj.Initializers.AddRange(invoke.Parameters);
+                    invoke.Parameters.Clear();
+                    invoke.Parameters.Add(obj);
+                    continue;
+                }
+
+                if (invoke.Method.TargetObject != null)
                     continue;

                 MethodInfo core;


* Added flag to control if a connection is cached or not by GetConnector().

--- Scripts/Connection/RESTConnector.cs
+++ Scripts/Connection/RESTConnector.cs
@@ -244,13 +244,14 @@
         /// </summary>
         /// <param name="serviceID">The ID of the service.</param>
         /// <param name="function">The name of the function.</param>
+        /// <param name="useCache">If true, then the connections will use a static cache.</param>
         /// <returns>Returns a RESTConnector object or null on error.</returns>
-        public static RESTConnector GetConnector( string serviceID, string function )
+        public static RESTConnector GetConnector( string serviceID, string function, bool useCache = true )
         {
             RESTConnector connector = null;

             string connectorID = serviceID + function;
-            if ( sm_Connectors.TryGetValue( connectorID, out connector ) )
+            if ( useCache && sm_Connectors.TryGetValue( connectorID, out connector ) )
                 return connector;

             Config cfg = Config.Instance;
@@ -283,7 +284,8 @@
             connector.UsingGateway = false;
             connector.URL = cred.m_URL + function;
             connector.Authentication = new Credentials( cred.m_User, cred.m_Password );
-            sm_Connectors[ connectorID ] = connector;
+            if ( useCache )
+                sm_Connectors[ connectorID ] = connector;

             return connector;
         }


use '_' as prefix for builtin aspects

use '_' as prefix for builtin aspects

--- Scripts/DapCore/context_/Context.cs
+++ Scripts/DapCore/context_/Context.cs
@@ -5,10 +5,10 @@
     public struct ContextConsts {
         public const string TypeContext = "Context";

-        public const string PathVars = "vars";
-        public const string PathProperties = "properties";
-        public const string PathChannels = "channels";
-        public const string PathHandlers = "handlers";
+        public const string PathVars = "_vars";
+        public const string PathProperties = "_properties";
+        public const string PathChannels = "_channels";
+        public const string PathHandlers = "_handlers";

         public const string SuffixHandlerAsync = "~";
         public const string SuffixChannelResponse = ">";


Cleaned whitespace from merge

Cleaned whitespace from merge

--- Source/Virgin_Kalactic/Itinerary.cs
+++ Source/Virgin_Kalactic/Itinerary.cs
@@ -166,8 +166,12 @@
 		public int numSamples = 20;
 		private int curSample = 0;

-		[KSPField(guiActive = true, guiName = "Demand")]
-		public double demand;
+		//[KSPField(guiActive = true, guiName = "Demand")]
+		//public double demand;
+
+		[KSPField(guiActive = true, guiName = "Throttle")]
+		public double throttle = 0; // instantiation may not be necessary, setting to 0 until made use of
+

 		[KSPField(isPersistant = true)]
 		public bool activen = false; //Todo: name this something less stupid
@@ -175,36 +179,36 @@
 		private TrackResource tr;

 		public class Resource
-    	{
-        	private PartResourceDefinition _resource = new PartResourceDefinition();
-    		public PartResourceDefinition resource
-    		{
-        		get { return this._resource; }
-    		}
-
-    		private double _maxRate = 1;
-    		public double maxRate
-    		{
+		{
+			private PartResourceDefinition _resource = new PartResourceDefinition();
+			public PartResourceDefinition resource
+			{
+				get { return this._resource; }
+			}
+
+			private double _maxRate = 1;
+			public double maxRate
+			{
 				get { return this._maxRate; }
-    		}
-
-    		private FloatCurve _rateCurve = new FloatCurve();
-    		public FloatCurve rateCurve
-    		{
-        		get { return this._rateCurve; }
-    		}
+			}
+
+			private FloatCurve _rateCurve = new FloatCurve();
+			public FloatCurve rateCurve
+			{
+				get { return this._rateCurve; }
+			}

 			public double[] samples;
-
-    		public Resource(ConfigNode node)
-    		{
-        		if (node.HasValue("resourceName") && PartResourceLibrary.Instance.resourceDefinitions.Any(d => d.name == node.GetValue("resourceName")))
-        		{
-        			this._resource = PartResourceLibrary.Instance.GetDefinition(node.GetValue("resourceName"));
-        			if (node.HasValue("maxRate")) { double.TryParse(node.GetValue("maxRate"), out _maxRate); }
-            		if (node.HasNode("rateCurve")) { _rateCurve.Load(node.GetNode("rateCurve")); }
-            	}
-    		}
+
+			public Resource(ConfigNode node)
+			{
+				if (node.HasValue("resourceName") && PartResourceLibrary.Instance.resourceDefinitions.Any(d => d.name == node.GetValue("resourceName")))
+				{
+					this._resource = PartResourceLibrary.Instance.GetDefinition(node.GetValue("resourceName"));
+					if (node.HasValue("maxRate")) { double.TryParse(node.GetValue("maxRate"), out _maxRate); }
+					if (node.HasNode("rateCurve")) { _rateCurve.Load(node.GetNode("rateCurve")); }
+				}
+			}
     	}

 		public override void OnStart(PartModule.StartState state)
@@ -225,6 +229,7 @@
 					curSample = (curSample + 1) % numSamples;
 					//demand = samples.Average();
 				}
+
 			}
 		}


Added build output for temporar diagnostic.

--- Sources/Heleonix.Build/ExeHelper.cs
+++ Sources/Heleonix.Build/ExeHelper.cs
@@ -22,6 +22,7 @@
 SOFTWARE.
 */

+using System;
 using System.Diagnostics;

 namespace Heleonix.Build
@@ -109,6 +110,8 @@
                     process.Kill();
                 }

+                Console.WriteLine($"==={output}===");
+
                 return process.ExitCode;
             }
         }


itertools.accumulate implementation (#429)

* itertools.accumulate implementation

Does not work with pickling, hits an issue with the special handling for reduce

* Combine accumulate implementations

--- Src/IronPython.Modules/IterTools.cs
+++ Src/IronPython.Modules/IterTools.cs
@@ -82,6 +82,35 @@
             }

             #endregion
+        }
+
+        [PythonType]
+        public class accumulate : IterBase {
+            public accumulate(CodeContext/*!*/ context, object iterable, object func = null) {
+                InnerEnumerator = Accumulator(context, PythonOps.GetEnumerator(iterable), func);
+            }
+
+            private IEnumerator<object> Accumulator(CodeContext/*!*/ context, IEnumerator iterable, object function) {
+                if (!MoveNextHelper(iterable)) {
+                    yield break;
+                }
+
+                object total = iterable.Current;
+                yield return total;
+
+                if (function == null) {
+                    PythonContext pc = context.LanguageContext;
+                    while (MoveNextHelper(iterable)) {
+                        total = pc.Add(total, iterable.Current);
+                        yield return total;
+                    }
+                } else {
+                    while (MoveNextHelper(iterable)) {
+                        total = PythonCalls.Call(function, total, iterable.Current);
+                        yield return total;
+                    }
+                }
+            }
         }

         [PythonType]


Fix multiple open reader exception

Fix multiple open reader exception

--- SupportManager.Control/Forwarder.cs
+++ SupportManager.Control/Forwarder.cs
@@ -49,7 +49,7 @@

         public async Task ReadAllTeamStatus()
         {
-            foreach (var team in context.Teams)
+            foreach (var team in context.Teams.ToList())
             {
                 var state = await context.ForwardingStates.OrderByDescending(s => s.When).FirstOrDefaultAsync();
                 var number = await exclusiveTaskFactory.StartNew(() =>


Add missing name/email info on Responses

--- SurveyMonkey/Containers/Response.cs
+++ SurveyMonkey/Containers/Response.cs
@@ -27,6 +27,9 @@
         public CollectionMode? CollectionMode { get; set; }
         public string IpAddress { get; set; }
         public long? RecipientId { get; set; }
+        public string FirstName { get; set; }
+        public string LastName { get; set; }
+        public string EmailAddress { get; set; }
         public List<ResponsePage> Pages { get; set; }
         public QuizResults QuizResults { get; set; }


nothing.

nothing.

--- yafsrc/YAF.Classes/YAF.Classes.Utils/General.cs
+++ yafsrc/YAF.Classes/YAF.Classes.Utils/General.cs
@@ -78,12 +78,17 @@
 			ulong banchk = Str2IP( ipmask );
 			ulong ipchk = Str2IP( chk.Split( '.' ) );

-			return ( ipchk & banchk ) == banmask;
+			return ( ipchk & banchk ) == banmask;
 		}

 		static public string GetSafeRawUrl()
 		{
-			string tProcessedRaw = System.Web.HttpContext.Current.Request.RawUrl;
+			return GetSafeRawUrl( System.Web.HttpContext.Current.Request.RawUrl );
+		}
+
+		static public string GetSafeRawUrl( string url )
+		{
+			string tProcessedRaw = url;
 			tProcessedRaw = tProcessedRaw.Replace( "\"", string.Empty );
 			tProcessedRaw = tProcessedRaw.Replace( "<", "%3C" );
 			tProcessedRaw = tProcessedRaw.Replace( ">", "%3E" );


[FIXED] host account was not correctly retrieved

--- yafsrc/YAF.Core/Services/YafSendNotification.cs
+++ yafsrc/YAF.Core/Services/YafSendNotification.cs
@@ -624,7 +624,11 @@
             if (this.BoardSettings.AllowPrivateMessages
                 && this.BoardSettings.SendWelcomeNotificationAfterRegister.Equals(2))
             {
-                LegacyDb.pmessage_save(2, userId, subject, emailBody, messageFlags.BitValue, -1);
+                var users = LegacyDb.UserList(YafContext.Current.PageBoardID, null, true, null, null, null).ToList();
+
+                var hostUser = users.FirstOrDefault(u => u.IsHostAdmin > 0);
+
+                LegacyDb.pmessage_save(hostUser.UserID.Value, userId, subject, emailBody, messageFlags.BitValue, -1);
             }
             else
             {


+ added shutdown

+ added shutdown

git-tfs-id: [http://tfs2010.sones:8080/tfs/sones]$/Experimental/IGraphFSReDesign;C3145

--- Applications/sonesGraphDB/sonesGraphDBStarter.cs
+++ Applications/sonesGraphDB/sonesGraphDBStarter.cs
@@ -131,11 +131,22 @@
                 Console.WriteLine("        the username \""+Properties.Settings.Default.Username+"\" and password \""+Properties.Settings.Default.Password+"\"");
                 Console.WriteLine();

-                while (true)
-                {
-                    Thread.Sleep(1000);
-                }
+                Console.WriteLine("Enter 'shutdown' to initiate the shutdown of this instance.");
             }
+
+            bool shutdown = false;
+            while (!shutdown)
+            {
+                String command = Console.ReadLine();
+
+                if (command.ToUpper() == "SHUTDOWN")
+                    shutdown = true;
+            }
+
+            _dsServer.Shutdown(null);
+
+            //GraphDB.Shutdown(null);
+
             #endregion
         }
     }


Fix namespace in new Unity versions

Fix namespace in new Unity versions

--- Assets/Adjust/Editor/AdjustEditorPreprocessor.cs
+++ Assets/Adjust/Editor/AdjustEditorPreprocessor.cs
@@ -23,7 +23,7 @@
         }
     }
 #if UNITY_2018_1_OR_NEWER
-    public void OnPreprocessBuild(Reporting.BuildReport report)
+    public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
     {
         OnPreprocessBuild(report.summary.platform, string.Empty);
     }


Fix remove passengers

Fix remove passengers

--- Battery-Commander.Web/Services/VehicleService.cs
+++ Battery-Commander.Web/Services/VehicleService.cs
@@ -11,7 +11,7 @@
     {
         public static async Task Reset_Drivers(Database db)
         {
-            foreach (var vehicle in db.Vehicles)
+            foreach (var vehicle in await Filter(db, new Query { }))
             {
                 vehicle.DriverId = null;
                 vehicle.A_DriverId = null;