#i105680# add c# tests

#i105680# add c# tests

--- testtools/source/bridgetest/cli/cli_cs_testobj.cs
+++ testtools/source/bridgetest/cli/cli_cs_testobj.cs
@@ -225,6 +225,26 @@
         o_testDataElements = _testDataElements;

         return _testDataElements;
+    }
+
+    public SmallStruct echoSmallStruct(/*[in]*/SmallStruct arg)
+    {
+        return arg;
+    }
+
+    public MediumStruct echoMediumStruct(/*[in]*/MediumStruct arg)
+    {
+        return arg;
+    }
+
+    public BigStruct echoBigStruct(/*[in]*/BigStruct arg)
+    {
+        return arg;
+    }
+
+    public AllFloats echoAllFloats(/*[in]*/AllFloats arg)
+    {
+        return arg;
     }

     // Attributes


Slightly straighten the comparison to the Head reference

--- LibGit2Sharp/Branch.cs
+++ LibGit2Sharp/Branch.cs
@@ -52,7 +52,7 @@
         /// </value>
         public bool IsCurrentRepositoryHead
         {
-            get { return CanonicalName == repo.Refs.Head.ResolveToDirectReference().CanonicalName; }
+            get { return repo.Refs[CanonicalName] == repo.Refs.Head.ResolveToDirectReference(); }
         }

         /// <summary>


Update MainWindow.xaml.cs

Update MainWindow.xaml.cs

--- MD5/MainWindow.xaml.cs
+++ MD5/MainWindow.xaml.cs
@@ -64,10 +64,6 @@

         private void checker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
-            // Test case:
-            // File: Devil May Cry (Europe) (En,Fr,De,Es,It).7z
-            // Hash: 5a52747ef4e4b87a0b6bddf93ac804f3
-
             Title = "Compute MD5";
             BtnOpen.IsEnabled = true;
             BtnPaste.IsEnabled = true;


Fixes issue with certain members recieving the update message when they shouldn't.

--- core/ServerCore.cs
+++ core/ServerCore.cs
@@ -501,8 +501,10 @@
                             UserPool.AUsers.ForEachWhere(x =>
                             {
                                 if (x.Level >= ILevel.Host)
+                                {
                                     x.Print(message);
-                                x.PM(Settings.Get<String>("bot"), message);
+                                    x.PM(Settings.Get<String>("bot"), message);
+                                }
                             }, x => x.LoggedIn && !x.Quarantined && x.Owner);

                             // web users


RepeatFirstAtEnd when end not already equals first

--- src/DxfKit.cs
+++ src/DxfKit.cs
@@ -220,17 +220,20 @@

         /// <summary>
         /// given points a,b,c it will return a,b,c,a ( first is repeated at end )
-        /// </summary>
-        public static IEnumerable<Vector3D> RepeatFirstAtEnd(this IEnumerable<Vector3D> pts)
+        /// it avoid to repeat first at end when latest point already equals the first one
+        /// </summary>
+        public static IEnumerable<Vector3D> RepeatFirstAtEnd(this IEnumerable<Vector3D> pts, double tol)
         {
             Vector3D first = null;
+            Vector3D last = null;
             foreach (var x in pts)
             {
                 if (first == null) first = x;
+                last = x;
                 yield return x;
             }
-            yield return first;
-
+
+            if (!last.EqualsTol(tol, first)) yield return first;
         }

         public static IEnumerable<EntityObject> CoordTransform(this DxfDocument dxf, Func<Vector3D, Vector3D> transform)


Adding support for nullable types with FastColumnSet.

