revised mutexes in Scenes/SceneManager.cs

--- OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -29,6 +29,7 @@
 using System.Collections.Generic;
 using System.Net;
 using System.Reflection;
+using System.Threading;
 using OpenMetaverse;
 using log4net;
 using OpenSim.Framework;
@@ -100,10 +101,22 @@
         }

         private readonly List<Scene> m_localScenes = new List<Scene>();
+        private ReaderWriterLock m_localScenesRwLock = new ReaderWriterLock();

         public List<Scene> Scenes
         {
-            get { return new List<Scene>(m_localScenes); }
+            get
+            {
+                m_localScenesRwLock.AcquireReaderLock(-1);
+                try
+                {
+                    return new List<Scene>(m_localScenes);
+                }
+                finally
+                {
+                    m_localScenesRwLock.ReleaseReaderLock();
+                }
+            }
         }

         /// <summary>
@@ -120,13 +133,18 @@
             {
                 if (CurrentScene == null)
                 {
-                    lock (m_localScenes)
+                    m_localScenesRwLock.AcquireReaderLock(-1);
+                    try
                     {
                         if (m_localScenes.Count > 0)
                             return m_localScenes[0];
                         else
                             return null;
                     }
+                    finally
+                    {
+                        m_localScenesRwLock.ReleaseReaderLock();
+                    }
                 }
                 else
                 {
@@ -143,18 +161,24 @@

         public void Close()
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 for (int i = 0; i < m_localScenes.Count; i++)
                 {
                     m_localScenes[i].Close();
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }
         }

         public void Close(Scene cscene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 if (m_localScenes.Contains(cscene))
                 {
@@ -167,12 +191,23 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }
         }

         public void Add(Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireWriterLock(-1);
+            try
+            {
                 m_localScenes.Add(scene);
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseWriterLock();
+            }

             scene.OnRestart += HandleRestart;
             scene.EventManager.OnRegionReadyStatusChange += HandleRegionReadyStatusChange;
@@ -182,7 +217,8 @@
         {
             Scene restartedScene = null;

-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireWriterLock(-1);
+            try
             {
                 for (int i = 0; i < m_localScenes.Count; i++)
                 {
@@ -193,6 +229,10 @@
                         break;
                     }
                 }
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseWriterLock();
             }

             // If the currently selected scene has been restarted, then we can't reselect here since we the scene
@@ -206,15 +246,23 @@

         private void HandleRegionReadyStatusChange(IScene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
+            {
                 AllRegionsReady = m_localScenes.TrueForAll(s => s.Ready);
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }
         }

         public void SendSimOnlineNotification(ulong regionHandle)
         {
             RegionInfo Result = null;

-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 for (int i = 0; i < m_localScenes.Count; i++)
                 {
@@ -241,6 +289,10 @@
                     m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }
         }

         /// <summary>
@@ -368,7 +420,8 @@
             }
             else
             {
-                lock (m_localScenes)
+                m_localScenesRwLock.AcquireReaderLock(-1);
+                try
                 {
                     foreach (Scene scene in m_localScenes)
                     {
@@ -379,6 +432,10 @@
                         }
                     }
                 }
+                finally
+                {
+                    m_localScenesRwLock.ReleaseReaderLock();
+                }

                 return false;
             }
@@ -388,7 +445,8 @@
         {
             m_log.Debug("Searching for Region: '" + regionID + "'");

-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -399,13 +457,18 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             return false;
         }

         public bool TryGetScene(string regionName, out Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene mscene in m_localScenes)
                 {
@@ -416,6 +479,10 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             scene = null;
             return false;
@@ -423,7 +490,8 @@

         public bool TryGetScene(UUID regionID, out Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene mscene in m_localScenes)
                 {
@@ -433,6 +501,10 @@
                         return true;
                     }
                 }
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
             }

             scene = null;
@@ -441,7 +513,8 @@

         public bool TryGetScene(uint locX, uint locY, out Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene mscene in m_localScenes)
                 {
@@ -453,6 +526,10 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             scene = null;
             return false;
@@ -460,7 +537,8 @@

         public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene mscene in m_localScenes)
                 {
@@ -471,6 +549,10 @@
                         return true;
                     }
                 }
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
             }

             scene = null;
@@ -511,7 +593,8 @@

         public RegionInfo GetRegionInfo(UUID regionID)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -521,6 +604,10 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             return null;
         }
@@ -537,7 +624,8 @@

         public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -547,6 +635,10 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             avatar = null;
             return false;
@@ -554,7 +646,8 @@

         public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -564,6 +657,10 @@
                         return true;
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             avatar = null;
             return false;
@@ -571,15 +668,23 @@

         public void CloseScene(Scene scene)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireWriterLock(-1);
+            try
+            {
                 m_localScenes.Remove(scene);
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseWriterLock();
+            }

             scene.Close();
         }

         public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -589,6 +694,10 @@
                     }
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             avatar = null;
             return false;
@@ -596,7 +705,8 @@

         public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
             {
                 foreach (Scene scene in m_localScenes)
                 {
@@ -605,6 +715,10 @@
                         return true;
                 }
             }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }

             sp = null;
             return false;
@@ -612,8 +726,15 @@

         public void ForEachScene(Action<Scene> action)
         {
-            lock (m_localScenes)
+            m_localScenesRwLock.AcquireReaderLock(-1);
+            try
+            {
                 m_localScenes.ForEach(action);
+            }
+            finally
+            {
+                m_localScenesRwLock.ReleaseReaderLock();
+            }
         }
     }
 }


Use ToString() rather than a cast (more robust)

--- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -558,7 +558,7 @@
                 else if (m_data[itemIndex] is Int32)
                     return new LSLInteger((int)m_data[itemIndex]);
                 else if (m_data[itemIndex] is LSL_Types.LSLString)
-                    return new LSLInteger((string)m_data[itemIndex]);
+                    return new LSLInteger(m_data[itemIndex].ToString());
                 else
                     throw new InvalidCastException();
             }


Simplify SceneSetupHelpers class by removing all code which was originally preserving service instances between tests.  This wasn't being used anyway and just leads to hard to diagnose test failures.

--- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -59,19 +59,14 @@
     {
         // These static variables in order to allow regions to be linked by shared modules and same
         // CommunicationsManager.
-        private static ISharedRegionModule m_assetService = null;
-//        private static ISharedRegionModule m_authenticationService = null;
         private static ISharedRegionModule m_inventoryService = null;
-        private static ISharedRegionModule m_gridService = null;
-        private static ISharedRegionModule m_userAccountService = null;
-        private static ISharedRegionModule m_presenceService = null;

         /// <summary>
         /// Set up a test scene
         /// </summary>
-        ///
+        /// <remarks>
         /// Automatically starts service threads, as would the normal runtime.
-        ///
+        /// </remarks>
         /// <returns></returns>
         public static TestScene SetupScene()
         {
@@ -156,10 +151,7 @@
             testScene.AddModule(godsModule.Name, godsModule);
             realServices = realServices.ToLower();

-            if (realServices.Contains("asset"))
-                StartAssetService(testScene, true);
-            else
-                StartAssetService(testScene, false);
+            LocalAssetServicesConnector assetService = StartAssetService(testScene, realServices.Contains("asset"));

             // For now, always started a 'real' authentication service
             StartAuthenticationService(testScene, true);
@@ -169,14 +161,15 @@
             else
                 StartInventoryService(testScene, false);

-            StartGridService(testScene, true);
-            StartUserAccountService(testScene);
-            StartPresenceService(testScene);
+                                                                   StartGridService(testScene, true);
+            LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
+            LocalPresenceServicesConnector    presenceService    = StartPresenceService(testScene);

             m_inventoryService.PostInitialise();
-            m_assetService.PostInitialise();
-            m_userAccountService.PostInitialise();
-            m_presenceService.PostInitialise();
+            assetService.PostInitialise();
+            userAccountService.PostInitialise();
+            presenceService.PostInitialise();
+
             testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
             testScene.SetModuleInterfaces();

@@ -191,11 +184,7 @@
             // It's really not a good idea to use static variables as they carry over between tests, leading to
             // problems that are extremely hard to debug.  Really, these static fields need to be eliminated -
             // tests using multiple regions that need to share modules need to find another solution.
-            m_assetService = null;
             m_inventoryService = null;
-            m_gridService = null;
-            m_userAccountService = null;
-            m_presenceService = null;

             testScene.RegionInfo.EstateSettings = new EstateSettings();
             testScene.LoginsDisabled = false;
@@ -203,9 +192,9 @@
             return testScene;
         }

-        private static void StartAssetService(Scene testScene, bool real)
-        {
-            ISharedRegionModule assetService = new LocalAssetServicesConnector();
+        private static LocalAssetServicesConnector StartAssetService(Scene testScene, bool real)
+        {
+            LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
             IConfigSource config = new IniConfigSource();
             config.AddConfig("Modules");
             config.AddConfig("AssetService");
@@ -219,7 +208,8 @@
             assetService.AddRegion(testScene);
             assetService.RegionLoaded(testScene);
             testScene.AddRegionModule(assetService.Name, assetService);
-            m_assetService = assetService;
+
+            return assetService;
         }

         private static void StartAuthenticationService(Scene testScene, bool real)
@@ -268,7 +258,7 @@
             m_inventoryService = inventoryService;
         }

-        private static void StartGridService(Scene testScene, bool real)
+        private static LocalGridServicesConnector StartGridService(Scene testScene, bool real)
         {
             IConfigSource config = new IniConfigSource();
             config.AddConfig("Modules");
@@ -277,24 +267,25 @@
             config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
             if (real)
                 config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
-            if (m_gridService == null)
-            {
-                ISharedRegionModule gridService = new LocalGridServicesConnector();
-                gridService.Initialise(config);
-                m_gridService = gridService;
-            }
+
+            LocalGridServicesConnector gridService = new LocalGridServicesConnector();
+            gridService.Initialise(config);
+
             //else
             //    config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
-            m_gridService.AddRegion(testScene);
-            m_gridService.RegionLoaded(testScene);
+            gridService.AddRegion(testScene);
+            gridService.RegionLoaded(testScene);
             //testScene.AddRegionModule(m_gridService.Name, m_gridService);
+
+            return gridService;
         }

         /// <summary>
         /// Start a user account service
         /// </summary>
         /// <param name="testScene"></param>
-        private static void StartUserAccountService(Scene testScene)
+        /// <returns></returns>
+        private static LocalUserAccountServicesConnector StartUserAccountService(Scene testScene)
         {
             IConfigSource config = new IniConfigSource();
             config.AddConfig("Modules");
@@ -304,23 +295,21 @@
             config.Configs["UserAccountService"].Set(
                 "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");

-//            if (m_userAccountService == null)
-//            {
-                ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector();
-                userAccountService.Initialise(config);
-                m_userAccountService = userAccountService;
-//            }
-
-            m_userAccountService.AddRegion(testScene);
-            m_userAccountService.RegionLoaded(testScene);
-            testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
+            LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector();
+            userAccountService.Initialise(config);
+
+            userAccountService.AddRegion(testScene);
+            userAccountService.RegionLoaded(testScene);
+            testScene.AddRegionModule(userAccountService.Name, userAccountService);
+
+            return userAccountService;
         }

         /// <summary>
         /// Start a presence service
         /// </summary>
         /// <param name="testScene"></param>
-        private static void StartPresenceService(Scene testScene)
+        private static LocalPresenceServicesConnector StartPresenceService(Scene testScene)
         {
             IConfigSource config = new IniConfigSource();
             config.AddConfig("Modules");
@@ -330,16 +319,14 @@
             config.Configs["PresenceService"].Set(
                 "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");

-            if (m_presenceService == null)
-            {
-                ISharedRegionModule presenceService = new LocalPresenceServicesConnector();
-                presenceService.Initialise(config);
-                m_presenceService = presenceService;
-            }
-
-            m_presenceService.AddRegion(testScene);
-            m_presenceService.RegionLoaded(testScene);
-            testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
+            LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector();
+            presenceService.Initialise(config);
+
+            presenceService.AddRegion(testScene);
+            presenceService.RegionLoaded(testScene);
+            testScene.AddRegionModule(presenceService.Name, presenceService);
+
+            return presenceService;
         }

         /// <summary>


fix handling LambdaParameter type

fix handling LambdaParameter type

--- Freesia/Internal/ExpressionBuilder.cs
+++ Freesia/Internal/ExpressionBuilder.cs
@@ -419,6 +419,7 @@
                 switch (t.Type)
                 {
                     case TokenType.Symbol:
+                    case TokenType.LambdaParameter:
                         return MakeNullableAccessExpression(MakePropertyAccess(t));
                     case TokenType.String:
                         return Expression.Constant(t.Value);
@@ -452,7 +453,7 @@

         private Expression MakePropertyAccess(CompilerToken t)
         {
-            if (t.Type != TokenType.Symbol) throw new ArgumentException("argument token is not symbol.");
+            if (t.Type != TokenType.Symbol && t.Type != TokenType.LambdaParameter) throw new ArgumentException("argument token is not symbol.");
             if (_env.ContainsKey(t.Value)) return _env[t.Value];
             var targetExpression = (Expression)_rootParameter;
             var targetType = typeof(T);
@@ -468,6 +469,7 @@

         private Expression[] MakeArgumentList(Type elementType, ASTNode node)
         {
+            if (node == null) return new Expression[0];
             if (node.Token.Type == TokenType.Nop) return new Expression[0];
             var stack = new Stack<ASTNode>();
             stack.Push(node);
@@ -507,6 +509,7 @@
                 switch (t.Type)
                 {
                     case TokenType.Symbol:
+                    case TokenType.LambdaParameter:
                         var type = GetSymbolType(t);
                         if (!type.GetTypeInfo().IsValueType) return true;
                         if (Nullable.GetUnderlyingType(type) != null) return true;
@@ -539,6 +542,7 @@
                 switch (t.Type)
                 {
                     case TokenType.Symbol:
+                    case TokenType.LambdaParameter:
                         var type = GetSymbolType((CompilerToken)o);
                         if (!type.GetTypeInfo().IsValueType) return false;
                         if (Nullable.GetUnderlyingType(type) != null) return true;
@@ -578,6 +582,7 @@
                 {
                     case TokenType.Symbol:
                     case TokenType.String:
+                    case TokenType.LambdaParameter:
                         return false;
                     case TokenType.Double:
                     case TokenType.Long:
@@ -599,6 +604,7 @@
                 {
                     case TokenType.Symbol:
                     case TokenType.String:
+                    case TokenType.LambdaParameter:
                         return null;
                     case TokenType.Double:
                         return Double.Parse(t.Value);
@@ -624,6 +630,7 @@
                 switch (t.Type)
                 {
                     case TokenType.Symbol:
+                    case TokenType.LambdaParameter:
                         return GetSymbolType(t);
                     case TokenType.String:
                         return typeof(string);
@@ -644,7 +651,7 @@

         private Type GetSymbolType(CompilerToken t)
         {
-            if (t.Type != TokenType.Symbol) return null;
+            if (t.Type != TokenType.Symbol && t.Type != TokenType.LambdaParameter) return null;
             if (_env.ContainsKey(t.Value)) return _env[t.Value].Type;
             var propname = t.Value;
             if (propname == UserFunctionNamespace)


check that index file name isn't same as a source file name.

--- ArcFormats/Eagls/ArcEAGLS.cs
+++ ArcFormats/Eagls/ArcEAGLS.cs
@@ -51,7 +51,8 @@
         public override ArcFile TryOpen (ArcView file)
         {
             string idx_name = Path.ChangeExtension (file.Name, ".idx");
-            if (!VFS.FileExists (idx_name))
+            if (file.Name.Equals (idx_name, StringComparison.InvariantCultureIgnoreCase)
+                || !VFS.FileExists (idx_name))
                 return null;
             var idx_entry = VFS.FindFile (idx_name);
             if (idx_entry.Size > 0xfffff || idx_entry.Size < 10000)


added custom dimensions for design and error events

--- GA-SDK-MONO-SHARED/Events/GAEvents.cs
+++ GA-SDK-MONO-SHARED/Events/GAEvents.cs
@@ -301,6 +301,9 @@
 				eventData.Add("value", new JSONData(value));
 			}

+            // Add custom dimensions
+            AddDimensionsToEvent(eventData);
+
             // Add custom fields
             AddFieldsToEvent(eventData, GAState.ValidateAndCleanCustomFields(fields));

@@ -329,6 +332,9 @@
 			eventData["category"] = CategoryError;
 			eventData["severity"] = severityString;
 			eventData["message"] = message;
+
+            // Add custom dimensions
+            AddDimensionsToEvent(eventData);

             // Add custom fields
             AddFieldsToEvent(eventData, GAState.ValidateAndCleanCustomFields(fields));


fixed: fetch upstream Korean CVVC

fixed: fetch upstream Korean CVVC

--- OpenUtau.Plugin.Builtin/KoreanCVVCPhonemizer.cs
+++ OpenUtau.Plugin.Builtin/KoreanCVVCPhonemizer.cs
@@ -3,173 +3,118 @@
 using System.Linq;
 using OpenUtau.Api;
 using OpenUtau.Core.Ustx;
+using Serilog;

-namespace OpenUtau.Plugin.Builtin {
-    [Phonemizer("Korean CVVC Phonemizer", "KO CVVC", "RYUUSEI")]
-    public class KoreanCVVCPhonemizer : Phonemizer {
-        static readonly string initialConsonantsTable = "ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ";
-        static readonly string vowelsTable = "ㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡ";
-        static readonly string lastConsonantsTable = " ㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ";
-        static readonly ushort unicodeKoreanBase = 0xAC00;
-        static readonly ushort unicodeKoreanLast = 0xD79F;
+namespace OpenUtau.Plugin.Builtin
+{
+    [Phonemizer("Korean CVVC Phonemizer", "KR CVVC", "Coludy")]
+    public class KoreanCVVCPhonemizer : Phonemizer
+    {
+        static readonly string[] plainVowels = new string[] { "아", "야", "와", "이", "위", "의", "우", "유", "에", "예", "애", "얘", "외", "왜", "웨", "오", "요", "으", "어", "여", "ㄴ", "ㅁ", "ㅇ", "ㄹ" };

-        private char[] SeparateHangul(char letter) {
-            var u16 = Convert.ToUInt16(letter);
-
-            if (u16 < unicodeKoreanBase || u16 > unicodeKoreanLast)
-                return new char[] { letter };
-
-            u16 -= unicodeKoreanBase;
-
-            var i = u16 / (21 * 28);
-            u16 %= 21 * 28;
-            var v = u16 / 28;
-            u16 %= 28;
-            var l = u16;
-
-            return new char[] { initialConsonantsTable[i], vowelsTable[v], lastConsonantsTable[l] };
-        }
-
-        static readonly string[] initialConsonants = new string[] {
-            "g=ㄱ",
-            "k=ㄲ,ㅋ",
-            "n=ㄴ",
-            "d=ㄷ",
-            "t=ㄸ,ㅌ",
-            "r=ㄹ",
-            "m=ㅁ",
-            "b=ㅂ",
-            "p=ㅃ",
-            "s=ㅅ",
-            "ss=ㅆ",
-            "j=ㅈ",
-            "zh=ㅉ",
-            "ch=ㅊ",
-            "p=ㅍ",
-            "h=ㅎ",
+        static readonly string[] vowels = new string[] {
+            "a=a,ya,wa,가,나,다,라,ㄹ라,마,바,사,아,자,차,카,타,파,하,까,따,빠,싸,짜,갸,냐,댜,랴,ㄹ랴,먀,뱌,샤,야,쟈,챠,캬,탸,퍄,햐,꺄,땨,뺘,쌰,쨔,과,놔,돠,롸,ㄹ롸,뫄,봐,솨,좌,촤,콰,톼,퐈,화,꽈,똬,뽜,쏴,쫘,fa,va,za,tha,rra,fya,vya,zya,thya,fwa,vwa,zwa,thwa",
+            "e=e,ye,we,게,네,데,레,ㄹ레,메,베,세,에,제,체,케,테,페,헤,께,떼,뻬,쎄,쩨,계,녜,뎨,례,ㄹ례,몌,볘,셰,예,졔,쳬,켸,톄,폐,혜,꼐,뗴,뼤,쎼,쪠,개,내,대,래,ㄹ래,매,배,새,애,재,채,캐,태,패,해,깨,때,빼,쌔,째,걔,냬,댸,럐,ㄹ럐,먜,뱨,섀,얘,쟤,챼,컈,턔,퍠,햬,꺠,떄,뺴,썌,쨰,괘,놰,돼,뢔,뫠,봬,쇄,왜,좨,쵀,쾌,퇘,퐤,홰,궤,눼,뒈,뤠,ㄹ뤠,뭬,붸,쉐,웨,줴,췌,퀘,퉤,풰,훼,꿰,뛔,쀄,쒜,쮀,괴,뇌,되,뢰,ㄹ뢰,뫼,뵈,쇠,외,죄,최,쾨,퇴,푀,회,꾀,뙤,뾔,쐬,쬐,fe,ve,ze,the,rre,fye,vye,zye,thye,fwe,vwe,zwe,thwe",
+            "i=i,wi,eui,기,니,디,리,ㄹ리,미,비,시,이,지,치,키,티,피,히,끼,띠,삐,씨,찌,귀,뉘,뒤,뤼,ㄹ뤼,뮈,뷔,쉬,위,쥐,취,퀴,튀,퓌,휘,뀌,뛰,쀠,쒸,쮜,긔,늬,듸,릐,ㄹ릐,믜,븨,싀,의,즤,츼,킈,틔,픠,희,끠,띄,쁴,씌,쯰,fi,vi,zi,thi,rri,fwi,vwi,zwi,thwi,feui,veui,zeui,theui",
+            "o=o,yo,고,노,도,로,ㄹ로,모,보,소,오,조,초,코,토,포,호,꼬,또,뽀,쏘,쪼,교,뇨,됴,료,ㄹ료,묘,뵤,쇼,요,죠,쵸,쿄,툐,표,효,꾜,뚀,뾰,쑈,쬬,fo,vo,zo,tho,rro,fyo,vyo,zyo,thyo",
+            "u=u,yu,구,누,두,루,ㄹ루,무,부,수,우,주,추,쿠,투,푸,후,꾸,뚜,뿌,쑤,쭈,규,뉴,듀,류,ㄹ류,뮤,뷰,슈,유,쥬,츄,큐,튜,퓨,휴,뀨,뜌,쀼,쓔,쮸,fu,vu,zu,thu,rru,fyu,vyu,zyu,thyu",
+            "eu=eu,그,느,드,르,ㄹ르,므,브,스,으,즈,츠,크,트,프,흐,끄,뜨,쁘,쓰,쯔,feu,veu,zeu,theu,rreu",
+            "eo=eo,yeo,weo,거,너,더,러,ㄹ러,머,버,서,어,저,처,커,터,퍼,허,꺼,떠,뻐,써,쩌,궈,눠,둬,뤄,ㄹ뤄,뭐,붜,숴,워,줘,춰,쿼,퉈,풔,훠,꿔,뚸,뿨,쒀,쭤,feo,veo,zeo,theo,rreo,fyeo,vyeo,zyeo,thyeo,fweo,vweo,zweo,thweo",
+            "N=N,ㄴ",
+            "M=M,ㅁ",
+            "NG=NG,ㅇ",
+            "L=L,ㄹ",
+            "K=K,ㄱ,ㅋ,ㄲ",
+            "P=P,ㅂ,ㅍ",
+            "T=T,ㄷ,ㅌ,ㅅ"
         };

-        static readonly string[] vowels = new string[] {
-            "a=ㅏ",
-            "ya=ㅑ",
-            "eo=ㅓ",
-            "yeo=ㅕ",
-            "o=ㅗ",
-            "yo=ㅛ",
-            "u=ㅜ",
-            "yu=ㅠ",
-            "eu=ㅡ",
-            "i=ㅣ",
-            "e=ㅔ,ㅐ",
-            "eui=ㅢ",
-            "ue=ㅞ,ㅙ",
-            "uo=ㅝ",
-            "wa=ㅘ",
-            "wi=ㅟ",
+        static readonly string[] consonants = new string[] {
+            "g=g,가,갸,과,기,귀,긔,구,규,게,계,개,걔,괴,괘,궤,고,교,그,거,겨",
+            "gg=gg,까,꺄,꽈,끼,뀌,끠,꾸,뀨,께,꼐,깨,꺠,꾀,꽤,꿰,꼬,꾜,끄,꺼,껴",
+            "n=n,나,냐,놔,니,뉘,늬,누,뉴,네,녜,내,냬,뇌,놰,눼,노,뇨,느,너,녀",
+            "d=d,다,댜,돠,디,뒤,듸,두,듀,데,뎨,대,댸,되,돼,뒈,도,됴,드,더,뎌",
+            "dd=dd,따,땨,똬,띠,뛰,띄,뚜,뜌,떼,뗴,때,떄,뙤,뙈,뛔,또,뚀,뜨,떠,뗘",
+            "r=r,라,랴,롸,리,뤼,릐,루,류,레,례,래,럐,뢰,뢔,뤠,로,료,르,러,려",
+            "l=l,ㄹ라,ㄹ랴,ㄹ롸,ㄹ리,ㄹ뤼,ㄹ릐,ㄹ루,ㄹ류,ㄹ레,ㄹ례,ㄹ래,ㄹ럐,ㄹ뢰,ㄹ뢔,ㄹ뤠,ㄹ로,ㄹ료,ㄹ르,ㄹ러,ㄹ려",
+            "m=m,마,먀,뫄,미,뮈,믜,무,뮤,메,몌,매,먜,뫼,뫠,뭬,모,묘,므,머,며",
+            "b=b,바,뱌,봐,비,뷔,븨,부,뷰,베,볘,배,뱨,뵈,봬,붸,보,뵤,브,버,벼",
+            "bb=bb,빠,뺘,뽜,삐,쀠,쁴,뿌,쀼,뻬,뼤,빼,뺴,뾔,뽸,쀄,뽀,뾰,쁘,뻐,뼈",
+            "s=s,사,솨,쉬,싀,수,세,새,쇠,쇄,쉐,소,스,서",
+            "sy=sy,샤,시,슈,셰,섀,쇼,셔",
+            "ss=ss,싸,쏴,쒸,씌,쑤,쎄,쌔,쐬,쐐,쒜,쏘,쓰,써",
+            "ssy=ssy,쌰,씨,쓔,쎼,썌,쑈,쎠",
+            "j=j,자,쟈,좌,지,쥐,즤,주,쥬,제,졔,재,쟤,죄,좨,줴,조,죠,즈,저,져",
+            "jj=jj,짜,쨔,쫘,찌,쮜,쯰,쭈,쮸,쩨,쪠,째,쨰,쬐,쫴,쮀,쪼,쬬,쯔,쩌,쪄",
+            "ch=ch,차,챠,촤,치,취,츼,추,츄,체,쳬,채,챼,최,쵀,췌,초,쵸,츠,처,쳐",
+            "k=k,카,캬,콰,키,퀴,킈,쿠,큐,케,켸,캐,컈,쾨,쾌,퀘,코,쿄,크,커,켜",
+            "t=t,타,탸,톼,티,튀,틔,투,튜,테,톄,태,턔,퇴,퇘,퉤,토,툐,트,터,텨",
+            "p=p,파,퍄,퐈,피,퓌,픠,푸,퓨,페,폐,패,퍠,푀,퐤,풰,포,표,프,퍼,펴",
+            "h=h,하,햐,화,히,휘,희,후,휴,헤,혜,해,햬,회,홰,훼,호,효,흐,허,혀",
+            "f=f",
+            "v=v",
+            "z=z",
+            "rr=rr",
+            "th=th"
         };

-        static readonly string[] subsequentVowels = new string[] {
-            "a=ㅏ,ㅑ,ㅘ",
-            "eo=ㅓ,ㅕ,ㅝ",
-            "o=ㅗ,ㅛ",
-            "u=ㅜ,ㅠ",
-            "eu=ㅡ",
-            "e=ㅔ,ㅐ,ㅞ,ㅙ"
-            "i=ㅣ,ㅢ,ㅟ"
-        }
+        static readonly Dictionary<string, string> vowelLookup;
+        static readonly Dictionary<string, string> consonantLookup;

-        static readonly string[] lastConsonants = new string[] {
-            "g=ㄱ,ㄺ",
-            "gp=ㄲ,ㅋ,ㄳ"
-            "n=ㄴ,ㄵ,ㄶ",
-            "d=ㄷ,ㅅ,ㅆ,ㅈ,ㅊ",
-            "l=ㄹ,ㄽ,ㅀ",
-            "rp= ㄼ,ㄾ",
-            "m=ㅁ,ㄻ",
-            "b=ㅂ,ㅌ,ㅍ,ㄿ",
-            "bp=ㅄ"
-            "h=ㅎ",
-        };
-
-        static readonly string[] subsequentfirstConsonants = new string[] {
-            "g=ㄱ,ㄲ,ㅋ",
-            "ㄴ",
-            "ㄷ",
-            "ㄹ",
-            "ㅁ",
-            "ㅂ",
-            "ㅇ",
-        }
-
-        static readonly string[] subsequentsecondConsonants = new string[] {
-            "g,k=ㄳㄱ,ㄳㅋ,ㄳㄲ",
-            "g,n=ㄳㄴ",
-            "g,t=ㄳㄷ,ㄳㅌ,ㄳㄸ",
-            "g,r=ㄳㄹ",
-            "g,m=ㄳㅁ",
-            "g,=ㄳ"
-            "ㄱㄵㄼㄽㄾㅄ"
-        }
-
-        static readonly Dictionary<string, string> initialConsonantLookup;
-        static readonly Dictionary<string, string> vowelLookup;
-        static readonly Dictionary<string, string> lastConsonantLookup;
-
-        static KoreanCVVCPhonemizer() {
-            initialConsonantLookup = initialConsonants.ToList()
-                .SelectMany(line => {
-                    var parts = line.Split('=');
-                    return parts[1].Split(',').Select(cv => (cv, parts[0]));
-                })
-                .ToDictionary(t => t.Item1, t => t.Item2);
+        static KoreanCVVCPhonemizer()
+        {
             vowelLookup = vowels.ToList()
                 .SelectMany(line => {
                     var parts = line.Split('=');
                     return parts[1].Split(',').Select(cv => (cv, parts[0]));
                 })
                 .ToDictionary(t => t.Item1, t => t.Item2);
-            lastConsonantLookup = lastConsonants.ToList()
+            consonantLookup = consonants.ToList()
                 .SelectMany(line => {
                     var parts = line.Split('=');
                     return parts[1].Split(',').Select(cv => (cv, parts[0]));
                 })
                 .ToDictionary(t => t.Item1, t => t.Item2);
-
         }

         // Store singer in field, will try reading presamp.ini later
         private USinger singer;
         public override void SetSinger(USinger singer) => this.singer = singer;

-        public override Phoneme[] Process(Note[] notes, Note? prevNeighbour, Note? nextNeighbour) {
+        public override Phoneme[] Process(Note[] notes, Note? prevNeighbour, Note? nextNeighbour)
+        {
             var note = notes[0];
             var currentUnicode = ToUnicodeElements(note.lyric);
             var currentLyric = note.lyric;
-            var koreanLyrics = SeparateHangul(currentLyric[0]);

-
-            // 이전 노트가 없는 경우
-            if (prevNeighbour == null) {
-                // 보이스 뱅크에 있는 경우 "- V" 또는 "- CV"를 사용
+            if (prevNeighbour == null)
+            {
+                // Use "- V" or "- CV" if present in voicebank
                 var initial = $"- {currentLyric}";
-                if (singer.TryGetMappedOto(initial, note.tone, out var _)) {
+                if (singer.TryGetMappedOto(initial, note.tone, out var _))
+                {
                     currentLyric = initial;
                 }
-            } else if (vowels.Contains(currentLyric)){
+            }
+            else if (plainVowels.Contains(currentLyric))
+            {
                 var prevUnicode = ToUnicodeElements(prevNeighbour?.lyric);

-                // 지금 노트가 VV 일때
-                if (vowelLookup.TryGetValue(prevUnicode.LastOrDefault() ?? string.Empty, out var vow)) {
+                // Current note is VV
+                if (vowelLookup.TryGetValue(prevUnicode.LastOrDefault() ?? string.Empty, out var vow))
+                {
                     currentLyric = $"{vow} {currentLyric}";
                 }
             }

-            if (nextNeighbour != null) {
+            if (nextNeighbour != null)
+            {
                 var nextUnicode = ToUnicodeElements(nextNeighbour?.lyric);
                 var nextLyric = string.Join("", nextUnicode);

                 // Check if next note is a vowel and does not require VC
-                if (vowels.Contains(nextUnicode.FirstOrDefault() ?? string.Empty)) {
+                if (plainVowels.Contains(nextUnicode.FirstOrDefault() ?? string.Empty))
+                {
                     return new Phoneme[] {
                         new Phoneme() {
                             phoneme = currentLyric,
@@ -177,20 +122,23 @@
                     };
                 }

-                // 다음 노트 앞에 VC 삽입
-                // 현재 노트에서 모음 가져오기
+                // Insert VC before next neighbor
+                // Get vowel from current note
                 var vowel = "";
-                if (vowelLookup.TryGetValue(currentUnicode.LastOrDefault() ?? string.Empty, out var vow)) {
+                if (vowelLookup.TryGetValue(currentUnicode.LastOrDefault() ?? string.Empty, out var vow))
+                {
                     vowel = vow;
                 }

-                // 다음 노트에서 자음 가져오기
+                // Get consonant from next note
                 var consonant = "";
-                if (lastConsonantLookup.TryGetValue(nextUnicode.FirstOrDefault() ?? string.Empty, out var con)) {
+                if (consonantLookup.TryGetValue(nextUnicode.FirstOrDefault() ?? string.Empty, out var con))
+                {
                     consonant = con;
                 }

-                if (consonant == "") {
+                if (consonant == "")
+                {
                     return new Phoneme[] {
                         new Phoneme() {
                             phoneme = currentLyric,
@@ -199,14 +147,23 @@
                 }

                 var vcPhoneme = $"{vowel} {consonant}";
+                if (!singer.TryGetMappedOto(vcPhoneme, note.tone, out var _))
+                {
+                    return new Phoneme[] {
+                        new Phoneme() {
+                            phoneme = currentLyric,
+                        }
+                    };
+                }

                 int totalDuration = notes.Sum(n => n.duration);
                 int vcLength = 120;
-                if (singer.TryGetMappedOto(nextLyric, note.tone, out var oto)) {
+                if (singer.TryGetMappedOto(nextLyric, note.tone, out var oto))
+                {
                     vcLength = MsToTick(oto.Preutter);
                 }
                 vcLength = Math.Min(totalDuration / 2, vcLength);
-
+
                 return new Phoneme[] {
                     new Phoneme() {
                         phoneme = currentLyric,
@@ -216,9 +173,9 @@
                         position = totalDuration - vcLength,
                     }
                 };
-            }
-
-            // 다음 노트가 없는 경우
+            }
+
+            // No next neighbor
             return new Phoneme[] {
                 new Phoneme {
                     phoneme = currentLyric,
@@ -226,4 +183,4 @@
             };
         }
     }
-}
+}


Now other damage-level objects have been added into the rain

--- Assets/Scripts/MakeItRain.cs
+++ Assets/Scripts/MakeItRain.cs
@@ -27,7 +27,7 @@
     // Called only when dance is finished
     public void Rain()
     {
-        int whichRain = Random.Range(10, 15);
+        int whichRain = Random.Range(1, 5);
         switch (whichRain)
         {
             case 1:


When linking viewer to DOSBOS, camera should follow player by default

--- Assets/Scripts/RoomLoader.cs
+++ Assets/Scripts/RoomLoader.cs
@@ -715,6 +715,11 @@
 				if (!DosBoxEnabled)
 				{
 					bool result = (GetComponent<DosBox>().LinkToDosBOX(floor, room));
+
+                    //set follow mode to player
+                    cameraFollow = 2;
+                    GetComponent<DosBox>().ResetCamera(floor, room);
+
 					Actors.SetActive(result);
 					DosBoxEnabled = result;
 				}


special load fills only untill mana ratio

--- Assets/Scripts/UI/PowerUI.cs
+++ Assets/Scripts/UI/PowerUI.cs
@@ -49,14 +49,15 @@
         specialLoad.value = 0;
         float timer = 0;
         float duration = power.coolDownTimer;
+        float finalFill = power.mana / power.maxMana;

         while (timer < duration) {
             timer += Time.deltaTime;
-            specialLoad.value = Mathf.Lerp(0, 1, timer/duration);
+            specialLoad.value = Mathf.Lerp(0, finalFill, timer/duration);
             yield return null;
         }

-        specialLoad.value = 1;
+        specialLoad.value = finalFill;
         EventDispatcher.DispatchEvent(Events.SPECIAL_POWER_COOLDOWN_END, null);
     }
 }


Default to Lanscape Orientation

Default to Lanscape Orientation

Default the UnityEngine Screen orientation to landscape.  The mobile platform respects this value and will show GalaxyExplorer landscape on a phone.  It has no effect on some platforms like Windows in desktop mode and HoloLens which is just fine.


end of bingo level handling

end of bingo level handling

--- Assets/scripts/bingo/game.cs
+++ Assets/scripts/bingo/game.cs
@@ -155,6 +155,7 @@
 			endOfGameDelay--;
 			if (endOfGameDelay == 0) {
 				// TODO: Handle end of game
+				GrannyState.instance.loadNextLevel();
 			}
 		} else if (opponentBingoDelay > 0) {
 			opponentBingoDelay--;
@@ -239,7 +240,7 @@
 							Debug.Log ("Game over: someone else won!");
 							opponentBingoDelay = OpponentBingoDelay;
 							gameOver = true;
-							GrannyState.instance.loadNextLevel();
+							//GrannyState.instance.loadNextLevel();
 						}
 					}
 				}
@@ -305,7 +306,7 @@
 						Debug.Log("Game over: Granny won!!");
 						gameOver = true;
 						endOfGameDelay = EndOfGameDelay;
-						GrannyState.instance.loadNextLevel();
+						//GrannyState.instance.loadNextLevel();

 					}

@@ -334,7 +335,7 @@
 				gameOver = true;
 				endOfGameDelay = EndOfGameDelay;
 				GrannyState.instance.moneyCt-=5;
-				GrannyState.instance.loadNextLevel();
+				//GrannyState.instance.loadNextLevel();
 			}
 		}
 	}


add failing unit test.

add failing unit test.

--- tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
+++ tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
@@ -64,6 +64,40 @@
                 Assert.False(ToolTip.GetIsOpen(target));
             }
         }
+
+        [Fact]
+        public void Should_Close_When_Tip_Is_Changed()
+        {
+            using (UnitTestApplication.Start(TestServices.StyledWindow))
+            {
+                var window = new Window();
+
+                var panel = new Panel();
+
+                var target = new Decorator()
+                {
+                    [ToolTip.TipProperty] = "Tip",
+                    [ToolTip.ShowDelayProperty] = 0
+                };
+
+                panel.Children.Add(target);
+
+                window.Content = panel;
+
+                window.ApplyTemplate();
+                window.Presenter.ApplyTemplate();
+
+                Assert.True((target as IVisual).IsAttachedToVisualTree);
+
+                _mouseHelper.Enter(target);
+
+                Assert.True(ToolTip.GetIsOpen(target));
+
+                ToolTip.SetTip(target, "");
+
+                Assert.False(ToolTip.GetIsOpen(target));
+            }
+        }

         [Fact]
         public void Should_Open_On_Pointer_Enter()


Added BodyReference.GetVelocityForOffset helper.

--- BepuPhysics/BodyReference.cs
+++ BepuPhysics/BodyReference.cs
@@ -323,6 +323,17 @@
         }

         /// <summary>
+        /// Computes the velocity of an offset point attached to the body.
+        /// </summary>
+        /// <param name="offset">Offset from the body's center to </param>
+        /// <param name="velocity">Effective velocity of the point if it were attached to the body.</param>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void GetVelocityForOffset(in Vector3 offset, out Vector3 velocity)
+        {
+            velocity = Velocity.Linear + Vector3.Cross(Velocity.Angular, offset);
+        }
+
+        /// <summary>
         /// Applies an angular impulse to an angular velocity. Does not wake the body up.
         /// </summary>
         /// <param name="angularImpulse">Impulse to apply to the velocity.</param>


Added trade rules check for margin order

--- Binance.Net/BinanceClient.cs
+++ Binance.Net/BinanceClient.cs
@@ -1655,6 +1655,13 @@
             if (!timestampResult)
                 return new WebCallResult<BinanceOrderList>(timestampResult.ResponseStatusCode, timestampResult.ResponseHeaders, null, timestampResult.Error);

+            var rulesCheck = await CheckTradeRules(symbol, quantity, price, null, ct).ConfigureAwait(false);
+            if (!rulesCheck.Passed)
+            {
+                log.Write(LogVerbosity.Warning, rulesCheck.ErrorMessage!);
+                return new WebCallResult<BinanceOrderList>(null, null, null, new ArgumentError(rulesCheck.ErrorMessage!));
+            }
+
             var parameters = new Dictionary<string, object>
             {
                 { "symbol", symbol },
@@ -2910,7 +2917,7 @@
             return new WebCallResult<DateTime>(null, null, default, null);
         }

-        private async Task<BinanceTradeRuleResult> CheckTradeRules(string symbol, decimal? quantity, decimal? price, OrderType type, CancellationToken ct)
+        private async Task<BinanceTradeRuleResult> CheckTradeRules(string symbol, decimal? quantity, decimal? price, OrderType? type, CancellationToken ct)
         {
             var outputQuantity = quantity;
             var outputPrice = price;
@@ -2928,9 +2935,13 @@
             if (symbolData == null)
                 return BinanceTradeRuleResult.CreateFailed($"Trade rules check failed: Symbol {symbol} not found");

-            if (!symbolData.OrderTypes.Contains(type))
-                return BinanceTradeRuleResult.CreateFailed($"Trade rules check failed: {type} order type not allowed for {symbol}");
-
+            if (type != null)
+            {
+                if (!symbolData.OrderTypes.Contains(type.Value))
+                    return BinanceTradeRuleResult.CreateFailed(
+                        $"Trade rules check failed: {type} order type not allowed for {symbol}");
+            }
+
             if (symbolData.LotSizeFilter != null || (symbolData.MarketLotSizeFilter != null && type == OrderType.Market))
             {
                 var minQty = symbolData.LotSizeFilter?.MinQuantity;


Fix exp in jwt (#752)

Fix exp in jwt (#752)

--- Box.V2/JWTAuth/BoxJWTAuth.cs
+++ Box.V2/JWTAuth/BoxJWTAuth.cs
@@ -254,7 +254,7 @@
                 expireTime = nowOverride.Value.AddSeconds(30);
             }

-            var payload = new JwtPayload(this.boxConfig.ClientId, AUTH_URL, claims, null, expireTime.DateTime);
+            var payload = new JwtPayload(this.boxConfig.ClientId, AUTH_URL, claims, null, expireTime.LocalDateTime);

             var header = new JwtHeader(signingCredentials: this.credentials);
             if (this.boxConfig.JWTPublicKeyId != null)


Fixed Identifiers.

Fixed Identifiers.

--- Aura/Lexer.cs
+++ Aura/Lexer.cs
@@ -122,7 +122,7 @@

                 if (m == null)
                 {
-                    result.Add(new Token(TokenType.Identifier, ReadWhile(p => !IsIgnored(p), buffer)));
+                    result.Add(new Token(TokenType.Identifier, ReadWhile(char.IsLetterOrDigit, buffer)));
                     buffer = "";
                     continue;
                 }


Catch errors earlier

Catch errors earlier

--- PoGo.PokeMobBot.Logic/Tasks/CatchPokemonTask.cs
+++ PoGo.PokeMobBot.Logic/Tasks/CatchPokemonTask.cs
@@ -25,6 +25,9 @@
         public static async Task Execute(ISession session, dynamic encounter, MapPokemon pokemon,
             FortData currentFortData = null, ulong encounterId = 0)
         {
+            if (encounter is EncounterResponse && pokemon == null)
+                throw new ArgumentException("Parameter pokemon must be set, if encounter is of type EncounterResponse", "pokemon");
+
             CatchPokemonResponse caughtPokemonResponse;
             var attemptCounter = 1;
             do


Fix delay being async

Fix delay being async

--- PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs
+++ PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs
@@ -91,7 +91,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -113,7 +113,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -155,7 +155,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -177,7 +177,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -199,7 +199,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -221,7 +221,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }
             }
@@ -257,7 +257,7 @@
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
                         else
-                            DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }

@@ -278,8 +278,8 @@
                         session.EventDispatcher.Send(new ItemRecycledEvent { Id = ItemId.ItemMaxRevive, Count = maxRevivesToRecycle });
                         if (session.LogicSettings.Teleport)
                             await Task.Delay(session.LogicSettings.DelayRecyleItem);
-                        else
-                         DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
+                        else
+                            await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 500);
                     }
                 }
             }


Naming fix

Naming fix

--- PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs
+++ PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs
@@ -63,19 +63,19 @@
                 diff = totalBallsCount - session.LogicSettings.TotalAmountOfPokeballsToKeep;
                 if (diff > 0)
                 {
-                    await removeItems(pokeBallsCount, ItemId.ItemPokeBall, cancellationToken, session);
+                    await RemoveItems(pokeBallsCount, ItemId.ItemPokeBall, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(greatBallsCount, ItemId.ItemGreatBall, cancellationToken, session);
+                    await RemoveItems(greatBallsCount, ItemId.ItemGreatBall, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(ultraBallsCount, ItemId.ItemUltraBall, cancellationToken, session);
+                    await RemoveItems(ultraBallsCount, ItemId.ItemUltraBall, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(masterBallsCount, ItemId.ItemMasterBall, cancellationToken, session);
+                    await RemoveItems(masterBallsCount, ItemId.ItemMasterBall, cancellationToken, session);
                 }
             }
         }
@@ -93,19 +93,19 @@
                 diff = totalPotionsCount - session.LogicSettings.TotalAmountOfPotionsToKeep;
                 if (diff > 0)
                 {
-                    await removeItems(potionCount, ItemId.ItemPotion, cancellationToken, session);
+                    await RemoveItems(potionCount, ItemId.ItemPotion, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(superPotionCount, ItemId.ItemSuperPotion, cancellationToken, session);
+                    await RemoveItems(superPotionCount, ItemId.ItemSuperPotion, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(hyperPotionsCount, ItemId.ItemHyperPotion, cancellationToken, session);
+                    await RemoveItems(hyperPotionsCount, ItemId.ItemHyperPotion, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(maxPotionCount, ItemId.ItemMaxPotion, cancellationToken, session);
+                    await RemoveItems(maxPotionCount, ItemId.ItemMaxPotion, cancellationToken, session);
                 }
             }
         }
@@ -124,27 +124,27 @@
                 diff = totalBerryCount - session.LogicSettings.TotalAmountOfPotionsToKeep;
                 if (diff > 0)
                 {
-                    await removeItems(razz, ItemId.ItemRazzBerry, cancellationToken, session);
+                    await RemoveItems(razz, ItemId.ItemRazzBerry, cancellationToken, session);
                 }

                 if (diff > 0)
                 {
-                    await removeItems(bluk, ItemId.ItemBlukBerry, cancellationToken, session);
+                    await RemoveItems(bluk, ItemId.ItemBlukBerry, cancellationToken, session);
                 }

                 if (diff > 0)
                 {
-                    await removeItems(nanab, ItemId.ItemNanabBerry, cancellationToken, session);
+                    await RemoveItems(nanab, ItemId.ItemNanabBerry, cancellationToken, session);
                 }

                 if (diff > 0)
                 {
-                    await removeItems(pinap, ItemId.ItemPinapBerry, cancellationToken, session);
+                    await RemoveItems(pinap, ItemId.ItemPinapBerry, cancellationToken, session);
                 }

                 if (diff > 0)
                 {
-                    await removeItems(wepar, ItemId.ItemWeparBerry, cancellationToken, session);
+                    await RemoveItems(wepar, ItemId.ItemWeparBerry, cancellationToken, session);
                 }
             }
         }
@@ -160,16 +160,16 @@
                 diff = totalRevivesCount - session.LogicSettings.TotalAmountOfRevivesToKeep;
                 if (diff > 0)
                 {
-                    await removeItems(reviveCount, ItemId.ItemRevive, cancellationToken, session);
+                    await RemoveItems(reviveCount, ItemId.ItemRevive, cancellationToken, session);
                 }
                 if (diff > 0)
                 {
-                    await removeItems(maxReviveCount, ItemId.ItemMaxRevive, cancellationToken, session);
+                    await RemoveItems(maxReviveCount, ItemId.ItemMaxRevive, cancellationToken, session);
                 }
             }
         }

-        private static async Task removeItems(int itemCount, ItemId item, CancellationToken cancellationToken, ISession session)
+        private static async Task RemoveItems(int itemCount, ItemId item, CancellationToken cancellationToken, ISession session)
         {
             int itemsToRecycle = 0;
             int itemsToKeep = itemCount - diff;


画像のちらつき防止

画像のちらつき防止

--- Product/KabeDon/KabeDon.Shared/MainPage.xaml.cs
+++ Product/KabeDon/KabeDon.Shared/MainPage.xaml.cs
@@ -71,9 +71,12 @@
             };
         }

-        private void ShowImage(Uri imageUri)
+        private async void ShowImage(Uri imageUri)
         {
-            var bitmap = new BitmapImage(imageUri);
+            var bitmap = new BitmapImage();
+            var file = await StorageFile.GetFileFromApplicationUriAsync(imageUri);
+            var stream = await file.OpenReadAsync();
+            await bitmap.SetSourceAsync(stream);
             image.Source = bitmap;
         }


Refactoring

Refactoring

--- QTFK.Cmd/Services/ExplorerConsoleArgsBuilder.cs
+++ QTFK.Cmd/Services/ExplorerConsoleArgsBuilder.cs
@@ -6,61 +6,63 @@
 {
     internal class ExplorerConsoleArgsBuilder : IConsoleArgsBuilder
     {
-        private readonly IDictionary<string, ArgumentInfo> _data;
+        private readonly IDictionary<string, ArgumentInfo> data;

         public ExplorerConsoleArgsBuilder(IDictionary<string, ArgumentInfo> data)
         {
-            _data = data;
+            Asserts.isSomething(data, $"'{nameof(data)}' cannot be null.");
+
+            this.data = data;
         }

         public event ArgsErrorDelegate Error;

         public bool Flag(string name, string description)
         {
-            _data.Set(name, new ArgumentInfo
-            {
-                Name = name,
-                Description = description,
-                Default = false.ToString(),
-                IsOptional = true,
-                IsIndexed = false,
-                IsFlag = true,
-            });
+            prv_setOptionData(this.data, name, description, true, false, false.ToString(), true);
             return false;
         }

         public string Optional(string name, string description, string defaultValue)
         {
-            return SetOptionData(name, description, true, false, defaultValue);
+            return prv_setOptionData(this.data, name, description, true, false, defaultValue, false);
         }

         public string Optional(int index, string name, string description, string defaultValue)
         {
-            return SetOptionData(name, description, true, true, defaultValue);
+            return prv_setOptionData(this.data, name, description, true, true, defaultValue, false);
         }

         public string Required(string name, string description)
         {
-            return SetOptionData(name, description, false, false);
+            return prv_setOptionData(this.data, name, description, false, false, string.Empty, false);
         }

         public string Required(int index, string name, string description)
         {
-            return SetOptionData(name, description, false, true);
+            return prv_setOptionData(this.data, name, description, false, true, string.Empty, false);
         }

-        private string SetOptionData(string name, string description, bool isOptional, bool isIndexed, string defaultValue = null)
+        private static string prv_setOptionData(IDictionary<string, ArgumentInfo> data
+            , string name, string description
+            , bool isOptional, bool isIndexed
+            , string defaultValue
+            , bool isFlag
+            )
         {
-            defaultValue = defaultValue ?? string.Empty;
-            _data.Set(name, new ArgumentInfo
+            ArgumentInfo argumentInfo;
+
+            argumentInfo = new ArgumentInfo
             {
                 Name = name,
                 Description = description,
                 Default = defaultValue,
                 IsOptional = isOptional,
                 IsIndexed = isIndexed,
-                IsFlag = false,
-            });
+                IsFlag = isFlag,
+            };
+            data.Set(name, argumentInfo);
+
             return defaultValue;
         }
     }


FIX typos in rdf:rest parsing from graph

--- RDFSharp/Semantics/OWL/RDFSemanticsUtilities.cs
+++ RDFSharp/Semantics/OWL/RDFSemanticsUtilities.cs
@@ -547,7 +547,7 @@
                         }

                         #region rdf:rest
-                        RDFTriple rest = prefetchContext[nameof(RDFVocabulary.RDF.FIRST)].SelectTriplesBySubject(itemRest).FirstOrDefault();
+                        RDFTriple rest = prefetchContext[nameof(RDFVocabulary.RDF.REST)].SelectTriplesBySubject(itemRest).FirstOrDefault();
                         if (rest != null)
                         {
                             if (rest.Object.Equals(RDFVocabulary.RDF.NIL))
@@ -1095,7 +1095,7 @@
                             ontology.Model.ClassModel.AddOneOfRelation((RDFOntologyEnumerateClass)ec, new List<RDFOntologyFact>() { ((RDFResource)first.Object).ToRDFOntologyFact() });

                             #region rdf:rest
-                            RDFTriple rest = prefetchContext[nameof(RDFVocabulary.RDF.FIRST)].SelectTriplesBySubject(itemRest).FirstOrDefault();
+                            RDFTriple rest = prefetchContext[nameof(RDFVocabulary.RDF.REST)].SelectTriplesBySubject(itemRest).FirstOrDefault();
                             if (rest != null)
                             {
                                 if (rest.Object.Equals(RDFVocabulary.RDF.NIL))


changed benchmark tests so it's easier to compare

--- RedFoxMQ.Tests/PublisherSubscriberBenchmarks.cs
+++ RedFoxMQ.Tests/PublisherSubscriberBenchmarks.cs
@@ -25,68 +25,69 @@
     [Explicit]
     class PublisherSubscriberBenchmarks
     {
+        private const int Count = 20000;
         private const int TimeOut = 30000;

-        [TestCase(10000)]
-        public void One_Publisher_One_Subscriber_Single_Broadcasts(int count)
-        {
-            using (var publisher = new Publisher())
-            using (var subscriber = new Subscriber())
-            {
-                publisher.Bind(TestHelpers.TcpTestEndpoint);
-                subscriber.ConnectAsync(TestHelpers.TcpTestEndpoint).Wait();
-
-                Thread.Sleep(30);
-
-                var isMessageReceived = new ManualResetEventSlim();
-
-                var receivedCount = 0;
-                subscriber.MessageReceived += m =>
-                {
-                    Interlocked.Increment(ref receivedCount);
-
-                    if (receivedCount >= count) isMessageReceived.Set();
-                };
-
-                var messageSent = new TestMessage { Text = "Hello" };
-
-                var sw = Stopwatch.StartNew();
-                for (var i = 0; i < count; i++)
+        [Test]
+        public void One_Publisher_One_Subscriber_Single_Broadcasts()
+        {
+            using (var publisher = new Publisher())
+            using (var subscriber = new Subscriber())
+            {
+                publisher.Bind(TestHelpers.TcpTestEndpoint);
+                subscriber.ConnectAsync(TestHelpers.TcpTestEndpoint).Wait();
+
+                Thread.Sleep(30);
+
+                var isMessageReceived = new ManualResetEventSlim();
+
+                var receivedCount = 0;
+                subscriber.MessageReceived += m =>
+                {
+                    Interlocked.Increment(ref receivedCount);
+
+                    if (receivedCount >= Count) isMessageReceived.Set();
+                };
+
+                var messageSent = new TestMessage { Text = "Hello" };
+
+                var sw = Stopwatch.StartNew();
+                for (var i = 0; i < Count; i++)
                 {
                     publisher.Broadcast(messageSent);
                 }
                 Assert.IsTrue(isMessageReceived.Wait(TimeOut), "Timeout waiting for message");
                 sw.Stop();

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
-            }
-        }
-
-        [TestCase(10000)]
-        public void One_Publisher_One_Subscriber_Batch_Broadcast(int count)
-        {
-            using (var publisher = new Publisher())
-            using (var subscriber = new Subscriber())
-            {
-                publisher.Bind(TestHelpers.TcpTestEndpoint);
-                subscriber.ConnectAsync(TestHelpers.TcpTestEndpoint).Wait();
-
-                Thread.Sleep(30);
-
-                var isMessageReceived = new ManualResetEventSlim();
-
-                var receivedCount = 0;
-                subscriber.MessageReceived += m =>
-                {
-                    Interlocked.Increment(ref receivedCount);
-
-                    if (receivedCount >= count) isMessageReceived.Set();
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
+            }
+        }
+
+        [Test]
+        public void One_Publisher_One_Subscriber_Batch_Broadcast()
+        {
+            using (var publisher = new Publisher())
+            using (var subscriber = new Subscriber())
+            {
+                publisher.Bind(TestHelpers.TcpTestEndpoint);
+                subscriber.ConnectAsync(TestHelpers.TcpTestEndpoint).Wait();
+
+                Thread.Sleep(30);
+
+                var isMessageReceived = new ManualResetEventSlim();
+
+                var receivedCount = 0;
+                subscriber.MessageReceived += m =>
+                {
+                    Interlocked.Increment(ref receivedCount);
+
+                    if (receivedCount >= Count) isMessageReceived.Set();
                 };

                 var messageSent = new TestMessage { Text = "Hello" };

                 var batch = new List<TestMessage>();
-                for (var i = 0; i < count; i++)
+                for (var i = 0; i < Count; i++)
                     batch.Add(messageSent);

                 var sw = Stopwatch.StartNew();
@@ -94,12 +95,12 @@
                 Assert.IsTrue(isMessageReceived.Wait(TimeOut), "Timeout waiting for message");
                 sw.Stop();

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
-            }
-        }
-
-        [TestCase(10000)]
-        public void One_Publisher_Two_Subscribers_Single_Broadcasts(int count)
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
+            }
+        }
+
+        [Test]
+        public void One_Publisher_Two_Subscribers_Single_Broadcasts()
         {
             using (var publisher = new Publisher())
             using (var subscriber1 = new Subscriber())
@@ -117,25 +118,25 @@
                 subscriber2.MessageReceived += m =>
                 {
                     Interlocked.Increment(ref receivedCount);
-                    if (receivedCount >= count) isMessageReceived.Set();
-                };
-
-                var messageSent = new TestMessage { Text = "Hello" };
-
-                var sw = Stopwatch.StartNew();
-                for (var i = 0; i < count; i++)
+                    if (receivedCount >= Count) isMessageReceived.Set();
+                };
+
+                var messageSent = new TestMessage { Text = "Hello" };
+
+                var sw = Stopwatch.StartNew();
+                for (var i = 0; i < Count; i++)
                 {
                     publisher.Broadcast(messageSent);
                 }
                 Assert.IsTrue(isMessageReceived.Wait(TimeOut), "Timeout waiting for message");
                 sw.Stop();

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
-            }
-        }
-
-        [TestCase(10000)]
-        public void One_Publisher_Two_Subscribers_Batch_Broadcast(int count)
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
+            }
+        }
+
+        [Test]
+        public void One_Publisher_Two_Subscribers_Batch_Broadcast()
         {
             using (var publisher = new Publisher())
             using (var subscriber1 = new Subscriber())
@@ -153,13 +154,13 @@
                 subscriber2.MessageReceived += m =>
                 {
                     Interlocked.Increment(ref receivedCount);
-                    if (receivedCount >= count) isMessageReceived.Set();
+                    if (receivedCount >= Count) isMessageReceived.Set();
                 };

                 var messageSent = new TestMessage { Text = "Hello" };

                 var batch = new List<TestMessage>();
-                for (var i = 0; i < count; i++)
+                for (var i = 0; i < Count; i++)
                     batch.Add(messageSent);

                 var sw = Stopwatch.StartNew();
@@ -167,12 +168,12 @@
                 Assert.IsTrue(isMessageReceived.Wait(TimeOut), "Timeout waiting for message");
                 sw.Stop();

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
-            }
-        }
-
-        [TestCase(10000)]
-        public void One_Publisher_Ten_Subscribers_Single_Broadcasts(int count)
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
+            }
+        }
+
+        [Test]
+        public void One_Publisher_Ten_Subscribers_Single_Broadcasts()
         {
             using (var publisher = new Publisher())
             using (var subscriber = new Subscriber())
@@ -197,13 +198,13 @@
                 subscriber.MessageReceived += m =>
                 {
                     Interlocked.Increment(ref receivedCount);
-                    if (receivedCount >= count) isMessageReceived.Set();
-                };
-
-                var messageSent = new TestMessage { Text = "Hello" };
-
-                var sw = Stopwatch.StartNew();
-                for (var i = 0; i < count; i++)
+                    if (receivedCount >= Count) isMessageReceived.Set();
+                };
+
+                var messageSent = new TestMessage { Text = "Hello" };
+
+                var sw = Stopwatch.StartNew();
+                for (var i = 0; i < Count; i++)
                 {
                     publisher.Broadcast(messageSent);
                 }
@@ -212,12 +213,12 @@

                 subscribers.ForEach(sub => sub.Dispose());

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
-            }
-        }
-
-        [TestCase(10000)]
-        public void One_Publisher_Ten_Subscribers_Batch_Broadcast(int count)
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
+            }
+        }
+
+        [Test]
+        public void One_Publisher_Ten_Subscribers_Batch_Broadcast()
         {
             using (var publisher = new Publisher())
             using (var subscriber = new Subscriber())
@@ -242,13 +243,13 @@
                 subscriber.MessageReceived += m =>
                 {
                     Interlocked.Increment(ref receivedCount);
-                    if (receivedCount >= count) isMessageReceived.Set();
+                    if (receivedCount >= Count) isMessageReceived.Set();
                 };

                 var messageSent = new TestMessage { Text = "Hello" };

                 var batch = new List<TestMessage>();
-                for (var i = 0; i < count; i++)
+                for (var i = 0; i < Count; i++)
                     batch.Add(messageSent);

                 var sw = Stopwatch.StartNew();
@@ -258,7 +259,7 @@

                 subscribers.ForEach(sub => sub.Dispose());

-                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, count, count / sw.Elapsed.TotalSeconds);
+                Assert.Inconclusive("{0} elapsed reading {1} messages ({2:F0} per second)", sw.Elapsed, Count, Count / sw.Elapsed.TotalSeconds);
             }
         }


add SSV to TP calculation

add SSV to TP calculation

--- ElectronicObserver/Utility/Data/Calculator.cs
+++ ElectronicObserver/Utility/Data/Calculator.cs
@@ -646,6 +646,10 @@

 					case ShipTypes.FleetOiler:
 						tp += 15;
+						break;
+
+					case ShipTypes.SubmarineAircraftCarrier:
+						tp += 1;
 						break;
 				}
 			}


