Fixup the global defaults config parsing code.

--- OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
+++ OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
@@ -238,7 +238,7 @@
 			defTimer.AutoReset = true;
 			defTimer.Start ();

-			AutoBackupModuleState abms = ParseConfig(null, false);
+			AutoBackupModuleState abms = ParseConfig(null, true);
 			m_log.Debug("[AUTO BACKUP]: Config for default");
 			m_log.Debug(abms.ToString());
 		}
@@ -262,16 +262,23 @@
 			if (!m_Enabled)
 				return;

-			AutoBackupModuleState abms = states[scene];
-			Timer timer = abms.GetTimer ();
-			List<IScene> list = timerMap[timer];
-			list.Remove (scene);
-			if (list.Count == 0) {
-				timerMap.Remove (timer);
-				timers.Remove (timer.Interval);
-				timer.Close ();
-			}
-			states.Remove(scene);
+			if(states.ContainsKey(scene))
+			{
+				AutoBackupModuleState abms = states[scene];
+
+				//Remove this scene out of the timer map list
+				Timer timer = abms.GetTimer ();
+				List<IScene> list = timerMap[timer];
+				list.Remove (scene);
+
+				//Shut down the timer if this was the last scene for the timer
+				if (list.Count == 0) {
+					timerMap.Remove (timer);
+					timers.Remove (timer.Interval);
+					timer.Close ();
+				}
+				states.Remove(scene);
+			}
 		}

 		void IRegionModuleBase.RegionLoaded (Framework.Scenes.Scene scene)
@@ -283,9 +290,9 @@
 			if (scene == null)
 				return;

-			AutoBackupModuleState abms = ParseConfig(scene, true);
+			AutoBackupModuleState abms = ParseConfig(scene, false);
 			m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName);
-			m_log.Debug(abms.ToString());
+			m_log.Debug((abms == null ? "DEFAULT" : abms.ToString()));
 		}

 		AutoBackupModuleState ParseConfig (IScene scene, bool parseDefault)
@@ -322,13 +329,16 @@
 			if(state == null && tmpEnabled != defaultState.GetEnabled()) //Varies from default state
 			{
 			    state = new AutoBackupModuleState();
-			    state.SetEnabled (tmpEnabled);
+			}
+
+			if(state != null)
+			{
+			    state.SetEnabled (tmpEnabled);
 			}

 			//If you don't want AutoBackup, we stop.
