Further improvements to TestCasePerformancePoints

--- osu.Game/Tests/Visual/TestCasePerformancePoints.cs
+++ osu.Game/Tests/Visual/TestCasePerformancePoints.cs
@@ -6,19 +6,23 @@
 using OpenTK;
 using OpenTK.Graphics;
 using osu.Framework.Allocation;
+using osu.Framework.Caching;
 using osu.Framework.Extensions.IEnumerableExtensions;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Cursor;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Sprites;
 using osu.Framework.Input;
 using osu.Game.Beatmaps;
 using osu.Game.Graphics.Sprites;
+using osu.Game.Graphics.UserInterface;
 using osu.Game.Online.API;
 using osu.Game.Online.API.Requests;
 using osu.Game.Overlays;
 using osu.Game.Overlays.Music;
 using osu.Game.Rulesets;
+using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Scoring;

 namespace osu.Game.Tests.Visual
@@ -27,50 +31,77 @@
     {
         public TestCasePerformancePoints(Ruleset ruleset)
         {
-            Child = new FillFlowContainer
+            Child = new GridContainer
             {
                 RelativeSizeAxes = Axes.Both,
-                Direction = FillDirection.Horizontal,
-                Children = new Drawable[]
-                {
-                    new Container
+                Content = new[]
+                {
+                    new Drawable[]
                     {
-                        RelativeSizeAxes = Axes.Both,
-                        Width = 0.25f,
-                        Children = new Drawable[]
-                        {
-                            new Box
+                        new Container
+                        {
+                            RelativeSizeAxes = Axes.Both,
+                            Children = new Drawable[]
                             {
-                                RelativeSizeAxes = Axes.Both,
-                                Colour = Color4.Black,
-                                Alpha = 0.5f,
-                            },
-                            new ScrollContainer(Direction.Vertical)
+                                new Box
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Colour = Color4.Black,
+                                    Alpha = 0.5f,
+                                },
+                                new ScrollContainer(Direction.Vertical)
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Child = new BeatmapList(ruleset)
+                                }
+                            }
+                        },
+                        null,
+                        new Container
+                        {
+                            RelativeSizeAxes = Axes.Both,
+                            Children = new Drawable[]
                             {
-                                RelativeSizeAxes = Axes.Both,
-                                Child = new BeatmapList(ruleset)
+                                new Box
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Colour = Color4.Black,
+                                    Alpha = 0.5f,
+                                },
+                                new ScrollContainer(Direction.Vertical)
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Child = new StarRatingGrid()
+                                }
                             }
-                        }
-                    },
-                    new Container
-                    {
-                        RelativeSizeAxes = Axes.Both,
-                        Width = 0.75f,
-                        Children = new Drawable[]
-                        {
-                            new Box
+                        },
+                        null,
+                        new Container
+                        {
+                            RelativeSizeAxes = Axes.Both,
+                            Children = new Drawable[]
                             {
-                                RelativeSizeAxes = Axes.Both,
-                                Colour = Color4.Black,
-                                Alpha = 0.5f,
-                            },
-                            new ScrollContainer(Direction.Vertical)
-                            {
-                                RelativeSizeAxes = Axes.Both,
-                                Child = new ScoreList { RelativeSizeAxes = Axes.Both }
+                                new Box
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Colour = Color4.Black,
+                                    Alpha = 0.5f,
+                                },
+                                new ScrollContainer(Direction.Vertical)
+                                {
+                                    RelativeSizeAxes = Axes.Both,
+                                    Child = new PerformanceList()
+                                }
                             }
-                        }
-                    },
+                        },
+                    }
+                },
+                ColumnDimensions = new[]
+                {
+                    new Dimension(),
+                    new Dimension(GridSizeMode.Absolute, 20),
+                    new Dimension(),
+                    new Dimension(GridSizeMode.Absolute, 20)
                 }
             };
         }
@@ -104,7 +135,7 @@
                 allBeatmaps.ForEach(b => beatmapDisplays.Add(new BeatmapDisplay(b)));
             }

-            private class BeatmapDisplay : CompositeDrawable
+            private class BeatmapDisplay : CompositeDrawable, IHasTooltip
             {
                 private readonly OsuSpriteText text;
                 private readonly BeatmapInfo beatmap;
@@ -113,6 +144,8 @@
                 private OsuGameBase osuGame;

                 private bool isSelected;
+
+                public string TooltipText => text.Text;

                 public BeatmapDisplay(BeatmapInfo beatmap)
                 {
@@ -168,16 +201,19 @@
             }
         }

-        private class ScoreList : CompositeDrawable
+        private class PerformanceList : CompositeDrawable
         {
-            private readonly FillFlowContainer<ScoreDisplay> scores;
+            private readonly FillFlowContainer<PerformanceDisplay> scores;
             private APIAccess api;

-            public ScoreList()
-            {
-                InternalChild = scores = new FillFlowContainer<ScoreDisplay>
-                {
-                    RelativeSizeAxes = Axes.Both,
+            public PerformanceList()
+            {
+                RelativeSizeAxes = Axes.X;
+                AutoSizeAxes = Axes.Y;
+                InternalChild = scores = new FillFlowContainer<PerformanceDisplay>
+                {
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
                     Direction = FillDirection.Vertical,
                     Spacing = new Vector2(0, 4)
                 };
@@ -197,39 +233,25 @@
                 scores.Clear();

                 lastRequest = new GetScoresRequest(newBeatmap.BeatmapInfo);
-                lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new ScoreDisplay(s, newBeatmap.Beatmap)));
+                lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new PerformanceDisplay(s, newBeatmap.Beatmap)));
                 api.Queue(lastRequest);
             }