Added Shuffle in IEnumerableExtension

Added Shuffle in IEnumerableExtension

--- Elementary/Elementary/IEnumerableExtension.cs
+++ Elementary/Elementary/IEnumerableExtension.cs
@@ -19,5 +19,28 @@

             return q;
         }
+
+        public static IEnumerable<T> Shuffle<T>(this T[] o)
+        {
+            List<int> avaliableIndexes = Enumerable.Range(0, o.Length).ToList();
+            for (int i = 0; i < o.Length; i++)
+            {
+                int rndIndex = avaliableIndexes.Random();
+                avaliableIndexes.Remove(rndIndex);
+
+                yield return o[rndIndex];
+            }
+        }
+        public static IEnumerable<T> Shuffle<T>(this T o) where T : List<T>
+        {
+            List<int> avaliableIndexes = Enumerable.Range(0, o.Count).ToList();
+            for (int i = 0; i < o.Count; i++)
+            {
+                int rndIndex = avaliableIndexes.Random();
+                avaliableIndexes.Remove(rndIndex);
+
+                yield return o[rndIndex];
+            }
+        }
     }
 }


Cleanup

Cleanup

--- ExpressiveSharp/Expression/Nodes/AliasNode.cs
+++ ExpressiveSharp/Expression/Nodes/AliasNode.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;

 namespace ExpressiveSharp.Expression.Nodes
 {


Removed debug

Removed debug

--- Facepunch.Steamworks/Interop/Callback.This.cs
+++ Facepunch.Steamworks/Interop/Callback.This.cs
@@ -20,7 +20,7 @@
         {
             var ptr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback ) ) );