--- src/SQLite.cs
+++ src/SQLite.cs
@@ -2906,10 +2906,9 @@

 				for (int i = 0; i < cols.Length; i++) {
 					var name = SQLite3.ColumnName16 (stmt, i);
-					var colType = SQLite3.ColumnType (stmt, i);
 					cols[i] = map.FindColumn (name);
 					if (cols[i] != null)
-						fastColumnSetters[i] = FastColumnSetter.GetFastSetter<T> (_conn, colType, cols[i]);
+						fastColumnSetters[i] = FastColumnSetter.GetFastSetter<T> (_conn, cols[i]);
 				}

 				while (SQLite3.Step (stmt) == SQLite3.Result.Row) {
@@ -3254,22 +3253,17 @@
 		/// </summary>
 		/// <typeparam name="T">The type of the destination object that the query will read into</typeparam>
 		/// <param name="conn">The active connection.  Note that this is primarily needed in order to read preferences regarding how certain data types (such as TimeSpan / DateTime) should be encoded in the database.</param>
-		/// <param name="colType">The column type as stored in SQLite</param>
 		/// <param name="column">The table mapping used to map the statement column to a member of the destination object type</param>
 		/// <returns>
 		/// A delegate for fast-setting of object members from statement columns.
 		///
 		/// If no fast setter is available for the requested column (enums in particular cause headache), then this function returns null.
 		/// </returns>
-		internal static Action<T, Sqlite3Statement, int> GetFastSetter<T> (SQLiteConnection conn, SQLite3.ColType colType, TableMapping.Column column)
+		internal static Action<T, Sqlite3Statement, int> GetFastSetter<T> (SQLiteConnection conn, TableMapping.Column column)
 		{
 			Action<T, Sqlite3Statement, int> fastSetter = null;

-			Type clrType = column.ColumnType;
-
-			if (colType == SQLite3.ColType.Null) {
-				return null;
-			}
+			Type clrType = column.PropertyInfo.PropertyType;

 			var clrTypeInfo = clrType.GetTypeInfo ();
 			if (clrTypeInfo.IsGenericType && clrTypeInfo.GetGenericTypeDefinition () == typeof (Nullable<>)) {
@@ -3283,33 +3277,33 @@
 				});
 			}
 			else if (clrType == typeof (Int32)) {
-				fastSetter = CreateTypedSetterDelegate<T, int> (column, (stmt, index)=>{
+				fastSetter = CreateNullableTypedSetterDelegate<T, int> (column, (stmt, index)=>{
 					return SQLite3.ColumnInt (stmt, index);
 				});
 			}
 			else if (clrType == typeof (Boolean)) {
-				fastSetter = CreateTypedSetterDelegate<T, bool> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, bool> (column, (stmt, index) => {
 					return SQLite3.ColumnInt (stmt, index) == 1;
 				});
 			}
 			else if (clrType == typeof (double)) {
-				fastSetter = CreateTypedSetterDelegate<T, double> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, double> (column, (stmt, index) => {
 					return SQLite3.ColumnDouble (stmt, index);
 				});
 			}
 			else if (clrType == typeof (float)) {
-				fastSetter = CreateTypedSetterDelegate<T, float> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, float> (column, (stmt, index) => {
 					return (float) SQLite3.ColumnDouble (stmt, index);
 				});
 			}
 			else if (clrType == typeof (TimeSpan)) {
 				if (conn.StoreTimeSpanAsTicks) {
-					fastSetter = CreateTypedSetterDelegate<T, TimeSpan> (column, (stmt, index) => {
+					fastSetter = CreateNullableTypedSetterDelegate<T, TimeSpan> (column, (stmt, index) => {
 						return new TimeSpan (SQLite3.ColumnInt64 (stmt, index));
 					});
 				}
 				else {
-					fastSetter = CreateTypedSetterDelegate<T, TimeSpan> (column, (stmt, index) => {
+					fastSetter = CreateNullableTypedSetterDelegate<T, TimeSpan> (column, (stmt, index) => {
 						var text = SQLite3.ColumnString (stmt, index);
 						TimeSpan resultTime;
 						if (!TimeSpan.TryParseExact (text, "c", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.TimeSpanStyles.None, out resultTime)) {
@@ -3321,12 +3315,12 @@
 			}
 			else if (clrType == typeof (DateTime)) {
 				if (conn.StoreDateTimeAsTicks) {
-					fastSetter = CreateTypedSetterDelegate<T, DateTime> (column, (stmt, index) => {
+					fastSetter = CreateNullableTypedSetterDelegate<T, DateTime> (column, (stmt, index) => {
 						return new DateTime (SQLite3.ColumnInt64 (stmt, index));
 					});
 				}
 				else {
-					fastSetter = CreateTypedSetterDelegate<T, DateTime> (column, (stmt, index) => {
+					fastSetter = CreateNullableTypedSetterDelegate<T, DateTime> (column, (stmt, index) => {
 						var text = SQLite3.ColumnString (stmt, index);
 						DateTime resultDate;
 						if (!DateTime.TryParseExact (text, conn.DateTimeStringFormat, System.Globalization.CultureInfo.InvariantCulture, conn.DateTimeStyle, out resultDate)) {
@@ -3337,7 +3331,7 @@
 				}
 			}
 			else if (clrType == typeof (DateTimeOffset)) {
-				fastSetter = CreateTypedSetterDelegate<T, DateTimeOffset> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, DateTimeOffset> (column, (stmt, index) => {
 					return new DateTimeOffset (SQLite3.ColumnInt64 (stmt, index), TimeSpan.Zero);
 				});
 			}
@@ -3345,37 +3339,37 @@
 				// NOTE: Not sure of a good way (if any?) to do a strongly-typed fast setter like this for enumerated types -- for now, return null and column sets will revert back to the safe (but slow) Reflection-based method of column prop.Set()
 			}
 			else if (clrType == typeof (Int64)) {
-				fastSetter = CreateTypedSetterDelegate<T, Int64> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, Int64> (column, (stmt, index) => {
 					return SQLite3.ColumnInt64 (stmt, index);
 				});
 			}
 			else if (clrType == typeof (UInt32)) {
-				fastSetter = CreateTypedSetterDelegate<T, UInt32> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, UInt32> (column, (stmt, index) => {
 					return (uint)SQLite3.ColumnInt64 (stmt, index);
 				});
 			}
 			else if (clrType == typeof (decimal)) {
-				fastSetter = CreateTypedSetterDelegate<T, decimal> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, decimal> (column, (stmt, index) => {
 					return (decimal)SQLite3.ColumnDouble (stmt, index);
 				});
 			}
 			else if (clrType == typeof (Byte)) {
-				fastSetter = CreateTypedSetterDelegate<T, Byte> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, Byte> (column, (stmt, index) => {
 					return (byte)SQLite3.ColumnInt (stmt, index);
 				});
 			}
 			else if (clrType == typeof (UInt16)) {
-				fastSetter = CreateTypedSetterDelegate<T, UInt16> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, UInt16> (column, (stmt, index) => {
 					return (ushort)SQLite3.ColumnInt (stmt, index);
 				});
 			}
 			else if (clrType == typeof (Int16)) {
-				fastSetter = CreateTypedSetterDelegate<T, Int16> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, Int16> (column, (stmt, index) => {
 					return (short)SQLite3.ColumnInt (stmt, index);
 				});
 			}
 			else if (clrType == typeof (sbyte)) {
-				fastSetter = CreateTypedSetterDelegate<T, sbyte> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, sbyte> (column, (stmt, index) => {
 					return (sbyte)SQLite3.ColumnInt (stmt, index);
 				});
 			}
@@ -3385,7 +3379,7 @@
 				});
 			}
 			else if (clrType == typeof (Guid)) {
-				fastSetter = CreateTypedSetterDelegate<T, Guid> (column, (stmt, index) => {
+				fastSetter = CreateNullableTypedSetterDelegate<T, Guid> (column, (stmt, index) => {
 					var text = SQLite3.ColumnString (stmt, index);
 					return new Guid (text);
 				});
@@ -3409,13 +3403,49 @@
 				});
 			}
 			else {
-				// Note: Will fall back to the slow setter method in the event that we are unable to create a fast setter delegate for a particular column type
+				// NOTE: Will fall back to the slow setter method in the event that we are unable to create a fast setter delegate for a particular column type
 			}
 			return fastSetter;
 		}

 		/// <summary>
 		/// This creates a strongly typed delegate that will permit fast setting of column values given a Sqlite3Statement and a column index.
+		///
+		/// Note that this is identical to CreateTypedSetterDelegate(), but has an extra check to see if it should create a nullable version of the delegate.
+		/// </summary>
+		/// <typeparam name="ObjectType">The type of the object whose member column is being set</typeparam>
+		/// <typeparam name="ColumnMemberType">The CLR type of the member in the object which corresponds to the given SQLite columnn</typeparam>
+		/// <param name="column">The column mapping that identifies the target member of the destination object</param>
+		/// <param name="getColumnValue">A lambda that can be used to retrieve the column value at query-time</param>
+		/// <returns>A strongly-typed delegate</returns>
+		private static Action<ObjectType, Sqlite3Statement, int> CreateNullableTypedSetterDelegate<ObjectType, ColumnMemberType> (TableMapping.Column column, Func<Sqlite3Statement, int, ColumnMemberType> getColumnValue) where ColumnMemberType : struct
+		{
+			var clrTypeInfo = column.PropertyInfo.PropertyType.GetTypeInfo();
+			bool isNullable = false;
+
+			if (clrTypeInfo.IsGenericType && clrTypeInfo.GetGenericTypeDefinition () == typeof (Nullable<>)) {
+				isNullable = true;
+			}
+
+			if (isNullable) {
+				var setProperty = (Action<ObjectType, ColumnMemberType?>)Delegate.CreateDelegate (
+						typeof (Action<ObjectType, ColumnMemberType?>), null,
+						column.PropertyInfo.GetSetMethod ());
+
+				return (o, stmt, i) => {
+					var colType = SQLite3.ColumnType (stmt, i);
+					if (colType != SQLite3.ColType.Null)
+						setProperty.Invoke (o, getColumnValue.Invoke (stmt, i));
+				};
+			}
+
+			return CreateTypedSetterDelegate<ObjectType, ColumnMemberType> (column, getColumnValue);
+		}
+
+		/// <summary>
+		/// This creates a strongly typed delegate that will permit fast setting of column values given a Sqlite3Statement and a column index.
+		///
+		/// Note that this has an extra check to see if it should create a nullable version of the delegate.
 		/// </summary>
 		/// <typeparam name="ObjectType">The type of the object whose member column is being set</typeparam>
 		/// <typeparam name="ColumnMemberType">The CLR type of the member in the object which corresponds to the given SQLite columnn</typeparam>
@@ -3424,18 +3454,15 @@
 		/// <returns>A strongly-typed delegate</returns>
 		private static Action<ObjectType, Sqlite3Statement, int> CreateTypedSetterDelegate<ObjectType, ColumnMemberType> (TableMapping.Column column, Func<Sqlite3Statement, int, ColumnMemberType> getColumnValue)
 		{
-			Action<ObjectType, Sqlite3Statement, int> fastSetter;
-
-			// Create a delegate that points to the Set accessor of the destination object property
 			var setProperty = (Action<ObjectType, ColumnMemberType>)Delegate.CreateDelegate (
 					typeof (Action<ObjectType, ColumnMemberType>), null,
 					column.PropertyInfo.GetSetMethod ());

-			// Wrapping the setter delegate allows us to maintain strong typing for these dynamic methods
-			fastSetter = (o, stmt, i) => {
-				setProperty.Invoke (o, getColumnValue.Invoke(stmt, i));
+			return (o, stmt, i) => {
+				var colType = SQLite3.ColumnType (stmt, i);
+				if (colType != SQLite3.ColType.Null)
+					setProperty.Invoke (o, getColumnValue.Invoke (stmt, i));
 			};
-			return fastSetter;
 		}
 	}


C++ redistributable.

C++ redistributable.

--- ksp_plugin_adapter/loader.cs
+++ ksp_plugin_adapter/loader.cs
@@ -72,14 +72,14 @@

   private static bool IsVCRedistInstalled(bool is_32_bit) {
     // NOTE(phl): These GUIDs are specific to:
-    //   Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23918
-    //   Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.23918
+    //   Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24212
+    //   Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24212
     // They will need to be updated when new versions of Visual C++
     // Redistributable are released by Microsoft.
     RegistryKey key = Registry.LocalMachine.OpenSubKey(
          @"Software\Classes\Installer\Dependencies\" +
-             (is_32_bit ? "{2e085fd2-a3e4-4b39-8e10-6b8d35f55244}"
-                        : "{dab68466-3a7d-41a8-a5cf-415e3ff8ef71}"),
+             (is_32_bit ? "{462f63a8-6347-4894-a1b3-dbfe3a4c981d}"
+                        : "{323dad84-0974-4d90-a1c1-e006c7fdbb7d}"),
          writable : false);
     if (key == null) {
       return false;
@@ -87,7 +87,7 @@
       string version = (string)key.GetValue("Version");
       // NOTE(phl): This string needs to be updated when new versions of Visual
       // C++ Redistributable are released by Microsoft.
-      return version != null && version == "14.0.23918.0";
+      return version != null && version == "14.0.24212.0";
     }
   }


Update DirectoryInfoImpl.cs

Update DirectoryInfoImpl.cs

--- source/Cosmos.System.Plugs/System/IO/DirectoryInfoImpl.cs
+++ source/Cosmos.System.Plugs/System/IO/DirectoryInfoImpl.cs
@@ -36,12 +36,6 @@
             Global.mFileSystemDebugger.SendInternal(aPath);

             aStorage = VFSManager.GetDirectory(aPath);
-
-            if (aStorage == null)
-            {
-                throw new NullReferenceException("Failed to create DirectoryInfo: Directory '" + aPath + "' doesn't exist");
-            }
-
             aFullPath = aPath;
             aName = Path.GetFileName(aPath);
         }


Added second indicator to dashboard

Added second indicator to dashboard

--- source/SqlServerReportRunner/Views/Dashboard/Index.cshtml
+++ source/SqlServerReportRunner/Views/Dashboard/Index.cshtml
@@ -67,19 +67,19 @@

-

+

-                                        {{ averageExecutionSeconds }}
+                                        {{ averageExecutionSeconds }}s
                                         Avg Execution

-

+

-                                        {{ averageGenerationSeconds }}
+                                        {{ averageGenerationSeconds }}s
                                         Avg Generation


Remove test namespace and class

Remove test namespace and class

--- src/AutoSitecoreUnitTest/AutoSitecoreCustomizationTest.cs
+++ src/AutoSitecoreUnitTest/AutoSitecoreCustomizationTest.cs
@@ -191,12 +191,4 @@
       items.First().ID.Should().NotBe(items.Last().ID);
     }
   }
-
-
-  namespace Silly
-  {
-    public class Item
-    {
-    }
-  }
 }


Don't show the ScaledSD column if values are small

--- src/BenchmarkDotNet.Core/Columns/DefaultColumnProvider.cs
+++ src/BenchmarkDotNet.Core/Columns/DefaultColumnProvider.cs
@@ -47,8 +47,18 @@
                 if (NeedToShow(summary, s => s.StandardDeviation > 1e-9))
                     yield return StatisticColumn.StdDev;

-                yield return BaselineScaledColumn.Scaled;
-                yield return BaselineScaledColumn.ScaledStdDev; // TODO: make optional
+                if (summary.Reports != null && summary.Benchmarks.Any(b => b.Target.Baseline))
+                {
+                    yield return BaselineScaledColumn.Scaled;
+                    var stdDevColumn = BaselineScaledColumn.ScaledStdDev;
+                    var stdDevColumnValues = summary.Benchmarks.Select(b => stdDevColumn.GetValue(summary, b));
+
+                    // Hide ScaledSD column if values is small
+                    // TODO: rewrite and check raw values
+                    bool hide = stdDevColumnValues.All(value => value == "0.00" || value == "0.01");
+                    if (!hide)
+                        yield return BaselineScaledColumn.ScaledStdDev;
+                }
             }

             private static bool NeedToShow(Summary summary, Func<Statistics, bool> check)
@@ -59,22 +69,20 @@

         private class ParamsColumnProvider : IColumnProvider
         {
-            public IEnumerable<IColumn> GetColumns(Summary summary)
-            {
-                return summary.Benchmarks.
-                    SelectMany(b => b.Parameters.Items.Select(item => item.Name)).
-                    Distinct().
-                    Select(name => new ParamColumn(name));
-            }
+            public IEnumerable<IColumn> GetColumns(Summary summary) => summary
+                .Benchmarks
+                .SelectMany(b => b.Parameters.Items.Select(item => item.Name))
+                .Distinct()
+                .Select(name => new ParamColumn(name));
         }

         private class DiagnosersColumnProvider : IColumnProvider
         {
-            public IEnumerable<IColumn> GetColumns(Summary summary) =>
-                summary.Config.
-                    GetDiagnosers().
-                    Select(d => d.GetColumnProvider()).
-                    SelectMany(cp => cp.GetColumns(summary));
+            public IEnumerable<IColumn> GetColumns(Summary summary) => summary
+                .Config
+                .GetDiagnosers()
+                .Select(d => d.GetColumnProvider())
+                .SelectMany(cp => cp.GetColumns(summary));
         }
     }
 }


Enable message for Dropbox check crash (BL-1246)

Also include stack trace in log message just in case it can be helpful.

--- src/BloomExe/CollectionChoosing/OpenCreateCloneControl.cs
+++ src/BloomExe/CollectionChoosing/OpenCreateCloneControl.cs
@@ -278,11 +278,11 @@
 			}
 			catch (Exception e)
 			{
-				// once we fix BL-1246, we should enable this:
-//				Palaso.Reporting.ErrorReport.NotifyUserOfProblem(e,
-//					"For some reason Bloom could not check your Dropbox settings. This should not cause you any problems, but please report it so we can fix it.");
+				// To help fix BL-1246, we enable this:
+				Palaso.Reporting.ErrorReport.NotifyUserOfProblem(e,
+					"For some reason Bloom could not check your Dropbox settings. This should not cause you any problems, but please report it so we can fix it.");
+				Palaso.Reporting.Logger.WriteEvent("*** In CheckForBeingInDropboxFolder(), got "+e.Message+Environment.NewLine+e.StackTrace);
 				Debug.Fail(e.Message);
-				Palaso.Reporting.Logger.WriteEvent("*** In CheckForBeingInDropboxFolder(), got "+e.Message);
 			}
 			return false;
 		}


Do not allow WriteArray or WriteObject to return while a stream is still being written

--- src/Compilers/Core/Portable/Serialization/ObjectWriter.cs
+++ src/Compilers/Core/Portable/Serialization/ObjectWriter.cs
@@ -487,7 +487,15 @@
                         _cancellationToken,
                         TaskCreationOptions.LongRunning,
                         TaskScheduler.Default);
-                    task.Wait();
+
+                    // We must not proceed until the additional task completes. After returning from a write, the underlying
+                    // stream providing access to raw memory will be closed; if this occurs before the separate thread
+                    // completes its write then an access violation can occur attempting to write to unmapped memory.
+                    //
+                    // CANCELLATION: If cancellation is required, DO NOT attempt to cancel the operation by cancelling this
+                    // wait. Cancellation must only be implemented by modifying 'task' to cancel itself in a timely manner
+                    // so the wait can complete.
+                    task.GetAwaiter().GetResult();
                 }
                 else
                 {
@@ -747,7 +755,15 @@
                         _cancellationToken,
                         TaskCreationOptions.LongRunning,
                         TaskScheduler.Default);
-                    task.Wait(_cancellationToken);
+
+                    // We must not proceed until the additional task completes. After returning from a write, the underlying
+                    // stream providing access to raw memory will be closed; if this occurs before the separate thread
+                    // completes its write then an access violation can occur attempting to write to unmapped memory.
+                    //
+                    // CANCELLATION: If cancellation is required, DO NOT attempt to cancel the operation by cancelling this
+                    // wait. Cancellation must only be implemented by modifying 'task' to cancel itself in a timely manner
+                    // so the wait can complete.
+                    task.GetAwaiter().GetResult();
                 }
                 else
                 {


Delete ShapeRendererStateControl.cs

Delete ShapeRendererStateControl.cs

--- src/Core2D.UI/Views/Renderer/ShapeRendererStateControl.cs
+++ src/Core2D.UI/Views/Renderer/ShapeRendererStateControl.cs
@@ -1,27 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
-
-namespace Core2D.UI.Views.Renderer
-{
-    /// <summary>
-    /// Interaction logic for <see cref="ShapeRendererStateControl"/> xaml.
-    /// </summary>
-    public class ShapeRendererStateControl : UserControl
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="ShapeRendererStateControl"/> class.
-        /// </summary>
-        public ShapeRendererStateControl()
-        {
-            InitializeComponent();
-        }
-
-        /// <summary>
-        /// Initialize the Xaml components.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            AvaloniaXamlLoader.Load(this);
-        }
-    }
-}