-            private class ScoreDisplay : CompositeDrawable
-            {
-                private readonly OsuSpriteText playerName;
-                private readonly GridContainer attributeGrid;
+            private class PerformanceDisplay : CompositeDrawable
+            {
+                private readonly OsuSpriteText text;

                 private readonly Score score;
                 private readonly Beatmap beatmap;

-                public ScoreDisplay(Score score, Beatmap beatmap)
+                public PerformanceDisplay(Score score, Beatmap beatmap)
                 {
                     this.score = score;
                     this.beatmap = beatmap;

                     RelativeSizeAxes = Axes.X;
-                    Height = 16;
-                    InternalChild = new GridContainer
-                    {
-                        RelativeSizeAxes = Axes.Both,
-                        Content = new[]
-                        {
-                            new Drawable[] { playerName = new OsuSpriteText() },
-                            new Drawable[] { attributeGrid = new GridContainer { RelativeSizeAxes = Axes.Both } }
-                        },
-                        RowDimensions = new[]
-                        {
-                            new Dimension(GridSizeMode.Relative, 0.75f),
-                            new Dimension(GridSizeMode.Relative, 0.25f)
-                        }
-                    };
+                    AutoSizeAxes = Axes.Y;
+                    InternalChild = text = new OsuSpriteText();
                 }

                 [BackgroundDependencyLoader]
@@ -243,8 +265,117 @@
                     var attributes = new Dictionary<string, string>();
                     double performance = calculator.Calculate(attributes);

-                    playerName.Text = $"{score.PP} | {performance.ToString("0.00")} | {score.PP / performance}";
-                    // var attributeRow =
+                    text.Text = $"{score.User.Username} -> online: {score.PP:n2}pp | local: {performance:n2}pp";
+                }
+            }
+        }
+
+        private class StarRatingGrid : CompositeDrawable
+        {
+            private readonly FillFlowContainer<OsuCheckbox> modFlow;
+            private readonly OsuSpriteText totalText;
+            private readonly FillFlowContainer categoryTexts;
+
+            public StarRatingGrid()
+            {
+                RelativeSizeAxes = Axes.X;
+                AutoSizeAxes = Axes.Y;
+                InternalChild = new FillFlowContainer
+                {
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
+                    Children = new Drawable[]
+                    {
+                        modFlow = new FillFlowContainer<OsuCheckbox>
+                        {
+                            Name = "Checkbox flow",
+                            RelativeSizeAxes = Axes.X,
+                            AutoSizeAxes = Axes.Y,
+                            Spacing = new Vector2(4, 4)
+                        },
+                        new FillFlowContainer
+                        {
+                            Name = "Information display",
+                            RelativeSizeAxes = Axes.X,
+                            AutoSizeAxes = Axes.Y,
+                            Spacing = new Vector2(0, 4),
+                            Direction = FillDirection.Vertical,
+                            Children = new Drawable[]
+                            {
+                                totalText = new OsuSpriteText { TextSize = 24 },
+                                categoryTexts = new FillFlowContainer
+                                {
+                                    RelativeSizeAxes = Axes.X,
+                                    AutoSizeAxes = Axes.Y,
+                                    Direction = FillDirection.Vertical
+                                }
+                            }
+                        }
+                    }
+                };
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuGameBase osuGame)
+            {
+                osuGame.Beatmap.ValueChanged += beatmapChanged;
+            }
+
+            private Cached informationCache = new Cached();
+
+            private Ruleset ruleset;
+            private WorkingBeatmap beatmap;
+
+            private void beatmapChanged(WorkingBeatmap newBeatmap)
+            {
+                beatmap = newBeatmap;
+
+                modFlow.Clear();
+
+                ruleset = newBeatmap.BeatmapInfo.Ruleset.CreateInstance();
+                foreach (var mod in ruleset.GetAllMods())
+                {
+                    var checkBox = new OsuCheckbox
+                    {
+                        RelativeSizeAxes = Axes.None,
+                        Width = 50,
+                        LabelText = mod.ShortenedName
+                    };
+
+                    checkBox.Current.ValueChanged += v => informationCache.Invalidate();
+                    modFlow.Add(checkBox);
+                }
+
+                informationCache.Invalidate();
+            }
+
+            protected override void Update()
+            {
+                base.Update();
+
+                if (ruleset == null)
+                    return;
+
+                if (!informationCache.IsValid)
+                {
+                    totalText.Text = string.Empty;
+                    categoryTexts.Clear();
+
+                    var allMods = ruleset.GetAllMods().ToList();
+                    Mod[] activeMods = modFlow.Where(c => c.Current.Value).Select(c => allMods.First(m => m.ShortenedName == c.LabelText)).ToArray();
+
+                    var diffCalc = ruleset.CreateDifficultyCalculator(beatmap.Beatmap, activeMods);
+                    if (diffCalc != null)
+                    {
+                        var categories = new Dictionary<string, string>();
+                        double totalSr = diffCalc.Calculate(categories);
+
+                        totalText.Text = $"Star rating: {totalSr:n2}";
+                        foreach (var kvp in categories)
+                            categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" });
+                    }
+
+                    informationCache.Validate();
                 }
             }
         }


Update NotesRepository.cs

Update NotesRepository.cs

--- Models/NotesRepository.cs
+++ Models/NotesRepository.cs
@@ -1,4 +1,4 @@
-
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Web;


Don't stop looking for symbols if we can't load a mdb symbol provider.

So that we match the behavior for native pdbs.

--- Mono.Cecil.Cil/Symbols.cs
+++ Mono.Cecil.Cil/Symbols.cs
@@ -788,8 +788,13 @@
 			}

 			var mdb_file_name = Mixin.GetMdbFileName (fileName);
-			if (File.Exists (mdb_file_name))
-				return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, fileName);
+			if (File.Exists (mdb_file_name)) {
+				try {
+					return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, fileName);
+				} catch (TypeLoadException) {
+					// We might not include support for mdbs.
+				}
+			}

 			if (throw_if_no_symbol)
 				throw new FileNotFoundException (string.Format ("No symbol found for file: {0}", fileName));


- Fixed NOT U2 and CMP U2 handling in Mosa.Platforms.X86
- 11 additional test cases now pass (NotC, LdlocaU2_CheckValue, LdargaU2_CheckValue)

git-svn-id: 61c3ae23f3a6520e9bc357b51591209af2ede9d8@655 45b04e34-05f1-4d87-a130-40a8491d5c8b

--- Mosa/Platforms/x86/X86.cs
+++ Mosa/Platforms/x86/X86.cs
@@ -23,15 +23,15 @@
 		#region X86Intructions

 #pragma warning disable 1591
-        /// <summary>
-        /// This class contains OpCodes for every x86 asm instruction
-        /// used by the x86 backend.
-        ///
-        /// Note: When 16 bit register/memory usage is needed,
-        ///       the opcode for 32 bit is used, prefixed by 0x66.
-        ///       This forces the CPU to fall back to 16 bit register/memory
-        ///       usage.
-        /// </summary>
+		/// <summary>
+		/// This class contains OpCodes for every x86 asm instruction
+		/// used by the x86 backend.
+		///
+		/// Note: When 16 bit register/memory usage is needed,
+		///       the opcode for 32 bit is used, prefixed by 0x66.
+		///       This forces the CPU to fall back to 16 bit register/memory
+		///       usage.
+		/// </summary>
 		public static class X86Instruction
 		{
 			public static class Add
@@ -156,8 +156,9 @@
 			}
 			public static class Not
 			{
-				public static OpCode R = new OpCode(new byte[] { 0xF7 }, 2);
-				public static OpCode M = new OpCode(new byte[] { 0xF7 }, 2);
+				public static OpCode MR_8 = new OpCode(new byte[] { 0xF6 }, 2);
+				public static OpCode MR_16 = new OpCode(new byte[] { 0x66, 0xF7 }, 2);
+				public static OpCode MR = new OpCode(new byte[] { 0xF7 }, 2);
 			}
 			public static class Cmp
 			{
@@ -168,6 +169,8 @@
 				public static OpCode R_C = new OpCode(new byte[] { 0x81 }, 7);
 				public static OpCode M_R_8 = new OpCode(new byte[] { 0x38 });
 				public static OpCode R_M_8 = new OpCode(new byte[] { 0x3A });
+				public static OpCode M_R_16 = new OpCode(new byte[] { 0x66, 0x39 });
+				public static OpCode R_M_16 = new OpCode(new byte[] { 0x66, 0x3B });
 			}
 			public static class Cmpxchg
 			{
@@ -790,8 +793,14 @@
 		/// <returns></returns>
 		public static OpCode Not(Operand dest)
 		{
-			if (dest is RegisterOperand) return X86Instruction.Not.R;
-			if (dest is MemoryOperand) return X86Instruction.Not.M;
+			if ((dest is RegisterOperand) || (dest is MemoryOperand))
+				if (IsByte(dest))
+					return X86Instruction.Not.MR_8;
+				else if (IsChar(dest))
+					return X86Instruction.Not.MR_16;
+				else
+					return X86Instruction.Not.MR;
+
 			throw new ArgumentException(@"No opcode for operand type.");
 		}

@@ -807,13 +816,19 @@
 				if (IsByte(dest))
 					return X86Instruction.Cmp.M_R_8;
 				else
-					return X86Instruction.Cmp.M_R;
+					if (IsChar(dest))
+						return X86Instruction.Cmp.M_R_16;
+					else
+						return X86Instruction.Cmp.M_R;

 			if ((dest is RegisterOperand) && (src is MemoryOperand))
 				if (IsByte(src))
 					return X86Instruction.Cmp.R_M_8;
 				else
-					return X86Instruction.Cmp.R_M;
+					if (IsChar(src))
+						return X86Instruction.Cmp.R_M_16;
+					else
+						return X86Instruction.Cmp.R_M;

 			if ((dest is RegisterOperand) && (src is RegisterOperand)) return X86Instruction.Cmp.R_R;
 			if ((dest is MemoryOperand) && (src is ConstantOperand)) return X86Instruction.Cmp.M_C;


Unify on a single test helper.

Unify on a single test helper.

--- src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForConstructorsAnalyzerTests.cs
+++ src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForConstructorsAnalyzerTests.cs
@@ -30,7 +30,7 @@
         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseExpressionBody1()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C()
@@ -41,13 +41,13 @@
 @"class C
 {
     public C() => Bar();
-}", options: UseExpressionBody);
+}", new TestParameters(options: UseExpressionBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseExpressionBody2()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C()
@@ -58,13 +58,13 @@
 @"class C
 {
     public C() => a = Bar();
-}", options: UseExpressionBody);
+}", new TestParameters(options: UseExpressionBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseExpressionBody3()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C()
@@ -75,13 +75,13 @@
 @"class C
 {
     public C() => throw new NotImplementedException();
-}", options: UseExpressionBody);
+}", new TestParameters(options: UseExpressionBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseExpressionBody4()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C()
@@ -92,13 +92,13 @@
 @"class C
 {
     public C() => throw new NotImplementedException(); // comment
-}", options: UseExpressionBody);
+}", new TestParameters(options: UseExpressionBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseBlockBody1()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C() [|=>|] Bar();
@@ -109,13 +109,13 @@
     {
         Bar();
     }
