Made good use of ConnectChange in GTK's WizardDialog

--- Selene.Gtk/Selene.Gtk.Frontend/WizardDialog.cs
+++ Selene.Gtk/Selene.Gtk.Frontend/WizardDialog.cs
@@ -59,6 +59,7 @@
                     foreach(Control Cont in Subcat.Controls)
                     {
                         WidgetPair Add = ProcureState(Cont) as WidgetPair;
+                        Add.Converter.ConnectChange(Add, HandleChange);
                         Table.AddWidget(Add);
                         StateList.Add(Add);
                     }
@@ -70,14 +71,12 @@
                 Win.SetPageComplete(Table, true);
                 i++;
             }
-            Win.WidgetEvent += HandleWidgetEvent;
             State = StateList.ToArray();
         }

-        void HandleWidgetEvent(object o, WidgetEventArgs args)
+        void HandleChange(object o, EventArgs args)
         {
-            if(args.Event.Type == Gdk.EventType.KeyRelease || args.Event.Type == Gdk.EventType.LeaveNotify)
-                Revalidate();
+            Revalidate();
         }

         void Revalidate()


Formatting

Formatting

--- SimpleMvcSitemap.Tests/SitemapProviderTests.cs
+++ SimpleMvcSitemap.Tests/SitemapProviderTests.cs
@@ -123,6 +123,7 @@
         }

+
         [Test]
         public void CreateSitemapWithConfiguration_HttpContextIsNull_ThrowsException()
         {
@@ -172,8 +173,7 @@
             _config.Setup(item => item.CreateSitemapUrl(It.Is<int>(i => i <= 3))).Returns(string.Empty);

             Expression<Func<SitemapIndexModel, bool>> validateIndex = index => index.Nodes.Count == 3;
-            _actionResultFactory.Setup(item => item.CreateXmlResult(It.Is(validateIndex)))
-                                .Returns(_expectedResult);
+            _actionResultFactory.Setup(item => item.CreateXmlResult(It.Is(validateIndex))).Returns(_expectedResult);

             ActionResult result = _sitemapProvider.CreateSitemap(_httpContext.Object, sitemapNodes, _config.Object);


Improve reliability of Service Fabric HandlesSiloAdditionAndRemoval test (#3154)

--- test/TestServiceFabric/FabricMembershipOracleTests.cs
+++ test/TestServiceFabric/FabricMembershipOracleTests.cs
@@ -132,11 +132,11 @@
                     SiloAddress.New(new IPEndPoint(IPAddress.Loopback, 4), 2),
                     "OtherNewSilo"),
             };
-
-            listener.VersionReached.Reset();
-            listener.WaitForVersion = 4;
+
+            // The local silo transitioned to 'Joining' and then 'Active' and two other silos became 'Active',
+            // so the version must be 4
             this.resolver.Notify(silos);
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(4);
             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
             Assert.Equal(SiloStatus.Active, listener.Silos[silos[1].SiloAddress]);
@@ -154,9 +154,9 @@
             Assert.Equal(2, multiClusters.Count);

             // Remove a silo and verify that it's been removed.
-            listener.WaitForVersion = 5;
+            // The single removal will bump the version to 5.
             this.resolver.Notify(new[] {silos[1]});
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(5);
             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
             Assert.Equal(SiloStatus.Active, listener.Silos[silos[1].SiloAddress]);
@@ -168,7 +168,7 @@

             // Remove a silo and verify that it's been removed.
             this.resolver.Notify(new FabricSiloInfo[0]);
-            listener.VersionReached.WaitOne(TimeSpan.FromMinutes(1));
+            listener.WaitForVersion(6);

             Assert.Equal(3, listener.Silos.Count);
             Assert.Contains(silos[1].SiloAddress, listener.Silos.Keys);
@@ -214,9 +214,9 @@

         private class MockStatusListener : ISiloStatusListener
         {
-            public int Version { get; private set; }
-            public int WaitForVersion { get; set; }
-            public AutoResetEvent VersionReached { get; } = new AutoResetEvent(false);
+            private AutoResetEvent versionUpdated = new AutoResetEvent(false);
+
+            public int Version => this.Notifications.Count;
             public Dictionary<SiloAddress, SiloStatus> Silos { get; } = new Dictionary<SiloAddress, SiloStatus>();
             public List<Tuple<SiloAddress, SiloStatus>> Notifications { get; } = new List<Tuple<SiloAddress, SiloStatus>>();

@@ -224,8 +224,25 @@
             {
                 this.Notifications.Add(Tuple.Create(updatedSilo, status));
                 this.Silos[updatedSilo] = status;
-                this.Version++;
-                if (this.Version >= this.WaitForVersion) this.VersionReached.Set();
+                this.versionUpdated.Set();
+            }
+
+            public void WaitForVersion(int version)
+            {
+                while (version > this.Version)
+                {
+                    // If we are at the correct version, exit without waiting.
+                    if (this.Version >= version)
+                    {
+                        break;
+                    }
+
+                    // Wait to be pulsed by an incoming update.
+                    this.versionUpdated.WaitOne(TimeSpan.FromMinutes(1));
+                }
+
+                // Wake up any waiters to check the current version.
+                this.versionUpdated.Set();
             }
         }


no null list

no null list

--- SolrNet/Impl/SolrMoreLikeThisHandlerResults.cs
+++ SolrNet/Impl/SolrMoreLikeThisHandlerResults.cs
@@ -15,6 +15,10 @@
         /// <summary>
         /// Interesting terms in More-like-this query
         /// </summary>
-        public IList<KeyValuePair<string, float>> InterestingTerms { get; set; }
+        public IList<KeyValuePair<string, float>> InterestingTerms { get; set; }
+
+        public SolrMoreLikeThisHandlerResults() {
+            InterestingTerms = new List<KeyValuePair<string, float>>();
+        }
     }
 }


Fix unit test

Fix unit test

--- test/VisualStudio.Test/VsPackageSourceProviderTest.cs
+++ test/VisualStudio.Test/VsPackageSourceProviderTest.cs
@@ -429,8 +429,8 @@
   <disabledPackageSources>
     <add key=""Windows 8 Packages"" value=""true"" />
   </disabledPackageSources>
-</configuration>",
-                  configFileContent);
+</configuration>".Replace("\r", ""),
+                  configFileContent.Replace("\r", ""));
         }

         [Fact]
@@ -649,8 +649,8 @@
   <activePackageSource>
     <add key=""Windows 8 Packages"" value=""https://www.nuget.org/api/v2/curated-feeds/windows8-packages/"" />
   </activePackageSource>
-</configuration>",
-                  configFileContent);
+</configuration>".Replace("\r", ""),
+                  configFileContent.Replace("\r", ""));
         }

         private static void AssertPackageSource(PackageSource ps, string name, string source)


Fixed: Default for makeCollectionPropertiesTrackable

--- Source/ChangeTracking/ChangeTrackingFactory.cs
+++ Source/ChangeTracking/ChangeTrackingFactory.cs
@@ -8,7 +8,7 @@
         static ChangeTrackingFactory() => Default = new ChangeTrackingFactory();
         public static ChangeTrackingFactory Default { get; }

-        public ChangeTrackingFactory() : this(makeComplexPropertiesTrackable: true, makeCollectionPropertiesTrackable: false)
+        public ChangeTrackingFactory() : this(makeComplexPropertiesTrackable: true, makeCollectionPropertiesTrackable: true)
         {

         }


Added UniversitiesOfInterest to studentInfo model

--- Source/Data/Interapp.Data.Models/University.cs
+++ Source/Data/Interapp.Data.Models/University.cs
@@ -9,11 +9,13 @@
     public class University
     {
         private ICollection<StudentInfo> students;
+        private ICollection<StudentInfo> interestedStudents;
         private ICollection<Document> documentRequirements;

         public University()
         {
             this.students = new HashSet<StudentInfo>();
+            this.interestedStudents = new HashSet<StudentInfo>();
             this.documentRequirements = new HashSet<Document>();
         }

@@ -68,6 +70,20 @@
             }
         }