-            Callback.Result da = ( _, p ) => {  onRunCallback( _, p ); Console.WriteLine( "Callback.Result: {0}", _.ToInt64() ); };
+            Callback.Result da = ( _, p ) => {  onRunCallback( _, p ); };
             Callback.GetSize dc = ( _ ) => { return size; };

             cb.AddHandle( GCHandle.Alloc( da ) );


Added SmartConvert method.

Added SmartConvert method.

--- GameEngine/Extensions/ReflectionExtensions.cs
+++ GameEngine/Extensions/ReflectionExtensions.cs
@@ -17,16 +17,7 @@
         {
             PropertyInfo propertyInfo = target.GetType().GetProperty(propertyName);

-            Type targetType = propertyInfo.PropertyType;
-
-            if (targetType.IsEnum)
-                propertyInfo.SetValue(target, Enum.Parse(targetType, value), null);
-            else
-            {
-                object convertedValue = (targetType == typeof(Color)) ? ColorExtensions.ToColor(value) : Convert.ChangeType(value, targetType);
-
-                propertyInfo.SetValue(target, convertedValue , null);
-            }
+            propertyInfo.SetValue(target, SmartConvert(value, propertyInfo.PropertyType), null);
         }

         public static void SetProperty(object target, string propertyName, object value)
