Route name change

Route name change

--- src/Microsoft.AspNetCore.Routing.Subdomain.Samples/Startup.cs
+++ src/Microsoft.AspNetCore.Routing.Subdomain.Samples/Startup.cs
@@ -95,7 +95,7 @@
                     new { controller = "Home", action = "Action2" });

                 routes.MapRoute(hostnames,
-                "NormalRouteTest",
+                "NormalRoute",
                 "{language}/{controller}/{action}",
                 new { Action = "Index", Controller = "Home", Language = "English" });
             });


Added title to Windows tray icon. This fixes #2652

--- Duplicati/GUI/Duplicati.GUI.TrayIcon/WinFormsRunner.cs
+++ Duplicati/GUI/Duplicati.GUI.TrayIcon/WinFormsRunner.cs
@@ -126,6 +126,7 @@
             m_trayIcon = new NotifyIcon();
             m_trayIcon.DoubleClick += new EventHandler(m_trayIcon_DoubleClick);
             m_trayIcon.Click += new EventHandler(m_trayIcon_Click);
+            m_trayIcon.Text = Duplicati.Library.AutoUpdater.AutoUpdateSettings.AppName;
             base.Init(args);
         }


Correct order of params to Guard.ArgumentValid() (#493)

The arguments are in order: condition, error message, name of parameter. See https://github.com/nunit/nunit-console/blob/master/src/NUnitEngine/nunit.engine/Guard.cs#L76

--- src/NUnitEngine/nunit.engine/Drivers/NUnit3FrameworkDriver.cs
+++ src/NUnitEngine/nunit.engine/Drivers/NUnit3FrameworkDriver.cs
@@ -74,7 +74,7 @@
         /// <returns>An Xml string representing the loaded test</returns>
         public string Load(string testAssemblyPath, IDictionary<string, object> settings)
         {
-            Guard.ArgumentValid(File.Exists(testAssemblyPath), "testAssemblyPath", "Framework driver constructor called with a file name that doesn't exist.");
+            Guard.ArgumentValid(File.Exists(testAssemblyPath), "Framework driver constructor called with a file name that doesn't exist.", "testAssemblyPath");

             var idPrefix = string.IsNullOrEmpty(ID) ? "" : ID + "-";
             _testAssemblyPath = testAssemblyPath;


Update IFileSystemWatcher to: * Pass through FileChangeTypes when available * Allow clients to watch a directory (in addition to individual files)

--- src/OmniSharp.Abstractions/FileWatching/IFileSystemWatcher.cs
+++ src/OmniSharp.Abstractions/FileWatching/IFileSystemWatcher.cs
@@ -1,12 +1,20 @@
-using System;
+using OmniSharp.Models;
+using System;

 namespace OmniSharp.FileWatching
 {
     // TODO: Flesh out this API more
     public interface IFileSystemWatcher
     {
-        void Watch(string path, Action<string> callback);
+        void Watch(string path, Action<string, FileChangeType?> callback);

-        void TriggerChange(string path);
+        /// <summary>
+        /// Called when a file is created, changed, or deleted.
+        /// </summary>
+        /// <param name="path">The path to the file</param>
+        /// <param name="verb">The type of change. Hosts are not required to pass a change type</param>
+        void TriggerChange(string path, FileChangeType? verb);
+
+        void WatchDirectory(string path, Action<string, FileChangeType?> callback);
     }
-}+}


PERF: Fixing 16595 Verify User Unicity

PERF: Fixing 16595 Verify User Unicity

--HG--
branch : perf

--- src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs
+++ src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs
@@ -38,32 +38,30 @@
         public ILogger Logger { get; set; }

         public string VerifyUserUnicity(string userName, string email) {
-            IEnumerable<UserPart> allUsers = _contentManager.Query<UserPart, UserPartRecord>().List();
+            string normalizedUserName = userName.ToLower();

-            foreach (var user in allUsers) {
-                if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {
-                    return "A user with that name already exists";
-                }
-                if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {
-                    return "A user with that email already exists";
-                }
+            if (_contentManager.Query<UserPart, UserPartRecord>()
+                                   .Where(user =>
+                                          user.NormalizedUserName == normalizedUserName ||
+                                          user.Email == email)
+                                   .List().Any()) {
+                return "User with that username and/or email already exists.";
             }

             return null;
         }

         public string VerifyUserUnicity(int id, string userName, string email) {
-            IEnumerable<UserPart> allUsers = _contentManager.Query<UserPart, UserPartRecord>().List();
-            foreach (var user in allUsers) {
-                if (user.Id == id)
-                    continue;
-                if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {
-                    return "A user with that name already exists";
-                }
-                if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {
-                    return "A user with that email already exists";
-                }
+            string normalizedUserName = userName.ToLower();
+
+            if (_contentManager.Query<UserPart, UserPartRecord>()
+                                   .Where(user =>
+                                          user.NormalizedUserName == normalizedUserName ||
+                                          user.Email == email)
+                                   .List().Any(user => user.Id != id)) {
+                return "User with that username and/or email already exists.";
             }
+
             return null;
         }


Fixing localized message of RequiredAttribute

--HG--
branch : 1.x

--- src/Orchard/Mvc/DataAnnotations/LocalizedRequiredAttribute.cs
+++ src/Orchard/Mvc/DataAnnotations/LocalizedRequiredAttribute.cs
@@ -17,7 +17,7 @@

         public override string FormatErrorMessage(string name) {
             return String.IsNullOrEmpty(ErrorMessage)
-                ? T("The field {0} is required.", name).Text
+                ? T("The {0} field is required.", name).Text
                 : T(ErrorMessage, name).Text;
         }
     }


Fixes #6344 shape items ordering (#6369)

--- src/OrchardCore/OrchardCore.DisplayManagement/Shapes/Shape.cs
+++ src/OrchardCore/OrchardCore.DisplayManagement/Shapes/Shape.cs
@@ -16,7 +16,7 @@
     {
         private List<string> _classes;
         private Dictionary<string, string> _attributes;
-        private readonly List<IPositioned> _items = new List<IPositioned>();
+        private List<IPositioned> _items = new List<IPositioned>();
         private bool _sorted = false;

         public ShapeMetadata Metadata { get; } = new ShapeMetadata();
@@ -31,7 +31,7 @@
             {
                 if (!_sorted)
                 {
-                    _items.Sort(FlatPositionComparer.Instance);
+                    _items = _items.OrderBy(x => x, FlatPositionComparer.Instance).ToList();
                     _sorted = true;
                 }

@@ -138,7 +138,7 @@
         {
             if (!_sorted)
             {
-                _items.Sort(FlatPositionComparer.Instance);
+                _items = _items.OrderBy(x => x, FlatPositionComparer.Instance).ToList();
                 _sorted = true;
             }

@@ -149,7 +149,7 @@
         {
             if (!_sorted)
             {
-                _items.Sort(FlatPositionComparer.Instance);
+                _items = _items.OrderBy(x => x, FlatPositionComparer.Instance).ToList();
                 _sorted = true;
             }


compiler: do not create Nullable{T} for locals

ref https://github.com/peachpiecompiler/peachpie/issues/938

--- src/Peachpie.CodeAnalysis/Compilation/PhpCompilation.Types.cs
+++ src/Peachpie.CodeAnalysis/Compilation/PhpCompilation.Types.cs
@@ -200,7 +200,7 @@
         /// <summary>
         /// Merges CLR type to be nullable.
         /// </summary>
-        internal TypeSymbol MergeNull(TypeSymbol type)
+        internal TypeSymbol MergeNull(TypeSymbol type, bool asSystemNullable)
         {
             if (type == null || type.IsVoid())
             {
@@ -209,14 +209,17 @@

             if (type.IsValueType || type.IsOfType(CoreTypes.IPhpArray)) // TODO: remove IPhpArray and check for null in emitted code
             {
-                // nullable bool|int|long|double|string
-                if (type.SpecialType == SpecialType.System_Boolean ||
-                    type.SpecialType == SpecialType.System_Int32 ||
-                    type.SpecialType == SpecialType.System_Int64 ||
-                    type.SpecialType == SpecialType.System_Double ||
-                    type.Is_PhpString())
-                {
-                    return this.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(type));
+                if (asSystemNullable)
+                {
+                    // nullable bool|int|long|double|string
+                    if (type.SpecialType == SpecialType.System_Boolean ||
+                        type.SpecialType == SpecialType.System_Int32 ||
+                        type.SpecialType == SpecialType.System_Int64 ||
+                        type.SpecialType == SpecialType.System_Double ||
+                        type.Is_PhpString())
+                    {
+                        return this.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(type));
+                    }
                 }

                 return CoreTypes.PhpValue;    // anything else -> PhpValue
@@ -309,8 +312,7 @@

             if (t.IsNullable || nullable)
             {
-                // TODO: for value types -> Nullable<T>
-                symbol = MergeNull(symbol);
+                symbol = MergeNull(symbol, asSystemNullable: true);
             }

             return symbol;
@@ -718,7 +720,7 @@
                     }
                 }

-                result = maybenull ? MergeNull(result) : result ?? CoreTypes.Void;
+                result = maybenull ? MergeNull(result, asSystemNullable: false) : result ?? CoreTypes.Void;

                 Debug.Assert(result.IsValidType());


#42 Throw user cancelled exception when play store window is cancelled

--- src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs
+++ src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs
@@ -40,6 +40,8 @@
         const string RESPONSE_IAP_CONTINUATION_TOKEN = "INAPP_CONTINUATION_TOKEN";

         const int PURCHASE_REQUEST_CODE = 1001;
+
+        const int RESPONSE_CODE_RESULT_USER_CANCELED = 1;

         Activity Context => CrossCurrentActivity.Current.Activity;

@@ -487,6 +489,10 @@
                 });

             }
+            else if (responseCode == RESPONSE_CODE_RESULT_USER_CANCELED)
+            {
+                tcsPurchase.SetException(new InAppBillingPurchaseException(PurchaseError.UserCancelled));
+            }
             else
             {
                 tcsPurchase?.TrySetResult(null);


Added update and delete functions to HTTP API in AutoAddPlugin.

--- src/Plugins/HdknPlugins.AutoAdd/Http/Api/FoldersController.cs
+++ src/Plugins/HdknPlugins.AutoAdd/Http/Api/FoldersController.cs
@@ -36,5 +36,35 @@

             return new JsonResult(folder);
         }
+
+        [HttpPut("api/folders/{id}")]
+        public ActionResult Edit(int id)
+        {
+            var folder = BindModel<Folder>();
+            var oldFolder = _dataRepository.Single<Folder>(id);
+
+            if (oldFolder != null)
+            {
+                folder.Id = id;
+                _dataRepository.Update(folder);
+            }
+
+            return new JsonResult(folder);
+        }
+
+        [HttpDelete("api/folders/{id}")]
+        public ActionResult Delete(int id)
+        {
+            var folder = _dataRepository.Single<Folder>(id);
+
+            if (folder != null)
+            {
+                _dataRepository.Delete(folder);
+
+                return new JsonResult(true);
+            }
+
+            return new JsonResult(false);
+        }
     }
 }


Correctly compare field values before setting using NO standard values

Ref: https://github.com/kamsar/Unicorn/issues/162

--- src/Rainbow.Storage.Sc/Deserialization/DefaultDeserializer.cs
+++ src/Rainbow.Storage.Sc/Deserialization/DefaultDeserializer.cs
@@ -625,7 +625,7 @@
 				return true;
 			}

-			if (field.Value != null && !field.Value.Equals(itemField.Value))
+			if (field.Value != null && !field.Value.Equals(itemField.GetValue(false, false)))
 			{
 				var oldValue = itemField.Value;
 				itemField.SetValue(field.Value, true);


Added config action to the shorter Run method so devs can still config Seleno

--- src/TestStack.Seleno/Configuration/SelenoApplicationRunner.cs
+++ src/TestStack.Seleno/Configuration/SelenoApplicationRunner.cs
@@ -24,10 +24,10 @@
             return Host;
         }

