Use vectorized SpanHelpers.SequenceEqual for string equality (#16994)

--- src/mscorlib/src/System/String.Comparison.cs
+++ src/mscorlib/src/System/String.Comparison.cs
@@ -80,61 +80,17 @@
         // Search/Query methods
         //

-        private static unsafe bool EqualsHelper(String strA, String strB)
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private static bool EqualsHelper(String strA, String strB)
         {
             Debug.Assert(strA != null);
             Debug.Assert(strB != null);
             Debug.Assert(strA.Length == strB.Length);

-            int length = strA.Length;
-
-            fixed (char* ap = &strA._firstChar) fixed (char* bp = &strB._firstChar)
-            {
-                char* a = ap;
-                char* b = bp;
-
-#if BIT64
-                // Single int read aligns pointers for the following long reads
-                // PERF: No length check needed as there is always an int32 worth of string allocated
-                //       This read can also include the null terminator which both strings will have
-                if (*(int*)a != *(int*)b) return false;
-                length -= 2; a += 2; b += 2;
-
-                // for AMD64 bit platform we unroll by 12 and
-                // check 3 qword at a time. This is less code
-                // than the 32 bit case and is a shorter path length.
-
-                while (length >= 12)
-                {
-                    if (*(long*)a != *(long*)b) return false;
-                    if (*(long*)(a + 4) != *(long*)(b + 4)) return false;
-                    if (*(long*)(a + 8) != *(long*)(b + 8)) return false;
-                    length -= 12; a += 12; b += 12;
-                }
-#else
-                while (length >= 10)
-                {
-                    if (*(int*)a != *(int*)b) return false;
-                    if (*(int*)(a + 2) != *(int*)(b + 2)) return false;
-                    if (*(int*)(a + 4) != *(int*)(b + 4)) return false;
-                    if (*(int*)(a + 6) != *(int*)(b + 6)) return false;
-                    if (*(int*)(a + 8) != *(int*)(b + 8)) return false;
-                    length -= 10; a += 10; b += 10;
-                }
-#endif
-
-                // This depends on the fact that the String objects are
-                // always zero terminated and that the terminating zero is not included
-                // in the length. For odd string sizes, the last compare will include
-                // the zero terminator.
-                while (length > 0)
-                {
-                    if (*(int*)a != *(int*)b) return false;
-                    length -= 2; a += 2; b += 2;
-                }
-
-                return true;
-            }
+            return SpanHelpers.SequenceEqual(
+                    ref Unsafe.As<char, byte>(ref strA.GetRawStringData()),
+                    ref Unsafe.As<char, byte>(ref strB.GetRawStringData()),
+                    ((nuint)strA.Length) * 2);
         }

         private static unsafe bool EqualsIgnoreCaseAsciiHelper(String strA, String strB)
@@ -172,70 +128,6 @@
                 }

                 return true;
-            }
-        }
-
-        private static unsafe bool StartsWithOrdinalHelper(String str, String startsWith)
-        {
-            Debug.Assert(str != null);
-            Debug.Assert(startsWith != null);
-            Debug.Assert(str.Length >= startsWith.Length);
-
-            int length = startsWith.Length;
-
-            fixed (char* ap = &str._firstChar)
-            fixed (char* bp = &startsWith._firstChar)
-            {
-                char* a = ap;
-                char* b = bp;
-
-#if BIT64
-                // Single int read aligns pointers for the following long reads
-                // No length check needed as this method is called when length >= 2
-                Debug.Assert(length >= 2);
-                if (*(int*)a != *(int*)b)
-                    return false;
-                length -= 2;
-                a += 2;
-                b += 2;
-
-                while (length >= 12)
-                {
-                    if (*(long*)a != *(long*)b)
-                        return false;
-                    if (*(long*)(a + 4) != *(long*)(b + 4))
-                        return false;
-                    if (*(long*)(a + 8) != *(long*)(b + 8))
-                        return false;
-                    length -= 12;
-                    a += 12;
-                    b += 12;
-                }
-#else
-                while (length >= 10)
-                {
-                    if (*(int*)a != *(int*)b) return false;
-                    if (*(int*)(a+2) != *(int*)(b+2)) return false;
-                    if (*(int*)(a+4) != *(int*)(b+4)) return false;
-                    if (*(int*)(a+6) != *(int*)(b+6)) return false;
-                    if (*(int*)(a+8) != *(int*)(b+8)) return false;
-                    length -= 10; a += 10; b += 10;
-                }
-#endif
-
-                while (length >= 2)
-                {
-                    if (*(int*)a != *(int*)b)
-                        return false;
-                    length -= 2;
-                    a += 2;
-                    b += 2;
-                }
-
-                // PERF: This depends on the fact that the String objects are always zero terminated
-                // and that the terminating zero is not included in the length. For even string sizes
-                // this compare can include the zero terminator. Bitwise OR avoids a branch.
-                return length == 0 | *a == *b;
             }
         }

@@ -1126,7 +1018,10 @@
                     }
                     return (value.Length == 1) ?
                             true :                 // First char is the same and thats all there is to compare
-                            StartsWithOrdinalHelper(this, value);
+                            SpanHelpers.SequenceEqual(
+                                ref Unsafe.As<char, byte>(ref this.GetRawStringData()),
+                                ref Unsafe.As<char, byte>(ref value.GetRawStringData()),
+                                ((nuint)value.Length) * 2);

                 case StringComparison.OrdinalIgnoreCase:
                     if (this.Length < value.Length)


Stop using Json as error output

Stop using Json as error output

--- src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/RestClients/ResourceManagerRestClientBase.cs
+++ src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/RestClients/ResourceManagerRestClientBase.cs
@@ -253,7 +253,7 @@
         private static Task<string> GetErrorMessage(HttpRequestMessage request, HttpResponseMessage response, ErrorResponseMessage errorResponse)
         {
             return errorResponse != null
-                 ? Task.FromResult(errorResponse.ToFormattedJson())
+                 ? Task.FromResult(string.Format("{0} : {1}", errorResponse.Error.Code, errorResponse.Error.Message))
                  : response.Content.ReadAsStringAsync();
         }


fixed broken test

fixed broken test

--- UnitLibraryTests/VolumeTests.cs
+++ UnitLibraryTests/VolumeTests.cs
@@ -52,7 +52,7 @@
         [Test()]
         public void Volume_ConstructorTests()
         {
-            Volume v1 = new Volume();
+            Volume v1 = new Volume(VolumeType.CubicMiles, 0);
             Volume v2 = new Volume(VolumeType.CubicFeet, 100);
             Volume v3 = new Volume(VolumeType.Gallons, 100);


Testing text nodes

Testing text nodes

--- UnitTests/Library/DOMActions.cs
+++ UnitTests/Library/DOMActions.cs
@@ -150,5 +150,52 @@
             Assert.IsTrue(parent.Contains(child));
             Assert.IsTrue(parent.Contains(grandchild));
         }
+
+        [TestMethod]
+        public void ReturnTextFromBody()
+        {
+            var test = "Some text";
+            var html = string.Format(@"
+
+{0}", test);
+            var doc = DocumentBuilder.Html(html);
+            Assert.AreEqual(test, doc.Body.TextContent);
+            Assert.AreEqual(test, doc.Body.Text());
+            Assert.AreEqual(test, doc.Body.ChildNodes[0].TextContent);
+
+            var text = doc.Body.ChildNodes[0] as TextNode;
+            Assert.IsNotNull(text);
+            Assert.AreEqual(test, text.Data);
+            Assert.AreEqual(test, text.Text);
+        }
+
+        [TestMethod]
+        public void ReturnConcatTextFromBody()
+        {
+            var test1 = "Some text";
+            var test2 = "Other text";
+            var test3 = "Another test";
+            var test = string.Concat(test1, test2, test3);
+            var html = @"
+
+";
+            var doc = DocumentBuilder.Html(html);
+            var text1 = doc.CreateTextNode(test1);
+            var text2 = doc.CreateTextNode(test2);
+            var text3 = doc.CreateTextNode(test3);
+            doc.Body.Append(text1);
+            doc.Body.Append(text2);
+            doc.Body.Append(text3);
+            Assert.AreEqual(test, doc.Body.TextContent);
+            Assert.AreEqual(test, doc.Body.Text());
+            Assert.AreEqual(test1, doc.Body.ChildNodes[0].TextContent);
+
+            Assert.AreEqual(test1, text1.Data);
+            Assert.AreEqual(test, text1.Text);
+            Assert.AreEqual(test2, text2.Data);
+            Assert.AreEqual(test, text2.Text);
+            Assert.AreEqual(test3, text3.Data);
+            Assert.AreEqual(test, text3.Text);
+        }
     }
 }


unit test for #2241

unit test for #2241

--- src/core/Akka.Tests/Actor/SupervisorHierarchySpec.cs
+++ src/core/Akka.Tests/Actor/SupervisorHierarchySpec.cs
@@ -65,6 +65,22 @@
             }
         }

+        private class ResumerAsync : TestReceiveActor
+        {
+            public ResumerAsync()
+            {
+                ReceiveAsync<string>(s => s.StartsWith("spawn:"), async s => Sender.Tell(Context.ActorOf<ResumerAsync>(s.Substring(6))));
+                ReceiveAsync<string>(s => s.Equals("spawn"), async _ => Sender.Tell(Context.ActorOf<ResumerAsync>()));
+                ReceiveAsync<string>(s => s.Equals("fail"), async _ => { throw new Exception("expected"); });
+                ReceiveAsync<string>(s => s.Equals("ping"), async _ => Sender.Tell("pong"));
+            }
+
+            protected override SupervisorStrategy SupervisorStrategy()
+            {
+                return new OneForOneStrategy(_ => Directive.Resume);
+            }
+        }
+
         private class Failure : Exception
         {
             public Directive Directive { get; set; }
@@ -88,7 +104,6 @@
             }
         }

