Fix some grammar in xmldocs

Fix some grammar in xmldocs

--- osu.Framework/Input/TextInputSource.cs
+++ osu.Framework/Input/TextInputSource.cs
@@ -14,7 +14,7 @@
     public class TextInputSource
     {
         /// <summary>
-        /// Whether the IME is actively providing text composition through <see cref="OnImeComposition"/> and accepting input from the user.
+        /// Whether IME is actively providing text composition through <see cref="OnImeComposition"/> and accepting input from the user.
         /// </summary>
         public bool ImeActive { get; protected set; }

@@ -36,10 +36,10 @@
         }

         /// <summary>
-        /// Gets all the text that was inputted by the user since the last <see cref="GetPendingText"/> call.
+        /// Gets all the text that was input by the user since the last <see cref="GetPendingText"/> call.
         /// </summary>
         /// <remarks>
-        /// Should be periodically called to collect user-inputted text.
+        /// Should be periodically called to collect user-input text.
         /// </remarks>
         public string GetPendingText()
         {
@@ -105,7 +105,7 @@
         /// Should be overriden per-platform.
         /// </summary>
         /// <remarks>
-        /// An active native implementation should add user inputted text with <see cref="AddPendingText"/>.
+        /// An active native implementation should add user input text with <see cref="AddPendingText"/>.
         /// and forward IME composition events through <see cref="TriggerImeComposition"/> and <see cref="TriggerImeResult"/>.
         /// </remarks>
         protected virtual void ActivateTextInput()
@@ -130,7 +130,7 @@
         }

         /// <summary>
-        /// Sets where the native implementation displays the IME and other text input elements.
+        /// Sets where the native implementation displays IME controls and other text input elements.
         /// </summary>
         /// <param name="rectangle">Should be provided in screen space.</param>
         public virtual void SetImeRectangle(RectangleF rectangle)
@@ -138,7 +138,7 @@
         }

         /// <summary>
-        /// Resets the IME.
+        /// Resets IME.
         /// This clears the current composition string and prepares it for new input.
         /// </summary>
         public virtual void ResetIme()
@@ -146,7 +146,7 @@
         }

         /// <summary>
-        /// Invoked when the IME composition starts or changes.
+        /// Invoked when IME composition starts or changes.
         /// </summary>
         /// <remarks>Empty string for text means that the composition has been cancelled.</remarks>
         public event ImeCompositionDelegate OnImeComposition;
@@ -163,7 +163,7 @@
         public delegate void ImeCompositionDelegate(string text, int start, int length);

         /// <summary>
-        /// Invoked when the IME composition successfully completes.
+        /// Invoked when IME composition successfully completes.
         /// </summary>
         public event Action<string> OnImeResult;


Undo some useless changes

Undo some useless changes

--- osu.Game/Overlays/Profile/RankChart.cs
+++ osu.Game/Overlays/Profile/RankChart.cs
@@ -81,9 +81,9 @@

         private void updateRankTexts()
         {
-            rankText.Text = rankedDays > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank";
-            performanceText.Text = rankedDays > 0 ? $"{user.Statistics.PP:#,0}pp" : string.Empty;
-            relativeText.Text = rankedDays > 0 ? $"{user.Country?.FullName} #{user.CountryRank:#,0}" : string.Empty;
+            rankText.Text = user.Statistics.Rank > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank";
+            performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty;
+            relativeText.Text = $"{user.Country?.FullName} #{user.CountryRank:#,0}";
         }

         private void showHistoryRankTexts(int dayIndex)


Avoid hard crash if `Save()` is called before preparing for mutation

--- osu.Game/Skinning/Editor/SkinEditor.cs
+++ osu.Game/Skinning/Editor/SkinEditor.cs
@@ -37,6 +37,8 @@

         [Resolved]
         private OsuColour colours { get; set; }
+
+        private bool hasBegunMutating;

         public SkinEditor(Drawable targetScreen)
         {
@@ -139,7 +141,11 @@
             // schedule ensures this only happens when the skin editor is visible.
             // also avoid some weird endless recursion / bindable feedback loop (something to do with tracking skins across three different bindable types).
             // probably something which will be factored out in a future database refactor so not too concerning for now.
-            currentSkin.BindValueChanged(skin => Scheduler.AddOnce(skinChanged), true);
+            currentSkin.BindValueChanged(skin =>
+            {
+                hasBegunMutating = false;
+                Scheduler.AddOnce(skinChanged);
+            }, true);
         }

         private void skinChanged()
@@ -161,6 +167,7 @@
             });

             skins.EnsureMutableSkin();
+            hasBegunMutating = true;
         }

         private void placeComponent(Type type)
@@ -194,6 +201,9 @@

         public void Save()
         {
+            if (!hasBegunMutating)
+                return;
+
             SkinnableElementTargetContainer[] targetContainers = targetScreen.ChildrenOfType<SkinnableElementTargetContainer>().ToArray();

             foreach (var t in targetContainers)


A test for serialization with late post hook and surrogate.

--- Tests/HooksTests.cs
+++ Tests/HooksTests.cs
@@ -213,6 +213,21 @@
             Assert.AreEqual(4, copy.DerivedPostDeserializationCounter);
         }