-        public static void Run(string webProjectFolder, int portNumber)
+        public static void Run(string webProjectFolder, int portNumber, Action<IAppConfigurator> configure = null)
         {
             var webApplication = new WebApplication(ProjectLocation.FromFolder(webProjectFolder), portNumber);
-            Host = New(x => x.ProjectToTest(webApplication));
+            Run(webApplication, configure);
         }

         public static void Run(WebApplication app, Action<IAppConfigurator> configure)
@@ -37,7 +37,9 @@
                 Action<IAppConfigurator> action = x =>
                 {
                     x.ProjectToTest(app);
-                    configure(x);
+
+                    if (configure != null)
+                        configure(x);
                 };

                Host = New(action);


Improves time slot retrievial

Improves time slot retrievial

Adds another GetTimeSlot method without any parameters to get the time slot for today.

--- code/Scheduler.cs
+++ code/Scheduler.cs
@@ -43,12 +43,12 @@
 			UI.fieldDayOfWeek.SelectedIndex = Days.IndexOf(DateTime.Now.DayOfWeek);

 			// displays the start time and end time for today
-			TimeSlot Today = GetTimeSlot(DateTime.Now.DayOfWeek);
+			TimeSlot slot = GetTimeSlot();

-			if (Today != null) {
-				UI.fieldStartTime.Text = Today.Start.Hours.ToString() + ":00";
-				UI.fieldEndTime.Text = Today.End.Hours.ToString() + ":00";
-				UI.labelDuration.Text = Today.Start.Subtract(Today.End).Duration().Hours.ToString() + " " + Translation.hours;
+			if (slot != null) {
+				UI.fieldStartTime.Text = slot.Start.Hours.ToString() + ":00";
+				UI.fieldEndTime.Text = slot.End.Hours.ToString() + ":00";
+				UI.labelDuration.Text = slot.Start.Subtract(slot.End).Duration().Hours.ToString() + " " + Translation.hours;
 			} else {
 				UI.fieldStartTime.Text = "-";
 				UI.fieldEndTime.Text = "-";
@@ -66,7 +66,17 @@
 		}

 		/// <summary>
-		/// Searches for a time slot for a specific day
+		/// Searches a time slot for today
+		/// </summary>
+		/// <returns>The time slot of today</returns>
+		public TimeSlot GetTimeSlot() {
+			return Slots.Find((match) => {
+				return match.Day == DateTime.Now.DayOfWeek;
+			});
+		}
+
+		/// <summary>
+		/// Searches a time slot for a specific day
 		/// </summary>
 		/// <param name="day">The day for which to find a time slot</param>
 		/// <returns>The time slot of the day</returns>
@@ -121,8 +131,8 @@
 		/// <returns>A flag that tells if the inbox can be synched</returns>
 		public bool ScheduledSync() {

-			// gets the current time slot for today
-			TimeSlot slot = GetTimeSlot(DateTime.Now.DayOfWeek);
+			// gets the time slot of today
+			TimeSlot slot = GetTimeSlot();

 			// allows inbox syncing if there is no slot defined for today
 			if (slot == null) {


Detect "infinite" ranges (even if the endpoints are finite) in tex range

--- renderdocui/Controls/RangeHistogram.cs
+++ renderdocui/Controls/RangeHistogram.cs
@@ -113,7 +113,9 @@
                 if (float.IsInfinity(m_WhitePoint) || float.IsNaN(m_WhitePoint) ||
                     float.IsInfinity(m_BlackPoint) || float.IsNaN(m_BlackPoint) ||
                     float.IsInfinity(m_RangeMax) || float.IsNaN(m_RangeMax) ||
-                    float.IsInfinity(m_RangeMin) || float.IsNaN(m_RangeMin))
+                    float.IsInfinity(m_RangeMin) || float.IsNaN(m_RangeMin) ||
+                    float.IsInfinity(m_RangeMax - m_RangeMin) || float.IsNaN(m_RangeMax - m_RangeMin) ||
+                    float.IsInfinity(m_WhitePoint - m_BlackPoint) || float.IsNaN(m_WhitePoint - m_BlackPoint))
                 {
                     return false;
                 }


Added leave command.

Added leave command.

--- Dogey/Modules/OwnerModule.cs
+++ Dogey/Modules/OwnerModule.cs
@@ -27,6 +27,16 @@
         public async Task Say(IUserMessage msg, [Remainder]string text)
         {
             await msg.Channel.SendMessageAsync(text);
+        }
+
+        [Command("leave")]
+        [Description("Make Dogey leave a server.")]
+        public async Task Set(IUserMessage msg, ulong guildId)
+        {
+            var guild = await _client.GetGuildAsync(guildId);
+
+            await guild.LeaveAsync();
+            await msg.Channel.SendMessageAsync($"I left the guild **{guild.Name}** ({guild.Id}).");
         }

         [Command("set")]


Fix up tooltip

Fix up tooltip

Fix tooltip hover. messages up during recode.

--- EDDiscovery/3DMap/FormMap.cs
+++ EDDiscovery/3DMap/FormMap.cs
@@ -566,6 +566,8 @@

         private void UpdateDataSetsDueToFlip()
         {
+            //Stopwatch sw = new Stopwatch(); sw.Start();
+
             DatasetBuilder builder = new DatasetBuilder();
             builder.UpdateGalObjects(ref _datasets_galmapobjects, GetBitmapOnScreenSizeX(), GetBitmapOnScreenSizeY(), _lastcameranorm.Rotation);

@@ -577,6 +579,8 @@

             if (_clickedGMO != null || _clickedSystem != null)              // if markers
                 builder.UpdateSelected(ref _datasets_selectedsystems, _clickedSystem, _clickedGMO, GetBitmapOnScreenSizeX(), GetBitmapOnScreenSizeY(), _lastcameranorm.Rotation);
+
+            //Console.WriteLine("Flip {0}", sw.ElapsedMilliseconds);
         }

         private void GenerateDataSetsMaps()
@@ -1181,6 +1185,7 @@
                     _cameraSlewProgress = 0.0f;
                     _cameraSlewTime = (float)Math.Max(2.0, dist / 10000.0);            //10000 ly/sec, with a minimum slew
                     //Console.WriteLine("Slew " + dist + " in " + _cameraSlewTime);
+                    KillHover();
                     Repaint();
                 }
             }
@@ -1955,75 +1960,37 @@
             }
             else //
             {
-                if (_cameraSlewProgress < 1.0F)       // slewing.. no hover tick
-                {
-                    _mousehovertick.Stop();
-                }
-                else if (_mousehovertooltip != null)
-                {
-                    if (Math.Abs(e.X - _mouseHover.X) + Math.Abs(e.Y - _mouseHover.Y) > 8)
-                    {
-                        _mousehovertooltip.Dispose();
-                        _mousehovertooltip = null;
-                    }
-                }
-                else if (_mousehovertick.Enabled)
-                {
-                    if (Math.Abs(e.X - _mouseHover.X) + Math.Abs(e.Y - _mouseHover.Y) > 8)
-                    {
-                        _mousehovertick.Stop();
-                    }
-                }
-                else
-                {
+                if (Math.Abs(e.X - _mouseHover.X) + Math.Abs(e.Y - _mouseHover.Y) > 8)
+                    KillHover();                                // we move we kill the hover.
+
+                                                                // no tool tip, not slewing, not ticking..
+                if (_mousehovertooltip == null && _cameraSlewProgress >= 1.0F && !_mousehovertick.Enabled)
+                {
+                    //Console.WriteLine("{0} Start tick", Environment.TickCount);
                     _mouseHover = e.Location;
                     _mousehovertick.Start();
                 }
             }
         }

-        private void glControl_OnMouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
-        {
-            var kbdstate = OpenTK.Input.Keyboard.GetState();
-
-            if (kbdstate[Key.LControl] || kbdstate[Key.RControl])
-            {
-                if (e.Delta < 0)
-                {
-                    _cameraFov = (float)Math.Min(_cameraFov*ZoomFact, Math.PI * 0.8);
-                }
-                else if (e.Delta > 0)
-                {
-                    _cameraFov /= (float)ZoomFact;
-                }
-            }
-            else
-            {
-                float curzoom = _zoom;
-
-                if (e.Delta > 0)
-                {
-                    _zoom *= (float)ZoomFact;
-                    if (_zoom > ZoomMax) _zoom = (float)ZoomMax;
-                }
-                if (e.Delta < 0)
-                {
-                    _zoom /= (float)ZoomFact;
-                    if (_zoom < ZoomMin) _zoom = (float)ZoomMin;
-                }
-
-                if ( curzoom != _zoom )
-                    UpdateDataSetsDueToZoom();
-            }
-
-            SetupViewport();
-            Repaint();
+        void KillHover()
+        {
+            if (_mousehovertooltip != null)                                 // kill the tool tip
+            {
+                //Console.WriteLine("{0} kill tool tip move mouse", Environment.TickCount);
+                _mousehovertooltip.Dispose();
+                _mousehovertooltip = null;
+            }
+
+            //Console.WriteLine("{0} kill hover", Environment.TickCount);
+            _mousehovertick.Stop();
         }

         void MouseHoverTick(object sender, EventArgs e)
         {
-            if (_cameraSlewProgress < 1.0F)       // slewing.. no hover tick
-                return;
+            _mousehovertick.Stop();
+
+            //Console.WriteLine("{0} Hover tick tripped slew {1}", Environment.TickCount, _cameraSlewProgress);

             ISystem hoversystem = null;
             BookmarkClass curbookmark = null;
@@ -2122,9 +2089,48 @@
             }
         }

-#endregion
-
-#region FindObjectsOnScreen
+        private void glControl_OnMouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
+        {
+            var kbdstate = OpenTK.Input.Keyboard.GetState();
+
+            if (kbdstate[Key.LControl] || kbdstate[Key.RControl])
+            {
+                if (e.Delta < 0)
+                {
+                    _cameraFov = (float)Math.Min(_cameraFov * ZoomFact, Math.PI * 0.8);
+                }
+                else if (e.Delta > 0)
+                {
+                    _cameraFov /= (float)ZoomFact;
+                }
+            }
+            else
+            {
+                float curzoom = _zoom;
+
+                if (e.Delta > 0)
+                {
+                    _zoom *= (float)ZoomFact;
+                    if (_zoom > ZoomMax) _zoom = (float)ZoomMax;
+                }
+                if (e.Delta < 0)
+                {
+                    _zoom /= (float)ZoomFact;
+                    if (_zoom < ZoomMin) _zoom = (float)ZoomMin;
+                }
+
+                if (curzoom != _zoom)
+                    UpdateDataSetsDueToZoom();
+            }
+
+            SetupViewport();
+            Repaint();
+        }
+
+
+        #endregion
+
+        #region FindObjectsOnScreen

         Matrix4d GetResMat()
         {


Updates test.

Updates test.

--- FlubuCore.Tests/Scripting/NugetPackageResolverTests.cs
+++ FlubuCore.Tests/Scripting/NugetPackageResolverTests.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using FlubuCore.Scripting;
 using Microsoft.DotNet.Cli.Utils;
@@ -9,7 +11,7 @@
     public class NugetPackageResolverTests
     {
         [Fact]
-        public void Resolve()
+        public void ResolveNugetDependencies()
         {
             var resolver = new NugetPackageResolver(new CommandFactory());
             var assemblies = resolver.ResolveNugetPackages(new List<NugetPackageReference>()
@@ -27,8 +29,8 @@
             }, null);

             Assert.True(assemblies.Count > 100);
-            Assert.True(assemblies.Any(x => x.Name == "FlubuCore"));
-            Assert.True(assemblies.Any(x => x.Name == "Dapper"));
+            Assert.Contains(assemblies, x => x.Name == "FlubuCore");
+            Assert.Contains(assemblies, x => x.Name == "Dapper");
         }
     }
 }