-
         public SupervisorHierarchySpec()
             : base(FullDebugConfig)
         {
@@ -156,8 +171,8 @@
             countDownMax.Wait(TimeSpan.FromSeconds(2)).ShouldBeTrue();
         }

-        [Fact]
-        public void A_supervisor_hierarchy_must_resume_children_after_Resume()
+        private void Helper_A_supervisor_hierarchy_must_resume_children_after_Resume<T>()
+            where T : ActorBase, new()
         {
             //Build this hierarchy:
             //     boss
@@ -165,7 +180,8 @@
             //    middle
             //      |
             //    worker
-            var boss = ActorOf<Resumer>("resumer");
+            var name = typeof(T).Name;
+            var boss = ActorOf<T>(name);
             boss.Tell("spawn:middle");
             var middle = ExpectMsg<IActorRef>();
             middle.Tell("spawn:worker");
@@ -186,8 +202,15 @@
             //verify worker (child to middle) is up
             worker.Tell("ping");
             ExpectMsg("pong");
-
-        }
+        }
+
+        [Fact]
+        public void A_supervisor_hierarchy_must_resume_children_after_Resume()
+        {
+            Helper_A_supervisor_hierarchy_must_resume_children_after_Resume<Resumer>();
+            Helper_A_supervisor_hierarchy_must_resume_children_after_Resume<ResumerAsync>();
+        }
+
         [Fact]
         public void A_supervisor_hierarchy_must_suspend_children_while_failing()
         {
@@ -282,7 +305,6 @@
             preStartCalled.Current.ShouldBe(1);
             postRestartCalled.Current.ShouldBe(0);
         }
-
     }
 }


Changed slightly the 'customer slider footnote' for pricing variables on hourly-pricing when it has a number-included, to be clearer for customer #237

--- web/App_Code/LcPricing/LcPricing.PackageModHourly.cs
+++ web/App_Code/LcPricing/LcPricing.PackageModHourly.cs
@@ -87,8 +87,11 @@
                 if (provar.Value.Def.IsCustomerVariable)
                 {
                     var calculateWithVar = provars.GetCalculateWithVariableFor(provar.Value);
-                    string sliderFootnote = String.Format(provar.Value.PricingVariableID == 1 ? "{0:C}" : "Adds {0:C} per each"
-                        ,calculateWithVar.GetValue<decimal>(0));
+                    string footNoteFormat = provar.Value.PricingVariableID == 1 ? "{0:C}" : "Adds {0:C} per each";
+                    // If package already include an amount, notify it
+                    if ((calculateWithVar.ProviderNumberIncluded ?? 0) > 0)
+                        footNoteFormat = "Includes {1:#,##0.##}, adds {0:C} per additional";
+                    string sliderFootnote = String.Format(footNoteFormat, calculateWithVar.GetValue<decimal>(0), calculateWithVar.ProviderNumberIncluded);

                     sv.AppendFormat(@"
                         <div class='customer-slider' data-prov-value='{2}'


fixed ORSet.cs

fixed ORSet.cs

--- src/contrib/cluster/Akka.DistributedData/ORSet.cs
+++ src/contrib/cluster/Akka.DistributedData/ORSet.cs
@@ -399,8 +399,6 @@
         IReplicatedData IDeltaReplicatedData.MergeDelta(IReplicatedDelta delta) => MergeDelta((IDeltaOperation)delta);
         IReplicatedData IDeltaReplicatedData.ResetDelta() => ResetDelta();

-        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
-
         public override string ToString()
         {
             var sb = new StringBuilder("ORSet(");


Fix Photo response parsing

Fix Photo response parsing

--- extensions/Exporters/FacebookExport/Mono.Facebook/Photo.cs
+++ extensions/Exporters/FacebookExport/Mono.Facebook/Photo.cs
@@ -30,6 +30,7 @@

 namespace Mono.Facebook
 {
+    [System.Xml.Serialization.XmlRootAttribute("photos_upload_response", Namespace="http://api.facebook.com/1.0/")]
 	public class Photo : photo, SessionWrapper
 	{
         [XmlIgnore]


Fixed bug with non-EN locales and numbers. Tests now also pass on german systems

--- src/dotless.Core/engine/LessNodes/Literals/Number.cs
+++ src/dotless.Core/engine/LessNodes/Literals/Number.cs
@@ -40,9 +40,9 @@
         }

         public override string ToCSharp()
-        {
-
-            return Value.ToString("N2");
+        {
+
+            return Value.ToString("N2", CultureInfo.InvariantCulture);
         }


DavidBurns: Mono support so Chrome loads on Linux using .NET

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@8288 07704840-8298-11de-bf8c-fd130f914ac9

--- chrome/src/csharp/webdriver-chrome/ChromeBinary.cs
+++ chrome/src/csharp/webdriver-chrome/ChromeBinary.cs
@@ -107,10 +107,11 @@
                 else if (Platform.CurrentPlatform.IsPlatformType(PlatformType.Vista))
                 {
                     chromeFile = Path.Combine(Path.GetTempPath(), "..\\Google\\Chrome\\Application\\chrome.exe");
-
-                    // TODO(Andre.Nogueira): Skipping for now, revisit later with Mono?
-                    // } else if (Platform.CurrentPlatform.IsPlatformType(PlatformType.Unix)) {
-                    //   chromeFileString.Append("/usr/bin/google-chrome");
+                }
+                else if (Platform.CurrentPlatform.IsPlatformType(PlatformType.Unix))
+                {
+                    chromeFile = "/usr/bin/google-chrome";
+
                     // } else if (Platform.CurrentPlatform.IsPlatformType(PlatformType.MacOSX)) {
                     //  string[] paths = new string[] {
                     //    "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",


Update ObjectSet.cs

Update ObjectSet.cs

--- src/Micro+/ObjectSet.cs
+++ src/Micro+/ObjectSet.cs
@@ -26,6 +26,8 @@
             get { return _list[index]; }
         }

+        public int Count { get { return _list.Count; } }
+
         public IEnumerator<T> GetEnumerator()
         {
             return _list.GetEnumerator();


sync iLoggerbase with code

sync iLoggerbase with code

obsoletes and adding 2 methods

--- src/NLog/ILoggerBase.cs
+++ src/NLog/ILoggerBase.cs
@@ -115,8 +115,27 @@
         /// <param name="level">The log level.</param>
         /// <param name="message">A <see langword="string" /> to be written.</param>
         /// <param name="exception">An exception to be logged.</param>
-        [Obsolete("Use Log(LogLevel, String, Exception) method instead.")]
+        [Obsolete("Use Log(LogLevel level, Exception exception, [Localizable(false)] string message, params object[] args)")]
         void LogException(LogLevel level, [Localizable(false)] string message, Exception exception);
+
+        /// <summary>
+        /// Writes the diagnostic message and exception at the specified level.
+        /// </summary>
+        /// <param name="level">The log level.</param>
+        /// <param name="message">A <see langword="string" /> to be written.</param>
+        /// <param name="args">Arguments to format.</param>
+        /// <param name="exception">An exception to be logged.</param>
+        void Log(LogLevel level, Exception exception, [Localizable(false)] string message, params object[] args);
+
+        /// <summary>
+        /// Writes the diagnostic message and exception at the specified level.
+        /// </summary>
+        /// <param name="level">The log level.</param>
+        /// <param name="formatProvider">An IFormatProvider that supplies culture-specific formatting information.</param>
+        /// <param name="message">A <see langword="string" /> to be written.</param>
+        /// <param name="args">Arguments to format.</param>
+        /// <param name="exception">An exception to be logged.</param>
+        void Log(LogLevel level, Exception exception, IFormatProvider formatProvider, [Localizable(false)] string message, params object[] args);

         /// <summary>
         /// Writes the diagnostic message at the specified level using the specified parameters and formatting them with the supplied format provider.
@@ -149,6 +168,7 @@
         /// <param name="level">The log level.</param>
         /// <param name="message">A <see langword="string" /> to be written.</param>
         /// <param name="exception">An exception to be logged.</param>
+        [Obsolete("Use Log(LogLevel level, Exception exception, [Localizable(false)] string message, params object[] args)")]
         void Log(LogLevel level, [Localizable(false)] string message, Exception exception);

         /// <summary>


Add test coverage for channel message highlighting

--- osu.Game.Tests/Visual/Online/TestSceneStandAloneChatDisplay.cs
+++ osu.Game.Tests/Visual/Online/TestSceneStandAloneChatDisplay.cs
@@ -9,6 +9,8 @@
 using System.Linq;
 using NUnit.Framework;
 using osu.Framework.Graphics.Containers;
+using osu.Framework.Testing;
+using osu.Framework.Utils;
 using osu.Game.Online.API.Requests.Responses;
 using osu.Game.Overlays.Chat;
 using osuTK.Input;
@@ -107,49 +109,7 @@
         [Test]
         public void TestManyMessages()
         {
-            AddStep("message from admin", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = admin,
-                Content = "I am a wang!"
-            }));
-
-            AddStep("message from team red", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = redUser,
-                Content = "I am team red."
-            }));
-
-            AddStep("message from team red", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = redUser,
-                Content = "I plan to win!"
-            }));
-
-            AddStep("message from team blue", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = blueUser,
-                Content = "Not on my watch. Prepare to eat saaaaaaaaaand. Lots and lots of saaaaaaand."
-            }));
-
-            AddStep("message from admin", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = admin,
-                Content = "Okay okay, calm down guys. Let's do this!"
-            }));
-
-            AddStep("message from long username", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = longUsernameUser,
-                Content = "Hi guys, my new username is lit!"
-            }));
-
-            AddStep("message with new date", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
-            {
-                Sender = longUsernameUser,
-                Content = "Message from the future!",
-                Timestamp = DateTimeOffset.Now
-            }));
-
+            sendRegularMessages();
             checkScrolledToBottom();

             const int messages_per_call = 10;