-}", options: UseBlockBody);
+}", new TestParameters(options: UseBlockBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseBlockBody2()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C() [|=>|] a = Bar();
@@ -126,13 +126,13 @@
     {
         a = Bar();
     }
-}", options: UseBlockBody);
+}", new TestParameters(options: UseBlockBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseBlockBody3()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C() [|=>|] throw new NotImplementedException();
@@ -143,13 +143,13 @@
     {
         throw new NotImplementedException();
     }
-}", options: UseBlockBody);
+}", new TestParameters(options: UseBlockBody));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExpressionBody)]
         public async Task TestUseBlockBody4()
         {
-            await TestInRegularAndScriptAsync(
+            await TestInRegularAndScript1Async(
 @"class C
 {
     public C() [|=>|] throw new NotImplementedException(); // comment
@@ -160,7 +160,7 @@
     {
         throw new NotImplementedException(); // comment
     }
-}", options: UseBlockBody);
+}", new TestParameters(options: UseBlockBody));
         }

         [WorkItem(20362, "https://github.com/dotnet/roslyn/issues/20362")]


Account for InferSecuritySchemes in generator options DeepCopy

--- src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs
+++ src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs
@@ -61,6 +61,7 @@
             target.OperationIdSelector = source.OperationIdSelector;
             target.TagsSelector = source.TagsSelector;
             target.SortKeySelector = source.SortKeySelector;
+            target.InferSecuritySchemes = source.InferSecuritySchemes;
             target.DescribeAllParametersInCamelCase = source.DescribeAllParametersInCamelCase;
             target.Servers = new List<OpenApiServer>(source.Servers);
             target.SecuritySchemes = new Dictionary<string, OpenApiSecurityScheme>(source.SecuritySchemes);


Updated zero weight mating

Updated zero weight mating

--- Mzinga.Trainer/Profile.cs
+++ Mzinga.Trainer/Profile.cs
@@ -315,12 +315,9 @@
                 double value = 0.5 * (mwA.Get(player, playerWeight) + mwB.Get(player, playerWeight));
                 if (value == 0.0)
                 {
-                    value = minMix + (Random.NextDouble() * Math.Abs(maxMix - minMix));
+                    value = -0.01 + (Random.NextDouble() * 0.02);
                 }
-                else
-                {
-                    value = value * (minMix + (Random.NextDouble() * (maxMix - minMix)));
-                }
+                value = value * (minMix + (Random.NextDouble() * (maxMix - minMix)));
                 mw.Set(player, playerWeight, value);
             },
             (player, bugType, bugTypeWeight) =>
@@ -328,12 +325,9 @@
                 double value = 0.5 * (mwA.Get(player, bugType, bugTypeWeight) + mwB.Get(player, bugType, bugTypeWeight));
                 if (value == 0.0)
                 {
-                    value = minMix + (Random.NextDouble() * Math.Abs(maxMix - minMix));
+                    value = -0.01 + (Random.NextDouble() * 0.02);
                 }
-                else
-                {
-                    value = value * (minMix + (Random.NextDouble() * Math.Abs(maxMix - minMix)));
-                }
+                value = value * (minMix + (Random.NextDouble() * Math.Abs(maxMix - minMix)));
                 mw.Set(player, bugType, bugTypeWeight, value);
             });


Work on recovery.

Work on recovery.

--- N2.Visualizer/Recovery.cs
+++ N2.Visualizer/Recovery.cs
@@ -101,19 +101,17 @@
         {
           _recoveryStack = stack as RecoveryStack;

-          var before = parser.Text.Substring(0, startTextPos); // DEBUG
-          if (before == "[\r\n  { : 1},\r\n  { a },\r\n  { a: },\r\n  { a:, },\r\n  { \r\n  'a':, \r\n  a:1\r\n  },\r\n  {a::2,:},\r\n  {a# :1}, \r\n  {a") // DEBUG
-          {
-            Debug.Assert(true);
-          }
+          //var before = parser.Text.Substring(0, startTextPos); // DEBUG
+          //if (before == "[\r\n  { : 1},\r\n  { a },\r\n  { a: },\r\n  { a:, },\r\n  { \r\n  'a':, \r\n  a:1\r\n  },\r\n  {a::2,:},\r\n  {a# :1}, \r\n  {a") // DEBUG
+          //{
+          //  Debug.Assert(true);
+          //}

           ProcessStackFrame(startTextPos, parser, _recoveryStack, curTextPos, text, 0);
         }
-        // Здес нужно прерывать цикл, если _bestResult != null.
-        // Но при этом _bestResult не должен содержать вариантов где в _bestResult.Recovered находятся только пробелы (void-правила).
         curTextPos++;
       }
-      while (curTextPos - startTextPos < 400 && curTextPos <= text.Length);
+      while (_bestResult == null && curTextPos <= text.Length); // && curTextPos - startTextPos < 400

       timer.Stop();


Extend IO pin

Extend IO pin

--- NET/API/Treehopper/Pin.cs
+++ NET/API/Treehopper/Pin.cs
@@ -142,7 +142,7 @@
     /// between pins. While it cannot be instantiated directly by the user, Pin variables can reference existing pins.
     /// </para>
     /// </remarks>