调用EventHandler时，改为总是永远重试异常。

调用EventHandler时，改为总是永远重试异常。

--- src/ENode/Infrastructure/Impl/DefaultMessageDispatcher.cs
+++ src/ENode/Infrastructure/Impl/DefaultMessageDispatcher.cs
@@ -181,7 +181,7 @@
             {
                 _logger.Fatal(string.Format("Handle single message has unknown exception, the code should not be run to here, errorMessage: {0}", errorMessage));
             },
-            retryTimes);
+            retryTimes, true);
         }
         private void HandleTwoMessageAsync(MultiMessageDisptaching multiMessageDispatching, IMessageHandlerProxy2 handlerProxy, string handlerTypeName, QueuedHandler<IMessageHandlerProxy2> queueHandler, int retryTimes)
         {
@@ -209,7 +209,7 @@
             {
                 _logger.Fatal(string.Format("Handle two message has unknown exception, the code should not be run to here, errorMessage: {0}", errorMessage));
             },
-            retryTimes);
+            retryTimes, true);
         }
         private void HandleThreeMessageAsync(MultiMessageDisptaching multiMessageDispatching, IMessageHandlerProxy3 handlerProxy, string handlerTypeName, QueuedHandler<IMessageHandlerProxy3> queueHandler, int retryTimes)
         {
@@ -238,7 +238,7 @@
             {
                 _logger.Fatal(string.Format("Handle three message has unknown exception, the code should not be run to here, errorMessage: {0}", errorMessage));
             },
-            retryTimes);
+            retryTimes, true);
         }

         #endregion


Change wait time before trying connection create to 12s.

--- src/EventStore/EventStore.Core.Tests/ClientAPI/connect.cs
+++ src/EventStore/EventStore.Core.Tests/ClientAPI/connect.cs
@@ -65,7 +65,7 @@
             {
                 connection.Connect(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12348));

-                Thread.Sleep(8000); //Ensure reconnection attempt
+                Thread.Sleep(12000); //Ensure reconnection attempt

                 Assert.Throws<InvalidOperationException>(
                     () => connection.CreateStream("stream", Guid.NewGuid(), false, new byte[0]),


more green

more green

--HG--
branch : tag-refactor

--- src/FunnelWeb.Tests/Web/Controllers/TagControllerTests.cs
+++ src/FunnelWeb.Tests/Web/Controllers/TagControllerTests.cs
@@ -14,7 +14,7 @@
     {

         [Test]
-        public void TagControllerTests_Empty_Repository_Returns_No_Categories()
+        public void TagControllerTests_Empty_Repository_Returns_No_Tags()
         {
             //Arrange
             var repo = Substitute.For<ITagRepository>();
@@ -29,5 +29,27 @@
             Assert.IsInstanceOf(typeof (IEnumerable<Tag>), result.Model);
             Assert.IsFalse(((IEnumerable<Tag>) result.Model).Any());
         }
+
+        [Test]
+        public void TagControllerTests_GetAll_Returns_Entire_Repository()
+        {
+            //Arrange
+            var repo = Substitute.For<ITagRepository>();
+            repo.GetAll().Returns(Enumerable
+                .Range(0, 5)
+                .Select(x => new Tag
+                                 {
+                                     Id = x,
+                                     Name = x.ToString()
+                                 }));
+            var controller = new TagController(repo);
+
+            //Act
+            var result = controller.Index() as ViewResult;
+
+            //Assert
+            Assert.IsTrue(((IEnumerable<Tag>)result.Model).Count() == 5);
+        }
+
     }
 }


Use string interpolation beside string format.

--- src/Humanizer/Localisation/Formatters/DefaultFormatter.cs
+++ src/Humanizer/Localisation/Formatters/DefaultFormatter.cs
@@ -96,7 +96,7 @@
             var resourceString = Resources.GetResource(GetResourceKey(resourceKey), _culture);

             if (string.IsNullOrEmpty(resourceString))
-                throw new ArgumentException(string.Format("The resource object with key '{0}' was not found", resourceKey), nameof(resourceKey));
+                throw new ArgumentException($"The resource object with key '{resourceKey}' was not found", nameof(resourceKey));

             return resourceString;
         }
@@ -113,7 +113,7 @@
             var resourceString = Resources.GetResource(GetResourceKey(resourceKey, number), _culture);

             if (string.IsNullOrEmpty(resourceString))
-                throw new ArgumentException(string.Format("The resource object with key '{0}' was not found", resourceKey), nameof(resourceKey));
+                throw new ArgumentException($"The resource object with key '{resourceKey}' was not found", nameof(resourceKey));

             return resourceString.FormatWith(number);
         }


Tactical fix for https://github.com/Azure/azure-webjobs-sdk/issues/929

Proper fix comes once https://github.com/projectkudu/AzureFunctionsPortal/issues/634is fixed and then we can remove the whole function.

--- src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs
+++ src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs
@@ -254,6 +254,16 @@
                     var segment = await SafeExecuteQuerySegmentedAsync(rangeQuery, startTime, endTime, continuationToken);

                     list.AddRange(segment.Results);
+
+                    if (rangeQuery.TakeCount.HasValue)
+                    {
+                        // Don't need to return more entries than were requested.
+                        if (list.Count >= rangeQuery.TakeCount.Value)
+                        {
+                            segment.ContinuationToken = null;
+                        }
+                    }
+
                     if (segment.ContinuationToken == null)
                     {
                         // Done!


Remove GenerateTypeCatalog from RunspaceTests

This was Garrett's workaround that we no longer use.

--- src/Microsoft.PowerShell.Linux.UnitTests/test_Runspace.cs
+++ src/Microsoft.PowerShell.Linux.UnitTests/test_Runspace.cs
@@ -8,25 +8,14 @@
     // NOTE: do not call AddCommand("out-host") after invoking or MergeMyResults,
     // otherwise Invoke will not return any objects

-    public class RunspaceTests: IDisposable
+    public class RunspaceTests
     {
         private static int count = 3;
         private static string script = String.Format($"get-process | select-object -first {count}");

-        public RunspaceTests()
-        {
-            TypeCatalog.GenerateTypeCatalog();
-            Assert.NotNull(System.Management.Automation.ClrHost.TypeCatalog);
-        }
-
-        public void Dispose()
-        {
-        }
-
         [Fact]
         public void TestRunspaceWithPipeline()
         {
-            Assert.NotNull(System.Management.Automation.ClrHost.TypeCatalog);
             using (Runspace runspace = RunspaceFactory.CreateRunspace())
             {
                 runspace.Open();


Fix effort calculation

Fix effort calculation

--- src/MiningCore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs
+++ src/MiningCore/Blockchain/Bitcoin/BitcoinPayoutHandler.cs
@@ -175,13 +175,9 @@

 	    public Task CalculateBlockEffortAsync(Block block, ulong accumulatedBlockShareDiff)
 	    {
-			// adjust diff
-		    var coinProps = BitcoinProperties.GetCoinProperties(poolConfig.Coin.Type, poolConfig.Coin.Algorithm);
-		    var adjusted = accumulatedBlockShareDiff / coinProps.ShareMultiplier;
-
-			block.Effort = adjusted / block.NetworkDifficulty;
-
-		    return Task.FromResult(true);
+		    block.Effort = (double)accumulatedBlockShareDiff / block.NetworkDifficulty;
+
+			return Task.FromResult(true);
 	    }

 		public Task<decimal> UpdateBlockRewardBalancesAsync(IDbConnection con, IDbTransaction tx, Block block, PoolConfig pool)


Add post condition.

Add post condition.

--- src/MsgPack.Rpc/Rpc/ObjectPoolConfiguration.Properties.cs
+++ src/MsgPack.Rpc/Rpc/ObjectPoolConfiguration.Properties.cs
@@ -87,7 +87,8 @@
 				{
 					throw new ArgumentOutOfRangeException( "value", "Argument cannot be negative number." );
 				}
-				Contract.EndContractBlock();
+
+				Contract.Ensures( Contract.Result<int>() >= default( int ) );

 				this.VerifyIsNotFrozen();
 				var coerced = value;
@@ -128,7 +129,8 @@
 				{
 					throw new ArgumentOutOfRangeException( "value", "Argument cannot be negative number." );
 				}
-				Contract.EndContractBlock();
+
+				Contract.Ensures( Contract.Result<int?>() == null || Contract.Result<int?>().Value >= default( int ) );

 				this.VerifyIsNotFrozen();
 				var coerced = value;
@@ -169,7 +171,8 @@
 				{
 					throw new ArgumentOutOfRangeException( "value", String.Format( CultureInfo.CurrentCulture, "Argument must be valid enum value of '{0}' type.", typeof( ExhausionPolicy ) ) );
 				}
-				Contract.EndContractBlock();
+
+				Contract.Ensures( Enum.IsDefined( typeof( ExhausionPolicy ), Contract.Result<ExhausionPolicy>() ) );

 				this.VerifyIsNotFrozen();
 				var coerced = value;
@@ -210,7 +213,8 @@
 				{
 					throw new ArgumentOutOfRangeException( "value", "Argument must be positive number." );
 				}
-				Contract.EndContractBlock();
+
+				Contract.Ensures( Contract.Result<TimeSpan?>() == null || Contract.Result<TimeSpan?>().Value > default( TimeSpan ) );

 				this.VerifyIsNotFrozen();
 				var coerced = value;
@@ -251,7 +255,8 @@
 				{
 					throw new ArgumentOutOfRangeException( "value", "Argument must be positive number." );
 				}
-				Contract.EndContractBlock();
+
+				Contract.Ensures( Contract.Result<TimeSpan?>() == null || Contract.Result<TimeSpan?>().Value > default( TimeSpan ) );

 				this.VerifyIsNotFrozen();
 				var coerced = value;


PP9-5472, add client for environment process

--- src/Picturepark.SDK.V1.CloudManager/CloudManagerClient.cs
+++ src/Picturepark.SDK.V1.CloudManager/CloudManagerClient.cs
@@ -36,6 +36,8 @@

         public CloudBackupClient CloudBackup { get; private set; }

+        public EnvironmentProcessClient EnvironmentProcess { get; private set; }
+
         public void Dispose()
         {
             if (_httpClient != null)
@@ -52,6 +54,7 @@
             Updates = new UpdateClient(settings, httpClient);
             SampleData = new SampleDataClient(settings, httpClient);
             CloudBackup = new CloudBackupClient(settings, httpClient);
+            EnvironmentProcess = new EnvironmentProcessClient(settings, httpClient);
         }
     }
 }


improve speed

improve speed

--- src/SFGameOfLife/OrchestrationActor/OrchestrationActor.cs
+++ src/SFGameOfLife/OrchestrationActor/OrchestrationActor.cs
@@ -66,15 +66,15 @@
         {
             var status = new List<int>();

-            //for (int j = 0; j < _ysize; j++)
-            //{
-            //    for (int i = 0; i < _xsize; i++)
-            //    {
-            //        var cellActor = GetCellActor(i, j);
-            //        var state = await cellActor.GetState();
-            //        status.Add(state);
-            //    }
-            //}
+            for (int j = 0; j < _ysize; j++)
+            {
+                for (int i = 0; i < _xsize; i++)
+                {
+                    var cellActor = GetCellActor(i, j);
+                    var state = await cellActor.GetState();
+                    status.Add(state);
+                }
+            }

             for (int j = 0; j < _ysize; j++)
             {
@@ -91,15 +91,14 @@
                         }
                         else
                         {
-                            var cellActor = GetCellActor(coord.Key, coord.Value);
-                            state = await cellActor.GetState();
+                            state = status[coord.Value*_xsize + coord.Key];
                         }

                         neighbourStates.Add(state);
                     }
                     var myCellActor = GetCellActor(i, j);
                     var newStatus = await myCellActor.ComputeNewState(neighbourStates);
-                    status.Add(newStatus);
+                    status[j * _xsize + i] =  newStatus;
                 }
             }


