Shouldly in TransientTestFolder

Shouldly in TransientTestFolder

--- src/Shared/UnitTests/TestEnvironment.cs
+++ src/Shared/UnitTests/TestEnvironment.cs
@@ -612,12 +612,11 @@
         {
             // Basic checks to make sure we're not deleting something very obviously wrong (e.g.
             // the entire temp drive).
-            Assert.NotNull(Path);
-            Assert.NotEqual(string.Empty, Path);
-            Assert.NotEqual(@"\", Path);
-            Assert.NotEqual(@"/", Path);
-            Assert.NotEqual(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath()), System.IO.Path.GetFullPath(Path));
-            Assert.True(System.IO.Path.IsPathRooted(Path));
+            Path.ShouldNotBeNullOrEmpty();
+            Path.ShouldNotBe(@"\");
+            Path.ShouldNotBe(@"/");
+            System.IO.Path.GetFullPath(Path).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath()));
+            System.IO.Path.IsPathRooted(Path).ShouldBeTrue(() => $"{Path} is not rooted");

             FileUtilities.DeleteDirectoryNoThrow(Path, true);
         }


Wait for interaction after dataset validation

Added switch for nonblocking calls also.

--- src/Spectre.DataValidatorApp/Program.cs
+++ src/Spectre.DataValidatorApp/Program.cs
@@ -14,9 +14,9 @@
         /// <param name="args">The command line arguments.</param>
         public static void Main(string[] args)
         {
-            if (args.Length != 1)
+            if ((args.Length != 1) || ((args.Length == 2) && (args[1] != "--nonblocking")))
             {
-                Console.Write(value: $"Usage: {AppDomain.CurrentDomain.FriendlyName} path_to_data_file");
+                Console.Write(value: $"Usage: {AppDomain.CurrentDomain.FriendlyName} path_to_data_file [--nonblocking]");
             }
             else
             {
@@ -31,6 +31,10 @@
                     Console.WriteLine(value: "Validation failure.");
                 }
             }
+            if (args.Length == 1)
+            {
+                Console.ReadLine();
+            }
         }
     }
 }


Fix tests

Fix tests

--- src/EditorFeatures/CSharpTest/Formatting/CodeCleanupTests.cs
+++ src/EditorFeatures/CSharpTest/Formatting/CodeCleanupTests.cs
@@ -563,8 +563,8 @@
             var expectedNumberOfUnsupportedDiagnosticIds =
                 language switch
                 {
-                    LanguageNames.CSharp => 35,
-                    LanguageNames.VisualBasic => 72,
+                    LanguageNames.CSharp => 36,
+                    LanguageNames.VisualBasic => 73,
                     _ => throw ExceptionUtilities.UnexpectedValue(language),
                 };


obsolete the old control.

obsolete the old control.

--- src/Avalonia.ReactiveUI/TransitioningContentControl.cs
+++ src/Avalonia.ReactiveUI/TransitioningContentControl.cs
@@ -10,6 +10,7 @@
     /// <summary>
     /// A ContentControl that animates the transition when its content is changed.
     /// </summary>
+    [Obsolete("Use TransitioningContentControl in Avalonia.Controls namespace")]
     public class TransitioningContentControl : ContentControl, IStyleable
     {
         /// <summary>


wps version change

wps version change

--- Terradue.Tep/Terradue/Tep/Controller/Service/WpsJob.cs
+++ Terradue.Tep/Terradue/Tep/Controller/Service/WpsJob.cs
@@ -604,11 +604,11 @@

             Uri describeUri = new Uri(providerUrl + "?service=WPS" +
                                           "&request=DescribeProcess" +
-                                      "&version=" + process.Version +
+                                      "&version=" + provider.WPSVersion +
                                           "&identifier=" + identifier);
             Uri executeUri = new Uri(providerUrl + "?service=WPS" +
                                          "&request=Execute" +
-                                     "&version=" + process.Version +
+                                     "&version=" + provider.WPSVersion +
                                          "&identifier=" + identifier);

             //getcapabilities


refactor

refactor

--- src/Cap.Consistency/Store/ConsistencyMessageManager.cs
+++ src/Cap.Consistency/Store/ConsistencyMessageManager.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Threading;
 using System.Threading.Tasks;
+using Cap.Consistency.Infrastructure;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
@@ -11,7 +12,7 @@
     /// Provides the APIs for managing message in a persistence store.
     /// </summary>
     /// <typeparam name="TMessage">The type encapsulating a message.</typeparam>
-    public class ConsistencyMessageManager<TMessage> : IDisposable where TMessage : class
+    public class ConsistencyMessageManager<TMessage> : IDisposable where TMessage : ConsistencyMessage
     {
         private bool _disposed;
         private readonly HttpContext _context;
@@ -63,6 +64,9 @@
         public virtual Task<OperateResult> CreateAsync(TMessage message) {
             ThrowIfDisposed();
             //todo: validation message fileds is correct
+
+
+

             return Store.CreateAsync(message, CancellationToken);
         }


Ignore case for hints

Ignore case for hints

--- src/FlubuCore/Infrastructure/Terminal/ConsoleHintedOutput.cs
+++ src/FlubuCore/Infrastructure/Terminal/ConsoleHintedOutput.cs
@@ -304,7 +304,7 @@
                 _suggestionsForUserInput = null;
                 return;
             }
-
+#if NETSTANDARD1_6
             //simple case then user's input is equal to start of hint
             var hints = hintSource
                 .Where(item => item.Length > lastInput.Length && item.Substring(0, lastInput.Length) == lastInput)
@@ -314,13 +314,29 @@
                     HighlightIndexes = Enumerable.Range(0, lastInput.Length).ToArray()
                 })
                 .ToList();