Greylist fixes in workflow consumer

Greylist fixes in workflow consumer

--- src/WorkflowCore/Services/BackgroundTasks/WorkflowConsumer.cs
+++ src/WorkflowCore/Services/BackgroundTasks/WorkflowConsumer.cs
@@ -84,7 +84,7 @@
         {
             //TODO: move to own class
             Logger.LogDebug("Subscribing to event {0} {1} for workflow {2} step {3}", subscription.EventName, subscription.EventKey, subscription.WorkflowId, subscription.StepId);
-
+
             await persistenceStore.CreateEventSubscription(subscription, cancellationToken);
             if (subscription.EventName != Event.EventTypeActivity)
             {
@@ -101,13 +101,21 @@
                         while (!acquiredLock && attempt < 10)
                         {
                             acquiredLock = await _lockProvider.AcquireLock(eventKey, cancellationToken);
-                            await Task.Delay(Options.IdleTime);
+                            await Task.Delay(Options.IdleTime, cancellationToken);

                             attempt++;
                         }

-                        await persistenceStore.MarkEventUnprocessed(evt, cancellationToken);
-                        await QueueProvider.QueueWork(evt, QueueType.Event);
+                        if (!acquiredLock)
+                        {
+                            Logger.LogWarning($"Failed to lock {evt}");
+                        }
+                        else
+                        {
+                            await persistenceStore.MarkEventUnprocessed(evt, cancellationToken);
+                            await QueueProvider.QueueWork(evt, QueueType.Event);
+                            _greylist.Remove(eventKey);
+                        }
                     }
                     finally
                     {


(maint) Remove duplicate sensitive parameter check

We were checking for `-apikey` and `-api-key` twice. No need to check
multiple times.

--- src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs
+++ src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs
@@ -41,8 +41,6 @@
              || commandArguments.contains("-key=")
              || commandArguments.contains("-apikey")
              || commandArguments.contains("-api-key")
-             || commandArguments.contains("-apikey")
-             || commandArguments.contains("-api-key")
             ;
         }
     }


Fixed assets resolving the value inside the get method.

--- GameLibrary/Xemio.GameLibrary/Assets/AssetContainer.cs
+++ GameLibrary/Xemio.GameLibrary/Assets/AssetContainer.cs
@@ -54,14 +54,22 @@
         /// Gets the asset for the specified id.
         /// </summary>
         /// <param name="id">The id.</param>
-        public object Get(string id)
+        private IAsset GetAsset(string id)
         {
             if (!this._assetMappings.ContainsKey(id))
             {
                 throw new AssetNotFoundException(id);
             }

-            return this._assetMappings[id].Value;
+            return this._assetMappings[id];
+        }
+        /// <summary>
+        /// Gets the asset for the specified id.
+        /// </summary>
+        /// <param name="id">The id.</param>
+        public object Get(string id)
+        {
+            return this.GetAsset(id).Value;
         }
         /// <summary>
         /// Gets the asset for the specified id.
@@ -69,7 +77,7 @@
         /// <param name="id">The id.</param>
         public T Get<T>(string id)
         {
-            Asset<T> asset = this.Get(id) as Asset<T>;
+            Asset<T> asset = this.GetAsset(id) as Asset<T>;
             if (asset == null)
             {
                 return default(T);


Updated comments

Updated comments

--- GenericServices/Core/EfGenericDtoBase.Generic.Setup.cs
+++ GenericServices/Core/EfGenericDtoBase.Generic.Setup.cs
@@ -26,7 +26,6 @@
 #endregion

 using System;
-using System.Collections.Concurrent;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using AutoMapper;
@@ -57,12 +56,9 @@
             MapperSetup();
         }

-
-        //---------------------------------------------------------------------
-        //private methods
-
         /// <summary>
         /// This is used to set up the mapping of any associated EfGenericDto
+        /// NOTE: It needs to be protected as the reflection .GetMethod doens't find a private method
         /// </summary>
         /// <param name="cfg"></param>
         /// <param name="readFromDatabase"></param>
@@ -75,6 +71,9 @@
             else
                 CreateWriteToDatabaseMapping(cfg);
         }
+
+        //---------------------------------------------------------------------
+        //private methods

         /// <summary>
         /// This sets all the AutoMapper mapping that this dto needs. It is called from the base constructor


Fixed R# Error

Fixed R# Error

--- HiP-Achievements/Controllers/AchievementsController.cs
+++ HiP-Achievements/Controllers/AchievementsController.cs
@@ -195,8 +195,8 @@
                             unlocked.Add(e);
                         }
                         break;
-                    case RouteFinishedAchievement e:
-                        break;
+
+                    // TODO: implement for other achievement types
                 }
             }
             var result = new AllItemsResult<AchievementResult>


Indicando cultura no TextPosReader quando é feito conversão de string para int/decimal

--- src/Boleto.Net/Arquivo/Reader/TextPosReader.cs
+++ src/Boleto.Net/Arquivo/Reader/TextPosReader.cs
@@ -8,6 +8,7 @@
 {
     public class TextPosReader
     {
+        private readonly NumberFormatInfo numberFormat = CultureInfo.GetCultureInfo("pt-BR").NumberFormat;
         public LinhaCbr643 Read(string line)
         {
             var type = typeof(LinhaCbr643);
@@ -36,12 +37,12 @@
                         tuple.Item1.SetValue(lineObject, data, null);
                 }
                 else if (typeof(int).IsAssignableFrom(tuple.Item1.PropertyType))
-                    tuple.Item1.SetValue(lineObject, int.Parse(str), null);
+                    tuple.Item1.SetValue(lineObject, int.Parse(str, numberFormat), null);
                 else if (typeof(decimal).IsAssignableFrom(tuple.Item1.PropertyType))
                 {
                     str = line.Substring(tuple.Item2.Start, tuple.Item2.Lenght + 2).Trim();
                     str = str.Insert(tuple.Item2.Lenght, ",");
-                    tuple.Item1.SetValue(lineObject, decimal.Parse(str), null);
+                    tuple.Item1.SetValue(lineObject, decimal.Parse(str, numberFormat), null);
                 }
                 else
                     tuple.Item1.SetValue(lineObject, str, null);


Update ResourceStub.cs

Update ResourceStub.cs

--- src/Seq.App.YouTrack/Resources/ResourceStub.cs
+++ src/Seq.App.YouTrack/Resources/ResourceStub.cs
@@ -1,4 +1,16 @@
-// Seq.App.YouTrack - Copyright (c) 2019 CaptiveAire
+// Copyright 2014-2019 CaptiveAire Systems
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.

 using System;
 using System.Reflection;
@@ -30,4 +42,4 @@
             return new EmbeddedResourceLoader(_resourceLocator).LoadText(name);
         }
     }
-}+}


Ops, I forgot to port the Factory property :P


ci test

ci test

--- eShopModernizedMVCSolution/src/eShopModernizedMVC/Views/Shared/_Layout.cshtml
+++ eShopModernizedMVCSolution/src/eShopModernizedMVC/Views/Shared/_Layout.cshtml
@@ -17,7 +17,7 @@

-
Catalog manager (MVC)

+
Catalog Manager (MVC)


Sorted out ordering in reads.

Sorted out ordering in reads.

--- JetBlack.MessageBus.Common/Network/StreamExtensions.cs
+++ JetBlack.MessageBus.Common/Network/StreamExtensions.cs
@@ -18,6 +18,32 @@
         }

         public static IObservable<DisposableValue<ArraySegment<byte>>> ToFrameStreamObservable(this Stream stream, BufferManager bufferManager)
+        {
+            return Observable.Create<DisposableValue<ArraySegment<byte>>>(async (observer, token) =>
+            {
+                try
+                {
+                    while (!token.IsCancellationRequested)
+                    {
+                        var buffer = await stream.ReadHeader(token)
+                            .ContinueWith(task => stream.ReadBody(task.Result, bufferManager, token), token);
+
+                        if (buffer.Result == default(DisposableValue<ArraySegment<byte>>))
+                            break;
+
+                        observer.OnNext(buffer.Result);
+                    }
+
+                    observer.OnCompleted();
+                }
+                catch (Exception error)
+                {
+                    observer.OnError(error);
+                }
+            });
+        }
+
+        public static IObservable<DisposableValue<ArraySegment<byte>>> ToFrameStreamObservableOld(this Stream stream, BufferManager bufferManager)
         {
             return Observable.Create<DisposableValue<ArraySegment<byte>>>(async (observer, token) =>
             {
@@ -45,6 +71,28 @@
                     observer.OnError(error);
                 }
             });
+        }
+
+        private static async Task<int> ReadHeader(this Stream stream, CancellationToken token)
+        {
+            var headerBuffer = new byte[sizeof(int)];
+
+            if (await stream.ReadBytesCompletelyAsync(headerBuffer, headerBuffer.Length, token) != headerBuffer.Length)
+                return -1;
+
+            return BitConverter.ToInt32(headerBuffer, 0);
+        }
+
+        private static async Task<DisposableValue<ArraySegment<byte>>> ReadBody(this Stream stream, int length, BufferManager bufferManager, CancellationToken token)
+        {
+            if (length <= 0)
+                return default(DisposableValue<ArraySegment<byte>>);
+
+            var buffer = bufferManager.TakeBuffer(length);
+            if (await stream.ReadBytesCompletelyAsync(buffer, length, token) != length)
+                return default(DisposableValue<ArraySegment<byte>>);
+
+            return DisposableValue.Create(new ArraySegment<byte>(buffer, 0, length), Disposable.Create(() => bufferManager.ReturnBuffer(buffer)));
         }

         public static IObserver<DisposableValue<ArraySegment<byte>>> ToFrameStreamObserver(this Stream stream, CancellationToken token)


add remarks to ArgumentList and ArgumentDictionary

--- src/Utility.CommandLine.Arguments/Arguments.cs
+++ src/Utility.CommandLine.Arguments/Arguments.cs
@@ -211,11 +211,20 @@
         ///     Gets a dictionary containing the arguments and values specified in the command line arguments with which the
         ///     application was started.
         /// </summary>
+        /// <remarks>
+        ///     This dictionary contains argument key/value pairs compiled from the <see cref="ArgumentList"/> and checked against
+        ///     the <see cref="TargetType"/> to combine duplicated pairs into lists where the backing property is a collection, and
+        ///     to overwrite where the backing property is not a collection.
+        /// </remarks>
         public Dictionary<string, object> ArgumentDictionary { get; }

         /// <summary>
         ///     Gets the list of arguments specified in the command line arguments with which the application was started.
         /// </summary>
+        /// <remarks>
+        ///     This list contains each argument key/value pair as supplied in the original string, preserving the original order
+        ///     and any duplicated pairs.
+        /// </remarks>
         public List<KeyValuePair<string, string>> ArgumentList { get; }

         /// <summary>


Add a way to store permanent variables to the predicate assignment list

--- LogicalShift.Reason/Solvers/PredicateAssignmentList.cs
+++ LogicalShift.Reason/Solvers/PredicateAssignmentList.cs
@@ -28,6 +28,12 @@
         private readonly List<IAssignmentLiteral> _otherAssignments = new List<IAssignmentLiteral>();

         /// <summary>
+        /// Identifiers of literals representing permanent variables (variables referenced in multiple subclauses).
+        /// These assignments are assigned to lower identifiers, after the assignments representing the arguments.
+        /// </summary>
+        private readonly HashSet<ILiteral> _permanentVariables = new HashSet<ILiteral>();
+
+        /// <summary>
         /// Adds a new argument to this object
         /// </summary>
         public void AddArgument(ILiteral argument)
@@ -53,11 +59,43 @@
         }

         /// <summary>
