cleanup

cleanup

--- Demo.Framework/DemoInterface.cs
+++ Demo.Framework/DemoInterface.cs
@@ -19,12 +19,9 @@
 	{
 		private static readonly Stopwatch _Watch;

-		private static readonly ShapedText _ShapedText;
-
 		static DemoInterface()
 		{
 			_Watch = new Stopwatch();
-			_ShapedText = new ShapedText();
 		}

 		public static void ResetDemo(
@@ -93,27 +90,28 @@
 			Rectangle subsystemRegion = subsystemMetrics.AlignRelativeTo(
 				middle, Alignment.Center, Axis.Horizontal);

-			subsystemRegion = subsystemRegion.Translate(0, middle.Bottom - subsystemRegion.Height);
+			subsystemRegion = subsystemRegion.Translate(
+				0, middle.Bottom - subsystemRegion.Height);

 			////////////////////////////////
-			string memoryString = string.Format("Memory: {0:N0} KB", GC.GetTotalMemory(true) / 1024);
-
-			Rectangle memoryMetrics = MeasureText(memoryString, device2D);
-
-			string garbageString = string.Format("Garbage: {0:N0} KB", memoryDelta / 1024);
-
-			Rectangle garbageMetrics = MeasureText(garbageString, device2D);
-
-			string snapshotString = "SNAPSHOT";
+			string memoryString = string.Format(
+				"Memory: {0:N0} KB", GC.GetTotalMemory(true) / 1024);
+
+			string garbageString = string.Format(
+				"Garbage: {0:N0} KB", memoryDelta / 1024);
+
+			const string snapshotString = "SNAPSHOT";

 			Rectangle snapshotMetrics = MeasureText(snapshotString, device2D);

-			string optionsString = "OPTIONS";
+			const string optionsString = "OPTIONS";

 			Rectangle optionsMetrics = MeasureText(optionsString, device2D);

-			snapshotMetrics = snapshotMetrics.AlignRelativeTo(right, Alignment.Center, Axis.Horizontal);
-			optionsMetrics = optionsMetrics.AlignRelativeTo(left, Alignment.Center, Axis.Horizontal);
+			snapshotMetrics = snapshotMetrics.AlignRelativeTo(
+				right, Alignment.Center, Axis.Horizontal);
+			optionsMetrics = optionsMetrics.AlignRelativeTo(
+				left, Alignment.Center, Axis.Horizontal);

 			device2D.Painter.Begin(target);

@@ -127,9 +125,13 @@
 			device2D.Painter.FillRectangle(right);

 			Rectangle timePanel = timeRegion.Expand(
-				timeRegion.Height, timeRegion.Height, timeRegion.Height, timeRegion.Height / 4.0f);
-
-			device2D.Painter.FillRectangle(timePanel, new Size(timeRegion.Height / 2.0f));
+				timeRegion.Height,
+				timeRegion.Height,
+				timeRegion.Height,
+				timeRegion.Height / 4.0f);
+
+			device2D.Painter.FillRectangle(
+				timePanel, new Size(timeRegion.Height / 2.0f));

 			Rectangle subsystemPanel = subsystemRegion.Expand(
 				subsystemRegion.Height,
@@ -137,7 +139,8 @@
 				subsystemRegion.Height,
 				subsystemRegion.Height);

-			device2D.Painter.FillRectangle(subsystemPanel, new Size(subsystemRegion.Height / 2.0f));
+			device2D.Painter.FillRectangle(
+				subsystemPanel, new Size(subsystemRegion.Height / 2.0f));

 			device2D.Painter.SetBrush(Resources.ActiveButton);

@@ -175,14 +178,17 @@
 				snapshotMetrics.Right,
 				snapshotMetrics.Bottom);

-			device2D.Painter.Translate(right.Left + (timeRegion.Height / 2.0f), (timeRegion.Height * 2) + (timeRegion.Height * 0.25f));
+			device2D.Painter.Translate(
+				right.Left + (timeRegion.Height / 2.0f),
+				(timeRegion.Height * 2) + (timeRegion.Height * 0.25f));

 			DrawText(Point.Empty, memoryString, device2D);

-			device2D.Painter.Translate(0, (timeRegion.Height * 2) + (timeRegion.Height * 0.25f));
+			device2D.Painter.Translate(
+				0, (timeRegion.Height * 2) + (timeRegion.Height * 0.25f));

 			DrawText(Point.Empty, garbageString, device2D);
-
+
 			device2D.Painter.RestoreState();

 			device2D.Painter.SaveState();
@@ -200,8 +206,11 @@
 			device2D.Painter.RestoreState();

 			GenerateMenu(
-				context, target, device2D, (timeRegion.Height * 3) + (timeRegion.Height * 0.25f), left.Width);
-
+				context,
+				target,
+				device2D,
+				(timeRegion.Height * 3) + (timeRegion.Height * 0.25f),
+				left.Width);

 			device2D.Painter.End();

@@ -294,12 +303,13 @@
 			float maxWidth = 0.0f;
 			float maxHeight = 0.0f;

