Add more math functions

Add more math functions

fixes #416

--- src/Provider40/Query/ExpressionTranslators/Internal/SqlCeMathTranslator.cs
+++ src/Provider40/Query/ExpressionTranslators/Internal/SqlCeMathTranslator.cs
@@ -20,6 +20,17 @@
             { nameof(Math.Ceiling), "CEILING" },
             { nameof(Math.Floor), "FLOOR" },
             { nameof(Math.Pow), "POWER" },
+            { nameof(Math.Exp), "EXP" },
+            { nameof(Math.Log10), "LOG10" },
+            { nameof(Math.Log), "LOG" },
+            { nameof(Math.Sqrt), "SQRT" },
+            { nameof(Math.Acos), "ACOS" },
+            { nameof(Math.Asin), "ASIN" },
+            { nameof(Math.Atan), "ATAN" },
+            { nameof(Math.Atan2), "ATN2" },
+            { nameof(Math.Cos), "COS" },
+            { nameof(Math.Sin), "SIN" },
+            { nameof(Math.Tan), "TAN" }
         };

         private static readonly IEnumerable<MethodInfo> _roundMethodInfos = typeof(Math).GetTypeInfo().GetDeclaredMethods(nameof(Math.Round))


服务条目Id一致时抛出异常提示。

服务条目Id一致时抛出异常提示。

--- src/Rabbit.Rpc/Runtime/Server/Implementation/DefaultServiceEntryManager.cs
+++ src/Rabbit.Rpc/Runtime/Server/Implementation/DefaultServiceEntryManager.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Linq;

 namespace Rabbit.Rpc.Runtime.Server.Implementation
 {
@@ -20,7 +22,13 @@
             var list = new List<ServiceEntry>();
             foreach (var provider in providers)
             {
-                list.AddRange(provider.GetEntries());
+                var entries = provider.GetEntries().ToArray();
+                foreach (var entry in entries)
+                {
+                    if (list.Any(i => i.Descriptor.Id == entry.Descriptor.Id))
+                        throw new InvalidOperationException($"本地包含多个Id为：{entry.Descriptor.Id} 的服务条目。");
+                }
+                list.AddRange(entries);
             }
             _serviceEntries = list.ToArray();
         }


Overriding soapAction in Soap11WsdlTemplate

Forgotten file

--- src/ServiceStack/WebHost.Endpoints/Support/Templates/Soap11WsdlTemplate.cs
+++ src/ServiceStack/WebHost.Endpoints/Support/Templates/Soap11WsdlTemplate.cs
@@ -12,8 +12,8 @@
 			get
 			{
 				return
-	@"<wsdl:operation name=""{0}"">
-      <soap:operation soapAction=""http://schemas.servicestack.net/types/{0}"" style=""document"" />
+	@"<wsdl:operation name=""{1}"">
+      <soap:operation soapAction=""{0}{1}"" style=""document"" />
       <wsdl:input>
         <soap:body use=""literal"" />
       </wsdl:input>
@@ -29,8 +29,8 @@
 			get
 			{
 				return
-	@"<wsdl:operation name=""{0}"">
-      <soap:operation soapAction=""http://schemas.servicestack.net/types/{0}"" style=""document"" />
+	@"<wsdl:operation name=""{1}"">
+      <soap:operation soapAction=""{0}{1}"" style=""document"" />
       <wsdl:input>
         <soap:body use=""literal"" />
       </wsdl:input>


Ensure code page utils registers code page providers

Without this tests fail due to lack of encoding provider.

--- main/Util/CodePageUtil.cs
+++ main/Util/CodePageUtil.cs
@@ -29,6 +29,13 @@
      */
     public class CodePageUtil
     {
+        static CodePageUtil()
+        {
+            #if NETSTANDARD2_1 || NETSTANDARD2_0
+                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
+            #endif
+        }
+
         /**
Codepage 037, a special case
 */
         public const int CP_037 = 37;


消减SqlParameter

消减SqlParameter

--- src/Anycmd/Engine/Rdb/SqlServerMetaDataService.cs
+++ src/Anycmd/Engine/Rdb/SqlServerMetaDataService.cs
@@ -7,7 +7,6 @@
     using System.Configuration;
     using System.Data;
     using System.Data.Common;
-    using System.Data.SqlClient;
     using System.Diagnostics;
     using System.Text;
     using Util;
@@ -359,31 +358,31 @@
                     if (description == null && table.Description != null)
                     {
                         db.ExecuteNonQuery(dropProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", table.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", table.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", table.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", table.Name, DbType.String));
                     }
                     else if (table.Description == null)
                     {
                         db.ExecuteNonQuery(addProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", table.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", table.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", table.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", table.Name, DbType.String));
                     }
                     else
                     {
                         db.ExecuteNonQuery(updateProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", table.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", table.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", table.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", table.Name, DbType.String));
                     }
                     table.Description = description;
                     #endregion
@@ -398,31 +397,31 @@
                     if (description == null && view.Description != null)
                     {
                         db.ExecuteNonQuery(dropProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", view.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", view.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", view.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", view.Name, DbType.String));
                     }
                     else if (view.Description == null)
                     {
                         db.ExecuteNonQuery(addProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", view.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", view.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", view.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", view.Name, DbType.String));
                     }
                     else
                     {
                         db.ExecuteNonQuery(updateProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", view.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", view.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", view.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", view.Name, DbType.String));
                     }
                     view.Description = description;
                     #endregion
@@ -437,37 +436,37 @@
                     if (description == null && tableColumn.Description != null)
                     {
                         db.ExecuteNonQuery(dropProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", tableColumn.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", tableColumn.TableName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", tableColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", tableColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", tableColumn.TableName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", tableColumn.Name, DbType.String));
                     }
                     else if (tableColumn.Description == null)
                     {
                         db.ExecuteNonQuery(addProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", tableColumn.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", tableColumn.TableName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", tableColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", tableColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", tableColumn.TableName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", tableColumn.Name, DbType.String));
                     }
                     else
                     {
                         db.ExecuteNonQuery(updateProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", tableColumn.SchemaName),
-                            new SqlParameter("level1type", "TABLE"),
-                            new SqlParameter("level1name", tableColumn.TableName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", tableColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", tableColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "TABLE", DbType.String),
+                            CreateParameter(db, "level1name", tableColumn.TableName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", tableColumn.Name, DbType.String));
                     }
                     tableColumn.Description = description;
                     #endregion
@@ -482,37 +481,37 @@
                     if (description == null && viewColumn.Description != null)
                     {
                         db.ExecuteNonQuery(dropProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", viewColumn.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", viewColumn.ViewName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", viewColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", viewColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", viewColumn.ViewName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", viewColumn.Name, DbType.String));
                     }
                     else if (viewColumn.Description == null)
                     {
                         db.ExecuteNonQuery(addProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", viewColumn.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", viewColumn.ViewName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", viewColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", viewColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", viewColumn.ViewName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", viewColumn.Name, DbType.String));
                     }
                     else
                     {
                         db.ExecuteNonQuery(updateProcName, CommandType.StoredProcedure,
-                            new SqlParameter("name", propertyName),
-                            new SqlParameter("value", description),
-                            new SqlParameter("level0type", "SCHEMA"),
-                            new SqlParameter("level0name", viewColumn.SchemaName),
-                            new SqlParameter("level1type", "VIEW"),
-                            new SqlParameter("level1name", viewColumn.ViewName),
-                            new SqlParameter("level2type", "COLUMN"),
-                            new SqlParameter("level2name", viewColumn.Name));
+                            CreateParameter(db, "name", propertyName, DbType.String),
+                            CreateParameter(db, "value", description, DbType.String),
+                            CreateParameter(db, "level0type", "SCHEMA", DbType.String),
+                            CreateParameter(db, "level0name", viewColumn.SchemaName, DbType.String),
+                            CreateParameter(db, "level1type", "VIEW", DbType.String),
+                            CreateParameter(db, "level1name", viewColumn.ViewName, DbType.String),
+                            CreateParameter(db, "level2type", "COLUMN", DbType.String),
+                            CreateParameter(db, "level2name", viewColumn.Name, DbType.String));
                     }
                     viewColumn.Description = description;
                     #endregion


Add xunit timeout to hanging CancelledBuild test (#5827)

This was attempted in #5290 but we hit a hang in this test again this week.

--- src/Build.UnitTests/BackEnd/BuildManager_Tests.cs
+++ src/Build.UnitTests/BackEnd/BuildManager_Tests.cs
@@ -1500,7 +1500,7 @@
         /// <summary>
         /// A canceled build
         /// </summary>
-        [Fact]
+        [Fact(Timeout = 20_000)]
         public void CancelledBuild()
         {
             string contents = CleanupFileContents(@"


Improved iOS database path

Improved iOS database path

--- src/AppShell.Data.Mobile.iOS/iOSSQLiteDatabase.cs
+++ src/AppShell.Data.Mobile.iOS/iOSSQLiteDatabase.cs
@@ -14,7 +14,7 @@

         public SQLiteConnection GetConnection(string databaseName)
         {
-            string databasePath = Path.Combine(platformProvider.GetDocumentFolderPath(), databaseName);
+            string databasePath = Path.Combine(platformProvider.GetDocumentFolderPath(), "..", "Library", databaseName);
             string databaseDirectory = Path.GetDirectoryName(databasePath);

             if (!Directory.Exists(databaseDirectory))
@@ -23,4 +23,4 @@
             return new SQLiteConnection(databasePath);
         }
     }
-}
+}


wip: mass transit interop

wip: mass transit interop

--- src/interoperability/InteroperabilityTests/MassTransitSpecs.cs
+++ src/interoperability/InteroperabilityTests/MassTransitSpecs.cs
@@ -62,6 +62,10 @@
                 var sender = theFixture.MassTransit.Services.GetRequiredService<ISendEndpointProvider>();
                 var endpoint = await sender.GetSendEndpoint(new Uri("rabbitmq://localhost/jasper"));
                 await endpoint.Send(new ResponseMessage {Id = id});
+                for (int i = 0; i < 1000; i++)
+                {
+                    await endpoint.Send(new ResponseMessage {Id = Guid.NewGuid()});
+                }
             });

             var envelope = ResponseHandler.Received.FirstOrDefault();