+        /// Adds a permanent variable to this object
+        /// </summary>
+        public void AddPermanentVariable(ILiteral variable)
+        {
+            _permanentVariables.Add(variable);
+        }
+
+        /// <summary>
         /// The number of arguments in this list (these are always the first set of assignments)
         /// </summary>
         public int CountArguments()
         {
             return _arguments.Count();
+        }
+
+        /// <summary>
+        /// Counts how many permanent variables have been added to this object
+        /// </summary>
+        public int CountPermanentVariables()
+        {
+            return _permanentVariables.Count;
+        }
+
+        /// <summary>
+        /// A list of variables that are used in these assignments
+        /// </summary>
+        public IEnumerable<ILiteral> Variables
+        {
+            get
+            {
+                var variables = _arguments.Concat(_otherAssignments)
+                    .Where(assignment => assignment.Value.UnificationKey == null)
+                    .Select(assignment => assignment.Value)
+                    .Distinct();
+
+                return variables;
+            }
         }

         /// <summary>
@@ -71,10 +109,14 @@
                 var eliminator = new AssignmentEliminator(_otherAssignments);
                 eliminator.Eliminate();

+                // Order the permanent variables first
+                var permanentFirst = eliminator.Assigments
+                    .OrderBy(assignment => _permanentVariables.Contains(assignment.Value)?0:1);
+
                 // Result is the result of remapping the arguments and adding in the remaining assignments
                 var result = _arguments
                     .Select(arg => arg.Remap(eliminator.MapVariable))
-                    .Concat(eliminator.Assigments);
+                    .Concat(permanentFirst);

                 return result;
             }


handling case where value is null.

handling case where value is null.

--- MileageStats.Web/Helpers/MustacheTemplateExtensions.cs
+++ MileageStats.Web/Helpers/MustacheTemplateExtensions.cs
@@ -46,13 +46,15 @@
                 var name = ExpressionHelper.GetExpressionText(getter);
                 return new MvcHtmlString(string.Format("{{{{{0}}}}}",name));

-            } else
-            {
-                var fn = getter.Compile();
-                var value = fn(helper.ViewData.Model);
+            }
+
+            var fn = getter.Compile();
+            var value = fn(helper.ViewData.Model);
+            if (value != null)
+            {
                 return new MvcHtmlString(value.ToString());
             }
-
+            return new MvcHtmlString(null);
         }

         public static MvcHtmlString Mustache<TModel, TProperty>(this HtmlHelper helper, TModel model, Expression<Func<TModel, TProperty>> getter)
@@ -63,13 +65,14 @@
                 return new MvcHtmlString(string.Format("{{{{{0}}}}}", name));

             }
-            else
-            {
-                var fn = getter.Compile();
-                var value = fn(model);
+
+            var fn = getter.Compile();
+            var value = fn(model);
+            if (value != null)
+            {
                 return new MvcHtmlString(value.ToString());
             }
-
+            return new MvcHtmlString(null);
         }

         public interface ISectionRenderer<out T> : IDisposable


Removed unneeded test

Removed unneeded test

--- PART/Source/CPRBroker/NUnitTester/SubscriptionsTest.cs
+++ PART/Source/CPRBroker/NUnitTester/SubscriptionsTest.cs
@@ -47,7 +47,7 @@
             return TestData.birthdateSubscriptionFunctions;
         }

-        [Test]
+       /* [Test]
         [Combinatorial]
         public void T510_SendBirthdateNotifications(
             [ValueSource("birthDateSubscriptionFuncs")]
@@ -93,6 +93,7 @@

             }
         }
+        */

         [Test]
         [TestCaseSource(typeof(TestData), TestData.CprNumbersToSubscribeFieldName)]
@@ -106,13 +107,13 @@
             TestData.changeSubscriptions.Add(sub);
         }

-        [Test]
+        /*[Test]
         public void T530_RefreshPersonsData()
         {
             var reseult = TestRunner.AccessService.RefreshPersonsData();
             Assert.IsNotNull(reseult);
             Assert.Greater(reseult.SucceededCprNumbers.Length, 0);
-        }
+        }*/

         private IEnumerable<Func<Subscriptions.ChangeSubscriptionType>> changeSubscriptionFuncs()
         {


Added Resolve to IPuzzleEditor

Added Resolve to IPuzzleEditor

--- PiCross/Domain/PiCross/Facade/Editing/IPuzzleEditor.cs
+++ PiCross/Domain/PiCross/Facade/Editing/IPuzzleEditor.cs
@@ -16,6 +16,8 @@
         ISequence<IPuzzleEditorConstraints> ColumnConstraints { get; }

         ISequence<IPuzzleEditorConstraints> RowConstraints { get; }
+
+        void ResolveAmbiguity();
     }

     public interface IPuzzleEditorSquare


Update Jira success message

Update Jira success message

--- Processes/Shared/Shared/Authentication/Targets/Jira.cs
+++ Processes/Shared/Shared/Authentication/Targets/Jira.cs
@@ -81,7 +81,7 @@
             }

             // Return the result
-            return new Result(true, "Authentication succeeded");
+            return new Result(true, "Successfully authenticated against the Jira server");
         }
     }
 }


Fix to wrongly detecting ramps

Fix to wrongly detecting ramps

--- Raccoon/Core/Components/Movement/PlatformerMovement.cs
+++ Raccoon/Core/Components/Movement/PlatformerMovement.cs
@@ -23,7 +23,7 @@
         /// greater than max value it'll be a wall.
         /// Preferred to be values in [0, 90] range.
         /// </summary>
-        public static Range AllowedRampElevation = new Range(0, 60); // in degrees (preferred to stay
+        public static Range AllowedRampElevation = new Range(1, 60); // in degrees (preferred to stay

         public delegate void PlatformerMovementAction();
         public event PlatformerMovementAction OnJumpBegin = delegate { },


Fix infinite jump when jumps > 1

Fix infinite jump when jumps > 1

--- Raccoon/Core/Components/Movement/PlatformerMovement.cs
+++ Raccoon/Core/Components/Movement/PlatformerMovement.cs
@@ -106,6 +106,7 @@
         private bool _canJump = true,
                      _canKeepCurrentJump = true,
                      _requestedJump,
+                     _jumpStart,
                      _canPerformEarlyJumpInput = true,
                      _canPerformLedgeJump = true,
                      _canPerformAdditionalJump;
@@ -407,6 +408,7 @@
                 }
             }

+            _jumpStart = false;
             _requestedJump = false;
             IsStillJumping = false;
             CanFallThrough = false;
@@ -846,6 +848,7 @@
             }

             IsStillJumping = true;
+            _jumpStart = true;
             _canPerformAdditionalJump = false; // it'll need to be reevaluated later
             _canPerformLedgeJump = false; // after any jump, can't perform ledge jump until reaches ground again
             _jumpMaxY = (int) (Body.Position.Y - JumpHeight);
@@ -916,7 +919,7 @@
                     Fall();
                 }
             } else if (distance.Y < 0f && (IsStillJumping || JustReceiveImpulse)) {
-                if (!IsJumping) {
+                if (!IsJumping || _jumpStart) {
                     IsJumping =
                         JustJumped =
                         HasJumped = true;


Removed unnecessary locking in DebuggerSession.ActiveThread

Also added null-protection to SetNextStatement's use of ActiveThread.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1030369/

--- Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs
+++ Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs
@@ -470,9 +470,7 @@
 		/// </remarks>
 		public ThreadInfo ActiveThread {
 			get {
-				lock (slock) {
-					return activeThread;
-				}
+				return activeThread;
 			}
 			set {
 				lock (slock) {
@@ -618,7 +616,12 @@
 			if (!IsConnected || IsRunning || !CanSetNextStatement)
 				throw new NotSupportedException ();

-			OnSetNextStatement (ActiveThread.Id, fileName, line, column);
+			var thread = ActiveThread;
+
+			if (thread == null)
+				return;
+
+			OnSetNextStatement (thread.Id, fileName, line, column);
 		}

 		/// <summary>
@@ -633,7 +636,12 @@
 			if (!IsConnected || IsRunning || !CanSetNextStatement)
 				throw new NotSupportedException ();

-			OnSetNextStatement (ActiveThread.Id, ilOffset);
+			var thread = ActiveThread;
+
+			if (thread == null)
+				return;
+
+			OnSetNextStatement (thread.Id, ilOffset);
 		}

 		/// <summary>


Updated VObject indexer to return null when a key isn't found

- To mimic Json.NET behavior.

--- Gameloop.Vdf/Linq/VObject.cs
+++ Gameloop.Vdf/Linq/VObject.cs
@@ -45,7 +45,7 @@
             get
             {
                 if (!TryGetValue(key, out VToken result))
-                    throw new KeyNotFoundException("The given key was not present.");
+                    return null;

                 return result;
             }


Perlin noise maybe

Perlin noise maybe

--- MoodRingChatroom/Assets/Scripts/Jacob/NoiseGenerator.cs
+++ MoodRingChatroom/Assets/Scripts/Jacob/NoiseGenerator.cs
@@ -21,6 +21,12 @@
 	// An array of colors that will map to the entire plane
 	private Color[] colorNoise;

+	private PerlinNoise perlin;
+
+	public float amp = 1.0f;
+	public float frq = 50.0f;
+	public int oct = 50;
+
 	void Start() {
 		// Set the width and height to the plane's dimensions
 		planeWidth = (int) gameObject.renderer.bounds.size.x;
@@ -31,11 +37,14 @@

 		colorNoise = new Color[noiseTex.width * noiseTex.height];
 		gameObject.renderer.material.mainTexture = noiseTex;
+
+		perlin = new PerlinNoise(0);
 	}

 	void Update() {
 		// MAKE. SOME. NOISE.
 		GeneratePerlin();
+//		GeneratePerlin (true);

 		// Compensates for active/deactive states of emotion
 		if(EmotionModel.CurrentState.y < 0) {
@@ -50,6 +59,8 @@
 		if(rand > 20f || rand < 5f) {
 			change*=-1f;;
 		}
+//		amp++;
+		frq-=0.05f;
 	}

 	void GeneratePerlin() {
@@ -73,4 +84,21 @@
 		noiseTex.SetPixels(colorNoise);
 		noiseTex.Apply();
 	}
+
+	void GeneratePerlin(bool t) {
+		float r = 1.0f-EmotionModel.CurrentState.x/-1.0f;
+		float g = 1.0f-EmotionModel.CurrentState.magnitude;
+		float b = 1.0f-EmotionModel.CurrentState.x/1.0f;
+
+
+		for(float x = 0.0F; x < noiseTex.width; x++) {
+			for(float y = 0.0F; y < noiseTex.height; y++) {
+				float noise = perlin.FractalNoise2D(x,y,oct,frq,1.0f);
+				noise = (noise + 1.0f) * 0.5f;
+//				noiseTex.SetPixel((int)x,(int)y,new Color(noise*r,noise*g,noise*b));
+				noiseTex.SetPixel((int)x,(int)y,new Color(noise, noise, noise, 1.0f));
+			}
+		}
+		noiseTex.Apply();
+	}
 }


fixing compatibility with old deployment

--- NTumbleBit/JsonConverters/CorrelationIdJsonConverter.cs
+++ NTumbleBit/JsonConverters/CorrelationIdJsonConverter.cs
@@ -20,7 +20,7 @@
 				return null;
 			try
 			{
-				return CorrelationId.Parse((string)reader.Value);
+				return CorrelationId.Parse(reader.Value.ToString());
 			}
 			catch(EndOfStreamException)
 			{


AdjustAllControls at application startup

--- GitAutoUpdateGUI/FormMain.cs
+++ GitAutoUpdateGUI/FormMain.cs
@@ -79,9 +79,9 @@
       GetWindowValue();
       LoadLanguages();
       SetLanguage(Settings.Default.LastLanguageUsed);
+      AdjustAllControls();
       CheckGitBashBinary();
       CheckGitBashPathInWinPath();
-      AdjustAllControls();
       EnableDisableButtons(listViewVSProjects, buttonCheckAll, buttonClearAll, buttonCheckUncheckAll, buttonUpdateVSProjects);
     }


Change message.

Change message.

--- NtApiDotNet/Win32/Security/Buffers/SecurityBufferOut.cs
+++ NtApiDotNet/Win32/Security/Buffers/SecurityBufferOut.cs
@@ -42,7 +42,7 @@
         public override byte[] ToArray()
         {
             if (_array == null)
-                throw new InvalidOperationException("Can't access return until it's been populated.");
+                throw new InvalidOperationException("Can't access buffer until it's been populated.");
             return _array;
         }


Update FormMain.cs

Update FormMain.cs

--- GitAutoUpdateGUI/FormMain.cs
+++ GitAutoUpdateGUI/FormMain.cs
@@ -732,7 +732,7 @@
     {
       if (tb != ActiveControl) return;
       var selectionIndex = tb.SelectionStart;
-      tb.Text = tb.Text.Insert(selectionIndex, Clipboard.GetText());
+      tb.SelectedText = Clipboard.GetText();
       tb.SelectionStart = selectionIndex + Clipboard.GetText().Length;
     }

@@ -1905,4 +1905,4 @@
       return lv.CheckedItems.Count;
     }
   }
-}+}


