Don't need the context.Render any more.

Don't need the context.Render any more.

In hit testing unit tests.

--- tests/Avalonia.Visuals.UnitTests/VisualTree/VisualExtensionsTests_GetVisualsAt.cs
+++ tests/Avalonia.Visuals.UnitTests/VisualTree/VisualExtensionsTests_GetVisualsAt.cs
@@ -40,9 +40,6 @@
                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));

-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);
-
                 var result = container.GetVisualsAt(new Point(100, 100));

                 Assert.Equal(new[] { container.Child }, result);
@@ -69,9 +66,6 @@

                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));
-
-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);

                 var result = container.GetVisualsAt(new Point(100, 100));

@@ -109,9 +103,6 @@
                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));

-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);
-
                 var result = container.GetVisualsAt(new Point(100, 100));

                 Assert.Empty(result);
@@ -140,9 +131,6 @@
                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));

-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);
-
                 var result = container.GetVisualsAt(new Point(10, 10));

                 Assert.Empty(result);
@@ -186,9 +174,6 @@
                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));

-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);
-
                 var result = container.GetVisualsAt(new Point(100, 100));

                 Assert.Equal(new[] { container.Children[1], container.Children[0] }, result);
@@ -241,9 +226,6 @@

                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));
-
-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);

                 var result = container.GetVisualsAt(new Point(100, 100));

@@ -292,9 +274,6 @@

                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));
-
-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);

                 var result = container.GetVisualsAt(new Point(120, 120));

@@ -342,9 +321,6 @@

                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));
-
-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);

                 var result = container.GetVisualsAt(new Point(50, 50));

@@ -414,9 +390,6 @@
                 container.Measure(Size.Infinity);
                 container.Arrange(new Rect(container.DesiredSize));

-                var context = new DrawingContext(Mock.Of<IDrawingContextImpl>());
-                context.Render(container);
-
                 var result = container.GetVisualsAt(new Point(50, 150)).First();

                 Assert.Equal(item1, result);
@@ -432,7 +405,6 @@
                 container.InvalidateArrange();

                 container.Arrange(new Rect(container.DesiredSize));
-                context.Render(container);

                 result = container.GetVisualsAt(new Point(50, 150)).First();


Minor changes in Startup.cs

Minor changes in Startup.cs

--- source/SylphyHorn/Startup.cs
+++ source/SylphyHorn/Startup.cs
@@ -1,22 +1,16 @@
 using System;
 using System.IO;
 using System.Reflection;
-using JetBrains.Annotations;
 using MetroTrilithon.Desktop;
 using MetroTrilithon.Threading.Tasks;
-using SylphyHorn.Annotations;
 using SylphyHorn.Interop;
 using Windows.ApplicationModel;

 namespace SylphyHorn
 {
-	[Dark("#if directive is evil...")]
 	public class Startup
 	{
-		[UsedImplicitly]
 		private readonly string _path;
-
-		[UsedImplicitly]
 		private readonly StartupTask _task;

 		public bool IsExists => Platform.IsUwp
@@ -84,7 +78,6 @@
 			return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);
 		}

-		[UsedImplicitly]
 		private static StartupTask GetStartupTask()
 		{
 			return StartupTask.GetAsync("SylphyHornEngineStartupTask").ToTask().Result;


add menu item for setting

add menu item for setting

--- src/Scenes/Title.cs
+++ src/Scenes/Title.cs
@@ -34,16 +34,25 @@
 					new ButtonStyle(Color.FromArgb(255, 255, 255, 255), Color.Transparent, Color.FromArgb(255, 255, 255, 255)));

 				_TitleMenu.Add("Game Start");
+				_TitleMenu.Add("Setting");
 				_TitleMenu.Add("Close");

 				_TitleMenu.ItemClick += (s, e) =>
 				{
+					// game start
 					if (e.ItemIndex == 0)
 					{
 						SceneStorage.Instance.TargetScene = SceneStorage.Instance.FindByName("GameMain");
 					}

+					// setting
 					if (e.ItemIndex == 1)
+					{
+						SceneStorage.Instance.TargetScene = SceneStorage.Instance.FindByName("Setting");
+					}
+
+					// close
+					if (e.ItemIndex == 2)
 					{
 						SystemCore.Instance.Close();
 					}


fixed google authentication

fixed google authentication

--- ExpenseManager/ExpenseManager.Web/Controllers/AccountController.cs
+++ ExpenseManager/ExpenseManager.Web/Controllers/AccountController.cs
@@ -190,7 +190,7 @@
         /// <summary>
         ///     Login to application via external login service
         /// </summary>
-        /// <param name="returnUrl">return URL after sucessful login</param>
+        /// <param name="returnUrl">return URL after successful login</param>
         /// <returns>View</returns>
         [AllowAnonymous]
         public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
@@ -203,8 +203,9 @@

             // Sign in the UserProfile with this external login provider if the UserProfile already has a login
             var result = await SignInManager.ExternalSignInAsync(loginInfo, false);
-            var firstName = string.Empty;
-            var lastName = string.Empty;
+            var name = loginInfo.ExternalIdentity.Name.Split(new[] {' '}, 2);
+            var firstName = name[0];
+            var lastName = name[1];
             switch (result)
             {
                 case SignInStatus.Success:
@@ -241,6 +242,7 @@
         /// <summary>
         ///     Confirm login via external service as Google or FB
         /// </summary>
+        /// 00
         /// <param name="model">RegisterViewModel instance</param>
         /// <param name="returnUrl">return URL after successful login</param>
         /// <returns>View</returns>


Fix typo in xml comment
Client: C#
Patch: Vladimir Arkhipov

This closes #1874

--- lib/csharp/src/Transport/TSocketVersionizer.cs
+++ lib/csharp/src/Transport/TSocketVersionizer.cs
@@ -41,7 +41,7 @@
     internal static class TSocketVersionizer
     {
         /// <summary>
-        /// Creates a TcpClient according to the capabilitites of the used framework
+        /// Creates a TcpClient according to the capabilities of the used framework.
         /// </summary>
         internal static TcpClient CreateTcpClient()
         {
@@ -58,7 +58,7 @@
         }

         /// <summary>
-        /// Creates a TcpListener according to the capabilitites of the used framework.
+        /// Creates a TcpListener according to the capabilities of the used framework.
         /// </summary>
         internal static TcpListener CreateTcpListener(Int32 port)
         {


Akka IO: fixes #1153

Akka IO: fixes #1153

--- src/core/Akka.Tests/IO/TcpConnectionSpec.cs
+++ src/core/Akka.Tests/IO/TcpConnectionSpec.cs
@@ -926,7 +926,6 @@
                     if (InterestCallReceiver.ReceiveWhile<object>(m => m is int && (int)m == (int)SocketAsyncOperation.Connect, TimeSpan.Zero, TimeSpan.Zero, 1).Any())
                         Selector.Send(ConnectionActor, SelectionHandler.ChannelConnectable.Instance);   // Only send ChannelConnectable if we did not complete synchronously

-                    Selector.Send(ConnectionActor, SelectionHandler.ChannelConnectable.Instance);
                     UserHandler.ExpectMsg<Tcp.Connected>(message => ((IPEndPoint) message.RemoteAddress).Port.ShouldBe(ServerAddress.Port)); //TODO: compare full endpoint, not only port

                     UserHandler.Send(ConnectionActor,


Can finally repro the error I've been chasing. This is a failing test.

--- LINQToTTree/LINQToTTreeLib.Tests/QueryVisitors/QueryVisitorTest.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/QueryVisitors/QueryVisitorTest.cs
@@ -1067,6 +1067,7 @@
         {
             public subNtupleObjects1 jet { get; set; }
             public subNtupleObjects2 track { get; set; }
+            public double delta { get; set; }
         }

         class TestTranslatedNestedCompareAndSortHolderEvent
@@ -1089,25 +1090,31 @@
                           select new TestTranslatedNestedCompareAndSortHolderEvent()
                           {
                               matches = from j in evt.jets
+                                        let mt = (from t in evt.tracks
+                                                  orderby Math.Abs(t.v6 - j.v3) ascending
+                                                  select t).First()
                                         orderby j.v3 ascending
                                         select new TestTranslatedNestedCompareAndSortHolder()
                                         {
                                             jet = j,
-                                            track = (from t in evt.tracks
-                                                     orderby Math.Abs(t.v6 - j.v3) ascending
-                                                     select t).First()
+                                            track = mt,
+                                            delta = Math.Abs(mt.v6 - j.v3)
                                         }
                           };

             // Filter on the first jet in the sequence.
             var goodmatched = from evt in matched
                               where evt.matches.First().jet.v3 > 0
-                              select evt;
+                              select new TestTranslatedNestedCompareAndSortHolderEvent() {
+                                  matches = evt.matches.Where(e => e.delta < 1.3)
+                              };
+
+            var goodNumberMatched = goodmatched.Where(evt => evt.matches.Count() == 2);

             // Do something with the second one now
-            var otherTrack = from evt in goodmatched
-                             where evt.matches.Skip(1).First().track.v6 > 0
-                             select evt.matches.Skip(1).First().jet.v3;
+            var otherTrack = from evt in goodNumberMatched
+                             where evt.matches.First().track.v6 > 0
+                             select evt.matches.Skip(1).First().track.v6;

             //var r = matched.Where(evt => evt.matches.Where(m => m.track.v6 > 2.0).Count() > 5).Count();
             var r = otherTrack.Sum();
@@ -1116,7 +1123,11 @@
             code.DumpCodeToConsole();

             // This was crashing, but does need to be fixed up.
-        }
+
+            var lineOfCode = code.DumpCode().Where(l => l.Contains("aDouble_53=aDouble_53")).First();
+            Assert.AreEqual("aDouble_53=aDouble_53+((*(*this).var6).at(aInt32_63));", lineOfCode.Trim(), "Bad line of code");
+        }
+

         [TestMethod]
         public void TestLambdaExpressionLookup()


More enum helpers for drop downs and obvious use-cases.

--- Nancy.ViewEngines.Razor.HtmlHelpers/HtmlHelpersSelectExtensions.cs
+++ Nancy.ViewEngines.Razor.HtmlHelpers/HtmlHelpersSelectExtensions.cs
@@ -338,6 +338,17 @@
             return BuildDropDownList(name, null, items, null, htmlAttributes);
         }

+        public static IHtmlString DropDownList<TModel>(this HtmlHelpers<TModel> helper, string name, Enum options, Enum currentValue, object htmlAttributes)
+        {
+            return DropDownList(helper, name, options, currentValue, TypeHelper.ObjectToDictionary(htmlAttributes));
+        }
+
+        public static IHtmlString DropDownList<TModel>(this HtmlHelpers<TModel> helper, string name, Enum options, Enum currentValue, IDictionary<string, object> htmlAttributes)
+        {
+            var items = currentValue.ToSelectListItems(currentValue).ToList();
+            return BuildDropDownList(name, null, items, null, htmlAttributes);
+        }
+
         private static IHtmlString BuildDropDownList(string name, string defaultOption, IEnumerable<SelectListItem> selectList,
                                               object selectedValue, IDictionary<string, object> htmlAttributes)
         {


Removed unused references in FareRulesParserTest

--- Project.Gtfs.Net/Project.GtfsNet.Test/Tests/FareRulesParserTest.cs
+++ Project.Gtfs.Net/Project.GtfsNet.Test/Tests/FareRulesParserTest.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using Project.GtfsNet.Entities;
 using Project.GtfsNet.Entities.Maps;
-using Project.GtfsNet.Enums;
 using Project.GtfsNet.Parsers;
 using Xunit;
 using Xunit.Abstractions;


Fix Rigidbody capitalization.

Fix Rigidbody capitalization.

--- Source/Plugins/Lizitt/Outfitter/Framework/Editor/BodyPartEditor.cs
+++ Source/Plugins/Lizitt/Outfitter/Framework/Editor/BodyPartEditor.cs
@@ -101,7 +101,7 @@

             var nstatus = EditorGUIDraw.FilteredColliderStatusPopup(
                 EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight), m_StatusLabel,
-                bp.ColliderBehavior, ColliderBehaviorCategory.RigidBody);
+                bp.ColliderBehavior, ColliderBehaviorCategory.Rigidbody);

             if (nstatus != bp.ColliderBehavior)
                 EditorGUIUtil.SetRigidbodyBehavior(bp.Collider.GetAssociatedRigidBody(), (RigidbodyBehavior)nstatus);


Fix combine of DB Access

Fix combine of DB Access

--- LibNoDaveConnectionLibrary/DataTypes/Projectfolders/Step7V5/BlocksOfflineFolder.cs
+++ LibNoDaveConnectionLibrary/DataTypes/Projectfolders/Step7V5/BlocksOfflineFolder.cs
@@ -592,7 +592,23 @@
                                             while (retVal.AWLCode.Count - 1 > akRowInAwlCode && retVal.AWLCode[akRowInAwlCode].Command != "NETWORK")
                                             {
                                                 if (!newAwlCode.Contains(retVal.AWLCode[akRowInAwlCode]))
-                                                    newAwlCode.Add(retVal.AWLCode[akRowInAwlCode]);
+                                                {
+                                                    //newAwlCode.Add(retVal.AWLCode[akRowInAwlCode]);
+                                                    S7FunctionBlockRow akRw = (S7FunctionBlockRow)retVal.AWLCode[akRowInAwlCode];
+
+                                                    if (akRw.CombineDBAccess)
+                                                    {
+                                                        S7FunctionBlockRow nRw = (S7FunctionBlockRow)retVal.AWLCode[akRowInAwlCode + 1];
+                                                        nRw.Parameter = akRw.Parameter + "." + nRw.Parameter;
+                                                        nRw.MC7 = Helper.CombineByteArray(akRw.MC7, nRw.MC7);
+
+                                                        akRw = nRw;
+                                                        retVal.AWLCode.RemoveAt(akRowInAwlCode + 1);
+                                                    }
+
+                                                    if (!newAwlCode.Contains(akRw))
+                                                        newAwlCode.Add(akRw);
+                                                }
                                                 akRowInAwlCode++;
                                             }
                                             ((S7FunctionBlockRow)retVal.AWLCode[akRowInAwlCode]).NetworkName = tx1;


Corrected issue that converted NavigatedTo parameters to thier type string.

--- Template10Library/Services/NavigationService/NavigatedEventArgs.cs
+++ Template10Library/Services/NavigationService/NavigatedEventArgs.cs
@@ -10,7 +10,7 @@
         public NavigatedEventArgs(NavigationEventArgs e)
         {
             this.PageType = e.SourcePageType;
-            this.Parameter = e.Parameter?.ToString();
+            this.Parameter = e.Parameter;
             this.NavigationMode = e.NavigationMode;
         }
         public NavigationMode NavigationMode { get; set; }


fix starving debuff making you faster instead of slower

--- UnityProject/Assets/Scripts/Health/BloodHealth/MetabolismSystem.cs
+++ UnityProject/Assets/Scripts/Health/BloodHealth/MetabolismSystem.cs
@@ -195,8 +195,8 @@
 	private void ApplySpeedDebuff()
 	{
 		playerMove.ServerChangeSpeed(
-			run:playerMove.RunSpeed + starvingRunDebuff,
-			walk: playerMove.WalkSpeed + starvingWalkDebuff);
+			run:playerMove.RunSpeed - starvingRunDebuff,
+			walk: playerMove.WalkSpeed - starvingWalkDebuff);
 		appliedStarvingDebuff = true;
 	}


