fixed tests

fixed tests

--- tests/TestUtility/TestHelpers.cs
+++ tests/TestUtility/TestHelpers.cs
@@ -24,7 +24,7 @@
         {
             var references = GetReferences();
             var scriptHelper = new ScriptProjectProvider(new ScriptOptions(), new OmniSharpEnvironment(), new LoggerFactory(), true);
-            var project = scriptHelper.CreateProject(testFile.FileName, references.Union(new[] { MetadataReference.CreateFromFile(typeof(CommandLineScriptGlobals).GetTypeInfo().Assembly.Location) }), testFile.FileName, Enumerable.Empty<string>());
+            var project = scriptHelper.CreateProject(testFile.FileName, references.Union(new[] { MetadataReference.CreateFromFile(typeof(CommandLineScriptGlobals).GetTypeInfo().Assembly.Location) }), testFile.FileName, typeof(CommandLineScriptGlobals), Enumerable.Empty<string>());
             workspace.AddProject(project);

             var documentInfo = DocumentInfo.Create(


fix bug, when different editor was considered to be Rider

--- resharper/src/resharper-unity/Unity3dRider/Assets/Plugins/Editor/JetBrains/RiderPlugin.cs
+++ resharper/src/resharper-unity/Unity3dRider/Assets/Plugins/Editor/JetBrains/RiderPlugin.cs
@@ -23,8 +23,7 @@
     private static string GetDefaultApp()
     {
         var alreadySetPath = GetExternalScriptEditor();
-        if (!string.IsNullOrEmpty(alreadySetPath) && alreadySetPath.ToLower().Contains("rider") &&
-            RiderPathExist(alreadySetPath))
+        if (!string.IsNullOrEmpty(alreadySetPath) && RiderPathExist(alreadySetPath))
           return alreadySetPath;

         switch (SystemInfoRiderPlugin.operatingSystemFamily)
@@ -145,6 +144,8 @@
         return false;
       // windows or mac
       var fileInfo = new FileInfo(path);
+      if (!fileInfo.Name.ToLower().Contains("rider"))
+        return false;
       var directoryInfo = new DirectoryInfo(path);
       return fileInfo.Exists || (SystemInfoRiderPlugin.operatingSystemFamily==OperatingSystemFamily.MacOSX && directoryInfo.Exists);
     }


do not call AddMvc() twice

do not call AddMvc() twice

--- TempyAPI/Startup.cs
+++ TempyAPI/Startup.cs
@@ -19,11 +19,11 @@
         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
         {
-            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
+            services.AddMvc(option => option.EnableEndpointRouting = false).SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
             var cosmosDbAuthSettings = new TempyDbAuthCredentials();
             Configuration.Bind("CosmosDbAuthSettings", cosmosDbAuthSettings);
             services.AddSingleton(cosmosDbAuthSettings);
-            services.AddMvc(option => option.EnableEndpointRouting = false);
+            //services.AddMvc(option => option.EnableEndpointRouting = false);
             // add a policy to allow CORS requests from any origins,
             // this will be used for remote Javascript to fetch TempyAPI data
             services.AddCors(


Tweak

Tweak

--- scr/SoundPlayer.cs
+++ scr/SoundPlayer.cs
@@ -132,18 +132,7 @@
                 using (Stream stream = getWaveStream())
                 using (WaveStream wave = new WaveStream(stream))
                 {
-                    SoundBufferDescription description = new SoundBufferDescription
-                    {
-                        SizeInBytes = (int)wave.Length,
-                        Flags = BufferFlags.ControlVolume,
-                        Format = wave.Format,
-                    };
-
-                    buffer = new SecondarySoundBuffer(dSound, description);
-                    byte[] data = new byte[description.SizeInBytes];
-                    wave.Read(data, 0, description.SizeInBytes);
-                    buffer.Write(data, 0, LockFlags.None);
-                    cache[id] = buffer;
+                    buffer = CreateBuffer(id, wave);
                 }
             }

@@ -159,18 +148,7 @@
                 {
                     using (WaveStream wave = new WaveStream(path))
                     {
-                        SoundBufferDescription description = new SoundBufferDescription
-                        {
-                            SizeInBytes = (int)wave.Length,
-                            Flags = BufferFlags.ControlVolume,
-                            Format = wave.Format,
-                        };
-
-                        buffer = new SecondarySoundBuffer(dSound, description);
-                        byte[] data = new byte[description.SizeInBytes];
-                        wave.Read(data, 0, description.SizeInBytes);
-                        buffer.Write(data, 0, LockFlags.None);
-                        cache[id] = buffer;
+                        buffer = CreateBuffer(id, wave);
                     }
                 }
                 else
@@ -186,6 +164,23 @@
         {
             buffer.Volume = (int)((1.0f - volume) * -4000.0f);
             buffer.Play(0, loop ? PlayFlags.Looping : PlayFlags.None);
+        }
+
+        private SecondarySoundBuffer CreateBuffer(string id, WaveStream wave)
+        {
+            SoundBufferDescription description = new SoundBufferDescription
+            {
+                SizeInBytes = (int)wave.Length,
+                Flags = BufferFlags.ControlVolume,
+                Format = wave.Format,
+            };
+
+            SecondarySoundBuffer buffer = new SecondarySoundBuffer(dSound, description);
+            byte[] data = new byte[description.SizeInBytes];
+            wave.Read(data, 0, description.SizeInBytes);
+            buffer.Write(data, 0, LockFlags.None);
+            cache[id] = buffer;
+            return buffer;
         }

         public void Stop(string id)


New repositories

New repositories

--- Tests/Experiment.cs
+++ Tests/Experiment.cs
@@ -31,9 +31,14 @@
                 new Repository("dotnet", "MiniProfiler", "MiniProfiler.sln"),
                 new Repository("SparkleShare", "hbons", @"SparkleShare\Windows\SparkleShare.sln"),
                 new Repository("ShareX", "ShareX", "ShareX.sln"),
+                new Repository("Nancy", "NancyFX", "Nancy.sln"),
+                new Repository("AutoMapper", "AutoMapper", @"src\AutoMapper.sln"),
+                // new Repository("RestSharp", "restsharp", "RestSharp.sln"), // Missing Xamarin
+                // new Repository("Ninject", "ninject", "Ninject.sln"), // Missing Xamarin
+                new Repository("EntityFramework", "aspnet", @"EntityFramework.sln"),
             }.ToDictionary(x => x.Name, x => x);

-        private string currentRepoToTest = "ShareX";
+        private string currentRepoToTest = "EntityFramework";

         // Data we now for sure is correct and has been parsed after all parse related bugs where resolved
         private readonly IEnumerable<string> _availibleParsedData = new List<string>()
@@ -47,6 +52,9 @@
             "dotnet",
             "SparkleShare",
             "ShareX",
+            "Nancy",
+            "AutoMapper",
+            "EntityFramework",
         };

         // TESTS


Commited missing changrs from yesterday

Commited missing changrs from yesterday

--- TextFungeProject.cs
+++ TextFungeProject.cs
@@ -1,5 +1,5 @@
-using BefunGen.AST.CodeGen;
-using BefungExec.Logic;
+using BefunExec.Logic;
+using BefunGen.AST.CodeGen;
 using System.Collections.Generic;

 namespace BefunWrite


Added AddUserSession extension method (#4026)

--- src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs
+++ src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs
@@ -403,5 +403,21 @@

             return builder;
         }
+
+        /// <summary>
+        /// Adds a custom user session.
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="builder">The builder.</param>
+        /// <returns></returns>
+        public static IIdentityServerBuilder AddUserSession<T>(this IIdentityServerBuilder builder)
+            where T : class, IUserSession
+        {
+            // This is added as scoped due to the note regarding the AuthenticateAsync
+            // method in the IdentityServer4.Services.DefaultUserSession implementation.
+            builder.Services.AddScoped<IUserSession, T>();
+
+            return builder;
+        }
     }
 }


Missing change

Missing change

--- src/LogoFX.Client.Bootstrapping.Adapters.SimpleContainer/net45/Properties/AssemblyInfo.cs
+++ src/LogoFX.Client.Bootstrapping.Adapters.SimpleContainer/net45/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.2.0")]
+[assembly: AssemblyFileVersion("1.2.0")]


Vector2: Implement IEquatable<Vector2>

Vector2: Implement IEquatable<Vector2>

--- UnitsNet/Vector2.cs
+++ UnitsNet/Vector2.cs
@@ -19,11 +19,12 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.

