Update validation.cake

Update validation.cake

--- .ci/validation.cake
+++ .ci/validation.cake
@@ -32,7 +32,7 @@
 var options = new NugetValidatorOptions {
 	Copyright = "© Microsoft Corporation. All rights reserved.",
 	Author = "Microsoft",
-	Owner = "Microsoft",
+	// Owner = "Microsoft", - No longer supported in nuspec: https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target
 	NeedsProjectUrl = true,
 	NeedsLicenseUrl = true,
 	ValidateRequireLicenseAcceptance = true,


Changed result to refreshResult (#47)

Changed result to refreshResult (#47)

--- clients/ConsoleClientWithBrowser/Program.cs
+++ clients/ConsoleClientWithBrowser/Program.cs
@@ -100,7 +100,7 @@
                 if (key.Key == ConsoleKey.R)
                 {
                     var refreshResult = await _oidcClient.RefreshTokenAsync(currentRefreshToken);
-                    if (result.IsError)
+                    if (refreshResult.IsError)
                     {
                         Console.WriteLine($"Error: {refreshResult.Error}");
                     }
@@ -134,4 +134,4 @@
             }
         }
     }
-}+}


Some refactoring and more work on boolean object loading.

--- fffProcessor.cs
+++ fffProcessor.cs
@@ -220,8 +220,8 @@
 				config.infillPercent = 0;
 			}

-            string booleanOpperations = "(0,1)";
-            MultiVolumes.ProcessBooleans(slicingData.AllPartsLayers, booleanOpperations);
+            //string booleanOpperations = "(0,1)";
+            //MultiVolumes.ProcessBooleans(slicingData.AllPartsLayers, booleanOpperations);

             MultiVolumes.RemoveVolumesIntersections(slicingData.AllPartsLayers);
 			MultiVolumes.OverlapMultipleVolumesSlightly(slicingData.AllPartsLayers, config.multiVolumeOverlapPercent);


Try to move to the seam hiding position as soon as possible to help the outside edge quality.

--- fffProcessor.cs
+++ fffProcessor.cs
@@ -700,7 +700,7 @@
 						}
 					}

-					// If we are on the very first layer we start with the outside in so that we can stick to the bed better.
+					// If we are on the very first layer we start with the outside so that we can stick to the bed better.
 					if (config.outsidePerimetersFirst || layerIndex == 0 || inset0Config.spiralize)
 					{
 						// First the outside (this helps with accuracy)
@@ -719,6 +719,14 @@
 					}
 					else // This is so we can do overhanges better (the outside can stick a bit to the inside).
 					{
+						// Figure out where the seam hiding start point is for inset 0 and move to that spot so
+						// we have the minimum travel while starting inset 0 after printing the rest of the insets
+						if (part?.Insets?[0]?[0]?.Count > 0)
+						{
+							int bestPoint = PathOrderOptimizer.GetBestEdgeIndex(part.Insets[0][0]);
+							gcodeLayer.WriteTravel(part.Insets[0][0][bestPoint]);
+						}
+
 						// Print everything but the first perimeter from the outside in so the little parts have more to stick to.
 						for (int perimeterIndex = 1; perimeterIndex < part.Insets.Count; perimeterIndex++)
 						{


Avoid going out of bounds in IsSubsequenceOf
Closes #35598

(cherry picked from commit 4b79ef5ebe2faa4b3690d90dc36ab6ead5ff1315)

--- modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
+++ modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
@@ -475,7 +475,7 @@
             int source = 0;
             int target = 0;

-            while (instance[source] != 0 && text[target] != 0)
+            while (source < len && target < text.Length)
             {
                 bool match;

@@ -492,7 +492,7 @@
                 if (match)
                 {
                     source++;
-                    if (instance[source] == 0)
+                    if (source >= len)
                         return true;
                 }


replace PrimitiveType.Quads with PrimitiveType.TriangleStrip

and change code accordingly

--- osu.Framework/Graphics/UserInterface/CircularProgressDrawNode.cs
+++ osu.Framework/Graphics/UserInterface/CircularProgressDrawNode.cs
@@ -16,10 +16,9 @@
 {
     public class CircularProgressDrawNodeSharedData
     {
-        // We multiply the size param by 3 such that the amount of vertices is a multiple of the amount of vertices
-        // per primitive (quads in this case). Otherwise overflowing the batch will result in wrong
-        // grouping of vertices into primitives.
-        public LinearBatch<TexturedVertex2D> HalfCircleBatch = new LinearBatch<TexturedVertex2D>(CircularProgressDrawNode.MAXRES * 100 * 4, 10, PrimitiveType.Quads);
+        // We add 2 to the size param to account for the first triangle needing every vertex passed, subsequent triangles use the last two vertices of the previous triangle.
+        // Otherwise overflowing the batch will result in wrong grouping of vertices into primitives.
+        public LinearBatch<TexturedVertex2D> HalfCircleBatch = new LinearBatch<TexturedVertex2D>(CircularProgressDrawNode.MAXRES * 100 + 2, 10, PrimitiveType.TriangleStrip);
     }

     public class CircularProgressDrawNode : DrawNode
@@ -66,19 +65,44 @@
             Vector2 screenOrigin = Vector2Extensions.Transform(origin, transformationMatrix);
             Color4 originColour = colourAt(origin);

+            // Clamps the angle so we don't overshoot.
+            // dir is used so negative angles result in negative angularOffset.
+            float angularOffset = dir * Math.Min(step, dir * Angle);
+            float normalisedStartAngle = 0;
+            float normalisedEndAngle = 0;
+
+            // First center point
+            Shared.HalfCircleBatch.Add(new TexturedVertex2D
+            {
+                Position = Vector2.Lerp(current, screenOrigin, InnerRadius),
+                TexturePosition = new Vector2((normalisedStartAngle + normalisedEndAngle) / 2, 0),
+                Colour = originColour
+            });
+
+            // First outer point.
+            Shared.HalfCircleBatch.Add(new TexturedVertex2D
+            {
+                Position = new Vector2(current.X, current.Y),
+                TexturePosition = new Vector2(normalisedStartAngle, 1 - 1 / Texture.Height),
+                Colour = currentColour
+            });
+
             for (int i = 1; i <= amountPoints; i++)
             {
-                // Clamps the angle so we don't overshoot.
-                // dir is used so negative angles result in negative angularOffset.
-                float angularOffset = dir * Math.Min(i * step, dir * Angle);
-                float normalisedStartAngle = amountPoints > 1
+                angularOffset = dir * Math.Min(i * step, dir * Angle);
+                normalisedStartAngle = amountPoints > 1
                     ? (1 - 1 / Texture.Width) * ((float)(i - 1) / amountPoints * Angle / MathHelper.TwoPi + (dir > 0 ? 0 : 1))
                     : 0;
-                float normalisedEndAngle = amountPoints > 1
+                normalisedEndAngle = amountPoints > 1
                     ? (1 - 1 / Texture.Width) * ((float)i / amountPoints * Angle / MathHelper.TwoPi + (dir > 0 ? 0 : 1))
                     : 0;

-                // First center point
+                // Update `current`
+                current = origin + pointOnCircle(start_angle + angularOffset) * 0.5f;
+                currentColour = colourAt(current);
+                current = Vector2Extensions.Transform(current, transformationMatrix);
+
+                // current center point
                 Shared.HalfCircleBatch.Add(new TexturedVertex2D
                 {
                     Position = Vector2.Lerp(current, screenOrigin, InnerRadius),
@@ -86,33 +110,12 @@
                     Colour = originColour
                 });

-                // First outer point. (Note that this uses the same `current` as the second point of previous iteration)
-                Shared.HalfCircleBatch.Add(new TexturedVertex2D
-                {
-                    Position = new Vector2(current.X, current.Y),
-                    TexturePosition = new Vector2(normalisedStartAngle, 1 - 1 / Texture.Height),
-                    Colour = currentColour
-                });
-
-                // Update `current`
-                current = origin + pointOnCircle(start_angle + angularOffset) * 0.5f;
-                currentColour = colourAt(current);
-                current = Vector2Extensions.Transform(current, transformationMatrix);
-
-                // Second outer point
+                // current outer point
                 Shared.HalfCircleBatch.Add(new TexturedVertex2D
                 {
                     Position = new Vector2(current.X, current.Y),
                     TexturePosition = new Vector2(normalisedEndAngle, 1 - 1 / Texture.Height),
                     Colour = currentColour
-                });
-
-                // Second center point
-                Shared.HalfCircleBatch.Add(new TexturedVertex2D
-                {
-                    Position = Vector2.Lerp(current, screenOrigin, InnerRadius),
-                    TexturePosition = new Vector2((normalisedStartAngle + normalisedEndAngle) / 2, 0),
-                    Colour = originColour
                 });
             }
         }


show object in timeline before placed

show object in timeline before placed

just BeginPlacement()

--- osu.Game.Rulesets.Taiko/Edit/Blueprints/HitPlacementBlueprint.cs
+++ osu.Game.Rulesets.Taiko/Edit/Blueprints/HitPlacementBlueprint.cs
@@ -26,6 +26,11 @@
                 Size = new Vector2(TaikoHitObject.DEFAULT_SIZE * TaikoPlayfield.DEFAULT_HEIGHT)
             };
         }
+        protected override void LoadComplete()
+        {
+            base.LoadComplete();
+            BeginPlacement();
+        }

         protected override bool OnMouseDown(MouseDownEvent e)
         {


fixed "-disableScan" mode

fixed "-disableScan" mode


display observation on addition if patient did not have one

--- parent_bMedecine/parent_bMedecine/ViewModel/PatientsViewModel.cs
+++ parent_bMedecine/parent_bMedecine/ViewModel/PatientsViewModel.cs
@@ -21,7 +21,6 @@
         private string _searchText = String.Empty;
         private ObservableCollection<ServicePatient.Patient> _patients = new ObservableCollection<ServicePatient.Patient>();
         private ServicePatient.Patient _selectedPatient;
-        private ServicePatient.Patient _defaultPatient;
         private bool _readOnlyUserProfile = false;

         #endregion Members
@@ -128,6 +127,7 @@
             MessengerInstance.Register<Message.OnLoginMessage>(this, m => { RetrievePatients(); ReadOnlyUserProfile = m.ReadOnlyUserProfile; });
             MessengerInstance.Register<Message.OnLogoutMessage>(this, m => { Reset(); });
             MessengerInstance.Register<Message.OnAddPatientMessage>(this, m => { RetrievePatients(); });
+            MessengerInstance.Register<Message.OnAddObservationMessage>(this, m => { CurrentViewModel = SimpleIoc.Default.GetInstance<ObservationsViewModel>(); });
             MessengerInstance.Register<Message.OnPatientEmptyContent>(this, m => { CurrentViewModel = SimpleIoc.Default.GetInstance<HomeViewModel>(); });
         }


Cleaned up a bit endpoint declarations.

Cleaned up a bit endpoint declarations.

--- rebbound/DribbbleClient.cs
+++ rebbound/DribbbleClient.cs
@@ -21,9 +21,7 @@

         private const string UserFollowingShotsEndpoint = "/user/following/shots";

-        private const string UsersEndpoint = "/users/{0}";
-
-        private const string UserShotsEndpoint = "/users/{0}/shots";
+        private const string UsersEndpoint = "users";

         private const string ShotsEndpoint = "shots";

@@ -73,7 +71,7 @@
             HttpClient client = new HttpClient();
             this.AddAuthorizationHeader(client);

-            var result = await client.GetStringAsync(string.Join(string.Empty, ApiBase, string.Format(UsersEndpoint, username))).ConfigureAwait(false);
+            var result = await client.GetStringAsync(string.Join("/", ApiBase, UsersEndpoint, username)).ConfigureAwait(false);

             JsonSerializer serializer = new JsonSerializer();

@@ -182,7 +180,7 @@
             HttpClient client = new HttpClient();
             this.AddAuthorizationHeader(client);

-            var result = await client.GetStringAsync(string.Join(string.Empty, ApiBase, string.Format(UserShotsEndpoint, userId))).ConfigureAwait(false);
+            var result = await client.GetStringAsync(string.Join("/", ApiBase, UsersEndpoint, userId, ShotsEndpoint)).ConfigureAwait(false);

             JsonSerializer serializer = new JsonSerializer();

@@ -200,7 +198,7 @@
             HttpClient client = new HttpClient();
             this.AddAuthorizationHeader(client);

-            var result = await client.GetStringAsync(string.Join(string.Empty, ApiBase, string.Join("/", ShotsEndpoint, shotId))).ConfigureAwait(false);
+            var result = await client.GetStringAsync(string.Join("/", ApiBase, ShotsEndpoint, shotId)).ConfigureAwait(false);

             JsonSerializer serializer = new JsonSerializer();


Add link to github

Add link to github

--- input/contribute/index.cshtml
+++ input/contribute/index.cshtml
@@ -23,7 +23,7 @@
                         Submitting documentation updates where you see fit or lacking

-                        Making contributions to the code base
+                        Making contributions to the code base

                         Asking your employer to reciprocate and contribute to open-source


Fix build.csx script

Fix build.csx script

--- DotNetBuild.Build.ScriptCs.Fluent/build.csx
+++ DotNetBuild.Build.ScriptCs.Fluent/build.csx
@@ -1,3 +1,8 @@
+#r "DotNetBuild.Core"
+#r "DotNetBuild.Runner"
+#r "DotNetBuild.Runner.ScriptCs"
+#r "DotNetBuild.Tasks"
+
 using DotNetBuild.Core.Facilities.Logging;
 using DotNetBuild.Core.Facilities.State;
 using DotNetBuild.Tasks;


(#123) Make API handlers async

(#123) Make API handlers async

--- sample/RawRabbit.AspNet.Sample/Controllers/ValuesController.cs
+++ sample/RawRabbit.AspNet.Sample/Controllers/ValuesController.cs
@@ -6,8 +6,6 @@
 using RawRabbit.Enrichers.MessageContext.Context;
 using RawRabbit.Messages.Sample;
 using RawRabbit.Operations.MessageSequence;
-using Serilog;
-using ILogger = Microsoft.Extensions.Logging.ILogger;

 namespace RawRabbit.AspNet.Sample.Controllers
 {
@@ -26,7 +24,7 @@

 		[HttpGet]
 		[Route("api/values")]
-		public Task<List<string>> GetAsync()
+		public async Task<List<string>> GetAsync()
 		{
 			_logger.LogDebug("Recieved Value Request.");
 			var valueSequence = _busClient.ExecuteSequence(s => s
@@ -43,25 +41,28 @@
 				.Complete<ValuesCalculated>()
 			);

-			return valueSequence.Task.ContinueWith(tResponse =>
+			try
 			{
-				if (tResponse.IsFaulted)
-					throw new Exception("No response recieved. Is the Console App started?");
-
-				_logger.LogInformation("Successfully created {valueCount} values", tResponse.Result.Values.Count);
-				return valueSequence.Aborted
-					? new List<string>()
-					: tResponse.Result.Values;
-			});
+				await valueSequence.Task;
+			}
+			catch (Exception e)
+			{
+				throw new Exception("No response recieved. Is the Console App started?", e);
+			}
+
+			_logger.LogInformation("Successfully created {valueCount} values", valueSequence.Task.Result.Values.Count);
+			return valueSequence.Aborted
+				? new List<string>()
+				: valueSequence.Task.Result.Values;
+
 		}

 		[HttpGet("api/values/{id}")]
-		public Task<string> GetAsync(int id)
+		public async Task<string> GetAsync(int id)
 		{
 			_logger.LogInformation("Requesting Value with id {valueId}", id);
-			return _busClient
-				.RequestAsync<ValueRequest, ValueResponse>(new ValueRequest {Value = id})
-				.ContinueWith(tResponse => tResponse.Result.Value);
+			var response = await _busClient.RequestAsync<ValueRequest, ValueResponse>(new ValueRequest {Value = id});
+			return response.Value;
 		}
 	}
 }


Corrected test for ComboBox.SelectedItem.

--- tungsten.sampletest/ComboBoxTest.cs
+++ tungsten.sampletest/ComboBoxTest.cs
@@ -22,7 +22,7 @@
         {
             var window = Desktop.FindFirstElement<WpfWindow>(By.Name("WndMain"));
             var comboBox = window.FindFirstElement<WpfComboBox>(By.Name("CmbShowError"));
-            comboBox.AssertThat(x => x.Items.Select(i => i.Content), Is.EqualTo(new[] { "No error", "Has error" }));
+            comboBox.AssertThat(x => x.SelectedItem.Content, Is.EqualTo("No error"));
         }
     }
 }