@@ -182,6 +142,61 @@
             checkScrolledToBottom();
         }

+        [Test]
+        public void TestMessageHighlighting()
+        {
+            Message highlighted = null;
+
+            sendRegularMessages();
+
+            AddStep("highlight first message", () =>
+            {
+                highlighted = testChannel.Messages[0];
+                chatDisplay.DrawableChannel.HighlightMessage(highlighted);
+            });
+
+            AddUntilStep("chat scrolled to first message", () =>
+            {
+                var line = chatDisplay.ChildrenOfType<ChatLine>().Single(c => c.Message == highlighted);
+                return chatDisplay.ScrollContainer.ScreenSpaceDrawQuad.Contains(line.ScreenSpaceDrawQuad.Centre);
+            });
+
+            sendMessage();
+            checkNotScrolledToBottom();
+
+            AddStep("highlight last message", () =>
+            {
+                highlighted = testChannel.Messages[^1];
+                chatDisplay.DrawableChannel.HighlightMessage(highlighted);
+            });
+
+            AddUntilStep("chat scrolled to last message", () =>
+            {
+                var line = chatDisplay.ChildrenOfType<ChatLine>().Single(c => c.Message == highlighted);
+                return chatDisplay.ScrollContainer.ScreenSpaceDrawQuad.Contains(line.ScreenSpaceDrawQuad.Centre);
+            });
+
+            sendMessage();
+            checkScrolledToBottom();
+
+            AddRepeatStep("highlight other random messages", () =>
+            {
+                highlighted = testChannel.Messages[RNG.Next(0, testChannel.Messages.Count - 1)];
+                chatDisplay.DrawableChannel.HighlightMessage(highlighted);
+            }, 10);
+        }
+
+        [Test]
+        public void TestMessageHighlightingOnFilledChat()
+        {
+            fillChat();
+
+            AddRepeatStep("highlight random messages", () =>
+            {
+                chatDisplay.DrawableChannel.HighlightMessage(testChannel.Messages[RNG.Next(0, testChannel.Messages.Count - 1)]);
+            }, 10);
+        }
+
         /// <summary>
         /// Tests that when a message gets wrapped by the chat display getting contracted while scrolled to bottom, the chat will still keep scrolling down.
         /// </summary>
@@ -321,6 +336,52 @@
             }));
         }

+        private void sendRegularMessages()
+        {
+            AddStep("message from admin", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = admin,
+                Content = "I am a wang!"
+            }));
+
+            AddStep("message from team red", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = redUser,
+                Content = "I am team red."
+            }));
+
+            AddStep("message from team red", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = redUser,
+                Content = "I plan to win!"
+            }));
+
+            AddStep("message from team blue", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = blueUser,
+                Content = "Not on my watch. Prepare to eat saaaaaaaaaand. Lots and lots of saaaaaaand."
+            }));
+
+            AddStep("message from admin", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = admin,
+                Content = "Okay okay, calm down guys. Let's do this!"
+            }));
+
+            AddStep("message from long username", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = longUsernameUser,
+                Content = "Hi guys, my new username is lit!"
+            }));
+
+            AddStep("message with new date", () => testChannel.AddNewMessages(new Message(messageIdSequence++)
+            {
+                Sender = longUsernameUser,
+                Content = "Message from the future!",
+                Timestamp = DateTimeOffset.Now
+            }));
+        }
+
         private void checkScrolledToBottom() =>
             AddUntilStep("is scrolled to bottom", () => chatDisplay.ScrolledToBottom);


add test for notice box

add test for notice box

--- osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs
+++ osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs
@@ -67,6 +67,40 @@
             AddAssert("check url", () => markdownContainer.Link.Url == $"{api.WebsiteRootUrl}/wiki/Article_styling_criteria/Formatting");
         }

+        [Test]
+        public void TestOutdatedNoticeBox()
+        {
+            AddStep("Add outdated yaml header", () =>
+            {
+                markdownContainer.Text = @"---
+outdated: true
+---";
+            });
+        }
+
+        [Test]
+        public void TestNeedsCleanupNoticeBox()
+        {
+            AddStep("Add needs cleanup yaml header", () =>
+            {
+                markdownContainer.Text = @"---
+needs_cleanup: true
+---";
+            });
+        }
+
+        [Test]
+        public void TestOnlyShowOutdatedNoticeBox()
+        {
+            AddStep("Add outdated and needs cleanup yaml", () =>
+            {
+                markdownContainer.Text = @"---
+outdated: true
+needs_cleanup: true
+---";
+            });
+        }
+
         private class TestMarkdownContainer : WikiMarkdownContainer
         {
             public LinkInline Link;


Update selected mdos references

Update selected mdos references

--- osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapDetailArea.cs
+++ osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapDetailArea.cs
@@ -44,7 +44,7 @@
                 Position = new Vector2(0, 25),
             });

-            modDisplay.Current.BindTo(Mods);
+            modDisplay.Current.BindTo(SelectedMods);

             AddStep("all metrics", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
             {
@@ -204,7 +204,7 @@
                     }
                 });

-                Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModEasy) };
+                SelectedMods.Value = new[] { ruleset.GetAllMods().First(m => m is ModEasy) };
             });

             AddStep("with HR mod", () =>
@@ -230,7 +230,7 @@
                     }
                 });

-                Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModHardRock) };
+                SelectedMods.Value = new[] { ruleset.GetAllMods().First(m => m is ModHardRock) };
             });
         }
     }


Tests: moved duplicate code to private fields / constructor

--- YahtzeeTests/ScoreSheetTests.cs
+++ YahtzeeTests/ScoreSheetTests.cs
@@ -9,11 +9,26 @@
 using YahtzeeTests.Support;

 namespace YahtzeeTests
-{
+{
 	[TestClass]
 	public class ScoreSheetTests
 	{
-		private TestDieFactory _testDieFactory = new TestDieFactory();
+		private readonly TestDieFactory _testDieFactory;
+		private readonly Mock<IDiceCup> _diceCup;
+		private readonly Mock<IDiceCup> _diceCup2;
+		private readonly Mock<IDiceOfAKindValidator> _diceOfAKindValidator;
+		private readonly Mock<IFullHouseValidator> _fullHouseValidator;
+		private readonly Mock<IStraightValidator> _straightValidator;
+
+		public ScoreSheetTests ()
+		{
+			_testDieFactory = new TestDieFactory();
+			_diceCup = new Mock<IDiceCup>();
+			_diceCup2 = new Mock<IDiceCup>();
+			_diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
+			_fullHouseValidator = new Mock<IFullHouseValidator>();
+			_straightValidator = new Mock<IStraightValidator>();
+		}

 		#region Three and four of a kind tests

@@ -22,17 +37,12 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 3, 3, 5, 6, 3 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(3, dice)).Returns(true);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? threeOfAKindScore = scoreSheet.RecordThreeOfAKind(diceCup.Object);
+			_diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceOfAKindValidator.Setup(x => x.IsValid(3, dice)).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? threeOfAKindScore = scoreSheet.RecordThreeOfAKind(_diceCup.Object);

 			//Assert
 			scoreSheet.ThreeOfAKind.Should().Be(20);
@@ -44,17 +54,12 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 3, 2, 5, 6, 3 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(3, dice)).Returns(false);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? threeOfAKindScore = scoreSheet.RecordThreeOfAKind(diceCup.Object);
+			_diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceOfAKindValidator.Setup(x => x.IsValid(3, dice)).Returns(false);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? threeOfAKindScore = scoreSheet.RecordThreeOfAKind(_diceCup.Object);

 			//Assert
 			threeOfAKindScore.Should().Be(0);
@@ -66,22 +71,17 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 4, 2, 4, 4, 3 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceCup.Setup(x => x.Dice).Returns(dice);

 			var dice2 = _testDieFactory.CreateDieEnumerable(new[] { 3, 3, 5, 3, 4 });
-			var diceCup2 = new Mock<IDiceCup>();
-			diceCup2.Setup(x => x.Dice).Returns(dice2);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(3, It.IsAny<IEnumerable<IDie>>())).Returns(true);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			scoreSheet.RecordThreeOfAKind(diceCup.Object);
-			var secondRecording = scoreSheet.RecordThreeOfAKind(diceCup2.Object);
+			_diceCup2.Setup(x => x.Dice).Returns(dice2);
+
+			_diceOfAKindValidator.Setup(x => x.IsValid(3, It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			scoreSheet.RecordThreeOfAKind(_diceCup.Object);
+			var secondRecording = scoreSheet.RecordThreeOfAKind(_diceCup2.Object);

 			// Assert
 			secondRecording.Should().NotHaveValue();
@@ -93,17 +93,12 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 3, 3, 5, 3, 3 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(4, dice)).Returns(true);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? fourOfAKindScore = scoreSheet.RecordFourOfAKind(diceCup.Object);
+			_diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceOfAKindValidator.Setup(x => x.IsValid(4, dice)).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? fourOfAKindScore = scoreSheet.RecordFourOfAKind(_diceCup.Object);

 			//Assert
 			fourOfAKindScore.Should().Be(17);
@@ -116,17 +111,12 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 3, 2, 5, 6, 3 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(4, dice)).Returns(false);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? fourOfAKindScore = scoreSheet.RecordFourOfAKind(diceCup.Object);
+			_diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceOfAKindValidator.Setup(x => x.IsValid(4, dice)).Returns(false);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? fourOfAKindScore = scoreSheet.RecordFourOfAKind(_diceCup.Object);

 			//Assert
 			fourOfAKindScore.Should().Be(0);