-			foreach (TextShaper.Span span in shapedOutput.Spans)
-			{
-				maxHeight = Math.Max(maxHeight,
+			foreach(TextShaper.Span span in shapedOutput.Spans)
+			{
+				maxHeight = Math.Max(
+					maxHeight,
 					span.FontMetrics.MeasureEm(span.PointSize));

-				foreach (int clusterIndex in span.Clusters)
+				foreach(int clusterIndex in span.Clusters)
 				{
 					maxWidth += shapedOutput.Clusters[clusterIndex].Advance;
 				}


Added file license to DefaultTestDiscoverer

--- Nodejs/Product/TestAdapter/DefaultTestDiscoverer.cs
+++ Nodejs/Product/TestAdapter/DefaultTestDiscoverer.cs
@@ -1,4 +1,6 @@
-using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
+
+using Microsoft.VisualStudio.TestPlatform.ObjectModel;
 using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;

 namespace Microsoft.NodejsTools.TestAdapter


* Fix Inconsistent line ending style on SimStatsReporter

--- OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -240,7 +240,7 @@
                 sb[12].StatID = (uint)Stats.OtherMS;
                 sb[12].StatValue = m_otherMS / statsUpdateFactor;

-                sb[13].StatID = (uint)Stats.InPacketsPerSecond;
+                sb[13].StatID = (uint)Stats.InPacketsPerSecond;
                 sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor);

                 sb[14].StatID = (uint)Stats.OutPacketsPerSecond;


Use pattern matching

Use pattern matching

--- Modix.Bot/ModixBot.cs
+++ Modix.Bot/ModixBot.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Diagnostics;
 using System.Threading;
 using System.Threading.Tasks;
@@ -189,8 +189,8 @@
             var stopwatch = new Stopwatch();
             stopwatch.Start();

-            var message = messageParam as SocketUserMessage;
-            if (message == null) return;
+            if (!(messageParam is SocketUserMessage message))
+                return;

             int argPos = 0;
             if (!(message.HasCharPrefix('!', ref argPos) || message.HasMentionPrefix(_client.CurrentUser, ref argPos)))


Added more statistics to export.

Added more statistics to export.

--- Source/Tools/ComparisonUtility/ComparisonUtility.cs
+++ Source/Tools/ComparisonUtility/ComparisonUtility.cs
@@ -49,8 +49,6 @@
         private const int SourcePoint = 0;
         private const int DestinationPoint = 1;

-        private long m_baseSourcePointLoss;
-        private long m_baseDestinationPointLoss;
         private int m_frameRate;
         private ulong m_subsecondOffset;
         private bool m_formClosing;
@@ -197,8 +195,6 @@

                 m_frameRate = int.Parse(parameters["m_frameRate"]);
                 m_subsecondOffset = (ulong)(Ticks.PerSecond / m_frameRate);
-                m_baseSourcePointLoss = 0;
-                m_baseDestinationPointLoss = 0;

                 ShowUpdateMessage("Loading source connection metadata...");
                 List<Metadata> sourceMetadata = Metadata.Query(sourceHostAddress, sourceMetadataPort, metaDataTimeout);
@@ -239,15 +235,17 @@
                 long receivedSourcePoints = 0;
                 long receivedDestinationPoints = 0;
                 long processedPoints = 0;
+                long receivedAsNaNPoints = 0;
                 long baseSourceSubsecondLoss = 0;
                 long baseDestinationSubsecondLoss = 0;
+                long baseSourcePointLoss = 0;
+                long baseDestinationPointLoss = 0;
                 ulong currentTimestamp;
                 ulong lastSourceTimestamp = 0;
                 ulong lastDestinationTimestamp = 0;
                 long displayMessageCount = messageInterval;

                 Dictionary<ulong, Dictionary<int, long[]>> hourlySummaries = new Dictionary<ulong, Dictionary<int, long[]>>();  // PointID[HourIndex[ValueCount[7]]]
-                Dictionary<ulong, DataPoint[]> dataBlock = new Dictionary<ulong, DataPoint[]>();                                // PointID[DataPoint[2]]
                 DataPoint sourcePoint = new DataPoint();
                 DataPoint destinationPoint = new DataPoint();
                 DataPoint referencePoint = new DataPoint();
@@ -264,7 +262,7 @@
                 Action<DataPoint, int> incrementValueCount = (dataPoint, valueIndex) =>
                 {
                     if (valueIndex == ComparedValue && pointIsMissing(dataPoint))
-                        Interlocked.Increment(ref m_baseSourcePointLoss);
+                        Interlocked.Increment(ref receivedAsNaNPoints);

                     Dictionary<int, long[]> summary = getHourlySummary(dataPoint.PointID);
                     int hourIndex = getHourIndex(dataPoint.Timestamp);
@@ -278,9 +276,21 @@
                         incrementValueCount(item.Item1, item.Item2);
                 };

+                ProcessQueue<Dictionary<ulong, DataPoint[]>>.ProcessItemFunctionSignature processDataBlock = dataBlock =>
+                {
+                    HashSet<ulong> missingSourceIDs = new HashSet<ulong>(sourcePointMappings.Values);
+                    missingSourceIDs.ExceptWith(dataBlock.Values.Select(points => points[SourcePoint]).Where(point => (object)point != null).Select(point => point.PointID));
+                    baseSourcePointLoss += missingSourceIDs.Count;
+
+                    HashSet<ulong> missingDestinationIDs = new HashSet<ulong>(destinationPointMappings.Values);
+                    missingDestinationIDs.ExceptWith(dataBlock.Values.Select(points => points[DestinationPoint]).Where(point => (object)point != null).Select(point => point.PointID));
+                    baseDestinationPointLoss += missingDestinationIDs.Count;
+                };
+
                 ProcessQueue<Tuple<DataPoint, int>> counterIncrements = ProcessQueue<Tuple<DataPoint, int>>.CreateRealTimeQueue(processActions);
-
-                Action<DataPoint> logMissingSourceValue = dataPoint => counterIncrements.Add(new Tuple<DataPoint, int>(dataPoint.Clone(), MissingSourceValue));
+                ProcessQueue<Dictionary<ulong, DataPoint[]>> dataBlockQueue = ProcessQueue<Dictionary<ulong, DataPoint[]>>.CreateRealTimeQueue(processDataBlock);
+
+                Action <DataPoint> logMissingSourceValue = dataPoint => counterIncrements.Add(new Tuple<DataPoint, int>(dataPoint.Clone(), MissingSourceValue));
                 Action<DataPoint> logMissingDestinationValue = dataPoint => counterIncrements.Add(new Tuple<DataPoint, int>(dataPoint.Clone(), MissingDestinationValue));
                 Action<DataPoint> logValidValue = dataPoint => counterIncrements.Add(new Tuple<DataPoint, int>(dataPoint.Clone(), ValidValue));
                 Action<DataPoint> logInvalidValue = dataPoint => counterIncrements.Add(new Tuple<DataPoint, int>(dataPoint.Clone(), InvalidValue));
@@ -297,8 +307,9 @@

                 ShowUpdateMessage("Comparing archives...");

-                // Start counter incrementation queue
+                // Start process queues
                 counterIncrements.Start();
+                dataBlockQueue.Start();

                 using (SnapDBClient sourceClient = new SnapDBClient(sourceHostAddress, sourceDataPort, sourceInstanceName, startTime, endTime, m_frameRate, sourcePointMappings.Values))
                 using (SnapDBClient destinationClient = new SnapDBClient(destinationHostAddress, destinationDataPort, destinationInstanceName, startTime, endTime, m_frameRate, destinationPointMappings.Values))
@@ -396,7 +407,8 @@

                         // Read all time adjusted points for the current timestamp into a single block
                         currentTimestamp = DataPoint.RoundTimestamp(sourcePoint.Timestamp, m_frameRate);
-                        dataBlock.Clear();
+
+                        Dictionary<ulong, DataPoint[]> dataBlock = new Dictionary<ulong, DataPoint[]>();

                         // Load source data for current timestamp
                         do
@@ -476,7 +488,6 @@
                             break;
                         }

-                        // Analyze data block
                         foreach (DataPoint[] points in dataBlock.Values)
                         {
                             if ((object)points[SourcePoint] == null)
@@ -539,9 +550,8 @@
                             }
                         }