+        [Test]
+        public void ShouldFailWithSurrogateAndLatePostDeserializationHook()
+        {
+            try
+            {
+                var lateHook = new LateDeserializationMockA();
+                PseudoClone(lateHook, serializer => serializer.ForSurrogate<LateDeserializationMockA>().SetObject(x => new object()));
+                Assert.Fail("Serialization finished while it should fail.");
+            }
+            catch(InvalidOperationException)
+            {
+
+            }
+        }
+
         private void ShouldInvokePostDeserializationEvenIfExceptionWasThrownDuringSerialization<T>(T prePostMock) where T : IPrePostMock
         {
             try


Add not disposed to reconnecition

Add not disposed to reconnecition

--- src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/DbConnection.cs
+++ src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/DbConnection.cs
@@ -49,12 +49,13 @@

         public IDbCommand CreateCommand()
         {
+            InsureConnection();
             return Connection.CreateCommand();
         }

         public void Open()
         {
-            if (Connection?.State != ConnectionState.Open)
+            if (!Disposed && Connection?.State != ConnectionState.Open)
             {
                 Connection?.Open();
             }


#479 done move help out of li on event frequency in submit-event form

--- src/StockportWebapp/Views/stockportgov/Events/SubmitEvent.cshtml
+++ src/StockportWebapp/Views/stockportgov/Events/SubmitEvent.cshtml
@@ -78,11 +78,12 @@
                                                 {

                                                         <input type="radio" value="@item" asp-for="Frequency"> @item
-                                                        @if (!string.IsNullOrWhiteSpace(@Model.Frequencylist[item]))
-                                                        {
-
@Model.Frequencylist[item]
-                                                        }
+

+                                                    if (!string.IsNullOrWhiteSpace(@Model.Frequencylist[item]))
+                                                    {
+
@Model.Frequencylist[item]

+                                                    }
                                                 }


Update App.xaml.cs

Update App.xaml.cs

--- src/Draw2D/App.xaml.cs
+++ src/Draw2D/App.xaml.cs
@@ -118,6 +118,7 @@
                          .With(new X11PlatformOptions { UseGpu = true, UseEGL = true })
                          .With(new AvaloniaNativePlatformOptions { UseGpu = true })
                          .UseSkia()
+                         //.UseDirect2D1()
                          .LogToDebug();

         public override void Initialize()


Addressed Saurabh's review feedback.

Addressed Saurabh's review feedback.

--- src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs
+++ src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs
@@ -2281,17 +2281,17 @@
                             {
                                 return false;
                             }
+
+                            // Give the parser the new collation values in case parameters don't specify one
+                            _defaultCollation = env.newCollation;

                             // UTF8 collation
                             if ((env.newCollation.info & TdsEnums.UTF8_IN_TDSCOLLATION) == TdsEnums.UTF8_IN_TDSCOLLATION)
                             {
                                 _defaultEncoding = Encoding.UTF8;
-                                _defaultCollation = env.newCollation;
                             }
                             else
                             {
-                                // give the parser the new collation values in case parameters don't specify one
-                                _defaultCollation = env.newCollation;
                                 int newCodePage = GetCodePage(env.newCollation, stateObj);
                                 if (newCodePage != _defaultCodePage)
                                 {
@@ -3263,7 +3263,7 @@
                 {
                     int codePage = GetCodePage(rec.collation, stateObj);

-                    // if the column lcid is the same as the default, use the default encoder
+                    // If the column lcid is the same as the default, use the default encoder
                     if (codePage == _defaultCodePage)
                     {
                         rec.codePage = _defaultCodePage;


The EventCounter APIs were left out of the reference assembly for System.Diagnostics.Tracing.   Add them.

--- src/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs
+++ src/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs
@@ -53,6 +53,10 @@
         public System.Diagnostics.Tracing.EventCommand Command { get { return default(System.Diagnostics.Tracing.EventCommand); } }
         public bool DisableEvent(int eventId) { return default(bool); }
         public bool EnableEvent(int eventId) { return default(bool); }
+    }
+    public class EventCounter {
+        public EventCounter(string name, EventSource eventSource) { }
+        public void WriteMetric(float value) { }
     }
     [System.AttributeUsageAttribute((System.AttributeTargets)(12), Inherited = false)]
     public partial class EventDataAttribute : System.Attribute


fixing build

fixing build

--- src/System.Text.Formatting/System/Text/Parsing/SequenceParser.cs
+++ src/System.Text.Formatting/System/Text/Parsing/SequenceParser.cs
@@ -25,7 +25,7 @@
             }

             // Attempt to parse the first segment. If it works (and it should in most cases), then return success.
-            bool parsed = Internal.InternalParser.TryParseUInt64(first.Span, EncodingData.InvariantUtf8, default(TextFormat), out value, out consumed);
+            bool parsed = InternalParser.TryParseUInt64(first.Span, EncodingData.InvariantUtf8, default(TextFormat), out value, out consumed);
             if (parsed && consumed < first.Length) {
                 return true;
             }
@@ -98,7 +98,7 @@
             }

             // Attempt to parse the first segment. If it works (and it should in most cases), then return success.
-            bool parsed = PrimitiveParser.TryParseUInt32(new Utf8String(first.Span), out value, out consumed);
+            bool parsed = InternalParser.TryParseUInt32(new Utf8String(first.Span), out value, out consumed);
             if (parsed && consumed < first.Length) {
                 return true;
             }
@@ -141,7 +141,7 @@
                     combinedSpan = destination.Slice(0, StackBufferSize - free.Length);

                     // if the stack allocated buffer parsed succesfully (and for uint it should always do), then return success.
-                    if (PrimitiveParser.TryParseUInt32(new Utf8String(combinedSpan), out value, out consumed)) {
+                    if (InternalParser.TryParseUInt32(new Utf8String(combinedSpan), out value, out consumed)) {
                         if(consumed < combinedSpan.Length || combinedSpan.Length < StackBufferSize) {
                             return true;
                         }
@@ -152,7 +152,7 @@
             // for invariant culture, we should never reach this point, as invariant uint text is never longer than 127 bytes.
             // I left this code here, as we will need it for custom cultures and possibly when we shrink the stack allocated buffer.
             combinedSpan = memorySequence.ToSingleSpan();
-            if (!PrimitiveParser.TryParseUInt32(new Utf8String(combinedSpan), out value, out consumed)) {
+            if (!InternalParser.TryParseUInt32(new Utf8String(combinedSpan), out value, out consumed)) {
                 return false;
             }
             return true;


cleanup more

cleanup more

--- src/ImTools/ImTools.cs
+++ src/ImTools/ImTools.cs
@@ -3059,7 +3059,7 @@
             internal override ImHashMap<K, V> AddOrGetEntry(int hash, Entry entry)
             {
                 var ph = Plus.Hash;
-                if (ph == hash) // ok, fast return here
+                if (ph == hash) // fast match and return
                     return Plus;

                 var b = B;
@@ -3068,14 +3068,14 @@
                 if (hash > m.Hash)
                 {
                     var right = b.Right;
+                    entryOrNewBranch = right.AddOrGetEntry(hash, entry);
+                    if (entryOrNewBranch is Entry)
+                        return entryOrNewBranch;
+
                     if (right is Leaf5PlusPlus rl)
                     {
-                        entryOrNewBranch = rl.AddOrGetEntry(hash, entry);
-                        if (entryOrNewBranch is Entry)
-                            return entryOrNewBranch;
-
+                        // we know that the new entry is Branch2, because otherwise it would not be Branch2Plus1 in the first place
                         var b2 = (Branch2)entryOrNewBranch;
-                        // we know that the `splitRight` is not null because otherwise it would not be Branch2Plus1 in the first place
                         Debug.Assert(ph > m.Hash, "Because right was on the verge of balance and the fact that the other branch is not on the verge was the reason of Branch2Plus1 creation");
                         return ph > b2.MidEntry.Hash
                             ? new Branch3(b.Left, m, b2.Left, b2.MidEntry, b2.Right is Leaf2 l2 ? new Leaf2Plus(Plus, l2) : new Leaf5Plus(Plus, (Leaf5)b2.Right))
@@ -3083,41 +3083,31 @@
                     }

                     // right is not on the verge, then the Plus would be added to the left
-                    entryOrNewBranch = right.AddOrGetEntry(hash, entry);
-                    if (entryOrNewBranch is Entry)
-                        return entryOrNewBranch;
-
                     entry = Plus;
                     ImHashMap<K, V> splitRight = null;
                     var newLeft = ((Leaf5PlusPlus)b.Left).AddEntry(ph, ref entry, ref splitRight);
                     return new Branch3(newLeft, entry, splitRight, m, entryOrNewBranch);
                 }
-
                 if (hash < m.Hash)
                 {
                     var left = b.Left;
+                    entryOrNewBranch = left.AddOrGetEntry(hash, entry);
+                    if (entryOrNewBranch is Entry)
+                        return entryOrNewBranch;
+
                     if (left is Leaf5PlusPlus ll)
                     {
-                        entryOrNewBranch = ll.AddOrGetEntry(hash, entry);
-                        if (entryOrNewBranch is Entry)
-                            return entryOrNewBranch; // we know that the `r` is Leaf so the only possibility why `splitRight` is null because the same hash entry is found
-
                         var b2 = (Branch2)entryOrNewBranch;
                         return ph < b2.MidEntry.Hash
                             ? new Branch3(b2.Left is Leaf5 l5 ? new Leaf5Plus(Plus, l5) : new Leaf2Plus(Plus, (Leaf2)b2.Left), b2.MidEntry, b2.Right, m, b.Right)
                             : new Branch3(b2.Left, b2.MidEntry, b2.Right is Leaf2 l2 ? new Leaf2Plus(Plus, l2) : new Leaf5Plus(Plus, (Leaf5)b2.Right), m, b.Right);
                     }

-                    entryOrNewBranch = left.AddOrGetEntry(hash, entry);
-                    if (entryOrNewBranch is Entry)
-                        return entryOrNewBranch;
-
                     entry = Plus;
                     ImHashMap<K, V> splitRight = null;
                     var newMiddle = ((Leaf5PlusPlus)b.Right).AddEntry(ph, ref entry, ref splitRight);
                     return new Branch3(entryOrNewBranch, m, newMiddle, entry, splitRight);
                 }
-
                 return m;
             }


Removed test url

Removed test url

--- scripts/Sport/futbol.csx
+++ scripts/Sport/futbol.csx
@@ -28,8 +28,7 @@

 var liveScores = new Dictionary<int, string>();

-//var apiUrl = "http://live.mobileapp.fifa.com/api/wc/matches";
-var apiUrl = "https://gist.githubusercontent.com/PeteGoo/4d4e2fdb9023ad6e7f59/raw/test.json";
+var apiUrl = "http://live.mobileapp.fifa.com/api/wc/matches";

 static Random _random = new Random(DateTime.Now.Millisecond);

@@ -168,4 +167,4 @@
     "http://media.giphy.com/media/Vx4njfM5eRPtm/giphy.gif",
     "http://media3.giphy.com/media/SqJfmCsBgMlEs/200.gif",
     "http://media.giphy.com/media/ZU4RfkaryvodO/giphy.gif"
-};+};


@wip #52

@wip #52

--- src/ImTools/ImTools.cs
+++ src/ImTools/ImTools.cs
@@ -2850,20 +2850,18 @@
                 if (hash > E.Hash)
                 {
                     // optimizing the split by postponing it by introducing the branch 2 plus 1
-                    if (R is Leaf5PlusPlus rl511 && L is Leaf5PlusPlus == false)
-                        return rl511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                    if (R is Leaf5PlusPlus && L is Leaf5PlusPlus == false)
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = R.AddSureNotPresentEntry(hash, entry);
                     return R.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(L, E, b2.L, b2.E, b2.R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2Right(this, entryOrNewBranch);
-                }
-                {
-                    if (L is Leaf5PlusPlus ll511 && R is Leaf5PlusPlus == false)
-                        return ll511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                        ? new Branch3(L, E, b2.L, b2.E, b2.R) : new Branch2Right(this, entryOrNewBranch);
+                }
+                {
+                    if (L is Leaf5PlusPlus && R is Leaf5PlusPlus == false)
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = L.AddSureNotPresentEntry(hash, entry);
                     return L.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(b2.L, b2.E, b2.R, E, R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2Left(this, entryOrNewBranch);
+                        ? new Branch3(b2.L, b2.E, b2.R, E, R) : new Branch2Left(this, entryOrNewBranch);
                 }
             }
         }
@@ -2918,20 +2916,18 @@
                 if (hash > me.Hash)
                 {
                     var right = B.R;
-                    if (right is Leaf5PlusPlus rl511 && L is Leaf5PlusPlus == false)
-                        return rl511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                    if (right is Leaf5PlusPlus && L is Leaf5PlusPlus == false)
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = right.AddSureNotPresentEntry(hash, entry);
                     return right.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(L, me, b2.L, b2.E, b2.R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2(L, me, entryOrNewBranch);
+                        ? new Branch3(L, me, b2.L, b2.E, b2.R) : new Branch2(L, me, entryOrNewBranch);
                 }
                 {
                     if (L is Leaf5PlusPlus ll511 && B.R is Leaf5PlusPlus == false)
-                        return ll511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = L.AddSureNotPresentEntry(hash, entry);
                     return L.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(b2.L, b2.E, b2.R, me, B.R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2Left(B, entryOrNewBranch);
+                        ? new Branch3(b2.L, b2.E, b2.R, me, B.R) : new Branch2Left(B, entryOrNewBranch);
                 }
             }
         }
@@ -2985,21 +2981,19 @@
                 ImHashMap<K, V> entryOrNewBranch = null;
                 if (hash > me.Hash)
                 {
-                    if (R is Leaf5PlusPlus rl511 && B.L is Leaf5PlusPlus == false)
-                        return rl511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                    if (R is Leaf5PlusPlus && B.L is Leaf5PlusPlus == false)
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = R.AddSureNotPresentEntry(hash, entry);
                     return R.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(B.L, me, b2.L, b2.E, b2.R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2Right(B, entryOrNewBranch);
+                        ? new Branch3(B.L, me, b2.L, b2.E, b2.R) : new Branch2Right(B, entryOrNewBranch);
                 }
                 {
                     var left = B.L;
-                    if (left is Leaf5PlusPlus ll511 && R is Leaf5PlusPlus == false)
-                        return ll511.GetEntryOrNull(hash) ?? (ImHashMap<K, V>)new Branch2Plus(entry, this);
+                    if (left is Leaf5PlusPlus && R is Leaf5PlusPlus == false)
+                        return new Branch2Plus(entry, this);
                     entryOrNewBranch = left.AddSureNotPresentEntry(hash, entry);
                     return left.MayTurnToBranch2 && entryOrNewBranch is Branch2 b2
-                        ? new Branch3(b2.L, b2.E, b2.R, me, R)
-                        : entryOrNewBranch is Entry ? entryOrNewBranch : new Branch2(entryOrNewBranch, me, R);
+                        ? new Branch3(b2.L, b2.E, b2.R, me, R) : new Branch2(entryOrNewBranch, me, R);
                 }
             }
         }


Исправление исключения при парсинге Status Code

Исправил ошибку, когда вызывалось исключение при парсинге Status Code,
если в ответе сервера не было Reason Phrase. Пример "HTTP/1.1 200/r/n"
на сайте http://api.temp-mail.ru/request/domains/

--- xNet/~Http/HttpResponse.cs
+++ xNet/~Http/HttpResponse.cs
@@ -1255,6 +1255,12 @@
             string version = startingLine.Substring("HTTP/", " ");
             string statusCode = startingLine.Substring(" ", " ");

+            if (statusCode.Length == 0)
+            {
+                // Если сервер не возвращает Reason Phrase
+                statusCode = startingLine.Substring(" ", Http.NewLine);
+            }
+
             if (version.Length == 0 || statusCode.Length == 0)
             {
                 throw NewHttpException(Resources.HttpException_ReceivedEmptyResponse);


Cosmetics

Cosmetics

--- src/tests/ExistsForAll.Shepherd.DependencyInjection.UnitTests/ShepherdTests.cs
+++ src/tests/ExistsForAll.Shepherd.DependencyInjection.UnitTests/ShepherdTests.cs
@@ -15,13 +15,14 @@
 		{
 			var sut = new ServiceCollection()
 			    .Scan(x => x.WithAssembly<INoImplInterface>()
-			        .WithOptions(o => o.ServiceIndexer.Filters.Add(new InterfaceAccumulationFilter(typeof(IFilterService)))));
+			        .WithOptions(o => o.ServiceIndexer
+				        .Filters
+				        .Add(new InterfaceAccumulationFilter(typeof(IFilterService)))));

 		    var provider = sut.BuildServiceProvider();

 		    try
 			{
-
 				AssertServiceRegistration<DecoratorServiceDecorator>(typeof(IDecoratorService), i =>
 				{
 					Assert.IsType<DecoratorServiceDecorator>(i);


correcting a comment

correcting a comment

--- src/win-driver/Domain/Session.cs
+++ src/win-driver/Domain/Session.cs
@@ -137,16 +137,14 @@
                         var automationElement = element.GetAutomationElement(window);
                         if (automationElement.Current.ControlType.Id == ControlType.ComboBox.Id)
                         {
-                            // this is the one combo box case that's "easy" to support
-                            // if we're looking for list items, and given a combo box
-                            // pop open the combo box, return all items, and leave the
-                            // combo box open so the handles don't become invalid
+                            // return all list items contained within the combo box [elementId]
                             var comboBox = new ComboBox(automationElement, window);
                             return comboBox.Items.Select(x => _elementRepository.Add(new ListItemElement(element, comboBox.Items.IndexOf(x))));
                         }

                         if (automationElement.Current.ControlType.Id == ControlType.List.Id)
                         {
+                            // return all list items contained within the list box [elementId]
                             var listBox = new ListBox(automationElement, window);
                             return listBox.Items.Select(x => _elementRepository.Add(new ListItemElement(element, listBox.Items.IndexOf(x))));
                         }


Fix race condition in QueuedAgentTests

Fix race condition in QueuedAgentTests

--- ecoAPM.NET.Agent.Tests/QueuedAgentTests.cs
+++ ecoAPM.NET.Agent.Tests/QueuedAgentTests.cs
@@ -12,11 +12,12 @@
 		//arrange
 		var config = new ServerConfig(new Uri("http://localhost"), Guid.NewGuid());
 		var httpClient = Substitute.For<HttpClient>();
-		var agent = new QueuedAgent(config, httpClient, null, TimeSpan.Zero);
+		var agent = new QueuedAgent(config, httpClient, null, TimeSpan.MaxValue);

 		//act
 		var e = new Event();
 		await agent.Send(e);
+		await Task.Delay(1);

 		//assert
 		Assert.Contains(e, agent.GetEventsToSend());


Run python from path set in python home (#590)

--- src/dotnet/APIView/APIViewWeb/Languages/PythonLanguageService.cs
+++ src/dotnet/APIView/APIViewWeb/Languages/PythonLanguageService.cs
@@ -11,9 +11,11 @@
 {
     public class PythonLanguageService : LanguageProcessor
     {
+        static string pythonhome = Environment.GetEnvironmentVariable("PYTHONHOME");
+
         public override string Name { get; } = "Python";
         public override string Extension { get; } = ".whl";
-        public override string ProcessName { get; } = "python";
+        public override string ProcessName { get; } = Path.Combine(pythonhome, "python");
         public override string VersionString { get; } = "0.1.1";

         public override string GetProccessorArguments(string originalName, string tempDirectory, string jsonPath)


Minor formatting cleanup.

Minor formatting cleanup.

--- Samples/DemoWinForms/App.cs
+++ Samples/DemoWinForms/App.cs
@@ -67,7 +67,7 @@

             mCamera = mSceneManager.CreateCamera("MainCamera");
             mCamera.Position = new Math3D.Vector3(150, 150, 150);
-            mCamera.LookAt(new Math3D.Vector3(0,0,0));
+            mCamera.LookAt(new Math3D.Vector3(0, 0, 0));
             mCamera.NearClipDistance = 5;

             mViewport = mRenderWindow.AddViewport(mCamera);


Change xUnit test to NUnit test

Change xUnit test to NUnit test

--- test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionManagerTests.cs
+++ test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionManagerTests.cs
@@ -55,7 +55,7 @@
                 modelService.Received(1).GetPullRequest("fork", "repo", 15);
             }

-            [Fact]
+            [Test]
             public void LocalRepositoryModelNull()
             {
                 var repositoryModel = null as LocalRepositoryModel;


test for post netcoreapp2.0 standalone activation

--- test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs
+++ test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs
@@ -8,6 +8,7 @@
 using Microsoft.NET.TestFramework;
 using Microsoft.NET.TestFramework.Assertions;
 using Microsoft.NET.TestFramework.Commands;
+using Microsoft.NET.TestFramework.ProjectConstruction;
 using Xunit;
 using static Microsoft.NET.TestFramework.Commands.MSBuildTest;

@@ -94,6 +95,76 @@
                 .HaveStdOutContaining("Hello World!");
         }

+        //Note: Pre Netcoreapp2.0 stanalone activation uses renamed dotnet.exe
+        //      While Post 2.0 we are shifting to using apphost.exe, so both publish needs to be validated
+        [Fact]
+        public void Publish_standalone_post_netcoreapp2_app_and_it_should_run()
+        {
+            var targetFramework = "netcoreapp2.0";
+            var rid = EnvironmentInfo.GetCompatibleRid(targetFramework);
+
+
+            TestProject testProject = new TestProject()
+            {
+                Name = "Hello",
+                IsSdkProject = true,
+                TargetFrameworks = targetFramework,
+                RuntimeFrameworkVersion = RepoInfo.NetCoreApp20Version,
+                RuntimeIdentifier = rid,
+                IsExe = true,
+            };
+
+
+            testProject.SourceFiles["Program.cs"] = @"
+using System;
+public static class Program
+{
+    public static void Main()
+    {
+        Console.WriteLine(""Hello from a netcoreapp2.0.!"");
+    }
+}
+";
+            var testProjectInstance = _testAssetsManager.CreateTestProject(testProject);
+
+            testProjectInstance.Restore(testProject.Name);
+            var publishCommand = new PublishCommand(Stage0MSBuild, Path.Combine(testProjectInstance.TestRoot, testProject.Name));
+            var publishResult = publishCommand.Execute();
+
+            publishResult.Should().Pass();
+
+            var publishDirectory = publishCommand.GetOutputDirectory(
+                targetFramework: targetFramework,
+                runtimeIdentifier: rid);
+            var selfContainedExecutable = $"Hello{Constants.ExeSuffix}";
+
+            string selfContainedExecutableFullPath = Path.Combine(publishDirectory.FullName, selfContainedExecutable);
+
+            var libPrefix = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "lib";
+
+            publishDirectory.Should().HaveFiles(new[] {
+                selfContainedExecutable,
+                "Hello.dll",
+                "Hello.pdb",
+                "Hello.deps.json",
+                "Hello.runtimeconfig.json",
+                $"{libPrefix}coreclr{Constants.DynamicLibSuffix}",
+                $"{libPrefix}hostfxr{Constants.DynamicLibSuffix}",
+                $"{libPrefix}hostpolicy{Constants.DynamicLibSuffix}",
+                $"mscorlib.dll",
+                $"System.Private.CoreLib.dll",
+            });
+
+            Command.Create(selfContainedExecutableFullPath, new string[] { })
+                .EnsureExecutable()
+                .CaptureStdOut()
+                .Execute()
+                .Should()
+                .Pass()
+                .And
+                .HaveStdOutContaining("Hello from a netcoreapp2.0.!");
+        }
+
         [Fact]
         public void A_deployment_project_can_reference_the_hello_world_project()
         {


Adds a test to the simple AC-1 solver test to ensure the label values are correct.

--- tests/Workbench.Core.Tests.Unit/Solvers/Ac1SolverWithSimpleValidModelShould.cs
+++ tests/Workbench.Core.Tests.Unit/Solvers/Ac1SolverWithSimpleValidModelShould.cs
@@ -16,6 +16,18 @@
             Assert.That(actualResult.Status, Is.EqualTo(SolveStatus.Success));
         }

+        [Test]
+        public void SolveReturningLabelsInValidRange()
+        {
+            var sut = new Ac1Solver();
+            var simpleModel = CreateWorkspace().Model;
+            var actualResult = sut.Solve(simpleModel);
+            var aLabel = actualResult.Snapshot.GetLabelByVariableName("A");
+            var bLabel = actualResult.Snapshot.GetLabelByVariableName("B");
+            Assert.That(aLabel.GetValueAsInt(), Is.InRange(1, 2));
+            Assert.That(bLabel.GetValueAsInt(), Is.InRange(1, 2));
+        }
+
         private WorkspaceModel CreateWorkspace()
         {
             return new WorkspaceBuilder("Very simple model utilizing a binary constraint")


added the messed session's information back in the session connected log

--- SocketBase/AppServerBase.cs
+++ SocketBase/AppServerBase.cs
@@ -1531,7 +1531,7 @@
             appSession.SocketSession.Closed += OnSocketSessionClosed;

             if (Config.LogBasicSessionActivity && Logger.IsInfoEnabled)
-                Logger.InfoFormat("A new session connected!");
+                Logger.Info("A new session connected!", session);

             OnNewSessionConnected(appSession);
             return true;


Refactoring.

Refactoring.

--- src/OpenUNC.cs
+++ src/OpenUNC.cs
@@ -14,14 +14,21 @@
             Uri uri = new Uri( Uri.UnescapeDataString( string.Join( "%20", args ).Replace( "#", "%23" ) ) );
             inputPath = uri.LocalPath + Uri.UnescapeDataString( uri.Fragment );
             CheckAccessible( uri );
-            String openPath = GetOpenPath( inputPath );
-            if( Directory.Exists( openPath ) )
+
+            string targetPath = TraverseValidPath( inputPath );
+            if( targetPath.Length != inputPath.Length )
             {
-                Process.Start( openPath );
+                MessageBox.Show( String.Format( "Open:\n\"{0}\"", targetPath ),
+                    "Information", MessageBoxButtons.OK, MessageBoxIcon.Information );
+            }
+
+            if( Directory.Exists( targetPath ) )
+            {
+                Process.Start( targetPath );
             }
             else
             {
-                Process.Start( "explorer.exe", String.Format( "/select, \"{0}\"", openPath ) );
+                Process.Start( "explorer.exe", String.Format( "/select, \"{0}\"", targetPath ) );
             }
         }
         catch( Exception e )
@@ -61,27 +68,22 @@
         }
     }

-    private static string GetOpenPath( string inputPath )
+    private static string TraverseValidPath( string inputPath )
     {
-        string openPath = inputPath;
-        while( !File.Exists( openPath ) && !Directory.Exists( openPath ) )
+        string targetPath = inputPath;
+        while( !File.Exists( targetPath ) && !Directory.Exists( targetPath ) )
         {
-            DirectoryInfo directoryInfo = Directory.GetParent( openPath );
+            DirectoryInfo directoryInfo = Directory.GetParent( targetPath );
             if( directoryInfo != null )
             {
-                openPath = directoryInfo.FullName;
+                targetPath = directoryInfo.FullName;
             }
             else
             {
                 throw new Exception( String.Format( "Not found." ) );
             }
         }
-        if( openPath.Length != inputPath.Length )
-        {
-            MessageBox.Show( String.Format( "Open:\n\"{0}\"", openPath ),
-                "Information", MessageBoxButtons.OK, MessageBoxIcon.Information );
-        }

-        return openPath;
+        return targetPath;
     }
 }


tweak multipliers

tweak multipliers

--- Source/DMCollectContract.cs
+++ Source/DMCollectContract.cs
@@ -45,7 +45,6 @@

 	public class DMCollectContract : Contract
 	{
-
 		internal DMCollectScience newParam;
 		private CelestialBody body;
 		private ExperimentSituations targetSituation;
@@ -92,10 +91,10 @@

 			this.AddParameter(newParam, null);
 			DMUtils.DebugLog("Parameter Added");
-			base.SetExpiry(10 * subjectValue, Math.Max(15, 15 * subjectValue) * (float)(this.prestige + 1));
+			base.SetExpiry(10, 20 * (float)(this.prestige + 1));
 			base.SetScience(DMscience.exp.baseValue * 0.8f * DMUtils.science, body);
 			base.SetDeadlineDays(20f * (float)(this.prestige + 1), body);
-			base.SetReputation(5f * (float)(this.prestige + 1), 10f * (float)(this.prestige + 1), body);
+			base.SetReputation(5f * (float)(this.prestige + 1) * DMUtils.reward, 10f * (float)(this.prestige + 1) * DMUtils.penalty, body);
 			base.SetFunds(600f * DMUtils.forward, 500f * DMUtils.reward, 500f * DMUtils.penalty, body);
 			return true;
 		}


Divide slider bonus by repeat count

Divide slider bonus by repeat count

--- osu.Game.Rulesets.Osu/Difficulty/Evaluators/FlashlightEvaluator.cs
+++ osu.Game.Rulesets.Osu/Difficulty/Evaluators/FlashlightEvaluator.cs
@@ -17,7 +17,6 @@

         private const double min_velocity = 0.5;
         private const double slider_multiplier = 1.3;
-        private const double repeat_bonus = 3.0;

         /// <summary>
         /// Evaluates the difficulty of memorising and hitting an object, based on:
@@ -91,9 +90,9 @@
                 // Longer sliders require more memorisation.
                 sliderBonus *= pixelTravelDistance;

-                // Reward sliders with repeats.
+                // Nerf sliders with repeats, as less memorisation is required.
                 if (osuSlider.RepeatCount > 0)
-                    sliderBonus *= repeat_bonus;
+                    sliderBonus /= (osuSlider.RepeatCount + 1);
             }

             result += sliderBonus * slider_multiplier;


Add test coverage of skin lookups failing when `@2x` and extension are present

--- osu.Game.Tests/NonVisual/Skinning/LegacySkinTextureFallbackTest.cs
+++ osu.Game.Tests/NonVisual/Skinning/LegacySkinTextureFallbackTest.cs
@@ -68,6 +68,20 @@
                 new[] { "followpoint" },
                 "Gameplay/osu/followpoint",
                 "followpoint", 1
+            },
+            new object[]
+            {
+                // Looking up a filename with extension specified should work.
+                new[] { "followpoint.png" },
+                "followpoint.png",
+                "followpoint.png", 1
+            },
+            new object[]
+            {
+                // Looking up a filename with extension specified should also work with @2x sprites.
+                new[] { "followpoint@2x.png" },
+                "followpoint.png",
+                "followpoint@2x.png", 2
             },
         };


Fixed unit test broken by https://github.com/Glimpse/Glimpse/commit/33e97f94e58674089e7d0e42b1b7a515173811bd

--- source/Glimpse.Test.Core2/Resource/AjaxShould.cs
+++ source/Glimpse.Test.Core2/Resource/AjaxShould.cs
@@ -54,7 +54,9 @@

             var guid = Guid.NewGuid();

-            contextMock.Setup(c => c.Parameters["parentRequestId"]).Returns(guid.ToString());
+            var output = guid.ToString();
+
+            contextMock.Setup(c => c.Parameters.TryGetValue("parentRequestId", out output)).Returns(true);
             contextMock.Setup(c => c.PersistanceStore.GetByRequestParentId(guid)).Returns(Enumerable.Empty<GlimpseRequest>());

             var resource = new AjaxResource();


[trunk] Refreshing Clang C++ compiler options delegates file.

--- packages/Clang/3.1/Scripts/CxxCompilerOptionCollectionDelegates.cs
+++ packages/Clang/3.1/Scripts/CxxCompilerOptionCollectionDelegates.cs
@@ -1,14 +1,16 @@
 // Automatically generated file from OpusOptionInterfacePropertyGenerator.
 // Command line:
-// -i=..\..\..\C\dev\Scripts\ICxxCompilerOptions.cs -n=Clang -c=CxxCompilerOptionCollection -p -d -dd=..\..\..\CommandLineProcessor\dev\Scripts\CommandLineDelegate.cs -pv=PrivateData
+// -i=..\..\..\C\dev\Scripts\ICxxCompilerOptions.cs -n=Clang -c=CxxCompilerOptionCollection -p -d -dd=..\..\..\CommandLineProcessor\dev\Scripts\CommandLineDelegate.cs -pv=PrivateData -e

 namespace Clang
 {
     public partial class CxxCompilerOptionCollection
     {
+        #region C.ICxxCompilerOptions Option delegates
         private static void ExceptionHandlerCommandLineProcessor(object sender, Opus.Core.StringArray commandLineBuilder, Opus.Core.Option option, Opus.Core.Target target)
         {
         }
+        #endregion
         protected override void SetDelegates(Opus.Core.DependencyNode node)
         {
             base.SetDelegates(node);


fix RIDER-55185

fix RIDER-55185

--- resharper/resharper-unity/src/Utils/NamingUtil.cs
+++ resharper/resharper-unity/src/Utils/NamingUtil.cs
@@ -40,7 +40,7 @@
                 UniqueNameContext = node,
                 IsConflictingElement = isConflictingElement
             };
-            var namesSuggestion = namesCollection.Prepare(elementKind, ScopeKind.Common, suggestionOptions);
+            var namesSuggestion = namesCollection.Prepare(elementKind, ScopeKind.TypeAndNamespace, suggestionOptions);
             return namesSuggestion.FirstName();
         }
     }


Simple space :)

Simple space :)

--- Src/Wide/Core/CoreModule.cs
+++ Src/Wide/Core/CoreModule.cs
@@ -137,6 +137,7 @@
         }

         #endregion