+using System;
 using System.Collections.Generic;

 namespace UnitsNet
 {
-    public struct Vector2
+    public struct Vector2 : IEquatable<Vector2>
     {
         public readonly double X;
         public readonly double Y;
@@ -42,11 +43,11 @@

         #region Equality

-        public static IEqualityComparer<Vector2> XyComparer { get; } = new XyEqualityComparer();
+        private static IEqualityComparer<Vector2> XyComparer { get; } = new XyEqualityComparer();

         public bool Equals(Vector2 other)
         {
-            return X.Equals(other.X) && Y.Equals(other.Y);
+            return XyComparer.Equals(this, other);
         }

         public static bool operator !=(Vector2 left, Vector2 right)


Workaround for #31381, which seems to be causing duplicate diagnostics being passed to FixAll

--- src/Workspaces/Core/Portable/CodeFixes/SyntaxEditorBasedCodeFixProvider.FixAllProvider.cs
+++ src/Workspaces/Core/Portable/CodeFixes/SyntaxEditorBasedCodeFixProvider.FixAllProvider.cs
@@ -64,7 +64,10 @@
                 // Ensure that diagnostics for this document are always in document location
                 // order.  This provides a consistent and deterministic order for fixers
                 // that want to update a document.
-                var filteredDiagnostics = diagnostics.WhereAsArray(d => _codeFixProvider.IncludeDiagnosticDuringFixAll(fixAllState, d, cancellationToken))
+                // Also ensure that we do not pass in duplicates by invoking Distinct.
+                // See https://github.com/dotnet/roslyn/issues/31381, that seems to be causing duplicate diagnostics.
+                var filteredDiagnostics = diagnostics.Distinct()
+                                                     .WhereAsArray(d => _codeFixProvider.IncludeDiagnosticDuringFixAll(fixAllState, d, cancellationToken))
                                                      .Sort((d1, d2) => d1.Location.SourceSpan.Start - d2.Location.SourceSpan.Start);

                 // PERF: Do not invoke FixAllAsync on the code fix provider if there are no diagnostics to be fixed.


fixed migration

fixed migration

--- Infrastructure.DataAccess/Migrations/202209091039005_add_itcontract_read_model.Designer.cs
+++ Infrastructure.DataAccess/Migrations/202209091039005_add_itcontract_read_model.Designer.cs
@@ -1,7 +1,4 @@
 // <auto-generated />
-
-using Infrastructure.DataAccess.Migrations;
-
 namespace Infrastructure.DataAccess.Migrations
 {
     using System.CodeDom.Compiler;
@@ -10,9 +7,9 @@
     using System.Resources;

     [GeneratedCode("EntityFramework.Migrations", "6.4.4")]
-    public sealed partial class RemovedHasMainContract : IMigrationMetadata
+    public sealed partial class add_itcontract_read_model : IMigrationMetadata
     {
-        private readonly ResourceManager Resources = new ResourceManager(typeof(RemovedHasMainContract));
+        private readonly ResourceManager Resources = new ResourceManager(typeof(add_itcontract_read_model));

         string IMigrationMetadata.Id
         {


changes.

changes.

--- test/TWCore.Test.Core/Program.cs
+++ test/TWCore.Test.Core/Program.cs
@@ -2,12 +2,14 @@
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net.Sockets;
 using System.Threading;
 using System.Threading.Tasks;
 using TWCore.Collections;
 using TWCore.Diagnostics.Status.Transports;
 using TWCore.Injector;
 using TWCore.Net.Multicast;
+using TWCore.Serialization;
 using TWCore.Services;
 using TWCore.Threading;

@@ -77,5 +79,14 @@
                 TWCore.Core.Log.InfoBasic("FINALIZING TEST SERVICE");
             }
         }
+
+        public class RpcClient
+        {
+            private TcpClient _client;
+            private BinarySerializer _serializer;
+            private bool _shouldBeConnected;
+
+
+        }
     }
 }


Added some spaces.

Added some spaces.

--- Source/SharpBattleNet.Framework.Networking/Connection/TCP/Details/ListenerTCPConnection.cs
+++ Source/SharpBattleNet.Framework.Networking/Connection/TCP/Details/ListenerTCPConnection.cs
@@ -43,6 +43,7 @@
     internal sealed class ListenerTCPConnection : TCPConnectionBase, IListenerTCPConnection
     {
         private readonly Logger _logger = LogManager.GetCurrentClassLogger();
+
         private readonly ISocketEventPool _socketEventBag = null;

         public ListenerTCPConnection(ISocketEventPool socketEventBag)


changes from v1.3.5 for api clients

changes from v1.3.5 for api clients

--- src/Api/IdentityServer/Clients.cs
+++ src/Api/IdentityServer/Clients.cs
@@ -9,22 +9,30 @@
         {
             return new List<Client>
             {
-                new ApiClient("mobile"),
-                new ApiClient("web"),
-                new ApiClient("browser"),
-                new ApiClient("desktop")
+                new ApiClient("mobile", 90, 1),
+                new ApiClient("web", 1, 1),
+                new ApiClient("browser", 30, 1),
+                new ApiClient("desktop", 30, 1)
             };
         }

         public class ApiClient : Client
         {
-            public ApiClient(string id, string[] additionalScopes = null)
+            public ApiClient(
+                string id,
+                int refreshTokenSlidingDays,
+                int accessTokenLifetimeHours,
+                string[] additionalScopes = null)
             {
                 ClientId = id;
                 RequireClientSecret = false;
                 AllowedGrantTypes = GrantTypes.ResourceOwnerPassword;
+                RefreshTokenExpiration = TokenExpiration.Sliding;
+                RefreshTokenUsage = TokenUsage.ReUse;
+                SlidingRefreshTokenLifetime = 86400 * refreshTokenSlidingDays;
+                AbsoluteRefreshTokenLifetime = int.MaxValue; // forever
                 UpdateAccessTokenClaimsOnRefresh = true;
-                AccessTokenLifetime = 60 * 60; // 1 hour
+                AccessTokenLifetime = 3600 * accessTokenLifetimeHours;
                 AllowOfflineAccess = true;

                 var scopes = new List<string> { "api" };


tz id for linux vs windows

tz id for linux vs windows

--- src/Billing/Utilities/PayPalIpnClient.cs
+++ src/Billing/Utilities/PayPalIpnClient.cs
@@ -3,6 +3,7 @@
 using System.Globalization;
 using System.Linq;
 using System.Net.Http;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading.Tasks;
 using System.Web;
@@ -165,8 +166,10 @@
                         CultureInfo.InvariantCulture, DateTimeStyles.None, out var paymentDate);
                     if(parsed)
                     {
-                        return TimeZoneInfo.ConvertTimeToUtc(paymentDate,
-                            TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"));
+                        var pacificTime = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
+                            TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time") :
+                            TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
+                        return TimeZoneInfo.ConvertTimeToUtc(paymentDate, pacificTime);
                     }
                 }
                 return default(DateTime);


don't show duplicate entries in dialog

don't show duplicate entries in dialog

git-svn-id: ee144a4ada4e65570a65b3ba2a4ac9d4eedc8fa4@1453744 13f79535-47bb-0310-9956-ffa450edef68

--- dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/PomConverter.cs
+++ dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/PomConverter.cs
@@ -331,7 +331,12 @@
                converter.ConvertProjectToPomModel(scmTag);

                missingReferences.AddRange(converter.GetMissingReferences());
-               nonPortableReferences.AddRange(converter.GetNonPortableReferences());
+
+               foreach (string s in converter.GetNonPortableReferences())
+               {
+                   if (!nonPortableReferences.Contains(s))
+                       nonPortableReferences.Add(s);
+               }

                return converter.Model;
            }


Update Form1.cs

Update Form1.cs

Fixed so it opens new game

--- SMG/SMG/Form1.cs
+++ SMG/SMG/Form1.cs
@@ -167,5 +167,41 @@
         {
             Console.WriteLine("Japanese was selected");
         }
+
+        /// <summary>
+        /// Brandon McCutcheon
+        /// closes the program
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_Quit_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+
+        /// <summary>
+        /// Load Game
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_load_Click(object sender, EventArgs e)
+        {
+
+        }
+        /// <summary>
+        /// Start new game
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnNewGame_Click(object sender, EventArgs e)
+        {
+            //code to open StartScreen Form
+            startScreen f = new startScreen();
+            DialogResult dr = f.ShowDialog();
+            if (dr == System.Windows.Forms.DialogResult.OK)
+            {
+                //code to handle if you come back to this.
+            }
+        }
     }
 }


CreateUserlessFoursquareContext

CreateUserlessFoursquareContext

--- src/BonVoyage/BonVoyageContext.cs
+++ src/BonVoyage/BonVoyageContext.cs
@@ -27,6 +27,16 @@
             return new FoursquareContext(_handler, accessToken);
         }

+        public FoursquareUserlessContext CreateUserlessFoursquareContext(UserlessAccessSettings settings)
+        {
+            if (settings == null)
+            {
+                throw new ArgumentNullException(nameof(settings));
+            }
+
+            return new FoursquareUserlessContext(_handler, settings);
+        }
+
         public void Dispose()
         {
             _handler?.Dispose();


saludo al mundo

saludo al mundo

--- ejercitacion1/ejercitacion1/Program.cs
+++ ejercitacion1/ejercitacion1/Program.cs
@@ -9,6 +9,8 @@
     {
         static void Main(string[] args)
         {
+            Console.WriteLine("hola mundo");
+            Console.ReadLine();
         }
     }
 }


Ignore all STL collections for now.

Ignore all STL collections for now.

--- src/Generator/Types/Std/Stdlib.cs
+++ src/Generator/Types/Std/Stdlib.cs
@@ -50,6 +50,8 @@
     [TypeMap("std::vector")]
     public class Vector : TypeMap
     {
+        public override bool IsIgnored { get { return true; } }
+
         public override string Signature()
         {
             var type = Type as TemplateSpecializationType;
@@ -71,6 +73,8 @@
     [TypeMap("std::map")]
     public class Map : TypeMap
     {
+        public override bool IsIgnored { get { return true; } }
+
         public override string Signature()
         {
             var type = Type as TemplateSpecializationType;
@@ -88,6 +92,12 @@
         {
             throw new System.NotImplementedException();
         }
+    }
+
+    [TypeMap("std::list")]
+    public class List : TypeMap
+    {
+        public override bool IsIgnored { get { return true; } }
     }

     [TypeMap("std::shared_ptr")]


Improvements to standard library interop support.

--- src/Generator/Types/Std/Stdlib.cs
+++ src/Generator/Types/Std/Stdlib.cs
@@ -34,17 +34,19 @@

         public override string CSharpSignature(CSharpTypePrinterContext ctx)
         {
-            return "string";
+            if (ctx.CSharpKind == CSharpTypePrinterContextKind.ManagedPointer)
+                return "System.IntPtr";
+            return "Std.String";
         }

         public override void CSharpMarshalToNative(MarshalContext ctx)
         {
-            ctx.Return.Write("StringToPtr");
+            ctx.Return.Write("new Std.String().Instance");
         }

         public override void CSharpMarshalToManaged(MarshalContext ctx)
         {
-            ctx.Return.Write("PtrToString");
+            ctx.Return.Write("new Std.String({0})", ctx.ReturnVarName);
         }
     }

@@ -58,12 +60,12 @@

         public override void CLIMarshalToNative(MarshalContext ctx)
         {
-            ctx.Return.Write("marshalString<E_UTF16>({0})", ctx.Parameter.Name);
-        }
-
-        public override void CLIMarshalToManaged(MarshalContext ctx)
-        {
-            ctx.Return.Write("marshalString<E_UTF16>({0})", ctx.ReturnVarName);
+            ctx.Return.Write("clix::marshalString<clix::E_UTF16>({0})", ctx.Parameter.Name);
+        }
+
+        public override void CLIMarshalToManaged(MarshalContext ctx)
+        {
+            ctx.Return.Write("clix::marshalString<clix::E_UTF16>({0})", ctx.ReturnVarName);
         }

         public override string CSharpSignature(CSharpTypePrinterContext ctx)
@@ -144,7 +146,8 @@
             var type = templateType.Arguments[0].Type;
             var tmpVarName = "_tmp" + ctx.ArgName;

-            ctx.SupportBefore.WriteLine("auto {0} = gcnew System::Collections::Generic::List<{1}>();", tmpVarName, type.ToString());
+            ctx.SupportBefore.WriteLine("auto {0} = gcnew System::Collections::Generic::List<{1}>();",
+                tmpVarName, type.ToString());
             ctx.SupportBefore.WriteLine("for(auto _element : {0})",ctx.ReturnVarName);
             ctx.SupportBefore.WriteStartBraceIndent();
             {
@@ -171,17 +174,18 @@

         public override string CSharpSignature(CSharpTypePrinterContext ctx)
         {
-            return string.Format("System.Collections.Generic.List<>");
+            return string.Format("System.Collections.Generic.List<{0}>",
+                ctx.GetTemplateParameterList());
         }

         public override void CSharpMarshalToNative(MarshalContext ctx)
         {
-            ctx.Return.Write("StringToPtr");
+            ctx.Return.Write("null");
         }

         public override void CSharpMarshalToManaged(MarshalContext ctx)
         {
-            ctx.Return.Write("PtrToString");
+            ctx.Return.Write("null");
         }
     }


Fix config.Root calculation (#199)

Fix config.Root calculation (#199)

* Fix config internal Fallback mutation

* Use fallback values of fallback configs

* Made config fully build on creation, and less mutable

* Config root calculation fix - use Value instead of Root from children

* Refactoring

* Added a comment

--- src/Hocon.Configuration/Config.cs
+++ src/Hocon.Configuration/Config.cs
@@ -18,22 +18,32 @@
     /// </summary>
     public class Config : HoconRoot
     {
+        [Obsolete("For json serialization/deserialization only", true)]
+        private Config()
+        {
+        }
+
         /// <inheritdoc />
         /// <summary>
         ///     Initializes a new instance of the <see cref="Config" /> class.
         /// </summary>
-        private Config()
-        {
-        }
-
-        /// <inheritdoc cref="Config()" />
+        private Config(HoconValue value, Config fallback)
+        {
+            Fallback = fallback;
+            Value = value;
+
+            Root = GetRootValue();
+        }
+
+        /// <inheritdoc cref="Config(HoconValue, Config)" />
         /// <param name="root">The root node to base this configuration.</param>
         /// <exception cref="T:System.ArgumentNullException">"The root value cannot be null."</exception>
         public Config(HoconRoot root) : base(root?.Value, root?.Substitutions ?? Enumerable.Empty<HoconSubstitution>())
         {
-        }
-
-        /// <inheritdoc cref="Config()" />
+            Root = GetRootValue();
+        }
+
+        /// <inheritdoc cref="Config(HoconValue, Config)" />
         /// <param name="source">The configuration to use as the primary source.</param>
         /// <param name="fallback">The configuration to use as a secondary source.</param>
         /// <exception cref="ArgumentNullException">The source configuration cannot be null.</exception>
@@ -41,6 +51,8 @@
             source?.Substitutions ?? Enumerable.Empty<HoconSubstitution>())
         {
             Fallback = fallback;
+
+            Root = GetRootValue();
         }

         /// <summary>
@@ -54,27 +66,12 @@
         /// <summary>
         ///     The configuration used as a secondary source.
         /// </summary>
-        public Config Fallback { get; private set; }
+        public Config Fallback { get; }

         /// <summary>
         ///     The root node of this configuration section
         /// </summary>
-        public virtual HoconValue Root
-        {
-            get
-            {
-                var elements = new List<IHoconElement>();
-                for (var config = this; config != null; config = config.Fallback?.Copy())
-                {
-                    elements.AddRange(config.Value);
-                }
-
-                var aggregated = new HoconValue(null);
-                aggregated.AddRange(elements.AsEnumerable().Reverse());
-
-                return aggregated;
-            }
-        }
+        public virtual HoconValue Root { get; }

         /// <summary>
         ///     Returns string representation of <see cref="Config" />, allowing to include fallback values
@@ -95,11 +92,7 @@
         protected Config Copy()
         {
             //deep clone
-            return new Config
-            {
-                Fallback = Fallback?.Copy(),
-                Value = (HoconValue) Value.Clone(null)
-            };
+            return new Config((HoconValue) Value.Clone(null), Fallback?.Copy());
         }

         protected override HoconValue GetNode(HoconPath path, bool throwIfNotFound = false)
@@ -144,14 +137,10 @@
         {
             if (fallback == this)
                 throw new ArgumentException("Config can not have itself as fallback", nameof(fallback));
-
-            var clone = Copy();
-
-            var current = clone;
-            while (current.Fallback != null) current = current.Fallback;
-            current.Fallback = fallback.Copy();
-
-            return clone;
+
+            // If Fallback is not set - we will set it in new copy
+            // If Fallback was set - just use it, but with adding new fallback values
+            return new Config((HoconValue) Value.Clone(null), Fallback?.WithFallback(fallback) ?? fallback);
         }

         /// <summary>
@@ -198,6 +187,24 @@
                 yield return kvp;
                 used.Add(kvp.Key);
             }
+        }
+
+        /// <summary>
+        /// Performs aggregation of Value and all Fallbacks into single <see cref="HoconValue"/> object
+        /// </summary>
+        private HoconValue GetRootValue()
+        {
+            var elements = new List<IHoconElement>();
+
+            for (var config = this; config != null; config = config.Fallback?.Copy())
+            {
+                elements.AddRange(config.Value);
+            }
+
+            var aggregated = new HoconValue(null);
+            aggregated.AddRange(elements.AsEnumerable().Reverse());
+
+            return aggregated;
         }
     }