-			if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) {
+			if ((state == null && !defaultState.GetEnabled()) || (state != null && !state.GetEnabled ())) {
 				m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled.");
-				state = defaultState;
 				return state;
 			} else {
 				m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED.");


Failure to send emails should not result in crash

--- RightpointLabs.Pourcast.Infrastructure/Services/SmtpEmailService.cs
+++ RightpointLabs.Pourcast.Infrastructure/Services/SmtpEmailService.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Reflection;
+using log4net;

 namespace RightpointLabs.Pourcast.Infrastructure.Services
 {
@@ -12,6 +14,8 @@
     {
         private readonly SmtpClient _client;

+        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
         public SmtpEmailService(SmtpClient client)
         {
             if (client == null) throw new ArgumentNullException("client");
@@ -23,7 +27,18 @@
         {
             if (email == null) return;

-            TransactionExtensions.WaitForTransactionCompleted(() => _client.Send(email));
+            TransactionExtensions.WaitForTransactionCompleted(() =>
+            {
+                try
+                {
+                    _client.Send(email);
+                }
+                catch (Exception ex)
+                {
+                    // failure to send the email should not bring everything crashing down
+                    log.Warn("Unable to send email", ex);
+                }
+            });
         }
     }
 }


Use new settings table

Use new settings table

--- KeyCounter/AppSettings.cs
+++ KeyCounter/AppSettings.cs
@@ -19,7 +19,7 @@
         public string TextColor {
             get {
                 if (_textColor.Equals("")) {
-                    SQLiteCommand command = new SQLiteCommand("SELECT value FROM Colors WHERE name = @Name", App.DbConnection);
+                    SQLiteCommand command = new SQLiteCommand("SELECT value FROM settings WHERE name = @Name", App.DbConnection);
                     command.Parameters.Add("@Name", System.Data.DbType.String);
                     command.Parameters["@Name"].Value = "textColor";
                     SQLiteDataReader r = command.ExecuteReader();
@@ -32,7 +32,7 @@
             set {
                 if (Regex.IsMatch(value, colorPattern, RegexOptions.IgnoreCase)) {
                     _textColor = value.StartsWith("#") ? value : "#" + value;
-                    SQLiteCommand command = new SQLiteCommand("INSERT INTO colors (name, value) VALUES (@Name, @Value)", App.DbConnection);
+                    SQLiteCommand command = new SQLiteCommand("INSERT INTO settings (name, value) VALUES (@Name, @Value)", App.DbConnection);
                     command.Parameters.Add("@Name", System.Data.DbType.String);
                     command.Parameters.Add("@Value", System.Data.DbType.String);
                     command.Parameters["@Name"].Value = "textColor";
@@ -48,7 +48,7 @@
         public string BgColor {
             get {
                 if (_bgColor.Equals("")) {
-                    SQLiteCommand command = new SQLiteCommand("SELECT value FROM colors WHERE name = @Name", App.DbConnection);
+                    SQLiteCommand command = new SQLiteCommand("SELECT value FROM settings WHERE name = @Name", App.DbConnection);
                     command.Parameters.Add("@Name", System.Data.DbType.String);
                     command.Parameters["@Name"].Value = "bgColor";
                     SQLiteDataReader r = command.ExecuteReader();
@@ -61,7 +61,7 @@
             set {
                 if (Regex.IsMatch(value, colorPattern, RegexOptions.IgnoreCase)) {
                     _bgColor = value.StartsWith("#") ? value : "#" + value;
-                    SQLiteCommand command = new SQLiteCommand("INSERT INTO colors (name, value) VALUES (@Name, @Value)", App.DbConnection);
+                    SQLiteCommand command = new SQLiteCommand("INSERT INTO settings (name, value) VALUES (@Name, @Value)", App.DbConnection);
                     command.Parameters.Add("@Name", System.Data.DbType.String);
                     command.Parameters.Add("@Value", System.Data.DbType.String);
                     command.Parameters["@Name"].Value = "bgColor";


Implement Shopify's updated list method with Link header

--- ShopifySharp/Services/ApplicationCredit/ApplicationCreditService.cs
+++ ShopifySharp/Services/ApplicationCredit/ApplicationCreditService.cs
@@ -3,6 +3,7 @@
 using System.Net.Http;
 using System.Threading.Tasks;
 using ShopifySharp.Filters;
+using ShopifySharp.Lists;

 namespace ShopifySharp
 {
@@ -21,18 +22,26 @@
         /// <summary>
         /// Gets a list of all past and present application credits.
         /// </summary>
-        /// <param name="fields">A comma-separated list of fields to include in the response.</param>
-        public virtual async Task<IEnumerable<ApplicationCredit>> ListAsync(IListFilter filter)
+        public virtual async Task<IListResult<ApplicationCredit>> ListAsync(IListFilter filter)
         {
-            throw new System.Exception("not yet implemented");
-            // var req = PrepareRequest($"application_credits.json");
-            //
-            // if (!string.IsNullOrEmpty(fields))
-            // {
-            //     req.QueryParams.Add("fields", fields);
-            // }
-            //
-            // return await ExecuteRequestAsync<List<ApplicationCredit>>(req, HttpMethod.Get, rootElement: "application_credits");
+            var req = PrepareRequest($"application_credits.json");
+
+            if (filter != null)
+            {
+                req.QueryParams.AddRange(filter.ToQueryParameters());
+            }
+
+            var response = await ExecuteRequestAsync<List<ApplicationCredit>>(req, HttpMethod.Get, rootElement: "application_credits");
+
+            return ParseLinkHeaderToListResult(response);
+        }
+
+        /// <summary>
+        /// Gets a list of all past and present application credits.
+        /// </summary>
+        public virtual async Task<IListResult<ApplicationCredit>> ListAsync(ApplicationCreditListFilter filter)
+        {
+            return await ListAsync((IListFilter) filter);
         }

         /// <summary>


use PrincipalContext in GetGroups

use PrincipalContext in GetGroups

--- Signum.Engine.Extensions/Authorization/ActiveDirectoryAuthorizer.cs
+++ Signum.Engine.Extensions/Authorization/ActiveDirectoryAuthorizer.cs
@@ -212,7 +212,7 @@
         var config = GetConfig();
         if (ctx is DirectoryServiceAutoCreateUserContext ds)
         {
-            var groups = ds.GetUserPrincipal().GetGroups();
+            var groups = ds.GetUserPrincipal().GetGroups(ds.PrincipalContext);
             var role = config.RoleMapping.FirstOrDefault(m =>
             {
                 Guid.TryParse(m.ADNameOrGuid, out var guid);


no escape! :runner:

no escape! :runner:

--- KuhlEngineTester/Form1.cs
+++ KuhlEngineTester/Form1.cs
@@ -204,6 +204,7 @@
             //item.FlipX = false;
             item.X = item.X + 2;
             if (jump > 0) item.X = item.X + 3;
+            if (item.X > renderer.Width) item.X = -item.Width;
             renderer.SetItem(uuid["Player"], item);
         }

@@ -271,6 +272,7 @@
             //item.FlipX = false;
             item.X = item.X - 2;
             if (jump > 0) item.X = item.X - 3;
+            if (item.X < -item.Width) item.X = renderer.Width;
             renderer.SetItem(uuid["Player"], item);
         }

@@ -279,6 +281,7 @@
             Item item = renderer.GetItem(uuid["Player"]);
             //item.FlipX = false;
             item.Y = item.Y - 2;
+            if (item.Y < -item.Height) item.Y = renderer.Height;
             renderer.SetItem(uuid["Player"], item);
         }

@@ -287,6 +290,7 @@
             Item item = renderer.GetItem(uuid["Player"]);
             //item.FlipX = false;
             item.Y = item.Y + 2;
+            if (item.Y > renderer.Height) item.Y = -item.Height;
             renderer.SetItem(uuid["Player"], item);
         }


added cases for DxaRegion and DxaRegions methods to TestPage2

--- webapp-net/Test/Areas/Test/Views/Page/TestPage2.cshtml
+++ webapp-net/Test/Areas/Test/Views/Page/TestPage2.cshtml
@@ -11,11 +11,93 @@

Rendered @Model with Page View "Test:TestPage2"

-
Regions

+
Regions #1, #2, #3

+

+            @Html.DxaRegions()
+

+
+
Regions #1, #2, #3, container size 1

+

+            @Html.DxaRegions(containerSize: 1)
+

+
+
Regions #1, #2, #3, container size 100

+

+            @Html.DxaRegions(containerSize: 100)
+

+
+
Regions #1, #2, #3, container size -100

+

+            @Html.DxaRegions(containerSize: -100)
+

+
+
Regions #1, #2 excluded

+

+            @Html.DxaRegions(exclude: "TestRegion1,TestRegion2")
+

+
+
Region #1 excluded + non-existing

+

+            @Html.DxaRegions(exclude: "TestRegion1,TestRegionNONE")
+

+
+
Non-existing regions excluded

+

+            @Html.DxaRegions(exclude: "TestRegionNONE1,TestRegionNONE2")
+

+
+

+
+
Region - null

+

+            @Html.DxaRegion("")
+

+
+
Region - TestRegion2

             @Html.DxaRegion("TestRegion2")

+
Region - TestRegion2, emptyview - TestRegion3

+

+            @Html.DxaRegion("TestRegion2", emptyViewName: "Test:TestRegion3")
+

+
+
Region - TestRegion2, emptyview - TestRegionNONE

+

+            @Html.DxaRegion("TestRegion2", emptyViewName: "Test:TestRegionNONE")
+

+
+
Region - TestRegionNONE

+

+            @Html.DxaRegion("TestRegionNONE")
+

+
+
Region - TestRegionNONE, emptyview - TestRegion3

+

+            @Html.DxaRegion("TestRegionNONE", emptyViewName: "Test:TestRegion3")
+

+
+
Region - TestRegionNONE, emptyview - TestRegionNONE

+

+            @Html.DxaRegion("TestRegionNONE", emptyViewName: "Test:TestRegionNONE")
+

+
+
Region - TestRegion2, containerSize 1

+

+            @Html.DxaRegion("TestRegion2", containerSize: 1)
+

+
+
Region - TestRegion2, containerSize 100

+

+            @Html.DxaRegion("TestRegion2", containerSize: 100)
+

+
+
Region - TestRegion2, containerSize -100

+

+            @Html.DxaRegion("TestRegion2", containerSize: -100)
+

+

         @if (WebRequestContext.IsPreview)


Fixing export ByInterface

Fixing export ByInterface

--- Source/Grace/DependencyInjection/Impl/ExportTypeSetConfiguration.cs
+++ Source/Grace/DependencyInjection/Impl/ExportTypeSetConfiguration.cs
@@ -779,7 +779,14 @@
                         if (implementedInterface.IsConstructedGenericType &&
                              implementedInterface.GetGenericTypeDefinition() == exportInterface)
                         {
-                            yield return exportInterface;
+                            if (exportedType.GetTypeInfo().IsGenericTypeDefinition)
+                            {
+                                yield return exportInterface;
+                            }
+                            else
+                            {
+                                yield return implementedInterface;
+                            }
                         }
                     }
                     else if (exportInterface.GetTypeInfo().IsAssignableFrom(implementedInterface.GetTypeInfo()))


fix commandcontext reply bug

fix commandcontext reply bug

--- Src/iFramework.Plugins/iFramework.MessageQueue.ZeroMQ/CommandBus.cs
+++ Src/iFramework.Plugins/iFramework.MessageQueue.ZeroMQ/CommandBus.cs
@@ -218,8 +218,9 @@
             }
             else //if not a linear command, we run synchronously.
             {
-                task = new Task(() =>
-                {
+                task = new Task<object>(() =>
+                {
+                    object result = null;
                     PerMessageContextLifetimeManager.CurrentMessageContext = commandContext;
                     var commandHandler = HandlerProvider.GetHandler(command.GetType());
                     if (commandHandler == null)
@@ -236,10 +237,14 @@
                     }
                     finally
                     {
+                        result = commandContext.Reply;
                         commandContext.ClearItems();
                     }
+                    return result;
                 });
                 task.RunSynchronously();
+
+
                 //if (task.Exception != null)
                 //{
                 //    throw task.Exception.GetBaseException();


Update Startup.cs

Update Startup.cs

--- src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/Startup.cs
+++ src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/Startup.cs
@@ -1,3 +1,5 @@
+using System;
+using System.Configuration;
 using Abp.Owin;
 using AbpCompanyName.AbpProjectName.Api.Controllers;
 using AbpCompanyName.AbpProjectName.WebMpa;
@@ -21,7 +23,11 @@
             app.UseCookieAuthentication(new CookieAuthenticationOptions
             {
                 AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
-                LoginPath = new PathString("/Account/Login")
+                LoginPath = new PathString("/Account/Login"),
+                // by setting following values, the auth cookie will expire after the configured amount of time (default 14 days) when user set the (IsPermanent == true) on the login
+                ExpireTimeSpan = new TimeSpan(int.Parse(ConfigurationManager.AppSettings["AuthSession.ExpireTimeInDays.WhenPersistet"] ?? "14"), 0, 0, 0),
+                SlidingExpiration = bool.Parse(ConfigurationManager.AppSettings["AuthSession.SlidingExpirationEnabled"] ?? bool.FalseString)
+
             });

             app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
@@ -35,4 +41,4 @@
             //});
         }
     }
-}+}


Fixed keyboard handling in combo box

Fixed keyboard handling in combo box

--- src/AcaciaZPushPlugin/AcaciaZPushPlugin/Controls/KComboBox.cs
+++ src/AcaciaZPushPlugin/AcaciaZPushPlugin/Controls/KComboBox.cs
@@ -16,87 +16,49 @@
     {
         #region Drop-down list

+        /// <summary>
+        /// Custom list for the drop-down. Performs a few functions:
+        /// - Prevents grabbing the focus away from the edit when clicked
+        /// - Adds hover highlighting
+        /// - Only commits selection when clicked or externally (through enter in the edit).
+        ///   This prevents updating the text and associated filters when scrolling through the combo.
+        /// </summary>
         private class DropList : ListBox
         {
             private readonly KComboBox _owner;
-            private int _highlightIndex = -1;
+            private int _committedIndex = -1;

             public DropList(KComboBox owner)
             {
                 this._owner = owner;
                 SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
-                DrawMode = DrawMode.OwnerDrawFixed;
                 SetStyle(ControlStyles.Selectable, false);
                 BorderStyle = BorderStyle.None;
             }

             protected override void OnMouseMove(MouseEventArgs e)
             {
-                // Use the mouse to highlight the current item
-                int newIndex = IndexFromPoint(PointToClient(Cursor.Position));
-                if (newIndex != _highlightIndex)
-                {
-                    int oldIndex = _highlightIndex;
-                    _highlightIndex = newIndex;
-
-                    // Invalidate the affected items, which may include a previously selected one
-                    InvalidateItem(oldIndex);
-                    InvalidateItem(_highlightIndex);
-                    if (SelectedIndex != oldIndex && SelectedIndex != _highlightIndex)
-                        InvalidateItem(SelectedIndex);
-                }
+                // Perform the select to highlight
+                SelectedIndex = IndexFromPoint(PointToClient(Cursor.Position));
             }

             protected override void OnMouseLeave(EventArgs e)
             {
                 base.OnMouseLeave(e);
-                _highlightIndex = -1;
+                SelectedIndex = _committedIndex;
+            }
+
+            protected override void OnVisibleChanged(EventArgs e)
+            {
+                base.OnVisibleChanged(e);
+                SelectedIndex = _committedIndex;
             }

             protected override void OnMouseDown(MouseEventArgs e)
             {
-                base.OnMouseDown(e);
-
-                // Perform the select when the mouse is clicked
+                // Select the item under the mouse and commit
                 SelectedIndex = IndexFromPoint(PointToClient(Cursor.Position));
-            }
-
-            protected override void OnVisibleChanged(EventArgs e)
-            {
-                base.OnVisibleChanged(e);
-                _highlightIndex = -1;
-            }
-
-            private void InvalidateItem(int index)
-            {
-                if (index < 0 || index >= Items.Count)
-                    return;
-                Invalidate(GetItemRectangle(index));
-            }
-
-            protected override void OnDrawItem(DrawItemEventArgs e)
-            {
-                // Create a custom event instance to be able to set the selected state for mouse hover
-                DrawItemState state = e.State;
-                if (_highlightIndex >= 0)
-                {
-                    state = _highlightIndex == e.Index ? DrawItemState.Selected : DrawItemState.None;
-                }
-                DrawItemEventArgs draw = new DrawItemEventArgs(e.Graphics, e.Font, e.Bounds, e.Index, state);
-                draw.DrawBackground();
-
-                string text = Items[draw.Index].ToString();
-                using (StringFormat format = new StringFormat())
-                {
-                    format.LineAlignment = StringAlignment.Center;
-                    using (Brush brush = new SolidBrush(draw.ForeColor))
-                    {
-                        draw.Graphics.DrawString(text,
-                            draw.Font, brush,
-                            draw.Bounds,
-                            format);
-                    }
-                }
+                CommitSelection();
             }

             protected override void DefWndProc(ref Message m)
@@ -117,12 +79,22 @@
                 Size prefSize = base.GetPreferredSize(proposedSize);
                 return new Size(prefSize.Width, ItemHeight * Math.Min(Items.Count, _owner.MaxDropDownItems));
             }
+
+            public void CommitSelection()
+            {
+                _committedIndex = SelectedIndex;
+                base.OnSelectedIndexChanged(new EventArgs());
+            }
+
+            protected override void OnSelectedIndexChanged(EventArgs e)
+            {
+                // Don't notify until committed
+            }
         }

         #endregion

         private readonly DropList _list;
-        private int _ignoreListEvents;

         #region Items properties

@@ -162,10 +134,14 @@

         private void _list_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (_list.SelectedIndex >= 0 && _ignoreListEvents == 0)
+            if (_list.SelectedIndex >= 0)
             {
                 Text = _list.SelectedItem.ToString();
             }
+            else
+            {
+                Text = "";
+            }
         }

         public void BeginUpdate()
@@ -188,16 +164,8 @@
             set
             {
                 _list.BindingContext = new BindingContext();
-                ++_ignoreListEvents;
-                try
-                {
-                    _list.DataSource = value;
-                    _list.SelectedIndex = -1;
-                }
-                finally
-                {
-                    --_ignoreListEvents;
-                }
+                _list.DataSource = value;
+                _list.SelectedIndex = -1;
             }
         }

@@ -219,7 +187,15 @@
                 case Keys.Down:
                 case Keys.Up:
                     User32.SendMessage(_list.Handle, (int)WM.KEYDOWN, new IntPtr((int)e.KeyCode), IntPtr.Zero);
-                    e.IsInputKey = false;
+                    e.IsInputKey = true;
+                    break;
+
+                // Enter commits the selected index and closes the drop down
+                case Keys.Enter:
+                case Keys.Tab:
+                    _list.CommitSelection();
+                    DroppedDown = false;
+                    e.IsInputKey = e.KeyCode == Keys.Enter;
                     break;
                 default:
                     base.OnPreviewKeyDown(e);


More specific region name.

More specific region name.

--- src/Arango/Arango.Tests/EdgeOperations/EdgeOperationsTests.cs
+++ src/Arango/Arango.Tests/EdgeOperations/EdgeOperationsTests.cs
@@ -155,7 +155,7 @@

         #endregion

-        #region Get
+        #region Get in/out/any

         [Test()]
         public void Should_get_edges_in()


persist optimized, auto-generated dll compiled from url/plain code, fixes #321

--- src/BenchmarkDotNet.Core/Running/ClassicBenchmarkConverter.cs
+++ src/BenchmarkDotNet.Core/Running/ClassicBenchmarkConverter.cs
@@ -40,7 +40,21 @@
         {
             string benchmarkContent = source;
             var cSharpCodeProvider = new CSharpCodeProvider();
-            var compilerParameters = new CompilerParameters(new[] { "mscorlib.dll", "System.dll", "System.Core.dll" }) { CompilerOptions = "/unsafe" };
+            var compilerParameters = new CompilerParameters(
+                new[]
+                {
+                    "mscorlib.dll",
+                    "System.dll",
+                    "System.Core.dll"
+                })
+            {
+                CompilerOptions = "/unsafe /optimize",
+                GenerateInMemory = false,
+                OutputAssembly = Path.Combine(
+                    Path.GetDirectoryName(typeof(Benchmark).Assembly.Location),
+                    $"{Path.GetFileNameWithoutExtension(Path.GetTempFileName())}.dll")
+            };
+
             compilerParameters.ReferencedAssemblies.Add(typeof(Benchmark).Assembly.Location);
             var compilerResults = cSharpCodeProvider.CompileAssemblyFromSource(compilerParameters, benchmarkContent);
             if (compilerResults.Errors.HasErrors)


[vsintegration] Prevent crash at close when fields are null. This may happen for example for files of type .ppo

--- VisualStudio/LanguageService/LineSeparators/LineSeparatorManager.cs
+++ VisualStudio/LanguageService/LineSeparators/LineSeparatorManager.cs
@@ -53,10 +53,19 @@
         private void OnClosed(object sender, EventArgs e)
         {
             closed = true;
-            _textView.Closed -= OnClosed;
-            _textView.LayoutChanged -= OnLayoutChanged;
-            _classifier.LineStateChanged -= LineStateChanged;
-            _editorFormatMap.FormatMappingChanged -= FormatMappingChanged;
+            if (_textView != null)
+            {
+                _textView.Closed -= OnClosed;
+                _textView.LayoutChanged -= OnLayoutChanged;
+            }
+            if (_classifier != null)
+            {
+                _classifier.LineStateChanged -= LineStateChanged;
+            }
+            if (_editorFormatMap != null)
+            {
+                _editorFormatMap.FormatMappingChanged -= FormatMappingChanged;
+            }

         }


change page size to 10 of approved requisitions

--- Web/Areas/Logistics/Views/HubAllocation/ApprovedRequesitions.cshtml
+++ Web/Areas/Logistics/Views/HubAllocation/ApprovedRequesitions.cshtml
@@ -71,7 +71,7 @@
             pageable: true,
             autoBind: true,
             dataSource: {
-                pageSize:1
+                pageSize:10
             }


CBL-3572 Add more detailed comments on enhanced certificate pinning API

--- src/Couchbase.Lite.Shared/API/Sync/ReplicatorConfiguration.cs
+++ src/Couchbase.Lite.Shared/API/Sync/ReplicatorConfiguration.cs
@@ -178,6 +178,10 @@
         /// Gets or sets a certificate to trust.  All other certificates received
         /// by a <see cref="Replicator"/> with this configuration will be rejected.
         /// </summary>
+        /// <remarks>
+        /// A server will be authenticated if it presents a chain of certificates (possibly of length 1)
+        /// in which any one of the certificates matches the one passed here.
+        /// </remarks>
         [CanBeNull]
         public X509Certificate2 PinnedServerCertificate
         {


Use top center HUD warning slot for beep messages.

--- game/server/base/gameconnection.cs
+++ game/server/base/gameconnection.cs
@@ -642,8 +642,12 @@

 function GameConnection::beepMsg(%this, %reason)
 {
-	MessageClient(%this, 'MsgBeep', '\c0Fail: %1', %reason);
+	//MessageClient(%this, 'MsgBeep', '\c0Fail: %1', %reason);
 	//bottomPrint(%this, %reason, 3, 1 );
+   %this.setHudWarning(2, %reason, true);
+   if(%this.clearBeepMsgThread !$= "")
+      cancel(%this.clearBeepMsgThread);
+   %this.clearBeepMsgThread = %this.schedule(4000, "setHudWarning", 2, "", false);
 	%this.play2D(BeepMessageSound);
 }


Warn when navigating to PR file with no changes

--- src/GitHub.VisualStudio/Commands/OpenFileInSolutionCommand.cs
+++ src/GitHub.VisualStudio/Commands/OpenFileInSolutionCommand.cs
@@ -110,6 +110,13 @@
                 // TODO: add metrics
                 // await usageTracker.Value.IncrementCounter(x => x.NumberOf???);

+                var sessionFile = await session.GetFile(relativePath);
+                if (sessionFile.Diff.Count == 0)
+                {
+                    statusBar.Value.ShowMessage("No changes in PR file: " + relativePath);
+                    return;
+                }
+
                 var diffViewer = await pullRequestEditorService.Value.OpenDiff(session, relativePath, "HEAD", scrollToFirstDiff: false);
                 if (diffViewer == null)
                 {


Make Destination field a public property

--- src/Jasper.Testing/Transports/Tcp/Protocol/ProtocolContext.cs
+++ src/Jasper.Testing/Transports/Tcp/Protocol/ProtocolContext.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Linq;
 using System.Net;
 using System.Net.Sockets;
@@ -21,7 +21,7 @@
         private readonly IPAddress theAddress = IPAddress.Loopback;
         private readonly int thePort = ++NextPort;
         private readonly ListeningAgent _listener;
-        private readonly Uri destination;
+        public readonly Uri Destination;
         private readonly OutgoingMessageBatch theMessageBatch;

@@ -30,7 +30,7 @@

         public ProtocolContext()
         {
-            destination = $"durable://localhost:{thePort}/incoming".ToUri();
+            Destination = $"durable://localhost:{thePort}/incoming".ToUri();
             _listener = new ListeningAgent(theReceiver, theAddress, thePort, "durable", CancellationToken.None);

@@ -44,7 +44,7 @@
                 outgoingMessage()
             };

-            theMessageBatch = new OutgoingMessageBatch(destination, messages);
+            theMessageBatch = new OutgoingMessageBatch(Destination, messages);
         }

         public void Dispose()
@@ -57,8 +57,8 @@
         {
             return new Envelope
             {
-                Destination = destination,
-                Data = new byte[] {1, 2, 3, 4, 5, 6, 7},
+                Destination = Destination,
+                Data = new byte[] { 1, 2, 3, 4, 5, 6, 7 },
                 SentAt = DateTime.Today.ToUniversalTime()
             };
         }
@@ -69,10 +69,10 @@

             using (var client = new TcpClient())
             {
-                if (Dns.GetHostName() == destination.Host)
-                    await client.ConnectAsync(IPAddress.Loopback, destination.Port);
+                if (Dns.GetHostName() == Destination.Host)
+                    await client.ConnectAsync(IPAddress.Loopback, Destination.Port);

-                await client.ConnectAsync(destination.Host, destination.Port);
+                await client.ConnectAsync(Destination.Host, Destination.Port);

                 await WireProtocol.Send(client.GetStream(), theMessageBatch, null, theSender);
             }


fix bug for incrematal build. (#863)

fix bug for incrematal build. (#863)

--- src/Microsoft.DocAsCode.Build.Engine/SingleDocumentBuilder.cs
+++ src/Microsoft.DocAsCode.Build.Engine/SingleDocumentBuilder.cs
@@ -1170,6 +1170,11 @@
             lpi = null;
             cpi = CreateProcessorInfo(incrementalContext, processor, versionName);

+            if (!incrementalContext.CanVersionIncremental)
+            {
+                return false;
+            }
+
             if (LastBuildInfo == null)
             {
                 Logger.LogVerbose($"Processor {processor.Name} disable incremental build because no last build.");


Allow specific bininspect baseline error per regex (#1877)

--- src/Microsoft.DotNet.Build.Tasks/ValidateBinInspectResults.cs
+++ src/Microsoft.DotNet.Build.Tasks/ValidateBinInspectResults.cs
@@ -4,6 +4,7 @@

 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.RegularExpressions;
@@ -16,11 +17,13 @@
     // if there is an actual failure we care about.
     public class ValidateBinInspectResults : BuildTask
     {
-        private static readonly string s_RootElement = "DATA";
-        private static readonly string s_RowElement = "ROW";
-        private static readonly string s_ErrorElement = "Err";
-        private static readonly string s_NameElement = "Full";
-        private static readonly string s_ResultElement = "Pass";
+        private const string s_RootElement = "DATA";
+        private const string s_RowElement = "ROW";
+        private const string s_ErrorElement = "Err";
+        private const string s_NameElement = "Full";
+        private const string s_ResultElement = "Pass";
+
+        private const string SpecificErrorMetadataName = "SpecificError";

         [Required]
         public string ResultsXml { get; set; }
@@ -40,9 +43,11 @@
             List<ITaskItem> reportedFailures = new List<ITaskItem>();

             // Gather all of the rows with error results
-            IEnumerable<XElement> errorRows = from descendant in rows
-                                              where descendant.Descendants().FirstOrDefault(f => f.Name == s_ResultElement).Value == "False"
-                                              select descendant;
+            IEnumerable<XElement> errorRows = rows
+                .Where(descendant => descendant
+                    .Descendants()
+                    .FirstOrDefault(f => f.Name == s_ResultElement)?.Value == "False")
+                .ToArray();

             // Filter out baselined files which are stored as regex patterns
             HashSet<XElement> baselineExcludeElements = new HashSet<XElement>();
@@ -50,10 +55,24 @@
             {
                 foreach (var baselineFile in BaselineFiles)
                 {
-                    IEnumerable<XElement> baselineExcluded = errorRows.Where(f => Regex.IsMatch(f.Descendants(s_NameElement).First().Value, baselineFile.ItemSpec, RegexOptions.IgnoreCase));
+                    string regex = baselineFile.ItemSpec;
+                    string specificError = baselineFile.GetMetadata(SpecificErrorMetadataName);
+
+                    var baselineExcluded = errorRows
+                        .Select(row => new
+                        {
+                            Element = row,
+                            FullFile = row.Descendants(s_NameElement).First().Value,
+                            Error = row.Descendants(s_ErrorElement).FirstOrDefault()?.Value,
+                        })
+                        .Where(f => Regex.IsMatch(f.FullFile, regex, RegexOptions.IgnoreCase))
+                        .Where(f =>
+                            string.IsNullOrEmpty(specificError) ||
+                            f.Error.Equals(specificError, StringComparison.OrdinalIgnoreCase));
+
                     foreach (var baselineExclude in baselineExcluded)
                     {
-                        baselineExcludeElements.Add(baselineExclude);
+                        baselineExcludeElements.Add(baselineExclude.Element);
                     }
                 }
             }


spelling: call in Microsoft.PackageManagement/providers/IPackageProvider.cs

--- src/Microsoft.PackageManagement/providers/IPackageProvider.cs
+++ src/Microsoft.PackageManagement/providers/IPackageProvider.cs
@@ -84,7 +84,7 @@
         /// <remarks>
         ///     PowerShellMetaProvider notes:
         ///         - may use Resolve-PackageSource as the function name
-        ///         - $request object is not passed as a parameter, but inserted as a variable before the ca New-PackageSource.
+        ///         - $request object is not passed as a parameter, but inserted as a variable before the New-PackageSource call.
         ///         - Values can be returned using Write-Object for objects returned from the function
         /// </remarks>
         void ResolvePackageSources(IRequest requestObject);


Ensure that if we have no trackers, CurrentTracker doesn't throw a null ref

svn path=/trunk/bitsharp/; revision=97134

--- src/MonoTorrent/MonoTorrent.Client/Managers/TrackerManager.cs
+++ src/MonoTorrent/MonoTorrent.Client/Managers/TrackerManager.cs
@@ -55,7 +55,13 @@
         /// </summary>
         public Tracker CurrentTracker
         {
-            get { return this.trackerTiers[0].Trackers[0]; }
+            get
+            {
+                if (this.trackerTiers.Length == 0 || this.trackerTiers[0].Trackers.Length == 0)
+                    return null;
+
+                return this.trackerTiers[0].Trackers[0];
+            }
         }

@@ -143,7 +149,7 @@
         /// <param name="clientEvent">The Event (if any) that represents this update</param>
         internal WaitHandle Announce(TorrentEvent clientEvent)
         {
-            return Announce(this.trackerTiers[0].Trackers[0], clientEvent, true);
+            return Announce(CurrentTracker, clientEvent, true);
         }

         public WaitHandle Announce(TrackerTier tier, Tracker tracker)


Fixed bad log message

Fixed bad log message

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@3333

--- src/NHibernate/Event/Default/AbstractFlushingEventListener.cs
+++ src/NHibernate/Event/Default/AbstractFlushingEventListener.cs
@@ -84,7 +84,7 @@
 					.Append(session.ActionQueue.CollectionRemovalsCount).Append(" removals to ")
 					.Append(persistenceContext.CollectionEntries.Count).Append(" collections");

-				log.Debug("EntitiesByKey:");
+				log.Debug(sb.ToString());
 				new Printer(session.Factory).ToString(persistenceContext.EntitiesByKey.Values.GetEnumerator());
 			}
 		}


Fixing custom url generation

Fixing custom url generation

--- src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs
+++ src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs
@@ -97,6 +97,9 @@
                     if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) {
                         url = _shellSettings.RequestUrlPrefix + "/" + url.Substring(2);
                     }
+                    else {
+                        url = url.Substring(2);
+                    }
                 }
                 if (!url.StartsWith("#")) {
                     var appPath = _urlHelper.RequestContext.HttpContext.Request.ApplicationPath;


Better support for arrays in ToDataNode()

--- LunarParser/Extensions.cs
+++ LunarParser/Extensions.cs
@@ -105,6 +105,36 @@
                 || type == typeof(string) || type == typeof(DateTime);
         }

+        private static DataNode FromArray(object obj, string arrayName = null)
+        {
+            var result = DataNode.CreateArray(arrayName);
+
+            var array = (Array)obj;
+            var type = array.GetType();
+
+            if (array != null && array.Length > 0)
+            {
+                var itemType = type.GetElementType();
+
+                for (int i = 0; i < array.Length; i++)
+                {
+                    var item = array.GetValue(i);
+
+                    if (itemType.IsPrimitive())
+                    {
+                        result.AddValue(item);
+                    }
+                    else
+                    {
+                        var itemNode = item.ToDataNode(null, true);
+                        result.AddNode(itemNode);
+                    }
+                }
+            }
+
+            return result;
+        }
+
         /// <summary>
         /// Converts an object to a DataSource
         /// </summary>
@@ -117,14 +147,47 @@

             Type type = obj.GetType();

-            var info = type.GetTypeInfo();
-            var fields = info.DeclaredFields.Where(f => f.IsPublic);
+            if (type.IsArray)
+            {
+                return FromArray(obj);
+            }
+            else
+            if (IsPrimitive(type))
+            {
+                throw new Exception("Can't convert primitive type to DataNode");
+            }
+
+            TypeInfo info = null;
+            var fields = Enumerable.Empty<FieldInfo>();
+
+            Type currentClass = type;
+            do
+            {
+                var currentInfo = currentClass.GetTypeInfo();
+                if (currentClass == type)
+                {
+                    info = currentInfo;
+                }
+
+                var temp = currentInfo.DeclaredFields.Where(f => f.IsPublic);
+
+                var fieldArray = temp.ToArray();
+
+                fields = temp.Concat(fields);
+
+                currentClass = currentInfo.BaseType;
+                if (currentClass == typeof(object))
+                {
+                    break;
+                }
+            } while (true);
+

             if (name == null && !isArrayElement)
             {
                 name = type.Name.ToLower();
             }
-
+
             var result = DataNode.CreateObject(name);

             foreach (var field in fields)
@@ -132,30 +195,16 @@
                 var val = field.GetValue(obj);

                 var fieldName = field.Name.ToLower();
-                var typeInfo = field.FieldType.GetTypeInfo();
-
-                if (field.FieldType.IsPrimitive() || typeInfo.IsEnum)
+                var fieldTypeInfo = field.FieldType.GetTypeInfo();
+
+                if (field.FieldType.IsPrimitive() || fieldTypeInfo.IsEnum)
                 {
                     result.AddField(fieldName, val);
                 }
                 else
-                if (typeInfo.IsArray)
-                {
-                    var arrayNode = DataNode.CreateArray(fieldName);
-
-                    var array = (Array)val;
-                    if (array != null && array.Length > 0)
-                    {
-                        var elementType = type.GetElementType();
-                        for (int i = 0; i < array.Length; i++)
-                        {
-                            var item = array.GetValue(i);
-
-                            var itemNode = item.ToDataNode(null, true);
-                            arrayNode.AddNode(itemNode);
-                        }
-                    }
-
+                if (fieldTypeInfo.IsArray)
+                {
+                    var arrayNode = FromArray(val, fieldName);
                     result.AddNode(arrayNode);
                 }
                 else


Changing Parse to TryParse and code tidy with C#7 out var

--- Ao3TrackReader/Ao3TrackReader/Data/Ao3SiteDataLookup.cs
+++ Ao3TrackReader/Ao3TrackReader/Data/Ao3SiteDataLookup.cs
@@ -938,59 +938,19 @@

             model.Language = stats?.ElementByClass("dd", "language")?.InnerText?.HtmlDecode()?.Trim();

-            try
-            {
-                if (stats != null) model.Details.Words = int.Parse(stats.ElementByClass("dd", "words")?.InnerText?.HtmlDecode()?.Replace(",", ""));
-            }
-            catch
-            {
-
-            }
-
-            try
-            {
-                if (stats != null) model.Details.Collections = int.Parse(stats.ElementByClass("dd", "collections")?.InnerText?.HtmlDecode());
-            }
-            catch
-            {
-
-            }
-
-            try
-            {
-                if (stats != null) model.Details.Comments = int.Parse(stats.ElementByClass("dd", "comments")?.InnerText?.HtmlDecode());
-            }
-            catch
-            {
-
-            }
-
-            try
-            {
-                if (stats != null) model.Details.Kudos = int.Parse(stats.ElementByClass("dd", "kudos")?.InnerText?.HtmlDecode());
-            }
-            catch
-            {
-
-            }
-
-            try
-            {
-                if (stats != null) model.Details.Bookmarks = int.Parse(stats.ElementByClass("dd", "bookmarks")?.InnerText?.HtmlDecode());
-            }
-            catch
-            {
-
-            }
-
-            try
-            {
-                if (stats != null) model.Details.Hits = int.Parse(stats.ElementByClass("dd", "hits")?.InnerText?.HtmlDecode());
-            }
-            catch
-            {
-
-            }
+            int intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "words")?.InnerText?.HtmlDecode()?.Replace(",", ""), out intval))
+                model.Details.Words = intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "collections")?.InnerText?.HtmlDecode(), out intval))
+                model.Details.Collections = intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "comments")?.InnerText?.HtmlDecode(), out intval))
+                model.Details.Comments = intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "kudos")?.InnerText?.HtmlDecode(), out intval))
+                model.Details.Kudos = intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "bookmarks")?.InnerText?.HtmlDecode(), out intval))
+                model.Details.Bookmarks = intval;
+            if (stats != null && int.TryParse(stats.ElementByClass("dd", "hits")?.InnerText?.HtmlDecode(), out intval))
+                model.Details.Hits = intval;

             // Series