Accidentally commented out some tests...

--- src/Cake.Core.Tests/Unit/IO/DirectoryPathTests.cs
+++ src/Cake.Core.Tests/Unit/IO/DirectoryPathTests.cs
@@ -11,12 +11,12 @@
         {
             [Theory]
 #if !UNIX
-            //[InlineData("c:/assets/shaders/", "simple.frag", "c:/assets/shaders/simple.frag")]
+            [InlineData("c:/assets/shaders/", "simple.frag", "c:/assets/shaders/simple.frag")]
             [InlineData("c:/", "simple.frag", "c:/simple.frag")]
 #endif
-            //[InlineData("assets/shaders", "simple.frag", "assets/shaders/simple.frag")]
-            //[InlineData("assets/shaders/", "simple.frag", "assets/shaders/simple.frag")]
-            //[InlineData("/assets/shaders/", "simple.frag", "/assets/shaders/simple.frag")]
+            [InlineData("assets/shaders", "simple.frag", "assets/shaders/simple.frag")]
+            [InlineData("assets/shaders/", "simple.frag", "assets/shaders/simple.frag")]
+            [InlineData("/assets/shaders/", "simple.frag", "/assets/shaders/simple.frag")]
             public void Should_Combine_Paths(string first, string second, string expected)
             {
                 // Given


Fix native menus not being setup properly Closes #4395

--- src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
+++ src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
@@ -11,7 +11,7 @@
     class AvaloniaNativeMenuExporter : ITopLevelNativeMenuExporter
     {
         private IAvaloniaNativeFactory _factory;
-        private bool _resetQueued;
+        private bool _resetQueued = true; // so initial layout resets trigger a menu reset properly
         private bool _exported = false;
         private IAvnWindow _nativeWindow;
         private NativeMenu _menu;
@@ -39,7 +39,7 @@
         public void SetNativeMenu(NativeMenu menu)
         {
             _menu = menu == null ? new NativeMenu() : menu;
-
+            _resetQueued = true; // we've reset the menu to something new, so make sure that a reset is queued
             DoLayoutReset();
         }


Update EnumerableDataReaderTests.cs

Update EnumerableDataReaderTests.cs

Merge I messed up :(

--- src/BulkWriter.Tests/EnumerableDataReaderTests.cs
+++ src/BulkWriter.Tests/EnumerableDataReaderTests.cs
@@ -52,11 +52,7 @@
             //   seems to create the columns by ordering the property names alphabetically).
             //

-
-
-
-
-            = new[] { new MyCustomOrderTestClass() };
+            _customOrderEnumerable = new[] { new MyCustomOrderTestClass() };

             TestHelpers.ExecuteNonQuery(_connectionString, $"DROP TABLE IF EXISTS [dbo].[{_customOrderTableName}]");

@@ -370,4 +366,4 @@
             public byte[] Data { get; set; }
         }
     }
-}+}


Bumped version to 0.5.8.0 by Jenkins

Bumped version to 0.5.8.0 by Jenkins

--- src/CollectdWinService/Properties/AssemblyInfo.cs
+++ src/CollectdWinService/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("0.5.7.0")]
-[assembly: AssemblyFileVersion("0.5.7.0")]
+[assembly: AssemblyVersion("0.5.8.0")]
+[assembly: AssemblyFileVersion("0.5.8.0")]


Object Managers no longer accept empty paths. Also removed an empty line.

--- src/Dbus/OrgFreedesktopDbusObjectManager_Proxy.cs
+++ src/Dbus/OrgFreedesktopDbusObjectManager_Proxy.cs
@@ -17,12 +17,14 @@

         private OrgFreedesktopDbusObjectManager_Proxy(Connection connection, IOrgFreedesktopDbusObjectManagerProvide target, ObjectPath path)
         {
+            if (path == null)
+                throw new ArgumentNullException("An ObjectManager needs a path!");
             this.connection = connection;
             this.target = target;
             this.path = path;
             InterfaceName = "org.freedesktop.DBus.ObjectManager";
             registration = connection.RegisterObjectProxy(
-                path ?? "",
+                path,
                 InterfaceName,
                 this
             );
@@ -34,7 +36,6 @@
         }

         public void Encode(List<byte> sendBody, ref int sendIndex)