Add ExpandCanvas node

Add ExpandCanvas node

--- src/Imageflow/Fluent/BuildNode.cs
+++ src/Imageflow/Fluent/BuildNode.cs
@@ -225,6 +225,27 @@
                 }
             });

+        /// <summary>
+        /// Adds padding of the given color by enlarging the canvas on the sides specified.
+        /// </summary>
+        /// <param name="left"></param>
+        /// <param name="top"></param>
+        /// <param name="right"></param>
+        /// <param name="bottom"></param>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public BuildNode ExpandCanvas(int left, int top, int right, int bottom, AnyColor color)
+            => To(new
+            {
+                expand_canvas = new
+                {
+                    left,
+                    top,
+                    right,
+                    bottom,
+                    color = color.ToImageflowDynamic()
+                }
+            });

 //        public BuildNode Clone() => new BuildNode(NodeData,Input,Canvas,Uid);


Remove any common test method prefix in test browser display

--- osu.Framework/Testing/TestBrowser.cs
+++ osu.Framework/Testing/TestBrowser.cs
@@ -455,7 +455,13 @@

             updateButtons();

-            var methods = newTest.GetType().GetMethods();
+            var methods = newTest.GetType().GetMethods()
+                                 .Where(m =>
+                                     m.Name != nameof(TestScene.TestConstructor) &&
+                                     (m.GetCustomAttribute(typeof(TestAttribute), false) != null ||
+                                      m.GetCustomAttributes(typeof(TestCaseAttribute), false).Length > 0)
+                                 ).ToArray();
+
             var setUpMethods = new List<MethodInfo>();

             foreach (var type in newTest.GetType().EnumerateBaseTypes())
@@ -469,19 +475,23 @@

             bool hadTestAttributeTest = false;

-            foreach (var m in methods.Where(m => m.Name != nameof(TestScene.TestConstructor)))
-            {
+            string commonPrefix = methods.Select(m => m.Name).GetCommonPrefix();
+
+            foreach (var m in methods)
+            {
+                var name = m.Name.Substring(commonPrefix.Length);
+
                 if (m.GetCustomAttribute(typeof(TestAttribute), false) != null)
                 {
                     hadTestAttributeTest = true;
-                    handleTestMethod(m);
+                    handleTestMethod(m, name);

                     if (m.GetCustomAttribute(typeof(RepeatAttribute), false) != null)
                     {
                         var count = (int)m.GetCustomAttributesData().Single(a => a.AttributeType == typeof(RepeatAttribute)).ConstructorArguments.Single().Value;

                         for (int i = 2; i <= count; i++)
-                            handleTestMethod(m, $"{m.Name} ({i})");
+                            handleTestMethod(m, $"{name} ({i})");
                     }
                 }


settings

settings

--- Settings.ascx.cs
+++ Settings.ascx.cs
@@ -178,49 +178,19 @@

         protected void cbShowReadMore_CheckedChanged(object sender, EventArgs e)
         {
-            if (cbShowReadMore.Checked)
-            {
-                txtReadMoreText.Visible = true;
-            }
-            else
-            {
-                txtReadMoreText.Visible = false;
-            }
-
-
-
+            var sc = new SettingsController();
+            var us = sc.LoadSingleSettings(ModuleId);
+            us.ShowReadMore = cbShowReadMore.Checked;
+            sc.UpdateSettings(us);
+            LoadSettings();
         }

         protected void cbShowBack_CheckedChanged(object sender, EventArgs e)
         {
-            if (cbShowBack.Checked)
-            {
-                txtBackText.Visible = true;
-            }
-            else
-            {
-                txtBackText.Visible = false;
-            }
-
-            LoadSettings();
-
-
         }

         protected void cbShowHome_CheckedChanged(object sender, EventArgs e)
         {
-            if (cbShowHome.Checked)
-            {
-                txtHomeText.Visible = true;
-            }
-            else
-            {
-                txtHomeText.Visible = false;
-            }
-
-            LoadSettings();
-
-
         }
     }
 }


Reset the beatmap database when it can't be read, rather than hard failing.

--- osu.Game/Database/BeatmapDatabase.cs
+++ osu.Game/Database/BeatmapDatabase.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Linq.Expressions;
@@ -35,11 +36,22 @@

             if (connection == null)
             {
-                connection = storage.GetDatabase(@"beatmaps");
-                connection.CreateTable<BeatmapMetadata>();
-                connection.CreateTable<BaseDifficulty>();
-                connection.CreateTable<BeatmapSetInfo>();
-                connection.CreateTable<BeatmapInfo>();
+                retry:
+                try
+                {
+                    connection = storage.GetDatabase(@"beatmaps");
+                    connection.CreateTable<BeatmapMetadata>();
+                    connection.CreateTable<BaseDifficulty>();
+                    connection.CreateTable<BeatmapSetInfo>();
+                    connection.CreateTable<BeatmapInfo>();
+                }
+                catch
+                {
+                    Debug.WriteLine(@"Beatmap database was unable to be migrated; starting fresh!");
+                    connection?.Close();
+                    storage.DeleteDatabase(@"beatmaps");
+                    goto retry;
+                }
             }
         }


Return the populated item when calling GetChildren to write more elegant code.

--- osu.Game/Database/BeatmapDatabase.cs
+++ osu.Game/Database/BeatmapDatabase.cs
@@ -139,9 +139,12 @@
             return connection.GetAllWithChildren<T>(filter, recursive);
         }

-        public void GetChildren<T>(T item, bool recursive = true)
+        public T GetChildren<T>(T item, bool recursive = true)
         {
-            connection.GetChildren<T>(item, recursive);
+            if (item == null) return default(T);
+
+            connection.GetChildren(item, recursive);
+            return item;
         }

         readonly Type[] validTypes = new[]


Refactor user request to fix threadsafety issues

--- osu.Game/Database/UserLookupCache.cs
+++ osu.Game/Database/UserLookupCache.cs
@@ -1,7 +1,6 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

