Fixed bug in UserNotifications example that didn't correctly check for local user.

--- Assets/HoloToolkit-Examples/Sharing/SharingService/Scripts/UserNotifications.cs
+++ Assets/HoloToolkit-Examples/Sharing/SharingService/Scripts/UserNotifications.cs
@@ -35,17 +35,17 @@
             usersTracker.UserLeft += NotifyUserLeft;
         }

-        private static void NotifyUserJoined(User user)
+        private void NotifyUserJoined(User user)
         {
-            if (user.IsValid() && localUser != user)
+            if (user.IsValid() && localUser.GetID() != user.GetID())
             {
                 Debug.LogFormat("[User Notifications] User {0} has joined the room.", user.GetName());
             }
         }

-        private static void NotifyUserLeft(User user)
+        private void NotifyUserLeft(User user)
         {
-            if (user.IsValid() && localUser != user)
+            if (user.IsValid() && localUser.GetID() != user.GetID())
             {
                 Debug.LogFormat("[User Notifications] User {0} has left the room.", user.GetName());
             }


Minor cleanup of using statements under OSX.

--- AudioWorks/src/Extensions/AudioWorks.Extensions.ReplayGain/Ebur128LibHandler.cs
+++ AudioWorks/src/Extensions/AudioWorks.Extensions.ReplayGain/Ebur128LibHandler.cs
@@ -20,9 +20,9 @@
 using System.IO;
 #if !LINUX
 using System.Reflection;
-#if !NETCOREAPP2_1
+#endif
+#if WINDOWS && !NETCOREAPP2_1
 using System.Runtime.InteropServices;
-#endif
 #endif
 #if !LINUX
 using System.Runtime.Loader;


BigDipper

BigDipper

--- Demos/CSharpGL.Demos/Models/BigDipper.cs
+++ Demos/CSharpGL.Demos/Models/BigDipper.cs
@@ -30,8 +30,8 @@
             }
         }

-        static vec3[] BigDipperPositions { get; set; }
-        static vec3[] BigDipperColors { get; set; }
+        static readonly vec3[] BigDipperPositions;
+        static readonly vec3[] BigDipperColors;

         static BigDipper()
         {


Fix resultados en estacion mantenimiento

--- Desarrollo/SimuRails/Models/Formacion.cs
+++ Desarrollo/SimuRails/Models/Formacion.cs
@@ -182,6 +182,7 @@
                     this.KilometrosRecorridos += distancia;
                     ActualizarHoraSalida(t + tiempoDeViaje + tiempoAtencion);
                     this.log.Info("# T: " + LogHelper.TimeConvert(this.HoraSalida, true) + " | Estacion: " + (this.EstacionActual.Nombre + new string(' ', 20)).Substring(0, 20) + " | Ascendidos " + pasajerosAscendidos + " | Descendidos: " + pasajerosDescendidos + " | Totales: " + this.Pasajeros);
+                    CalcularResultados();
                     return t + tiempoDeViaje + tiempoAtencion;
                 }
                 //Se setea el tiempo comprometido de la estacion a la que acaba de llegar.


Fix FCurve property width.

Fix FCurve property width.

--- Dev/Editor/Effekseer/GUI/Dock/FCurves.cs
+++ Dev/Editor/Effekseer/GUI/Dock/FCurves.cs
@@ -127,6 +127,8 @@
 			float dpiScale = Manager.DpiScale;
 			var contentSize = Manager.NativeManager.GetContentRegionAvail();

+			Manager.NativeManager.PushItemWidth(-1);
+
 			if (Component.Functions.CanShowTip())
 			{
 				Manager.NativeManager.SetTooltip(Resources.GetString("FCurve_TimelineMode_Desc"));
@@ -270,6 +272,8 @@
 			Manager.NativeManager.NextColumn();

 			UpdateDetails();
+
+			Manager.NativeManager.PopItemWidth();

 			isFirstUpdate = false;
 		}


splittet GetHaschcode test function into 2 separate

--- tests/Functions/FileFunctionsTest.cs
+++ tests/Functions/FileFunctionsTest.cs
@@ -30,24 +30,27 @@
         #region Public Instance Methods

         [Test]
-        public void GetChecksum() {
-            string buildFragment1 =
+        public void GetChecksum_MD5() {
+            string buildFragment =
                 "<project>" +
                 "   <echo file=\"checksum.input\">test input file</echo>" +
                 "   <property name=\"checksum\" value=\"${file::get-checksum('checksum.input','MD5')}\" />" +
-                "   <fail unless=\"${checksum == '91ddb9a8a8fc8f96c182b2b7e8c65f52'}\">${checksum}</fail>" +
+                "   <fail unless=\"${checksum == '5de15b57ef72b6ee1784b6f941a4e1be'}\">${checksum}</fail>" +
                 "</project>";

-            RunBuild(buildFragment1);
+            RunBuild(buildFragment);
+        }

-            string buildFragment2 =
+        [Test]
+        public void GetChecksum_SHA1() {
+            string buildFragment =
                 "<project>" +
                 "   <echo file=\"checksum.input\">test input file</echo>" +
                 "   <property name=\"checksum\" value=\"${file::get-checksum('checksum.input','sha1')}\" />" +
-                "   <fail unless=\"${checksum == '124a5468603f36e91980bb345aff00308267fc7e'}\">${checksum}</fail>" +
+                "   <fail unless=\"${checksum == '033f8ec76d9c63a9e8c6baab4298c3b88819eeaa'}\">${checksum}</fail>" +
                 "</project>";

-            RunBuild(buildFragment2);
+            RunBuild(buildFragment);
         }

         [Test]


Minor clean up in _Layout.cshtml

Minor clean up in _Layout.cshtml

--- Dinero.Tools.Difference/Dinero.Tools.Difference.Web/Views/Shared/_Layout.cshtml
+++ Dinero.Tools.Difference/Dinero.Tools.Difference.Web/Views/Shared/_Layout.cshtml
@@ -38,24 +38,6 @@

                 Dinero.dk Værktøj (BETA)

-
-
-            @*

-

-

-
-

-

-                            Portfolio
-

-

-                            About
-

-

-                            Contact
-

-

-
*@


Allow time for 32K screenshots to finish saving

--- EDDiscovery/ImageHandler/ImageHandler.cs
+++ EDDiscovery/ImageHandler/ImageHandler.cs
@@ -183,7 +183,7 @@

                 FileStream testfile = null;

-                for (int tries = 20; tries-- > 0;)          // wait 10 seconds and then try it anyway.. first time ED converts I've seen 2+ seconds.
+                for (int tries = 60; tries-- > 0;)          // wait 30 seconds and then try it anyway.. 32K hires shots take a while to write.
                 {
                     System.Threading.Thread.Sleep(500);     // every 500ms see if we can read the file, if we can, go, else wait..
                     try


Se agrega el comodin a los writeline para que se vea el valor de cada una de las variables

--- EjercicioNro01/EjercicioNro01/Program.cs
+++ EjercicioNro01/EjercicioNro01/Program.cs
@@ -36,9 +36,10 @@
             }
             promedio = sum / num.Length;

-            Console.WriteLine("Valor Maximo: ", num.Max());
-            Console.WriteLine("Valor Minimo: ", num.Min());
-            Console.WriteLine("Valor Promedio: ", promedio);
+            Console.WriteLine("Valor Maximo: {0}", num.Max());
+            Console.WriteLine("Valor Minimo: {0}", num.Min());
+            Console.WriteLine("Valor Promedio: {0}", promedio);
+            Console.ReadLine();

         }
     }


Added busy waiting at execution command.

--- src/vs15/CoCo/VsSettingsService.cs
+++ src/vs15/CoCo/VsSettingsService.cs
@@ -1,6 +1,7 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Threading;
 using System.Windows.Media;
 using System.Xml;
 using System.Xml.XPath;
@@ -49,9 +50,11 @@
             var result = new Dictionary<string, ClassificationSettings>();

             /// NOTE: <see cref="Microsoft.VisualStudio.Shell.Interop.IVsCommandWindow.ExecuteCommand"/> just posts message
-            /// of execution command to shell's queue, that doesn't match the current synchronous model =>
-            /// use <see cref="EnvDTE._DTE.ExecuteCommand"/> to immediatly invoke a command
+            /// of execution command to shell's queue, that doesn't match the current synchronous model,
+            /// <see cref="EnvDTE._DTE.ExecuteCommand"/> aslo is asynchronous, but more usefull, if use it together with a busy-looping
+            /// (<see cref="EnvDTE._dispCommandEvents_Event.AfterExecute"/> doesn't solve the issue)
             ClassificationManager.Instance.DTE.ExecuteCommand("Tools.ImportandExportSettings", $"/export:\"{_tempCurrenSettings}\"");
+            if (!IsExportDone(30)) return result;

             XmlNodeList existingSettings;
             try
@@ -108,5 +111,33 @@
             File.Delete(_tempCurrenSettings);
             return result;
         }
+
+        /// <summary>
+        /// Busy-looping that just check if the <see cref="_tempCurrenSettings"/> is locked or free.
+        /// <para>It will check not more than <paramref name="repeatCount"/> times</para>
+        /// </summary>
+        private static bool IsExportDone(int repeatCount)
+        {
+            while (repeatCount < 30)
+            {
+                try
+                {
+                    using (var stream = File.OpenText(_tempCurrenSettings))
+                    {
+                    }
+                    break;
+                }
+                catch (IOException)
+                {
+                    using (var waitHandle = new ManualResetEventSlim(false))
+                    {
+                        waitHandle.Wait(100);
+                    }
+                    ++repeatCount;
+                }
+            }
+
+            return repeatCount < 30;
+        }
     }
 }


Web.Api: Adding the name and version of the application to the log file creation

--- src/web.api/DependencyInjection.cs
+++ src/web.api/DependencyInjection.cs
@@ -71,11 +71,14 @@

         private static void RegisterLoggers(ContainerBuilder builder)
         {
+            var assemblyInfo = Assembly.GetExecutingAssembly().GetName();
             builder.Register(c => LoggerBuilder.ForFile(
                     Path.Combine(Assembly.GetExecutingAssembly().LocalDirectoryPath(), @"..\App_Data", DefaultInfoFileName),
                     new DebugLogTemplate(
                         c.Resolve<IConfiguration>(),
-                        () => DateTimeOffset.Now)))
+                        () => DateTimeOffset.Now),
+                    assemblyInfo.Name,
+                    assemblyInfo.Version))
                 .As<ILogger>()
                 .SingleInstance();
         }
@@ -104,7 +107,9 @@
                 builder.RegisterModule(new DataAccessModule());

                 builder.Register(c => new XmlConfiguration(
-                        WebApiConfigurationKeys.ToCollection().ToList(),
+                        WebApiConfigurationKeys.ToCollection()
+                            .Append(DiagnosticsConfigurationKeys.ToCollection())
+                            .ToList(),
                         WebApiConstants.ConfigurationSectionApplicationSettings))
                     .As<IConfiguration>()
                     .SingleInstance();