-                        // TODO:
-                        //foreach (dataBlock.Points.PointIDs that are missing from metadata)
-                        //   Interlocked.Add(ref m_baseSourcePointLoss, m_subsecondOffset);
+                        // Queue data block to complete analyze process
+                        dataBlockQueue.Add(dataBlock);
                     }

                     if (m_formClosing)
@@ -553,49 +563,54 @@
                     {
                         totalTime = DateTime.UtcNow.Ticks - operationStartTime;
                         ShowUpdateMessage("*** Compare Complete ***");
-                        ShowUpdateMessage($"Total compare time {totalTime.ToElapsedTimeString(3)} at {comparedPoints / totalTime.ToSeconds():N0} points per second.");
                         UpdateProgressBar(100);

                         ShowUpdateMessage("Completing count processing...");
+
                         counterIncrements.Flush();
+                        dataBlockQueue.Flush();
+
                         ShowUpdateMessage("*** Count Processing Complete ***");

-                        long totalBaseSourcePointLoss = m_baseSourcePointLoss + baseSourceSubsecondLoss * sourceMetadata.Count;
-                        long totalBaseDestinationPointLoss = m_baseDestinationPointLoss + baseDestinationSubsecondLoss * destinationMetadata.Count;
+                        long totalBaseSourcePointLoss = receivedAsNaNPoints + baseSourcePointLoss + baseSourceSubsecondLoss * sourceMetadata.Count;
+                        long totalBaseDestinationPointLoss = receivedAsNaNPoints + baseDestinationPointLoss + baseDestinationSubsecondLoss * destinationMetadata.Count;
                         long expectedPoints = (long)(timespan * m_frameRate * sourceMetadata.Count);
                         long expectedSourcePoints = expectedPoints - totalBaseSourcePointLoss;
                         long expectedDestinationPoints = expectedPoints - totalBaseDestinationPointLoss;

                         string overallSummary =
+                            $"Total compare time {totalTime.ToElapsedTimeString(3)} at {expectedPoints / totalTime.ToSeconds():N0} points per second.{Environment.NewLine}" +
                             $"{Environment.NewLine}" +
                             $"           Meta-data points: {sourceMetadata.Count}{Environment.NewLine}" +
                             $"          Time-span covered: {timespan:N0} seconds: {Ticks.FromSeconds(timespan).ToElapsedTimeString(2)}{Environment.NewLine}" +
+                            $"            Expected points: {expectedPoints:N0}{Environment.NewLine}" +
                             $"           Processed points: {processedPoints:N0}{Environment.NewLine}" +
                             $"            Compared points: {comparedPoints:N0}{Environment.NewLine}" +
                             $"               Valid points: {validPoints:N0}{Environment.NewLine}" +
                             $"             Invalid points: {invalidPoints:N0}{Environment.NewLine}" +
+                            $"     Received as NaN points: {receivedAsNaNPoints:N0}{Environment.NewLine}" +
                             $"      Missing source points: {missingSourcePoints:N0}{Environment.NewLine}" +
                             $" Missing destination points: {missingDestinationPoints:N0}{Environment.NewLine}" +
+                            $"           Base source loss: {baseSourcePointLoss:N0}{Environment.NewLine}" +
+                            $"      Base destination loss: {baseDestinationPointLoss:N0}{Environment.NewLine}" +
                             $"          Source duplicates: {duplicateSourcePoints:N0}{Environment.NewLine}" +
                             $"     Destination duplicates: {duplicateDestinationPoints:N0}{Environment.NewLine}" +
                             $"      Overall data accuracy: {Math.Round(validPoints / (double)comparedPoints * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
                             $"{Environment.NewLine}" +
+                            $" Missing source sub-seconds: {baseSourceSubsecondLoss:N0}, outage of {new Ticks(baseSourceSubsecondLoss * (long)m_subsecondOffset).ToElapsedTimeString(2)}{Environment.NewLine}" +
+                            $"     Total base source loss: {totalBaseSourcePointLoss:N0}: {Math.Round(totalBaseSourcePointLoss / (double)expectedPoints.NotZero(1) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
+                            $"     Expected source points: {expectedSourcePoints:N0} (excluding loss){Environment.NewLine}" +
                             $"     Received source points: {receivedSourcePoints:N0}{Environment.NewLine}" +
-                            $" Missing source sub-seconds: {baseSourceSubsecondLoss:N0}, outage of {new Ticks(baseSourceSubsecondLoss * (long)m_subsecondOffset).ToElapsedTimeString(2)}{Environment.NewLine}" +
-                            $"     Base source point loss: {totalBaseSourcePointLoss:N0}: {Math.Round(totalBaseSourcePointLoss / (double)expectedSourcePoints.NotZero(1) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
-                            $"     Expected source points: {expectedSourcePoints:N0} (excluding loss){Environment.NewLine}" +
                             $"        Source completeness: {Math.Round(receivedSourcePoints / (double)(expectedSourcePoints) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
                             $"{Environment.NewLine}" +
+                            $"   Missing dest sub-seconds: {baseDestinationSubsecondLoss:N0}, outage of {new Ticks(baseDestinationSubsecondLoss * (long)m_subsecondOffset).ToElapsedTimeString(2)}{Environment.NewLine}" +
+                            $"Total base destination loss: {totalBaseDestinationPointLoss:N0}: {Math.Round(totalBaseDestinationPointLoss / (double)expectedPoints.NotZero(1) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
+                            $"Expected destination points: {expectedDestinationPoints:N0} (excluding loss){Environment.NewLine}" +
                             $"Received destination points: {receivedDestinationPoints:N0}{Environment.NewLine}" +
-                            $"   Missing dest sub-seconds: {baseDestinationSubsecondLoss:N0}, outage of {new Ticks(baseDestinationSubsecondLoss * (long)m_subsecondOffset).ToElapsedTimeString(2)}{Environment.NewLine}" +
-                            $"Base destination point loss: {totalBaseDestinationPointLoss:N0}: {Math.Round(totalBaseDestinationPointLoss / (double)expectedDestinationPoints.NotZero(1) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
-                            $"Expected destination points: {expectedDestinationPoints:N0} (excluding loss){Environment.NewLine}" +
                             $"   Destination completeness: {Math.Round(receivedDestinationPoints / (double)(expectedDestinationPoints) * 100000.0D) / 1000.0D:N3}%{Environment.NewLine}" +
                             $"{Environment.NewLine}" +
                             $">> {Math.Round(missingSourcePoints / (double)(comparedPoints + missingSourcePoints).NotZero(1) * 100000.0D) / 1000.0D:N3}% missing from source that exists in destination{Environment.NewLine}" +
-                            $">> {Math.Round(missingDestinationPoints / (double)(comparedPoints + missingDestinationPoints).NotZero(1) * 100000.0D) / 1000.0D:N3}% missing from destination that exists in source{Environment.NewLine}" +
-                            $"{Environment.NewLine}" +
-                            $">> {Math.Round(receivedDestinationPoints / (double)(receivedSourcePoints).NotZero(1) * 100000.0D) / 1000.0D:N3}% overall loss to destination compared to source{Environment.NewLine}";
+                            $">> {Math.Round(missingDestinationPoints / (double)(comparedPoints + missingDestinationPoints).NotZero(1) * 100000.0D) / 1000.0D:N3}% missing from destination that exists in source{Environment.NewLine}";

                         ShowUpdateMessage(overallSummary);


fixed formatting and naming issues

fixed formatting and naming issues

--- src/Abp.MailKit/EmailExtensitons.cs
+++ src/Abp.MailKit/EmailExtensitons.cs
@@ -181,7 +181,7 @@
             return message;
         }