-    public class Pin : INotifyPropertyChanged, IDigitalPin, IAdcPin
+    public class Pin : INotifyPropertyChanged, IDigitalIOPin, IAdcPin
     {
         protected string ioName;
         /// <summary>


Ignore errors from broken assemblies when scanning for older versions of Harmony

--- Harmony/Tools/SelfPatching.cs
+++ Harmony/Tools/SelfPatching.cs
@@ -22,11 +22,18 @@

 		static bool IsHarmonyAssembly(Assembly assembly)
 		{
-			var attribute = assembly.GetCustomAttributes(typeof(GuidAttribute), false);
-			if (attribute.Length < 1)
+			try
+			{
+				var attribute = assembly.GetCustomAttributes(typeof(GuidAttribute), false);
+				if (attribute.Length < 1)
+					return false;
+				var guidAttribute = attribute.GetValue(0) as GuidAttribute;
+				return guidAttribute.Value.ToString() == "69aee16a-b6e7-4642-8081-3928b32455df";
+			}
+			catch (Exception)
+			{
 				return false;
-			var guidAttribute = attribute.GetValue(0) as GuidAttribute;
-			return guidAttribute.Value.ToString() == "69aee16a-b6e7-4642-8081-3928b32455df";
+			}
 		}

 		// globally shared between all our identical versions


add overload for msdn package generator. (#752)

--- tools/ExternalPackageGenerators/Microsoft.DocAsCode.ExternalPackageGenerators.Msdn/Program.cs
+++ tools/ExternalPackageGenerators/Microsoft.DocAsCode.ExternalPackageGenerators.Msdn/Program.cs
@@ -27,6 +27,8 @@
     {

         #region Fields
+        private static readonly Regex GenericMethodPostFix = new Regex(@"``\d+$", RegexOptions.Compiled);
+
         private static string MsdnUrlTemplate = "https://msdn.microsoft.com/en-us/library/{0}(v={1}).aspx";
         private static string MtpsApiUrlTemplate = "http://services.mtps.microsoft.com/ServiceAPI/content/{0}/en-us;{1}/common/mtps.links";
         private static int HttpMaxConcurrency = 64;
@@ -360,7 +362,6 @@
                 result.Add(typeSpec);
             }
             int size = 0;
-
             foreach (var specsTask in
                 from block in
                     (from item in entry.Items
@@ -370,6 +371,7 @@
             {
                 result.AddRange(await specsTask);
             }
+            result.AddRange(await GetOverloadXRefSpecAsync(result));
             if (typeSpec != null && typeSpec.Href != null)
             {
                 // handle enum field, or other one-page-member
@@ -421,6 +423,57 @@
                 CommentId = pair.CommentId,
                 Href = string.Format(MsdnUrlTemplate, shortId, _msdnVersion),
             };
+        }
+
+        private async Task<XRefSpec[]> GetOverloadXRefSpecAsync(List<XRefSpec> specs)
+        {
+            var pairs = (from spec in specs
+                         let overload = GetOverloadIdBody(spec)
+                         where overload != null
+                         group Tuple.Create(spec, overload) by overload.Uid into g
+                         select g.First());
+            return await Task.WhenAll(from pair in pairs select GetOverloadXRefSpecCoreAsync(pair));
+        }
+
+        private async Task<XRefSpec> GetOverloadXRefSpecCoreAsync(Tuple<XRefSpec, CommentIdAndUid> pair)
+        {
+            var dict = await _commentIdToShortIdMapCache.GetAsync(pair.Item1.CommentId);
+            string shortId;
+            if (dict.TryGetValue(pair.Item2.CommentId, out shortId))
+            {
+                return new XRefSpec
+                {
+                    Uid = pair.Item2.Uid,
+                    CommentId = pair.Item2.CommentId,
+                    Href = string.Format(MsdnUrlTemplate, shortId, _msdnVersion),
+                };
+            }
+            else
+            {
+                return new XRefSpec(pair.Item1)
+                {
+                    Uid = pair.Item2.Uid
+                };
+            }
+        }
+
+        private static CommentIdAndUid GetOverloadIdBody(XRefSpec pair)
+        {
+            switch (pair.CommentId[0])
+            {
+                case 'M':
+                case 'P':
+                    var body = pair.Uid;
+                    var index = body.IndexOf('(');
+                    if (index != -1)
+                    {
+                        body = body.Remove(index);
+                    }
+                    body = GenericMethodPostFix.Replace(body, string.Empty);
+                    return new CommentIdAndUid("Overload:" + body, body + "*");
+                default:
+                    return null;
+            }
         }

         private string GetContainingCommentId(string commentId)
@@ -442,6 +495,8 @@
                     case 'M':
                     case 'P':
                         return "T" + result.Substring(1);
+                    case 'O':
+                        return "T" + result.Substring("Overload".Length);
                     default:
                         return "N" + result.Substring(1);
                 }


test success

test success

--- HelloWorld/Tests/UnitTest1.cs
+++ HelloWorld/Tests/UnitTest1.cs
@@ -14,7 +14,7 @@
         [TestMethod]
         public void TestMethod2()
         {
-            Assert.IsTrue(false);
+            Assert.IsTrue(true);
         }
     }
 }


PageGenerator_GenerateSidebarContent_Should.RendersTagLinksWithoutSpaces - Red

--- PrehensilePonyTail/PPTail.Generator.T4Html.Test/PageGenerator_GenerateSidebarContent_Should.cs
+++ PrehensilePonyTail/PPTail.Generator.T4Html.Test/PageGenerator_GenerateSidebarContent_Should.cs
@@ -126,6 +126,34 @@
         }

         [Fact]
+        public void RendersTagLinksWithoutSpaces()
+        {
+            var widget = Enumerations.WidgetType.Tag_cloud.CreateWidget();
+            var widgets = new List<Widget>() { widget };
+
+            var templates = (null as IEnumerable<Template>).CreateBlankTemplates();
+            var settings = (null as Settings).CreateDefault("yyyy-MM-dd");
+
+            var siteSettings = (null as SiteSettings).Create();
+            var posts = (null as IEnumerable<ContentItem>).Create(1);
+            var thisPost = posts.Single();
+            var tagValue = $"{String.Empty.GetRandom()} {string.Empty.GetRandom()}";
+            thisPost.Tags = new List<string>() { tagValue };
+
+            var tagName = tagValue.Replace(" ", "_");
+            var extension = settings.outputFileExtension;
+
+            var pages = new List<ContentItem>();
+
+            string expected = $"href=\"/tags/{tagName}.{extension}\"";
+
+            var pageGen = (null as Interfaces.IPageGenerator).Create(templates, settings);
+            var actual = pageGen.GenerateSidebarContent(settings, siteSettings, posts, pages, widgets);
+
+            Assert.Contains(expected, actual);
+        }
+
+        [Fact]
         public void RenderWidgetTitleIfShowTitleIsTrue()
         {
             var widget = Enumerations.WidgetType.TextBox.CreateWidget();


修改异步MessageHandlerDemo

修改异步MessageHandlerDemo

--- Samples/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/WeixinAsyncController.cs
+++ Samples/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/WeixinAsyncController.cs
@@ -61,26 +61,23 @@
         /// </summary>
         [HttpPost]
         [ActionName("Index")]
-        public Task<ActionResult> MiniPost(PostModel postModel)
+        public async Task<ActionResult> MiniPost(PostModel postModel)
         {
-            return Task.Factory.StartNew<ActionResult>(() =>
+            if (!CheckSignature.Check(postModel.Signature, postModel.Timestamp, postModel.Nonce, Token))
             {
-                if (!CheckSignature.Check(postModel.Signature, postModel.Timestamp, postModel.Nonce, Token))
-                {
-                    return new WeixinResult("参数错误！");
-                }
+                return new WeixinResult("参数错误！");
+            }

-                postModel.Token = Token;
-                postModel.EncodingAESKey = EncodingAESKey; //根据自己后台的设置保持一致
-                postModel.AppId = AppId; //根据自己后台的设置保持一致
+            postModel.Token = Token;
+            postModel.EncodingAESKey = EncodingAESKey; //根据自己后台的设置保持一致
+            postModel.AppId = AppId; //根据自己后台的设置保持一致

-                var messageHandler = new CustomMessageHandler(Request.InputStream, postModel, 10);
+            var messageHandler = new CustomMessageHandler(Request.InputStream, postModel, 10);

-                messageHandler.Execute(); //执行微信处理过程
+            await messageHandler.ExecuteAsync(); //执行微信处理过程

-                return new FixWeixinBugWeixinResult(messageHandler);
-
-            }).ContinueWith<ActionResult>(task => task.Result);
+            return new FixWeixinBugWeixinResult(messageHandler);
+            //.ContinueWith<ActionResult>(task => task.Result);
         }

         /// <summary>