@@ -35,5 +26,13 @@

             propertyInfo.SetValue(target, value, null);
         }
+
+        public static object SmartConvert(string value, Type target)
+        {
+            if (target.IsEnum)
+                return Enum.Parse(target, value);
+            else
+                return (target == typeof(Color)) ? ColorExtensions.ToColor(value) : Convert.ChangeType(value, target);
+        }
     }
 }


Add tooltip to Cameo header of VoiceActorInfoGrid

--- Glyssen/Controls/VoiceActorInformationGrid.cs
+++ Glyssen/Controls/VoiceActorInformationGrid.cs
@@ -57,6 +57,9 @@
 			m_dataGrid.AllowUserToDeleteRows = true;
 			m_dataGrid.MultiSelect = true;
 			m_dataGrid.EditMode = DataGridViewEditMode.EditOnEnter;
+
+			Cameo.ToolTipText = LocalizationManager.GetString("DialogBoxes.VoiceActorInformation.CameoTooltip",
+															"Distinguished actor to play minor character role.");
 		}

 		void m_dataGrid_DataError(object sender, DataGridViewDataErrorEventArgs e)


feat: Add formatting method for routing header values

This will then be called by the generator for both implicit and explicit headers that are not for string fields.

It's slightly annoying to have to include a type name when calling
the method, but it's only ever used in autogenerated code, and I
think that beats exposing it in a less specific context.