@@ -138,22 +128,16 @@
 		{
 			// Arrange
 			var dice = _testDieFactory.CreateDieEnumerable(new[] { 4, 2, 4, 4, 4 });
-			var diceCup = new Mock<IDiceCup>();
-			diceCup.Setup(x => x.Dice).Returns(dice);
+			_diceCup.Setup(x => x.Dice).Returns(dice);

 			var dice2 = _testDieFactory.CreateDieEnumerable(new[] { 5, 5, 5, 3, 5 });
-			var diceCup2 = new Mock<IDiceCup>();
-			diceCup2.Setup(x => x.Dice).Returns(dice2);
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			diceOfAKindValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			scoreSheet.RecordFourOfAKind(diceCup.Object);
-			var secondRecording = scoreSheet.RecordFourOfAKind(diceCup2.Object);
+			_diceCup2.Setup(x => x.Dice).Returns(dice2);
+			_diceOfAKindValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			scoreSheet.RecordFourOfAKind(_diceCup.Object);
+			var secondRecording = scoreSheet.RecordFourOfAKind(_diceCup2.Object);

 			// Assert
 			secondRecording.Should().NotHaveValue();
@@ -168,16 +152,11 @@
 		public void RecordFullHouseWithValidSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(true);
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? fullHouseScore = scoreSheet.RecordFullHouse(diceCup.Object);
+			_fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? fullHouseScore = scoreSheet.RecordFullHouse(_diceCup.Object);

 			//Assert
 			scoreSheet.FullHouse.Should().Be(25);
@@ -188,16 +167,11 @@
 		public void RecordFullHouseWithInvalidSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(false);
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? fullHouseScore = scoreSheet.RecordFullHouse(diceCup.Object);
+			_fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(false);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? fullHouseScore = scoreSheet.RecordFullHouse(_diceCup.Object);

 			//Assert
 			fullHouseScore.Should().Be(0);
@@ -208,17 +182,12 @@
 		public void DisallowSettingFullHouseOnceItsBeenSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(true);
-			var straightValidator = new Mock<IStraightValidator>();
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			scoreSheet.RecordFullHouse(diceCup.Object);
-			var secondRecord = scoreSheet.RecordFullHouse(diceCup.Object);
+			_fullHouseValidator.Setup(x => x.IsValid(It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			scoreSheet.RecordFullHouse(_diceCup.Object);
+			var secondRecord = scoreSheet.RecordFullHouse(_diceCup.Object);

 			//Assert
 			secondRecord.Should().NotHaveValue();
@@ -233,16 +202,11 @@
 		public void RecordSmallStraightWithValidSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-			straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? smallStraightScore = scoreSheet.RecordSmallStraight(diceCup.Object);
+			_straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? smallStraightScore = scoreSheet.RecordSmallStraight(_diceCup.Object);

 			//Assert
 			scoreSheet.SmallStraight.Should().Be(30);
@@ -253,16 +217,11 @@
 		public void RecordSmallStraightWithInvalidSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-			straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(false);
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			int? smallStraightScore = scoreSheet.RecordSmallStraight(diceCup.Object);
+			_straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(false);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			int? smallStraightScore = scoreSheet.RecordSmallStraight(_diceCup.Object);

 			//Assert
 			scoreSheet.SmallStraight.Should().Be(0);
@@ -273,22 +232,19 @@
 		public void DisallowSettingSmallStraightOnceItsBeenSet()
 		{
 			// Arrange
-			var diceCup = new Mock<IDiceCup>();
-
-			var diceOfAKindValidator = new Mock<IDiceOfAKindValidator>();
-			var fullHouseValidator = new Mock<IFullHouseValidator>();
-			var straightValidator = new Mock<IStraightValidator>();
-			straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
-
-			// Act
-			var scoreSheet = new ScoreSheet(diceOfAKindValidator.Object, fullHouseValidator.Object, straightValidator.Object);
-			scoreSheet.RecordSmallStraight(diceCup.Object);
-			int? secondRecord = scoreSheet.RecordSmallStraight(diceCup.Object);
+			_straightValidator.Setup(x => x.IsValid(4, It.IsAny<IEnumerable<IDie>>())).Returns(true);
+
+			// Act
+			var scoreSheet = new ScoreSheet(_diceOfAKindValidator.Object, _fullHouseValidator.Object, _straightValidator.Object);
+			scoreSheet.RecordSmallStraight(_diceCup.Object);
+			int? secondRecord = scoreSheet.RecordSmallStraight(_diceCup.Object);

 			//Assert
 			secondRecord.Should().NotHaveValue();

 		}
+
+		// TODO: Large Straight Tests

 		#endregion
 	}


Control.Describe to include CPU architecture and identifier if known

--- src/Numerics/Control.cs
+++ src/Numerics/Control.cs
@@ -28,14 +28,20 @@
 // </copyright>

 using System;
-using System.Linq;
 using System.Reflection;
-using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading.Tasks;
 using MathNet.Numerics.Providers.SparseSolver;
 using MathNet.Numerics.Providers.FourierTransform;
 using MathNet.Numerics.Providers.LinearAlgebra;
+
+#if NET40
+using System.Linq;
+#endif
+
+#if !NET40 && !NET461
+using System.Runtime.InteropServices;
+#endif

 namespace MathNet.Numerics
 {
@@ -346,6 +352,17 @@
             sb.AppendLine($"Framework: {RuntimeInformation.FrameworkDescription}");
             sb.AppendLine($"Process Architecture: {RuntimeInformation.ProcessArchitecture}");
 #endif
+            var processorArchitecture = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
+            if (!String.IsNullOrEmpty(processorArchitecture))
+            {
+                sb.AppendLine($"Processor Architecture: {processorArchitecture}");
+            }
+            var processorId = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER");
+            if (!String.IsNullOrEmpty(processorId))
+            {
+                sb.AppendLine($"Processor Identifier: {processorId}");
+            }
+
             return sb.ToString();
         }
     }


tests for RPL handler

tests for RPL handler

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/RecognisePriorLearningHandlerTests.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/RecognisePriorLearningHandlerTests.cs
@@ -46,6 +46,18 @@

             fixture.VerifyException<DomainException>();
         }
+
+        [Test]
+        public async Task Handle_WhenPriorLearningExistsAndRecognisedPriorLearningIsFalse_PriorLearningDetailsAreNulled()
+        {
+            fixture = await new RecognisePriorLearningHandlerTestsFixture().WithPriorLearningDetailsSet();
+            fixture.Command.RecognisePriorLearning = false;
+
+            await fixture.Handle();
+
+            Assert.IsNull(fixture.DraftApprenticeshipFromDb.PriorLearning?.DurationReducedBy);
+            Assert.IsNull(fixture.DraftApprenticeshipFromDb.PriorLearning?.PriceReducedBy);
+        }
     }

     public class RecognisePriorLearningHandlerTestsFixture
@@ -61,6 +73,7 @@
         public IRequestHandler<RecognisePriorLearningCommand> Handler { get; set; }
         public UserInfo UserInfo { get; }
         public UnitOfWorkContext UnitOfWorkContext { get; set; }
+        public ApprenticeshipPriorLearning PriorLearning { get; set; }

         public DraftApprenticeship DraftApprenticeshipFromDb =>
             Db.DraftApprenticeships.First(x => x.Id == ApprenticeshipId);
@@ -99,7 +112,10 @@
              .Without(s => s.ApprenticeshipUpdate)
              .Without(s => s.FlexibleEmployment)
              .Without(s => s.PreviousApprenticeship)
+             .Without(s=>s.PriorLearning)
              .Create();
+
+            PriorLearning = new ApprenticeshipPriorLearning { DurationReducedBy = 9, PriceReducedBy = 190};

             CancellationToken = new CancellationToken();

@@ -138,6 +154,15 @@
             return this;
         }

+        public async Task<RecognisePriorLearningHandlerTestsFixture> WithPriorLearningDetailsSet()
+        {
+            var apprenticeship = Db.DraftApprenticeships.First();
+            apprenticeship.RecognisePriorLearning = true;
+            apprenticeship.PriorLearning = PriorLearning;
+            await Db.SaveChangesAsync();
+            return this;
+        }
+
         public void VerifyException<T>()
         {
             Assert.IsNotNull(Exception);


Minor fix

Minor fix

--- eMI3_Core/LocalService/RequestRouter.cs
+++ eMI3_Core/LocalService/RequestRouter.cs
@@ -241,7 +241,7 @@
             lock (AuthenticationServices)
             {

-                SENDCDRResult          SENDCDRResult;
+                SENDCDRResult      SENDCDRResult;
                 IEMobilityService  AuthenticationService;

                 #region An authenticator was found for the upstream SessionId!


w = n.Dot(d) < 0 ? n : -n;

w = n.Dot(d) < 0 ? n : -n;

--- cs-smallpt/core/SmallPT.cs
+++ cs-smallpt/core/SmallPT.cs
@@ -134,7 +134,7 @@
                         }
                     default:
                         {
-                            Vector3 w = -n;
+                            Vector3 w = n.Dot(d) < 0 ? n : -n;
                             Vector3 u = ((Math.Abs(w[0]) > 0.1 ? new Vector3(0.0, 1.0, 0.0) : new Vector3(1.0, 0.0, 0.0)).Cross(w)).Normalize();
                             Vector3 v = w.Cross(u);


preferences view

preferences view

--- bstrkr.mobile/bstrkr.android/Views/PreferencesView.cs
+++ bstrkr.mobile/bstrkr.android/Views/PreferencesView.cs
@@ -21,5 +21,13 @@

 			this.Activity.ActionBar.Title = AppResources.preferences_view_title;
 		}
+
+		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+		{
+			var view = base.OnCreateView(inflater, container, savedInstanceState);
+			view.SetBackgroundResource(Resource.Color.background_holo_dark);
+
+			return view;
+		}
 	}
 }