Update DynamicCharacterAvatar.cs

Update DynamicCharacterAvatar.cs


Fix modifiers getting instantly released

--- osu.Framework/Input/Bindings/KeyBindingContainer.cs
+++ osu.Framework/Input/Bindings/KeyBindingContainer.cs
@@ -132,9 +132,13 @@
             if (!repeat)
                 pressedBindings.AddRange(newlyPressed);

-            // exact matching may result in no newly pressed actions, in which case we want to release all existing ones
+            // exact matching may result in no pressed (new or old) bindings, in which case we want to trigger releases for existing actions
             if (simultaneousMode == SimultaneousBindingMode.NoneExact)
-                releasePressedActions();
+            {
+                // only want to release pressed actions if no existing bindings would still remain pressed
+                if (pressedBindings.Count > 0 && !pressedBindings.Any(m => m.KeyCombination.IsPressed(pressedCombination, simultaneousMode == SimultaneousBindingMode.NoneExact)))
+                    releasePressedActions();
+            }

             foreach (var newBinding in newlyPressed)
             {


Update TaikoRulesetContainer.cs

Update TaikoRulesetContainer.cs

Remove code that I am almost 100% sure that makes barlines every 1/1 instead of 4/1.

--- osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs
+++ osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs
@@ -70,8 +70,6 @@
                 Playfield.Add(isMajor ? new DrawableBarLineMajor(barLine) : new DrawableBarLine(barLine));

                 double bl = currentPoint.BeatLength;
-                if (bl < 800)
-                    bl *= (int)currentPoint.TimeSignature;

                 time += bl;
                 currentBeat++;


return back custom cursor

return back custom cursor

--- mogate/GameMogate.cs
+++ mogate/GameMogate.cs
@@ -24,7 +24,9 @@
 			Content.RootDirectory = "Content";
 			m_graphics.PreferredBackBufferHeight = 768;
 			m_graphics.PreferredBackBufferWidth = 1024;
-			m_graphics.IsFullScreen = false;
+			m_graphics.IsFullScreen = false;
+
+			IsMouseVisible = true;
 		}

 		/// <summary>


Next release is Galois.

Next release is Galois.

--- ksp_plugin_adapter/main_window.cs
+++ ksp_plugin_adapter/main_window.cs
@@ -5,10 +5,10 @@

 internal class MainWindow : VesselSupervisedWindowRenderer {
   // Update this section before each release.
-  private const string next_release_name_ = "Gallai";
-  private const int next_release_lunation_number_ = 254;
+  private const string next_release_name_ = "Galois";
+  private const int next_release_lunation_number_ = 255;
   private readonly DateTimeOffset next_release_date_ =
-      new DateTimeOffset(2020, 07, 20, 17, 32, 00, TimeSpan.Zero);
+      new DateTimeOffset(2020, 08, 19, 02, 41, 00, TimeSpan.Zero);

   public MainWindow(PrincipiaPluginAdapter adapter,
                     FlightPlanner flight_planner,


Remove unnecessary cast.

Remove unnecessary cast.

--- osu.Framework/Graphics/Containers/ScrollContainer.cs
+++ osu.Framework/Graphics/Containers/ScrollContainer.cs
@@ -111,7 +111,7 @@
         /// </summary>
         private float target;

-        private float scrollableExtent => (float)Math.Max(availableContent - displayableContent, 0);
+        private float scrollableExtent => Math.Max(availableContent - displayableContent, 0);
         private float clamp(float position, float extension = 0) => MathHelper.Clamp(position, -extension, scrollableExtent + extension);

         protected override Container<Drawable> Content => content;


Fix a couple more inspections

Fix a couple more inspections

--- osu.Framework/Testing/DrawFrameRecordingContainer.cs
+++ osu.Framework/Testing/DrawFrameRecordingContainer.cs
@@ -4,6 +4,7 @@
 #nullable disable

 using System.Collections.Generic;
+using System.Diagnostics;
 using JetBrains.Annotations;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
@@ -80,6 +81,8 @@
             if (!(drawNode is ICompositeDrawNode composite))
                 return;

+            Debug.Assert(composite.Children != null);
+
             foreach (var child in composite.Children)
                 referenceRecursively(child);
         }
@@ -90,6 +93,8 @@

             if (!(drawNode is ICompositeDrawNode composite))
                 return;
+
+            Debug.Assert(composite.Children != null);

             foreach (var child in composite.Children)
                 disposeRecursively(child);


Add support for custom hyper-dash legacy fruit colouring

--- osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs
+++ osu.Game.Rulesets.Catch/Skinning/LegacyFruitPiece.cs
@@ -7,6 +7,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Sprites;
 using osu.Game.Rulesets.Catch.Objects.Drawables;
+using osu.Game.Rulesets.Catch.UI;
 using osu.Game.Rulesets.Objects.Drawables;
 using osu.Game.Skinning;
 using osuTK;
@@ -53,10 +54,15 @@

             if (drawableCatchObject.HitObject.HyperDash)
             {
+                var hyperDashColour =
+                    skin.GetConfig<CatchSkinConfiguration, Color4>(CatchSkinConfiguration.HyperDashFruit)?.Value ??
+                    skin.GetConfig<CatchSkinConfiguration, Color4>(CatchSkinConfiguration.HyperDash)?.Value ??
+                    Catcher.DefaultHyperDashColour;
+
                 var hyperDash = new Sprite
                 {
                     Texture = skin.GetTexture(lookupName),
-                    Colour = Color4.Red,
+                    Colour = hyperDashColour,
                     Anchor = Anchor.Centre,
                     Origin = Anchor.Centre,
                     Blending = BlendingParameters.Additive,


Fix tests

Fix tests

--- osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs
@@ -3,6 +3,8 @@

 using System.Collections.Generic;
 using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
 using NUnit.Framework;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
@@ -11,6 +13,7 @@
 using osu.Framework.Testing;
 using osu.Framework.Utils;
 using osu.Game.Beatmaps;
+using osu.Game.Database;
 using osu.Game.Online;
 using osu.Game.Online.Spectator;
 using osu.Game.Replays.Legacy;
@@ -29,6 +32,9 @@
         [Cached(typeof(SpectatorStreamingClient))]
         private TestSpectatorStreamingClient testSpectatorStreamingClient = new TestSpectatorStreamingClient();

+        [Cached(typeof(UserLookupCache))]
+        private UserLookupCache lookupCache = new TestUserLookupCache();
+
         // used just to show beatmap card for the time being.
         protected override bool UseOnlineAPI => true;

@@ -301,5 +307,14 @@
                 });
             }
         }