Добавил реализацию метода ПолучитьДвоичныеДанныеИзHexСтроки

--- src/ScriptEngine.HostedScript/Library/GlobalBinaryData.cs
+++ src/ScriptEngine.HostedScript/Library/GlobalBinaryData.cs
@@ -146,7 +146,20 @@

         // ToDo: ПолучитьBase64БуферДвоичныхДанныхИзБуфераДвоичныхДанных

-        // ToDo: ПолучитьДвоичныеДанныеИзHexСтроки
+        /// <summary>
+        /// Преобразует строку формата Base 16 (Hex) в двоичные данные.
+        /// </summary>
+        /// <param name="str">Строка в формате Base 16 (Hex).</param>
+        /// <returns>Тип: ДвоичныеДанные.</returns>
+        [ContextMethod("ПолучитьДвоичныеДанныеИзHexСтроки")]
+        public BinaryDataContext GetBinaryDataFromHexString(string str)
+        {
+            int NumberChars = str.Length;
+            byte[] bytes = new byte[NumberChars / 2];
+            for (int i = 0; i < NumberChars; i += 2)
+                bytes[i / 2] = Convert.ToByte(str.Substring(i, 2), 16);
+            return new BinaryDataContext(bytes);
+        }

         // ToDo: ПолучитьБуферДвоичныхДанныхИзHexСтроки


[docTools] Add Generic Parameters to Methods C# Syntax

--- src/SharpDoc/Styles/Standard/html/SyntaxCodeCSharp.cshtml
+++ src/SharpDoc/Styles/Standard/html/SyntaxCodeCSharp.cshtml
@@ -79,14 +79,161 @@
             }
         }

+        DumpGenericParametersConstraints(text, type);
+
+        return text.ToString();
+    }
+
+    /// <summary>
+    /// Dump the C# syntax of a type property
+    /// </summary>
+    /// <param name="prop"></param>
+    /// <returns></returns>
+    protected string DumpProperty(NProperty prop)
+    {
+        var text = new StringBuilder();
+
+        // Append visibility
+        text.Append(prop.VisibilityFullName).Append(" ");
+
+		// Append Type
+        text.Append(prop.PropertyType.Name).Append(" ");
+
+		// Append Name
+		text.Append(prop.Name).Append(" { ");
+
+		if (prop.HasGetMethod)
+        {
+			if (prop.Visibility != prop.GetMethod.Visibility)
+                text.Append(prop.GetMethod.VisibilityName).Append(" ");
+            text.Append("get;");
+        }
+
+		if (prop.HasSetMethod)
+        {
+			if (prop.HasGetMethod)
+			    text.Append(" ");
+			if (prop.Visibility != prop.SetMethod.Visibility)
+                text.Append(prop.SetMethod.VisibilityName).Append(" ");
+            text.Append("set;");
+        }
+
+        text.Append(" }").AppendLine();
+
+        return text.ToString();
+    }
+
+
+    /// <summary>
+    /// Dump the C# syntax of an event
+    /// </summary>
+    /// <param name="nEvent"></param>
+    /// <returns></returns>
+    protected string DumpEvent(NEvent nEvent)
+    {
+        var text = new StringBuilder();
+
+        // Append visibility
+        text.Append(nEvent.VisibilityFullName).Append(" ");
+
+        // Append Type
+        text.Append(EscapeForSyntaxBox(nEvent.EventType.Name)).Append(" ");
+
+        // Append Name
+        text.Append(EscapeForSyntaxBox(nEvent.Name));
+
+        return text.ToString();
+    }
+
+    /// <summary>
+    /// Dump the C# syntax of a type property
+    /// </summary>
+    /// <param name="field"></param>
+    /// <returns></returns>
+    protected string DumpField(NField field)
+    {
+        var text = new StringBuilder();
+
+        // Append visibility
+        text.Append(field.VisibilityFullName).Append(" ");
+
+        // Append the return type
+	    text.Append(EscapeForSyntaxBox(field.FieldType.Name)).Append(" ");
+
+        // Append the name
+        text.Append(EscapeForSyntaxBox(field.Name));
+
         // TODO add generic constraints here

-        if(type.GenericParameters.Count > 0)
+        return text.ToString();
+    }
+
+    /// <summary>
+    /// Dump the C# syntax of a type method
+    /// </summary>
+    /// <param name="method"></param>
+    /// <returns></returns>
+    protected string DumpMethod(NMethod method)
+    {
+        var text = new StringBuilder();
+
+        // Append attributes
+        foreach (var attribute in method.Attributes)
+            text.Append("[").Append(attribute).Append("]").AppendLine();
+
+        // Append visibility
+        text.Append(method.VisibilityFullName).Append(" ");
+
+        // Append the return type
+		if (!(method is NConstructor))
+	        text.Append(EscapeForSyntaxBox(method.ReturnType.Name)).Append(" ");
+
+        // Append the name
+        text.Append(EscapeForSyntaxBox(method.Name));
+
+        DumpParameters(text, method.Parameters);
+
+        DumpGenericParametersConstraints(text, method);
+
+        return text.ToString();
+    }
+
+    /// <summary>
+    /// Dump the C# syntax of a type method
+    /// </summary>
+    /// <param name="method"></param>
+    /// <returns></returns>
+    protected void DumpParameters(StringBuilder text, List<NParameter> parameters)
+    {
+        text.Append("(");
+        if (parameters.Count > 0)
+        {
+            text.AppendLine();
+            for (int i = 0; i < parameters.Count; i++)
+            {
+                if (i > 0)
+                    text.Append(", ").AppendLine();
+                var parameter = parameters[i];
+                text.Append("\t");
+                text.Append(EscapeForSyntaxBox(parameter.ParameterTypeName)).Append(" ").Append(EscapeForSyntaxBox(parameter.Name));
+            }
+            text.AppendLine();
+        }
+        text.Append(")");
+    }
+
+    /// <summary>
+    /// Dump the C# syntax of generic parameters constraints
+    /// </summary>
+    /// <returns></returns>
+    protected void DumpGenericParametersConstraints(StringBuilder text, INMemberReference member)
+    {
+        if(member.GenericParameters.Count > 0)
         {
             List<NGenericParameter> constraintsParameters = new List<NGenericParameter>();
-            for(int i = 0; i < type.GenericParameters.Count; i++)
+            for(int i = 0; i < member.GenericParameters.Count; i++)
             {
-                var param = type.GenericParameters[i];
+                var param = member.GenericParameters[i];
                 if(param.HasConstraints || param.HasDefaultConstructorConstraint)
                     constraintsParameters.Add(param);
             }
@@ -114,147 +261,7 @@
                 }
             }
         }
-
-        return text.ToString();
-    }
-
-    /// <summary>
-    /// Dump the C# syntax of a type property
-    /// </summary>
-    /// <param name="prop"></param>
-    /// <returns></returns>
-    protected string DumpProperty(NProperty prop)
-    {
-        var text = new StringBuilder();
-
-        // Append visibility
-        text.Append(prop.VisibilityFullName).Append(" ");
-
-		// Append Type
-        text.Append(prop.PropertyType.Name).Append(" ");
-
-		// Append Name
-		text.Append(prop.Name).Append(" { ");
-
-		if (prop.HasGetMethod)
-        {
-			if (prop.Visibility != prop.GetMethod.Visibility)
-                text.Append(prop.GetMethod.VisibilityName).Append(" ");
-            text.Append("get;");
-        }
-
-		if (prop.HasSetMethod)
-        {
-			if (prop.HasGetMethod)
-			    text.Append(" ");
-			if (prop.Visibility != prop.SetMethod.Visibility)
-                text.Append(prop.SetMethod.VisibilityName).Append(" ");
-            text.Append("set;");
-        }
-
-        text.Append(" }").AppendLine();
-
-        return text.ToString();
-    }
-
-
-    /// <summary>
-    /// Dump the C# syntax of an event
-    /// </summary>
-    /// <param name="nEvent"></param>
-    /// <returns></returns>
-    protected string DumpEvent(NEvent nEvent)
-    {
-        var text = new StringBuilder();
-
-        // Append visibility
-        text.Append(nEvent.VisibilityFullName).Append(" ");
-
-        // Append Type
-        text.Append(EscapeForSyntaxBox(nEvent.EventType.Name)).Append(" ");
-
-        // Append Name
-        text.Append(EscapeForSyntaxBox(nEvent.Name));
-
-        return text.ToString();
-    }
-
-    /// <summary>
-    /// Dump the C# syntax of a type property
-    /// </summary>
-    /// <param name="field"></param>
-    /// <returns></returns>
-    protected string DumpField(NField field)
-    {
-        var text = new StringBuilder();
-
-        // Append visibility
-        text.Append(field.VisibilityFullName).Append(" ");
-
-        // Append the return type
-	    text.Append(EscapeForSyntaxBox(field.FieldType.Name)).Append(" ");
-
-        // Append the name
-        text.Append(EscapeForSyntaxBox(field.Name));
-
-        // TODO add generic constraints here
-
-        return text.ToString();
-    }
-
-    /// <summary>
-    /// Dump the C# syntax of a type method
-    /// </summary>
-    /// <param name="method"></param>
-    /// <returns></returns>
-    protected string DumpMethod(NMethod method)
-    {
-        var text = new StringBuilder();
-
-        // Append attributes
-        foreach (var attribute in method.Attributes)
-            text.Append("[").Append(attribute).Append("]").AppendLine();
-
-        // Append visibility
-        text.Append(method.VisibilityFullName).Append(" ");
-
-        // Append the return type
-		if (!(method is NConstructor))
-	        text.Append(EscapeForSyntaxBox(method.ReturnType.Name)).Append(" ");
-
-        // Append the name
-        text.Append(EscapeForSyntaxBox(method.Name));
-
-        DumpParameters(text, method.Parameters);
-
-        // TODO add generic constraints here
-
-        return text.ToString();
-    }
-
-    /// <summary>
-    /// Dump the C# syntax of a type method
-    /// </summary>
-    /// <param name="method"></param>
-    /// <returns></returns>
-    protected void DumpParameters(StringBuilder text, List<NParameter> parameters)
-    {
-        text.Append("(");
-        if (parameters.Count > 0)
-        {
-            text.AppendLine();
-            for (int i = 0; i < parameters.Count; i++)
-            {
-                if (i > 0)
-                    text.Append(", ").AppendLine();
-                var parameter = parameters[i];
-                text.Append("\t");
-                text.Append(EscapeForSyntaxBox(parameter.ParameterTypeName)).Append(" ").Append(EscapeForSyntaxBox(parameter.Name));
-            }
-            text.AppendLine();
-        }
-        text.Append(")");
-    }
+    }
 }

 @helper Dump(NMember member)


InactiveServerStartupComplete

InactiveServerStartupComplete