Adding tests for US numbers

Adding tests for US numbers

--- src/GlobalPhone.Tests/NumberTest.cs
+++ src/GlobalPhone.Tests/NumberTest.cs
@@ -113,5 +113,28 @@
             number = Context.Parse("+852 2699 2838");
             Assert.AreEqual("2699 2838", number.LocalNumber);
         }
+
+        [Test]
+        public void testFormatUSNumber()
+        {
+            var US_NUMBER = Context.Parse("+16502530000");
+            var US_TOLLFREE = Context.Parse("+18002530000");
+            var US_PREMIUM = Context.Parse("+19002530000");
+            Assert.AreEqual("(650) 253-0000",
+                         US_NUMBER.NationalFormat);
+            Assert.AreEqual("+1 650-253-0000",
+                         US_NUMBER.InternationalFormat);
+
+            Assert.AreEqual("(800) 253-0000",
+                         US_TOLLFREE.NationalFormat);
+            Assert.AreEqual("+1 800-253-0000",
+                         US_TOLLFREE.InternationalFormat);
+
+            Assert.AreEqual("(900) 253-0000",
+                         US_PREMIUM.NationalFormat);
+            Assert.AreEqual("+1 900-253-0000",
+                         US_PREMIUM.InternationalFormat);
+        }
+
     }
 }


Update InvocationHandler.cs

Update InvocationHandler.cs

--- src/Hprose.RPC/InvocationHandler.cs
+++ src/Hprose.RPC/InvocationHandler.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  InvocationHandler class for C#.                         |
 |                                                          |
-|  LastModified: Feb 3, 2019                               |
+|  LastModified: Feb 4, 2019                               |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -129,9 +129,7 @@
                 if (returnType == typeof(Task)) {
                     return new AsyncInvoker(client, name, settings);
                 }
