Refactor Package code

Refactor Package code

--- VSPerformanceTracker/VsPerformanceTrackerPackage.cs
+++ VSPerformanceTracker/VsPerformanceTrackerPackage.cs
@@ -23,40 +23,47 @@
     {
         private BuildListener _buildListener;
         private SolutionLoadListener _solutionLoadListener;
-        private ISolutionInfoQueryer _solutionQueryer;

         protected override void Initialize()
         {
             base.Initialize();

-            var solutionService = (IVsSolution) GetService(typeof (SVsSolution));
-            var buildManager = (IVsSolutionBuildManager) GetService(typeof (SVsSolutionBuildManager));
-            var buildManager5 = (IVsSolutionBuildManager5) GetService(typeof (SVsSolutionBuildManager));
+            StartLogging(StartEventListeners());
+        }

-            _solutionQueryer = new SolutionInfoQueryer(solutionService);
-
-            var events = Observable.Merge(new []
-            {
-                ListenForBuildEvents(buildManager, buildManager5),
-                ListenForSolutionLoadEvents(solutionService),
-            });
-
+        private void StartLogging(IObservable<PerformanceEvent> events)
+        {
             var logFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "build-log.csv");

             PerformanceEventLogger.Run(events, new AppendableFile(logFile));
         }

-        private IObservable<PerformanceEvent> ListenForSolutionLoadEvents(IVsSolution solutionService)
+        private IObservable<PerformanceEvent> StartEventListeners()
+        {
+            var solutionService = (IVsSolution)GetService(typeof(SVsSolution));
+            var solutionQueryer = new SolutionInfoQueryer(solutionService);
+
+            var buildManager = (IVsSolutionBuildManager)GetService(typeof(SVsSolutionBuildManager));
+            var buildManager5 = (IVsSolutionBuildManager5)GetService(typeof(SVsSolutionBuildManager));
+
+            return Observable.Merge(new[]
+            {
+                ListenForSolutionLoadEvents(solutionService, solutionQueryer),
+                ListenForBuildEvents(solutionQueryer, buildManager, buildManager5),
+            });
+        }
+
+        private IObservable<PerformanceEvent> ListenForSolutionLoadEvents(IVsSolution solutionService, SolutionInfoQueryer solutionQueryer)
         {
             _solutionLoadListener = new SolutionLoadListener(solutionService);
-            var solutionLoadTransformer = new SolutionLoadToPerformanceEventTransformer(_solutionQueryer);
+            var solutionLoadTransformer = new SolutionLoadToPerformanceEventTransformer(solutionQueryer);
             return _solutionLoadListener.LoadFinished.Select(solutionLoadTransformer.Transform);
         }

-        private IObservable<PerformanceEvent> ListenForBuildEvents(IVsSolutionBuildManager buildManager, IVsSolutionBuildManager5 buildManager5)
+        private IObservable<PerformanceEvent> ListenForBuildEvents(SolutionInfoQueryer solutionQueryer, IVsSolutionBuildManager buildManager, IVsSolutionBuildManager5 buildManager5)
         {
             _buildListener = new BuildListener(buildManager, buildManager5);
-            var buildTransformer = new BuildToPerformanceEventTransformer(_solutionQueryer);
+            var buildTransformer = new BuildToPerformanceEventTransformer(solutionQueryer);
             return _buildListener.LoadFinished.Select(buildTransformer.Transform);
         }

@@ -68,8 +75,12 @@
         protected override void Dispose(bool disposing)
         {
             base.Dispose(disposing);
-            _buildListener.Dispose();
-            _solutionLoadListener.Dispose();
+
+            if (_buildListener != null)
+                _buildListener.Dispose();
+
+            if (_solutionLoadListener != null)
+                _solutionLoadListener.Dispose();
         }
     }
 }


[VsIntegration] Fix type after refactoring

--- VisualStudio/ProjectPackage/XSharpProjectPackage.cs
+++ VisualStudio/ProjectPackage/XSharpProjectPackage.cs
@@ -447,7 +447,7 @@
         }
         public void SetCommentTokens()
         {
-            var commentTokens = taskList.CommentTokens;
+            var commentTokens = _taskList.CommentTokens;
             var tokens = new List< XSharpModel.XCommentToken>();
             foreach (var token in commentTokens)
             {


distance to view planet now depending on size of the planet

--- Visualizer/Assets/CustomScripts/RayCastToPlanets.cs
+++ Visualizer/Assets/CustomScripts/RayCastToPlanets.cs
@@ -189,6 +189,11 @@
         priv_indicator.SetActive(false);
         cam.GetComponent<SGT_CameraFreeLook>().enabled = false;
         cam.GetComponent<SGT_CameraFreeOrbit>().enabled = true;
+        float avgScale = (float)((planet.gameObject.transform.localScale.x + planet.gameObject.transform.localScale.y + planet.gameObject.transform.localScale.z) / 3.0);
+        cam.GetComponent<SGT_CameraFreeOrbit>().Distance = (float)(avgScale + avgScale);
+        print(cam.GetComponent<SGT_CameraFreeOrbit>().Distance);
+        cam.GetComponent<SGT_CameraFreeOrbit>().DistanceMin = cam.GetComponent<SGT_CameraFreeOrbit>().Distance;
+        cam.GetComponent<SGT_CameraFreeOrbit>().DistanceMax = cam.GetComponent<SGT_CameraFreeOrbit>().Distance;
         cam.transform.LookAt(planet.transform);
         planetLookedAt = planet;
 //        cam.transform.position = cam.transform.position + (cam.transform.forward * (cam.transform.DistanceTo(planet.transform.position) - 1000));


Quick fix for crash when skilling tagged nodes.  - All Ascendancy nodes are ignored for now. Should probably also disable tagging them?

--- WPFSKillTree/TreeGenerator/Solver/AbstractSolver.cs
+++ WPFSKillTree/TreeGenerator/Solver/AbstractSolver.cs
@@ -369,7 +369,9 @@
                             // Only add nodes in the subsettree if one is given.
                             || Settings.SubsetTree.Count > 0 && !Settings.SubsetTree.Contains(node.Id)
                             // Mastery nodes are obviously not useful.
-                            || node.IsMastery)
+                            || node.IsMastery
+                            // Ignore ascendancies for now
+                            || node.ascendancyName != null)
                             continue;

                         if (IncludeNodeInSearchGraph(node))


Applied minor fix to new device mapping

Applied minor fix to new device mapping

--- AdvertModule/AdvertHelper.cs
+++ AdvertModule/AdvertHelper.cs
@@ -81,13 +81,10 @@
                 deviceName = "samsung/sgh";
             }

-            deviceName = "nokia/c3";
-
             string strOpenxUrl = AdvertConfig.OpenX_URL + openXAdUnitToUse;
             string strUserDetails = "&" + "c.device=" + deviceName + "&" + "c.age=" + userAge + "&" + "c.gender=" + userGenderType + "&" + "xid=" + MxitUserID + "&" + "c.screensize=" + displayWidth + "x" + displayHeight;
-            //string strCompleteUrl = strOpenxUrl + strUserDetails;
             string strCompleteUrl = strOpenxUrl + strUserDetails;
-            //string strCompleteUrl = strOpenxUrl + Uri.EscapeDataString(strUserDetails);
+
             //use the complete url on a mobile
             HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strCompleteUrl);


Update Program.cs

Update Program.cs

--- Agenda.ConsoleApp/Program.cs
+++ Agenda.ConsoleApp/Program.cs
@@ -72,7 +72,7 @@
             }
             catch (Exception ex)
             {
-                Console.WriteLine(string.Format("Ocorreu um erro durante a incialização! M_otivo: {0}", ex.Message));
+                Console.WriteLine(string.Format("Ocorreu um erro durante a incialização! Motivo: {0}", ex.Message));
             }
         }


BasketMessageAdapter. Fix process subscription for multi-connections.

--- Algo/BasketMessageAdapter.cs
+++ Algo/BasketMessageAdapter.cs
@@ -1590,27 +1590,23 @@

 			lock (_connectedResponseLock)
 			{
-				if (error != null)
-				{
-					if (!HasPendingAdapters())
-					{
-						notSupportedMsgs = _pendingMessages.ToArray();
-						_pendingMessages.Clear();
-					}
-				}
-				else
+				if (error == null)
 				{
 					foreach (var supportedMessage in innerAdapter.SupportedInMessages)
-					{
 						_messageTypeAdapters.SafeAdd(supportedMessage).Add(wrapper);
-					}
-
-					extra.AddRange(_pendingMessages.Select(m => m.LoopBack(this)));
-
-					_pendingMessages.Clear();
 				}

 				UpdateAdapterState(underlyingAdapter, true, error, extra);
+
+				if (!HasPendingAdapters())
+				{
+					var pending = _pendingMessages.CopyAndClear();
+
+					if (_adapterStates.Any(p => p.Value.Item1 == ConnectionStates.Connected))
+						extra.AddRange(pending.Select(m => m.LoopBack(this)));
+					else
+						notSupportedMsgs = pending;
+				}
 			}

 			if (notSupportedMsgs != null)
@@ -1796,21 +1792,21 @@
 					_subscription.Remove(originMsg.OriginalTransactionId);
 			}

-			if (message.IsNotSupported() && originMsg is MarketDataMessage mdMsg)
+			if (message.IsNotSupported() && originMsg is ISubscriptionMessage subscrMsg)
 			{
 				lock (_connectedResponseLock)
 				{
 					// try loopback only subscribe messages
-					if (mdMsg.IsSubscribe)
+					if (subscrMsg.IsSubscribe)
 					{
 						var set = _nonSupportedAdapters.SafeAdd(originalTransactionId, k => new HashSet<IMessageAdapter>());
 						set.Add(GetUnderlyingAdapter(adapter));

-						mdMsg.LoopBack(this);
+						subscrMsg.LoopBack(this);
 					}
 				}

-				return mdMsg;
+				return (Message)subscrMsg;
 			}

 			return message;


slight code tweaks

slight code tweaks

--- AllColors/MainWindow.xaml.cs
+++ AllColors/MainWindow.xaml.cs
@@ -60,7 +60,7 @@

 			var title = window1.Title;
 			cancel = false;