--- src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs
+++ src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs
@@ -205,64 +205,66 @@
 			switch (activationReason)
 			{
 				case MonitorActivationReason.ActiveServerCrashed:
-					if (monitorState.RebootingInactiveServer || monitorState.InactiveServerCritFail)
-					{
-						logger.LogInformation("Inactive server is {0}! Restarting monitor...", monitorState.InactiveServerCritFail ? "critically failed" : "still rebooting");
-						monitorState.NextAction = MonitorAction.Restart;
-						break;
-					}
-
-					var dasDmbTask = dmbFactory.LockNextDmb(cancellationToken);
-					var result = await monitorState.InactiveServer.SetPort(ActiveLaunchParameters.PrimaryPort.Value, cancellationToken).ConfigureAwait(false);
-
-					if (!result)
-					{
-						logger.LogWarning("Failed to activate inactive server! Restarting monitor...");
-						monitorState.NextAction = MonitorAction.Restart;
-						break;
-					}
-
-					monitorState.InactiveServerHasStagedDmb = false;
-					LastLaunchParameters = ActiveLaunchParameters;
-
-					var deadServer = monitorState.ActiveServer;
-					monitorState.ActiveServer = monitorState.InactiveServer;
-					monitorState.NextAction = MonitorAction.Continue;
-
-					try
-					{
-						monitorState.InactiveServer = await sessionControllerFactory.LaunchNew(ActiveLaunchParameters, await dasDmbTask.ConfigureAwait(false), null, false, !monitorState.ActiveServer.IsPrimary, false, cancellationToken).ConfigureAwait(false);
-					}
-					catch (OperationCanceledException)
-					{
-						throw;
-					}
-					catch (Exception e)
-					{
-						logger.LogError("Exception occurred while recreating crashed server! Attempting backup strategy of running DMB of running server! Exception: {0}", e.ToString());
-						//ahh jeez, what do we do here?
-						//this is our fault, so it should never happen
-						//try to start it using the active server's dmb as a backup
+					using (monitorState.ActiveServer)   //it's dead, dispose it when we're done
+					{
+						if (monitorState.RebootingInactiveServer || monitorState.InactiveServerCritFail)
+						{
+							logger.LogInformation("Inactive server is {0}! Restarting monitor...", monitorState.InactiveServerCritFail ? "critically failed" : "still rebooting");
+							monitorState.NextAction = MonitorAction.Restart;
+							break;
+						}
+
+						var dasDmbTask = dmbFactory.LockNextDmb(cancellationToken);
+						var result = await monitorState.InactiveServer.SetPort(ActiveLaunchParameters.PrimaryPort.Value, cancellationToken).ConfigureAwait(false);
+
+						if (!result)
+						{
+							logger.LogWarning("Failed to activate inactive server! Restarting monitor...");
+							monitorState.NextAction = MonitorAction.Restart;
+							break;
+						}
+
+						monitorState.InactiveServerHasStagedDmb = false;
+						LastLaunchParameters = ActiveLaunchParameters;
+
+						monitorState.ActiveServer = monitorState.InactiveServer;
+						monitorState.NextAction = MonitorAction.Continue;
+
 						try
 						{
-							var dmbBackup = dmbFactory.FromCompileJob(monitorState.ActiveServer.Dmb.CompileJob);
-							monitorState.InactiveServer = await sessionControllerFactory.LaunchNew(ActiveLaunchParameters, dmbBackup, null, false, !monitorState.ActiveServer.IsPrimary, false, cancellationToken).ConfigureAwait(false);
+							monitorState.InactiveServer = await sessionControllerFactory.LaunchNew(ActiveLaunchParameters, await dasDmbTask.ConfigureAwait(false), null, false, !monitorState.ActiveServer.IsPrimary, false, cancellationToken).ConfigureAwait(false);
 						}
 						catch (OperationCanceledException)
 						{
 							throw;
 						}
-						catch (Exception e2)
-						{
-							//fuuuuucckkk
-							logger.LogError("Backup strategy failed! Monitor will restart when active server reboots! This Exception: {0}", e2.ToString());
-							monitorState.InactiveServerCritFail = true;
-							break;
-						}
-					}
-
-					logger.LogInformation("Successfully relaunched inactive server!");
-					monitorState.RebootingInactiveServer = true;
+						catch (Exception e)
+						{
+							logger.LogError("Exception occurred while recreating crashed server! Attempting backup strategy of running DMB of running server! Exception: {0}", e.ToString());
+							//ahh jeez, what do we do here?
+							//this is our fault, so it should never happen
+							//try to start it using the active server's dmb as a backup
+							try
+							{
+								var dmbBackup = dmbFactory.FromCompileJob(monitorState.ActiveServer.Dmb.CompileJob);
+								monitorState.InactiveServer = await sessionControllerFactory.LaunchNew(ActiveLaunchParameters, dmbBackup, null, false, !monitorState.ActiveServer.IsPrimary, false, cancellationToken).ConfigureAwait(false);
+							}
+							catch (OperationCanceledException)
+							{
+								throw;
+							}
+							catch (Exception e2)
+							{
+								//fuuuuucckkk
+								logger.LogError("Backup strategy failed! Monitor will restart when active server reboots! This Exception: {0}", e2.ToString());
+								monitorState.InactiveServerCritFail = true;
+								break;
+							}
+						}
+
+						logger.LogInformation("Successfully relaunched inactive server!");
+						monitorState.RebootingInactiveServer = true;
+					}
 					break;
 				case MonitorActivationReason.InactiveServerCrashed:
 					throw new NotImplementedException();
@@ -271,7 +273,10 @@
 				case MonitorActivationReason.InactiveServerRebooted:
 					throw new NotImplementedException();
 				case MonitorActivationReason.InactiveServerStartupComplete:
-					throw new NotImplementedException();
+					//eziest case of my life
+					monitorState.RebootingInactiveServer = false;
+					monitorState.NextAction = MonitorAction.Continue;
+					break;
 				case MonitorActivationReason.NewDmbAvailable:
 					throw new NotImplementedException();
 			}


Update doc

Update doc

--- src/Workspaces/Core/Portable/Remote/PinnedSolutionInfo.cs
+++ src/Workspaces/Core/Portable/Remote/PinnedSolutionInfo.cs
@@ -13,9 +13,8 @@
     internal sealed class PinnedSolutionInfo
     {
         /// <summary>
-        /// Unique ID for this pinned solution
-        ///
-        /// This later used to find matching solution between VS and remote host
+        /// Checksum for the pinned solution. Ensures that OOP synchronization requests can unique identify which
+        /// in-flight solution-snapshots they correspond to.
         /// </summary>
         [DataMember(Order = 0)]
         public readonly Checksum SolutionChecksum;


server: allow matches against absolut path only

--- logv.http/Server.cs
+++ logv.http/Server.cs
@@ -258,6 +258,9 @@
             if (_handlerByUrlAndVerb.ContainsKey(uri))
                 return _handlerByUrlAndVerb[uri];

+            if (_handlerByUrlAndVerb.ContainsKey(request.Url.AbsolutePath))
+                return _handlerByUrlAndVerb[uri];
+
             //ok no 100% match, lets find the best handler
             var keys = _handlerByUrlAndVerb.Keys;

@@ -273,7 +276,7 @@
                 if (key.Length > uri.Length)
                     continue;

-                if (uri.Substring(0, key.Length).Equals(key))
+                if (uri.Substring(0, key.Length).Equals(key) || request.Url.AbsolutePath.Substring(0, key.Length).Equals(key))
                 {
                     if (key.Length > lastBestMatch)
                     {


Fix a crash in vulkan pipeline state export to html

--- renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs
+++ renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs
@@ -2863,10 +2863,9 @@
                             object[] sampDetails = MakeSampler("", "", descriptorBind);
                             rows.Add(new object[] {
                                 setname, slotname, name, bind.type,
-                                "", "", "",
+                                "", "", "", "",
                                 sampDetails[5],
-                                sampDetails[6],
-                                sampDetails[7]
+                                sampDetails[6]
                             });
                         }
                     }


fix delegate by-pass

fix delegate by-pass

--- CNeptune/CNeptune/Program.cs
+++ CNeptune/CNeptune/Program.cs
@@ -78,7 +78,7 @@

         static private bool Bypass(TypeDefinition type)
         {
-            return type.IsInterface || type.IsValueType || type.Name == Program.Module || type.Name == Program.Neptune || type.BaseType == type.Module.Import(typeof(MulticastDelegate));
+            return type.IsInterface || type.IsValueType || type.Name == Program.Module || type.Name == Program.Neptune || (type.BaseType != null && type.BaseType.Resolve() == type.Module.Import(typeof(MulticastDelegate)).Resolve());
         }

         static private TypeDefinition Instrumentation(TypeDefinition type)


Added span to command line options

Added span to command line options

--- WallpaperChanger/Program.cs
+++ WallpaperChanger/Program.cs
@@ -63,7 +63,8 @@
             Centered,
             Stretched,
             Fit,
-            Fill
+            Fill,
+            Span
         }

         public static int SetWithRegistry(String file, Style style, String storagePath)
@@ -161,34 +162,21 @@

                 // set the wallpaper using the external method
                 IActiveDesktop iad = shlobj.GetActiveDesktop();
-                WALLPAPEROPT oldWopt = new WALLPAPEROPT();
-                iad.GetWallpaperOptions(ref oldWopt, 0);
-                Console.WriteLine("Old Style:"+oldWopt.dwStyle.ToString());
-                Console.WriteLine(oldWopt.ToString());
+                //WALLPAPEROPT oldWopt = new WALLPAPEROPT();
+                //iad.GetWallpaperOptions(ref oldWopt, 0);
+                //Console.WriteLine("Old Style:"+oldWopt.dwStyle.ToString());
+                //Console.WriteLine(oldWopt.ToString());

                 iad.SetWallpaper(storagePath, 0);
                 WALLPAPEROPT wopt = new WALLPAPEROPT();
                 Console.WriteLine("Style " + style.ToString());
-                if (style == Style.Tiled)
-                {
-                    wopt.dwStyle = WallPaperStyle.WPSTYLE_TILE;
-                }
-                if (style == Style.Centered)
-                {
-                    wopt.dwStyle = WallPaperStyle.WPSTYLE_CENTER;
-                }
-                if (style == Style.Stretched)
-                {
-                    wopt.dwStyle = WallPaperStyle.WPSTYLE_STRETCH;
-                }
-                if (style == Style.Fit)
-                {
-                    wopt.dwStyle = WallPaperStyle.WPSTYLE_KEEPASPECT;
-                }
-                if (style == Style.Fill)
-                {
-                    wopt.dwStyle = WallPaperStyle.WPSTYLE_CROPTOFIT;
-                }
+                if (style == Style.Tiled) wopt.dwStyle = WallPaperStyle.WPSTYLE_TILE;
+                else if (style == Style.Centered) wopt.dwStyle = WallPaperStyle.WPSTYLE_CENTER;
+                else if (style == Style.Stretched) wopt.dwStyle = WallPaperStyle.WPSTYLE_STRETCH;
+                else if (style == Style.Fit) wopt.dwStyle = WallPaperStyle.WPSTYLE_KEEPASPECT;
+                else if (style == Style.Fill) wopt.dwStyle = WallPaperStyle.WPSTYLE_CROPTOFIT;
+                else if (style == Style.Span) wopt.dwStyle = WallPaperStyle.WPSTYLE_SPAN;
+
                 iad.SetWallpaperOptions(wopt,0);
                 iad.ApplyChanges(AD_Apply.ALL | AD_Apply.FORCE | AD_Apply.BUFFERED_REFRESH);
                 WALLPAPEROPT newWopt = new WALLPAPEROPT();


--- CSharp/Collection/ForEach.cs
+++ CSharp/Collection/ForEach.cs
@@ -10,6 +10,10 @@
         foreach (int item in lista) {
             WriteLine(item);
         }