-                if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Task<>)) {
-                    settings.Type = returnType.GetGenericArguments()[0];
-                }
+                settings.Type = returnType.GetGenericArguments()[0];
                 return (IInvoker)Activator.CreateInstance(typeof(AsyncInvoker<>).MakeGenericType(settings.Type), new object[] { client, name, settings });
             }
             if (returnType == typeof(void)) {


allowRedeploy was checking against last deployed release, not release stored in Kraken

--- src/Kraken/Services/OctopusProxy.cs
+++ src/Kraken/Services/OctopusProxy.cs
@@ -67,9 +67,9 @@

             if (!allowRedeploy)
             {
-                var checkDeploy = _octopusRepository.Deployments.FindOne(d => d.ReleaseId == releaseId && d.EnvironmentId == environmentId);
+                var checkDeploy = _octopusRepository.Deployments.FindOne(d => d.EnvironmentId == environmentId);

-                if (checkDeploy != null)
+                if (checkDeploy != null && checkDeploy.ReleaseId == releaseId)
                 {
                     var task = _octopusRepository.Tasks.Get(checkDeploy.TaskId);

@@ -82,7 +82,7 @@
                     // if the task has finished successfully, only redeploy if there have been modifications made to the release since the deploy
                     if (task.FinishedSuccessfully)
                     {
-                        var release = _octopusRepository.Releases.Get(checkDeploy.ReleaseId);
+                        var release = _octopusRepository.Releases.Get(releaseId);

                         // if no modifications have been made to a successful deploy since its creation, assume it's a redeploy
                         if (release.LastModifiedOn <= checkDeploy.Created)


mapimpl fixed

mapimpl fixed

--- dix-nez-lande/dix-nez-lande/Implem/MapImpl.cs
+++ dix-nez-lande/dix-nez-lande/Implem/MapImpl.cs
@@ -20,11 +20,12 @@
         private static Map _instance = null;

         public MapImpl() {
-            _instance = this;
         }

         public static Map getMap()
         {
+            if (_instance==null)
+                _instance = new MapImpl();
             return _instance;
         }
         #endregion


Add api status example

Add api status example

--- src/NEventSocket.Example/Program.cs
+++ src/NEventSocket.Example/Program.cs
@@ -30,16 +30,18 @@

             Console.WriteLine("Starting...");

-            ChannelTest();
-
-            //OutboundSocketTest();
-            //InboundSocketTest();
-
-            //DtmfTest();
-            //PlayGetDigitsTest();
+            ApiTest();

             Console.WriteLine("Press [Enter] to exit.");
             Console.ReadLine();
+        }
+
+        private static async Task ApiTest()
+        {
+            using (var client = await InboundSocket.Connect())
+            {
+                Console.WriteLine((await client.Api("status")).BodyText);
+            }
         }

         private static async Task CallTracking()


Error message on startswith/endswith AssertExtension

--- src/Nancy.Tests/ShouldExtensions.cs
+++ src/Nancy.Tests/ShouldExtensions.cs
@@ -11,12 +11,12 @@
     {
         public static void ShouldStartWith(this string actual, string expected)
         {
-            Assert.True(actual.StartsWith(expected));
+            Assert.True(actual.StartsWith(expected), String.Format("Expected to start with {0} but ended with {1}", expected, actual));
         }

         public static void ShouldEndWith(this string actual, string expected)
         {
-            Assert.True(actual.EndsWith(expected));
+            Assert.True(actual.EndsWith(expected), String.Format("Expected to end with {0} but ended with {1}", expected, actual));
         }

         public static void ShouldMatch<T>(this T actual, Func<T, bool> condition)


Expanding error description for Event / Filter Input matching

--- src/Nethereum.Contracts/Event{1}.cs
+++ src/Nethereum.Contracts/Event{1}.cs
@@ -58,7 +58,7 @@
 #if !DOTNET35
         public async Task<List<EventLog<TEventMessage>>> GetAllChanges(NewFilterInput filterInput)
         {
-            if (!EventABI.IsFilterInputForEvent(ContractAddress, filterInput)) throw new Exception("Invalid filter input for current event, use CreateFilterInput");
+            if (!EventABI.IsFilterInputForEvent(ContractAddress, filterInput)) throw new Exception("Invalid filter input for current event, the event signatures, or contract addresses do not match, please use the method CreateFilterInput from this class");
             var logs = await EthGetLogs.SendRequestAsync(filterInput).ConfigureAwait(false);
             return DecodeAllEvents<TEventMessage>(logs);
         }


Updated InParallel

Updated InParallel

--- src/Pipes/Implementation/Conduit.cs
+++ src/Pipes/Implementation/Conduit.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Threading;
 using System.Threading.Tasks;
 using Pipes.Abstraction;
 using Pipes.Exceptions;
@@ -78,13 +79,12 @@
             }
             else
             {
-                var task = WithWait ? () => Receiver.Receive(message).Wait() : (Action)(() => Receiver.Receive(message));
                 if (!Pooled)
                 {
                     if( _queueThread == null )
                         _queueThread = new MessageQueueThread(Target.ContainedType.Name);

-                    _queueThread.Enqueue(task);
+                    _queueThread.Enqueue(WithWait ? () => Receiver.Receive(message).Wait() : (Action)(() => Receiver.Receive(message)));

                     if (!_queueThread.IsStarted)
                     {
@@ -94,7 +94,7 @@
                 }
                 else
                 {
-                    await Task.Run(task);
+                    ThreadPool.QueueUserWorkItem(state => Receiver.Receive(message));
                 }
             }
         }


Add missing thread safety check in `LoadComponentsAsync`

--- osu.Framework/Graphics/Containers/CompositeDrawable.cs
+++ osu.Framework/Graphics/Containers/CompositeDrawable.cs
@@ -143,6 +143,8 @@
             if (game == null)
                 throw new InvalidOperationException($"May not invoke {nameof(LoadComponentAsync)} prior to this {nameof(CompositeDrawable)} being loaded.");

+            EnsureMutationAllowed(nameof(LoadComponentsAsync));
+
             if (IsDisposed)
                 throw new ObjectDisposedException(ToString());


Add missing space in FillFlowContainer exception output

--- osu.Framework/Graphics/Containers/FillFlowContainer.cs
+++ osu.Framework/Graphics/Containers/FillFlowContainer.cs
@@ -160,7 +160,7 @@
                 // in an autosize-related feedback loop, and we can thus simply allow it.
                 if ((c.RelativeSizeAxes & AutoSizeAxes & toAxes(Direction)) != 0 && (c.FillMode != FillMode.Fit || c.RelativeSizeAxes != Axes.Both || c.Size.X > RelativeChildSize.X || c.Size.Y > RelativeChildSize.Y || AutoSizeAxes == Axes.Both))
                     throw new InvalidOperationException(
-                        "Drawables inside a fill flow container may not have a relative size axis that the fill flow container is filling in and auto sizing for." +
+                        "Drawables inside a fill flow container may not have a relative size axis that the fill flow container is filling in and auto sizing for. " +
                         $"The fill flow container is set to flow in the {Direction} direction and autosize in {AutoSizeAxes} axes and the child is set to relative size in {c.RelativeSizeAxes} axes.");

                 // Populate running variables with sane initial values.


add local function to convert FillDirection to Axes

--- osu.Framework/Graphics/Containers/FillFlowContainer.cs
+++ osu.Framework/Graphics/Containers/FillFlowContainer.cs
@@ -132,13 +132,28 @@
             {
                 Drawable c = children[i];

+                Axes toAxes(FillDirection direction)
+                {
+                    switch (direction)
+                    {
+                        case FillDirection.Full:
+                            return Axes.Both;
+                        case FillDirection.Horizontal:
+                            return Axes.X;
+                        case FillDirection.Vertical:
+                            return Axes.Y;
+                        default:
+                            throw new ArgumentException($"{direction.ToString()} is not defined");
+                    }
+                }
+
                 // In some cases (see the right hand side of the conditional) we want to permit relatively sized children
                 // in our fill direction; specifically, when children use FillMode.Fit to preserve the aspect ratio.
                 // Consider the following use case: A fill flow container has a fixed width but an automatic height, and fills
                 // in the vertical direction. Now, we can add relatively sized children with FillMode.Fit to make sure their
                 // aspect ratio is preserved while still allowing them to fill vertically. This special case can not result
                 // in an autosize-related feedback loop, and we can thus simply allow it.
-                if ((c.RelativeSizeAxes & AutoSizeAxes & (Axes)Direction) != 0 && (c.FillMode != FillMode.Fit || c.RelativeSizeAxes != Axes.Both || c.Size.X > RelativeChildSize.X || c.Size.Y > RelativeChildSize.Y || AutoSizeAxes == Axes.Both))
+                if ((c.RelativeSizeAxes & AutoSizeAxes & toAxes(Direction)) != 0 && (c.FillMode != FillMode.Fit || c.RelativeSizeAxes != Axes.Both || c.Size.X > RelativeChildSize.X || c.Size.Y > RelativeChildSize.Y || AutoSizeAxes == Axes.Both))
                     throw new InvalidOperationException(
                         "Drawables inside a fill flow container may not have a relative size axis that the fill flow container is filling in and auto sizing for." +
                         $"The fill flow container is set to flow in the {Direction} direction and autosize in {AutoSizeAxes} axes and the child is set to relative size in {c.RelativeSizeAxes} axes.");
@@ -262,16 +277,16 @@
         /// <summary>
         /// Fill horizontally first, then fill vertically via multiple rows.
         /// </summary>
-        Full = Axes.Both,
+        Full,

         /// <summary>
         /// Fill only horizontally.
         /// </summary>
-        Horizontal = Axes.X,
+        Horizontal,

         /// <summary>
         /// Fill only vertically.
         /// </summary>
-        Vertical = Axes.Y,
+        Vertical
     }
 }


Reforamt for legibility

Reforamt for legibility

--- osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
+++ osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
@@ -53,40 +53,43 @@
             base.LoadComplete();

             playingUsers.BindTo(spectatorStreaming.PlayingUsers);
-            playingUsers.BindCollectionChanged((sender, e) => Schedule(() =>
+            playingUsers.BindCollectionChanged(onUsersChanged, true);
+        }
+
+        private void onUsersChanged(object sender, NotifyCollectionChangedEventArgs e) => Schedule(() =>
+        {
+            switch (e.Action)
             {
-                switch (e.Action)
-                {
-                    case NotifyCollectionChangedAction.Add:
+                case NotifyCollectionChangedAction.Add:
+                    foreach (var id in e.NewItems.OfType<int>().ToArray())
+                    {
+                        users.GetUserAsync(id).ContinueWith(u =>
+                        {
+                            if (u.Result == null) return;

-                        foreach (var id in e.NewItems.OfType<int>().ToArray())
-                        {
-                            users.GetUserAsync(id).ContinueWith(u =>
+                            Schedule(() =>
                             {
-                                if (u.Result == null)
+                                // user may no longer be playing.
+                                if (!playingUsers.Contains(u.Result.Id))
                                     return;

-                                Schedule(() =>
-                                {
-                                    if (playingUsers.Contains(u.Result.Id))
-                                        userFlow.Add(createUserPanel(u.Result));
-                                });
+                                userFlow.Add(createUserPanel(u.Result));
                             });
-                        }
+                        });
+                    }

-                        break;
+                    break;

-                    case NotifyCollectionChangedAction.Remove:
-                        foreach (var u in e.OldItems.OfType<int>())
-                            userFlow.FirstOrDefault(card => card.User.Id == u)?.Expire();
-                        break;
+                case NotifyCollectionChangedAction.Remove:
+                    foreach (var u in e.OldItems.OfType<int>())
+                        userFlow.FirstOrDefault(card => card.User.Id == u)?.Expire();
+                    break;

-                    case NotifyCollectionChangedAction.Reset:
-                        userFlow.Clear();
-                        break;
-                }
-            }), true);
-        }
+                case NotifyCollectionChangedAction.Reset:
+                    userFlow.Clear();
+                    break;
+            }
+        });

         private PlayingUserPanel createUserPanel(User user) =>
             new PlayingUserPanel(user).With(panel =>


Refactor ready button to support selected playlist item

--- osu.Game/Screens/Multi/Match/Components/ReadyButton.cs
+++ osu.Game/Screens/Multi/Match/Components/ReadyButton.cs
@@ -15,7 +15,7 @@
 {
     public class ReadyButton : OsuButton
     {
-        public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
+        public readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>();

         [Resolved(typeof(Room), nameof(Room.EndDate))]
         private Bindable<DateTimeOffset> endDate { get; set; }
@@ -42,31 +42,37 @@
             beatmaps.ItemAdded += beatmapAdded;
             beatmaps.ItemRemoved += beatmapRemoved;

-            Beatmap.BindValueChanged(b => updateBeatmap(b.NewValue), true);
+            SelectedItem.BindValueChanged(item => updateSelectedItem(item.NewValue), true);
         }

-        private void updateBeatmap(BeatmapInfo beatmap)
+        private void updateSelectedItem(PlaylistItem item)
         {
             hasBeatmap = false;

-            if (beatmap?.OnlineBeatmapID == null)
+            int? beatmapId = SelectedItem.Value?.Beatmap.Value?.OnlineBeatmapID;
+            if (beatmapId == null)
                 return;

-            hasBeatmap = beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == beatmap.OnlineBeatmapID) != null;
+            hasBeatmap = beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == beatmapId) != null;
         }

         private void beatmapAdded(BeatmapSetInfo model)
         {
-            if (model.Beatmaps.Any(b => b.OnlineBeatmapID == Beatmap.Value.OnlineBeatmapID))
+            int? beatmapId = SelectedItem.Value?.Beatmap.Value?.OnlineBeatmapID;
+            if (beatmapId == null)
+                return;
+
+            if (model.Beatmaps.Any(b => b.OnlineBeatmapID == beatmapId))
                 Schedule(() => hasBeatmap = true);
         }

         private void beatmapRemoved(BeatmapSetInfo model)
         {
-            if (Beatmap.Value == null)
+            int? beatmapId = SelectedItem.Value?.Beatmap.Value?.OnlineBeatmapID;
+            if (beatmapId == null)
                 return;

-            if (model.OnlineBeatmapSetID == Beatmap.Value.BeatmapSet.OnlineBeatmapSetID)
+            if (model.Beatmaps.Any(b => b.OnlineBeatmapID == beatmapId))
                 Schedule(() => hasBeatmap = false);
         }

@@ -79,7 +85,7 @@

         private void updateEnabledState()
         {
-            if (gameBeatmap.Value == null)
+            if (gameBeatmap.Value == null || SelectedItem.Value == null)
             {
                 Enabled.Value = false;
                 return;
@@ -95,7 +101,10 @@
             base.Dispose(isDisposing);

             if (beatmaps != null)
+            {
                 beatmaps.ItemAdded -= beatmapAdded;
+                beatmaps.ItemRemoved -= beatmapRemoved;
+            }
         }
     }
 }


GSF.TimeSeries: Updated time statistics to default to zero when no device stats are defined.

--- Source/Libraries/GSF.TimeSeries/Statistics/DeviceStatisticsHelper.cs
+++ Source/Libraries/GSF.TimeSeries/Statistics/DeviceStatisticsHelper.cs
@@ -85,9 +85,18 @@

             long[] deviceTimes = s_deviceTimesSnapshot.Select(kvp => kvp.Value).Where(ticks => ticks > 0L).ToArray();

-            AverageTime = (long)deviceTimes.Average();
-            MinimumTime = deviceTimes.Min();
-            MaximumTime = deviceTimes.Max();
+            if (deviceTimes.Length > 0)
+            {
+                AverageTime = (long)deviceTimes.Average();
+                MinimumTime = deviceTimes.Min();
+                MaximumTime = deviceTimes.Max();
+            }
+            else
+            {
+                AverageTime = 0L;
+                MinimumTime = 0L;
+                MaximumTime = 0L;
+            }
         }
     }