@@ -1010,14 +970,8 @@
                     var part = n.Element("strong")?.InnerText?.HtmlDecode();
                     if (String.IsNullOrWhiteSpace(part)) continue;

-                    try
-                    {
-                        series[uri.AbsoluteUri] = new Ao3SeriesLink(int.Parse(part), link.InnerText?.HtmlDecode());
-                    }
-                    catch
-                    {
-
-                    }
+                    if (int.TryParse(part, out intval))
+                        series[uri.AbsoluteUri] = new Ao3SeriesLink(intval, link.InnerText?.HtmlDecode());

                 }
                 if (series.Count > 0) model.Details.Series = series;
@@ -1026,18 +980,12 @@
             var chapters = stats?.ElementByClass("dd", "chapters")?.InnerText?.Trim()?.Split('/');
             if (chapters != null)
             {
-                try
-                {
                     int? total;
                     if (chapters[1] == "?") total = null;
                     else total = int.Parse(chapters[1]);

-                    model.Details.Chapters = new Ao3ChapterDetails(int.Parse(chapters[0]), total);
-                }
-                catch
-                {
-
-                }
+                    if (int.TryParse(chapters[0],out intval))
+                        model.Details.Chapters = new Ao3ChapterDetails(intval, total);
             }

             // Horrible horrible dirty grabbing of the summary