+        var texto = "123456";
+        foreach (char item in texto) {
+            WriteLine(item);
+        }
     }
 }


testing automated deployment

testing automated deployment

--- Web/Views/Home/Index.cshtml
+++ Web/Views/Home/Index.cshtml
@@ -9,7 +9,7 @@

-
Goal Tracking allows a user to track the progress and usage of different targets or achievements.

+
xxGoal Tracking allows a user to track the progress and usage of different targets or achievements.

The system allows a user to create categories and goals and track their progress.  Goal tracking happens over progressive iterations. An iteration can be of various
         lengths, a day, week, month or a year.  The user would create a goal and record the data as they work towards that goal.

An example Goal could be to track the number of miles ridden on the user's push bike each month.  The users aim could be to increase the amount by 10% per month (iteration).


Wildcard bits - linq

Wildcard bits - linq

--- CareerCup/Google/wildcard.cs
+++ CareerCup/Google/wildcard.cs
@@ -26,16 +26,14 @@
             return result;
         }

-        var newResult = new List<String>();
-        foreach (var localResult in result)
-        {
-            foreach (var forwardResult in s.Substring(1).Regenerate())
-            {
-                newResult.Add(localResult + forwardResult);
-            }
-        }
-
-        return newResult;
+        return result.
+                SelectMany(x => s.Substring(1).
+                                  Regenerate().
+                                  Select(y => String.Format(
+                                                        "{0}{1}",
+                                                        x,
+                                                        y))).
+                ToList();
     }

     static void Main()


localization hotfix

localization hotfix

--- Wpf.TestBuilder/App.xaml.cs
+++ Wpf.TestBuilder/App.xaml.cs
@@ -7,12 +7,5 @@
     /// </summary>
     public partial class App : Application
     {
-        protected override void OnStartup(StartupEventArgs e)
-        {
-            base.OnStartup(e);
-
-            System.Threading.Thread.CurrentThread.CurrentUICulture =
-            new System.Globalization.CultureInfo("ru-RU");
-        }
     }
 }


Set values to 0 when the pad is not connected

--- XInputDotNetPure/GamePad.cs
+++ XInputDotNetPure/GamePad.cs
@@ -243,6 +243,19 @@
         internal GamePadState(bool isConnected, RawState rawState, GamePadDeadZone deadZone)
         {
             this.isConnected = isConnected;
+
+            if (!isConnected)
+            {
+                rawState.dwPacketNumber = 0;
+                rawState.Gamepad.dwButtons = 0;
+                rawState.Gamepad.bLeftTrigger = 0;
+                rawState.Gamepad.bRightTrigger = 0;
+                rawState.Gamepad.sThumbLX = 0;
+                rawState.Gamepad.sThumbLY = 0;
+                rawState.Gamepad.sThumbRX = 0;
+                rawState.Gamepad.sThumbRY = 0;
+            }
+
             packetNumber = rawState.dwPacketNumber;
             buttons = new GamePadButtons(
                 (rawState.Gamepad.dwButtons & (uint)ButtonsConstants.Start) != 0 ? ButtonState.Pressed : ButtonState.Released,


WPF - Fix Custom Cursor Not displaying

WPF - Fix Custom Cursor Not displaying

- Update CursorType enum
  CEF has added some additional values
  As entries were added before Custom the WPF custom cursor handling wasn't working
  https://github.com/chromiumembedded/cef/commit/047e8f9349ecd635b1146e4a44de46a38b8a64f8#diff-447d40892c51b4ffc870cf1a28bab2ae2d411752216be4750a17193e6675b26b

--- CefSharp/Enums/CursorType.cs
+++ CefSharp/Enums/CursorType.cs
@@ -182,8 +182,32 @@
         /// </summary>
         Grabbing,
         /// <summary>
+        /// An enum constant representing the MiddlePanningVertical option.
+        /// </summary>
+        MiddlePanningVertical,
+        /// <summary>
+        /// An enum constant representing the MiddlePanningHorizontal option.
+        /// </summary>
+        MiddlePanningHorizontal,
+        /// <summary>
         /// An enum constant representing the custom option.
         /// </summary>
         Custom,
+        /// <summary>
+        /// DndNone
+        /// </summary>
+        DndNone,
+        /// <summary>
+        /// DndMove
+        /// </summary>
+        DndMove,
+        /// <summary>
+        /// DndCopy
+        /// </summary>
+        DndCopy,
+        /// <summary>
+        /// DndLink
+        /// </summary>
+        DndLink
     }
 }


SecurityIdentifier - grab config value once via static context

--- Common/SecurityIdentifier.cs
+++ Common/SecurityIdentifier.cs
@@ -37,6 +37,8 @@
     {
         #region Empty, DefaultDate Fields

+        private static readonly string MapFileProviderTypeName = Config.Get("map-file-provider", "LocalDiskMapFileProvider");
+
         /// <summary>
         /// Gets an instance of <see cref="SecurityIdentifier"/> that is empty, that is, one with no symbol specified
         /// </summary>
@@ -257,8 +259,7 @@
         /// <returns>A new <see cref="SecurityIdentifier"/> representing the specified symbol today</returns>
         public static SecurityIdentifier GenerateEquity(string symbol, string market)
         {
-            var mapFileProviderTypeName = Config.Get("map-file-provider", "LocalDiskMapFileProvider");
-            var provider = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(mapFileProviderTypeName);
+            var provider = Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(MapFileProviderTypeName);
             var resolver = provider.Get(market);
             var mapFile = resolver.ResolveMapFile(symbol, DateTime.Today);
             var firstDate = mapFile.FirstDate;


Wrapping .NET test web server process termination with try-catch

--- dotnet/test/common/Environment/TestWebServer.cs
+++ dotnet/test/common/Environment/TestWebServer.cs
@@ -82,14 +82,22 @@

             if (webserverProcess != null)
             {
-                webserverProcess.WaitForExit(10000);
-                if (!webserverProcess.HasExited)
+                try
                 {
-                    webserverProcess.Kill();
+                    webserverProcess.WaitForExit(10000);
+                    if (!webserverProcess.HasExited)
+                    {
+                        webserverProcess.Kill();
+                    }
                 }
-
-                webserverProcess.Dispose();
-                webserverProcess = null;
+                catch (Exception)
+                {
+                }
+                finally
+                {
+                    webserverProcess.Dispose();
+                    webserverProcess = null;
+                }
             }
         }
     }


Ignore client-side marker component on the server.

--- Content.Server/EntryPoint.cs
+++ Content.Server/EntryPoint.cs
@@ -41,7 +41,8 @@
                 "InteractionOutline",
                 "MeleeWeaponArcAnimation",
                 "AnimationsTest",
-                "ItemStatus"
+                "ItemStatus",
+                "Marker",
             };

             foreach (var ignoreName in registerIgnore)


Add support for "opacity" attribute

Add support for "opacity" attribute

--- NGraphics/SvgReader.cs
+++ NGraphics/SvgReader.cs
@@ -471,6 +471,22 @@
 					var sb = brush as SolidBrush;
 					if (sb != null)
 						sb.Color = sb.Color.WithAlpha (ReadNumber (fillOpacity));
+				}
+			}
+
+			if (key.Equals("opacity", StringComparison.OrdinalIgnoreCase))
+			{
+				var opacity = value;
+				if (!string.IsNullOrWhiteSpace (opacity)) {
+					if (brush == null)
+						brush = new SolidBrush ();
+					var sb = brush as SolidBrush;
+					if (sb != null)
+						sb.Color = sb.Color.WithAlpha (ReadNumber (opacity));
+
+					if (pen == null)
+						pen = new Pen();
+					pen.Color = pen.Color.WithAlpha(ReadNumber(opacity));
 				}
 			}


Add unit test from less.js bug 663

Add unit test from less.js bug 663

--- src/dotless.Test/Specs/SelectorsFixture.cs
+++ src/dotless.Test/Specs/SelectorsFixture.cs
@@ -238,5 +238,34 @@
             AssertLess(input, expected);
         }

+        [Test]
+        public void PseudoSelectors()
+        {
+            // from less.js bug 663
+
+            var input = @"
+.other ::fnord { color: red }
+.other::fnord { color: red }
+.other {
+  ::bnord {color: red }
+  &::bnord {color: red }
+}";
+
+            var expected = @"
+.other ::fnord {
+  color: red;
+}
+.other::fnord {
+  color: red;
+}
+.other ::bnord {
+  color: red;
+}
+.other::bnord {
+  color: red;
+}";
+
+            AssertLess(input, expected);
+        }
     }
 }


Add visual test for HTML string unescaping.

--- osu.Game.Tests/Visual/Online/TestSceneChangelogOverlay.cs
+++ osu.Game.Tests/Visual/Online/TestSceneChangelogOverlay.cs
@@ -68,6 +68,34 @@
                 changelog.ShowListing();
                 changelog.Show();
             });
+
+            AddStep(@"Ensure HTML string unescaping", () =>
+            {
+                changelog.ShowBuild(new APIChangelogBuild
+                {
+                    Version = "2019.920.0",
+                    DisplayVersion = "2019.920.0",
+                    UpdateStream = new APIUpdateStream
+                    {
+                        Name = "Test",
+                        DisplayName = "Test"
+                    },
+                    ChangelogEntries = new List<APIChangelogEntry>
+                    {
+                        new APIChangelogEntry
+                        {
+                            Category = "Testing HTML strings unescaping",
+                            Title = "Ensuring HTML strings are being unescaped",
+                            MessageHtml = """"This text should appear triple-quoted"""    >_<",
+                            GithubUser = new APIChangelogUser
+                            {
+                                DisplayName = "Dummy",
+                                OsuUsername = "Dummy",
+                            }
+                        },
+                    }
+                });
+            });
         }
     }
 }


Update

Update

--- main/dbms_gui_02/dbms_gui_02/dbms_gui_02/MainForm.Designer.cs
+++ main/dbms_gui_02/dbms_gui_02/dbms_gui_02/MainForm.Designer.cs
@@ -107,9 +107,9 @@
             // toolStrip1
             //
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripButton1,
             this.toolStripButton_Run,
-            this.toolStripButton_Clean,
-            this.toolStripButton1});
+            this.toolStripButton_Clean});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(856, 25);
@@ -124,6 +124,7 @@
             this.toolStripButton_Run.Name = "toolStripButton_Run";
             this.toolStripButton_Run.Size = new System.Drawing.Size(23, 22);
             this.toolStripButton_Run.Text = "Run";
+            this.toolStripButton_Run.ToolTipText = "Execute the queries in the main window.";
             this.toolStripButton_Run.Click += new System.EventHandler(this.toolStripButton1_Click);
             //
             // toolStripButton_Clean
@@ -134,6 +135,7 @@
             this.toolStripButton_Clean.Name = "toolStripButton_Clean";
             this.toolStripButton_Clean.Size = new System.Drawing.Size(23, 22);
             this.toolStripButton_Clean.Text = "Clean";
+            this.toolStripButton_Clean.ToolTipText = "Clean the main window commands.";
             this.toolStripButton_Clean.Click += new System.EventHandler(this.toolStripButton_Clean_Click);
             //
             // toolStripButton1
@@ -144,6 +146,7 @@
             this.toolStripButton1.Name = "toolStripButton1";
             this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
             this.toolStripButton1.Text = "toolStripButton1";
+            this.toolStripButton1.ToolTipText = "Load a sample set of queries.";
             this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
             //
             // MainForm


fixed peek last, first when list is empty

--- data-structures-csharp/data-structures-csharp/Queue/Deque.cs
+++ data-structures-csharp/data-structures-csharp/Queue/Deque.cs
@@ -19,11 +19,25 @@
         public int Capacity { get { return internalList.Capacity; } }
         public T PeekFirst
         {
-            get { return internalList[0]; }
+            get
+            {
+                if (!internalList.Any())
+                {
+                    return default(T);
+                }
+                return internalList[0];
+            }
         }
         public T PeekLast
         {
-            get { return internalList[internalList.Count - 1]; }
+            get
+            {
+                if(!internalList.Any())
+                {
+                    return default(T);
+                }
+                return internalList[internalList.Count - 1];
+            }
         }

         /// <summary>