Use Newtonsoft.Json to deserialize responses

By default RestSharp uses SimpleJson for deserializing responses. `DeserializeAs` has a variety of issues with nested JSON and underscores. Until RestSharp brings it back, we should always use Newtonsoft.Json for deserializing objects in the API client.

--- src/Taxjar/TaxjarApi.cs
+++ src/Taxjar/TaxjarApi.cs
@@ -140,7 +140,7 @@
                 throw new Exception(response.ErrorMessage, response.ErrorException);
             }

-            return response.Data;
+            return JsonConvert.DeserializeObject<T>(response.Content);
         }

         protected virtual async Task<T> SendRequestAsync<T>(string endpoint, object body = null, Method httpMethod = Method.POST) where T : new()
@@ -160,7 +160,7 @@
                 throw new Exception(response.ErrorMessage, response.ErrorException);
             }

-            return response.Data;
+            return JsonConvert.DeserializeObject<T>(response.Content);
         }

         protected virtual bool IsAnonymousType(Type type)


tiny clean-up

tiny clean-up

git-svn-id: 16f658619b342a39b0afd2472f072a689916e5a2@120 6f2d7086-9719-0410-ba06-0b8292a297aa


AV1568: Optimized running time

AV1568: Optimized running time

--- src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/Rules/Maintainability/DoNotAssignToParameterAnalyzer.cs
+++ src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/Rules/Maintainability/DoNotAssignToParameterAnalyzer.cs
@@ -1,10 +1,10 @@
 using System.Collections.Generic;
 using System.Collections.Immutable;
 using System.Linq;
+using System.Threading;
 using CSharpGuidelinesAnalyzer.Extensions;
 using JetBrains.Annotations;
 using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.Diagnostics;
 using Microsoft.CodeAnalysis.Operations;

@@ -40,91 +40,64 @@
             context.EnableConcurrentExecution();
             context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);

-            context.RegisterSyntaxNodeAction(c => c.SkipEmptyName(AnalyzeParameter), SyntaxKind.Parameter);
+            context.RegisterSymbolAction(c => c.SkipEmptyName(AnalyzeMethod), SymbolKind.Method);
             context.RegisterSymbolAction(c => c.SkipEmptyName(AnalyzeProperty), SymbolKind.Property);
             context.RegisterSymbolAction(c => c.SkipEmptyName(AnalyzeEvent), SymbolKind.Event);
-        }
-
-        private void AnalyzeParameter(SymbolAnalysisContext context)
-        {
-            var parameter = (IParameterSymbol)context.Symbol;
-
-            if (!(parameter.ContainingSymbol is IMethodSymbol method) || method.IsAbstract)
-            {
-                return;
-            }
-
-            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
-            {
-                AnalyzeParameterUsage(parameter, method, collector, context);
+
+            context.RegisterOperationAction(c => c.SkipInvalid(AnalyzeLocalFunction), OperationKind.LocalFunction);
+            context.RegisterOperationAction(c => c.SkipInvalid(AnalyzeAnonymousFunction), OperationKind.AnonymousFunction);
+        }
+
+        private void AnalyzeMethod(SymbolAnalysisContext context)
+        {
+            var method = (IMethodSymbol)context.Symbol;
+
+            if (ShouldSkip(method) || method.IsPropertyOrEventAccessor())
+            {
+                return;
+            }
+
+            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
+            {
+                InnerAnalyzeMethod(method, collector, context.Compilation, context.CancellationToken);
+            }
+        }
+
+        private void AnalyzeProperty(SymbolAnalysisContext context)
+        {
+            var property = (IPropertySymbol)context.Symbol;
+
+            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
+            {
+                AnalyzeAccessorMethod(property.GetMethod, collector, context);
+                AnalyzeAccessorMethod(property.SetMethod, collector, context);

                 FilterDuplicateLocations(collector.Diagnostics);
             }
         }

-        private void AnalyzeParameterUsage([NotNull] IParameterSymbol parameter, [NotNull] IMethodSymbol method,
-            [NotNull] DiagnosticCollector collector, SymbolAnalysisContext context)
-        {
-            if (parameter.RefKind != RefKind.None || parameter.IsSynthesized())
-            {
-                return;
-            }
-
-            if (IsUserDefinedStruct(parameter))
-            {
-                // A user-defined struct can reassign its 'this' parameter on invocation. That's why the compiler dataflow
-                // analysis reports all access as writes. Because that's not very practical, we run our own assignment analysis.
-
-                AnalyzeParameterUsageInMethodSlow(parameter, method, collector, context);
-            }
-            else
-            {
-                AnalyzeParameterUsageInMethod(parameter, method, collector, context);
-            }
-        }
-
-        private bool IsUserDefinedStruct([NotNull] IParameterSymbol parameter)
-        {
-            return parameter.Type.TypeKind == TypeKind.Struct && !IsSimpleType(parameter.Type);
-        }
-
-        private bool IsSimpleType([NotNull] ITypeSymbol type)
-        {
-            return type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || SimpleTypes.Contains(type.SpecialType);
-        }
-
-        private static void AnalyzeParameterUsageInMethod([NotNull] IParameterSymbol parameter, [NotNull] IMethodSymbol method,
-            [NotNull] DiagnosticCollector collector, SymbolAnalysisContext context)
-        {
-            SyntaxNode body = method.TryGetBodySyntaxForMethod(context.CancellationToken);
-            if (body != null)
-            {
-                SemanticModel model = context.Compilation.GetSemanticModel(body.SyntaxTree);
-                DataFlowAnalysis dataFlowAnalysis = model.AnalyzeDataFlow(body);
-                if (dataFlowAnalysis.Succeeded)
-                {
-                    if (dataFlowAnalysis.WrittenInside.Contains(parameter))
-                    {
-                        collector.Add(Diagnostic.Create(Rule, parameter.Locations[0], parameter.Name));
-                    }
-                }
-            }
-        }
-
-        private void AnalyzeParameterUsageInMethodSlow([NotNull] IParameterSymbol parameter, [NotNull] IMethodSymbol method,
-            [NotNull] DiagnosticCollector collector, SymbolAnalysisContext context)
-        {
-            IOperation body = method.TryGetOperationBlockForMethod(context.Compilation, context.CancellationToken);
-            if (body != null)
-            {
-                var walker = new AssignmentWalker(parameter);
-                walker.Visit(body);
-
-                if (walker.SeenAssignment)
-                {
-                    collector.Add(Diagnostic.Create(Rule, parameter.Locations[0], parameter.Name));
-                }
-            }
+        private void AnalyzeEvent(SymbolAnalysisContext context)
+        {
+            var evnt = (IEventSymbol)context.Symbol;
+
+            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
+            {
+                AnalyzeAccessorMethod(evnt.AddMethod, collector, context);
+                AnalyzeAccessorMethod(evnt.RemoveMethod, collector, context);
+
+                FilterDuplicateLocations(collector.Diagnostics);
+            }
+        }
+
+        private void AnalyzeAccessorMethod([CanBeNull] IMethodSymbol accessorMethod, [NotNull] DiagnosticCollector collector,
+            SymbolAnalysisContext context)
+        {
+            if (accessorMethod == null || ShouldSkip(accessorMethod))
+            {
+                return;
+            }
+
+            InnerAnalyzeMethod(accessorMethod, collector, context.Compilation, context.CancellationToken);
         }

         private void FilterDuplicateLocations([NotNull] [ItemNotNull] IList<Diagnostic> diagnostics)
@@ -147,86 +120,165 @@
             }
         }

