refactor(manager)

refactor(manager)

edit naming of error method

--- src/csharp-steamgaug-es-api-core/Manager/SteamgaugManager.cs
+++ src/csharp-steamgaug-es-api-core/Manager/SteamgaugManager.cs
@@ -60,7 +60,7 @@
             return _steamgaugResponseModel.SteamCommunity.Time;
         }

-        public bool SteamCommunityError()
+        public bool SteamCommunityHasError()
         {
             updateResponseModel();
             if (_steamgaugResponseModel.SteamCommunity.Error == "No Error")


Delete ShapeView.xaml.cs

Delete ShapeView.xaml.cs

[skip ci]

--- src/Core2D.vNext/Views/Shape/ShapeView.xaml.cs
+++ src/Core2D.vNext/Views/Shape/ShapeView.xaml.cs
@@ -1,12 +0,0 @@
-using System.Windows.Controls;
-
-namespace Core2D.Views.Project
-{
-    public partial class ShapeView : UserControl
-    {
-        public ShapeView()
-        {
-            InitializeComponent();
-        }
-    }
-}


removed for

removed for

--- APproject/FSCodeGenerator/FSCodeGenRef.cs
+++ APproject/FSCodeGenerator/FSCodeGenRef.cs
@@ -106,9 +106,6 @@
                 case Labels.Read:
                     translateRead(n);
                     break;
-                case Labels.For:
-                    translateFor(n);
-                    break;
                 case Labels.Async:
                     translateAsync(n);
                     break;


Save ip after recording, check ip on index, version 1.0

--- AThousandCounts/Views/Count/_Count.cshtml
+++ AThousandCounts/Views/Count/_Count.cshtml
@@ -4,7 +4,8 @@
         @(Model)!!!

         Click this pink square to record a three second video of you saying
         @Model in your language of choice.

-        If you don't like your number please hit refresh.

+        If you don't like your number refresh the page to see what other
+        counts are left.

         Make yourself comfortable and get ready to join A Thousand Counts.

         3, 2, 1, COUNT!


2D Zeichnungen auslesen mit Test

2D Zeichnungen auslesen mit Test

--- Addin/MasterModel/MasterModel/Sherlock.cs
+++ Addin/MasterModel/MasterModel/Sherlock.cs
@@ -14,14 +14,31 @@
         MasterM partypart = new MasterM();
         public void Investigate(PartDocument suspect)
         {
+            List<string> test = new List<string>();
             //sketches
             foreach (Sketch sketchy in suspect.ComponentDefinition.Sketches)
             {
                 partypart.SketchyList.Add(sketchy);
-                MessageBox.Show(sketchy.AttributeSets.ToString());
+                //Test
+                test.Add("    "+sketchy.Name+": ");
+                foreach (Inventor.SketchEntity Ente in sketchy.SketchEntities)
+                {
+                    test.Add( Ente.Type.ToString());
+
+                }
+                //End Test
             }
+            //Test
+            var message = string.Join(",", test);
+            MessageBox.Show(message);
+            //End Test
+
             //Parameter
             partypart.param = suspect.ComponentDefinition.Parameters;
+            //Test
+            var message2 = string.Join(",", partypart.param.ToString());
+            MessageBox.Show(message2);
+            //End Test
         }
         public void ShowShakespeare()
         {


Made smilies rule lower priority -- was conflicting with URLs.

--- yafsrc/YAF.Classes/YAF.Classes.UI/FormatMsg.cs
+++ yafsrc/YAF.Classes/YAF.Classes.UI/FormatMsg.cs
@@ -205,8 +205,8 @@
 																								) );

 				// increase the rank as we go...
-				lowerRule.RuleRank = lowerRule.RuleRank + codeOffset;
-				upperRule.RuleRank = upperRule.RuleRank + codeOffset;
+				lowerRule.RuleRank = lowerRule.RuleRank + 100 + codeOffset;
+				upperRule.RuleRank = upperRule.RuleRank + 100 + codeOffset;

 				rules.AddRule( lowerRule );
 				rules.AddRule( upperRule );