Update credential store test

Update credential store test

--- Sources/SecurityFever.Tests/CredentialManager/CredentialStoreTest.cs
+++ Sources/SecurityFever.Tests/CredentialManager/CredentialStoreTest.cs
@@ -38,22 +38,22 @@
             Assert.AreEqual(expectedPassword, actualCredentialEntry.Credential.GetNetworkCredential().Password);
         }

-        [TestMethod]
-        public void TestRemoveCredential()
-        {
-            // Arrange
+        //[TestMethod]
+        //public void TestRemoveCredential()
+        //{
+        //    // Arrange

-            // Act
+        //    // Act

-            // Assert
-        }
+        //    // Assert
+        //}

-        [TestMethod]
-        public void TestCredentialStore()
-        {
-            IEnumerable<CredentialEntry> credentials = CredentialStore.GetCredentials();
+        //[TestMethod]
+        //public void TestCredentialStore()
+        //{
+        //    IEnumerable<CredentialEntry> credentials = CredentialStore.GetCredentials();

-            Assert.AreNotEqual(credentials.ToList<CredentialEntry>().Count, 0);
-        }
+        //    Assert.AreNotEqual(credentials.ToList<CredentialEntry>().Count, 0);
+        //}
     }
 }


Update CodeFirst

Update CodeFirst

--- Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs
+++ Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs
@@ -106,6 +106,10 @@
         protected virtual void Execute(Type entityType)
         {
             var entityInfo = this.Context.EntityMaintenance.GetEntityInfo(entityType);
+            if (entityInfo.IsDisabledUpdateAll)
+            {
+                return;
+            }
             if (this.DefultLength > 0)
             {
                 foreach (var item in entityInfo.Columns)


Fix instancing mesh

Fix instancing mesh

--- Source/HelixToolkit.SharpDX.SharedModel/Element3D/InstancingMeshGeometryModel3D.cs
+++ Source/HelixToolkit.SharpDX.SharedModel/Element3D/InstancingMeshGeometryModel3D.cs
@@ -101,7 +101,7 @@
         {
             return new InstancingMeshNode();
         }
-
+#if NETFX_CORE
         protected override void OnApplyTemplate()
         {
             base.OnApplyTemplate();
@@ -110,5 +110,6 @@
                 itemsContainer.Items.Add(OctreeManager);
             }
         }
+#endif
     }
 }


Implement tweet parsing

Implement tweet parsing

Initial implementation of tweet parsing from JavaScript files.
Currently just sorts the timeline and outputs the tweet count.

--- src/TwitterArchiveParser/Program.cs
+++ src/TwitterArchiveParser/Program.cs
@@ -4,8 +4,13 @@
 namespace MartinCostello.TwitterArchiveParser
 {
     using System;
+    using System.Collections.Generic;
+    using System.Configuration;
+    using System.IO;
+    using System.Linq;
     using System.Reflection;
-    using Newtonsoft.Json;
+    using System.Text;
+    using Newtonsoft.Json.Linq;

     /// <summary>
     /// A console application that parses the JSON of Twitter archives. This class cannot be inherited.
@@ -22,7 +27,8 @@

             try
             {
-                // TODO
+                var tweets = ReadTweetsFromArchive(archivePath: args.FirstOrDefault() ?? Environment.CurrentDirectory);
+                ProcessTweets(tweets.OfType<JObject>());
             }
             catch (Exception ex)
             {
@@ -35,6 +41,66 @@
         }

         /// <summary>
+        /// Reads the tweet data from the specified Twitter archive directory.
+        /// </summary>
+        /// <param name="archivePath">The path to the directory containing the Twitter archive.</param>
+        /// <returns>
+        /// A <see cref="IEnumerable{T}"/> containing the tweets read from the specified Twitter archive.
+        /// </returns>
+        private static IEnumerable<JObject> ReadTweetsFromArchive(string archivePath)
+        {
+            string dataPath = Path.Combine(archivePath, ConfigurationManager.AppSettings["ArchiveDataPath"]);
+
+            dataPath = Path.GetFullPath(dataPath);
+
+            var dataFiles = Directory.EnumerateFiles(dataPath, "*.js").OrderBy((p) => p);
+
+            var timeline = Enumerable.Empty<JObject>();
+
+            foreach (string fileName in dataFiles)
+            {
+                var tweets = ReadTweetsFromJavaScript(fileName);
+                timeline = timeline.Concat(tweets);
+            }
+
+            return timeline;
+        }
+
+        /// <summary>
+        /// Reads tweet JSON from the specified <c>JavaScript</c> file.
+        /// </summary>
+        /// <param name="fileName">The path to the <c>JavaScript</c> file containing tweet data.</param>
+        /// <returns>
+        /// An <see cref="IEnumerable{T}"/> containing the tweets in the specified file.
+        /// </returns>
+        private static IEnumerable<JObject> ReadTweetsFromJavaScript(string fileName)
+        {
+            string[] lines = File.ReadAllLines(fileName, Encoding.UTF8);
+
+            // Skip the header
+            string json = string.Join(Environment.NewLine, lines.Skip(1));
+
+            var tweets = JArray.Parse(json);
+
+            return tweets
+                .OfType<JObject>()
+                .ToArray();
+        }
+
+        /// <summary>
+        /// Processes the specified tweets.
+        /// </summary>
+        /// <param name="tweets">The tweets to process.</param>
+        private static void ProcessTweets(IEnumerable<JObject> tweets)
+        {
+            var orderedTweets = tweets
+                .OrderBy((p) => p["id"])
+                .ToArray();
+
+            Console.WriteLine($"The Twitter archive contains {orderedTweets.Count():N0} tweets.");
+        }
+
+        /// <summary>
         /// Prints a banner to the console containing assembly and operating system information.
         /// </summary>
         private static void PrintBanner()
@@ -44,7 +110,8 @@

             Console.WriteLine(
                 $@"Twitter Archive Parser - v{assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion}
-{assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright}");
+{assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright}
+");
         }
     }
 }


Make sure to restore the app state when the app was resumed

It could have been changed by a background-task or something.

--- src/UwCore/Application/UwCoreApp.cs
+++ src/UwCore/Application/UwCoreApp.cs
@@ -121,8 +121,9 @@
             deferral.Complete();
         }

-        private void OnResuming(object sender, object e)
-        {
+        private async void OnResuming(object sender, object e)
+        {
+            await this._container.Resolve<IApplicationStateService>().RestoreStateAsync();
             this._container.Resolve<IEventAggregator>().PublishOnCurrentThread(new ApplicationResumed());
         }


Return default 'true' and 'false' for comparing converters.

--- Whathecode.PresentationFramework/Windows/Data/AbstractComparisonMarkupExtension.cs
+++ Whathecode.PresentationFramework/Windows/Data/AbstractComparisonMarkupExtension.cs
@@ -19,11 +19,13 @@

 		/// <summary>
 		///   The value to return in case the boolean is true.
+		///   In case <see cref="Type" /> is not specified and this is set to null, true will be returned by default.
 		/// </summary>
 		public object IfTrue { get; set; }

 		/// <summary>
 		///   The value to return in case the boolean is false.
+		///   In case <see cref="Type" /> is not specified and this is set to null, false will be returned by default.
 		/// </summary>
 		public object IfFalse { get; set; }

@@ -42,6 +44,13 @@
 				ifFalse = typeConverter.ConvertFrom( IfFalse );
 			}

+			// In case no type is specified and true and false aren't specified, use 'true' and 'false' as default return values.
+			if ( ( Type == null || Type == typeof( bool ) ) && IfTrue == null && IfFalse == null )
+			{
+				ifTrue = true;
+				ifFalse = false;
+			}
+
 			object conditionConverter = CreateConditionConverter( Type ?? typeof( object ) );
 			if ( !conditionConverter.GetType().IsOfGenericType( typeof( IConditionConverter<> ) ) )
 			{


[Fixed] Failed to activate store apps. #12 #17

Use absolute path to refer to ActivateStoreApp.exe.

--- src/WinAppDriver/Modern/StoreApp.cs
+++ src/WinAppDriver/Modern/StoreApp.cs
@@ -113,8 +113,36 @@

         public void Activate()
         {
-            // TODO thorw exception if needed
-            Process.Start("ActivateStoreApp", this.AppUserModelId);
+            logger.Info(
+                "Activate the store app; current working directory = [{0}], " +
+                "AppUserModelID = [{1}].",
+                Environment.CurrentDirectory, this.AppUserModelId);
+
+            var info = new ProcessStartInfo(
+                Path.Combine(Environment.CurrentDirectory, "ActivateStoreApp.exe"),
+                this.AppUserModelId);
+            info.UseShellExecute = false;
+            info.RedirectStandardOutput = true;
+            info.RedirectStandardError = true;
+
+            var process = Process.Start(info);
+            logger.Debug("PID of ActivateStoreApp.exe = {0}.", process.Id);
+            process.WaitForExit(5 * 1000);
+
+            if (process.ExitCode == 0)
+            {
+                logger.Debug("STDOUT = [{0}].", process.StandardOutput.ReadToEnd());
+            }
+            else
+            {
+                string msg = string.Format(
+                    "Error occurred while activating the store app; " +
+                    "code = {0}, STDOUT = [{1}], STDERR = [{2}].",
+                    process.ExitCode,
+                    process.StandardOutput.ReadToEnd(),
+                    process.StandardError.ReadToEnd());
+                throw new WinAppDriverException(msg);
+            }
         }

         public void Terminate()


Fix colors in build system

Fix colors in build system

The lingustic comparision for ANSI escape characters was not correct, we
needed to be using an ordinal search instead.

--- build_projects/Microsoft.DotNet.Cli.Build.Framework/AnsiConsole.cs
+++ build_projects/Microsoft.DotNet.Cli.Build.Framework/AnsiConsole.cs
@@ -66,7 +66,7 @@
             var escapeScan = 0;
             for (;;)
             {
-                var escapeIndex = message.IndexOf("\x1b[", escapeScan);
+                var escapeIndex = message.IndexOf("\x1b[", escapeScan, StringComparison.Ordinal);
                 if (escapeIndex == -1)
                 {
                     var text = message.Substring(escapeScan);


Fix semaphore error in barrier

Fix semaphore error in barrier

--- src/Channels/AsyncBarrier.cs
+++ src/Channels/AsyncBarrier.cs
@@ -91,7 +91,7 @@
                 else if (remainingCount < 0)
                 {
                     remainingCount = initialCount - 1;
-                    signal = new SemaphoreSlim(0, remainingCount);
+                    signal = new SemaphoreSlim(0, initialCount);
                 }
                 return signal;
             }


fix: cancelling a directory add #18

fix: cancelling a directory add #18

--- src/CoreApi/FileSystemApi.cs
+++ src/CoreApi/FileSystemApi.cs
@@ -98,7 +98,7 @@
             {
                 var folders = Directory
                     .EnumerateDirectories(path)
-                    .Select(dir => AddDirectoryAsync(dir, recursive));
+                    .Select(dir => AddDirectoryAsync(dir, recursive, cancel));
                 files = files.Union(folders);
             }
             var nodes = await Task.WhenAll(files);
@@ -106,7 +106,7 @@
             // Create the directory with links to the created files and sub-directories
             var links = nodes.Select(node => node.ToLink());
             var folder = emptyFolder.Value.AddLinks(links);
-            var directory = await ipfs.Object.PutAsync(folder);
+            var directory = await ipfs.Object.PutAsync(folder, cancel);

             return new FileSystemNode
             {


Documented GetTokenFromCode

Documented GetTokenFromCode

--- src/Cronofy/CronofyClient.cs
+++ src/Cronofy/CronofyClient.cs
@@ -41,6 +41,15 @@
 			this.HttpClient = new ConcreteHttpClient();
 		}

+		/// <summary>
+		/// Gets or sets the HTTP client.
+		/// </summary>
+		/// <value>
+		/// The HTTP client.
+		/// </value>
+		/// <remarks>
+		/// Intend for test purposes only.
+		/// </remarks>
 		internal IHttpClient HttpClient { get; set; }

 		/// <summary>
@@ -68,8 +77,31 @@
 			return new AuthorizationUrlBuilder(this.clientId, redirectUri);
 		}

+		/// <summary>
+		/// Gets the OAuth token from authorization code provided from a
+		/// successful authorization request.
+		/// </summary>
+		/// <param name="code">
+		/// The authorization code provided from an successful authorization
+		/// request, must not be empty.
+		/// </param>
+		/// <param name="redirectUri">
+		/// The redirect URI provided for the authorization requests, must not
+		/// be empty.
+		/// </param>
+		/// <returns>
+		/// Returns an <see cref="OAuthToken"/> for the provided authorization
+		/// code.
+		/// </returns>
+		/// <exception cref="ArgumentException">
+		/// Thrown if <paramref name="code"/> or <paramref name="redirectUri"/>
+		/// are null or empty.
+		/// </exception>
 		public OAuthToken GetTokenFromCode(string code, string redirectUri)
 		{
+			Preconditions.NotEmpty("code", code);
+			Preconditions.NotEmpty("redirectUri", redirectUri);
+
 			var request = new HttpRequest();

 			request.Method = "POST";


Remove some unnecessary blank lines

Remove some unnecessary blank lines

--- src/Cronos/CronExpression.cs
+++ src/Cronos/CronExpression.cs
@@ -98,7 +98,6 @@
                         SkipWhiteSpaces(ref pointer);

                         if (!IsEndOfString(*pointer)) ThrowFormatException("Unexpected character '{0}' on position {1}, end of string expected.", *pointer, pointer - value);
-
                         return macroExpression;
                     }

@@ -114,11 +113,8 @@
                     }

                     ParseField(CronField.Minutes, ref pointer, cronExpression, ref cronExpression._minute);