@@ -1049,7 +997,7 @@
                 {
                     model.Details.Summary = HtmlConverter.ConvertNode(summarynode);
                 }
-                catch
+                catch (Exception)
                 {

                 }
@@ -1135,43 +1083,41 @@
                                 while (sdd.Name == "#text") sdd = sdd.NextSibling;
                                 if (sdd.Name != "dd") continue;

-                                try
+                                int intval;
+                                switch (sdt.InnerText.HtmlDecode().Trim())
                                 {
-                                    switch (sdt.InnerText.HtmlDecode().Trim())
-                                    {
-                                        case "Words:":
-                                            model.Details.Words = int.Parse(sdd.InnerText.HtmlDecode().Replace(",", ""));
-                                            break;
-
-                                        case "Works:":
-                                            model.Details.Works = int.Parse(sdd.InnerText.HtmlDecode());
-                                            break;
-
-                                        case "Complete:":
-                                            switch (sdd.InnerText.HtmlDecode().Trim())
-                                            {
-                                                case "Yes":
-                                                    complete = true;
-                                                    model.RequiredTags[Ao3RequiredTag.Complete] = new Ao3RequredTagData("complete-yes", "Complete");
-                                                    break;
-
-                                                case "No":
-                                                    model.RequiredTags[Ao3RequiredTag.Complete] = new Ao3RequredTagData("complete-no", "Incomplete");
-                                                    break;
-
-                                                default:
-                                                    break;
-                                            }
-
-                                            break;
-
-                                        case "Bookmarks:":
-                                            model.Details.Bookmarks = int.Parse(sdd.InnerText.HtmlDecode());
-                                            break;
-                                    }
-                                }
-                                catch (Exception)
-                                {
+                                    case "Words:":
+                                        if (int.TryParse(sdd.InnerText.HtmlDecode().Replace(",", ""), out intval))
+                                            model.Details.Words = intval;
+                                        break;
+
+                                    case "Works:":
+                                        if (int.TryParse(sdd.InnerText.HtmlDecode(), out intval))
+                                            model.Details.Works = intval;
+                                        break;
+
+                                    case "Complete:":
+                                        switch (sdd.InnerText.HtmlDecode().Trim())
+                                        {
+                                            case "Yes":
+                                                complete = true;
+                                                model.RequiredTags[Ao3RequiredTag.Complete] = new Ao3RequredTagData("complete-yes", "Complete");
+                                                break;
+
+                                            case "No":
+                                                model.RequiredTags[Ao3RequiredTag.Complete] = new Ao3RequredTagData("complete-no", "Incomplete");
+                                                break;
+
+                                            default:
+                                                break;
+                                        }
+
+                                        break;
+
+                                    case "Bookmarks:":
+                                        if (int.TryParse(sdd.InnerText.HtmlDecode(),out intval))
+                                            model.Details.Bookmarks = intval;
+                                        break;
                                 }
                             }
                             break;