-
         {
             Encoder.AddArray(sendBody, ref sendIndex, (List<byte> sendBody_e, ref int sendIndex_e) =>
             {


Retry create directory in tests (#17610)

* Retry create directory

--- src/Common/tests/System/IO/FileCleanupTestBase.cs
+++ src/Common/tests/System/IO/FileCleanupTestBase.cs
@@ -4,6 +4,7 @@

 using Xunit;
 using System.Runtime.CompilerServices;
+using System.Threading;

 namespace System.IO
 {
@@ -18,15 +19,26 @@
             // so that it can be easily correlated if necessary, and the random string to helps avoid conflicts if
             // the same test should be run concurrently with itself (e.g. if a [Fact] method lives on a base class)
             // or if some stray files were left over from a previous run.
-            TestDirectory = Path.Combine(Path.GetTempPath(), GetType().Name + "_" + Path.GetRandomFileName());
-            try
+
+            // Make 3 attempts since we have seen this on rare occasions fail with access denied, perhaps due to machine
+            // configuration, and it doesn't make sense to fail arbitrary tests for this reason.
+            string failure = string.Empty;
+            for (int i = 0; i <= 2; i++)
             {
-                Directory.CreateDirectory(TestDirectory);
+                TestDirectory = Path.Combine(Path.GetTempPath(), GetType().Name + "_" + Path.GetRandomFileName());
+                try
+                {
+                    Directory.CreateDirectory(TestDirectory);
+                    break;
+                }
+                catch (Exception ex)
+                {
+                    failure += ex.ToString() + Environment.NewLine;
+                    Thread.Sleep(10); // Give a transient condition like antivirus/indexing a chance to go away
+                }
             }
-            catch (Exception ex)
-            {
-                Assert.True(false, $"FileCleanupTestBase failed to create {TestDirectory} due to {ex.ToString()}");
-            }
+
+            Assert.True(Directory.Exists(TestDirectory), $"FileCleanupTestBase failed to create {TestDirectory}. {failure}");
         }

         /// <summary>Delete the associated test directory.</summary>


Initialize the task resources in all build tasks.

--- src/Compilers/Core/MSBuildTask/ManagedCompiler.cs
+++ src/Compilers/Core/MSBuildTask/ManagedCompiler.cs
@@ -23,6 +23,11 @@
     {
         private CancellationTokenSource _sharedCompileCts = null;
         internal readonly PropertyDictionary _store = new PropertyDictionary();
+
+        public ManagedCompiler()
+        {
+            this.TaskResources = ErrorString.ResourceManager;
+        }

         #region Properties


Improve command-line help for conformance tool.

--- src/FacilityConformance/FacilityConformanceApp.cs
+++ src/FacilityConformance/FacilityConformanceApp.cs
@@ -27,9 +27,15 @@
 			{
 				return await new FacilityConformanceApp().RunAsync(args);
 			}
-			catch (Exception exception) when (exception is ArgsReaderException || exception is ApplicationException)
+			catch (ArgsReaderException exception)
 			{
 				Console.WriteLine(exception.Message);
+				Console.WriteLine();
+
+				const int columnWidth = 40;
+				Console.WriteLine("Usage:");
+				Console.WriteLine("  host [--url <url>]".PadRight(columnWidth) + "Hosts a conformance server");
+				Console.WriteLine("  test [--url <url>] [<test> ...]".PadRight(columnWidth) + "Tests a conformance server");
 				return -1;
 			}
 			catch (Exception exception)
@@ -49,19 +55,23 @@

 		public async Task<int> RunAsync(IReadOnlyList<string> args)
 		{
+			const string defaultUrl = "http://localhost:4117/";
+
 			var argsReader = new ArgsReader(args);
-
 			string command = argsReader.ReadArgument();
-			string url = argsReader.ReadOption("url") ?? "http://localhost:4117/";
-			var testNames = argsReader.ReadArguments();
-			argsReader.VerifyComplete();
-
-			if (command == "host" && testNames.Count == 0)
-			{
+			if (command == "host")
+			{
+				string url = argsReader.ReadOption("url") ?? defaultUrl;
+				argsReader.VerifyComplete();
+
 				new WebHostBuilder().UseKestrel().UseUrls(url).Configure(app => app.Run(HostAsync)).Build().Run();
 			}
 			else if (command == "test")
 			{
+				string url = argsReader.ReadOption("url") ?? defaultUrl;
+				var testNames = argsReader.ReadArguments();
+				argsReader.VerifyComplete();
+
 				var httpClient = new HttpClient();

 				IConformanceApi getApiForTest(string testName)
@@ -99,9 +109,13 @@

 				return failureCount == 0 ? 0 : 1;
 			}
+			else if (command != null)
+			{
+				throw new ArgsReaderException($"Invalid command: {command}");
+			}
 			else
 			{
-				throw new ApplicationException("Usage:\n  host [--url <url>]\n  test [--url <url>] [<test> ...]");
+				throw new ArgsReaderException("Missing command.");
 			}

 			return 0;


Minor code cleanup.

Minor code cleanup.

--- src/GitHubFeeds/Controllers/CommentsController.cs
+++ src/GitHubFeeds/Controllers/CommentsController.cs
@@ -25,12 +25,12 @@
 			AsyncManager.OutstandingOperations.Increment();

 			m_requestETag = Request.Headers["If-None-Match"];
-			Uri uri = CreateUri(p, 1, 1);
+			Uri uri = CreateCommentsPageUri(p, 1, 1);
 			HttpWebRequest request = CreateRequest(p, uri);
 			request.GetHttpResponseAsync()
 				.ContinueWith(t => GetCommentCount(t))
 				.ContinueWith(t => GetCommentPages(p, t.Result))
-				.ContinueWith(t => TaskUtility.ContinueWhenAll(t.Result, ts => GetComments(ts))).Unwrap()
+				.ContinueWith(t => TaskUtility.ContinueWhenAll(t.Result, GetComments)).Unwrap()
 				.ContinueWith(t => CreateFeed(p, t.Result))
 				.ContinueWith(t =>
 				{
@@ -46,7 +46,7 @@
 		}

 		// Creates the URI for comments for the specified repo, with a specific page size and offset.
-		private static Uri CreateUri(ListParameters p, int pageOffset, int pageSize)
+		private static Uri CreateCommentsPageUri(ListParameters p, int pageOffset, int pageSize)
 		{
 			// create URI for GitHub.com or GitHub Enterprise
 			string uriTemplate = p.Server == "api.github.com" ?
@@ -121,11 +121,11 @@
 			if (commentCount > 50 && (commentCount % c_pageSize < 50))
 			{
 				// there are at least 50 items, but the last page doesn't contain at least 50
-				uris.Add(CreateUri(p, lastPageOffset - 1, c_pageSize));
+				uris.Add(CreateCommentsPageUri(p, lastPageOffset - 1, c_pageSize));
 			}

 			// get the last page of comments
-			uris.Add(CreateUri(p, lastPageOffset, c_pageSize));
+			uris.Add(CreateCommentsPageUri(p, lastPageOffset, c_pageSize));

 			// return a task for each URI
 			return uris.Select(u => CreateRequest(p, u).GetHttpResponseAsync()).ToArray();


Update src/FuncSharp/Extensions/IEnumerableExtensions.cs

Co-authored-by: Marek Třešňák <349dad4973986e88158028ec4fb044fd31de9fb2@outlook.com>

--- src/FuncSharp/Extensions/IEnumerableExtensions.cs
+++ src/FuncSharp/Extensions/IEnumerableExtensions.cs
@@ -1,4 +1,3 @@
-
 using System;
 using System.Collections;
 using System.Collections.Generic;


Add GetValue and GetMemberType to ReflectionService

--- source/Nuke.Common/Execution/ReflectionService.cs
+++ source/Nuke.Common/Execution/ReflectionService.cs
@@ -7,6 +7,7 @@
 using System.Linq;
 using System.Linq.Expressions;
 using System.Reflection;
+using JetBrains.Annotations;
 using Nuke.Common.Utilities.Collections;

 namespace Nuke.Common.Execution
@@ -18,23 +19,27 @@
         public const BindingFlags Instance = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
         public const BindingFlags Static = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

-        public static void SetValue(object instance, string memberName, object value)
+        public static T GetValue<T>(this MemberInfo member, object obj = null, object[] args = null)
         {
-            var member = instance.GetType().GetMember(memberName, All)
-                .SingleOrDefault()
-                .NotNull($"Could not find member '{memberName}' on type '{instance.GetType()}'.");
-            SetValue(instance, member, value);
-        }
-
-        public static void SetValue(Type type, string memberName, object value)
-        {
-            var member = type.GetMember(memberName, All)
-                .SingleOrDefault()
-                .NotNull($"Could not find member '{memberName}' on type '{type}'.");
-            SetValue(instance: null, member, value);
+            return (T) GetValue(member, obj, args);
         }

-        public static void SetValue(object instance, MemberInfo member, object value)
+        public static object GetValue(this MemberInfo member, object obj = null, object[] args = null)
+        {
+            switch (member)
+            {
+                case FieldInfo fieldInfo:
+                    return fieldInfo.GetValue(obj);
+                case PropertyInfo propertyInfo:
+                    return propertyInfo.GetValue(obj);
+                case MethodInfo methodInfo:
+                    return methodInfo.Invoke(obj, args);
+                default:
+                    throw new NotSupportedException();
+            }
+        }
+
+        public static void SetValue(this MemberInfo member, object instance, object value)
         {
             if (member is FieldInfo field)
             {
@@ -66,7 +71,7 @@
             return memberExpression.Member;
         }

-        public static Type GetFieldOrPropertyType(this MemberInfo member)
+        public static Type GetMemberType(this MemberInfo member)
         {
             switch (member)
             {
@@ -74,6 +79,8 @@
                     return fieldInfo.FieldType;
                 case PropertyInfo propertyInfo:
                     return propertyInfo.PropertyType;
+                case MethodInfo methodInfo:
+                    return methodInfo.ReturnType;
                 default:
                     throw new NotSupportedException();
             }


Adding functionality to skip the contents of a file when generating an MD5 This gives us a much faster test for the existence of files and not their contents

--- src/GitHub.Api/Extensions/FileSystemExtensions.cs
+++ src/GitHub.Api/Extensions/FileSystemExtensions.cs
@@ -22,7 +22,7 @@
             return BitConverter.ToString(computeHash).Replace("-", string.Empty).ToLower();
         }

-        public static string CalculateFolderMD5(this IFileSystem fileSystem, string path)
+        public static string CalculateFolderMD5(this IFileSystem fileSystem, string path, bool includeContents = true)
         {
             //https://stackoverflow.com/questions/3625658/creating-hash-for-folder

@@ -39,9 +39,12 @@
                     var pathBytes = Encoding.UTF8.GetBytes(relativeFilePath);
                     md5.TransformBlock(pathBytes, 0, pathBytes.Length, pathBytes, 0);

-                    // hash contents
-                    var contentBytes = File.ReadAllBytes(filePath);
-                    md5.TransformBlock(contentBytes, 0, contentBytes.Length, contentBytes, 0);
+                    if (includeContents)
+                    {
+                        // hash contents
+                        var contentBytes = File.ReadAllBytes(filePath);
+                        md5.TransformBlock(contentBytes, 0, contentBytes.Length, contentBytes, 0);
+                    }
                 }

                 //Handles empty filePaths case


- removed empty line

- removed empty line

--- src/GongSolutions.WPF.DragDrop.Shared/DropInfo.cs
+++ src/GongSolutions.WPF.DragDrop.Shared/DropInfo.cs
@@ -352,7 +352,6 @@
     /// </summary>
     public string EffectText { get; set; }

-
     /// <summary>
     /// Gets the relative position the item will be inserted to compared to the TargetItem
     /// </summary>


added some code based on the error message

error message Unable to create an object of type 'MergeTemplateContext'. Add an implementation of 'IDesignTimeDbContextFactory<MergeTemplateContext>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.

--- src/Mailman.Services/Data/MergeTemplateContext.cs
+++ src/Mailman.Services/Data/MergeTemplateContext.cs
@@ -1,4 +1,8 @@
 using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+using System;
+using System.Collections.Generic;
+using System.Text;

 namespace Mailman.Services.Data
 {
@@ -7,10 +11,21 @@
         public MergeTemplateContext(DbContextOptions<MergeTemplateContext> options) : base(options) { }

         public DbSet<MergeTemplate> MergeTemplates {get;set;}
-        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
-        {
-            optionsBuilder.UseSqlite("Data Source=mergetemplate.db");
-        }
+        //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        //{
+        //    optionsBuilder.UseSqlite("Data Source=mergetemplate.db");
+        //}

     }
+
+    public class MergeTemplateContextFactory : IDesignTimeDbContextFactory<MergeTemplateContext>
+    {
+    public MergeTemplateContext CreateDbContext(string[] args)
+    {
+        var builder = new DbContextOptionsBuilder<MergeTemplateContext>();
+        builder.UseSqlite("Data Source=mergetemplate.db");
+
+        return new MergeTemplateContext(builder.Options);
+    }
+}
 }


making BatchedQuery use ITenant

making BatchedQuery use ITenant

--- src/Marten/Services/BatchQuerying/BatchedQuery.cs
+++ src/Marten/Services/BatchQuerying/BatchedQuery.cs
@@ -161,7 +161,7 @@

         public Task<T> AddItem<T>(IQueryHandler<T> handler, QueryStatistics stats)
         {
-            _store.Schema.EnsureStorageExists(handler.SourceType);
+            _parent.Tenant.EnsureStorageExists(handler.SourceType);

             var item = new BatchQueryItem<T>(handler, stats);
             _items.Add(item);


bugfix. Firing the TrackerStateChanged event was done incorrectly. Now correctly displaying OldState and NewState

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

--- src/MonoTorrent.Client/Managers/TrackerManager.cs
+++ src/MonoTorrent.Client/Managers/TrackerManager.cs
@@ -141,9 +141,9 @@
             this.updateSucceeded = true;
             this.lastUpdated = DateTime.Now;
             Tracker tracker = this.ChooseTracker();
+
+            UpdateState(tracker, TrackerState.Announcing);
             WaitHandle handle = tracker.Announce(bytesDownloaded, bytesUploaded, bytesLeft, clientEvent, this.infoHash);
-
-            UpdateState(tracker, TrackerState.Announcing);
             return handle;
         }

@@ -305,12 +305,11 @@
             if (tracker.State == newState)
                 return;

+            TrackerStateChangedEventArgs e = new TrackerStateChangedEventArgs(tracker, tracker.State, newState);
             tracker.State = newState;
-            if (this.OnTrackerStateChange == null)
-                return;
-
-            TrackerStateChangedEventArgs e = new TrackerStateChangedEventArgs(tracker, tracker.State, newState);
-            this.OnTrackerStateChange(this.manager, e);
+
+            if (this.OnTrackerStateChange != null)
+                this.OnTrackerStateChange(this.manager, e);
         }

@@ -392,4 +391,4 @@
         }
         #endregion
     }
-}+}


Added comments; forgot to comment out PutExtra line

--- src/Media.Plugin/Android/IntentExtraExtensions.cs
+++ src/Media.Plugin/Android/IntentExtraExtensions.cs
@@ -28,11 +28,15 @@
 			// Android API 25 and up
 			intent.PutExtra(extraBackPost25, 1);

+			//Removed PutExtra.  LG Phones crash when setting this intent and the back camera
+			// is already enabled (UserFront=false)
+
 			//TODO: Test if we can use the GetExtra to check before setting. May still fix LG
-			//with less potential negative side-effects
+			//with less potential negative side-effects for other phones or for the front-facing camera
+
 			//var val = intent.GetBooleanExtra(extraUserFront, false);
 			//if (val)
-				intent.PutExtra(extraUserFront, false);
+			//	intent.PutExtra(extraUserFront, false);
 		}
 	}
 }


Pre-create Continue bytes in Frame

Pre-create Continue bytes in Frame

--- src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs
+++ src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs
@@ -260,7 +260,13 @@
             //_upgradeTask = callback(_callContext);
         }