+
+        internal class TestUserLookupCache : UserLookupCache
+        {
+            protected override Task<User> ComputeValueAsync(int lookup, CancellationToken token = default) => Task.FromResult(new User
+            {
+                Id = lookup,
+                Username = $"User {lookup}"
+            });
+        }
     }
 }


Use default timeout in `GetPlayableBeatmap` when provided `CancellationToken` is `default`

--- osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs
+++ osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs
@@ -145,7 +145,11 @@
         {
             playableMods = mods.Select(m => m.DeepClone()).ToArray();

-            Beatmap = beatmap.GetPlayableBeatmap(ruleset, playableMods, cancellationToken);
+            // Only pass through the cancellation token if it's non-default.
+            // This allows for the default timeout to be applied for playable beatmap construction.
+            Beatmap = cancellationToken == default
+                ? beatmap.GetPlayableBeatmap(ruleset, playableMods)
+                : beatmap.GetPlayableBeatmap(ruleset, playableMods, cancellationToken);

             var track = new TrackVirtual(10000);
             playableMods.OfType<IApplicableToTrack>().ForEach(m => m.ApplyToTrack(track));


Use Environment.SpecialFolder to place the DLLs.   - Fixes #137

--- pGina/src/Shared/Registration/CredProviderManager.cs
+++ pGina/src/Shared/Registration/CredProviderManager.cs
@@ -104,7 +104,8 @@

         public override void Install()
         {
-            FileInfo dll = null;
+            FileInfo dll = null;
+
             if (Abstractions.Windows.OsInfo.Is64Bit())
             {
                 dll = DllUtils.Find64BitDll(this.CpInfo.Path, this.CpInfo.ShortName);
@@ -210,7 +211,8 @@

         static readonly string PROVIDER_KEY_BASE = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers";
         static readonly string CLSID_BASE = @"CLSID";
-        static readonly string PROVIDER_KEY_BASE_6432 = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers";
+        static readonly string PROVIDER_KEY_BASE_6432 = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers";
+        static readonly string WINDIR = Environment.GetFolderPath(Environment.SpecialFolder.Windows);

         // The registry keys
         string ProviderKey
@@ -235,21 +237,31 @@
             // Defaults for pGina Credential Provider
             this.CpInfo.ProviderGuid = new Guid("{D0BEFEFB-3D2C-44DA-BBAD-3B2D04557246}");
             this.CpInfo.ShortName = "pGinaCredentialProvider";
-        }
+        }
+
+        private string GetCpDllPath()
+        {
+            return Path.Combine(WINDIR, "System32", CpInfo.ShortName + ".dll");
+        }
+
+        private string GetCpDllPath6432()
+        {
+            return Path.Combine(WINDIR, "Syswow64", CpInfo.ShortName + ".dll");
+        }

         public override void Install()
         {
             m_logger.InfoFormat("Installing credential provider {0} {{{1}}}",
                 CpInfo.ShortName,
-                CpInfo.ProviderGuid.ToString());
+                CpInfo.ProviderGuid.ToString());

             // Copy the DLL
             if (Abstractions.Windows.OsInfo.Is64Bit()) // Are we on a 64 bit OS?
             {
                 FileInfo x64Dll = DllUtils.Find64BitDll(CpInfo.Path, CpInfo.ShortName);
-                FileInfo x32Dll = DllUtils.Find32BitDll(CpInfo.Path, CpInfo.ShortName);
-                string destination64 = String.Format(@"C:\Windows\System32\{0}.dll", CpInfo.ShortName);
-                string destination32 = String.Format(@"C:\Windows\Syswow64\{0}.dll", CpInfo.ShortName);
+                FileInfo x32Dll = DllUtils.Find32BitDll(CpInfo.Path, CpInfo.ShortName);
+                string destination64 = GetCpDllPath();
+                string destination32 = GetCpDllPath6432();

                 if (x64Dll == null && x32Dll == null)
                 {
@@ -287,8 +299,8 @@
             }
             else
             {
-                FileInfo x32Dll = DllUtils.Find32BitDll(CpInfo.Path, CpInfo.ShortName);
-                string destination = String.Format(@"C:\Windows\System32\{0}.dll", CpInfo.ShortName);
+                FileInfo x32Dll = DllUtils.Find32BitDll(CpInfo.Path, CpInfo.ShortName);
+                string destination = GetCpDllPath();

                 if (x32Dll != null)
                 {
@@ -329,11 +341,11 @@
         {
             m_logger.InfoFormat("Uninstalling credential provider {0} {{{1}}}",
                 CpInfo.ShortName,
-                CpInfo.ProviderGuid.ToString());
-
-            string dll = String.Format(@"C:\Windows\System32\{0}.dll", CpInfo.ShortName);
-            string dll6432 = String.Format(@"C:\Windows\Syswow64\{0}.dll", CpInfo.ShortName);
-
+                CpInfo.ProviderGuid.ToString());
+
+            string dll = GetCpDllPath();
+            string dll6432 = GetCpDllPath6432();
+
             if (File.Exists(dll))
             {
                 m_logger.DebugFormat("Deleting: {0}", dll);
@@ -341,8 +353,8 @@
             }
             if (File.Exists(dll6432))
             {
-                m_logger.DebugFormat("Deleting: {0}", dll);
-                File.Delete(dll);
+                m_logger.DebugFormat("Deleting: {0}", dll6432);
+                File.Delete(dll6432);
             }

             string guid = "{" + CpInfo.ProviderGuid.ToString() + "}";


Fix V3041

Fix V3041

--- Advanced.Algorithms/DynamicProgramming/Maximizing/KnackSackProblems.cs
+++ Advanced.Algorithms/DynamicProgramming/Maximizing/KnackSackProblems.cs
@@ -60,7 +60,7 @@
             //O(n)
             for (int i = 0; i < weights.Length; i++)
             {
-                ratios[i] = values[i] / weights[i];
+                ratios[i] = (double)values[i] / weights[i];
             }
             //(o(nlog(n)
             //quick sort by desc weights


Code Refactoring

Code Refactoring

--- src/PartialDeployer/Ftp.cs
+++ src/PartialDeployer/Ftp.cs
@@ -22,7 +22,7 @@
         private string ftp_password;
         private string ftp_folder;

-        private List<string> ConfigedRemotePaths;
+        private List<string> configedRemotePaths;

         //http://stackoverflow.com/questions/1013486/parsing-ftpwebrequests-listdirectorydetails-line
         //Regex regex = new Regex(@"^([d-])([rwxt-]{3}){3}\s+\d{1,}\s+.*?(\d{1,})\s+(\w+\s+\d{1,2}\s+(?:\d{4})?)(\d{1,2}:\d{2})?\s+(.+?)\s?$", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
@@ -37,7 +37,7 @@
             ftp_server = _configMan.FTP_Server;
             ftp_folder = _configMan.FTP_Folder;

-            ConfigedRemotePaths = new List<string>();
+            configedRemotePaths = new List<string>();
         }

         #region Privates
@@ -132,25 +132,30 @@

             foreach (string path in pathToMake)
             {
-                string tryPath = String.Format("{0}{1}{2}", ftp_server, ftp_folder, path);
-
-                if (!ConfigedRemotePaths.Any(s => s == tryPath))
-                {
-                    FtpWebRequest request = getRequestObject(tryPath);
-                    request.Method = WebRequestMethods.Ftp.MakeDirectory;
-                    try
-                    {
-                        WebResponse response = request.GetResponse();
-                        ConfigedRemotePaths.Add(tryPath);
-                    }
-                    catch (Exception ex)
-                    {
-                        log.ErrorFormat(ex.Message);
-                    }
-                }
+                createFtpFolder(String.Format("{0}{1}{2}", ftp_server, ftp_folder, path));
             }

             return true;
+        }
+
+        private void createFtpFolder(string folderPath)
+        {
+            log.DebugFormat("createFtpFolder - {0}", folderPath);
+
+            if (!configedRemotePaths.Any(s => s == folderPath))
+            {
+                FtpWebRequest request = getRequestObject(folderPath);
+                request.Method = WebRequestMethods.Ftp.MakeDirectory;
+                try
+                {
+                    WebResponse response = request.GetResponse();
+                    configedRemotePaths.Add(folderPath);
+                }
+                catch (Exception ex)
+                {
+                    log.ErrorFormat(ex.Message);
+                }
+            }
         }

         public bool FTPUpload(string fromFile, string fileToUpload)


Fixes issue #557

Fixes issue #557

--- AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ModelTemplateModel.cs
+++ AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ModelTemplateModel.cs
@@ -171,9 +171,29 @@

         public bool ContainsPropertiesInCompositeType()
         {
-            var sample = ComposedProperties.FirstOrDefault(p =>
-                p.Type is CompositeType || p.Type is SequenceType && (p.Type as SequenceType).ElementType is CompositeType);
+            var sample = ComposedProperties.FirstOrDefault(p => ContainsCompositeType(p.Type));
             return sample != null;
+        }
+
+        private bool ContainsCompositeType(IType type)
+        {
+            bool result = false;
+            //base condition
+            if (type is CompositeType ||
+                type is SequenceType && (type as SequenceType).ElementType is CompositeType ||
+                type is DictionaryType && (type as DictionaryType).ValueType is CompositeType)
+            {
+                result = true;
+            }
+            else if (type is SequenceType)
+            {
+                result = ContainsCompositeType((type as SequenceType).ElementType);
+            }
+            else if (type is DictionaryType)
+            {
+                result = ContainsCompositeType((type as DictionaryType).ValueType);
+            }
+            return result;
         }

         public bool ContainsDurationProperty()


Modified commands to behave better when attached to DMs

--- Ocell/Helpers/Commands.cs
+++ Ocell/Helpers/Commands.cs
@@ -18,7 +18,17 @@
         {
             ITweetable tweet = (ITweetable)parameter;
             DataTransfer.Text = "@" + tweet.Author.ScreenName + " ";
-            DataTransfer.ReplyId = tweet.Id;
+            if (parameter is TwitterStatus)
+            {
+                DataTransfer.ReplyId = tweet.Id;
+                DataTransfer.ReplyingDM = false;
+            }
+            else if (parameter is TwitterDirectMessage)
+            {
+                DataTransfer.DMDestinationId = (parameter as TwitterDirectMessage).SenderId;
+                DataTransfer.ReplyingDM = true;
+            }
+
             PhoneApplicationFrame service = ((PhoneApplicationFrame)Application.Current.RootVisual);
             Deployment.Current.Dispatcher.BeginInvoke(() => service.Navigate(new Uri("/Pages/NewTweet.xaml", UriKind.Relative)));
         }
@@ -30,7 +40,7 @@
     {
         public bool CanExecute(object parameter)
         {
-            return parameter is ITweetable;
+            return parameter is TwitterStatus;
         }

         public void Execute(object parameter)
@@ -51,7 +61,7 @@
     {
         public bool CanExecute(object parameter)
         {
-            return (parameter is ITweetable) &&
+            return (parameter is TwitterStatus) &&
                 Config.Accounts.Count > 0 &&
                 DataTransfer.CurrentAccount != null;
         }
@@ -68,7 +78,7 @@
     {
         public bool CanExecute(object parameter)
         {
-            return (parameter is ITweetable) &&
+            return (parameter is TwitterStatus) &&
                 Config.Accounts.Count > 0 &&
                 DataTransfer.CurrentAccount != null;
         }


Issue #427

Issue #427

--- Cognifide.PowerShell/Client/Applications/PowerShellMultiValuePrompt.cs
+++ Cognifide.PowerShell/Client/Applications/PowerShellMultiValuePrompt.cs
@@ -531,7 +531,7 @@
                 var placeholder = variable["Placeholder"];
                 if (placeholder is string)
                 {
-                    ((Edit) edit).Placeholder = placeholder.ToString();
+                    ((Edit) edit).Attributes["placeholder"] = placeholder.ToString();
                 }
             }
             if (!string.IsNullOrEmpty((string) variable["Tooltip"]))


Change resolution on the fly

Change resolution on the fly

--- OpenKh.Game/OpenKhGame.cs
+++ OpenKh.Game/OpenKhGame.cs
@@ -22,6 +22,7 @@
         private readonly InputManager inputManager;
         private readonly DebugOverlay _debugOverlay;
         private IState state;
+        private bool _isResolutionChanged;

         public int State
         {
@@ -65,13 +66,8 @@
             _dataContent = new SafeDataContent(_dataContent);

             _kernel = new Kernel(_dataContent);
-
-            var resolutionWidth = Config.ResolutionWidth;
-            var resolutionHeight = Config.ResolutionHeight;
-            if (resolutionWidth == 0)
-                resolutionWidth = _kernel.IsReMix ? Global.ResolutionRemixWidth : Global.ResolutionWidth;
-            if (resolutionHeight == 0)
-                resolutionHeight = Global.ResolutionHeight;
+            var resolutionWidth = GetResolutionWidth();
+            var resolutionHeight = GetResolutionHeight();

             Log.Info($"Internal game resolution set to {resolutionWidth}x{resolutionHeight}");

@@ -87,6 +83,24 @@
             archiveManager = new ArchiveManager(_dataContent);
             inputManager = new InputManager();
             _debugOverlay = new DebugOverlay(this);
+
+            Config.OnConfigurationChange += () =>
+            {
+                var resolutionWidth = GetResolutionWidth();
+                var resolutionHeight = GetResolutionHeight();
+
+                Log.Info($"Internal game resolution set to {resolutionWidth}x{resolutionHeight}");
+                var backBufferWidth = (int)Math.Round(resolutionWidth * Config.ResolutionBoost);
+                var backBufferHeight = (int)Math.Round(resolutionHeight * Config.ResolutionBoost);
+
+                if (graphics.PreferredBackBufferWidth != backBufferWidth ||
+                    graphics.PreferredBackBufferHeight != backBufferHeight)
+                {
+                    graphics.PreferredBackBufferWidth = backBufferWidth;
+                    graphics.PreferredBackBufferHeight = backBufferHeight;
+                    _isResolutionChanged = true;
+                }
+            };
         }

         protected override void Initialize()
@@ -119,6 +133,12 @@

         protected override void Draw(GameTime gameTime)
         {
+            if (_isResolutionChanged)
+            {
+                graphics.ApplyChanges();
+                _isResolutionChanged = false;
+            }
+
             graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

             var deltaTimes = GetDeltaTimes(gameTime);
@@ -175,5 +195,21 @@
                 return new StandardDataContent(basePath);
             }
         }
+
+        private static int GetResolutionHeight()
+        {
+            var resolutionHeight = Config.ResolutionHeight;
+            if (resolutionHeight == 0)
+                resolutionHeight = Global.ResolutionHeight;
+            return resolutionHeight;
+        }
+
+        private int GetResolutionWidth()
+        {
+            var resolutionWidth = Config.ResolutionWidth;
+            if (resolutionWidth == 0)
+                resolutionWidth = _kernel.IsReMix ? Global.ResolutionRemixWidth : Global.ResolutionWidth;
+            return resolutionWidth;
+        }
     }
 }


Adding List Server with tag filter

Adding List Server with tag filter

--- ComputeClient/Compute.Contracts/Requests/Server20/ServerListOptions.cs
+++ ComputeClient/Compute.Contracts/Requests/Server20/ServerListOptions.cs
@@ -82,15 +82,35 @@
         /// </summary>
         public const string DrsEligibleField = "drsEligible";

-		/// <summary>
-		/// The "deploymentMode" field name.
-		/// </summary>
-		public const string DeploymentModeField = "deploymentMode";
-
-		/// <summary>
-		/// Identifies an individual Virtual Listener.
-		/// </summary>
-		public Guid? Id
+        /// <summary>
+        /// The "deploymentMode" field name.
+        /// </summary>
+        public const string DeploymentModeField = "deploymentMode";
+
+        /// <summary>
+		/// The "deploymentMode" field name.
+		/// </summary>
+		public const string TagField = "tag.";
+
+        /// <summary>
+		/// The "deploymentMode" field name.
+		/// </summary>
+		public const string TagIdField = "tagId.";
+
+        /// <summary>
+		/// The "deploymentMode" field name.
+		/// </summary>
+        public Guid? TagKeyId { get; set; }
+
+        /// <summary>
+		/// The "deploymentMode" field name.
+		/// </summary>
+        public string TagKeyName { get; set; }
+
+        /// <summary>
+        /// Identifies an individual Virtual Listener.
+        /// </summary>
+        public Guid? Id
         {
             get { return GetFilter<Guid?>(IdField); }
             set { SetFilter(IdField, value); }
@@ -231,13 +251,30 @@
             set { SetFilter(DrsEligibleField, value); }
         }

-		/// <summary>
-		/// Gets or sets the deploymentMode filter.
-		/// </summary>
-		public string DeploymentMode
-		{
-			get { return GetFilter<string>(DeploymentModeField); }
-			set { SetFilter(DeploymentModeField, value); }
-		}
-	}
+        /// <summary>
+        /// Gets or sets the deploymentMode filter.
+        /// </summary>
+        public string DeploymentMode
+        {
+            get { return GetFilter<string>(DeploymentModeField); }
+            set { SetFilter(DeploymentModeField, value); }
+        }
+
+        /// <summary>
+        /// Identifies Virtual Listeners by their name.
+        /// </summary>
+        public string TagValue
+        {
+            get
+            {
+                var tag = string.IsNullOrEmpty(TagKeyName) ? TagIdField + TagKeyId : TagField + TagKeyName;
+                return GetFilter<string>(tag);
+            }
+            set
+            {
+                var tag = string.IsNullOrEmpty(TagKeyName) ? TagIdField + TagKeyId : TagField + TagKeyName;
+                SetFilter(tag, value);
+            }
+        }
+    }
 }