Fix mistyped exposed source method

Fix mistyped exposed source method

--- osu.Framework.Tests/Visual/Testing/TestSceneTestWithSource.cs
+++ osu.Framework.Tests/Visual/Testing/TestSceneTestWithSource.cs
@@ -42,7 +42,7 @@

         public static object[][] ExposedSourceProperty => SourceProperty;

-        public static object[][] ExposedSourceMethod => SourceMethod();
+        public static object[][] ExposedSourceMethod() => SourceMethod();

         [TestCaseSource(nameof(SourceField))]
         public void TestSourceField(int a, int b)


Fix notifiation stack trace output on mania conversion failure

--- osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs
+++ osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs
@@ -55,15 +55,18 @@
         {
             int iterations = 0;

-            while (condition() && iterations++ < max_rng_iterations)
+            while (condition())
+            {
+                if (iterations++ >= max_rng_iterations)
+                {
+                    // log an error but don't throw. we want to continue execution.
+                    Logger.Error(new ExceededAllowedIterationsException(new StackTrace(0)),
+                        "Conversion encountered errors. The beatmap may not be correctly converted.");
+                    return;
+                }
+
                 action();
-
-            if (iterations < max_rng_iterations)
-                return;
-
-            // Generate + log an error/stacktrace
-
-            Logger.Log($"Allowable iterations ({max_rng_iterations}) exceeded:\n{new StackTrace(0)}", level: LogLevel.Error);
+            }
         }

         /// <summary>
@@ -71,5 +74,20 @@
         /// </summary>
         /// <returns>The <see cref="Pattern"/>s containing the hit objects.</returns>
         public abstract IEnumerable<Pattern> Generate();
+
+        /// <summary>
+        /// Denotes when a single conversion operation is in an infinitely looping state.
+        /// </summary>
+        public class ExceededAllowedIterationsException : Exception
+        {
+            private readonly string stackTrace;
+
+            public ExceededAllowedIterationsException(StackTrace stackTrace)
+            {
+                this.stackTrace = stackTrace.ToString();
+            }
+
+            public override string StackTrace => stackTrace;
+        }
     }
 }


Fix test failure due to async-loading of content

--- osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs
+++ osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs
@@ -191,7 +191,7 @@
         {
             AddUntilStep($"displayed bpm is {target}", () =>
             {
-                var label = this.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Single(l => l.Statistic.Name == "BPM");
+                var label = infoWedge.DisplayedContent.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Single(l => l.Statistic.Name == "BPM");
                 return label.Statistic.Content == target;
             });
         }


Adjust zoom defaults for timeline to be more useful

--- osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
+++ osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
@@ -30,7 +30,10 @@
         {
             ZoomDuration = 200;
             ZoomEasing = Easing.OutQuint;
-            Zoom = 10;
+
+            Zoom = 60;
+            MaxZoom = 240;
+
             ScrollbarVisible = false;
         }


Fix `DrawableStoryboardAnimation` not specifying sizing correctly

Usually this would be handled by `TextureAnimation`, but because we are
inheriting from `DrawableAnimation` here for reasons, we needed to
implement this ourselves. Follows the implementation in
`TextureAnimation`.

--- osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs
+++ osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs
@@ -5,8 +5,10 @@
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Animations;
+using osu.Framework.Graphics.Sprites;
 using osu.Framework.Graphics.Textures;
 using osu.Framework.Utils;
+using osu.Game.Skinning;
 using osuTK;

 namespace osu.Game.Storyboards.Drawables
@@ -88,6 +90,14 @@
             LifetimeEnd = animation.EndTime;
         }