-        byte[] _continueBytes = Encoding.ASCII.GetBytes("HTTP/1.1 100 Continue\r\n\r\n");
+        private static readonly ArraySegment<byte> _continueBytes = CreateAsciiByteArraySegment("HTTP/1.1 100 Continue\r\n\r\n");
+
+        private static ArraySegment<byte> CreateAsciiByteArraySegment(string text)
+        {
+            var bytes = Encoding.ASCII.GetBytes(text);
+            return new ArraySegment<byte>(bytes);
+        }

         public void ProduceContinue()
         {
@@ -272,7 +278,7 @@
                 (expect.FirstOrDefault() ?? "").Equals("100-continue", StringComparison.OrdinalIgnoreCase))
             {
                 SocketOutput.Write(
-                    new ArraySegment<byte>(_continueBytes, 0, _continueBytes.Length),
+                    _continueBytes,
                     (error, _) =>
                     {
                         if (error != null)


Finishing fixing previous typo.

Finishing fixing previous typo.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@2802

--- src/NHibernate.Test/Criteria/CriteriaQueryTest.cs
+++ src/NHibernate.Test/Criteria/CriteriaQueryTest.cs
@@ -1349,7 +1349,7 @@
 				Assert.IsNotNull(criteria.GetCriteriaByPath("ma"));
 				Assert.AreEqual("ma",criteria.GetCriteriaByPath("ma").Alias);
 				Assert.AreEqual(criteria,criteria.GetCriteriaByPath("mu") );
-				Assert.AreEqual(criteria.CreateCriteria("fooBar"), criteria.GetCriteiraByPath("fooBar") );
+				Assert.AreEqual(criteria.CreateCriteria("fooBar"), criteria.GetCriteriaByPath("fooBar") );

 			}
 		}


Fixing NRE when use dynamically change logging configuration

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@4314

--- src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs
+++ src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs
@@ -19,10 +19,11 @@
 		{
 			batchSize = Factory.Settings.AdoBatchSize;
 			currentBatch = new SqlClientSqlCommandSet();
-			if (log.IsDebugEnabled)
-			{
-				currentBatchCommandsLog = new StringBuilder();
-			}
+			//we always create this, because we need to deal with a scenario in which
+			//the user change the logging configuration at runtime. Trying to put this
+			//behind an if(log.IsDebugEnabled) will cause a null reference exception
+			//at that point.
+			currentBatchCommandsLog = new StringBuilder();
 		}

 		public override int BatchSize


Fix new defines added in merge

Fix new defines added in merge

--- src/NUnitFramework/testdata/AssertMultipleData.cs
+++ src/NUnitFramework/testdata/AssertMultipleData.cs
@@ -3,7 +3,7 @@

 #if ASYNC
 using System.Threading.Tasks;
-#if NET_4_0
+#if NET40
 using Task = System.Threading.Tasks.TaskEx;
 #endif
 #endif


Not displaying custom GUI texts when game is paused

--- src/Nuterra/Maritaria/MagnetToggleKeyBehaviour.cs
+++ src/Nuterra/Maritaria/MagnetToggleKeyBehaviour.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using UnityEngine;

 namespace Maritaria
@@ -33,7 +33,7 @@

 		public void OnGUI()
 		{
-			if (!Singleton.playerTank || Singleton.playerTank.blockman.IterateBlockComponents<ModuleItemHolderMagnet>().FirstOrDefault() == null)
+			if (!Singleton.playerTank || Singleton.playerTank.blockman.IterateBlockComponents<ModuleItemHolderMagnet>().FirstOrDefault() == null || Singleton.Manager<ManPauseGame>.inst.IsPaused)
 			{
 				//No tank or no magnet blocks
 				return;


minor fix

minor fix

--- src/OpenCvSharp.Extensions/BitmapConverter_Mat.cs
+++ src/OpenCvSharp.Extensions/BitmapConverter_Mat.cs
@@ -6,6 +6,15 @@

 namespace OpenCvSharp.Extensions
 {
+#if LANG_JP
+    /// <summary>
+    /// System.Drawing.BitmapとMatの相互変換メソッドを提供するクラス
+    /// </summary>
+#else
+    /// <summary>
+    /// static class which provides conversion between System.Drawing.Bitmap and Mat
+    /// </summary>
+#endif
     public static class BitmapConverter
     {
         #region ToMat


langversion defaults to 7.4

langversion defaults to 7.4

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

--- src/Peachpie.CodeAnalysis/Syntax/PhpSyntaxTree.cs
+++ src/Peachpie.CodeAnalysis/Syntax/PhpSyntaxTree.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Immutable;
+using System.Linq;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -85,9 +86,9 @@
             { new Version(8, 0), LanguageFeatures.Php80Set },
         };

-        public static Version LatestLanguageVersion => new Version(8, 0); // s_langversions.Keys.Max();
-
-        public static Version DefaultLanguageVersion => LatestLanguageVersion;
+        public static Version LatestLanguageVersion => SupportedLanguageVersions.Max();
+
+        public static Version DefaultLanguageVersion => new Version(7, 4);

         public static IReadOnlyCollection<Version> SupportedLanguageVersions => s_langversions.Keys;


PF-74 Added PostFileWithRequest convenience methods

These IServiceClient extension methods help make the generic file upload methods infer the correct response type, with no <TResponse> resolution required.

--- src/Aquarius.Client/TimeSeries/Client/ServiceClientExtensions.cs
+++ src/Aquarius.Client/TimeSeries/Client/ServiceClientExtensions.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Threading;
 using ServiceStack;
@@ -75,5 +76,20 @@
                 batch.Clear();
             }
         }
+
+        public static TResponse PostFileWithRequest<TResponse>(this IServiceClient client, string path, IReturn<TResponse> requestDto)
+        {
+            var fileToUpload = new FileInfo(path);
+
+            using (var stream = fileToUpload.OpenRead())
+            {
+                return PostFileWithRequest(client, stream, fileToUpload.Name, requestDto);
+            }
+        }
+
+        public static TResponse PostFileWithRequest<TResponse>(this IServiceClient client, Stream contentToUpload, string uploadedFileName, IReturn<TResponse> requestDto)
+        {
+            return client.PostFileWithRequest<TResponse>(contentToUpload, uploadedFileName, requestDto);
+        }
     }
 }


Avoid internal error when using project caching on an unsaved sln (#7768)

Fixes #7762

--- src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs
+++ src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs
@@ -345,16 +345,7 @@
             async Task LateInitializePluginForVsWorkaround(CacheRequest request)
             {
                 var (_, configuration) = request;
-                var solutionPath = configuration.Project.GetPropertyValue(SolutionProjectGenerator.SolutionPathPropertyName);
                 var solutionConfigurationXml = configuration.Project.GetPropertyValue(SolutionProjectGenerator.CurrentSolutionConfigurationContents);
-
-                ErrorUtilities.VerifyThrow(
-                    solutionPath != null && !string.IsNullOrWhiteSpace(solutionPath) && solutionPath != "*Undefined*",
-                    $"Expected VS to set a valid SolutionPath property but got: {solutionPath}");
-
-                ErrorUtilities.VerifyThrow(
-                    FileSystems.Default.FileExists(solutionPath),
-                    $"Solution file does not exist: {solutionPath}");

                 ErrorUtilities.VerifyThrow(
                     string.IsNullOrWhiteSpace(solutionConfigurationXml) is false,


handle service host startup race condition

--- src/CodeEditor.ServiceClient/IObservableServiceClientProvider.cs
+++ src/CodeEditor.ServiceClient/IObservableServiceClientProvider.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Diagnostics;
 using ServiceStack.Text;
 using CodeEditor.Composition;
 using CodeEditor.IO;
@@ -42,9 +43,7 @@
 			{
 				try
 				{
-					var uriFile = UriFileFor(serviceHostProcessSettings.Executable);
-					EnsureServiceHostProcessIsUp(uriFile, serviceHostProcessSettings);
-					var serviceHostUri = FirstLineOf(uriFile);
+					var serviceHostUri = ServiceHostUriFor(serviceHostProcessSettings);
 					observer.CompleteWith(new ObservableServiceClient(serviceHostUri));
 				}
 				catch (Exception e)
@@ -54,6 +53,16 @@
 				}
 				return Disposable.Empty;
 			});
+		}
+
+		string ServiceHostUriFor(ProcessSettings serviceHostProcessSettings)
+		{
+			lock (this)
+			{
+				var uriFile = UriFileFor(serviceHostProcessSettings.Executable);
+				EnsureServiceHostProcessIsUp(uriFile, serviceHostProcessSettings);
+				return FirstLineOf(uriFile);
+			}
 		}

 		string FirstLineOf(IFile uriFile)
@@ -72,6 +81,14 @@
 				return;
 			}
 			StartServiceHost(serviceHostProcessSettings);
+			WaitFor(uriFile, TimeSpan.FromMilliseconds(200));
+		}
+
+		void WaitFor(IFile uriFile, TimeSpan timeout)
+		{
+			var timer = Stopwatch.StartNew();
+			while (!uriFile.Exists() && timer.Elapsed < timeout)
+				System.Threading.Thread.Sleep(0);
 		}

 		IFile UriFileFor(ResourcePath serviceHostExecutablePath)


Avoid buffer overrun when calling gethostname

gethostname can truncate the returned host name up to the buffer size.
in that case the null termination will not be stored.
the change here is to force null termination

--- src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs
+++ src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs
@@ -31,6 +31,9 @@
                 throw new InvalidOperationException(string.Format("gethostname returned {0}", err));
             }

+            // If the hostname is truncated, it is unspecified whether the returned buffer includes a terminating null byte.
+            name[ArrLength - 1] = 0;
+
             return Marshal.PtrToStringAnsi((IntPtr)name);
         }
     }


Update usings.

Update usings.

--- src/EditorFeatures/CSharpTest/Wrapping/ParameterWrappingTests.cs
+++ src/EditorFeatures/CSharpTest/Wrapping/ParameterWrappingTests.cs
@@ -1,14 +1,8 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

-using System.Collections.Generic;
-using System.Collections.Immutable;
 using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CodeActions;
 using Microsoft.CodeAnalysis.CodeRefactorings;
 using Microsoft.CodeAnalysis.CSharp.Editor.Wrapping;
-using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings;
-using Microsoft.CodeAnalysis.Formatting;
-using Microsoft.CodeAnalysis.Options;
 using Microsoft.CodeAnalysis.Test.Utilities;
 using Xunit;


Remove rejoin logic.