If a FireAndForget thread terminates with an exception, then catch and log rather than letting it terminate the simulator.

Exceptions don't appear to do this with the SmartThreadPool but they do with UnsafeQueueUserWorkItem (and maybe others)

--- OpenSim/Framework/Util.cs
+++ OpenSim/Framework/Util.cs
@@ -1508,7 +1508,21 @@
             // When OpenSim interacts with a database or sends data over the wire, it must send this in en_US culture
             // so that we don't encounter problems where, for instance, data is saved with a culture that uses commas
             // for decimals places but is read by a culture that treats commas as number seperators.
-            WaitCallback realCallback = delegate(object o) { Culture.SetCurrentCulture(); callback(o); };
+            WaitCallback realCallback = delegate(object o)
+            {
+                Culture.SetCurrentCulture();
+
+                try
+                {
+                    callback(o);
+                }
+                catch (Exception e)
+                {
+                    m_log.ErrorFormat(
+                        "[UTIL]: Continuing after async_call_method thread terminated with exception {0}{1}",
+                        e.Message, e.StackTrace);
+                }
+            };

             switch (FireAndForgetMethod)
             {


去掉不使用输出

去掉不使用输出


add distortion model for T265 fisheye image

--- wrappers/csharp/Intel.RealSense/Types/Enums/Distortion.cs
+++ wrappers/csharp/Intel.RealSense/Types/Enums/Distortion.cs
@@ -21,6 +21,10 @@
         Ftheta = 3,

         ///  Unmodified Brown-Conrady distortion model
-        BrownConrady = 4,
+        BrownConrady = 4,
+
+        /// <summary Four parameter Kannala Brandt distortion model
+        KannalaBrandt4 = 5,
+
     }
 }