@@ -288,7 +288,7 @@

 				VariableRegexReplaceRule url =
 					new VariableRegexReplaceRule(
-						@"(?<before>^|[ ]|
)(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?+%#&=;,]*)?)",
+						@"(?<before>^|[ ]|
)(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?+%#&=;:,]*)?)",
 						"${before}${innertrunc}".Replace( "{0}", target ).Replace( "{1}", nofollow ),
 						_options,
 						new string [] { "before" },
@@ -301,7 +301,7 @@

 				url =
 					new VariableRegexReplaceRule(
-						@"(?<before>^|[ ]|
)(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%&=+;,#~$]*[^.<])?)",
+						@"(?<before>^|[ ]|
)(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%&=+;,:#~$]*[^.<])?)",
 						"${before}${innertrunc}".Replace( "{0}", target ).Replace( "{1}", nofollow ),
 						_options,
 						new string [] { "before" },


organized code and  replaced First with Single

--- Scripts/CapturyAvatarManager.cs
+++ Scripts/CapturyAvatarManager.cs
@@ -92,6 +92,7 @@
         /// </summary>
         private List<ARTag> trackedARTags = new List<ARTag>();

+        #region Unity Methods
         private void Start()
         {
             // get config
@@ -129,6 +130,52 @@
             networkPlugin.ARTagsDetected += OnARTagsDetected;
         }

+        private void Update()
+        {
+            lock (newSkeletons)
+            {
+                lock (trackedSkeletons)
+                {
+                    InstantiateDefaultAvatars(newSkeletons);
+                }
+            }
+            lock (lostSkeletons)
+            {
+                lock (trackedSkeletons)
+                {
+                    DestroyAvatars(lostSkeletons);
+                }
+            }
+            lock (trackedSkeletons)
+            {
+                lock (trackedARTags)
+                {
+                    // get the AR tags which are attached to the players headset
+                    List<ARTag> trackedHeadsetTags = GetHeadsetARTags(trackedARTags);
+
+                    // check headset to skeleton assignment with AR tags
+                    if (playerSkeleton == null)
+                    {
+                        TryARTagToSkeletonAssignemnt(trackedHeadsetTags);
+                    }
+
+                    // Clear tracked AR Tags if there's no AR Tag update since last frame.
+                    if (arTagsUpdated == false)
+                    {
+                        ClearTrackedARTags();
+                    }
+
+                    if (Input.GetKeyDown(KeyCode.C))
+                    {
+                        // calibrate AR Tag offset
+                        CalibrateHeadsetARTags(trackedHeadsetTags, playerSkeleton);
+                    }
+
+                    arTagsUpdated = false;
+                }
+            }
+        }
+
         private void OnDestroy()
         {
             // unregister from events
@@ -144,71 +191,337 @@
         {
             CapturyConfigManager.SaveConfig();
         }
-
-        private void Update()
-        {
+        #endregion Unity Methods
+
+        /// <summary>
+        /// Can be called from a multiplayer manager to set the skeletons playerID
+        /// </summary>
+        /// <param name="skeletonID">Captury Skeleton id</param>
+        /// <param name="playerID">Networking Player id</param>
+        public void SetSkeletonPlayerID(int skeletonID, int playerID)
+        {
+            CapturySkeleton skel = trackedSkeletons.Single(s => s.id == skeletonID);
+            if (skel != null)
+            {
+                skel.playerID = playerID;
+            }
+        }
+
+        #region Captury Delegates
+        /// <summary>
+        /// Called when a new captury skeleton is found
+        /// </summary>
+        /// <param name="skeleton"></param>
+        private void OnSkeletonFound(CapturySkeleton skeleton)
+        {
+            Debug.Log("CapturyAvatarManager found skeleton with id " + skeleton.id + " and name " + skeleton.name);
             lock (newSkeletons)
             {
-                InstantiateDefaultAvatars(newSkeletons);
-            }
+                newSkeletons.Add(skeleton);
+            }
+        }
+
+        /// <summary>
+        /// Called when a captury skeleton is lost
+        /// </summary>
+        /// <param name="skeleton"></param>
+        private void OnSkeletonLost(CapturySkeleton skeleton)
+        {
+            Debug.Log("CapturyAvatarManager lost skeleton with id " + skeleton.id + " and name " + skeleton.name);
             lock (lostSkeletons)
             {
-                DestroyAvatars(lostSkeletons);
-            }
-            lock (trackedSkeletons)
-            {
-                lock (trackedARTags)
-                {
-                    // get the AR tags which are attached to the players headset
-                    List<ARTag> trackedHeadsetTags = GetHeadsetARTags(trackedARTags);
-
-                    // check headset to skeleton assignment with AR tags
-                    if (playerSkeleton == null)
-                    {
-                        foreach (var tag in trackedHeadsetTags)
+                lostSkeletons.Add(skeleton);
+            }
+            // clear the assignment between local player and the skelton if it's lost
+            if (IsLocalPlayer(skeleton))
+            {
+                ClearPlayerAssignment();
+            }
+        }
+
+        /// <summary>
+        /// Called when a Captury AR tags (markers) are detected
+        /// </summary>
+        /// <param name="tags"></param>
+        private void OnARTagsDetected(ARTag[] tags)
+        {
+            lock (trackedARTags)
+            {
+                List<ARTag> lostTags = new List<ARTag>();
+
+                // find lost AR tags and delete them
+                foreach (var prevTag in trackedARTags)
+                {
+                    ARTag newTag = tags.Single(item => item.id == prevTag.id);
+                    if (newTag == null)
+                    {
+                        // tag is no longer tracked
+                        lostTags.Add(prevTag);
+                        if (capturyConfig.debugARTags)
                         {
-                            CapturySkeleton skel = GetAttachedSkeleton(tag);
-                            if (skel != null)
+                            lock (trackedARTagGameObjects)
                             {
-                                if (skel.playerID == -1)
+                                GameObject gO = trackedARTagGameObjects[prevTag];
+                                DestroyImmediate(gO);
+                                trackedARTagGameObjects.Remove(prevTag);
+                            }
+                        }
+                    }
+                }
+                trackedARTags.RemoveAll(item => lostTags.Contains(item));
+
+                // find new AR tags / update existing
+                foreach (var tag in tags)
+                {
+                    int tagIndexInPrevTagsArray = trackedARTags.FindIndex(item => item.id == tag.id);
+                    if (tagIndexInPrevTagsArray != -1)
+                    {
+                        // update AR tag
+                        trackedARTags[tagIndexInPrevTagsArray] = tag;
+                        if (capturyConfig.debugARTags)
+                        {
+                            lock (trackedARTagGameObjects)
+                            {
+                                // update pose
+                                GameObject gO = trackedARTagGameObjects.Single(item => item.Key.id == tag.id).Value;
+                                if (gO != null)
                                 {
-                                    AssignPlayerToSkeleton(skel);
-                                }
-                                else
-                                {
-                                    Debug.Log("Skeleton " + skel.id + " is already assigned to player " + skel.playerID);
+                                    gO.transform.position = tag.translation;
+                                    gO.transform.rotation = tag.rotation;
                                 }
                             }
                         }
                     }
-
-
-                    // Clear tracked AR Tags if there's no AR Tag update since last frame.
-                    if (arTagsUpdated == false)
-                    {
-                        trackedARTags.Clear();
+                    else
+                    {
+                        // new AR tag found
+                        trackedARTags.Add(tag);
                         if (capturyConfig.debugARTags)
                         {
-                            foreach (var tag in trackedARTagGameObjects)
+                            lock (trackedARTagGameObjects)
                             {
-                                DestroyImmediate(tag.Value);
+                                // can be optimized with object pool
+                                GameObject gO = GameObject.CreatePrimitive(PrimitiveType.Cube);
+                                gO.name = "arTag " + tag.id;
+                                gO.transform.localScale = new Vector3(0.1f, 0.1f, 0.01f);
+                                trackedARTagGameObjects.Add(tag, gO);
                             }
-                            trackedARTagGameObjects.Clear();
                         }
                     }
-
-                    if (Input.GetKeyDown(KeyCode.C))
-                    {
-                        // calibrate AR Tag offset
-                        CalibrateHeadsetARTags(trackedHeadsetTags, playerSkeleton);
-                    }
-
-                    arTagsUpdated = false;
-                }
-            }
-
-        }
-
+                }
+
+                arTagsUpdated = true;
+            }
+        }
+        #endregion
+
+        #region Avatars
+        /// <summary>
+        /// Returns the avatar prefab with the given avatarID from <see cref="localAvatarPrefabs"/> or <see cref="remoteAvatarPrefabs"/> depending on isLocal.
+        /// If avatarID is invalid, <see cref="defaultAvatar"/> will be returned
+        /// </summary>
+        /// <param name="avatarID"></param>
+        /// <param name="isLocal"></param>
+        /// <returns>Avatar prefab</returns>
+        private GameObject GetAvatarPrefab(int avatarID, bool isLocal)
+        {
+            GameObject[] avatars;
+            if (isLocal)
+            {
+                avatars = localAvatarPrefabs;
+            }
+            else
+            {
+                avatars = remoteAvatarPrefabs;
+            }
+            if (avatarID < 0 || avatarID > avatars.Length)
+            {
+                Debug.LogError("Trying to get avatar for invalid id " + avatarID + ". returning defaultAvatar!");
+                return defaultAvatar;
+            }
+            return avatars[avatarID];
+        }
+
+        /// <summary>
+        /// Instantiates and sets the given avatarPrefab for the CapturySkeleton
+        /// </summary>
+        /// <param name="skel"></param>
+        /// <param name="avatarPrefab"></param>
+        private void SetAvatar(CapturySkeleton skel, GameObject avatarPrefab)
+        {
+            GameObject avatar = Instantiate(avatarPrefab);
+            DontDestroyOnLoad(avatar);
+            avatar.SetActive(true);
+            if(skel.mesh != null)
+            {
+                // destory old avatar
+                DestroyImmediate(skel.mesh);
+            }
+            skel.mesh = avatar;
+        }
+
+        /// <summary>
+        /// Instantiates default avatars for the given list of skeletons
+        /// </summary>
+        /// <param name="skeletons"></param>
+        private void InstantiateDefaultAvatars(List<CapturySkeleton> skeletons)
+        {
+            foreach (CapturySkeleton skel in skeletons)
+            {
+                Debug.Log("Instantiating avatar for skeleton with id " + skel.id + " and name " + skel.name);
+                SetAvatar(skel, defaultAvatar);
+                trackedSkeletons.Add(skel);
+            }
+            skeletons.Clear();
+        }
+
+        /// <summary>
+        /// Destorys avatars for the given list of skeletons
+        /// </summary>
+        private void DestroyAvatars(List<CapturySkeleton> skeltons)
+        {
+            foreach (CapturySkeleton skel in skeltons)
+            {
+                Debug.Log("Destroying avatar for skeleton with id " + skel.id + " and name " + skel.name);
+                DestroyImmediate(skel.mesh);
+                skel.mesh = null;
+                trackedSkeletons.Remove(skel);
+            }
+            skeltons.Clear();
+        }
+        #endregion
+
+        #region CapturySkeleton To Avatar Handling
+        /// <summary>
+        /// Assigns the local player to the given <see cref="CapturySkeleton"/>.
+        /// </summary>
+        /// <param name="skeleton"></param>
+        private void AssignPlayerToSkeleton(CapturySkeleton skeleton)
+        {
+            // instantiate the local player avatar
+            GameObject avatarPrefab = GetAvatarPrefab(capturyConfig.avatarID, true);
+            SetAvatar(skeleton, avatarPrefab);
+            playerSkeleton = skeleton;
+
+            Transform left = null;
+            Transform right = null;
+            Transform head = null;
+            GameObject avatar = skeleton.mesh.gameObject;
+            Component[] trafos = avatar.transform.GetComponentsInChildren<Transform>();
+            foreach (Transform child in trafos)
+            {
+                if (child.name.EndsWith(AVATAR_LEFT_HAND_TRANSFORM_NAME))
+                {
+                    left = child;
+                }
+                if (child.name.EndsWith(AVATAR_RIGHT_HAND_TRANSFORM_NAME))
+                {
+                    right = child;
+                }
+                if (child.name.EndsWith(AVATAR_HEAD_TRANSFORM_NAME))
+                {
+                    head = child;
+                }
+            }
+            if (left != null && right != null)
+            {
+                capturyLeapIntegration.setTargetModel(left, right, skeleton.id);
+            }
+            else
+            {
+                Debug.Log("Cannot find hands on target avatar with name '" + AVATAR_LEFT_HAND_TRANSFORM_NAME + "' and '" + AVATAR_RIGHT_HAND_TRANSFORM_NAME + "'");
+            }
+
+            if (head != null)
+            {
+                transformFollower.Target = head;
+            }
+            else
+            {
+                Debug.Log("Cannot find head on target avatar with name " + AVATAR_HEAD_TRANSFORM_NAME);
+            }
+
+            if (PlayerAssignmentChanged != null)
+            {
+                PlayerAssignmentChanged(playerSkeleton.id, true);
+            }
+            Debug.Log("Assigned local player to skeleton with name " + skeleton.name + " and id " + skeleton.id);
+        }
+
+        /// <summary>
+        /// Clears the assignment of the local player with an skeleton
+        /// </summary>
+        private void ClearPlayerAssignment()
+        {
+            if(playerSkeleton == null)
+            {
+                Debug.LogError("Trying to clear player assignment, but playerSkeleton == null");
+                return;
+            }
+
+            if (PlayerAssignmentChanged != null)
+            {
+                PlayerAssignmentChanged(playerSkeleton.id, false);
+            }
+
+            playerSkeleton.playerID = -1;
+            capturyLeapIntegration.setTargetModel(null, null, -1);
+            transformFollower.Target = null;
+            playerSkeleton = null;
+        }
+        #endregion Skeleton To Player Assignment
+
+        #region CapturySkeleton Helper
+        /// <summary>
+        /// Returns the head <see cref="CapturySkeletonJoint"/> of the given <see cref="CapturySkeleton"/> by looking for <see cref="CapturyNetworkPlugin.HeadJointName"/>
+        /// </summary>
+        /// <param name="skel"></param>
+        /// <returns></returns>
+        private CapturySkeletonJoint GetHeadJoint(CapturySkeleton skel)
+        {
+            return skel.joints.Single(item => item.name == CapturyNetworkPlugin.HeadJointName);
+        }
+
+        /// <summary>
+        /// Return true if the given skeleton is the local player skeleton
+        /// </summary>
+        /// <param name="skeleton"></param>
+        /// <returns></returns>
+        private bool IsLocalPlayer(CapturySkeleton skeleton)
+        {
+            return skeleton.Equals(playerSkeleton);
+        }
+        #endregion CapturySkeleton Helper
+
+        #region AR Tag Helper
+        /// <summary>
+        /// Get all <see cref="ARTag"/>s in the given list which are assigned to the headset. This is defined in <see cref="capturyConfig"/>.
+        /// </summary>
+        /// <param name="tags"></param>
+        /// <returns>List of AR Tags which are assigned to the headset</returns>
+        private List<ARTag> GetHeadsetARTags(List<ARTag> tags)
+        {
+            return tags.Where(tag => capturyConfig.headsetARTags.Any(headsetTag => headsetTag.id == tag.id)).ToList();
+        }
+
+        /// <summary>
+        /// Clears <see cref="trackedARTags"/> and <see cref="trackedARTagGameObjects"/>
+        /// </summary>
+        private void ClearTrackedARTags()
+        {
+            trackedARTags.Clear();
+            if (capturyConfig.debugARTags)
+            {
+                foreach (var tag in trackedARTagGameObjects)
+                {
+                    DestroyImmediate(tag.Value);
+                }
+                trackedARTagGameObjects.Clear();
+            }
+        }
+        #endregion AR Tags
+
+        #region AR Tag To CapturySkeleton Handling
         /// <summary>
         /// Looks for <see cref="ARTag"/>s in arTags which are assigned to the player/headset.
         /// The offset from the found tags to the given <see cref="CapturySkeleton"/> head joint will be saved to <see cref="capturyConfig"/>.
@@ -217,7 +530,7 @@
         /// <param name="skel"><see cref="CapturySkeleton"/> which head joint will be used to calculate the offsets.</param>
         private void CalibrateHeadsetARTags(List<ARTag> arTags, CapturySkeleton skel)
         {
-            if(arTags != null && skel != null)
+            if (arTags != null && skel != null)
             {
                 List<ARTag> headsetTags = GetHeadsetARTags(arTags);
                 CapturySkeletonJoint headJoint = GetHeadJoint(playerSkeleton);
@@ -255,206 +568,6 @@
         }

         /// <summary>
-        /// Can be called from a multiplayer manager to set the skeletons playerID
-        /// </summary>
-        /// <param name="skeletonID">Captury Skeleton id</param>
-        /// <param name="playerID">Networking Player id</param>
-        public void SetSkeletonPlayerID(int skeletonID, int playerID)
-        {
-            CapturySkeleton skel = trackedSkeletons.First(s => s.id == skeletonID);
-            if (skel != null)
-            {
-                skel.playerID = playerID;
-            }
-        }
-
-        /// <summary>
-        /// Called when a new captury skeleton is found
-        /// </summary>
-        /// <param name="skeleton"></param>
-        private void OnSkeletonFound(CapturySkeleton skeleton)
-        {
-            Debug.Log("CapturyAvatarManager found skeleton with id " + skeleton.id + " and name " + skeleton.name);
-            lock (newSkeletons)
-            {
-                newSkeletons.Add(skeleton);
-            }
-        }
-
-        /// <summary>
-        /// Called when a captury skeleton is lost
-        /// </summary>
-        /// <param name="skeleton"></param>
-        private void OnSkeletonLost(CapturySkeleton skeleton)
-        {
-            Debug.Log("CapturyAvatarManager lost skeleton with id " + skeleton.id + " and name " + skeleton.name);
-            lock (lostSkeletons)
-            {
-                lostSkeletons.Add(skeleton);
-            }
-            // clear the assignment between local player and the skelton if it's lost
-            if (IsLocalPlayer(skeleton))
-            {
-                ClearPlayerAssignment();
-            }
-        }
-
-        /// <summary>
-        /// Called when a Captury AR tags (markers) are detected
-        /// </summary>
-        /// <param name="tags"></param>
-        private void OnARTagsDetected(ARTag[] tags)
-        {
-            lock (trackedARTags)
-            {
-                List<ARTag> lostTags = new List<ARTag>();
-
-                // find lost AR tags and delete them
-                foreach (var prevTag in trackedARTags)
-                {
-                    ARTag newTag = tags.First(item => item.id == prevTag.id);
-                    if (newTag == null)
-                    {
-                        // tag is no longer tracked
-                        lostTags.Add(prevTag);
-                        if (capturyConfig.debugARTags)
-                        {
-                            lock (trackedARTagGameObjects)
-                            {
-                                GameObject gO = trackedARTagGameObjects[prevTag];
-                                DestroyImmediate(gO);
-                                trackedARTagGameObjects.Remove(prevTag);
-                            }
-                        }
-                    }
-                }
-                trackedARTags.RemoveAll(item => lostTags.Contains(item));
-
-                // find new AR tags / update existing
-                foreach (var tag in tags)
-                {
-                    int tagIndexInPrevTagsArray = trackedARTags.FindIndex(item => item.id == tag.id);
-                    if (tagIndexInPrevTagsArray != -1)
-                    {
-                        // update AR tag
-                        trackedARTags[tagIndexInPrevTagsArray] = tag;
-                        if (capturyConfig.debugARTags)
-                        {
-                            lock (trackedARTagGameObjects)
-                            {
-                                // update pose
-                                GameObject gO = trackedARTagGameObjects.First(item => item.Key.id == tag.id).Value;
-                                if (gO != null)
-                                {
-                                    gO.transform.position = tag.translation;
-                                    gO.transform.rotation = tag.rotation;
-                                }
-                            }
-                        }
-                    }
-                    else
-                    {
-                        // new AR tag found
-                        trackedARTags.Add(tag);
-                        if (capturyConfig.debugARTags)
-                        {
-                            lock (trackedARTagGameObjects)
-                            {
-                                // can be optimized with object pool
-                                GameObject gO = GameObject.CreatePrimitive(PrimitiveType.Cube);
-                                gO.name = "arTag " + tag.id;
-                                gO.transform.localScale = new Vector3(0.1f, 0.1f, 0.01f);
-                                trackedARTagGameObjects.Add(tag, gO);
-                            }
-                        }
-                    }
-                }
-
-                arTagsUpdated = true;
-            }
-        }
-
-        /// <summary>
-        /// Returns the avatar prefab with the given avatarID from <see cref="localAvatarPrefabs"/> or <see cref="remoteAvatarPrefabs"/> depending on isLocal.
-        /// If avatarID is invalid, <see cref="defaultAvatar"/> will be returned
-        /// </summary>
-        /// <param name="avatarID"></param>
-        /// <param name="isLocal"></param>
-        /// <returns>Avatar prefab</returns>
-        private GameObject GetAvatarPrefab(int avatarID, bool isLocal)
-        {
-            GameObject[] avatars;
-            if (isLocal)
-            {
-                avatars = localAvatarPrefabs;
-            }
-            else
-            {
-                avatars = remoteAvatarPrefabs;
-            }
-            if (avatarID < 0 || avatarID > avatars.Length)
-            {
-                Debug.LogError("Trying to get avatar for invalid id " + avatarID + ". returning defaultAvatar!");
-                return defaultAvatar;
-            }
-            return avatars[avatarID];
-        }
-
-        /// <summary>
-        /// Instantiates and sets the given avatarPrefab for the CapturySkeleton
-        /// </summary>
-        /// <param name="skel"></param>
-        /// <param name="avatarPrefab"></param>
-        private void SetAvatar(CapturySkeleton skel, GameObject avatarPrefab)
-        {
-            GameObject avatar = Instantiate(avatarPrefab);
-            DontDestroyOnLoad(avatar);
-            avatar.SetActive(true);
-            if(skel.mesh != null)
-            {
-                // destory old avatar
-                DestroyImmediate(skel.mesh);
-            }
-            skel.mesh = avatar;
-        }
-
-        /// <summary>
-        /// Instantiates default avatars for the given list of skeletons
-        /// </summary>
-        /// <param name="skeletons"></param>
-        private void InstantiateDefaultAvatars(List<CapturySkeleton> skeletons)
-        {
-            lock (trackedSkeletons)
-            {
-                foreach (CapturySkeleton skel in skeletons)
-                {
-                    Debug.Log("Instantiating avatar for skeleton with id " + skel.id + " and name " + skel.name);
-                    SetAvatar(skel, defaultAvatar);
-                    trackedSkeletons.Add(skel);
-                }
-                skeletons.Clear();
-            }
-        }
-
-        /// <summary>
-        /// Destorys avatars for the given list of skeletons
-        /// </summary>
-        private void DestroyAvatars(List<CapturySkeleton> skeltons)
-        {
-            lock (trackedSkeletons)
-            {
-                foreach (CapturySkeleton skel in skeltons)
-                {
-                    Debug.Log("Destroying avatar for skeleton with id " + skel.id + " and name " + skel.name);
-                    DestroyImmediate(skel.mesh);
-                    skel.mesh = null;
-                    trackedSkeletons.Remove(skel);
-                }
-                skeltons.Clear();
-            }
-        }
-
-        /// <summary>
         /// Checks if the <see cref="ARTag"/> is attached to the <see cref="CapturySkeleton"/> by comparing their positions
         /// </summary>
         /// <param name="tag"></param>
@@ -480,7 +593,7 @@
         /// <returns>The skeleton which tag is attached to. null if there's none.</returns>
         private CapturySkeleton GetAttachedSkeleton(ARTag tag)
         {
-            foreach(var skel in trackedSkeletons)
+            foreach (var skel in trackedSkeletons)
             {
                 if (IsAttachedToSkeleton(tag, skel))
                 {
@@ -490,111 +603,24 @@
             return null;
         }

-        /// <summary>
-        /// Assigns the local player to the given <see cref="CapturySkeleton"/>.
-        /// </summary>
-        /// <param name="skeleton"></param>
-        private void AssignPlayerToSkeleton(CapturySkeleton skeleton)
-        {
-            // instantiate the local player avatar
-            GameObject avatarPrefab = GetAvatarPrefab(capturyConfig.avatarID, true);
-            SetAvatar(skeleton, avatarPrefab);
-            playerSkeleton = skeleton;
-
-            Transform left = null;
-            Transform right = null;
-            Transform head = null;
-            GameObject avatar = skeleton.mesh.gameObject;
-            Component[] trafos = avatar.transform.GetComponentsInChildren<Transform>();
-            foreach (Transform child in trafos)
-            {
-                if (child.name.EndsWith(AVATAR_LEFT_HAND_TRANSFORM_NAME))
-                {
-                    left = child;
-                }
-                if (child.name.EndsWith(AVATAR_RIGHT_HAND_TRANSFORM_NAME))
-                {
-                    right = child;
-                }
-                if (child.name.EndsWith(AVATAR_HEAD_TRANSFORM_NAME))
-                {
-                    head = child;
-                }
-            }
-            if (left != null && right != null)
-            {
-                capturyLeapIntegration.setTargetModel(left, right, skeleton.id);
-            }
-            else
-            {
-                Debug.Log("Cannot find hands on target avatar with name '" + AVATAR_LEFT_HAND_TRANSFORM_NAME + "' and '" + AVATAR_RIGHT_HAND_TRANSFORM_NAME + "'");
-            }
-
-            if (head != null)
-            {
-                transformFollower.Target = head;
-            }
-            else
-            {
-                Debug.Log("Cannot find head on target avatar with name " + AVATAR_HEAD_TRANSFORM_NAME);
-            }
-
-            if (PlayerAssignmentChanged != null)
-            {
-                PlayerAssignmentChanged(playerSkeleton.id, true);
-            }
-            Debug.Log("Assigned local player to skeleton with name " + skeleton.name + " and id " + skeleton.id);
-        }
-
-        /// <summary>
-        /// Clears the assignment of the local player with an skeleton
-        /// </summary>
-        private void ClearPlayerAssignment()
-        {
-            if(playerSkeleton == null)
-            {
-                Debug.LogError("Trying to clear player assignment, but playerSkeleton == null");
-                return;
-            }
-
-            if (PlayerAssignmentChanged != null)
-            {
-                PlayerAssignmentChanged(playerSkeleton.id, false);
-            }
-
-            playerSkeleton.playerID = -1;
-            capturyLeapIntegration.setTargetModel(null, null, -1);
-            transformFollower.Target = null;
-            playerSkeleton = null;
-        }
-
-        /// <summary>
-        /// Return true if the given skeleton is the local player skeleton
-        /// </summary>
-        /// <param name="skeleton"></param>
-        /// <returns></returns>
-        private bool IsLocalPlayer(CapturySkeleton skeleton)
-        {
-            return skeleton.Equals(playerSkeleton);
-        }
-
-        #region CapturySkeleton Helper
-        private CapturySkeletonJoint GetHeadJoint(CapturySkeleton skel)
-        {
-            return skel.joints.Single(item => item.name == CapturyNetworkPlugin.HeadJointName);
-        }
-        #endregion CapturySkeleton Helper
-
-        #region AR Tags
-        /// <summary>
-        /// Get all <see cref="ARTag"/>s in the given list which are assigned to the headset. This is defined in <see cref="capturyConfig"/>.
-        /// </summary>
-        /// <param name="tags"></param>
-        /// <returns>List of AR Tags which are assigned to the headset</returns>
-        private List<ARTag> GetHeadsetARTags(List<ARTag> tags)
-        {
-            return tags.Where(tag => capturyConfig.headsetARTags.Any(headsetTag => headsetTag.id == tag.id)).ToList();
-        }
-        #endregion AR Tags
+        private void TryARTagToSkeletonAssignemnt(List<ARTag> trackedHeadsetTags)
+        {
+            foreach (var tag in trackedHeadsetTags)
+            {
+                CapturySkeleton skel = GetAttachedSkeleton(tag);
+                if (skel != null)
+                {
+                    if (skel.playerID == -1)
+                    {
+                        AssignPlayerToSkeleton(skel);
+                    }
+                    else
+                    {
+                        Debug.Log("Skeleton " + skel.id + " is already assigned to player " + skel.playerID);
+                    }
+                }
+            }
+        }
+        #endregion AR Tag CapturySkeleton
     }
 }


Array optimization (lazy load)

Array optimization (lazy load)

--- src/Couchbase.Lite/API/Document/ArrayObject.cs
+++ src/Couchbase.Lite/API/Document/ArrayObject.cs
@@ -21,6 +21,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Globalization;
 using System.Linq;
 using System.Reflection;
@@ -74,7 +75,16 @@
         #region Properties

         /// <inheritdoc />
-        public override int Count => _list.Count;
+        public override int Count
+        {
+            get {
+                if (_list == null) {
+                    return base.Count;
+                }
+
+                return _list.Count;
+            }
+        }

         /// <inheritdoc />
         public new Fragment this[int index]
@@ -93,7 +103,7 @@
         /// Default Constructor
         /// </summary>
         public ArrayObject()
-            : this(default(FleeceArray))
+            : base(default(FleeceArray))
         {

         }
@@ -111,17 +121,18 @@
         internal ArrayObject(FleeceArray data)
             : base(data)
         {
-            _list = new List<object>();
-            LoadBackingData();
+
         }

         #endregion

         #region Private Methods

-        private void LoadBackingData()
-        {
+        private void CopyFleeceData()
+        {
+            Debug.Assert(_list == null);
             var count = base.Count;
+            _list = new List<object>(count);
             for (int i = 0; i < count; i++) {
                 var value = base.GetObject(i);
                 _list.Add(DataOps.ConvertValue(value, ObjectChanged, ObjectChanged));
@@ -180,18 +191,26 @@
         /// <inheritdoc />
         public override IEnumerator<object> GetEnumerator()
         {
+            if (_list == null) {
+                return base.GetEnumerator();
+            }
+
             return _list.Cast<object>().GetEnumerator();
         }

         /// <inheritdoc />
         public override Blob GetBlob(int index)
         {
-            return _list[index] as Blob;
+            return GetObject(index) as Blob;
         }

         /// <inheritdoc />
         public override bool GetBoolean(int index)
         {
+            if (_list == null) {
+                return base.GetBoolean(index);
+            }
+
             var value = _list[index];
             return DataOps.ConvertToBoolean(value);
         }
@@ -199,13 +218,16 @@
         /// <inheritdoc />
         public override DateTimeOffset GetDate(int index)
         {
-            var value = _list[index];
-            return DataOps.ConvertToDate(value);
+            return DataOps.ConvertToDate(GetObject(index));
         }

         /// <inheritdoc />
         public override double GetDouble(int index)
         {
+            if (_list == null) {
+                return base.GetDouble(index);
+            }
+
             var value = _list[index];
             return DataOps.ConvertToDouble(value);
         }
@@ -213,6 +235,10 @@
         /// <inheritdoc />
         public override int GetInt(int index)
         {
+            if (_list == null) {
+                return base.GetInt(index);
+            }
+
             var value = _list[index];
             return DataOps.ConvertToInt(value);
         }
@@ -220,6 +246,10 @@
         /// <inheritdoc />
         public override long GetLong(int index)
         {
+            if (_list == null) {
+                return base.GetLong(index);
+            }
+
             var value = _list[index];
             return DataOps.ConvertToLong(value);
         }
@@ -227,18 +257,30 @@
         /// <inheritdoc />
         public override object GetObject(int index)
         {
+            if (_list == null) {
+                var value = base.GetObject(index);
+                if (value is IReadOnlyDictionary || value is IReadOnlyArray) {
+                    CopyFleeceData();
+                } else {
+                    return value;
+                }
+            }
             return _list[index];
         }

         /// <inheritdoc />
         public override string GetString(int index)
         {
-            return _list[index] as string;
+            return GetObject(index) as string;
         }

         /// <inheritdoc />
         public override IList<object> ToList()
         {
+            if (_list == null) {
+                CopyFleeceData();
+            }
+
             var array = new List<object>();
             foreach (var item in _list) {
                 switch (item) {
@@ -264,6 +306,10 @@
         /// <inheritdoc />
         public IArray Add(object value)
         {
+            if (_list == null) {
+                CopyFleeceData();
+            }
+
             _list.Add(DataOps.ConvertValue(value, ObjectChanged, ObjectChanged));
             SetChanged();
             return this;
@@ -272,18 +318,22 @@
         /// <inheritdoc />
         public new IArray GetArray(int index)
         {
-            return _list[index] as IArray;
+            return GetObject(index) as IArray;
         }

         /// <inheritdoc />
         public new IDictionaryObject GetDictionary(int index)
         {
-            return _list[index] as IDictionaryObject;
+            return GetObject(index) as IDictionaryObject;
         }

         /// <inheritdoc />
         public IArray Insert(int index, object value)
         {
+            if (_list == null) {
+                CopyFleeceData();
+            }
+
             _list.Insert(index, DataOps.ConvertValue(value, ObjectChanged, ObjectChanged));
             SetChanged();
             return this;
@@ -292,6 +342,10 @@
         /// <inheritdoc />
         public IArray RemoveAt(int index)
         {
+            if (_list == null) {
+                CopyFleeceData();
+            }
+
             var value = _list[index];
             RemoveChangedListener(value);
             _list.RemoveAt(index);
@@ -317,6 +371,10 @@
         /// <inheritdoc />
         public IArray Set(int index, object value)
         {
+            if (_list == null) {
+                CopyFleeceData();
+            }
+
             var oldValue = _list[index];
             if (value?.Equals(oldValue) == false) {
                 value = DataOps.ConvertValue(value, ObjectChanged, ObjectChanged);


Target Server/Port fixed in ListView

Target Server/Port fixed in ListView

--- Server/Forms/FrmReverseProxy.cs
+++ Server/Forms/FrmReverseProxy.cs
@@ -54,11 +54,16 @@
                         string TotalReceivedStr = GetSizeStr(ProxyClient.LengthReceived);
                         string TotalSendStr = GetSizeStr(ProxyClient.LengthSended);

+                        ProxyClient.ListItem.SubItems[0].Text = ProxyClient.TargetServer;
+                        ProxyClient.ListItem.SubItems[1].Text = ProxyClient.TargetPort.ToString();
+
                         if (ProxyClient.ListItem.SubItems[2].Text != TotalReceivedStr)
                             ProxyClient.ListItem.SubItems[2].Text = TotalReceivedStr;

                         if (ProxyClient.ListItem.SubItems[3].Text != TotalSendStr)
                             ProxyClient.ListItem.SubItems[3].Text = TotalSendStr;
+
+

                         if (!ProxyClient.IsConnected)
                         {


Fix hang on Mac - RunOnIdle->CreateFolderWindow

--- ApplicationView/MenuRow/MenuOptionFile.cs
+++ ApplicationView/MenuRow/MenuOptionFile.cs
@@ -61,11 +61,14 @@
 			{
 				if (createFolderWindow == null)
 				{
-					createFolderWindow = new CreateFolderWindow((returnInfo) =>
+					UiThread.RunOnIdle(() =>
 					{
-						AddLocalFolderToLibrary(this, new StringEventArgs(returnInfo.newName));
+						createFolderWindow = new CreateFolderWindow((returnInfo) =>
+						{
+							AddLocalFolderToLibrary(this, new StringEventArgs(returnInfo.newName));
+						});
+						createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; };
 					});
-					createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; };
 				}
 				else
 				{


version 0.5.2

version 0.5.2

--- src/DiabloInterface/Properties/AssemblyInfo.cs
+++ src/DiabloInterface/Properties/AssemblyInfo.cs
@@ -21,5 +21,5 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("25bb3310-9bd7-4234-af7d-9f7fb6870a20")]

-[assembly: AssemblyVersion("0.5.1")]
-[assembly: AssemblyInformationalVersion("0.5.1")]
+[assembly: AssemblyVersion("0.5.2")]
+[assembly: AssemblyInformationalVersion("0.5.2")]


Hard code content-range.

Hard code content-range.

--- AspNetCoreMultipartByterRanges/Startup.cs
+++ AspNetCoreMultipartByterRanges/Startup.cs
@@ -22,15 +22,20 @@
             var response = context.Response;
             response.ContentType = $"multipart/byteranges; boundary={Boundary}";

+            // TODO Softcode the 'Content-length' and 'Content-range' headers.
+            response.ContentLength = 13486;
+            var contentLength = response.ContentLength.Value;
+
             await response.WriteAsync(Boundary + CrLf);
-            await AddImage(response, "./blue.jpg");
-            await AddImage(response, "./red.jpg");
-            await AddImage(response, "./green.jpg");
+            await AddImage(response, "./blue.jpg", 301, 600, contentLength);
+            await AddImage(response, "./red.jpg", 601, 900, contentLength);
+            await AddImage(response, "./green.jpg", 901, contentLength, contentLength);
             response.Body.Flush();
         });
     }

-    private async Task AddImage(HttpResponse response, string path)
+    private async Task AddImage(HttpResponse response, string path,
+        long start, long end, long total)
     {
         if (!File.Exists(path))
         {
@@ -40,16 +45,19 @@
         var bytes = File.ReadAllBytes(path);
         var file = new FileContentResult(bytes, "image/jpg");

-        await response.WriteAsync("Content-type: " + file.ContentType.ToString() + CrLf);
-
-        // TODO Add Content-range header. This will take some thought. :)
-
+        await response
+            .WriteAsync($"Content-type: {file.ContentType.ToString()}" + CrLf);
+
+        await response
+            .WriteAsync($"Content-range: bytes {start}-{end}/{total}" + CrLf);
+
         await response.WriteAsync(CrLf);
         await response.Body.WriteAsync(
             file.FileContents,
             offset: 0,
             count: file.FileContents.Length);
         await response.WriteAsync(CrLf);
+
         await response.WriteAsync(Boundary + CrLf);
     }
 }


Update SkiaShapeRenderer.cs

Update SkiaShapeRenderer.cs

--- src/Draw2D.Skia/Renderers/SkiaShapeRenderer.cs
+++ src/Draw2D.Skia/Renderers/SkiaShapeRenderer.cs
@@ -318,16 +318,22 @@
                     break;
                 case Path2DLineEffect path2DLineEffect:
                     {
-                        inflateX = path2DLineEffect.Matrix?.ScaleX ?? 0.0;
-                        inflateY = path2DLineEffect.Matrix?.ScaleY ?? 0.0;
-                        isClipPath = true;
+                        if (path2DLineEffect.Matrix != null)
+                        {
+                            inflateX = Math.Max(Math.Abs(path2DLineEffect.Matrix.ScaleX), Math.Abs(path2DLineEffect.Matrix.SkewX));
+                            inflateY = Math.Max(Math.Abs(path2DLineEffect.Matrix.ScaleY), Math.Abs(path2DLineEffect.Matrix.SkewY));
+                            isClipPath = true;
+                        }
                     }
                     break;
                 case Path2DPathEffect path2DPathEffect:
                     {
-                        inflateX = path2DPathEffect.Matrix?.ScaleX ?? 0.0;
-                        inflateY = path2DPathEffect.Matrix?.ScaleY ?? 0.0;
-                        isClipPath = true;
+                        if (path2DPathEffect.Matrix != null)
+                        {
+                            inflateX = Math.Max(Math.Abs(path2DPathEffect.Matrix.ScaleX), Math.Abs(path2DPathEffect.Matrix.SkewX));
+                            inflateY = Math.Max(Math.Abs(path2DPathEffect.Matrix.ScaleY), Math.Abs(path2DPathEffect.Matrix.SkewY));
+                            isClipPath = true;
+                        }
                     }
                     break;
                 case PathComposeEffect pathComposeEffect:


refactor: expract the CreateTestFixture method.

--- src/Experiment.AutoFixture/TheoremAttribute.cs
+++ src/Experiment.AutoFixture/TheoremAttribute.cs
@@ -18,8 +18,13 @@
         /// <summary>
         /// Initializes a new instance of the <see cref="TheoremAttribute"/> class.
         /// </summary>
-        public TheoremAttribute() : base(() => new TestFixtureAdapter(new SpecimenContext(new Fixture())))
+        public TheoremAttribute() : base(CreateTestFixture)
         {
+        }
+
+        private static ITestFixture CreateTestFixture()
+        {
+            return new TestFixtureAdapter(new SpecimenContext(new Fixture()));
         }
     }
 }


try-catch for exceptions being thrown at tracing time

--- src/Medidata.ZipkinTracer.Core/ZipkinClient.cs
+++ src/Medidata.ZipkinTracer.Core/ZipkinClient.cs
@@ -59,25 +59,47 @@

         public void EndClientTrace(int duration)
         {
-            if ( isTraceOn )
-            {
-                spanTracer.ReceiveClientSpan(clientSpan, duration);
-            }
+            EndTrace(spanTracer.ReceiveClientSpan, clientSpan, duration);
         }

         public void StartServerTrace()
         {
-            if ( isTraceOn )
-            {
-                serverSpan = spanTracer.ReceiveServerSpan(requestName, traceProvider.TraceId, traceProvider.ParentSpanId, traceProvider.SpanId);
-            }
+            serverSpan = StartTrace(spanTracer.ReceiveServerSpan, requestName, traceProvider.TraceId, traceProvider.ParentSpanId, traceProvider.SpanId);
         }

         public void EndServerTrace(int duration)
         {
+            EndTrace(spanTracer.SendServerSpan, serverSpan, duration);
+        }
+
+        private Span StartTrace(Func<string, string, string, string, Span> func, string requestName, string traceId, string parentSpanId, string spanId)
+        {
             if ( isTraceOn )
             {
-                spanTracer.SendServerSpan(serverSpan, duration);
+                try
+                {
+                    return func(requestName, traceId, parentSpanId, spanId);
+                }
+                catch(Exception ex)
+                {
+                    //log
+                }
+            }
+            return null;
+        }
+
+        private void EndTrace(Action<Span, int> action, Span span, int duration)
+        {
+            if ( isTraceOn )
+            {
+                try
+                {
+                    action(span, duration);
+                }
+                catch(Exception ex)
+                {
+                    //log
+                }
             }
         }


removed extrea code

removed extrea code

--- Source/Tasks/ChangeSpeedTask.cs
+++ Source/Tasks/ChangeSpeedTask.cs
@@ -71,19 +71,16 @@
 				{
 					return NodeSpeed;
 				}
-				break;

 				case ENodeType.relative:
 				{
 					return NodeSpeed / Duration;
 				}
-				break;

 				default:
 				{
 					return ((NodeSpeed - bullet.Speed) / (Duration - RunDelta));
 				}
-				break;
 			}
 		}


adding handling for RST segments;

adding handling for RST segments;

--- examples/TCP/TCP.cs
+++ examples/TCP/TCP.cs
@@ -99,7 +99,14 @@
             int tcb_i = TCB.lookup (tcbs, packet);
             TcpPacket tcp_p = ((TcpPacket)(ip_p.PayloadPacket));

-            if (tcb_i < 0) {
+            if (tcb_i >= 0) {
+              // Quickly check if this is a reset, in which case we release
+              // resources related to the connection.
+              if (tcp_p.Rst) {
+                tcbs[tcb_i].free();
+                return ForwardingDecision.Drop.Instance;
+              }
+            } else {
               // This must be a new connection since there's no TCB for it.
               if (tcp_p.Syn) {
                 tcb_i = TCB.find_free_TCB(tcbs);


Respect TargetFileName on OverwriteOnInstall option

--- Source/src/WixSharp/Compiler.cs
+++ Source/src/WixSharp/Compiler.cs
@@ -1710,9 +1710,13 @@

                 if (wFile.OverwriteOnInstall)
                 {
+                    string removeFileName = wFile.TargetFileName.IsNotEmpty() ?
+                                            wFile.TargetFileName :
+                                            wFile.Name.PathGetFileName();
+
                     comp.AddElement("RemoveFile",
                                   $@"Id=Remove_{fileId};
-                                     Name={ wFile.Name.PathGetFileName()};
+                                     Name={ removeFileName };
                                      On=both");
                 }


#218 - Sync parallel queries for profile.

--- src/Money.UI.Blazor/Services/UserMiddleware.cs
+++ src/Money.UI.Blazor/Services/UserMiddleware.cs
@@ -15,18 +15,30 @@
         IEventHandler<EmailChanged>
     {
         private ProfileModel profile;
+        private Task getProfileTask;

         public async Task<object> ExecuteAsync(object query, HttpQueryDispatcher dispatcher, HttpQueryDispatcher.Next next)
         {
-            if (query is GetProfile)
+            if (query is GetProfile getProfile)
             {
                 if (profile == null)
-                    profile = (ProfileModel)await next(query);
+                {
+                    if (getProfileTask == null)
+                        getProfileTask = LoadProfileAsync(getProfile, next);
+
+                    await getProfileTask;
+                    getProfileTask = null;
+                }

                 return profile;
             }

             return await next(query);
+        }
+
+        private async Task LoadProfileAsync(GetProfile query, HttpQueryDispatcher.Next next)
+        {
+            profile = (ProfileModel)await next(query);
         }

         Task IEventHandler<EmailChanged>.HandleAsync(EmailChanged payload)


React to EF changes

React to EF changes

--- src/MusicStore.Spa/Models/MusicStoreContext.cs
+++ src/MusicStore.Spa/Models/MusicStoreContext.cs
@@ -63,10 +63,10 @@
             var album = builder.Model.GetEntityType(typeof(Album));
             var artist = builder.Model.GetEntityType(typeof(Artist));
             var orderDetail = builder.Model.GetEntityType(typeof(OrderDetail));
-            genre.AddNavigation(new Navigation(album.ForeignKeys.Single(k => k.ReferencedEntityType == genre), "Albums", pointsToPrincipal: false));
-            album.AddNavigation(new Navigation(orderDetail.ForeignKeys.Single(k => k.ReferencedEntityType == album), "OrderDetails", pointsToPrincipal: false));
-            album.AddNavigation(new Navigation(album.ForeignKeys.Single(k => k.ReferencedEntityType == genre), "Genre", pointsToPrincipal: true));
-            album.AddNavigation(new Navigation(album.ForeignKeys.Single(k => k.ReferencedEntityType == artist), "Artist", pointsToPrincipal: true));
+            genre.AddNavigation("Albums", album.ForeignKeys.Single(k => k.ReferencedEntityType == genre), pointsToPrincipal: false);
+            album.AddNavigation("OrderDetails", orderDetail.ForeignKeys.Single(k => k.ReferencedEntityType == album), pointsToPrincipal: false);
+            album.AddNavigation("Genre", album.ForeignKeys.Single(k => k.ReferencedEntityType == genre), pointsToPrincipal: true);
+            album.AddNavigation("Artist", album.ForeignKeys.Single(k => k.ReferencedEntityType == artist), pointsToPrincipal: true);
         }
     }


also reset start time on Reset for Meter

--- Src/Metrics/Core/MeterMetric.cs
+++ Src/Metrics/Core/MeterMetric.cs
@@ -14,7 +14,7 @@
         private readonly EWMA m15Rate = EWMA.FifteenMinuteEWMA();

         private readonly Clock clock;
-        private readonly long startTime;
+        private long startTime;

         private AtomicLong count = new AtomicLong();
         private readonly Scheduler tickScheduler;
@@ -109,6 +109,7 @@
             this.m1Rate.Reset();
             this.m5Rate.Reset();
             this.m15Rate.Reset();
+            this.startTime = this.clock.Nanoseconds;
         }
     }
 }