Release-As: 4.2.0-alpha01

--- Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs
+++ Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs
@@ -8,7 +8,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Text.RegularExpressions;

 namespace Google.Api.Gax.Grpc
@@ -58,6 +57,16 @@
                 .Select(group => new SingleParameterExtractor(group))
                 .ToList();
         }
+
+        /// <summary>
+        /// Returns a string representation of the given value, suitable for including in a routing header.
+        /// (This method does not perform URI encoding; it is expected that the result of this method will either be
+        /// used in <see cref="WithExtractedParameter(string, string, Func{TRequest, string})"/>, or as an argument to
+        /// <see cref="ApiCall{TRequest, TResponse}.WithGoogleRequestParam(string, Func{TRequest, string})" />.)
+        /// </summary>
+        /// <param name="value">The value to format. May be null.</param>
+        /// <returns>The formatted value, or null if <paramref name="value"/> is null.</returns>
+        public static string FormatRoutingHeaderValue(object value) => ProtobufUtilities.FormatValueAsJsonPrimitive(value);

         /// <summary>
         /// Returns a new instance with the same parameter extractors as this one, with an additional one specified as arguments.


Make optional BackupInstance param non-positional.

--- Google.PowerShell/Sql/GcSqlInstanceCmdlets.cs
+++ Google.PowerShell/Sql/GcSqlInstanceCmdlets.cs
@@ -950,7 +950,7 @@
         /// The DatabaseInstance that describes the Replica we want to promote.
         /// </para>
         /// </summary>