If the XML rename dance is successful, delete .old file

--- OpenSim/Framework/Configuration/XML/XmlConfiguration.cs
+++ OpenSim/Framework/Configuration/XML/XmlConfiguration.cs
@@ -151,6 +151,8 @@
                 File.Delete(oldFile);
             File.Move(fileName, oldFile);
             File.Move(newFile, fileName);
+            if (File.Exists(fileName) && File.Exists(oldFile))
+                File.Delete(oldFile);
             needsCommit = false;
         }


Allow null expected values for just ignoring the value (todo: maybe allow byte expected values).

--- test/TestApp/TestRunner.cs
+++ test/TestApp/TestRunner.cs
@@ -82,7 +82,7 @@

 			 string result = reader.ReadToEnd ();

-			 if (result != expected)
+			 if (expected != null && result != expected)
 			    throw new Exception (String.Format ("Expected '{0}' for uri {1} got '{2}'", expected, uri, result));

 			if (LoadTest) {


PG-1215 [WIP] Fixed up broken unit test (and hopefully made it slightly more clear)

--- GlyssenTests/ProjectTests.cs
+++ GlyssenTests/ProjectTests.cs
@@ -1142,6 +1142,7 @@
 		[Test]
 		public void SetReferenceText_ChangeFromEnglishToFrenchWithOneBlockMismatched_ReferenceTextClearedForAllRelatedBlocks()
 		{
+			// Setup
 			var testProject = TestProject.CreateTestProject(TestProject.TestBook.MRK);
 			testProject.ReferenceText = ReferenceText.GetStandardReferenceText(ReferenceTextType.English);
 			testProject.IsOkayToClearExistingRefBlocksWhenChangingReferenceText = () => true;
@@ -1150,21 +1151,30 @@

 			var mark5V41 = blocks.IndexOf(b => b.ChapterNumber == 5 && b.InitialStartVerseNumber == 41);
 			var matchup = testProject.ReferenceText.GetBlocksForVerseMatchedToReferenceText(mark, mark5V41);
-			Assert.AreEqual(5, matchup.CorrelatedBlocks.Count);
-			Assert.AreEqual(40, matchup.CorrelatedBlocks[0].InitialStartVerseNumber);
-			Assert.AreEqual(41, matchup.CorrelatedBlocks[1].InitialStartVerseNumber);
-			Assert.IsTrue(matchup.CorrelatedBlocks.All(b => b.ReferenceBlocks.Count == 1));
+			Assert.AreEqual(5, matchup.CorrelatedBlocks.Count, "Setup problem");
+			Assert.AreEqual(40, matchup.CorrelatedBlocks[0].InitialStartVerseNumber, "Setup problem");
+			Assert.AreEqual(41, matchup.CorrelatedBlocks[1].InitialStartVerseNumber, "Setup problem");
+			Assert.IsTrue(matchup.CorrelatedBlocks.Take(4).All(b => b.MatchesReferenceText),
+				"Setup problem: GetBlocksForVerseMatchedToReferenceText expected to match all except the last " +
+				"vern block to exactly one ref block.");
+			Assert.IsFalse(matchup.CorrelatedBlocks.Last().MatchesReferenceText);
+			var englishTextOfLastNarrtorBlock = ((ScriptText)matchup.CorrelatedBlocks[3].ReferenceBlocks.Single().BlockElements.Single()).Content;
+			var iQuoteMark = englishTextOfLastNarrtorBlock.IndexOf("“");
+			matchup.SetReferenceText(3, "This is not going to match the corresponding English text in the French test reference text.");
+			matchup.SetReferenceText(4, englishTextOfLastNarrtorBlock.Substring(iQuoteMark));
+			matchup.CorrelatedBlocks.Last().SetNonDramaticCharacterId(mark.NarratorCharacterId);
 			matchup.MatchAllBlocks(null);
-			matchup.SetReferenceText(3, "this won't match.");
 			matchup.Apply();
 			var matchedVernBlocks = blocks.Skip(mark5V41).Take(4).ToList();
 			Assert.IsTrue(matchedVernBlocks.All(b => b.MatchesReferenceText));
 			Assert.IsTrue(matchedVernBlocks.All(b => b.ReferenceBlocks.Single().ReferenceBlocks.Count == 0));
 			Assert.IsFalse(matchedVernBlocks.Any(b => string.IsNullOrEmpty(b.GetPrimaryReferenceText())));

+			// SUT
 			ReferenceText rtFrench = TestReferenceText.CreateCustomReferenceText(TestReferenceText.TestReferenceTextResource.FrenchMRK);
 			testProject.ReferenceText = rtFrench;

+			// Verification
 			Assert.IsTrue(blocks.Single(b => b.ChapterNumber == 5 && b.InitialStartVerseNumber == 40).MatchesReferenceText);
 			mark5V41 = blocks.IndexOf(b => b.ChapterNumber == 5 && b.InitialStartVerseNumber == 41);
 			var vernBlocksForMark5V41 = blocks.Skip(mark5V41).Take(4).ToList();


fix unit test for SolidColorBrush

fix unit test for SolidColorBrush

--- tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
+++ tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
@@ -372,7 +372,7 @@
             Assert.Equal(2, setters.Length);

             Assert.Equal(TextBlock.BackgroundProperty, setters[0].Property);
-            Assert.Equal(Brushes.White, setters[0].Value);
+            Assert.Equal(Brushes.White.Color, ((ISolidColorBrush)setters[0].Value).Color);

             Assert.Equal(TextBlock.WidthProperty, setters[1].Property);
             Assert.Equal(100.0, setters[1].Value);


Test ignored

Test ignored

--- tests/LinqInfer.Tests/Learning/ImageLearningExamples.cs
+++ tests/LinqInfer.Tests/Learning/ImageLearningExamples.cs
@@ -22,7 +22,7 @@
         private const int VectorWidth = 7;

         [Test]
-        //[Ignore("TODO: Invalid or bad data on dotnet core?")]
+        [Ignore("TODO: System.ArgumentException Invalid or corrupted data on dotnet core linux?")]
         public void LoadSerialisedNetworkFromXml_ClassifiesAsExpected()
         {
             using (var res = GetResource("net-X-O-I.xml"))


More resharper using removals

More resharper using removals

--- Hearts/Factories/IFactory.cs
+++ Hearts/Factories/IFactory.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+
 namespace Hearts.Factories
 {
     public interface IFactory<out T>


#29 added MetadataHelper method that returns label of an attribute

--- Helpers/CrmMetadataHelper.cs
+++ Helpers/CrmMetadataHelper.cs
@@ -7,62 +7,77 @@

 namespace KpdApps.Common.MsCrm2015.Helpers
 {
-	public static class CrmMetadataHelper
-	{
-		private static List<EntityMetadata> _entities = new List<EntityMetadata>();
+    public static class CrmMetadataHelper
+    {
+        private static List<EntityMetadata> _entities = new List<EntityMetadata>();

-		private static readonly object Locker = new object();
+        private static readonly object Locker = new object();

-		public static EntityMetadata GetEntityMetadata(string entityName, IOrganizationService service)
-		{
-			lock (Locker)
-			{
-				if (_entities == null)
-					_entities = new List<EntityMetadata>();
-			}
+        public static EntityMetadata GetEntityMetadata(string entityName, IOrganizationService service)
+        {
+            lock (Locker)
+            {
+                if (_entities == null)
+                    _entities = new List<EntityMetadata>();
+            }

-			EntityMetadata metadata = _entities.FirstOrDefault(a => string.Compare(a.SchemaName, entityName, StringComparison.InvariantCultureIgnoreCase) == 0) ?? LoadEntityMetadata(entityName, service);
+            EntityMetadata metadata = _entities.FirstOrDefault(a => string.Compare(a.SchemaName, entityName, StringComparison.InvariantCultureIgnoreCase) == 0) ?? LoadEntityMetadata(entityName, service);

-			return metadata;
-		}
+            return metadata;
+        }

-		private static EntityMetadata LoadEntityMetadata(string entityName, IOrganizationService service)
-		{
-			lock (Locker)
-			{
-				RetrieveEntityRequest request = new RetrieveEntityRequest
-				{
-					LogicalName = entityName,
-					EntityFilters = EntityFilters.Entity | EntityFilters.Attributes
-				};
+        private static EntityMetadata LoadEntityMetadata(string entityName, IOrganizationService service)
+        {
+            lock (Locker)
+            {
+                RetrieveEntityRequest request = new RetrieveEntityRequest
+                {
+                    LogicalName = entityName,
+                    EntityFilters = EntityFilters.Entity | EntityFilters.Attributes
+                };

-				RetrieveEntityResponse metadata = (RetrieveEntityResponse)service.Execute(request);
+                RetrieveEntityResponse metadata = (RetrieveEntityResponse)service.Execute(request);

-				if (metadata.EntityMetadata == null)
-					return null;
+                if (metadata.EntityMetadata == null)
+                    return null;

-				_entities.Add(metadata.EntityMetadata);
-				return metadata.EntityMetadata;
-			}
-		}
+                _entities.Add(metadata.EntityMetadata);
+                return metadata.EntityMetadata;
+            }
+        }

-		public static string GetPickListLabel(string entityName, string fieldName, int value, IOrganizationService service)
-		{
-			RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest
-			{
-				EntityLogicalName = entityName,
-				LogicalName = fieldName,
-				RetrieveAsIfPublished = true
-			};
+        public static string GetPickListLabel(string entityName, string fieldName, int value, IOrganizationService service)
+        {
+            RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest
+            {
+                EntityLogicalName = entityName,
+                LogicalName = fieldName,
+                RetrieveAsIfPublished = true
+            };

-			RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(attributeRequest);
-			EnumAttributeMetadata attributeMetadata = (EnumAttributeMetadata)response.AttributeMetadata;
-			foreach (OptionMetadata optionMeta in attributeMetadata.OptionSet.Options)
-			{
-				if (optionMeta.Value == value)
-					return optionMeta.Label.UserLocalizedLabel.Label;
-			}
-			return string.Empty;
-		}
-	}
-}
+            RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(attributeRequest);
+            EnumAttributeMetadata attributeMetadata = (EnumAttributeMetadata)response.AttributeMetadata;
+            foreach (OptionMetadata optionMeta in attributeMetadata.OptionSet.Options)
+            {
+                if (optionMeta.Value == value)
+                    return optionMeta.Label.UserLocalizedLabel.Label;
+            }
+            return string.Empty;
+        }
+
+        public static string GetAttributeLabel(string entityName, string fieldName, int value, IOrganizationService service)
+        {
+            RetrieveAttributeRequest retrieveAttributeRequest = new RetrieveAttributeRequest
+            {
+                EntityLogicalName = entityName,
+                LogicalName = fieldName,
+                RetrieveAsIfPublished = true
+            };
+
+            RetrieveAttributeResponse retrieveAttributeResponse = (RetrieveAttributeResponse)service.Execute(retrieveAttributeRequest);
+            AttributeMetadata retrievedAttributeMetadata = (AttributeMetadata)retrieveAttributeResponse.AttributeMetadata;
+
+            return retrievedAttributeMetadata.DisplayName.UserLocalizedLabel.Label;
+        }
+    }
+}


fix text attachments

fix text attachments

--- Signum.Engine.Extensions/Mailing/Pop3/MailMimeParser.cs
+++ Signum.Engine.Extensions/Mailing/Pop3/MailMimeParser.cs
@@ -61,7 +61,7 @@
                 {
                     List<string> parts = SplitSubparts(reader, contentType.Boundary);

-
+
                     if (contentType.MediaType == "multipart/related")
                     {
                         var result = GetParts(parts[0], Request.AlternateView).ToList();
@@ -70,16 +70,16 @@

                         foreach (string item in parts.Skip(1))
                         {
-                            foreach (var part in GetParts(item, best == null ? Request.None: Request.LinkedResource))
+                            foreach (var part in GetParts(item, best == null ? Request.None : Request.LinkedResource))
                             {
                                 if (best != null && part is LinkedResource)
                                     best.LinkedResources.Add((LinkedResource)part);
                                 else
-                                    result.Add(best);
+                                    result.Add(best);
                             }
                         }

-                        return result;
+                        return result;
                     }
                     else
                     {
@@ -97,11 +97,16 @@
                 if (req == Request.LinkedResource)
                     return new List<AttachmentBase> { ParseAttachment(reader, contentTransferEncoding, contentType, headers, asLinkedResource: true) };

-                if (contentType.MediaType != null && contentType.MediaType.StartsWith("text/"))
+                if (contentType.MediaType != null && contentType.MediaType.StartsWith("text/") && !IsAttachment(headers["Content-Disposition"]))
                     return new List<AttachmentBase> { ParseTextView(reader, contentTransferEncoding, contentType) };

                 return new List<AttachmentBase> { ParseAttachment(reader, contentTransferEncoding, contentType, headers, asLinkedResource: false) };
             }
+        }
+
+        private static bool IsAttachment(string contentDisposition)
+        {
+            return contentDisposition.HasText() && contentDisposition.StartsWith("attachment", StringComparison.InvariantCultureIgnoreCase);
         }

         static NameValueCollection ReadHeaders(StringReader reader, NameValueCollection headers)


NetPropertyToken InSql

NetPropertyToken InSql

--- Signum.Entities/DynamicQuery/Tokens/NetPropertyToken.cs
+++ Signum.Entities/DynamicQuery/Tokens/NetPropertyToken.cs
@@ -53,11 +53,15 @@
             get { return PropertyInfo.Name; }
         }

+        public static MethodInfo miInSql = ReflectionTools.GetMethodInfo(() => (1).InSql()).GetGenericMethodDefinition();
+
         protected override Expression BuildExpressionInternal(BuildExpressionContext context)
         {
             var result = Parent.BuildExpression(context);

-            return Expression.Property(result.UnNullify(), PropertyInfo).Nullify();
+            var prop = Expression.Property(result.UnNullify(), PropertyInfo);
+
+            return Expression.Call(miInSql.MakeGenericMethod(prop.Type), prop).Nullify();
         }

         protected override List<QueryToken> SubTokensOverride(SubTokensOptions options)


add arguments support

add arguments support

--- SoundsRecord/win32/SoundsRecord/SoundsRecord/Program.cs
+++ SoundsRecord/win32/SoundsRecord/SoundsRecord/Program.cs
@@ -5,13 +5,21 @@
 using System;
 using CSCore.SoundIn;
 using CSCore.Codecs.WAV;
+using System.Threading;

 namespace SoundsRecord
 {
     class Program
     {
-        static void Main(string[] args)
+        static int Main(string[] args)
         {
+            if (args.Length == 0 || args[0] == "-h" || args[0] == "--help")
+            {
+                System.Console.WriteLine("Usage:");
+                System.Console.WriteLine("    SoundsRecord.exe <time/seconds> <output/wav>");
+                return 1;
+            }
+
             using (WasapiCapture capture = new WasapiLoopbackCapture())
             {

@@ -19,7 +27,7 @@
                 capture.Initialize();

                 //create a wavewriter to write the data to
-                using (WaveWriter w = new WaveWriter("dump.wav", capture.WaveFormat))
+                using (WaveWriter w = new WaveWriter(args[1], capture.WaveFormat))
                 {
                     //setup an eventhandler to receive the recorded data
                     capture.DataAvailable += (s, e) =>
@@ -31,12 +39,14 @@
                     //start recording
                     capture.Start();

-                    Console.ReadKey();
+                    //delay and keep recording
+                    Thread.Sleep(Int32.Parse(args[0]) * 1000);

                     //stop recording
                     capture.Stop();
                 }
             }
+            return 0;
         }
     }
 }


Add catchall support for ReceiveTalkDirect to EmoteManager (#3382)

--- Source/ACE.Server/WorldObjects/Managers/EmoteManager.cs
+++ Source/ACE.Server/WorldObjects/Managers/EmoteManager.cs
@@ -1438,7 +1438,7 @@
             var emoteSet = _worldObject.Biota.PropertiesEmote.Where(e => e.Category == category);

             // optional criteria
-            if (category == EmoteCategory.HearChat && questName != null)
+            if ((category == EmoteCategory.HearChat || category == EmoteCategory.ReceiveTalkDirect) && questName != null)
                 emoteSet = emoteSet.Where(e => e.Quest != null && e.Quest.Equals(questName, StringComparison.OrdinalIgnoreCase) || e.Quest == null);
             else if (questName != null)
                 emoteSet = emoteSet.Where(e => e.Quest != null && e.Quest.Equals(questName, StringComparison.OrdinalIgnoreCase));


Fix list section ordering bug

Fix list section ordering bug

Also changes the fields in the composite section class to be lazily initialized.

--- RockLib.Configuration/CompositeConfigurationSection.cs
+++ RockLib.Configuration/CompositeConfigurationSection.cs
@@ -8,50 +8,80 @@
 {
     internal class CompositeConfigurationSection : IConfigurationSection
     {
-        private readonly IReadOnlyCollection<IConfigurationSection> _allSections;
-        private readonly IConfigurationSection _primarySection;
+        private readonly Lazy<IReadOnlyCollection<IConfigurationSection>> _allSections;
+        private readonly Lazy<IConfigurationSection> _primarySection;
+        private readonly Lazy<IEnumerable<IConfigurationSection>> _children;

         public CompositeConfigurationSection(IEnumerable<IConfigurationSection> sections)
         {
-            _allSections = sections.ToList();
-            _primarySection = _allSections.FirstOrDefault(section => section.Value != null)
-                ?? _allSections.First();
+            _allSections = new Lazy<IReadOnlyCollection<IConfigurationSection>>(() => sections.ToList());
+
+            _primarySection = new Lazy<IConfigurationSection>(() => _allSections.Value.FirstOrDefault(section => section.Value != null)
+                ?? _allSections.Value.First());
+
+            _children = new Lazy<IEnumerable<IConfigurationSection>>(() =>
+                _allSections.Value.SelectMany(section => section.GetChildren())
+                    .GroupBy(s => s.Key, StringComparer.OrdinalIgnoreCase)
+                    .Select(s => new CompositeConfigurationSection(s))
+                    .OrderBy(s => s.Key, CompositeSectionKeyComparer.Instance)
+                    .ToList());
         }

         public IConfigurationSection GetSection(string key) =>
-            new CompositeConfigurationSection(_allSections.Select(s => s.GetSection(key)));
+            new CompositeConfigurationSection(_allSections.Value.Select(s => s.GetSection(key)));

-        public IEnumerable<IConfigurationSection> GetChildren() =>
-            _allSections.SelectMany(section => section.GetChildren())
-                .GroupBy(section => section.Key, StringComparer.OrdinalIgnoreCase)
-                .Select(sections => new CompositeConfigurationSection(sections));
+        public IEnumerable<IConfigurationSection> GetChildren() => _children.Value;

-        public IChangeToken GetReloadToken() => _primarySection.GetReloadToken();
+        public IChangeToken GetReloadToken() => _primarySection.Value.GetReloadToken();

         public string this[string key]
         {
-            get => _allSections.FirstOrDefault(s => s[key] != null)?[key];
+            get => _allSections.Value.FirstOrDefault(s => s[key] != null)?[key];
             set
             {
-                foreach (var section in _allSections)
+                foreach (var section in _allSections.Value)
                 {
                     if (section[key] == null)
                         continue;
                     section[key] = value;
                     return;
                 }
-                _primarySection[key] = value;
+                _primarySection.Value[key] = value;
             }
         }

-        public string Key => _primarySection.Key;
+        public string Key => _primarySection.Value.Key;

-        public string Path => _primarySection.Path;
+        public string Path => _primarySection.Value.Path;

         public string Value
         {
-            get => _primarySection.Value;
-            set => _primarySection.Value = value;
+            get => _primarySection.Value.Value;
+            set => _primarySection.Value.Value = value;
+        }
+
+        private class CompositeSectionKeyComparer : IComparer<string>
+        {
+            public static readonly IComparer<string> Instance = new CompositeSectionKeyComparer();
+
+            private CompositeSectionKeyComparer() {}
+
+            int IComparer<string>.Compare(string x, string y)
+            {
+                var xIsInt = uint.TryParse(x, out var xValue);
+                var yIsInt = uint.TryParse(y, out var yValue);
+
+                // Put numeric keys in ascending order.
+                if (xIsInt && yIsInt)
+                    return xValue.CompareTo(yValue);
+
+                // Put numeric keys before non-numeric keys.
+                if (xIsInt) return -1;
+                if (yIsInt) return 1;
+
+                // Do not change order when neither key is numeric.
+                return 0;
+            }
         }
     }
 }


TokenVisitor - FieldDeclList scope

TokenVisitor - FieldDeclList scope

--- Source/Devsense.PHP.Parser/Syntax/TreeContextVisitor.cs
+++ Source/Devsense.PHP.Parser/Syntax/TreeContextVisitor.cs
@@ -261,6 +261,7 @@
                 element is MethodDecl ||
                 element is LambdaFunctionExpr ||
                 element is CatchItem ||
+                element is FieldDeclList ||
                 element is FinallyItem;
         }


Fixed slider appearing for an instant while game is loading

--- Source/Engine/AGS.Engine/Game/Factories/AGSUIFactory.cs
+++ Source/Engine/AGS.Engine/Game/Factories/AGSUIFactory.cs
@@ -277,6 +277,7 @@

             TypedParameter idParam = new TypedParameter(typeof(string), id);
             ISlider slider = _resolver.Container.Resolve<ISlider>(idParam, idParam);
+            setParent(slider, parent);
             slider.Label = label;
             slider.MinValue = min;
             slider.MaxValue = max;
@@ -284,7 +285,6 @@
             slider.Graphics = graphics;
             slider.HandleGraphics = handle;
             slider.IgnoreViewport = true;
-            setParent(slider, parent);

             if (addToUi)
                 _gameState.UI.Add(slider);


Add documentation for string extensions.

--- Source/Lib/TraktApiSharp/Extensions/StringExtensions.cs
+++ Source/Lib/TraktApiSharp/Extensions/StringExtensions.cs
@@ -3,10 +3,15 @@
     using System;
     using System.Linq;

+    /// Provides helper methods for strings.
     public static class StringExtensions
     {
         private static readonly char[] DelimiterChars = { ' ', ',', '.', ':', ';', '\n', '\t' };

+        /// Converts the given string to a string, in which only the first letter is capitalized.
+        /// <param name="value">The string, in which only the first letter should be capitalized.</param>
+        /// <returns>A string, in which only the first letter is capitalized.</returns>
+        /// <exception cref="ArgumentException">Thrown, if the given string is null or empty.</exception>
         public static string FirstToUpper(this string value)
         {
             if (string.IsNullOrEmpty(value))
@@ -20,6 +25,9 @@
             return trimmedValue.ToUpper();
         }

+        /// Counts the words in a string.
+        /// <param name="value">The string, for which the words should be counted.</param>
+        /// <returns>The number of words in the given string or zero, if the given string is null or empty.</returns>
         public static int WordCount(this string value)
         {
             if (string.IsNullOrEmpty(value))
@@ -30,6 +38,9 @@
             return filteredWords.Count();
         }

+        /// Returns, whether the given string contains any spaces.
+        /// <param name="value">The string, which should be checked.</param>
+        /// <returns>True, if the given string contains any spaces, otherwise false.</returns>
         public static bool ContainsSpace(this string value)
         {
             return value.Contains(" ");


eDNA Adapters: Updated meta-data connection to also enable caching, when requested, with a unique cache name.

--- Source/Libraries/Adapters/eDNAAdapters/OutputAdapter.cs
+++ Source/Libraries/Adapters/eDNAAdapters/OutputAdapter.cs
@@ -204,7 +204,7 @@
         /// Gets or sets the filename to be used for point map cache.
         /// </summary>
         [ConnectionStringParameter]
-        [Description("Defines the path and filename to be used for the eDNA client API cache. Leave blank for cache name to target host working directory and be same as adapter name with a \"_eDNA.cache\" extension.")]
+        [Description("Defines the path and filename to be used for the eDNA client API cache. Leave blank for cache name to target host working directory and be same as adapter name extension.")]
         [DefaultValue(Default.LocalCacheFileName)]
         public string LocalCacheFileName { get; set; } = Default.LocalCacheFileName;

@@ -479,7 +479,7 @@
                 EnableCaching = setting.ParseBoolean();

             if (!settings.TryGetValue(nameof(LocalCacheFileName), out setting) || string.IsNullOrWhiteSpace(setting))
-                setting = $"{Name}_eDNA.cache";
+                setting = Name;

             LocalCacheFileName = FilePath.GetAbsolutePath(setting);

@@ -538,17 +538,18 @@
                 ExpandDigitalWordBits = setting.ParseBoolean();
         }

-        private int ConnectToDNAService(out uint connection, bool enableCache = false)
-        {
-            string cacheFileName = FilePath.GetFileName(LocalCacheFileName);
-            string cachePath = FilePath.GetDirectoryName(LocalCacheFileName);
-
-            int result = LinkMX.eDnaMxUniversalInitialize(out connection, AcknowledgeDataPackets, EnableQueuing, enableCache, int.MaxValue, cacheFileName, cachePath);
+        private int ConnectToDNAService(out uint connection, string cacheSuffix)
+        {
+            string fileName = $"{LocalCacheFileName}{cacheSuffix}";
+            string cacheFileName = FilePath.GetFileName(fileName);
+            string cachePath = FilePath.GetDirectoryName(fileName);
+
+            int result = LinkMX.eDnaMxUniversalInitialize(out connection, AcknowledgeDataPackets, EnableQueuing, EnableCaching, int.MaxValue, cacheFileName, cachePath);

             if (result != 0)
                 throw new EzDNAApiNetException($"Failed to initialize connection to eDNA Universal Service: {(LinkMXReturnStatus)result}", result);

-            if (enableCache && ClearCacheOnStartup)
+            if (EnableCaching && ClearCacheOnStartup)
             {
                 result = LinkMX.eDnaMxDeleteCacheFiles(connection);

@@ -567,7 +568,7 @@
             m_processedMeasurements = 0;

             // Initialize connection eDNA client API
-            int result = ConnectToDNAService(out m_connection, EnableCaching);
+            int result = ConnectToDNAService(out m_connection, "_eDNAData.cache");

             string connectionInfo = $"{PrimaryServer}:{PrimaryPort}{(string.IsNullOrWhiteSpace(SecondaryServer) ? "" : $" / {SecondaryServer}:{SecondaryPort}")}";

@@ -731,7 +732,7 @@
                 Dictionary<Guid, Metadata> metadataCache = QueryMetaDataForInputs(inputMeasurements, measurements);

                 // Connect to eDNA separately for meta-data refresh, this way meta-data refresh does not contend with time-series data updates
-                int result = ConnectToDNAService(out connection);
+                int result = ConnectToDNAService(out connection, "_eDNAMeta.cache");

                 if (result < 0 || result > 2)
                 {


eDNA Adapters: Updated socket level connection detection logic.

--- Source/Libraries/Adapters/eDNAAdapters/OutputAdapter.cs
+++ Source/Libraries/Adapters/eDNAAdapters/OutputAdapter.cs
@@ -1258,16 +1258,16 @@
                 // Verify connection is up at socket level, API is not always accurate
                 Func<string, IPAddress> parseIP = host => string.IsNullOrWhiteSpace(host) ? IPAddress.None : IPAddress.Parse(host);

-                IPAddress primary = parseIP(PrimaryServer);
-                IPAddress secondary = parseIP(SecondaryServer);
+                IPAddress primaryIP = parseIP(PrimaryServer);
+                IPAddress secondaryIP = parseIP(SecondaryServer);

                 Func<TcpConnectionInformation, IPAddress, int, bool> isEstablished = (connection, address, port) =>
                     connection.RemoteEndPoint.Address.Equals(address) &&
                     connection.RemoteEndPoint.Port == (int)port &&
                     connection.State == TcpState.Established;

-                reconnect = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections().Any(connection =>
-                    isEstablished(connection, primary, PrimaryPort) || isEstablished(connection, secondary, SecondaryPort));
+                reconnect = !IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections().Any(connection =>
+                    isEstablished(connection, primaryIP, PrimaryPort) || isEstablished(connection, secondaryIP, SecondaryPort));
             }

             if (reconnect)


compile error...

compile error...

--- Source/ReactiveProperty.Platform.Android/ListAdapter.cs
+++ Source/ReactiveProperty.Platform.Android/ListAdapter.cs
@@ -29,7 +29,7 @@
         public ListAdapter(IList<T> list, Func<int, T, View> createRowView, Action<int, T, View> setRowData, Func<int, T, long> getId = null)
         {
             if (list == null) { throw new ArgumentNullException(nameof(list)); }
-            if (createRowView == null) { throw new ArgumentNullException(nameof(createRowView); }
+            if (createRowView == null) { throw new ArgumentNullException(nameof(createRowView)); }
             if (setRowData == null) { throw new ArgumentNullException(nameof(setRowData)); }

             this.list = list;


Fixed Get-Module tests to work with PS

Fixed Get-Module tests to work with PS

--- Source/ReferenceTests/Commands/GetModuleCommandTests.cs
+++ Source/ReferenceTests/Commands/GetModuleCommandTests.cs
@@ -17,9 +17,9 @@
                 "Import-Module '" + mod +"'",
                 "Get-Module"
             ));
-            Assert.That(res, Is.Not.Empty);
-            var names = from r in res select (r.BaseObject as PSModuleInfo).Name;
-            Assert.That(names, Contains.Item(Path.GetFileNameWithoutExtension(mod)));
+            var modName = Path.GetFileNameWithoutExtension(mod);
+            Assert.That(res.Count, Is.EqualTo(1));
+            Assert.That((res[0].BaseObject as PSModuleInfo).Name, Is.EqualTo(modName));
         }

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

             var res = ReferenceHost.RawExecute(NewlineJoin(
                 "Import-Module '" + m1Path +"','" + m2Path + "'",
-                "Get-Module fooba"
+                "Get-Module fooba*"
             ));
             Assert.That(res.Count, Is.EqualTo(2));
             var names = from r in res select (r.BaseObject as PSModuleInfo).Name;
@@ -79,17 +79,20 @@
                 ReferenceHost.RawExecuteInLastRunspace("testfun");
             });

+            var innerModName = Path.GetFileNameWithoutExtension(innerMod);
+            var outerModName = Path.GetFileNameWithoutExtension(outerMod);
+
             // make sure innerMod is registered in outerMod, altough loaded in local scope
-            var innerModName = Path.GetFileNameWithoutExtension(innerMod);
             var res = ReferenceHost.RawExecuteInLastRunspace("getMT | % { $_.Name }");
-            Assert.That(res.Count, Is.EqualTo(1));
-            Assert.That(res[0].BaseObject, Is.EqualTo(innerModName));
+            Assert.That(res.Count, Is.EqualTo(2));
+            var modNames = from r in res select r.BaseObject;
+            Assert.That(modNames, Contains.Item(innerModName));
+            Assert.That(modNames, Contains.Item(innerModName));

             // make sure innerMod is *not* registered in global scope, as it's only loaded as a submodule
             res = ReferenceHost.RawExecuteInLastRunspace("Get-Module | % { $_.Name }");
-            var modNames = from r in res select r.BaseObject;
-            Assert.That(modNames, Contains.Item(Path.GetFileNameWithoutExtension(outerMod)));
-            Assert.That(modNames, Is.Not.Contains(innerModName));
+            Assert.That(res.Count, Is.EqualTo(1));
+            Assert.That(res[0].BaseObject, Is.EqualTo(outerModName));
         }

         [Test]
@@ -99,7 +102,7 @@
             var script = CreateFile("Import-Module '" + innerMod + "' -Global", "ps1");
             var outerMod = CreateFile(NewlineJoin(
                 "function getMT { Get-Module }",
-                "function execTest { test }",
+                "function execTest { testfun }",
                 " & '" + script + "'"
             ), "psm1");

@@ -115,15 +118,20 @@
             Assert.That(res.Count, Is.EqualTo(1));
             Assert.That(res[0].BaseObject, Is.EqualTo("foo"));

+            var innerModName = Path.GetFileNameWithoutExtension(innerMod);
+            var outerModName = Path.GetFileNameWithoutExtension(outerMod);
+
             // make sure innerMod is registered in outerMod
-            var innerModName = Path.GetFileNameWithoutExtension(innerMod);
             res = ReferenceHost.RawExecuteInLastRunspace("getMT | % { $_.Name }");
-            Assert.That(res.Count, Is.EqualTo(1));
-            Assert.That(res[0].BaseObject, Is.EqualTo(innerModName));
+            Assert.That(res.Count, Is.EqualTo(2));
+            var modNames = from r in res select r.BaseObject;
+            Assert.That(modNames, Contains.Item(innerModName));
+            Assert.That(modNames, Contains.Item(innerModName));

             // make sure innerMod is also registered in global scope
             res = ReferenceHost.RawExecuteInLastRunspace("Get-Module | % { $_.Name }");
-            var modNames = from r in res select r.BaseObject;
+            Assert.That(res.Count, Is.EqualTo(2));
+            modNames = from r in res select r.BaseObject;
             Assert.That(modNames, Contains.Item(Path.GetFileNameWithoutExtension(outerMod)));
             Assert.That(modNames, Contains.Item(innerModName));
         }


update version

update version

--- Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
+++ Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
@@ -13,5 +13,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-[assembly: AssemblyVersion("5.3.1.0")]
-[assembly: AssemblyFileVersion("5.3.1")]+[assembly: AssemblyVersion("5.3.2.0")]
+[assembly: AssemblyFileVersion("5.3.2")]


Add russian text test (custom output formatter)

--- HtmlSanitizer.Tests/Tests.cs
+++ HtmlSanitizer.Tests/Tests.cs
@@ -2149,6 +2149,22 @@
             Assert.That(sanitizer.Sanitize(html), Is.EqualTo(@"
Click here: http://example.com/.
").IgnoreCase);
             Assert.That(sanitizer.Sanitize("Check out www.google.com."), Is.EqualTo(@"Check out www.google.com.").IgnoreCase);
         }
+
+        [Test]
+        public void RussianTextTest()
+        {
+            // Arrange
+            var s = new HtmlSanitizer();
+
+            // Act
+            var htmlFragment = "Тест";
+            var outputFormatter = new CsQuery.Output.FormatDefault(DomRenderingOptions.RemoveComments | DomRenderingOptions.QuoteAllAttributes, HtmlEncoders.Minimum);
+            var actual = s.Sanitize(htmlFragment, "", outputFormatter);
+
+            // Assert
+            var expected = htmlFragment;
+            Assert.That(actual, Is.EqualTo(expected).IgnoreCase);
+        }
     }
 }