@@ -1197,8 +1143,7 @@
                 // Coalate tags
                 foreach (var kvp in workmodel.Tags)
                 {
-                    List<string> list;
-                    if (!tags.TryGetValue(kvp.Key, out list)) tags[kvp.Key] = list = new List<string>();
+                    if (!tags.TryGetValue(kvp.Key, out var list)) tags[kvp.Key] = list = new List<string>();

                     foreach (var tag in kvp.Value)
                     {
@@ -1209,8 +1154,7 @@
                 // Coalate required tags
                 foreach (var kvp in RequiredTagToType)
                 {
-                    Ao3RequredTagData reqTag;
-                    if (workmodel.RequiredTags.TryGetValue(kvp.Key, out reqTag))
+                    if (workmodel.RequiredTags.TryGetValue(kvp.Key, out var reqTag))
                     {
                         List<string> list;
                         if (!tags.TryGetValue(kvp.Value, out list))
@@ -1245,24 +1189,21 @@
             List<string> req;
             if (tags.TryGetValue(Ao3TagType.Warnings, out req))
             {
-                string sclass;
-                if (req.Count == 1 && reqtags.TryGetValue(req[0], out sclass))
+                if (req.Count == 1 && reqtags.TryGetValue(req[0], out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Warnings] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Warnings] = new Ao3RequredTagData("warning-yes", string.Join(", ", req));
             }
             if (tags.TryGetValue(Ao3TagType.Category, out req))
             {
-                string sclass;
-                if (req.Count == 1 && reqtags.TryGetValue(req[0], out sclass))
+                if (req.Count == 1 && reqtags.TryGetValue(req[0], out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Category] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Category] = new Ao3RequredTagData("category-multi", string.Join(", ", req));
             }
             if (tags.TryGetValue(Ao3TagType.Rating, out req))
             {
-                string sclass;
-                if (req.Count == 1 && reqtags.TryGetValue(req[0], out sclass))
+                if (req.Count == 1 && reqtags.TryGetValue(req[0], out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Rating] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Rating] = new Ao3RequredTagData("rating-na", string.Join(", ", req));
@@ -1298,9 +1239,8 @@

             foreach (var i in Enum.GetValues(typeof(Ao3TagType)))
             {
-                List<string> tagids;
                 var name = "work_search[" + i.ToString().ToLowerInvariant().TrimEnd('s') + "_ids][]";
-                if (query.TryGetValue(name, out tagids))
+                if (query.TryGetValue(name, out var tagids))
                 {
                     foreach (var s in tagids)
                     {
@@ -1332,8 +1272,7 @@

             if (query.ContainsKey("work_search[language_id]"))
             {
-                int id;
-                if (int.TryParse(query["work_search[language_id]"][0], out id))
+                if (int.TryParse(query["work_search[language_id]"][0], out int id))
                 {
                     tasks.Add(Task.Run(async () =>
                     {
@@ -1397,8 +1336,7 @@

                 if (t.Value.Item2 != 0) idmap[t.Value.Item1] = t.Value.Item2;

-                List<string> list;
-                if (!tags.TryGetValue(t.Key, out list))
+                if (!tags.TryGetValue(t.Key, out var list))
                 {
                     tags[t.Key] = list = new List<string>();
                 }
@@ -1410,27 +1348,21 @@
             List<string> req;
             if (tags.TryGetValue(Ao3TagType.Warnings, out req))
             {
-                int id = 0;
-                string sclass;
-                if (req.Count == 1 && idmap.TryGetValue(req[0], out id) && TagIdToReqClass.TryGetValue(id, out sclass))
+                if (req.Count == 1 && idmap.TryGetValue(req[0], out int id) && TagIdToReqClass.TryGetValue(id, out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Warnings] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Warnings] = new Ao3RequredTagData("warning-yes", string.Join(", ", req));
             }
             if (tags.TryGetValue(Ao3TagType.Category, out req))
             {
-                int id = 0;
-                string sclass;
-                if (req.Count == 1 && idmap.TryGetValue(req[0], out id) && TagIdToReqClass.TryGetValue(id, out sclass))
+                if (req.Count == 1 && idmap.TryGetValue(req[0], out int id) && TagIdToReqClass.TryGetValue(id, out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Category] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Category] = new Ao3RequredTagData("category-multi", string.Join(", ", req));
             }
             if (tags.TryGetValue(Ao3TagType.Rating, out req))
             {
-                int id = 0;
-                string sclass;
-                if (req.Count == 1 && idmap.TryGetValue(req[0], out id) && TagIdToReqClass.TryGetValue(id, out sclass))
+                if (req.Count == 1 && idmap.TryGetValue(req[0], out int id) && TagIdToReqClass.TryGetValue(id, out string sclass))
                     model.RequiredTags[Ao3RequiredTag.Rating] = new Ao3RequredTagData(sclass, req[0]);
                 else
                     model.RequiredTags[Ao3RequiredTag.Rating] = new Ao3RequredTagData("rating-na", string.Join(", ", req));


MAINT: dispose NotifyIcon when app is closing

--- MPLite/MainWindow.xaml.cs
+++ MPLite/MainWindow.xaml.cs
@@ -272,6 +272,7 @@

         private void winMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
         {
+            notifyIcon.Dispose();
             Properties.Settings.Default.WindowHeight = this.ActualHeight;
             Properties.Settings.Default.WindowWidth = this.ActualWidth;
             Properties.Settings.Default.Save();


ReflectionFunction getStartLine(), getEndLine() always return integer

--- src/Peachpie.Library/Reflection/ReflectionFunctionAbstract.cs
+++ src/Peachpie.Library/Reflection/ReflectionFunctionAbstract.cs
@@ -58,18 +58,16 @@
         [return: CastToFalse]
         public string getDocComment() => ReflectionUtils.getDocComment(_routine.Methods[0]);

-        [return: CastToFalse]
-        public long getStartLine()
+        public virtual long getStartLine()
         {
             PhpException.FunctionNotSupported("ReflectionFunctionAbstract::getStartLine");
-            return -1;
+            return 0;
         }

-        [return: CastToFalse]
-        public long getEndLine()
+        public virtual long getEndLine()
         {
             PhpException.FunctionNotSupported("ReflectionFunctionAbstract::getEndLine");
-            return -1;
+            return 0;
         }

         public ReflectionExtension getExtension()


Update to new switch (#43285)

Update to new switch (#43285)

--- src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs
+++ src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs
@@ -310,34 +310,24 @@
         {
             // Order sensitive, some of these exceptions derive from others
             // and we want to display the most specific message possible.
-            switch (ex)
-            {
-                case SecurityTokenInvalidAudienceException stia:
-                    messages.Add($"The audience '{stia.InvalidAudience ?? "(null)"}' is invalid");
-                    break;
-                case SecurityTokenInvalidIssuerException stii:
-                    messages.Add($"The issuer '{stii.InvalidIssuer ?? "(null)"}' is invalid");
-                    break;
-                case SecurityTokenNoExpirationException _:
-                    messages.Add("The token has no expiration");
-                    break;
-                case SecurityTokenInvalidLifetimeException stil:
-                    messages.Add("The token lifetime is invalid; NotBefore: "
-                        + $"'{stil.NotBefore?.ToString(CultureInfo.InvariantCulture) ?? "(null)"}'"
-                        + $", Expires: '{stil.Expires?.ToString(CultureInfo.InvariantCulture) ?? "(null)"}'");
-                    break;
-                case SecurityTokenNotYetValidException stnyv:
-                    messages.Add($"The token is not valid before '{stnyv.NotBefore.ToString(CultureInfo.InvariantCulture)}'");
-                    break;
-                case SecurityTokenExpiredException ste:
-                    messages.Add($"The token expired at '{ste.Expires.ToString(CultureInfo.InvariantCulture)}'");
-                    break;
-                case SecurityTokenSignatureKeyNotFoundException _:
-                    messages.Add("The signature key was not found");
-                    break;
-                case SecurityTokenInvalidSignatureException _:
-                    messages.Add("The signature is invalid");
-                    break;
+            string? message = ex switch
+            {
+                SecurityTokenInvalidAudienceException stia => $"The audience '{stia.InvalidAudience ?? "(null)"}' is invalid",
+                SecurityTokenInvalidIssuerException stii => $"The issuer '{stii.InvalidIssuer ?? "(null)"}' is invalid",
+                SecurityTokenNoExpirationException _ => "The token has no expiration",
+                SecurityTokenInvalidLifetimeException stil => "The token lifetime is invalid; NotBefore: "
+                    + $"'{stil.NotBefore?.ToString(CultureInfo.InvariantCulture) ?? "(null)"}'"
+                    + $", Expires: '{stil.Expires?.ToString(CultureInfo.InvariantCulture) ?? "(null)"}'",
+                SecurityTokenNotYetValidException stnyv => $"The token is not valid before '{stnyv.NotBefore.ToString(CultureInfo.InvariantCulture)}'",
+                SecurityTokenExpiredException ste => $"The token expired at '{ste.Expires.ToString(CultureInfo.InvariantCulture)}'",
+                SecurityTokenSignatureKeyNotFoundException _ => "The signature key was not found",
+                SecurityTokenInvalidSignatureException _ => "The signature is invalid",
+                _ => null,
+            };
+
+            if (message is not null)
+            {
+                messages.Add(message);
             }
         }


Removed debugging readline.

Removed debugging readline.

--- src/dotnet-new3/Program.cs
+++ src/dotnet-new3/Program.cs
@@ -18,8 +18,6 @@
     {
         public static int Main(string[] args)
         {
-            Console.ReadLine();
-
             CommandLineApplication app = new CommandLineApplication(false)
             {
                 Name = "dotnet new3",


long line fix

long line fix

--- src/Selenium.WebDriver.Extensions/Selectors/JQuerySelector.cs
+++ src/Selenium.WebDriver.Extensions/Selectors/JQuerySelector.cs
@@ -20,7 +20,8 @@
         /// </summary>
         /// <param name="selector">A string containing a selector expression.</param>
         /// <remarks>
-        /// This constructor cannot be merged with <see cref="M:Selenium.WebDriver.Extensions.JQuerySelector.#ctor(System.String,Selenium.WebDriver.Extensions.JQuerySelector,System.String,System.String)" />
+        /// This constructor cannot be merged with
+        /// <see cref="M:Selenium.WebDriver.Extensions.JQuerySelector.#ctor(System.String,Selenium.WebDriver.Extensions.JQuerySelector,System.String,System.String)" />
         /// constructor as it is resolved by reflection.
         /// </remarks>
         [SuppressMessage("ReSharper", "IntroduceOptionalParameters.Global")]


try-catch for exceptions that can be thrown during a SectionThreadTest

--- test/UnitTests/UnitTests/Tests/SectionThreadTest.cs
+++ test/UnitTests/UnitTests/Tests/SectionThreadTest.cs
@@ -1,4 +1,5 @@
 using epvpapi;
+using epvpapi.Connection;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using System;
 using System.Collections.Generic;
@@ -16,18 +17,31 @@
         {
             // http://www.elitepvpers.com/forum/main/619408-shoutbox-rules-regeln.html
             var testThread = new SectionThread(619408, Section.Main);
-            var replies = testThread.Replies(TestEnvironment.Session);
-            Assert.AreNotEqual(0, replies.Count, "No replies were pulled from the test thread");

-            foreach(var reply in replies)
+            try
             {
-                Assert.AreNotEqual(0, reply.ID, "The ID of a reply was not set");
-                Assert.AreNotEqual(0, reply.Content.Length, "The content of a reply was not set");
-                Assert.AreNotEqual(default(DateTime), reply.Date, "The date and time of a reply was not set");
-                Assert.AreNotEqual(0, reply.Sender.ID, "The ID of a reply sender was not set");
-                Assert.AreNotEqual(0, reply.Sender.Name.Length, "The name of a reply was not set");
-                Assert.AreNotEqual(0, reply.Sender.Title.Length, "The user title of a reply sender was not set");
-                Assert.AreNotEqual(default(DateTime), reply.Sender.JoinDate, "The join date of a reply sender was not set");
+                var replies = testThread.Replies(TestEnvironment.Session);
+                Assert.AreNotEqual(0, replies.Count, "No replies were pulled from the test thread");
+
+                foreach (var reply in replies)
+                {
+                    Assert.AreNotEqual(0, reply.ID, "The ID of a reply was not set");
+                    Assert.AreNotEqual(0, reply.Content.Length, "The content of a reply was not set");
+                    Assert.AreNotEqual(default(DateTime), reply.Date, "The date and time of a reply was not set");
+                    Assert.AreNotEqual(0, reply.Sender.ID, "The ID of a reply sender was not set");
+                    Assert.AreNotEqual(0, reply.Sender.Name.Length, "The name of a reply was not set");
+                    Assert.AreNotEqual(0, reply.Sender.Title.Length, "The user title of a reply sender was not set");
+                    Assert.AreNotEqual(default(DateTime), reply.Sender.JoinDate,
+                        "The join date of a reply sender was not set");
+                }
+            }
+            catch (RequestFailedException exc)
+            {
+                AssertExtender.Exception("A HTTP request failed", exc);
+            }
+            catch (InvalidSessionException exc)
+            {
+                AssertExtender.Exception("Session is invalid", exc);
             }
         }
     }


Early-bird tickets are sold out

Early-bird tickets are sold out

--- src/Swetugg.Web/Areas/Sthlm2020/Views/Conference/Index.cshtml
+++ src/Swetugg.Web/Areas/Sthlm2020/Views/Conference/Index.cshtml
@@ -540,7 +540,7 @@

Invoice?

                         Do you wish to buy more than five tickets and/or prefer an invoice? Contact us at invoice@swetugg.se. For 5 tickets or less
-                        we charge an extra fee of 100kr for invoices. Due to manual invoice processing delay we don't recommend buying with invoice during Early Bird ticket sale. If Early Bird tickets are sold out shortly after your invoice order, you will be charged full price (3 000 SEK per ticket).
+                        we charge an extra fee of 100kr for invoices.

                 }
                 else


Log elapsed

Log elapsed

--- src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs
+++ src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs
@@ -133,7 +133,7 @@

                         triggerResponseWrite.SetResult(true);
                         _output.WriteLine("ReadAsync() completed at: {0}", stopwatch.Elapsed.ToString());
-                        Assert.True(stopwatch.Elapsed < new TimeSpan(0, 0, 10), "Elapsed time should be short");
+                        Assert.True(stopwatch.Elapsed < new TimeSpan(0, 0, 10), $"Elapsed time {stopwatch.Elapsed} should be short");
                     }
                 });
             }


Fix build error with mirroring

Fix build error with mirroring

--- src/System.Private.CoreLib/src/System/DateTime.Unix.CoreRT.cs
+++ src/System.Private.CoreLib/src/System/DateTime.Unix.CoreRT.cs
@@ -11,7 +11,7 @@
             get
             {
                 // For performance, use a private constructor that does not validate arguments.
-                return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + TicksTo1970)) | KindUtc);
+                return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + DateTime.UnixEpochTicks)) | KindUtc);
             }
         }
     }


little clean up

little clean up

--- src/TwitterQuiz/Controllers/AuthenticationCallbackProvider.cs
+++ src/TwitterQuiz/Controllers/AuthenticationCallbackProvider.cs
@@ -33,20 +33,14 @@
                 _eventStoreConnection.AppendToStream(user, new { Created = DateTime.Now });
             }

-            // TODO: Create auth token
-            var ticket = new FormsAuthenticationTicket(1, // version
-                                                       user.Username, // user name
-                                                       DateTime.Now, // create time
-                                                       DateTime.Now.AddSeconds(30), // expire time
-                                                       false, // persistent
-                                                       ""); // user data, such as roles
+            // Create auth token
+            var ticket = new FormsAuthenticationTicket(1, user.Username, DateTime.Now, DateTime.Now.AddMinutes(30), false, "");

             var strEncryptedTicket = FormsAuthentication.Encrypt(ticket);
             var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, strEncryptedTicket);
             context.Response.Cookies.Add(cookie);

-            context.Response.Redirect(model.ReturnUrl);
-            return null;
+            return new RedirectResult(model.ReturnUrl);
         }

         public ActionResult OnRedirectToAuthenticationProviderError(HttpContextBase context, string errorMessage)


No need to warn if attribute is not present Adds some logging about indexing being done.. the number of committed items seems to differ a little from the number of items in the index, not sure wh

--- src/Umbraco.Web/WebServices/ExamineManagementApiController.cs
+++ src/Umbraco.Web/WebServices/ExamineManagementApiController.cs
@@ -166,6 +166,8 @@
             var msg = ValidateLuceneIndexer(indexerName, out indexer);
             if (msg.IsSuccessStatusCode)
             {
+                LogHelper.Info<ExamineManagementApiController>(string.Format("Rebuilding index '{0}'", indexerName));
+
                 //remove it in case there's a handler there alraedy
                 indexer.IndexOperationComplete -= Indexer_IndexOperationComplete;
                 //now add a single handler
@@ -200,6 +202,8 @@

             //ensure it's not listening anymore
             indexer.IndexOperationComplete -= Indexer_IndexOperationComplete;
+
+            LogHelper.Info<ExamineManagementApiController>(string.Format("Rebuilding index '{0}' done, {1} items committed (can differ from the number of items in the index)", indexer.Name, indexer.CommitCount));

             var cacheKey = "temp_indexing_op_" + indexer.Name;
             ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(cacheKey);
@@ -266,7 +270,10 @@
                 var val = p.GetValue(indexer, null);
                 if (val == null)
                 {
-                    LogHelper.Warn<ExamineManagementApiController>("Property value was null when setting up property on indexer: " + indexer.Name + " property: " + p.Name);
+                    // Do not warn for new new attribute that is optional
+                    if(string.Equals(p.Name, "DirectoryFactory", StringComparison.InvariantCultureIgnoreCase) == false)
+                        LogHelper.Warn<ExamineManagementApiController>("Property value was null when setting up property on indexer: " + indexer.Name + " property: " + p.Name);
+
                     val = string.Empty;
                 }
                 indexerModel.ProviderProperties.Add(p.Name, val.ToString());


CAR-2245: Passing Pool_update to the precheck page

Signed-off-by: Gabor Apati-Nagy <fea1aad7ceb67d3aeb88acb6b51e51467c21418e@citrix.com>

--- XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs
+++ XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs
@@ -188,6 +188,7 @@

                     PatchingWizard_PatchingPage.Patch = PatchingWizard_UploadPage.Patch;
                 }
+                PatchingWizard_PrecheckPage.Pool_update = PatchingWizard_UploadPage.PoolUpdate;
                 PatchingWizard_PatchingPage.PoolUpdate = PatchingWizard_UploadPage.PoolUpdate;
                 PatchingWizard_ModePage.PoolUpdate = PatchingWizard_UploadPage.PoolUpdate;
                 PatchingWizard_PatchingPage.SuppPackVdis = PatchingWizard_UploadPage.SuppPackVdis;


[Gtk] Fixed scrolling range issue

[Gtk] Fixed scrolling range issue

Looks like GTK doesn't like Gtk.Adjustment.Lower to have
a negative value. We now always set a positive value.

--- Xwt.Gtk/Xwt.GtkBackend/ScrollAdjustmentBackend.cs
+++ Xwt.Gtk/Xwt.GtkBackend/ScrollAdjustmentBackend.cs
@@ -88,29 +88,39 @@
 		#region IScrollAdjustmentBackend implementation
 		public double Value {
 			get {
-				return adjustment.Value;
+				return lower + adjustment.Value;
 			}
 			set {
-				adjustment.Value = value;
+				adjustment.Value = value - lower;
 			}
 		}

+		double lower;
 		public double LowerValue {
 			get {
-				return adjustment.Lower;
+				return lower;
 			}
 			set {
-				adjustment.Lower = value;
+				lower = value;
+				UpdateRange ();
 			}
 		}

+		double upper;
 		public double UpperValue {
 			get {
-				return adjustment.Upper;
+				return upper;
 			}
 			set {
-				adjustment.Upper = value;
+				upper = value;
+				UpdateRange ();
 			}
+		}
+
+		void UpdateRange ()
+		{
+			var newUpper = upper - lower;
+			adjustment.Upper = newUpper >= 0 ? newUpper : 0;
 		}

 		public double PageIncrement {


C#: Throw an exception in get_trigger if the C function returns an error

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>

--- bindings/csharp/Device.cs
+++ bindings/csharp/Device.cs
@@ -118,6 +118,9 @@
         {
             IntPtr ptr = (IntPtr)0;
             int err = iio_device_get_trigger(this.dev, ptr);
+            if (err < 0)
+                throw new Exception("Unable to get trigger: err=" + err);
+
             ptr = Marshal.ReadIntPtr(ptr);

             foreach (Trigger trig in ctx.get_devices()) {


reverted refactor

reverted refactor

--- Ocaramba/DriverContext.cs
+++ Ocaramba/DriverContext.cs
@@ -550,38 +550,44 @@
             NameValueCollection settings =
                 ConfigurationManager.GetSection("environments/" + this.CrossBrowserEnvironment) as NameValueCollection;
             var browserType = this.GetBrowserTypeForRemoteDriver(settings);
-
-            dynamic browserOptions = null;
             switch (browserType)
             {
                 case BrowserType.Firefox:
-                    browserOptions = new FirefoxOptions();
-
+                    FirefoxOptions firefoxOptions = new FirefoxOptions();
+                    firefoxOptions.Proxy = this.CurrentProxy();
+                    this.SetRemoteDriverBrowserOptions(driverCapabilitiesConf, settings, firefoxOptions);
+                    this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetDriverOptions(firefoxOptions).ToCapabilities());
                     break;
                 case BrowserType.Android:
                 case BrowserType.Chrome:
-                    browserOptions = new ChromeOptions();
+                    ChromeOptions chromeOptions = new ChromeOptions();
+                    chromeOptions.Proxy = this.CurrentProxy();
+                    this.SetRemoteDriverBrowserOptions(driverCapabilitiesConf, settings, chromeOptions);
+                    this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetDriverOptions(chromeOptions).ToCapabilities());
                     break;
                 case BrowserType.Iphone:
                 case BrowserType.Safari:
-                    browserOptions = new SafariOptions();
+                    SafariOptions safariOptions = new SafariOptions();
+                    safariOptions.Proxy =this.CurrentProxy();
+                    this.SetRemoteDriverOptions(driverCapabilitiesConf, settings, safariOptions);
+                    this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetDriverOptions(safariOptions).ToCapabilities());
                     break;
                 case BrowserType.Edge:
-                    browserOptions = new EdgeOptions();
+                    EdgeOptions egEdgeOptions = new EdgeOptions();
+                    this.SetRemoteDriverOptions(driverCapabilitiesConf, settings, egEdgeOptions);
+                    this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetDriverOptions(egEdgeOptions).ToCapabilities());
                     break;
                 case BrowserType.IE:
                 case BrowserType.InternetExplorer:
-                    browserOptions = new InternetExplorerOptions();
-
+                    InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();
+                    internetExplorerOptions.Proxy = this.CurrentProxy();
+                    this.SetRemoteDriverBrowserOptions(driverCapabilitiesConf, settings, internetExplorerOptions);
+                    this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub,this.SetDriverOptions(internetExplorerOptions).ToCapabilities());
                     break;
                 default:
                     throw new NotSupportedException(
                         string.Format(CultureInfo.CurrentCulture, "Driver {0} is not supported", this.CrossBrowserEnvironment));
             }
-
-            browserOptions.Proxy = this.CurrentProxy();
-            this.SetRemoteDriverBrowserOptions(driverCapabilitiesConf, settings, browserOptions);
-            this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetDriverOptions(browserOptions).ToCapabilities(), BaseConfiguration.RemoteWebDriverTimeout);
         }
     }
 }