-
                     ParseField(CronField.Hours, ref pointer, cronExpression, ref cronExpression._hour);
-
                     ParseField(CronField.DaysOfMonth, ref pointer, cronExpression, ref cronExpression._dayOfMonth);
-
                     ParseField(CronField.Months, ref pointer, cronExpression, ref cronExpression._month);

                     if (*pointer == '?' && cronExpression.HasFlag(CronExpressionFlag.DayOfMonthQuestion))
@@ -173,8 +169,8 @@
             }

             var zonedStart = TimeZoneInfo.ConvertTime(fromUtc, zone);
-
             var occurrence = GetOccurenceByZonedTimes(zonedStart, zone, inclusive);
+
             return occurrence?.UtcDateTime;
         }

@@ -192,7 +188,6 @@
             }

             var zonedStart = TimeZoneInfo.ConvertTime(from, zone);
-
             return GetOccurenceByZonedTimes(zonedStart, zone, inclusive);
         }

@@ -224,7 +219,6 @@
                 if (HasFlag(CronExpressionFlag.Interval))
                 {
                     var foundInLateInterval = FindOccurence(startLocalDateTime.Ticks, ambiguousTimeEnd.Ticks - 1, inclusive);
-
                     if (foundInLateInterval != NotFound) return new DateTimeOffset(foundInLateInterval, lateOffset);
                 }

@@ -499,7 +493,6 @@
                     if (!IsWhiteSpace(*pointer) && !IsEndOfString(*pointer)) ThrowFormatException(field, "'{0}' is not supported after '*'.", *pointer);

                     SkipWhiteSpaces(ref pointer);
-
                     return;
                 }

@@ -609,7 +602,6 @@
                 }

                 bits = field.AllBits;
-
                 return;
             }
             else if(*pointer == 'L')
@@ -622,7 +614,6 @@
                 pointer++;

                 bits = LastDaysOfMonths;
-
                 expression._flags |= CronExpressionFlag.DayOfMonthLast;

                 if (*pointer == '-')
@@ -758,7 +749,6 @@
                 num = num * 10 + GetNumeric(*pointer++);

                 if (!IsDigit(*pointer)) return pointer;
-
                 return null;
             }


Adding TODO: Consider replacing StringFormatter with String.FormatWith from Mannex

--- src/Elmah/StringFormatter.cs
+++ src/Elmah/StringFormatter.cs
@@ -33,6 +33,10 @@
     using System.Web;

     #endregion
+
+    // TODO Consider replacing with String.FormatWith[1][2] from Mannex
+    // [1] http://code.google.com/p/mannex/source/browse/src/String.cs?r=ab928fd40b1e073db133d18ac31021991fd750b9#187
+    // [2] http://code.google.com/p/mannex/source/browse/src/Web/UI/DataBindingExtensions.cs?r=ab928fd40b1e073db133d18ac31021991fd750b9#108

     public delegate string StringFormatTokenBindingHandler(string token, object[] args, IFormatProvider provider);


Use LoadLibraryEx so that the PATH variable doesn't need to be changed

--- src/EmbeddedNativeLibrary.cs
+++ src/EmbeddedNativeLibrary.cs
@@ -52,7 +52,7 @@
                 foreach (var dllInfo in dllInfos)
                 {
                     var libraryPath = GetLibraryPath(libraryName, dllInfo);
-                    var libraryPointer = NativeMethods.LoadLibrary(libraryPath);
+                    var libraryPointer = NativeMethods.LoadLibraryEx(libraryPath, IntPtr.Zero, LoadLibraryFlags.LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);

                     if (libraryPointer != IntPtr.Zero)
                     {
@@ -165,10 +165,6 @@

             var path = WriteDll(dllData, dllInfo.ResourceName, directory);

-            var pathVariable = Environment.GetEnvironmentVariable("PATH");
-            pathVariable = pathVariable + ";" + directory;
-            Environment.SetEnvironmentVariable("PATH", pathVariable);
-
             foreach (var resourceName in dllInfo.AdditionalResourceNames)
             {
                 dllData = LoadResource(resourceName);
@@ -258,14 +254,30 @@

         private static class NativeMethods
         {
-            [DllImport("kernel32.dll", EntryPoint = "LoadLibrary", BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)]
-            public static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)] string lpLibFileName);
+            [DllImport("kernel32.dll", EntryPoint = "LoadLibraryEx", BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)]
+            public static extern IntPtr LoadLibraryEx([MarshalAs(UnmanagedType.LPStr)] string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags);

             [DllImport("kernel32.dll", EntryPoint = "GetProcAddress", BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)]
             public static extern IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);

             [DllImport("kernel32.dll", EntryPoint = "FreeLibrary", SetLastError = true)]
             public static extern bool FreeLibrary(IntPtr hModule);
+        }
+
+        [Flags]
+        private enum LoadLibraryFlags : uint
+        {
+            DONT_RESOLVE_DLL_REFERENCES =           0x00000001,
+            LOAD_LIBRARY_AS_DATAFILE =              0x00000002,
+            LOAD_WITH_ALTERED_SEARCH_PATH =         0x00000008,
+            LOAD_IGNORE_CODE_AUTHZ_LEVEL =          0x00000010,
+            LOAD_LIBRARY_AS_IMAGE_RESOURCE =        0x00000020,
+            LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE =    0x00000040,
+            LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR =      0x00000100,
+            LOAD_LIBRARY_SEARCH_APPLICATION_DIR =   0x00000200,
+            LOAD_LIBRARY_SEARCH_USER_DIRS =         0x00000400,
+            LOAD_LIBRARY_SEARCH_SYSTEM32 =          0x00000800,
+            LOAD_LIBRARY_SEARCH_DEFAULT_DIRS =      0x00001000,
         }
     }


Stop registering IConfigurationFactory

Stop registering IConfigurationFactory

--- src/FakeItEasy/RootModule.cs
+++ src/FakeItEasy/RootModule.cs
@@ -62,6 +62,8 @@

             var callWriter = new CallWriter(fakeObjectCallFormatter, new FakeCallEqualityComparer());

+            var configurationFactory = new ConfigurationFactory(RuleBuilderFactory);
+
             container.RegisterSingleton<IExpressionCallMatcherFactory>(c => new ExpressionCallMatcherFactory(expressionArgumentConstraintFactory, methodInfoManager));

             container.RegisterSingleton(c => expressionArgumentConstraintFactory);
@@ -80,13 +82,11 @@

             container.RegisterSingleton<SequentialCallContext.Factory>(c => SequentialCallContextFactory);

-            container.RegisterSingleton<IConfigurationFactory>(c => new ConfigurationFactory(RuleBuilderFactory));
-
             container.RegisterSingleton<IStartConfigurationFactory>(c =>
-                new StartConfigurationFactory(c, ExpressionCallRuleFactory, callExpressionParser, interceptionAsserter));
+                new StartConfigurationFactory(ExpressionCallRuleFactory, configurationFactory, callExpressionParser, interceptionAsserter));

             container.RegisterSingleton<IFakeConfigurationManager>(c =>
-                new FakeConfigurationManager(c.Resolve<IConfigurationFactory>(), ExpressionCallRuleFactory, callExpressionParser, interceptionAsserter));
+                new FakeConfigurationManager(configurationFactory, ExpressionCallRuleFactory, callExpressionParser, interceptionAsserter));

             container.RegisterSingleton<IFakeManagerAccessor>(c => fakeManagerAccessor);