Fix a crash happening when the team is received before the map

--- PROProtocol/GameClient.cs
+++ PROProtocol/GameClient.cs
@@ -604,6 +604,9 @@
                 // DSSock.loadMap
                 SendPacket("-");
                 SendPacket("k|.|" + MapName.ToLowerInvariant());
+
+                CanUseCut = HasCutAbility();
+                CanUseSmashRock = HasRockSmashAbility();
             }
             else
             {
@@ -740,7 +743,7 @@
                     OnNpcDestroy(data);
                     break;
                 case "#":
-                    OnPokemonsUpdate(data);
+                    OnTeamUpdate(data);
                     break;
                 case "d":
                     OnInventoryUpdate(data);
@@ -935,12 +938,12 @@
             }
         }

-        private void OnPokemonsUpdate(string[] data)
-        {
-            string[] pokemonsData = data[1].Split(new[] { "\r\n" }, StringSplitOptions.None);
+        private void OnTeamUpdate(string[] data)
+        {
+            string[] teamData = data[1].Split(new[] { "\r\n" }, StringSplitOptions.None);

             Team.Clear();
-            foreach (string pokemon in pokemonsData)
+            foreach (string pokemon in teamData)
             {
                 if (pokemon == string.Empty)
                     continue;
@@ -949,8 +952,12 @@

                 Team.Add(new Pokemon(pokemonData));
             }
-            CanUseCut = HasCutAbility();
-            CanUseSmashRock = HasRockSmashAbility();
+
+            if (IsInitialized)
+            {
+                CanUseCut = HasCutAbility();
+                CanUseSmashRock = HasRockSmashAbility();
+            }

             if (_swapTimeout.IsActive)
             {


Please don't make a commit to make a point.

--- KerbalFuture/Superluminal/SpaceFolder/SpaceFolderDriveVesselModule.cs
+++ KerbalFuture/Superluminal/SpaceFolder/SpaceFolderDriveVesselModule.cs
@@ -113,12 +113,12 @@
 			{
 				return new List<SpaceFolderDriveData>();
 			}
-			List<SpaceFolderDriveData> noticeMeSenpai = new List<SpaceFolderDriveData>();
+			List<SpaceFolderDriveData> returnList = new List<SpaceFolderDriveData>();
 			foreach(Part p in SFDOnVessel(v))
 			{
-				noticeMeSenpai.Add(PartSFDData(p));
+				returnList.Add(PartSFDData(p));
 			}
-			return noticeMeSenpai;
+			return returnList;
 		}
 		//Calculates the amount of main resource used
 		private double MainResourceWarpCalc(double diameter, double multiplier)