add variant to report

add variant to report

--- Onfido/Entities/Report.cs
+++ Onfido/Entities/Report.cs
@@ -18,6 +18,9 @@
         [JsonProperty("status")]
         public string Status;

+        [JsonProperty("variant")]
+        public string Variant;
+
         [JsonProperty("result")]
         public string Result;


Change default directory of game content from "." to "./data"

--- OpenKh.Game/OpenKhGame.cs
+++ OpenKh.Game/OpenKhGame.cs
@@ -13,7 +13,7 @@
 {
     public class OpenKhGame : Microsoft.Xna.Framework.Game, IStateChange
     {
-        private const string DefaultContentPath = ".";
+        private const string DefaultContentPath = "./data";
         private GraphicsDeviceManager graphics;

         private readonly IDataContent _dataContent;


Fixed TakeItemFromPokemon

Fixed TakeItemFromPokemon

was out of range

--- PROProtocol/GameClient.cs
+++ PROProtocol/GameClient.cs
@@ -377,12 +377,12 @@
             }
             SendPacket(toSend);
         }
-
+
         public void SendGiveItem(int pokemonId, int itemId)
         {
             SendMessage("/giveitem " + pokemonId + "," + itemId);
         }
-
+
         public void SendTakeItem(int pokemonId)
         {
             SendMessage("/takeitem " + pokemonId);
@@ -471,7 +471,7 @@
                 }
             }
         }