-        private void AnalyzeProperty(SymbolAnalysisContext context)
-        {
-            var property = (IPropertySymbol)context.Symbol;
-
-            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
-            {
-                AnalyzeAccessorMethod(property.GetMethod, collector, context);
-                AnalyzeAccessorMethod(property.SetMethod, collector, context);
-
-                FilterDuplicateLocations(collector.Diagnostics);
-            }
-        }
-
-        private void AnalyzeEvent(SymbolAnalysisContext context)
-        {
-            var evnt = (IEventSymbol)context.Symbol;
-
-            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
-            {
-                AnalyzeAccessorMethod(evnt.AddMethod, collector, context);
-                AnalyzeAccessorMethod(evnt.RemoveMethod, collector, context);
-
-                FilterDuplicateLocations(collector.Diagnostics);
-            }
-        }
-
-        private void AnalyzeAccessorMethod([CanBeNull] IMethodSymbol accessorMethod, [NotNull] DiagnosticCollector collector,
-            SymbolAnalysisContext context)
-        {
-            if (accessorMethod != null && !accessorMethod.IsAbstract)
-            {
-                foreach (IParameterSymbol parameter in accessorMethod.Parameters)
-                {
-                    AnalyzeParameterUsage(parameter, accessorMethod, collector, context);
-                }
+        private void AnalyzeLocalFunction(OperationAnalysisContext context)
+        {
+            var localFunction = (ILocalFunctionOperation)context.Operation;
+
+            if (ShouldSkip(localFunction.Symbol))
+            {
+                return;
+            }
+
+            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
+            {
+                InnerAnalyzeMethod(localFunction.Symbol, collector, context.Compilation, context.CancellationToken);
+            }
+        }
+
+        private void AnalyzeAnonymousFunction(OperationAnalysisContext context)
+        {
+            var anonymousFunction = (IAnonymousFunctionOperation)context.Operation;
+
+            if (ShouldSkip(anonymousFunction.Symbol))
+            {
+                return;
+            }
+
+            using (var collector = new DiagnosticCollector(context.ReportDiagnostic))
+            {
+                InnerAnalyzeMethod(anonymousFunction.Symbol, collector, context.Compilation, context.CancellationToken);
+            }
+        }
+
+        private static bool ShouldSkip([NotNull] IMethodSymbol method)
+        {
+            return method.IsAbstract || method.IsSynthesized() || !method.Parameters.Any();
+        }
+
+        private void InnerAnalyzeMethod([NotNull] IMethodSymbol method, [NotNull] DiagnosticCollector collector,
+            [NotNull] Compilation compilation, CancellationToken cancellationToken)
+        {
+            SyntaxNode bodySyntax = method.TryGetBodySyntaxForMethod(cancellationToken);
+            if (bodySyntax == null)
+            {
+                return;
+            }
+
+            IGrouping<bool, IParameterSymbol>[] parameterGrouping = method.Parameters
+                .Where(p => p.RefKind == RefKind.None && !p.IsSynthesized()).GroupBy(IsUserDefinedStruct).ToArray();
+
+            IParameterSymbol[] ordinaryParameters = parameterGrouping.Where(x => !x.Key).SelectMany(x => x).ToArray();
+            if (ordinaryParameters.Any())
+            {
+                AnalyzeOrdinaryParameters(ordinaryParameters, bodySyntax, collector, compilation);
+            }
+
+            IParameterSymbol[] structParameters = parameterGrouping.Where(x => x.Key).SelectMany(x => x).ToArray();
+            if (structParameters.Any())
+            {
+                AnalyzeStructParameters(structParameters, bodySyntax, collector, compilation, cancellationToken);
+            }
+        }
+
+        private bool IsUserDefinedStruct([NotNull] IParameterSymbol parameter)
+        {
+            return parameter.Type.TypeKind == TypeKind.Struct && !IsSimpleType(parameter.Type);
+        }
+
+        private bool IsSimpleType([NotNull] ITypeSymbol type)
+        {
+            return type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || SimpleTypes.Contains(type.SpecialType);
+        }
+
+        private void AnalyzeOrdinaryParameters([NotNull] [ItemNotNull] ICollection<IParameterSymbol> parameters,
+            [NotNull] SyntaxNode bodySyntax, [NotNull] DiagnosticCollector collector, [NotNull] Compilation compilation)
+        {
+            DataFlowAnalysis dataFlowAnalysis = TryAnalyzeDataFlow(bodySyntax, compilation);
+            if (dataFlowAnalysis == null)
+            {
+                return;
+            }
+
+            foreach (IParameterSymbol parameter in parameters)
+            {
+                if (dataFlowAnalysis.WrittenInside.Contains(parameter))
+                {
+                    collector.Add(Diagnostic.Create(Rule, parameter.Locations[0], parameter.Name));
+                }
+            }
+        }
+
+        [CanBeNull]
+        private DataFlowAnalysis TryAnalyzeDataFlow([NotNull] SyntaxNode bodySyntax, [NotNull] Compilation compilation)
+        {
+            SemanticModel model = compilation.GetSemanticModel(bodySyntax.SyntaxTree);
+            DataFlowAnalysis dataFlowAnalysis = model.AnalyzeDataFlow(bodySyntax);
+
+            return dataFlowAnalysis.Succeeded ? dataFlowAnalysis : null;
+        }
+
+        private void AnalyzeStructParameters([NotNull] [ItemNotNull] ICollection<IParameterSymbol> parameters,
+            [NotNull] SyntaxNode bodySyntax, [NotNull] DiagnosticCollector collector, [NotNull] Compilation compilation,
+            CancellationToken cancellationToken)
+        {
+            // A user-defined struct can reassign its 'this' parameter on invocation. That's why the compiler dataflow
+            // analysis reports all access as writes. Because that's not very practical, we run our own assignment analysis.
+
+            SemanticModel model = compilation.GetSemanticModel(bodySyntax.SyntaxTree);
+            IOperation bodyOperation = model.GetOperation(bodySyntax);
+
+            if (bodyOperation == null || bodyOperation.HasErrors(compilation, cancellationToken))
+            {
+                return;
+            }
+
+            var walker = new AssignmentWalker(parameters);
+            walker.Visit(bodyOperation);
+
+            foreach (IParameterSymbol parameter in walker.ParametersAssigned)
+            {
+                collector.Add(Diagnostic.Create(Rule, parameter.Locations[0], parameter.Name));
             }
         }

         private sealed class AssignmentWalker : OperationWalker
         {
             [NotNull]
-            private readonly IParameterSymbol parameter;
-
-            public bool SeenAssignment { get; private set; }
-
-            public AssignmentWalker([NotNull] IParameterSymbol parameter)
-            {
-                Guard.NotNull(parameter, nameof(parameter));
-                this.parameter = parameter;
+            private readonly IDictionary<IParameterSymbol, bool> seenAssignmentPerParameter =
+                new Dictionary<IParameterSymbol, bool>();
+
+            [NotNull]
+            [ItemNotNull]
+            public ICollection<IParameterSymbol> ParametersAssigned =>
+                seenAssignmentPerParameter.Where(pair => pair.Value).Select(pair => pair.Key).ToArray();
+
+            public AssignmentWalker([NotNull] [ItemNotNull] ICollection<IParameterSymbol> parameters)
+            {
+                Guard.NotNull(parameters, nameof(parameters));
+
+                foreach (IParameterSymbol parameter in parameters)
+                {
+                    seenAssignmentPerParameter[parameter] = false;
+                }
             }

             public override void VisitSimpleAssignment([NotNull] ISimpleAssignmentOperation operation)
             {
-                if (IsReferenceToCurrentParameter(operation.Target))
-                {
-                    SeenAssignment = true;
-                    return;
-                }
+                RegisterAssignmentToParameter(operation.Target);

                 base.VisitSimpleAssignment(operation);
             }

             public override void VisitCompoundAssignment([NotNull] ICompoundAssignmentOperation operation)
             {
-                if (IsReferenceToCurrentParameter(operation.Target))
-                {
-                    SeenAssignment = true;
-                    return;
-                }
+                RegisterAssignmentToParameter(operation.Target);

                 base.VisitCompoundAssignment(operation);
             }

             public override void VisitIncrementOrDecrement([NotNull] IIncrementOrDecrementOperation operation)
             {
-                if (IsReferenceToCurrentParameter(operation.Target))
-                {
-                    SeenAssignment = true;
-                    return;
-                }
+                RegisterAssignmentToParameter(operation.Target);

                 base.VisitIncrementOrDecrement(operation);
             }
@@ -237,11 +289,7 @@
                 {
                     foreach (IOperation element in tuple.Elements)
                     {
-                        if (IsReferenceToCurrentParameter(element))
-                        {
-                            SeenAssignment = true;
-                            return;
-                        }
+                        RegisterAssignmentToParameter(element);
                     }
                 }

@@ -250,22 +298,25 @@

             public override void VisitArgument([NotNull] IArgumentOperation operation)
             {
-                if (IsReferenceToCurrentParameter(operation.Value))
-                {
-                    if (operation.Parameter.RefKind == RefKind.Ref || operation.Parameter.RefKind == RefKind.Out)
+                if (operation.Parameter.RefKind == RefKind.Ref || operation.Parameter.RefKind == RefKind.Out)
+                {
+                    RegisterAssignmentToParameter(operation.Value);
+                }
+
+                base.VisitArgument(operation);
+            }
+
+            private void RegisterAssignmentToParameter([NotNull] IOperation operation)
+            {
+                if (operation is IParameterReferenceOperation parameterReference)
+                {
+                    IParameterSymbol parameter = parameterReference.Parameter;
+
+                    if (seenAssignmentPerParameter.ContainsKey(parameter))
                     {
-                        SeenAssignment = true;
-                        return;
+                        seenAssignmentPerParameter[parameter] = true;
                     }
                 }
-
-                base.VisitArgument(operation);
-            }
-
-            private bool IsReferenceToCurrentParameter([NotNull] IOperation operation)
-            {
-                return operation is IParameterReferenceOperation parameterReference &&
-                    parameter.Equals(parameterReference.Parameter);
             }
         }
     }


Formatting fix in ContentDirectory.cs.

Formatting fix in ContentDirectory.cs.

--- src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectory.cs
+++ src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectory.cs
@@ -37,8 +37,8 @@

         [UpnpAction]
         public virtual void GetSearchCapabilities ([UpnpArgument ("SearchCaps")]
-                                                     [UpnpRelatedStateVariable ("SearchCapabilities")]
-                                                     out string searchCapabilities)
+                                                   [UpnpRelatedStateVariable ("SearchCapabilities")]
+                                                   out string searchCapabilities)
         {
             searchCapabilities = SearchCapabilities;
         }
@@ -47,8 +47,8 @@

         [UpnpAction]
         public virtual void GetSortCapabilities ([UpnpArgument ("SortCaps")]
-                                                   [UpnpRelatedStateVariable ("SortCapabilities")]
-                                                   out string sortCapabilities)
+                                                 [UpnpRelatedStateVariable ("SortCapabilities")]
+                                                 out string sortCapabilities)
         {
             sortCapabilities = SortCapabilities;
         }
@@ -57,8 +57,8 @@

         [UpnpAction]
         public virtual void GetSystemUpdateID ([UpnpArgument ("Id")]
-                                                 [UpnpRelatedStateVariable ("SystemUpdateID")]
-                                                 out string systemUpdateId)
+                                               [UpnpRelatedStateVariable ("SystemUpdateID")]
+                                               out string systemUpdateId)
         {
             systemUpdateId = SystemUpdateID;
         }