Tweaked docs and added #ifdefs for SL to use ThreadPool instead of TaskPool

--- EPS.Concurrency/JournalingJobResultQueue.cs
+++ EPS.Concurrency/JournalingJobResultQueue.cs
@@ -18,15 +18,21 @@
 	{
 		private IDisposable jobCompleted;

-		/// <summary>	Constructs a new instance. </summary>
+		/// <summary>
+		/// Constructs a new instance that listens to completion notifications on Scheduler.TaskPool or Scheduler.ThreadPool when on Silverlight .
+		/// </summary>
 		/// <remarks>	7/9/2011. </remarks>
 		/// <param name="jobCompletionNotifications">	The job completion notification stream. </param>
 		/// <param name="jobResultInspector">		 	The job result inspector. </param>
 		/// <param name="durableJobStorage">		 	The durable job storage. </param>
 		public JournalingJobResultQueue(IObservable<JobResult<TJobInput, TJobOutput>> jobCompletionNotifications,
 			IJobResultInspector<TJobInput, TJobOutput, TQueuePoison> jobResultInspector,
-			IDurableJobStorageQueue<TJobInput, TQueuePoison> durableJobStorage) :
-			this(jobCompletionNotifications, jobResultInspector, durableJobStorage, LogManager.GetCurrentClassLogger(), Scheduler.TaskPool)
+			IDurableJobStorageQueue<TJobInput, TQueuePoison> durableJobStorage)
+#if SILVERLIGHT
+			: this(jobCompletionNotifications, jobResultInspector, durableJobStorage, LogManager.GetCurrentClassLogger(), Scheduler.ThreadPool)
+#else
+			: this(jobCompletionNotifications, jobResultInspector, durableJobStorage, LogManager.GetCurrentClassLogger(), Scheduler.TaskPool)
+#endif
 		{ }

 		internal JournalingJobResultQueue(IObservable<JobResult<TJobInput, TJobOutput>> jobCompletionNotifications,


Fix compile errors due to accessor modifications.

--- Extensions/CCBReader/CCBAnimationManager.cs
+++ Extensions/CCBReader/CCBAnimationManager.cs
@@ -820,7 +820,7 @@
 		/// Start the show operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBSetSpriteFrameState(this, target);

@@ -877,7 +877,7 @@
 		/// Start the CCBRotateTo operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBSoundEffectState(this, target);

@@ -935,7 +935,7 @@
 		/// Start the CCBRotateTo operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBRotateToState(this, target);

@@ -993,7 +993,7 @@
 		/// Start the CCBRotateXTo operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBRotateXToState(this, target);

@@ -1047,7 +1047,7 @@
 		/// Start the CCBRotateYTo operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBRotateYToState(this, target);

@@ -1098,7 +1098,7 @@
 		/// Start the EaseInstant operation on the given target.
 		/// </summary>
 		/// <param name="target"></param>
-		protected override CCActionState StartAction(CCNode target)
+		protected internal override CCActionState StartAction(CCNode target)
 		{
 			return new CCBEaseInstantState(this, target);


Provide dynamic counts of actors, characters, and estimated time (PG-385)

--- Glyssen/Dialogs/VoiceActorInformationDlg.cs
+++ Glyssen/Dialogs/VoiceActorInformationDlg.cs
@@ -33,6 +33,11 @@

 			m_linkMoreInfo.Links.Clear();
 			m_linkMoreInfo.Links.Add(77, 9);
+
+			Project project = viewModel.Project;
+			label1.Text = string.Format("This project has {0} books with {1} distinct character roles.",
+				project.IncludedBooks.Count, project.GetKeyStrokesByCharacterId().Count);
+			label2.Text = string.Format("Estimated recording time: {0:N2} hours", project.CharacterGroupList.CharacterGroups.Sum(g => g.EstimatedHours));

 			UpdateTally();
 		}


Update DataTableExtensions.cs

Update DataTableExtensions.cs

--- src/DataTableExtensions.cs
+++ src/DataTableExtensions.cs
@@ -26,6 +26,23 @@
 		}
 		#endregion