-        [Parameter(Mandatory = false, Position = 2)]
+        [Parameter(Mandatory = false)]
         [ValidateNotNullOrEmpty]
         public string BackupInstance { get; set; }


Fix GcsBucketWebsite cmdlets

Fix GcsBucketWebsite cmdlets

--- Google.PowerShell/Storage/GcsBucketWebsite.cs
+++ Google.PowerShell/Storage/GcsBucketWebsite.cs
@@ -20,8 +20,14 @@
     /// <para type="description">
     /// Removes the website associated with a Cloud Storage Bucket.
     /// </para>
+    /// <example>
+    ///   <para>Remove the website data for $bucket.</para>
+    ///   <para>PS C:\> Remove-GcsBucketWebsite $bucket</para>
+    /// </example>
+    /// <para type="link" uri="(https://cloud.google.com/storage/docs/hosting-static-website)">[Static Website Hosting]</para>
+    /// <para type="link" uri="(https://cloud.google.com/storage/docs/static-website)">[Static Website Troubleshooting]</para>
     ///
-    [Cmdlet(VerbsCommon.Remove, "GcsBucketWebsite")]
+    [Cmdlet(VerbsCommon.Remove, "GcsBucketWebsite"), OutputType(typeof(Bucket))]
     public class RemoveGcsBucketWebsiteCmdlet : GcsCmdlet
     {
         ///
@@ -60,8 +66,15 @@
     /// <para type="description">
     /// Updates the website associated with a Cloud Storage Bucket.
     /// </para>
+    /// <example>
+    ///   <para>Host http://example.com from the contents of $bucket.</para>
+    ///   <para>PS C:\> Write-GcsBucketWebsite $bucket -MainPageSuffix "main.html" -NotFoundPage "error.html"</para>
+    ///   <para>Next, set the domains DNS records to point to Cloud Storage. See the "Static WebsiteHosting" help topic for more information.</para>
+    /// </example>
+    /// <para type="link" uri="(https://cloud.google.com/storage/docs/hosting-static-website)">[Static Website Hosting]</para>
+    /// <para type="link" uri="(https://cloud.google.com/storage/docs/static-website)">[Static Website Troubleshooting]</para>
     ///
-    [Cmdlet(VerbsCommunications.Write, "GcsBucketWebsite")]
+    [Cmdlet(VerbsCommunications.Write, "GcsBucketWebsite"), OutputType(typeof(Bucket))]
     public class WriteGcsBucketWebsiteCmdlet : GcsCmdlet
     {
         ///
@@ -73,11 +86,23 @@
         [PropertyByTypeTransformationAttribute(Property = "Name", TypeToTransform = typeof(Bucket))]
         public string Name { get; set; }

+        ///
+        /// <para typedef="description">
+        /// Storage object for the "main page" of the website, e.g. what is served from "http://example.com/".
+        /// Defaults to "index.html".
+        /// </para>
+        ///
         [Parameter(Position = 1)]
-        public string MainPageSuffix { get; set; }
+        public string MainPageSuffix { get; set; } = "index.html";

+        ///
+        /// <para typedef="description">
+        /// Storage object to render when no appropriate file is found, e.g. what is served from "http://example.com/sadjkffasugmd".
+        /// Defaults to "404.html".
+        /// </para>
+        ///
         [Parameter(Position = 2)]
-        public string NotFoundPage { get; set; }
+        public string NotFoundPage { get; set; } = "404.html";

         protected override void ProcessRecord()
         {


Refactoring of  samples.

Refactoring of  samples.

--- Grammars/Json/Tests/Sample.Json.Cs/Program.cs
+++ Grammars/Json/Tests/Sample.Json.Cs/Program.cs
@@ -1,11 +1,8 @@
 using N2;
+using N2.Tests;

 using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.IO;
-
-using N2.Tests;

 namespace Sample.Json.Cs
 {
@@ -16,9 +13,7 @@
       if (args.Length > 0)
         text = File.ReadAllText(args[0]);

-      var source = new SourceSnapshot(text);
-      var parserHost = new ParserHost();
-      var parseResult = JsonParser.Start(source, parserHost);
+      var parseResult = JsonParser.Start(new SourceSnapshot(text), new ParserHost());

       if (parseResult.IsSuccess)
       {


Version 2.13.6

Version 2.13.6

--- HeroesMatchTracker/Properties/AssemblyInfo.cs
+++ HeroesMatchTracker/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
     ResourceDictionaryLocation.SourceAssembly)]

 // by using the '*' as shown below:
-[assembly: AssemblyVersion("2.13.5")]
-[assembly: AssemblyFileVersion("2.13.5")]+[assembly: AssemblyVersion("2.13.6")]
+[assembly: AssemblyFileVersion("2.13.6")]


RECS0107: Redundant 'ToString()' call [ci skip]

--- ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs
+++ ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs
@@ -330,7 +330,7 @@
 			using (ZipOutputStream zOut = new ZipOutputStream(fs)) {
 				zOut.SetComment(comment);
 				for (int i = 0; i < entries; ++i) {
-					zOut.PutNextEntry(new ZipEntry(entryNamePrefix + (i + 1).ToString()));
+					zOut.PutNextEntry(new ZipEntry(entryNamePrefix + (i + 1)));
 					AddKnownDataToEntry(zOut, size);
 				}
 			}
@@ -343,7 +343,7 @@
 				zOut.IsStreamOwner = isOwner;
 				zOut.SetComment(comment);
 				for (int i = 0; i < entries; ++i) {
-					zOut.PutNextEntry(new ZipEntry(entryNamePrefix + (i + 1).ToString()));
+					zOut.PutNextEntry(new ZipEntry(entryNamePrefix + (i + 1)));
 					AddKnownDataToEntry(zOut, size);
 				}
 			}


Without the backslash, "C:Dir" does not take the child folder under the drive root but takes "whatever directory is the current directory for drive C: at the moment" and concats "Dir" to that, which would yield unexpected test results if you're using drive C: and got some currentdir on it different from the root.

--- ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs
+++ ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs
@@ -1127,7 +1127,7 @@
 			TestDirectory(wnt, "d", "d");
 			TestDirectory(wnt, "absolute/file2", @"absolute\file2");

-			string BaseDir1 = Path.Combine("C:", "Dir");
+			string BaseDir1 = Path.Combine("C:\\", "Dir");
 			wnt.BaseDirectory = BaseDir1;

 			TestDirectory(wnt, "talofa", Path.Combine(BaseDir1, "talofa"));


added handling for Jarrays, added check for if target to edit is the xvm reference path itself, added check if result from minipath search was null, added fix for using file root for writing to disk when using followPath

--- RelhaxModpack/RelhaxModpack/Utils/PatchUtils.cs
+++ RelhaxModpack/RelhaxModpack/Utils/PatchUtils.cs
@@ -491,13 +491,14 @@
             //if it is an xvm configuration file, or from editor, and we are wanting to followPath, then the root object then becomes the last item in the path
             //this works based on splitting up the path itself (forces dot convention) and going into files based on the reference
             //note that it will modify the patch path variable
+            JObject searchRoot = root;
             if ((Path.GetExtension(p.CompletePath).ToLower().Equals(".xc") || p.FromEditor) && p.FollowPath)
             {
                 Logging.Debug("followpath is true, and either editor or xc file, following path to get actual root json object");
-                root = FollowXvmPath(p, root);
-            }
-
-            if(root == null && p.FollowPath)
+                searchRoot = FollowXvmPath(p, root);
+            }
+
+            if(searchRoot == null && p.FollowPath)
             {
                 Logging.Debug("root Jobject is null, meaning followPath previously completed, so stop here");
                 return;
@@ -507,22 +508,22 @@
             switch (p.Mode.ToLower())
             {
                 case "add":
-                    JsonAdd(p, root);
+                    JsonAdd(p, searchRoot);
                     break;
                 case "edit":
-                    JsonEditRemove(p, root, true);
+                    JsonEditRemove(p, searchRoot, true);
                     break;
                 case "remove":
-                    JsonEditRemove(p, root, false);
+                    JsonEditRemove(p, searchRoot, false);
                     break;
                 case "arrayadd":
-                    JsonArrayAdd(p, root);
+                    JsonArrayAdd(p, searchRoot);
                     break;
                 case "arrayremove":
-                    JsonArrayRemoveClear(p, root, true);
+                    JsonArrayRemoveClear(p, searchRoot, true);
                     break;
                 case "arrayclear":
-                    JsonArrayRemoveClear(p, root, false);
+                    JsonArrayRemoveClear(p, searchRoot, false);
                     break;
                 default:
                     Logging.Error("ERROR: Unknown json patch mode, {0}", p.Mode);
@@ -964,6 +965,11 @@
                     Logging.Error(tokenSearchException.ToString());
                     break;
                 }
+                if(pathSearchResult == null)
+                {
+                    Logging.Error("minipath search result is null, error with the given path?");
+                    break;
+                }
                 if(pathSearchResult is JObject jobject)
                 {
                     //if it's a jboject, then search inside with saving
@@ -972,17 +978,25 @@
                 }
                 else if (pathSearchResult is JArray jarray)
                 {
-                    throw new BadMemeException("wait that's illegal");
+                    //if the result is an array then it's an arrayEdit. return the latest object and path. an array in an array has yet to be seen
+                    Logging.Debug("miniPath resulted in Jarray, stop and return latest object");
+                    break;
                 }
                 else if (pathSearchResult is JValue jvalue)
                 {
-                    Logging.Debug("miniPath resulted in jValue, checking if reference or value");
+                    Logging.Debug("miniPath resulted in jValue, checking if string for xvm reference");
                     if(jvalue.Value is string value)
                     {
                         Logging.Debug("jValue is string, checking for xvm reference");
                         if(value.Contains(@"[xvm_dollar]"))
                         {
-                            Logging.Debug("xvm reference detected, parsing");
+                            Logging.Debug("xvm reference detected, checking if reference is target and not add");
+                            if(pathArray.Count == 1 && !p.Mode.ToLower().Equals("add"))
+                            {
+                                Logging.Debug("this reference is the target, so don't enter it. return latest object");
+                                break;
+                            }
+                            Logging.Debug("reference is not target");

                             //parse the first part of the reference, could be direct reference path inside file or filename
                             string fileOrReference = value.Split(new string[] { @"[xvm_dollar][lbracket][quote]"}, StringSplitOptions.RemoveEmptyEntries)[0].Split('[')[0];


add test wait timeout

add test wait timeout

--- test/Condenser.Tests.Integration/Routing/RoutingFixture.cs
+++ test/Condenser.Tests.Integration/Routing/RoutingFixture.cs
@@ -144,9 +144,9 @@

         }

-        public Task<bool> WaitForRegistrationAsync()
+        public Task WaitForRegistrationAsync()
         {
-            return _wait.WaitAsync();
+            return Task.WhenAny(new[] { _wait.WaitAsync(), Task.Delay(30 * 1000) });
         }

         private void SignalWhenAllRegistered(Dictionary<string, List<IService>> data)


Comments for WebViewExtensions.cs

Comments for WebViewExtensions.cs

--- wallabag/wallabag.Shared/Common/WebViewExtensions.cs
+++ wallabag/wallabag.Shared/Common/WebViewExtensions.cs
@@ -3,6 +3,9 @@

 namespace wallabag.Common
 {
+    /// <summary>
+    /// This class allows us to enable binding to a string property which contains HTML.
+    /// </summary>
     class WebViewExtensions
     {
         public static string GetHTML(DependencyObject obj)


minor code refactoring

minor code refactoring

--- Irony.Samples/Scheme/SchemeGrammar.cs
+++ Irony.Samples/Scheme/SchemeGrammar.cs
@@ -204,6 +204,8 @@
       BraceMatchFilter filter = new BraceMatchFilter();
       TokenFilters.Add(filter);

+      //Scheme is tail-recursive language
+      base.Options |= LanguageOptions.TailRecursive;

     }//constructor


Delete MouseTranslate.cs

Delete MouseTranslate.cs

--- InputLagTest/Assets/Scripts/MouseTranslate.cs
+++ InputLagTest/Assets/Scripts/MouseTranslate.cs
@@ -1,22 +0,0 @@
-using UnityEngine;
-
-//This is placed on the cameras gameobject
-public class MouseTranslate : MonoBehaviour
-{
-	public float mouseSpeed;
-	public bool useButtonInsteadOfMouseMove;
-	public KeyCode inputKey = KeyCode.Mouse0;
-
-	void Update()
-	{
-		if(useButtonInsteadOfMouseMove) //Could be keyboard or mouse buttons
-		{
-			if(Input.GetKeyDown(inputKey))
-			{
-				transform.Rotate(0, mouseSpeed, 0);
-			}
-		}else{
-			transform.Rotate(0, Input.GetAxisRaw("Mouse X") * mouseSpeed, 0);
-		}
-	}
-}


Use BlockingCollection<T> instead of (brittle) AutoResetEvent/ConcurrentQueue handrolled lameness

--- IronSmarkets.Tests/Mocks/MockSessionSocket.cs
+++ IronSmarkets.Tests/Mocks/MockSessionSocket.cs
@@ -106,13 +106,8 @@
     {
         private readonly Queue<IPayloadWrapper> _payloads =
             new Queue<IPayloadWrapper>();
-        private readonly ConcurrentQueue<Payload> _incoming =
-            new ConcurrentQueue<Payload>();
-
-        // We only expect 1 waiting thread, so this WaitHandle should
-        // suffice
-        private readonly AutoResetEvent _incomingEvent =
-            new AutoResetEvent(false);
+        private readonly BlockingCollection<Payload> _incoming =
+            new BlockingCollection<Payload>(new ConcurrentQueue<Payload>());

         private bool _disposed;
         private bool _connected;
@@ -183,8 +178,7 @@
                 throw new ConnectionException(
                     "Socket not connected");

-            _incoming.Enqueue(payload);
-            _incomingEvent.Set();
+            _incoming.Add(payload);
         }

         public void Flush()
@@ -218,14 +212,11 @@
                 var next = _payloads.Peek();
                 if (next.Outgoing)
                     return _payloads.Dequeue().Payload;
+                Payload lastIn;
                 // We are very impatient in unit tests
-                if (!_incomingEvent.WaitOne(1000)) ThrowNotConnected();
-                Payload lastIn;
-                if (!_incoming.TryPeek(out lastIn)) ThrowNotConnected();
+                if (!_incoming.TryTake(out lastIn, 1000)) ThrowNotConnected();
                 if (!next.Expects(lastIn))
                     throw new InvalidOperationException();
-                if (!_incoming.TryDequeue(out lastIn))
-                    ThrowNotConnected();
                 _payloads.Dequeue();
             }
         }


avoid first chance exception in FlushAllAsync

--- Kudu.Core/Infrastructure/ProcessExtensions.cs
+++ Kudu.Core/Infrastructure/ProcessExtensions.cs
@@ -252,8 +252,18 @@

                 try
                 {
-                    // observe all tasks to avoid process crashes
-                    await Task.WhenAll(stdio, delay);
+                    // in happy path, stdio task will complete in timely manner and
+                    // delay task is canceled.  we observe the delay.Exception
+                    // explicitly to avoid first chance exception.
+                    if (delay.IsCanceled && delay.Exception == null)
+                    {
+                        await stdio;
+                    }
+                    else
+                    {
+                        // observe all tasks to avoid process crashes
+                        await Task.WhenAll(stdio, delay);
+                    }

                     // in case tasks completion races with cancellation
                     break;


Increment version number

Increment version number

--- NET/API/Treehopper/Properties/AssemblyInfo.cs
+++ NET/API/Treehopper/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.0.0")]
-[assembly: AssemblyFileVersion("1.2.0.0")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]


archer's custom reaction

archer's custom reaction

--- NadekoBot/_Models/JSONModels/Configuration.cs
+++ NadekoBot/_Models/JSONModels/Configuration.cs
@@ -87,6 +87,9 @@
             } },
             { "%mention% threaten", new List<string>() {
                 "You wanna die, %target%?"
+            } },
+            { "%mention% archer", new List<string>() {
+                "http://i.imgur.com/Bha9NhL.jpg"
             } }
         };


Added tokenization tests for #786

Added tokenization tests for #786

--- src/AngleSharp.Core.Tests/Html/HtmlTokenization.cs
+++ src/AngleSharp.Core.Tests/Html/HtmlTokenization.cs
@@ -18,6 +18,45 @@
         private static HtmlTokenizer CreateTokenizer(TextSource source)
         {
             return new HtmlTokenizer(source, HtmlEntityProvider.Resolver);
+        }
+
+        [Test]
+        public void TokenizationCarriageReturnPureCharactersIssue_786()
+        {
+            var ms = new MemoryStream(Encoding.UTF8.GetBytes("\r\nThis is test 1\r\nThis is test 2"));
+            var s = new TextSource(ms);
+            var t = CreateTokenizer(s);
+            var token = t.Get();
+            Assert.AreEqual(HtmlTokenType.Character, token.Type);
+            Assert.AreEqual("\nThis is test 1\nThis is test 2", token.Data);
+        }
+
+        [Test]
+        public void TokenizationCarriageReturnNonLeadingIssue_786()
+        {
+            var ms = new MemoryStream(Encoding.UTF8.GetBytes("
\r\nThis is test 1
 \r\nThis is test 2"));
+            var s = new TextSource(ms);
+            var t = CreateTokenizer(s);
+            var tokenHtmlOpen = t.Get();
+            var tokenBodyOpen = t.Get();
+            var tokenP1 = t.Get();
+            var tokenP1data = t.Get();
+            var tokenP2 = t.Get();
+            var tokenP2data = t.Get();
+            var tokenBodyClose = t.Get();
+            var tokenHtmlClose = t.Get();
+            var eof = t.Get();
+            Assert.AreEqual(HtmlTokenType.EndTag, tokenHtmlClose.Type);
+            Assert.AreEqual(HtmlTokenType.StartTag, tokenHtmlOpen.Type);
+            Assert.AreEqual(HtmlTokenType.EndTag, tokenBodyClose.Type);
+            Assert.AreEqual(HtmlTokenType.StartTag, tokenBodyOpen.Type);
+            Assert.AreEqual(HtmlTokenType.StartTag, tokenP1.Type);
+            Assert.AreEqual(HtmlTokenType.StartTag, tokenP2.Type);
+            Assert.AreEqual(HtmlTokenType.Character, tokenP1data.Type);
+            Assert.AreEqual(HtmlTokenType.Character, tokenP2data.Type);
+            Assert.AreEqual(HtmlTokenType.EndOfFile, eof.Type);
+            Assert.AreEqual("\nThis is test 1", tokenP1data.Data);
+            Assert.AreEqual(" \nThis is test 2", tokenP2data.Data);
         }

         [Test]


Do not serialize properties which are flagged with arango specific attributes.

--- src/Arango/Arango.Client/API/Documents/Document.cs
+++ src/Arango/Arango.Client/API/Documents/Document.cs
@@ -646,7 +646,14 @@

                 if (arangoProperty != null)
                 {
-                    if (!arangoProperty.Serializable)
+                    // do not convert properties which are not flagged for serialization or
+                    // represent arango specific fields
+                    if (!arangoProperty.Serializable ||
+                        arangoProperty.Identity ||
+                        arangoProperty.Key ||
+                        arangoProperty.Revision ||
+                        arangoProperty.From ||
+                        arangoProperty.To)
                     {
                         continue;
                     }