+        [InverseProperty("UniversitiesOfInterest")]
+        public virtual ICollection<StudentInfo> InterestedStudents
+        {
+            get
+            {
+                return this.interestedStudents;
+            }
+
+            set
+            {
+                this.interestedStudents = value;
+            }
+        }
+
         [InverseProperty("University")]
         public virtual ICollection<StudentInfo> Students
         {


Added models to context

Added models to context

--- Source/Data/Interapp.Data/InterappDbContext.cs
+++ Source/Data/Interapp.Data/InterappDbContext.cs
@@ -2,6 +2,7 @@
 {
     using Microsoft.AspNet.Identity.EntityFramework;
     using Models;
+    using System.Data.Entity;

     public class InterappDbContext : IdentityDbContext<User>
     {
@@ -10,6 +11,18 @@
         {
         }

+        public IDbSet<Country> Countries { get; set; }
+
+        public IDbSet<Document> Documents { get; set; }
+
+        public IDbSet<Essay> Essays { get; set; }
+
+        public IDbSet<Major> Majors { get; set; }
+
+        public IDbSet<Score> Scores { get; set; }
+
+        public IDbSet<University> Universities { get; set; }
+
         public static InterappDbContext Create()
         {
             return new InterappDbContext();


Update links to "Maximize WPF 3D Performance"

--- Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
+++ Source/HelixToolkit.Wpf/Helpers/MeshBuilder.cs
@@ -22,7 +22,7 @@
     /// Builds MeshGeometry3D objects.
     ///
     /// <remarks>
-    /// Performance tips for MeshGeometry3D (See MSDN)
+    /// Performance tips for MeshGeometry3D (See MSDN)
     /// <para>
     /// High impact:
     /// Mesh animation—changing the individual vertices of a mesh on a per-frame basis—is not always efficient in
@@ -2536,7 +2536,7 @@
         /// Checks the performance limits.
         ///
         /// <remarks>
-        /// See MSDN.
+        /// See MSDN.
         /// Try to keep mesh sizes under these limits:
         /// Positions : 20,001 point instances
         /// TriangleIndices : 60,003 integer instances


ObjReader: Support for multiple materials within the same group

--- Source/HelixToolkit.Wpf/Importers/ObjReader.cs
+++ Source/HelixToolkit.Wpf/Importers/ObjReader.cs
@@ -297,7 +297,13 @@
                             this.LoadMaterialLib(values);
                             break;
                         case "usemtl": // material name
+                            this.EnsureNewMesh();
+
                             this.SetMaterial(values);
+                            break;
+                        case "usemap": // texture map name
+                            this.EnsureNewMesh();
+
                             break;
                         case "bevel": // bevel interpolation
                         case "c_interp": // color interpolation
@@ -432,6 +438,18 @@
         }

         /// <summary>
+        /// Ensures that a new mesh is created.
+        /// </summary>
+        private void EnsureNewMesh()
+        {
+            if (this.CurrentGroup.MeshBuilder.TriangleIndices.Count != 0)
+            {
+                this.CurrentGroup.AddMesh();
+                this.smoothingGroupMaps.Clear();
+            }
+        }
+
+        /// <summary>
         /// Sets the smoothing group number.
         /// </summary>
         /// <param name="values">The group number.</param>
@@ -676,8 +694,10 @@
             var modelGroup = new Model3DGroup();
             foreach (var g in this.Groups)
             {
-                var gm = new GeometryModel3D { Geometry = g.MeshBuilder.ToMesh(), Material = g.Material, BackMaterial = g.Material };
-                modelGroup.Children.Add(gm);
+                foreach (var gm in g.CreateModels())
+                {
+                    modelGroup.Children.Add(gm);
+                }
             }

             return modelGroup;
@@ -857,6 +877,16 @@
         /// </summary>
         public class Group
         {
+            /// <summary>
+            /// List of mesh builders.
+            /// </summary>
+            private readonly IList<MeshBuilder> meshBuilders;
+
+            /// <summary>
+            /// List of materials.
+            /// </summary>
+            private readonly IList<Material> materials;
+
             #region Constructors and Destructors

             /// <summary>
@@ -868,8 +898,9 @@
             public Group(string name)
             {
                 this.Name = name;
-                this.Material = MaterialHelper.CreateMaterial(Brushes.Green);
-                this.MeshBuilder = new MeshBuilder(true, true);
+                this.meshBuilders = new List<MeshBuilder>();
+                this.materials = new List<Material>();
+                this.AddMesh();
             }

             #endregion
@@ -877,24 +908,64 @@
             #region Public Properties

             /// <summary>
-            ///   Gets or sets the material.
+            ///   Sets the material.
             /// </summary>
             /// <value>The material.</value>
-            public Material Material { get; set; }
-
-            /// <summary>
-            ///   Gets or sets the mesh builder.
+            public Material Material
+            {
+                set
+                {
+                    this.materials[this.materials.Count - 1] = value;
+                }
+            }
+
+            /// <summary>
+            ///   Gets the mesh builder for the current mesh.
             /// </summary>
             /// <value>The mesh builder.</value>
-            public MeshBuilder MeshBuilder { get; set; }
-
-            /// <summary>
-            ///   Gets or sets the name.
+            public MeshBuilder MeshBuilder
+            {
+                get
+                {
+                    return this.meshBuilders[this.meshBuilders.Count - 1];
+                }
+            }
+
+            /// <summary>
+            ///   Gets or sets the group name.
             /// </summary>
             /// <value>The name.</value>
             public string Name { get; set; }

             #endregion
+
+            /// <summary>
+            /// Adds a mesh.
+            /// </summary>
+            public void AddMesh()
+            {
+                var meshBuilder = new MeshBuilder(true, true);
+                this.meshBuilders.Add(meshBuilder);
+                this.materials.Add(HelixToolkit.Wpf.Materials.Green);
+            }
+
+            /// <summary>
+            /// Creates the models of the group.
+            /// </summary>
+            /// <returns>The models.</returns>
+            public IEnumerable<Model3D> CreateModels()
+            {
+                for (int i = 0; i < this.meshBuilders.Count; i++)
+                {
+                    yield return
+                        new GeometryModel3D
+                            {
+                                Geometry = this.meshBuilders[i].ToMesh(),
+                                Material = this.materials[i],
+                                BackMaterial = this.materials[i]
+                            };
+                }
+            }
         }

         /// <summary>


[Package Explorer] Ask for confirmation before deleting content.

--- Tools/NuGet/NuGetPackageExplorer/PackageViewModel/PackagePart/PackagePart.cs
+++ Tools/NuGet/NuGetPackageExplorer/PackageViewModel/PackagePart/PackagePart.cs
@@ -100,6 +100,10 @@
         }

         public void Delete() {
+            bool confirm = PackageViewModel.MessageBox.Confirm("Are you sure you want to delete it?");
+            if (!confirm) {
+                return;
+            }

             if (Parent != null) {
                 Parent.Children.Remove(this);


- Service.Dispose() is now virtual.

- Service.Dispose() is now virtual.

--- Unity/Assets/GameFramework/Services/_GenPrototypeService/PrototypeService.cs
+++ Unity/Assets/GameFramework/Services/_GenPrototypeService/PrototypeService.cs
@@ -91,7 +91,7 @@

         bool isDisposed = false;

-        public void Dispose() {
+        public virtual void Dispose() {
             if (isDisposed || Kernel.applicationQuitting) return;
             isDisposed = true;
             disposables.Dispose();


Dummy checkin

Dummy checkin

--- src/GitLink/Pdb/PdbFile.cs
+++ src/GitLink/Pdb/PdbFile.cs
@@ -57,6 +57,7 @@
             get { return Info.NameToPdbName.ContainsKey(SrcSrvContent); }
         }

+
         public int SrcSrv
         {
             get { return Info.NameToPdbName[SrcSrvContent].Stream; }


Move Force.MassByAccelerationEqualsForce overload with double out of the WinRT compiled code

--- UnitsNet/CustomCode/UnitClasses/Force.extra.cs
+++ UnitsNet/CustomCode/UnitClasses/Force.extra.cs
@@ -58,6 +58,11 @@
             double newtons = p.Pascals*metersSquared;
             return new Force(newtons);
         }
+
+        public static Force FromMassByAcceleration(Mass mass, double metersPerSecondSquared)
+        {
+          return new Force(mass.Kilograms * metersPerSecondSquared);
+        }
 #endif

         public static Force FromPressureByArea(Pressure p, Area area)
@@ -66,11 +71,6 @@
             return new Force(newtons);
         }

-        public static Force FromMassByAcceleration(Mass mass, double metersPerSecondSquared)
-        {
-            return new Force(mass.Kilograms*metersPerSecondSquared);
-        }
-
         public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration)
         {
             return new Force(mass.Kilograms * acceleration.MeterPerSecondSquared);


Removed the gameserver running check as you should be able to have multiple gameservers running for one loginserver

--- src/L2dotNET/GameServer.cs
+++ src/L2dotNET/GameServer.cs
@@ -31,8 +31,6 @@

         public void Start()
         {
-            CheckRunningProcesses();
-
             Config.Config.Instance.Initialize();

             PreReqValidation.Instance.Initialize();
@@ -122,16 +120,5 @@
         {
             ClientManager.Instance.AddClient(clientSocket);
         }
-
-        private void CheckRunningProcesses()
-        {
-            if (Process.GetProcessesByName("L2dotNET.GameService").Length == 1)
-                return;
-
-            Log.Fatal("A L2dotNET.GameService process is already running!");
-            Log.Info("Press ENTER to exit...");
-            Console.Read();
-            Environment.Exit(0);
-        }
     }
 }


Update LocalizationStartup.cs

Update LocalizationStartup.cs

--- src/LocalizationStartup.cs
+++ src/LocalizationStartup.cs
@@ -1,4 +1,4 @@
-// @yasinkuyu
+// @yasinkuyu
 // 05/08/2014

 using System;
@@ -50,7 +50,7 @@
         /// </summary>
         /// <param id="id">Xml localization item id</param>
         /// <returns></returns>
-        public string GetLang(string id)
+        public string GetLang(string id, string _culture = "")
         {
             ReadCookie();

@@ -64,6 +64,9 @@

             if (string.IsNullOrEmpty(xmlFolderName))
                 Folder = xmlFolderName;
+
+            if (string.IsNullOrEmpty(_culture))
+                Culture = _culture;

             string applicationName = string.Format("{0}_{1}_", Culture, uniqueApplicationName);

@@ -112,4 +115,4 @@
             return null;
         }
     }
-}+}


Poll better, faster, stronger :muscle:

Poll better, faster, stronger :muscle:

--- src/MindstormR.EV3/Main.cs
+++ src/MindstormR.EV3/Main.cs
@@ -16,7 +16,7 @@
 {
     class MainClass
     {
-        private const string baseUrl = "http://test.henkmollema.nl/robot/";
+        private const string BaseUrl = "http://test.henkmollema.nl/robot/";
         private static int _id;

         public static void Main(string[] args)
@@ -36,7 +36,7 @@

                 var sw = Stopwatch.StartNew();
                 var client = new WebClient();
-                string s = client.DownloadString(baseUrl + "login");
+                string s = client.DownloadString(BaseUrl + "login");
                 sw.Stop();

                 if (!int.TryParse(s, out _id))
@@ -62,13 +62,13 @@
                     // Get the new command and push the sensor data in one go.
                     string command = client.DownloadString(
                                          string.Format("{0}/{1}/command?touch={2}&gyro={3}&color={4}&ir={5}&battery={6}",
-                                             baseUrl,
+                                             BaseUrl,
                                              _id,
                                              touchSensor.ReadAsString(),
                                              gyroSensor.ReadAsString(),
                                              colorSensor.ReadAsString(),
                                              irSensor.ReadAsString(),
-                                             (int)(Battery.Current * 1000)));
+                                             (int)(Battery.Current * 100)));
                     sw.Stop();

                     Info("Command: '{0}' ({1:n2}ms)", false, "Robot " + _id, command, sw.Elapsed.TotalMilliseconds);
@@ -101,12 +101,12 @@
                     }

                     // todo: consider using signalr for this -> #18
-                    Thread.Sleep(250);
+                    Thread.Sleep(100);
                 }

                 vehicle.Off();
                 Info("Logging out...", false, "Robot " + _id);
-                client.DownloadString(baseUrl + _id + "/logout");
+                client.DownloadString(BaseUrl + _id + "/logout");
                 Info("Logged out", false, "Robot " + _id);
                 terminateProgram.WaitOne();
             }


Added test

Added test

Returns moveNext so fails)

--- tests/NLog.UnitTests/LayoutRenderers/CallSiteTests.cs
+++ tests/NLog.UnitTests/LayoutRenderers/CallSiteTests.cs
@@ -31,6 +31,9 @@
 // THE POSSIBILITY OF SUCH DAMAGE.
 //

+using System.IO;
+using System.Threading.Tasks;
+
 namespace NLog.UnitTests.LayoutRenderers
 {
     using System;
@@ -191,7 +194,7 @@
             MethodBase currentMethod = MethodBase.GetCurrentMethod();
             AssertDebugLastMessage("debug", currentMethod.DeclaringType.FullName.Substring(0, 3) + " msg");
         }
-
+
         [Fact]
         public void ClassNameWithPaddingTestPadLeftAlignRightTest()
         {
@@ -549,6 +552,35 @@
         }