fixed a bug where testing stats where not reported properly

--- Tools/Testing/Tester/Testing/TestingProcessScheduler.cs
+++ Tools/Testing/Tester/Testing/TestingProcessScheduler.cs
@@ -103,15 +103,12 @@
                     {
                         if (testingProcess.Key != processId)
                         {
-                            if (this.Configuration.ReportCodeCoverage)
+                            this.StopTestingProcess(testingProcess.Key);
+
+                            TestReport testReport = this.GetTestReport(testingProcess.Key);
+                            if (testReport != null)
                             {
-                                this.StopTestingProcess(testingProcess.Key);
-
-                                TestReport testReport = this.GetTestReport(testingProcess.Key);
-                                if (testReport != null)
-                                {
-                                    this.TestReports.TryAdd(testingProcess.Key, testReport);
-                                }
+                                this.TestReports.TryAdd(testingProcess.Key, testReport);
                             }

                             try


Add unit tests

Add unit tests

--- UnitTestUsefullFunctions/UnitTestNumberOfOccurrences.cs
+++ UnitTestUsefullFunctions/UnitTestNumberOfOccurrences.cs
@@ -145,5 +145,35 @@
       int result = StringFunc.NumberOfOccurrences(source1, source2);
       Assert.AreEqual(result, expected);
     }
+
+    [TestMethod]
+    public void TestMethod_NumberOfOccurrences_brown_fox_a_1()
+    {
+      const string source1 = "a";
+      const string source2 = "The quick brown fox jumps over the lazy dog";
+      const int expected = 1;
+      int result = StringFunc.NumberOfOccurrences(source1, source2);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_NumberOfOccurrences_brown_fox_b_1()
+    {
+      const string source1 = "b";
+      const string source2 = "The quick brown fox jumps over the lazy dog";
+      const int expected = 1;
+      int result = StringFunc.NumberOfOccurrences(source1, source2);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_NumberOfOccurrences_brown_fox_c_1()
+    {
+      const string source1 = "c";
+      const string source2 = "The quick brown fox jumps over the lazy dog";
+      const int expected = 1;
+      int result = StringFunc.NumberOfOccurrences(source1, source2);
+      Assert.AreEqual(result, expected);
+    }
   }
 }


fix stuff

fix stuff

--- UnityProject/Assets/Scripts/UI/Net/Elements/NetLabel.cs
+++ UnityProject/Assets/Scripts/UI/Net/Elements/NetLabel.cs
@@ -41,7 +41,7 @@
 			}

 			externalChange = false;