-
+
         public bool GiveItemToPokemon(int pokemonUid, int itemId)
         {
             if (!(pokemonUid >= 1 && pokemonUid <= Team.Count))
@@ -493,14 +493,14 @@
             }
             return false;
         }
-
+
         public bool TakeItemFromPokemon(int pokemonUid)
         {
             if (!(pokemonUid >= 1 && pokemonUid <= Team.Count))
             {
                 return false;
             }
-            if (!_itemUseTimeout.IsActive && Team[pokemonUid].ItemHeld != "")
+            if (!_itemUseTimeout.IsActive && Team[pokemonUid - 1].ItemHeld != "")
             {
                 SendTakeItem(pokemonUid);
                 _itemUseTimeout.Set();


Fixed delegate issue

Fixed delegate issue

--- Patchy/MainWindow.xaml.cs
+++ Patchy/MainWindow.xaml.cs
@@ -61,7 +61,7 @@
             Initialize();
             Timer = new Timer(o => // Used for updating periodic objects and the notify icon
                 {
-                    Dispatcher.Invoke(() =>
+                    Dispatcher.Invoke(new Action(() =>
                         {
                             CheckMagnetLinks();
                             foreach (var torrent in Client.Torrents)
@@ -94,7 +94,7 @@
                                     Client.Torrents.Count,
                                     Client.Torrents.Count == 1 ? "" : "s");
                             }
-                        });
+                        }));
                 }, null, 1000, 1000);
         }

@@ -189,7 +189,7 @@

         void torrent_PeerDisconnected(object sender, PeerConnectionEventArgs e)
         {
-            Dispatcher.Invoke(() =>
+            Dispatcher.Invoke(new Action(() =>
             {
                 var torrent = sender as Torrent;
                 if (torrent == null)
@@ -198,12 +198,12 @@
                 if (periodicTorrent == null)
                     return;
                 periodicTorrent.PeerList.Remove(e.PeerID);
-            });
+            }));
         }

         void torrent_PeerConnected(object sender, PeerConnectionEventArgs e)
         {
-            Dispatcher.Invoke(() =>
+            Dispatcher.Invoke(new Action(() =>
                 {
                     var torrent = sender as Torrent;
                     if (torrent == null)
@@ -212,7 +212,7 @@
                     if (periodicTorrent == null)
                         return;
                     periodicTorrent.PeerList.Add(e.PeerID);
-                });
+                }));
         }

         private void ExecuteExit(object sender, ExecutedRoutedEventArgs e)


un win sequence

un win sequence

--- PewPew/MainWindow.xaml.cs
+++ PewPew/MainWindow.xaml.cs
@@ -180,7 +180,7 @@
             winningSoundPlayer.ScrubbingEnabled = true;
             winningSoundPlayer.Source = new Uri((@"../../sounds/win.mp3"), UriKind.Relative);
             winningSoundPlayer.Volume = 10;
-            playWinSequence();
+

             //DoubleAnimation explosionFader = new DoubleAnimation();
             //explosionFader.From = 0.0;


Fixed error if text is missing during logging

--- src/func/ActivateDevice.cs
+++ src/func/ActivateDevice.cs
@@ -32,7 +32,7 @@

             if (string.IsNullOrWhiteSpace(slackRequest.Text) || slackRequest.Text.Trim().Length != RegisterDeviceCommand.CodeLength)
             {
-                log.Verbose($"Invalid Code {slackRequest.Text.Trim()}");
+                log.Verbose($"Invalid Code {slackRequest.Text?.Trim()}");
                 return req.CreateResponse(HttpStatusCode.BadRequest, new SlackSlashCommandResponse
                 {
                     ResponseType = MessageResponseType.Ephemeral,


Simplify invalidate override.

Simplify invalidate override.

--- osu.Framework/Graphics/Containers/AutoSizeContainer.cs
+++ osu.Framework/Graphics/Containers/AutoSizeContainer.cs
@@ -22,9 +22,7 @@
             if ((invalidation & Invalidation.SizeInParentSpace) > 0)
                 autoSize.Invalidate();

-            bool alreadyInvalidated = base.Invalidate(invalidation, source, shallPropagate);
-
-            return !alreadyInvalidated;
+            return base.Invalidate(invalidation, source, shallPropagate);
         }

         protected override Quad DrawQuadForBounds


Expose a new method that is invoked after UpdateChildrenLife

--- osu.Framework/Graphics/Containers/CompositeDrawable.cs
+++ osu.Framework/Graphics/Containers/CompositeDrawable.cs
@@ -477,6 +477,8 @@
             // for children, as they should never affect our present status.
             if (!IsPresent || !RequiresChildrenUpdate) return false;

+            UpdateAfterChildrenLife();
+
             // We iterate by index to gain performance
             // ReSharper disable once ForCanBeConvertedToForeach
             for (int i = 0; i < aliveInternalChildren.Count; ++i)
@@ -497,6 +499,15 @@
             updateChildrenSizeDependencies();
             UpdateAfterAutoSize();
             return true;
+        }
+
+        /// <summary>
+        /// Invoked after <see cref="UpdateChildrenLife"/> and <see cref="Drawable.IsPresent"/> state checks have taken place,
+        /// but before <see cref="Drawable.UpdateSubTree"/> is invoked for all <see cref="InternalChildren"/>.
+        /// This occurs after <see cref="Drawable.Update"/> has been invoked on this <see cref="CompositeDrawable"/>
+        /// </summary>
+        protected virtual void UpdateAfterChildrenLife()
+        {
         }

         /// <summary>


Access SafeAreaPadding via IBindable

Access SafeAreaPadding via IBindable

--- osu.Framework/Graphics/Containers/SafeAreaContainer.cs
+++ osu.Framework/Graphics/Containers/SafeAreaContainer.cs
@@ -24,7 +24,7 @@
         [Resolved]
         private GameHost host { get; set; }

-        private readonly BindableMarginPadding safeAreaPadding = new BindableMarginPadding();
+        private readonly IBindable<MarginPadding> safeAreaPadding = new BindableMarginPadding();

         private Edges appliedEdges = Edges.All;


Rewrite to handle input in reverse-topological order

--- osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
+++ osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
@@ -114,47 +114,6 @@
             recycleVisualisers();
         }

-        private Drawable findTargetIn(Drawable d, InputState state)
-        {
-            if (d is DrawVisualiser) return null;
-            if (d is CursorContainer) return null;
-            if (d is PropertyDisplay) return null;
-
-            if (!d.IsPresent) return null;
-
-            bool containsCursor = d.ScreenSpaceDrawQuad.Contains(state.Mouse.NativeState.Position);
-            // This is an optimization: We don't need to consider drawables which we don't hover, and which do not
-            // forward input further to children (via d.ReceivePositionalInputAt). If they do forward input to children, then there
-            // is a good chance they have children poking out of their bounds, which we need to catch.
-            if (!containsCursor && !d.ReceivePositionalInputAt(state.Mouse.NativeState.Position))
-                return null;
-
-            var dAsContainer = d as CompositeDrawable;
-
-            Drawable containedTarget = null;
-
-            if (dAsContainer != null)
-            {
-                if (!dAsContainer.InternalChildren.Any())
-                    return null;
-
-                foreach (var c in dAsContainer.AliveInternalChildren)
-                {
-                    var contained = findTargetIn(c, state);
-                    if (contained != null)
-                    {
-                        if (containedTarget == null ||
-                            containedTarget.DrawWidth * containedTarget.DrawHeight > contained.DrawWidth * contained.DrawHeight)
-                        {
-                            containedTarget = contained;
-                        }
-                    }
-                }
-            }
-
-            return containedTarget ?? (containsCursor ? d : null);
-        }
-
         void IContainVisualisedDrawables.AddVisualiser(VisualisedDrawable visualiser)
         {
             visualiser.RequestTarget = d =>
@@ -210,6 +169,66 @@
             }
         }