+#else
+            //simple case then user's input is equal to start of hint
+            var hints = hintSource
+                .Where(item => item.Length > lastInput.Length && item.Substring(0, lastInput.Length).Equals(lastInput, StringComparison.OrdinalIgnoreCase))
+                .Select(hint => new Suggestion
+                {
+                    Value = hint,
+                    HighlightIndexes = Enumerable.Range(0, lastInput.Length).ToArray()
+                })
+                .ToList();
+#endif

             //more complex case: tokenize hint and try to search user input from beginning of tokens
             foreach (var item in hintSource)
             {
                 var parts = item.Split(new[] { ' ', ';', '-', '_' }, StringSplitOptions.RemoveEmptyEntries);

-                var candidate = parts.FirstOrDefault(part => part.Length >= lastInput.Length && part.Substring(0, lastInput.Length) == lastInput);
+                string candidate;
+             #if NETSTANDARD1_6
+                candidate = parts.FirstOrDefault(part => part.Length >= lastInput.Length && part.Substring(0, lastInput.Length) == lastInput);
+             #else
+                candidate = parts.FirstOrDefault(part => part.Length >= lastInput.Length && part.Substring(0, lastInput.Length).Equals(lastInput, StringComparison.InvariantCultureIgnoreCase));
+             #endif
                 if (candidate != null)
                 {
                     hints.Add(new Suggestion
@@ -347,7 +363,11 @@
                     }

                     var substring = item.Substring(startIndex);
+#if NETSTANDARD1_6
                     var idx = substring.IndexOf(lastInput[i]);
+#else
+                    var idx = substring.IndexOf(lastInput[i].ToString(), StringComparison.OrdinalIgnoreCase);
+ #endif
                     if (idx < 0)
                     {
                         //no such symbol in the hints source item


Use Raw field when detecting JavaProxyThrowable

--- Mindscape.Raygun4Net.Xamarin.Android/RaygunClient.cs
+++ Mindscape.Raygun4Net.Xamarin.Android/RaygunClient.cs
@@ -794,20 +794,20 @@
       RaygunErrorStackTraceLineMessage[] stackTrace = e.Message?.Details?.Error.StackTrace;
       if (stackTrace != null && stackTrace.Length > 1)
       {
-        string firstLineFileName = stackTrace[0].FileName;
+        string firstLine = stackTrace[0].Raw;
         if (
-          firstLineFileName != null &&
+          firstLine != null &&
           (
-            // Older Xamarin versions (pre Xamarin.Android 6.1?)
-            firstLineFileName.Contains("--- End of managed exception stack trace ---") ||
+            // Older Xamarin versions (pre Xamarin.Android 6.1)
+            firstLine.Contains("--- End of managed exception stack trace ---") ||
             // More recent Xamarin versions
-            firstLineFileName.Contains($"--- End of managed {e.Message.Details.Error.ClassName} stack trace ---")
+            firstLine.Contains($"--- End of managed {e.Message.Details.Error.ClassName} stack trace ---")
           )
         )
         {
           foreach (RaygunErrorStackTraceLineMessage line in stackTrace.Skip(1))
           {
-            if (line.FileName != null && line.FileName.Contains("JavaProxyThrowable"))
+            if (line.Raw != null && !line.Raw.StartsWith("at ") && line.Raw.Contains("JavaProxyThrowable"))
             {
               // Reaching this point means the exception is wrapping a managed exception that has already been sent.
               // Such exception does not contain any additional useful information, and so is a waste to send it.


Add hashrate data to MyRentalsRecord class

--- MiningRigRentalsApi/ObjectModel/MyRentalsResponse.cs
+++ MiningRigRentalsApi/ObjectModel/MyRentalsResponse.cs
@@ -24,5 +24,32 @@
 		public DateTime starttime;
 		public string status;
 		public double vailable_in_hours;
+		public MyRentalsHashrateAdvertised advertised;
+		public MyRentalsHashrateCurrent current;
+		public MyRentalsHashrateAverage average;
 	}
+
+	public class MyRentalsHashrateAdvertised
+	{
+		public string hashrate_nice;
+		public ulong hashrate;
+	}
+
+	public class  MyRentalsHashrateCurrent
+	{
+		public double hash_5m;
+		public string hash_5m_nice;
+		public double hash_30m;
+		public string hash_30m_nice;
+		public double hash_1h;
+		public string hash_1h_nice;
+	}
+
+	public class MyRentalsHashrateAverage
+	{
+		public double hashrate;
+		public string hashrate_nice;
+		public double percent;
+	}
+
 }


Fixed ActionSelector

Fixed ActionSelector

--- src/Taskever/Taskever.WebSpa/Api/Test.cs
+++ src/Taskever/Taskever.WebSpa/Api/Test.cs
@@ -87,11 +87,6 @@
                 IHttpRouteData routeData = request.GetRouteData();
                 if (routeData != null)
                 {
-                    if (routeData.Route.RouteTemplate == "")
-                    {
-
-                    }
-
                     string serviceName;
                     if (routeData.Values.TryGetValue("serviceName", out serviceName))
                     {


Update

Update

--- wpf/ComboBoxMVVM/ComboBoxMVVM/MainWindowViewModel.cs
+++ wpf/ComboBoxMVVM/ComboBoxMVVM/MainWindowViewModel.cs
@@ -33,7 +33,10 @@
         public Int64 Province
         {
             get { return ViewModel.SingleOptX.GetID(this.ProvinceOptArr); }
-            set { ViewModel.SingleOptX.SetID(this.ProvinceOptArr, value); NotifyPropertyChanged("Province");}
+            set {
+                ViewModel.SingleOptX.SetID(this.ProvinceOptArr, value);
+                NotifyPropertyChanged("Province"); // NOTE: for ComboBox, it needs to be "notified" manually.
+            }
         }
         public ObservableCollection<ViewModel.SingleOpt> ProvinceOptArr { get; set; }


Steam test commands

Steam test commands

--- StardewValleyMP/MultiplayerMod.cs
+++ StardewValleyMP/MultiplayerMod.cs
@@ -4,6 +4,7 @@
 using StardewValley;
 using StardewValley.Menus;
 using StardewValleyMP.Vanilla;
+using Steamworks;
 using System;
 using System.Reflection;

@@ -28,6 +29,8 @@
             ControlEvents.KeyboardChanged += onKeyboardChange;
             //GraphicsEvents.DrawDebug += Multiplayer.drawNetworkingDebug;

+            Helper.ConsoleCommands.Add("steam", "", steamtest);
+
             if (DEBUG)
             {
                 a = Assembly.GetAssembly(typeof(StardewValley.Game1));
@@ -119,5 +122,91 @@
                 Log.error("Exception during keyboard change: " + e);
             }
         }
+
+        private static Callback<P2PSessionRequest_t> sessReq;
+        public static void steamtest( string str, string[] args )
+        {
+            if (args.Length == 0) return;
+
+            try
+            {
+                if (args[0] == "init")
+                {
+                    try
+                    {
+                        bool b = SteamAPI.InitSafe();
+                        if (b) Log.info("Steamworks initialized");
+                        else Log.error("Failed to initialize steamworks");
+                    }
+                    catch (Exception e)
+                    {
+                        Log.error("Exception during steamworks initialization: " + e.Message);
+                    }
+                }
+                else if (args[0] == "id")
+                {
+                    Log.info("Steam user ID: " + SteamUser.GetSteamID());
+                }
+                else if (args[0] == "listen")
+                {
+                    sessReq = Callback<P2PSessionRequest_t>.Create(sessReqFunc);
+                }
+                else if (args[0] == "accept" && args.Length == 2)
+                {
+                    CSteamID req = args[1] == "self" ? SteamUser.GetSteamID() : new CSteamID(ulong.Parse(args[1]));
+                    bool b = SteamNetworking.AcceptP2PSessionWithUser(req);
+                    if (b) Log.info("Successfully accepted p2p session with " + req);
+                    else Log.error("Failed to accept session.");
+                }
+                else if (args[0] == "send" && args.Length >= 3)
+                {
+                    CSteamID to = args[1] == "self" ? SteamUser.GetSteamID() : new CSteamID(ulong.Parse(args[1]));
+
+                    String[] args_ = new String[args.Length - 2];
+                    Array.Copy(args, 2, args_, 0, args.Length - 2);
+                    string msg = String.Join(" ", args_);
+
+                    byte[] bytes = new byte[msg.Length * sizeof(char)];
+                    System.Buffer.BlockCopy(msg.ToCharArray(), 0, bytes, 0, bytes.Length);
+
+                    bool b = SteamNetworking.SendP2PPacket(to, bytes, (uint)bytes.Length, EP2PSend.k_EP2PSendReliable);
+                    if (b) Log.info("Successfully sent \"" + msg + "\" to " + to);
+                    else Log.error("Failed to send packet.");
+                }
+                else if (args[0] == "receive")
+                {
+                    uint size;
+                    while (SteamNetworking.IsP2PPacketAvailable(out size))
+                    {
+                        CSteamID from;
+                        byte[] buffer = new byte[size];
+                        uint read;
+
+                        if (SteamNetworking.ReadP2PPacket(buffer, size, out read, out from))
+                        {
+                            char[] chars = new char[read / sizeof(char)];
+                            Buffer.BlockCopy(buffer, 0, chars, 0, (int)read);
+
+                            Log.info("Received " + read + " bytes from " + from + ": ");
+                            Log.info(new string(chars));
+                        }
+                        else
+                        {
+                            Log.error("Failed to receive packet.");
+                        }
+                    }
+                }
+            }
+            catch ( Exception e )
+            {
+                Log.error("Exception in steam command: " + e.Message);
+            }
+        }
+
+        private static void sessReqFunc( P2PSessionRequest_t req )
+        {
+            CSteamID other = req.m_steamIDRemote;
+            Log.info("Session request from " + other);
+        }
     }
 }


Improve OnTradeOfferUpdated mimick OnNewTradeOffer

OnNewTradeOffer previously was fired when tradeoffers came in that were active.
Before this commint, outgoing and incoming offers that were already accepted showed up in this event.

--- SteamBot/TradeOfferUserHandler.cs
+++ SteamBot/TradeOfferUserHandler.cs
@@ -13,7 +13,7 @@

         public override void OnTradeOfferUpdated(TradeOffer offer)
         {
-            if(offer.OfferState == TradeOfferState.TradeOfferStateAccepted)
+            if(offer.OfferState == TradeOfferState.TradeOfferStateActive && !offer.IsOurOffer)
             {
                 OnNewTradeOffer(offer);
             }


Removed remnants of reportprogress testing causing a crash

--- SteamMaster/SteamUI/SteamTheme.cs
+++ SteamMaster/SteamUI/SteamTheme.cs
@@ -305,7 +305,6 @@
                 {
                     GenerateGameList();
                         //For testing purposes GenerateGameList can be called instead of the RecommendButtomClick delegate
-                    bgWorker.ReportProgress(100);
                 };
                 bgWorker.RunWorkerCompleted += (s, a) =>
                 {


Logging MoveWindow calls to debug resizing issues

git-svn-id: 44b358d4e2542483730fa9c9041adfb707708c43@51 8d6e282c-8220-11de-b77e-d9b456c0130a

--- SuperPutty/ctlApplicationPanel.cs
+++ SuperPutty/ctlApplicationPanel.cs
@@ -1249,7 +1249,10 @@
                 // if not minimizing
                 if (this.Height > 0 && this.Width > 0)
                 {
-                    //Log.DebugFormat("MoveWindow: w={0}, h={1}, visible={2}", this.Width, this.Height, this.Visible);
+                    if (Log.IsDebugEnabled)
+                    {
+                        Log.DebugFormat("MoveWindow: w={0}, h={1}, visible={2}", this.Width, this.Height, this.Visible);
+                    }
                     MoveWindow(m_AppWin, 0, 0, this.Width, this.Height, true);
                 }
             }


git-svn-id: svn://localhost/mosa@750 45b04e34-05f1-4d87-a130-40a8491d5c8b

--- Mosa/Platforms/x86/LongOperandTransformationStage.cs
+++ Mosa/Platforms/x86/LongOperandTransformationStage.cs
@@ -219,7 +219,7 @@
 		/// <param name="instruction">The instruction.</param>
 		private void ExpandDiv(Context ctx, IL.DivInstruction instruction)
 		{
-			BasicBlock[] blocks = CreateEmptyBlocks(7);
+			BasicBlock[] blocks = CreateEmptyBlocks(8);
 			BasicBlock nextBlock = SplitBlock(ctx, instruction, blocks[0]);

 			SigType I4 = new SigType(CilElementType.I4);
@@ -251,14 +251,14 @@
 			// sbb     eax,0
 			// mov     HIWORD(DVND),eax ; save positive value
 			// mov     LOWORD(DVND),edx
-			Replace(ctx, new Instruction[] {
+			blocks[0].Instructions.AddRange(new Instruction[] {
                 new IR.PushInstruction(edi),
                 new IR.PushInstruction(esi),
                 new IR.PushInstruction(ebx),
                 new Instructions.LogicalXorInstruction(edi, edi),
                 new Instructions.MoveInstruction(eax, op1H),
                 new Instructions.LogicalOrInstruction(eax, eax),
-                new IR.BranchInstruction(IR.ConditionCode.GreaterOrEqual, blocks[0].Label),
+                new IR.BranchInstruction(IR.ConditionCode.GreaterOrEqual, blocks[1].Label),
                 new Instructions.IncInstruction(edi),
                 new Instructions.MoveInstruction(edx, op1L),
                 new Instructions.NegInstruction(eax),
@@ -280,10 +280,10 @@
 			// sbb     eax,0
 			// mov     HIWORD(DVSR),eax ; save positive value
 			// mov     LOWORD(DVSR),edx
-			blocks[0].Instructions.AddRange(new Instruction[] {
+			blocks[1].Instructions.AddRange(new Instruction[] {
                 new Instructions.MoveInstruction(eax, op2H),
                 new Instructions.LogicalOrInstruction(eax, eax),
-                new IR.BranchInstruction(IR.ConditionCode.GreaterOrEqual, blocks[1].Label),
+                new IR.BranchInstruction(IR.ConditionCode.GreaterOrEqual, blocks[2].Label),
                 new Instructions.IncInstruction(edi),
                 new Instructions.MoveInstruction(edx, op2L),
                 new Instructions.NegInstruction(eax),
@@ -291,7 +291,7 @@
                 new Instructions.SbbInstruction(eax, new ConstantOperand(I4, 0)),
                 new Instructions.MoveInstruction(op2H, eax),
                 new Instructions.MoveInstruction(op2L, edx),
-				new IR.JmpInstruction(blocks[1].Label),
+				new IR.JmpInstruction(blocks[2].Label),
             });

 			// L2:
@@ -315,9 +315,9 @@
 			// div     ecx             ; eax <- low order bits of quotient
 			// mov     edx,ebx         ; edx:eax <- quotient
 			// jmp     short L4        ; set sign, restore stack and return
-			blocks[1].Instructions.AddRange(new Instruction[] {
+			blocks[2].Instructions.AddRange(new Instruction[] {
                 new Instructions.LogicalOrInstruction(eax, eax),
-                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[2].Label),
+                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[3].Label),
                 new Instructions.MoveInstruction(ecx, op2L),
                 new Instructions.MoveInstruction(eax, op1H),
                 new Instructions.LogicalXorInstruction(edx, edx),
@@ -326,7 +326,7 @@
                 new Instructions.MoveInstruction(eax, op1L),
                 new Instructions.UDivInstruction(eax, ecx),
                 new Instructions.MoveInstruction(edx, ebx),
-                new IR.JmpInstruction(blocks[6].Label)
+                new IR.JmpInstruction(blocks[7].Label)
             });
 			;
 			// Here we do it the hard way.  Remember, eax contains the high word of DVSR
@@ -336,7 +336,7 @@
 			//        mov     ecx,LOWORD(DVSR)
 			//        mov     edx,HIWORD(DVND) ; edx:eax <- dividend
 			//        mov     eax,LOWORD(DVND)
-			blocks[2].Instructions.AddRange(new Instruction[] {
+			blocks[3].Instructions.AddRange(new Instruction[] {
                 new Instructions.MoveInstruction(ebx, eax),
                 new Instructions.MoveInstruction(ecx, op2L),
                 new Instructions.MoveInstruction(edx, op1H),
@@ -369,13 +369,13 @@
 			// mul     esi             ; QUOT * LOWORD(DVSR)
 			// add     edx,ecx         ; EDX:EAX = QUOT * DVSR
 			// jc      short L6        ; carry means Quotient is off by 1
-			blocks[3].Instructions.AddRange(new Instruction[] {
+			blocks[4].Instructions.AddRange(new Instruction[] {
                 new Instructions.ShrInstruction(ebx, new ConstantOperand(U1, 1)),
                 new Instructions.RcrInstruction(ecx, new ConstantOperand(U1, 1)), // RCR
                 new Instructions.ShrInstruction(edx, new ConstantOperand(U1, 1)),
                 new Instructions.RcrInstruction(eax, new ConstantOperand(U1, 1)),
                 new Instructions.LogicalOrInstruction(ebx, ebx),
-                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[3].Label),
+                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[4].Label),
                 new Instructions.UDivInstruction(eax, ecx),
                 new Instructions.MoveInstruction(esi, eax),
                 new x86.Instructions.MulInstruction(eax, op2H),
@@ -385,25 +385,25 @@
                 new x86.Instructions.MulInstruction(eax, esi),
                 //new IL.MulInstruction(IL.OpCode.Mul, eax, eax, esi),
                 new Instructions.AddInstruction(edx, ecx),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[4].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[5].Label),
                 new Instructions.CmpInstruction(edx, op1H),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedGreaterThan, blocks[4].Label),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[5].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedGreaterThan, blocks[5].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[6].Label),
                 new Instructions.CmpInstruction(eax, op1L),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessOrEqual, blocks[5].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessOrEqual, blocks[6].Label),
             });

 			// L6:
-			blocks[4].Instructions.AddRange(new Instruction[] {
+			blocks[5].Instructions.AddRange(new Instruction[] {
                 new Instructions.DecInstruction(esi),
-				new IR.JmpInstruction(blocks[5].Label),
+				new IR.JmpInstruction(blocks[6].Label),
             });

 			// L7:
-			blocks[5].Instructions.AddRange(new Instruction[] {
+			blocks[6].Instructions.AddRange(new Instruction[] {
                 new Instructions.LogicalXorInstruction(edx, edx),
                 new Instructions.MoveInstruction(eax, esi),
-				new IR.JmpInstruction(blocks[6].Label),
+				new IR.JmpInstruction(blocks[7].Label),
             });

 			;
@@ -416,7 +416,7 @@
 			//        neg     edx             ; otherwise, negate the result
 			//        neg     eax
 			//        sbb     edx,0
-			blocks[6].Instructions.InsertRange(0, new Instruction[] {
+			blocks[7].Instructions.AddRange(new Instruction[] {
                 new Instructions.DecInstruction(edi),
                 new IR.BranchInstruction(IR.ConditionCode.NotEqual, nextBlock.Label),
                 new Instructions.NegInstruction(edx),
@@ -432,6 +432,8 @@
                 new IR.PopInstruction(esi),
                 new IR.PopInstruction(edi),
             });
+
+            Remove(ctx);

 			// Link the created blocks together
 			LinkBlocks(ctx.Block, blocks[0]);
@@ -697,7 +699,7 @@
 		/// <param name="instruction">The instruction.</param>
 		private void ExpandUDiv(Context ctx, IR.UDivInstruction instruction)
 		{
-			BasicBlock[] blocks = CreateEmptyBlocks(7);
+			BasicBlock[] blocks = CreateEmptyBlocks(5);
 			BasicBlock nextBlock = SplitBlock(ctx, instruction, blocks[0]);

 			SigType I4 = new SigType(CilElementType.I4);
@@ -715,13 +717,13 @@
 			RegisterOperand edi = new RegisterOperand(U4, GeneralPurposeRegister.EDI);
 			RegisterOperand esi = new RegisterOperand(U4, GeneralPurposeRegister.ESI);

-			Replace(ctx, new Instruction[] {
+			blocks[0].Instructions.AddRange(new Instruction[] {
                 new IR.PushInstruction(edi),
                 new IR.PushInstruction(esi),
                 new IR.PushInstruction(ebx),
                 new Instructions.MoveInstruction(eax, op2H),
                 new Instructions.LogicalOrInstruction(eax, eax),
-                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[0].Label),
+                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[1].Label),
                 new Instructions.MoveInstruction(ecx, op2L),
                 new Instructions.MoveInstruction(eax, op1H),
                 new Instructions.LogicalXorInstruction(edx, edx),
@@ -734,7 +736,7 @@
             });

 			// L1
-			blocks[0].Instructions.AddRange(new Instruction[] {
+			blocks[1].Instructions.AddRange(new Instruction[] {
                 new Instructions.MoveInstruction(ecx, eax),
                 new Instructions.MoveInstruction(ebx, op2L),
                 new Instructions.MoveInstruction(edx, op1H),
@@ -743,13 +745,13 @@
 			});

 			// L3
-			blocks[1].Instructions.AddRange(new Instruction[] {
+			blocks[2].Instructions.AddRange(new Instruction[] {
                 new Instructions.ShrInstruction(ecx, new ConstantOperand(U1, 1)),
                 new Instructions.RcrInstruction(ebx, new ConstantOperand(U1, 1)), // RCR
                 new Instructions.ShrInstruction(edx, new ConstantOperand(U1, 1)),
                 new Instructions.RcrInstruction(eax, new ConstantOperand(U1, 1)),
                 new Instructions.LogicalOrInstruction(ecx, ecx),
-                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[1].Label),
+                new IR.BranchInstruction(IR.ConditionCode.NotEqual, blocks[2].Label),
                 new Instructions.UDivInstruction(eax, ebx),
                 new Instructions.MoveInstruction(esi, eax),
                 new IL.MulInstruction(IL.OpCode.Mul, eax, eax, op2H),
@@ -757,23 +759,23 @@
                 new Instructions.MoveInstruction(eax, op2L),
                 new IL.MulInstruction(IL.OpCode.Mul, eax, eax, esi),
                 new Instructions.AddInstruction(edx, ecx),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[2].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[3].Label),
                 new Instructions.CmpInstruction(edx, op1H),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedGreaterThan, blocks[2].Label),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[3].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedGreaterThan, blocks[3].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessThan, blocks[4].Label),
                 new Instructions.CmpInstruction(eax, op1L),
-                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessOrEqual, blocks[3].Label),
+                new IR.BranchInstruction(IR.ConditionCode.UnsignedLessOrEqual, blocks[4].Label),
+				new IR.JmpInstruction(blocks[3].Label),
+            });
+
+			// L4:
+			blocks[3].Instructions.AddRange(new Instruction[] {
+                new Instructions.DecInstruction(esi),
 				new IR.JmpInstruction(blocks[4].Label),
-            });
-
-			// L4:
-			blocks[2].Instructions.AddRange(new Instruction[] {
-                new Instructions.DecInstruction(esi),
-				new IR.JmpInstruction(blocks[3].Label),
 			});

 			// L5
-			blocks[3].Instructions.AddRange(new Instruction[] {
+			blocks[4].Instructions.AddRange(new Instruction[] {
                 new Instructions.LogicalXorInstruction(edx, edx),
                 new Instructions.MoveInstruction(eax, esi),
 				new IR.JmpInstruction(nextBlock.Label),
@@ -787,6 +789,8 @@
                 new IR.PopInstruction(esi),
                 new IR.PopInstruction(edi),
             });
+
+            Remove(ctx);

 			// Link the created blocks together
 			LinkBlocks(ctx.Block, blocks[0]);
@@ -1639,7 +1643,6 @@
                     new IR.BranchInstruction(IR.ConditionCode.Equal, blocks[1].Label),
                     // Branch if check already gave results
                     new IR.BranchInstruction(GetHighCondition(code), blocks[3].Label),
-					new IR.JmpInstruction(blocks[1].Label),
                 });
 				blocks[1].Instructions.AddRange(new Instruction[] {
                     // Compare low dwords
@@ -1649,10 +1652,10 @@
                     new IR.JmpInstruction(blocks[3].Label),
                 });
 				blocks[2].Instructions.AddRange(new Instruction[] {
-                    new IR.JmpInstruction(targets[0]),
+                    new IR.JmpInstruction(targets[1]),
                 });
 				blocks[3].Instructions.AddRange(new Instruction[] {
-                    new IR.JmpInstruction(targets[1]),
+                    new IR.JmpInstruction(targets[2]),
                 });
 			}
 			else {
@@ -1680,8 +1683,8 @@
 			Remove(ctx);

 			LinkBlocks(blocks[1], blocks[2]);
+			LinkBlocks(blocks[2], blocks[3]);
 			LinkBlocks(blocks[1], blocks[3]);
-			LinkBlocks(blocks[2], blocks[3]);
 		}

 		/// <summary>


Fixed bug where gui would freeze on exit if not ran first

--- FrontEndUIRedux/MainWindow.xaml.cs
+++ FrontEndUIRedux/MainWindow.xaml.cs
@@ -45,10 +45,18 @@
         /// <param name="e">event arguments</param>
         private void MainWindow_Closing(object sender, CancelEventArgs e)
         {
-            guiClient.stop();
-            guiClient.start();
-            guiClient.write.WriteLine("Stop");
-            guiClient.stop();
+            try {
+                try
+                {
+                    guiClient.stop();
+                }
+                catch (Exception) { }
+                finally {
+                    guiClient.start();
+                    guiClient.write.WriteLine("Stop");
+                    guiClient.stop(); }
+            }
+            catch (Exception) { }
         }


A Fix. Was too hasty.

A Fix. Was too hasty.

--- yafsrc/YetAnotherForum.NET/controls/PollList.ascx.cs
+++ yafsrc/YetAnotherForum.NET/controls/PollList.ascx.cs
@@ -222,7 +222,7 @@
                }*/

             bool existingPoll = (PollGroupId > 0) && ((TopicId > 0) || (ForumId > 0) || (BoardId > 0));
-            NewPollRow.Visible = HasOwnerExistingGroupAccess() && (!existingPoll);
+            NewPollRow.Visible = HasOwnerExistingGroupAccess() && existingPoll;
                 if (PollGroupId > 0)
                 {
                     BindData();
@@ -628,10 +628,16 @@
                 }
                 else
                 {
-                    if ((!isClosedBound && (isNotVoted || PageContext.BoardSettings.AllowUsersViewPollVotesBefore)) || (isClosedBound && isPollClosed))
+                    if (!isClosedBound && PageContext.BoardSettings.AllowUsersViewPollVotesBefore)
                     {
                         _showResults = true;
                     }
+                }
+
+                // The poll expired. We show results
+                if (isClosedBound && isPollClosed)
+                {
+                    _showResults = true;
                 }

                 polloll.DataBind();


order by name

order by name

--- Launcher/MainForm.cs
+++ Launcher/MainForm.cs
@@ -85,6 +85,7 @@
                     forms.Add(type);
                 }
             }
+            forms.OrderBy(t => ((MainFormAttribute)t.GetCustomAttributes(typeof(MainFormAttribute), false)[0]).Name);
             return forms.ToArray();
         }


ProviderConfigurationSectionTests: Check provider specific config.

--- test/ExRam.Gremlinq.Core.AspNet.Tests/ProviderConfigurationSectionTests.cs
+++ test/ExRam.Gremlinq.Core.AspNet.Tests/ProviderConfigurationSectionTests.cs
@@ -1,5 +1,6 @@
-using ExRam.Gremlinq.Providers.Core;
+using System.Collections.Generic;

+using ExRam.Gremlinq.Providers.Core;
 using FluentAssertions;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
@@ -14,31 +15,61 @@

         }

+        private readonly IProviderConfigurationSection _section;
+
         public ProviderConfigurationSectionTests() : base()
-        {
-
-        }
-
-        [Fact]
-        public void Indexer_can_be_null()
         {
             var serviceCollection = new ServiceCollection()
                 .AddSingleton<IConfiguration>(new ConfigurationBuilder()
-                    .AddInMemoryCollection()
-                    .Build())
+                .AddInMemoryCollection(new Dictionary<string, string>
+                    {
+                        { "Gremlinq:Gremlinq_key_1", "value1" },
+                        { "Gremlinq:Gremlinq_key_2", "value2" },
+
+                        { "Gremlinq:Provider1:Provider1_key_1", "provider1_value1" },
+                        { "Gremlinq:Provider1:Provider1_key_2", "provider1_value2" },
+
+                        { "Gremlinq:Provider2:Provider2_key_1", "provider2_value1" },
+                        { "Gremlinq:Provider2:Provider2_key_2", "provider2_value2" }
+                   })
+                   .Build())
                 .AddGremlinq(s => s
                     .UseProvider<IMyProviderConfigurator>(
-                        "Provider",
+                        "Provider1",
                         (source, _) => source
                             .ConfigureEnvironment(_ => _),
                         setup => { },
                         default!))
                 .BuildServiceProvider();

-            var section = serviceCollection
+            _section = serviceCollection
                 .GetRequiredService<IProviderConfigurationSection>();
+        }

-            section["Key"]
+        [Fact]
+        public void Indexer_can_be_null()
+        {
+            _section["Key"]
+                .Should()
+                .BeNull();
+        }
+
+        [Fact]
+        public void Provider_config()
+        {
+            _section["Provider1_key_1"]
+                .Should()
+                .Be("provider1_value1");
+
+            _section["Provider1_key_2"]
+                .Should()
+                .Be("provider1_value2");
+
+            _section["Provider2_key_1"]
+              .Should()
+              .BeNull();
+
+            _section["Provider2_key_2"]
                 .Should()
                 .BeNull();
         }


Added failing test for #1171.

Added failing test for #1171.

--- tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/SceneBuilderTests.cs
+++ tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/SceneBuilderTests.cs
@@ -143,13 +143,61 @@

                 var borderNode = scene.FindNode(border);
                 Assert.Equal(new Rect(50, 50, 50, 50), borderNode.ClipBounds);
-
-                // Initial ClipBounds are correct, make sure they're still correct after updating border.
+            }
+        }
+
+        [Fact]
+        public void Should_Update_Descendent_ClipBounds_When_Margin_Changed()
+        {
+            using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface))
+            {
+                Border border;
+                Canvas canvas;
+                var tree = new TestRoot
+                {
+                    Width = 200,
+                    Height = 300,
+                    Child = canvas = new Canvas
+                    {
+                        ClipToBounds = true,
+                        Width = 100,
+                        Height = 100,
+                        HorizontalAlignment = HorizontalAlignment.Left,
+                        VerticalAlignment = VerticalAlignment.Top,
+                        Children =
+                        {
+                            (border = new Border
+                            {
+                                Background = Brushes.AliceBlue,
+                                Width = 100,
+                                Height = 100,
+                                [Canvas.LeftProperty] = 50,
+                                [Canvas.TopProperty] = 50,
+                            })
+                        }
+                    }
+                };
+
+                tree.Measure(Size.Infinity);
+                tree.Arrange(new Rect(tree.DesiredSize));
+
+                var scene = new Scene(tree);
+                var sceneBuilder = new SceneBuilder();
+                sceneBuilder.UpdateAll(scene);
+
+                var borderNode = scene.FindNode(border);
+                Assert.Equal(new Rect(50, 50, 50, 50), borderNode.ClipBounds);
+
+                canvas.Width = canvas.Height = 125;
+                canvas.Measure(Size.Infinity);
+                canvas.Arrange(new Rect(tree.DesiredSize));
+
+                // Initial ClipBounds are correct, make sure they're still correct after updating canvas.
                 scene = scene.Clone();
-                Assert.True(sceneBuilder.Update(scene, border));
+                Assert.True(sceneBuilder.Update(scene, canvas));

                 borderNode = scene.FindNode(border);
-                Assert.Equal(new Rect(50, 50, 50, 50), borderNode.ClipBounds);
+                Assert.Equal(new Rect(50, 50, 75, 75), borderNode.ClipBounds);
             }
         }


JWK kty field returns Unknown key type if not parsable

--- src/THNETII.Security.JOSE/JsonWebKey.cs
+++ src/THNETII.Security.JOSE/JsonWebKey.cs
@@ -27,7 +27,7 @@

         private readonly Tuple<string, JsonWebKeyType> lockKty;
         private readonly DuplexConversionTuple<string, JsonWebKeyType> kty =
-            new DuplexConversionTuple<string, JsonWebKeyType>(EnumStringConverter<JsonWebKeyType>.Parse, EnumStringConverter<JsonWebKeyType>.ToString);
+            new DuplexConversionTuple<string, JsonWebKeyType>(EnumStringConverter<JsonWebKeyType>.ParseOrDefault, EnumStringConverter<JsonWebKeyType>.ToString);

         /// <summary>
         /// The "kty" (key type) parameter identifies the cryptographic algorithm


Indentation fixes

Indentation fixes

--- TETCSharpClient/GazeApiManager.cs
+++ TETCSharpClient/GazeApiManager.cs
@@ -40,9 +40,9 @@
         #region Public methods

         public bool Connect()
-	    {
-		    return Connect(GazeApiSettings.Host, GazeApiSettings.Port);
-	    }
+      {
+        return Connect(GazeApiSettings.Host, GazeApiSettings.Port);
+      }

         public bool Connect(string host, int port)
         {
@@ -67,46 +67,46 @@
             }
             return true;
         }
-
-	    public void Close()
-	    {
-		    try
-		    {
-			    if(null != incomingStreamHandler)
-				    incomingStreamHandler.Stop();
-
-			    if(null != outgoingStreamHandler)
-                    outgoingStreamHandler.Stop();
-
-			    if(null != socket)
-				    socket.Close();
-
-                if (null != requestQueue)
-                    requestQueue.Clear();
-		    }
-		    catch (Exception e)
-		    {
-                Debug.WriteLine("Error closing socket: " + e.Message);
-		    }
-	    }
-
-	    public bool IsConnected()
-	    {
-		    if(null != socket)
-			    return socket.Connected;
-
-		    return false;
-	    }
-
-	    protected void Request(string request)
-	    {
+
+      public void Close()
+      {
+        try
+        {
+            if(null != incomingStreamHandler)
+                incomingStreamHandler.Stop();
+
+            if(null != outgoingStreamHandler)
+                outgoingStreamHandler.Stop();
+
+            if(null != socket)
+                socket.Close();
+
+            if (null != requestQueue)
+                requestQueue.Clear();
+        }
+        catch (Exception e)
+        {
+            Debug.WriteLine("Error closing socket: " + e.Message);
+        }
+      }
+
+      public bool IsConnected()
+      {
+        if(null != socket)
+            return socket.Connected;
+
+        return false;
+      }
+
+      protected void Request(string request)
+      {
             lock (((ICollection)requestQueue).SyncRoot)
             {
                 requestQueue.Enqueue(request);
                 //Signal Event that queue is populated
                 outEvent.GetUpdateHandle().Set();
             }
-	    }
+      }

         public void RequestTracker(GazeManager.ClientMode mode, int version)
         {
@@ -123,18 +123,18 @@
             TrackerGetRequest gr = new TrackerGetRequest();

             gr.Values = new[]
-			{
-				Protocol.TRACKER_HEARTBEATINTERVAL,
-				Protocol.TRACKER_ISCALIBRATED,
-				Protocol.TRACKER_ISCALIBRATING,
-				Protocol.TRACKER_VERSION,
-				Protocol.TRACKER_SCREEN_INDEX,
+            {
+                Protocol.TRACKER_HEARTBEATINTERVAL,
+                Protocol.TRACKER_ISCALIBRATED,
+                Protocol.TRACKER_ISCALIBRATING,
+                Protocol.TRACKER_VERSION,
+                Protocol.TRACKER_SCREEN_INDEX,
                 Protocol.TRACKER_SCREEN_RESOLUTION_WIDTH,
                 Protocol.TRACKER_SCREEN_RESOLUTION_HEIGHT,
                 Protocol.TRACKER_SCREEN_PHYSICAL_WIDTH,
                 Protocol.TRACKER_SCREEN_PHYSICAL_HEIGHT,
-				Protocol.TRACKER_MODE_PUSH
-			};
+                Protocol.TRACKER_MODE_PUSH
+            };

             Request(JsonConvert.SerializeObject(gr));
         }
@@ -144,10 +144,10 @@
             TrackerGetRequest gr = new TrackerGetRequest();

             gr.Values = new[]
-			{
-				Protocol.TRACKER_ISCALIBRATED,
-				Protocol.TRACKER_ISCALIBRATING
-			};
+            {
+                Protocol.TRACKER_ISCALIBRATED,
+                Protocol.TRACKER_ISCALIBRATING
+            };

             Request(JsonConvert.SerializeObject(gr));
         }
@@ -157,13 +157,13 @@
             TrackerGetRequest gr = new TrackerGetRequest();

             gr.Values = new[]
-			{
-				Protocol.TRACKER_SCREEN_INDEX,
+            {
+                Protocol.TRACKER_SCREEN_INDEX,
                 Protocol.TRACKER_SCREEN_RESOLUTION_WIDTH,
                 Protocol.TRACKER_SCREEN_RESOLUTION_HEIGHT,
                 Protocol.TRACKER_SCREEN_PHYSICAL_WIDTH,
                 Protocol.TRACKER_SCREEN_PHYSICAL_HEIGHT
-			};
+            };

             Request(JsonConvert.SerializeObject(gr));
         }


Add codeanalysis attribute

Add codeanalysis attribute

--- osu.Game/Utils/ModUtils.cs
+++ osu.Game/Utils/ModUtils.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using osu.Game.Rulesets.Mods;

@@ -45,7 +46,7 @@
         /// <param name="combination">The <see cref="Mod"/> combination to check.</param>
         /// <param name="invalidMods">Any invalid mods in the set.</param>
         /// <returns>Whether all <see cref="Mod"/>s in the combination are compatible with each-other.</returns>
-        public static bool CheckCompatibleSet(IEnumerable<Mod> combination, out List<Mod>? invalidMods)
+        public static bool CheckCompatibleSet(IEnumerable<Mod> combination, [NotNullWhen(false)] out List<Mod>? invalidMods)
         {
             combination = FlattenMods(combination).ToArray();
             invalidMods = null;


ResettablePropertyGrid: Inject custom WinForms type editors

--- src/Common.WinForms/Controls/ResettablePropertyGrid.cs
+++ src/Common.WinForms/Controls/ResettablePropertyGrid.cs
@@ -21,9 +21,13 @@
  */

 using System;
+using System.ComponentModel;
+using System.Drawing.Design;
 using System.Security.Permissions;
 using System.Windows.Forms;
+using NanoByte.Common.Collections;
 using NanoByte.Common.Properties;
+using NanoByte.Common.Values.Design;

 namespace NanoByte.Common.Controls
 {
@@ -32,6 +36,13 @@
     /// </summary>
     public class ResettablePropertyGrid : PropertyGrid
     {
+        static ResettablePropertyGrid()
+        {
+            // Inject custom WinForms type editors
+            TypeDescriptor.AddAttributes(typeof(TimeSpan), new EditorAttribute(typeof(TimeSpanEditor), typeof(UITypeEditor)));
+            TypeDescriptor.AddAttributes(typeof(LanguageSet), new EditorAttribute(typeof(LanguageSetEditor), typeof(UITypeEditor)));
+        }
+
         private readonly ToolStripMenuItem _menuReset = new ToolStripMenuItem {Text = Resources.ResetValue};

         public ResettablePropertyGrid()


Verify that we do not box for integer "is constant" Fixes #12813

--- src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs
+++ src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs
@@ -774,5 +774,30 @@
   IL_0019:  ret
 }");
         }
-    }
-}
+
+        [Fact, WorkItem(12813, "https://github.com/dotnet/roslyn/issues/12813")]
+        public void NoBoxingOnIntegerConstantPattern()
+        {
+            var source =
+@"public class C
+{
+    static bool M1(int x)
+    {
+        return x is 42;
+    }
+}";
+            var compilation = CreateCompilation(source, options: TestOptions.ReleaseDll);
+            compilation.VerifyDiagnostics();
+            var compVerifier = CompileAndVerify(compilation);
+            compVerifier.VerifyIL("C.M1",
+@"{
+  // Code size        6 (0x6)
+  .maxstack  2
+  IL_0000:  ldc.i4.s   42
+  IL_0002:  ldarg.0
+  IL_0003:  ceq
+  IL_0005:  ret
+}");
+        }
+    }
+}


CORS for API

CORS for API

--- src/WebHost/Startup.cs
+++ src/WebHost/Startup.cs
@@ -27,16 +27,15 @@
             // container
             var container = configureIoC(app, httpConfigurations);

+            // enable CORS for entire application
+            app.UseCors(CorsOptions.AllowAll);
+
             // SignalR routes
-            app.Map("/signalr", map =>
+            app.MapSignalR("/signalr", new HubConfiguration
             {
-                map.UseCors(CorsOptions.AllowAll);
-                map.RunSignalR(new HubConfiguration
-                {
-                    EnableJavaScriptProxies = true,
-                    EnableDetailedErrors = false,
-                    Resolver = new AutofacDependencyResolver(container)
-                });
+                EnableJavaScriptProxies = true,
+                EnableDetailedErrors = false,
+                Resolver = new AutofacDependencyResolver(container)
             });

             // enable web api and configure serialization of JSON


Use the dirty rect from BeginPaint on WM_PAINT.

The one returned by `GetUpdateRect` at this point will be empty, from
the win32 docs:

> BeginPaint automatically validates the update region, so any call to
GetUpdateRect made immediately after the call to BeginPaint retrieves an
empty update region.

--- src/Windows/Avalonia.Win32/WindowImpl.cs
+++ src/Windows/Avalonia.Win32/WindowImpl.cs
@@ -572,9 +572,8 @@

                     if (UnmanagedMethods.BeginPaint(_hwnd, out ps) != IntPtr.Zero)
                     {
-                        UnmanagedMethods.RECT r;
-                        UnmanagedMethods.GetUpdateRect(_hwnd, out r, false);
                         var f = Scaling;
+                        var r = ps.rcPaint;
                         Paint?.Invoke(new Rect(r.left / f, r.top / f, (r.right - r.left) / f, (r.bottom - r.top) / f));
                         UnmanagedMethods.EndPaint(_hwnd, ref ps);
                     }


Remove unused import

Remove unused import

--- src/ReadLine/KeyHandler.cs
+++ src/ReadLine/KeyHandler.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text;

 namespace ReadLine


Enable F_TRANSLUCENT blending

Enable F_TRANSLUCENT blending

--- GUI/Types/Renderer/MeshRenderer.cs
+++ GUI/Types/Renderer/MeshRenderer.cs
@@ -180,19 +180,21 @@
                 var alphaReference = call.Shader.GetUniformLocation("g_flAlphaTestReference");
                 GL.Uniform1(alphaReference, alpha);

-                /*
-                if (call.Material.IntParams.ContainsKey("F_TRANSLUCENT") && call.Material.IntParams["F_TRANSLUCENT"] == 1)
-                {
+                var disableBlend = false;
+
+                if (call.Material.Material.IntParams.ContainsKey("F_TRANSLUCENT") && call.Material.Material.IntParams["F_TRANSLUCENT"] == 1)
+                {
+                    disableBlend = true;
                     GL.Enable(EnableCap.Blend);
-                    GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
-                }
-                else
+                    GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
+                }
+
+                GL.DrawElements(call.PrimitiveType, call.IndexCount, call.IndiceType, (IntPtr)call.StartIndex);
+
+                if (disableBlend)
                 {
                     GL.Disable(EnableCap.Blend);
                 }
-                */
-
-                GL.DrawElements(call.PrimitiveType, call.IndexCount, call.IndiceType, (IntPtr)call.StartIndex);
             }

             GL.Disable(EnableCap.CullFace);


Revert "Possible fix for unending plasma fires (#6527)" (#6539)

This reverts commit 64f2da85600f52945b019991fa499d61c86db1b3.

--- UnityProject/Assets/Scripts/Tilemaps/Utils/TileList.cs
+++ UnityProject/Assets/Scripts/Tilemaps/Utils/TileList.cs
@@ -159,14 +159,7 @@
 		}

 		lockedPosition = localPosition;
-		List<RegisterTile> registerTiles = new List<RegisterTile>();
 		foreach (var registerTile in Get((Vector3Int)lockedPosition))
-		{
-			registerTiles.Add(registerTile);
-		}
-
-		//To prevent modifying collection while in the loop
-		foreach (RegisterTile registerTile in registerTiles)
 		{
 			action.Invoke(registerTile);
 		}


Add legacy option

Add legacy option

--- Unosquare.Labs.SshDeploy/Options/MonitorVerbOptions.cs
+++ Unosquare.Labs.SshDeploy/Options/MonitorVerbOptions.cs
@@ -8,6 +8,9 @@
     public class MonitorVerbOptions : PushVerbOptions
     {
         [ArgumentOption('m', "monitor", DefaultValue = "sshdeploy.ready", HelpText = "The command to run on the target machine", Required = false)]
-        public string MonitorFile { get; set; }
+        public string MonitorFile { get; set; }
+
+        [ArgumentOption('l', "legacy", DefaultValue = false, HelpText = "Monitor files using legacy method", Required = false)]
+        public bool Legacy { get; set; }
     }
 }