+        [Fact]
+        public void Show_correct_method_with_async()
+        {
+
+            //namespace en name of current method
+            const string currentMethodFullName = "NLog.UnitTests.LayoutRenderers.CallSiteTests.Show_correct_method_with_async";
+
+            LogManager.Configuration = CreateConfigurationFromString(@"
+           <nlog>
+               <targets><target name='debug' type='Debug' layout='${callsite}|${message}' /></targets>
+               <rules>
+                   <logger name='*' levels='Warn' writeTo='debug' />
+               </rules>
+           </nlog>");
+
+            AsyncMethod().Wait();
+            AssertDebugLastMessage("debug", string.Format("{0}|direct", currentMethodFullName));
+
+        }
+
+        private async Task AsyncMethod()
+        {
+            var findFile = new FileInfo("test.txt");
+            var logger = LogManager.GetCurrentClassLogger();
+            logger.Warn("direct");
+            var reader = new StreamReader(new MemoryStream(new byte[0]));
+            await reader.ReadLineAsync();
+        }
+

         public class CompositeWrapper
         {


Fix deadlock in integration test

Fix deadlock in integration test

--- tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
+++ tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
@@ -89,7 +89,7 @@
 			var killTask = Task.Run(() =>
 			{
 				killTaskStarted.SetResult(null);
-				while (jobTcs.Task?.IsCompleted != true)
+				while (!jobTcs.Task.IsCompleted)
 					KillDD(false);
 			});

@@ -98,12 +98,12 @@
 			{
 				await killTaskStarted.Task;
 				var dumpTask = instanceClient.DreamDaemon.CreateDump(cancellationToken);
+				job = await WaitForJob(await dumpTask, 20, true, null, cancellationToken);
+			}
+			finally
+			{
+				jobTcs.SetResult(null);
 				await killTask;
-				job = await WaitForJob(await dumpTask, 20, true, null, cancellationToken);
-			}
-			finally
-			{
-				jobTcs.SetResult(null);
 			}
 			Assert.IsTrue(job.ErrorCode == ErrorCode.DreamDaemonOffline || job.ErrorCode == ErrorCode.GCoreFailure, $"{job.ErrorCode}: {job.ExceptionDetails}");
 			await Task.Delay(TimeSpan.FromSeconds(20), cancellationToken);


another fix

another fix

--- src/NadekoBot/NadekoBot.cs
+++ src/NadekoBot/NadekoBot.cs
@@ -28,6 +28,7 @@
 using System.IO;
 using NadekoBot.Services.Pokemon;
 using NadekoBot.DataStructures;
+using NadekoBot.Extensions;

 namespace NadekoBot
 {


better logs?

better logs?

--- src/NadekoBot/NadekoBot.cs
+++ src/NadekoBot/NadekoBot.cs
@@ -7,6 +7,7 @@
 using NLog.Config;
 using NLog.Targets;
 using System;
+using System.Diagnostics;
 using System.Linq;
 using System.Reflection;
 using System.Threading.Tasks;
@@ -94,14 +95,41 @@
         {
             var throwaway = Task.Run(async () =>
             {
+                var sw = new Stopwatch();
+                sw.Start();
                 var t = await Commands.Execute(imsg, imsg.Content);
+                sw.Stop();
+                var channel = (imsg.Channel as ITextChannel);
                 if (t.IsSuccess)
                 {
-                    _log.Info("Command Executed\n\tFull Message: {0}",imsg.Content);
+
+                    _log.Info("Command Executed after {4}s\n\t" +
+                              "User: {0}\n\t" +
+                              "Server: {1}\n\t" +
+                              "Channel: {2}\n\t" +
+                              "Message: {3}",
+                              imsg.Author + " [" + imsg.Author.Id + "]\n\t", // {0}
+                              (channel == null ? "PRIVATE" : channel.Guild.Name + " [" + channel.Guild.Id + "]") + "\n\t", // {1}
+                              (channel == null ? "PRIVATE" : channel.Name + " [" + channel.Id + "]") + "\n\t", //{2}
+                              imsg.Content, // {3}
+                              sw.Elapsed.TotalSeconds // {4}
+                              );
                 }
                 else if (!t.IsSuccess && t.Error != CommandError.UnknownCommand)
                 {
-                    _log.Warn("Command errored!\n\tFull Message: {0}\n\tError:{1}", imsg.Content, t.ErrorReason);
+                    _log.Warn("Command Errored after {5}s\n\t" +
+                              "User: {0}\n\t" +
+                              "Server: {1}\n\t" +
+                              "Channel: {2}\n\t" +
+                              "Message: {3}\n\t" +
+                              "Error: {4}",
+                              imsg.Author + " [" + imsg.Author.Id + "]\n\t", // {0}
+                              (channel == null ? "PRIVATE" : channel.Guild.Name + " [" + channel.Guild.Id + "]") + "\n\t", // {1}
+                              (channel == null ? "PRIVATE" : channel.Name + " [" + channel.Id + "]") + "\n\t", //{2}
+                              imsg.Content,// {3}
+                              t.ErrorReason, // {4}
+                              sw.Elapsed.TotalSeconds //{5}
+                              );
                 }
             });


Datahub: Update MeterActivity tab to only query meters a user has access to.

--- src/PQDashboard/DataHub.cs
+++ src/PQDashboard/DataHub.cs
@@ -1683,6 +1683,10 @@

         public IEnumerable<MeterActivity> QueryMeterActivity(DateTime startTime, string orderBy, int numberOfResults, bool ascending = false)
         {
+            string userSID = UserInfo.UserNameToSID(Context.User.Identity.Name);
+            if (DataContext.Connection.ExecuteScalar<int>("SELECT COUNT(*) FROM UserAccount WHERE Name = {0}", userSID) == 0)
+                userSID = "External";
+
             string order;
             order = ascending ? "ASC" : "DESC";

@@ -1708,7 +1712,10 @@
 		                                    (CASE WHEN E180D.EventCount IS NULL THEN 0 ELSE E180D.EventCount END) AS Events180Days,
                                             FirstEvent.EventID AS FirstEventID

-                                    FROM	Meter AS m LEFT OUTER JOIN
+                                    FROM	(SELECT me.*
+                                            FROM UserMeter u JOIN Meter me ON u.MeterID=me.ID
+                                            WHERE u.UserName=@userSID) AS m LEFT OUTER JOIN
+
 		                                    (SELECT m.ID, COUNT(e.ID) AS EventCount
 		                                    FROM Meter m LEFT OUTER JOIN Event e on m.ID=e.MeterID
 		                                    WHERE e.StartTime <= @StartTime AND e.StartTime >= DATEADD(HH,-24,@StartTime)
@@ -1717,22 +1724,22 @@
 	                                        (SELECT m.ID, COUNT(e.ID) AS EventCount
 		                                    FROM Meter m LEFT OUTER JOIN Event e on m.ID=e.MeterID
 		                                    WHERE e.StartTime <= @StartTime AND e.StartTime >= DATEADD(DD,-7,@StartTime)
-		                                    GROUP BY m.ID) AS E7D ON E24H.ID=E7D.ID LEFT OUTER JOIN
+		                                    GROUP BY m.ID) AS E7D ON m.ID=E7D.ID LEFT OUTER JOIN

                                         	(SELECT m.ID, COUNT(e.ID) AS EventCount
 		                                    FROM Meter m LEFT OUTER JOIN Event e on m.ID=e.MeterID
 		                                    WHERE e.StartTime <= @StartTime AND e.StartTime >= DATEADD(DD,-30,@StartTime)
-		                                    GROUP BY m.ID) AS E30D ON E24H.ID=E30D.ID LEFT OUTER JOIN
+		                                    GROUP BY m.ID) AS E30D ON m.ID=E30D.ID LEFT OUTER JOIN

 	                                        (SELECT m.ID, COUNT(e.ID) AS EventCount
 		                                    FROM Meter m LEFT OUTER JOIN Event e on m.ID=e.MeterID
 		                                    WHERE e.StartTime <= @StartTime AND e.StartTime >= DATEADD(DD,-90,@StartTime)
-		                                    GROUP BY m.ID) AS E90D ON E30D.ID=E90D.ID LEFT OUTER JOIN
+		                                    GROUP BY m.ID) AS E90D ON m.ID=E90D.ID LEFT OUTER JOIN

                                         	(SELECT m.ID, COUNT(e.ID) AS EventCount
 		                                    FROM Meter m LEFT OUTER JOIN Event e on m.ID=e.MeterID
 		                                    WHERE e.StartTime <= @StartTime AND e.StartTime >= DATEADD(DD,-180,@StartTime)
-		                                    GROUP BY m.ID) AS E180D ON E30D.ID=E180D.ID LEFT OUTER JOIN
+		                                    GROUP BY m.ID) AS E180D ON m.ID=E180D.ID LEFT OUTER JOIN

                                             (SELECT Meter.ID, FirstEvent.EventID
                                             FROM Meter LEFT OUTER JOIN
@@ -1752,6 +1759,11 @@
                 param1.ParameterName = "@StartTime";
                 param1.Value = startTime;
                 sc.Parameters.Add(param1);
+
+                IDbDataParameter param2 = sc.CreateParameter();
+                param2.ParameterName = "@userSID";
+                param2.Value = userSID;
+                sc.Parameters.Add(param2);

                 IDataReader rdr = sc.ExecuteReader();
                 table.Load(rdr);


Offer more overridable flexibility in Command

--- src/Peasy/Peasy/Command.cs
+++ src/Peasy/Peasy/Command.cs
@@ -13,13 +13,13 @@
         /// <summary>
         /// Synchronously orchestrates command initialization, rule execution, and command execution
         /// </summary>
-        public ExecutionResult Execute()
+        public virtual ExecutionResult Execute()
         {
             OnInitialization();

             var validationResults = GetErrors().ToArray();
             if (validationResults.Any())
-                return new ExecutionResult { Success = false, Errors = validationResults };
+                return OnFailedExecution(validationResults);

             try
             {
@@ -27,22 +27,32 @@
             }
             catch (ServiceException ex)
             {
-                return new ExecutionResult { Success = false, Errors = new ValidationResult[] { new ValidationResult(ex.Message) }};
-            }
-
+                return OnFailedExecution(new [] { new ValidationResult(ex.Message) });
+            }
+
+            return OnSuccessfulExecution();
+        }
+
+        protected virtual ExecutionResult OnFailedExecution(ValidationResult[] validationResults)
+        {
+            return new ExecutionResult { Success = false, Errors = validationResults };
+        }
+
+        protected virtual ExecutionResult OnSuccessfulExecution()
+        {
             return new ExecutionResult { Success = true };
         }

         /// <summary>
         /// Asynchronously orchestrates command initialization, rule execution, and command execution
         /// </summary>
-        public async Task<ExecutionResult> ExecuteAsync()
+        public virtual async Task<ExecutionResult> ExecuteAsync()
         {
             await OnInitializationAsync();

-            var validationResults = await GetErrorsAsync();
-            if (validationResults.ToArray().Any())
-                return new ExecutionResult { Success = false, Errors = validationResults };
+            var validationResults = (await GetErrorsAsync()).ToArray();
+            if (validationResults.Any())
+                return OnFailedExecution(validationResults);

             try
             {
@@ -50,10 +60,10 @@
             }
             catch (ServiceException ex)
             {
-                return new ExecutionResult { Success = false, Errors = new ValidationResult[] { new ValidationResult(ex.Message) }};
-            }
-
-            return new ExecutionResult { Success = true };
+                return OnFailedExecution(new [] { new ValidationResult(ex.Message) });
+            }
+
+            return OnSuccessfulExecution();
         }

         /// <summary>
@@ -101,13 +111,13 @@
         /// <summary>
         /// Synchronously orchestrates command initialization, rule execution, and command execution
         /// </summary>
-        public ExecutionResult<T> Execute()
+        public virtual ExecutionResult<T> Execute()
         {
             OnInitialization();

             var validationResults = GetErrors().ToArray();
             if (validationResults.Any())
-                return new ExecutionResult<T> { Success = false, Errors = validationResults };
+                return OnFailedExecution(validationResults);

             T result;
             try
@@ -116,22 +126,22 @@
             }
             catch (ServiceException ex)
             {
-                return new ExecutionResult<T> { Success = false, Errors = new ValidationResult[] { new ValidationResult(ex.Message) }};
-            }
-
-            return new ExecutionResult<T> { Success = true, Value = result };
+                return OnFailedExecution(new [] { new ValidationResult(ex.Message) });
+            }
+
+            return OnSuccessfulExecution(result);
         }

         /// <summary>
         /// Asynchronously orchestrates command initialization, rule execution, and command execution
         /// </summary>
-        public async Task<ExecutionResult<T>> ExecuteAsync()
+        public virtual async Task<ExecutionResult<T>> ExecuteAsync()
         {
             await OnInitializationAsync();

-            var validationResults = await GetErrorsAsync();
-            if (validationResults.ToArray().Any())
-                return new ExecutionResult<T> { Success = false, Errors = validationResults };
+            var validationResults = (await GetErrorsAsync()).ToArray();
+            if (validationResults.Any())
+                return OnFailedExecution(validationResults);

             T result;
             try
@@ -140,10 +150,20 @@
             }
             catch (ServiceException ex)
             {
-                return new ExecutionResult<T> { Success = false, Errors = new ValidationResult[] { new ValidationResult(ex.Message) }};
-            }
-
-            return new ExecutionResult<T> { Success = true, Value = result };
+                return OnFailedExecution(new [] { new ValidationResult(ex.Message) } );
+            }
+
+            return OnSuccessfulExecution(result);
+        }
+
+        protected virtual ExecutionResult<T> OnFailedExecution(ValidationResult[] validationResults)
+        {
+            return new ExecutionResult<T> { Success = false, Errors = validationResults };
+        }
+
+        protected virtual ExecutionResult<T> OnSuccessfulExecution(T value)
+        {
+            return new ExecutionResult<T> { Success = true, Value = value };
         }

         /// <summary>