-			List<(byte x, byte y)> startCoords = new List<(byte x, byte y)>();
+			var startCoords = new List<(byte x, byte y)>();
 			switch (e)
 			{
 				case MouseEventArgs me:
@@ -220,8 +220,6 @@

 					if (front.Count == 1)
 						return front.First();
-
-					var distList = new List<(float fitness, byte x, byte y)>(front.Count);

 					(int n, float dist) GetFitness((byte x, byte y) checkCoord, (int n, float dist) stat)
 					{
@@ -275,8 +273,9 @@
 				}

 				//put the first pixel in the center, then fit everything else accordingly
-				var timer = new Stopwatch();
-				timer.Start();
+				var targetFps = 60.0;
+				var targetFrameTime = 1000.0 / targetFps;
+				var timer = Stopwatch.StartNew();
 				for (var i = 0; i < startCoords.Count; i++)
 					PutPixel(startCoords[i], randomColors[i]);
 				Update();
@@ -286,14 +285,15 @@
 				{
 					//PutPixel(FindBestFitness(randomColors[idx]), randomColors[idx]);
 					PutPixel(FindBestFitnessWeighted(randomColors[idx]), randomColors[idx]);
-					if (/*idx % 1000 == 0 &&*/ timer.Elapsed.TotalMilliseconds >= 1000.0/60.0)
-					{
+					if (timer.Elapsed.TotalMilliseconds >= targetFrameTime)
+					{
+						timer.Restart();
 						Update();
 						window1.Title = $"{title} ({100.0 * idx / randomColors.Length:0.00}%)";
-						DoEvents();
 						if (cancel)
 							break;
-						timer.Restart();
+						DoEvents();
+
 					}
 				}
 				timer.Reset();
@@ -310,16 +310,14 @@
 		[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
 		public void DoEvents()
 		{
-			DispatcherFrame frame = new DispatcherFrame();
-			Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
-				new DispatcherOperationCallback(ExitFrame), frame);
+			var frame = new DispatcherFrame();
+			Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(ExitFrame), frame);
 			Dispatcher.PushFrame(frame);
 		}

 		public object ExitFrame(object f)
 		{
 			((DispatcherFrame)f).Continue = false;
-
 			return null;
 		}


fixed units view

fixed units view

--- Antd/Views/page-units.cshtml
+++ Antd/Views/page-units.cshtml
@@ -71,10 +71,10 @@
                     <td>@unit.name </td>
                     <td>@unit.status </td>
                     <td>
-                        <input type="button" class="bg-yellow unit-start" data-unit="@unit.name" value="Start" />
-                        <input type="button" class="bg-yellow unit-stop" data-unit="@unit.name" value="Stop" />
-                        <input type="button" class="bg-yellow unit-enable" data-unit="@unit.name" value="Enable" />
-                        <input type="button" class="bg-yellow unit-disable" data-unit="@unit.name" value="Disable" />
+                        <input type="button" class="bg-anthilla-green unit-start" data-unit="@unit.name" value="Start" />
+                        <input type="button" class="bg-anthilla-green unit-stop" data-unit="@unit.name" value="Stop" />
+                        <input type="button" class="bg-anthilla-green unit-enable" data-unit="@unit.name" value="Enable" />
+                        <input type="button" class="bg-anthilla-green unit-disable" data-unit="@unit.name" value="Disable" />
                     </td>
                 </tr>
             }


improved RAM info

improved RAM info

--- AppMetrics.Client/Tracker.cs
+++ AppMetrics.Client/Tracker.cs
@@ -271,8 +271,10 @@
 		private void ReportPeriodicInfo()
 		{
 			var workingSet = ToMegabytes((ulong)Process.GetCurrentProcess().WorkingSet64);
-
-			Log("Client_CurrentWorkingSet", workingSet);
+			Log("Client_WorkingSet", workingSet);
+
+			var privateMemorySize = ToMegabytes((ulong)Process.GetCurrentProcess().PrivateMemorySize64);
+			Log("Client_PrivateMemorySize", privateMemorySize);

 			var computerInfo = new ComputerInfo();


refactoring

refactoring

--- AppMetrics.Client/Tracker.cs
+++ AppMetrics.Client/Tracker.cs
@@ -34,11 +34,11 @@

 		public void Dispose()
 		{
-			lock (Sync)
-			{
-				Sessions.Remove(this);
-			}
-		}
+			Log("SessionFinished", null, MessagePriority.High);
+			_disposed = true;
+		}
+
+		private volatile bool _disposed;

 		static Tracker()
 		{
@@ -55,9 +55,9 @@
 			{
 				foreach (var session in Sessions)
 				{
-					session.Log("SessionFinished", null, MessagePriority.High);
-				}
-			}
+					session.Dispose();
+				}
+			}

 			_terminated = true;
 			var period = waitAll ? Timeout.Infinite : 5 * 1000;
@@ -66,11 +66,7 @@

 			lock (Sync)
 			{
-				var sessionsTmp = new HashSet<Tracker>(Sessions);
-				foreach (var session in sessionsTmp)
-				{
-					session.Dispose();
-				}
+				Sessions.Clear();
 			}
 		}

@@ -167,6 +163,8 @@

 		private void AddMessage(string name, string val, MessagePriority priority)
 		{
+			if (_disposed)
+				throw new ObjectDisposedException("Tracker");
 			if (_terminated)
 				return;

@@ -219,6 +217,14 @@
 			foreach (var session in sessions)
 			{
 				session.SendMessages();
+
+				if (session._disposed)
+				{
+					lock (Sync)
+					{
+						Sessions.Remove(session);
+					}
+				}
 			}
 		}


Add a OnInventoryItemReceived event.  Example and documentation available at http://code.google.com/p/libsl-ia-samples/

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@875 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife-cs/InventorySystem/InventoryManager.cs
+++ libsecondlife-cs/InventorySystem/InventoryManager.cs
@@ -80,7 +80,10 @@
         /// <param name="InventoryFolder">The Inventory Folder that was updated</param>
         /// <param name="e"></param>
         public delegate void On_RequestDownloadContents_Finished(object iFolder, EventArgs e);
-        public event On_RequestDownloadContents_Finished RequestDownloadFinishedEvent;
+        public event On_RequestDownloadContents_Finished OnRequestDownloadFinishedEvent;
+
+        public delegate void On_InventoryItemReceived(LLUUID fromAgentID, string fromAgentName, uint parentEstateID, LLUUID regionID, LLVector3 position, DateTime timestamp, InventoryItem item);
+        public event On_InventoryItemReceived OnInventoryItemReceived;

         /// <summary>
         /// Primary constructor
@@ -102,6 +105,8 @@
             // Setup the callback for Inventory Creation Update
             slClient.Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, new NetworkManager.PacketCallback(UpdateCreateInventoryItemHandler));

+            // Lets listen for inventory being given to us
+            slClient.Self.OnInstantMessage += new MainAvatar.InstantMessageCallback(Self_OnInstantMessage);
         }

         #region State Management