-using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading;
@@ -15,103 +14,75 @@
 {
     public class UserLookupCache : MemoryCachingComponent<int, User>
     {
-        private readonly HashSet<int> nextTaskIDs = new HashSet<int>();
-
         [Resolved]
         private IAPIProvider api { get; set; }
-
-        private readonly object taskAssignmentLock = new object();
-
-        private Task<List<User>> pendingRequest;
-
-        /// <summary>
-        /// Whether <see cref="pendingRequest"/> has already grabbed its IDs.
-        /// </summary>
-        private bool pendingRequestConsumedIDs;

         public Task<User> GetUserAsync(int userId, CancellationToken token = default) => GetAsync(userId, token);

         protected override async Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
-        {
-            var users = await getQueryTaskForUser(lookup);
-            return users.FirstOrDefault(u => u.Id == lookup);
-        }
+            => await queryUser(lookup);

-        /// <summary>
-        /// Return the task responsible for fetching the provided user.
-        /// This may be part of a larger batch lookup to reduce web requests.
-        /// </summary>
-        /// <param name="userId">The user to lookup.</param>
-        /// <returns>The task responsible for the lookup.</returns>
-        private Task<List<User>> getQueryTaskForUser(int userId)
+        private readonly List<(int id, TaskCompletionSource<User>)> pendingUserTasks = new List<(int, TaskCompletionSource<User>)>();
+        private Task pendingRequestTask;
+        private readonly object taskAssignmentLock = new object();
+
+        private Task<User> queryUser(int userId)
         {
             lock (taskAssignmentLock)
             {
-                nextTaskIDs.Add(userId);
+                var tcs = new TaskCompletionSource<User>();

-                // if there's a pending request which hasn't been started yet (and is not yet full), we can wait on it.
-                if (pendingRequest != null && !pendingRequestConsumedIDs && nextTaskIDs.Count < 50)
-                    return pendingRequest;
+                // Add to the queue.
+                pendingUserTasks.Add((userId, tcs));

-                return queueNextTask(nextLookup);
-            }
+                // Create a request task if there's not already one.
+                if (pendingRequestTask == null)
+                    createNewTask();

-            List<User> nextLookup()
-            {
-                int[] lookupItems;
-
-                lock (taskAssignmentLock)
-                {
-                    pendingRequestConsumedIDs = true;
-                    lookupItems = nextTaskIDs.ToArray();
-                    nextTaskIDs.Clear();
-
-                    if (lookupItems.Length == 0)
-                    {
-                        queueNextTask(null);
-                        return new List<User>();
-                    }
-                }
-
-                var request = new GetUsersRequest(lookupItems);
-
-                // rather than queueing, we maintain our own single-threaded request stream.
-                api.Perform(request);
-
-                return request.Result?.Users;
+                return tcs.Task;
             }
         }

-        /// <summary>
-        /// Queues new work at the end of the current work tasks.
-        /// Ensures the provided work is eventually run.
-        /// </summary>
-        /// <param name="work">The work to run. Can be null to signify the end of available work.</param>
-        /// <returns>The task tracking this work.</returns>
-        private Task<List<User>> queueNextTask(Func<List<User>> work)
+        private void performLookup()
         {
+            var userTasks = new List<(int id, TaskCompletionSource<User> task)>();
+
+            // Grab at most 50 users from the queue.
             lock (taskAssignmentLock)
             {
-                if (work == null)
+                while (pendingUserTasks.Count > 0 && userTasks.Count < 50)
                 {
-                    pendingRequest = null;
-                    pendingRequestConsumedIDs = false;
+                    (int id, TaskCompletionSource<User> task) next = pendingUserTasks[^1];
+
+                    pendingUserTasks.RemoveAt(pendingUserTasks.Count - 1);
+
+                    // Perform a secondary check for existence, in case the user was queried in a previous batch.
+                    if (CheckExists(next.id, out var existing))
+                        next.task.SetResult(existing);
+                    else
+                        userTasks.Add(next);
                 }
-                else if (pendingRequest == null)
-                {
-                    // special case for the first request ever.
-                    pendingRequest = Task.Run(work);
-                    pendingRequestConsumedIDs = false;
-                }
-                else
-                {
-                    // append the new request on to the last to be executed.
-                    pendingRequest = pendingRequest.ContinueWith(_ => work());
-                    pendingRequestConsumedIDs = false;
-                }
+            }

-                return pendingRequest;
+            // Query the users.
+            var request = new GetUsersRequest(userTasks.Select(t => t.id).ToArray());
+
+            // rather than queueing, we maintain our own single-threaded request stream.
+            api.Perform(request);
+
+            // Create a new request task if there's still more users to query.
+            lock (taskAssignmentLock)
+            {
+                pendingRequestTask = null;
+                if (pendingUserTasks.Count > 0)
+                    createNewTask();
             }
+
+            // Notify of completion.
+            foreach (var (id, task) in userTasks)
+                task.SetResult(request.Result?.Users?.FirstOrDefault(u => u.Id == id));
         }
+
+        private void createNewTask() => pendingRequestTask = Task.Run(performLookup);
     }
 }


Fix MusicController doing work in the background when not visible.

--- osu.Game/Overlays/MusicController.cs
+++ osu.Game/Overlays/MusicController.cs
@@ -23,6 +23,7 @@
 using osu.Game.Database;
 using osu.Game.Graphics;
 using osu.Framework.Graphics.Primitives;
+using osu.Framework.Threading;
 using osu.Game.Graphics.Sprites;

 namespace osu.Game.Overlays
@@ -229,6 +230,12 @@
         {
             base.Update();

+            if (pendingBeatmapSwitch != null)
+            {
+                pendingBeatmapSwitch();
+                pendingBeatmapSwitch = null;
+            }
+
             if (current?.TrackLoaded ?? false)
             {

@@ -320,43 +327,50 @@
             base.PerformLoad(game);
         }

+        Action pendingBeatmapSwitch;
+
         private void updateDisplay(WorkingBeatmap beatmap, TransformDirection direction)
         {
-            Task.Run(() =>
-            {
-                if (beatmap?.Beatmap == null)
-                    //todo: we may need to display some default text here (currently in the constructor).
-                    return;
-
-                BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
-                title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
-                artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
-            });
-
-            MusicControllerBackground newBackground;
-
-            (newBackground = new MusicControllerBackground(beatmap)).Preload(game, delegate
-            {
-
-                dragContainer.Add(newBackground);
-
-                switch (direction)
+            //we might be off-screen when this update comes in.
+            //rather than Scheduling, manually handle this to avoid possible memory contention.
+            pendingBeatmapSwitch = () =>
+            {
+                Task.Run(() =>
                 {
-                    case TransformDirection.Next:
-                        newBackground.Position = new Vector2(400, 0);
-                        newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
-                        backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
-                        break;
-                    case TransformDirection.Prev:
-                        newBackground.Position = new Vector2(-400, 0);
-                        newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
-                        backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
-                        break;
-                }
-
-                backgroundSprite.Expire();
-                backgroundSprite = newBackground;
-            });
+                    if (beatmap?.Beatmap == null)
+                        //todo: we may need to display some default text here (currently in the constructor).
+                        return;
+
+                    BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
+                    title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
+                    artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
+                });
+
+                MusicControllerBackground newBackground;
+
+                (newBackground = new MusicControllerBackground(beatmap)).Preload(game, delegate
+                {
+
+                    dragContainer.Add(newBackground);
+
+                    switch (direction)
+                    {
+                        case TransformDirection.Next:
+                            newBackground.Position = new Vector2(400, 0);
+                            newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
+                            backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
+                            break;
+                        case TransformDirection.Prev:
+                            newBackground.Position = new Vector2(-400, 0);
+                            newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
+                            backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
+                            break;
+                    }
+
+                    backgroundSprite.Expire();
+                    backgroundSprite = newBackground;
+                });
+            };
         }

         private Func<string, string, string> unicodeString;


Make spotlight selector work

Make spotlight selector work

--- osu.Game/Overlays/RankingsOverlay.cs
+++ osu.Game/Overlays/RankingsOverlay.cs
@@ -14,6 +14,8 @@
 using System.Threading;
 using osu.Game.Online.API.Requests;
 using osu.Game.Overlays.Rankings.Tables;
+using osu.Game.Online.API.Requests.Responses;
+using System.Linq;

 namespace osu.Game.Overlays
 {
@@ -22,11 +24,13 @@
         protected readonly Bindable<Country> Country = new Bindable<Country>();
         protected readonly Bindable<RankingsScope> Scope = new Bindable<RankingsScope>();
         private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
+        private readonly Bindable<APISpotlight> spotlight = new Bindable<APISpotlight>();

         private readonly BasicScrollContainer scrollFlow;
         private readonly Container tableContainer;
         private readonly DimmedLoadingLayer loading;
         private readonly Box background;
+        private readonly RankingsOverlayHeader header;

         private APIRequest lastRequest;
         private CancellationTokenSource cancellationToken;
@@ -54,14 +58,15 @@
                         Direction = FillDirection.Vertical,
                         Children = new Drawable[]
                         {
-                            new RankingsOverlayHeader
+                            header = new RankingsOverlayHeader
                             {
                                 Anchor = Anchor.TopCentre,
                                 Origin = Anchor.TopCentre,
                                 Depth = -float.MaxValue,
                                 Country = { BindTarget = Country },
                                 Current = { BindTarget = Scope },
-                                Ruleset = { BindTarget = ruleset }
+                                Ruleset = { BindTarget = ruleset },
+                                Spotlight = { BindTarget = spotlight }
                             },
                             new Container
                             {
@@ -109,11 +114,19 @@
                 if (Scope.Value != RankingsScope.Performance)
                     Country.Value = null;

+                if (Scope.Value == RankingsScope.Spotlights && !header.Spotlights.Any())
+                {
+                    getSpotlights();
+                    return;
+                }
+
                 Scheduler.AddOnce(loadNewContent);
             }, true);

             ruleset.BindValueChanged(_ => Scheduler.AddOnce(loadNewContent), true);

+            spotlight.BindValueChanged(_ => Scheduler.AddOnce(loadNewContent), true);
+
             base.LoadComplete();
         }

@@ -127,6 +140,14 @@
             Country.Value = requested;
         }

+        private void getSpotlights()
+        {
+            loading.Show();
+            var request = new GetSpotlightsRequest();
+            request.Success += response => header.Spotlights = response.Spotlights;
+            api.Queue(request);
+        }
+
         private void loadNewContent()
         {
             loading.Show();
@@ -145,7 +166,6 @@

             request.Success += () => loadTable(createTableFromResponse(request));
             request.Failure += _ => loadTable(null);
-
             api.Queue(request);
         }

@@ -161,6 +181,9 @@

                 case RankingsScope.Score:
                     return new GetUserRankingsRequest(ruleset.Value, UserRankingsType.Score);
+
+                case RankingsScope.Spotlights:
+                    return new GetSpotlightRankingsRequest(ruleset.Value, header.Spotlight.Value.Id);
             }

             return null;
@@ -184,6 +207,9 @@

                 case GetCountryRankingsRequest countryRequest:
                     return new CountriesTable(1, countryRequest.Result.Countries);
+
+                case GetSpotlightRankingsRequest spotlightRequest:
+                    return new ScoresTable(1, spotlightRequest.Result.Users);
             }

             return null;


memory leak problem. This closes #81

memory leak problem. This closes #81