+        protected override Vector2 GetCurrentDisplaySize()
+        {
+            Texture texture = (CurrentFrame as Sprite)?.Texture
+                              ?? ((CurrentFrame as SkinnableSprite)?.Drawable as Sprite)?.Texture;
+
+            return new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
+        }
+
         [BackgroundDependencyLoader]
         private void load(TextureStore textureStore, Storyboard storyboard)
         {


Tweak assault rifle projectile trail.

Tweak assault rifle projectile trail.

--- ethernet/server/scripts/weapons/assaultrifle/assaultrifle.cs
+++ ethernet/server/scripts/weapons/assaultrifle/assaultrifle.cs
@@ -61,10 +61,10 @@
 //	hitDeflectorExplosion = DiscDeflectedEffect;

 //   particleEmitter	= AssaultRifleProjectileParticleEmitter;
-	laserTrail[0]   = RedAssaultRifleProjectileLaserTrail;
+//	laserTrail[0]   = RedAssaultRifleProjectileLaserTrail;
 //	laserTrail[1]   = AssaultRifleProjectileRedLaserTrail;
 	laserTail	    = RedAssaultRifleProjectileLaserTail;
-	laserTailLen    = 10;
+	laserTailLen    = 20;

 	muzzleVelocity		= 600;
 	velInheritFactor	 = 1.0;
@@ -101,7 +101,7 @@
 {
 	projectileShapeName = "~/data/weapons/blaster/projectile.blue.dts";
 	explosion = BlueAssaultRifleProjectileExplosion;
-	laserTrail[0]   = BlueAssaultRifleProjectileLaserTrail;
+	//laserTrail[0]   = BlueAssaultRifleProjectileLaserTrail;
 	laserTail = BlueAssaultRifleProjectileLaserTail;
 	lightColor  = "0.0 0.0 1.0";
 };


Pages without regions were throwing a nullreference when the Regions property was invoked

--- source/DD4T.ContentModel/ContentModel.cs
+++ source/DD4T.ContentModel/ContentModel.cs
@@ -105,13 +105,14 @@
         [XmlIgnore]
         IList<IRegion> IPage.Regions
         {
-            get { return Regions.ToList<IRegion>(); }
-        }
-    }
-
+            get { return Regions?.ToList<IRegion>(); }
+        }
+    }
+
+    [Serializable]
     public class Region : IRegion
     {
-
+
         public string Name { get; set; }

         public Schema Schema { get; set; }


Don't use Turkish casing for en-US-POSIX.

Previously, we were using a comparision between "i" and "I" (while
ignoring case) to figure out if we needed to do Turkish casing (on the
assumption that locales which compared i and I as non equal when
ignoring case were doing Turkish casing).

ICU Does tailoring of the en-US-POSIX locale and assigns different
primary wights to 'i' and 'I'. You can see this in the ICU Collation
Demo by looking at the raw collation elements. Different primary weights
mean they different letters, not the same letter with a difference in
casing (which is a trinary weight).

This changes the check to compare using an actual Turkish i when doing
our detection to not get confused by these cases.

Fixes #2531

--- src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs
+++ src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs
@@ -88,7 +88,8 @@
         private bool NeedsTurkishCasing(string localeName)
         {
             Contract.Assert(localeName != null);
-            return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("i", "I", CompareOptions.IgnoreCase) != 0;
+
+            return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("\u0131", "I", CompareOptions.IgnoreCase) == 0;
         }

         private bool IsInvariant { get { return m_cultureName.Length == 0; } }


Fix NPM warnings as errors (#550)

Fix NPM warnings as errors (#550)

--- source/Nuke.Common/Tools/Npm/NpmTasks.cs
+++ source/Nuke.Common/Tools/Npm/NpmTasks.cs
@@ -1,4 +1,4 @@
-// Copyright 2020 Maintainers of NUKE.
+// Copyright 2020 Maintainers of NUKE.
 // Distributed under the MIT License.
 // https://github.com/nuke-build/nuke/blob/master/LICENSE

@@ -17,7 +17,7 @@
                     break;
                 case OutputType.Err:
                 {
-                    if (output.StartsWith("npmWARN"))
+                    if (output.StartsWith("npmWARN") || output.StartsWith("npm WARN"))
                         Logger.Warn(output);
                     else
                         Logger.Error(output);


Remove suerfluous usings

Remove suerfluous usings

--- src/ApiPorter.Patterns/Matcher.Create.cs
+++ src/ApiPorter.Patterns/Matcher.Create.cs
@@ -1,8 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Immutable;
-using System.Linq;
-using System.Text;

 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;


#12 StaleSafely.Execute(Action<TimeSpan> action, TimeSpan timeout) falls into infinite loop

--- src/Atata.WebDriverExtras/StaleSafely.cs
+++ src/Atata.WebDriverExtras/StaleSafely.cs
@@ -61,6 +61,7 @@
                 try
                 {
                     action(workingTimeout);
+                    return;
                 }
                 catch (StaleElementReferenceException exception)
                 {


Fix error

Fix error

--- src/Avalonia.Controls.ViewBox/ViewBox.cs
+++ src/Avalonia.Controls.ViewBox/ViewBox.cs
@@ -87,6 +87,6 @@
         Matrix ScaleAt(double scaleX, double scaleY, double centerX, double centerY)
         {
             return new Matrix(scaleX, 0, 0, scaleY, centerX - (scaleX * centerX), centerY - (scaleY * centerY));
-        };
+        }
     }
 }


get returns null in case of not-found References

--- src/DatenMeister/Runtime/ObjectHelper.cs
+++ src/DatenMeister/Runtime/ObjectHelper.cs
@@ -111,12 +111,14 @@

             if (typeof(T) == typeof(IObject))
             {
-                return ((T) (value.GetAsSingle(property, noReferences) as IObject)!)!;
+                var asSingle = (value.GetAsSingle(property, noReferences) as IObject)!;
+                return ((T) asSingle)!;
             }

             if (typeof(T) == typeof(IElement))
             {
-                return ((T) (value.GetAsSingle(property, noReferences) as IElement)!)!;
+                var asSingle = (value.GetAsSingle(property, noReferences) as IElement)!;
+                return asSingle is MofObjectShadow ? default : (T) asSingle;
             }

             if (typeof(T) == typeof(IReflectiveCollection))


Moves the env var string keys in a single place

--- src/Elders.Pandora/ApplicationContext.cs
+++ src/Elders.Pandora/ApplicationContext.cs
@@ -2,6 +2,12 @@

 namespace Elders.Pandora
 {
+    public static class EnvVar
+    {
+        public const string ClusterKey = "CLUSTER_NAME";
+        public const string MachineKey = "COMPUTERNAME";
+    }
+
     public interface IPandoraContext
     {
         string ApplicationName { get; }
@@ -13,11 +19,13 @@

     public class ApplicationContext : IPandoraContext
     {
+
+
         public ApplicationContext(string applicationName, string cluster = null, string machine = null)
         {
             this.ApplicationName = applicationName;
-            this.Cluster = cluster ?? Environment.GetEnvironmentVariable("CLUSTER_NAME", EnvironmentVariableTarget.Machine);
-            this.Machine = machine ?? Environment.GetEnvironmentVariable("COMPUTERNAME");
+            this.Cluster = cluster ?? Environment.GetEnvironmentVariable(EnvVar.ClusterKey, EnvironmentVariableTarget.Machine);
+            this.Machine = machine ?? Environment.GetEnvironmentVariable(EnvVar.MachineKey);
         }

         public string ApplicationName { get; private set; }
@@ -32,7 +40,7 @@
         public ClusterContext(string applicationName, string cluster = null)
         {
             this.ApplicationName = applicationName;
-            this.Cluster = cluster ?? Environment.GetEnvironmentVariable("CLUSTER_NAME", EnvironmentVariableTarget.Machine);
+            this.Cluster = cluster ?? Environment.GetEnvironmentVariable(EnvVar.ClusterKey, EnvironmentVariableTarget.Machine);
             this.Machine = Box.Machine.NotSpecified;
         }


#17 Cleaned up TaskBuilder

#17 Cleaned up TaskBuilder

--- src/Galaxy/ServiceManager/TaskBuilder.cs
+++ src/Galaxy/ServiceManager/TaskBuilder.cs
@@ -25,13 +25,10 @@

         public DeploymentTask UpdateServiceTask(Deployment deployment, NugetFeed deploymentFeed)
         {
-            var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
-
-            var clearBinaries = new ClearBinaries(serviceFolder, deployment.KeepOnUpdate);
             return CreateDeployTask("UpdateService", deployment)
                 .Add(StopService(deployment))
                 .Add(BackupService(deployment))
-                .Add(clearBinaries)
+                .Add(ClearBinaries(deployment))
                 .Add(InstallPackage(deployment, deploymentFeed, deployment.KeepOnUpdate.Clone()))
                 .Add(OverrideFiles(deployment));
         }
@@ -44,11 +41,10 @@

         public DeploymentTask UninstallServiceTask(Deployment deployment, NugetFeed deploymentFeed)
         {
-            var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
             return CreateDeployTask("UninstallService", deployment)
                 .Add(StopService(deployment))
                 .Add(UninstallService(deployment))
-                .Add(new UninstallPackage(serviceFolder));
+                .Add(UninstallPackage(deployment));
         }

         public DeploymentTask StartServiceTask(Deployment deployment, NugetFeed deploymentFeed)
@@ -66,11 +62,10 @@
         private static DeploymentTask CreateDeployTask(string name, Deployment deployment)
         {
             var deployLogFolder = deployment.GetDeployLogFolder();
-
             Folder.EnsureExists(deployLogFolder);
+
             var filename = string.Format("{0}.{1:yyyy-MM-dd_HH.mm.ss}.log", name, DateTime.Now);
             var fullPath = Path.Combine(deployLogFolder, filename);
-
             var logStream = File.Open(fullPath, FileMode.Create, FileAccess.Write);

             return new DeploymentTask(name, deployment.Id, logStream);
@@ -81,29 +76,42 @@
             var serviceName = deployment.GetServiceName();
             var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
             var backupFolder = deployment.GetBackupFolder();
-
             return new BackupService(serviceName, serviceFolder, backupFolder);
+        }
+
+        private IOperation ClearBinaries(Deployment deployment)
+        {
+            var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
+            var keepOnUpdate = deployment.KeepOnUpdate;
+            return new ClearBinaries(serviceFolder, keepOnUpdate);
         }

         private IOperation InstallPackage(Deployment deployment, NugetFeed deploymentFeed, FileList keepOnUpdate)
         {
             var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
+            var packageId = deployment.PackageId;
+            var feedUri = deploymentFeed.Uri;
+            var packageVersion = deployment.PackageVersion;
+            var orders = new[] { new InstallPackageOrder(packageId, feedUri, packageVersion) };
+            return new InstallPackage(serviceFolder, orders, keepOnUpdate);
+        }

-            var orders = new[]
-            {
-                new InstallPackageOrder(deployment.PackageId, deploymentFeed.Uri, deployment.PackageVersion)
-            };
-            return new InstallPackage(serviceFolder, orders, keepOnUpdate);
+        private IOperation UninstallPackage(Deployment deployment)
+        {
+            var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
+            return new UninstallPackage(serviceFolder);
         }

         private IOperation StartService(Deployment deployment)
         {
-            return new StartService(deployment.GetServiceName());
+            var serviceName = deployment.GetServiceName();
+            return new StartService(serviceName);
         }

         private IOperation StopService(Deployment deployment)
         {
-            return new StopService(deployment.GetServiceName());
+            var serviceName = deployment.GetServiceName();
+            return new StopService(serviceName);
         }

         private IOperation InstallService(Deployment deployment)
@@ -126,7 +134,8 @@
         {
             var serviceFolder = deployment.GetDeployFolder(_options.GetDeployFolder());
             var serviceFilesFolder = deployment.GetFilesFolder();
-            return new OverrideFiles(serviceFolder, serviceFilesFolder, deployment.KeepOnUpdate.Clone());
+            var keepOnUpdate = deployment.KeepOnUpdate.Clone();
+            return new OverrideFiles(serviceFolder, serviceFilesFolder, keepOnUpdate);
         }
     }
-}
+}


Update the test runner to use the new parser interface.

--- src/Generator.Tests/HeaderTestFixture.cs
+++ src/Generator.Tests/HeaderTestFixture.cs
@@ -30,7 +30,7 @@
             var parser = new Parser(options);
             var result = parser.ParseHeader(file);

-            if (!result.Success)
+            if (result.Kind != ParserResultKind.Success)
                 throw new Exception("Could not parse file: " + file);

             library = result.Library;


Remove dependency on AutoFixture

Remove dependency on AutoFixture

Unfortunately AutoFixture is not yet compatible with .NET Core so it
needs to be removed from these tests.

--- tests/Compiler/Clr.Tests/Compilation/IL/GeneratorTests.cs
+++ tests/Compiler/Clr.Tests/Compilation/IL/GeneratorTests.cs
@@ -13,18 +13,18 @@
     [TestFixture]
     public class GeneratorTests
     {
-        Fixture _fixture;
-        string _assemblyName;
-        string _className;
-        string _classNamespace;
+        readonly string _assemblyName;
+        readonly string _className;
+        readonly string _classNamespace;
+        readonly string _methodName;

         [SetUp]
         public void SetUp()
         {
-            _fixture = new Fixture ();
-            _assemblyName = _fixture.Create<string> ();
-            _className = _fixture.Create<string> ();
-            _classNamespace = _fixture.Create<string> ();
+            _assemblyName = $"assembly_{Guid.NewGuid ().ToString ()}";
+            _className = $"type_{Guid.NewGuid ().ToString ()}";
+            _classNamespace = $"namespace_{Guid.NewGuid ().ToString ()}";
+            _methodName = $"method_{Guid.NewGuid ().ToString ()}";
         }

         [Test]
@@ -139,14 +139,13 @@
         public void Given_a_function_definition_When_generating_Then_a_method_with_correct_name_is_created()
         {
             // Arrange
-            var methodName = _fixture.Create<string> ();
             var assemblyDefinition = AssemblyDefinitionBuilder.Create (_assemblyName)
                 .AsLibrary ()
                 .AddModule (c => c
                     .WithName (_className)
                     .WithNamespace (_classNamespace)
                     .AddFunction(f => f
-                        .WithName(methodName)
+                        .WithName(_methodName)
                         .Public ()))
                 .Build();

@@ -155,7 +154,7 @@

             // Assert
             var type = assemblyDefinition.LoadAssembly ().GetTypes ().First ();
-            var method = type.GetMethod (methodName);
+            var method = type.GetMethod (_methodName);
             method.Should ().NotBeNull ();
         }

@@ -163,14 +162,13 @@
         public void Given_a_function_definition_When_generating_Then_a_public_static_method_is_created ()
         {
             // Arrange
-            var methodName = _fixture.Create<string> ();
             var assemblyDefinition = AssemblyDefinitionBuilder.Create (_assemblyName)
                 .AsLibrary ()
                 .AddModule (c => c
                     .WithName (_className)
                     .WithNamespace (_classNamespace)
                     .AddFunction (f => f
-                        .WithName (methodName)
+                        .WithName (_methodName)
                         .Public ()))
                 .Build ();

@@ -179,7 +177,7 @@

             // Assert
             var type = assemblyDefinition.LoadAssembly ().GetTypes ().First ();
-            var method = type.GetMethod (methodName);
+            var method = type.GetMethod (_methodName);
             method.IsPublic.Should ().BeTrue ("method must be public");
             method.IsStatic.Should ().BeTrue ("method must be static");
             method.IsHideBySig.Should ().BeTrue ("method must be hidebysig");
@@ -196,7 +194,7 @@
 					.WithName (_className)
 					.WithNamespace (_classNamespace)
 					.AddFunction (f => f
-					     .WithName (methodName)
+					     .WithName (_methodName)
 					     .Public ()))
                 .Build ();

@@ -205,7 +203,7 @@

             // Assert
             var type = assemblyDefinition.LoadAssembly ().GetTypes ().First ();
-            var method = type.GetMethod (methodName);
+            var method = type.GetMethod (_methodName);
             var result = method.Invoke (null, null);
             result.Should ().BeOfType<int> ();
             result.Should ().Be (1);


Rewrite Asserts for concurrenttest for better diag

--- tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs
+++ tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs
@@ -32,7 +32,6 @@
 //

 #if !NETSTANDARD
-
 #define DISABLE_FILE_INTERNAL_LOGGING

 namespace NLog.UnitTests.Targets
@@ -45,6 +44,9 @@
     using NLog.Targets;
     using NLog.Targets.Wrappers;
     using Xunit;
+    using System.Collections.Generic;
+    using System.Linq;
+
     using Xunit.Extensions;

     public class ConcurrentFileTargetTests : NLogTestBase
@@ -168,7 +170,9 @@

                 string logFile = Path.Combine(tempPath, MakeFileName(numProcesses, numLogs, mode));
                 if (File.Exists(logFile))
-                    File.Delete(logFile);
+                {
+                    throw new Exception($"file '{logFile}' already exists");
+                }

                 Process[] processes = new Process[numProcesses];

@@ -198,32 +202,33 @@

                 bool verifyFileSize = files.Count > 1;

-                int[] maxNumber = new int[numProcesses];
+                var recievedNumbersSet = new List<int>[numProcesses];
+                for (int i = 0; i < numProcesses; i++)
+                {
+                    var recievedNumbers = new List<int>(numLogs);
+                    recievedNumbersSet[i] = recievedNumbers;
+                }
+
                 //Console.WriteLine("Verifying output file {0}", logFile);
                 foreach (var file in files)
                 {
+
                     using (StreamReader sr = File.OpenText(file))
                     {
+
                         string line;
-
                         while ((line = sr.ReadLine()) != null)
                         {
                             string[] tokens = line.Split(' ');
                             Assert.Equal(2, tokens.Length);
-                            try
-                            {
-                                int thread = Convert.ToInt32(tokens[0]);
-                                int number = Convert.ToInt32(tokens[1]);
-                                Assert.True(thread >= 0);
-                                Assert.True(thread < numProcesses);
-                                Assert.Equal(maxNumber[thread], number);
-                                maxNumber[thread]++;
-                            }
-                            catch (Exception ex)
-                            {
-                                throw new InvalidOperationException($"Error when parsing line '{line}' in file {file}", ex);
-                            }
+
+                            int thread = Convert.ToInt32(tokens[0]);
+                            int number = Convert.ToInt32(tokens[1]);
+                            Assert.True(thread >= 0);
+                            Assert.True(thread < numProcesses);
+                            recievedNumbersSet[thread].Add(number);
                         }
+

                         if (verifyFileSize)
                         {
@@ -236,6 +241,30 @@
                         }
                     }
                 }
+
+                var expected = Enumerable.Range(0, numLogs).ToList();
+
+                int currentProcess = 0;
+                try
+                {
+                    for (; currentProcess < numProcesses; currentProcess++)
+                    {
+                        var recievedNumbers = recievedNumbersSet[currentProcess];
+
+                        var fastCheck = expected.SequenceEqual(recievedNumbers);
+
+                        if (!fastCheck)
+                            //assert equals on two long lists in xUnit is lame. Not showing the difference.
+                        {
+                            Assert.Equal(string.Join(",", expected), string.Join(",", recievedNumbers));
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    throw new InvalidOperationException($"Error when comparing path {tempPath} for process {currentProcess}", ex);
+                }
+
             }
             finally
             {


Revert unwanted change.

Revert unwanted change.

--- samples/ControlCatalog.Android/Resources/Resource.Designer.cs
+++ samples/ControlCatalog.Android/Resources/Resource.Designer.cs
@@ -14,7 +14,7 @@
 {

-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.99.62")]
 	public partial class Resource
 	{