Add a test to ensure YamlNode.ToString() does not throw on infinitely recursive nodes

--- YamlDotNet.Test/RepresentationModel/YamlStreamTests.cs
+++ YamlDotNet.Test/RepresentationModel/YamlStreamTests.cs
@@ -52,13 +52,24 @@
             // of just on AllNodes because in debug mode, AllNodes
             // is accessed after the document loads to check for unresolved aliases...
             var loadAndAccessAllNodes = new Action(() =>
-                {
-                    var stream = new YamlStream();
-                    stream.Load(Yaml.ParserForText("&a [*a]"));
-                    var allNodes = stream.Documents.Single().AllNodes.ToList();
-                });
+            {
+                var stream = new YamlStream();
+                stream.Load(Yaml.ParserForText("&a [*a]"));
+                var allNodes = stream.Documents.Single().AllNodes.ToList();
+            });

             loadAndAccessAllNodes.ShouldThrow<MaximumRecursionLevelReachedException>("because the document is infinitely recursive.");
+        }
+
+        [Fact]
+        public void InfinitelyRecursiveNodeToStringSucceeds()
+        {
+            var stream = new YamlStream();
+            stream.Load(Yaml.ParserForText("&a [*a]"));
+
+            var toString = stream.Documents.Single().RootNode.ToString();
+
+            toString.Should().Contain(YamlNode.MaximumRecursionLevelReachedToStringValue);
         }

         [Fact]