--- src/Kondor.Service/Application.cs
+++ src/Kondor.Service/Application.cs
@@ -8,10 +8,16 @@
     public class Application : IApplication
     {
         private readonly ISettingHandler _settingHandler;
+        private readonly ILeitnerService _leitnerService;
+        private readonly ITelegramMessageHandler _telegramMessageHandler;
+        private readonly INotificationHandler _notificationHandler;

-        public Application(ISettingHandler settingHandler)
+        public Application(ISettingHandler settingHandler, ILeitnerService leitnerService, ITelegramMessageHandler telegramMessageHandler, INotificationHandler notificationHandler)
         {
             _settingHandler = settingHandler;
+            _leitnerService = leitnerService;
+            _telegramMessageHandler = telegramMessageHandler;
+            _notificationHandler = notificationHandler;
         }

         public void Run()
@@ -33,8 +39,7 @@
         {
             try
             {
-                var notificationHandler = ObjectManager.GetInstance<INotificationHandler>();
-                notificationHandler.SendNotification();
+                _notificationHandler.SendNotification();
                 Console.WriteLine("Notification");
             }
             catch (Exception exception)
@@ -47,9 +52,7 @@
         {
             try
             {
-                var telegramMessageHandler = ObjectManager.GetInstance<ITelegramMessageHandler>();
-                telegramMessageHandler.ProcessMessages();
-
+                _telegramMessageHandler.ProcessMessages();
                 Console.WriteLine("T Job");
             }
             catch (Exception exception)
@@ -62,9 +65,7 @@
         {
             try
             {
-                var leitnerService = ObjectManager.GetInstance<ILeitnerService>();
-                var cleanerResult = leitnerService.BoxCleanUp();
-
+                var cleanerResult = _leitnerService.BoxCleanUp();
                 Console.WriteLine("Cleaner: " + cleanerResult);
             }
             catch (Exception exception)


Fix SkinnableSprite initialising a drawable even when the texture is not available

--- osu.Game/Skinning/SkinnableSprite.cs
+++ osu.Game/Skinning/SkinnableSprite.cs
@@ -24,7 +24,15 @@
         {
         }

-        protected override Drawable CreateDefault(ISkinComponent component) => new Sprite { Texture = textures.Get(component.LookupName) };
+        protected override Drawable CreateDefault(ISkinComponent component)
+        {
+            var texture = textures.Get(component.LookupName);
+
+            if (texture == null)
+                return null;
+
+            return new Sprite { Texture = texture };
+        }

         private class SpriteComponent : ISkinComponent
         {


Re-add accidentally deleted comment.

Re-add accidentally deleted comment.

--- src/LessMsi.Cli/OpenGuiCommand.cs
+++ src/LessMsi.Cli/OpenGuiCommand.cs
@@ -24,7 +24,8 @@
 				var p = new Process();
 				p.StartInfo.FileName = guiExe;

-				if (args.Count > 0)
+				//should we wait for exit?
+                if (args.Count > 0)
 				{
 					// We add double quotes to support paths with spaces, for ex: "E:\Downloads and Sofware\potato.msi".
 					p.StartInfo.Arguments = string.Format("\"{0}\"", args[1]);


Make CLI work with paths containing spaces.

--- src/LessMsi.Cli/OpenGuiCommand.cs
+++ src/LessMsi.Cli/OpenGuiCommand.cs
@@ -21,11 +21,17 @@
 			var guiExe = Path.Combine(AppPath, "lessmsi-gui.exe");
 			if (File.Exists(guiExe))
 			{
-				//should we wait for exit?
-				if (args.Count > 0)
-					Process.Start(guiExe, args[1]);
-				else
-					Process.Start(guiExe);
+			    var p = new Process();
+			    p.StartInfo.FileName = guiExe;
+
+			    if (args.Count > 0)
+			    {
+                    // We add double quotes to support paths with spaces, for ex: "E:\Downloads and Sofware\potato.msi".
+                    p.StartInfo.Arguments = string.Format("\"{0}\"", args[1]);
+			        p.Start();
+			    }
+			    else
+			        p.Start();
 			}
 		}


Use new simple console

Use new simple console

--- src/Lunet.Core/Core/SiteObject.cs
+++ src/Lunet.Core/Core/SiteObject.cs
@@ -74,7 +74,10 @@
             {
                 builder.AddProvider(new LoggerProviderIntercept(this))
                     .AddFilter(LogFilter)
-                    .AddConsole();
+                    .AddSimpleConsole(configure: options =>
+                    {
+                        options.SingleLine = true;
+                    });
             });

             Log = LoggerFactory.CreateLogger("lunet");


Fixing visual parent issue

Fixing visual parent issue

--- src/ControlzEx.Showcase/UniformGridEx.cs
+++ src/ControlzEx.Showcase/UniformGridEx.cs
@@ -198,7 +198,11 @@
             if (this.ShowGridLines)
             {
                 this.GridLinesRenderer ??= this.CreateGridLinesRenderer();
-                this.AddVisualChild(this.GridLinesRenderer);
+
+                if (this.GridLinesRenderer.Parent != this)
+                {
+                    this.AddVisualChild(this.GridLinesRenderer);
+                }
             }
             else if (this.ShowGridLines == false
                      && this.GridLinesRenderer is not null)


only the linked cancellation token should be used for the dequeue method.

--- src/Core/Jobs/WorkItemJob/WorkItemJob.cs
+++ src/Core/Jobs/WorkItemJob/WorkItemJob.cs
@@ -38,7 +38,7 @@
             if (queueEntry == null)
                 return JobResult.Success;

-            if (linkedCancellationTokenSource.IsCancellationRequested) {
+            if (cancellationToken.IsCancellationRequested) {
                 _logger.Info("Job was cancelled. Abandoning {queueEntryType} work item: {queueEntryId}", queueEntry.Value.Type, queueEntry.Id);
                 await queueEntry.AbandonAsync().AnyContext();
                 return JobResult.CancelledWithMessage($"Abandoning {queueEntry.Value.Type} work item: {queueEntry.Id}");
@@ -66,7 +66,7 @@
                     Type = queueEntry.Value.Type
                 }).AnyContext();

-            var lockValue = await handler.GetWorkItemLockAsync(workItemData, linkedCancellationTokenSource.Token).AnyContext();
+            var lockValue = await handler.GetWorkItemLockAsync(workItemData, cancellationToken).AnyContext();
             if (lockValue == null) {
                 await queueEntry.AbandonAsync().AnyContext();
                 _logger.Trace("Unable to acquire work item lock.");
@@ -90,7 +90,7 @@

             try {
                 _logger.Info("Processing {0} work item queue entry ({1}).", workItemDataType.Name, queueEntry.Id);
-                await handler.HandleItemAsync(new WorkItemContext(workItemData, JobId, lockValue, linkedCancellationTokenSource.Token, progressCallback)).AnyContext();
+                await handler.HandleItemAsync(new WorkItemContext(workItemData, JobId, lockValue, cancellationToken, progressCallback)).AnyContext();

                 if (!queueEntry.IsAbandoned && !queueEntry.IsCompleted) {
                     await queueEntry.CompleteAsync().AnyContext();


Fix slow test

Fix slow test

--- src/Core/Tests/Jobs/JobQueueTestsBase.cs
+++ src/Core/Tests/Jobs/JobQueueTestsBase.cs
@@ -75,18 +75,19 @@
             const int jobCount = 5;
             const int workItemCount = 100;

-            Log.SetLogLevel<SampleQueueJob>(LogLevel.Error);
-            Log.SetLogLevel<InMemoryMetricsClient>(LogLevel.Trace);
+            Log.SetLogLevel<SampleQueueJob>(LogLevel.Information);
+            Log.SetLogLevel<InMemoryMetricsClient>(LogLevel.None);

             var metrics = new InMemoryMetricsClient(true, loggerFactory: Log);

             var queues = new List<IQueue<SampleQueueWorkItem>>();
             for (int i = 0; i < jobCount; i++) {
-                var q = GetSampleWorkItemQueue(retries: 3, retryDelay: TimeSpan.FromMilliseconds(5));
+                var q = GetSampleWorkItemQueue(retries: 1, retryDelay: TimeSpan.Zero);
                 await q.DeleteQueueAsync();
                 q.AttachBehavior(new MetricsQueueBehavior<SampleQueueWorkItem>(metrics, "test", Log));
                 queues.Add(q);
             }
+            _logger.Info("Done setting up queues");

             var enqueueTask = Run.InParallel(workItemCount, async index => {
                 var queue = queues[RandomData.GetInt(0, jobCount - 1)];
@@ -95,6 +96,7 @@
                     Path = RandomData.GetString()
                 });
             });
+            _logger.Info("Done enqueueing");

             var cancellationTokenSource = new CancellationTokenSource();
             await Run.InParallel(jobCount, async index => {
@@ -103,6 +105,7 @@
                 await job.RunUntilEmptyAsync(cancellationTokenSource.Token);
                 cancellationTokenSource.Cancel();
             });
+            _logger.Info("Done running jobs until empty");

             await enqueueTask;

@@ -112,8 +115,10 @@
                 _logger.Info("Queue#{i}: Working: {working} Completed: {completed} Abandoned: {abandoned} Error: {errors} Deadletter: {deadletter}", i, stats.Working, stats.Completed, stats.Abandoned, stats.Errors, stats.Deadletter);
                 queueStats.Add(stats);
             }
+            _logger.Info("Done getting queue stats");

             await metrics.FlushAsync();
+            _logger.Info("Done flushing metrics");

             var queueSummary = await metrics.GetQueueStatsAsync("test.samplequeueworkitem");
             Assert.Equal(queueStats.Sum(s => s.Completed), queueSummary.Completed.Count);


Make StyleSaveUpdate also cascade on locks (forgot to add this)

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@1264

--- src/NHibernate/Engine/Cascades.cs
+++ src/NHibernate/Engine/Cascades.cs
@@ -227,7 +227,9 @@
 			{
 				public override bool DoCascade( CascadingAction action )
 				{
-					return action == CascadingAction.ActionSaveUpdate;
+					return action == CascadingAction.ActionSaveUpdate
+						|| action == CascadingAction.ActionLock;
+					// TODO: H2.1 also includes Copy and Replicate actions here
 				}
 			}


Change to extension method

Change to extension method

IApplicationStartup only seems to work when in executing assembly?
Convert to extension method of IPipelines and invoke on
ApplicationStartup

--- src/Nancy.Gzip/GzipCompression.cs
+++ src/Nancy.Gzip/GzipCompression.cs
@@ -4,9 +4,9 @@
     using System.Linq;
     using Bootstrapper;

-    public class GzipCompression : IApplicationStartup
+    public static class GzipCompression
     {
-        public void Initialize(IPipelines pipelines)
+        public static void EnableGzipCompression(this IPipelines pipelines)
         {
             pipelines.AfterRequest += CheckForCompression;
         }


Remove TODO around negative symbols

Remove TODO around negative symbols

We don't use NumberFormatInfo anywhere now. We could potentially revisit that in
the future, but then we'd need to revisit *everywhere* that uses '-'. (It's hardcoded in
a lot of places.)

--- src/NodaTime/Text/FormatHelper.cs
+++ src/NodaTime/Text/FormatHelper.cs
@@ -52,7 +52,6 @@
                 if (value < 0)
                 {
                     value = -value;
-                    // TODO: Should we use a culture-specific negative sign?
                     outputBuffer.Append('-');
                 }
                 outputBuffer.Append((char)('0' + (value / 1000)));


Provide overloads to specify MySql schema to use

--- src/DbUp.MySql/MySqlExtensions.cs
+++ src/DbUp.MySql/MySqlExtensions.cs
@@ -28,16 +28,43 @@
     /// <summary>
     /// Creates an upgrader for MySql databases.
     /// </summary>
+    /// <param name="supported">Fluent helper type.</param>
+    /// <param name="connectionString">MySql database connection string.</param>
+    /// <param name="schema">Which MySql schema to check for changes</param>
+    /// <returns>
+    /// A builder for a database upgrader designed for MySql databases.
+    /// </returns>
+    public static UpgradeEngineBuilder MySqlDatabase(this SupportedDatabases supported, string connectionString, string schema)
+    {
+        return MySqlDatabase(new MySqlConnectionManager(connectionString), schema);
+    }
+
+    /// <summary>
+    /// Creates an upgrader for MySql databases.
+    /// </summary>
     /// <param name="connectionManager">The <see cref="MySqlConnectionManager"/> to be used during a database upgrade.</param>
     /// <returns>
     /// A builder for a database upgrader designed for MySql databases.
     /// </returns>
     public static UpgradeEngineBuilder MySqlDatabase(IConnectionManager connectionManager)
     {
+        return MySqlDatabase(connectionManager, null);
+    }
+
+    /// <summary>
+    /// Creates an upgrader for MySql databases.
+    /// </summary>
+    /// <param name="connectionManager">The <see cref="MySqlConnectionManager"/> to be used during a database upgrade.</param>
+    /// /// <param name="schema">Which MySQL schema to check for changes</param>
+    /// <returns>
+    /// A builder for a database upgrader designed for MySql databases.
+    /// </returns>
+    public static UpgradeEngineBuilder MySqlDatabase(IConnectionManager connectionManager, string schema)
+    {
         var builder = new UpgradeEngineBuilder();
         builder.Configure(c => c.ConnectionManager = connectionManager);
         builder.Configure(c => c.ScriptExecutor = new SqlScriptExecutor(() => c.ConnectionManager, () => c.Log, null, () => c.VariablesEnabled, c.ScriptPreprocessors));
-        builder.Configure(c => c.Journal = new MySqlITableJournal(() => c.ConnectionManager, () => c.Log, null, "schemaversions"));
+        builder.Configure(c => c.Journal = new MySqlITableJournal(() => c.ConnectionManager, () => c.Log, schema, "schemaversions"));
         builder.WithPreprocessor(new MySqlPreprocessor());
         return builder;
     }


Fixed compile error

Fixed compile error

--- src/Discord.Net/Models/Message.cs
+++ src/Discord.Net/Models/Message.cs
@@ -326,7 +326,7 @@

         public Task Acknowledge()
         {
-            if (_userId != Client.CurrentUser.Id)
+            if (User.Id != Client.CurrentUser.Id)
                 return Client.ClientAPI.Send(new AckMessageRequest(Channel.Id, Id));
             else
                 return TaskHelper.CompletedTask;


RP record missing factory

RP record missing factory

--- src/DnsClient/DnsRecordFactory.cs
+++ src/DnsClient/DnsRecordFactory.cs
@@ -117,6 +117,10 @@

                 case ResourceRecordType.TXT:
                     result = ResolveTXTRecord(info);
+                    break;
+
+                case ResourceRecordType.RP:
+                    result = new RpRecord(info, _reader.ReadName(), _reader.ReadName());
                     break;

                 case ResourceRecordType.AFSDB:


LifecycleTests demonstrates a realistic failure/retry behavior in which initial failures are recharacterized as descriptive skips.

--- src/Fixie.Tests/LifecycleTests.cs
+++ src/Fixie.Tests/LifecycleTests.cs
@@ -252,24 +252,54 @@
             }
         }

-        class RunHooksTwice : Execution
-        {
+        class RetryExecution : Execution
+        {
+            const int MaxAttempts = 3;
+
             public void Execute(TestClass testClass)
             {
                 testClass.RunTests(test =>
                 {
-                    if (test.Method.Name.Contains("Skip")) return;
-                    test.RunCases(UsingInputAttributes, @case => { @case.Execute(); @case.Execute(); });
-                    test.RunCases(UsingInputAttributes, @case => { @case.Execute(); @case.Execute(); });
+                    if (!test.Method.Name.Contains("Skip"))
+                        foreach (var parameters in Cases(test))
+                            RunWithRetries(test, parameters);
                 });
-
-                testClass.RunTests(test =>
-                {
-                    if (test.Method.Name.Contains("Skip")) return;
-                    test.RunCases(UsingInputAttributes, @case => { @case.Execute(); @case.Execute(); });
-                    test.RunCases(UsingInputAttributes, @case => { @case.Execute(); @case.Execute(); });
-                });
-            }
+            }
+
+            static void RunWithRetries(TestMethod test, object?[] parameters)
+            {
+                var remainingAttempts = MaxAttempts;
+
+                while (remainingAttempts > 0)
+                {
+                    test.Run(parameters, @case =>
+                    {
+                        @case.Execute();
+
+                        remainingAttempts--;
+
+                        if (@case.State == CaseState.Failed && remainingAttempts > 0)
+                            @case.Skip(@case.Exception?.Message + " Retrying...");
+                        else
+                            remainingAttempts = 0;
+                    });
+                }
+            }
+
+            static IEnumerable<object?[]> Cases(TestMethod test)
+            {
+                if (test.HasParameters)
+                {
+                    foreach (var parameters in UsingInputAttributes(test.Method))
+                        yield return parameters;
+                }
+                else
+                {
+                    yield return EmptyParameters;
+                }
+            }
+
+            static readonly object[] EmptyParameters = {};
         }

         static IEnumerable<object[]> BuggyParameterSource(MethodInfo method)
@@ -494,41 +524,19 @@
                 "ClassTearDown");
         }

-        public void ShouldAllowRunningAllExecutionHooksMultipleTimes()
-        {
-            var output = Run<SampleTestClass, RunHooksTwice>();
-
-            //NOTE: At the Case level, results are mutated in place,
-            //      so here we see 2 fail results and 2 pass results,
-            //      though Fail(), Pass(1), and Pass(2) are each
-            //      executed 4 times. This discrepancy is undesirable.
-            //      This assertion is merely stating the current
-            //      behavior.
-
-            output.ShouldHaveResults(
-                "SampleTestClass.Fail failed: 'Fail' failed!",
+        public void ShouldAllowRunningTestsMultipleTimesWithDistinctResultPerInvocation()
+        {
+            var output = Run<SampleTestClass, RetryExecution>();
+
+            output.ShouldHaveResults(
+                "SampleTestClass.Fail skipped: 'Fail' failed! Retrying...",
+                "SampleTestClass.Fail skipped: 'Fail' failed! Retrying...",
                 "SampleTestClass.Fail failed: 'Fail' failed!",
                 "SampleTestClass.Pass(1) passed",
                 "SampleTestClass.Pass(2) passed",
-                "SampleTestClass.Pass(1) passed",
-                "SampleTestClass.Pass(2) passed",
-                "SampleTestClass.Skip skipped",
-
-                "SampleTestClass.Fail failed: 'Fail' failed!",
-                "SampleTestClass.Fail failed: 'Fail' failed!",
-                "SampleTestClass.Pass(1) passed",
-                "SampleTestClass.Pass(2) passed",
-                "SampleTestClass.Pass(1) passed",
-                "SampleTestClass.Pass(2) passed",
-                "SampleTestClass.Skip skipped");
-
-            output.ShouldHaveLifecycle(
-                "Fail", "Fail", "Fail", "Fail",
-                "Pass(1)", "Pass(1)", "Pass(2)", "Pass(2)",
-                "Pass(1)", "Pass(1)", "Pass(2)", "Pass(2)",
-                "Fail", "Fail", "Fail", "Fail",
-                "Pass(1)", "Pass(1)", "Pass(2)", "Pass(2)",
-                "Pass(1)", "Pass(1)", "Pass(2)", "Pass(2)");
+                "SampleTestClass.Skip skipped");
+
+            output.ShouldHaveLifecycle("Fail", "Fail", "Fail", "Pass(1)", "Pass(2)");
         }

         public void ShouldSkipAllTestsWhenShortCircuitingClassExecution()


cleanup

cleanup

comment

--- src/Peachpie.Library/Variables.cs
+++ src/Peachpie.Library/Variables.cs
@@ -420,7 +420,7 @@
         public static bool is_array(PhpValue variable) => variable.IsArray || (variable.IsAlias && variable.Alias.Value.IsArray);

         /// <summary>
-        /// Checks whether a dereferenced variable is <see cref="Core.Reflection.DObject"/>.
+        /// Checks whether a dereferenced variable is an instance of class.
         /// </summary>
         /// <param name="variable">The variable.</param>
         /// <returns>Whether <paramref name="variable"/> is <see cref="object"/>.</returns>


nothing

nothing

--- src/GeometriesTest/ClipperTest.cs
+++ src/GeometriesTest/ClipperTest.cs
@@ -22,6 +22,7 @@
                 double a = 0, b = 0;
                 if (Clipper.Intersects(v1, v2, v3, v4, ref a, ref b))
                 {
+                    //Assert.True(false);
                     var cross = Segment.Intersect(v1.ToPoint(), v2.ToPoint(), v3.ToPoint(), v4.ToPoint());
                     double aa = cross.Value.DistanceBetween(v1.ToPoint()) / v1.ToPoint().DistanceBetween(v2.ToPoint());


buildtask logger thread safety

buildtask logger thread safety

--- src/Peachpie.NET.Sdk/BuildTask.cs
+++ src/Peachpie.NET.Sdk/BuildTask.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Text;
 using System.Threading;
@@ -283,51 +284,71 @@
         // so we have our custom TextWriter that we pass to Log
         sealed class LogWriter : TextWriter
         {
+            TaskLoggingHelper Log { get; }
+
+            StringBuilder Buffer { get; } = new StringBuilder();
+
+            public override Encoding Encoding => Encoding.UTF8;
+
             public LogWriter(TaskLoggingHelper log)
             {
-                _log = log;
+                Debug.Assert(log != null);
+
+                this.Log = log;
                 this.NewLine = "\n";
             }

-            TaskLoggingHelper _log;
-            StringBuilder _text = new StringBuilder();
-
-            public override Encoding Encoding => Encoding.UTF8;
-
-            bool _logLine()
-            {
-                for (int i = 0; i < _text.Length; i++)
-                {
-                    if (_text[i] == '\n')
+            bool TryLogCompleteMessage()
+            {
+                string line = null;
+
+                lock (Buffer)   // accessed in parallel
+                {
+                    // get line from the buffer:
+                    for (int i = 0; i < Buffer.Length; i++)
                     {
-                        _logLine(_text.ToString(0, i));
-                        _text.Remove(0, i + 1);
-                        return true;
+                        if (Buffer[i] == '\n')
+                        {
+                            line = Buffer.ToString(0, i);
+
+                            Buffer.Remove(0, i + 1);
+                        }
                     }
                 }

-                return false;
-            }
-
-            void _logLine(string line)
-            {
-                _log.LogMessageFromText(line, MessageImportance.High);
+                //
+                return line != null && LogCompleteMessage(line);
+            }
+
+            bool LogCompleteMessage(string line)
+            {
+                // TODO: following logs only Warnings and Errors,
+                // to log Info diagnostics properly, parse it by ourselves
+
+                return this.Log.LogMessageFromText(line.Trim(), MessageImportance.High);
             }

             public override void Write(char value)
             {
-                _text.Append(value);
+                lock (Buffer) // accessed in parallel
+                {
+                    Buffer.Append(value);
+                }

                 if (value == '\n')
                 {
-                    _logLine();
+                    TryLogCompleteMessage();
                 }
             }

             public override void Write(string value)
             {
-                _text.Append(value);
-                _logLine();
+                lock (Buffer)
+                {
+                    Buffer.Append(value);
+                }
+
+                TryLogCompleteMessage();
             }
         }
     }


Something

Something

--- src/IlViewer.Core/IlGeneration.cs
+++ src/IlViewer.Core/IlGeneration.cs
@@ -19,6 +19,8 @@
                throw new ArgumentNullException(nameof(classFilename));

             Compilation compilation = LoadWorkspace(projectJsonPath);
+
+	        AssemblyIdentity res = compilation.ReferencedAssemblyNames.FirstOrDefault(x => x.Name == classFilename);

 	        SyntaxTree systenTree = compilation.SyntaxTrees.FirstOrDefault(x => x.FilePath.Contains(classFilename));
 	        string sourceCode = systenTree.GetText().ToString();


fix stackoverflow exception when visualizing large graphs

--- src/Sir.VectorSpace/PathFinder.cs
+++ src/Sir.VectorSpace/PathFinder.cs
@@ -72,20 +72,22 @@
         public static string Visualize(VectorNode root)
         {
             StringBuilder output = new StringBuilder();
-            Visualize(root, output, 0);
+
+            foreach(var node in All(root))
+            {
+                Visualize(node, output);
+            }
+
             return output.ToString();
         }

-        private static void Visualize(VectorNode node, StringBuilder output, int depth)
+        private static void Visualize(VectorNode node, StringBuilder output)
         {
             if (node == null) return;

-            output.Append('\t', depth);
+            output.Append('\t',node.Depth);
             output.AppendFormat($"{node} w:{node.Weight}");
             output.AppendLine();
-
-            Visualize(node.Left, output, depth + 1);
-            Visualize(node.Right, output, depth);
         }

         public static (int depth, int width) Size(VectorNode root)
@@ -111,7 +113,7 @@
             return (depth, width);
         }

-        public static int Depth(VectorNode node)
+        private static int Depth(VectorNode node)
         {
             var count = 1;


TextureEvent.Showメソッドの動作を変更

TextureEvent.Showメソッドの動作を変更

--- src/Sitrine/Event/TextureEvent.cs
+++ src/Sitrine/Event/TextureEvent.cs
@@ -1279,7 +1279,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public TextureEvent Show()
         {
-            return this.Alpha(1.0f);
+            return this.Alpha(1.0);
         }
         #endregion


On LIFT export, added some error notices... adding "notes" is not sufficient.

--- src/SolidGui/Export/ExportLift.cs
+++ src/SolidGui/Export/ExportLift.cs
@@ -98,10 +98,8 @@
 							}
 							else
 							{
-								// add an error note
 								adaptedEntry.AddSolidNote(String.Format("Cannot find target: {0}", relation.TargetID));
-								// add a note
-								//adaptedEntry.LiftLexEntry.
+                                progress.WriteError("Cannot find lexical relation target: {0}, referenced from {1}", relation.TargetID, adaptedEntry.LiftLexEntry.GetSimpleFormForLogging());
 							}
 						}

@@ -121,8 +119,8 @@
 								}
 								else
 								{
-									// add a note
-									//adaptedEntry.LiftLexEntry.
+                                    adaptedEntry.AddSolidNote(String.Format("Cannot find subentry target: {0}", relation.TargetID));
+                                    progress.WriteError("Cannot find subentry target: {0}, referenced from {1}", relation.TargetID, adaptedEntry.LiftLexEntry.GetSimpleFormForLogging());
 								}
 							}