Remove rejoin logic.

--- Chat/Chat.cs
+++ Chat/Chat.cs
@@ -976,24 +976,13 @@

             if (user == null)
             {
-                // Attempt to re-join the chat if the server forgot the user for some reason.
-                if (!Join())
-                {
-                    throw new InvalidOperationException(String.Format("You go by the name '{0}' but the server has no idea who you are.", name));
-                }
-
-                user = _db.Users.FirstOrDefault(u => u.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
-            }
-
+                throw new InvalidOperationException(String.Format("You go by the name '{0}' but the server has no idea who you are.", name));
+            }
+
+            // Make sure the calling user is who they should be
             if (user.ClientId != Context.ClientId)
             {
                 throw new InvalidOperationException("Nice try...");
-            }
-
-            // Keep the client id up to date
-            if (String.IsNullOrEmpty(user.ClientId))
-            {
-                user.ClientId = Context.ClientId;
             }

             user.Active = true;


Updated the constants file.

Updated the constants file.

--- Constants.cs
+++ Constants.cs
@@ -10,12 +10,6 @@
 {
 	Projects = new[]
 	{
-		new Project
-		{
-			Name = "Automation.ConfigWriter",
-			Folders = new string[0],
-			Files = new string[0]
-		},
 		new Project
 		{
 			Name = "Automation.Framework",
@@ -39,6 +33,12 @@
 			Name = "Automation.Tests",
 			Folders = new string[0],
 			Files = new string[0]
+		},
+		new Project
+		{
+			Name = "Automation.Xml",
+			Folders = new string[0],
+			Files = new string[0]
 		}
 	}
 };


remove diagnostics

remove diagnostics

--- App/StackExchange.DataExplorer/OData.svc.cs
+++ App/StackExchange.DataExplorer/OData.svc.cs
@@ -55,7 +55,7 @@
             config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
             config.SetEntitySetPageSize("*", 50);
             config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
-            config.UseVerboseErrors = true;
+           // config.UseVerboseErrors = true;
         }

         [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope",


Add NoContentView.

Add NoContentView.

--- App2Night/App2Night/View/CreatePartyPage.cs
+++ App2Night/App2Night/View/CreatePartyPage.cs
@@ -17,7 +17,12 @@
             MinimumDate = DateTime.Now,
             MaximumDate = DateTime.Now.AddMonths(12)
         };
-
+        StackLayout _noContentView = new StackLayout
+        {
+            HorizontalOptions = LayoutOptions.Center,
+            Padding = new Thickness(0, 20)
+        };
+        Label _noContentText = new Label { Text = "Click Here to Load image"};
         private TimePicker _timePicker = new TimePicker();
         private EnumBindablePicker<MusicGenre> _musicGenreSwitch = new EnumBindablePicker<MusicGenre>();
         private CustomButton _cancelButton = new CustomButton
@@ -43,6 +48,15 @@
             _acceptButton.ButtonTapped += Accept;
             _cancelButton.ButtonTapped += Cancel;
             Title = "Create Party";
+            _noContentView.Children.Add(new Label
+            {
+                FontFamily = "FontAwesome",
+                Text = "\uf11a",
+                FontSize = 100,
+                FontAttributes = FontAttributes.Bold
+            });
+            _noContentView.Children.Add(_noContentText);
+            _image.IsVisible = false;
             // set Content
             Content = new Grid
             {
@@ -101,12 +115,13 @@
                     {_datePicker,1,3 },
                     {_timePicker,1,4 },
                     {_musicGenreSwitch,1,5 },
-
+                    {_noContentView,0,0 },
                     {_cancelButton,1,6 },
                     {_acceptButton,0,6 }
                 }
             };
             Grid.SetColumnSpan(_image,2);
+            Grid.SetColumnSpan(_noContentView, 2);
         }

         private void Accept(Object o, EventArgs e)


Make CreditNote OutOfBandAmount nullable fixes #1901

--- src/Stripe.net/Entities/CreditNotes/CreditNote.cs
+++ src/Stripe.net/Entities/CreditNotes/CreditNote.cs
@@ -152,7 +152,7 @@
         /// Amount that was credited outside of Stripe.
         /// </summary>
         [JsonProperty("out_of_band_amount")]
-        public long OutOfBandAmount { get; set; }
+        public long? OutOfBandAmount { get; set; }

         /// <summary>
         /// The link to download the PDF of the credit note.


Skip .sav tests

Skip .sav tests

--- src/OpenSage.Game.Tests/Data/Sav/SaveFileTests.cs
+++ src/OpenSage.Game.Tests/Data/Sav/SaveFileTests.cs
@@ -17,8 +17,8 @@
             _fixture = fixture;
         }

-        //[Theory(Skip = "Doesn't work yet")]
-        [Theory]
+        [Theory(Skip = "Doesn't work yet")]
+        //[Theory]
         [MemberData(nameof(GetSaveFiles))]
         public void CanLoadSaveFiles(string relativePath)
         {


Check for Nullability of HttpContext while getting Client IP

--- src/Orchard/Services/ClientHostAddressAccessor.cs
+++ src/Orchard/Services/ClientHostAddressAccessor.cs
@@ -24,7 +24,12 @@
         public string ClientHostAddressHeaderName { get; set; }

         public string GetClientAddress() {
-            var request = _wca.GetContext().HttpContext.Request;
+            var workContext = _wca.GetContext();
+
+            if (workContext == null || workContext.HttpContext == null)
+                return string.Empty;
+
+            var request = workContext.HttpContext.Request;

             if (EnableClientHostAddressHeader && !String.IsNullOrWhiteSpace(ClientHostAddressHeaderName)) {
                 var headerName = ClientHostAddressHeaderName.Trim();


fix Authenticode hash (PE hash) calculation for unsigned files

--- src/PeNet/Header/Authenticode/AuthenticodeInfo.cs
+++ src/PeNet/Header/Authenticode/AuthenticodeInfo.cs
@@ -177,9 +177,16 @@
             hash.TransformBlock(buff, offset, length, new byte[length], 0);

             // 8-13. Hash everything between end of header and certificate
-            var sizeOfHeaders = Convert.ToInt32(_peFile.ImageNtHeaders?.OptionalHeader.SizeOfHeaders);
-            length = Convert.ToInt32(_peFile.WinCertificate?.Offset) - sizeOfHeaders;
-            hash.TransformBlock(buff, sizeOfHeaders, length, new byte[length], 0);
+            offset = Convert.ToInt32(_peFile.ImageNtHeaders?.OptionalHeader.SizeOfHeaders);
+
+            if (_peFile.WinCertificate is not null)
+            {
+                length = Convert.ToInt32(_peFile.WinCertificate?.Offset) - offset;
+                hash.TransformBlock(buff, offset, length, new byte[length], 0);
+
+                // Move offset right beyond the Certificate Table
+                offset += length + Convert.ToInt32(certificateTable?.Size);
+            }

             // 14. Create a value called FILE_SIZE, which is not part of the signature.
             // Set this value to the image’s file size, acquired from the underlying file system.
@@ -190,8 +197,6 @@
             // in the second ULONG value in the Certificate Table entry (32 bit: offset 132, 64 bit: offset 148) in Optional Header Data Directories.
             // 14. Hash everything from the end of the certificate to the end of the file.
             var fileSize = buff.Length;
-            var sizeOfAttributeCertificateTable = Convert.ToInt32(certificateTable?.Size);
-            offset = sizeOfAttributeCertificateTable + Convert.ToInt32(_peFile.WinCertificate?.Offset);
             if (fileSize > offset)
             {
                 length = fileSize - offset;


dynamic cast ulong -> phpvalue

dynamic cast ulong -> phpvalue

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

--- src/Peachpie.Runtime/Dynamic/ConvertExpression.cs
+++ src/Peachpie.Runtime/Dynamic/ConvertExpression.cs
@@ -475,7 +475,6 @@
             if (source == typeof(bool)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Bool), expr);
             if (source == typeof(int)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Int), expr);
             if (source == typeof(long)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Long), expr);
-            if (source == typeof(uint)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Long), Expression.Convert(expr, typeof(long)));
             if (source == typeof(double)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Double), expr);
             if (source == typeof(float)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Double), Expression.Convert(expr, typeof(double)));
             if (source == typeof(string)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.String), expr);
@@ -488,6 +487,8 @@
             if (source.GetTypeInfo().IsValueType)
             {
                 if (source == typeof(void)) return VoidAsConstant(expr, PhpValue.Void, Cache.Types.PhpValue);
+                if (source == typeof(uint)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Long), Expression.Convert(expr, typeof(long)));
+                if (source == typeof(ulong)) return Expression.Call(typeof(PhpValue).GetMethod("Create", Cache.Types.Double), Expression.Convert(expr, typeof(double)));

                 throw new NotImplementedException(source.FullName);
             }


Added test for issue 329.

Added test for issue 329.

--- src/FluentNHibernate.Testing/AutoMapping/AutoMapVersionTester.cs
+++ src/FluentNHibernate.Testing/AutoMapping/AutoMapVersionTester.cs
@@ -63,9 +63,22 @@
             mapping.Version.UnsavedValue.ShouldEqual(null);
         }

+        [Test]
+        public void ShouldMapInheritedByteArray()
+        {
+            var mapping = new ClassMapping { Type = typeof(SubTarget) };
+
+            mapper.Map(mapping, typeof(SubTarget).GetProperty("Version"));
+
+            Assert.That(mapping.Version, Is.Not.Null);
+        }
+
         private class Target
         {
             public byte[] Version { get; set; }
         }
+
+        private class SubTarget : Target
+        {}
     }
 }


Converting to property type when sometimes we put unappropriate values inside them.

--- src/GraphClimber/ExpressionImplementation/PropertyStateMember.cs
+++ src/GraphClimber/ExpressionImplementation/PropertyStateMember.cs
@@ -55,7 +55,7 @@
                 Expression.Assign(Expression.Property
                     (obj.Convert(_property.DeclaringType),
                         _property),
-                    value);
+                    value.Convert(_property.PropertyType));
         }

         public bool IsArrayElement


Update NarrowMapList.cs

Update NarrowMapList.cs