Valid IsDevelopment condition

Valid IsDevelopment condition

--- devdays/Startup.cs
+++ devdays/Startup.cs
@@ -26,7 +26,7 @@

             app.UseMvc();

-            if (!env.IsDevelopment())
+            if (env.IsDevelopment())
             {
                app.UseDeveloperExceptionPage();
             }


remove unused import

remove unused import

--- Generators/DataServiceGenerator.cs
+++ Generators/DataServiceGenerator.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics.Eventing.Reader;
 using System.IO;
 using System.Linq;
 using System.Reflection;


Corrected a method.

Corrected a method.

--- Geta.EPi.Cms/QueryStringBuilder.cs
+++ Geta.EPi.Cms/QueryStringBuilder.cs
@@ -36,7 +36,8 @@

 		public QueryStringBuilder Toggle(string name, string value)
 		{
-			var exists = UrlBuilder.QueryCollection[name] != null;
+			var currVal = UrlBuilder.QueryCollection[name];
+			var exists = currVal != null && currVal == value;

 			if (exists)
 				UrlBuilder.QueryCollection.Remove(name);


Version 0.93

Version 0.93

--- GitMind/Properties/AssemblyInfo.cs
+++ GitMind/Properties/AssemblyInfo.cs
@@ -50,7 +50,7 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("0.92.*")]
+[assembly: AssemblyVersion("0.93.*")]

 [assembly: InternalsVisibleTo("GitMindTest")]