Incorporate TagBuilder breaking changes

Incorporate TagBuilder breaking changes

--- src/Glimpse.Web.Common/ScriptInjector.cs
+++ src/Glimpse.Web.Common/ScriptInjector.cs
@@ -20,10 +20,10 @@

             var tag = new TagBuilder("script")
             {
-                InnerHtml = js.ToString()
+                InnerHtml = new HtmlString(js.ToString()),
             };

-            output.PostContent.Append(tag.ToString());
+            output.PostContent.Append(tag.ToHtmlContent(TagRenderMode.Normal));
         }
     }
 }


catch some errors

catch some errors

Signed-off-by: Sven Strickroth <a88b7dcd1a9e3e17770bbaa6d7515b31a2d7e85d@cs-ware.de>

--- src/Gurtle/Providers/Trac/TracProject.cs
+++ src/Gurtle/Providers/Trac/TracProject.cs
@@ -157,7 +157,14 @@
                 }

                 JsonData data = JsonMapper.ToObject(args.Result);
-                if (data["result"].Count > 0)
+                if (data["error"] != null)
+                {
+                    if (onCompleted != null)
+                        onCompleted(false, new Exception((string)data["error"]["message"]));
+
+                    return;
+                }
+                else if (data["result"] != null && data["result"].Count > 0)
                 {
                     var client2 = new WebClient();
                     client2.Headers.Add("Content-Type", "application/json");


added encoding property for ConsoleTarget

--- src/NLog/Targets/ConsoleTarget.cs
+++ src/NLog/Targets/ConsoleTarget.cs
@@ -30,6 +30,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 // THE POSSIBILITY OF SUCH DAMAGE.
 //
+
+using System.Text;

 namespace NLog.Targets
 {
@@ -64,6 +66,16 @@
         /// <docgen category='Console Options' order='10' />
         [DefaultValue(false)]
         public bool Error { get; set; }
+
+        /// <summary>
+        /// Set the encoding for writing messages.
+        ///  </summary>
+        /// <remarks>Has side effect</remarks>
+        public Encoding Encoding
+        {
+            get { return Console.OutputEncoding; }
+            set { Console.OutputEncoding = value; }
+        }

         /// <summary>
         /// Initializes the target.


NetworkTarget - Report to InternalLogger at Debug-level when discarding huge LogEvents (#4788)

--- src/NLog/Targets/NetworkTarget.cs
+++ src/NLog/Targets/NetworkTarget.cs
@@ -556,13 +556,14 @@
             {
                 if (OnOverflow == NetworkTargetOverflowAction.Discard)
                 {
-                    InternalLogger.Trace("{0}: Discarded LogEvent because MessageSize={1} is above MaxMessageSize={2}", this, messageSize, MaxMessageSize);
+                    InternalLogger.Debug("{0}: Discarded LogEvent because MessageSize={1} is above MaxMessageSize={2}", this, messageSize, MaxMessageSize);
                     continuation(null);
                     return;
                 }

                 if (OnOverflow == NetworkTargetOverflowAction.Error)
                 {
+                    InternalLogger.Debug("{0}: Discarded LogEvent because MessageSize={1} is above MaxMessageSize={2}", this, messageSize, MaxMessageSize);
                     continuation(new InvalidOperationException($"NetworkTarget: Discarded LogEvent because MessageSize={messageSize} is above MaxMessageSize={MaxMessageSize}"));
                     return;
                 }


fixed the exception will be thrown when stop status collector if it was not started before;

--- src/NRack.Server/BootstrapBase.cs
+++ src/NRack.Server/BootstrapBase.cs
@@ -148,8 +148,15 @@

         private void StopStatusCollect()
         {
-            m_StatusCollectTimer.Dispose();
-            m_StatusCollectTimer = null;
+            var timer = m_StatusCollectTimer;
+
+            if (timer != null)
+            {
+                if(Interlocked.CompareExchange(ref m_StatusCollectTimer, null, timer) == timer)
+                {
+                    timer.Dispose();
+                }
+            }
         }

         private void OnStatusCollectTimerCallback(object state)


enable support for cancelling bootstrapper

--- src/Paket.Bootstrapper/Program.cs
+++ src/Paket.Bootstrapper/Program.cs
@@ -13,27 +13,45 @@
         const string PaketVersionEnv = "PAKET.VERSION";
         const string SelfUpdateCommandArg = "--self";
         const string SilentCommandArg = "-s";
-
+
         static void Main(string[] args)
         {
+            Console.CancelKeyPress += CancelKeyPressed;
+
             var commandArgs = args;
-            bool preferNuget = false;
+            var preferNuget = false;
             if (commandArgs.Contains(PreferNugetCommandArg))
             {
                 preferNuget = true;
                 commandArgs = args.Where(x => x != PreferNugetCommandArg).ToArray();
             }
-            bool silent = false;
+            var silent = false;
             if (commandArgs.Contains(SilentCommandArg))
             {
                 silent = true;
                 commandArgs = args.Where(x => x != SilentCommandArg).ToArray();
             }
-            var dlArgs = EvaluateCommandArgs(commandArgs,silent);
+            var dlArgs = EvaluateCommandArgs(commandArgs, silent);

             var effectiveStrategy = GetEffectiveDownloadStrategy(dlArgs, preferNuget);
-
+
             StartPaketBootstrapping(effectiveStrategy, dlArgs, silent);
+        }
+
+        private static void CancelKeyPressed(object sender, ConsoleCancelEventArgs e)
+        {
+            Console.WriteLine("Bootstrapper cancelled");
+            var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+            var target = Path.Combine(folder, "paket.exe");
+
+            var exitCode = 1;
+            if (File.Exists(target))
+            {
+                var localVersion = BootstrapperHelper.GetLocalFileVersion(target);
+                Console.WriteLine("Detected existing paket.exe ({0}). Cancelling normally.", localVersion);
+                exitCode = 0;
+            }
+            Environment.Exit(exitCode);
         }

         private static void StartPaketBootstrapping(IDownloadStrategy downloadStrategy, DownloadArguments dlArgs, bool silent)
@@ -49,14 +67,14 @@
                 var localVersion = BootstrapperHelper.GetLocalFileVersion(dlArgs.Target);

                 var latestVersion = dlArgs.LatestVersion;
-                if (latestVersion == "")
+                if (latestVersion == String.Empty)
                 {
                     latestVersion = downloadStrategy.GetLatestVersion(dlArgs.IgnorePrerelease);
                 }

                 if (dlArgs.DoSelfUpdate)
                 {
-                    if(!silent)
+                    if (!silent)
                         Console.WriteLine("Trying self update");
                     downloadStrategy.SelfUpdate(latestVersion, silent);
                 }
@@ -122,7 +140,7 @@
             var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
             var target = Path.Combine(folder, "paket.exe");

-            var latestVersion = Environment.GetEnvironmentVariable(PaketVersionEnv) ?? "";
+            var latestVersion = Environment.GetEnvironmentVariable(PaketVersionEnv) ?? String.Empty;
             var ignorePrerelease = true;
             bool doSelfUpdate = false;
             var commandArgs = args;
@@ -137,7 +155,7 @@
                 if (commandArgs[0] == PrereleaseCommandArg)
                 {
                     ignorePrerelease = false;
-                    latestVersion = "";
+                    latestVersion = String.Empty;
                     if (!silent)
                         Console.WriteLine("Prerelease requested. Looking for latest prerelease.");
                 }


Fix shell-completion.yml to exclude unlisted targets for invocation

--- source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
+++ source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
@@ -6,6 +6,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using Nuke.Common.IO;
+using static Nuke.Common.Constants;

 namespace Nuke.Common.Execution
 {
@@ -18,9 +19,9 @@
         {
             var completionItems = new SortedDictionary<string, string[]>();

-            var targetNames = build.ExecutableTargets.Select(x => x.Name).OrderBy(x => x).ToList();
-            completionItems[Constants.InvokedTargetsParameterName] = targetNames.ToArray();
-            completionItems[Constants.SkippedTargetsParameterName] = targetNames.ToArray();
+            var targets = build.ExecutableTargets.OrderBy(x => x.Name).ToList();
+            completionItems[InvokedTargetsParameterName] = targets.Where(x => x.Listed).Select(x => x.Name).ToArray();
+            completionItems[SkippedTargetsParameterName] = targets.Select(x => x.Name).ToArray();

             var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false);
             foreach (var parameter in parameters)
@@ -33,9 +34,9 @@
                 completionItems[parameterName] = subItems?.ToArray();
             }

-            SerializationTasks.YamlSerializeToFile(completionItems, Constants.GetCompletionFile(NukeBuild.RootDirectory));
+            SerializationTasks.YamlSerializeToFile(completionItems, GetCompletionFile(NukeBuild.RootDirectory));

-            if (EnvironmentInfo.GetParameter<bool>(Constants.CompletionParameterName))
+            if (EnvironmentInfo.GetParameter<bool>(CompletionParameterName))
                 Environment.Exit(exitCode: 0);
         }
     }


Add detailed instruction for NuGet issues (#405)

--- source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
+++ source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
@@ -548,6 +548,10 @@
             // close error message, if needed
             if (!string.IsNullOrEmpty(errorMessage))
             {
+                errorMessage += "" + Environment.NewLine;
+                errorMessage += "If you are using PREVIEW versions of the NuGet packages, make sure you have our Azure Pipelines feed setup." + Environment.NewLine;
+                errorMessage += "See here for details: https://nanoframework.net/2018/05/16/setup-visual-studio-to-access-preview-versions-feed" + Environment.NewLine;
+                errorMessage += "" + Environment.NewLine;
                 errorMessage += "***************************************";
             }


Fix deployment provider (#331)

Fix deployment provider (#331)

--- source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
+++ source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
@@ -396,7 +396,7 @@
                                $"  2) if the project is referring the appropriate version of the assembly." + Environment.NewLine;
             }

-            if (string.IsNullOrEmpty(missingAssemblies))
+            if (!string.IsNullOrEmpty(missingAssemblies))
             {
                 errorMessage += missingAssemblies;
                 errorMessage += "Please check: " + Environment.NewLine +


Update PixelBandAccessor.cs

Update PixelBandAccessor.cs

--- src/RasterIO/PixelBandAccessor.cs
+++ src/RasterIO/PixelBandAccessor.cs
@@ -1,34 +1,23 @@
-// Copyright 2010 Green Code LLC
-// All rights reserved.
-//
-// The copyright holders license this file under the New (3-clause) BSD
-// License (the "License").  You may not use this file except in
-// compliance with the License.  A copy of the License is available at
-//
-//   http://www.opensource.org/licenses/BSD-3-Clause
-//
-// and is included in the NOTICE.txt file distributed with this work.
-//
-// Contributors:
+// Contributors:
 //   James Domingo, Green Code LLC

 using Landis.SpatialModeling;

-namespace Landis.RasterIO
-{
-    /// <summary>
-    /// Accessor for getting or seting a particular pixel band.
-    /// </summary>
-    public abstract class PixelBandAccessor<T>
-        where T : struct
-    {
-        protected Band<T> pixelBand;
-
-        protected PixelBandAccessor(PixelBand pixelBand)
-        {
-            this.pixelBand = pixelBand as Band<T>;
-            if (this.pixelBand == null)
-                throw new System.ArgumentException("pixelBand is not a Band<T>");
-        }
-    }
-}
+namespace Landis.RasterIO
+{
+    /// <summary>
+    /// Accessor for getting or seting a particular pixel band.
+    /// </summary>
+    public abstract class PixelBandAccessor<T>
+        where T : struct
+    {
+        protected Band<T> pixelBand;
+
+        protected PixelBandAccessor(PixelBand pixelBand)
+        {
+            this.pixelBand = pixelBand as Band<T>;
+            if (this.pixelBand == null)
+                throw new System.ArgumentException("pixelBand is not a Band<T>");
+        }
+    }
+}


Build MEF catalog from explicit types

Build MEF catalog from explicit types

--- src/ResXManager.VSIX/VSPackage.cs
+++ src/ResXManager.VSIX/VSPackage.cs
@@ -194,15 +194,12 @@
         }

         [NotNull]
-        [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom")]
         private LoaderMessages FillCatalog()
         {
             _compositionContainer.ComposeExportedValue(nameof(VsPackage), (IServiceProvider)this);
             _compositionContainer.ComposeExportedValue(Tracer);

-            var thisAssembly = GetType().Assembly;
-
-            var path = Path.GetDirectoryName(thisAssembly.Location);
+            var assembly = GetType().Assembly;

             var messages = new LoaderMessages();

@@ -217,26 +214,15 @@
             //    .Select(assembly => string.Format(CultureInfo.CurrentCulture, "Found assembly '{0}' already loaded from {1}.", assembly.FullName, assembly.CodeBase))
             //    .ToList();

-            // ReSharper disable once AssignNullToNotNullAttribute
-            foreach (var file in Directory.EnumerateFiles(path, @"ResXManager.*.dll"))
-            {
-                try
-                {
-                    var assembly = Assembly.LoadFrom(file);
-                    messages.Messages.Add(string.Format(CultureInfo.CurrentCulture, "Loaded assembly '{0}' from {1}.", assembly.FullName, assembly.CodeBase));
 #pragma warning disable CA2000 // Dispose objects before losing scope => AggregateCatalog will dispose all
-                    _compositionCatalog.Catalogs.Add(new AssemblyCatalog(assembly));
+            // ReSharper disable RedundantNameQualifier
+            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(assembly));
+            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Infrastructure.ITracer).Assembly));
+            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Model.GlobalExtensions).Assembly));
+            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Translators.AzureTranslator).Assembly));
+            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.View.Appearance).Assembly));
+            // ReSharper restore RedundantNameQualifier
 #pragma warning restore CA2000 // Dispose objects before losing scope