-			OnSyncedValueChanged?.Invoke(Element.text);
+			OnSyncedValueChanged?.Invoke(value);
 		}
 	}


Fixes #40

Fixes #40

--- VirusTotal.NET/DateTimeParsers/YearMonthDayConverter.cs
+++ VirusTotal.NET/DateTimeParsers/YearMonthDayConverter.cs
@@ -9,11 +9,12 @@
     public class YearMonthDayConverter : DateTimeConverterBase
     {
         private readonly CultureInfo _culture = new CultureInfo("en-us");
-        private const string _dateFormatString = "yyyyMMdd";
+        private const string _newDateTimeFormat = "yyyyMMdd";
+        private const string _oldDateTimeFormat = "yyyyMMddHHmmss";

         public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
         {
-            writer.DateFormatString = _dateFormatString;
+            writer.DateFormatString = _newDateTimeFormat;
             writer.WriteValue(value);
         }

@@ -31,7 +32,12 @@
             if (value.Equals("-", StringComparison.OrdinalIgnoreCase))
                 return DateTime.MinValue;

-            if (DateTime.TryParseExact(value, _dateFormatString, _culture, DateTimeStyles.AllowWhiteSpaces, out DateTime result))
+            //New format
+            if (DateTime.TryParseExact(value, _newDateTimeFormat, _culture, DateTimeStyles.AllowWhiteSpaces, out DateTime result))
+                return result;
+
+            //Old format
+            if (DateTime.TryParseExact(value, _oldDateTimeFormat, _culture, DateTimeStyles.AllowWhiteSpaces, out result))
                 return result;

             throw new InvalidDateTimeException("Invalid date/time from VirusTotal. Tried to parse: " + value);


[Modify] 2021

[Modify] 2021

--- websocket-sharp/Server/WebSocketServiceHost.cs
+++ websocket-sharp/Server/WebSocketServiceHost.cs
@@ -4,7 +4,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2012-2017 sta.blockhead
+ * Copyright (c) 2012-2021 sta.blockhead
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal


Adds the initialize function to its own report group, so that it's obvious when an emitter is missing the initialize function.

--- ProjectHekate.Scripting/BulletGrammar.cs
+++ ProjectHekate.Scripting/BulletGrammar.cs
@@ -155,7 +155,7 @@
             AddTermsReportGroup("type declaration", "emitter", "state");
             AddTermsReportGroup("constant", number, stringLiteral, charLiteral);
             AddTermsReportGroup("constant", "true", "false", "null");
-
+            AddTermsReportGroup("initialize", "Initialize");
             AddTermsReportGroup("unary operator", "+", "-", "!", "~");

             AddToNoReportGroup(comma, semi);


Remove redundant codes

Remove redundant codes


Adds methos stub for changed composition scale

--- Samples/Win81/MiniCubeXaml/Direct3DUserControl.xaml.cs
+++ Samples/Win81/MiniCubeXaml/Direct3DUserControl.xaml.cs
@@ -92,6 +92,12 @@
             CompositionTargetEx.Rendering += CompositionTarget_Rendering;

             this.LayoutUpdated += Direct3DUserControl_LayoutUpdated;
+            this.CompositionScaleChanged += Direct3DUserControl_CompositionScaleChanged;
+        }
+
+        void Direct3DUserControl_CompositionScaleChanged(SwapChainPanel sender, object args)
+        {
+            //TODO: handle changed composition scale
         }

         void Direct3DUserControl_LayoutUpdated(object sender, object e)