-        static MimePart GetMimePart(AttachmentBase item)
+        private static MimePart GetMimePart(AttachmentBase item)
         {
             var mimeType = item.ContentType.ToString();
             var contentType = ContentType.Parse(mimeType);
@@ -191,7 +191,8 @@
             if (contentType.MediaType.Equals("text", StringComparison.OrdinalIgnoreCase))
             {
                 // Original: part = new TextPart(contentType);
-                // Due to consturctor of TextPart(ContentType contentType) being internal, mimic the instantiation by using MimePart(ContentType contentType)
+                // Due to constructor of TextPart(ContentType contentType) being internal,
+                // mimic the instantiation by using MimePart(ContentType contentType)
                 part = new MimePart(contentType);
             }
             else
@@ -236,23 +237,23 @@
         }

         /// <summary>
-		/// Convert a <see cref="System.Net.Mail.MailAddress"/>
-		/// to a <see cref="MailboxAddress"/>.
-		/// </summary>
-		/// <returns>The equivalent <see cref="MailboxAddress"/>.</returns>
-		/// <param name="address">The mail address.</param>
-		static MailboxAddress ToMailboxAddress(this MailAddress address)
+        /// Convert a <see cref="System.Net.Mail.MailAddress"/>
+        /// to a <see cref="MailboxAddress"/>.
+        /// </summary>
+        /// <returns>The equivalent <see cref="MailboxAddress"/>.</returns>
+        /// <param name="address">The mail address.</param>
+		private static MailboxAddress ToMailboxAddress(this MailAddress address)
         {
             return address != null ? new MailboxAddress(address.DisplayName, address.Address) : null;
         }

         /// <summary>