@@ -724,15 +729,60 @@

         protected void FireRequestDownloadFinishedEvent(object o, EventArgs e)
         {
-            if (RequestDownloadFinishedEvent != null)
-            {
-                RequestDownloadFinishedEvent(o, e);
+            if (OnRequestDownloadFinishedEvent != null)
+            {
+                OnRequestDownloadFinishedEvent(o, e);
             }
         }

         #endregion

         #region libsecondlife callback handlers
+
+        void Self_OnInstantMessage(LLUUID fromAgentID, string fromAgentName, LLUUID toAgentID, uint parentEstateID, LLUUID regionID, LLVector3 position, byte dialog, bool groupIM, LLUUID imSessionID, DateTime timestamp, string message, byte offline, byte[] binaryBucket)
+        {
+            if ( (dialog == (byte)MainAvatar.InstantMessageDialog.GiveInventory) && (OnInventoryItemReceived != null))
+            {
+                sbyte IncomingItemType = (sbyte)binaryBucket[0];
+                LLUUID IncomingItemID = new LLUUID(binaryBucket, 1);
+
+                // Update root folders
+                InventoryFolder root = GetRootFolder();
+                if (root.GetContents().Count == 0)
+                {
+                    root.RequestDownloadContents(false, true, false, false).RequestComplete.WaitOne(3000, false);
+                }
+
+                // Look for root folder that accepts the type of inventory being received.
+                foreach (InventoryBase ib in root.GetContents())
+                {
+                    if (ib is InventoryFolder)
+                    {
+                        InventoryFolder iFolder = (InventoryFolder)ib;
+                        if (iFolder.Type == IncomingItemType)
+                        {
+                            // Check folder for incoming item
+                            iFolder.RequestDownloadContents(false, false, true, false).RequestComplete.WaitOne(3000, false);
+                            foreach (InventoryBase ib2 in iFolder.GetContents())
+                            {
+                                if (ib2 is InventoryItem)
+                                {
+                                    InventoryItem iItem = (InventoryItem)ib2;
+
+                                    if (iItem.ItemID == IncomingItemID)
+                                    {
+                                        OnInventoryItemReceived(fromAgentID, fromAgentName, parentEstateID, regionID, position, timestamp, iItem);
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+

         /// <summary>
         /// This is called in response to an item creation request
@@ -887,8 +937,6 @@
                     // See if the Incoming Folder already exists locally
                     if (FoldersByUUID.ContainsKey(IncomingFolderID))
                     {
-                        Console.WriteLine("Updating existing folder entry.");
-
                         InventoryFolder existingFolder = FoldersByUUID[IncomingFolderID];
                         existingFolder._Name = IncomingName;
                         existingFolder._Type = IncomingType;
@@ -896,7 +944,6 @@
                         // Check if parent of existing is the same as the incoming
                         if (!existingFolder.ParentID.Equals(IncomingParentID))
                         {
-                            Console.WriteLine("* New Parent :: " + existingFolder.ParentID + " != " + IncomingParentID);
                             // Remove existing from old parent
                             if (FoldersByUUID.ContainsKey(existingFolder.ParentID))
                             {
@@ -923,7 +970,7 @@
                     }
                     else
                     {
-                        InventoryFolder TempInvFolder = new InventoryFolder(this, IncomingName, IncomingFolderID, IncomingParentID);
+                        InventoryFolder TempInvFolder = new InventoryFolder(this, IncomingName, IncomingFolderID, IncomingParentID, IncomingType);

                         // Add folder to Parent
                         if (InvFolderUpdating._Contents.Contains(TempInvFolder) == false)
@@ -977,7 +1024,7 @@
                 // remove from folder status.
                 FolderDownloadStatus.Remove(uuidFolderID);
                 dr.RequestComplete.Set();
-                if (RequestDownloadFinishedEvent != null)
+                if (OnRequestDownloadFinishedEvent != null)
                 {
                     DownloadRequest_EventArgs e = new DownloadRequest_EventArgs();
                     e.DownloadRequest = dr;


Use field values to create default pipeline in client options

--- Azuria/ProxerClientOptions.cs
+++ Azuria/ProxerClientOptions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using Azuria.Authentication;
 using Azuria.Helpers;
@@ -145,13 +145,13 @@
             return this;
         }

-        private static IPipeline CreateDefaultPipeline(char[] apiKey, IProxerClient client)
+        private IPipeline CreateDefaultPipeline(char[] apiKey, IProxerClient client)
         {
             var middlewares = new List<IMiddleware>
             {
                 new StaticHeaderMiddleware(CreateDefaultHeaders(apiKey)), // First to start execution
                 new ErrorMiddleware(),
-                new HttpJsonRequestMiddleware(new HttpClient(), new JsonDeserializer()) // Last to start execution
+                new HttpJsonRequestMiddleware(this._httpClient, this._jsonDeserializer) // Last to start execution
             };

             return new Pipeline(middlewares);


Reorganise Parameter and Setting attributes into class hierarchy

--- src/command/Attributes.cs
+++ src/command/Attributes.cs
@@ -24,6 +24,7 @@
     }

+
     /// </summary>
     /// Define an attribute that can be used to tag a method, property, or
     /// constructor as a source of new instances of the class returned by
@@ -36,6 +37,7 @@
     public class FactoryAttribute : Attribute
     {
     }
+

     /// </summary>
@@ -52,52 +54,40 @@
     }

+
     /// <summary>
-    /// Used to define the possible settings that can appear in an
-    /// ISettingsCollection subclass. These often change between versions, so
-    /// Since and Deprecated arguments are supported.
+    /// Abstract base class for Parameter and Setting attributes.
     /// </summary>
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-    public class SettingAttribute : Attribute, ISetting
+    public abstract class AbstractSettingAttribute : Attribute
     {
-        /// Name of the setting
-        public string Name { get; set; }
+        protected object _defaultValue = null;
+        protected bool   _hasDefaultValue = false;
+
         /// Description of the setting
         public string Description { get; set; }
-        /// The Type of value which the setting accepts
-        public Type ParameterType { get; set; }
+        /// Whether the parameter has a DefaultValue (since the default may be null)
+        public bool   HasDefaultValue { get { return _hasDefaultValue; } }
+        /// Default value for parameter
+        public object DefaultValue {
+            get {
+                return _defaultValue;
+            }
+            set {
+                _defaultValue = value;
+                _hasDefaultValue = true;
+            }
+        }
+        /// Whether the setting has a DefaultValue; settings default to true
+        public bool   IsSensitive { get; set; }
         /// The constant prefix of all values in the enum which can be omitted
         public string EnumPrefix { get; set; }
-        /// Whether the setting is sensitive, and should be masked
-        public bool IsSensitive { get; set; }
-        /// Whether the setting has a DefaultValue; settings default to true
-        public bool HasDefaultValue { get; set; }
-        /// Default value for setting (may be null, even if this is not the
-        /// default)
-        // TODO: Do we need another field to indicate if default is available?
-        public object DefaultValue { get; set; }
-        /// Version in which the setting was introduced
-        public string Since { get; set; }
-        /// Version in which the setting was deprecated
-        public string Deprecated { get; set; }

-        public SettingAttribute()
-        {
-            ParameterType = typeof(bool);
-            HasDefaultValue = true;
-        }
-
-        public SettingAttribute(string name)
-        {
-            Name = name;
-            ParameterType = typeof(bool);
-            HasDefaultValue = true;
-        }
     }

+
     /// <summary>
-    /// Define an attribute which will be used to specify additional parameter
+    /// Define an attribute which will be used to specify command parameter
     /// information, such as default values, sensitive flags, enum prefixes,
     /// etc.
     /// </summary>
@@ -108,28 +98,39 @@
     /// they can appear (only at the end of the list of parameters).
     /// </remarks>
     [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
-    public class ParameterAttribute : Attribute
+    public class ParameterAttribute : AbstractSettingAttribute
     {
-        private object _defaultValue = null;
-        private bool   _hasDefaultValue = false;
-
-        public string Description { get; set; }
-        public bool   HasDefaultValue { get { return _hasDefaultValue; } }
-        public object DefaultValue {
-            get {
-                return _defaultValue;
-            }
-            set {
-                _defaultValue = value;
-                _hasDefaultValue = true;
-            }
-        }
-        public bool   IsSensitive { get; set; }
-        public string EnumPrefix { get; set; }
-
         public ParameterAttribute(string desc) {
             Description = desc;
         }
     }

+
+
+    /// <summary>
+    /// Used to define the possible settings that can appear in an
+    /// ISettingsCollection subclass. These often change between versions, so
+    /// Since and Deprecated arguments are supported.
+    /// </summary>
+    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+    public class SettingAttribute : AbstractSettingAttribute, ISetting
+    {
+        /// Name of the setting
+        public string Name { get; set; }
+        /// The Type of value which the setting accepts
+        public Type ParameterType { get; set; }
+        /// Version in which the setting was introduced
+        public string Since { get; set; }
+        /// Version in which the setting was deprecated
+        public string Deprecated { get; set; }
+
+
+        public SettingAttribute(string name)
+        {
+            Name = name;
+            ParameterType = typeof(bool);
+            _hasDefaultValue = true;
+        }
+    }
+
 }


Add support for [CheckDisposed]

Add support for [CheckDisposed]

--- src/generator.cs
+++ src/generator.cs
@@ -287,6 +287,20 @@
 	public PlainStringAttribute () {}
 }

+// When applied, the generator generates a check for the Handle being valid on the main object, to
+// ensure that the user did not Dispose() the object.
+//
+// This is typically used in scenarios where the user might be tempted to dispose
+// the object in a callback:
+//
+//     foo.FinishedDownloading += delegate { foo.Dispose (); }
+//
+// This would invalidate "foo" and force the code to return to a destroyed/freed
+// object
+public class CheckDisposedAttribute : Attribute {
+	public CheckDisposedAttribute () {}
+}
+
 //
 // When applied, instructs the generator to use this object as the
 // target, instead of the implicit Handle Can only be used in methods
@@ -1163,7 +1177,7 @@
 						if (mi.DeclaringType == t)
 							need_abstract [t] = true;
 						continue;
-					} else if (attr is SealedAttribute || attr is EventArgsAttribute || attr is DelegateNameAttribute || attr is EventNameAttribute || attr is DefaultValueAttribute || attr is ObsoleteAttribute || attr is AlphaAttribute || attr is DefaultValueFromArgumentAttribute || attr is NewAttribute || attr is SinceAttribute || attr is PostGetAttribute || attr is NullAllowedAttribute)
+					} else if (attr is SealedAttribute || attr is EventArgsAttribute || attr is DelegateNameAttribute || attr is EventNameAttribute || attr is DefaultValueAttribute || attr is ObsoleteAttribute || attr is AlphaAttribute || attr is DefaultValueFromArgumentAttribute || attr is NewAttribute || attr is SinceAttribute || attr is PostGetAttribute || attr is NullAllowedAttribute || attr is CheckDisposedAttribute)
 						continue;
 					else
 						Console.WriteLine ("Error: Unknown attribute {0} on {1}", attr.GetType (), t);
@@ -2136,6 +2150,10 @@
 									print ("{0} = args.{1};", par.Name, GetPublicParameterName (par));
 								}
 							}
+							if (HasAttribute (mi, typeof (CheckDisposedAttribute))){
+								print ("if ({0}.Handle == IntPtr.Zero)", RenderArgs (pars.Take (1)));
+								print ("\tthrow new ObjectDisposedException (\"The object was disposed on the event, you should not call Dispose() inside the handler\");");
+							}
 							indent--;
 							print ("}");
 						} else {


added public value varibale to NamedOnnxValue (#3347)

Co-authored-by: cassieview <6a6304d68f4f262f6c3cd30f101b5dfda03ed0db@microsoft.com>

--- csharp/src/Microsoft.ML.OnnxRuntime/NamedOnnxValue.cs
+++ csharp/src/Microsoft.ML.OnnxRuntime/NamedOnnxValue.cs
@@ -29,6 +29,7 @@
         }

         public string Name { get { return _name; } set { _name = value; } }
+        public Object Value { get { return _value; } set { _value = value; } }

         /// <summary>
         /// Try-get value as a Tensor<T>.


Fix updated Doxygen errors. (#6588)

Fix updated Doxygen errors. (#6588)

--- csharp/src/Microsoft.ML.OnnxRuntime/Tensors/Tensor.cs
+++ csharp/src/Microsoft.ML.OnnxRuntime/Tensors/Tensor.cs
@@ -922,6 +922,12 @@
             return GetTriangle(offset, upper: true);
         }

+        /// <summary>
+        /// Implementation method for GetTriangle, GetLowerTriangle, GetUpperTriangle
+        /// </summary>
+        /// <param name="offset">Offset of diagonal to set in returned tensor.</param>
+        /// <param name="upper">true for upper triangular and false otherwise</param>
+        /// <returns></returns>
         public Tensor<T> GetTriangle(int offset, bool upper)
         {
             if (Rank < 2)
@@ -1158,8 +1164,16 @@
             }
         }

+        /// <summary>
+        /// Always fixed size Tensor
+        /// </summary>
+        /// <value>always true</value>
         public bool IsFixedSize => true;

+        /// <summary>
+        /// Tensor is not readonly
+        /// </summary>
+        /// <value>always false</value>
         public bool IsReadOnly => false;

         int IList.Add(object value)
@@ -1566,6 +1580,11 @@

         #endregion

+        /// <summary>
+        /// Get a string representation of Tensor
+        /// </summary>
+        /// <param name="includeWhitespace"></param>
+        /// <returns></returns>
         public string GetArrayString(bool includeWhitespace = true)
         {
             var builder = new StringBuilder();


Rename sensitive search phrase in one unit test.

--- test/Dialog.Test/PackagesSearchNodeTest.cs
+++ test/Dialog.Test/PackagesSearchNodeTest.cs
@@ -34,7 +34,7 @@
                 true,
                 supportsPrereleasePackages);

-            PackagesSearchNode node = CreatePackagesSearchNode("xxx", baseNode: baseNode);
+            PackagesSearchNode node = CreatePackagesSearchNode("yyy", baseNode: baseNode);

             // Act & Assert
             Assert.Equal(supportsPrereleasePackages, node.SupportsPrereleasePackages);


dispose the client after the disconnect event, so it does not call objectdisposed exceptions on getting objects properties

--- src/shawlib/Network/TcpClient.cs
+++ src/shawlib/Network/TcpClient.cs
@@ -53,11 +53,10 @@

         void onDisconnectEvent(Exception ex)
         {
+            var handler = OnDisconnect;
+            if (handler != null)
+                handler(this, new ExceptionEventArgs(ex));
             Disconnect();
-
-            var handler = OnDisconnect;
-            if (handler != null)
-                handler(this, new ExceptionEventArgs(ex));
         }

         void onReceiveEvent(byte[] bytes)


Deflecting a seeker always leads to a no-discs grace period.

--- ethernet/server/scripts/weapons/disc/disc.seeker.cs
+++ ethernet/server/scripts/weapons/disc/disc.seeker.cs
@@ -110,10 +110,9 @@
 function RedSeekerDisc::onDeflected(%this, %obj)
 {
     if(%obj.state() == $NortDisc::Attacking)
-    {
         %obj.getTarget().removeAttackingDisc(%obj);
-        %obj.getTarget().startNoDiscGracePeriod();
-    }
+
+    %obj.getTarget().startNoDiscGracePeriod();
 }

 function RedSeekerDisc::onHitTarget(%this, %obj)


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/ServerSslConfiguration.cs
+++ websocket-sharp/Net/ServerSslConfiguration.cs
@@ -56,12 +56,12 @@
     #region Public Constructors

     /// <summary>
-    /// Initializes a new instance of the <see cref="ServerSslConfiguration"/> class with
-    /// the specified <paramref name="serverCertificate"/>.
+    /// Initializes a new instance of the <see cref="ServerSslConfiguration"/> class
+    /// with the specified <paramref name="serverCertificate"/>.
     /// </summary>
     /// <param name="serverCertificate">
-    /// A <see cref="X509Certificate2"/> that represents the certificate used to authenticate
-    /// the server.
+    /// A <see cref="X509Certificate2"/> that represents an X.509 certificate
+    /// used to authenticate the server.
     /// </param>
     public ServerSslConfiguration (X509Certificate2 serverCertificate)
       : this (serverCertificate, false, SslProtocols.Default, false)


Return the global position instead the local position in GetActiveCheckPointPosition() function

--- Assets/Scripts/CheckPoint.cs
+++ Assets/Scripts/CheckPoint.cs
@@ -44,7 +44,7 @@
                 // We search the activated checkpoint to get its position
                 if (cp.GetComponent<CheckPoint>().Activated)
                 {
-                    result = cp.transform.localPosition;
+                    result = cp.transform.position;
                     break;
                 }
             }


Put exit triggers in yellow

Put exit triggers in yellow

--- Assets/Scripts/RoomLoader.cs
+++ Assets/Scripts/RoomLoader.cs
@@ -234,9 +234,13 @@
 				box.ID = ReadShort(allPointsA[i + 12], allPointsA[i + 13]);
 				box.Flags = ReadShort(allPointsA[i + 14], allPointsA[i + 15]);

-				if (box.Flags == 9 || box.Flags == 10) //custom trigger or exit
+				if (box.Flags == 9) //custom trigger
 				{
 					box.Color = new Color32(255, 128, 0, 50);
+				}
+				else if (box.Flags == 10) //exit
+				{
+					box.Color = new Color32(255, 255, 50, 100);
 				}
 				else if (box.Flags == 0) //room switch
 				{


refactored StickyNote content preview setter and duplicatable way of checking

--- Assets/Scripts/StickyNote.cs
+++ Assets/Scripts/StickyNote.cs
@@ -18,11 +18,13 @@
         }
     }

+    private bool _isDuplicatable = true;
     private Duplicatable _duplicatable;
     private TapToPlaceOnBoard _tapToPlaceOnBoard;
     private InteractibleAction _interactibleAction;
     private TextMesh _textMesh;
     private string _content;
+    private const int LINE_BUFFER = 5;

     void Start()
     {
@@ -47,28 +49,25 @@

     public void Duplicate()
     {
-        if (CanDuplicate())
+        if (_isDuplicatable)
+        {
+            _isDuplicatable = false;
             _duplicatable.Duplicate();
-    }
-
-    private bool CanDuplicate()
-    {
-        return (_tapToPlaceOnBoard.IsPlacingMode() || WasMoved()) == false;
-
-    }
-
-    private bool WasMoved()
-    {
-        return gameObject.transform.localPosition.Equals(new Vector3(0, 0, 0)) == false;
+        }
     }

     private void SetContentPreview()
     {
-        var preview = _content.Split(' ')[0];
-        if (preview.Length > 5)
+        var preview = _content.Trim();
+        if (_content.Length > LINE_BUFFER)
         {
-            preview = preview.Substring(0, 5);
+            preview = preview.Split(' ')[0];
+            if (preview.Length > LINE_BUFFER)
+            {
+                preview = preview.Substring(0, LINE_BUFFER);
+            }
+            preview = preview + "...";
         }
-        _textMesh.text = preview + "...";
+        _textMesh.text = preview;
     }
 }


Life UI ceil instead of cast to int

Life UI ceil instead of cast to int

--- Assets/Scripts/UI/LifeBar.cs
+++ Assets/Scripts/UI/LifeBar.cs
@@ -28,7 +28,7 @@
     void Update () {
         if(player != null) {
             lifeBar.value = player.currentLife / player.maxLife;
-            text.text = Mathf.Max((int)(player.currentLife), 0) + "/" + ((int)player.maxLife);
+            text.text = Mathf.Max(Mathf.Ceil(player.currentLife), 0) + "/" + Mathf.Ceil(player.maxLife);
         }
 	}
 }


fix complex method(visual studio didn't save my work?!)

--- osu.Framework.Android/Input/AndroidInputConnection.cs
+++ osu.Framework.Android/Input/AndroidInputConnection.cs
@@ -28,21 +28,11 @@

         static readonly Dictionary<char, Keycode> charToKeycodeMap = new Dictionary<char, Keycode>
         {
-            { '+',  Keycode.Plus},
-                { '-',  Keycode.Minus},
-                { '*',  Keycode.Star},
-                { '/',  Keycode.Slash},
-                { '=',  Keycode.Equals},
-                { '@',  Keycode.At},
-                { '#',  Keycode.Pound},
-                { '\'',  Keycode.Apostrophe},
-                { '.',  Keycode.Period},
-                { '[',  Keycode.LeftBracket},
-                { ']',  Keycode.RightBracket},
-                { ';',  Keycode.Semicolon},
-                { '`',  Keycode.Grave},
-                { ' ',  Keycode.Space},
-                { ',',  Keycode.Comma},
+            { '+', Keycode.Plus }, { '-', Keycode.Minus }, { '*', Keycode.Star },
+            { '/', Keycode.Slash }, { '=', Keycode.Equals }, { '@', Keycode.At },
+            { '#', Keycode.Pound }, { '\'', Keycode.Apostrophe }, { '.', Keycode.Period },
+            { '[', Keycode.LeftBracket }, { ']', Keycode.RightBracket }, { ';', Keycode.Semicolon },
+            { '`', Keycode.Grave }, { ' ', Keycode.Space }, { ',', Keycode.Comma }
         };

         public AndroidGameView TargetView { get; set; }
@@ -131,25 +121,7 @@

         private static Keycode parseSymbolCharToKeycode(char c)
         {
-            switch (c)
-            {
-                case '+': return Keycode.Plus;
-                case '-': return Keycode.Minus;
-                case '*': return Keycode.Star;
-                case '/': return Keycode.Slash;
-                case '=': return Keycode.Equals;
-                case '@': return Keycode.At;
-                case '#': return Keycode.Pound;
-                case '\'': return Keycode.Apostrophe;
-                case '.': return Keycode.Period;
-                case '[': return Keycode.LeftBracket;
-                case ']': return Keycode.RightBracket;
-                case ';': return Keycode.Semicolon;
-                case '`': return Keycode.Grave;
-                case ' ': return Keycode.Space;
-                case ',': return Keycode.Comma;
-                default: return Keycode.Unknown;
-            }
+            return charToKeycodeMap.ContainsKey(c) ? charToKeycodeMap[c] : Keycode.Unknown;
         }

         public static bool NeedShiftPress(char c)


Make VertexBuffer.Stride readonly.

Make VertexBuffer.Stride readonly.

--- osu.Framework/Graphics/OpenGL/Buffers/VertexBuffer.cs
+++ osu.Framework/Graphics/OpenGL/Buffers/VertexBuffer.cs
@@ -92,7 +92,7 @@

         protected abstract PrimitiveType Type { get; }

-        protected static int Stride = VertexUtils<T>.Stride;
+        protected static readonly int Stride = VertexUtils<T>.Stride;

         public void Draw()
         {


`EditorBeatmap.SelectedHitObjects` -> `SelectedItems` (same thing)

--- osu.Game.Rulesets.Catch/Edit/CatchSelectionHandler.cs
+++ osu.Game.Rulesets.Catch/Edit/CatchSelectionHandler.cs
@@ -30,7 +30,7 @@
             Vector2 targetPosition = HitObjectContainer.ToLocalSpace(blueprint.ScreenSpaceSelectionPoint + moveEvent.ScreenSpaceDelta);

             float deltaX = targetPosition.X - originalPosition.X;
-            deltaX = limitMovement(deltaX, EditorBeatmap.SelectedHitObjects);
+            deltaX = limitMovement(deltaX, SelectedItems);

             if (deltaX == 0)
             {
@@ -54,7 +54,7 @@

         public override bool HandleFlip(Direction direction)
         {
-            var selectionRange = CatchHitObjectUtils.GetPositionRange(EditorBeatmap.SelectedHitObjects);
+            var selectionRange = CatchHitObjectUtils.GetPositionRange(SelectedItems);

             bool changed = false;
             EditorBeatmap.PerformOnSelection(h =>
@@ -69,8 +69,8 @@
         {
             base.OnSelectionChanged();

-            var selectionRange = CatchHitObjectUtils.GetPositionRange(EditorBeatmap.SelectedHitObjects);
-            SelectionBox.CanFlipX = selectionRange.Length > 0 && EditorBeatmap.SelectedHitObjects.Any(h => h is CatchHitObject && !(h is BananaShower));
+            var selectionRange = CatchHitObjectUtils.GetPositionRange(SelectedItems);
+            SelectionBox.CanFlipX = selectionRange.Length > 0 && SelectedItems.Any(h => h is CatchHitObject && !(h is BananaShower));
         }

         /// <summary>


Fix a few xmldoc typos

Fix a few xmldoc typos

--- osu.Game/Rulesets/Mods/ModWithVisibilityAdjustment.cs
+++ osu.Game/Rulesets/Mods/ModWithVisibilityAdjustment.cs
@@ -34,18 +34,18 @@
         protected virtual bool IsFirstAdjustableObject(HitObject hitObject) => true;

         /// <summary>
-        /// Apply a special increased-visibility state to the first adjustable object..
+        /// Apply a special increased-visibility state to the first adjustable object.
         /// Only applicable if the user chooses to turn on the "increase first object visibility" setting.
         /// </summary>
         /// <param name="hitObject">The hit object to apply the state change to.</param>
-        /// <param name="state">The state of the hit object.</param>
+        /// <param name="state">The state of the hitobject.</param>
         protected abstract void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state);

         /// <summary>
         /// Apply a normal visibility state adjustment to an object.
         /// </summary>
         /// <param name="hitObject">The hit object to apply the state change to.</param>
-        /// <param name="state">The state of the hit object.</param>
+        /// <param name="state">The state of the hitobject.</param>
         protected abstract void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state);

         public virtual void ReadFromConfig(OsuConfigManager config)


Documented LifoEvents<T> in the same way as FifoEvents<T> has been documented in commit URL: https://github.com/GreanTech/AtomEventStore/blob/406feb1dc645a4e59abeedb49d65db175d4dd5ed/AtomEventStore/FifoEvents.cs.

--- AtomEventStore/LifoEvents.cs
+++ AtomEventStore/LifoEvents.cs
@@ -6,6 +6,46 @@

 namespace Grean.AtomEventStore
 {
+    /// <summary>
+    /// A backward-moving sequence of events, read from an underlying storage
+    /// mechansism. Events can be of (potentially) any type, as long as there's
+    /// a storage mechanism that can persist and read back instances of that
+    /// type.
+    /// </summary>
+    /// <typeparam name="T">
+    /// The type of event represented by the stream.
+    /// </typeparam>
+    /// <remarks>
+    /// <para>
+    /// The LifoEvents class reads events using a Linked List storage approach.
+    /// For its particulars, it uses Atom for persistence and linking.
+    /// </para>
+    /// <para>
+    /// The concepts of storing events as a linked list was inspired by an
+    /// article by Yves Reynhout called "Your EventStream is a linked list" at
+    /// http://bit.ly/AqearV.
+    /// </para>
+    /// <para>
+    /// When you read the event stream, LifoEvents starts at the end and
+    /// works its way backward, yielding events as it goes along. Thus, newest
+    /// events are served first, until you stop enumerating, or until you reach
+    /// the oldest event.
+    /// </para>
+    /// <para>
+    /// Various storage mechanisms can be plugged into LifoEvents, such as a
+    /// file-based storage mechanism, or in-memory storage. Third-party storage
+    /// add-ins for e.g. cloud-based storage is also an option. A custom
+    /// storage mechanism must implement the <see cref="IAtomEventStorage" />
+    /// interface.
+    /// </para>
+    /// <para>
+    /// Use <see cref="AtomEventObserver{T}" /> to write the events.
+    /// </para>
+    /// </remarks>
+    /// <seealso cref="AtomEventsInMemory" />
+    /// <seealso cref="AtomEventsInFiles" />
+    /// <seealso cref="IAtomEventStorage" />
+    /// <seealso cref="AtomEventObserver{T}" />
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Suppressed following discussion at http://bit.ly/11T4eZe")]
     public class LifoEvents<T> : IEnumerable<T>
     {
@@ -13,6 +53,43 @@
         private readonly IAtomEventStorage storage;
         private readonly IContentSerializer serializer;

+        /// <summary>
+        /// Initializes a new instance of the <see cref="LifoEvents{T}" />
+        /// class.
+        /// </summary>
+        /// <param name="id">The ID of the event stream.</param>
+        /// <param name="storage">
+        /// The underlying storage mechanism from which to read.
+        /// </param>
+        /// <param name="serializer">
+        /// The serializer used to serialize and deserialize items to a format
+        /// compatible with Atom. The object supplied via this constructor
+        /// parameter is subsequently available via the
+        /// <see cref="Serializer" /> property.
+        /// </param>
+        /// <remarks>
+        /// <para>
+        /// The <paramref name="id" /> is the ID of a single event stream. Each
+        /// event stream has its own ID. If you need more than a single event
+        /// stream (e.g. if you are implementing the Aggregate Root pattern),
+        /// each event stream should have a separate ID.
+        /// </para>
+        /// <para>
+        /// The <paramref name="storage" /> value can be any implementation of
+        /// <see cref="IAtomEventStorage" />. Built-in implementatoins include
+        /// <see cref="AtomEventsInMemory" /> and
+        /// <see cref="AtomEventsInFiles" />.
+        /// </para>
+        /// </remarks>
+        /// <exception cref="System.ArgumentNullException">
+        /// <paramref name="storage" /> or <paramref name="serializer" /> is
+        /// <see langword="null" />
+        /// </exception>
+        /// <seealso cref="LifoEvents{T}" />
+        /// <seealso cref="ContentSerializer" />
+        /// <seealso cref="AtomEventsInMemory" />
+        /// <seealso cref="AtomEventsInFiles" />
+        /// <seealso cref="IAtomEventStorage" />
         public LifoEvents(
             UuidIri id,
             IAtomEventStorage storage,
@@ -28,6 +105,38 @@
             this.serializer = serializer;
         }

+        /// <summary>
+        /// Returns an enumerator that iterates through the events, from
+        /// most recent to the oldest.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="T:System.Collections.Generic.IEnumerator{T}" /> that
+        /// can be used to iterate through the collection.
+        /// </returns>
+        /// <remarks>
+        /// <para>
+        /// This Iterator reads events from the instance's underlying
+        /// <see cref="Storage" />, which may involve I/O operations. Since
+        /// AtomEventStore stores events in Atom Feed pages, unless the page
+        /// size used is 1, events will tend to be enumerated in bursts
+        /// corresponding to the page size.
+        /// </para>
+        /// <para>
+        /// In order to minimize the potential delay caused by I/O operations,
+        /// this Iterator employs a read-ahead algorithm. When enumerating
+        /// events, it begins to download the next Atom feed page on a
+        /// background thread, while still yielding entries from the current
+        /// page. This means that the Iterator may occasionally download a page
+        /// that the client doesn't need, because the client breaks out of the
+        /// enumeration before reaching the page in question.
+        /// </para>
+        /// <para>
+        /// In order to prevent unnecessary page downloads, the algorithm only
+        /// starts reading ahead after enumerating the first item in the
+        /// sequence. This enables clients to peek at the first item without
+        /// triggering a background download.
+        /// </para>
+        /// </remarks>
         public IEnumerator<T> GetEnumerator()
         {
             var page = this.ReadLast();
@@ -48,6 +157,14 @@
             }
         }

+        /// <summary>
+        /// Returns an enumerator that iterates through a collection.
+        /// </summary>
+        /// <returns>
+        /// An <see cref="T:System.Collections.IEnumerator" /> object that can
+        /// be used to iterate through the collection.
+        /// </returns>
+        /// <seealso cref="GetEnumerator()" />
         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
         {
             return this.GetEnumerator();
@@ -87,16 +204,51 @@
                 return AtomFeed.ReadFrom(r, this.serializer);
         }

+        /// <summary>
+        /// Gets the ID of the event stream.
+        /// </summary>
+        /// <value>
+        /// The ID of the event stream, as originally supplied via the
+        /// constructor.
+        /// </value>
+        /// <seealso cref="LifoEvents{T}(UuidIri, IAtomEventStorage, IContentSerializer)" />
         public UuidIri Id
         {
             get { return this.id; }
         }

+        /// <summary>
+        /// Gets the underlying storage mechanism.
+        /// </summary>
+        /// <value>
+        /// The underlying storage mechanism, as originally supplied via the
+        /// constructor.
+        /// </value>
+        /// <seealso cref="LifoEvents{T}(UuidIri, IAtomEventStorage, IContentSerializer)" />
         public IAtomEventStorage Storage
         {
             get { return this.storage; }
         }

+        /// <summary>
+        /// Gets the content serializer.
+        /// </summary>
+        /// <value>
+        /// The content serializer, which is used to deserialize the elements
+        /// of the stream from the Atom 'content' element within an Atom entry.
+        /// This object is supplied via the constructor.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// The serializer is used to read items from the stream, using
+        /// <see cref="Storage" /> to read the contents, after which the
+        /// serializer is used to deserialize the previously serialized
+        /// content.
+        /// </para>
+        /// </remarks>
+        /// <seealso cref="Storage" />
+        /// <seealso cref="AppendAsync(T)" />
+        /// <seealso cref="LifoEvents{T}(UuidIri, IAtomEventStorage, IContentSerializer)" />
         public IContentSerializer Serializer
         {
             get { return this.serializer; }


filestream probably needed

filestream probably needed

--- APproject/FSCodeGenerator/FSCodeGen.cs
+++ APproject/FSCodeGenerator/FSCodeGen.cs
@@ -27,7 +27,7 @@
             {
                 try
                 {
-                    //FileStream output = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.Write);
+                    FileStream output = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.Write);
                     fileWriter = new StreamWriter(outputFileName + ".fs");
                 }
                 catch (IOException)


Button Fixed

Button Fixed

--- Airtraffic_Simulator/Form1.Designer.cs
+++ Airtraffic_Simulator/Form1.Designer.cs
@@ -462,13 +462,14 @@
             //
             this.panelAdvanced.BackColor = System.Drawing.Color.SteelBlue;
             this.panelAdvanced.Controls.Add(this.label14);
+            this.panelAdvanced.Controls.Add(this.btUpdate);
             this.panelAdvanced.Controls.Add(this.label13);
             this.panelAdvanced.Controls.Add(this.label12);
             this.panelAdvanced.ForeColor = System.Drawing.SystemColors.ControlText;
             this.panelAdvanced.Location = new System.Drawing.Point(9, 501);
             this.panelAdvanced.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.panelAdvanced.Name = "panelAdvanced";
-            this.panelAdvanced.Size = new System.Drawing.Size(251, 128);
+            this.panelAdvanced.Size = new System.Drawing.Size(251, 153);
             this.panelAdvanced.TabIndex = 9;
             this.panelAdvanced.Visible = false;
             this.panelAdvanced.Paint += new System.Windows.Forms.PaintEventHandler(this.panelAdvanced_Paint);
@@ -478,7 +479,7 @@
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
             this.label14.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label14.Location = new System.Drawing.Point(5, 55);
+            this.label14.Location = new System.Drawing.Point(3, 86);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(176, 20);
             this.label14.TabIndex = 16;
@@ -489,7 +490,7 @@
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
             this.label13.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label13.Location = new System.Drawing.Point(5, 34);
+            this.label13.Location = new System.Drawing.Point(5, 50);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(115, 20);
             this.label13.TabIndex = 15;
@@ -511,7 +512,7 @@
             this.btUpdate.BackColor = System.Drawing.Color.LightSeaGreen;
             this.btUpdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
             this.btUpdate.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.btUpdate.Location = new System.Drawing.Point(9, 745);
+            this.btUpdate.Location = new System.Drawing.Point(3, 50);
             this.btUpdate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btUpdate.Name = "btUpdate";
             this.btUpdate.Size = new System.Drawing.Size(251, 57);
@@ -567,7 +568,6 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1360, 828);
             this.Controls.Add(this.panelDrawing);
-            this.Controls.Add(this.btUpdate);
             this.Controls.Add(this.panelAdvanced);
             this.Controls.Add(this.btAdvanced);
             this.Controls.Add(this.panelTime);


add some SuppressBecause

add some SuppressBecause

--- Analyzers/analyzers/SuppressBecause.cs
+++ Analyzers/analyzers/SuppressBecause.cs
@@ -25,6 +25,11 @@
         public const string CA_ALL_SeeOtherSuppressionMessages = "See the other suppression messages applied within the same context.";

         /// <summary>
+        /// The specified paramters are required to achieve the needed functionality.
+        /// </summary>
+        public const string CA1005_AvoidExcessiveParametersOnGenericTypes_SpecifiedParametersRequiredForNeededFunctionality = "The specified paramters are required to achieve the needed functionality.";
+
+        /// <summary>
         /// Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference.
         /// </summary>
         public const string CA1014_MarkAssembliesWithClsCompliant_ConsoleExeDoesNotNeedToBeClsCompliant = "Console executable does not need the [assembly: CLSCompliant(true)] as it should not be shared as an assembly for reference.";
@@ -48,6 +53,11 @@
         /// We prefer to read <see cref="System.Guid" />'s string representation as lowercase.
         /// </summary>
         public const string CA1308_NormalizeStringsToUppercase_PreferGuidLowercase = "We prefer to read System.Guid's string representation as lowercase.";
+
+        /// <summary>
+        /// We disagree with the assessment that this method as excessively complex.
+        /// </summary>
+        public const string CA1502_AvoidExcessiveComplexity_DisagreeWithAssessment = "We disagree with the assessment that this method as excessively complex.";

         /// <summary>
         /// The analyzer is incorrectly detecting compound words in a unit test method name.


improved recall

improved recall

--- AutoSharpporting/Autoplay.cs
+++ AutoSharpporting/Autoplay.cs
@@ -66,7 +66,7 @@
                 {
                     bot.IssueOrder(GameObjectOrder.MoveTo, carry.Position);
                 }
-                if (carry.IsDead || carry.Distance(bot.Position) > 6000)
+                if (carry.IsDead || carry.Distance(bot.Position) > 6000 || bot.HealthPercentage() < 25)
                 {
                     if (ObjectManager.Get<Obj_AI_Turret>().First(x => !x.IsMe && x.Distance(ObjectManager.Player) < 6000 && x.IsAlly) != null)
                     {


Another Kvi reading optimization.

Another Kvi reading optimization.

--- BTDB/BTreeLib/BTreeImpl12.cs
+++ BTDB/BTreeLib/BTreeImpl12.cs
@@ -376,13 +376,16 @@
                     recursiveChildCount += NodeUtils12.Ptr2NodeHeader(child).RecursiveChildCount;
                 }

+                var commonPrefix = new Span<byte>();
                 for (var i = 1; i < todo; i++)
                 {
                     var prefix = NodeUtils12.GetLeftestKey(nodes[i], out var suffix);
                     totalSuffixLength += (uint) prefix.Length + (uint) suffix.Length;
-                }
-
-                var newNode = AllocateBranch((uint) todo, 0, totalSuffixLength, out var keyPusher);
+                    commonPrefix = i == 1 ? prefix : prefix.Slice(0, TreeNodeUtils.FindFirstDifference(commonPrefix, prefix));
+                }
+
+                totalSuffixLength -= (ulong)((todo - 1) * commonPrefix.Length);
+                var newNode = AllocateBranch((uint) todo, (uint)commonPrefix.Length, totalSuffixLength, out var keyPusher);
                 NodeUtils12.Ptr2NodeHeader(newNode)._recursiveChildCount = recursiveChildCount;
                 for (var i = 1; i < todo; i++)
                 {


(SenrenCxCrypt): override ReadName instead of Init.

--- ArcFormats/KiriKiri/CryptAlgorithms.cs
+++ ArcFormats/KiriKiri/CryptAlgorithms.cs
@@ -1023,26 +1023,24 @@
         {
         }

-        public override void Init (ArcFile arc)
+        public override string ReadName (BinaryReader header)
         {
             if (null == KnownNames)
                 ReadNames();
-            foreach (var entry in arc.Dir)
-            {
-                string name;
-                if (KnownNames.TryGetValue (entry.Name, out name))
-                {
-                    entry.Name = name;
-                    entry.Type = FormatCatalog.Instance.GetTypeFromName (name);
-                }
-            }
+            var hash = base.ReadName (header);
+            string name;
+            if (null == hash || !KnownNames.TryGetValue (hash, out name))
+                return hash;
+            if (string.IsNullOrEmpty (name))
+                return null;
+            return name;
         }

         void ReadNames ()
         {
             var dir = FormatCatalog.Instance.DataDirectory;
             var names_file = Path.Combine (dir, FileMapName);
-            var names = new Dictionary<string, string>();
+            var names = new Dictionary<string, string> { { "$", "startup.tjs" } };
             try
             {
                 var hash_buf = new char[32];


Fixes U4-1864 Publishing document type with Upload field and related umbracoWidth, umbracoHeight, etc fields added

--- src/umbraco.cms/businesslogic/Content.cs
+++ src/umbraco.cms/businesslogic/Content.cs
@@ -699,7 +699,7 @@
                     continue;

                 //get the propertyId
-                var property = propData.SingleOrDefault(x => x.PropertyTypeId == pt.Id);
+                var property = propData.FirstOrDefault(x => x.PropertyTypeId == pt.Id);
                 if (property == null)
                 {
                     //continue;


Case insensitive decryption key lookup

Case insensitive decryption key lookup

--- BinderTool/DecryptionKeys.cs
+++ BinderTool/DecryptionKeys.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Text;

 namespace BinderTool
@@ -11,7 +12,7 @@

         static DecryptionKeys()
         {
-            RsaKeyDictionary = new Dictionary<string, string>
+            RsaKeyDictionary = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase)
             {
                 { "Data1.bhd", Data1Key },
                 { "Data2.bhd", Data2Key },
@@ -22,7 +23,7 @@
                 { "DLC2.bhd", Dlc2Key },
             };

-            AesKeyDictionary = new Dictionary<string, byte[]>()
+            AesKeyDictionary = new Dictionary<string, byte[]>(StringComparer.InvariantCultureIgnoreCase)
             {
                 { "regulation.regbnd.dcx.enc", RegulationFileKeyDs3 },
                 { "enc_regulation.bnd.dcx", RegulationFileKeyDs2 },


anroid - set app secret & set device known

--- Assets/Adjust/Android/AdjustAndroid.cs
+++ Assets/Adjust/Android/AdjustAndroid.cs
@@ -128,11 +128,30 @@

             // Since INSTALL_REFERRER is not triggering SDK initialisation, call onResume after onCreate.
             // OnApplicationPause doesn't get called first time the scene loads, so call to onResume is needed.
+
+			// Set App Secret
+			if (IsAppSecretSet(adjustConfig)) {
+				ajoAdjustConfig.Call("setAppSecret", adjustConfig.secretId.Value,
+					adjustConfig.appSecretInfo1.Value, adjustConfig.appSecretInfo2.Value,
+					adjustConfig.appSecretInfo3.Value, adjustConfig.appSecretInfo4.Value);
+			}
+
+			// Set device known
+			if (adjustConfig.isDeviceKnown.HasValue) {
+				ajoAdjustConfig.Call("setDeviceKnown", adjustConfig.isDeviceKnown.Value);
+			}

             // Initialise and start the SDK.
             ajcAdjust.CallStatic("onCreate", ajoAdjustConfig);
             ajcAdjust.CallStatic("onResume");
         }
+
+		private static bool IsAppSecretSet(AdjustConfig adjustConfig)
+		{
+			return adjustConfig.secretId.HasValue &&
+				adjustConfig.appSecretInfo1.HasValue && adjustConfig.appSecretInfo2.HasValue &&
+				adjustConfig.appSecretInfo2.HasValue && adjustConfig.appSecretInfo2.HasValue;
+		}

         public static void trackEvent(AdjustEvent adjustEvent) {
             AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken);
@@ -216,9 +235,9 @@
         }

         public static void addSessionPartnerParameter(string key, string value) {
-            if (ajcAdjust == null) {
-                ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
-            }
+			if (ajcAdjust == null) {
+				ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+			}

             ajcAdjust.CallStatic("addSessionPartnerParameter", key, value);
         }


Allow default strings to handle case where there is no key

--- Assets/Carrot/Editor/CarrotSettings.cs
+++ Assets/Carrot/Editor/CarrotSettings.cs
@@ -96,15 +96,8 @@

    static void LoadSettings()
    {
-      if(EditorPrefs.HasKey(ProjectName + "-CarrotAppId"))
-      {
-         mCarrotAppId = EditorPrefs.GetString(ProjectName + "-CarrotAppId");
-      }
-
-      if(EditorPrefs.HasKey(ProjectName + "-CarrotAppSecret"))
-      {
-         mCarrotAppSecret = EditorPrefs.GetString(ProjectName + "-CarrotAppSecret");
-      }
+      mCarrotAppId = EditorPrefs.GetString(ProjectName + "-CarrotAppId");
+      mCarrotAppSecret = EditorPrefs.GetString(ProjectName + "-CarrotAppSecret");
    }

    static void SaveSettings()


Made the rendertile function virtual so that inheriting from the TileMap2D source allows everything to work just as nicely as it currently does.

--- Assets/Pbtk/TileMap2D/ChunkRenderer.cs
+++ Assets/Pbtk/TileMap2D/ChunkRenderer.cs
@@ -87,7 +87,7 @@
 			/// <param name="l">The layer index of the tile in the chunk</param>
 			/// <param name="gid">The GID of the tile to render</param>
 			/// <returns>The rendered tile</returns>
-			public GameObject RenderTile(TileMap tile_map, int chunk_index_x, int chunk_index_y, int x, int y, int l, int gid)
+			public virtual GameObject RenderTile(TileMap tile_map, int chunk_index_x, int chunk_index_y, int x, int y, int l, int gid)
 			{
 				int id = gid & 0x1FFFFFFF;
 				bool flip_horiz = ((uint)gid & 0x80000000) == 0x80000000;


poison given a duration

poison given a duration

--- Assets/Scripts/Model/Buffs/BuffList.cs
+++ Assets/Scripts/Model/Buffs/BuffList.cs
@@ -6,7 +6,7 @@

 public static class BuffList {
     public class Poison : Buff {
-        public Poison(SpellParams caster, SpellParams target) : base(caster, target, Util.GetSprite("fox-head"), "Poisoned", "Loses health at the end of each turn.") { }
+        public Poison(SpellParams caster, SpellParams target) : base(2, caster, target, Util.GetSprite("fox-head"), "Poisoned", "Loses health at the end of each turn.") { }

         protected override IList<SpellEffect> OnEndOfTurnHelper() {
             return new SpellEffect[] {


Add a method to validate matches

Add a method to validate matches

This can be used to validate matches to avoid executing an alignment that will fail due to invalid match sequences.

--- Aurio/Aurio/Matching/MatchProcessor.cs
+++ Aurio/Aurio/Matching/MatchProcessor.cs
@@ -303,6 +303,21 @@
                 });
                 m2.Track2Time = targetTime;
                 // TODO alle anderen Matches die Track 2 betreffen anpassen
+
+        public static void ValidateMatches(List<MatchGroup> trackGroups) {
+            foreach (MatchGroup trackGroup in trackGroups) {
+                foreach (MatchPair trackPair in trackGroup.MatchPairs) {
+                    var timeWarpCollection = new TimeWarpCollection();
+
+                    // (By convention, we always warp the second track of a pair of tracks.)
+                    var timeWarps = GetTimeWarps(trackPair.Matches, trackPair.Track2);
+
+                    // Adding all warps to the collection triggers the validation.
+                    // This will validate the warps and throw an exception if something is wrong.
+                    timeWarpCollection.AddRange(timeWarps.Values);
+                }
+            }
+        }
             }

             // apply time warps to the track


Fix a bug that was causing duplicate primitives in the viewer when logging in after the first login, and also fix a bug where if an avatar edited a prim, and then very quickly logged out, the changes would not be saved.

--- Aurora/Modules/World/Startup/Backup.cs
+++ Aurora/Modules/World/Startup/Backup.cs
@@ -393,6 +393,11 @@

             public void ResetRegionToStartupDefault ()
             {
+                while (IsBackingUp || m_backupTaintedPrims.Count != 0 || m_secondaryBackupTaintedPrims.Count != 0)
+                {
+                    //Wait until other threads are done with backup before backing up so that we get everything
+                    Thread.Sleep (100);
+                }
                 m_haveLoadedPrims = false;
                 //Add the loading prims piece just to be safe
                 LoadingPrims = true;
@@ -403,7 +408,6 @@
                 //Clear the queue so that we don't try to remove the prims twice
                 ClearDeleteFromStorage ();

-                List<SceneObjectGroup> groups = new List<SceneObjectGroup> ();
                 lock (m_scene.Entities)
                 {
                     EntityBase[] entities = m_scene.Entities.GetEntities ();
@@ -412,11 +416,9 @@
                         if (entity is SceneObjectGroup && !((SceneObjectGroup)entity).IsAttachment)
                         {
                             List<SceneObjectPart> parts = new List<SceneObjectPart> ();
-                            foreach (SceneObjectGroup group in groups)
-                            {
-                                parts.AddRange (group.ChildrenList);
-                                DeleteSceneObject (group, true, false); //Don't remove from the database
-                            }
+                            SceneObjectGroup grp = entity as SceneObjectGroup;
+                            parts.AddRange (grp.ChildrenList);
+                            DeleteSceneObject (grp, true, false); //Don't remove from the database
                             m_scene.ForEachScenePresence (delegate (ScenePresence avatar)
                             {
                                 avatar.ControllingClient.SendKillObject (m_scene.RegionInfo.RegionHandle, parts.ToArray ());


Fix tests

Fix tests

--- BTCPayServer/Services/PayjoinClient.cs
+++ BTCPayServer/Services/PayjoinClient.cs
@@ -22,16 +22,21 @@
                 throw new InvalidOperationException("The psbt should be finalized with witness information");
             var coinsPerTypes = psbt.Inputs.Select(i =>
             {
-                if (i.WitnessUtxo.ScriptPubKey.IsScriptType(ScriptType.P2WPKH))
-                    return ((PSBTCoin)i, ScriptPubKeyType.Segwit);
-                if (i.WitnessUtxo.ScriptPubKey.IsScriptType(ScriptType.P2SH) &&
-                    i.FinalScriptWitness.ToScript().IsScriptType(ScriptType.P2WPKH))
-                    return ((PSBTCoin)i, ScriptPubKeyType.SegwitP2SH);
-                return ((PSBTCoin)i, null as ScriptPubKeyType?);
+                return ((PSBTCoin)i, i.GetInputScriptPubKeyType());
             }).GroupBy(o => o.Item2, o => o.Item1).ToArray();
             if (coinsPerTypes.Length != 1)
                 return default;
             return coinsPerTypes[0].Key;
+        }
+
+        public static ScriptPubKeyType? GetInputScriptPubKeyType(this PSBTInput i)
+        {
+            if (i.WitnessUtxo.ScriptPubKey.IsScriptType(ScriptType.P2WPKH))
+                return ScriptPubKeyType.Segwit;
+            if (i.WitnessUtxo.ScriptPubKey.IsScriptType(ScriptType.P2SH) &&
+                i.FinalScriptWitness.ToScript().IsScriptType(ScriptType.P2WPKH))
+                return ScriptPubKeyType.SegwitP2SH;
+            return null as ScriptPubKeyType?;
         }
     }

@@ -178,19 +183,18 @@
                 }
             }

-            // Making sure that the receiver's inputs are finalized and match format
-            var payjoinInputType = newPSBT.GetInputsScriptPubKeyType();
-            if (payjoinInputType is null || payjoinInputType.Value != type)
-            {
-                throw new PayjoinSenderException("The payjoin receiver included an input that is not the same segwit input type");
-            }
-
             foreach (var input in newPSBT.Inputs)
             {
                 if (originalTx.Inputs.FindIndexedInput(input.PrevOut) is null)
                 {
                     if (!input.IsFinalized())
                         throw new PayjoinSenderException("The payjoin receiver included a non finalized input");
+                    // Making sure that the receiver's inputs are finalized and match format
+                    var payjoinInputType = input.GetInputScriptPubKeyType();
+                    if (payjoinInputType is null || payjoinInputType.Value != type)
+                    {
+                        throw new PayjoinSenderException("The payjoin receiver included an input that is not the same segwit input type");
+                    }
                 }
             }


log shit

log shit

--- Bot/Controllers/ConversationStarter.cs
+++ Bot/Controllers/ConversationStarter.cs
@@ -36,7 +36,8 @@
             var userInfo = await graphHelper.GetUserInfo();
             Random rnd = new Random();
             int fileindex = rnd.Next(1, 7);
-            string fileurl = "https://raw.githubusercontent.com/ThessalonikiNet-MeetUp/NoiseDetectionBot/master/Bot/Images/shh" + fileindex +".gif";
+            string fileurl = $"https://raw.githubusercontent.com/ThessalonikiNet-MeetUp/NoiseDetectionBot/master/Bot/Images/shh{fileindex}.gif";
+            Trace.TraceInformation($"GetMeetingRoomSuggestions: Image={fileurl}.");

             var animationCard = new HeroCard
             {


Add IList<T> constructor

Add IList<T> constructor

Remove List<T> and T[] constructors

--- CSharpGameLibrary/NativeStringArray.cs
+++ CSharpGameLibrary/NativeStringArray.cs
@@ -16,16 +16,7 @@
             Init(count);
         }

-        public NativeStringArray(string[] array) {
-            if (array != null) {
-                Init(array.Length);
-                for (int i = 0; i < array.Length; i++) {
-                    this[i] = array[i]; //indexer takes care of converting the strings
-                }
-            }
-        }
-
-        public NativeStringArray(List<string> list) {
+        public NativeStringArray(IList<string> list) {
             if (list != null) {
                 Init(list.Count);
                 for (int i = 0; i < list.Count; i++) {


add offset args to SpeedrunTimer.EndLoad

--- 140-speedrun-timer/MainObject/SpeedrunTimer.cs
+++ 140-speedrun-timer/MainObject/SpeedrunTimer.cs
@@ -223,14 +223,14 @@
 			});
 		}

-		public void EndLoad()
+		public void EndLoad(int millisecondsOffset = 0, int quarterBeatsOffset = 0)
 		{
 			if (!IsRunning || !IsGameTimePaused)
 				return;

 			DoAfterUpdate(() =>
 			{
-				_beatTimer.ResumeTimer();
+				_beatTimer.ResumeTimer(millisecondsOffset, quarterBeatsOffset);
 			});
 		}


Update ClearAOI.cs

Update ClearAOI.cs

--- ClearAOIContextMenu/CSharp/ClearAOI.cs
+++ ClearAOIContextMenu/CSharp/ClearAOI.cs
@@ -1,4 +1,17 @@
-using System;
+/*Copyright 2015 Esri
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.*/
+
+using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Windows.Forms;


Verify Whether There is Recorded Portfolio Equity Before Computing Performace

When there is no recorded portfolio equity for a given period, we don't need to compute the algorithm performance (it is all zeroes). This procedure prevents the unrepresented `DateTime` error in `CreateBenchmarkDifferences`.

--- Common/Statistics/StatisticsBuilder.cs
+++ Common/Statistics/StatisticsBuilder.cs
@@ -18,6 +18,7 @@
 using System.Globalization;
 using System.Linq;
 using QuantConnect.Logging;
+using QuantConnect.Util;

 namespace QuantConnect.Statistics
 {
@@ -82,9 +83,16 @@
             List<ChartPoint> pointsBenchmark,
             decimal startingCapital)
         {
+            var periodEquity = new SortedDictionary<DateTime, decimal>(equity.Where(x => x.Key.Date >= fromDate && x.Key.Date < toDate.AddDays(1)).ToDictionary(x => x.Key, y => y.Value));
+
+            // No portfolio equity for the period means that there is no performance to be computed
+            if (periodEquity.IsNullOrEmpty())
+            {
+                return new AlgorithmPerformance();
+            }
+
             var periodTrades = trades.Where(x => x.ExitTime.Date >= fromDate && x.ExitTime < toDate.AddDays(1)).ToList();
             var periodProfitLoss = new SortedDictionary<DateTime, decimal>(profitLoss.Where(x => x.Key >= fromDate && x.Key.Date < toDate.AddDays(1)).ToDictionary(x => x.Key, y => y.Value));
-            var periodEquity = new SortedDictionary<DateTime, decimal>(equity.Where(x => x.Key.Date >= fromDate && x.Key.Date < toDate.AddDays(1)).ToDictionary(x => x.Key, y => y.Value));

             var benchmark = ChartPointToDictionary(pointsBenchmark, fromDate, toDate);
             var performance = ChartPointToDictionary(pointsPerformance, fromDate, toDate);


HtmlTextWriter optimized by implementing Write(string)

--- CommonMark/Formatter/HtmlTextWriter.cs
+++ CommonMark/Formatter/HtmlTextWriter.cs
@@ -22,6 +22,42 @@
             this._windowsNewLine = nl == "\r\n";
         }

+        public override void Write(string value)
+        {
+            if (value == null || value.Length == 0)
+                return;
+
+            if (this._windowsNewLine)
+            {
+                var lastPos = 0;
+                var lastC = this._last;
+                int pos = 0;
+                var charArray = value.ToCharArray();
+
+                while (-1 != (pos = value.IndexOf('\n', pos)))
+                {
+                    lastC = pos == 0 ? this._last : value[pos - 1];
+
+                    if (lastC != '\r')
+                    {
+                        this._inner.Write(charArray, lastPos, pos - lastPos);
+                        this._inner.Write('\r');
+                        lastPos = pos;
+                    }
+
+                    pos++;
+                }
+
+                this._inner.Write(charArray, lastPos, value.Length - lastPos);
+            }
+            else
+            {
+                this._inner.Write(value);
+            }
+
+            this._last = value[value.Length - 1];
+        }
+
         public override void Write(char value)
         {
             if (this._windowsNewLine && _last != '\r' && value == '\n')


Hash on AggregatorSettings

Hash on AggregatorSettings

--- Configuration/TFSAggregatorSettings.cs
+++ Configuration/TFSAggregatorSettings.cs
@@ -20,12 +20,15 @@

         public static TFSAggregatorSettings LoadFromFile(string settingsPath, ILogEvents logger)
         {
-            return Load(logger, (xmlLoadOptions) => XDocument.Load(settingsPath, xmlLoadOptions));
+            DateTime timestamp = System.IO.File.GetLastWriteTimeUtc(settingsPath);
+            return Load(timestamp, (xmlLoadOptions) => XDocument.Load(settingsPath, xmlLoadOptions), logger);
         }

         public static TFSAggregatorSettings LoadXml(string content, ILogEvents logger)
         {
-            return Load(logger, (xmlLoadOptions) => XDocument.Parse(content, xmlLoadOptions));
+            // conventional
+            DateTime timestamp = new DateTime(0, DateTimeKind.Utc);
+            return Load(timestamp, (xmlLoadOptions) => XDocument.Parse(content, xmlLoadOptions), logger);
         }

         /// <summary>
@@ -33,12 +36,14 @@
         /// </summary>
         /// <param name="load">A lambda returning the <see cref="XDocument"/> to parse.</param>
         /// <returns></returns>
-        public static TFSAggregatorSettings Load(ILogEvents logger, Func<LoadOptions, XDocument> load)
+        public static TFSAggregatorSettings Load(DateTime timestamp, Func<LoadOptions, XDocument> load, ILogEvents logger)
         {
             var instance = new TFSAggregatorSettings();

             LoadOptions xmlLoadOptions = LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo;
             XDocument doc = load(xmlLoadOptions);
+
+            instance.Hash = ComputeHash(doc, timestamp);

             if (!Validate(logger, doc))
                 // HACK we must handle this scenario with clean exit
@@ -67,6 +72,26 @@
             }//for

             return instance;
+        }
+
+        private static string ComputeHash(XDocument doc, DateTime timestamp)
+        {
+            using (var stream = new System.IO.MemoryStream())
+            {
+                using (var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider())
+                {
+                    using (var w = new System.IO.BinaryWriter(stream))
+                    {
+                        w.Write(timestamp.ToBinary());
+                        w.Flush();
+                        doc.Save(stream, SaveOptions.OmitDuplicateNamespaces);
+                        stream.Flush();
+                        var hash = md5.ComputeHash(stream.GetBuffer());
+                        string hex = BitConverter.ToString(hash);
+                        return hex.Replace("-", "");
+                    }
+                }
+            }
         }

         private static bool Validate(ILogEvents logger, XDocument doc)
@@ -206,5 +231,6 @@
         public LogLevel LogLevel { get; set; }
         public string ScriptLanguage { get; set; }
         public bool AutoImpersonate { get; set; }
+        public string Hash { get; private set; }
     }
 }


use the right resource for rooms....

use the right resource for rooms....

--- Bot/Services/RoomsService.cs
+++ Bot/Services/RoomsService.cs
@@ -18,7 +18,7 @@

         public static Uri BaseUrl => new Uri(Config.GetAppSetting("RoomNinjaApiUrl"));

-        public static readonly string Resource = "https://rightpoint.com/553d35d5-1fd5-4763-8356-a62cc4d350e3";
+        public static readonly string Resource = Config.GetAppSetting("RoomNinjaResource") ?? "https://rooms.rightpoint.com/";

         public RoomsService(string accessToken) : base(accessToken)
         {


Handled null event data.

Handled null event data.

--- Build/BuildUtil/ColorExec.cs
+++ Build/BuildUtil/ColorExec.cs
@@ -36,8 +36,8 @@
                 {
                     process.StartInfo.RedirectStandardOutput = true;
                     process.StartInfo.RedirectStandardError = true;
-                    process.OutputDataReceived += (sender, eventArgs) => Log.LogMessage(MessageImportance.High, eventArgs.Data);
-                    process.ErrorDataReceived += (sender, eventArgs) => Log.LogError(eventArgs.Data);
+                    process.OutputDataReceived += (sender, eventArgs) => { if (eventArgs.Data != null) Log.LogMessage(MessageImportance.High, eventArgs.Data); };
+                    process.ErrorDataReceived += (sender, eventArgs) => { if (eventArgs.Data != null) Log.LogError(eventArgs.Data); };
                 }

                 process.StartInfo.UseShellExecute = false;


catch "illegal characters in path" ArgumentException as seen in issue #157 when using includepaths from propertysheets

--- CPPCheckPlugin/SourceFile.cs
+++ CPPCheckPlugin/SourceFile.cs
@@ -63,7 +63,19 @@
 				return;
 			if (String.IsNullOrEmpty(path)|| path.Equals(".") || path.Equals("\\\".\\\""))
 				return;
-			if (path.Contains("\\:")) // absolute path
+
+      bool isAbsolutePath = false;
+      try
+      {
+        isAbsolutePath = System.IO.Path.IsPathRooted(path);
+      }
+      catch (System.ArgumentException)
+      {
+        // seems like an invalid path, ignore
+        return;
+      }
+
+			if (isAbsolutePath) // absolute path
 				_includePaths.Add(cleanPath(path));
 			else
 			{


Add support for copying descriptors

Add support for copying descriptors

--- CSGL.Vulkan/DescriptorSet.cs
+++ CSGL.Vulkan/DescriptorSet.cs
@@ -29,6 +29,16 @@
         public List<BufferView> texelBufferView;
     }

+    public class CopyDescriptorSet {
+        public DescriptorSet srcSet;
+        public uint srcBinding;
+        public uint srcArrayElement;
+        public DescriptorSet dstSet;
+        public uint dstBinding;
+        public uint dstArrayElement;
+        public uint descriptorCount;
+    }
+
     public class DescriptorSet : INative<VkDescriptorSet> {
         VkDescriptorSet descriptorSet;

@@ -47,19 +57,29 @@
             this.descriptorSet = descriptorSet;
         }

-        public static void Update(Device device, List<WriteDescriptorSet> writes) {
+        public static void Update(Device device, List<WriteDescriptorSet> writes, List<CopyDescriptorSet> copies) {
             if (device == null) throw new ArgumentNullException(nameof(device));
+
+            int copyCount = 0;
+            int writeCount = 0;

             int totalBuffers = 0;
             int totalImages = 0;
             int totalBufferViews = 0;

-            for (int i = 0; i < writes.Count; i++) {
-                var write = writes[i];
+            if (writes != null) {
+                writeCount = writes.Count;
+                for (int i = 0; i < writeCount; i++) {
+                    var write = writes[i];

-                if (write.bufferInfo != null) totalBuffers += write.bufferInfo.Count;
-                if (write.imageInfo != null) totalImages += write.imageInfo.Count;
-                if (write.texelBufferView != null) totalBufferViews += write.texelBufferView.Count;
+                    if (write.bufferInfo != null) totalBuffers += write.bufferInfo.Count;
+                    if (write.imageInfo != null) totalImages += write.imageInfo.Count;
+                    if (write.texelBufferView != null) totalBufferViews += write.texelBufferView.Count;
+                }
+            }
+
+            if (copies != null) {
+                copyCount = copies.Count;
             }

             unsafe {
@@ -71,9 +91,10 @@
                 int imageIndex = 0;
                 int bufferViewIndex = 0;

-                var writesNative = stackalloc VkWriteDescriptorSet[writes.Count];
+                var writesNative = stackalloc VkWriteDescriptorSet[writeCount];
+                var copiesNative = stackalloc VkCopyDescriptorSet[copyCount];

-                for (int i = 0; i < writes.Count; i++) {
+                for (int i = 0; i < writeCount; i++) {
                     var mWrite = writes[i];

                     writesNative[i].sType = VkStructureType.WriteDescriptorSet;
@@ -128,12 +149,25 @@
                     }
                 }

-                device.Commands.updateDescriptorSets(device.Native, (uint)writes.Count, (IntPtr)writesNative, 0, IntPtr.Zero);
+                for (int i = 0; i < copyCount; i++) {
+                    var mCopy = copies[i];
+
+                    copiesNative[i].sType = VkStructureType.CopyDescriptorSet;
+                    copiesNative[i].srcSet = mCopy.srcSet.Native;
+                    copiesNative[i].srcBinding = mCopy.srcBinding;
+                    copiesNative[i].srcArrayElement = mCopy.srcArrayElement;
+                    copiesNative[i].dstSet = mCopy.dstSet.Native;
+                    copiesNative[i].dstBinding = mCopy.dstBinding;
+                    copiesNative[i].dstArrayElement = mCopy.dstArrayElement;
+                    copiesNative[i].descriptorCount = mCopy.descriptorCount;
+                }
+
+                device.Commands.updateDescriptorSets(device.Native, (uint)writeCount, (IntPtr)writesNative, (uint)copyCount, (IntPtr)copiesNative);
             }
         }

-        public void Update(List<WriteDescriptorSet> writes) {
-            Update(Device, writes);
+        public void Update(List<WriteDescriptorSet> writes, List<CopyDescriptorSet> copies) {
+            Update(Device, writes, copies);
         }
     }
 }


Always check all replicas when checking replica's Write out message when replica is not updated, so we know which ones

--- CachelessDnsClient/Client.cs
+++ CachelessDnsClient/Client.cs
@@ -48,30 +48,32 @@

                 if (soaMessage != null && soaMessage.ReturnCode == ReturnCode.NoError && soaMessage.AuthorityRecords.Count > 0)
                 {
-
+                    bool foundInReplicas = true;
                     foreach (NsRecord server in soaMessage.AuthorityRecords)
                     {
                         // Create client talking directly to Master server
-                        // NOTE: Async client appears not to work
                         hostDomainIps = await resolver.ResolveHostAsync(server.NameServer);
                         ip4s = hostDomainIps.Where(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
                         client = new DnsClient(ip4s, 60);
+
+                        // NOTE: Async client.Resolve appears not to work, so using sync method
                         var dnsMessage = client.Resolve(hostName, RecordType.A, RecordClass.INet, new DnsQueryOptions() { IsRecursionDesired = true });
                         if (dnsMessage == null || dnsMessage.ReturnCode == ReturnCode.NxDomain || dnsMessage.AnswerRecords.Count == 0)
                         {
                             // Record not found
-                            return false;
+                            Console.WriteLine("Record not found in NS server '{0}'", server.NameServer);
+                            foundInReplicas = false;
                         }

                         // If we aren't checking all replica's, return true from first result
                         if (!replicas)
                         {
-                            return true;
+                            return foundInReplicas;
                         }
                     }

                     // All SOA servers returned a record
-                    return true;
+                    return foundInReplicas;
                 }
             }


Calculate rootNodeStart from the length of the background preceding it, instead of using the JsonValueSyntax.Start property.


Remove extra output line

Remove extra output line

--- Cake.Xamarin.Build/Aliases.cs
+++ Cake.Xamarin.Build/Aliases.cs
@@ -420,7 +420,6 @@
 			}

 			logInfo(context, "------------------------------");
-			logInfo(context, "------------------------------");
 		}

 		static void logInfo(ICakeContext context, string format, params object[] args)
@@ -485,7 +484,13 @@
         }

-		static PlatformFamily GetOperatingSystem(this ICakeContext context)
+		/// <summary>
+		/// Gets the type of Operating System
+		/// </summary>
+		/// <returns>The operating system.</returns>
+		/// <param name="context">Context.</param>
+		[CakeMethodAlias]
+		public static PlatformFamily GetOperatingSystem(this ICakeContext context)
 		{
 			try
 			{


Create method read/write on/in file

Create method read/write on/in file

--- CarsGame/CarsGame/CarsGame.cs
+++ CarsGame/CarsGame/CarsGame.cs
@@ -7,7 +7,6 @@
 //create object
 struct Object
 {
-
     public int x;
     public int y;
     public char[,] c;
@@ -63,10 +62,8 @@
     static int score = 0;
     static int bestScore = 0;

-
     static void Main()
     {
-
         Console.Title = "Car Race F1";
         Console.WindowWidth = GameWidth;
         Console.BufferWidth = GameWidth;
@@ -75,6 +72,71 @@

         newObject.x = 40;
         userCar.c = userCarArr;
+
+        ReadFromFile();
+
+
+        while (true)
+        {
+            if (EndGame())
+            {
+                PrintStringOnPosition();
+                break;
+            }
+
+            MoveUserCar();
+
+            NewObject();
+
+            if (HittingCars())
+            {
+                --livesCount;
+            }
+
+            foreach (Object car in objects)
+            {
+                PrintOnPosition(enemyCar, car.y, car.x, ConsoleColor.Red);
+            }
+
+            if (speed >= 90)
+            {
+                speed = 90;
+            }
+            else
+            {
+                ++speed;
+            }
+
+            score += 10;
+
+            DrawInfo(GameWidth, GameHeight, livesCount, acceleration, speed);
+
+            Thread.Sleep(100 - speed);
+            Console.Clear();
+        }
+
+        if (score > bestScore)
+        {
+            WriteIntoFile();
+        }
+    }
+
+    static void WriteIntoFile()
+    {
+        try
+        {
+            StreamWriter streamWriter = new StreamWriter("bestScore.txt", false);
+            streamWriter.Write(score);
+            streamWriter.Close();
+        }
+        catch (Exception ex)
+        {
+            Console.Error.WriteLine(ex.Message);
+        }
+    }
+
+    static void ReadFromFile()
+    {
         try
         {
             StreamReader reader = new StreamReader("bestScore.txt");
@@ -85,52 +147,6 @@
         {
             Console.Error.WriteLine(ex.Message);
         }
-
-        while (true)
-        {
-            MoveUserCar();
-            NewCar();
-            if (HittingCars())
-            {
-                --livesCount;
-            }
-
-            #region end of the program
-            if (EndGame())
-            {
-                PrintStringOnPosition();
-                break;
-            }
-            #endregion
-
-            foreach (Object car in objects)
-            {
-                PrintOnPosition(enemyCar, car.y, car.x, ConsoleColor.Red);
-            }
-            if (speed >= 90)
-            {
-                speed = 90;
-            }
-            ++speed;
-            score += 10;
-            DrawInfo(GameWidth, GameHeight, livesCount, acceleration, speed);
-            Thread.Sleep(100 - speed);
-            Console.Clear();
-        }
-
-        if (score > bestScore)
-        {
-            try
-            {
-                StreamWriter streamWriter = new StreamWriter("bestScore.txt", false);
-                streamWriter.Write(score);
-                streamWriter.Close();
-            }
-            catch (Exception ex)
-            {
-                Console.Error.WriteLine(ex.Message);
-            }
-        }
     }

     //Print cars and text at position on console
@@ -148,14 +164,13 @@

     static void Print(int row, int col, object data)
     {
-
         Console.CursorVisible = false;
         Console.SetCursorPosition(col, row);
         Console.Write(data);
     }

     //After live is over write game over
-    static void PrintStringOnPosition(ConsoleColor color = ConsoleColor.Gray)
+    static void PrintStringOnPosition(ConsoleColor color = ConsoleColor.Red)
     {
         Console.Clear();
         Console.WriteLine(@"                     .... NO! ...                  ... MNO! ...
@@ -240,7 +255,7 @@
         }
     }

-    static void NewCar()
+    static void NewObject()
     {
         int chance = random.Next(0, 100);
         int[] laneY = { 0, 8, 16 };


Implement IQueryableUserStore

Implement IQueryableUserStore

--- src/AspNetCore.Identity.Marten/UserStore.cs
+++ src/AspNetCore.Identity.Marten/UserStore.cs
@@ -18,6 +18,7 @@
         , IUserPhoneNumberStore<TUser>
         , IUserTwoFactorStore<TUser>
         , IUserLockoutStore<TUser>
+        , IQueryableUserStore<TUser>
         where TUser : IdentityUser<TKey>
     {
         public UserStore(IDocumentSession session, ISystemClock clock)
@@ -47,6 +48,14 @@

         public ISystemClock Clock { get; private set; }

+        public IQueryable<TUser> Users
+        {
+            get
+            {
+                return Session.Query<TUser>();
+            }
+        }
+
         #region IUserStore<TUser> Support
         public async Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken)
         {


Error_ExceptionWindow_GitHubRedirect - skipped

--- src/DotVVM.Samples.Tests.New/ErrorsTests.cs
+++ src/DotVVM.Samples.Tests.New/ErrorsTests.cs
@@ -291,7 +291,7 @@
             });
         }

-        [Fact, Ignore]
+        [Fact(Skip = "Test is not reliable.")]
         [SampleReference(nameof(SamplesRouteUrls.Errors_FieldInValueBinding))]
         public void Error_ExceptionWindow_GitHubRedirect()
         {


Head Bobbing

Head Bobbing

--- CardboardWalk/Assets/Walk.cs
+++ CardboardWalk/Assets/Walk.cs
@@ -13,6 +13,13 @@
     public Color NormalColor, HighlightColor;
     public float clickTime = 1f;
     public Canvas canvas;
+
+    [Header("Head Bobbing")]
+    public float frequency;
+    public float amplitudeX, amplitudeY;
+    private Vector3 OriginalPosition;
+    private float BobbingDistance = 0f;
+
     private Rigidbody rigidbody;
     private float clickTimeRemaining = -1f;

@@ -40,6 +47,10 @@
             Vector3 direction = cameraObject.transform.forward;
             direction.y = 0f;
             rigidbody.MovePosition(transform.position + direction * speed);
+
+            BobbingDistance += direction.magnitude * speed;
+            cameraObject.transform.localPosition = cameraObject.transform.rotation * new Vector3(amplitudeX * Mathf.Sin(BobbingDistance * frequency), amplitudeY * Mathf.Sin(BobbingDistance * frequency * 2), 0f);
+            Debug.DrawLine(cameraObject.transform.position, cameraObject.transform.position + new Vector3(0.1f,0,0), Color.red, 2f);
         }
     }