+		#region DataRowCollection Extensions
+		public static object GetValuesInColumn (this DataRowCollection rows, DataColumn col)
+		{
+			return rows.OfType<DataRow>().Select(dr => dr[col]);
+		}
+
+		public static object GetValuesInColumn (this DataRowCollection rows, string columnName)
+		{
+			return rows.OfType<DataRow>().Select(dr => dr[columnName]);
+		}
+
+		public static object GetValuesInColumn (this DataRowCollection rows, int columnOrdinal)
+		{
+			return rows.OfType<DataRow>().Select(dr => dr[columnOrdinal]);
+		}
+		#endregion
+
 		#region Conversion
 		public static void ConvertColumnsFromString (this DataTable dt, bool toMixed)
 		{
@@ -50,7 +67,7 @@
 		/// <exception cref="InvalidOperationException"><paramref name="toMixed" /> is false and the specified <paramref name="column" /> contains multiple types after <paramref name="projection" />.</exception>
 		public static void Convert (this DataColumn column, Func<object, object> projection, bool toMixed)
 		{
-			var cells = column.Table.Rows.OfType<DataRow>().Select(row => projection(row[column]));
+			var cells = column.Table.Rows.GetValuesInColumn(column).Select(projection);
 			var items = new List<object>(column.Table.Rows.Count);
 			Type newType = null;
 			foreach (var cell in cells) {


Learn to spell bootstrapper.

Learn to spell bootstrapper.

--- src/Nancy/Security/Csrf.cs
+++ src/Nancy/Security/Csrf.cs
@@ -14,7 +14,7 @@

         /// <summary>
         /// Enables Csrf token generation.
-        /// This is disabled by default. Enabling it is just a single line in the bootstrapp app startup:
+        /// This is disabled by default. Enabling it is just a single line in the bootstrapper app startup:
         /// Csrf.Enable(pipelines);
         /// </summary>
         /// <param name="pipelines">Application pipelines</param>


:bug: should use async socket accept   - apparently the synchronous version, whilst working fine on win32,     may be responsible for the deadlock observed when disposing an     HttpServer instance on OSX

--- source/SimpleServers/PeanutButter.SimpleTcpServer/TcpServer.cs
+++ source/SimpleServers/PeanutButter.SimpleTcpServer/TcpServer.cs
@@ -45,10 +45,16 @@
         public Action<string> LogAction { get; set; } = Console.WriteLine;

         // ReSharper disable once MemberCanBePrivate.Global
+
         /// <summary>
         /// Port which this server has bound to
         /// </summary>
         public int Port { get; protected set; }
+
+        /// <summary>
+        /// Flag exposing listening state
+        /// </summary>
+        public bool IsListening => _listener != null;

         private TcpListener _listener;
         private Task _task;
@@ -59,6 +65,7 @@
         private readonly int _randomPortMin;
         private readonly int _randomPortMax;

+
         /// <summary>
         /// Construct the server with a random port within the provided range
         /// </summary>
@@ -142,7 +149,7 @@
                 {
                     try
                     {
-                        AcceptClient();
+                        AcceptClientAsync();
                     }
                     catch (Exception ex)
                     {
@@ -188,21 +195,63 @@
             Log(ex.StackTrace);
         }

-        private void AcceptClient()
+        private void AcceptClientAsync()
         {
             var listener = _listener;
             if (listener == null)
+            {
                 return;
-            var s = listener.AcceptTcpClient();
-            var clientInfo = s.Client.RemoteEndPoint.ToString();
-            Log("Accepting incoming client request from {0}", clientInfo);
-            var processor = CreateProcessorFor(s);
-            Log("Spawning processor in background task...");
-            Task.Run(() =>
-            {
-                Log("Processing request for {0}", clientInfo);
+            }
+
+            var state = new AsyncAcceptState(this, listener);
+            listener.BeginAcceptTcpClient(TcpClientAcceptHandler, state);
+            state.ResetEvent.Wait();
+        }
+
+        private void TcpClientAcceptHandler(IAsyncResult ar)
+        {
+            var state = ar.AsyncState as AsyncAcceptState;
+            if (state == null)
+            {
+                throw new InvalidOperationException(
+                    $"Should have received AsyncAcceptState object"
+                );
+            }
+
+            try
+            {
+                if (!state.TcpServer.IsListening)
+                {
+                    return;
+                }
+
+                var client = state.Listener.EndAcceptTcpClient(ar);
+                var clientInfo = client.Client.RemoteEndPoint.ToString();
+                Log($"Accepting incoming client request from {clientInfo}");
+                var processor = CreateProcessorFor(client);
+                Log($"Processing request for {clientInfo}");
                 processor.ProcessRequest();
-            });
+            }
+            finally
+            {
+                state.ResetEvent.Set();
+            }
+        }
+
+        private class AsyncAcceptState
+        {
+            public TcpServer TcpServer { get; }
+            public TcpListener Listener { get; }
+            public ManualResetEventSlim ResetEvent { get; }
+
+            public AsyncAcceptState(
+                TcpServer tcpServer,
+                TcpListener listener)
+            {
+                TcpServer = tcpServer;
+                Listener = listener;
+                ResetEvent = new ManualResetEventSlim();
+            }
         }

         /// <summary>
@@ -220,10 +269,15 @@
         {
             try
             {
-                if (_listener == null)
+                var listener = _listener;
+                _listener = null;
+                if (listener == null)
+                {
                     return;
+                }
+
                 _cancellationTokenSource.Cancel();
-                _listener.Stop();
+                listener.Stop();
                 try
                 {
                     if (!_task.Wait(MaxShutDownTime))
@@ -237,7 +291,7 @@
                 {
                     /* we can end up in here if the task is cancelled really early */
                 }
-                _listener = null;
+
                 _task = null;
                 _cancellationTokenSource = null;
             }


Introduce an async version of GetAssetDataFromUrl (#307)


[KOE-125] Fixed selection of separator borders in drop list

--- src/AcaciaZPushPlugin/AcaciaZPushPlugin/UI/GABLookupControl.cs
+++ src/AcaciaZPushPlugin/AcaciaZPushPlugin/UI/GABLookupControl.cs
@@ -249,7 +249,24 @@
             GABUser item = (GABUser)e.Item;

             // Draw the background
-            e.DrawBackground();
+            if (e.State == DrawItemState.Selected)
+            {
+                // If the item is selected, we don't want the separating border to get selected too.
+                // So draw the normal background in the border area
+                Rectangle rect = e.Bounds;
+                rect.Y = rect.Bottom - BorderPadding.Vertical - BorderThickness;
+                rect.Height = BorderPadding.Vertical + BorderThickness;
+                new System.Windows.Forms.DrawItemEventArgs(e.Graphics, e.Font, rect, e.Index, DrawItemState.None).DrawBackground();
+
+                // And the selected background in the item area.
+                rect.Y = e.Bounds.Y;
+                rect.Height = e.Bounds.Height - BorderPadding.Vertical - BorderThickness;
+                new System.Windows.Forms.DrawItemEventArgs(e.Graphics, e.Font, rect, e.Index, DrawItemState.Selected).DrawBackground();
+            }
+            else
+            {
+                e.DrawBackground();
+            }

             // Get the sizes
             Size nameSize = TextRenderer.MeasureText(e.Graphics, item.FullName, Font);


Update CSharpCompilation.cs

Update CSharpCompilation.cs

Add doc to CSharpCompilation.ClassifyConversion method

--- src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
+++ src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
@@ -1821,6 +1821,14 @@
         // compilation, while the other method needs a bindings object to determine what bound node
         // an expression syntax binds to.  Perhaps when we document these methods we should explain
         // where a user can find the other.
+        /// <summary>
+        /// Classifies a conversion from <paramref name="source"/> to <paramref name="destination"/> according
+        /// to this compilation's programming language.
+        /// </summary>
+        /// <param name="source">Source type of value to be converted</param>
+        /// <param name="destination">Destination type of value to be converted</param>
+        /// <returns>A <see cref="Conversion"/> that classifies the conversion from the
+        /// <paramref name="source"/> type to the <paramref name="destination"/> type.</returns>
         public Conversion ClassifyConversion(ITypeSymbol source, ITypeSymbol destination)
         {
             // Note that it is possible for there to be both an implicit user-defined conversion


fix bug.

fix bug.

--- src/EQueue/Broker/RequestHandlers/PullMessageRequestHandler.cs
+++ src/EQueue/Broker/RequestHandlers/PullMessageRequestHandler.cs
@@ -32,7 +32,7 @@
             _offsetManager = ObjectContainer.Resolve<IOffsetManager>();
             _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
             _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
-            _emptyResponseData = _binarySerializer.Serialize(new PullMessageResponse(new QueueMessage[0]));
+            _emptyResponseData = _binarySerializer.Serialize(new PullMessageResponse(new QueueMessage[0], -1));
         }

         public RemotingResponse HandleRequest(IRequestHandlerContext context, RemotingRequest remotingRequest)


Add resolver helper method

Add resolver helper method

--- src/Foundatio.Parsers.ElasticQueries/ElasticMappingResolver.cs
+++ src/Foundatio.Parsers.ElasticQueries/ElasticMappingResolver.cs
@@ -169,7 +169,7 @@
     public string GetSortFieldName(string field) {
         return GetNonAnalyzedFieldName(field, ElasticMapping.SortFieldName);
     }
-
+
     public string GetSortFieldName(Field field) {
         return GetNonAnalyzedFieldName(GetResolvedField(field), ElasticMapping.SortFieldName);
     }
@@ -179,7 +179,11 @@
     }

     public string GetAggregationsFieldName(Field field) {
-        return GetNonAnalyzedFieldName(GetResolvedField(field), ElasticMapping.KeywordFieldName);
+        return GetNonAnalyzedFieldName(field, ElasticMapping.KeywordFieldName);
+    }
+
+    public string GetNonAnalyzedFieldName(Field field, string preferredSubField = null) {
+        return GetNonAnalyzedFieldName(GetResolvedField(field), preferredSubField);
     }

     public string GetNonAnalyzedFieldName(string field, string preferredSubField = null) {
@@ -188,7 +192,7 @@

         var mapping = GetMapping(field, true);

-        if (mapping.Property == null || !IsPropertyAnalyzed(mapping.Property))
+        if (mapping?.Property == null || !IsPropertyAnalyzed(mapping.Property))
             return field;

         var multiFieldProperty = mapping.Property as ICoreProperty;


Only update PR list state on main thread.

`IVirtualizingListSource.IsLoading` can be signalled on a background thread. This was causing a deadlock in #1828. Make sure we call `IssueListViewModelBase.UpdateState` on the UI thread.

Fixes #1828

--- src/GitHub.App/ViewModels/GitHubPane/IssueListViewModelBase.cs
+++ src/GitHub.App/ViewModels/GitHubPane/IssueListViewModelBase.cs
@@ -7,6 +7,7 @@
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Threading.Tasks;
+using System.Windows.Threading;
 using GitHub.Collections;
 using GitHub.Extensions;
 using GitHub.Extensions.Reactive;
@@ -209,6 +210,7 @@
                     this.WhenAnyValue(x => x.SelectedState),
                     this.WhenAnyValue(x => x.AuthorFilter.Selected),
                     (loading, count, _, __, ___) => Tuple.Create(loading, count))
+                .ObserveOn(RxApp.MainThreadScheduler)
                 .Subscribe(x => UpdateState(x.Item1, x.Item2)));
             dispose.Add(
                 Observable.FromEventPattern<ErrorEventArgs>(


Fix the fade in and out animation if no duration exists

--- src/MahApps.Metro/MahApps.Metro.Shared/Controls/MetroWindow.cs
+++ src/MahApps.Metro/MahApps.Metro.Shared/Controls/MetroWindow.cs
@@ -789,6 +789,30 @@
             get { return TitleCaps ? Title.ToUpper() : Title; }
         }

+        private bool CanUseOverlayFadingStoryboard(Storyboard sb, out DoubleAnimation animation)
+        {
+            animation = null;
+            if (null == sb)
+            {
+                return false;
+            }
+
+            sb.Dispatcher.VerifyAccess();
+
+            animation = sb.Children.OfType<DoubleAnimation>().FirstOrDefault();
+            if (null == animation)
+            {
+                return false;
+            }
+
+            return (sb.Duration.HasTimeSpan && sb.Duration.TimeSpan.Ticks > 0)
+                   || (sb.AccelerationRatio > 0)
+                   || (sb.DecelerationRatio > 0)
+                   || (animation.Duration.HasTimeSpan && animation.Duration.TimeSpan.Ticks > 0)
+                   || animation.AccelerationRatio > 0
+                   || animation.DecelerationRatio > 0;
+        }
+
         /// <summary>
         /// Begins to show the MetroWindow's overlay effect.
         /// </summary>
@@ -808,38 +832,33 @@

             Dispatcher.VerifyAccess();

-            overlayBox.Visibility = Visibility.Visible;
-
             var sb = OverlayFadeIn?.Clone();
-            if (sb != null)
-            {
-                overlayStoryboard = sb;
-
-                ((DoubleAnimation)sb.Children[0]).To = this.OverlayOpacity;
-
-                this.BeginInvoke(() =>
+            overlayStoryboard = sb;
+            DoubleAnimation animation;
+            if (CanUseOverlayFadingStoryboard(sb, out animation))
+            {
+                this.overlayBox.SetCurrentValue(VisibilityProperty, Visibility.Visible);
+
+                animation.To = this.OverlayOpacity;
+
+                EventHandler completionHandler = null;
+                completionHandler = (sender, args) =>
                     {
-                        EventHandler completionHandler = null;
-                        completionHandler = (sender, args) =>
-                            {
-                                //sb.Completed -= completionHandler;
-                                if (overlayStoryboard == sb)
-                                {
-                                    overlayStoryboard = null;
-                                }
-
-                                tcs.TrySetResult(null);
-                            };
-
-                        sb.Completed += completionHandler;
-                        sb.Freeze();
-                        overlayBox.BeginStoryboard(sb);
-                    });
+                        sb.Completed -= completionHandler;
+                        if (overlayStoryboard == sb)
+                        {
+                            overlayStoryboard = null;
+                        }
+
+                        tcs.TrySetResult(null);
+                    };
+
+                sb.Completed += completionHandler;
+                overlayBox.BeginStoryboard(sb);
             }
             else
             {
-                overlayStoryboard = null;
-                this.overlayBox.Opacity = this.OverlayOpacity;
+                ShowOverlay();
                 tcs.TrySetResult(null);
             }

@@ -859,6 +878,7 @@
             if (overlayBox.Visibility == Visibility.Visible && overlayBox.Opacity <= 0.0)
             {
                 //No Task.FromResult in .NET 4.
+                this.overlayBox.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                 tcs.SetResult(null);
                 return tcs.Task;
             }
@@ -866,37 +886,31 @@
             Dispatcher.VerifyAccess();

             var sb = OverlayFadeOut?.Clone();
-            if (sb != null)
-            {
-                overlayStoryboard = sb;
-
-                ((DoubleAnimation)sb.Children[0]).To = 0d;
-
-                this.BeginInvoke(() =>
+            overlayStoryboard = sb;
+            DoubleAnimation animation;
+            if (CanUseOverlayFadingStoryboard(sb, out animation))
+            {
+                animation.To = 0d;
+
+                EventHandler completionHandler = null;
+                completionHandler = (sender, args) =>
                     {
-                        EventHandler completionHandler = null;
-                        completionHandler = (sender, args) =>
-                            {
-                                //sb.Completed -= completionHandler;
-                                if (overlayStoryboard == sb)
-                                {
-                                    overlayBox.Visibility = Visibility.Hidden;
-                                    overlayStoryboard = null;
-                                }
-
-                                tcs.TrySetResult(null);
-                            };
-
-                        sb.Completed += completionHandler;
-                        sb.Freeze();
-                        this.overlayBox.BeginStoryboard(sb);
-                    });
-
+                        sb.Completed -= completionHandler;
+                        if (overlayStoryboard == sb)
+                        {
+                            this.overlayBox.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
+                            overlayStoryboard = null;
+                        }
+
+                        tcs.TrySetResult(null);
+                    };
+
+                sb.Completed += completionHandler;
+                overlayBox.BeginStoryboard(sb);
             }
             else
             {
-                overlayStoryboard = null;
-                overlayBox.Visibility = Visibility.Hidden;
+                HideOverlay();
                 tcs.TrySetResult(null);
             }

@@ -912,14 +926,14 @@

         public void ShowOverlay()
         {
-            overlayBox.Visibility = Visibility.Visible;
+            this.overlayBox.SetCurrentValue(VisibilityProperty, Visibility.Visible);
             overlayBox.SetCurrentValue(Grid.OpacityProperty, this.OverlayOpacity);
         }

         public void HideOverlay()
         {
-            overlayBox.SetCurrentValue(Grid.OpacityProperty, 0.0);
-            overlayBox.Visibility = System.Windows.Visibility.Hidden;
+            overlayBox.SetCurrentValue(Grid.OpacityProperty, 0d);
+            this.overlayBox.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
         }

         /// <summary>


Increment minor -> 0.3.0

Increment minor -> 0.3.0

--- AssemblyInfo.sln.cs
+++ AssemblyInfo.sln.cs
@@ -7,6 +7,6 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-[assembly: AssemblyVersion("0.2.0.0")]
-[assembly: AssemblyFileVersion("0.2.0.0")]
-[assembly: AssemblyInformationalVersion("0.2.0")]
+[assembly: AssemblyVersion("0.3.0.0")]
+[assembly: AssemblyFileVersion("0.3.0.0")]
+[assembly: AssemblyInformationalVersion("0.3.0")]


practicum les 1.3

practicum les 1.3

--- Automaat/Program.cs
+++ Automaat/Program.cs
@@ -19,7 +19,8 @@
             Console.WriteLine("is automaat 2 a DFA: " + a2.IsDfa());

             PracL1ERepresentatie1();
-            PracL1Representatie2();
+            PracL1Representatie2();
+            PracL1Representatie3();

             Console.ReadLine();
         }
@@ -165,5 +166,42 @@
             testWords.Add(new Tuple<string, bool>("ababa", true));
             TestingAutomaat(m, testWords);
         }
+
+        static void PracL1Representatie3()
+        {
+            char[] alphabet = { 'a', 'b' };
+            Automaat<string> m = new Automaat<string>(alphabet);
+
+            m.AddTransition(new Transition<string>("1", alphabet[0], "3"));
+            m.AddTransition(new Transition<string>("1", alphabet[1], "2"));
+
+            m.AddTransition(new Transition<string>("2", alphabet[0], "2"));
+            m.AddTransition(new Transition<string>("2", alphabet[1], "1"));
+
+            m.AddTransition(new Transition<string>("3", alphabet[0], "4"));
+            m.AddTransition(new Transition<string>("3", alphabet[1], "2"));
+
+            m.AddTransition(new Transition<string>("4", alphabet[0], "3"));
+            m.AddTransition(new Transition<string>("4", alphabet[1], "5"));
+
+            m.AddTransition(new Transition<string>("5", alphabet[0], "2"));
+            m.AddTransition(new Transition<string>("5", alphabet[1], "1"));
+
+            // only on start state in a dfa:
+            m.DefineAsStartState("1");
+
+            // two final states:
+            m.DefineAsFinalState("5");
+
+            List<Tuple<string, bool>> testWords = new List<Tuple<string, bool>>();
+            testWords.Add(new Tuple<string, bool>("aab", true));
+            testWords.Add(new Tuple<string, bool>("bbaab", true));
+            testWords.Add(new Tuple<string, bool>("bbbaab", false));
+            testWords.Add(new Tuple<string, bool>("aabaabaab", true));
+            testWords.Add(new Tuple<string, bool>("bbaabb", false));
+            testWords.Add(new Tuple<string, bool>("aabaab", false));
+            testWords.Add(new Tuple<string, bool>("ababaabaa", false));
+            TestingAutomaat(m, testWords);
+        }
     }
 }


[Bam] Temporarily remove System.IO.Compression from Nugets included in generated debug projects. It's needed by SharpCompress, but it's out of date (v4.2.1 no longer exists), so always generates an error in the generated project.

--- Bam/DebugProject.cs
+++ Bam/DebugProject.cs
@@ -95,6 +95,14 @@
             var all = core.GetReferencedAssemblies();
             var filtered = all.Where(item =>
             {
+                if (item.Name == "System.IO.Compression")
+                {
+                    // SharpCompress depends on this assembly, but it's out of date (v4.2.1)
+                    // and will generate an error for each BAM debug project generated
+                    // so just don't include it - we're never going to step into it
+                    return false;
+                }
+
                 var publicKeyToken = string.Empty;
                 for (var i = 0; i < item.GetPublicKeyToken().GetLength(0); i++)
                 {


Eliminate tests for max delay

Eliminate tests for max delay

--- src/NUnitFramework/tests/Constraints/DelayedConstraintTests.cs
+++ src/NUnitFramework/tests/Constraints/DelayedConstraintTests.cs
@@ -154,7 +154,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN)); // wiggle room due to timer resolution
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -183,7 +183,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -198,7 +198,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -213,7 +213,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -393,7 +393,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN)); // wiggle room due to timer resolution
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -422,7 +422,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -437,7 +437,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -452,7 +452,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -467,7 +467,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }
 #endif