--- Assembly-CSharp/Global/Field/Map/NarrowMapList.cs
+++ Assembly-CSharp/Global/Field/Map/NarrowMapList.cs
@@ -8,7 +8,6 @@

     private static readonly Int32[] List = new[]
     {
-
         0052, // Prima Vista/Meeting Rm
         0053, // Prima Vista/Meeting Rm
         0056, // S. Gate
@@ -24,15 +23,13 @@
         0068, // A. Castle/Throne
         0069, // A. Castle/Throne
         0100, // Alexandria/Main Street
-        //0103, // Alexandria/Square
+        0102,
         0104, // Alexandria/Shop
         0105, // Alexandria/Alley
         0108, // Alexandria/Item Shop
         0109,
-        //0116, // Alexandria/Rooftop
+        0114,
         0150, // A. Castle/Guardhouse
-        //0153, // A. Castle/Hallway
-        //0154, // A. Castle/Hallway
         0160, // A. Castle/Courtyard
         0161, // A. Castle/Courtyard
         0162, // A. Castle/West Tower
@@ -44,12 +41,17 @@
         0201, // Prima Vista/Bridge
         0203, // Prima Vista/Meeting Rm
         0205, // Prima Vista/Hallway
+        0206,
+        0207,
         0209, // Prima Vista/Event
+        0251,
+        0252,
         0254,
         0255, // Evil Forest/Riverbank
         0256, // Evil Forest/Trail
         0259, // Evil Forest/Trail
         0261, // Evil Forest/Exit
+        0262,
         0301, // Ice Cavern/Ice Path
         0305, // Ice Cavern/Ice Path
         0306, // Ice Cavern/Cave
@@ -57,14 +59,12 @@
         0309, // Ice Cavern/Waterfall
         0310, // Ice Cavern/Waterfall
         0311, // Ice Cavern/Exit
-        //0351, // Dali/Inn
-        //0352, // Dali/Inn
         0354, // Dali/Wpn. Shop
-        //0355, // Dali/Pub
         0357, // Dali/Windmill 2F
         0358, // Dali/Windmill
         0359, // Dali/???
         0400, // Dali/Underground
+        0407,
         0452, // Dali/Field
         0453, // Dali/Field
         0454, // Dali/Field
@@ -74,25 +74,27 @@
         0500, // Cargo Ship/Deck
         0502, // Cargo Ship/Bridge
         0503, // Cargo Ship/Bridge
-        //0504, // Cargo Ship/Engine Room
         0505, // Cargo Ship/Rear Deck
         0506, // Cargo Ship/Deck
+        0550,
         0551, // Lindblum/B.D. Station
         0553, // Lindblum/Inn
+        0556,
         0560, // Lindblum/Synthesist
-        0562, // Lindblum/Wpn. Shop
+        0565,
         0567, // Lindblum/Theater Ave.
         0570, // Lindblum/Industrial Wa
         0574, // Lindblum/Festival
         0576, // Lindblum/Festival
-        //0600, // L. Castle/Royal Cham.
         0601, // L. Castle/Lift
         0606, // L. Castle/Event
         0607, // L. Castle/Hangar
         0609, // L. Castle/Castle Bridg
-        //0615, // L. Castle/Telescope
+        0620,
         0701, // Gizamaluke/Entrance
+        0705,
         0750, // Burmecia/Gate
+        0751,
         0754, // Burmecia/Residence
         0758, // Burmecia/Pathway
         0760, // Burmecia/Uptown Area
@@ -102,13 +104,14 @@
         0767, // Burmecia/Palace
         0800, // S. Gate/Bohden Gate
         0802, // S. Gate/Bohden Sta.
+        0803,
         0813, // S. Gate/Berkmea
         0814, // S. Gate/Berkmea
         0816, // S. Gate/Berkmea
-        //0916, // Treno/Dock
+        0911,
         0930, // Treno/Tot Residence
         0932, // Treno/Event
-        //0951, // Gargan Roo/Passage
+        0950,
         0954, // Gargan Roo/Tunnel
         1000, // Cleyra/Tree Roots
         1001, // Cleyra/Tree Roots
@@ -118,31 +121,21 @@
         1007, // Cleyra/Tree Trunk
         1009, // Cleyra/Tree Trunk
         1013, // Cleyra/Tree Trunk
-        //1015, // Cleyra/Tree Trunk
         1017, // Cleyra/Tree Trunk
+        1018,
         1050, // Cleyra/Tree Trunk
-        //1051, // Cleyra/Entrance
-        //1053, // Cleyra/Water Mill Area
-        //1054, // Cleyra/Windmill Area
-        //1055, // Cleyra/Town Area
-        //1057, // Cleyra/Observation Poi
         1058, // Cleyra/Cathedral
-        //1059, // Cleyra/Cathedral
-        //1060, // Cleyra/Cathedral
         1100, // Cleyra/Tree Trunk
         1108, // Cleyra/Cathedral
-        //1110, // Cleyra/Cathedral
         1150, // Red Rose/Deck
         1151, // Red Rose/Cabin
         1153, // Red Rose/Bridge
         1200, // A. Castle/Throne
-        //1205, // A. Castle/Chapel
+        1201,
         1208, // A. Castle/Dungeon
         1210, // A. Castle/West Tower
         1212, // A. Castle/East Tower
         1213, // A. Castle/Guardhouse
-        //1214, // A. Castle/Hallway
-        //1215, // A. Castle/Hallway
         1221, // A. Castle/Courtyard
         1222, // A. Castle/Courtyard
         1226, // A. Castle/Library
@@ -150,26 +143,30 @@
         1251, // Pinnacle Rocks/Hole
         1252, // Pinnacle Rocks/Path
         1253, // Pinnacle Rocks/Path
+        1254,
         1300, // Lindblum/Hunter’s Gate
         1301, // Lindblum/B.D. Station
         1303, // Lindblum/Inn
         1308, // Lindblum/Synthesist
-        1309, // Lindblum/Wpn. Shop
         1314, // Lindblum/Theater Ave.
         1357, // L. Castle/Hangar
         1401, // Fossil Roo/Cavern
         1403, // Fossil Roo/Cavern
+        1404,
         1406, // Fossil Roo/Nest
         1410, // Fossil Roo/Nest
         1452, // Mage Village/Cemetery
         1453, // Mage Village/Cemetery
         1455, // Mage Village/Synthesis
         1457, // Mage Village/Rooftop
+        1458,
         1459, // Mage Village/Water Mil
-        //1462, // Mage Village/Event
         1463, // Dead Forest/Grove
         1464, // Dead Forest/Dead End
+        1500,
+        1506,
         1507, // Conde Petie/Pathway
+        1508,
         1509, // Conde Petie/Item Shop
         1556, // Mountain Path/Roots
         1557, // Mountain Path/Roots
@@ -180,14 +177,15 @@
         1608, // Mdn. Sari/Secret Room
         1609, // Mdn. Sari/Cove
         1610, // Mdn. Sari/Cove
+        1650,
         1651, // Iifa Tree/Tree Roots
-        //1652, // Iifa Tree/Roots
-        //1653, // Iifa Tree/Tree Roots
         1655, // Iifa Tree/Tree Path
         1656, // Iifa Tree/Eidolon Moun
         1657, // Iifa Tree/Tree Roots
         1658, // Iifa Tree/Silver Drago
-        //1663, // Iifa Tree/Tree Trunk
+        1660,
+        1661,
+        1662,
         1704, // Mdn. Sari/Eidolon Wall
         1705, // Mdn. Sari/Resting Room
         1706, // Mdn. Sari/Kitchen
@@ -198,6 +196,7 @@
         1753, // Iifa Tree/Inner Roots
         1755, // Iifa Tree/Bottom
         1756, // Iifa Tree/Bottom
+        1757,
         1758, // Iifa Tree/Tree Roots
         1800, // A. Castle/Tomb
         1803, // A. Castle/Guardhouse
@@ -210,47 +209,52 @@
         1818, // A. Castle/Neptune
         1820, // A. Castle/West Tower
         1822, // A. Castle/Library
-        //1823, // A. Castle/Hallway
         1850, // Alexandria/Main Street
-        //1853, // Alexandria/Square
+        1852,
         1854, // Alexandria/Alley
         1857, // Alexandria/Item Shop
         1858, // Alexandria/Wpn. Shop
         1866, // Alexandria/Dock
+        1951,
+        1952,
         1953, // Quan’s/Fishing Area
         2000, // Hilda Garde 2/Deck
+        2002,
+        2004,
         2005, // A. Castle/Altar
+        2006,
         2007, // A. Castle/Altar
         2008, // A. Castle/Altar
         2010,
         2050, // Alexandria/Main Street
-        //2053, // Alexandria/Square
+        2052,
+        2055,
         2101, // Lindblum/B.D. Station
         2103, // Lindblum/Inn
         2108, // Lindblum/Synthesist
         2109, // Lindblum/Wpn. Shop
         2114, // Lindblum/Theater Ave.
-        //2150, // L. Castle/Royal Cham.
         2151, // L. Castle/Lift
         2157, // L. Castle/Hangar
         2159, // L. Castle/Castle Bridg
+        2200,
         2202, // Palace/Dungeon
         2203, // Palace/Rack
         2204, // Palace/Odyssey
         2205, // Palace/Odyssey
         2208, // Palace/Hallway
-        //2217, // Palace/Stairwell
-        2220, // Palace/Library
+        2222,
         2250, // Oeilvert/Outside
         2254, // Oeilvert/Ship Display
         2255, // Oeilvert/Stairwell
         2257, // Oeilvert/Display
-        //2259, // Oeilvert/Star Display
         2260, // Oeilvert/Tombstone
         2261, // Oeilvert/Bridge
+        2303,
         2305, // Esto Gaza/Path
         2351, // Gulug/Well
         2354, // Gulug/Room
+        2355,
         2356, // Gulug/Room
         2361, // Gulug/Well
         2362, // Gulug/Path
@@ -258,16 +262,19 @@
         2365,
         2400, // A. Castle/Neptune
         2405, // A. Castle/Courtyard
+        2406,
         2450, // Alexandria/Main Street
+        2451,
         2453, // Alexandria/Alley
         2458, // Alexandria/Dock
         2500, // I. Castle/Entrance
         2501, // I. Castle/Entrance
         2502, // I. Castle/Hall
+        2503,
         2504, // I. Castle/Small Room
         2505, // I. Castle/Inverted Roo
-        //2510, // I. Castle/Mural Room
         2512, // I. Castle/Mural Room
+        2513,
         2552, // Earth Shrine/Interior
         2600, // Terra/Hilltop
         2602, // Terra/Stepping Stones
@@ -275,19 +282,21 @@
         2606, // Terra/Tree base
         2607, // Terra/Bridge
         2608, // Terra/Event
+        2650,
         2651, // Bran Bal/Entrance
         2654, // Bran Bal/Pond
         2657, // Bran Bal/Storage
         2660, // Bran Bal/Hilltop
         2701, // Pand./Path
         2715, // Pand./Event
-        //2716, // Pand./Event
         2719, // Pand./Exit
         2752, // Invincible/Bridge
         2755, // Hilda Garde/Bridge
         2756, // Red Rose/Bridge
         2850, // Hilda Garde 3/Bridge
         2851, // Hilda Garde 3/Engine
+        2855,
+        2856,
         2900, // Memoria/Outside
         2901, // Memoria/Entrance
         2902, // Memoria/Stairs of Time
@@ -300,6 +309,7 @@
         2912, // Memoria/World Fusion
         2913, // Memoria/Portal
         2914, // Memoria/Birth
+        2915,
         2917, // Memoria/Gaia’s Birth
         2918, // Memoria/Stairs
         2919, // Memoria/Gate to Space
@@ -309,6 +319,7 @@
         2925, // Crystal World
         2926, // Crystal World
         2927, // Crystal World
+        2928,
         2929, // last/cw mbg a
         2930, // last/cw mbg 0
         2932, // last/cw brg 0
@@ -323,6 +334,7 @@
         3054, // Mage Village/Synthesis
         3056, // Mage Village/Rooftop
         3058, // Mage Village/Water Mil
-
+        3100,
+
     }.OrderBy(a => a).ToArray();
 }