Delete QueryableExtensions.cs

Delete QueryableExtensions.cs

no longer needed as EnumerableExtensions optimises for IQueryable, saves duplicated code

--- src/QueryableExtensions.cs
+++ src/QueryableExtensions.cs
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace HallLibrary.Extensions
-{
-	/// <summary>
-	/// Contains static methods for working with queryables.
-	/// </summary>
-	public static class QueryableExtensions
-	{
-		#region Count
-			/// <summary>
-			/// Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> exceeds the specified <paramref name="count"/>, querying only the minimum number of elements in the source necessary to determine the answer.
-			/// </summary>
-			/// <typeparam name="T">The type of elements in the queryable.</typeparam>
-			/// <param name="queryable">The queryable source to check.</param>
-			/// <param name="count">The count to exceed.</param>
-			/// <returns>Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> exceeds the specified <paramref name="count"/>.</returns>
-			public static bool CountExceeds<T>(this IQueryable<T> queryable, int count)
-			{
-				return queryable.Take(count + 1).Count() > count;
-			}
-
-			/// <summary>
-			/// Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> equals the specified <paramref name="count"/>, querying only the minimum number of elements in the source necessary to determine the answer.
-			/// </summary>
-			/// <typeparam name="T">The type of elements in the queryable.</typeparam>
-			/// <param name="queryable">The queryable source to check.</param>
-			/// <param name="count">The count to match.</param>
-			/// <returns>Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> equals the specified <paramref name="count"/>.</returns>
-			public static bool CountEquals<T>(this IQueryable<T> queryable, int count)
-			{
-				// note that this works because if there are more items than count, we just take one extra and compare it, which will return false
-				// if there are less items, it will return false
-				// and if there are count items, it can only take count, so the comparison will succeed
-				return queryable.Take(count + 1).Count() == count;
-			}
-
-
-			/// <summary>
-			/// Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> is less than the specified <paramref name="count"/>, querying only the minimum number of elements in the source necessary to determine the answer.
-			/// </summary>
-			/// <typeparam name="T">The type of elements in the queryable.</typeparam>
-			/// <param name="queryable">The queryable source to check.</param>
-			/// <param name="count">The count to compare.</param>
-			/// <returns>Returns <c>true</c> if the number of elements in the <paramref name="queryable"/> is less than the specified <paramref name="count"/>.</returns>
-			public static bool CountIsLessThan<T>(this IEnumerable<T> queryable, int count)
-			{
-				return queryable.Take(count).Count() < count;
-			}
-		#endregion
-	}
-}


Fix BatchUpdate for Pomelo.MySql

Fix BatchUpdate for Pomelo.MySql

--- src/shared/Z.EF.Plus.BatchUpdate.Shared/BatchUpdate.cs
+++ src/shared/Z.EF.Plus.BatchUpdate.Shared/BatchUpdate.cs
@@ -1459,11 +1459,15 @@
                     valueSql = valueSql.Trim();

 					if (updateFactory.Parameters != null && updateFactory.Parameters.Count == 1)
-					{
-						valueSql = valueSql.Replace("[" +updateFactory.Parameters.First().Name +"]", "B");
+					{
+                        string name = updateFactory.Parameters.First().Name;
+                        valueSql = valueSql.Replace($"`{name}`", "B");
+                        valueSql = valueSql.Replace($"[{name}]", "B");
 					}

 					// Add the destination name
+					valueSql = valueSql.Replace("`x`", "B");
+					valueSql = valueSql.Replace("`c`", "B");
 					valueSql = valueSql.Replace("[x]", "B");
                     valueSql = valueSql.Replace("[c]", "B");


factored

factored

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -379,16 +379,6 @@
   }

   private void DrawMainWindow(int window_id) {
-    UnityEngine.GUIStyle style = new UnityEngine.GUIStyle(
-        UnityEngine.GUI.skin.button);
-    style.normal.textColor = style.focused.textColor = UnityEngine.Color.white;
-    style.hover.textColor = style.active.textColor = UnityEngine.Color.yellow;
-    style.onNormal.textColor  = UnityEngine.Color.green;
-    style.onFocused.textColor = UnityEngine.Color.green;
-    style.onHover.textColor   = UnityEngine.Color.green;
-    style.onActive.textColor  = UnityEngine.Color.green;
-    style.padding             = new UnityEngine.RectOffset(8, 8, 8, 8);
-
     UnityEngine.GUILayout.BeginVertical();
     String plugin_state;
     if (PluginRunning()) {
@@ -419,34 +409,34 @@
           last_plugin_reset_.ToUniversalTime().ToString("O");
     }
     UnityEngine.GUILayout.TextArea(last_reset_information);
-    String reference_frame_selection_toggle =
-        show_reference_frame_selection_ ? "↑ Reference Frame Selection ↑"
-                                        : "↓ Reference Frame Selection ↓";
-    if (UnityEngine.GUILayout.Button(reference_frame_selection_toggle)) {
-      show_reference_frame_selection_ = !show_reference_frame_selection_;
-      if (!show_reference_frame_selection_) {
-        ShrinkMainWindow();
-      }
-    }
-    if (show_reference_frame_selection_) {
-      ReferenceFrameSelection();
-    }
-    String logging_settings_toggle =
-        show_logging_settings_ ? "↑ Logging Settings ↑"
-                               : "↓ Logging Settings ↓";
-    if (UnityEngine.GUILayout.Button(logging_settings_toggle)) {
-      show_logging_settings_ = !show_logging_settings_;
-      if (!show_logging_settings_) {
-        ShrinkMainWindow();
-      }
-    }
-    if (show_logging_settings_) {
-      LoggingSettings();
-    }
+    ToggleableSection(name   : "Reference Frame Selection",
+                      show   : ref show_reference_frame_selection_,
+                      render : ReferenceFrameSelection);
+    ToggleableSection(name   : "Logging Settings",
+                      show   : ref show_logging_settings_,
+                      render : LoggingSettings);
     UnityEngine.GUILayout.EndVertical();
     UnityEngine.GUI.DragWindow(
         position : new UnityEngine.Rect(left : 0f, top : 0f, width : 10000f,
-                                        height : 20f));
+                                        height : 10000f));
+  }
+
+  delegate void GUIRenderer();
+
+  private void ToggleableSection(String name,
+                                 ref bool show,
+                                 GUIRenderer render) {
+    String toggle = show ? "↑ " + name + " ↑"
+                         : "↓ " + name + " ↓";
+    if (UnityEngine.GUILayout.Button(toggle)) {
+      show = !show;
+      if (!show) {
+        ShrinkMainWindow();
+      }
+    }
+    if (show) {
+      render();
+    }
   }

   private void ReferenceFrameSelection() {
@@ -466,8 +456,9 @@
           "the nonrotating reference frame fixing the centre of " +
           FlightGlobals.Bodies[first_selected_celestial_].theName + ".";
     }
-    UnityEngine.GUILayout.TextArea(text: reference_frame_description);
-    UnityEngine.GUILayout.Label(text : "Reference frame selection:");
+    UnityEngine.GUILayout.TextArea(
+        text    : reference_frame_description,
+        options : UnityEngine.GUILayout.Height(100));
     foreach (CelestialBody celestial in FlightGlobals.Bodies) {
       bool changed_rendering = false;
       UnityEngine.GUILayout.BeginHorizontal();


add readonly to SdmapTagger.cs

add readonly to SdmapTagger.cs

--- sdmap/src/sdmap.vstool/Tagger/SdmapTagger.cs
+++ sdmap/src/sdmap.vstool/Tagger/SdmapTagger.cs
@@ -15,11 +15,12 @@
 {
     sealed class SdmapTagger : ITagger<ClassificationTag>
     {
-        private ISdmapLexer lexer;
-        private ITextBuffer buffer;
-        private IStandardClassificationService standardClassificationService;
+        private readonly ISdmapLexer lexer;
+        private readonly ITextBuffer buffer;
+        private readonly IStandardClassificationService standardClassificationService;
+        private readonly SortedList<int, TagSpan<ClassificationTag>> tokenBuffer = new SortedList<int, TagSpan<ClassificationTag>>();
+
         public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-        private SortedList<int, TagSpan<ClassificationTag>> tokenBuffer = new SortedList<int, TagSpan<ClassificationTag>>();

         public SdmapTagger(ISdmapLexer lexer, ITextBuffer buffer, IStandardClassificationService standardClassificationService)
         {


Add basic unit test for feature report

Add basic unit test for feature report

--- source/Htc.Vita.Core.Tests/UsbManagerTest.cs
+++ source/Htc.Vita.Core.Tests/UsbManagerTest.cs
@@ -46,5 +46,45 @@
                 }
             }
         }
+
+        [Fact]
+        public void Default_1_GetHidFeatureReport()
+        {
+            if (!Platform.IsWindows)
+            {
+                return;
+            }
+            var deviceInfos = UsbManager.GetHidDevices();
+            Assert.NotNull(deviceInfos);
+            foreach (var deviceInfo in deviceInfos)
+            {
+                _output.WriteLine("deviceInfo.Path: \"" + deviceInfo.Path + "\"");
+                _output.WriteLine("deviceInfo.SerialNumber: \"" + deviceInfo.SerialNumber + "\"");
+                Assert.False(string.IsNullOrWhiteSpace(deviceInfo.Path));
+                var productId = deviceInfo.ProductId;
+                if (!string.IsNullOrEmpty(productId))
+                {
+                    Assert.True(productId.Length == 4);
+                }
+                var vendorId = deviceInfo.VendorId;
+                if (!string.IsNullOrEmpty(vendorId))
+                {
+                    Assert.True(vendorId.Length == 4);
+                }
+                Assert.False(string.IsNullOrWhiteSpace(deviceInfo.Description));
+                Assert.False(string.IsNullOrWhiteSpace(deviceInfo.Manufacturer));
+                var optional = deviceInfo.Optional;
+                if (optional.ContainsKey("type"))
+                {
+                    Assert.False(string.IsNullOrWhiteSpace(optional["type"]));
+                }
+
+                var featureReport = UsbManager.GetHidFeatureReport(deviceInfo.Path, 0);
+                if (featureReport != null)
+                {
+                    _output.WriteLine("deviceInfo.FeatureReport: \"" + Util.Convert.ToHexString(featureReport) + "\"");
+                }
+            }
+        }
     }
 }


Default grid item aspect ratio to IGDB format

--- source/Playnite/Settings/PlayniteSettings.cs
+++ source/Playnite/Settings/PlayniteSettings.cs
@@ -409,7 +409,7 @@
         [JsonIgnore]
         public AspectRatio CoverAspectRatio => new AspectRatio(GridItemWidthRatio, GridItemHeightRatio);

-        private int gridItemWidthRatio = 27;
+        private int gridItemWidthRatio = 3;
         public int GridItemWidthRatio
         {
             get
@@ -426,7 +426,7 @@
             }
         }

-        private int gridItemHeightRatio = 38;
+        private int gridItemHeightRatio = 4;
         public int GridItemHeightRatio
         {
             get


Don't enable trace messages by default

Don't enable trace messages by default

--- source/Playnite/Settings/PlayniteSettings.cs
+++ source/Playnite/Settings/PlayniteSettings.cs
@@ -1520,7 +1520,7 @@
             }
         }

-        private bool traceLogEnabled = true;
+        private bool traceLogEnabled = false;
         public bool TraceLogEnabled
         {
             get => traceLogEnabled;


Fix: Group by category doesn't get remembered #97

--- source/PlayniteUI/Windows/MainWindow.xaml.cs
+++ source/PlayniteUI/Windows/MainWindow.xaml.cs
@@ -555,6 +555,8 @@
                 Localization.SetLanguage(Config.Language);
                 return;
             }