+
         /// <summary>
         /// The AppCommands registered by the Core Module
         /// </summary>


ISPP check.

ISPP check.

--- source2/Build/Cosmos.Build.Builder/CosmosTask.cs
+++ source2/Build/Cosmos.Build.Builder/CosmosTask.cs
@@ -14,6 +14,7 @@
     protected string mOutputPath;
     protected int mReleaseNo;
     protected string mInnoFile;
+    protected string mInnoPath;

     public CosmosTask(string aCosmosPath, int aReleaseNo) {
       mCosmosPath = aCosmosPath;
@@ -131,7 +132,7 @@
       CheckVs2010Sp1();
       CheckVs2010SDK();
       CheckNet35Sp1(); // Required by VMWareLib
-      CheckForUninstall("Inno Setup QuickStart Pack", true);
+      CheckForInno();
       CheckForInstall("Microsoft Visual Studio 2010 SDK SP1", true);
       if (!CheckForInstall("VMware Workstation", false)) {
         if (!CheckForInstall("VMware Player", false)) {
@@ -139,6 +140,24 @@
         }
       }
       CheckForInstall("VMWare VIX", true);
+    }
+
+    void CheckForInno() {
+      Echo("Checking for Inno Setup");
+      using (var xKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1", false)) {
+        if (xKey == null) {
+          throw new Exception("Cannot find Inno Setup.");
+        }
+        mInnoPath = (string)xKey.GetValue("InstallLocation");
+        if (string.IsNullOrWhiteSpace(mInnoPath)) {
+          throw new Exception("Cannot find Inno Setup.");
+        }
+      }
+
+      Echo("Checking for Inno Preprocessor");
+      if (!File.Exists(Path.Combine(mInnoPath, "ISPP.dll"))) {
+        throw new Exception("Inno Preprocessor not detected.");
+      }
     }

     void CheckVs2010Sp1() {
@@ -245,18 +264,7 @@
     void CreateSetup() {
       Section("Creating Setup");

-      string xInnoPath;
-      using (var xKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1", false)) {
-        if (xKey == null) {
-          throw new Exception("Cannot find Inno Setup.");
-        }
-        xInnoPath = (string)xKey.GetValue("InstallLocation");
-        if (string.IsNullOrWhiteSpace(xInnoPath)) {
-          throw new Exception("Cannot find Inno Setup.");
-        }
-      }
-
-      string xISCC = Path.Combine(xInnoPath, "ISCC.exe");
+      string xISCC = Path.Combine(mInnoPath, "ISCC.exe");
       if (!File.Exists(xISCC)) {
         throw new Exception("Cannot find Inno setup.");
       }


corrected readProgramFile

corrected readProgramFile

--- StroopTest/StroopProgram.cs
+++ StroopTest/StroopProgram.cs
@@ -451,9 +451,9 @@
                 else { SubtitlePlace = 0; SubtitleColor = "false"; }
                 ExpositionType = config[13];
                 ImagesListFile = config[14];
-                fixPoint = config[15];
-                fontWordLabel = config[16];
-                expandImage = Boolean.Parse(config[17]);
+                FixPoint = config[15];
+                FontWordLabel = config[16];
+                ExpandImage = Boolean.Parse(config[17]);
                 AudioListFile = config[18];
                 SubtitlesListFile = config[19];


* libpango: various bits done.

* libpango: various bits done.

--- src/libpango/datamodel.cs
+++ src/libpango/datamodel.cs
@@ -5,68 +5,93 @@
 namespace libpango
 {
     public class Schedule {
+        // TODO
         int time;
+        // there should be a priority queue inside
         public void add(EventHandler e, int timeoffset) { }
-        public EventHandler get() { }
-    }
-    public class Game {}
+        //public EventHandler pop() { }
+    }
+    public class Game {
+        // TODO
+        // can contain: quotas for monsters
+        // atEnd()
+    }
     public class Map {
         List<Entity>[,] map;

-        Map(int width, int height) {
+        public Map(int width, int height)
+        {
             map = new List<Entity>[width,height];
         }

-        bool add(Entity ent, Coordinates coords) {
-            if (ent.isWalkable() || isWalkable(coords)) {
+        // add entity to a given place
+        public bool add(ref Entity ent, Coordinates coords)
+        {
+            if (ent.isWalkable() || (isWalkable(coords) && !hasEntity(ent,coords))) {
                 map[coords.x, coords.y].Add(ent);
                 return true;
             }
             return false;
         }
-        bool remove(Entity ent, Coordinates coords) {
+        // remove entity from given place
+        public bool remove(ref Entity ent, Coordinates coords)
+        {
             if(hasEntity(ent,coords)) {
                 return map[coords.x, coords.y].Remove(ent);
             }
             return false;
         }
-        bool remove(Entity ent) {
+        // remove entity from map
+        public bool remove(ref Entity ent)
+        {
             Coordinates coords = find(ent);
             if (!coords.Equals(Coordinates.invalid)) {
-                return remove(ent, coords);
+                return remove(ref ent, coords);
             }
             return false;
         }
         // field is walkable, if all entities there are walkable
-        bool isWalkable(Coordinates coords) {
+        public bool isWalkable(Coordinates coords) {
             foreach (Entity ent in map[coords.x, coords.y]) {
                 if (!ent.isWalkable()) { return false; }
             }
             return true;
         }
-        void move(Entity ent, Coordinates from, Coordinates to) { }
+        public bool move(ref Entity ent, Coordinates from, Coordinates to) {
+            // TODO: this is a bit ugly
+            if (remove(ref ent, from)) {
+                add(ref ent, to);
+                return true;
+            }
+            return false;
+        }
         // search for entity in the whole map
-        Coordinates find(Entity ent) {
-            for (int y = 0; y < map.GetUpperBound(0); y++) {
-                for(int x = 0; x < map.GetUpperBound(1); x++) {
-                    if (map[y, x].Contains(ent)) {
-                        return new Coordinates(y, x);
+        public Coordinates find(Entity ent)
+        {
+            for(int x = 0; x < map.GetUpperBound(0); x++) {
+                for (int y = 0; y < map.GetUpperBound(1); y++) {
+                    if (map[x, y].Contains(ent)) {
+                        return new Coordinates(x, y);
                     }
                 }
             }
             return Coordinates.invalid;
         }
         // search in the whole map
-        bool hasEntity(Entity ent) {
+        public bool hasEntity(Entity ent)
+        {
             return (!find(ent).Equals(Coordinates.invalid));
         }
         // search in list
-        bool hasEntity(Entity ent, Coordinates coords) {
+        public bool hasEntity(Entity ent, Coordinates coords)
+        {
             return map[coords.x, coords.y].Contains(ent);
         }
     }

     // Counted from [0,0]
+    // x - vertical (goes from to to down)
+    // y - horisontal (goes left to right)
     public struct Coordinates {
         public int x, y;
         public static Coordinates invalid = new Coordinates(-1,-1);
@@ -74,14 +99,30 @@
             this.x = x;
             this.y = y;
         }
-    }
-    public enum Direction { Up, Right, Left, Down }
-    public enum Rotation { Forward, CW, Backwards, CCW }
+        public static Coordinates step(Coordinates c, Direction dir) {
+            switch (dir) {
+                case Direction.Up:
+                    return new Coordinates(c.x - 1, c.y);
+                case Direction.Right:
+                    return new Coordinates(c.x, c.y + 1);
+                case Direction.Down:
+                    return new Coordinates(c.x + 1, c.y);
+                case Direction.Left:
+                    return new Coordinates(c.x, c.y - 1);
+            }
+            return c;
+        }
+        public Coordinates step(Direction dir) {
+            return Coordinates.step(this, dir);
+        }
+    }
+    public enum Direction { Up = 0, Right, Left, Down };
+    public enum Rotation { Forward = 0, CW, Backwards, CCW }

     public abstract class Entity {
         // Coordinates will be both in map and in entity.
         // We'll need to synchronize this.
-        Coordinates coords;
+        protected Coordinates coords;

         public virtual bool isWalkable() { return false; }
         public abstract void turn();
@@ -92,23 +133,34 @@
     // but how to incorporate new fields into interface???
     public abstract class MovableEntity : Entity
     {
-        Direction direction;
-
-        public bool go(Direction dir) { } // true, if step was made
-        public void rotate(Rotation rot) { }
+        protected Direction direction;
+
+        // true, if step was made
+        //public bool go(Map map)
+        //{
+        //    Coordinates step = coords.step(direction);
+        //    if (map.isWalkable(step)) {
+        //        map.move(this, coords, step); // TODO
+        //        coords = step;
+        //        return true;
+        //    }
+        //    return false;
+        //}
+        public void rotate(Rotation rot) {
+            direction = (Direction)(((int)direction + (int)rot) % 4);
+        }
     }

     public abstract class LiveEntity : MovableEntity {
-        int health;
-        int maxHealth;
-        int lives;
-        int defaultLives;
+        protected int health;
+        protected int maxHealth;
+        protected int lives;
+        protected int defaultLives;

         // change < 0 ... hurt
         // change > 0 ... stimpack
-        // Take care of correct lives count when health goes
-        // throuh 0 or maxHealth.
-        // returns true, if still alive
+        // Take care of correct lives count when health goes through 0 or maxHealth.
+        // Returns true, if still alive.
         public virtual bool changeHealth(int change) {
             health += change;
             if (health > maxHealth) {
@@ -118,20 +170,20 @@
                 if (lives > 0) {
                     lives--;
                     health += maxHealth;
-                } else {
-                    die();
-                    return false;
                 }
+                die();
+                return false;
             }
             return true;
         }
-
         public abstract void die();
-        public abstract void attack(Entity e, int hitcount);
+        public void attack(Entity e, int hitcount) {
+            e.acceptAttack(hitcount);
+        }
     }

     public abstract class WalkableEntity : Entity {
-        // other entities walk through this one
+        // other entities can walk through this one
         public override bool isWalkable() { return true; }
     }

@@ -139,30 +191,58 @@
         // money for killing monsters, gathering bonuses, aligning diamonds, ...
         int money;
         public override void turn() { }
-        public override void acceptAttack(int hitcount) { }
+        public override void acceptAttack(int hitcount) {
+            changeHealth(hitcount);
+        }
+        public override void die() {
+            if ((lives >= 0) && (health >= 0)) {
+                // TODO: respawn with the same entity
+            } else {
+                // TODO: end of game
+            }
+        }
     }
     // maybe think of multiple types of mosters
     public class MonsterEntity : LiveEntity {
         public override void turn() { }
-        public override void acceptAttack(int hitcount) { }
+        public override void acceptAttack(int hitcount) {
+            changeHealth(hitcount);
+        }
+        public override void die() {
+            // TODO: schedule respawning, make new entity
+        }
     }

     public class Stone : Entity {
+        public override void turn() { } // empty
+        public override void acceptAttack(int hitcount) { } // empty
+        // does not interact, except it is non-walkable
+    }
+
+    public class IceBlock : MovableEntity {
+        public override void turn() {
+            // TODO: make step, if in movement; stop when encountering non-walkable place
+        }
+        public override void acceptAttack(int hitcount) {
+            // TODO: melt
+        }
+    }
+
+    public class FreePlace : WalkableEntity {
+        public override void turn() { } // empty
+        public override void acceptAttack(int hitcount) { } // empty
+        // does not interact, except it is walkable
+    }
+
+    // TODO: classes for various bonuses
+    public class Bonus : WalkableEntity {
+        public Bonus() {
+            // TODO: schedule vanishing in given time
+        }
         public override void turn() { }
         public override void acceptAttack(int hitcount) { }
-    }
-    public class IceBlock : MovableEntity {
-        public override void turn() { }
-        public override void acceptAttack(int hitcount) { }
-    }
-
-    public class FreePlace : WalkableEntity {
-        public override void turn() { }
-        public override void acceptAttack(int hitcount) { }
-    }
-    // multiple bonuses
-    public class Bonus : WalkableEntity {
-        public override void turn() { }
-        public override void acceptAttack(int hitcount) { }
+
+        // TODO: Resolve, how to give player the bonus content,
+        // if he steps on the same place as this bonus.
     }
 }


Adds -clean to dm compile options

Adds -clean to dm compile options

--- TGServerService/Compiler.cs
+++ TGServerService/Compiler.cs
@@ -365,7 +365,7 @@
 				using (var DM = new Process())  //will kill the process if the thread is terminated
 				{
 					DM.StartInfo.FileName = ByondDirectory + "/bin/dm.exe";
-					DM.StartInfo.Arguments = dmePath;
+					DM.StartInfo.Arguments = String.Format("-clean {0}", dmePath);
 					DM.StartInfo.RedirectStandardOutput = true;
 					DM.StartInfo.UseShellExecute = false;
 					var OutputList = new StringBuilder();


- Include what is monitored (modify,create,delete,move,all) in verbose output

--- src/main/csharp/Runner.cs
+++ src/main/csharp/Runner.cs
@@ -77,8 +77,9 @@
 				if (!args.Quiet)
 				{
 					Console.Error.WriteLine(
-						"===> {0} {1}{2} for {3}",
+						"===> {0} for {1} in {2}{3} for {4}",
 						args.Monitor ? "Monitoring" : "Watching",
+						changes,
 						args.Path,
 						args.Recursive ? " -r" : "",
 						String.Join(", ", args.Events.ToArray())


Hide ads when they fail to display

Hide ads when they fail to display

--- UKTrains.WP8/Ads.cs
+++ UKTrains.WP8/Ads.cs
@@ -81,6 +81,7 @@

             public override void AdFailedEventHandler(object sender)
             {
+                _hideAds();
             }

             public override void AdReceivedEventHandler(object sender)


Reset speed/gravity in case old config file is found.

Signed-off-by: V10lator <fd1911a80a45064cec08d87c592168c9000a1489@myway.de>

--- UltimateSettings.cs
+++ UltimateSettings.cs
@@ -8,6 +8,8 @@
 {
 	internal class UltimateSettings
 	{
+		private const int CONFIG_VERSION = 4;
+
 		private Dictionary<string, object> settingsValueDictionary = new Dictionary<string, object>();
 		internal const string TOGGLE_KEY_SETTING = "Toggle key";
 		internal const string JUMP_KEY_SETTING = "Jump key";
@@ -177,7 +179,7 @@
 		{
 			object obj;
 			if (!settingsValueDictionary.TryGetValue ("Version", out obj)) {
-				settingsValueDictionary.Add ("Version", 3);
+				settingsValueDictionary.Add ("Version", 4);
 				UltimateMain.Instance.Log ("Unversioned config file, fixing!", UltimateMain.LogLevel.WARNING);
 				needSave = true;
 			} else {
@@ -186,13 +188,21 @@
 					v = int.Parse (obj.ToString ());
 				} catch (Exception) {
 				}
-				if (v < 3) {
+				if (v < CONFIG_VERSION) {
 					UltimateMain.Instance.Log ("Config file version " + v + " found, updating!", UltimateMain.LogLevel.WARNING);
-					settingsValueDictionary["Version"] = 3;
-					needSave = true;
-				} else if (v > 3) {
-					settingsValueDictionary["Version"] = 3;
-					UltimateMain.Instance.Log ("Config file version " + v + " not supported! Assuming version 2", UltimateMain.LogLevel.WARNING);
+					settingsValueDictionary["Version"] = CONFIG_VERSION;
+
+					// Speed and Gravity changed from 3 to 4, reset...
+					UltimateMain.Instance.Log("Resetting speed and gravity settings!", UltimateMain.LogLevel.WARNING);
+					if (settingsValueDictionary.ContainsKey(SPEED_SETTING))
+						settingsValueDictionary[SPEED_SETTING] = DEFAULT_SPEED;
+					if (settingsValueDictionary.ContainsKey(GRAVITY_SETTING))
+						settingsValueDictionary[GRAVITY_SETTING] = DEFAULT_GRAVITY;
+
+					needSave = true;
+				} else if (v > CONFIG_VERSION) {
+					settingsValueDictionary["Version"] = CONFIG_VERSION;
+					UltimateMain.Instance.Log ("Config file version " + v + " not supported! Assuming version " + v, UltimateMain.LogLevel.WARNING);
 					needSave = true;
 				}
 			}


テスト追加したので一旦コミット

テスト追加したので一旦コミット

まだ増えたり減ったりするかとおもいますが、一旦ここで記録を残しています

--- UnitTest/UrlTest.cs
+++ UnitTest/UrlTest.cs
@@ -94,7 +94,7 @@
       Assert.Equal("http", url.Scheme);
       Assert.Equal("/path/to/api", url.LocalPath);

-      //パラメータの追加(プロパティ経由)
+      //パラメータの追加(メソッドで)
       url.SetParam("key", "value");
       Assert.Equal("value", url.GetParam("key"));
       Assert.Equal("http://example.com/path/to/api?key=value", url.Build());
@@ -150,7 +150,7 @@
       Assert.Equal("http", url.Scheme);
       Assert.Equal("/path/to/api", url.LocalPath);

-      //パラメータの追加(プロパティ経由)
+      //パラメータの追加(メソッドで)
       url.SetParam("key", "value");
       Assert.Equal("value", url.GetParam("key"));
       Assert.Equal("http://example.com/path/to/api?foo=bar&key=value", url.Build());
@@ -220,6 +220,26 @@
       str = "addedStr";
       Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2", url.Build());

+      //Setメソッドでパラメータ追加
+      url.SetParam("newKey", "newValue");
+      Assert.Equal("newValue", url.GetParam("newKey"));
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue", url.Build());
+
+      //Build()の引数でパラメータ追加
+      var tmpParam = new Dictionary<string, string>() { {"tmpKey", "tmpValue"} };
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue&tmpKey=tmpValue", url.Build(tmpParam));
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue", url.Build());
+
+      //Build()の引数でパラメータ削除テスト
+      var exclude = new List<string>() { "array[]" };
+      Assert.Equal("http://example.com/path/to/api?newKey=newValue", url.Build(exclude));
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue", url.Build());
+
+      //値が空文字の Dictionary を追加
+      var empValDic = new Dictionary<string, string>() { { "empKey", "" } };
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue&empKey=", url.Build(empValDic));
+      Assert.Equal("http://example.com/path/to/api?array[]=value0&array[]=value1&array[]=value2&newKey=newValue", url.Build());
+
       //存在しないキーで値を取得しようとした場合、例外になる。
       Assert.Throws<KeyNotFoundException>(() => url.GetParam("unknown"));
     }


Catch exception when performing file watching

In medium trust FileSystemWatcher aren't allowed. So disable file watching
when en exception occurs. Can't use AppDomain.IsFullyTrusted because it is
only supported in .NET 4 and up.
fixes #144

--- src/NLog/LogFactory.cs
+++ src/NLog/LogFactory.cs
@@ -185,7 +185,14 @@
                     if (this.config != null)
                     {
                         Dump(this.config);
-                        this.watcher.Watch(this.config.FileNamesToWatch);
+                        try
+                        {
+                            this.watcher.Watch(this.config.FileNamesToWatch);
+                        }
+                        catch (Exception exception)
+                        {
+                            InternalLogger.Warn("Cannot start file watching: {0}. File watching is disabled", exception);
+                        }
                     }
 #endif
                     if (this.config != null)


Four4Sample - more factorial tests

Four4Sample - more factorial tests

--- projects/Four4Sample/Four4.Test/CalculationTest.cs
+++ projects/Four4Sample/Four4.Test/CalculationTest.cs
@@ -99,6 +99,8 @@

         [Theory]
         [InlineData("4 !", "24")]
+        [InlineData("4 .4 / !", "3628800")]
+        [InlineData("4 4 / 4 + !", "120")]
         public void Factorial(string input, string result)
         {
             Calc(input, result);


Make tags and fields more thread safe.

Make tags and fields more thread safe.

--- src/Ocelog/LogEvent.cs
+++ src/Ocelog/LogEvent.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;

@@ -13,8 +14,8 @@

     public class LogEvent
     {
-        private List<string> _tags = new List<string>();
-        private List<object> _fields= new List<object>();
+        private ConcurrentQueue<string> _tags = new ConcurrentQueue<string>();
+        private ConcurrentQueue<object> _fields= new ConcurrentQueue<object>();
         private object _content;

         public object Content
@@ -35,14 +36,14 @@

         public void AddTag(string tag)
         {
-            _tags.Add(tag);
+            _tags.Enqueue(tag);
         }

         public void AddField(object additionalFields)
         {
             EnsureValidType(additionalFields, nameof(additionalFields));

-            _fields.Add(additionalFields);
+            _fields.Enqueue(additionalFields);
         }

         private void EnsureValidType(object value, string nameof)


Return 0 if maxValue in Range is 0.

Return 0 if maxValue in Range is 0.

--- src/PcgRandom/Pcg32.cs
+++ src/PcgRandom/Pcg32.cs
@@ -44,6 +44,11 @@

         public uint Range(uint maxValue)
         {
+            if (maxValue == 0)
+            {
+                return 0;
+            }
+
             uint threshold = (uint)((0x100000000UL - maxValue) % maxValue);

             for (;;)


Interactable listen to events from children

--- Assets/MixedRealityToolkit.SDK/Features/UX/Interactable/Scripts/Interactable.cs
+++ Assets/MixedRealityToolkit.SDK/Features/UX/Interactable/Scripts/Interactable.cs
@@ -625,11 +625,15 @@
                 return;
             }

-            if (eventData.NewFocusedObject == gameObject)
+            if (eventData.NewFocusedObject == null)
+            {
+                RemovePointer(eventData.Pointer);
+            }
+            else if (eventData.NewFocusedObject.transform.IsChildOf(gameObject.transform))
             {
                 AddPointer(eventData.Pointer);
             }
-            else if (eventData.OldFocusedObject == gameObject)
+            else if (eventData.OldFocusedObject.transform.IsChildOf(gameObject.transform))
             {
                 RemovePointer(eventData.Pointer);
             }


Handle situation when there is no TabTip key in registry

--- WPFTabTip/TabTip.cs
+++ WPFTabTip/TabTip.cs
@@ -65,7 +65,7 @@
         {
             const string TabTipAutoInvokeKey = "EnableDesktopModeAutoInvoke";

-            int EnableDesktopModeAutoInvoke = (int) Registry.GetValue(TabTipRegistryKeyName, TabTipAutoInvokeKey, -1);
+            int EnableDesktopModeAutoInvoke = (int) (Registry.GetValue(TabTipRegistryKeyName, TabTipAutoInvokeKey, -1) ?? -1);
             if (EnableDesktopModeAutoInvoke != 1)
                 Registry.SetValue(TabTipRegistryKeyName, TabTipAutoInvokeKey, 1);
         }
@@ -78,7 +78,7 @@
             const string TabTipDockedKey = "EdgeTargetDockedState";
             const string TabTipProcessName = "TabTip";

-            int docked = (int)Registry.GetValue(TabTipRegistryKeyName, TabTipDockedKey, 0);
+            int docked = (int) (Registry.GetValue(TabTipRegistryKeyName, TabTipDockedKey, 1) ?? 1);
             if (docked == 1)
             {
                 Registry.SetValue(TabTipRegistryKeyName, TabTipDockedKey, 0);


WebSearches: Make formatting methods virtual

This is in preparation for subclasses overriding the standard formatting
with more extensive and/or specialized formatting.

--- WebSearches/Site.cs
+++ WebSearches/Site.cs
@@ -75,14 +75,30 @@
             if (displayed >= DisplayMax)
                 break;

-            var title = GoogleTools.ReplaceBoldTags(result.Title, "\u0002", "\u000F");
-            title = RemoveSiteName(title);
+            var formatted = FormatResult(result);

-            var msg = string.Format("[{0}] {1} :: {2}", displayed + 1, title, result.Address);
+            var msg = string.Format("[{0}] {1}", displayed + 1, formatted);
             yield return msg;

             displayed++;
         }
+    }
+
+
+    public virtual string FormatResult(SearchResult result)
+    {
+        var title = FormatTitle(result);
+
+        return string.Format("{0} :: {1}", title, result.Address);
+    }
+
+
+    public virtual string FormatTitle(SearchResult result)
+    {
+        var title = GoogleTools.ReplaceBoldTags(result.Title, "\u0002", "\u000F");
+        title = RemoveSiteName(title);
+
+        return title;
     }


Fix compilation problems

Fix compilation problems

--- src/Assets/Scripts/UI/Changelog/ChangelogList.cs
+++ src/Assets/Scripts/UI/Changelog/ChangelogList.cs
@@ -1,6 +1,6 @@
 using System.Collections;
 using System.Linq;
-using PatchKit.Api.Models;
+using PatchKit.Api.Models.Main;
 using PatchKit.Unity.UI;
 using PatchKit.Unity.Utilities;


Look for msbuild in default install path on mac

--- src/Cake.Common/Tools/MSBuild/MSBuildResolver.cs
+++ src/Cake.Common/Tools/MSBuild/MSBuildResolver.cs
@@ -12,6 +12,18 @@
     {
         public static FilePath GetMSBuildPath(IFileSystem fileSystem, ICakeEnvironment environment, MSBuildToolVersion version, MSBuildPlatform buildPlatform)
         {
+            if (environment.Platform.Family == PlatformFamily.OSX)
+            {
+                var macMSBuildPath = new FilePath("/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild");
+
+                if (fileSystem.Exist(macMSBuildPath))
+                {
+                    return macMSBuildPath;
+                }
+
+                throw new CakeException("Could not resolve MSBuild.");
+            }
+
             var binPath = version == MSBuildToolVersion.Default
                 ? GetHighestAvailableMSBuildVersion(fileSystem, environment, buildPlatform)
                 : GetMSBuildPath(fileSystem, environment, (MSBuildVersion)version, buildPlatform);


Change to small responsive

Change to small responsive

--- src/Cash-Flow-Projection/Views/Home/Index.cshtml
+++ src/Cash-Flow-Projection/Views/Home/Index.cshtml
@@ -17,7 +17,7 @@

-

+

             Date


Only get process and service lists if any checks are defined.

--- src/CollectdWinService/ReadSystemChecksPlugin.cs
+++ src/CollectdWinService/ReadSystemChecksPlugin.cs
@@ -83,6 +83,8 @@

             List<ServiceCheckConfig> serviceChecks = _checks.OfType<ServiceCheckConfig>().ToList();

+            if (serviceChecks.Count > 0)
+            {
             ServiceController[] serviceList = ServiceController.GetServices();

                 foreach (SystemCheckConfig checkConfig in serviceChecks)
@@ -109,6 +111,7 @@
                     Logger.Warn("No services matching '{0}' were found. Check not created.", checkConfig.Name);
                 }
             }
+            }
             return checkList;
         }

@@ -119,6 +122,8 @@

             List<ProcessCheckConfig> processChecks = _checks.OfType<ProcessCheckConfig>().ToList();

+            if (processChecks.Count > 0)
+            {
             Process[] processList = Process.GetProcesses();

                 foreach (SystemCheckConfig checkConfig in processChecks)
@@ -143,7 +148,7 @@
                 }

             }
-
+            }
             return checkList;
         }


Enable NRT on `IHasCustomTooltip` interface

--- osu.Framework/Graphics/Cursor/IHasCustomTooltip.cs
+++ osu.Framework/Graphics/Cursor/IHasCustomTooltip.cs
@@ -1,7 +1,5 @@
 // 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.
-
-#nullable disable

 namespace osu.Framework.Graphics.Cursor
 {
@@ -24,20 +22,21 @@
         /// <summary>
         /// Tooltip text that shows when hovering the drawable.
         /// </summary>
-        object TooltipContent { get; }
+        object? TooltipContent { get; }
     }

     /// <inheritdoc />
     public interface IHasCustomTooltip<TContent> : IHasCustomTooltip
+        where TContent : class
     {
         ITooltip IHasCustomTooltip.GetCustomTooltip() => GetCustomTooltip();

         /// <inheritdoc cref="IHasCustomTooltip.GetCustomTooltip"/>
         new ITooltip<TContent> GetCustomTooltip();

-        object IHasCustomTooltip.TooltipContent => TooltipContent;
+        object? IHasCustomTooltip.TooltipContent => TooltipContent;

         /// <inheritdoc cref="IHasCustomTooltip.TooltipContent"/>
-        new TContent TooltipContent { get; }
+        new TContent? TooltipContent { get; }
     }
 }


Assert that SecurityService.GetUserCredentialsAsync should be called on main thread only.

--- src/Common/Core/Impl/Security/SecurityService.cs
+++ src/Common/Core/Impl/Security/SecurityService.cs
@@ -23,6 +23,8 @@
         }

         public Task<Credentials> GetUserCredentialsAsync(string authority, bool invalidateStoredCredentials, CancellationToken cancellationToken = default(CancellationToken)) {
+            _coreShellLazy.Value.AssertIsOnMainThread();
+
             var showDialog = invalidateStoredCredentials;
             var credentials = new Credentials();


Add xmldoc covering nuances of Prepare/FreeAfterUse

--- osu.Framework/Graphics/Pooling/PoolableDrawable.cs
+++ osu.Framework/Graphics/Pooling/PoolableDrawable.cs
@@ -62,6 +62,7 @@

         /// <summary>
         /// Perform any initialisation on new usage of this drawable.
+        /// This is scheduled to the first update frame and may not be run if this is never reached.
         /// </summary>
         protected virtual void PrepareForUse()
         {
@@ -69,6 +70,7 @@

         /// <summary>
         /// Perform any clean-up required before returning this drawable to a pool.
+        /// This is called regardless of whether <see cref="PrepareForUse"/> was executed.
         /// </summary>
         protected virtual void FreeAfterUse()
         {


Fix redist

Fix redist

--- src/Common/src/CoreLib/System/IO/PathInternal.cs
+++ src/Common/src/CoreLib/System/IO/PathInternal.cs
@@ -15,8 +15,16 @@
         /// </summary>
         internal static bool StartsWithDirectorySeparator(ReadOnlySpan<char> path) => path.Length > 0 && IsDirectorySeparator(path[0]);

+#if MS_IO_REDIST
         internal static string EnsureTrailingSeparator(string path)
-            => Path.EndsInDirectorySeparator(path.AsSpan()) ? path : path + DirectorySeparatorCharAsString;
+            => EndsInDirectorySeparator(path) ? path : path + DirectorySeparatorCharAsString;
+
+        internal static bool EndsInDirectorySeparator(string path)
+            => !string.IsNullOrEmpty(path) && IsDirectorySeparator(path[path.Length - 1]);
+#else
+        internal static string EnsureTrailingSeparator(string path)
+            => Path.EndsInDirectorySeparator(path.AsSpan()) ? path : path + DirectorySeparatorCharAsString;
+#endif

         internal static bool IsRoot(ReadOnlySpan<char> path)
             => path.Length == GetRootLength(path);


Improve colouring

Improve colouring

--- osu.Game.Tests/Visual/Gameplay/TestSceneScoring.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneScoring.cs
@@ -30,18 +30,6 @@
         private SettingsSlider<int> sliderMaxCombo = null!;

         private FillFlowContainer legend = null!;
-
-        private static readonly Color4[] line_colours =
-        {
-            Color4Extensions.FromHex("588c7e"),
-            Color4Extensions.FromHex("b2a367"),
-            Color4Extensions.FromHex("c98f65"),
-            Color4Extensions.FromHex("bc5151"),
-            Color4Extensions.FromHex("5c8bd6"),
-            Color4Extensions.FromHex("7f6ab7"),
-            Color4Extensions.FromHex("a368ad"),
-            Color4Extensions.FromHex("aa6880"),
-        };

         [Test]
         public void TestBasic()
@@ -120,13 +108,13 @@
             graphs.Clear();
             legend.Clear();

-            runForProcessor("lazer-classic", new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Classic } });
-            runForProcessor("lazer-standardised", new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Standardised } });
+            runForProcessor("lazer-standardised", Color4.Cyan, new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Standardised } });
+            runForProcessor("lazer-classic", Color4.Orange, new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Classic } });

             int totalScore = 0;
             int currentCombo = 0;

-            runForAlgorithm("stable-v1", () =>
+            runForAlgorithm("stable-v1", Color4.Beige, () =>
             {
                 const int base_score = 300;
                 const float score_multiplier = 1;
@@ -144,7 +132,7 @@
             }, () => totalScore);
         }

-        private void runForProcessor(string name, ScoreProcessor processor)
+        private void runForProcessor(string name, Color4 colour, ScoreProcessor processor)
         {
             int maxCombo = sliderMaxCombo.Current.Value;

@@ -154,17 +142,15 @@

             processor.ApplyBeatmap(beatmap);

-            runForAlgorithm(name,
+            runForAlgorithm(name, colour,
                 () => processor.ApplyResult(new OsuJudgementResult(new HitCircle(), new OsuJudgement()) { Type = HitResult.Great }),
                 () => processor.ApplyResult(new OsuJudgementResult(new HitCircle(), new OsuJudgement()) { Type = HitResult.Miss }),
                 () => (int)processor.TotalScore.Value);
         }

-        private void runForAlgorithm(string name, Action applyHit, Action applyMiss, Func<int> getTotalScore)
+        private void runForAlgorithm(string name, Color4 colour, Action applyHit, Action applyMiss, Func<int> getTotalScore)
         {
             int maxCombo = sliderMaxCombo.Current.Value;
-
-            Color4 colour = line_colours[Math.Abs(name.GetHashCode()) % line_colours.Length];

             List<float> results = new List<float>();


Skip version (#28835)

Skip version (#28835)

--- src/Common/src/CoreLib/System/IO/PathInternal.cs
+++ src/Common/src/CoreLib/System/IO/PathInternal.cs
@@ -116,6 +116,25 @@
         /// <param name="rootLength">The length of the root of the given path</param>
         internal static string RemoveRelativeSegments(string path, int rootLength)
         {
+            Span<char> initialBuffer = stackalloc char[260 /* PathInternal.MaxShortPath */];
+            ValueStringBuilder sb = new ValueStringBuilder(initialBuffer);
+
+            if (RemoveRelativeSegments(path.AsSpan(), rootLength, ref sb))
+            {
+                path = sb.ToString();
+            }
+
+            sb.Dispose();
+            return path;
+        }
+
+        /// <summary>
+        /// Try to remove relative segments from the given path (without combining with a root).
+        /// </summary>
+        /// <param name="rootLength">The length of the root of the given path</param>
+        /// <returns>"true" if the path was modified</returns>
+        internal static bool RemoveRelativeSegments(ReadOnlySpan<char> path, int rootLength, ref ValueStringBuilder sb)
+        {
             Debug.Assert(rootLength > 0);
             bool flippedSeparator = false;

@@ -126,15 +145,12 @@
             if (PathInternal.IsDirectorySeparator(path[skip - 1]))
                 skip--;

-            Span<char> initialBuffer = stackalloc char[260 /* PathInternal.MaxShortPath */];
-            ValueStringBuilder sb = new ValueStringBuilder(initialBuffer);
-
             // Remove "//", "/./", and "/../" from the path by copying each character to the output,
             // except the ones we're removing, such that the builder contains the normalized path
             // at the end.
             if (skip > 0)
             {
-                sb.Append(path.AsSpan(0, skip));
+                sb.Append(path.Slice(0, skip));
             }

             for (int i = skip; i < path.Length; i++)
@@ -182,7 +198,7 @@

                         i += 2;
                         continue;
-                    }
+                   }
                 }

                 // Normalize the directory separator if needed
@@ -198,11 +214,16 @@
             // If we haven't changed the source path, return the original
             if (!flippedSeparator && sb.Length == path.Length)
             {
-                sb.Dispose();
-                return path;
-            }
-
-            return sb.Length < rootLength ? path.Substring(0, rootLength) : sb.ToString();
+                return false;
+            }
+
+            // We may have eaten the trailing separator from the root when we started and not replaced it
+            if (skip != rootLength && sb.Length < rootLength)
+            {
+                sb.Append(path[rootLength - 1]);
+            }
+
+            return true;
         }
     }
 }


Remove unused field

Remove unused field

--- osu.Game/Graphics/UserInterfaceV2/ColourDisplay.cs
+++ osu.Game/Graphics/UserInterfaceV2/ColourDisplay.cs
@@ -31,7 +31,6 @@

         private readonly BindableWithCurrent<Colour4> current = new BindableWithCurrent<Colour4>();

-        private OsuClickableContainer colourCircle;
         private OsuSpriteText colourName;

         public Bindable<Colour4> Current
@@ -70,7 +69,7 @@
                 Spacing = new Vector2(0, 10),
                 Children = new Drawable[]
                 {
-                    colourCircle = new ColourCircle
+                    new ColourCircle
                     {
                         Current = { BindTarget = Current },
                         DeleteRequested = () => DeleteRequested?.Invoke(this)


Fix potential crash on rare incorrect firing of skin dropdown update methods

As brought to light by https://gist.github.com/smoogipoo/56eda7ab56b9d1966556f2ca7a80a847.

There's a chance that the dropdown is not populated by the time
`updateSelectedSkinFromConfig` is fired via an external means (config
changes).

--- osu.Game/Overlays/Settings/Sections/SkinSection.cs
+++ osu.Game/Overlays/Settings/Sections/SkinSection.cs
@@ -134,6 +134,9 @@

         private void updateSelectedSkinFromConfig()
         {
+            if (!skinDropdown.Items.Any())
+                return;
+
             Live<SkinInfo> skin = null;

             if (Guid.TryParse(configBindable.Value, out var configId))


Improve acceptable difference for repeat edges

Likelihood that `spanDuration` is greater than E+7 is quite low in any realistic case, so this should work fine.

--- osu.Game/Rulesets/Edit/Checks/CheckMutedObjects.cs
+++ osu.Game/Rulesets/Edit/Checks/CheckMutedObjects.cs
@@ -98,9 +98,13 @@
             {
                 double spanDuration = hasRepeats.Duration / hasRepeats.SpanCount();
                 double spans = (time - hitObject.StartTime) / spanDuration;
+                double acceptableDifference = 1 / spanDuration; // 1 ms of acceptable difference, as with head/tail above.

-                if (Precision.AlmostEquals(spans, Math.Ceiling(spans)) || Precision.AlmostEquals(spans, Math.Floor(spans)))
+                if (Precision.AlmostEquals(spans, Math.Ceiling(spans), acceptableDifference) ||
+                    Precision.AlmostEquals(spans, Math.Floor(spans), acceptableDifference))
+                {
                     return EdgeType.Repeat;
+                }
             }

             return EdgeType.None;


Change section title to read better

Change section title to read better

--- osu.Game/Screens/Edit/Setup/RulesetSetupSection.cs
+++ osu.Game/Screens/Edit/Setup/RulesetSetupSection.cs
@@ -8,7 +8,7 @@
 {
     public abstract class RulesetSetupSection : SetupSection
     {
-        public sealed override LocalisableString Title => $"{rulesetInfo.Name}-specific";
+        public sealed override LocalisableString Title => $"Ruleset ({rulesetInfo.Name})";

         private readonly RulesetInfo rulesetInfo;


Drag requires 4 pixels of movement to drag+move or resize.

--- FRBDK/Glue/OfficialPlugins/Compiler/Embedded/Editing/Markers/SelectionMarker.cs
+++ FRBDK/Glue/OfficialPlugins/Compiler/Embedded/Editing/Markers/SelectionMarker.cs
@@ -116,6 +116,8 @@

         const int handleDimension = 10;

+        Microsoft.Xna.Framework.Point ScreenPointPushed;
+
         #endregion

         #region Constructor/Init
@@ -176,16 +178,38 @@
         {
             Visible = item != null;

+            UpdateScreenPointPushed();
+
             UpdateMainRectangleSizeToItem(item);

             UpdateColor();

+            ApplyPrimaryDownDragEditing(item, sideGrabbed);
+
+            UpdateHandlesVisibilityAndPosition();
+        }
+
+        private void UpdateScreenPointPushed()
+        {
+            var cursor = FlatRedBall.Gui.GuiManager.Cursor;
+
+            if(cursor.PrimaryPush)
+            {
+                ScreenPointPushed = new Microsoft.Xna.Framework.Point(cursor.ScreenX, cursor.ScreenY);
+            }
+        }
+
+        private void ApplyPrimaryDownDragEditing(PositionedObject item, ResizeSide sideGrabbed)
+        {
             var cursor = FlatRedBall.Gui.GuiManager.Cursor;

             if (CanMoveItem && cursor.PrimaryDown &&
                 (cursor.ScreenXChange != 0 || cursor.ScreenYChange != 0))
             {
-                if (item != null)
+                var hasMovedEnough = Math.Abs(ScreenPointPushed.X - cursor.ScreenX) > 4 ||
+                    Math.Abs(ScreenPointPushed.Y - cursor.ScreenY) > 4;
+
+                if (item != null && hasMovedEnough)
                 {
                     if (sideGrabbed == ResizeSide.None)
                     {
@@ -201,8 +225,6 @@
                     }
                 }
             }
-
-            UpdateHandlesVisibilityAndPosition();
         }

         private void UpdateColor()


Checked that index will never be more than long.MaxValue.

--HG--
branch : 2011-05-28-es

--- Framework/Lokad.Cqrs.Portable/Feature.TapeStorage/SingleThreadFileTapeWriter.cs
+++ Framework/Lokad.Cqrs.Portable/Feature.TapeStorage/SingleThreadFileTapeWriter.cs
@@ -37,10 +37,17 @@
                 var dataStream = dataWriter.BaseStream;
                 var indexStream = indexWriter.BaseStream;

+                // Used only to enforce the rule that index must not be more than long.MaxValue
+                var index = indexStream.Position / sizeof(long);
+
                 foreach (var record in records)
                 {
                     if (record.Length == 0)
                         throw new ArgumentException("Record must contain at least one byte.");
+
+                    if (index > long.MaxValue - 1)
+                        throw new IndexOutOfRangeException("Index is more than long.MaxValue.");
+                    index++;

                     indexWriter.Write(dataStream.Position);


delete method updated

delete method updated

--- UsersMVC/DAL/IRepository.cs
+++ UsersMVC/DAL/IRepository.cs
@@ -12,7 +12,7 @@
         T GetUser(long id);
         void Create(T item);
         void Update(T item);
-        void Delete(string login);
+        void Delete(long id);
         void Save();
     }
 }


SQLiteMetadataTable implementation

SQLiteMetadataTable implementation

--- src/Evolve/Dialect/SQLite/SQLiteMetadataTable.cs
+++ src/Evolve/Dialect/SQLite/SQLiteMetadataTable.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Evolve.Connection;
 using Evolve.Metadata;
 using Evolve.Migration;
@@ -8,13 +9,15 @@
 {
     public class SQLiteMetadataTable : MetadataTable
     {
-        public SQLiteMetadataTable(string schema, string name, IWrappedConnection wrappedConnection) : base(schema, name, wrappedConnection)
+        public SQLiteMetadataTable(string schema, string tableName, IWrappedConnection wrappedConnection) : base(schema, tableName, wrappedConnection)
         {
         }

+        /// <summary>
+        ///     SQLite does not support locking. No concurrent migration supported.
+        /// </summary>
         public override void Lock()
         {
-            throw new NotImplementedException();
         }

         public override bool CreateIfNotExists()
@@ -32,17 +35,17 @@

         protected override bool IsExists()
         {
-            return _wrappedConnection.QueryForLong($"SELECT COUNT(tbl_name) FROM \"{Schema}\".sqlite_master WHERE type = 'table' AND tbl_name = '{Name}'") == 1;
+            return _wrappedConnection.QueryForLong($"SELECT COUNT(tbl_name) FROM \"{Schema}\".sqlite_master WHERE type = 'table' AND tbl_name = '{TableName}'") == 1;
         }

         protected override void Create()
         {
-            string sql = "CREATE TABLE [{schema}].[{table}] " +
+            string sql = $"CREATE TABLE [{Schema}].[{TableName}] " +
              "( " +
                  "[id] INT PRIMARY KEY AUTOINCREMENT NOT NULL, " +
                  "[version] VARCHAR(50), " +
                  "[description] VARCHAR(200) NOT NULL, " +
-                 "[script] VARCHAR(1000) NOT NULL, " +
+                 "[name] VARCHAR(1000) NOT NULL, " +
                  "[checksum] VARCHAR(32), " +
                  "[installed_by] VARCHAR(100) NOT NULL, " +
                  "[installed_on] TEXT NOT NULL DEFAULT (strftime('%Y-%m-%d %H:%M:%f','now')), " +
@@ -52,9 +55,9 @@
             _wrappedConnection.ExecuteNonQuery(sql);
         }

-        protected override MigrationMetadata InternalAddMigrationMetadata(MigrationScript migration, bool success)
+        protected override void InternalAddMigrationMetadata(MigrationScript migration, bool success)
         {
-            string sql = "INSERT INTO [{schema}].[{table}] ([version], [description], [script], [checksum], [installed_by], [success]) VALUES" +
+            string sql = $"INSERT INTO [{Schema}].[{TableName}] ([version], [description], [name], [checksum], [installed_by], [success]) VALUES" +
              "( " +
                 $"'{migration.Version}', " +
                 $"'{migration.Description.TruncateWithEllipsis(200)}', " +
@@ -63,11 +66,25 @@
                 $"'', " +
                 $"{(success ? 1 : 0)}, " +
              ")";
+
+            _wrappedConnection.ExecuteNonQuery(sql);
         }

         protected override IEnumerable<MigrationMetadata> InternalGetAllMigrationMetadata()
         {
-            throw new NotImplementedException();
+            string sql = $"SELECT [id], [version], [description], [name], [checksum], [installed_by], [installed_on], [success] FROM [{Schema}].[{TableName}]";
+            return _wrappedConnection.QueryForListOfT(sql, r =>
+                   {
+                       return new MigrationMetadata(r.GetString(1), r.GetString(2), r.GetString(3))
+                       {
+                           Id = r.GetInt32(0),
+                           Checksum = r.GetString(4),
+                           InstalledBy = r.GetString(5),
+                           InstalledOn = r.GetDateTime(6),
+                           Success = r.GetBoolean(7)
+                       };
+                   })
+                   .DefaultIfEmpty();
         }
     }
 }


version 2.0.3

version 2.0.3

--- source/AskMonaViewer/MainForm.cs
+++ source/AskMonaViewer/MainForm.cs
@@ -27,7 +27,7 @@
         private string mHtmlHeader = "";
         private bool mIsTabClosing = false;
         private bool mIsDocumentLoading = false;
-        private const string mVersionString = "2.0.2";
+        private const string mVersionString = "2.0.3";
         private ApplicationSettings mSettings;
         private AskMonaApi mAskMonaApi;
         private ImgurApi mImgurApi;


Refactor code.

Refactor code.

--- XMutator/Program.cs
+++ XMutator/Program.cs
@@ -59,14 +59,14 @@
                 dirInfo.Attributes = FileAttributes.Normal;
             }
             //フォルダ内のすべてのファイルの属性を変更
-            foreach (FileInfo fi in dirInfo.GetFiles()) {
+            foreach (var fi in dirInfo.GetFiles()) {
                 if ((fi.Attributes & FileAttributes.ReadOnly) ==
                     FileAttributes.ReadOnly) {
                     fi.Attributes = FileAttributes.Normal;
                 }
             }
             //サブフォルダの属性を回帰的に変更
-            foreach (DirectoryInfo di in dirInfo.GetDirectories()) {
+            foreach (var di in dirInfo.GetDirectories()) {
                 RemoveReadonlyAttribute(di);
             }
         }
@@ -125,7 +125,7 @@
             if (!dirPaths.IsEmpty() && !help) {
                 foreach (var dirPath in dirPaths) {
                     var projName = Path.GetFileName(dirPath);
-                    CopyDirectory(dirPath, "backup\\" + projName);
+                    CopyDirectory(dirPath, Path.Combine("backup", projName));

                     if (MavenTest(dirPath) == 2) {
                         Console.WriteLine("Not Run Tests");
@@ -135,7 +135,7 @@
                     var generatedMutatns = 0;
                     var killedMutants = 0;

-                    var files = GetAllJavaFiles(dirPath + "\\src\\main");
+                    var files = GetAllJavaFiles(Path.Combine(dirPath, "src", "main"));
                     foreach (var filePath in files) {
                         var tree = CstGenerators.JavaUsingAntlr3.GenerateTreeFromCodePath(filePath);
                         var nodes = tree.Descendants()
@@ -153,9 +153,7 @@
                             node.Replacement = "{}";

                             using (var mutant = new StreamWriter(filePath, false,
-                                    Encoding.GetEncoding(932))) {
-                                mutant.WriteLine(tree.Code);
-                            }
+                                    Encoding.GetEncoding(932))) mutant.WriteLine(tree.Code);
                             //Console.WriteLine(tree.Code);
                             node.Replacement = null;
                             generatedMutatns++;


Federations should now be fetched again

Federations should now be fetched again

--- src/HtmlGenerator/Pass1-Generation/Federation.cs
+++ src/HtmlGenerator/Pass1-Generation/Federation.cs
@@ -22,7 +22,7 @@

         public Federation(params string[] servers)
         {
-            if (servers == null || servers.Length > 0)
+            if (servers == null || servers.Length <= 0)
             {
                 return;
             }