Fixed bug

Fixed bug

--- AssetStudio/StudioClasses/ModelConverter.cs
+++ AssetStudio/StudioClasses/ModelConverter.cs
@@ -231,7 +231,7 @@
             var subHashSet = new HashSet<int>();
             var combine = false;
             int firstSubMesh = 0;
-            if (meshR.m_StaticBatchInfo != null && meshR.m_StaticBatchInfo.subMeshCount > 0)
+            if (meshR.m_StaticBatchInfo?.subMeshCount > 0)
             {
                 firstSubMesh = meshR.m_StaticBatchInfo.firstSubMesh;
                 var finalSubMesh = meshR.m_StaticBatchInfo.firstSubMesh + meshR.m_StaticBatchInfo.subMeshCount;
@@ -241,7 +241,7 @@
                 }
                 combine = true;
             }
-            else if (meshR.m_SubsetIndices != null)
+            else if (meshR.m_SubsetIndices?.Length > 0)
             {
                 firstSubMesh = (int)meshR.m_SubsetIndices.Min(x => x);
                 foreach (var index in meshR.m_SubsetIndices)
@@ -284,7 +284,7 @@
                     }
                     iVertex.Position = new Vector3(-mesh.m_Vertices[j * c], mesh.m_Vertices[j * c + 1], mesh.m_Vertices[j * c + 2]);
                     //Normals
-                    if (mesh.m_Normals != null && mesh.m_Normals.Length > 0)
+                    if (mesh.m_Normals?.Length > 0)
                     {
                         if (mesh.m_Normals.Length == mesh.m_VertexCount * 3)
                         {


Use IList<string> for TypeTable in WordDelimiterTokenFilter

--- src/Nest/Domain/Analysis/TokenFilter/WordDelimiterTokenFilter.cs
+++ src/Nest/Domain/Analysis/TokenFilter/WordDelimiterTokenFilter.cs
@@ -48,9 +48,9 @@
         public string ProtectedWordsPath { get; set; }

         [JsonProperty("type_table")]
-        public string TypeTable { get; set; }
+        public IList<string> TypeTable { get; set; }

         [JsonProperty("type_table_path")]
         public string TypeTablePath { get; set; }
     }
-}+}


Add tower and walls

Add tower and walls

--- Assets/MapGen/DistantTerrain/RegionMaker.cs
+++ Assets/MapGen/DistantTerrain/RegionMaker.cs
@@ -301,8 +301,6 @@
                     switch (building.type)
                     {
                         case SiteRealizationBuildingType.cottage_plot:
-                        case SiteRealizationBuildingType.castle_wall:
-                        case SiteRealizationBuildingType.castle_tower:
                         case SiteRealizationBuildingType.castle_courtyard:
                         case SiteRealizationBuildingType.house:
                         case SiteRealizationBuildingType.temple:
@@ -336,25 +334,31 @@
                         case SiteRealizationBuildingType.courtyard:
                         case SiteRealizationBuildingType.market_square:
                         case SiteRealizationBuildingType.waste:
-                            min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
-                            max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
-                            AddBlock(vert1 + min, vert1 + max, biome, terrainColor);
-                            break;
+                            {
+                                min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, terrainColor);
+                                break;
+                            }
                         case SiteRealizationBuildingType.pasture:
-                            min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
-                            max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
-                            AddBlock(vert1 + min, vert1 + max, biome, plantColor);
-                            break;
+                            {
+                                min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, plantColor);
+                                break;
+                            }
                         case SiteRealizationBuildingType.trenches:
-                            int mid_x = (building.min_x + building.max_x) / 2;
-                            int mid_y = (building.min_y + building.max_y) / 2;
-                            min = new Vector3((mid_x - 1) * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
-                            max = new Vector3((mid_x + 2) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
-                            AddBlock(vert1 + min, vert1 + max, biome, Color.black);
-                            min = new Vector3(building.min_x * GameMap.tileWidth, 0, -(mid_y - 1) * GameMap.tileWidth);
-                            max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(mid_y + 2) * GameMap.tileWidth);
-                            AddBlock(vert1 + min, vert1 + max, biome, Color.black);
-                            break;
+                            {
+                                int mid_x = (building.min_x + building.max_x) / 2;
+                                int mid_y = (building.min_y + building.max_y) / 2;
+                                min = new Vector3((mid_x - 1) * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                max = new Vector3((mid_x + 2) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, Color.black);
+                                min = new Vector3(building.min_x * GameMap.tileWidth, 0, -(mid_y - 1) * GameMap.tileWidth);
+                                max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 1 * GameMap.tileHeight / 6.0f, -(mid_y + 2) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, Color.black);
+                                break;
+                            }
                         case SiteRealizationBuildingType.great_tower:
                             {
                                 fakeTile.material = building.material;
@@ -372,11 +376,60 @@
                                 AddCylinder(vert1 + min, vert1 + max, biome, buildingColor);
                                 break;
                             }
+                        case SiteRealizationBuildingType.castle_wall:
+                            {
+                                fakeTile.material = building.material;
+                                Color buildingColor;
+                                ContentLoader.Instance.ColorConfiguration.GetValue(fakeTile, MeshLayer.StaticMaterial, out color);
+                                if (color != null)
+                                    buildingColor = color.value;
+                                else
+                                {
+                                    buildingColor = Color.magenta;
+                                }
+                                if (building.wall_info != null)
+                                {
+                                    min = new Vector3(building.wall_info.start_x * GameMap.tileWidth, (building.wall_info.start_z - tile.elevation) * GameMap.tileHeight, -building.wall_info.start_y * GameMap.tileWidth);
+                                    max = new Vector3(building.wall_info.end_x * GameMap.tileWidth, 0, -building.wall_info.end_y * GameMap.tileWidth);
+                                    AddWall(vert1 + min, vert1 + max, 4 * GameMap.tileWidth, biome, buildingColor);
+                                }
+                                else
+                                {
+                                    min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                    max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 2 * GameMap.tileHeight, -(building.max_y + 1) * GameMap.tileWidth);
+                                    AddBlock(vert1 + min, vert1 + max, biome, Color.black);
+                                }
+                                break;
+                            }
+                        case SiteRealizationBuildingType.castle_tower:
+                            {
+                                fakeTile.material = building.material;
+                                Color buildingColor;
+                                ContentLoader.Instance.ColorConfiguration.GetValue(fakeTile, MeshLayer.StaticMaterial, out color);
+                                if (color != null)
+                                    buildingColor = color.value;
+                                else
+                                {
+                                    Debug.LogError("No valid color for " + building.type);
+                                    buildingColor = Color.magenta;
+                                }
+                                int roof = 2;
+                                if (building.tower_info != null)
+                                {
+                                    roof = building.tower_info.roof_z - tile.elevation;
+                                }
+                                min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                max = new Vector3((building.max_x + 1) * GameMap.tileWidth, roof * GameMap.tileHeight, -(building.max_y + 1) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, buildingColor);
+                                break;
+                            }
                         default:
-                            min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
-                            max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 13 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
-                            AddBlock(vert1 + min, vert1 + max, biome, Color.magenta);
-                            break;
+                            {
+                                min = new Vector3(building.min_x * GameMap.tileWidth, 0, -building.min_y * GameMap.tileWidth);
+                                max = new Vector3((building.max_x + 1) * GameMap.tileWidth, 13 * GameMap.tileHeight / 6.0f, -(building.max_y + 1) * GameMap.tileWidth);
+                                AddBlock(vert1 + min, vert1 + max, biome, Color.magenta);
+                                break;
+                            }
                     }

                 }
@@ -1062,6 +1115,25 @@

     }