Web Forms: Implemented requested change as per #178

--- src/i18n/ResponseFilter.cs
+++ src/i18n/ResponseFilter.cs
@@ -1,189 +1,189 @@
-using System;
-using System.Linq;
-using System.IO;
-using System.Text;
-using System.Web;
-using System.Web.UI;
-using i18n.Helpers;
-
-namespace i18n
-{
-    ///
-    /// A filter class used to intercept the ASP.NET response stream and
-    /// post-process the response for localization. This includes:
-    ///   1. Localization of marked messages (nuggets) in the response entity;
-    ///   2. Late URL Localization.
-    ///
-    public class ResponseFilter : Stream
-    {
-        private IEarlyUrlLocalizer m_earlyUrlLocalizer;
-        private INuggetLocalizer m_nuggetLocalizer;
-
-        /// <remarks>
-        /// We need to accumulate all written blocks into a staging buffer so that
-        /// any nuggets which straddle the break between two blocks are picked up
-        /// correctly. This approach is not perfect in that we need to allocate a block
-        /// of memory for the entire response, which could be large, but the only way
-        /// around would involve parsing for nuggest where we track start and end
-        /// tokens (that is, don't use regex).
-        /// </remarks>
-        private MemoryStream m_stagingBuffer = new MemoryStream();
-
-        ///
-        /// The stream onto which we pass data once processed. This will typically be set
-        /// to the stream which was the original value of Response.Filter before we got there.
-        ///
-        protected Stream m_outputStream;
-
-        ///
-        /// HTTP context with which the filter is associated.
-        ///
-        protected HttpContextBase m_httpContext;
-
-        public ResponseFilter(
-            HttpContextBase httpContext,
-            Stream outputStream,
-            IEarlyUrlLocalizer earlyUrlLocalizer,
-            INuggetLocalizer nuggetLocalizer)
-        {
-            m_httpContext = httpContext;
-            m_outputStream = outputStream;
-            m_earlyUrlLocalizer = earlyUrlLocalizer;
-            m_nuggetLocalizer = nuggetLocalizer;
-        }
-
-    #region [Stream]
-
-        public override void Write(byte[] buffer, int offset, int count)
-        {
-            DebugHelpers.WriteLine("ResponseFilter::Write -- count: {0}", count);
-
-            m_stagingBuffer.Write(buffer, offset, count);
-        }
-
-        public override void Flush()
-        {
-            DebugHelpers.WriteLine("ResponseFilter::Flush");
-
-            // Convert byte array into string.
-            Encoding enc = m_httpContext.Response.ContentEncoding;
-            Byte[] buf = m_stagingBuffer.GetBuffer();
-            string entity = enc.GetString(buf, 0, (int)m_stagingBuffer.Length);
-
-            // Prep for special BOM handling.
-            // NB: at present we only support UTF-8 for this logic.
-            //bool utf8WithoutBom = enc is UTF8Encoding && !buf.IsTextWithBom_Utf8();
-                // #86 -- disabled this BOM handling for now as it doesn't seem to help.
-                // Furthermore, it appears that the Encoding instance returned by
-                // Response.ContentEncoding above is correctly configured to omit
-                // BOM or not from its GetByte method, depending on whether or not
-                // the response buffer has a BOM in it or not (for instance, see the
-                // ctor of UTF8Encoding that takes a bool for this).
-
-            // Buffer no longer required so release memory.
-            m_stagingBuffer.Dispose();
-            m_stagingBuffer = null;
-            buf = null;
-
-            // Translate any embedded messages aka 'nuggets'.
-            if (m_nuggetLocalizer != null)
-            {
-                var page = m_httpContext.Handler as Page;
-                //if webforms and postback
-                if (page != null && page.IsPostBack) {
-                    var postbackParser = new PostbackParser(entity);
-                    // not quite sure only those 2 types should be translated (any help ?)
-                    var types = new[]
-                    {
-                        "updatePanel",
-                        "scriptStartupBlock"
-                    };
-                    foreach (var type in types) {
-                        postbackParser.GetSections(type).ForEach(section => {
-                            section.Content = m_nuggetLocalizer.ProcessNuggets(
-                                section.Content,
-                                m_httpContext.GetRequestUserLanguages());
-                        });
-                    }
-                    entity = postbackParser.ToString();
-                } else {
-                    entity = m_nuggetLocalizer.ProcessNuggets(
-                        entity,
-                        m_httpContext.GetRequestUserLanguages());
-                }
-            }
-
-            // If Early Localization is enabled, we balance that here with Late URL Localization.
-            // The goal is to localize same-host URLs in the entity body and so save a redirect
-            // on subsequent requests to those URLs by the user-agent (Early URL Localization).
-            // We patch all URLs in the entity which are:
-            //  1. same-host
-            //  2. are not already localized
-            //  3. pass any custom filtering
-            // Examples of attributes containing urls include:
-            //


Thats what you get for not building before comitting

--- Extensions/System/ExceptionExtensions.cs
+++ Extensions/System/ExceptionExtensions.cs
@@ -33,9 +33,9 @@
         /// <returns>The inner most exception or the exception at <paramref name="maxDepth"/>.</returns>
         public static Exception InnerMostException(this Exception exception, int maxDepth)
         {
-            if (exception.InnerException != null || depth == 0)
+            if (exception.InnerException != null || maxDepth == 0)
             {
-                return exception.InnerException.InnerMostException(depth--);
+                return exception.InnerException.InnerMostException(maxDepth--);
             }

             return exception.InnerException;


Included Blackforest in trusted authority list in v3 (#601)

#587

--- src/ADAL.PCL/AuthenticatorTemplateList.cs
+++ src/ADAL.PCL/AuthenticatorTemplateList.cs
@@ -36,10 +36,11 @@
     {
         public AuthenticatorTemplateList()
         {
-            string[] trustedHostList =
+            string[] trustedHostList =
                 {
                     "login.windows.net",            // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
                     "login.chinacloudapi.cn",       // Microsoft Azure China
+                    "login.microsoftonline.de",     // Microsoft Azure Blackforest
                     "login-us.microsoftonline.com", // Microsoft Azure US Government
                     "login.microsoftonline.com"     // Microsoft Azure Worldwide
                 };


Fix oopsie

Fix oopsie

--- src/Alex.Networking.Java/NetConnection.cs
+++ src/Alex.Networking.Java/NetConnection.cs
@@ -82,6 +82,7 @@
 					return false;

 				Client = new TcpClient();
+
 				//Client.ReceiveBufferSize = int.MaxValue;
 				//Client.SendBufferSize = int.MaxValue;

@@ -212,7 +213,7 @@
 						    if (cancellationToken.IsCancellationRequested)
 							    break;

-						    if (TryReadPacket(readStream, out var lastPacketId))
+						    if (readStream.DataAvailable && TryReadPacket(readStream, out var lastPacketId))
 						    {
 							    _lastReceivedPacketId = lastPacketId;
 						    }


TimeSeriesEntity: Added ISupportLifecycle to the interfaces extended by IAdapterCollection.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C87961

--- Source-TimeSeriesEntity/Libraries/GSF.TimeSeries/Adapters/IAdapterCollection.cs
+++ Source-TimeSeriesEntity/Libraries/GSF.TimeSeries/Adapters/IAdapterCollection.cs
@@ -32,7 +32,7 @@
     /// <summary>
     /// Represents the abstract interface for a collection of adapters.
     /// </summary>
-    public interface IAdapterCollection : IList<IAdapter>, IProvideStatus
+    public interface IAdapterCollection : IList<IAdapter>, ISupportLifecycle, IProvideStatus
     {
         #region [ Members ]


Added more exception handeling to TCP listener.

--- Source/SharpBattleNet.Framework.Networking/Listeners/TCP/Details/TCPListener.cs
+++ Source/SharpBattleNet.Framework.Networking/Listeners/TCP/Details/TCPListener.cs
@@ -46,6 +46,7 @@
     internal sealed class TCPListener : ITCPListener
     {
         private readonly Logger _logger = LogManager.GetCurrentClassLogger();
+
         private readonly ISocketEventPool _socketEvents = null;
         private readonly IListenerTCPConnectionFactory _listenerFactory = null;

@@ -72,6 +73,7 @@
                 socketEvent = new SocketAsyncEventArgs();
             }

+            socketEvent.AcceptSocket = null;
             socketEvent.Completed += HandleAcceptEvent;

             return socketEvent;
@@ -83,7 +85,11 @@

             socketEvent.AcceptSocket = null;
             socketEvent.Completed -= HandleAcceptEvent;
-            _socketEvents.TryAdd(socketEvent);
+
+            if(false == _socketEvents.TryAdd(socketEvent))
+            {
+                _logger.Trace("Failed to add an instance of a socket event back to the socket event pool");
+            }

             return;
         }
@@ -92,21 +98,44 @@
         {
             IListenerTCPConnection connection = null;

-            _logger.Info("Got new TCP connection from {0}", socketEvent.AcceptSocket.RemoteEndPoint);
+            Guard.AgainstNull(socketEvent);
+
+            _logger.Debug("Got new TCP connection from {0}", socketEvent.AcceptSocket.RemoteEndPoint);

             StartAccept();

-            if (socketEvent.SocketError != SocketError.Success)
-            {
-                _logger.Warn("Socket connection from {0} failed. Stated reason is : {1}", socketEvent.AcceptSocket.RemoteEndPoint, socketEvent.SocketError);
+            if (SocketError.Success != socketEvent.SocketError)
+            {
+                if (SocketError.ConnectionReset == socketEvent.SocketError)
+                {
+                    _logger.Trace("Connection reset from {0}. Possible DOS attack", socketEvent.AcceptSocket.RemoteEndPoint);
+                }
+                else
+                {
+                    if (null != socketEvent.AcceptSocket)
+                    {
+                        _logger.Warn("Socket connection from {0} failed.", socketEvent.AcceptSocket.RemoteEndPoint);
+                    }
+
+                    _logger.Trace("Socket accept fail reason : {0}", socketEvent.SocketError);
+                }
             }
             else
             {
-                connection = _listenerFactory.Create();
-                connection.Start(socketEvent.AcceptSocket);
-                if (false == _accepted(connection))
-                {
-                    connection.Disconnect();
+                try
+                {
+                    connection = _listenerFactory.Create();
+                    connection.Start(socketEvent.AcceptSocket);
+                    if (false == _accepted(connection))
+                    {
+                        connection.Disconnect();
+                    }
+                }
+                catch(Exception ex)
+                {
+                    _logger.DebugException("Failed to create socket connection", ex);
+
+                    socketEvent.AcceptSocket.Close();
                 }
             }

@@ -125,11 +154,23 @@
         {
             SocketAsyncEventArgs socketEvent = null;

-            socketEvent = RequestSocketEvent();
-
-            if (false == _listener.AcceptAsync(socketEvent))
-            {
-                HandleAccept(socketEvent);
+            try
+            {
+                socketEvent = RequestSocketEvent();
+
+                if (false == _listener.AcceptAsync(socketEvent))
+                {
+                    HandleAccept(socketEvent);
+                }
+            }
+            catch (ObjectDisposedException ex)
+            {
+                _logger.TraceException("Socket disposed. Normal exception that happens at exit", ex);
+
+                if (null != socketEvent)
+                {
+                    RecycleSocketEvent(socketEvent);
+                }
             }

             return;


Refactor/rename queue flush command

Refactor/rename queue flush command

--- src/InEngine.Core/Queue/Commands/Flush.cs
+++ src/InEngine.Core/Queue/Commands/Flush.cs
@@ -6,27 +6,27 @@
     public class Flush : AbstractCommand
     {
         [Option("pending", HelpText = "Clear the pending queue.")]
-        public bool ClearPendingQueue { get; set; }
+        public bool PendingQueue { get; set; }

         [Option("failed", HelpText = "Clear the failed queue.")]
-        public bool ClearFailedQueue { get; set; }
+        public bool FailedQueue { get; set; }

         [Option("in-progress", HelpText = "Clear the in-progress queue.")]
-        public bool ClearInProgressQueue { get; set; }
+        public bool InProgressQueue { get; set; }

         [Option("secondary", HelpText = "Clear secondary queues. Primary queues are cleared by default.")]
         public bool UseSecondaryQueue { get; set; }

         public override void Run()
         {
-            if (ClearPendingQueue == false && ClearFailedQueue == false && ClearInProgressQueue == false)
+            if (PendingQueue == false && FailedQueue == false && InProgressQueue == false)
                 throw new CommandFailedException("Must specify at least one queue to clear. Use -h to see available options.");
             var broker = Broker.Make(UseSecondaryQueue);
-            if (ClearPendingQueue)
+            if (PendingQueue)
                 Info($"Pending: {broker.ClearPendingQueue().ToString()}");
-            if (ClearInProgressQueue)
+            if (InProgressQueue)
                 Info($"In-progress: {broker.ClearInProgressQueue().ToString()}");
-            if (ClearFailedQueue)
+            if (FailedQueue)
                 Info($"Failed: {broker.ClearFailedQueue().ToString()}");
         }
     }


Revert interaction change (#6013)

Revert interaction change (#6013)

* Map updates

* Removes fugitive from traitor gamemode

* Fixes menu button not working

* Possible NRE fixes

* Tesla now moves through walls

* fixes tesla damage

* Fix arc NRE

* Fix ghost role manager NRE

* Should fix client shooter not seeing bullets

* Singularity fix

* Update InteractionUtils.cs


Assign target planet

Assign target planet

--- contractContainer.cs
+++ contractContainer.cs
@@ -29,8 +29,12 @@
 using System.Collections.Generic;
 using System;
 using System.Linq;
+using System.Text.RegularExpressions;
 using Contracts;
-using Contracts.Parameters;
+using Contracts.Templates;
+using FinePrint.Contracts;
+using FinePrint.Contracts.Parameters;
+using FinePrint.Utilities;
 using UnityEngine;
 using System.Reflection;

@@ -45,6 +49,7 @@
 		private double totalReward, duration;
 		private bool showNote;
 		private string daysToExpire;
+		private string targetPlanet;
 		private string title = "";
 		private string notes = "";
 		private string fundsRewString, fundsPenString, repRewString, repPenString, sciRewString;
@@ -84,6 +89,10 @@
 				ContractParameter param = c.GetParameter(i);
 				addContractParam(param, 0);
 			}
+
+			CelestialBody t = getTargetBody();
+
+			targetPlanet = t == null ? "" : t.name;
 		}

 		private void addContractParam(ContractParameter param, int Level)
@@ -176,6 +185,97 @@
 			allParamList.Add(pC);
 		}

+		private CelestialBody getTargetBody()
+		{
+			if (contract == null)
+				return null;
+
+			bool checkTitle = false;
+
+			Type t = contract.GetType();
+
+			if (t == typeof(CollectScience))
+				return ((CollectScience)contract).TargetBody;
+			else if (t == typeof(ExploreBody))
+				return ((ExploreBody)contract).TargetBody;
+			else if (t == typeof(PartTest))
+			{
+				var fields = typeof(PartTest).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
+
+				return fields[1].GetValue((PartTest)contract) as CelestialBody;
+			}
+			else if (t == typeof(PlantFlag))
+				return ((PlantFlag)contract).TargetBody;
+			else if (t == typeof(RecoverAsset))
+			{
+				var fields = typeof(RecoverAsset).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
+
+				return fields[0].GetValue((RecoverAsset)contract) as CelestialBody;
+			}
+			else if (t == typeof(GrandTour))
+				return ((GrandTour)contract).TargetBodies.LastOrDefault();
+			else if (t == typeof(ARMContract))
+			{
+				var fields = typeof(ARMContract).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
+
+				return fields[0].GetValue((ARMContract)contract) as CelestialBody;
+			}
+			else if (t == typeof(BaseContract))
+				return ((BaseContract)contract).targetBody;
+			else if (t == typeof(ISRUContract))
+				return ((ISRUContract)contract).targetBody;
+			else if (t == typeof(RecordTrackContract))
+				return null;
+			else if (t == typeof(SatelliteContract))
+			{
+				SpecificOrbitParameter p = contract.GetParameter<SpecificOrbitParameter>();
+
+				if (p == null)
+					return null;
+
+				return p.targetBody;
+			}
+			else if (t == typeof(StationContract))
+				return ((StationContract)contract).targetBody;
+			else if (t == typeof(SurveyContract))
+				return ((SurveyContract)contract).targetBody;
+			else if (t == typeof(TourismContract))
+				return null;
+			else if (t == typeof(WorldFirstContract))
+			{
+				ProgressTrackingParameter p = contract.GetParameter<ProgressTrackingParameter>();
+
+				if (p == null)
+					return null;
+
+				var fields = typeof(ProgressTrackingParameter).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
+
+				var milestone = fields[0].GetValue(p) as ProgressMilestone;
+
+				if (milestone == null)
+					return null;
+
+				return milestone.body;
+			}
+			else
+				checkTitle = true;
+
+			if (checkTitle)
+			{
+				foreach (CelestialBody b in FlightGlobals.Bodies)
+				{
+					string n = b.name;
+
+					Regex r = new Regex(string.Format(@"\b{0}\b", n));
+
+					if (r.IsMatch(title))
+						return b;
+				}
+			}
+
+			return null;
+		}
+
 		#region Public Accessors

 		public Contract Contract
@@ -216,6 +316,11 @@
 		{
 			get { return notes; }
 			internal set { notes = value; }
+		}
+
+		public string TargetPlanet
+		{
+			get { return targetPlanet; }
 		}

 		public string FundsRewString
@@ -295,7 +400,7 @@
 			{
 				if (PartTestName == "partTest")
 				{
-					part = ((PartTest)cParam).tgtPartInfo;
+					part = ((Contracts.Parameters.PartTest)cParam).tgtPartInfo;
 					DMC_MBE.LogFormatted_DebugOnly("Part Assigned For Stock Part Test");
 				}
 				else if (PartTestName == "MCEScience")


Switch to fluent DeserializerBuilder

Switch to fluent DeserializerBuilder

--- src/MagicChunks/Documents/YamlDocument.cs
+++ src/MagicChunks/Documents/YamlDocument.cs
@@ -15,7 +15,11 @@

         public YamlDocument(string source)
         {
-            var deserializer = new Deserializer(namingConvention: new CamelCaseNamingConvention(), objectFactory: new CustomObjectFactory());
+            var deserializer = new DeserializerBuilder()
+                .WithNamingConvention(new CamelCaseNamingConvention())
+                .WithObjectFactory(new CustomObjectFactory())
+                .Build();
+
             using (var reader = new StringReader(source))
             {
                 try


Fixed when applicationUser is null and trying to load settings

--- Forum/Repositories/SettingsRepository.cs
+++ Forum/Repositories/SettingsRepository.cs
@@ -108,7 +108,7 @@
 		public string GetSetting(string name, bool forceGlobal) {
 			var settingValue = string.Empty;

-			if (!forceGlobal) {
+			if (!forceGlobal && !(UserContext.ApplicationUser is null)) {
 				var userId = UserContext.ApplicationUser.Id;

 				if (!UserSettings.ContainsKey(userId)) {


Removed unnecessary namespace

Removed unnecessary namespace

--- GZipRequestHandler.WebApi/GZipHandler.cs
+++ GZipRequestHandler.WebApi/GZipHandler.cs
@@ -11,7 +11,7 @@
     /// </summary>
     public class GZipHandler : DelegatingHandler
     {
-        protected override System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
+        protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
         {
             if (IsRequestCompressed(request))
             {


Try wheel zoom one pixel in

Try wheel zoom one pixel in

--- Gu.Wpf.Geometry.UiTests/ZoomViewTests.cs
+++ Gu.Wpf.Geometry.UiTests/ZoomViewTests.cs
@@ -106,7 +106,7 @@

             var topLeft = image.Properties.BoundingRectangle.Value.TopLeft();
             var size = Size.Parse(renderSize.Text);
-            Mouse.Click(MouseButton.Left, new FlaUI.Core.Shapes.Point(topLeft.X + size.Width, topLeft.Y + size.Height));
+            Mouse.Click(MouseButton.Left, new FlaUI.Core.Shapes.Point(topLeft.X + size.Width - 1, topLeft.Y + size.Height - 1));
             Mouse.Scroll(1);
             this.app.WaitWhileBusy();
             this.app.WaitWhileBusy();


Fixed #1315: Should inject IHttpContextAccessor instead of HttpContextAccessor.

--- src/Abp.AspNetCore/AspNetCore/Runtime/Session/AspNetCorePrincipalAccessor.cs
+++ src/Abp.AspNetCore/AspNetCore/Runtime/Session/AspNetCorePrincipalAccessor.cs
@@ -8,9 +8,9 @@
     {
         public override ClaimsPrincipal Principal => _httpContextAccessor.HttpContext?.User ?? base.Principal;

-        private readonly HttpContextAccessor _httpContextAccessor;
+        private readonly IHttpContextAccessor _httpContextAccessor;

-        public AspNetCorePrincipalAccessor(HttpContextAccessor httpContextAccessor)
+        public AspNetCorePrincipalAccessor(IHttpContextAccessor httpContextAccessor)
         {
             _httpContextAccessor = httpContextAccessor;
         }


removed not used usings

removed not used usings

--- src/ArgentPonyWarcraftClient/Models/GameDataApi/Covenant/CovenantProgress.cs
+++ src/ArgentPonyWarcraftClient/Models/GameDataApi/Covenant/CovenantProgress.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;

 namespace ArgentPonyWarcraftClient
 {


Add startup squirrel icon/association handling

--- osu.Desktop/Program.cs
+++ osu.Desktop/Program.cs
@@ -3,6 +3,7 @@

 using System;
 using System.IO;
+using System.Runtime.Versioning;
 using System.Threading;
 using System.Threading.Tasks;
 using osu.Desktop.LegacyIpc;
@@ -12,6 +13,7 @@
 using osu.Framework.Platform;
 using osu.Game.IPC;
 using osu.Game.Tournament;
+using Squirrel;

 namespace osu.Desktop
 {
@@ -24,6 +26,10 @@
         [STAThread]
         public static void Main(string[] args)
         {
+            // run Squirrel first, as the app may exit after these run
+            if (OperatingSystem.IsWindows())
+                setupSquirrel();
+
             // Back up the cwd before DesktopGameHost changes it
             string cwd = Environment.CurrentDirectory;

@@ -104,6 +110,25 @@
             }
         }

+        [SupportedOSPlatform("windows")]
+        private static void setupSquirrel()
+        {
+            SquirrelAwareApp.HandleEvents(onInitialInstall: (version, tools) =>
+            {
+                tools.CreateShortcutForThisExe();
+            }, onAppUninstall: (version, tools) =>
+            {
+                tools.RemoveShortcutForThisExe();
+                tools.RemoveUninstallerRegistryEntry();
+            }, onEveryRun: (version, tools, firstRun) =>
+            {
+                tools.SetProcessAppUserModelId();
+
+                if (firstRun)
+                    tools.CreateUninstallerRegistryEntry();
+            });
+        }
+
         private static int allowableExceptions = DebugUtils.IsDebugBuild ? 0 : 1;

         /// <summary>


Enhancing function names tests

Enhancing function names tests

--- test/WebJobs.Script.Tests/ScriptHostTests.cs
+++ test/WebJobs.Script.Tests/ScriptHostTests.cs
@@ -581,6 +581,7 @@
         }

         [Theory]
+        [InlineData("")]
         [InlineData("host")]
         [InlineData("Host")]
         [InlineData("-function")]


Update QueueExtensionsTests.cs

Update QueueExtensionsTests.cs

--- test/WinBeacon.Tests/QueueExtensionsTests.cs
+++ test/WinBeacon.Tests/QueueExtensionsTests.cs
@@ -55,7 +55,8 @@
         public void QueueExtensions_Enqueue()
         {
             var input = new byte[] { 0x9A, 0xBC, 0xDE, 0xF0 };
-            var queue = new Queue<byte>(input);
+            var queue = new Queue<byte>();
+            queue.Enqueue(input);
             Assert.AreEqual(input.Length, queue.Count);
             Assert.AreEqual(input, queue.DequeueAll());
         }


Adding code for 1. logging deduped csv 2. uri and !letter filtering


Rename 'ManageStartup' to 'manageStartup'


Add extra new lines to plugin load/execution error messages


Update AutoLegality.cs

Update AutoLegality.cs

--- AutoLegality/AutoLegality.cs
+++ AutoLegality/AutoLegality.cs
@@ -59,7 +59,7 @@
                     int latestVersion = AutomaticLegality.ParseTagAsVersion(data.Split(new string[] { "\"tag_name\":\"" }, System.StringSplitOptions.None)[1].Split('"')[0]);
                     if (data == null || latestVersion == -1)
                         return;
-                    if (int.TryParse(Resources.ProgramVersion, out var cur) && latestVersion <= cur)
+                    if (int.TryParse(CurrentProgramVersion.ToString(), out var cur) && latestVersion <= cur)
                         return;

                     Invoke((MethodInvoker)(() =>
@@ -72,4 +72,4 @@
             catch { }
         }
     }
-}+}


Handle dictionary insert race condition.

--- BosunReporter/MetricGroup.cs
+++ BosunReporter/MetricGroup.cs
@@ -6,6 +6,7 @@
 {
     public sealed class MetricGroup<T> where T : BosunMetric
     {
+        private readonly object _dictionaryLock = new object();
         private readonly MetricsCollector _collector;
         private readonly string _name;
         private readonly Dictionary<string, T> _metrics = new Dictionary<string,T>();
@@ -28,11 +29,16 @@
                 if (_metrics.TryGetValue(primaryTagValue, out metric))
                     return metric;

-                // not going to worry about concurrency here because GetMetric is already thread safe, and indempotent.
-                metric = _collector.GetMetric(_name, _metricFactory(primaryTagValue));
-                _metrics[primaryTagValue] = metric;
-
-                return metric;
+                lock (_dictionaryLock)
+                {
+                    if (_metrics.TryGetValue(primaryTagValue, out metric))
+                        return metric;
+
+                    metric = _collector.GetMetric(_name, _metricFactory(primaryTagValue));
+                    _metrics[primaryTagValue] = metric;
+
+                    return metric;
+                }
             }
         }


Fix auth retry for expired claim (#697)

Fix auth retry for expired claim (#697)

--- Box.V2/JWTAuth/BoxJWTAuth.cs
+++ Box.V2/JWTAuth/BoxJWTAuth.cs
@@ -171,6 +171,9 @@
                     // because the stream cannot be reset) and we haven't exceeded the number of allowed retries, then retry the request.
                     // If we get a 202 code and has a retry-after header, we will retry after.
                     // If we get a 400 due to exp claim issue, this can happen if the current system time is too different from the Box server time, so retry.
+                    var errorCode = ex.Error?.Code ?? ex.Error?.Name;
+                    var errorDescription = ex.Error?.Message ?? ex.Error?.Description;
+
                     if ((ex.StatusCode == HttpRequestHandler.TooManyRequests
                         ||
                         ex.StatusCode == HttpStatusCode.InternalServerError
@@ -183,7 +186,9 @@
                         ||
                         (ex.StatusCode == HttpStatusCode.Accepted && retryAfterHeader != null)
                         ||
-                        (ex.StatusCode == HttpStatusCode.BadRequest && ex.Error.Code.Contains("invalid_grant") && ex.Error.Description.Contains("exp")))
+                        (ex.StatusCode == HttpStatusCode.BadRequest
+                        && errorCode != null && errorCode.Contains("invalid_grant")
+                        && errorDescription != null && errorDescription.Contains("exp")))
                         && retryCounter++ < HttpRequestHandler.RetryLimit)
                     {


Normalize newlines

Normalize newlines

--- BrawlManagerLib/CustomSSS.cs
+++ BrawlManagerLib/CustomSSS.cs
@@ -11,164 +11,164 @@
     /// Allows read-write access to Custom SSS code, and read-only access to all Stage-Dependent Song Loader instances.
     /// This class will store the entire codeset, split between itself (the SSS code) and the portions before/after (in raw byte[]).
     /// </summary>
-	public class CustomSSS {
+	public class CustomSSS {
 		private static byte[] SDSL_HEADER = { 0x28, 0x70, 0x8c, 0xeb, 0x00, 0x00, 0x00 };
 		public Dictionary<byte, Song> SongsByStage { get; private set; }

-        public byte[] sss1 { get; private set; }
-		public byte[] sss2 { get; private set; }
-		public byte[] sss3 { get; private set; }
-
-		public byte[] DataBefore { get; private set; }
-		public byte[] DataAfter { get; private set; }
-
-		public int OtherCodesIgnoredInSameFile { get; private set; }
-
-		public Tuple<byte, byte> this[int index] {
-			get {
-				return new Tuple<byte, byte>(sss3[2 * index], sss3[2 * index + 1]);
-			}
-		}
-
-		private Tuple<byte[], byte[]> _iconsInGroups;
-		public Tuple<byte[], byte[]> IconsInGroups {
-			get {
-				if (_iconsInGroups == null) {
-					byte[] b1 = new byte[sss1.Length];
-					for (int i = 0; i < b1.Length; i++) {
-						b1[i] = sss3[sss1[i] * 2 + 1];
-					}
-					byte[] b2 = new byte[sss2.Length];
-					for (int i = 0; i < b2.Length; i++) {
-						b2[i] = sss3[sss2[i] * 2 + 1];
-					}
-					_iconsInGroups = new Tuple<byte[], byte[]>(b1, b2);
-				}
-				return _iconsInGroups;
-			}
-		}
-
-		private byte[] _stageIDsInOrder;
-		public byte[] StageIDsInOrder {
-			get {
-				if (_stageIDsInOrder == null) {
-					_stageIDsInOrder = new byte[sss1.Length + sss2.Length];
-					for (int i = 0; i < sss1.Length; i++) {
-						_stageIDsInOrder[i] = sss3[sss1[i] * 2];
-					}
-					for (int i = 0; i < sss2.Length; i++) {
-						_stageIDsInOrder[sss1.Length + i] = sss3[sss2[i] * 2];
-					}
-				}
-				return _stageIDsInOrder;
-			}
-		}
-
-		public byte IconForStage(int stage_id) {
-			for (int i = 0; i < sss3.Length; i += 2) {
-				if (sss3[i] == stage_id) {
-					return sss3[i + 1];
-				}
-			}
-			return 0xFF;
-		}
-
-		public byte StageForIcon(int icon_id) {
-			for (int i = 0; i < sss3.Length; i += 2) {
-				if (sss3[i + 1] == icon_id) {
-					return sss3[i];
-				}
-			}
-			return 0xFF;
-		}
-
-        public CustomSSS(string[] s) {
-			init(s);
-		}
-
-		public CustomSSS(byte[] data) {
-			init(data);
-		}
-
-		public CustomSSS(string filename) {
-			if (filename.EndsWith("gct", StringComparison.InvariantCultureIgnoreCase)) {
-				init(File.ReadAllBytes(filename));
-			} else {
-				init(File.ReadAllLines(filename));
-			}
-		}
-
-		private static byte[] gctheader = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde };
-		private static byte[] gctfooter = { 0xf0, 0, 0, 0, 0, 0, 0, 0 };
-		private void init(string[] s) {
-			Regex r = new Regex(@"(\* )?[A-Fa-f0-9]{8} [A-Fa-f0-9]{8}");
-			var matching_lines =
-				from line in s
-				where r.IsMatch(line)
-				select line;
-
-			byte[] core = ByteUtilities.StringToByteArray(string.Join("\n", matching_lines));
-			byte[] data = new byte[core.Length + 16];
-			Array.ConstrainedCopy(gctheader, 0, data, 0, 8);
-			Array.ConstrainedCopy(core, 0, data, 8, core.Length);
-			Array.ConstrainedCopy(gctfooter, 0, data, data.Length - 8, 8);
-			init(data);
-		}
-
-		private static byte[] SSS_HEADER = ByteUtilities.StringToByteArray("046b8f5c 7c802378");
-		private void init(byte[] data) {
-			OtherCodesIgnoredInSameFile = 0;
-			int index = -1;
-			for (int line = 0; line < data.Length; line += 8) {
-				if (ByteUtilities.ByteArrayEquals(data, line, SSS_HEADER, 0, SSS_HEADER.Length)) {
-					if (index != -1) {
-						OtherCodesIgnoredInSameFile++;
-					}
-					index = line;
-				}
-			}
-
-			if (index < 0) {
-				MessageBox.Show("No custom SSS code found. A default code will be used.");
-				DataBefore = data.ToArray();
-				sss1 = ByteUtilities.StringToByteArray("00010203 04050709 080A0B0C 0D0E0F10 11141516 1A191217 0618131D 1E1B1C00");
-				sss2 = ByteUtilities.StringToByteArray("1F202122 23242526 2728");
-				sss3 = ByteUtilities.StringToByteArray("01010202 03030404 05050606 07070808 0909330A 0B0B0C0C 0D0D0E0E 130F1410 " +
-													   "15111612 17131814 19151C16 1D171E18 1F19201A 211B221C 231D241E 251F2932 " +
-													   "15111612 2A332B34 2C352D36 2F373038 3139323A 2E3BFFFF");
-				DataAfter = new byte[0];
-				return;
-			}
-
-			int start = index;
-			DataBefore = new byte[start];
-			Array.ConstrainedCopy(data, 0, DataBefore, 0, start);
-
-			index += 14 * 8;
-			byte sss1_count = data[index - 1];
-			sss1 = new byte[sss1_count];
-			Array.ConstrainedCopy(data, index, sss1, 0, sss1_count);
-
-			index += sss1_count;
-			while (index % 8 != 0) index++;
-
-			index += 2 * 8;
-			byte sss2_count = data[index - 1];
-			sss2 = new byte[sss2_count];
-			Array.ConstrainedCopy(data, index, sss2, 0, sss2_count);
-
-			index += sss2_count;
-			while (index % 8 != 0) index++;
-
-			index += 1 * 8;
-			byte sss3_count = data[index - 1];
-			sss3 = new byte[sss3_count];
-			Array.ConstrainedCopy(data, index, sss3, 0, sss3_count);
-
-			index += sss3_count;
-			while (index % 8 != 0) index++;
-
-			DataAfter = new byte[data.Length - index];
+        public byte[] sss1 { get; private set; }
+		public byte[] sss2 { get; private set; }
+		public byte[] sss3 { get; private set; }
+
+		public byte[] DataBefore { get; private set; }
+		public byte[] DataAfter { get; private set; }
+
+		public int OtherCodesIgnoredInSameFile { get; private set; }
+
+		public Tuple<byte, byte> this[int index] {
+			get {
+				return new Tuple<byte, byte>(sss3[2 * index], sss3[2 * index + 1]);
+			}
+		}
+
+		private Tuple<byte[], byte[]> _iconsInGroups;
+		public Tuple<byte[], byte[]> IconsInGroups {
+			get {
+				if (_iconsInGroups == null) {
+					byte[] b1 = new byte[sss1.Length];
+					for (int i = 0; i < b1.Length; i++) {
+						b1[i] = sss3[sss1[i] * 2 + 1];
+					}
+					byte[] b2 = new byte[sss2.Length];
+					for (int i = 0; i < b2.Length; i++) {
+						b2[i] = sss3[sss2[i] * 2 + 1];
+					}
+					_iconsInGroups = new Tuple<byte[], byte[]>(b1, b2);
+				}
+				return _iconsInGroups;
+			}
+		}
+
+		private byte[] _stageIDsInOrder;
+		public byte[] StageIDsInOrder {
+			get {
+				if (_stageIDsInOrder == null) {
+					_stageIDsInOrder = new byte[sss1.Length + sss2.Length];
+					for (int i = 0; i < sss1.Length; i++) {
+						_stageIDsInOrder[i] = sss3[sss1[i] * 2];
+					}
+					for (int i = 0; i < sss2.Length; i++) {
+						_stageIDsInOrder[sss1.Length + i] = sss3[sss2[i] * 2];
+					}
+				}
+				return _stageIDsInOrder;
+			}
+		}
+
+		public byte IconForStage(int stage_id) {
+			for (int i = 0; i < sss3.Length; i += 2) {
+				if (sss3[i] == stage_id) {
+					return sss3[i + 1];
+				}
+			}
+			return 0xFF;
+		}
+
+		public byte StageForIcon(int icon_id) {
+			for (int i = 0; i < sss3.Length; i += 2) {
+				if (sss3[i + 1] == icon_id) {
+					return sss3[i];
+				}
+			}
+			return 0xFF;
+		}
+
+        public CustomSSS(string[] s) {
+			init(s);
+		}
+
+		public CustomSSS(byte[] data) {
+			init(data);
+		}
+
+		public CustomSSS(string filename) {
+			if (filename.EndsWith("gct", StringComparison.InvariantCultureIgnoreCase)) {
+				init(File.ReadAllBytes(filename));
+			} else {
+				init(File.ReadAllLines(filename));
+			}
+		}
+
+		private static byte[] gctheader = { 0x00, 0xd0, 0xc0, 0xde, 0x00, 0xd0, 0xc0, 0xde };
+		private static byte[] gctfooter = { 0xf0, 0, 0, 0, 0, 0, 0, 0 };
+		private void init(string[] s) {
+			Regex r = new Regex(@"(\* )?[A-Fa-f0-9]{8} [A-Fa-f0-9]{8}");
+			var matching_lines =
+				from line in s
+				where r.IsMatch(line)
+				select line;
+
+			byte[] core = ByteUtilities.StringToByteArray(string.Join("\n", matching_lines));
+			byte[] data = new byte[core.Length + 16];
+			Array.ConstrainedCopy(gctheader, 0, data, 0, 8);
+			Array.ConstrainedCopy(core, 0, data, 8, core.Length);
+			Array.ConstrainedCopy(gctfooter, 0, data, data.Length - 8, 8);
+			init(data);
+		}
+
+		private static byte[] SSS_HEADER = ByteUtilities.StringToByteArray("046b8f5c 7c802378");
+		private void init(byte[] data) {
+			OtherCodesIgnoredInSameFile = 0;
+			int index = -1;
+			for (int line = 0; line < data.Length; line += 8) {
+				if (ByteUtilities.ByteArrayEquals(data, line, SSS_HEADER, 0, SSS_HEADER.Length)) {
+					if (index != -1) {
+						OtherCodesIgnoredInSameFile++;
+					}
+					index = line;
+				}
+			}
+
+			if (index < 0) {
+				MessageBox.Show("No custom SSS code found. A default code will be used.");
+				DataBefore = data.ToArray();
+				sss1 = ByteUtilities.StringToByteArray("00010203 04050709 080A0B0C 0D0E0F10 11141516 1A191217 0618131D 1E1B1C00");
+				sss2 = ByteUtilities.StringToByteArray("1F202122 23242526 2728");
+				sss3 = ByteUtilities.StringToByteArray("01010202 03030404 05050606 07070808 0909330A 0B0B0C0C 0D0D0E0E 130F1410 " +
+													   "15111612 17131814 19151C16 1D171E18 1F19201A 211B221C 231D241E 251F2932 " +
+													   "15111612 2A332B34 2C352D36 2F373038 3139323A 2E3BFFFF");
+				DataAfter = new byte[0];
+				return;
+			}
+
+			int start = index;
+			DataBefore = new byte[start];
+			Array.ConstrainedCopy(data, 0, DataBefore, 0, start);
+
+			index += 14 * 8;
+			byte sss1_count = data[index - 1];
+			sss1 = new byte[sss1_count];
+			Array.ConstrainedCopy(data, index, sss1, 0, sss1_count);
+
+			index += sss1_count;
+			while (index % 8 != 0) index++;
+
+			index += 2 * 8;
+			byte sss2_count = data[index - 1];
+			sss2 = new byte[sss2_count];
+			Array.ConstrainedCopy(data, index, sss2, 0, sss2_count);
+
+			index += sss2_count;
+			while (index % 8 != 0) index++;
+
+			index += 1 * 8;
+			byte sss3_count = data[index - 1];
+			sss3 = new byte[sss3_count];
+			Array.ConstrainedCopy(data, index, sss3, 0, sss3_count);
+
+			index += sss3_count;
+			while (index % 8 != 0) index++;
+
+			DataAfter = new byte[data.Length - index];
 			Array.ConstrainedCopy(data, index, DataAfter, 0, data.Length - index);

             SongsByStage = new Dictionary<byte, Song>();
@@ -189,12 +189,12 @@
                     SongsByStage.Add(stageID, s);
                     line += 24;
                 }
-            }
-		}
-
-		public override string ToString() {
-			return String.Format("Custom SSS: {0}/{1} stages, from pool of {2} pairs",
-				sss1.Length, sss2.Length, sss3.Length / 2);
+            }
+		}
+
+		public override string ToString() {
+			return String.Format("Custom SSS: {0}/{1} stages, from pool of {2} pairs",
+				sss1.Length, sss2.Length, sss3.Length / 2);
 		}
 	}
 }


Fix infinite recursion in IEnumerable<T>.None() (#69)

Note: Previous refactoring of !IEnumerable<T>.Any() pattern was too eager

--- BugReport/Util/Extensions.cs
+++ BugReport/Util/Extensions.cs
@@ -17,7 +17,7 @@

         public static bool None<T>(this IEnumerable<T> items)
         {
-            return items.None();
+            return !items.Any();
         }
     }
 }


Overwrite existing env vars

Overwrite existing env vars

--- src/Microsoft.DotNet.Cli.Utils/Command.cs
+++ src/Microsoft.DotNet.Cli.Utils/Command.cs
@@ -158,7 +158,7 @@

         public Command EnvironmentVariable(string name, string value)
         {
-            _process.StartInfo.Environment.Add(name, value);
+            _process.StartInfo.Environment[name] = value;
             return this;
         }


ResponseFactory refactor, null encoder bug fixed

--- ITCC.HTTP.Server/Core/ResponseFactory.cs
+++ ITCC.HTTP.Server/Core/ResponseFactory.cs
@@ -72,46 +72,35 @@
             IDictionary<string, string> additionalHeaders = null, bool alreadyEncoded = false)
         {
             var httpResponse = context.Response;
+            // ReSharper disable once RedundantAssignment
             var isHeadRequest = context.Request.HttpMethod.ToUpperInvariant() == "HEAD";
             httpResponse.StatusCode = (int) code;
             httpResponse.StatusDescription = SelectReasonPhrase(code);

+            httpResponse.SendChunked = false;
+
+            SetResponseHeaders(httpResponse, additionalHeaders);
+
+            if (body == null)
+            {
+                Logger.LogTrace("RESP FACTORY", $"Response built: \n{SerializeResponse(httpResponse, null)}");
+                return;
+            }
+
             var encoder = SelectEncoder(context.Request);
-            if (body != null && encoder == null)
-            {
-                httpResponse.StatusCode = (int) HttpStatusCode.NotAcceptable;
+            if (encoder == null)
+            {
+                httpResponse.StatusCode = (int)HttpStatusCode.NotAcceptable;
                 httpResponse.StatusDescription = SelectReasonPhrase(HttpStatusCode.NotAcceptable);
                 Logger.LogTrace("RESP FACTORY", $"Response built: \n{SerializeResponse(httpResponse, null)}");
                 return;
             }
-            httpResponse.SendChunked = false;
+
             var contentType = alreadyEncoded
                 ? "text/plain"
                 : encoder.ContentType;
             httpResponse.ContentType = $"{contentType}; charset={encoder.Encoding.WebName}";

-            if (_commonHeaders != null)
-            {
-                foreach (var header in _commonHeaders)
-                {
-                    httpResponse.AddHeader(header.Key, header.Value);
-                }
-            }
-
-            if (additionalHeaders != null)
-            {
-                foreach (var header in additionalHeaders)
-                {
-                    httpResponse.AddHeader(header.Key, header.Value);
-                }
-            }
-
-            if (body == null)
-            {
-                Logger.LogTrace("RESP FACTORY", $"Response built: \n{SerializeResponse(httpResponse, null)}");
-                return;
-            }
-
             string bodyString;
             if (!alreadyEncoded)
                 bodyString = encoder.Serializer == null ? body.ToString() : encoder.Serializer(body);
@@ -119,6 +108,92 @@
             {
                 bodyString = body as string;
             }
+
+            SetResponseBody(context, encoder, bodyString);
+
+            Logger.LogTrace("RESP FACTORY", $"Response built: \n{SerializeResponse(httpResponse, isHeadRequest ? null : bodyString)}");
+        }
+
+        public static string SerializeResponse(HttpListenerResponse response, string bodyString)
+        {
+            if (response == null)
+                return string.Empty;
+
+            var builder = new StringBuilder();
+            builder.AppendLine($"HTTP/{response.ProtocolVersion} {response.StatusCode} {response.StatusDescription}");
+            foreach (var key in response.Headers.AllKeys)
+            {
+                if (LogProhibitedHeaders.Contains(key))
+                    builder.AppendLine($"{key}: {Constants.RemovedLogString}");
+                builder.AppendLine($"{key}: {response.Headers[key]}");
+            }
+            if (response.OutputStream == null)
+                return builder.ToString();
+
+            builder.AppendLine();
+            if (!LogResponseBodies)
+                return builder.ToString();
+
+            if (response.OutputStream is FileStream)
+            {
+                builder.AppendLine($"<File {((FileStream)response.OutputStream).Name} content>");
+            }
+            else
+            {
+                try
+                {
+                    var processedBodyString = LogBodyReplacePatterns.Aggregate(bodyString, (current, prohibitedPattern) => Regex.Replace(current, prohibitedPattern.Item1, prohibitedPattern.Item2));
+
+                    if (ResponseBodyLogLimit < 1 || processedBodyString.Length <= ResponseBodyLogLimit)
+                        builder.AppendLine(processedBodyString);
+                    else
+                    {
+                        builder.AppendLine(processedBodyString.Substring(0, ResponseBodyLogLimit));
+                        builder.AppendLine($"[And {processedBodyString.Length - ResponseBodyLogLimit} more bytes...]");
+                    }
+                }
+                catch (Exception)
+                {
+                    return builder.ToString();
+                }
+            }
+
+            return builder.ToString();
+        }
+
+
+        public static bool LogResponseBodies = true;
+        public static int ResponseBodyLogLimit = -1;
+        public static readonly List<Tuple<string, string>> LogBodyReplacePatterns = new List<Tuple<string, string>>();
+        public static readonly List<string> LogProhibitedHeaders = new List<string>();
+
+        #endregion
+
+        #region private
+
+        private static void SetResponseHeaders(HttpListenerResponse httpResponse, IDictionary<string, string> additionalHeaders)
+        {
+            if (_commonHeaders != null)
+            {
+                foreach (var header in _commonHeaders)
+                {
+                    httpResponse.AddHeader(header.Key, header.Value);
+                }
+            }
+
+            if (additionalHeaders != null)
+            {
+                foreach (var header in additionalHeaders)
+                {
+                    httpResponse.AddHeader(header.Key, header.Value);
+                }
+            }
+        }
+
+        private static void SetResponseBody(HttpListenerContext context, BodyEncoder encoder, string bodyString)
+        {
+            var httpResponse = context.Response;
+            var isHeadRequest = context.Request.HttpMethod.ToUpperInvariant() == "HEAD";

             var gzipResponse = RequestEnablesGzip(encoder, context.Request);
             if (gzipResponse)
@@ -139,12 +214,11 @@
                     }
                     httpResponse.ContentLength64 = memoryStream.Length;
                     if (!isHeadRequest)
-                        httpResponse.OutputStream.Write(memoryStream.GetBuffer(), 0, (int) memoryStream.Length);
+                        httpResponse.OutputStream.Write(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
                     memoryStream.Close();
                 }
                 catch (HttpListenerException)
                 {
-                    return;
                 }
                 finally
                 {
@@ -164,70 +238,10 @@
                     }
                     catch (HttpListenerException)
                     {
-                        return;
                     }
-                }
-            }
-
-            Logger.LogTrace("RESP FACTORY", $"Response built: \n{SerializeResponse(httpResponse, isHeadRequest ? null : bodyString)}");
-        }
-
-        public static string SerializeResponse(HttpListenerResponse response, string bodyString)
-        {
-            if (response == null)
-                return string.Empty;
-
-            var builder = new StringBuilder();
-            builder.AppendLine($"HTTP/{response.ProtocolVersion} {response.StatusCode} {response.StatusDescription}");
-            foreach (var key in response.Headers.AllKeys)
-            {
-                if (LogProhibitedHeaders.Contains(key))
-                    builder.AppendLine($"{key}: {Constants.RemovedLogString}");
-                builder.AppendLine($"{key}: {response.Headers[key]}");
-            }
-            if (response.OutputStream == null)
-                return builder.ToString();
-
-            builder.AppendLine();
-            if (!LogResponseBodies)
-                return builder.ToString();
-
-            if (response.OutputStream is FileStream)
-            {
-                builder.AppendLine($"<File {((FileStream)response.OutputStream).Name} content>");
-            }
-            else
-            {
-                try
-                {
-                    var processedBodyString = LogBodyReplacePatterns.Aggregate(bodyString, (current, prohibitedPattern) => Regex.Replace(current, prohibitedPattern.Item1, prohibitedPattern.Item2));
-
-                    if (ResponseBodyLogLimit < 1 || processedBodyString.Length <= ResponseBodyLogLimit)
-                        builder.AppendLine(processedBodyString);
-                    else
-                    {
-                        builder.AppendLine(processedBodyString.Substring(0, ResponseBodyLogLimit));
-                        builder.AppendLine($"[And {processedBodyString.Length - ResponseBodyLogLimit} more bytes...]");
-                    }
-                }
-                catch (Exception)
-                {
-                    return builder.ToString();
-                }
-            }
-
-            return builder.ToString();
-        }
-
-
-        public static bool LogResponseBodies = true;
-        public static int ResponseBodyLogLimit = -1;
-        public static readonly List<Tuple<string, string>> LogBodyReplacePatterns = new List<Tuple<string, string>>();
-        public static readonly List<string> LogProhibitedHeaders = new List<string>();
-
-        #endregion
-
-        #region private
+                }
+            }
+        }

         private static BodyEncoder SelectEncoder(HttpListenerRequest request)
         {


Comment fix

Comment fix

--- Ict4Participation/Class_Layer/Comment.cs
+++ Ict4Participation/Class_Layer/Comment.cs
@@ -47,12 +47,12 @@
             DataTable dt = Database_Layer.Database.RetrieveQuery(
             "SELECT * FROM "
             + "(SELECT c.\"QUESTION_ID\" as QID, c.\"Description\" as Post, a.\"Name\" as Poster FROM \"Comment\" c "
-            + "JOIN \"Acc\" a"
-            + "ON a.\"ID\"=c.\"PosterACC_ID\")"
+            + "JOIN \"Acc\" a "
+            + "ON a.\"ID\"=c.\"PosterACC_ID\") "
             + "WHERE QID = " + postID);
             foreach (DataRow row in dt.Rows)
             {
-                commentstr.Add(String.Format("{0}: {1}", row["Name"].ToString(), row["Comment"].ToString()));
+                commentstr.Add(String.Format("{0}: {1}", row["Poster"].ToString(), row["Post"].ToString()));
             }

             //For the comment objects


minor tweak

minor tweak

--- IdmNet/IdmNet.Tests/IdmNetClientTests.cs
+++ IdmNet/IdmNet.Tests/IdmNetClientTests.cs
@@ -442,7 +442,11 @@
             }
         }

-        // TODO 002: Implement the Resource client Get operation (as opposed to Enumerate+Pull)
+        // TODO 005: Implement the Resource client Get operation (as opposed to Enumerate+Pull)
+        // TODO 004: Get Count
+        // TODO 004: Paging
+        // TODO 003: Implement GetSchema(string objectTypeName)
+        // TODO 002: Implement Select *
         // TODO 001: Implement Approvals
         // TODO -999: Implement the STS endpoint


Fix identifier completion exploding.

Fix identifier completion exploding.

- This is an interesting issue because the VS LSP platform violates the LSP spec whereas Razor does not violate the spec and translates VS LSP platform requests into spec abiding messages; however, this in turn breaks Roslyn. So for instance, when typing an identifier to trigger completion the trigger kind should be `invoked` and the trigger character should be `null`; however, the LSP platform passes `CompletionTriggerKind.TriggerCharacter` and either a `\0` trigger character or the actual identifier. Because of this difference in behavior prior to this change you'd run `char.Parse` on `null` which would of course explode.

--- src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs
+++ src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs
@@ -54,7 +54,7 @@
             // C# and VB share the same LSP language server, and thus share the same default trigger characters.
             // We need to ensure the trigger character is valid in the document's language. For example, the '{'
             // character, while a trigger character in VB, is not a trigger character in C#.
-            var triggerCharacter = char.Parse(request.Context.TriggerCharacter);
+            char.TryParse(request.Context.TriggerCharacter, out var triggerCharacter);
             if (request.Context.TriggerKind == LSP.CompletionTriggerKind.TriggerCharacter && !char.IsLetterOrDigit(triggerCharacter) &&
                 !IsValidTriggerCharacterForDocument(document, request.Context.TriggerCharacter))
             {


updated constructor args.

updated constructor args.

--HG--
branch : dev

--- ImpromptuInterface/Dynamic/Invocation.cs
+++ ImpromptuInterface/Dynamic/Invocation.cs
@@ -109,8 +109,7 @@
                                    String_OR_InvokeMemberName name,
                                    int argCount =0,
                                    string[] argNames =null,
-                                   bool staticContext = false,
-                                   Type context =null) : base(kind, name, null)
+                                   object context =null) : base(kind, name, null)
         {

             _argNames = argNames ?? new string[] {};
@@ -136,8 +135,17 @@
                     Array.Copy(_argNames,0, tBlank, tBlank.Length - _argNames.Length, tBlank.Length);
                 _argNames = tBlank;
             }
-            _staticContext = staticContext;
-            _context = context ?? typeof(object);
+
+            if (context != null)
+            {
+                var tDummy = context.GetTargetContext(out _context, out _staticContext);
+            }
+            else
+            {
+                _context = typeof (object);
+            }
+
+
         }

         public override object Invoke(object target, params object[] args)


BREAKING: Lucene.Net.QueryParser.Flexible.Standard.Parser.EscapeQuerySyntaxImpl::ReplaceIgnoreCase(): Changed guard clause to throw ArgumentNullException rather than NullReferenceException

--- src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs
+++ src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs
@@ -116,11 +116,17 @@
         /// <param name="escapeChar">the new character to prefix sequence1 in return string.</param>
         /// <param name="locale"></param>
         /// <returns>the new <see cref="ICharSequence"/></returns>
+        /// <exception cref="ArgumentNullException"><paramref name="string"/>, <paramref name="sequence1"/>, or <paramref name="escapeChar"/> is <c>null</c>.</exception>
         private static ICharSequence ReplaceIgnoreCase(ICharSequence @string,
             string sequence1, string escapeChar, CultureInfo locale)
         {
-            if (escapeChar == null || sequence1 == null || @string == null)
-                throw new NullReferenceException(); // LUCNENET TODO: ArgumentException...
+            // LUCENENT: Changed from NullPointerException to ArgumentNullException
+            if (escapeChar is null)
+                throw new ArgumentNullException(nameof(escapeChar));
+            if (sequence1 is null)
+                throw new ArgumentNullException(nameof(sequence1));
+            if (@string is null)
+                throw new ArgumentNullException(nameof(@string));

             // empty string case
             int count = @string.Length;


fix RoleConditionEvaluator (#9380)

fix RoleConditionEvaluator (#9380)

The evaluator now only takes into account the role claims

--- src/OrchardCore.Modules/OrchardCore.Rules/Services/RoleConditionEvaluator.cs
+++ src/OrchardCore.Modules/OrchardCore.Rules/Services/RoleConditionEvaluator.cs
@@ -34,8 +34,7 @@
             // Claim all if the operator is negative
             if (condition.Operation is INegateOperator)
             {
-                return (_httpContextAccessor.HttpContext.User?.Claims.All(claim =>
-                    claim.Type == roleClaimType &&
+                return (_httpContextAccessor.HttpContext.User?.Claims.Where(c => c.Type == roleClaimType).All(claim =>
                     operatorComparer.Compare(condition.Operation, claim.Value, condition.Value))
                 ).GetValueOrDefault() ? True : False;
             }


2073: simplifiy curve flattener

2073: simplifiy curve flattener

--- src/PixelFarm/PixelFarm.Painter/4_CpuBlit_VertexProcessing/CurveFlattener.cs
+++ src/PixelFarm/PixelFarm.Painter/4_CpuBlit_VertexProcessing/CurveFlattener.cs
@@ -129,13 +129,6 @@
             set => _div_curveFlattener.CuspLimit = value;
         }

-        enum CurvePointMode
-        {
-            NotCurve,
-            P2,
-            P3
-        }
-
         public void Reset()
         {
             ApproximationScale = 1;
@@ -152,22 +145,14 @@
         {
             return MakeVxs(vxs, null, output);
         }
-
-
         public VertexStore MakeVxs(VertexStore vxs, ICoordTransformer tx, VertexStore output)
         {
-
-            CurvePointMode latestCurveMode = CurvePointMode.NotCurve;
             double x, y;
             VertexCmd cmd;
-            VectorMath.Vector2 c3p2 = new VectorMath.Vector2();
-            VectorMath.Vector2 c4p2 = new VectorMath.Vector2();
-            VectorMath.Vector2 c4p3 = new VectorMath.Vector2();
             double lastX = 0;
-            double lasty = 0;
+            double lastY = 0;
             double lastMoveX = 0;
             double lastMoveY = 0;
-

             int index = 0;
             bool hasTx = tx != null;
@@ -190,176 +175,109 @@
                 //-----------------
                 switch (cmd)
                 {
-
                     case VertexCmd.C3:
                         {
-                            switch (latestCurveMode)
-                            {
-                                case CurvePointMode.P2:
-                                    {
-                                    }
-                                    break;
-                                case CurvePointMode.P3:
-                                    {
-                                    }
-                                    break;
-                                case CurvePointMode.NotCurve:
-                                    {
-                                        c3p2.x = x;
-                                        c3p2.y = y;
-                                    }
-                                    break;
-                                default:
-                                    {
-                                    }
-                                    break;
-                            }
-                            latestCurveMode = CurvePointMode.P2;
+                            //for curve3, it contains (x0,y0), (x1,y1), (x2,y2)
+                            //this is (x1,y1) so next point must be (x2,y2)
+
+                            //read next
+                            cmd = vxs.GetVertex(index++, out double x2, out double y2);
+                            if (cmd != VertexCmd.LineTo) { throw new System.NotSupportedException(); }
+
+                            if (_selectedApproximationMethod == CurveApproximationMethod.Inc)
+                            {
+                                _inc_curveFlattener.Flatten(
+                                   lastX, lastY,
+                                   x, y,
+                                   lastX = x2, lastY = y2,
+                                   _tmpFlattenPoints, true);
+
+                            }
+                            else
+                            {
+                                _div_curveFlattener.Flatten(
+                                    lastX, lastY,
+                                    x, y,
+                                   lastX = x2, lastY = y2,
+                                    _tmpFlattenPoints,
+                                    true
+                                    );
+                            }
+                            //copy flatten curve to vxs
+                            int count = _tmpFlattenPoints.Count;
+                            for (int i = 0; i < count; ++i)
+                            {
+                                var vec = _tmpFlattenPoints[i];
+                                output.AddLineTo(vec.x, vec.y);
+                            }
+                            _tmpFlattenPoints.Clear();
                         }
                         break;
                     case VertexCmd.C4:
                         {
-
-                            switch (latestCurveMode)
-                            {
-                                case CurvePointMode.P2:
-                                    {
-                                        c3p2.x = x;
-                                        c3p2.y = y;
-                                    }
-                                    break;
-                                case CurvePointMode.P3:
-                                    {
-                                        c4p3.x = x;
-                                        c4p3.y = y;
-                                    }
-                                    break;
-                                case CurvePointMode.NotCurve:
-                                    {
-                                        c4p2.x = x;
-                                        c4p2.y = y;
-                                    }
-                                    break;
-                            }
-                            latestCurveMode = CurvePointMode.P3;
+                            //for curve4, it contains (x0,y0), (x1,y1), (x2,y2), (x3,y3)
+                            //this is (x1,y1) so next point must be (x2,y2) and (x3,y3)
+
+                            cmd = vxs.GetVertex(index++, out double x2, out double y2);
+                            if (cmd != VertexCmd.C4)
+                            {
+                                throw new System.NotSupportedException();
+                            }
+                            cmd = vxs.GetVertex(index++, out double x3, out double y3);
+                            if (cmd != VertexCmd.LineTo)
+                            {
+                                throw new System.NotSupportedException();
+                            }
+
+                            if (_selectedApproximationMethod == CurveApproximationMethod.Inc)
+                            {
+                                _inc_curveFlattener.Flatten(
+                                    lastX, lastY,
+                                    x, y,
+                                    x2, y2,
+                                   lastX = x3, lastY = y3,
+                                    _tmpFlattenPoints, true
+                                    );
+                            }
+                            else
+                            {
+                                _div_curveFlattener.Flatten(
+                                     lastX, lastY,
+                                     x, y,
+                                     x2, y2,
+                                      lastX = x3, lastY = y3,
+                                     _tmpFlattenPoints, true
+                                    );
+                            }
+                            //copy flatten curve to vxs
+                            int count = _tmpFlattenPoints.Count;
+                            for (int i = 0; i < count; ++i)
+                            {
+                                var vec = _tmpFlattenPoints[i];
+                                output.AddLineTo(vec.x, vec.y);
+                            }
+
+                            _tmpFlattenPoints.Clear();
+
                         }
                         break;
                     case VertexCmd.LineTo:
-                        {
-                            switch (latestCurveMode)
-                            {
-                                case CurvePointMode.P2:
-                                    {
-
-                                        if (_selectedApproximationMethod == CurveApproximationMethod.Inc)
-                                        {
-
-                                            _inc_curveFlattener.Flatten(
-                                               lastX, lasty,
-                                               c3p2.X, c3p2.Y,
-                                               x, y,
-                                               _tmpFlattenPoints, true);
-
-                                        }
-                                        else
-                                        {
-                                            _div_curveFlattener.Flatten(lastX, lasty,
-                                                c3p2.X, c3p2.Y,
-                                                x, y,
-                                                _tmpFlattenPoints,
-                                                true
-                                                );
-                                        }
-                                        //copy flatten curve to vxs
-                                        int count = _tmpFlattenPoints.Count;
-                                        for (int i = 0; i < count; ++i)
-                                        {
-                                            var vec = _tmpFlattenPoints[i];
-                                            output.AddLineTo(vec.x, vec.y);
-                                        }
-                                        _tmpFlattenPoints.Clear();
-
-                                    }
-                                    break;
-                                case CurvePointMode.P3:
-                                    {
-
-                                        if (_selectedApproximationMethod == CurveApproximationMethod.Inc)
-                                        {
-                                            _inc_curveFlattener.Flatten(
-                                                lastX, lasty,
-                                                c4p2.x, c4p2.y,
-                                                c4p3.x, c4p3.y,
-                                                x, y,
-                                                _tmpFlattenPoints, true
-                                                );
-                                        }
-                                        else
-                                        {
-                                            _div_curveFlattener.Flatten(
-                                                 lastX, lasty,
-                                                 c4p2.x, c4p2.y,
-                                                 c4p3.x, c4p3.y,
-                                                 x, y, _tmpFlattenPoints, true
-                                                );
-                                        }
-                                        //copy flatten curve to vxs
-                                        int count = _tmpFlattenPoints.Count;
-                                        for (int i = 0; i < count; ++i)
-                                        {
-                                            var vec = _tmpFlattenPoints[i];
-                                            output.AddLineTo(vec.x, vec.y);
-                                        }
-
-                                        _tmpFlattenPoints.Clear();
-                                    }
-                                    break;
-                                default:
-                                    {
-                                        output.AddVertex(x, y, cmd);
-                                    }
-                                    break;
-                            }
-                            //-----------
-                            latestCurveMode = CurvePointMode.NotCurve;
-                            lastX = x;
-                            lasty = y;
-                            //-----------
-                        }
+                        output.AddLineTo(lastX = x, lastY = y);
+
                         break;
                     case VertexCmd.MoveTo:
-                        {
-                            //move to, and end command
-                            output.AddVertex(x, y, cmd);
-                            //-----------
-                            latestCurveMode = CurvePointMode.NotCurve;
-                            lastMoveX = lastX = x;
-                            lastMoveY = lasty = y;
-                            //-----------
-                        }
-                        break;
-
+                        //move to, and end command
+                        output.AddVertex(lastMoveX = lastX = x, lastMoveY = lastY = y, cmd);
+                        break;
                     case VertexCmd.Close:
                     case VertexCmd.CloseAndEndFigure:
-                        {
-                            latestCurveMode = CurvePointMode.NotCurve;
-                            output.AddVertex(lastMoveX, lastMoveY, cmd);
-                            //move to begin
-                            lastX = lastMoveX;
-                            lasty = lastMoveY;
-                        }
-                        break;
-
+                        //we need only command
+                        //move to begin
+                        output.AddVertex(lastX = lastMoveX, lastY = lastMoveY, cmd);
+                        break;
                     default:
-                        {
-                            //move to, and end command
-                            output.AddVertex(x, y, cmd);
-                            //-----------
-                            latestCurveMode = CurvePointMode.NotCurve;
-                            lastX = x;
-                            lasty = y;
-                            //-----------
-                        }
+                        //move to, and end command
+                        output.AddVertex(lastX = x, lastY = y, cmd);
                         break;
                 }
             }


Fix out-of-range arguments

Fix out-of-range arguments

It always resulted in providing a single comma-delimited string, where it's not always appropriate (e.g. !nickname or !owns)

http://steamcommunity.com/groups/ascfarm/discussions/1/1499000547484950912/


cleanup

cleanup

static vars prefixed

--- src/Peachpie.Runtime/Context.ConstsMap.cs
+++ src/Peachpie.Runtime/Context.ConstsMap.cs
@@ -96,27 +96,27 @@
             /// <summary>
             /// Maps of constant name to its ID.
             /// </summary>
-            readonly static Dictionary<ConstName, int> _map = new Dictionary<ConstName, int>(1024, new ConstName.ConstNameComparer());
+            readonly static Dictionary<ConstName, int> s_map = new Dictionary<ConstName, int>(1024, new ConstName.ConstNameComparer());

             /// <summary>
             /// Lock mechanism for accessing statics.
             /// </summary>
-            readonly static ReaderWriterLockSlim _rwLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
+            readonly static ReaderWriterLockSlim s_rwLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);

             /// <summary>
             /// Maps constant ID to its actual value, accross all contexts (application wide).
             /// </summary>
-            static ConstData[] _valuesApp = new ConstData[1200];   // there is ~1162 builtin constants
+            static ConstData[] s_valuesApp = new ConstData[1200];   // there is ~1162 builtin constants

             /// <summary>
             /// Actual count of defined constant names.
             /// </summary>
-            static int _countApp, _countCtx;
+            static int s_countApp, s_countCtx;

             /// <summary>
             /// Maps constant ID to its actual value in current context.
             /// </summary>
-            PhpValue[] _valuesCtx = new PhpValue[_countCtx];
+            PhpValue[] _valuesCtx = new PhpValue[s_countCtx];

             static void EnsureArray<T>(ref T[] arr, int size)
             {
@@ -141,30 +141,30 @@
                 var cname = new ConstName(name, ignoreCase);
                 int idx;

-                _rwLock.EnterUpgradeableReadLock();
+                s_rwLock.EnterUpgradeableReadLock();
                 try
                 {
-                    if (!_map.TryGetValue(cname, out idx))
-                    {
-                        _rwLock.EnterWriteLock();
+                    if (!s_map.TryGetValue(cname, out idx))
+                    {
+                        s_rwLock.EnterWriteLock();
                         try
                         {
                             // new constant ID, non zero
                             idx = appConstant
-                                ? -(++_countApp)    // app constants are negative
-                                : (++_countCtx);    //
-
-                            _map.Add(cname, idx);
+                                ? -(++s_countApp)    // app constants are negative
+                                : (++s_countCtx);    //
+
+                            s_map.Add(cname, idx);
                         }
                         finally
                         {
-                            _rwLock.ExitWriteLock();
+                            s_rwLock.ExitWriteLock();
                         }
                     }
                 }
                 finally
                 {
-                    _rwLock.ExitUpgradeableReadLock();
+                    s_rwLock.ExitUpgradeableReadLock();
                 }

                 //
@@ -183,10 +183,10 @@
                     throw ConstantRedeclaredException(name);   // runtime constant with this name was already defined
                 }

-                EnsureArray(ref _valuesApp, idx);
+                EnsureArray(ref s_valuesApp, idx);

                 // fill in the app contant slot
-                ref var slot = ref _valuesApp[idx - 1];
+                ref var slot = ref s_valuesApp[idx - 1];

                 if (SetValue(ref slot.Data, value))
                 {
@@ -262,14 +262,14 @@
             {
                 if (idx == 0)
                 {
-                    _rwLock.EnterReadLock();
+                    s_rwLock.EnterReadLock();
                     try
                     {
-                        _map.TryGetValue(new ConstName(name), out idx);
+                        s_map.TryGetValue(new ConstName(name), out idx);
                     }
                     finally
                     {
-                        _rwLock.ExitReadLock();
+                        s_rwLock.ExitReadLock();
                     }
                 }

@@ -294,7 +294,7 @@
                 else // if (idx < 0)
                 {
                     // app constant
-                    if (ArrayUtils.TryGetItem(_valuesApp, -idx - 1, out var data) && data.Data.IsSet)
+                    if (ArrayUtils.TryGetItem(s_valuesApp, -idx - 1, out var data) && data.Data.IsSet)
                     {
                         value = data.Value;
                         return true;
@@ -317,16 +317,16 @@
             /// </summary>
             public IEnumerator<ConstantInfo> GetEnumerator()
             {
-                var listApp = new ConstantInfo[_countApp];
-                var listCtx = new ConstantInfo[_countCtx];
+                var listApp = new ConstantInfo[s_countApp];
+                var listCtx = new ConstantInfo[s_countCtx];

                 //
-                _rwLock.EnterReadLock();
+                s_rwLock.EnterReadLock();
                 try
                 {
                     // initilize values

-                    var valuesApp = _valuesApp;
+                    var valuesApp = s_valuesApp;
                     for (int i = 0; i < valuesApp.Length; i++)
                     {
                         ref var data = ref valuesApp[i];
@@ -352,7 +352,7 @@
                     }

                     // assign name from the map
-                    foreach (var pair in _map)
+                    foreach (var pair in s_map)
                     {
                         if (pair.Value < 0)
                         {
@@ -368,7 +368,7 @@
                 }
                 finally
                 {
-                    _rwLock.ExitReadLock();
+                    s_rwLock.ExitReadLock();
                 }

                 //


better method matching

better method matching

--- src/ReflectionCli/Main/ArgumentsParser.cs
+++ src/ReflectionCli/Main/ArgumentsParser.cs
@@ -99,7 +99,7 @@
                 }
             }

-            if (matchingmethods == null) {
+            if (matchingmethods.Count() == 0) {
                 throw new Exception($"No Constructors for {type.Name} have matching input names to those Provided.");
             }


InstagramMediaList should implement IEnumerable<InstagramMedia>

--- src/Skybrud.Social.Instagram/BasicDisplay/Models/Media/InstagramMediaList.cs
+++ src/Skybrud.Social.Instagram/BasicDisplay/Models/Media/InstagramMediaList.cs
@@ -1,4 +1,6 @@
-using Newtonsoft.Json.Linq;
+using System.Collections;
+using System.Collections.Generic;
+using Newtonsoft.Json.Linq;
 using Skybrud.Essentials.Json.Extensions;
 using Skybrud.Social.Instagram.BasicDisplay.Models.Users;

@@ -7,7 +9,7 @@
     /// <summary>
     /// Class representing a list of media.
     /// </summary>
-    public class InstagramMediaList : InstagramObject {
+    public class InstagramMediaList : InstagramObject, IEnumerable<InstagramMedia> {

         #region Properties

@@ -32,6 +34,19 @@

         #endregion

+        #region Member methods
+
+        /// <inheritdoc />
+        public IEnumerator<InstagramMedia> GetEnumerator() {
+            return ((IEnumerable<InstagramMedia>) Data).GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator() {
+            return GetEnumerator();
+        }
+
+        #endregion
+
         #region Static methods

         /// <summary>
@@ -45,6 +60,7 @@

         #endregion

+
     }

 }


Update MentionExtractor.cs

Update MentionExtractor.cs

Fixed small bug and indentation

--- JabbR/Infrastructure/MentionExtractor.cs
+++ JabbR/Infrastructure/MentionExtractor.cs
@@ -25,7 +25,7 @@
             // Find username mentions
             foreach (var u in Regex.Matches(message, UsernameMentionPattern)
                                    .Where(m => m.Success)
-                                   .Select(m => m.Groups["user"])
+                                   .Select(m => m.Groups["user"].Value.Trim())
                                    .Where(u => !String.IsNullOrEmpty(u))) {
                 matches.Add(u);
             }
@@ -39,7 +39,8 @@
                 for (int i = 1; i < match.Groups.Count; i++)
                 {
                     if (!match.Groups[i].Success) continue;
-                        matches.Add(regex.GroupNameFromNumber(i));
+
+                    matches.Add(regex.GroupNameFromNumber(i));
                 }
             }


Updated sample.

Updated sample.

--- samples/AspNetStructureMapSample/AppTenantResolver.cs
+++ samples/AspNetStructureMapSample/AppTenantResolver.cs
@@ -49,7 +49,8 @@

         protected override MemoryCacheEntryOptions CreateCacheEntryOptions()
         {
-            return base.CreateCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(30));
+            return base.CreateCacheEntryOptions()
+                .SetSlidingExpiration(TimeSpan.FromMinutes(5));
         }
     }
 }


Added the delete index optimisation again.   The problem before was not disposing things correctly.

--- src/StorageEngines/SQLiteCommon/storage.sqlite.common/src/SqliteViewStore.cs
+++ src/StorageEngines/SQLiteCommon/storage.sqlite.common/src/SqliteViewStore.cs
@@ -663,7 +663,12 @@
                             if (last == 0) {
                                 try {
                                     // If the lastSequence has been reset to 0, make sure to remove all map results:
-                                    changes = db.StorageEngine.ExecSQL(view.QueryString("DELETE FROM 'maps_#'"));
+                                    using(var changesCursor =  db.StorageEngine.RawQuery(view.QueryString("SELECT COUNT(*) FROM maps_#"))) {
+                                        changes = changesCursor.GetInt(0);
+                                    }
+
+                                    DeleteIndex();
+									CreateIndex();
                                 } catch (Exception) {
                                     ok = false;
                                 }