@@ -67,14 +67,14 @@

         [UpnpAction]
         public virtual void Browse ([UpnpArgument ("ObjectID")] string objectId,
-                                      [UpnpArgument ("BrowseFlag")] BrowseFlag browseFlag,
-                                      [UpnpArgument ("StartingIndex")] int startingIndex,
-                                      [UpnpArgument ("RequestCount")] int requestCount,
-                                      [UpnpArgument ("SortCriteria")] string sortCriteria,
-                                      [UpnpArgument ("NumberReturned")] out int numberReturned,
-                                      [UpnpArgument ("TotalMatches")] out int totalMatches,
-                                      [UpnpArgument ("UpdateID")] out string updateId,
-                                      [UpnpArgument ("Result")] out string result)
+                                    [UpnpArgument ("BrowseFlag")] BrowseFlag browseFlag,
+                                    [UpnpArgument ("StartingIndex")] int startingIndex,
+                                    [UpnpArgument ("RequestCount")] int requestCount,
+                                    [UpnpArgument ("SortCriteria")] string sortCriteria,
+                                    [UpnpArgument ("NumberReturned")] out int numberReturned,
+                                    [UpnpArgument ("TotalMatches")] out int totalMatches,
+                                    [UpnpArgument ("UpdateID")] out string updateId,
+                                    [UpnpArgument ("Result")] out string result)
         {
             result = Browse (objectId, browseFlag, startingIndex, requestCount, sortCriteria, out numberReturned, out totalMatches, out updateId);
         }


Highlight exceptions stack trace in verbose mode

--- src/Wyam.Core/Engine.cs
+++ src/Wyam.Core/Engine.cs
@@ -162,7 +162,8 @@
             }
             catch (Exception ex)
             {
-                Trace.Verbose("Exception: {0}", ex);
+                if (Trace.Level == System.Diagnostics.SourceLevels.Verbose)
+                    Trace.Error("Exception: {0}", ex);
                 throw;
             }
         }


Double the length of the wait time between inventory receive item/folder retries.  The darn thing is bound to arrive sooner or later...

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@1031 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife-cs/InventorySystem/InventoryManager.cs
+++ libsecondlife-cs/InventorySystem/InventoryManager.cs
@@ -918,7 +918,8 @@
                     }

                     InventoryFolder iFolder = null;
-                    int numAttempts = 2;
+                    int numAttempts = 6;
+                    int timeBetweenAttempts = 500;
                     while( numAttempts-- > 0 )
                     {
                         foreach( InventoryBase ib in root.GetContents() )
@@ -939,7 +940,8 @@
                             catch (Exception e) { slClient.Log(e.ToString(), Helpers.LogLevel.Error); }
                             return;
                         } else {
-                            Thread.Sleep(500);
+                            Thread.Sleep(timeBetweenAttempts);
+                            timeBetweenAttempts *= 2;
                             root.RequestDownloadContents(false, true, false).RequestComplete.WaitOne(3000, false);
                         }
                     }


change analyser command name to make it shorter

--- AgileTools.CommandLine/Commands/RunAnalyserCommand.cs
+++ AgileTools.CommandLine/Commands/RunAnalyserCommand.cs
@@ -17,7 +17,7 @@
             new CumulativeFlowAnalyserHandler()
         };

-        public override string CommandName => "runAnalyser";
+        public override string CommandName => "analyse";
         public override string Description => "";
         public override IEnumerable<CommandParameter> Parameters => new List<CommandParameter>
         {


added msg to test assert + moved check before verifying initial bounds

--- Assets/MRTK/Tests/PlayModeTests/BoundsControlTests.cs
+++ Assets/MRTK/Tests/PlayModeTests/BoundsControlTests.cs
@@ -155,8 +155,8 @@
         public IEnumerator BoundsControlInstantiate()
         {
             BoundsControl boundsControl = InstantiateSceneAndDefaultBoundsControl();
-            yield return VerifyInitialBoundsCorrect(boundsControl);
-            Assert.IsNotNull(boundsControl);
+            Assert.IsNotNull(boundsControl, "Bounds control creation failed!");
+            yield return VerifyInitialBoundsCorrect(boundsControl);

             GameObject.Destroy(boundsControl.gameObject);
             // Wait for a frame to give Unity a change to actually destroy the object
@@ -170,8 +170,8 @@
         public IEnumerator HandleColliderInstantiation([ValueSource("handleTestData")] HandleTestData testData)
         {
             BoundsControl boundsControl = InstantiateSceneAndDefaultBoundsControl();
-            yield return VerifyInitialBoundsCorrect(boundsControl);
-            Assert.IsNotNull(boundsControl);
+            Assert.IsNotNull(boundsControl, "Bounds control creation failed!");
+            yield return VerifyInitialBoundsCorrect(boundsControl);
             boundsControl.BoundsControlActivation = BoundsControlActivationType.ActivateOnStart;
             yield return null;


Move clean up.

Move clean up.

--- Assets/Scripts/Content/AssetImport/ExtractDataTool.cs
+++ Assets/Scripts/Content/AssetImport/ExtractDataTool.cs
@@ -74,15 +74,15 @@
         file = ContentData.ContentPath() + "/MoM/ffg/extract-items.ini";
         File.WriteAllText(file, items);

-        mythos += "[MythosPool]\r\n";
+        mythos += "[MythosPool]\n";
         string mythosAll = "event1=";
         foreach (string s in mythosList)
         {
             mythosAll += s + " ";
         }
         mythos += mythosAll.Substring(0, mythosAll.Length - 1);
-        mythos += "\r\nbutton1=\"Continue\"\r\n";
-        mythos += "trigger=Mythos\r\n";
+        mythos += "\nbutton1=\"Continue\"\n";
+        mythos += "trigger=Mythos\n";
         file = ContentData.ContentPath() + "MoM/ffg/extract-mythos.ini";
         File.WriteAllText(file, mythos);
     }
@@ -102,9 +102,9 @@
             nameCamelUnder += "_" + eFixed;
         }

-        string ret = "[Item" + type + nameCamel + "]\r\n";
-        ret += "name={ffg:" + label + "}\r\n";
-        ret += "image=../ffg/img/Item_" + type + nameCamel + ".dds\r\n\r\n";
+        string ret = "[Item" + type + nameCamel + "]\n";
+        ret += "name={ffg:" + label + "}\n";
+        ret += "image=../ffg/img/Item_" + type + nameCamel + ".dds\n\n";

         return ret;
     }
@@ -120,10 +120,10 @@
             nameCamel += eFixed;
         }

-        string ret = "[" + nameCamel + "]\r\n";
-        ret += "text={ffg:" + label + "}\r\n";
-        ret += "target=" + elements[3].ToLower() + "\r\n";
-        ret += "attacktype=" + elements[1].ToLower() + "\r\n\r\n";
+        string ret = "[" + nameCamel + "]\n";
+        ret += "text={ffg:" + label + "}\n";
+        ret += "target=" + elements[3].ToLower() + "\n";
+        ret += "attacktype=" + elements[1].ToLower() + "\n\n";
         return ret;
     }

@@ -148,25 +148,25 @@
         }

         list.Add(nameCamel);
-        string ret = "[" + nameCamel + "]\r\n";
-        ret += "text={ffg:" + label + "}\r\n";
+        string ret = "[" + nameCamel + "\n";
+        ret += "text={ffg:" + label + "}\n";
         if (label.Substring(label.Length - 3).Equals("_01"))
         {
-            ret += "event1=" + nameCamel.Replace("01", "02") + "\r\n";
-            ret += "button1=\"Resolve Event\"\r\n";
-            ret += "event2=\r\n";
-            ret += "button2=\"No Effect\"\r\n";
-            ret += "flags=mythos\r\n\r\n";
-
-            ret += "[" + nameCamel.Replace("01", "02") + "]\r\n";
-            ret += "text={ffg:" + label.Replace("01", "02") + "}\r\n";
+            ret += "event1=" + nameCamel.Replace("01", "02") + "\n";
+            ret += "button1=\"Resolve Event\"\n";
+            ret += "event2=\n";
+            ret += "button2=\"No Effect\"\n";
+            ret += "flags=mythos\n\n";
+
+            ret += "[" + nameCamel.Replace("01", "02") + "]\n";
+            ret += "text={ffg:" + label.Replace("01", "02") + "}\n";
         }
         else
         {
-            ret += "flags=mythos\r\n";
-        }
-        ret += "event1=\r\n";
-        ret += "button1=\"Continue\"\r\n\r\n";
+            ret += "flags=mythos\n";
+        }
+        ret += "event1=\n";
+        ret += "button1=\"Continue\"\n\n";
         return ret;
     }

@@ -341,9 +341,22 @@
                 move.Add(label);
                 int indexStart = allText.IndexOf(label);
                 string instruction = allText.Substring(indexStart, allText.IndexOf("\n", indexStart));
+                string altmove = label.Substring(0, label.Length - 2) + "00";
                 if ((instruction.IndexOf("towards the nearest") > 0) && (instruction.IndexOf("towards the nearest within range") < 0))
                 {
                      movealt.Add("");
+                }
+                else if (allText.IndexOf(altmove) > 0)
+                {
+                    // Hack for hounds, needs fixing
+                    if (allText.IndexOf(altmove + 'a') > 0)
+                    {
+                        movealt.Add("{ffg:" + altmove + "a}");
+                    }
+                    else
+                    {
+                        movealt.Add("{ffg:" + altmove + "}");
+                    }
                 }
                 else if (instruction.IndexOf("The {0} moves 3 spaces") > 0 || instruction.IndexOf("moves up to 3 spaces") > 0)
                 {
@@ -412,9 +425,9 @@
             string ret = "";
             foreach (string s in evade)
             {
-                ret += "[Evade" + nameCamel + s.Substring(s.Length - 2, 2) + "]\r\n";
-                ret += "monster=" + nameCamel + "\r\n";
-                ret += "text={ffg:" + s + "}\r\n\r\n";
+                ret += "[Evade" + nameCamel + s.Substring(s.Length - 2, 2) + "]\n";
+                ret += "monster=" + nameCamel + "\n";
+                ret += "text={ffg:" + s + "}\n\n";
             }
             return ret;
         }