tab -> space

tab -> space

--- Gitter/ViewModels/RoomViewModel.cs
+++ Gitter/ViewModels/RoomViewModel.cs
@@ -13,20 +13,20 @@
             this.Room = room;
         }

-		public Uri UserAvatarSource
-		{
-			get
-			{
-				if (this.Room.user != null && this.Room.user.avatarUrlSmall != null)
-				{
-					return new Uri(this.Room.user.avatarUrlSmall);
-				}
+        public Uri UserAvatarSource
+        {
+            get
+            {
+                if (this.Room.user != null && this.Room.user.avatarUrlSmall != null)
+                {
+                    return new Uri(this.Room.user.avatarUrlSmall);
+                }

-				return null;
-			}
-		}
+                return null;
+            }
+        }

-		public string Id
+        public string Id
         {
             get { return this.Room.id; }
         }
@@ -36,10 +36,10 @@
             get { return this.Room.name; }
         }

-		public string Topic
-		{
-			get { return this.Room.topic; }
-		}
+        public string Topic
+        {
+            get { return this.Room.topic; }
+        }

         public Room Room { get; private set; }
     }


Requests for the root directory defers to index.html when present.

--- GnomeServer/IntegratedWebServer.cs
+++ GnomeServer/IntegratedWebServer.cs
@@ -204,49 +204,6 @@
             ServiceFileRequest(wwwroot, request, response);
         }