#227 Also apply optimizations to federated Exists filter

--- RDFSharp/Query/Mirella/RDFQueryEngine.cs
+++ RDFSharp/Query/Mirella/RDFQueryEngine.cs
@@ -311,15 +311,8 @@
                     existsFilterResultsTable.ExtendedProperties.Add("IsOptional", false);
                     existsFilterResultsTable.ExtendedProperties.Add("JoinAsUnion", false);

-                    //Initialize result datatable if needed
-                    if (existsFilter.PatternResults == null)
-                        existsFilter.PatternResults = existsFilterResultsTable.Clone();
-
-                    //Assign result datatable (federation merges data)
-                    if (dataSource.IsFederation())
-                        existsFilter.PatternResults.Merge(existsFilterResultsTable, true, MissingSchemaAction.Add);
-                    else
-                        existsFilter.PatternResults = existsFilterResultsTable;
+                    //Save result datatable (directly into the filter)
+                    existsFilter.PatternResults = existsFilterResultsTable;
                 }
                 #endregion
             }


CMF1-1266 Fixed formatting

CMF1-1266 Fixed formatting

--- Sdl.Web.Tridion.Templates/Templates/PublishMappings.cs
+++ Sdl.Web.Tridion.Templates/Templates/PublishMappings.cs
@@ -228,6 +228,7 @@
                 MaxOccurs = -1
             };
         }
+
         private Binary PublishXpmRegionConfiguration(StructureGroup structureGroup, Component relatedComponent)
         {
             IDictionary<string, XpmRegionData> xpmRegions = new Dictionary<string, XpmRegionData>();


FIX typo in describe evaluation

FIX typo in describe evaluation

--- RDFSharp/Query/Mirella/RDFQueryEngine.cs
+++ RDFSharp/Query/Mirella/RDFQueryEngine.cs
@@ -1196,7 +1196,7 @@
                                     {
                                         //Create SELECT query to describe term
                                         RDFSelectQuery selectQuery =
-                                            dt is RDFResource
+                                            term is RDFResource
                                                 ? new RDFSelectQuery()
                                                     .AddPatternGroup(new RDFPatternGroup("DESCRIBE_RESULTS")
                                                         .AddPattern(new RDFPattern((RDFResource)term, new RDFVariable("PREDICATE"), new RDFVariable("OBJECT")).UnionWithNext())
@@ -1218,7 +1218,7 @@
                                     {
                                         //Create SELECT query to describe term
                                         RDFSelectQuery selectQuery =
-                                            dt is RDFResource
+                                            term is RDFResource
                                                 ? new RDFSelectQuery()
                                                     .AddPatternGroup(new RDFPatternGroup("DESCRIBE_RESULTS")
                                                         .AddPattern(new RDFPattern((RDFResource)term, new RDFVariable("PREDICATE"), new RDFVariable("OBJECT")).UnionWithNext())


CandleBuilderMessageAdapter. Fix handling unsubscription responses.

--- Algo/Candles/Compression/CandleBuilderMessageAdapter.cs
+++ Algo/Candles/Compression/CandleBuilderMessageAdapter.cs
@@ -94,6 +94,7 @@

 		private readonly SynchronizedDictionary<long, SeriesInfo> _seriesByTransactionId = new SynchronizedDictionary<long, SeriesInfo>();
 		private readonly SynchronizedDictionary<SecurityId, SynchronizedList<SeriesInfo>> _seriesBySecurityId = new SynchronizedDictionary<SecurityId, SynchronizedList<SeriesInfo>>();
+		private readonly SynchronizedSet<long> _unsubscriptions = new SynchronizedSet<long>();
 		private readonly CandleBuildersList _candleBuilders;
 		private readonly IExchangeInfoProvider _exchangeInfoProvider;

@@ -135,6 +136,7 @@
 				case MessageTypes.Reset:
 					_seriesByTransactionId.Clear();
 					_seriesBySecurityId.Clear();
+					_unsubscriptions.Clear();
 					break;

 				case MessageTypes.MarketData:
@@ -222,18 +224,24 @@
 						{
 							RemoveSeries(series);

+							RaiseNewOutMessage(new MarketDataMessage
+							{
+								OriginalTransactionId = mdMsg.TransactionId,
+							});
+
+							var transactionId = TransactionIdGenerator.GetNextId();
+
+							_unsubscriptions.Add(transactionId);
+
 							base.SendInMessage(new MarketDataMessage
 							{
-								TransactionId = TransactionIdGenerator.GetNextId(),
+								TransactionId = transactionId,
 								OriginalTransactionId = series.Current.TransactionId,
 								IsSubscribe = false,
 								SecurityId = series.Current.SecurityId,
 							});

-							RaiseNewOutMessage(new MarketDataMessage
-							{
-								OriginalTransactionId = mdMsg.TransactionId,
-							});
+
 							return;
 						}

@@ -462,6 +470,9 @@

 		private bool ProcessMarketDataResponse(MarketDataMessage message)
 		{
+			if (_unsubscriptions.Remove(message.OriginalTransactionId))
+				return true;
+
 			if (!_seriesByTransactionId.TryGetValue(message.OriginalTransactionId, out var series))
 				return false;

@@ -512,10 +523,11 @@
 				{
 					if (original.AllowBuildFromSmallerTimeFrame)
 					{
-						var smaller = InnerAdapter.TimeFrames
-						                          .FilterSmallerTimeFrames((TimeSpan)original.Arg)
-						                          .OrderByDescending()
-						                          .FirstOr();
+						var smaller = InnerAdapter
+										.TimeFrames
+						                .FilterSmallerTimeFrames((TimeSpan)original.Arg)
+						                .OrderByDescending()
+						                .FirstOr();

 						if (smaller != null)
 						{