@@ -634,7 +634,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN)); // wiggle room due to timer resolution
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -663,7 +663,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -678,7 +678,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -693,7 +693,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }

         [Test]
@@ -708,7 +708,7 @@

             var elapsed = DateTime.UtcNow - start;
             Assert.That(elapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(MIN));
-            Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
+            //Assert.That(elapsed.TotalMilliseconds, Is.LessThan(MAX));
         }
 #endif


Fix bulk alias unit tests

Fix bulk alias unit tests

--- src/Nest/Indices/AliasManagement/Alias/Actions/IAliasAction.cs
+++ src/Nest/Indices/AliasManagement/Alias/Actions/IAliasAction.cs
@@ -1,7 +1,96 @@
-namespace Nest
+using Utf8Json;
+using Utf8Json.Internal;
+
+namespace Nest
 {
 	/// <summary>
 	/// Marker interface for alias operation
 	/// </summary>
+	[JsonFormatter(typeof(AliasActionFormatter))]
 	public interface IAliasAction { }
+
+	public class AliasActionFormatter : IJsonFormatter<IAliasAction>
+	{
+		private static readonly AutomataDictionary Actions = new AutomataDictionary
+		{
+			{ "add", 0 },
+			{ "remove", 1 },
+			{ "remove_index", 2 },
+		};
+
+		public IAliasAction Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver)
+		{
+			var token = reader.GetCurrentJsonToken();
+			if (token == JsonToken.Null)
+				return null;
+
+			var segment = reader.ReadNextBlockSegment();
+			var segmentReader = new JsonReader(segment.Array, segment.Offset);
+
+			segmentReader.ReadIsBeginObjectWithVerify();
+			var action = segmentReader.ReadPropertyNameSegmentRaw();
+			IAliasAction aliasAction = null;
+
+			segmentReader = new JsonReader(segment.Array, segment.Offset);
+
+			if (Actions.TryGetValue(action, out var value))
+			{
+				switch (value)
+				{
+					case 0:
+						aliasAction = Deserialize<AliasAddAction>(ref segmentReader, formatterResolver);
+						break;
+					case 1:
+						aliasAction = Deserialize<AliasRemoveAction>(ref segmentReader, formatterResolver);
+						break;
+					case 2:
+						aliasAction = Deserialize<AliasRemoveIndexAction>(ref segmentReader, formatterResolver);
+						break;
+				}
+			}
+
+			return aliasAction;
+		}
+
+		public void Serialize(ref JsonWriter writer, IAliasAction value, IJsonFormatterResolver formatterResolver)
+		{
+			if (value == null)
+			{
+				writer.WriteNull();
+				return;
+			}
+
+			switch (value)
+			{
+				case IAliasAddAction addAction:
+					Serialize(ref writer, addAction, formatterResolver);
+					break;
+				case IAliasRemoveAction removeAction:
+					Serialize(ref writer, removeAction, formatterResolver);
+					break;
+				case IAliasRemoveIndexAction removeIndexAction:
+					Serialize(ref writer, removeIndexAction, formatterResolver);
+					break;
+				default:
+					// TODO: Should we handle some other way?
+					writer.WriteNull();
+					break;
+			}
+		}
+
+		private static void Serialize<TAliasAction>(ref JsonWriter writer, TAliasAction action,
+			IJsonFormatterResolver formatterResolver
+		) where TAliasAction : IAliasAction
+		{
+			var formatter = formatterResolver.GetFormatter<TAliasAction>();
+			formatter.Serialize(ref writer, action, formatterResolver);
+		}
+
+		private static TAliasAction Deserialize<TAliasAction>(ref JsonReader reader, IJsonFormatterResolver formatterResolver)
+			where TAliasAction : IAliasAction
+		{
+			var formatter = formatterResolver.GetFormatter<TAliasAction>();
+			return formatter.Deserialize(ref reader, formatterResolver);
+		}
+	}
 }