+        private Drawable cursorTarget;
+
+        protected override void Update()
+        {
+            base.Update();
+
+            updateCursorTarget();
+        }
+
+        private void updateCursorTarget()
+        {
+            Drawable drawableTarget = null;
+            CompositeDrawable compositeTarget = null;
+
+            findTarget(inputManager);
+
+            cursorTarget = drawableTarget ?? compositeTarget;
+
+            // Finds the targeted drawable and composite drawable. The search stops if a drawable is targeted.
+            void findTarget(Drawable drawable)
+            {
+                if (!isValidTarget(drawable))
+                    return;
+
+                if (drawable is CompositeDrawable composite)
+                {
+                    for (int i = composite.AliveInternalChildren.Count - 1; i >= 0; i--)
+                    {
+                        findTarget(composite.AliveInternalChildren[i]);
+
+                        if (drawableTarget != null)
+                            return;
+                    }
+
+                    if (compositeTarget == null)
+                        compositeTarget = composite;
+                }
+                else
+                    drawableTarget = drawable;
+            }
+
+            bool isValidTarget(Drawable drawable)
+            {
+                if (drawable is DrawVisualiser || drawable is CursorContainer || drawable is PropertyDisplay)
+                    return false;
+
+                if (!drawable.IsPresent)
+                    return false;
+
+                bool containsCursor = drawable.ScreenSpaceDrawQuad.Contains(inputManager.CurrentState.Mouse.NativeState.Position);
+                // This is an optimization: We don't need to consider drawables which we don't hover, and which do not
+                // forward input further to children (via d.ReceivePositionalInputAt). If they do forward input to children, then there
+                // is a good chance they have children poking out of their bounds, which we need to catch.
+                if (!containsCursor && !drawable.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.NativeState.Position))
+                    return false;
+
+                return true;
+            }
+        }
+
         public bool Searching { get; private set; }

         private void setHighlight(VisualisedDrawable newHighlight)
@@ -239,13 +258,11 @@

         protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => Searching;

-        private Drawable findTarget(InputState state) => findTargetIn(Parent?.Parent, state);
-
         protected override bool OnClick(InputState state)
         {
             if (Searching)
             {
-                Target = findTarget(state)?.Parent;
+                Target = cursorTarget?.Parent;

                 if (Target != null)
                 {
@@ -262,8 +279,8 @@

         protected override bool OnMouseMove(InputState state)
         {
-            overlay.Target = Searching ? findTarget(state) : inputManager.HoveredDrawables.OfType<VisualisedDrawable>().FirstOrDefault()?.Target;
-            return base.OnMouseMove(state);
+            overlay.Target = Searching ? cursorTarget : inputManager.HoveredDrawables.OfType<VisualisedDrawable>().FirstOrDefault()?.Target;
+            return overlay.Target != null;
         }

         private readonly Dictionary<Drawable, VisualisedDrawable> visCache = new Dictionary<Drawable, VisualisedDrawable>();


Fix `IPCLocationTest` not waiting for load of component

As seen at
https://github.com/ppy/osu/runs/4731480384?check_suite_focus=true.

--- osu.Game.Tournament.Tests/NonVisual/IPCLocationTest.cs
+++ osu.Game.Tournament.Tests/NonVisual/IPCLocationTest.cs
@@ -36,7 +36,7 @@
                     TournamentStorage storage = (TournamentStorage)osu.Dependencies.Get<Storage>();
                     FileBasedIPC ipc = null;

-                    WaitForOrAssert(() => (ipc = osu.Dependencies.Get<MatchIPCInfo>() as FileBasedIPC) != null, @"ipc could not be populated in a reasonable amount of time");
+                    WaitForOrAssert(() => (ipc = osu.Dependencies.Get<MatchIPCInfo>() as FileBasedIPC)?.IsLoaded == true, @"ipc could not be populated in a reasonable amount of time");

                     Assert.True(ipc.SetIPCLocation(testStableInstallDirectory));
                     Assert.True(storage.AllTournaments.Exists("stable.json"));


Reword binding text to read better

Reword binding text to read better

--- osu.Game/Localisation/GlobalActionKeyBindingStrings.cs
+++ osu.Game/Localisation/GlobalActionKeyBindingStrings.cs
@@ -130,14 +130,14 @@
         public static LocalisableString SelectNext => new TranslatableString(getKey(@"select_next"), @"Next selection");

         /// <summary>
-        /// "Previous group selection"
-        /// </summary>
-        public static LocalisableString SelectPreviousGroup => new TranslatableString(getKey(@"select_previous_group"), @"Previous group selection");
-
-        /// <summary>
-        /// "Next group selection"
-        /// </summary>
-        public static LocalisableString SelectNextGroup => new TranslatableString(getKey(@"select_next_group"), @"Next group selection");
+        /// "Select previous group"
+        /// </summary>
+        public static LocalisableString SelectPreviousGroup => new TranslatableString(getKey(@"select_previous_group"), @"Select previous group");
+
+        /// <summary>
+        /// "Select next group"
+        /// </summary>
+        public static LocalisableString SelectNextGroup => new TranslatableString(getKey(@"select_next_group"), @"Select next group");

         /// <summary>
         /// "Home"


Move hierarchy init to load and remove unnecessary field storage

--- osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
+++ osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
@@ -102,8 +102,6 @@
         {
             public readonly User User;

-            private readonly PurpleTriangleButton watchButton;
-
             [Resolved(canBeNull: true)]
             private OsuGame game { get; set; }

@@ -112,7 +110,11 @@
                 User = user;

                 AutoSizeAxes = Axes.Both;
+            }

+            [BackgroundDependencyLoader]
+            private void load(IAPIProvider api)
+            {
                 InternalChildren = new Drawable[]
                 {
                     new FillFlowContainer
@@ -123,30 +125,25 @@
                         Width = 290,
                         Children = new Drawable[]
                         {
-                            new UserGridPanel(user)
+                            new UserGridPanel(User)
                             {
                                 RelativeSizeAxes = Axes.X,
                                 Anchor = Anchor.TopCentre,
                                 Origin = Anchor.TopCentre,
                             },
-                            watchButton = new PurpleTriangleButton
+                            new PurpleTriangleButton
                             {
                                 RelativeSizeAxes = Axes.X,
                                 Text = "Watch",
                                 Anchor = Anchor.TopCentre,
                                 Origin = Anchor.TopCentre,
-                                Action = () => game?.PerformFromScreen(s => s.Push(new Spectator(user)))
+                                Action = () => game?.PerformFromScreen(s => s.Push(new Spectator(User))),
+                                Enabled = { Value = User.Id != api.LocalUser.Value.Id }
                             }
                         }
                     },
                 };
             }
-
-            [BackgroundDependencyLoader]
-            private void load(IAPIProvider api)
-            {
-                watchButton.Enabled.Value = User.Id != api.LocalUser.Value.Id;
-            }
         }
     }
 }


Make notification insertion cleaner

Make notification insertion cleaner

--- osu.Game/Overlays/Notifications/NotificationSection.cs
+++ osu.Game/Overlays/Notifications/NotificationSection.cs
@@ -26,8 +26,7 @@

         public void Add(Notification notification, float position)
         {
-            notifications.Add(notification);
-            notifications.SetLayoutPosition(notification, position);
+            notifications.Insert((int)position, notification);
         }

         public IEnumerable<Type> AcceptTypes;


rename wrong controller

rename wrong controller

--- src/Backend/Gateway.API/Controllers/HostsController.cs
+++ src/Backend/Gateway.API/Controllers/HostsController.cs
@@ -16,9 +16,9 @@
 namespace EESLP.Backend.Gateway.API.Controllers
 {
     [Route("api/[controller]")]
-    public class LogsController : BaseController
+    public class HostsController : BaseController
     {
-        public LogsController(ILogger<LogsController> logger, IMapper mapper, IHttpApiClient http, IOptions<ApiOptions> apiOptions, IDistributedCache cache) : base(logger, mapper, http, apiOptions, cache)
+        public HostsController(ILogger<HostsController> logger, IMapper mapper, IHttpApiClient http, IOptions<ApiOptions> apiOptions, IDistributedCache cache) : base(logger, mapper, http, apiOptions, cache)
         {
         }


Fix #195, make sure arguments get passed properly upon rescue.

--- src/BibleBot.Backend/Controllers/CommandsController.cs
+++ src/BibleBot.Backend/Controllers/CommandsController.cs
@@ -187,7 +187,7 @@
                                                 }
                                             }

-                                            var commandArgs = args.Skip(1).ToList();
+                                            var commandArgs = args.Skip(2).ToList();

                                             if (commandArgs.Count() < idealCommand.ExpectedArguments)
                                             {
@@ -202,7 +202,7 @@
                                                 };
                                             }

-                                            return idealCommand.ProcessCommand(req, args.Skip(1).ToList());
+                                            return idealCommand.ProcessCommand(req, commandArgs);
                                         }
                                     }
                                     else


Fixed the definition of IntArray.BuildArray().

--- src/BoboBrowse.Net/BoboBrowse.Net/DocIdSet/IntArray.cs
+++ src/BoboBrowse.Net/BoboBrowse.Net/DocIdSet/IntArray.cs
@@ -70,7 +70,7 @@
             return false;
         }

-        protected internal override object BuildArray(int len)
+        protected override object BuildArray(int len)
         {
             return new int[len];
         }


fix for the task wrapper

fix for the task wrapper

--- src/Boxes.Integration/Tasks/PipelineExecutorWrapper.cs
+++ src/Boxes.Integration/Tasks/PipelineExecutorWrapper.cs
@@ -34,7 +34,6 @@
         /// </summary>
         public PipelineExecutorWrapper()
         {
-            UpdateTasksAsRequired();
         }

         /// <summary>
@@ -44,6 +43,7 @@
         public PipelineExecutorWrapper(IEnumerable<IBoxesTask<T>> tasks) : this()
         {
             _tasks = tasks as ICollection<IBoxesTask<T>> ?? tasks.ToList();
+            UpdateTasksAsRequired();
         }

         /// <summary>


add a test for Index.GetDictionaryEnumerator()

--- csharp/tests/Tests/TestIndex.cs
+++ csharp/tests/Tests/TestIndex.cs
@@ -125,6 +125,23 @@
             res.IterationTime = DateTime.Now - start;
             start = System.DateTime.Now;

+            IDictionaryEnumerator de = intIndex.GetDictionaryEnumerator();
+            long prev = long.MinValue;
+            i = 0;
+            while (de.MoveNext())
+            {
+                DictionaryEntry e1 = (DictionaryEntry)de.Current;
+                DictionaryEntry e2 = de.Entry;
+                Tests.Assert(e1.Equals(e2));
+                long k = (long)e1.Key;
+                Record v = (Record)e1.Value;
+                Tests.Assert(v.intKey == k);
+                Tests.Assert(k >= prev);
+                prev = k;
+                i++;
+            }
+            Tests.Assert(i == nRecords);
+
             key = 1999;
             for (i = 0; i < nRecords; i++)
             {