-        private static void ServiceFileRequest(String wwwroot, HttpListenerRequest request, HttpListenerResponse response)
-        {
-            var relativePath = request.Url.AbsolutePath.Substring(1);
-            relativePath = relativePath.Replace("/", Path.DirectorySeparatorChar.ToString());
-            var absolutePath = Path.Combine(wwwroot, relativePath);
-
-            LogMessage(String.Format("ServiceFileRequest: {0} ({1})", request.Url, absolutePath));
-
-            if (File.Exists(absolutePath))
-            {
-                var extension = Path.GetExtension(absolutePath);
-                response.ContentType = Apache.GetMime(extension);
-                response.StatusCode = 200; // HTTP 200 - SUCCESS
-
-                // Open file, read bytes into buffer and write them to the output stream.
-                using (FileStream fileReader = File.OpenRead(absolutePath))
-                {
-                    byte[] buffer = new byte[4096];
-                    int read;
-                    while ((read = fileReader.Read(buffer, 0, buffer.Length)) > 0)
-                    {
-                        response.OutputStream.Write(buffer, 0, read);
-                    }
-                }
-            }
-            else
-            {
-                String body = String.Format("No resource is available at the specified filepath: {0}", absolutePath);
-
-                IResponseFormatter notFoundResponseFormatter = new PlainTextResponseFormatter(body, HttpStatusCode.NotFound);
-                notFoundResponseFormatter.WriteContent(response);
-            }
-        }
-
-        /// <summary>
-        /// Searches all the assemblies in the current AppDomain for class definitions that implement the <see cref="IRequestHandler"/> interface.  Those classes are instantiated and registered as request handlers.
-        /// </summary>
-        private void RegisterHandlers()
-        {
-            IEnumerable<Type> handlers = FindHandlersInLoadedAssemblies();
-            RegisterHandlers(handlers);
-        }
-
         private void RegisterHandlers(IEnumerable<Type> handlers)
         {
             if (handlers == null) { return; }
@@ -353,6 +310,15 @@
         {
             if (request.Url.AbsolutePath.ToLower() == "/")
             {
+                var wwwroot = GetWebRoot();
+                var indexFile = "index.html";
+                var absolutePath = Path.Combine(wwwroot, indexFile);
+                if (File.Exists(absolutePath))
+                {
+                    // If an index.html file exists in the root, we won't service root requests any longer.
+                    return false;
+                }
+
                 List<String> links = new List<String>();
                 foreach (var requestHandler in this._requestHandlers.OrderBy(obj => obj.Priority))
                 {
@@ -392,6 +358,56 @@
             }

             return false;
+        }
+
+        private static void ServiceFileRequest(String wwwroot, HttpListenerRequest request, HttpListenerResponse response)
+        {
+            var relativePath = request.Url.AbsolutePath.Substring(1);
+            relativePath = relativePath.Replace("/", Path.DirectorySeparatorChar.ToString());
+
+            // Is the user requesting the default document for a root location?
+            if (String.IsNullOrWhiteSpace(relativePath))
+            {
+                // We'll use "index.html" to indicate this.
+                relativePath = "index.html";
+            }
+            var absolutePath = Path.Combine(wwwroot, relativePath);
+
+            LogMessage(String.Format("ServiceFileRequest: {0} ({1})", request.Url, absolutePath));
+
+            if (File.Exists(absolutePath))
+            {
+                var extension = Path.GetExtension(absolutePath);
+                response.ContentType = Apache.GetMime(extension);
+                response.StatusCode = 200; // HTTP 200 - SUCCESS
+
+                // Open file, read bytes into buffer and write them to the output stream.
+                using (FileStream fileReader = File.OpenRead(absolutePath))
+                {
+                    byte[] buffer = new byte[4096];
+                    int read;
+                    while ((read = fileReader.Read(buffer, 0, buffer.Length)) > 0)
+                    {
+                        response.OutputStream.Write(buffer, 0, read);
+                    }
+                }
+            }
+            else
+            {
+                String body = String.Format("No resource is available at the specified filepath: {0}", absolutePath);
+
+                IResponseFormatter notFoundResponseFormatter = new PlainTextResponseFormatter(body, HttpStatusCode.NotFound);
+                notFoundResponseFormatter.WriteContent(response);
+            }
+        }
+
+        /// <summary>
+        /// Searches all the assemblies in the current AppDomain for class definitions that implement the <see cref="IRequestHandler"/> interface.  Those classes are instantiated and registered as request handlers.
+        /// </summary>
+        private void RegisterHandlers()
+        {
+            IEnumerable<Type> handlers = FindHandlersInLoadedAssemblies();
+            RegisterHandlers(handlers);
         }

         #endregion Reserved Endpoint Handlers


EmitDynamicMethod with obj

EmitDynamicMethod with obj

--- GrEmit/GrEmit/Utils/EmitHelpers.cs
+++ GrEmit/GrEmit/Utils/EmitHelpers.cs
@@ -36,6 +36,19 @@
             var dynamicMethod = new DynamicMethod(name, methodInfo.ReturnType, GetParameterTypes(methodInfo.GetParameters()), m, true);
             emitCode(new GroboIL(dynamicMethod));
             return CreateDelegate<T>(dynamicMethod);
+        }
+
+        public static T EmitDynamicMethod<T>(string name, Module m, Action<GroboIL> emitCode, object target) where T : class
+        {
+            Type delegateType = typeof(T);
+            //HACK
+            MethodInfo methodInfo = delegateType.GetMethod("Invoke", BindingFlags.Public | BindingFlags.Instance);
+            if(methodInfo == null)
+                throw new ArgumentException(String.Format("Type {0} not a Delegate", delegateType));
+
+            var dynamicMethod = new DynamicMethod(name, methodInfo.ReturnType, GetParameterTypes(methodInfo.GetParameters()), m, true);
+            emitCode(new GroboIL(dynamicMethod));
+            return CreateDelegate<T>(dynamicMethod, target);
         }

         public static Type[] GetParameterTypes(ParameterInfo[] parameters)


better commenting

better commenting

--- src/Tools/Github/GitMergeBot/Program.cs
+++ src/Tools/Github/GitMergeBot/Program.cs
@@ -88,7 +88,7 @@
             // pullRequest could be null if we are running in debug mode.
             if (pullRequest != null)
             {
-                await CommentOnIssue(_options.SourceUser, _options.RepoName, pullRequest.Number, "@dotnet-bot test vsi please");
+                await _client.Issue.Comment.Create(_options.SourceUser, _options.RepoName, pullRequest.Number, "@dotnet-bot test vsi please");
             }
             return;
         }
@@ -148,20 +148,6 @@
             }

             return branchName;
-        }
-
-        private async Task CommentOnIssue(string user, string repo, int issueNumber, string message)
-        {
-                var resp = await _client.Connection.Post<string>(
-                    uri: new Uri($"https://api.github.com/repos/{user}/{repo}/issues/{issueNumber}/comments"),
-                    body: $"{{\"body\": \"{message}\"}}",
-                    accepts: "*/*",
-                    contentType: "application/json");
-                var statusCode = resp.HttpResponse.StatusCode;
-                if (statusCode != HttpStatusCode.Created)
-                {
-                    throw new Exception($"Failed commenting on issue {issueNumber} on {user}/{repo} with code {statusCode}");
-                }
         }

         /// <summary>


Upped the assembly version

Upped the assembly version

--- src/Torshify/Properties/AssemblyInfo.cs
+++ src/Torshify/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.7.0.0")]
-[assembly: AssemblyFileVersion("0.7.0.0")]
+[assembly: AssemblyVersion("0.8.0.0")]
+[assembly: AssemblyFileVersion("0.8.0.0")]


Fixed compilation error

Fixed compilation error

--- NadekoBot.Core/Modules/Gambling/WebMiningCommands.cs
+++ NadekoBot.Core/Modules/Gambling/WebMiningCommands.cs
@@ -1,4 +1,5 @@
-using NadekoBot.Core.Modules.Gambling.Services;
+#if GLOBAL_NADEKO
+using NadekoBot.Core.Modules.Gambling.Services;

 namespace NadekoBot.Modules.Gambling
 {
@@ -10,3 +11,4 @@
         }
     }
 }
+#endif


move TODO to the right place

move TODO to the right place

--- Octokit.Tests.Integration/RepositoriesClientTests.cs
+++ Octokit.Tests.Integration/RepositoriesClientTests.cs
@@ -194,8 +194,6 @@
                 var repository = await github.Repository.Get(github.Credentials.Login, repoName);
                 Assert.Equal(repoName, repository.Name);
             }
-
-            // TODO: Add a test for the team_id param once an overload that takes an oranization is added
         }

         public class TheCreateMethodForOrganization
@@ -226,6 +224,8 @@
                 Assert.True(repository.HasWiki);
                 Assert.Null(repository.Homepage);
             }
+
+            // TODO: Add a test for the team_id param once an overload that takes an oranization is added
         }

         public class TheGetAsyncMethod


corrected endless loop in GroupsV2 Connector Cache

--- OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs
+++ OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs
@@ -142,13 +142,22 @@
                 if (firstCall)
                 {
                     //group = m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName);
-                    group = d();
-
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, group, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (ExtendedGroupRecord)group;
+                    try
+                    {
+                        group = d();
+
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, group, GROUPS_CACHE_TIMEOUT);
+                            return (ExtendedGroupRecord)group;
+                        }
+                    }
+                    finally
+                    {
+                        lock (m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -240,13 +249,22 @@

                 if (firstCall)
                 {
-                    membership = d();
-
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (ExtendedGroupMembershipData)membership;
+                    try
+                    {
+                        membership = d();
+
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
+                            return (ExtendedGroupMembershipData)membership;
+                        }
+                    }
+                    finally
+                    {
+                        lock (m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -283,12 +301,21 @@

                 if (firstCall)
                 {
-                    membership = d();
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (ExtendedGroupMembershipData)membership;
+                    try
+                    {
+                        membership = d();
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
+                            return (ExtendedGroupMembershipData)membership;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -324,12 +351,21 @@

                 if (firstCall)
                 {
-                    memberships = d();
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (List<GroupMembershipData>)memberships;
+                    try
+                    {
+                        memberships = d();
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT);
+                            return (List<GroupMembershipData>)memberships;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -365,12 +401,21 @@

                 if (firstCall)
                 {
-                    memberships = d();
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (List<GroupMembershipData>)memberships;
+                    try
+                    {
+                        memberships = d();
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT);
+                            return (List<GroupMembershipData>)memberships;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -407,20 +452,29 @@

                 if (firstCall)
                 {
-                    List<ExtendedGroupMembersData> _members = d();
-
-                    if (_members != null && _members.Count > 0)
-                        members = _members.ConvertAll<GroupMembersData>(new Converter<ExtendedGroupMembersData, GroupMembersData>(m_ForeignImporter.ConvertGroupMembersData));
-                    else
-                        members = new List<GroupMembersData>();
-
-                    lock (m_Cache)
-                    {
-                        //m_Cache.AddOrUpdate(cacheKey, members, GROUPS_CACHE_TIMEOUT);
-                        m_Cache.AddOrUpdate(cacheKey, _members, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-
-                        return (List<GroupMembersData>)members;
+                    try
+                    {
+                        List<ExtendedGroupMembersData> _members = d();
+
+                        if (_members != null && _members.Count > 0)
+                            members = _members.ConvertAll<GroupMembersData>(new Converter<ExtendedGroupMembersData, GroupMembersData>(m_ForeignImporter.ConvertGroupMembersData));
+                        else
+                            members = new List<GroupMembersData>();
+
+                        lock (m_Cache)
+                        {
+                            //m_Cache.AddOrUpdate(cacheKey, members, GROUPS_CACHE_TIMEOUT);
+                            m_Cache.AddOrUpdate(cacheKey, _members, GROUPS_CACHE_TIMEOUT);
+
+                            return (List<GroupMembersData>)members;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -535,14 +589,23 @@

                 if (firstCall)
                 {
-                    roles = d();
-                    if (roles != null)
-                    {
-                        lock (m_Cache)
-                        {
-                            m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT);
-                            m_ActiveRequests.Remove(cacheKey);
-                            return (List<GroupRolesData>)roles;
+                    try
+                    {
+                        roles = d();
+                        if (roles != null)
+                        {
+                            lock (m_Cache)
+                            {
+                                m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT);
+                                return (List<GroupRolesData>)roles;
+                            }
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
                         }
                     }
                 }
@@ -579,23 +642,32 @@

                 if (firstCall)
                 {
-                    List<ExtendedGroupRoleMembersData> _rmembers = d();
-
-                    if (_rmembers != null && _rmembers.Count > 0)
-                        rmembers = _rmembers.ConvertAll<GroupRoleMembersData>(new Converter<ExtendedGroupRoleMembersData, GroupRoleMembersData>(m_ForeignImporter.ConvertGroupRoleMembersData));
-                    else
-                        rmembers = new List<GroupRoleMembersData>();
-
-                    lock (m_Cache)
-                    {
-                        // For some strange reason, when I cache the list of GroupRoleMembersData,
-                        // it gets emptied out. The TryGet gets an empty list...
-                        //m_Cache.AddOrUpdate(cacheKey, rmembers, GROUPS_CACHE_TIMEOUT);
-                        // Caching the list of ExtendedGroupRoleMembersData doesn't show that issue
-                        // I don't get it.
-                        m_Cache.AddOrUpdate(cacheKey, _rmembers, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (List<GroupRoleMembersData>)rmembers;
+                    try
+                    {
+                        List<ExtendedGroupRoleMembersData> _rmembers = d();
+
+                        if (_rmembers != null && _rmembers.Count > 0)
+                            rmembers = _rmembers.ConvertAll<GroupRoleMembersData>(new Converter<ExtendedGroupRoleMembersData, GroupRoleMembersData>(m_ForeignImporter.ConvertGroupRoleMembersData));
+                        else
+                            rmembers = new List<GroupRoleMembersData>();
+
+                        lock (m_Cache)
+                        {
+                            // For some strange reason, when I cache the list of GroupRoleMembersData,
+                            // it gets emptied out. The TryGet gets an empty list...
+                            //m_Cache.AddOrUpdate(cacheKey, rmembers, GROUPS_CACHE_TIMEOUT);
+                            // Caching the list of ExtendedGroupRoleMembersData doesn't show that issue
+                            // I don't get it.
+                            m_Cache.AddOrUpdate(cacheKey, _rmembers, GROUPS_CACHE_TIMEOUT);
+                            return (List<GroupRoleMembersData>)rmembers;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -704,12 +776,21 @@

                 if (firstCall)
                 {
-                    roles = d();
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (List<GroupRolesData>)roles;
+                    try
+                    {
+                        roles = d();
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT);
+                            return (List<GroupRolesData>)roles;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -805,13 +886,22 @@

                 if (firstCall)
                 {
-                    GroupNoticeInfo _notice = d();
-
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, _notice, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return _notice;
+                    try
+                    {
+                        GroupNoticeInfo _notice = d();
+
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, _notice, GROUPS_CACHE_TIMEOUT);
+                            return _notice;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else
@@ -847,13 +937,22 @@

                 if (firstCall)
                 {
-                    notices = d();
-
-                    lock (m_Cache)
-                    {
-                        m_Cache.AddOrUpdate(cacheKey, notices, GROUPS_CACHE_TIMEOUT);
-                        m_ActiveRequests.Remove(cacheKey);
-                        return (List<ExtendedGroupNoticeData>)notices;
+                    try
+                    {
+                        notices = d();
+
+                        lock (m_Cache)
+                        {
+                            m_Cache.AddOrUpdate(cacheKey, notices, GROUPS_CACHE_TIMEOUT);
+                            return (List<ExtendedGroupNoticeData>)notices;
+                        }
+                    }
+                    finally
+                    {
+                        lock(m_Cache)
+                        {
+                            m_ActiveRequests.Remove(cacheKey);
+                        }
                     }
                 }
                 else


Remove a console debug output

Remove a console debug output

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -6252,7 +6252,7 @@
                         break;
                     case PacketType.DirPlacesQuery:
                         DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack;
-                        Console.WriteLine(dirPlacesQueryPacket.ToString());
+                        //Console.WriteLine(dirPlacesQueryPacket.ToString());

                         handlerDirPlacesQuery = OnDirPlacesQuery;
                         if (handlerDirPlacesQuery != null)


Show when appearance is sent to an avatar to help track down failure \to display avatars

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3427,6 +3427,7 @@

             avp.Sender.IsTrial = false;
             avp.Sender.ID = agentID;
+            m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
             OutPacket(avp, ThrottleOutPacketType.Task);
         }


Added IOException handling on the socket

--- M2Mqtt/MqttClient.cs
+++ M2Mqtt/MqttClient.cs
@@ -50,6 +50,7 @@
 // alias needed due to Microsoft.SPOT.Trace in .Net Micro Framework
 // (it's ambiguos with uPLibrary.Networking.M2Mqtt.Utility.Trace)
 using MqttUtility = uPLibrary.Networking.M2Mqtt.Utility;
+using System.IO;

 namespace uPLibrary.Networking.M2Mqtt
 {
@@ -1608,7 +1609,7 @@
                                 (ex.ErrorCode == MqttClientErrorCode.InvalidConnectFlags));
                     }
 #if !(WINDOWS_APP || WINDOWS_PHONE_APP)
-                    else if ((e.GetType() == typeof(SocketException)) ||
+                    else if ((e.GetType() == typeof(IOException)) || (e.GetType() == typeof(SocketException)) ||
                              ((e.InnerException != null) && (e.InnerException.GetType() == typeof(SocketException)))) // added for SSL/TLS incoming connection that use SslStream that wraps SocketException
                     {
                         close = true;


Make release notes button visible in test app

Change-Id: Iaec6a9ac2ae1c1fe3b6c27d24b6023d0c30a2f05

--- PalasoUIWindowsForms.TestApp/TestAppForm.Designer.cs
+++ PalasoUIWindowsForms.TestApp/TestAppForm.Designer.cs
@@ -125,7 +125,7 @@
 			// label1
 			//
 			this.label1.AutoSize = true;
-			this.label1.Location = new System.Drawing.Point(13, 216);
+			this.label1.Location = new System.Drawing.Point(12, 246);
 			this.label1.Name = "label1";
 			this.label1.Size = new System.Drawing.Size(149, 13);
 			superToolTipInfo1.BackgroundGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
@@ -147,7 +147,7 @@
 			//
 			// btnMetaDataEditor
 			//
-			this.btnMetaDataEditor.Location = new System.Drawing.Point(12, 186);
+			this.btnMetaDataEditor.Location = new System.Drawing.Point(12, 214);
 			this.btnMetaDataEditor.Name = "btnMetaDataEditor";
 			this.btnMetaDataEditor.Size = new System.Drawing.Size(157, 23);
 			this.btnMetaDataEditor.TabIndex = 0;
@@ -169,7 +169,7 @@
 			//
 			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
 			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-			this.ClientSize = new System.Drawing.Size(284, 262);
+			this.ClientSize = new System.Drawing.Size(187, 268);
 			this.Controls.Add(this._silAboutBoxGecko);
 			this.Controls.Add(this.label1);
 			this.Controls.Add(this.btnMetaDataEditor);


Bugfix for issue WS-55

Bugfix for issue WS-55

Windows line ending issue with the default
text for testing the sort rules in the
WeSay configuration Tool.

--- PalasoUIWindowsForms/WritingSystems/WSSortControl.cs
+++ PalasoUIWindowsForms/WritingSystems/WSSortControl.cs
@@ -37,11 +37,8 @@
 			_defaultFontSize = _sortRulesTextBox.Font.SizeInPoints;

 			// default text for testing the sort rules
-			_testSortText.Text = @"pear
-apple
-orange
-mango
-peach";
+			// default text for testing the sort rules; bug fix for WS-55 so all platforms have the right line ending
+			_testSortText.Text = String.Join(Environment.NewLine, new string[] { "pear", "apple", "orange", "mango", "peach" });
 		}

 		public void BindToModel(WritingSystemSetupModel model)


Update to index workflows

Update to index workflows

--- PsISEProjectExplorer/Services/PowershellTokenizer.cs
+++ PsISEProjectExplorer/Services/PowershellTokenizer.cs
@@ -79,7 +79,7 @@
                 else if (token.Type == PSTokenType.Keyword)
                 {
                     string tokenContent = token.Content.ToLowerInvariant();
-                    if (tokenContent == "function" || tokenContent == "filter" || tokenContent == "configuration")
+                    if (tokenContent == "function" || tokenContent == "filter" || tokenContent == "configuration" || tokenContent == "workflow")
                     {
                         nextTokenIsFunctionName = true;
                     }


Adding Author information

Adding Author information

--- RS485AVRBootloader.Loader/Properties/AssemblyInfo.cs
+++ RS485AVRBootloader.Loader/Properties/AssemblyInfo.cs
@@ -8,9 +8,9 @@
 [assembly: AssemblyTitle("SerialAVRBootloader.Loader")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Mateusz Świetlicki")]
 [assembly: AssemblyProduct("SerialAVRBootloader.Loader")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyCopyright("Copyright © Mateusz Świetlicki 2014")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Fix buffer with overlap

Fix buffer with overlap

--- Reactive4.NET/operators/FlowableBufferSizeOverlap.cs
+++ Reactive4.NET/operators/FlowableBufferSizeOverlap.cs
@@ -175,9 +175,8 @@

             public void Request(long n)
             {
-                if (SubscriptionHelper.Validate(n))
+                if (!SubscriptionHelper.PostCompleteMultiRequest(actual, ref requested, queue, n, ref cancelled))
                 {
-                    SubscriptionHelper.AddRequest(ref requested, n);
                     long u = SubscriptionHelper.MultiplyCap(n, size - skip);
                     if (Volatile.Read(ref once) == 0 && Interlocked.CompareExchange(ref once, 1, 0) == 0)
                     {


385 Scheduler.SubmitJob() should be done off the UI thread 	Queue submission onto the thread pool

--- Release/Product/Python/Hpc/HpcSupport/HpcLauncher.cs
+++ Release/Product/Python/Hpc/HpcSupport/HpcLauncher.cs
@@ -763,17 +763,20 @@
                 scheduler.SetInterfaceMode(false, owner);
             }

-            try {
-                scheduler.SubmitJob(job, null, null);
-            } catch (Exception ex) {
-                string msg;
-                msg = "Failed to submit job " + ex.ToString();
-                if (pane != null) {
-                    pane.OutputString(msg);
-                } else {
-                    MessageBox.Show(msg, "Python Tools for Visual Studio");
-                }
-            }
+
+            ThreadPool.QueueUserWorkItem(x => {
+                try {
+                    scheduler.SubmitJob(job, null, null);
+                } catch (Exception ex) {
+                    string msg;
+                    msg = "Failed to submit job " + ex.ToString();
+                    if (pane != null) {
+                        pane.OutputString(msg);
+                    } else {
+                        MessageBox.Show(msg, "Python Tools for Visual Studio");
+                    }
+                }
+            });
         }

         private static Process LaunchRedirectedToVsOutputWindow(ProcessStartInfo info, bool reportExit = true) {


Add method to return Department object by it's identifier

--- src/Diploms.WebUI/Controllers/DepartmentsController.cs
+++ src/Diploms.WebUI/Controllers/DepartmentsController.cs
@@ -21,6 +21,17 @@
         public async Task<IActionResult> GetDepartments()
         {
             return Ok(await _repository.Get());
+        }
+
+        [HttpGet("{id:int}")]
+        public async Task<IActionResult> GetDepartment(int id)
+        {
+            var result = await _repository.Get(id);
+            if (result != null)
+            {
+                return Ok(result);
+            }
+            return NotFound();
         }

         [HttpPut("add")]


Heading level on editable title

Heading level on editable title

--- src/Framework/N2/Details/WithEditableTitleAttribute.cs
+++ src/Framework/N2/Details/WithEditableTitleAttribute.cs
@@ -22,7 +22,7 @@
         /// </summary>
         public WithEditableTitleAttribute()
             : this("Title", -20)
-        {
+        {
         }

         /// <summary>
@@ -42,7 +42,9 @@
             set { focus = value; }
         }

-        public string CssClass { get; set; }
+        public string CssClass { get; set; }
+
+		public int HeadingLevel { get; set; }

         public override bool UpdateItem(ContentItem item, Control editor)
         {
@@ -79,17 +81,17 @@
             object value = item[propertyName];
             if (value != null)
             {
-                int headingLevel = item.IsPage ? 1 : 2;
-            writer.Write("<h");
-            writer.Write(headingLevel);
-            if(CssClass != null)
-                writer.Write(" class='" + CssClass + "'");
-            writer.Write(">");
-                writer.Write(value);
-            writer.Write("</h");
-            writer.Write(headingLevel);
-            writer.Write(">");
-        }
+                int headingLevel = HeadingLevel > 0 ? HeadingLevel : item.IsPage ? 1 : 2;
+				writer.Write("<h");
+				writer.Write(headingLevel);
+				if(CssClass != null)
+					writer.Write(" class='" + CssClass + "'");
+				writer.Write(">");
+					writer.Write(value);
+				writer.Write("</h");
+				writer.Write(headingLevel);
+				writer.Write(">");
+			}
         }

         #endregion
@@ -103,7 +105,7 @@
             {
                 var heading = new Hn
                 {
-                    Level = item.IsPage ? 1 : 2,
+                    Level = HeadingLevel > 0 ? HeadingLevel : item.IsPage ? 1 : 2,
                     Text = value.ToString(),
                     CssClass = CssClass
                 };


Fixed broken test.

Fixed broken test.

--- src/MbUnit/MbUnit.Tests/Framework/AssertTest_Xml_AreEqual.cs
+++ src/MbUnit/MbUnit.Tests/Framework/AssertTest_Xml_AreEqual.cs
@@ -61,12 +61,12 @@
         }

         [Test]
-        public void AreEqual_with_multiple_root_elements_should_throw_exception()
+        public void AreEqual_with_multiple_root_elements_should_fail()
         {
             string xml = "<a/><b/><c/>";
             AssertionFailure[] failures = Capture(() => Assert.Xml.AreEqual(xml, xml));
             Assert.Count(1, failures);
-            Assert.AreEqual("Cannot parse the actual XML fragment.", failures[0].Message);
+            Assert.AreEqual("Cannot parse the actual XML fragment.", failures[0].Description);
         }

         [Test]


Update MVCConfigurationExtensions.cs

Update MVCConfigurationExtensions.cs

--- src/Grace.AspNetCore.MVC/MVCConfigurationExtensions.cs
+++ src/Grace.AspNetCore.MVC/MVCConfigurationExtensions.cs
@@ -5,6 +5,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using Grace.AspNetCore.MVC.Inspector;

 namespace Grace.AspNetCore.MVC
 {


Wrap failure with MySqlException. Fixes #434

--- src/MySqlConnector/MySql.Data.MySqlClient/MySqlDataReader.cs
+++ src/MySqlConnector/MySql.Data.MySqlClient/MySqlDataReader.cs
@@ -100,7 +100,7 @@

 				throw mySqlException != null ?
 					new MySqlException(mySqlException.Number, mySqlException.SqlState, mySqlException.Message, mySqlException) :
-					resultSet.ReadResultSetHeaderException;
+					new MySqlException("Failed to read the result set.", resultSet.ReadResultSetHeaderException);
 			}

 			Command.LastInsertedId = resultSet.LastInsertId;


Fix some more tests

Fix some more tests

--- src/Numerics.Tests/LinearAlgebraTests/VectorToStringTests.cs
+++ src/Numerics.Tests/LinearAlgebraTests/VectorToStringTests.cs
@@ -15,6 +15,8 @@
         [Test]
         public void MinimumLimits()
         {
+            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
             Assert.That(v1.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL));
             Assert.That(v2.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL + "6.28319" + NL));
             Assert.That(v100.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL + "     .." + NL + "314.159" + NL));
@@ -23,6 +25,8 @@
         [Test]
         public void GitHubIssue387()
         {
+            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
             Vector<double> v = Vector<double>.Build.DenseOfArray(new[]
                 {
                     0.607142857142857,


Use single resolve type method

Use single resolve type method

--- src/Orleans/Streams/Predicates/FilterPredicateWrapperData.cs
+++ src/Orleans/Streams/Predicates/FilterPredicateWrapperData.cs
@@ -65,7 +65,7 @@

         private static StreamFilterPredicate RehydrateStaticFuncion(string funcClassName, string funcMethodName)
         {
-            Type funcClassType = CachedTypeResolver.Instance.ResolveType(funcClassName);
+            Type funcClassType = TypeUtils.ResolveType(funcClassName);
             MethodInfo method = funcClassType.GetMethod(funcMethodName);
             StreamFilterPredicate pred = (StreamFilterPredicate) method.CreateDelegate(typeof(StreamFilterPredicate));
 #if DEBUG


Fix race condition in SourceTypeSymbol._lazyTraitUses initialization

--- src/Peachpie.CodeAnalysis/Symbols/Source/SourceTypeSymbol.cs
+++ src/Peachpie.CodeAnalysis/Symbols/Source/SourceTypeSymbol.cs
@@ -673,8 +673,8 @@
                     if (self)
                     {
                         _lazyBaseType = v_base;
+                        _lazyTraitUses = SelectTraitUses(this, tsignature, v);
                         _lazyInterfacesType = v_interfaces;
-                        _lazyTraitUses = SelectTraitUses(this, tsignature, v);

                         self = false;
                     }
@@ -711,8 +711,8 @@
             {
                 // default with unbound error types:
                 _lazyBaseType = tsignature[0].Symbol;
+                _lazyTraitUses = ImmutableArray<TraitUse>.Empty;
                 _lazyInterfacesType = tsignature.Where(x => x.Attributes.IsInterface()).Select(x => x.Symbol).AsImmutable();
-                _lazyTraitUses = ImmutableArray<TraitUse>.Empty;
             }
             else
             {


#73 - Fixed PersistedQueue bug.

#73 - Fixed PersistedQueue bug.

--- src/IX.Guaranteed/Collections/PersistedQueueBase{T}.cs
+++ src/IX.Guaranteed/Collections/PersistedQueueBase{T}.cs
@@ -222,14 +222,22 @@

                 try
                 {
+                    T obj;
+
                     using (global::System.IO.Stream stream = this.FileShim.OpenRead(possibleFilePath))
                     {
-                        var obj = (T)this.Serializer.ReadObject(stream);
-
-                        this.FileShim.Delete(possibleFilePath);
-
-                        return obj;
+                        obj = (T)this.Serializer.ReadObject(stream);
                     }
+
+                    this.FileShim.Delete(possibleFilePath);
+
+                    return obj;
+                }
+                catch (global::System.IO.IOException)
+                {
+                    this.HandleFileLoadProblem(possibleFilePath);
+                    i++;
+                    continue;
                 }
                 catch (UnauthorizedAccessException)
                 {
@@ -272,6 +280,12 @@
                         return (T)this.Serializer.ReadObject(stream);
                     }
                 }
+                catch (global::System.IO.IOException)
+                {
+                    this.HandleFileLoadProblem(possibleFilePath);
+                    i++;
+                    continue;
+                }
                 catch (UnauthorizedAccessException)
                 {
                     this.HandleFileLoadProblem(possibleFilePath);
@@ -304,6 +318,11 @@
                         obj = (T)this.Serializer.ReadObject(stream);
                     }
                 }
+                catch (global::System.IO.IOException)
+                {
+                    this.HandleFileLoadProblem(possibleFilePath);
+                    continue;
+                }
                 catch (UnauthorizedAccessException)
                 {
                     this.HandleFileLoadProblem(possibleFilePath);


Refactor interface in Shortcuts/RouterDbExtensions Whereas by convention the cancellation tokens are strung onto the end as a default parameter, they cannot both conform to common design patterns and be present in a variable length parameter list (made with 'params'). This commit modifies the interface to use overloading. The extant interface, which uses a variable length parameter list, has no cancellation token and serves current users. The new interface does not use 'params' and places the cancellation token at the end.

--- src/Itinero/Algorithms/Shortcuts/RouterDbExtensions.cs
+++ src/Itinero/Algorithms/Shortcuts/RouterDbExtensions.cs
@@ -31,7 +31,19 @@
         /// <summary>
         /// Adds multiple shortcut db's at the same time.
         /// </summary>
-        public static void AddShortcuts(this RouterDb routerDb, CancellationToken cancellationToken = new CancellationToken(), params ShortcutSpecs[] shortcutSpecs)
+        public static void AddShortcuts(this RouterDb routerDb, params ShortcutSpecs[] shortcutSpecs)
+        {
+            //This overload is done manually instead of by default parameter to offer the parameter list interface without moving
+            //the cancellation token to an unusual position in the parameter list. The wrapped method below does not include
+            //a default cancellation token in its parameter set because this will create an ambiguous method spec and, potentially,
+            //a stack overflow at runtime (depending on the whims of the compiler.)
+            AddShortcuts(routerDb, shortcutSpecs, new CancellationToken());
+        }
+
+        /// <summary>
+        /// Adds multiple shortcut db's at the same time.
+        /// </summary>
+        public static void AddShortcuts(this RouterDb routerDb, ShortcutSpecs[] shortcutSpecs, CancellationToken cancellationToken)
         {
             // check all specs.
             if (shortcutSpecs == null) { throw new ArgumentNullException(); }