Output a new list element in the TOC only if the node is a feature file

--- src/Pickles/Pickles/Formatters/HtmlTableOfContentsFormatter.cs
+++ src/Pickles/Pickles/Formatters/HtmlTableOfContentsFormatter.cs
@@ -16,7 +16,7 @@

             foreach (var childNode in features.ChildNodes)
             {
-                if (childNode.IsLeafNode)
+                if (childNode.IsLeafNode && !childNode.Data.IsDirectory)
                 {
                     ul.Add(new XElement(xmlns + "li",
                                 new XElement(xmlns + "a",


fix typo in algorithms supported

fix typo in algorithms supported

--- src/System.IdentityModel.Tokens.Jwt/JwtSecurityTokenHandler.cs
+++ src/System.IdentityModel.Tokens.Jwt/JwtSecurityTokenHandler.cs
@@ -587,7 +587,7 @@
                     keySize = 256;
                 else if (SecurityAlgorithms.Aes192CbcHmacSha384.Equals(encryptingCredentials.Enc, StringComparison.Ordinal))
                     keySize = 384;
-                else if (SecurityAlgorithms.Aes128CbcHmacSha256.Equals(encryptingCredentials.Enc, StringComparison.Ordinal))
+                else if (SecurityAlgorithms.Aes256CbcHmacSha512.Equals(encryptingCredentials.Enc, StringComparison.Ordinal))
                     keySize = 512;
                 else
                     throw LogHelper.LogExceptionMessage(new SecurityTokenEncryptionFailedException(string.Format(CultureInfo.InvariantCulture, LogMessages.IDX10617, SecurityAlgorithms.Aes128CbcHmacSha256, SecurityAlgorithms.Aes192CbcHmacSha384, SecurityAlgorithms.Aes256CbcHmacSha512, encryptingCredentials.Enc)));


Revert "Report file loading exception messages with invariant culture"

This reverts commit ceca61ff27ae403e0f1b8c6757f083cb5ee824d7.

--- src/Text.Analyzers/Core/IdentifiersShouldBeSpelledCorrectly.cs
+++ src/Text.Analyzers/Core/IdentifiersShouldBeSpelledCorrectly.cs
@@ -3,7 +3,6 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Immutable;
-using System.Globalization;
 using System.Linq;
 using Analyzer.Utilities;
 using Analyzer.Utilities.Extensions;
@@ -23,6 +22,7 @@
         internal const string RuleId = "CA1704";

         private static readonly LocalizableString s_localizableTitle = new LocalizableResourceString(nameof(TextAnalyzersResources.IdentifiersShouldBeSpelledCorrectlyTitle), TextAnalyzersResources.ResourceManager, typeof(TextAnalyzersResources));
+
         private static readonly LocalizableString s_localizableMessageFileParse = new LocalizableResourceString(nameof(TextAnalyzersResources.IdentifiersShouldBeSpelledCorrectlyFileParse), TextAnalyzersResources.ResourceManager, typeof(TextAnalyzersResources));
         private static readonly LocalizableString s_localizableMessageAssembly = new LocalizableResourceString(nameof(TextAnalyzersResources.IdentifiersShouldBeSpelledCorrectlyMessageAssembly), TextAnalyzersResources.ResourceManager, typeof(TextAnalyzersResources));
         private static readonly LocalizableString s_localizableMessageNamespace = new LocalizableResourceString(nameof(TextAnalyzersResources.IdentifiersShouldBeSpelledCorrectlyMessageNamespace), TextAnalyzersResources.ResourceManager, typeof(TextAnalyzersResources));
@@ -299,7 +299,7 @@
                         catch (Exception ex)
 #pragma warning restore CA1031 // Do not catch general exception types
                         {
-                            ReportFileParseDiagnostic(additionalFile.Path, ex.Message.ToString(CultureInfo.InvariantCulture));
+                            ReportFileParseDiagnostic(additionalFile.Path, ex.Message);
                         }
                     }


Allows resetting reboot state with the DreamDaemonController

--- src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
+++ src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
@@ -192,13 +192,13 @@

 			//run these in parallel because they are equally as important
 			await Task.WhenAll(DatabaseContext.Save(cancellationToken), wd.ChangeSettings(current, cancellationToken)).ConfigureAwait(false);
-
-			//soft shutdown/restart can't be cancelled because of how many things rely on them
-			//They can be alternated though
+
 			if (!oldSoftRestart.Value && current.SoftRestart.Value)
 				await wd.Restart(true, cancellationToken).ConfigureAwait(false);
 			else if (!oldSoftShutdown.Value && current.SoftShutdown.Value)
 				await wd.Terminate(true, cancellationToken).ConfigureAwait(false);
+			else if ((oldSoftRestart.Value && !current.SoftRestart.Value) || (oldSoftShutdown.Value && !current.SoftShutdown.Value))
+				await wd.ResetRebootState(cancellationToken).ConfigureAwait(false);

 			return await ReadImpl(current, cancellationToken).ConfigureAwait(false);
 		}


import references data bugs was fixed

import references data bugs was fixed

--- src/TravelAgent.Web/TravelAgent.WebAPI/Models/ReferencesDto.cs
+++ src/TravelAgent.Web/TravelAgent.WebAPI/Models/ReferencesDto.cs
@@ -30,6 +30,11 @@

         public static IList<References> ToList(IList<ReferencesDto> dto_list)
         {
+            if(dto_list == null)
+            {
+                return new List<References>();
+            }
+
             IList<References> list = new List<References>();
             foreach (ReferencesDto item in dto_list)
             {


Fixes PerformGetByQuery related to U4-1783. The query does not need to be version specific.

--- src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
@@ -78,7 +78,9 @@
         {
             var sqlClause = GetBaseQuery(false);
             var translator = new SqlTranslator<IContent>(sqlClause, query);
-            var sql = translator.Translate();
+            var sql = translator.Translate()
+                                .Where<DocumentDto>(x => x.Newest)
+                                .OrderByDescending<ContentVersionDto>(x => x.VersionDate);

             //NOTE: This doesn't allow properties to be part of the query
             var dtos = Database.Fetch<DocumentDto, ContentVersionDto, ContentDto, NodeDto>(sql);


Fixed PR review comments

Fixed PR review comments

--- src/Umbraco.Infrastructure/Services/Implement/MemberService.cs
+++ src/Umbraco.Infrastructure/Services/Implement/MemberService.cs
@@ -941,7 +941,7 @@
             using (IScope scope = ScopeProvider.CreateScope(autoComplete: true))
             {
                 scope.ReadLock(Constants.Locks.MemberTree);
-                return _memberGroupRepository.GetMany().Select(x=>x).Distinct();
+                return _memberGroupRepository.GetMany().Distinct();
             }
         }


Corrected Version with all parameters as individual values

--- src/WinBeacon.Stack/Hci/Commands/LeSetAdvertisingParameters.cs
+++ src/WinBeacon.Stack/Hci/Commands/LeSetAdvertisingParameters.cs
@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright 2015-2016 Huysentruit Wouter, Stefan Magerstedt
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,16 +18,8 @@
 using System.Diagnostics;
 using WinBeacon.Stack.Hci.Opcodes;
 using WinBeacon.Stack.Hci.Parameters;
-using System.Collections.Generic;
-using System.Linq;
+using System.Linq;
 using System.Text.RegularExpressions;
-
-/*
-0x00 Connectable undirected advertising (ADV_IND) (default)
-0x01 Connectable high duty cycle directed advertising (ADV_DIRECT_IND, high duty cycle)
-0x02 Scannable undirected advertising(ADV_SCAN_IND)
-0x03 Non connectable undirected advertising(ADV_NONCONN_IND)
-*/

 namespace WinBeacon.Stack.Hci.Commands
 {
@@ -35,30 +27,35 @@
     {
         /// <summary>
         /// Set the advertising parameters
+        /// The Advertising_Interval_Min and Advertising_Interval_Max shall not be set to less than 0x00A0 (100 ms) if the Advertising_Type is set to 0x02 (ADV_SCAN_IND) or 0x03 (ADV_NONCONN_IND).
+        /// The Host shall not issue this command when advertising is enabled in the Controller; if it is the Command Disallowed error code shall be used.
         /// </summary>
         /// <param name="advertisingIntervalMinInMs">Minimum advertising interval for undirected and low duty cycle directed advertising. Range: 20-10240  Default: 1280 = 1.28 seconds</param>
         /// <param name="advertisingIntervalMaxInMs">Maximum advertising interval for undirected and low duty cycle directed advertising. Range: 20-10240  Default: 1280 = 1.28 seconds</param>
         /// <param name="advertisingType">The Advertising_Type is used to determine the packet type that is used for advertising when advertising is enabled.</param>
-        /// <param name="ownAdressType"></param>
-        /// <param name="peerAdressType"></param>
-        /// <param name="peerAddress"></param>
-        /// <param name="advertisingChannelMap"></param>
-        /// <param name="advertisingFilterPolicy"></param>
+        /// <param name="ownAdressType">Own_Address_Type parameter indicates the type of address being used in the advertising packets.</param>
+        /// <param name="peerAdressType">The Peer_Address_Type parameter contains the Peer’s Identity Type</param>
+        /// <param name="peerAddress">The Peer_Address parameter contains the peer’s Identity Address</param>
+        /// <param name="advertisingChannelMap">The Advertising_Channel_Map is a bit field that indicates the advertising channels that shall be used when transmitting advertising packets.At least one channel bit shall be set in the Advertising_Channel_Map parameter.</param>
+        /// <param name="advertisingFilterPolicy">The Advertising_Filter_Policy parameter shall be ignored when directed advertising is enabled.</param>
         public LeSetAdvertisingParameters(ushort advertisingIntervalMinInMs, ushort advertisingIntervalMaxInMs, AdvertisingType advertisingType, OwnAddressType ownAdressType, PeerAddressType peerAdressType, string peerAddress, AdvertisingChannelMap advertisingChannelMap, AdvertisingFilterPolicy advertisingFilterPolicy)
             : base(OpcodeGroup.LeController, (int)LeControllerOpcode.SetAdvertisingParameters)
         {
-            ushort advertisingIntervalMin = (ushort)Math.Ceiling(advertisingIntervalMinInMs / 0.625);
-            ushort advertisingIntervalMax = (ushort)Math.Ceiling(advertisingIntervalMaxInMs / 0.625);
-            Debug.Assert(advertisingIntervalMin >= 0x0020);
-            Debug.Assert(advertisingIntervalMin <= 0x4000);
-            Debug.Assert(advertisingIntervalMax >= 0x0020);
-            Debug.Assert(advertisingIntervalMax <= 0x4000);
-            Parameters.Add(new UshortCommandParameter(advertisingIntervalMin));
-            Parameters.Add(new UshortCommandParameter(advertisingIntervalMax));
+            ushort advertisingIntervalMin = (ushort)Math.Ceiling(advertisingIntervalMinInMs / 0.625);
+            ushort advertisingIntervalMax = (ushort)Math.Ceiling(advertisingIntervalMaxInMs / 0.625);
+            Debug.Assert(advertisingIntervalMin >= 0x0020);
+            Debug.Assert(advertisingIntervalMin <= 0x4000);
+            Debug.Assert(advertisingIntervalMax >= 0x0020);
+            Debug.Assert(advertisingIntervalMax <= 0x4000);
+            Parameters.Add(new UshortCommandParameter(advertisingIntervalMin));
+            Parameters.Add(new UshortCommandParameter(advertisingIntervalMax));
             Parameters.Add(new UshortCommandParameter((byte)advertisingType));
+            Parameters.Add(new UshortCommandParameter((byte)ownAdressType));
+            Parameters.Add(new UshortCommandParameter((byte)peerAdressType));
             Parameters.Add(new ByteArrayCommandParameter((from Match m in Regex.Matches(peerAddress, @"[0-9a-f]{2}", RegexOptions.IgnoreCase) select Convert.ToByte(m.Value, 16)).ToArray()));
             Parameters.Add(new ByteCommandParameter((byte)advertisingChannelMap));
             Parameters.Add(new ByteCommandParameter((byte)advertisingFilterPolicy));
         }
     }
+
 }


Red test for too many rolls

Red test for too many rolls

--- Bowling/bowling.csx
+++ Bowling/bowling.csx
@@ -122,6 +122,11 @@
 		game.Score().ShouldBe(300);
 	}

+	public void Roll_too_many()
+	{
+		Should.NotThrow(() => RollMany(rolls: 22, pins: 0));
+	}
+
 	private void RollSpare()
 	{
 		game.Roll(5);


[Core] Debug log message indicating a package definition file is being read. Good for debugging package resolution

--- Bam.Core/Package/PackageDefinition.cs
+++ Bam.Core/Package/PackageDefinition.cs
@@ -380,6 +380,8 @@
             bool validateSchemaLocation,
             bool validatePackageLocations)
         {
+            Log.DebugMessage("Reading package definition file: {0}", this.XMLFilename);
+
             var xmlReaderSettings = new System.Xml.XmlReaderSettings();
             xmlReaderSettings.CheckCharacters = true;
             xmlReaderSettings.CloseInput = true;


Stops examine on grounding rods (#6336)

Stops examine on grounding rods (#6336)

--- UnityProject/Assets/Scripts/Objects/Engineering/TeslaCoil.cs
+++ UnityProject/Assets/Scripts/Objects/Engineering/TeslaCoil.cs
@@ -206,6 +206,8 @@

 		public string Examine(Vector3 worldPos = default(Vector3))
 		{
+			if (CurrentState != TeslaCoilState.Power) return null;
+
 			return $"Generating {generatedWatts} watts of energy";
 		}


CA-236547: Unexpected error while applying hotfix on multiple Xenservers of different version

Reset both before any upload as the upload is going to set the correct one anyway

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

--- XenAdmin/Wizards/PatchingWizard/PatchingWizard_UploadPage.cs
+++ XenAdmin/Wizards/PatchingWizard/PatchingWizard_UploadPage.cs
@@ -188,6 +188,9 @@
                     case UpdateType.ISO:
                         if (CanUploadUpdateOnHost(SelectedNewPatchPath, selectedServer))
                         {
+                            _poolUpdate = null;
+                            _patch = null;
+
                             action = new UploadSupplementalPackAction(
                             selectedServer.Connection,
                             SelectedServers.Where(s => s.Connection == selectedServer.Connection).ToList(),


Fixed relocator (stupid)

Fixed relocator (stupid)

--- Blobber/Relocators/ModuleRelocator.cs
+++ Blobber/Relocators/ModuleRelocator.cs
@@ -20,7 +20,7 @@
             _newModule = newModule;
         }

-        protected override TypeSig TryRelocateTypeRef(TypeRef typeRef)
+        protected override ITypeDefOrRef TryRelocateTypeRef(TypeRef typeRef)
         {
             if (typeRef == null)
                 return null;
@@ -31,7 +31,21 @@
             // this seems to be useless: TODO: check and remove
             if (typeDef == null)
                 typeDef = _newModule.Find(BlobberStitcher.GetMergedName(typeRef, _oldModule), false);
-            return typeDef?.ToTypeSig();
+            return typeDef;
+        }
+
+        protected override ITypeDefOrRef TryRelocateTypeDef(TypeDef typeDef)
+        {
+            if (typeDef == null)
+                return null;
+            var scope = typeDef.Scope as IFullName;
+            if (scope?.FullName != _oldModule.Assembly.FullName)
+                return null;
+            var relocatedTypeDef = _newModule.Find(typeDef.FullName, false);
+            // this seems to be useless: TODO: check and remove
+            if (relocatedTypeDef == null)
+                relocatedTypeDef = _newModule.Find(BlobberStitcher.GetMergedName(typeDef, _oldModule), false);
+            return relocatedTypeDef;
         }
     }
 }


Removed unnecessary FakeFileSystem instances.

--- BlogTemplate.Tests/Pages/EditTests.cs
+++ BlogTemplate.Tests/Pages/EditTests.cs
@@ -13,7 +13,6 @@
         [Fact]
         public void UpdatePost_PublishedToPublished_TitleIsUpdated_UpdateSlug()
         {
-            //IFileSystem testFileSystem = new FakeFileSystem();
             BlogDataStore testDataStore = new BlogDataStore(new FakeFileSystem());
             SlugGenerator slugGenerator = new SlugGenerator(testDataStore);
             ExcerptGenerator excerptGenerator = new ExcerptGenerator(140);
@@ -44,7 +43,6 @@
         [Fact]
         public void UpdatePost_DraftToPublished_TitleIsUpdated_UpdateSlug()
         {
-            //IFileSystem testFileSystem = new FakeFileSystem();
             BlogDataStore testDataStore = new BlogDataStore(new FakeFileSystem());
             SlugGenerator slugGenerator = new SlugGenerator(testDataStore);
             ExcerptGenerator excerptGenerator = new ExcerptGenerator(140);
@@ -73,7 +71,6 @@
         [Fact]
         public void UpdatePost_PreviouslyPublishedDraftToPublished_TitleIsUpdated_UpdateSlug()
         {
-            //IFileSystem testFileSystem = new FakeFileSystem();
             BlogDataStore testDataStore = new BlogDataStore(new FakeFileSystem());
             SlugGenerator slugGenerator = new SlugGenerator(testDataStore);
             ExcerptGenerator excerptGenerator = new ExcerptGenerator(140);
@@ -103,7 +100,6 @@
         [Fact]
         public void UpdatePost_PreviouslyPublishedDraftToPublished_DoNotUpdatePubDate()
         {
-            //IFileSystem testFileSystem = new FakeFileSystem();
             BlogDataStore testDataStore = new BlogDataStore(new FakeFileSystem());
             SlugGenerator slugGenerator = new SlugGenerator(testDataStore);
             ExcerptGenerator excerptGenerator = new ExcerptGenerator(140);
@@ -134,7 +130,6 @@
         [Fact]
         public void UpdatePost_PublishedToDraft_TitleIsUpdated_DoNotUpdateSlug()
         {
-            //IFileSystem testFileSystem = new FakeFileSystem();
             BlogDataStore testDataStore = new BlogDataStore(new FakeFileSystem());
             SlugGenerator slugGenerator = new SlugGenerator(testDataStore);
             ExcerptGenerator excerptGenerator = new ExcerptGenerator(140);


updated to 1.2.5

updated to 1.2.5

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


Added spanish and dutch

Added spanish and dutch

--- Client/Localization/Base/Languages.cs
+++ Client/Localization/Base/Languages.cs
@@ -4,10 +4,12 @@
     public enum Languages
     {
         English,
+        Spanish,
         French,
         Russian,
         German,
         Japanese,
-        Simplified_Chinese,
+        Simplified_Chinese,
+        Dutch
     }
 }


do not permaforce nickname changes on bots, and remove restrictions

--- CompatBot/Commands/ForcedNicknames.cs
+++ CompatBot/Commands/ForcedNicknames.cs
@@ -6,6 +6,7 @@
 using CompatBot.Database;
 using CompatBot.EventHandlers;
 using CompatBot.Utils;
+using CompatBot.Utils.Extensions;
 using DSharpPlus;
 using DSharpPlus.CommandsNext;
 using DSharpPlus.CommandsNext.Attributes;
@@ -32,7 +33,7 @@
                     return;
                 }

-                if (!expectedNickname.All(c => char.IsLetterOrDigit(c) || char.IsWhiteSpace(c)))
+                if (!expectedNickname.All(c => char.IsLetterOrDigit(c) || char.IsWhiteSpace(c)) && !discordUser.IsBotSafeCheck())
                 {
                     await ctx.ReactWithAsync(Config.Reactions.Failure, "Nickname must follow Rule 7", true).ConfigureAwait(false);
                     return;
@@ -46,25 +47,28 @@
                         await ctx.RespondAsync($"{discordUser.Mention} will be renamed in all {guilds.Count} servers").ConfigureAwait(false);
                 }
                 else
-                    guilds = new List<DiscordGuild> {ctx.Guild};
+                    guilds = new(){ctx.Guild};

                 int changed = 0, noPermissions = 0, failed = 0;
                 await using var db = new BotDb();
                 foreach (var guild in guilds)
                 {
-                    var enforceRules = db.ForcedNicknames.FirstOrDefault(mem => mem.UserId == discordUser.Id && mem.GuildId == guild.Id);
-                    if (enforceRules is null)
+                    if (!discordUser.IsBotSafeCheck())
                     {
-                        enforceRules = new ForcedNickname {UserId = discordUser.Id, GuildId = guild.Id, Nickname = expectedNickname};
-                        await db.ForcedNicknames.AddAsync(enforceRules).ConfigureAwait(false);
-                    }
-                    else
-                    {
-                        if (enforceRules.Nickname == expectedNickname)
-                        {
-                            continue;
-                        }
-                        enforceRules.Nickname = expectedNickname;
+                        var enforceRules = db.ForcedNicknames.FirstOrDefault(mem => mem.UserId == discordUser.Id && mem.GuildId == guild.Id);
+                        if (enforceRules is null)
+                        {
+                            enforceRules = new() {UserId = discordUser.Id, GuildId = guild.Id, Nickname = expectedNickname};
+                            await db.ForcedNicknames.AddAsync(enforceRules).ConfigureAwait(false);
+                        }
+                        else
+                        {
+                            if (enforceRules.Nickname == expectedNickname)
+                            {
+                                continue;
+                            }
+                            enforceRules.Nickname = expectedNickname;
+                        }
                     }
                     if (!(ctx.Guild?.Permissions?.HasFlag(Permissions.ChangeNickname) ?? true))
                     {
@@ -129,7 +133,7 @@
                         try
                         {
                             //todo: change to mem.Nickname = default when the library fixes their shit
-                            await discordMember.ModifyAsync(mem => mem.Nickname = new Optional<string>("")).ConfigureAwait(false);
+                            await discordMember.ModifyAsync(mem => mem.Nickname = new("")).ConfigureAwait(false);
                         }
                         catch (Exception ex)
                         {


Update SolutionAssemblyInfo.cs

Update SolutionAssemblyInfo.cs

--- ComputeClient/SolutionAssemblyInfo.cs
+++ ComputeClient/SolutionAssemblyInfo.cs
@@ -18,4 +18,4 @@
 [assembly: AssemblyCulture("")]
 [assembly: AssemblyVersion("3.7.21")]
 [assembly: AssemblyFileVersion("3.7.21")]
-[assembly: AssemblyInformationalVersion("3.7.21-dev")]
+[assembly: AssemblyInformationalVersion("3.7.21")]


Fixed Resolve visitor to resolve argument expressions

--- ComputerAlgebra/Extensions/Resolve.cs
+++ ComputerAlgebra/Extensions/Resolve.cs
@@ -16,6 +16,8 @@

         protected override Expression VisitCall(Call F)
         {
+            F = (Call)base.VisitCall(F);
+
             if (F.Target is UnknownFunction)
             {
                 IEnumerable<Function> lookup = ns.LookupFunction(F.Target.Name, F.Arguments);


Update DragonSystem to use SharedAudioSystem (#10141)

--- Content.Server/Dragon/DragonSystem.cs
+++ Content.Server/Dragon/DragonSystem.cs
@@ -6,8 +6,6 @@
 using Content.Shared.Chemistry.Components;
 using Content.Shared.MobState;
 using Content.Shared.MobState.Components;
-using Content.Shared.Tag;
-using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using System.Threading;
@@ -21,6 +19,7 @@
         [Dependency] private readonly PopupSystem _popupSystem = default!;
         [Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
         [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audioSystem = default!;

         public override void Initialize()
         {
@@ -40,10 +39,10 @@
         {
             //Empties the stomach upon death
             //TODO: Do this when the dragon gets butchered instead
-            if (args.CurrentMobState.IsDead())
+            if (args.CurrentMobState == DamageState.Dead)
             {
                 if (component.SoundDeath != null)
-                    SoundSystem.Play(component.SoundDeath.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid, component.SoundDeath.Params);
+                    _audioSystem.PlayPvs(component.SoundDeath, uid, component.SoundDeath.Params);

                 component.DragonStomach.EmptyContainer();
             }
@@ -75,7 +74,7 @@
             component.DragonStomach.Insert(args.Target);

             if (component.SoundDevour != null)
-                SoundSystem.Play(component.SoundDevour.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid, component.SoundDevour.Params);
+                _audioSystem.PlayPvs(component.SoundDevour, uid, component.SoundDevour.Params);
         }

         private void OnDragonStructureDevourComplete(EntityUid uid, DragonComponent component, DragonStructureDevourComplete args)
@@ -85,7 +84,7 @@
             EntityManager.QueueDeleteEntity(args.Target);

             if (component.SoundDevour != null)
-                SoundSystem.Play(component.SoundDevour.GetSound(), Filter.Pvs(args.User, entityManager: EntityManager), uid, component.SoundDevour.Params);
+                _audioSystem.PlayPvs(component.SoundDevour, uid, component.SoundDevour.Params);
         }

         private void OnStartup(EntityUid uid, DragonComponent component, ComponentStartup args)
@@ -103,7 +102,7 @@
                 _actionsSystem.AddAction(uid, component.SpawnAction, null);

             if (component.SoundRoar != null)
-                SoundSystem.Play(component.SoundRoar.GetSound(), Filter.Pvs(uid, 4f, EntityManager), uid, component.SoundRoar.Params);
+                _audioSystem.Play(component.SoundRoar, Filter.Pvs(uid, 4f, EntityManager), uid, component.SoundRoar.Params);
         }

         /// <summary>
@@ -113,7 +112,11 @@
         {
             if (component.CancelToken != null ||
                 args.Handled ||
-                component.DevourWhitelist?.IsValid(args.Target, EntityManager) != true) return;
+                component.DevourWhitelist?.IsValid(args.Target, EntityManager) != true)
+            {
+                return;
+            }
+

             args.Handled = true;
             var target = args.Target;
@@ -147,7 +150,7 @@
             _popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-structure"), uid, Filter.Entities(uid));

             if (component.SoundStructureDevour != null)
-                SoundSystem.Play(component.SoundStructureDevour.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid, component.SoundStructureDevour.Params);
+                _audioSystem.PlayPvs(component.SoundStructureDevour, uid, component.SoundStructureDevour.Params);

             component.CancelToken = new CancellationTokenSource();

@@ -163,7 +166,8 @@

         private void OnDragonSpawnAction(EntityUid dragonuid, DragonComponent component, DragonSpawnActionEvent args)
         {
-            if (component.SpawnPrototype == null) return;
+            if (component.SpawnPrototype == null)
+                return;

             // If dragon has spawns then add one.
             if (component.SpawnsLeft > 0)


Made Items property virtual

Made Items property virtual

--- Core/Collections/VirtualDictionary.cs
+++ Core/Collections/VirtualDictionary.cs
@@ -114,7 +114,7 @@

 		/// Gets the enumerated list of items.
 		/// <value>The enumerated list of items.</value>
-		protected IEnumerable<KeyValuePair<TKey, TValue>> Items =>
+		protected virtual IEnumerable<KeyValuePair<TKey, TValue>> Items =>
 			Keys.Select(k => new KeyValuePair<TKey, TValue>(k, this[k]));

 		/// Gets or sets the <see cref="TValue"/> with the specified key.


Fix some trash

Fix some trash

--- Joinrpg/Controllers/GameGroupsController.cs
+++ Joinrpg/Controllers/GameGroupsController.cs
@@ -60,11 +60,6 @@
         }));
     }

-    private ActionResult WithGroupAsMaster(int projectId, int characterGroupId, Func<Project, CharacterGroup, ActionResult> p)
-    {
-      throw new NotImplementedException();
-    }
-
     private static DirectClaimSettings GetDirectClaimSettings(CharacterGroup group)

     {


Add public access for property CanMove. We need a way to pause the movement. For effects - Stun, Knockback, etc.

--- Core/Game/Abilities/Essential/Move.cs
+++ Core/Game/Abilities/Essential/Move.cs
@@ -108,7 +108,11 @@

         [SerializeField]
         private bool _canMove = true;
-        public bool CanMove {get {return _canMove;}}
+		public bool CanMove {
+			get { return _canMove; }
+			set { _canMove = value; }
+		}
+
         [SerializeField]
         private bool _canTurn = true;
         public bool CanTurn {get; private set;}


fully enforced code style

fully enforced code style

Fully enforced code style to try to maximize readability and also to
force me to understand the code. After the exercise I have to say there
is no other good way to implement Complex on .NET

--- Core/System/Numerics/Complex.net35.cs
+++ Core/System/Numerics/Complex.net35.cs
@@ -35,19 +35,28 @@
         public static readonly Complex ImaginaryOne = new Complex(0, 1);
         public static readonly Complex One = new Complex(1, 0);
         public static readonly Complex Zero = new Complex(0, 0);
-        private double real, imaginary;
+        private double _imaginary;
+        private double _real;

         public Complex(double real, double imaginary)
         {
-            this.imaginary = imaginary;
-            this.real = real;
+            _imaginary = imaginary;
+            _real = real;
         }

         public double Imaginary
         {
             get
             {
-                return imaginary;
+                return _imaginary;
+            }
+        }
+
+        private double MagnitudeSquared
+        {
+            get
+            {
+                return (_imaginary * _imaginary) + (_real * _real);
             }
         }

@@ -55,7 +64,7 @@
         {
             get
             {
-                return Math.Sqrt((imaginary * imaginary) + (real * real));
+                return Math.Sqrt((_imaginary * _imaginary) + (_real * _real));
             }
         }

@@ -63,7 +72,7 @@
         {
             get
             {
-                return Math.Atan2(imaginary, real);
+                return Math.Atan2(_imaginary, _real);
             }
         }

@@ -71,13 +80,13 @@
         {
             get
             {
-                return real;
+                return _real;
             }
         }

         public static double Abs(Complex value)
         {
-            return Math.Sqrt((value.imaginary * value.imaginary) + (value.real * value.real));
+            return Math.Sqrt((value._imaginary * value._imaginary) + (value._real * value._real));
         }

         public static Complex Acos(Complex value)
@@ -89,8 +98,8 @@
         {
             return new Complex
                 (
-                    left.real + right.real,
-                    left.imaginary + right.imaginary
+                    left._real + right._real,
+                    left._imaginary + right._imaginary
                 );
         }

@@ -106,15 +115,15 @@

         public static Complex Conjugate(Complex value)
         {
-            return new Complex(value.real, -value.imaginary);
+            return new Complex(value._real, -value._imaginary);
         }

         public static Complex Cos(Complex value)
         {
             return new Complex
                 (
-                    Math.Cos(value.real) * Math.Cosh(value.imaginary),
-                    -Math.Sin(value.real) * Math.Sinh(value.imaginary)
+                    Math.Cos(value._real) * Math.Cosh(value._imaginary),
+                    -Math.Sin(value._real) * Math.Sinh(value._imaginary)
                 );
         }

@@ -122,28 +131,28 @@
         {
             return new Complex
                 (
-                    Math.Cosh(value.real) * Math.Cos(value.imaginary),
-                    -Math.Sinh(value.real) * Math.Sin(value.imaginary)
+                    Math.Cosh(value._real) * Math.Cos(value._imaginary),
+                    -Math.Sinh(value._real) * Math.Sin(value._imaginary)
                 );
         }

         public static Complex Divide(Complex dividend, Complex divisor)
         {
-            double rsri = (divisor.real * divisor.real) + (divisor.imaginary * divisor.imaginary);
-            return new Complex
-                (
-                    ((dividend.real * divisor.real) + (dividend.imaginary * divisor.imaginary)) / rsri,
-                    ((dividend.imaginary * divisor.real) - (dividend.real * divisor.imaginary)) / rsri
+            double divisorMagnitudeSquared = divisor.MagnitudeSquared;
+            return new Complex
+                (
+                    ((dividend._real * divisor._real) + (dividend._imaginary * divisor._imaginary)) / divisorMagnitudeSquared,
+                    ((dividend._imaginary * divisor._real) - (dividend._real * divisor._imaginary)) / divisorMagnitudeSquared
                 );
         }

         public static Complex Exp(Complex value)
         {
-            var e = Math.Exp(value.real);
-            return new Complex
-                (
-                    e * Math.Cos(value.imaginary),
-                    e * Math.Sin(value.imaginary)
+            var expReal = Math.Exp(value._real);
+            return new Complex
+                (
+                    expReal * Math.Cos(value._imaginary),
+                    expReal * Math.Sin(value._imaginary)
                 );
         }

@@ -243,8 +252,8 @@
         {
             return new Complex
                 (
-                    (left.real * right.real) - (left.imaginary * right.imaginary),
-                    (left.real * right.imaginary) + (left.imaginary * right.real)
+                    (left._real * right._real) - (left._imaginary * right._imaginary),
+                    (left._real * right._imaginary) + (left._imaginary * right._real)
                 );
         }

@@ -257,37 +266,37 @@
         {
             return new Complex
                 (
-                    left.real - right.real,
-                    left.imaginary - right.imaginary
+                    left._real - right._real,
+                    left._imaginary - right._imaginary
                 );
         }

         public static Complex operator -(Complex value)
         {
-            return new Complex(-value.real, -value.imaginary);
+            return new Complex(-value._real, -value._imaginary);
         }

         public static bool operator !=(Complex left, Complex right)
         {
-            return left.real != right.real || left.imaginary != right.imaginary;
+            return left._real != right._real || left._imaginary != right._imaginary;
         }

         public static Complex operator *(Complex left, Complex right)
         {
             return new Complex
                 (
-                    (left.real * right.real) - (left.imaginary * right.imaginary),
-                    (left.real * right.imaginary) + (left.imaginary * right.real)
+                    (left._real * right._real) - (left._imaginary * right._imaginary),
+                    (left._real * right._imaginary) + (left._imaginary * right._real)
                 );
         }

         public static Complex operator /(Complex left, Complex right)
         {
-            double rsri = (right.real * right.real) + (right.imaginary * right.imaginary);
-            return new Complex
-                (
-                    ((left.real * right.real) + (left.imaginary * right.imaginary)) / rsri,
-                    ((left.imaginary * right.real) - (left.real * right.imaginary)) / rsri
+            double rsri = (right._real * right._real) + (right._imaginary * right._imaginary);
+            return new Complex
+                (
+                    ((left._real * right._real) + (left._imaginary * right._imaginary)) / rsri,
+                    ((left._imaginary * right._real) - (left._real * right._imaginary)) / rsri
                 );
         }

@@ -295,14 +304,14 @@
         {
             return new Complex
                 (
-                    left.real + right.real,
-                    left.imaginary + right.imaginary
+                    left._real + right._real,
+                    left._imaginary + right._imaginary
                 );
         }

         public static bool operator ==(Complex left, Complex right)
         {
-            return left.real == right.real && left.imaginary == right.imaginary;
+            return left._real == right._real && left._imaginary == right._imaginary;
         }

         public static Complex Pow(Complex value, double power)
@@ -321,15 +330,18 @@
             {
                 return value;
             }
-            return One / value;
+            else
+            {
+                return One / value;
+            }
         }

         public static Complex Sin(Complex value)
         {
             return new Complex
                 (
-                    Math.Sin(value.real) * Math.Cosh(value.imaginary),
-                    Math.Cos(value.real) * Math.Sinh(value.imaginary)
+                    Math.Sin(value._real) * Math.Cosh(value._imaginary),
+                    Math.Cos(value._real) * Math.Sinh(value._imaginary)
                 );
         }

@@ -337,8 +349,8 @@
         {
             return new Complex
                 (
-                    Math.Sinh(value.real) * Math.Cos(value.imaginary),
-                    Math.Cosh(value.real) * Math.Sin(value.imaginary)
+                    Math.Sinh(value._real) * Math.Cos(value._imaginary),
+                    Math.Cosh(value._real) * Math.Sin(value._imaginary)
                 );
         }

@@ -351,8 +363,8 @@
         {
             return new Complex
                 (
-                    left.real - right.real,
-                    left.imaginary - right.imaginary
+                    left._real - right._real,
+                    left._imaginary - right._imaginary
                 );
         }

@@ -368,7 +380,7 @@

         public bool Equals(Complex value)
         {
-            return real == value.real && imaginary == value.imaginary;
+            return _real == value._real && _imaginary == value._imaginary;
         }

         public override bool Equals(object obj)
@@ -377,33 +389,36 @@
             {
                 return false;
             }
-            Complex r = (Complex)obj;
-            return real == r.real && imaginary == r.imaginary;
+            else
+            {
+                Complex other = (Complex)obj;
+                return _real == other._real && _imaginary == other._imaginary;
+            }
         }

         public override int GetHashCode()
         {
-            return real.GetHashCode() ^ imaginary.GetHashCode();
+            return _real.GetHashCode() ^ _imaginary.GetHashCode();
         }

         public override string ToString()
         {
-            return string.Format("({0}, {1})", real, imaginary);
+            return string.Format("({0}, {1})", _real, _imaginary);
         }

         public string ToString(IFormatProvider provider)
         {
-            return string.Format(provider, "({0}, {1})", real, imaginary);
+            return string.Format(provider, "({0}, {1})", _real, _imaginary);
         }

         public string ToString(string format)
         {
-            return string.Format("({0}, {1})", real.ToString(format), imaginary.ToString(format));
+            return string.Format("({0}, {1})", _real.ToString(format), _imaginary.ToString(format));
         }

         public string ToString(string format, IFormatProvider provider)
         {
-            return string.Format("({0}, {1})", real.ToString(format, provider), imaginary.ToString(format, provider));
+            return string.Format("({0}, {1})", _real.ToString(format, provider), _imaginary.ToString(format, provider));
         }
     }
 }


Added CouchBase revamp status code

Added CouchBase revamp status code

--- Criteo.Memcache/Headers/HeaderUtil.cs
+++ Criteo.Memcache/Headers/HeaderUtil.cs
@@ -14,10 +14,21 @@
         InvalidArguments = 0x0004,
         ItemNotStored = 0x0005,
         IncrDecrOnNonNumeric = 0x0006,
+
+        // Revamp from http://code.google.com/p/memcached/wiki/BinaryProtocolRevamped#Response_Status
+        VbucketBelongsToAnotherServer = 0x0007,
+        AuthenticationError = 0x0008,
+        AuthenticationContinue = 0x0009,
+        NotSupported = 0x0083,
+        InternalError = 0x0084,
+        Busy = 0x0085,
+        TemporaryFailure = 0x0086,
+        // End revamp
+
         UnknownCommand = 0x0081,
         OutOfMemory = 0x0082,

-        // SASL errors
+        // SASL Commands from Couchbase
         AuthRequired = 0x0020,
         StepRequired = 0x0021,
     }


CrunchyrollBot: Apply episode offset to episodes

--- CrunchyrollBot/CrunchyrollBot/Show.cs
+++ CrunchyrollBot/CrunchyrollBot/Show.cs
@@ -63,11 +63,32 @@
                         continue;

                     GetDatabaseData();
+
+                    if (!ApplyOffsetAndCheckValidity())
+                        continue;
                 }
                 else
                 {
                     continue;
                 }
+            }
+        }
+
+        private bool ApplyOffsetAndCheckValidity()
+        {
+            // There is no offset so it does not have to be applied
+            if (InternalOffset == 0)
+            {
+                return true;
+            }
+            else
+            {
+                CrunchyrollEpisodeNumber += InternalOffset;
+                // The episode was actually an episode from a different season so it needs to be skipped
+                if (CrunchyrollEpisodeNumber <= 0)
+                    return false;
+                else
+                    return true;
             }
         }


PurchaseModel: now Serializable

PurchaseModel: now Serializable

--- CryptoTracker/Models/PurchaseModel.cs
+++ CryptoTracker/Models/PurchaseModel.cs
@@ -1,12 +1,22 @@
-using Microsoft.Toolkit.Mvvm.ComponentModel;
-using System;
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using Windows.UI;
 using Windows.UI.Xaml.Media;

 namespace CryptoTracker.Models {
-	[DataContractAttribute()]
-    public class PurchaseModel : ObservableObject {
+    [DataContract()]
+    public class PurchaseModel : INotifyPropertyChanged {
+
+        private void SetProperty<T>(ref T field, T newValue, [CallerMemberName] string propertyName = null) {
+            if (newValue.Equals(field))
+                return;
+            field = newValue;
+            NotifyPropertyChanged(propertyName);
+        }
+
+        public PurchaseModel() { }

         private bool isComplete = false;
         public bool IsComplete {
@@ -103,5 +113,12 @@
             get => worth;
             set => SetProperty(ref worth, value);
         }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+        public void NotifyPropertyChanged([CallerMemberName] string propertyName = "") {
+            if (PropertyChanged != null)
+                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+
+        }
     }
 }


Bump version to 3.2.1

Bump version to 3.2.1

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


Make the bsp generation more accessible

Make the bsp generation more accessible

--- DataConverters3D/Object3D/Object3D.cs
+++ DataConverters3D/Object3D/Object3D.cs
@@ -198,22 +198,29 @@
 				if (_color != value)
 				{
 					_color = value;
-
-					if (_color.alpha != 255
-						&& Mesh != null
-						&& Mesh.FaceBspTree == null
-						&& Mesh.Faces.Count < 2000
-						&& !buildingFaceBsp)
-					{
-						this.buildingFaceBsp = true;
-						Task.Run(() =>
-						{
-							var bspTree = FaceBspTree.Create(Mesh);
-							UiThread.RunOnIdle(() => Mesh.FaceBspTree = bspTree);
-							this.buildingFaceBsp = false;
-						});
-					}
-				}
+					if (_color.alpha != 255)
+					{
+						EnsureTransparentSorting();
+					}
+				}
+			}
+		}
+
+		public void EnsureTransparentSorting()
+		{
+			if (Mesh != null
+				&& Mesh.FaceBspTree == null
+				&& Mesh.Faces.Count < 2000
+				&& !buildingFaceBsp)
+			{
+				this.buildingFaceBsp = true;
+				Task.Run(() =>
+				{
+					// TODO: make a SHA1 based cache for the sorting on this mesh and use them from memory or disk
+					var bspTree = FaceBspTree.Create(Mesh);
+					UiThread.RunOnIdle(() => Mesh.FaceBspTree = bspTree);
+					this.buildingFaceBsp = false;
+				});
 			}
 		}


Fix Remove

Fix Remove

--- DataConverters3D/Object3D/SafeList.cs
+++ DataConverters3D/Object3D/SafeList.cs
@@ -51,7 +51,7 @@

 		public void Add(T item) => this.Modify(list => list.Add(item));

-		public void Remove(T item) => this.Modify(list => list.Add(item));
+		public void Remove(T item) => this.Modify(list => list.Remove(item));

 		public int Count => items.Count;


Add parse case for CATALOG.

Add parse case for CATALOG.

--- Levolution.Data.CueSheet.Shared/CueSheet.cs
+++ Levolution.Data.CueSheet.Shared/CueSheet.cs
@@ -76,6 +76,7 @@
                 var command = regex.Matches(line).Cast<object>().Select(x => x.ToString().Trim()).Where(x => !string.IsNullOrEmpty(x)).ToArray();
                 switch(command[0])
                 {
+                    case "CATALOG": { cueSheet.Catalog = command[1]; break; }
                     case "TITLE": { currentInfo.Title = command[1]; break; }
                     case "PERFORMER": { currentInfo.Performer = command[1]; break; }
                     case "SONGWRITER": { currentInfo.SongWriter = command[1]; break; }


version number test: expand preview characters

--- LibGit2Sharp.Tests/GlobalSettingsFixture.cs
+++ LibGit2Sharp.Tests/GlobalSettingsFixture.cs
@@ -30,7 +30,7 @@
             //      git2hash: '06d772d' LibGit2 library hash.
             //      arch: 'x86' or 'x64' LibGit2 target.
             //      git2Features: 'Threads, Ssh' LibGit2 features compiled with.
-            string regex = @"^(?<version>\d+\.\d+\.\d+(-\w+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?LibGit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";
+            string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?LibGit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";

             Assert.NotNull(versionInfo);