-		/// Convert a <see cref="System.Net.Mail.MailAddressCollection"/>
-		/// to a <see cref="InternetAddressList"/>.
-		/// </summary>
-		/// <returns>The equivalent <see cref="InternetAddressList"/>.</returns>
-		/// <param name="addresses">The mail address.</param>
-		static InternetAddressList ToInternetAddressList(this MailAddressCollection addresses)
+        /// Convert a <see cref="System.Net.Mail.MailAddressCollection"/>
+        /// to a <see cref="InternetAddressList"/>.
+        /// </summary>
+        /// <returns>The equivalent <see cref="InternetAddressList"/>.</returns>
+        /// <param name="addresses">The mail address.</param>
+		private static InternetAddressList ToInternetAddressList(this MailAddressCollection addresses)
         {
             if (addresses == null)
                 return null;


Fix for LOG4NET-40 RollingFileAppender does not limit files to MaxSizeRollBackups when CountDirection is 1

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@312301 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/RollingFileAppender.cs
+++ src/Appender/RollingFileAppender.cs
@@ -550,11 +550,6 @@
 				if (!m_staticLogFileName)
 				{
 					m_scheduledFilename = fileName;
-
-					if (m_countDirection >= 0)
-					{
-						m_curSizeRollBackups++;
-					}
 				}

 				// Open the file (call the base class to do it)
@@ -590,7 +585,7 @@

 				if (m_countDirection >= 0)
 				{
-					fileName = fileName + '.' + (m_curSizeRollBackups + 1);
+					fileName = fileName + '.' + m_curSizeRollBackups;
 				}
 			}