+
+            Config.SaveSettings();
         }

         private void FilterSettings_PropertyChanged(object sender, PropertyChangedEventArgs e)


prevent useless casts

prevent useless casts

--- src/AutoMapper/Internal/ExpressionFactory.cs
+++ src/AutoMapper/Internal/ExpressionFactory.cs
@@ -139,7 +139,7 @@
         public static Expression IfNullElse(Expression expression, Expression then, Expression @else = null)
         {
             var isNull = expression.Type.IsValueType() && !expression.Type.IsNullableType() ? (Expression) Constant(false) : Equal(expression, Constant(null));
-            return Condition(isNull, then, Convert(@else ?? Default(then.Type), then.Type));
+            return Condition(isNull, then, ToType(@else ?? Default(then.Type), then.Type));
         }

         internal class IfNotNullVisitor : ExpressionVisitor


Remove extra space.

Remove extra space.

--- src/Avalonia.Animation/TransitionInstance.cs
+++ src/Avalonia.Animation/TransitionInstance.cs
@@ -31,7 +31,7 @@
             var interpVal = (double)t.Ticks / _duration.Ticks;

             // Clamp interpolation value.
-            if (interpVal >= 1d |  (interpVal < 0d))
+            if (interpVal >= 1d | (interpVal < 0d))
             {
                 PublishNext(1d);
                 PublishCompleted();


cleanup

cleanup

--- src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs
+++ src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs
@@ -12,13 +12,9 @@

 [assembly: InternalsVisibleTo(Connection.DynamicAssemblyName)]

-#if SIGNED_BUILD
 [assembly:
     InternalsVisibleTo(
         "Avalonia.X11, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c1bba1142285fe0419326fb25866ba62c47e6c2b5c1ab0c95b46413fad375471232cb81706932e1cef38781b9ebd39d5100401bacb651c6c5bbf59e571e81b3bc08d2a622004e08b1a6ece82a7e0b9857525c86d2b95fab4bc3dce148558d7f3ae61aa3a234086902aeface87d9dfdd32b9d2fe3c6dd4055b5ab4b104998bd87")]
-#else
-[assembly: InternalsVisibleTo("Avalonia.X11")]
-#endif

 namespace Avalonia.FreeDesktop
 {


Use StringBuilder.Append instead of string concat

--- src/Compilers/Core/MSBuildTask/DotnetHost.cs
+++ src/Compilers/Core/MSBuildTask/DotnetHost.cs
@@ -66,7 +66,8 @@
         {
             var builder = new CommandLineBuilderExtension();
             builder.AppendFileNameIfNotNull(pathToTool);
-            builder.AppendTextUnquoted(" " + commandLineArgs);
+            builder.AppendTextUnquoted(" ");
+            builder.AppendTextUnquoted(commandLineArgs);
             return builder.ToString();
         }
     }


Traversal: Deal with uninitialized instances.

--- src/ExRam.Gremlinq.Core/Queries/Traversal.cs
+++ src/ExRam.Gremlinq.Core/Queries/Traversal.cs
@@ -12,7 +12,6 @@
     {
         public static readonly Traversal Empty = new(Array.Empty<Step>(), Projection.Empty);

-        private readonly int _count;
         private readonly Step?[]? _steps;

         internal Traversal(IEnumerable<Step> steps, Projection projection) : this(ToArrayHelper(steps), projection)
@@ -31,7 +30,7 @@

         internal Traversal(Step?[] steps, int count, SideEffectSemantics semantics, Projection projection)
         {
-            _count = count;
+            Count = count;
             _steps = steps;
             Projection = projection;
             SideEffectSemantics = semantics;
@@ -54,14 +53,14 @@
         {
             var steps = Steps;

-            if (_count < steps.Length)
+            if (Count < steps.Length)
             {
-                if (Interlocked.CompareExchange(ref steps[_count], step, default) != null)
+                if (Interlocked.CompareExchange(ref steps[Count], step, default) != null)
                     return Clone().Push(step);

                 return new Traversal(
                     steps,
-                    _count + 1,
+                    Count + 1,
                     step.SideEffectSemanticsChange == SideEffectSemanticsChange.Write
                         ? SideEffectSemantics.Write
                         : SideEffectSemantics,
@@ -78,17 +77,17 @@
             if (Count == 0)
                 throw new InvalidOperationException($"{nameof(Traversal)} is Empty.");

-            poppedStep = this[_count - 1];
-            return new Traversal(_steps!, _count - 1, Projection);
+            poppedStep = this[Count - 1];
+            return new Traversal(Steps, Count - 1, Projection);
         }

-        public Traversal WithProjection(Projection projection) => new(Steps, _count, projection);
+        public Traversal WithProjection(Projection projection) => new(Steps, Count, projection);

         public IEnumerator<Step> GetEnumerator()
         {
             var steps = Steps;

-            for (var i = 0; i < _count; i++)
+            for (var i = 0; i < Count; i++)
             {
                 yield return steps[i]!;
             }
@@ -102,10 +101,10 @@

                 if (projectionTraversal.Count > 0)
                 {
-                    var ret = new Step[_count + projectionTraversal.Count];
+                    var ret = new Step[Count + projectionTraversal.Count];

                     CopyTo(ret, 0);
-                    projectionTraversal.CopyTo(ret, _count);
+                    projectionTraversal.CopyTo(ret, Count);

                     return new Traversal(ret, Projection.Empty);
                 }
@@ -116,7 +115,7 @@

         IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();

-        public int Count { get => Steps is not null ? _count : 0; }
+        public int Count { get; }

         public Projection Projection { get; }

@@ -124,7 +123,7 @@
         {
             get => index < 0 || index >= Count
                 ? throw new ArgumentOutOfRangeException(nameof(index))
-                : _steps![index]!;
+                : Steps[index]!;
         }

         public SideEffectSemantics SideEffectSemantics { get; }
@@ -143,7 +142,7 @@

         internal Step Peek() => PeekOrDefault() ?? throw new InvalidOperationException($"{nameof(Traversal)} is Empty.");

-        internal Step? PeekOrDefault() => Count > 0 ? this[_count - 1] : null;
+        internal Step? PeekOrDefault() => Count > 0 ? this[Count - 1] : null;

         public static implicit operator Traversal(Step step) => new(new[] { step }, Projection.Empty);

@@ -156,9 +155,7 @@
             for (var i = 0; i < count; i++)
             {
                 if (steps[i]!.SideEffectSemanticsChange == SideEffectSemanticsChange.Write)
-                {
                     return SideEffectSemantics.Write;
-                }
             }

             return SideEffectSemantics.Read;
@@ -166,12 +163,12 @@

         private Traversal EnsureCapacity(int count)
         {
-            if (_steps!.Length < count)
+            if (Steps.Length < count)
             {
                 var newSteps = new Step[count];
-                Array.Copy(_steps!, newSteps, _count);
+                Array.Copy(Steps, newSteps, Count);

-                return new(newSteps, _count, SideEffectSemantics, Projection);
+                return new(newSteps, Count, SideEffectSemantics, Projection);
             }

             return this;
@@ -179,18 +176,13 @@

         private Traversal Clone()
         {
-            var newSteps = new Step[_steps!.Length];
-            Array.Copy(_steps!, newSteps, _count);
+            var newSteps = new Step[Steps.Length];
+            Array.Copy(Steps, newSteps, Count);

-            return new(newSteps, _count, SideEffectSemantics, Projection);
+            return new(newSteps, Count, SideEffectSemantics, Projection);
         }

-        private Step?[] Steps
-        {
-            get => _steps is { } steps
-                ? steps
-                : throw new InvalidOperationException($"{nameof(Traversal)} has not been initialized.");
-        }
+        private Step?[] Steps => _steps ?? Array.Empty<Step>();

         internal bool IsEmpty { get => Count == 0; }
     }


Wrapped RollBack and RollBackToVersion in try catch blocks for automatic transanction roll backs

--- src/FluentMigrator.Runner/MigrationRunner.cs
+++ src/FluentMigrator.Runner/MigrationRunner.cs
@@ -212,14 +212,21 @@

         public void Rollback(int steps, bool useAutomaticTransactionManagement)
 		{
-            //TODO: Wrap this in a try catch
-			foreach (var migrationNumber in VersionLoader.VersionInfo.AppliedMigrations().Take(steps))
-			{
-				ApplyMigrationDown(migrationNumber);
-			}
-
-			VersionLoader.LoadVersionInfo();
-            if (useAutomaticTransactionManagement) { Processor.CommitTransaction(); }
+            try
+            {
+                foreach (var migrationNumber in VersionLoader.VersionInfo.AppliedMigrations().Take(steps))
+                {
+                    ApplyMigrationDown(migrationNumber);
+                }
+
+                VersionLoader.LoadVersionInfo();
+                if (useAutomaticTransactionManagement) { Processor.CommitTransaction(); }
+            }
+            catch (Exception)
+            {
+                if (useAutomaticTransactionManagement) { Processor.RollbackTransaction(); }
+                throw;
+            }
 		}

         public void RollbackToVersion(long version)
@@ -230,23 +237,29 @@
         public void RollbackToVersion(long version, bool useAutomaticTransactionManagement)
 		{
             //TODO: Extract VersionsToApply Strategy
-            //TODO: Wrap this in a try catch
-
-			// Get the migrations between current and the to version
-			foreach (var migrationNumber in VersionLoader.VersionInfo.AppliedMigrations())
-			{
-				if (version < migrationNumber || version == 0)
-				{
-					ApplyMigrationDown(migrationNumber);
-				}
-			}
-
-			if (version == 0)
-				VersionLoader.RemoveVersionTable();
-			else
-				VersionLoader.LoadVersionInfo();
-
-            if (useAutomaticTransactionManagement) { Processor.CommitTransaction(); }
+            try
+            {
+                // Get the migrations between current and the to version
+                foreach (var migrationNumber in VersionLoader.VersionInfo.AppliedMigrations())
+                {
+                    if (version < migrationNumber || version == 0)
+                    {
+                        ApplyMigrationDown(migrationNumber);
+                    }
+                }
+
+                if (version == 0)
+                    VersionLoader.RemoveVersionTable();
+                else
+                    VersionLoader.LoadVersionInfo();
+
+                if (useAutomaticTransactionManagement) { Processor.CommitTransaction(); }
+            }
+            catch (Exception)
+            {
+                if (useAutomaticTransactionManagement) { Processor.RollbackTransaction(); }
+                throw;
+            }
 		}

 		public Assembly MigrationAssembly


Mark method as obsolete

Mark method as obsolete

--- src/FluentValidation/Internal/RuleBuilder.cs
+++ src/FluentValidation/Internal/RuleBuilder.cs
@@ -57,6 +57,7 @@
 		/// Sets the validator associated with the rule. Use with complex properties where an IValidator instance is already declared for the property type.
 		/// </summary>
 		/// <param name="validator">The validator to set</param>
+		[Obsolete("This overload of SetValidator is no longer used. If you are trying to set a child validator for a collection, use SetCollectionValidator instead.")]
 		public IRuleBuilderOptions<T, TProperty> SetValidator(IValidator validator) {
 			validator.Guard("Cannot pass a null validator to SetValidator");
 			SetValidator(Extensions.InferPropertyValidatorForChildValidator(Rule, validator));


 * Fixed occasional crash in NotificationHandler.Close

git-svn-id: e2945e6dc2723cb01f425b5a7c3c201ce5019a89@1120 080cfd25-d5d9-4c59-82ea-70d02a200d8b

--- src/Gablarski.Clients/NotificationHandler.cs
+++ src/Gablarski.Clients/NotificationHandler.cs
@@ -267,7 +267,8 @@
 		{
 			Clear ();

-			MediaController.Reset();
+			if (MediaController != null)
+				MediaController.Reset();

 			this.client.Disconnected -= OnClientDisconnected;
 			this.client.Users.UserJoined -= OnUserJoined;


feat(identifiable): add default for generic

--- src/JsonApiDotNetCore/Models/Identifiable.cs
+++ src/JsonApiDotNetCore/Models/Identifiable.cs
@@ -1,6 +1,9 @@
 namespace JsonApiDotNetCore.Models
 {
-    public abstract class Identifiable<T> : IIdentifiable<T>, IIdentifiable
+    public class Identifiable : Identifiable<int>
+    {}
+
+    public class Identifiable<T> : IIdentifiable<T>, IIdentifiable
     {
         public T Id { get; set; }


Add exception handling - missed from merge.

--- src/Kafka/Kafka.Client/Producers/Producer.cs
+++ src/Kafka/Kafka.Client/Producers/Producer.cs
@@ -90,11 +90,19 @@

             if (this.populateProducerPool)
             {
-                IDictionary<int, Broker> allBrokers = this.brokerPartitionInfo.GetAllBrokerInfo();
-                foreach (var broker in allBrokers)
-                {
-                    this.producerPool.AddProducer(
-                        new Broker(broker.Key, broker.Value.Host, broker.Value.Host, broker.Value.Port));
+                try
+                {
+                    IDictionary<int, Broker> allBrokers = this.brokerPartitionInfo.GetAllBrokerInfo();
+                    foreach (var broker in allBrokers)
+                    {
+                        this.producerPool.AddProducer(
+                            new Broker(broker.Key, broker.Value.Host, broker.Value.Host, broker.Value.Port));
+                    }
+                }
+                catch
+                {
+                    this.brokerPartitionInfo.Dispose();
+                    throw;
                 }
             }
         }


Refactored ACPI class for better code style

--- src/Kernel/Kernel_alpha/Drivers/ACPI/ACPI.cs
+++ src/Kernel/Kernel_alpha/Drivers/ACPI/ACPI.cs
@@ -71,7 +71,7 @@

             for (int i = 19; i >= 16; i--)
             {
-                addr += (*((byte*)ptr + i));
+                addr += (*(ptr + i));
                 addr = (i == 16) ? addr : addr << 8;
             }

@@ -80,14 +80,14 @@

             for (int i = 3; i >= 0; i--)
             {
-                addr += (*((byte*)ptr + i));
+                addr += (*(ptr + i));
                 addr = (i == 0) ? addr : addr << 8;
             }

             int length = addr;
             ptr -= 4;

-            if (ptr != null && misc.acpiCheckHeader((byte*)ptr, "RSDT") == 0)
+            if (ptr != null && misc.acpiCheckHeader(ptr, "RSDT") == 0)
             {
                 addr = 0;
                 int entrys = length;
@@ -99,12 +99,12 @@
                 {
                     for (int i = 3; i >= 0; i--)
                     {
-                        addr += (*((byte*)ptr + i));
+                        addr += (*(ptr + i));
                         addr = (i == 0) ? addr : addr << 8;
                     }

                     yeuse = (byte*)addr;
-                    Facp = (byte*)yeuse;
+                    Facp = yeuse;

                     if (misc.Compare("FACP", Facp) == 0)
                     {
@@ -115,7 +115,7 @@

                             while (0 < dsdtLength--)
                             {
-                                if (misc.Compare("_S5_", (byte*)S5Addr) == 0)
+                                if (misc.Compare("_S5_", S5Addr) == 0)
                                     break;
                                 S5Addr++;
                             }
@@ -185,11 +185,11 @@
                     }

                     if (i < 300) return true;
-                    else return false;
-                }
-                else return false;
-            }
-            else return true;
+                    return false;
+                }
+                return false;
+            }
+            return true;
         }

         // Disable ACPI
@@ -251,19 +251,32 @@
         // FACP Table
         private byte facpbget (int number)
         {
-            if (number == 0) { return *(Facp + 52); }
-            else if (number == 1) { return *(Facp + 53); }
-            else if (number == 2) { return *(Facp + 89); }
-            else return 0;
+            switch (number) {
+            case 0:
+                return *(Facp + 52);
+            case 1:
+                return *(Facp + 53);
+            case 2:
+                return *(Facp + 89);
+            default:
+                return 0;
+            }
         }

         private int* facpget (int number)
         {
-            if (number == 0) { return (int*)*((int*)(Facp + 40)); }
-            else if (number == 1) { return (int*)*((int*)(Facp + 48)); }
-            else if (number == 2) { return (int*)*((int*)(Facp + 64)); }
-            else if (number == 3) { return (int*)*((int*)(Facp + 68)); }
-            else { return null; }
+            switch (number) {
+            case 0:
+                return (int*)*((int*)(Facp + 40));
+            case 1:
+                return (int*)*((int*)(Facp + 48));
+            case 2:
+                return (int*)*((int*)(Facp + 64));
+            case 3:
+                return (int*)*((int*)(Facp + 68));
+            default:
+                return null;
+            }
         }
     }
 }


arp results parsed

arp results parsed

--- src/LANMachines/LanPingerAsync/ArpScanner.cs
+++ src/LANMachines/LanPingerAsync/ArpScanner.cs
@@ -18,8 +18,12 @@
         {
             List<string> reachableMachines = new List<string>();

-            string arpRes = getArpScan();
-            Console.WriteLine(arpRes);
+            List<string> arpRes = getArpScan();
+
+            foreach (string res in arpRes)
+            {
+                Console.WriteLine(res);
+            } // end foreach

             return reachableMachines;
         } // end method
@@ -28,7 +32,7 @@

         #region Private Methods

-        private string getArpScan()
+        private List<string> getArpScan()
         {
             Process arpProcess = new Process();
             ProcessStartInfo procInfo = new ProcessStartInfo()
@@ -43,11 +47,27 @@
             arpProcess.StartInfo = procInfo;
             arpProcess.Start();

-            string output = arpProcess.StandardOutput.ReadToEnd();
+            string procOut = "";
+            List<string> arpScanResults = new List<string>();
+            while ((procOut = arpProcess.StandardOutput.ReadLine()) != null)
+            {
+                string[] parts = procOut.Trim().Split(' ');
+
+                if (parts.Length == 0)
+                {
+                    continue;
+                } // end if
+
+                string address = parts[0];
+                if (!String.IsNullOrEmpty(address) && char.IsDigit(address[0]))
+                {
+                    arpScanResults.Add(address);
+                } // end if
+            } // end while

             arpProcess.WaitForExit();

-            return output;
+            return arpScanResults;
         } // end method

         #endregion


fix openfile command

fix openfile command

--- src/MarkdownEdit/Commands/OpenFileCommand.cs
+++ src/MarkdownEdit/Commands/OpenFileCommand.cs
@@ -6,7 +6,7 @@
 {
     internal static class OpenFileCommand
     {
-        public static readonly RoutedCommand Command = new RoutedCommand();
+        public static readonly RoutedCommand Command = ApplicationCommands.Open;

         static OpenFileCommand()
         {


Refactor out base.Init call in CCMenu

Refactor out base.Init call in CCMenu

--- cocos2d/menu_nodes/CCMenu.cs
+++ cocos2d/menu_nodes/CCMenu.cs
@@ -145,40 +145,37 @@
                     RemoveChild(i, false);
                 }
             }
-            if (base.Init())
-            {
-                TouchPriority = kCCMenuHandlerPriority;
-                TouchMode = CCTouchMode.OneByOne;
-                TouchEnabled = true;
-
-                m_bEnabled = true;
-                // menu in the center of the screen
-                CCSize s = CCDirector.SharedDirector.WinSize;
-
-                IgnoreAnchorPointForPosition = true;
-                AnchorPoint = new CCPoint(0.5f, 0.5f);
-                ContentSize = s;
-
-                Position = (new CCPoint(s.Width / 2, s.Height / 2));
-
-                if (items != null)
-                {
-                    int z = 0;
-                    foreach (CCMenuItem item in items)
-                    {
-                        AddChild(item, z);
-                        z++;
-                    }
-                }
-
-                //    [self alignItemsVertically];
-                m_pSelectedItem = null;
-                m_eState = CCMenuState.Waiting;
-
-                // enable cascade color and opacity on menus
-                CascadeColorEnabled = true;
-                CascadeOpacityEnabled = true;
-            }
+            TouchPriority = kCCMenuHandlerPriority;
+            TouchMode = CCTouchMode.OneByOne;
+            TouchEnabled = true;
+
+            m_bEnabled = true;
+            // menu in the center of the screen
+            CCSize s = CCDirector.SharedDirector.WinSize;
+
+            IgnoreAnchorPointForPosition = true;
+            AnchorPoint = new CCPoint(0.5f, 0.5f);
+            ContentSize = s;
+
+            Position = (new CCPoint(s.Width / 2, s.Height / 2));
+
+            if (items != null)
+            {
+                int z = 0;
+                foreach (CCMenuItem item in items)
+                {
+                    AddChild(item, z);
+                    z++;
+                }
+            }
+
+            //    [self alignItemsVertically];
+            m_pSelectedItem = null;
+            m_eState = CCMenuState.Waiting;
+
+            // enable cascade color and opacity on menus
+            CascadeColorEnabled = true;
+            CascadeOpacityEnabled = true;
         }

         /*


Instantiate the regexes once.

Instantiate the regexes once.

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

--- src/MonoTorrent/MonoTorrent.Common/PeerID.cs
+++ src/MonoTorrent/MonoTorrent.Common/PeerID.cs
@@ -138,6 +138,17 @@
     /// </summary>
     public struct Software
     {
+        static readonly Regex bow = new Regex("-BOWA");
+        static readonly Regex brahms = new Regex("M/d-/d-/d--");
+        static readonly Regex bitlord = new Regex("exbc..LORD");
+        static readonly Regex bittornado = new Regex(@"(([A-Za-z]{1})\d{2}[A-Za-z]{1})----*");
+        static readonly Regex bitcomet = new Regex("exbc");
+        static readonly Regex mldonkey = new Regex("-ML/d\\./d\\./d");
+        static readonly Regex opera = new Regex("OP/d{4}");
+        static readonly Regex queenbee = new Regex("Q/d-/d-/d--");
+        static readonly Regex standard = new Regex(@"-(([A-Za-z\~]{2})\d{4})-*");
+        static readonly Regex shadows = new Regex(@"(([A-Za-z]{1})\d{3})----*");
+        static readonly Regex xbt = new Regex("XBT/d/{3}");
         private Client client;
         private string peerId;
         private string shortId;
@@ -161,16 +172,12 @@
         internal Software(string peerId)
         {
             Match m;
-            Regex r;

             this.peerId = peerId;

             #region Standard style peers
-            r = new Regex(@"-(([A-Za-z\~]{2})\d{4})-*");
-            if (r.IsMatch(peerId))
-            {
-                m = r.Match(peerId);
-
+            if ((m = standard.Match(peerId)) !=null)
+            {
                 this.shortId = m.Groups[1].Value;
                 switch (m.Groups[2].Value)
                 {
@@ -320,10 +327,8 @@
             #endregion

             #region Shadows Style
-            r = new Regex(@"(([A-Za-z]{1})\d{3})----*");
-            if (r.IsMatch(peerId))
-            {
-                m = r.Match(peerId);
+            if ((m = shadows.Match(peerId)) != null)
+            {
                 this.shortId = m.Groups[1].Value;
                 switch (m.Groups[2].Value)
                 {
@@ -361,8 +366,7 @@
             #endregion

             #region Brams Client
-            r = new Regex("M/d-/d-/d--");
-            if (r.IsMatch(peerId))
+            if ((m = brahms.Match(peerId)) != null)
             {
                 this.shortId = "M";
                 this.client = Client.BitTorrent;
@@ -371,8 +375,7 @@
             #endregion

             #region BitLord
-            r = new Regex("exbc..LORD");
-            if (r.IsMatch(peerId))
+            if ((m = bitlord.Match(peerId)) != null)
             {
                 this.client = Client.BitLord;
                 this.shortId = "lord";
@@ -381,8 +384,7 @@
             #endregion

             #region BitComet
-            r = new Regex("exbc");
-            if (r.IsMatch(peerId))
+            if ((m = bitcomet.Match(peerId)) != null)
             {
                 this.client = Client.BitComet;
                 this.shortId = "BC";
@@ -391,8 +393,7 @@
             #endregion

             #region XBT
-            r = new Regex("XBT/d/{3}");
-            if (r.IsMatch(peerId))
+            if ((m = xbt.Match(peerId)) != null)
             {
                 this.client = Client.XBTClient;
                 this.shortId = "XBT";
@@ -401,8 +402,7 @@
             #endregion

             #region Opera
-            r = new Regex("OP/d{4}");
-            if (r.IsMatch(peerId))
+            if ((m = opera.Match(peerId)) != null)
             {
                 this.client = Client.Opera;
                 this.shortId = "OP";
@@ -410,8 +410,7 @@
             #endregion

             #region MLDonkey
-            r = new Regex("-ML/d\\./d\\./d");
-            if (r.IsMatch(peerId))
+            if ((m = mldonkey .Match(peerId)) != null)
             {
                 this.client = Client.MLDonkey;
                 this.shortId = "ML";
@@ -420,8 +419,7 @@
             #endregion

             #region Bits on wheels
-            r = new Regex("-BOWA");
-            if (r.IsMatch(peerId))
+            if ((m = bow.Match(peerId)) != null)
             {
                 this.client = Client.BitsOnWheels;
                 this.shortId = "BOW";
@@ -430,8 +428,7 @@
             #endregion

             #region Queen Bee
-            r = new Regex("Q/d-/d-/d--");
-            if (r.IsMatch(peerId))
+            if ((m = queenbee.Match(peerId)) != null)
             {
                 this.client = Client.QueenBee;
                 this.shortId = "Q";
@@ -440,10 +437,8 @@
             #endregion

             #region BitTornado special style
-            r = new Regex(@"(([A-Za-z]{1})\d{2}[A-Za-z]{1})----*");
-            if(r.IsMatch(peerId))
-            {
-                m = r.Match(peerId);
+            if((m = bittornado.Match(peerId)) != null)
+            {
                 this.shortId = m.Groups[1].Value;
                 this.client = Client.BitTornado;
                 return;


camboi comen

camboi comen

--- src/Movimientos.Web.Api.Models/EntityBase.cs
+++ src/Movimientos.Web.Api.Models/EntityBase.cs
@@ -15,7 +15,7 @@
             set { links = value; }
         }

-
+        //lsdkfnsdkvsd

         public void AddLink(Link link)
         {


Fixing ArgumentsToParameters

Fixing ArgumentsToParameters

--- src/Neat.Procedure/Neat.Procedure/Command.cs
+++ src/Neat.Procedure/Neat.Procedure/Command.cs
@@ -47,10 +47,12 @@
             using (var command = new SqlCommand(ParametersQuery, cmd.Connection))
             {
                 command.Parameters.AddWithValue("@SpecificName", cmd.CommandText);
-                var reader = command.ExecuteReader();
-                var i = 0;
-                while (reader.Read() && i < parameters.Length)
-                    cmd.Parameters.AddWithValue(reader[ParameterNameColumn] as string, parameters[i++]);
+                using (var reader = command.ExecuteReader())
+                {
+                    var i = 0;
+                    while (reader.Read() && i < parameters.Length)
+                        cmd.Parameters.AddWithValue(reader[ParameterNameColumn] as string, parameters[i++]);
+                }
             }
         }
     }


Remove a TODO which we don't really want to do.

--- src/NodaTime/Globalization/NodaFormatInfo.cs
+++ src/NodaTime/Globalization/NodaFormatInfo.cs
@@ -190,7 +190,6 @@
         internal FixedFormatInfoPatternParser<LocalDate> LocalDatePatternParser { get { return localDatePatternParser; } }
         internal FixedFormatInfoPatternParser<LocalDateTime> LocalDateTimePatternParser { get { return localDateTimePatternParser; } }

-        // TODO(Post-V1): Make these writable?
         /// <summary>
         /// Returns a read-only list of the names of the months for the default calendar for this culture.
         /// See the usage guide for caveats around the use of these names for other calendars.


Add subsystem names for BFME1

Add subsystem names for BFME1

--- src/OpenSage.Game/Content/SubsystemLoader.cs
+++ src/OpenSage.Game/Content/SubsystemLoader.cs
@@ -106,6 +106,7 @@
                 case Subsystem.Core:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                             yield return "TheWritableGlobalData";
@@ -121,6 +122,7 @@
                 case Subsystem.ObjectCreation:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                             yield return "TheThingFactory";
@@ -134,6 +136,7 @@
                 case Subsystem.Players:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                         case SageGame.Cnc3:
@@ -145,6 +148,7 @@
                 case Subsystem.Terrain:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                         case SageGame.Cnc3:
@@ -157,6 +161,7 @@
                 case Subsystem.ParticleSystems:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                             yield return "TheParticleSystemManager";
@@ -172,6 +177,7 @@
                 case Subsystem.Multiplayer:
                     switch (_gameDefinition.Game)
                     {
+                        case SageGame.Bfme:
                         case SageGame.Bfme2:
                         case SageGame.Bfme2Rotwk:
                             yield return "TheMultiplayerSettings";


Improve code documentation in the IStorageEngine interface

--- src/Openchain.Abstractions/IStorageEngine.cs
+++ src/Openchain.Abstractions/IStorageEngine.cs
@@ -24,7 +24,7 @@
     public interface IStorageEngine : IDisposable
     {
         /// <summary>
-        /// Initialize the storage engine.
+        /// Initializes the storage engine.
         /// </summary>
         /// <returns>The task object representing the asynchronous operation.</returns>
         Task Initialize();


improved equals + added an initial version of GetHashCode implementation

--- src/Parameters/Shared/SharedParameterFile.cs
+++ src/Parameters/Shared/SharedParameterFile.cs
@@ -11,11 +11,11 @@

 namespace CodeCave.Revit.Toolkit.Parameters.Shared
 {
-    /// <inheritdoc />
+    /// <inheritdoc cref="ICloneable" />
     /// <summary>
     /// This class represents Revit shared parameter file
     /// </summary>
-    public sealed partial class SharedParameterFile : ICloneable
+    public sealed partial class SharedParameterFile : ICloneable, IEquatable<SharedParameterFile>
     {
         private static readonly Regex SectionRegex;
         private static readonly Configuration CsvConfiguration;
@@ -287,20 +287,31 @@
         }

         /// <summary>
-        /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
-        /// </summary>
-        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
+        /// Determines whether the specified <see cref="Object" />, is equal to this instance.
+        /// </summary>
+        /// <param name="obj">The <see cref="Object" /> to compare with this instance.</param>
         /// <returns>
         /// </returns>
         public override bool Equals(object obj)
         {
-            if (!(obj is SharedParameterFile))
-            {
-                // ReSharper disable once BaseObjectEqualsIsObjectEquals
-                return base.Equals(obj);
-            }
-
-            var other = (SharedParameterFile) obj;
+            if (ReferenceEquals(null, obj)) return false;
+            if (ReferenceEquals(this, obj)) return true;
+            return obj.GetType() == GetType() && Equals(obj as SharedParameterFile);
+        }
+
+        /// <inheritdoc />
+        /// <summary>
+        /// Indicates whether the current object is equal to another object of the same type.
+        /// </summary>
+        /// <param name="other">An object to compare with this object.</param>
+        /// <returns>
+        /// true if the current object is equal to the <paramref name="other">other</paramref> parameter; otherwise, false.
+        /// </returns>
+        public bool Equals(SharedParameterFile other)
+        {
+            // ReSharper disable once UseNullPropagation
+            if (other == null) return false;
+
             if (Metadata.Version != other.Metadata.Version || Metadata.MinVersion != other.Metadata.MinVersion)
                 return false;

@@ -345,5 +356,23 @@

             return clone;
         }
+
+        /// <summary>
+        /// Returns a hash code for this instance.
+        /// </summary>
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
+        /// </returns>
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                var hashCode = -409059346;
+                hashCode = hashCode * -1521134295 + EqualityComparer<Meta>.Default.GetHashCode(Metadata);
+                hashCode = hashCode * -1521134295 + EqualityComparer<List<Group>>.Default.GetHashCode(Groups);
+                hashCode = hashCode * -1521134295 + EqualityComparer<List<Parameter>>.Default.GetHashCode(Parameters);
+                return hashCode;
+            }
+        }
     }
 }


removed unnecessary method

removed unnecessary method

--- src/Peachpie.Runtime/Utilities/ArrayUtils.cs
+++ src/Peachpie.Runtime/Utilities/ArrayUtils.cs
@@ -81,27 +81,6 @@
         /// </summary>
         /// <returns>Last character or <c>\0</c>.</returns>
         public static char Last(this string str) => StringUtils.LastChar(str);
-
-        /// <summary>
-        /// Fast trim of a specified character.
-        /// </summary>
-        public static string Trim(string str, char ch)
-        {
-            if (!string.IsNullOrEmpty(str))
-            {
-                int i = 0;
-                int j = str.Length - 1;
-
-                //
-                while (i < str.Length && str[i] == ch) i++;
-                while (j > i && str[j] == ch) j--;
-
-                //
-                return i < j ? str.Substring(i, j - i + 1) : string.Empty;
-            }
-
-            return str;
-        }

         /// <summary>
         /// Fills a portion of an array of bytes by specified byte.


debug info

debug info

--- src/Resin.UnitTests/MappedTrieReaderTests.cs
+++ src/Resin.UnitTests/MappedTrieReaderTests.cs
@@ -4,6 +4,7 @@
 using Resin.IO.Read;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using System.Collections.Generic;
+using System.Diagnostics;

 namespace Tests
 {
@@ -29,6 +30,8 @@
                 node.PostingsAddress = new BlockInfo(long.MinValue, int.MinValue);
             }

+            File.WriteAllText("Can_find_within_range.log", tree.Visualize(), System.Text.Encoding.UTF8);
+
             tree.Serialize(fileName);

             IList<Word> words;


Completes with async exception and runs finally after one step completes async then throws sync exception

--- projects/AsyncEnumSample/test/AsyncEnumSample.Test.Unit/AsyncOperationTest.cs
+++ projects/AsyncEnumSample/test/AsyncEnumSample.Test.Unit/AsyncOperationTest.cs
@@ -263,7 +263,7 @@
         }

         [Fact]
-        public void Completes_with_async_exception_and_runs_finally_after_one_step_completes_async_then_throws_sync_exception()
+        public void Completes_with_async_exception_and_runs_finally_after_one_step_completes_async_then_throws_sync_exception_on_end()
         {
             InvalidTimeZoneException expected = new InvalidTimeZoneException("Expected.");
             ThrowOnEndOfOneAsyncStepWithFinallyOperation op = new ThrowOnEndOfOneAsyncStepWithFinallyOperation(expected);
@@ -280,6 +280,24 @@
             Assert.True(op.RanFinally);
         }

+        [Fact]
+        public void Completes_with_async_exception_and_runs_finally_after_one_step_completes_async_then_throws_sync_exception()
+        {
+            InvalidTimeZoneException expected = new InvalidTimeZoneException("Expected.");
+            ThrowAfterAsyncStepWithFinallyOperation op = new ThrowAfterAsyncStepWithFinallyOperation(expected);
+            Task<int> task = op.Start();
+
+            Assert.False(task.IsCompleted);
+
+            op.Complete();
+
+            Assert.Equal(TaskStatus.Faulted, task.Status);
+            Assert.NotNull(task.Exception);
+            Assert.Equal(1, task.Exception.InnerExceptions.Count);
+            Assert.Same(expected, task.Exception.InnerExceptions[0]);
+            Assert.True(op.RanFinally);
+        }
+
         private sealed class SetResultInCtorOperation : AsyncOperation<int>
         {
             public SetResultInCtorOperation(int result)
@@ -722,5 +740,37 @@
                 }
             }
         }
+
+        private sealed class ThrowAfterAsyncStepWithFinallyOperation : AsyncOperation<int>
+        {
+            private readonly Exception exception;
+            private readonly TaskCompletionSource<bool> tcs;
+
+            public ThrowAfterAsyncStepWithFinallyOperation(Exception exception)
+            {
+                this.exception = exception;
+                this.tcs = new TaskCompletionSource<bool>();
+            }
+
+            public bool RanFinally { get; private set; }
+
+            public void Complete()
+            {
+                this.tcs.SetResult(false);
+            }
+
+            protected override IEnumerator<Step> Steps()
+            {
+                try
+                {
+                    yield return Step.Await(this, thisPtr => thisPtr.tcs.Task);
+                    throw this.exception;
+                }
+                finally
+                {
+                    this.RanFinally = true;
+                }
+            }
+        }
     }
 }


Remove extra logic around length. Instead, just truncate long to int.

--- src/SendGrid/Helpers/Mail/SendGridMessage.cs
+++ src/SendGrid/Helpers/Mail/SendGridMessage.cs
@@ -20,9 +20,6 @@
     [JsonObject(IsReference = false)]
     public class SendGridMessage
     {
-        // Maximum attachment size is limited to 30MB
-        private const int MaxAttachmentSize = 30 * 1024 * 1024;
-
         /// <summary>
         /// Gets or sets an email object containing the email address and name of the sender. Unicode encoding is not supported for the from field.
         /// </summary>
@@ -991,7 +988,7 @@
         }

         /// <summary>
-        /// Add an attachment from a stream to the email. No attachment will be added in the case that the stream cannot be read, or if the attachment length exceeds SendGrid's maximum size (30MB).
+        /// Add an attachment from a stream to the email. No attachment will be added in the case that the stream cannot be read. Streams of length greater than int.MaxValue are truncated
         /// </summary>
         /// <param name="filename">The filename the attachment will display in the email.</param>
         /// <param name="contentStream">The stream to use as content of the attachment.</param>
@@ -1008,15 +1005,10 @@
                 return;
             }

-            if (contentStream.Length > MaxAttachmentSize)
-            {
-                return;
-            }
-
-            var streamBytes = new byte[contentStream.Length];
-
-            // Read all the bytes. Note that we can safely case the length as an int, as the maximum allowed is less than int.MaxValue
-            await contentStream.ReadAsync(streamBytes, 0, (int)contentStream.Length, cancellationToken);
+            var contentLength = Convert.ToInt32(contentStream.Length);
+            var streamBytes = new byte[contentLength];
+
+            await contentStream.ReadAsync(streamBytes, 0, contentLength, cancellationToken);

             var base64Content = Convert.ToBase64String(streamBytes);


Removed commented-out file.

Removed commented-out file.

--- src/Skia/Perspex.Skia.Android/MethodTable.cs
+++ src/Skia/Perspex.Skia.Android/MethodTable.cs
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-
-using Android.App;
-using Android.Content;
-using Android.Graphics;
-using Android.OS;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-
-namespace Perspex.Skia
-{
-/* No longer needed with SkiaSharp
-    class MethodTableImpl : MethodTable
-    {
-        [DllImport(@"perspesk")]
-        private static extern IntPtr GetPerspexMethodTable();
-        [DllImport(@"perspesk")]
-        private static extern IntPtr PerspexJniInit(IntPtr jniEnv);
-
-        public MethodTableImpl() : base(GetPerspexMethodTable())
-        {
-            PerspexJniInit(JNIEnv.Handle);
-        }
-    }
-	*/
-}


changes.

changes.

--- src/TWCore/Net/Multicast/DiscoveryService.cs
+++ src/TWCore/Net/Multicast/DiscoveryService.cs
@@ -169,7 +169,7 @@
                 if (LocalServices.All((s, serviceId) => s.Service.ServiceId != serviceId, service.ServiceId))
                 {
                     var sObj = new SerializedObject(service, Serializer);
-                    var sObjArr = (byte[])sObj.ToSubArray();
+                    var sObjArr = sObj.ToSubArray();
                     LocalServices.Add(new RegisteredServiceContainer(service, Serializer, sObjArr));
                 }
             }
@@ -338,7 +338,7 @@
         {
             while (!_token.IsCancellationRequested)
             {
-                var servicesBytes = new List<byte[]>();
+                var servicesBytes = new List<SubArray<byte>>();
                 lock (LocalServices)
                 {
                     foreach (var srv in LocalServices)
@@ -347,7 +347,7 @@
                         {
                             if (srv.Serializer != Serializer)
                             {
-                                srv.DataToSend = (byte[]) new SerializedObject(srv.Service, Serializer).ToSubArray();
+                                srv.DataToSend = new SerializedObject(srv.Service, Serializer).ToSubArray();
                                 srv.Serializer = Serializer;
                             }
                             servicesBytes.Add(srv.DataToSend);
@@ -355,7 +355,7 @@
                         else if (srv.Service.GetDataFunc != null)
                         {
                             srv.Service.Data = srv.Service.GetDataFunc();
-                            servicesBytes.Add((byte[])new SerializedObject(srv.Service, Serializer).ToSubArray());
+                            servicesBytes.Add(new SerializedObject(srv.Service, Serializer).ToSubArray());
                         }
                     }
                 }
@@ -371,9 +371,9 @@
         {
             public RegisteredService Service;
             public ISerializer Serializer;
-            public byte[] DataToSend;
-
-            public RegisteredServiceContainer(RegisteredService service, ISerializer serializer, byte[] dataToSend)
+            public SubArray<byte> DataToSend;
+
+            public RegisteredServiceContainer(RegisteredService service, ISerializer serializer, SubArray<byte> dataToSend)
             {
                 Service = service;
                 Serializer = serializer;


BasketMessageAdapter. Fix non supported subscriptions processing.


bugfix

bugfix

--- AppMetrics.Client/Tracker.cs
+++ AppMetrics.Client/Tracker.cs
@@ -35,7 +35,7 @@
 		{
 			lock (Sync)
 			{
-				if (LoggingThread.ThreadState != ThreadState.Running)
+				if (_terminated)
 					throw new InvalidOperationException();

 				var found = Sessions.Where(


Bump MinHeartBeatTTL from 5 to 10

Bump MinHeartBeatTTL from 5 to 10

--- ArchiSteamFarm/Statistics.cs
+++ ArchiSteamFarm/Statistics.cs
@@ -33,7 +33,7 @@

 namespace ArchiSteamFarm {
 	internal sealed class Statistics : IDisposable {
-		private const byte MinHeartBeatTTL = 5; // Minimum amount of minutes we must wait before sending next HeartBeat
+		private const byte MinHeartBeatTTL = 10; // Minimum amount of minutes we must wait before sending next HeartBeat

 		private static readonly SemaphoreSlim InitializationSemaphore = new SemaphoreSlim(1);


mod pitch and roll val

mod pitch and roll val


Disabling tracing

Disabling tracing

--- src/ControlzEx/Behaviors/WindowChrome/WindowChromeBehavior.MessageHandling.cs
+++ src/ControlzEx/Behaviors/WindowChrome/WindowChromeBehavior.MessageHandling.cs
@@ -113,7 +113,7 @@

             var message = (WM)msg;

-            System.Diagnostics.Trace.WriteLine($"{DateTime.Now} {hwnd} {message} {wParam} {lParam}");
+            //System.Diagnostics.Trace.WriteLine($"{DateTime.Now} {hwnd} {message} {wParam} {lParam}");

             switch (message)
             {


Allow 10 reconnection in wrflca processor.

--- src/EventStore/EventStore.TestClient/Commands/WriteFloodClientApiProcessor.cs
+++ src/EventStore/EventStore.TestClient/Commands/WriteFloodClientApiProcessor.cs
@@ -93,7 +93,7 @@
                     .DisableVerboseLogging()
                     .UseConsoleLogger()
                     .EnableOperationsForwarding()
-                    .LimitReconnectionsTo(0)
+                    .LimitReconnectionsTo(10)
                     //.KeepReconnecting()
                     .LimitRetriesForOperationTo(0)
                     //.KeepRetrying()


Remove use of tuple since we have a perfectly good type we can use.

--- src/Features/Core/Portable/FindReferences/IDefinitionsAndReferencesFactory.cs
+++ src/Features/Core/Portable/FindReferences/IDefinitionsAndReferencesFactory.cs
@@ -31,7 +31,7 @@
             var definitions = ImmutableArray.CreateBuilder<DefinitionItem>();
             var references = ImmutableArray.CreateBuilder<SourceReferenceItem>();

-            var uniqueLocations = new HashSet<ValueTuple<Document, TextSpan>>();
+            var uniqueLocations = new HashSet<DocumentLocation>();

             // Order the symbols by precedence, then create the appropriate
             // definition item per symbol and all refernece items for its
@@ -85,7 +85,7 @@
             ReferencedSymbol referencedSymbol,
             ImmutableArray<DefinitionItem>.Builder definitions,
             ImmutableArray<SourceReferenceItem>.Builder references,
-            HashSet<ValueTuple<Document, TextSpan>> uniqueLocations)
+            HashSet<DocumentLocation> uniqueLocations)
         {
             // See if this is a symbol we even want to present to the user.  If not,
             // ignore it entirely (including all its reference locations).
@@ -194,7 +194,7 @@
             ReferencedSymbol referencedSymbol,
             ImmutableArray<SourceReferenceItem>.Builder references,
             DefinitionItem definitionItem,
-            HashSet<ValueTuple<Document, TextSpan>> uniqueLocations)
+            HashSet<DocumentLocation> uniqueLocations)
         {
             foreach (var referenceLocation in referencedSymbol.Locations)
             {
@@ -204,14 +204,14 @@
                 var document = referenceLocation.Document;
                 var sourceSpan = location.SourceSpan;

-                if (uniqueLocations.Add(ValueTuple.Create(document, sourceSpan)))
+                var documentLocation = new DocumentLocation(document, sourceSpan);
+                if (!documentLocation.CanNavigateTo())
                 {
-                    var documentLocation = new DocumentLocation(document, sourceSpan);
-                    if (!documentLocation.CanNavigateTo())
-                    {
-                        continue;
-                    }
-
+                    continue;
+                }
+
+                if (uniqueLocations.Add(documentLocation))
+                {
                     references.Add(new SourceReferenceItem(definitionItem, documentLocation));
                 }
             }


Revert breaking parameter rename

Revert breaking parameter rename

--- src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectHandler.cs
+++ src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectHandler.cs
@@ -150,7 +150,7 @@
         /// Redirect user to the identity provider for sign out
         /// </summary>
         /// <returns>A task executing the sign out procedure</returns>
-        protected override async Task HandleSignOutAsync(SignOutContext context)
+        protected override async Task HandleSignOutAsync(SignOutContext signout)
         {
             Logger.EnteringOpenIdAuthenticationHandlerHandleSignOutAsync(GetType().FullName);

@@ -168,7 +168,7 @@
             };

             // Get the post redirect URI.
-            var properties = new AuthenticationProperties(context.Properties);
+            var properties = new AuthenticationProperties(signout.Properties);
             if (string.IsNullOrEmpty(properties.RedirectUri))
             {
                 properties.RedirectUri = BuildRedirectUriIfRelative(Options.PostLogoutRedirectUri);