+    private void AddWall(Vector3 start, Vector3 end, float width, Vector2 biome, Color color)
+    {
+        Vector3 front = new Vector3(end.x - start.x, 0, end.z - start.z).normalized * width / 2;
+        Vector3 left = new Vector3(-front.z, 0, front.x);
+        Vector3 down = new Vector3(0, end.y - start.y, 0);
+
+        Vector3 v1 = new Vector3(start.x, start.y, start.z) + left - front;
+        Vector3 v4 = new Vector3(start.x, start.y, start.z) - left - front;
+        Vector3 v2 = new Vector3(end.x, start.y, end.z) + left + front;
+        Vector3 v3 = new Vector3(end.x, start.y, end.z) - left + front;
+
+        AddQuad(v1, v2, v3, v4, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);
+
+        AddVerticalQuad(v1, v2 + down, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);
+        AddVerticalQuad(v2, v3 + down, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);
+        AddVerticalQuad(v3, v4 + down, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);
+        AddVerticalQuad(v4, v1 + down, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);
+    }
+
     private void AddBlock(Vector3 min, Vector3 max, Vector2 biome, Color color)
     {
         AddHorizontalQuad(new Vector3(min.x, max.y, min.z), max, biome, color, vertices, colors, uvCoords, uvCoords2, triangles);


Fix test to use testcase parameter

Fix test to use testcase parameter

Fix RayleightTests.ValidateMaximum test to use the scale parameter instead of the hardcoded value.

--- src/Numerics.Tests/DistributionTests/Continuous/RayleighTests.cs
+++ src/Numerics.Tests/DistributionTests/Continuous/RayleighTests.cs
@@ -200,7 +200,7 @@
         [TestCase(Double.PositiveInfinity)]
         public void ValidateMaximum(double scale)
         {
-            var n = new Rayleigh(1.0);
+            var n = new Rayleigh(scale);
             Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
         }


Update UISpriteAnimation.cs

Update UISpriteAnimation.cs

--- Assets/NGUI/Scripts/UI/UISpriteAnimation.cs
+++ Assets/NGUI/Scripts/UI/UISpriteAnimation.cs
@@ -1,8 +1,3 @@
-//----------------------------------------------
-//            NGUI: Next-Gen UI kit
-// Copyright © 2011-2016 Tasharen Entertainment
-//----------------------------------------------
-
 using UnityEngine;
 using System.Collections.Generic;


fix inherate will overwrite cls table

fix inherate will overwrite cls table

--- Assets/Plugins/Slua_Managed/LuaValueType.cs
+++ Assets/Plugins/Slua_Managed/LuaValueType.cs
@@ -66,7 +66,7 @@

 local function inherite(cls,base)
 	for k,v in pairs(getmetatable(base)) do
-		if k:sub(1,2)~='__' and  k:sub(1,1)>='A' and k:sub(1,1)<='Z' then
+		if not cls[k] and k:sub(1,2)~='__' and  k:sub(1,1)>='A' and k:sub(1,1)<='Z' then
 			cls[k]=v
 		end
 	end


Refactor SceneService regions.

Refactor SceneService regions.

--- Assets/Scripts/SceneService/SceneService.cs
+++ Assets/Scripts/SceneService/SceneService.cs
@@ -76,22 +76,12 @@
             }
         }

-        #region Adhoc Loading Methods
-
-        public IEnumerator LoadNextLevelFadeIn(bool useLoadingScreen = true, bool usePlayerInput = false)
-        {
-            var initalSceneId = SceneUtilityEx.GetNextSceneName();
-            yield return StartCoroutine(LoadLevelFadeIn(initalSceneId, true, useLoadingScreen, usePlayerInput));
-        }
-
-        #endregion
-
-        #region Core Loader Methods
+        #region Scene Loading (Optional Fade In / Out)

         public void LoadLevelFadeInDelegate(int index, bool animate = true, bool useLoadingScreen = true,
             bool usePlayerInput = false)
         {
-            string sceneId = SceneManager.GetSceneAt(index).name;
+            var sceneId = SceneManager.GetSceneAt(index).name;
             LoadLevelFadeInDelegate(sceneId, animate, useLoadingScreen, usePlayerInput);
         }

@@ -103,8 +93,6 @@
             else
                 Instance.StartCoroutine(LoadLevelLoadScreen(sceneName, usePlayerInput));
         }
-
-        #region Internal Core Transition

         private IEnumerator LoadLevelFadeIn(string sceneId, bool showSplash = false, bool useLoadingScreen = true,
             bool usePlayerInput = false)
@@ -143,12 +131,10 @@
             yield return Instance.StartCoroutine(PlayFadeAnimation(false, BlackOverlay));
             SetCanvasEnabled(false);
         }
-
-        #endregion
-
-        #endregion
-
-        #region Loading Screen
+
+        #endregion
+
+        #region Scene Loading With Loading Screen (Optional Player Input)

         public IEnumerator LoadLevelLoadScreen(string sceneName, bool usePlayerInput)
         {
@@ -185,8 +171,6 @@
             ao.allowSceneActivation = true;
             RemoveLoadingScreen();
         }
-
-        #region Internal LoadingScreen Manangement

         private LoadingScreenPresenter RequestLoadingScreen(bool requirePlayerInput)
         {
@@ -211,9 +195,7 @@
         {
             Destroy(_instancedLoadScreen.gameObject);
         }
-
-        #endregion
-
+
         #endregion

         #region Animation
@@ -289,7 +271,7 @@
             return string.Empty;
         }

-        public static string GetSceneNameByBuildIndex(int buildIndex)
+        private static string GetSceneNameByBuildIndex(int buildIndex)
         {
             return GetSceneNameFromScenePath(SceneUtility.GetScenePathByBuildIndex(buildIndex));
         }


refactor(Logger): use trace log level by default

When adding the Logger script to the scene to customize its settings the
log level was initially set to `Info` by default, despite the
automatically created Logger using `Trace` instead.
This change makes sure `Trace` is used in all cases by default and
simplifies the automatic creation to use the default values.

--- Assets/VRTK/Scripts/Internal/VRTK_Logger.cs
+++ Assets/VRTK/Scripts/Internal/VRTK_Logger.cs
@@ -49,7 +49,7 @@

         public static Dictionary<CommonMessageKeys, int> commonMessageParts = new Dictionary<CommonMessageKeys, int>();

-        public LogLevels minLevel = LogLevels.Info;
+        public LogLevels minLevel = LogLevels.Trace;
         public bool throwExceptions = true;

         public static void CreateIfNotExists()
@@ -61,8 +61,6 @@
                     hideFlags = HideFlags.DontSaveInEditor | HideFlags.HideInHierarchy
                 };
                 instance = loggerObject.AddComponent<VRTK_Logger>();
-                instance.minLevel = LogLevels.Trace;
-                instance.throwExceptions = true;
             }

             if (commonMessageParts.Count != commonMessages.Count)


Fixed caps check in SetTextureBlendingMode.

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@57 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom/RenderSystem_OpenGL/GLRenderSystem.cs
+++ Axiom/RenderSystem_OpenGL/GLRenderSystem.cs
@@ -550,20 +550,20 @@
             float[] vals = tempColorVals;

             // ambient
-            if(lastAmbient == null || lastAmbient != ambient) {
+            //if(lastAmbient == null || lastAmbient != ambient) {
                 ambient.ToArrayRGBA(vals);
                 Gl.glMaterialfv(Gl.GL_FRONT_AND_BACK, Gl.GL_AMBIENT, vals);

                 lastAmbient = ambient;
-            }
+            //}

             // diffuse
-            if(lastDiffuse == null || lastDiffuse != diffuse) {
+            //if(lastDiffuse == null || lastDiffuse != diffuse) {
                 vals[0] = diffuse.r; vals[1] = diffuse.g; vals[2] = diffuse.b; vals[3] = diffuse.a;
                 Gl.glMaterialfv(Gl.GL_FRONT_AND_BACK, Gl.GL_DIFFUSE, vals);

                 lastDiffuse = diffuse;
-            }
+            //}

             // specular
             if(lastSpecular == null || lastSpecular != specular) {
@@ -595,9 +595,9 @@
         /// <param name="stage"></param>
         /// <param name="texAddressingMode"></param>
         protected override void SetTextureAddressingMode(int stage, TextureAddressing texAddressingMode) {
-            if(textureUnits[stage].TextureAddressing == texAddressingMode) {
-                return;
-            }
+            //if(textureUnits[stage].TextureAddressing == texAddressingMode) {
+           //     return;
+           // }

             int type = 0;

@@ -630,16 +630,13 @@
         /// <param name="stage"></param>
         /// <param name="blendMode"></param>
         public override void SetTextureBlendMode(int stage, LayerBlendModeEx blendMode) {
-            if(caps.CheckCap(Capabilities.TextureBlending)) {
+            if(!caps.CheckCap(Capabilities.TextureBlending)) {
                 return;
             }

             if(textureUnits[stage].ColorBlendMode == blendMode) {
                 return;
             }
-
-            //float[] av1 = new float[4] {0.0f, 0.0f, 0.0f, blendMode.alphaArg1};
-            //float[] av2 = new float[4] {0.0f, 0.0f, 0.0f, blendMode.alphaArg2};

             int src1op, src2op, cmd;

@@ -771,17 +768,32 @@
             Gl.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_OPERAND1_ALPHA, Gl.GL_SRC_ALPHA);
             Gl.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_OPERAND2_ALPHA, Gl.GL_SRC_ALPHA);

-            // color value 1
-            blendMode.colorArg1.ToArrayRGBA(tempColorVals);
-
-            if (blendMode.blendType == LayerBlendType.Color && blendMode.source1 == LayerBlendSource.Manual)
+            // check source2 and set colors values appropriately
+            if (blendMode.source1 == LayerBlendSource.Manual) {
+                if(blendMode.blendType == LayerBlendType.Color) {
+                    // color value 1
+                    blendMode.colorArg1.ToArrayRGBA(tempColorVals);
+                }
+                else {
+                    // alpha value 1
+                    tempColorVals[0] = 0.0f; tempColorVals[1] = 0.0f; tempColorVals[2] = 0.0f; tempColorVals[3] = blendMode.alphaArg1;
+                }
+
                 Gl.glTexEnvfv(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_COLOR, tempColorVals);
-
-            // color value 2
-            blendMode.colorArg2.ToArrayRGBA(tempColorVals);
-
-            if (blendMode.blendType == LayerBlendType.Color && blendMode.source2 == LayerBlendSource.Manual)
+            }
+
+            // check source2 and set colors values appropriately
+            if (blendMode.source2 == LayerBlendSource.Manual) {
+                if(blendMode.blendType == LayerBlendType.Color) {
+                    // color value 2
+                    blendMode.colorArg2.ToArrayRGBA(tempColorVals);
+                }
+                else {
+                    // alpha value 2
+                    tempColorVals[0] = 0.0f; tempColorVals[1] = 0.0f; tempColorVals[2] = 0.0f; tempColorVals[3] = blendMode.alphaArg2;
+                }
                 Gl.glTexEnvfv(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_COLOR, tempColorVals);
+            }

             Ext.glActiveTextureARB(Gl.GL_TEXTURE0);
         }