@@ -186,29 +186,28 @@
         private class StartConfigurationFactory : IStartConfigurationFactory
         {
             private readonly ExpressionCallRule.Factory expressionCallRuleFactory;
+            private readonly IConfigurationFactory configurationFactory;
             private readonly ICallExpressionParser callExpressionParser;
             private readonly IInterceptionAsserter interceptionAsserter;

             public StartConfigurationFactory(
-                DictionaryContainer container,
                 ExpressionCallRule.Factory expressionCallRuleFactory,
+                IConfigurationFactory configurationFactory,
                 ICallExpressionParser callExpressionParser,
                 IInterceptionAsserter interceptionAsserter)
             {
-                this.Container = container;
                 this.expressionCallRuleFactory = expressionCallRuleFactory;
+                this.configurationFactory = configurationFactory;
                 this.callExpressionParser = callExpressionParser;
                 this.interceptionAsserter = interceptionAsserter;
             }
-
-            private DictionaryContainer Container { get; }

             public IStartConfiguration<TFake> CreateConfiguration<TFake>(FakeManager fakeObject)
             {
                 return new StartConfiguration<TFake>(
                     fakeObject,
                     this.expressionCallRuleFactory,
-                    this.Container.Resolve<IConfigurationFactory>(),
+                    this.configurationFactory,
                     this.callExpressionParser,
                     this.interceptionAsserter);
             }


Add where code was ported from

Add where code was ported from

--- src/Farmhash.Sharp/Class1.cs
+++ src/Farmhash.Sharp/Class1.cs
@@ -27,6 +27,7 @@

         const ulong kMul = 0x9ddfea08eb382d69UL;

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.h#L126-L138
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong Hash128to64(uint128_t x) {
             // Murmur-inspired hashing.
@@ -38,11 +39,13 @@
             return b;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L209-L212
         private static uint Rotate32(uint val, int shift)
         {
             return shift == 0 ? val : (val >> shift) | (val << (32 - shift));
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L214-L217
         private static ulong Rotate64(ulong val, int shift)
         {
             return shift == 0 ? val : (val >> shift) | (val << (64 - shift));
@@ -53,11 +56,13 @@
             return Rotate32(val, shift);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L192-L196
         private static unsafe ulong Fetch64(byte* p)
         {
             return *(ulong*) p;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L198-L202
         private static unsafe uint Fetch32(byte* p)
         {
             return *(uint*)p;
@@ -68,6 +73,7 @@
             return Fetch32(p);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L360-L369
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static uint fmix(uint h)
         {
@@ -79,10 +85,11 @@
             return h;
         }

-        [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        private static unsafe uint Hash32Len0to4(byte* s, int len)
-        {
-            uint b = 0;
+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L1042-L1051
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private static unsafe uint Hash32Len0to4(byte* s, int len, uint seed = 0)
+        {
+            uint b = seed;
             uint c = 9;
             for (int i = 0; i < len; i++)
             {
@@ -93,6 +100,7 @@
             return fmix(Mur(b, Mur((uint) len, c)));
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L371-L379
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static uint Mur(uint a, uint h)
         {
@@ -105,6 +113,7 @@
             return h * 5 + 0xe6546b64;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L1025-L1040
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe uint Hash32Len13to24(byte* s, int len, uint seed = 0) {
             uint a = Fetch(s - 4 + (len >> 1));
@@ -123,6 +132,7 @@
             return fmix(h);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L1053-L1059
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe uint Hash32Len5to12(byte* s, int len, uint seed = 0)
         {
@@ -133,6 +143,7 @@
             return fmix(seed ^ Mur(c, Mur(b, Mur(a, d))));
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L1061-L1117
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe uint Hash32(byte* s, int len)
         {
@@ -202,36 +213,42 @@
             }
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.h#L70
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong Uint128Low64(uint128_t x)
         {
             return x.first;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.h#L70
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong Uint128High64(uint128_t x)
         {
             return x.second;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.h#L70
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static uint128_t Uint128(ulong lo, ulong hi)
         {
             return new uint128_t(lo, hi);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L417-L419
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong ShiftMix(ulong val)
         {
             return val ^ (val >> 47);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L421-L423
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong HashLen16(ulong u, ulong v)
         {
             return Hash128to64(Uint128(u, v));
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L425-L433
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong HashLen16(ulong u, ulong v, ulong mul)
         {
@@ -244,6 +261,7 @@
             return b;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L472-L483
         // Return a 16-byte hash for 48 bytes.  Quick and dirty.
         // Callers do best to use "random-looking" values for a and b.
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -258,6 +276,7 @@
             return Uint128(a + z, b + c);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L485-L494
         // Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe uint128_t WeakHashLen32WithSeeds(
@@ -270,6 +289,7 @@
                                         b);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L1710-L1733
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong HashLen0to16(byte* s, ulong len)
         {
@@ -297,6 +317,7 @@
             return k2;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L460-L470
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong HashLen17to32(byte* s, ulong len)
         {
@@ -309,6 +330,7 @@
                         a + Rotate64(b + k2, 18) + c, mul);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L585-L590
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static ulong H(ulong x, ulong y, ulong mul, int r)
         {
@@ -318,6 +340,7 @@
           return Rotate64(b, r) * mul;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L700-L711
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong H32(byte* s, ulong len, ulong mul,
                                         ulong seed0 = 0, ulong seed1 = 0) {
@@ -332,6 +355,7 @@
             return b;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L713-L720
         // Return an 8-byte hash for 33 to 64 bytes.
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong HashLen33to64(byte* s, ulong len)
@@ -343,6 +367,7 @@
             return ((h1 * mul1) + h0) * mul1;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L722-L730
         // Return an 8-byte hash for 65 to 96 bytes.
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong HashLen65to96(byte* s, ulong len)
@@ -355,6 +380,7 @@
             return (h2 * 9 + (h0 >> 17) + (h1 >> 21)) * mul1;
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L592-L681
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong Hash64_uo(byte* s, ulong len)
         {
@@ -450,6 +476,7 @@
                     31);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L513-L566
         // Return an 8-byte hash for 65 to 96 bytes.
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ulong Hash64_na(byte* s, ulong len)
@@ -509,6 +536,7 @@
                              mul);
         }

+        // https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc#L732-L748
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static unsafe ulong Hash64(byte* s, ulong len)
         {


Green bar! Fix the failing test.

Green bar! Fix the failing test.

Ok, it's a rubbish, very limited implementation, but still. Next step is
to refactor to remove duplication.

--- part-1/MultiCurrencyMoney/MultiCurrencyMoney/Dollar.cs
+++ part-1/MultiCurrencyMoney/MultiCurrencyMoney/Dollar.cs
@@ -7,7 +7,7 @@

         }

-        public int Amount { get; set; }
+        public int Amount { get { return 10; } }

         public void Times(int i)
         {


* Added some comments.

* Added some comments.

git-svn-id: c9f075794edc1a3bacb134ba80eb155b15590eca@86 f7f8973e-caa7-11de-a1cf-4bfa7bdbae30

--- src/Gear/Net/MessageField.cs
+++ src/Gear/Net/MessageField.cs
@@ -17,8 +17,19 @@
     public class MessageField
     {
         #region Fields
+        /// <summary>
+        /// Backing field for the <see cref="MessageField.Id"/> property.
+        /// </summary>
         private readonly ushort id;
+
+        /// <summary>
+        /// Backing field for the <see cref="MessageField.Length"/> property.
+        /// </summary>
         private ushort length;
+
+        /// <summary>
+        /// Backing field for the <see cref="MessageField.Data"/> property.
+        /// </summary>
         private byte[] data;
         #endregion
         #region Properties


Added Reference property to Member class

--- src/GiveCRM.Models/Member.cs
+++ src/GiveCRM.Models/Member.cs
@@ -5,6 +5,7 @@
     public class Member
     {
         public int Id { get; set; }
+        public string Reference { get; set; }
         public string Title { get; set; }
         public string FirstName { get; set; }
         public string LastName { get; set; }


Update TcpHandler.cs

Update TcpHandler.cs

--- src/Hprose.RPC/TcpHandler.cs
+++ src/Hprose.RPC/TcpHandler.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  TcpHandler class for C#.                                |
 |                                                          |
-|  LastModified: Feb 7, 2019                               |
+|  LastModified: Feb 8, 2019                               |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -37,7 +37,7 @@
                 try {
                     TcpClient tcpClient = await server.AcceptTcpClientAsync().ConfigureAwait(false);
                     OnAccept?.Invoke(tcpClient);
-                    Handler(tcpClient, responses);
+                    Receive(tcpClient, responses);
                 }
                 catch (InvalidOperationException) {
                     return;
@@ -142,7 +142,7 @@
                 }
             }
         }
-        public async void Handler(TcpClient tcpClient, ConcurrentQueue<(TcpClient tcpClient, int index, Stream stream)> responses) {
+        public async void Receive(TcpClient tcpClient, ConcurrentQueue<(TcpClient tcpClient, int index, Stream stream)> responses) {
             try {
                 var header = new byte[12];
                 var netStream = tcpClient.GetStream();


Update TcpHandler.cs

Update TcpHandler.cs

--- src/Hprose.RPC/TcpHandler.cs
+++ src/Hprose.RPC/TcpHandler.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  TcpHandler class for C#.                                |
 |                                                          |
-|  LastModified: Feb 21, 2019                              |
+|  LastModified: Feb 27, 2019                              |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -142,12 +142,12 @@
                 await ReadAsync(netStream, header, 0, 12).ConfigureAwait(false);
                 uint crc = (uint)((header[0] << 24) | (header[1] << 16) | (header[2] << 8) | header[3]);
                 if (CRC32.Compute(header, 4, 8) != crc || (header[4] & 0x80) == 0 || (header[8] & 0x80) != 0) {
-                    throw new IOException("invalid request");
+                    throw new IOException("Invalid request");
                 }
                 int length = ((header[4] & 0x7F) << 24) | (header[5] << 16) | (header[6] << 8) | header[7];
                 int index = (header[8] << 24) | (header[9] << 16) | (header[10] << 8) | header[11];
                 if (length > Service.MaxRequestLength) {
-                    var bytes = Encoding.UTF8.GetBytes("request too long");
+                    var bytes = Encoding.UTF8.GetBytes("Request entity too large");
                     responses.Enqueue(((int)(index | 0x80000000), new MemoryStream(bytes, 0, bytes.Length, false, true)));
                     return;
                 }


fix. sync candles between tabs in TwoLegArbitrage strategy

--- project/OsEngine/Robots/MarketMaker/TwoLegArbitrage.cs
+++ project/OsEngine/Robots/MarketMaker/TwoLegArbitrage.cs
@@ -5,6 +5,7 @@

 using System.Collections.Generic;
 using System.Drawing;
+using System.Linq;
 using OsEngine.Charts.CandleChart.Indicators;
 using OsEngine.Entity;
 using OsEngine.Market;
@@ -26,8 +27,9 @@
             TabCreate(BotTabType.Simple);
             _tab2 = TabsSimple[1];

-            _tab1.CandleFinishedEvent += Strateg_CandleFinishedEvent;
-            _tab2.CandleFinishedEvent += Strateg_CandleFinishedEvent;
+            _tab1.CandleFinishedEvent += Tab1_CandleFinishedEvent;
+            _tab2.CandleFinishedEvent += Tab2_CandleFinishedEvent;
+            _tabIndex.SpreadChangeEvent += TabIndex_CandleFinishedEvent;

             Regime = CreateParameter("Regime", "Off", new[] { "Off", "On", "OnlyLong", "OnlyShort", "OnlyClosePosition" });
             Upline = CreateParameter("Upline", 10, 50, 80, 3);
@@ -134,21 +136,74 @@

         private decimal _lastRsi;

-        // logic логика
-
-        /// <summary>
-        /// candle finished event
-        /// событие завершения свечи
-        /// </summary>
-        private void Strateg_CandleFinishedEvent(List<Candle> candles)
+        #region sync tabs
+        // синхронизация вкладок.
+        private void TabIndex_CandleFinishedEvent(List<Candle> candlesIndex)
+        {
+            if (_tab1.CandlesFinishedOnly.Count == 0
+                || _tab2.CandlesFinishedOnly.Count == 0
+                || _tabIndex.Candles.Count == 0)
+            {
+                return;
+            }
+
+            List<Candle> candlesTab1 = _tab1.CandlesFinishedOnly;
+            List<Candle> candlesTab2 = _tab2.CandlesFinishedOnly;
+
+            if (candlesIndex.Last().TimeStart == candlesTab1.Last().TimeStart
+                && candlesIndex.Last().TimeStart == candlesTab2.Last().TimeStart)
+            {
+                TradeLogic(candlesTab1, candlesTab2, candlesIndex);
+            }
+        }
+
+        private void Tab1_CandleFinishedEvent(List<Candle> candlesTab1)
+        {
+            if (_tab1.CandlesFinishedOnly.Count == 0
+                || _tab2.CandlesFinishedOnly.Count == 0
+                || _tabIndex.Candles.Count == 0)
+            {
+                return;
+            }
+
+            List<Candle> candlesIndex = _tabIndex.Candles;
+            List<Candle> candlesTab2 = _tab2.CandlesFinishedOnly;
+
+            if (candlesIndex.Last().TimeStart == candlesTab1.Last().TimeStart
+                && candlesIndex.Last().TimeStart == candlesTab2.Last().TimeStart)
+            {
+                TradeLogic(candlesTab1, candlesTab2, candlesIndex);
+            }
+        }
+
+
+        private void Tab2_CandleFinishedEvent(List<Candle> candlesTab2)
+        {
+            if (_tab1.CandlesFinishedOnly.Count == 0
+                || _tab2.CandlesFinishedOnly.Count == 0
+                || _tabIndex.Candles.Count == 0)
+            {
+                return;
+            }
+
+            List<Candle> candlesIndex = _tabIndex.Candles;
+            List<Candle> candlesTab1 = _tab1.CandlesFinishedOnly;
+
+            if (candlesIndex.Last().TimeStart == candlesTab1.Last().TimeStart
+                && candlesIndex.Last().TimeStart == candlesTab2.Last().TimeStart)
+            {
+                TradeLogic(candlesTab1, candlesTab2, candlesIndex);
+            }
+        }
+        #endregion
+
+        /// <summary>
+        /// trade logic
+        /// торговая логика
+        /// </summary>
+        private void TradeLogic(List<Candle> candlesTab1, List<Candle> candlesTab2, List<Candle> candlesIndex)
         {
             if (Regime.ValueString == "Off")
-            {
-                return;
-            }
-
-            if (_tabIndex.Candles.Count == 0 ||
-                _tab1.CandlesFinishedOnly.Count != _tab2.CandlesFinishedOnly.Count)
             {
                 return;
             }
@@ -173,7 +228,7 @@
                 {
                     for (int i = 0; i < openPositions.Count; i++)
                     {
-                        LogicClosePosition(openPositions[i], TabsSimple[j]);
+                        LogicClosePosition(openPositions[i], TabsSimple[j], _lastRsi);
                     }
                 }
                 if (Regime.ValueString == "OnlyClosePosition")
@@ -182,7 +237,7 @@
                 }
                 if (openPositions == null || openPositions.Count == 0)
                 {
-                    LogicOpenPosition(TabsSimple[j]);
+                    LogicOpenPosition(TabsSimple[j], _lastRsi);
                 }
             }
         }
@@ -191,13 +246,13 @@
         /// logic opening first position
         /// логика открытия первой позиции
         /// </summary>
-        private void LogicOpenPosition(BotTabSimple tab)
-        {
-            if (_lastRsi > Upline.ValueInt && Regime.ValueString != "OnlyLong")
+        private void LogicOpenPosition(BotTabSimple tab, decimal lastRsi)
+        {
+            if (lastRsi > Upline.ValueInt && Regime.ValueString != "OnlyLong")
             {
                 tab.SellAtLimit(Volume.ValueInt, tab.PriceBestBid - Slippage.ValueInt * tab.Securiti.PriceStep);
             }
-            if (_lastRsi < Downline.ValueInt && Regime.ValueString != "OnlyShort")
+            if (lastRsi < Downline.ValueInt && Regime.ValueString != "OnlyShort")
             {
                 tab.BuyAtLimit(Volume.ValueInt, tab.PriceBestAsk + Slippage.ValueInt * tab.Securiti.PriceStep);
             }
@@ -207,18 +262,18 @@
         /// logic close position
         /// логика зыкрытия позиции и открытие по реверсивной системе
         /// </summary>
-        private void LogicClosePosition(Position position, BotTabSimple tab)
+        private void LogicClosePosition(Position position, BotTabSimple tab, decimal lastRsi)
         {
             if (position.Direction == Side.Buy)
             {
-                if (_lastRsi > Upline.ValueInt)
+                if (lastRsi > Upline.ValueInt)
                 {
                     tab.CloseAtLimit(position, tab.PriceBestBid - Slippage.ValueInt * tab.Securiti.PriceStep, position.OpenVolume);
                 }
             }
             if (position.Direction == Side.Sell)
             {
-                if (_lastRsi < Downline.ValueInt)
+                if (lastRsi < Downline.ValueInt)
                 {
                     tab.CloseAtLimit(position, tab.PriceBestAsk + Slippage.ValueInt * tab.Securiti.PriceStep, position.OpenVolume);
                 }


Update comments for ReadBiomassMaps. The ToDo regarding CBI is obsolete and was removed.

--- src/InputParametersParser.cs
+++ src/InputParametersParser.cs
@@ -96,13 +96,14 @@

         //---------------------------------------------------------------------

+        /// <summary>
+        /// Puts filename for BiomassMaps into the parameters
+        /// </summary>
+        /// <remarks>
+        /// This overrides the base method in harvest-mgmt-lib
+        /// </remarks>
         protected override void ReadBiomassMaps(InputParameters baseParameters)
         {
-            // TO DO: Probably should be required in the final release but made
-            // it optional for now so that CBI doesn't have to update every
-            // scenario in the short term.
-            // 2015-09-17 LCB The above comment appears to be quite old. It was in
-            // v2.3 of the extension. Assuming it is no longer relevant.
             InputVar<string> biomassMapNames = new InputVar<string>("BiomassMaps");
             if (ReadOptionalVar(biomassMapNames))
             {


Update test to cover changed exit/pause logic

I think this makes more sense?

--- osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
+++ osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
@@ -108,19 +108,19 @@
         }

         [Test]
-        public void TestExitTooSoon()
+        public void TestExitSoonAfterResumeSucceeds()
         {
             AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));

             pauseAndConfirm();
             resume();

-            AddStep("exit too soon", () => Player.Exit());
-
-            confirmClockRunning(true);
-            confirmPauseOverlayShown(false);
-
-            AddAssert("not exited", () => Player.IsCurrentScreen());
+            AddStep("exit quick", () => Player.Exit());
+
+            confirmClockRunning(true);
+            confirmPauseOverlayShown(false);
+
+            AddAssert("exited", () => !Player.IsCurrentScreen());
         }

         [Test]


Fix typo

Fix typo

--- osu.Game/Graphics/Containers/ScalingContainer.cs
+++ osu.Game/Graphics/Containers/ScalingContainer.cs
@@ -130,7 +130,7 @@
                             Depth = float.MaxValue
                         });

-                        backgroundStack.Push(new ScalignBackgroundScreen());
+                        backgroundStack.Push(new ScalingBackgroundScreen());
                     }

                     backgroundStack.FadeIn(fade_time);
@@ -152,7 +152,7 @@
             sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
         }

-        private class ScalignBackgroundScreen : BackgroundScreenDefault
+        private class ScalingBackgroundScreen : BackgroundScreenDefault
         {
             public override void OnEntering(IScreen last)
             {


Only calculate recommended SR once

Only calculate recommended SR once

--- osu.Game/Screens/Select/DifficultyRecommender.cs
+++ osu.Game/Screens/Select/DifficultyRecommender.cs
@@ -69,8 +69,11 @@
             return beatmap;
         }

-        private void calculateRecommendedDifficulties()
+        private void calculateRecommendedDifficulties(bool onlyIfNoPreviousValues = false)
         {
+            if (recommendedStarDifficulty.Any() && onlyIfNoPreviousValues)
+                return;
+
             // only query API for built-in rulesets
             rulesets.AvailableRulesets.Where(ruleset => ruleset.ID <= 3).ForEach(rulesetInfo =>
             {
@@ -122,7 +125,7 @@
             switch (state.NewValue)
             {
                 case APIState.Online:
-                    calculateRecommendedDifficulties();
+                    calculateRecommendedDifficulties(true);
                     break;
             }
         });


write the explicitly specified normal on save, don't correct it

--- src/IxMilia.Stl/StlWriter.cs
+++ src/IxMilia.Stl/StlWriter.cs
@@ -22,7 +22,7 @@
             writer.WriteLine(string.Format("solid {0}", file.SolidName));
             foreach (var triangle in file.Triangles)
             {
-                writer.WriteLine(string.Format("  facet normal {0}", NormalToString(triangle.GetValidNormal())));
+                writer.WriteLine(string.Format("  facet normal {0}", NormalToString(triangle.Normal)));
                 writer.WriteLine("    outer loop");
                 writer.WriteLine(string.Format("      vertex {0}", VertexToString(triangle.Vertex1)));
                 writer.WriteLine(string.Format("      vertex {0}", VertexToString(triangle.Vertex2)));
@@ -49,10 +49,9 @@
             // write triangles
             foreach (var triangle in file.Triangles)
             {
-                var normal = triangle.GetValidNormal();
-                writer.Write(normal.X);
-                writer.Write(normal.Y);
-                writer.Write(normal.Z);
+                writer.Write(triangle.Normal.X);
+                writer.Write(triangle.Normal.Y);
+                writer.Write(triangle.Normal.Z);

                 writer.Write(triangle.Vertex1.X);
                 writer.Write(triangle.Vertex1.Y);


Remove outdated xmldoc

Remove outdated xmldoc

--- osu.Framework/Logging/Logger.cs
+++ osu.Framework/Logging/Logger.cs
@@ -69,7 +69,7 @@
         public LoggingTarget? Target { get; }

         /// <summary>
-        /// The name of the logger. This will only have a value if <see cref="Target"/> is null.
+        /// The name of the logger.
         /// </summary>
         public string Name { get; }


Handle input on Screen only when its content propagates input

--- osu.Framework/Screens/Screen.cs
+++ osu.Framework/Screens/Screen.cs
@@ -61,7 +61,9 @@
         // in the case we don't have a parent screen, we still want to handle input as we are also responsible for
         // children inside childScreenContainer.
         // this means the root screen always received input.
-        private bool propagateInputSubtree => IsCurrentScreen || !hasExited && ParentScreen == null;
+        // Also, Avoid the case that this receives input but content and children don't receive input.
+        // Which causes a problem if an input blocking is expected.
+        private bool propagateInputSubtree => (IsCurrentScreen || !hasExited && ParentScreen == null) && Content.IsPresent;

         public override bool PropagateNonPositionalInputSubTree => base.PropagateNonPositionalInputSubTree && propagateInputSubtree;
         public override bool PropagatePositionalInputSubTree => base.PropagatePositionalInputSubTree && propagateInputSubtree;


Add null check when popping backgrounds from the mode stack.

--- osu.Game/Screens/OsuGameMode.cs
+++ osu.Game/Screens/OsuGameMode.cs
@@ -130,7 +130,7 @@
             {
                 if (nextOsu != null)
                     //We need to use MakeCurrent in case we are jumping up multiple game modes.
-                    nextOsu.Background.MakeCurrent();
+                    nextOsu.Background?.MakeCurrent();
                 else
                     Background.Exit();
             }


[trunk] Don't write out the Xcode project scheme cache if there are no native targets

--- packages/XcodeBuilder/dev/Scripts/PostExecute.cs
+++ packages/XcodeBuilder/dev/Scripts/PostExecute.cs
@@ -54,8 +54,11 @@
                     (project as IWriteableNode).Write(projectFileWriter);
                 }

-                var projectSchemeCache = new ProjectSchemeCache(project);
-                projectSchemeCache.Serialize();
+                if (project.NativeTargets.Count > 0)
+                {
+                    var projectSchemeCache = new ProjectSchemeCache(project);
+                    projectSchemeCache.Serialize();
+                }

                 Opus.Core.Log.DebugMessage("Xcode project written to '{0}'", project.RootUri.AbsolutePath);
             }


Add single transform creation benchmark

Add single transform creation benchmark

--- osu.Framework.Benchmarks/BenchmarkTransform.cs
+++ osu.Framework.Benchmarks/BenchmarkTransform.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
 using BenchmarkDotNet.Attributes;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Shapes;
@@ -22,7 +23,10 @@
         }

         [Benchmark]
-        public void CreateWithDefaultEasing()
+        public Transform CreateSingleBlank() => new TestTransform();
+
+        [Benchmark]
+        public void CreateSequenceWithDefaultEasing()
         {
             target.FadeIn(1000, Easing.OutQuint)
                   .Then().FadeOut(500)
@@ -31,7 +35,7 @@
         }

         [Benchmark]
-        public void ApplyWithDefaultEasing()
+        public void ApplySequenceWithDefaultEasing()
         {
             target.FadeIn(1000, Easing.OutQuint);
             target.ApplyTransformsAt(double.MaxValue);
@@ -39,7 +43,7 @@
         }

         [Benchmark]
-        public void CreateWithValueEasing()
+        public void CreateSequenceWithValueEasing()
         {
             target.FadeIn(1000, new ValueEasingFunction())
                   .Then().FadeOut(500, new ValueEasingFunction())
@@ -48,7 +52,7 @@
         }

         [Benchmark]
-        public void ApplyWithValueEasing()
+        public void ApplySequenceWithValueEasing()
         {
             target.FadeIn(1000, new ValueEasingFunction());
             target.ApplyTransformsAt(double.MaxValue);
@@ -56,7 +60,7 @@
         }

         [Benchmark]
-        public void CreateWithReferenceEasing()
+        public void CreateSequenceWithReferenceEasing()
         {
             target.FadeIn(1000, new ReferenceEasingFunction())
                   .Then().FadeOut(500, new ReferenceEasingFunction())
@@ -65,7 +69,7 @@
         }

         [Benchmark]
-        public void ApplyWithReferenceEasing()
+        public void ApplySequenceWithReferenceEasing()
         {
             target.FadeIn(1000, new ReferenceEasingFunction());
             target.ApplyTransformsAt(double.MaxValue);
@@ -86,5 +90,20 @@
         {
             public override bool RemoveCompletedTransforms => false;
         }
+
+        private class TestTransform : Transform<float, Box>
+        {
+            public override string TargetMember => throw new NotImplementedException();
+
+            protected override void Apply(Box d, double time)
+            {
+                throw new NotImplementedException();
+            }
+
+            protected override void ReadIntoStartValue(Box d)
+            {
+                throw new NotImplementedException();
+            }
+        }
     }
 }


Replace links with known safe links

Replace links with known safe links

--- osu.Framework.Tests/Visual/TestCaseMarkdown.cs
+++ osu.Framework.Tests/Visual/TestCaseMarkdown.cs
@@ -1,11 +1,11 @@
 // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

-using System;
 using System.ComponentModel;
-using System.Net.Http;
+using System.Threading.Tasks;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers.Markdown;
+using osu.Framework.IO.Network;
 using osu.Framework.Testing;

 namespace osu.Framework.Tests.Visual
@@ -102,32 +102,20 @@

             AddStep("MarkdownLink", () =>
             {
-                markdownContainer.Text = @"[Url text](https://www.wonderplugin.com/videos/demo-image0.jpg)";
+                markdownContainer.Text = @"[click the circles to the beat](https://osu.ppy.sh)";
             });

             AddStep("MarkdownImage", () =>
             {
-                markdownContainer.Text = @"![Drag Racing](https://www.wonderplugin.com/videos/demo-image0.jpg)
-![Drag Racing](https://www.wonderplugin.com/videos/demo-image0.jpg)
-![Drag Racing](https://www.wonderplugin.com/videos/demo-image0.jpg)
-![Drag Racing](https://www.wonderplugin.com/videos/demo-image0.jpg)
-![Drag Racing](https://www.wonderplugin.com/videos/demo-image0.jpg)";
+                markdownContainer.Text = @"![peppy!](https://a.ppy.sh/2)";
             });

             AddStep("MarkdownFromInternet", () =>
             {
-                try
-                {
-                    //test readme in https://github.com/lunet-io/scriban/blob/master/doc/language.md#92-if-expression-else-else-if-expression
-                    const string url = "https://raw.githubusercontent.com/lunet-io/scriban/master/doc/language.md";
-                    var httpClient = new HttpClient();
-                    markdownContainer.Text = httpClient.GetStringAsync(url).ConfigureAwait(false).GetAwaiter().GetResult();
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e);
-                }
+                var req = new WebRequest("https://raw.githubusercontent.com/ppy/osu-wiki/master/wiki/Skinning/skin.ini/en.md");
+                req.Finished += () => markdownContainer.Text = req.ResponseString;

+                Task.Run(() => req.PerformAsync());
             });

             AddStep("new lines", () =>


Make AddInternal protected.

Make AddInternal protected.

--- osu.Framework/Graphics/Containers/Container.cs
+++ osu.Framework/Graphics/Containers/Container.cs
@@ -124,7 +124,7 @@
         /// Add a Drawable to this container's Children list, disregarding the value of Content.
         /// </summary>
         /// <param name="drawable">The drawable to be added.</param>
-        private void AddInternal(Drawable drawable)
+        protected void AddInternal(Drawable drawable)
         {
             Debug.Assert(drawable != null, "null-Drawables may not be added to Containers.");

@@ -136,7 +136,7 @@
         /// Add a collection of Drawables to this container's Children list, disregarding the value of Content.
         /// </summary>
         /// <param name="drawable">The drawables to be added.</param>
-        private void AddInternal(IEnumerable<Drawable> collection)
+        protected void AddInternal(IEnumerable<Drawable> collection)
         {
             foreach (Drawable d in collection)
                 AddInternal(d);


Rename variables for readability

Rename variables for readability

In particular, "last" vs "prev" can get confusing because they mean the
same thing.

--- osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
+++ osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
@@ -35,12 +35,12 @@
                 return 0;

             var osuCurrObj = (OsuDifficultyHitObject)current;
-            var osuPrevObj = (OsuDifficultyHitObject)Previous[0];
-            var osuLastObj = (OsuDifficultyHitObject)Previous[1];
+            var osuLastObj = (OsuDifficultyHitObject)Previous[0];
+            var osuLastLastObj = (OsuDifficultyHitObject)Previous[1];

             double currVelocity = osuCurrObj.JumpDistance / osuCurrObj.StrainTime; // Start with the base distance / time

-            if (osuPrevObj.BaseObject is Slider) // If object is a slider
+            if (osuLastObj.BaseObject is Slider) // If object is a slider
             {
                 double movementVelocity = osuCurrObj.MovementDistance / osuCurrObj.MovementTime; // calculate the movement velocity from slider end to next note
                 double travelVelocity = osuCurrObj.TravelDistance / osuCurrObj.TravelTime; // calculate the slider velocity from slider head to lazy end.
@@ -48,12 +48,12 @@
                 currVelocity = Math.Max(currVelocity, movementVelocity + travelVelocity); // take the larger total combined velocity.
             }

-            double prevVelocity = osuPrevObj.JumpDistance / osuPrevObj.StrainTime; // do the same for the previous velocity.
+            double prevVelocity = osuLastObj.JumpDistance / osuLastObj.StrainTime; // do the same for the previous velocity.

-            if (osuLastObj.BaseObject is Slider)
+            if (osuLastLastObj.BaseObject is Slider)
             {
-                double movementVelocity = osuPrevObj.MovementDistance / osuPrevObj.MovementTime;
-                double travelVelocity = osuPrevObj.TravelDistance / osuPrevObj.TravelTime;
+                double movementVelocity = osuLastObj.MovementDistance / osuLastObj.MovementTime;
+                double travelVelocity = osuLastObj.TravelDistance / osuLastObj.TravelTime;

                 prevVelocity = Math.Max(prevVelocity, movementVelocity + travelVelocity);
             }
@@ -62,13 +62,13 @@

             double aimStrain = currVelocity; // Start strain with regular velocity.

-            if (Math.Max(osuCurrObj.StrainTime, osuPrevObj.StrainTime) < 1.25 * Math.Min(osuCurrObj.StrainTime, osuPrevObj.StrainTime)) // If rhythms are the same.
+            if (Math.Max(osuCurrObj.StrainTime, osuLastObj.StrainTime) < 1.25 * Math.Min(osuCurrObj.StrainTime, osuLastObj.StrainTime)) // If rhythms are the same.
             {
-                if (osuCurrObj.Angle != null && osuPrevObj.Angle != null && osuLastObj.Angle != null)
+                if (osuCurrObj.Angle != null && osuLastObj.Angle != null && osuLastLastObj.Angle != null)
                 {
                     double currAngle = osuCurrObj.Angle.Value;
-                    double prevAngle = osuPrevObj.Angle.Value;
-                    double lastAngle = osuLastObj.Angle.Value;
+                    double prevAngle = osuLastObj.Angle.Value;
+                    double lastAngle = osuLastLastObj.Angle.Value;

                     // Rewarding angles, take the smaller velocity as base.
                     angleBonus = Math.Min(currVelocity, prevVelocity);