-                }
-                catch (ReflectionTypeLoadException ex)
-                {
-                    messages.Errors.Add("Assembly: " + Path.GetFileName(file) + " => " + string.Join("\n", ex.LoaderExceptions.Select(l => l.Message + ": " + (l.InnerException?.Message ?? string.Empty))));
-                }
-                catch (Exception ex)
-                {
-                    messages.Errors.Add("Assembly: " + Path.GetFileName(file) + " => " + ex.Message);
-                }
-            }

             _exportProviderLoaded.Set();


Minor code cleanup.

Minor code cleanup.

--- src/Server/Search/FileDatabase.cs
+++ src/Server/Search/FileDatabase.cs
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
@@ -17,6 +18,9 @@

 namespace VsChromium.Server.Search {
   public class FileDatabase {
+    /// <summary>
+    /// Note: For debugging purposes only.
+    /// </summary>
     private bool OutputDiagnostics = false;
     private readonly IProjectDiscovery _projectDiscovery;
     private readonly IFileSystemNameFactory _fileSystemNameFactory;
@@ -24,7 +28,6 @@
     private readonly IProgressTrackerFactory _progressTrackerFactory;
     private IList<DirectoryName> _directoryNames;
     private IList<FileName> _fileNames;
-    private FileSystemTree _fileSystemTree;
     private Dictionary<FileName, FileData> _files;
     private IList<FileData> _filesWithContents;
     private bool _frozen;
@@ -42,22 +45,26 @@

     public bool Frozen { get { return _frozen; } }

-    public FileSystemTree FileSystemTree { get { return _fileSystemTree; } }
-
     public Dictionary<FileName, FileData> Files { get { return _files; } }

+    public IList<FileName> FileNames { get { return _fileNames; } }
+
+    public IList<DirectoryName> DirectoryNames { get { return _directoryNames; } }
+
     public IList<FileData> FilesWithContents { get { return _filesWithContents; } }

-    public IList<FileName> FileNames { get { return _fileNames; } }
-
-    public IList<DirectoryName> DirectoryNames { get { return _directoryNames; } }
-
-    public void ComputeState(FileSystemTree newTree, FileDatabase oldState) {
+    public void ComputeState(FileDatabase previousFileDatabase, FileSystemTree newTree) {
+      if (previousFileDatabase == null)
+        throw new ArgumentNullException("previousFileDatabase");
+
+      if (newTree == null)
+        throw new ArgumentNullException("newTree");
+
       // Compute list of files from tree
       ComputeFileCollection(newTree);

       // Merge old state in new state
-      TransferUnchangedFileContents(oldState);
+      TransferUnchangedFileContents(previousFileDatabase);

       // Load file contents into newState
       ReadMissingFileContents();
@@ -89,8 +96,7 @@
       Logger.Log("Freezing FileDatabase state.");
       var sw = Stopwatch.StartNew();

-      if (_fileSystemTree == null) {
-        _fileSystemTree = FileSystemTree.Empty;
+      if (_files == null) {
         _files = new Dictionary<FileName, FileData>();
         _directoryNames = new List<DirectoryName>();
       }
@@ -128,7 +134,6 @@
       Logger.Log("Computing list of searchable files from FileSystemTree.");
       var sw = Stopwatch.StartNew();

-      _fileSystemTree = tree;
       _files = new Dictionary<FileName, FileData>();
       _directoryNames = new List<DirectoryName>();


Tweak adjusted advance ratio based on testing

--- src/SixLabors.Fonts/TextLayout.cs
+++ src/SixLabors.Fonts/TextLayout.cs
@@ -259,12 +259,12 @@

             // Recalculate the advance based upon the next line.
             // If larger, we want to scale it up to ensure it it pushed down far enough.
-            // We split the different exactly to line up the text at the exact vertical center.
+            // We split the different at 2/3 (heuristically determined value based upon extensive visual testing).
             if (!isFirstLine && !isLastLine)
             {
                 TextLine next = textBox.TextLines[index + 1];
                 float nextLineAdvance = textBox.ScaledMaxLineHeight(next.MaxPointSize) * options.LineSpacing;
-                scaledLineAdvance += (nextLineAdvance - scaledLineAdvance) * .5F;
+                scaledLineAdvance += (nextLineAdvance - scaledLineAdvance) * .667F;
             }

             float originX = location.X;
@@ -288,7 +288,7 @@
                             {
                                 TextLine next = textBox.TextLines[index + 1];
                                 float nextLineAdvance = textBox.ScaledMaxLineHeight(next.MaxPointSize);
-                                advance += (nextLineAdvance - advance) * .5F;
+                                advance += (nextLineAdvance - advance) * .667F;
                             }

                             offsetY -= advance * options.LineSpacing * .5F;
@@ -304,7 +304,7 @@
                             {
                                 TextLine next = textBox.TextLines[index + 1];
                                 float nextLineAdvance = textBox.ScaledMaxLineHeight(next.MaxPointSize);
-                                advance += (nextLineAdvance - advance) * .5F;
+                                advance += (nextLineAdvance - advance) * .667F;
                             }

                             offsetY -= advance * options.LineSpacing;


Improved Function name for adding an archive creator

--- src/Arkivverket.Arkade.UI/ViewModels/CreatePackageViewModel.cs
+++ src/Arkivverket.Arkade.UI/ViewModels/CreatePackageViewModel.cs
@@ -40,11 +40,11 @@
         private ObservableCollection<GuiMetaDataModel> _metaDataComments = new ObservableCollection<GuiMetaDataModel>();
         private ObservableCollection<GuiMetaDataModel> _metadataPreregistreredUsers = new ObservableCollection<GuiMetaDataModel>();

+        private GuiMetaDataModel _selectedCreatorDataModel;
         private GuiMetaDataModel _selectedTransfererDataModel;
         private GuiMetaDataModel _selectedProducerDataModel;
         private GuiMetaDataModel _selectedOwnerDataModel;
         private GuiMetaDataModel _selectedArchiveSystemDataModel;
-        private GuiMetaDataModel _selectedPreRegistreredUserDataModel;

         private readonly List<MetadataEntityInformationUnit> _metaDataEntityInformationUnits = new List<MetadataEntityInformationUnit>();
@@ -188,13 +188,13 @@
             }
         }

-        public GuiMetaDataModel SelectedPreRegistreredUserDataModel
-        {
-            get { return _selectedPreRegistreredUserDataModel; }
-            set
-            {
-                SetProperty(ref _selectedPreRegistreredUserDataModel, value);
-                MetaDataArchiveCreators.Add(_selectedPreRegistreredUserDataModel);
+        public GuiMetaDataModel SelectedCreatorDataModel
+        {
+            get { return _selectedCreatorDataModel; }
+            set
+            {
+                SetProperty(ref _selectedCreatorDataModel, value);
+                MetaDataArchiveCreators.Add(_selectedCreatorDataModel);
             }
         }