@@ -798,7 +793,6 @@
 			try
 			{
 				// Bump the counter up to the highest count seen so far
-//				int backup = int.Parse(curFileName.Substring(index + 1), System.Globalization.NumberFormatInfo.InvariantInfo);
 				int backup;
 				if (SystemInfo.TryParse(curFileName.Substring(index + 1), out backup))
 				{
@@ -1194,6 +1188,11 @@

 			RollOverRenameFiles(File);

+			if (!m_staticLogFileName && m_countDirection >= 0)
+			{
+				m_curSizeRollBackups++;
+			}
+
 			// This will also close the file. This is OK since multiple close operations are safe.
 			SafeOpenFile(m_baseFileName, false);
 		}
@@ -1251,12 +1250,33 @@
 				}
 				else
 				{
-					//countDirection > 0
+					//countDirection >= 0
 					if (m_curSizeRollBackups >= m_maxSizeRollBackups && m_maxSizeRollBackups > 0)
 					{
 						//delete the first and keep counting up.
-						int oldestFileIndex = m_curSizeRollBackups - m_maxSizeRollBackups + 1;
-						DeleteFile(baseFileName + '.' + oldestFileIndex);
+						int oldestFileIndex = m_curSizeRollBackups - m_maxSizeRollBackups;
+
+						// If static then there is 1 file without a number, therefore 1 less archive
+						if (m_staticLogFileName)
+						{
+							oldestFileIndex++;
+						}
+
+						// If using a static log file then the base for the numbered sequence is the baseFileName passed in
+						// If not using a static log file then the baseFileName will already have a numbered postfix which
+						// we must remove, however it may have a date postfix which we must keep!
+						string archiveFileBaseName = baseFileName;
+						if (!m_staticLogFileName)
+						{
+							int lastDotIndex = archiveFileBaseName.LastIndexOf(".");
+							if (lastDotIndex >= 0)
+							{
+								archiveFileBaseName = archiveFileBaseName.Substring(0, lastDotIndex);
+							}
+						}
+
+						// Delete the archive file
+						DeleteFile(archiveFileBaseName + '.' + oldestFileIndex);
 					}

 					if (m_staticLogFileName)


Enable heap snapshot analysis via EventPipe.

--- src/PerfView/PerfViewData.cs
+++ src/PerfView/PerfViewData.cs
@@ -3319,14 +3319,14 @@
     /// </summary>
     public class PerfViewHeapSnapshots : PerfViewTreeItem
     {
-        public PerfViewHeapSnapshots(ETLPerfViewData file)
+        public PerfViewHeapSnapshots(PerfViewFile file)
         {
             Name = "GC Heap Snapshots";
             DataFile = file;
         }

         public virtual string Title { get { return Name + " for " + DataFile.Title; } }
-        public ETLPerfViewData DataFile { get; private set; }
+        public PerfViewFile DataFile { get; private set; }
         public override string FilePath { get { return DataFile.FilePath; } }

         /// <summary>
@@ -3340,7 +3340,15 @@
                 var newChildren = new List<PerfViewTreeItem>();
                 worker.StartWork("Searching for heap dumps in " + Name, delegate ()
                 {
-                    var traceLog = DataFile.GetTraceLog(worker.LogWriter);
+                    TraceLog traceLog = null;
+                    if (DataFile is ETLPerfViewData)
+                    {
+                        traceLog = ((ETLPerfViewData)DataFile).GetTraceLog(worker.LogWriter);
+                    }
+                    else if(DataFile is EventPipePerfViewData)
+                    {
+                        traceLog = ((EventPipePerfViewData)DataFile).GetTraceLog(worker.LogWriter);
+                    }
                     var source = traceLog.Events.GetSource();
                     var jsHeapParser = new JSDumpHeapTraceEventParser(source);

@@ -3406,7 +3414,7 @@
         /// <summary>
         /// snapshotKinds should be .NET or JS
         /// </summary>
-        public PerfViewHeapSnapshot(ETLPerfViewData file, int processId, string processName, double timeRelativeMSec, string snapshotKind)
+        public PerfViewHeapSnapshot(PerfViewFile file, int processId, string processName, double timeRelativeMSec, string snapshotKind)
         {
             m_snapshotKind = snapshotKind;
             m_timeRelativeMSec = timeRelativeMSec;
@@ -7562,6 +7570,7 @@
             bool hasGC = false;
             bool hasJIT = false;
             bool hasAnyStacks = false;
+            bool hasDotNetHeapDumps = true;
             if (m_traceLog != null)
             {
                 foreach (TraceEventCounts eventStats in m_traceLog.Stats)
@@ -7573,6 +7582,9 @@
                         hasGC = true;
                     else if (eventStats.EventName.StartsWith("Method/JittingStarted"))
                         hasJIT = true;
+
+                    if (eventStats.EventName.StartsWith("GC/BulkNode"))
+                        hasDotNetHeapDumps = true;
                 }
             }

@@ -7593,6 +7605,9 @@

                 if (hasGC)
                     memory.AddChild(new PerfViewGCStats(this));
+
+                if (hasDotNetHeapDumps)
+                    memory.AddChild(new PerfViewHeapSnapshots(this));

                 if (hasJIT)
                     advanced.AddChild(new PerfViewJitStats(this));


mise à jour de la stratégie DoubleCandle

--- Sources/Strategies/DoubleCandleStrategy/DoubleCandleStrategy.cs
+++ Sources/Strategies/DoubleCandleStrategy/DoubleCandleStrategy.cs
@@ -21,6 +21,8 @@
 #endregion

+using System;
+using System.Diagnostics;
 using cAlgo;
 using cAlgo.API;
 using cAlgo.API.Indicators;
@@ -34,17 +36,20 @@
 	{
 		#region Strategy Parameters
 			public int Period { get; set; }
-			public int DoubleCandleStep { get; set; }
+			public int CandleSize { get; set; }
+			public int? BollingerDivisions { get; set; }
 		#endregion

 		private RelativeStrengthIndex _rsi;
 		private BollingerBands _bollingerBand;

-		public DoubleCandleStrategy(Robot robot, int doubleCandleperiod, int doubleCandleStep): base(robot)
+		public DoubleCandleStrategy(Robot robot, int period, int candleSize, int? bollingerDivisions=null)
+			: base(robot)
 		{
-			this.Period = doubleCandleperiod;
-			this.DoubleCandleStep = doubleCandleStep;
+			this.Period = period;
+			this.CandleSize = candleSize;
+			this.BollingerDivisions = bollingerDivisions;

 			Initialize();
 		}
@@ -54,6 +59,7 @@
 			_rsi = Robot.Indicators.RelativeStrengthIndex(Robot.MarketSeries.Close,Period);
 			_bollingerBand = Robot.Indicators.BollingerBands(Robot.MarketSeries.Close, 20, 2, MovingAverageType.Simple);

+			Debug.Assert(CandleSize >= 0, "The candle size must be greather than 0");

 		}

@@ -63,7 +69,7 @@
 		/// <returns></returns>
 		public override TradeType? signal()
 		{
-			double step = DoubleCandleStep * Robot.Symbol.PipSize;
+			double candleSize = CandleSize * Robot.Symbol.PipSize;
 			int lastIndex = Robot.MarketSeries.Close.Count - 2;
 			int previewIndex = lastIndex - 1;

@@ -72,21 +78,17 @@
 			double lastOpen = Robot.MarketSeries.Open[lastIndex];
 			double lastClose = Robot.MarketSeries.Close[lastIndex];

-			bool bollingerTestBuy = _bollingerBand.Top.LastValue - Robot.Symbol.Mid() > 0.0005;
-			bool bollingerTestSell = Robot.Symbol.Mid() - _bollingerBand.Bottom.LastValue > 0.0005;
+			double thresholTridggering = (BollingerDivisions.HasValue) ? (_bollingerBand.Top.LastValue - _bollingerBand.Bottom.LastValue) / BollingerDivisions.Value : 0;
+
+			bool bollingerTestBuy = Math.Abs(_bollingerBand.Top.LastValue - Robot.Symbol.Mid()) >= thresholTridggering;
+			bool bollingerTestSell = Math.Abs(_bollingerBand.Bottom.LastValue - Robot.Symbol.Mid()) >= thresholTridggering;

-			if (!Robot.existBuyPositions() && (lastClose > lastOpen + step) && (previewClose > previewOpen + step) && lastClose > previewClose && _rsi.Result.LastValue<65 && bollingerTestBuy)
-			{
-				Robot.closeAllSellPositions();
+			if (!Robot.existBuyPositions() && (lastClose > lastOpen + candleSize) && (previewClose > previewOpen + candleSize) && _rsi.Result.LastValue<65 && bollingerTestBuy)
 				return TradeType.Buy;
-			}

-			if (!Robot.existSellPositions() && (lastClose + step < lastOpen) && (previewClose + step < previewOpen) && lastClose < previewClose && _rsi.Result.LastValue>35 && bollingerTestSell)
-			{
-				Robot.closeAllBuyPositions();
+			if (!Robot.existSellPositions() && (lastClose + candleSize < lastOpen) && (previewClose + candleSize < previewOpen) && _rsi.Result.LastValue>35 && bollingerTestSell)
 				return TradeType.Sell;
-			}

 			return null;
 		}


Again no idea

Again no idea

--- src/AutoMapper/Internal/TypePair.cs
+++ src/AutoMapper/Internal/TypePair.cs
@@ -1,50 +1,50 @@
-using System;
-
-namespace AutoMapper.Internal
-{
-	internal struct TypePair : IEquatable<TypePair>
-	{
-
-		public TypePair(Type sourceType, Type destinationType)
-			: this()
-		{
-			_sourceType = sourceType;
-			_destinationType = destinationType;
-			_hashcode = (_sourceType.GetHashCode()*397) ^ _destinationType.GetHashCode();
-		}
-
-        private readonly Type _destinationType;
-        private readonly int _hashcode;
-        private readonly Type _sourceType;
-
-	    public Type SourceType
-	    {
-	        get { return _sourceType; }
-	    }
-
-	    public Type DestinationType
-	    {
-	        get { return _destinationType; }
-	    }
-
-		public bool Equals(TypePair other)
-		{
-			return Equals(other._sourceType, _sourceType) && Equals(other._destinationType, _destinationType);
-		}
-
-		public override bool Equals(object obj)
-		{
-			if (ReferenceEquals(null, obj)) return false;
-			if (obj.GetType() != typeof (TypePair)) return false;
-			return Equals((TypePair) obj);
-		}
-
-		public override int GetHashCode()
-		{
-			unchecked
-			{
-				return _hashcode;
-			}
-		}
-	}
+using System;
+
+namespace AutoMapper.Internal
+{
+	internal struct TypePair : IEquatable<TypePair>
+	{
+
+		public TypePair(Type sourceType, Type destinationType)
+			: this()
+		{
+			_sourceType = sourceType;
+			_destinationType = destinationType;
+			_hashcode = (_sourceType.GetHashCode()*397) ^ _destinationType.GetHashCode();
+		}
+
+        private readonly Type _destinationType;
+        private readonly int _hashcode;
+        private readonly Type _sourceType;
+
+	    public Type SourceType
+	    {
+	        get { return _sourceType; }
+	    }
+
+	    public Type DestinationType
+	    {
+	        get { return _destinationType; }
+	    }
+
+		public bool Equals(TypePair other)
+		{
+			return Equals(other._sourceType, _sourceType) && Equals(other._destinationType, _destinationType);
+		}
+
+		public override bool Equals(object obj)
+		{
+			if (ReferenceEquals(null, obj)) return false;
+			if (obj.GetType() != typeof (TypePair)) return false;
+			return Equals((TypePair) obj);
+		}
+
+		public override int GetHashCode()
+		{
+			unchecked
+			{
+				return _hashcode;
+			}
+		}
+	}
 }


Fix remote camera horizontal rotation keys

--- ARGame/Assets/Scripts/Projection/ControllableRemoteMarker.cs
+++ ARGame/Assets/Scripts/Projection/ControllableRemoteMarker.cs
@@ -149,12 +149,12 @@

             if (Input.GetKey(KeyCode.D))
             {
-                horizontal += HorizontalSpeed;
+                horizontal -= HorizontalSpeed;
             }

             if (Input.GetKey(KeyCode.A))
             {
-                horizontal -= HorizontalSpeed;
+                horizontal += HorizontalSpeed;
             }

             return new Vector2(horizontal, vertical);


Fix issue with deployed assemblies version missing (#219)

--- source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
+++ source/VisualStudio.Extension/DeployProvider/DeployProvider.cs
@@ -172,8 +172,9 @@

                         foreach (IAssemblyReference reference in referencedAssemblies)
                         {
-                            string verString = await reference.Metadata.GetEvaluatedPropertyValueAsync("Version");
-                            assemblyList.Add((await reference.GetFullPathAsync(), $" v{verString}"));
+                            // load assembly to get the version
+                            var assembly = Assembly.LoadFrom(await reference.GetFullPathAsync()).GetName();
+                            assemblyList.Add((await reference.GetFullPathAsync(), $" v{assembly.Version.ToString(4)}"));
                         }

                         // loop through each project that is set to build
@@ -181,41 +182,13 @@
                         {
                             if (await project.GetReferenceOutputAssemblyAsync())
                             {
-                                string verString = await project.Metadata.GetEvaluatedPropertyValueAsync("Version");
+                                string referencedProjectAssemblyPath = await project.GetFullPathAsync();
+
+                                // load assembly to get the version
+                                var assembly = Assembly.LoadFrom(referencedProjectAssemblyPath).GetName();

                                 // add the referenced project output to the assembly list
-                                assemblyList.Add((await project.GetFullPathAsync(), $" v{verString}"));
-
-                                // get the referenced assemblies for this referenced project
-
-                                // need to reach the UnconfiguredProject using reflection
-
-                                // get the unresolved reference for this referenced project
-                                var unresolvedDependency = await Properties.ConfiguredProject.Services.ProjectReferences.GetUnresolvedReferenceAsync(project);
-
-                                // get the type info for the PropertiesContext
-                                var projectPropertiesContextType = unresolvedDependency.PropertiesContext.GetType().GetTypeInfo();
-                                // get the fields from the Type
-                                var fields = projectPropertiesContextType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
-
-                                // get FieldInfo for the 'project' field
-                                var projectField = fields.FirstOrDefault(propInfo => propInfo.Name == "project");
-
-                                // get the field value
-                                var projectValue = projectField.GetValue(unresolvedDependency.PropertiesContext);
-
-                                // load the configured project for this referenced project
-                                var configuredProject = await ((UnconfiguredProject)projectValue).GetSuggestedConfiguredProjectAsync();
-
-                                // get the resolved references for the referenced project
-                                var referencedProjectReferencedAssemblies = await configuredProject.Services.AssemblyReferences.GetResolvedReferencesAsync();
-
-                                // add those to the assembly list
-                                foreach (IAssemblyReference reference in referencedProjectReferencedAssemblies)
-                                {
-                                    string versionString = await reference.Metadata.GetEvaluatedPropertyValueAsync("Version");
-                                    assemblyList.Add((await reference.GetFullPathAsync(), $" v{versionString}"));
-                                }
+                                assemblyList.Add((referencedProjectAssemblyPath, $" v{assembly.Version.ToString(4)}"));
                             }
                         }


Parser Updated

Parser Updated

--- TeamX/Documenten/ParserScrumProject/ParserScrumProject/Form1.cs
+++ TeamX/Documenten/ParserScrumProject/ParserScrumProject/Form1.cs
@@ -57,6 +57,8 @@

         private void button2_Click(object sender, EventArgs e)
         {
+            richTextBox1.Text = null;
+            progressBar1.Value = 0;
             OpenFileDialog openFileDialog1 = new OpenFileDialog();
             openFileDialog1.Filter = "Text|*.txt|All|*.*";
             if (openFileDialog1.ShowDialog() == DialogResult.OK)