@@ -424,9 +437,9 @@
             string ret = "";
             foreach (string s in horror)
             {
-                ret += "[Horror" + nameCamel + s.Substring(s.Length - 2, 2) + "]\r\n";
-                ret += "monster=" + nameCamel + "\r\n";
-                ret += "text={ffg:" + s + "}\r\n\r\n";
+                ret += "[Horror" + nameCamel + s.Substring(s.Length - 2, 2) + "]\n";
+                ret += "monster=" + nameCamel + "\n";
+                ret += "text={ffg:" + s + "}\n\n";
             }
             return ret;
         }
@@ -434,13 +447,19 @@
         public string GetActivation()
         {
             string ret = "";
-            foreach (string a in attack)
-            {
-                string m = a.Replace("_ATTACK_", "_MOVE_");
-                string id = a.Substring(a.IndexOf("_ATTACK_") + "_ATTACK_".Length);
-                ret += "[MonsterActivation" + nameCamel + id + "]\r\n";
-                ret += "ability={ffg:" + m + "}\r\n";
-                ret += "master={ffg:" + a + "}\r\n\r\n";
+            for (int i = 0; i < attack.Length)
+            {
+                string m = attack[i].Replace("_ATTACK_", "_MOVE_");
+                string id = attack[i].Substring(attack[i].IndexOf("_ATTACK_") + "_ATTACK_".Length);
+                ret += "[MonsterActivation" + nameCamel + id + "]\n";
+                ret += "ability={ffg:" + m + "}\n";
+                ret += "master={ffg:" + attack[i] + "}\n";
+                ret += "movebutton=" + movebutton[i] + "\n";
+                if (movealt[i].Length > 0)
+                {
+                    ret += "move=" + movealt[i] + "\n";
+                }
+                ret += '\n';
             }
             return ret;
         }


Extracted part to get repo name from httpcontext to create a unit test.

Also added another replace to remove any slashes

--- Bonobo.Git.Server/Attributes/GitAuthorizeAttribute.cs
+++ Bonobo.Git.Server/Attributes/GitAuthorizeAttribute.cs
@@ -25,6 +25,12 @@
         [Dependency]
         public IRepositoryPermissionService RepositoryPermissionService { get; set; }

+        public static string GetRepoPath(string path, string applicationPath)
+        {
+            var repo = path.Replace(applicationPath, "").Replace("/","");
+            return repo.Substring(0, repo.IndexOf(".git"));
+        }
+
         public override void OnAuthorization(System.Web.Mvc.AuthorizationContext filterContext)
         {
             if (filterContext == null)
@@ -34,9 +40,8 @@

             HttpContextBase httpContext = filterContext.HttpContext;

+            string repo = GetRepoPath(httpContext.Request.Path, httpContext.Request.ApplicationPath);
             // check if repo allows anonymous pulls
-            var repo = httpContext.Request.Path.Replace(httpContext.Request.ApplicationPath, "");
-            repo = repo.Substring(1, repo.IndexOf(".git")-1);
             if (RepositoryPermissionService.AllowsAnonymous(repo))
             {
                 return;


Correctly redirect from repo controller (#733)

Correctly redirect to home/login

--- Bonobo.Git.Server/Controllers/RepositoryController.cs
+++ Bonobo.Git.Server/Controllers/RepositoryController.cs
@@ -38,10 +38,10 @@

         public ActionResult Index(string sortGroup = null, string searchString = null)
         {
-            var unorderedRepositoryDetails = this.GetIndexModel();
+            var unorderedRepositoryDetails = GetIndexModel().ToList();
             if (!User.Identity.IsAuthenticated && !unorderedRepositoryDetails.Any())
             {
-                return RedirectToAction("Logon", "Home", new { returnUrl="/Home/Index" });
+                return RedirectToAction("Logon", "Home", new { returnUrl = Url.Action("index", "Home") });
             }
             if (!string.IsNullOrEmpty(searchString))
             {
@@ -49,10 +49,10 @@
                 unorderedRepositoryDetails = unorderedRepositoryDetails.Where(a => a.Name.ToLower().Contains(search) ||
                                             (!string.IsNullOrEmpty(a.Group) && a.Group.ToLower().Contains(search)) ||
                                             (!string.IsNullOrEmpty(a.Description) && a.Description.ToLower().Contains(search)))
-                                            .AsEnumerable();
-            }
-
-            foreach(var item in unorderedRepositoryDetails){
+                                            .ToList();
+            }
+            foreach(var item in unorderedRepositoryDetails)
+            {
                 SetGitUrls(item);
             }
             var orderedReposityDetails = unorderedRepositoryDetails


Store the given Id if appropriate

Store the given Id if appropriate

--- Connection.cs
+++ Connection.cs
@@ -97,6 +97,9 @@
 			if (Id != UUID.Zero)
 				if (auth.ActualId != Id)
 					throw new Exception ("Authentication failure: Unexpected GUID");
+
+			if (Id == UUID.Zero)
+				Id = auth.ActualId;

 			isAuthenticated = true;
 		}
@@ -554,7 +557,7 @@
 		const string machineUuidFilename = @"/var/lib/dbus/machine-id";
 		static UUID? machineId = null;
 		private static object idReadLock = new object ();
-		static UUID MachineId
+		internal static UUID MachineId
 		{
 			get {
 				lock (idReadLock) {


value updated

value updated

--- Code/TrackingApp.Droid/Resources/Resource.Designer.cs
+++ Code/TrackingApp.Droid/Resources/Resource.Designer.cs
@@ -119,6 +119,12 @@
 			// aapt resource value: 0x7f040002
 			public const int SpeechMessage = 2130968578;

+			// aapt resource value: 0x7f040008
+			public const int TableStore = 2130968584;
+
+			// aapt resource value: 0x7f040007
+			public const int TableStoreKey = 2130968583;
+
 			static String()
 			{
 				global::Android.Runtime.ResourceIdManager.UpdateIdValues();


Fix data type bug in BrokerageModelPythonWrapper.DefaultMarkets

--- Common/Python/Wrappers/BrokerageModelPythonWrapper.cs
+++ Common/Python/Wrappers/BrokerageModelPythonWrapper.cs
@@ -22,6 +22,7 @@
 using QuantConnect.Orders.Slippage;
 using QuantConnect.Securities;
 using System.Collections.Generic;
+using System.Linq;

 namespace QuantConnect.Python.Wrappers
 {
@@ -66,7 +67,7 @@
             {
                 using (Py.GIL())
                 {
-                    return _brokerageModel.DefaultMarkets;
+                    return _brokerageModel.DefaultMarkets.ToDictionary(x => x.Key, x => x.Value);
                 }
             }
         }


fix drink examine text (#5170)

fix drink examine text (#5170)

--- Content.Server/Nutrition/EntitySystems/DrinkSystem.cs
+++ Content.Server/Nutrition/EntitySystems/DrinkSystem.cs
@@ -60,7 +60,7 @@
             var color = IsEmpty(uid, component) ? "gray" : "yellow";
             var openedText =
                 Loc.GetString(IsEmpty(uid, component) ? "drink-component-on-examine-is-empty" : "drink-component-on-examine-is-opened");
-            args.Message.AddMarkup(Loc.GetString("drink-component-on-examine-details-text", ("colorName", color), ("text", openedText)));
+            args.Message.AddMarkup($"\n{Loc.GetString("drink-component-on-examine-details-text", ("colorName", color), ("text", openedText))}");
         }

         private void SetOpen(EntityUid uid, bool opened = false, DrinkComponent? component = null)


Allow ghosts to ignore obstructions (#8397)

--- Content.Shared/Interaction/SharedInteractionSystem.cs
+++ Content.Shared/Interaction/SharedInteractionSystem.cs
@@ -4,6 +4,7 @@
 using Content.Shared.Administration.Logs;
 using Content.Shared.CombatMode;
 using Content.Shared.Database;
+using Content.Shared.Ghost;
 using Content.Shared.Hands.Components;
 using Content.Shared.Input;
 using Content.Shared.Interaction.Components;
@@ -149,7 +150,7 @@
                 return true;
             }

-            UserInteraction(user.Value, coords, uid, altInteract: true);
+            UserInteraction(user.Value, coords, uid, altInteract: true, checkAccess: ShouldCheckAccess(user.Value));

             return false;
         }
@@ -163,9 +164,16 @@
                 return true;
             }

-            UserInteraction(userEntity.Value, coords, !Deleted(uid) ? uid : null);
+            UserInteraction(userEntity.Value, coords, !Deleted(uid) ? uid : null, checkAccess: ShouldCheckAccess(userEntity.Value));

             return false;
+        }
+
+        private bool ShouldCheckAccess(EntityUid user)
+        {
+            // This is for Admin/mapping convenience. If ever there are other ghosts that can still interact, this check
+            // might need to be more selective.
+            return !HasComp<SharedGhostComponent>(user);
         }

         /// <summary>
@@ -669,7 +677,7 @@
             if (Deleted(uid))
                 return false;

-            InteractionActivate(user.Value, uid);
+            InteractionActivate(user.Value, uid, checkAccess: ShouldCheckAccess(user.Value));
             return false;
         }


whitespace

whitespace

git-svn-id: 9499ca894a8a68cdff32de8c8c545ddc6cb0944b@279 458802cb-8328-0410-b1d9-a76001e3bb52

--- xmlunit/src/csharp/XmlDiff.cs
+++ xmlunit/src/csharp/XmlDiff.cs
@@ -145,7 +145,7 @@

                 if (!String.Equals(controlAttrName, testAttrName)) {
                     if (!_diffConfiguration.IgnoreAttributeOrder) {
-                    DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result);
+                        DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result);
                     }

                     if (!_testReader.MoveToAttribute(controlAttrName)) {