Reverting internal methods to public methods in RepositoryFactory

--- src/Umbraco.Core/Persistence/RepositoryFactory.cs
+++ src/Umbraco.Core/Persistence/RepositoryFactory.cs
@@ -24,7 +24,7 @@
                 CreateUserTypeRepository(uow));
         }

-        internal virtual IContentRepository CreateContentRepository(IDatabaseUnitOfWork uow)
+        public virtual IContentRepository CreateContentRepository(IDatabaseUnitOfWork uow)
         {
             return new ContentRepository(
                 uow,
@@ -33,7 +33,7 @@
                 CreateTemplateRepository(uow));
         }

-        internal virtual IContentTypeRepository CreateContentTypeRepository(IDatabaseUnitOfWork uow)
+        public virtual IContentTypeRepository CreateContentTypeRepository(IDatabaseUnitOfWork uow)
         {
             return new ContentTypeRepository(
                 uow,
@@ -41,14 +41,14 @@
                 new TemplateRepository(uow, NullCacheProvider.Current));
         }

-        internal virtual IDataTypeDefinitionRepository CreateDataTypeDefinitionRepository(IDatabaseUnitOfWork uow)
+        public virtual IDataTypeDefinitionRepository CreateDataTypeDefinitionRepository(IDatabaseUnitOfWork uow)
         {
             return new DataTypeDefinitionRepository(
                 uow,
                 NullCacheProvider.Current);
         }

-        internal virtual IDictionaryRepository CreateDictionaryRepository(IDatabaseUnitOfWork uow)
+        public virtual IDictionaryRepository CreateDictionaryRepository(IDatabaseUnitOfWork uow)
         {
             return new DictionaryRepository(
                 uow,
@@ -56,7 +56,7 @@
                 CreateLanguageRepository(uow));
         }

-        internal virtual ILanguageRepository CreateLanguageRepository(IDatabaseUnitOfWork uow)
+        public virtual ILanguageRepository CreateLanguageRepository(IDatabaseUnitOfWork uow)
         {
             return new LanguageRepository(
                 uow,
@@ -70,7 +70,7 @@
                 InMemoryCacheProvider.Current);
         }

-        internal virtual IMediaRepository CreateMediaRepository(IDatabaseUnitOfWork uow)
+        public virtual IMediaRepository CreateMediaRepository(IDatabaseUnitOfWork uow)
         {
             return new MediaRepository(
                 uow,
@@ -78,14 +78,14 @@
                 CreateMediaTypeRepository(uow));
         }

-        internal virtual IMediaTypeRepository CreateMediaTypeRepository(IDatabaseUnitOfWork uow)
+        public virtual IMediaTypeRepository CreateMediaTypeRepository(IDatabaseUnitOfWork uow)
         {
             return new MediaTypeRepository(
                 uow,
                 InMemoryCacheProvider.Current);
         }

-        internal virtual IRelationRepository CreateRelationRepository(IDatabaseUnitOfWork uow)
+        public virtual IRelationRepository CreateRelationRepository(IDatabaseUnitOfWork uow)
         {
             return new RelationRepository(
                 uow,
@@ -93,24 +93,24 @@
                 CreateRelationTypeRepository(uow));
         }

-        internal virtual IRelationTypeRepository CreateRelationTypeRepository(IDatabaseUnitOfWork uow)
+        public virtual IRelationTypeRepository CreateRelationTypeRepository(IDatabaseUnitOfWork uow)
         {
             return new RelationTypeRepository(
                 uow,
                 NullCacheProvider.Current);
         }

-        internal virtual IScriptRepository CreateScriptRepository(IUnitOfWork uow)
+        public virtual IScriptRepository CreateScriptRepository(IUnitOfWork uow)
         {
             return new ScriptRepository(uow);
         }

-        internal virtual IStylesheetRepository CreateStylesheetRepository(IUnitOfWork uow)
+        public virtual IStylesheetRepository CreateStylesheetRepository(IUnitOfWork uow)
         {
             return new StylesheetRepository(uow);
         }

-        internal virtual ITemplateRepository CreateTemplateRepository(IDatabaseUnitOfWork uow)
+        public virtual ITemplateRepository CreateTemplateRepository(IDatabaseUnitOfWork uow)
         {
             return new TemplateRepository(uow, NullCacheProvider.Current);
         }


minor doc comment

minor doc comment

--- src/UriBuilder.Fluent/TerribleDevUriExtensions.cs
+++ src/UriBuilder.Fluent/TerribleDevUriExtensions.cs
@@ -22,6 +22,7 @@
         /// </summary>
         /// <param name="bld"></param>
         /// <param name="parameterDictionary"></param>
+        /// <exception cref="ArgumentNullException"></exception>
         /// <returns></returns>
         public static UriBuilder WithParameter(this UriBuilder bld, IDictionary<string, string> parameterDictionary)
         {


allow configurable skia resource limit.

allow configurable skia resource limit.

--- src/Web/Avalonia.Web.Blazor/AvaloniaView.razor.cs
+++ src/Web/Avalonia.Web.Blazor/AvaloniaView.razor.cs
@@ -278,9 +278,9 @@
                         _glInterface = GRGlInterface.Create();
                         _context = GRContext.CreateGl(_glInterface);

-
+                        var options = AvaloniaLocator.Current.GetService<SkiaOptions>();
                         // bump the default resource cache limit
-                        _context.SetResourceCacheLimit(256 * 1024 * 1024);
+                        _context.SetResourceCacheLimit(options.MaxGpuResourceSizeBytes ?? 32 * 1024 * 1024);
                         Console.WriteLine("glcontext created and resource limit set");
                     }


Changing log file name format

Changing log file name format

--- src/WebJobs.Script/Diagnostics/FileTraceWriter.cs
+++ src/WebJobs.Script/Diagnostics/FileTraceWriter.cs
@@ -186,7 +186,7 @@

             // add the line to the current buffer batch, which is flushed
             // on a timer
-            line = string.Format(CultureInfo.InvariantCulture, "{0} {1}", DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff", CultureInfo.InvariantCulture), line.Trim());
+            line = string.Format(CultureInfo.InvariantCulture, "{0} {1}", DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fff", CultureInfo.InvariantCulture), line.Trim());
             _logBuffer.Enqueue(line);
         }

@@ -204,7 +204,7 @@

             // we include a machine identifier in the log file name to ensure we don't have any
             // log file contention between scaled out instances
-            string filePath = Path.Combine(_logFilePath, string.Format(CultureInfo.InvariantCulture, "{0}-{1}.log", Guid.NewGuid(), _instanceId));
+            string filePath = Path.Combine(_logFilePath, string.Format(CultureInfo.InvariantCulture, "{0}-{1}.log", DateTime.UtcNow.ToString("yyyy-MM-ddTHH-mm-ssK"), _instanceId));
             _currentLogFileInfo = new FileInfo(filePath);
         }


Fixing bad merge (#3331)

Fixing bad merge (#3331)

--- src/WebJobs.Script/ScriptHostBuilderExtensions.cs
+++ src/WebJobs.Script/ScriptHostBuilderExtensions.cs
@@ -125,7 +125,7 @@
                 services.AddSingleton<IOptions<ScriptApplicationHostOptions>>(new OptionsWrapper<ScriptApplicationHostOptions>(applicationHostOptions));
                 services.AddSingleton<IOptionsMonitor<ScriptApplicationHostOptions>>(new ScriptApplicationHostOptionsMonitor(applicationHostOptions));
                 services.ConfigureOptions<ScriptHostOptionsSetup>();
-
+                services.ConfigureOptions<HostHealthMonitorOptionsSetup>();
                 services.ConfigureOptions<JobHostFunctionTimeoutOptionsSetup>();
                 // TODO: pgopa only add this to WebHostServiceCollection
                 services.ConfigureOptions<LanguageWorkerOptionsSetup>();


Update test from error to warning

Update test from error to warning

--- Assets/MixedRealityToolkit.Tests/EditModeTests/Core/MixedRealityToolkitTests.cs
+++ Assets/MixedRealityToolkit.Tests/EditModeTests/Core/MixedRealityToolkitTests.cs
@@ -45,7 +45,7 @@
             MixedRealityToolkit.Instance.ActiveProfile = null;

             // Tests
-            LogAssert.Expect(LogType.Error, "No Mixed Reality Configuration Profile found, cannot initialize the Mixed Reality Toolkit");
+            LogAssert.Expect(LogType.Warning, "No Mixed Reality Configuration Profile found, cannot initialize the Mixed Reality Toolkit");
             Assert.IsFalse(MixedRealityToolkit.Instance.HasActiveProfile);
             Assert.IsNull(MixedRealityToolkit.Instance.ActiveProfile);
         }


SkipPagesWithTheWrongRootNode - Red

SkipPagesWithTheWrongRootNode - Red

--- PrehensilePonyTail/PPTail.Data.FileSystem.Test/Repository_GetAllPages_Should.cs
+++ PrehensilePonyTail/PPTail.Data.FileSystem.Test/Repository_GetAllPages_Should.cs
@@ -98,9 +98,23 @@
             Assert.Equal(0, pages.Count());
         }

-        [Fact(Skip = "NotImplemented")]
+        [Fact]
         public void SkipPagesWithTheWrongRootNode()
         {
+            var files = new List<string>();
+            files.Add("68AA2FE5-58F9-421A-9C1B-02254B953BC5.xml");
+
+            var fileSystem = new MockFileSystem();
+            fileSystem.Files = files;
+            fileSystem.FileText = "<posts/>";
+
+            var serviceProvider = new ServiceCollection();
+            serviceProvider.AddSingleton<IFileSystem>(fileSystem);
+
+            var target = (null as IContentRepository).Create(serviceProvider);
+            var pages = target.GetAllPages();
+
+            Assert.Equal(0, pages.Count());
         }
     }
 }


TVA.Core: Wrapped retry events for InterprocessCache with a not disposed test for safety since thread pool threads could still fire outside of class being disposed.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS05]$/tvacodelibrary/Main;C65154

--- Source/OldCode/TVACodeLibrary/Source/Libraries/TVA.Core/IO/InterprocessCache.cs
+++ Source/OldCode/TVACodeLibrary/Source/Libraries/TVA.Core/IO/InterprocessCache.cs
@@ -660,90 +660,44 @@
         /// </summary>
         private void SynchronizedWrite(object state)
         {
-            if (m_fileLock.TryEnterWriteLock((int)m_retryTimer.Interval))
-            {
-                FileStream fileStream = null;
-
-                try
-                {
-                    fileStream = new FileStream(m_fileName, FileMode.Create, FileAccess.Write, FileShare.None);
-
-                    if (m_dataLock.TryEnterReadLock((int)m_retryTimer.Interval))
-                    {
-                        try
-                        {
-                            // Disable file watch notification before update
-                            if (m_fileWatcher != null)
-                                m_fileWatcher.EnableRaisingEvents = false;
-
-                            SaveFileData(fileStream, m_fileData);
-                            m_saveIsQueued.Set();
-                        }
-                        finally
-                        {
-                            m_dataLock.ExitReadLock();
-
-                            // Reenable file watch notification
-                            if (m_fileWatcher != null)
-                                m_fileWatcher.EnableRaisingEvents = true;
-                        }
-                    }
-                }
-                catch (IOException ex)
-                {
-                    RetrySynchronizedEvent(ex, WriteEvent);
-                }
-                finally
-                {
-                    m_fileLock.ExitWriteLock();
-
-                    if (fileStream != null)
-                        fileStream.Close();
-                }
-            }
-            else
-            {
-                RetrySynchronizedEvent(new TimeoutException("Timeout waiting to acquire write lock for " + m_fileName), WriteEvent);
-            }
-        }
-
-        /// <summary>
-        /// Synchronously reads file data when no writes are active.
-        /// </summary>
-        private void SynchronizedRead(object state)
-        {
-            if (File.Exists(m_fileName))
-            {
-                if (m_fileLock.TryEnterReadLock((int)m_retryTimer.Interval))
+            if (!m_disposed)
+            {
+                if (m_fileLock.TryEnterWriteLock((int)m_retryTimer.Interval))
                 {
                     FileStream fileStream = null;

                     try
                     {
-                        fileStream = new FileStream(m_fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
-
-                        if (m_dataLock.TryEnterWriteLock((int)m_retryTimer.Interval))
+                        fileStream = new FileStream(m_fileName, FileMode.Create, FileAccess.Write, FileShare.None);
+
+                        if (m_dataLock.TryEnterReadLock((int)m_retryTimer.Interval))
                         {
                             try
                             {
-                                m_fileData = LoadFileData(fileStream);
+                                // Disable file watch notification before update
+                                if (m_fileWatcher != null)
+                                    m_fileWatcher.EnableRaisingEvents = false;
+
+                                SaveFileData(fileStream, m_fileData);
+                                m_saveIsQueued.Set();
                             }
                             finally
                             {
-                                m_dataLock.ExitWriteLock();
+                                m_dataLock.ExitReadLock();
+
+                                // Reenable file watch notification
+                                if (m_fileWatcher != null)
+                                    m_fileWatcher.EnableRaisingEvents = true;
                             }
-
-                            // Release any threads waiting for file data
-                            m_dataIsReady.Set();
                         }
                     }
                     catch (IOException ex)
                     {
-                        RetrySynchronizedEvent(ex, ReadEvent);
+                        RetrySynchronizedEvent(ex, WriteEvent);
                     }
                     finally
                     {
-                        m_fileLock.ExitReadLock();
+                        m_fileLock.ExitWriteLock();

                         if (fileStream != null)
                             fileStream.Close();
@@ -751,17 +705,68 @@
                 }
                 else
                 {
-                    RetrySynchronizedEvent(new TimeoutException("Timeout waiting to acquire read lock for " + m_fileName), ReadEvent);
-                }
-
-            }
-            else
-            {
-                // File doesn't exist, create ane empty array representing a zero-length file
-                m_fileData = new byte[0];
-
-                // Release any threads waiting for file data
-                m_dataIsReady.Set();
+                    RetrySynchronizedEvent(new TimeoutException("Timeout waiting to acquire write lock for " + m_fileName), WriteEvent);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Synchronously reads file data when no writes are active.
+        /// </summary>
+        private void SynchronizedRead(object state)
+        {
+            if (!m_disposed)
+            {
+                if (File.Exists(m_fileName))
+                {
+                    if (m_fileLock.TryEnterReadLock((int)m_retryTimer.Interval))
+                    {
+                        FileStream fileStream = null;
+
+                        try
+                        {
+                            fileStream = new FileStream(m_fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
+
+                            if (m_dataLock.TryEnterWriteLock((int)m_retryTimer.Interval))
+                            {
+                                try
+                                {
+                                    m_fileData = LoadFileData(fileStream);
+                                }
+                                finally
+                                {
+                                    m_dataLock.ExitWriteLock();
+                                }
+
+                                // Release any threads waiting for file data
+                                m_dataIsReady.Set();
+                            }
+                        }
+                        catch (IOException ex)
+                        {
+                            RetrySynchronizedEvent(ex, ReadEvent);
+                        }
+                        finally
+                        {
+                            m_fileLock.ExitReadLock();
+
+                            if (fileStream != null)
+                                fileStream.Close();
+                        }
+                    }
+                    else
+                    {
+                        RetrySynchronizedEvent(new TimeoutException("Timeout waiting to acquire read lock for " + m_fileName), ReadEvent);
+                    }
+                }
+                else
+                {
+                    // File doesn't exist, create ane empty array representing a zero-length file
+                    m_fileData = new byte[0];
+
+                    // Release any threads waiting for file data
+                    m_dataIsReady.Set();
+                }
             }
         }

@@ -772,32 +777,34 @@
         /// <param name="eventType">Event type to retry.</param>
         private void RetrySynchronizedEvent(Exception ex, int eventType)
         {
-            // We monitor basic I/O and lock failures occurring in quick succession, we can't allow retry activity to go on forever
-            if (DateTime.UtcNow.Ticks - m_lastRetryTime > (long)Ticks.FromMilliseconds(m_retryTimer.Interval * m_maximumRetryAttempts))
-            {
-                // Significant time has passed since last retry, so we reset counter
-                m_retryCount = 0;
-                m_lastRetryTime = DateTime.UtcNow.Ticks;
-            }
-            else
-            {
-                m_retryCount++;
-
-                if (m_retryCount >= m_maximumRetryAttempts)
-                    throw new UnauthorizedAccessException("Failed to " + (eventType == WriteEvent ? "write" : "read") + " data to " + m_fileName + " after " + m_maximumRetryAttempts + " attempts: " + ex.Message, ex);
-            }
-
-            // Technically the interprocess mutex will handle serialized access to the file, but if the OS or other process
-            // not participating with the mutex has the file locked, all we can do is queue up a retry for this event.
-            lock (m_retryQueue)
-            {
-                m_retryQueue[eventType] = true;
-            }
-            m_retryTimer.Start();
-
             // A retry is only being initiating for basic file I/O or locking errors, all other errors will initiate an unhandled
             // exception causing system exit. It would be an error, IMO, for the system to create values then not be able to load
             // them at next run or not be able to use values from last run because file could not be loaded.
+            if (!m_disposed)
+            {
+                // We monitor basic I/O and lock failures occurring in quick succession, we can't allow retry activity to go on forever
+                if (DateTime.UtcNow.Ticks - m_lastRetryTime > (long)Ticks.FromMilliseconds(m_retryTimer.Interval * m_maximumRetryAttempts))
+                {
+                    // Significant time has passed since last retry, so we reset counter
+                    m_retryCount = 0;
+                    m_lastRetryTime = DateTime.UtcNow.Ticks;
+                }
+                else
+                {
+                    m_retryCount++;
+
+                    if (m_retryCount >= m_maximumRetryAttempts)
+                        throw new UnauthorizedAccessException("Failed to " + (eventType == WriteEvent ? "write" : "read") + " data to " + m_fileName + " after " + m_maximumRetryAttempts + " attempts: " + ex.Message, ex);
+                }
+
+                // Technically the interprocess mutex will handle serialized access to the file, but if the OS or other process
+                // not participating with the mutex has the file locked, all we can do is queue up a retry for this event.
+                lock (m_retryQueue)
+                {
+                    m_retryQueue[eventType] = true;
+                }
+                m_retryTimer.Start();
+            }
         }

         /// <summary>
@@ -805,31 +812,34 @@
         /// </summary>
         private void m_retryTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
         {
-            WaitCallback callBackEvent = null;
-
-            lock (m_retryQueue)
-            {
-                // Reads should always occur first since you may need to load any
-                // newly written data before saving new data: users can override
-                // load and save behavior to "merge" data sets if needed.
-                if (m_retryQueue[ReadEvent])
-                {
-                    callBackEvent = SynchronizedRead;
-                    m_retryQueue[ReadEvent] = false;
-                }
-                else if (m_retryQueue[WriteEvent])
-                {
-                    callBackEvent = SynchronizedWrite;
-                    m_retryQueue[WriteEvent] = false;
-                }
-
-                // If any events remain queued for retry, start timer for next event
-                if (m_retryQueue.Any(true))
-                    m_retryTimer.Start();
-            }
-
-            if (callBackEvent != null)
-                ThreadPool.QueueUserWorkItem(callBackEvent);
+            if (!m_disposed)
+            {
+                WaitCallback callBackEvent = null;
+
+                lock (m_retryQueue)
+                {
+                    // Reads should always occur first since you may need to load any
+                    // newly written data before saving new data: users can override
+                    // load and save behavior to "merge" data sets if needed.
+                    if (m_retryQueue[ReadEvent])
+                    {
+                        callBackEvent = SynchronizedRead;
+                        m_retryQueue[ReadEvent] = false;
+                    }
+                    else if (m_retryQueue[WriteEvent])
+                    {
+                        callBackEvent = SynchronizedWrite;
+                        m_retryQueue[WriteEvent] = false;
+                    }
+
+                    // If any events remain queued for retry, start timer for next event
+                    if (m_retryQueue.Any(true))
+                        m_retryTimer.Start();
+                }
+
+                if (callBackEvent != null)
+                    ThreadPool.QueueUserWorkItem(callBackEvent);
+            }
         }

         /// <summary>


Removed commented lines from TestSettingsRepository.

--- Trappist/src/Promact.Trappist.Repository/TestSettings/TestSettingsRepository.cs
+++ Trappist/src/Promact.Trappist.Repository/TestSettings/TestSettingsRepository.cs
@@ -47,7 +47,6 @@
         /// <returns>Settings Saved for the selected Test</returns>
         public Test GetTestSettings(int id)
         {
-            //var get = _dbContext.Test.FirstOrDefault(x=> x.Id == 74);
             var get = _dbContext.Test.FirstOrDefault(x => x.Id == id);
             return get;
         }


Add comment

Add comment

Add comment

--- VisualStudioProjects/ArrayDataGraphic/ArrayDataGraphic/CSharpFiles/DataArray.cs
+++ VisualStudioProjects/ArrayDataGraphic/ArrayDataGraphic/CSharpFiles/DataArray.cs
@@ -1,4 +1,12 @@
-using System;
+/********************************************************************
+ * Develop by Jimmy Hu												*
+ * This program is licensed under the Apache License 2.0.			*
+ * DataArray.cs														*
+ * 本檔案建立繪圖資料佇列單元物件									*
+ ********************************************************************
+ */
+
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -6,7 +14,8 @@

 namespace ArrayDataGraphic.CSharpFiles
 {                                                                               //	namespace start, 進入命名空間
-	class DataArray
-	{
-	}
+	class DataArray                                                             //	DataArray class, DataArray類別
+	{                                                                           //	DataArray class start, 開始DataArray類別
+
+	}                                                                           //	DataArray class end, 結束DataArray類別
 }                                                                               //	namespace end, 結束命名空間


Renames variables for readability

Renames variables for readability

--- 02-PokerHands/02-PokerHands/HandRecognizer.cs
+++ 02-PokerHands/02-PokerHands/HandRecognizer.cs
@@ -56,31 +56,31 @@

 		private static int getUniqueCardCount(List<Card> cards)
 		{
-			int _binaryRepresentation_Face =
+			int _faceValuesBinary =
 				(int)cards[0].Number
 				& (int)cards[1].Number
 				& (int)cards[2].Number
 				& (int)cards[3].Number
 				& (int)cards[4].Number;
-			int _uniqueCardCount = 0;
+			int _uniqueFaceValueCount = 0;

-			for (int _count = 0; _count < 13; _count++ )
+			for (int _faceCount = 0; _faceCount < 13; _faceCount++ )
 			{
-				// Check the 1s digit of the binary representation of the poker hand. If it's a 1, that's a unique card
-				if ((_binaryRepresentation_Face & 1) == 1)
+				// Check the 1s digit of the binary representation of the poker hand's values. If it's a 1, that's a unique card
+				if ((_faceValuesBinary & 1) == 1)
 				{
-					_uniqueCardCount++;
+					_uniqueFaceValueCount++;
 				}

-				_binaryRepresentation_Face = _binaryRepresentation_Face >> 1;
+				_faceValuesBinary = _faceValuesBinary >> 1;
 			}

-			return _uniqueCardCount;
+			return _uniqueFaceValueCount;
 		}

-		private static bool isFlush(List<Card> cards)
+		private static int getUniqueSuitCount(List<Card> cards)
 		{
-			int _binaryRepresentation_Suit =
+			int _SuitsBinary =
 				(int)cards[0].Suit
 				& (int)cards[1].Suit
 				& (int)cards[2].Suit
@@ -88,18 +88,23 @@
 				& (int)cards[4].Suit;
 			int _uniqueSuitCount = 0;

-			for (int _count = 0; _count < 4; _count++)
+			for (int _suitCount = 0; _suitCount < 4; _suitCount++)
 			{
-				// Check the 1s digit of the binary representation of the poker hand. If it's a 1, that's a unique suit
-				if ((_binaryRepresentation_Suit & 1) == 1)
+				// Check the 1s digit of the binary representation of the poker hand's suits. If it's a 1, that's a unique suit
+				if ((_SuitsBinary & 1) == 1)
 				{
 					_uniqueSuitCount++;
 				}

-				_binaryRepresentation_Suit = _binaryRepresentation_Suit >> 1;
+				_SuitsBinary = _SuitsBinary >> 1;
 			}

-			return (_uniqueSuitCount == 1);
+			return _uniqueSuitCount;
+		}
+
+		private static bool isFlush(List<Card> cards)
+		{
+			return (getUniqueSuitCount(cards) == 1);
 		}

 		private static bool isStraight(List<Card> cards)


Fixed faulty indent levels when inspector is not displayed #380

--- Assets/Fungus/Flowchart/Editor/BlockEditor.cs
+++ Assets/Fungus/Flowchart/Editor/BlockEditor.cs
@@ -335,8 +335,9 @@
 				// Add event handlers with no category first
 				foreach (System.Type type in eventHandlerTypes)
 				{
-					EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type);
-					if (info.Category.Length == 0)
+					EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type);
+					if (info != null &&
+						info.Category.Length == 0)
 					{
 						SetEventHandlerOperation operation = new SetEventHandlerOperation();
 						operation.block = block;
@@ -350,7 +351,8 @@
 				foreach (System.Type type in eventHandlerTypes)
 				{
 					EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type);
-					if (info.Category.Length > 0)
+					if (info != null &&
+						info.Category.Length > 0)
 					{
 						SetEventHandlerOperation operation = new SetEventHandlerOperation();
 						operation.block = block;
@@ -558,7 +560,8 @@
 			foreach (System.Type type in eventHandlerTypes)
 			{
 				EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type);
-				if (info.Category != "" &&
+				if (info != null &&
+					info.Category != "" &&
 				    !eventHandlerCategories.Contains(info.Category))
 				{
 					eventHandlerCategories.Add(info.Category);
@@ -575,7 +578,8 @@
 				{
 					EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(type);

-					if (info.Category == category ||
+					if (info != null &&
+						info.Category == category ||
 					    info.Category == "" && category == "Core")
 					{
 						markdown += "## " + info.EventHandlerName + "\n";


implemented some more dialogue options

implemented some more dialogue options

--- Assets/Script/Dialogue/FathersOfficeDialog.cs
+++ Assets/Script/Dialogue/FathersOfficeDialog.cs
@@ -145,7 +145,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcChatSonPresident);
-		Player.Say ("My son is the president of the best country in the world, Bavaria ... I mean Germany. " +
+		Npc.Say ("My son is the president of the best country in the world, Bavaria ... I mean Germany. " +
 			"I'm so proud of Hans");

 		yield return End ();
@@ -159,7 +159,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcChatSonPresident);
-		Player.Say ("I like working so close to my son the Bundeskanzler of Deutschland, but I have no time anymore " +
+		Npc.Say ("I like working so close to my son the Bundeskanzler of Deutschland, but I have no time anymore " +
 			"to care about my beautiful beard.");

 		yield return End ();
@@ -173,7 +173,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcChatNameday);
-		Player.Say ("I have been celebrating the nameday of Hans' second name. \" Hans Blitzkrieg Müller, Buneskanzler " +
+		Npc.Say ("I have been celebrating the nameday of Hans' second name. \" Hans Blitzkrieg Müller, Buneskanzler " +
 			"of Germany\" has a nice ring to it, doesn't it?");

 		yield return End ();
@@ -200,7 +200,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcChatShooting);
-		Player.Say ("Shooting ... obviously. I got into it, because of the shiny Bavarian uniforms, " +
+		Npc.Say ("Shooting ... obviously. I got into it, because of the shiny Bavarian uniforms, " +
 		            "just like the one I'm wearing");

 		yield return End ();
@@ -263,7 +263,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcIntimidateKruschperl);
-		Player.Say ("You little Krüschperl will not be able to pass me.");
+		Npc.Say ("You little Krüschperl will not be able to pass me.");

 		yield return End ();
 	}
@@ -276,7 +276,7 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcIntimidateDontDrink);
-		Player.Say ("I don't drink on duty. You won't fool me!");
+		Npc.Say ("I don't drink on duty. You won't fool me!");

 		yield return End ();
 	}
@@ -293,9 +293,62 @@
 		yield return WaitForInput ();

 		PlaySound (this.NpcGreetingThatWouldBe);
-		Player.Say ("Oh, and that would be ... ?");
+		Npc.Say ("Oh, and that would be ... ?");

 		Npc.Happens (HappeningKeys.Greeting);
+
+		yield return End ();
+	}
+
+	private IEnumerator SmartLuxRules()
+	{
+		PlaySound (this.PlayerSmartLuxembourgRules);
+		Player.Say ("As soon as Luxembourg rules the world, all of Germany will be made Bavarian, that's the " +
+			"only thing the people know about Germany, anyway.");
+
+		yield return WaitForInput ();
+
+		PlaySound (this.NpcSmartBavarianShit);
+		Npc.Say ("Dreamy Bavarian Shit!");
+
+		yield return End ();
+	}
+
+	private IEnumerator SmartRuleLAndG()
+	{
+		PlaySound (this.PlayerSmartRuleLAndG);
+		Player.Say ("I could help your son rule Luxembourg and Germany.");
+
+		yield return WaitForInput ();
+
+		PlaySound (this.NpcSmartMorePower);
+		Npc.Say ("Ooooh the more power the better.");
+
+		yield return End ();
+	}
+
+	private IEnumerator SmartTrachten()
+	{
+		PlaySound (this.PlayerSmartTrachten);
+		Player.Say ("Luxembourg has a lot of beautiful Trachten-outfits.");
+
+		yield return WaitForInput ();
+
+		PlaySound (this.NpcSmartTrachtenmaking);
+		Npc.Say ("Nothing can beat the traditional bavarian art of Trachtenmaking!");
+
+		yield return End ();
+	}
+
+	private IEnumerator SmartWomen()
+	{
+		PlaySound (this.PlayerSmartWomen);
+		Player.Say("Luxembourg has some of the most beautiful women in the world.");
+
+		yield return WaitForInput ();
+
+		PlaySound (this.NpcSmartElfriede);
+		Npc.Say ("No, thanks. My beloved Elfriede is the only one for me!");

 		yield return End ();
 	}


Update

Update

--- AutoRest/Modelers/Swagger/OperationBuilder.cs
+++ AutoRest/Modelers/Swagger/OperationBuilder.cs
@@ -25,6 +25,7 @@
         private IList<string> _effectiveProduces;
         private SwaggerModeler _swaggerModeler;
         private Operation _operation;
+        private const string APP_JSON_MIME = "application/json";

         public OperationBuilder(Operation operation, SwaggerModeler swaggerModeler)
         {
@@ -53,8 +54,8 @@
                 Name = methodName
             };

-            method.ContentType = "application/json";
-            string produce = _effectiveProduces.FirstOrDefault(s => s.StartsWith("application/json", StringComparison.OrdinalIgnoreCase));
+            method.ContentType = APP_JSON_MIME;
+            string produce = _effectiveProduces.FirstOrDefault(s => s.StartsWith(APP_JSON_MIME, StringComparison.OrdinalIgnoreCase));
             if (!string.IsNullOrEmpty(produce))
             {
                 method.ContentType = produce;
@@ -346,7 +347,7 @@
         private bool SwaggerOperationProducesJson()
         {
             return _effectiveProduces != null &&
-                   _effectiveProduces.Any(s => s.StartsWith("application/json", StringComparison.OrdinalIgnoreCase));
+                   _effectiveProduces.Any(s => s.StartsWith(APP_JSON_MIME, StringComparison.OrdinalIgnoreCase));
         }

         private bool SwaggerOperationProducesNotEmpty()


added else if instead of just if, and added startsWith using ignoreCase = true.

--- src/main/dot-net/Stumps.Engine/Proxy/ProxyHost.cs
+++ src/main/dot-net/Stumps.Engine/Proxy/ProxyHost.cs
@@ -3,6 +3,7 @@
     using System;
     using System.Collections.Generic;
     using System.Collections.Concurrent;
+    using System.Globalization;
     using System.Net;
     using Stumps.Logging;
     using Stumps.Data;
@@ -18,6 +19,7 @@
         // Define the length of http:// and https:// to use for checking and extracting proper domain
         private const int HTTP_CHAR_LENGTH = 7;
         private const int HTTPS_CHAR_LENGTH = 8;
+        private CultureInfo cultureInfo;

         public ProxyHost(ILogger logger, IDataAccess dataAccess) {

@@ -45,13 +47,14 @@
             if ( port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort ) {
                 throw new ArgumentOutOfRangeException("port");
             }
-
+
             // If the user mistakenly puts in http:// or https://, grab just the domain.  If it's https://, then the UseSsl value will be automatically set to true.
-            if (externalHostName.StartsWith("http://")){
+            if (externalHostName.StartsWith("http://", true, cultureInfo))
+            {
                 externalHostName = externalHostName.Substring(HTTP_CHAR_LENGTH);
             }

-            if (externalHostName.StartsWith("https://")){
+            else if (externalHostName.StartsWith("https://",true, cultureInfo)){
                 externalHostName = externalHostName.Substring(HTTPS_CHAR_LENGTH);
                 useSsl = true;
             }


fix defines so they come from the spreadsheet

--- CardMaker/Card/Import/ExcelReferenceReader.cs
+++ CardMaker/Card/Import/ExcelReferenceReader.cs
@@ -121,6 +121,10 @@
                     {
                         rowData.Add(cell.Value2.ToString());
                     }
+                    else
+                    {
+                        rowData.Add("");
+                    }
                 }
                 listExcelData.Add(rowData);
             }
@@ -154,23 +158,14 @@
                 return;
             }

-            GetData(GetDefinesReference(), listDefineData, true);
+            ExcelSpreadsheetReference zExcelSpreadSheetReference = ExcelSpreadsheetReference.parse(zReference.RelativePath);
+            zExcelSpreadSheetReference.SheetName = DEFAULT_DEFINES_SHEET_NAME;
+            GetData(zExcelSpreadSheetReference, listDefineData, true);
         }

         public void GetReferenceData(ProjectLayoutReference zReference, List<List<string>> listReferenceData)
         {
             GetData(ExcelSpreadsheetReference.parse(ReferencePath), listReferenceData, false);
         }
-
-        private static ExcelSpreadsheetReference GetDefinesReference()
-        {
-            var zExcelSpreadSheetReference = ExcelSpreadsheetReference.parseSpreadsheetOnlyReference(
-                (string.IsNullOrEmpty(ProjectManager.Instance.LoadedProject.overrideDefineReferenceName)
-                    ? Path.GetFileNameWithoutExtension(ProjectManager.Instance.ProjectFilePath)
-                    : ProjectManager.Instance.LoadedProject.overrideDefineReferenceName)
-            );
-            zExcelSpreadSheetReference.SheetName = DEFAULT_DEFINES_SHEET_NAME;
-            return zExcelSpreadSheetReference;
-        }
     }
 }


debugger provider update

debugger provider update

--- CatLib.VS/CatLib/Debugger/DebuggerProvider.cs
+++ CatLib.VS/CatLib/Debugger/DebuggerProvider.cs
@@ -28,13 +28,31 @@
     public sealed class DebuggerProvider : IServiceProvider
     {
         /// <summary>
+        /// 日志句柄
+        /// </summary>
+        public IDictionary<string , Type> LogHandlers { get; set; }
+
+        /// <summary>
+        /// 首页的日志显示
+        /// </summary>
+        public IList<string> IndexMonitor { get; set; }
+
+        /// <summary>
         /// 初始化
         /// </summary>
         [Priority(5)]
         public void Init()
         {
+            InitWebConsole();
+        }
+
+        /// <summary>
+        /// 初始化Web控制台
+        /// </summary>
+        private void InitWebConsole()
+        {
             var config = App.Make<IConfigManager>();
-            if (config == null || config.Default.Get("debugger.webconsole.enable", true))
+            if (config == null || config.Default.Get("Debugger.WebConsole.Enable", true))
             {
                 App.On(ApplicationEvents.OnStartCompleted, (payload) =>
                 {
@@ -63,9 +81,9 @@
         /// <returns>句柄</returns>
         private IDictionary<string, Type> GetLogHandlers()
         {
-            return new Dictionary<string, Type>
+            return new Dictionary<string, Type>(LogHandlers ?? new Dictionary<string, Type>())
             {
-                { "debugger.logger.handler.console" , typeof(StdOutLogHandler) }
+                { "Debugger.Logger.Handler.Console" , typeof(StdOutLogHandler) }
             };
         }

@@ -104,8 +122,8 @@
                 var port = 9478;
                 if (config != null)
                 {
-                    host = config.Default.Get("debugger.webconsole.host", "*");
-                    port = config.Default.Get("debugger.webconsole.port", 9478);
+                    host = config.Default.Get("Debugger.WebConsole.Host", "*");
+                    port = config.Default.Get("Debugger.WebConsole.Port", 9478);
                 }

                 var httpDebuggerConsole = obj as HttpDebuggerConsole;
@@ -129,12 +147,8 @@
         private void RegisterWebLog()
         {
             App.Singleton<LogStore>();
-
-            App.Instance("Debugger.WebMonitor.Monitor.IndexMonitor", new List<string>
+            App.Instance("Debugger.WebMonitor.Monitor.IndexMonitor", new List<string>(IndexMonitor ?? new List<string>())
             {
-                "Profiler.GetMonoUsedSize@memory",
-                "Profiler.GetTotalAllocatedMemory",
-                "fps"
             });
         }
     }


CodeMaid organise and clean Tally.cs

CodeMaid organise and clean Tally.cs

--- ClosedXML/Excel/CalcEngine/Functions/Tally.cs
+++ ClosedXML/Excel/CalcEngine/Functions/Tally.cs
@@ -1,3 +1,4 @@
+// Keep this file CodeMaid organised and cleaned
 using ClosedXML.Excel.CalcEngine.Exceptions;
 using System;
 using System.Collections;
@@ -69,6 +70,13 @@
             _numericValues = null;
         }

+        public double Average()
+        {
+            var nums = NumericValuesInternal();
+            if (nums.Length == 0) throw new ApplicationException("No values");
+            return nums.Average();
+        }
+
         public double Count()
         {
             return Count(NumbersOnly);
@@ -82,63 +90,45 @@
                 return _list.Count(o => !CalcEngineHelpers.ValueIsBlank(o));
         }

-        private IEnumerable<double> NumericValuesEnumerable()
-        {
-            foreach (var value in _list)
-            {
-                if (value is string || !(value is IEnumerable vEnumerable))
-                {
-                    if (TryParseToDouble(value, aggressiveConversion: false, out double tmp))
-                        yield return tmp;
-                }
-                else
-                {
-                    foreach (var v in vEnumerable)
-                    {
-                        if (TryParseToDouble(v, aggressiveConversion: false, out double tmp))
-                            yield return tmp;
-                    }
-                }
-            }
-        }
-
-        // If aggressiveConversion == true, then try to parse non-numeric types to double too
-        private bool TryParseToDouble(object value, bool aggressiveConversion, out double d)
-        {
-            d = 0;
-            if (value.IsNumber())
-            {
-                d = Convert.ToDouble(value);
-                return true;
-            }
-            else if (value is Boolean b)
-            {
-                if (!aggressiveConversion) return false;
-
-                d = (b ? 1 : 0);
-                return true;
-            }
-            else if (value is DateTime dt)
-            {
-                d = dt.ToOADate();
-                return true;
-            }
-            else if (value is TimeSpan ts)
-            {
-                d = ts.TotalDays;
-                return true;
-            }
-            else if (value is string s)
-            {
-                if (!aggressiveConversion) return false;
-                return double.TryParse(s, out d);
-            }
-
-            return false;
-        }
-
-        private double[] NumericValuesInternal()
-            => LazyInitializer.EnsureInitialized(ref _numericValues, () => NumericValuesEnumerable().ToArray());
+        public double DevSq()
+        {
+            var nums = NumericValuesInternal();
+            if (nums.Length == 0) throw new CellValueException("No numeric parameters.");
+
+            return nums.Sum(x => Math.Pow(x - Average(), 2));
+        }
+
+        public double Geomean()
+        {
+            var nums = NumericValuesInternal();
+
+            if (nums.Length == 0) throw new NumberException("No numeric parameters.");
+            if (HasNonPositiveNumbers()) throw new NumberException("Incorrect parameters. Use only positive numbers in your data.");
+
+            return Math.Pow(Product(), 1.0 / nums.Length);
+        }
+
+        public IEnumerator<object> GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
+
+        public double Max()
+        {
+            var nums = NumericValuesInternal();
+            return nums.Length == 0 ? 0 : nums.Max();
+        }
+
+        public double Min()
+        {
+            var nums = NumericValuesInternal();
+            return nums.Length == 0 ? 0 : nums.Min();
+        }

         public IEnumerable<double> NumericValues()
             => NumericValuesInternal().AsEnumerable();
@@ -151,84 +141,7 @@
                 : nums.Aggregate(1d, (a, b) => a * b);
         }

-        public double Sum() => NumericValuesInternal().Sum();
-
-        public double Average()
-        {
-            var nums = NumericValuesInternal();
-            if (nums.Length == 0) throw new ApplicationException("No values");
-            return nums.Average();
-        }
-
-        public double Min()
-        {
-            var nums = NumericValuesInternal();
-            return nums.Length == 0 ? 0 : nums.Min();
-        }
-
-        public double DevSq()
-        {
-            var nums = NumericValuesInternal();
-            if (nums.Length == 0) throw new CellValueException("No numeric parameters.");
-
-            return nums.Sum(x => Math.Pow(x - Average(), 2));
-        }
-
-        public double Geomean()
-        {
-            var nums = NumericValuesInternal();
-
-            if (nums.Length == 0) throw new NumberException("No numeric parameters.");
-            if (HasNonPositiveNumbers()) throw new NumberException("Incorrect parameters. Use only positive numbers in your data.");
-
-            return Math.Pow(Product(), 1.0 / nums.Length);
-        }
-
-        private bool HasNonPositiveNumbers()
-        {
-            var nums = NumericValuesInternal();
-            return nums.Any(x => x <= 0);
-        }
-
-        public double Max()
-        {
-            var nums = NumericValuesInternal();
-            return nums.Length == 0 ? 0 : nums.Max();
-        }
-
         public double Range() => Max() - Min();
-
-        private static double Sum2(IEnumerable<double> nums)
-        {
-            return nums.Sum(d => d * d);
-        }
-
-        public double VarP()
-        {
-            var nums = NumericValuesInternal();
-            var avg = nums.Average();
-            var sum2 = Sum2(nums);
-            var count = nums.Length;
-            return count <= 1 ? 0 : sum2 / count - avg * avg;
-        }
-
-        public double StdP()
-        {
-            var nums = NumericValuesInternal();
-            var avg = nums.Average();
-            var sum2 = nums.Sum(d => d * d);
-            var count = nums.Length;
-            return count <= 1 ? 0 : Math.Sqrt(sum2 / count - avg * avg);
-        }
-
-        public double Var()
-        {
-            var nums = NumericValuesInternal();
-            var avg = nums.Average();
-            var sum2 = Sum2(nums);
-            var count = nums.Length;
-            return count <= 1 ? 0 : (sum2 / count - avg * avg) * count / (count - 1);
-        }

         public double Std()
         {
@@ -251,14 +164,102 @@
             return ret;
         }

-        public IEnumerator<object> GetEnumerator()
-        {
-            return _list.GetEnumerator();
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
+        public double StdP()
+        {
+            var nums = NumericValuesInternal();
+            var avg = nums.Average();
+            var sum2 = nums.Sum(d => d * d);
+            var count = nums.Length;
+            return count <= 1 ? 0 : Math.Sqrt(sum2 / count - avg * avg);
+        }
+
+        public double Sum() => NumericValuesInternal().Sum();
+
+        public double Var()
+        {
+            var nums = NumericValuesInternal();
+            var avg = nums.Average();
+            var sum2 = Sum2(nums);
+            var count = nums.Length;
+            return count <= 1 ? 0 : (sum2 / count - avg * avg) * count / (count - 1);
+        }
+
+        public double VarP()
+        {
+            var nums = NumericValuesInternal();
+            var avg = nums.Average();
+            var sum2 = Sum2(nums);
+            var count = nums.Length;
+            return count <= 1 ? 0 : sum2 / count - avg * avg;
+        }
+
+        private static double Sum2(IEnumerable<double> nums)
+        {
+            return nums.Sum(d => d * d);
+        }
+
+        private bool HasNonPositiveNumbers()
+        {
+            var nums = NumericValuesInternal();
+            return nums.Any(x => x <= 0);
+        }
+
+        private IEnumerable<double> NumericValuesEnumerable()
+        {
+            foreach (var value in _list)
+            {
+                if (value is string || !(value is IEnumerable vEnumerable))
+                {
+                    if (TryParseToDouble(value, aggressiveConversion: false, out double tmp))
+                        yield return tmp;
+                }
+                else
+                {
+                    foreach (var v in vEnumerable)
+                    {
+                        if (TryParseToDouble(v, aggressiveConversion: false, out double tmp))
+                            yield return tmp;
+                    }
+                }
+            }
+        }
+
+        private double[] NumericValuesInternal()
+                    => LazyInitializer.EnsureInitialized(ref _numericValues, () => NumericValuesEnumerable().ToArray());
+
+        // If aggressiveConversion == true, then try to parse non-numeric types to double too
+        private bool TryParseToDouble(object value, bool aggressiveConversion, out double d)
+        {
+            d = 0;
+            if (value.IsNumber())
+            {
+                d = Convert.ToDouble(value);
+                return true;
+            }
+            else if (value is Boolean b)
+            {
+                if (!aggressiveConversion) return false;
+
+                d = (b ? 1 : 0);
+                return true;
+            }
+            else if (value is DateTime dt)
+            {
+                d = dt.ToOADate();
+                return true;
+            }
+            else if (value is TimeSpan ts)
+            {
+                d = ts.TotalDays;
+                return true;
+            }
+            else if (value is string s)
+            {
+                if (!aggressiveConversion) return false;
+                return double.TryParse(s, out d);
+            }
+
+            return false;
         }
     }
 }


Fix space ambience issues (#8990)

Fix space ambience issues (#8990)

- Won't immediately stop ambience on grid traversal
- No longer plays on station

--- Content.Client/Audio/BackgroundAudioSystem.cs
+++ Content.Client/Audio/BackgroundAudioSystem.cs
@@ -18,6 +18,7 @@
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using Robust.Shared.Timing;
 using Timer = Robust.Shared.Timing.Timer;

 namespace Content.Client.Audio
@@ -25,15 +26,15 @@
     [UsedImplicitly]
     public sealed class BackgroundAudioSystem : EntitySystem
     {
+        [Dependency] private readonly IBaseClient _client = default!;
+        [Dependency] private readonly IConfigurationManager _configManager = default!;
+        [Dependency] private readonly IGameTiming _timing = default!;
+        [Dependency] private readonly IMapManager _mapManager = default!;
+        [Dependency] private readonly IPlayerManager _playMan = default!;
         [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
         [Dependency] private readonly IRobustRandom _robustRandom = default!;
-        [Dependency] private readonly IConfigurationManager _configManager = default!;
         [Dependency] private readonly IStateManager _stateManager = default!;
-        [Dependency] private readonly IBaseClient _client = default!;
         [Dependency] private readonly ClientGameTicker _gameTicker = default!;
-        [Dependency] private readonly IMapManager _mapManager = default!;
-        [Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
-        [Dependency] private readonly IPlayerManager _playMan = default!;

         private readonly AudioParams _ambientParams = new(-10f, 1, "Master", 0, 0, 0, true, 0f);
         private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
@@ -41,6 +42,14 @@
         private IPlayingAudioStream? _ambientStream;
         private IPlayingAudioStream? _lobbyStream;

+        /// <summary>
+        /// What is currently playing.
+        /// </summary>
+        private SoundCollectionPrototype? _playingCollection;
+
+        /// <summary>
+        /// What the ambience has been set to.
+        /// </summary>
         private SoundCollectionPrototype _currentCollection = default!;
         private CancellationTokenSource _timerCancelTokenSource = new();

@@ -87,32 +96,36 @@

         private void EntParentChanged(ref EntParentChangedMessage message)
         {
-            if(_playMan.LocalPlayer is null || _playMan.LocalPlayer.ControlledEntity != message.Entity) return;
-            if (!TryComp<TransformComponent>(message.Entity, out var xform) ||
-                !_mapManager.TryGetGrid(xform.GridUid, out var grid)) return;
-
-            var tileDef = (ContentTileDefinition) _tileDefMan[grid.GetTileRef(xform.Coordinates).Tile.TypeId];
-
-            if(_currentCollection.ID == _spaceAmbience.ID)
-            {
-                if (!tileDef.Sturdy) return;
+            if(_playMan.LocalPlayer is null || _playMan.LocalPlayer.ControlledEntity != message.Entity ||
+               !_timing.IsFirstTimePredicted) return;
+
+            if (!TryComp<TransformComponent>(message.Entity, out var xform)) return;
+
+            // Check if we traversed to grid.
+            if (_mapManager.TryGetGrid(xform.GridUid, out var grid))
+            {
+                if (_currentCollection == _stationAmbience) return;
                 ChangeAmbience(_stationAmbience);
-
-            }
-            else // currently station
-            {
-                if (tileDef.Sturdy) return;
+            }
+            else
+            {
                 ChangeAmbience(_spaceAmbience);
             }
         }

         private void ChangeAmbience(SoundCollectionPrototype newAmbience)
         {
-            EndAmbience();
+            if (_currentCollection == newAmbience) return;
+            _timerCancelTokenSource.Cancel();
             _currentCollection = newAmbience;
-            _timerCancelTokenSource.Cancel();
             _timerCancelTokenSource = new();
-            Timer.Spawn(1500, StartAmbience, _timerCancelTokenSource.Token);
+            Timer.Spawn(1500, () =>
+            {
+                // If we traverse a few times then don't interrupt an existing song.
+                if (_playingCollection == _currentCollection) return;
+                EndAmbience();
+                StartAmbience();
+            }, _timerCancelTokenSource.Token);
         }

         private void StateManagerOnStateChanged(StateChangedEventArgs args)
@@ -168,12 +181,14 @@
         {
             EndAmbience();
             if (!CanPlayCollection(_currentCollection)) return;
+            _playingCollection = _currentCollection;
             var file = _robustRandom.Pick(_currentCollection.PickFiles).ToString();
             _ambientStream = SoundSystem.Play(file, Filter.Local(), _ambientParams.WithVolume(_ambientParams.Volume + _configManager.GetCVar(CCVars.AmbienceVolume)));
         }

         private void EndAmbience()
         {
+            _playingCollection = null;
             _ambientStream?.Stop();
             _ambientStream = null;
         }


More run overloads

More run overloads

--- Core/System/Threading/Tasks/Task.run.net35.cs
+++ Core/System/Threading/Tasks/Task.run.net35.cs
@@ -21,6 +21,25 @@
             return result;
         }

+        public static Task Run(Func<Task> action)
+        {
+            // TODO: change to continue with and promise task?
+            var result = new Task(() => action().Wait(), CancellationToken.None, TaskCreationOptions.DenyChildAttach);
+            result.Start();
+            return result;
+        }
+
+        public static Task Run(Func<Task> action, CancellationToken cancellationToken)
+        {
+            // TODO: change to continue with and promise task?
+            var result = new Task(() => action().Wait(), cancellationToken, TaskCreationOptions.DenyChildAttach);
+            if (!cancellationToken.IsCancellationRequested)
+            {
+                result.InternalStart(result.Scheduler);
+            }
+            return result;
+        }
+
         public static Task<TResult> Run<TResult>(Func<TResult> function)
         {
             var result = new Task<TResult>(function, CancellationToken.None, TaskCreationOptions.DenyChildAttach);
@@ -37,6 +56,25 @@
             }
             return result;
         }
+
+        public static Task<TResult> Run<TResult>(Func<Task<TResult>> function)
+        {
+            // TODO: change to continue with and promise task?
+            var result = new Task<TResult>(() => function().Result, CancellationToken.None, TaskCreationOptions.DenyChildAttach);
+            result.Start();
+            return result;
+        }
+
+        public static Task<TResult> Run<TResult>(Func<Task<TResult>> function, CancellationToken cancellationToken)
+        {
+            // TODO: change to continue with and promise task?
+            var result = new Task<TResult>(() => function().Result, cancellationToken, TaskCreationOptions.DenyChildAttach);
+            if (!cancellationToken.IsCancellationRequested)
+            {
+                result.InternalStart(result.Scheduler);
+            }
+            return result;
+        }
     }
 }


Added bullets before translation.

Added bullets before translation.

--- CramTool/CramTool/Views/WordViewPanel.xaml.cs
+++ CramTool/CramTool/Views/WordViewPanel.xaml.cs
@@ -71,6 +71,10 @@
             foreach (Token token in tokens)
             {
                 string text = token.Value;
+                if (token.Type == TokenType.Translation)
+                {
+                    text = "\u2022 " + text;
+                }
                 if (token.Type == TokenType.Example)
                 {
                     text = "Example: " + text;


Update texture display before updating visual range. Refs #388

* This was broken in 0f4d43cd37d which changed from specifying texture
  settings directly, to using them from the output's settings.

--- renderdocui/Windows/TextureViewer.cs
+++ renderdocui/Windows/TextureViewer.cs
@@ -3184,6 +3184,7 @@
                 return;
             }

+            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
             m_Core.Renderer.BeginInvoke(RT_UpdateVisualRange);

             if (m_Output != null && m_PickedPoint.X >= 0 && m_PickedPoint.Y >= 0)
@@ -3194,8 +3195,6 @@
                         RT_PickPixelsAndUpdate(m_PickedPoint.X, m_PickedPoint.Y, true);
                 });
             }
-
-            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
         }

         private void overlay_SelectedIndexChanged(object sender, EventArgs e)
@@ -3215,6 +3214,7 @@
             if (CurrentTexture.depth > 1)
                 m_TexDisplay.sliceFace = (UInt32)(sliceFace.SelectedIndex << (int)m_TexDisplay.mip);

+            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
             m_Core.Renderer.BeginInvoke(RT_UpdateVisualRange);

             if (m_Output != null && m_PickedPoint.X >= 0 && m_PickedPoint.Y >= 0)
@@ -3226,7 +3226,6 @@
                 });
             }

-            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
         }

         private void updateChannelsHandler(object sender, EventArgs e)


Changed the specflow tag to be a generic one

--- CodeBySpecification/CodeBySpecification/Core/FeatureBase.cs
+++ CodeBySpecification/CodeBySpecification/Core/FeatureBase.cs
@@ -12,7 +12,7 @@

 		#region Core Step Definition Vocabulary

-		[BeforeFeature("SeleniumTest")]
+		[BeforeFeature("UIAutomationTest")]
 		public static void BeforeSeleniumTestFeature()
 		{
 			var browserName = ConfigurationManager.AppSettings["UI.Tests.Target.Browser"];
@@ -21,7 +21,7 @@
 			UiFeatureTestsHelper.InitilizeTests(browserName, objectDefSource);
 		}

-		[AfterFeature("SeleniumTest")]
+		[AfterFeature("UIAutomationTest")]
 		public static void AfterSeleniumTestFeature()
 		{
 			//Browser.Quit();


Added unit tests for the enumeration converter.

--- test/ValueConverterTests.cs
+++ test/ValueConverterTests.cs
@@ -56,6 +56,41 @@

             Assert.Throws<InvalidOperationException>(() => booleanConverter.Convert(typeof(object), "0.0"));
             Assert.Throws<InvalidOperationException>(() => booleanConverter.Convert(typeof(object), "XYZ"));
+        }
+
+        /// <summary>
+        /// Represents an enumeration used for testing the enumeration converter.
+        /// </summary>
+        private enum Animal { Cat, Dog, Bird }
+
+        /// <summary>
+        /// Tests the value converter that can convert string to enumeration values.
+        /// </summary>
+        [Fact]
+        public void TestEnumerationConverter()
+        {
+            EnumerationConverter enumerationConverter = new EnumerationConverter();
+
+            Assert.True(enumerationConverter.CanConvertTo(typeof(DayOfWeek)));
+            Assert.True(enumerationConverter.CanConvertTo(typeof(Animal)));
+            Assert.True(enumerationConverter.CanConvertTo(typeof(PlatformID)));
+
+            Assert.False(enumerationConverter.CanConvertTo(typeof(string)));
+            Assert.False(enumerationConverter.CanConvertTo(typeof(int)));
+            Assert.False(enumerationConverter.CanConvertTo(typeof(bool)));
+            Assert.False(enumerationConverter.CanConvertTo(typeof(float)));
+            Assert.False(enumerationConverter.CanConvertTo(typeof(Enum)));
+
+            Assert.False(enumerationConverter.CanConvertFrom("abc"));
+            Assert.False(enumerationConverter.CanConvertFrom("123"));
+            Assert.False(enumerationConverter.CanConvertFrom(""));
+
+            Assert.Equal(Animal.Cat, enumerationConverter.Convert(typeof(Animal), "Cat"));
+            Assert.Equal(Animal.Dog, enumerationConverter.Convert(typeof(Animal), "Dog"));
+            Assert.Equal(Animal.Bird, enumerationConverter.Convert(typeof(Animal), "Bird"));
+
+            Assert.Throws<InvalidOperationException>(() => enumerationConverter.Convert(typeof(object), "Dog"));
+            Assert.Throws<InvalidOperationException>(() => enumerationConverter.Convert(typeof(Animal), "Fish"));
         }

         /// <summary>


Bug fixed: 編集画面で履歴を選択した後に新規作成メニューが表示される問題を解消。

--- Implem.Pleasanter/Libraries/HtmlParts/HtmlNavigationMenu.cs
+++ Implem.Pleasanter/Libraries/HtmlParts/HtmlNavigationMenu.cs
@@ -52,7 +52,7 @@
                                     action: () => hb
                                         .Span(css: "ui-icon ui-icon-plus")
                                         .Displays_New())),
-                        _using: !Routes.Action("new", "create", "edit"))
+                        _using: !Routes.Action("new", "create", "edit", "history"))
                     .Li(
                         css: "sub-menu",
                         action: () => hb


removed unused logic

removed unused logic

--- Kentico.Kontent.Delivery/Urls/DeliveryEndpointUrlBuilder.cs
+++ Kentico.Kontent.Delivery/Urls/DeliveryEndpointUrlBuilder.cs
@@ -26,20 +26,9 @@
             _deliveryOptions = deliveryOptions;
         }

-        public string GetItemUrl(string codename, string[] parameters)
-        {
-            return GetUrl(string.Format(UrlTemplateItem, Uri.EscapeDataString(codename)), parameters);
-        }
-
         public string GetItemUrl(string codename, IEnumerable<IQueryParameter> parameters)
         {
             return GetUrl(string.Format(UrlTemplateItem, Uri.EscapeDataString(codename)), parameters);
-        }
-
-        public string GetItemsUrl(string[] parameters)
-        {
-            var enrichedParameters = EnrichParameters(parameters);
-            return GetUrl(UrlTemplateItems, enrichedParameters);
         }

         public string GetItemsUrl(IEnumerable<IQueryParameter> parameters)
@@ -48,29 +37,14 @@
             return GetUrl(UrlTemplateItems, updatedParameters);
         }

-        public string GetItemsFeedUrl(string[] parameters)
-        {
-            return GetUrl(UrlTemplateItemsFeed, parameters);
-        }
-
         public string GetItemsFeedUrl(IEnumerable<IQueryParameter> parameters)
         {
             return GetUrl(UrlTemplateItemsFeed, parameters);
         }

-        public string GetTypeUrl(string codename)
-        {
-            return GetUrl(string.Format(UrlTemplateType, Uri.EscapeDataString(codename)));
-        }
-
-        public string GetTypeUrl(string codename, IEnumerable<IQueryParameter> parameters)
+        public string GetTypeUrl(string codename, IEnumerable<IQueryParameter> parameters = null)
         {
             return GetUrl(string.Format(UrlTemplateType, Uri.EscapeDataString(codename)), parameters);
-        }
-
-        public string GetTypesUrl(string[] parameters)
-        {
-            return GetUrl(UrlTemplateTypes, parameters);
         }

         public string GetTypesUrl(IEnumerable<IQueryParameter> parameters)
@@ -86,11 +60,6 @@
         public string GetTaxonomyUrl(string codename)
         {
             return GetUrl(string.Format(UrlTemplateTaxonomy, Uri.EscapeDataString(codename)));
-        }
-
-        public string GetTaxonomiesUrl(string[] parameters)
-        {
-            return GetUrl(UrlTemplateTaxonomies, parameters);
         }

         public string GetTaxonomiesUrl(IEnumerable<IQueryParameter> parameters)
@@ -147,17 +116,6 @@
             return hostUrl;
         }

-        private IEnumerable<string> EnrichParameters(IEnumerable<string> parameters)
-        {
-            var parameterList = parameters?.ToList() ?? new List<string>();
-            if (_deliveryOptions.CurrentValue.IncludeTotalCount && !parameterList.Contains(new IncludeTotalCountParameter().GetQueryStringParameter()))
-            {
-                parameterList.Add(new IncludeTotalCountParameter().GetQueryStringParameter());
-            }
-
-            return parameterList;
-        }
-
         private IEnumerable<IQueryParameter> EnrichParameters(IEnumerable<IQueryParameter> parameters)
         {
             var parameterList = parameters?.ToList() ?? new List<IQueryParameter>();


make sure that only one bug can be reported per iteration

--- Libraries/TestingServices/Scheduling/BugFindingScheduler.cs
+++ Libraries/TestingServices/Scheduling/BugFindingScheduler.cs
@@ -179,7 +179,7 @@
                     {
                         return;
                     }
-
+
                     while (!machineInfo.IsActive)
                     {
                         IO.Debug($"<ScheduleDebug> Sleep task {machineInfo.Id} of machine " +
@@ -238,7 +238,7 @@
             {
                 this.Runtime.ProgramTrace.AddFairNondeterministicChoice(uniqueId, choice);
             }
-
+
             if (this.Runtime.Configuration.CacheProgramState &&
                 this.Runtime.Configuration.SafetyPrefixBound <= this.ExploredSteps)
             {
@@ -361,7 +361,7 @@
             {
                 return;
             }
-
+
             var machineInfo = this.TaskMap[(int)id];

             IO.Debug($"<ScheduleDebug> Completed task {machineInfo.Id} of machine " +
@@ -410,23 +410,26 @@
         /// <param name="killTasks">Kill tasks</param>
         internal void NotifyAssertionFailure(string text, bool killTasks = true)
         {
-            this.BugReport = text;
-
-            ErrorReporter.Report(text);
-
-            IO.Log("<StrategyLog> Found bug using " +
-                $"'{this.Runtime.Configuration.SchedulingStrategy}' strategy.");
-
-            if (this.Strategy.GetDescription().Length > 0)
-            {
-                IO.Log($"<StrategyLog> {this.Strategy.GetDescription()}");
-            }
-
-            this.BugFound = true;
-
-            if (this.Runtime.Configuration.AttachDebugger)
-            {
-                System.Diagnostics.Debugger.Break();
+            if (!this.BugFound)
+            {
+                this.BugReport = text;
+
+                ErrorReporter.Report(text);
+
+                IO.Log("<StrategyLog> Found bug using " +
+                    $"'{this.Runtime.Configuration.SchedulingStrategy}' strategy.");
+
+                if (this.Strategy.GetDescription().Length > 0)
+                {
+                    IO.Log($"<StrategyLog> {this.Strategy.GetDescription()}");
+                }
+
+                this.BugFound = true;
+
+                if (this.Runtime.Configuration.AttachDebugger)
+                {
+                    System.Diagnostics.Debugger.Break();
+                }
             }

             if (killTasks)


Properly fix immortality on system on/off

--- LmpClient/Systems/VesselImmortalSys/VesselImmortalSystem.cs
+++ LmpClient/Systems/VesselImmortalSys/VesselImmortalSystem.cs
@@ -33,6 +33,11 @@
             SpectateEvent.onFinishedSpectating.Add(VesselImmortalEvents.FinishSpectating);
             LockEvent.onLockAcquireUnityThread.Add(VesselImmortalEvents.OnLockAcquire);
             LockEvent.onLockReleaseUnityThread.Add(VesselImmortalEvents.OnLockRelease);
+
+            foreach (var vessel in FlightGlobals.VesselsLoaded)
+            {
+                SetImmortalStateBasedOnLock(vessel);
+            }
         }

         protected override void OnDisabled()
@@ -46,6 +51,11 @@
             SpectateEvent.onFinishedSpectating.Remove(VesselImmortalEvents.FinishSpectating);
             LockEvent.onLockAcquireUnityThread.Remove(VesselImmortalEvents.OnLockAcquire);
             LockEvent.onLockReleaseUnityThread.Remove(VesselImmortalEvents.OnLockRelease);
+
+            foreach (var vessel in FlightGlobals.VesselsLoaded)
+            {
+                vessel.SetImmortal(false);
+            }
         }

         #endregion


fix request logging (GET was logged always)

--- MailRuCloud/MailRuCloudApi/Base/Requests/Web/BaseRequest.cs
+++ MailRuCloud/MailRuCloudApi/Base/Requests/Web/BaseRequest.cs
@@ -51,7 +51,6 @@
         public async Task<T> MakeRequestAsync()
         {
             var httprequest = CreateRequest();
-            Logger.Debug($"HTTP:{httprequest.Method}:{httprequest.RequestUri.AbsoluteUri}");

             var content = CreateHttpContent();
             if (content != null)
@@ -60,6 +59,7 @@
                 var stream = httprequest.GetRequestStream();
                 stream.Write(content, 0, content.Length);
             }
+            Logger.Debug($"HTTP:{httprequest.Method}:{httprequest.RequestUri.AbsoluteUri}");

             using (var response = (HttpWebResponse)await Task.Factory.FromAsync(httprequest.BeginGetResponse, asyncResult => httprequest.EndGetResponse(asyncResult), null))
             {


added integration tests

added integration tests

--- Octokit.Tests.Integration/Clients/DeploymentsClientTests.cs
+++ Octokit.Tests.Integration/Clients/DeploymentsClientTests.cs
@@ -86,12 +86,33 @@
     }

     [IntegrationTest]
+    public async Task CanCreateDeploymentWithRepositoryId()
+    {
+        var newDeployment = new NewDeployment(_commit.Sha) { AutoMerge = false };
+
+        var deployment = await _deploymentsClient.Create(_context.Repository.Id, newDeployment);
+
+        Assert.NotNull(deployment);
+    }
+
+    [IntegrationTest]
     public async Task ReturnsDeployments()
     {
         var newDeployment = new NewDeployment(_commit.Sha) { AutoMerge = false };
         await _deploymentsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newDeployment);

         var deployments = await _deploymentsClient.GetAll(_context.RepositoryOwner, _context.RepositoryName);
+
+        Assert.NotEmpty(deployments);
+    }
+
+    [IntegrationTest]
+    public async Task ReturnsDeploymentsWithRepositoryId()
+    {
+        var newDeployment = new NewDeployment(_commit.Sha) { AutoMerge = false };
+        await _deploymentsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newDeployment);
+
+        var deployments = await _deploymentsClient.GetAll(_context.Repository.Id);

         Assert.NotEmpty(deployments);
     }
@@ -171,6 +192,38 @@
         Assert.NotEqual(firstPage[2].Id, secondPage[2].Id);
     }

+    [IntegrationTest]
+    public async Task ReturnsDistinctResultsBasedOnStartPageWithRepositoryId()
+    {
+        var commits = CreateCommits(6);
+        foreach (var commit in commits)
+        {
+            var newDeployment = new NewDeployment(commit.Sha) { AutoMerge = false };
+            await _deploymentsClient.Create(_context.Repository.Id, newDeployment);
+        }
+
+        var startOptions = new ApiOptions
+        {
+            PageSize = 3,
+            PageCount = 1
+        };
+
+        var firstPage = await _deploymentsClient.GetAll(_context.Repository.Id, startOptions);
+
+        var skipStartOptions = new ApiOptions
+        {
+            PageSize = 3,
+            PageCount = 1,
+            StartPage = 2
+        };
+
+        var secondPage = await _deploymentsClient.GetAll(_context.Repository.Id, skipStartOptions);
+
+        Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
+        Assert.NotEqual(firstPage[1].Id, secondPage[1].Id);
+        Assert.NotEqual(firstPage[2].Id, secondPage[2].Id);
+    }
+
     public void Dispose()
     {
         _context.Dispose();


if a viewer overloads region capability to process RequestMapBlocks, ignore following requests for 300 seconds. This was necessary becaus some viewers like FireStorm are doing it, saturating region and grid services for no usefull reason

--- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1060,27 +1060,80 @@
         /// <param name="maxY"></param>
         public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
         {
-            m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag);
+//            m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag);

             GetAndSendBlocks(remoteClient, minX, minY, maxX, maxY, flag);
         }

+        private const double SPAMBLOCKTIMEms = 300000; // 5 minutes
+        private Dictionary<UUID,double> spamBlocked = new Dictionary<UUID,double>();
+
         protected virtual List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
         {
-            MapBlockRequestData req = new MapBlockRequestData();
-
-            req.client = remoteClient;
-            req.minX = minX;
-            req.maxX = maxX;
-            req.minY = minY;
-            req.maxY = maxY;
-            req.flags = flag;
+            // anti spam because of FireStorm 4.7.7 absurd request repeat rates
+            // possible others
+
+            double now = Util.GetTimeStampMS();
+            UUID agentID = remoteClient.AgentId;

             lock (m_mapBlockRequestEvent)
             {
-                if (!m_mapBlockRequests.ContainsKey(remoteClient.AgentId))
-                    m_mapBlockRequests[remoteClient.AgentId] = new Queue<MapBlockRequestData>();
-                m_mapBlockRequests[remoteClient.AgentId].Enqueue(req);
+                if(spamBlocked.ContainsKey(agentID))
+                {
+                    if(spamBlocked[agentID] < now &&
+                            (!m_mapBlockRequests.ContainsKey(agentID) ||
+                            m_mapBlockRequests[agentID].Count == 0 ))
+                    {
+                        spamBlocked.Remove(agentID);
+                        m_log.DebugFormat("[WoldMapModule] RequestMapBlocks release spammer {0}", agentID);
+                    }
+                    else
+                        return new List<MapBlockData>();
+                }
+                else
+                {
+                // ugly slow expire spammers
+                    if(spamBlocked.Count > 0)
+                    {
+                        UUID k = UUID.Zero;
+                        bool expireone = false;
+                        foreach(UUID k2 in spamBlocked.Keys)
+                        {
+                            if(spamBlocked[k2] < now &&
+                                (!m_mapBlockRequests.ContainsKey(k2) ||
+                                m_mapBlockRequests[k2].Count == 0 ))
+                            {
+                                m_log.DebugFormat("[WoldMapModule] RequestMapBlocks release spammer {0}", k2);
+                                k = k2;
+                                expireone = true;
+                            }
+                        break; // doing one at a time
+                        }
+                    if(expireone)
+                        spamBlocked.Remove(k);
+                    }
+                }
+
+//                m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag);
+
+                MapBlockRequestData req = new MapBlockRequestData();
+
+                req.client = remoteClient;
+                req.minX = minX;
+                req.maxX = maxX;
+                req.minY = minY;
+                req.maxY = maxY;
+                req.flags = flag;
+
+                if (!m_mapBlockRequests.ContainsKey(agentID))
+                    m_mapBlockRequests[agentID] = new Queue<MapBlockRequestData>();
+                if(m_mapBlockRequests[agentID].Count < 150 )
+                    m_mapBlockRequests[agentID].Enqueue(req);
+                else
+                {
+                    spamBlocked[agentID] = now + SPAMBLOCKTIMEms;
+                    m_log.DebugFormat("[WoldMapModule] RequestMapBlocks blocking spammer {0} for {1} s",agentID, SPAMBLOCKTIMEms/1000.0);
+                }
                 m_mapBlockRequestEvent.Set();
             }


add test to check move of task item to user inventory when a target folder is explicitly given

--- OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -95,6 +95,32 @@
         /// </summary>
         /// This should place it in the most suitable user folder.
         [Test]
+        public void TestMoveTaskInventoryItem()
+        {
+            TestHelper.InMethod();
+//            log4net.Config.XmlConfigurator.Configure();
+
+            Scene scene = SceneSetupHelpers.SetupScene("inventory");
+            UserAccount user1 = CreateUser(scene);
+            SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
+            SceneObjectPart sop1 = sog1.RootPart;
+            TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
+            InventoryFolderBase folder
+                = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
+
+            // Perform test
+            scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID);
+
+            InventoryItemBase ncUserItem
+                = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem");
+            Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found");
+        }
+
+        /// <summary>
+        /// Test MoveTaskInventoryItem where the item has no parent folder assigned.
+        /// </summary>
+        /// This should place it in the most suitable user folder.
+        [Test]
         public void TestMoveTaskInventoryItemNoParent()
         {
             TestHelper.InMethod();


Updated CommandLineSettings to use new logging options that didn't exist at the time it was originally written

--- RelhaxModpack/RelhaxModpack/Settings/CommandLineSettings.cs
+++ RelhaxModpack/RelhaxModpack/Settings/CommandLineSettings.cs
@@ -105,7 +105,7 @@
         /// <param name="args">A string array of command line arguments</param>
         public static void ParseCommandLine(string[] args)
         {
-            Logging.Info("command line: " + string.Join(" ", args));
+            Logging.Info(LogOptions.ClassName, "Command line: " + string.Join(" ", args));
             for (int i = 0; i < args.Length; i++)
             {
                 string commandArg = args[i];
@@ -116,56 +116,60 @@
                 {
                     //start with settings for application configurations
                     case "test":
-                        Logging.Info("test, loading in test mode");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in test mode", commandArg);
                         TestMode = true;
                         break;
                     case "skip-update":
-                        Logging.Info("skip-update, skipping updating");
+                        Logging.Info(LogOptions.ClassName, "{0}, skipping updating", commandArg);
                         SkipUpdate = true;
                         break;
                     case "silent-start":
-                        Logging.Info("silent-start, loading in background");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in background", commandArg);
                         SilentStart = true;
                         break;
                     case "auto-install":
                         AutoInstallFileName = args[++i];
-                        Logging.Info("auto-install, attempting to launch installation using user configuration file: " + AutoInstallFileName);
+                        Logging.Info(LogOptions.ClassName, "{0}, attempting to launch installation using user configuration file {1}", commandArg, AutoInstallFileName);
                         break;
                     case "updateKeyFile":
                         //get key file
                         UpdateKeyFileName = args[++i];
-                        Logging.Info("updateKeyFile, loading keyfile " + UpdateKeyFileName);
+                        Logging.Info(LogOptions.ClassName, "{0}, loading keyfile {1}", commandArg, UpdateKeyFileName);
                         break;
                     case "editorAutoLoad":
                         EditorAutoLoadFileName = args[++i];
-                        Logging.Info("editorAutoLoad, loading database from " + EditorAutoLoadFileName);
+                        Logging.Info(LogOptions.ClassName, "{0}, loading database from {1}", commandArg, EditorAutoLoadFileName);
                         break;
                     //now check for different startup modes
                     case "patch-designer":
                         ApplicationMode = ApplicationMode.PatchDesigner;
-                        Logging.Info("patch-designer, loading in patch design mode");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in patch design mode", commandArg);
                         break;
                     case "database-updater":
                         ApplicationMode = ApplicationMode.Updater;
-                        Logging.Info("database-updater, loading in database update mode");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in database update mode", commandArg);
+                        break;
+                    case "modpack-toolbox":
+                        ApplicationMode = ApplicationMode.Updater;
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in database update mode", commandArg);
                         break;
                     case "updater-hardcode-path":
-                        Logging.Info("updater-hardcode-path, forcing folder path as {0}", ModpackToolbox.HardCodeRepoPath);
+                        Logging.Info(LogOptions.ClassName, "{0}, forcing folder path as {1}", commandArg, ModpackToolbox.HardCodeRepoPath);
                         ModpackToolbox.UseHardCodePath = true;
                         break;
                     case "database-editor":
                         ApplicationMode = ApplicationMode.Editor;
-                        Logging.Info("database-editor, loading in database edit mode");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in database edit mode", commandArg);
                         break;
                     case "patcher":
                         ApplicationMode = ApplicationMode.Patcher;
-                        Logging.Info("patcher, loading in patch mode");
+                        Logging.Info(LogOptions.ClassName, "{0}, loading in patch mode", commandArg);
                         PatchFilenames.Add(args[++i].Trim());
                         break;
                     case "macro":
                         string macroName = args[++i];
                         string macroValue = args[++i];
-                        Logging.Info("parsing macro '{0}' with value '{1}'",macroName,macroValue);
+                        Logging.Info(LogOptions.ClassName, "{0}, parsing macro '{1}' with value '{2}'", commandArg, macroName, macroValue);
                         /*
                         FilePathDict.Add(@"{versiondir}", Settings.WoTClientVersion);
                         FilePathDict.Add(@"{appdata}", Settings.AppDataFolder);
@@ -173,7 +177,7 @@
                         */
                         if(!macroName[0].Equals('{'))
                         {
-                            Logging.Info(@"macro not started with '{', adding");
+                            Logging.Info(LogOptions.ClassName, @"macro not started with '{', adding");
                             macroName = string.Format("{{{0}}}", macroName);
                         }
                         MacroUtils.FilePathDict.Add(macroName, macroValue);
@@ -181,7 +185,7 @@
                     default:
                         if (ApplicationMode == ApplicationMode.Patcher)
                         {
-                            Logging.Info("adding patch: {0}", commandArg.Trim());
+                            Logging.Info(LogOptions.ClassName, "Adding patch: {0}", commandArg.Trim());
                             PatchFilenames.Add(commandArg.Trim());
                         }
                         break;


temporary fix for star rating save in database

--- RunApproachStatistics/ViewModel/PostMeasurementViewModel.cs
+++ RunApproachStatistics/ViewModel/PostMeasurementViewModel.cs
@@ -380,6 +380,7 @@
         }
         public void SaveAction(object commandParam)
         {
+            SelectedThumbnail.Vault.rating_star = ratingVM.RatingValue;
             vaultModule.update(SelectedThumbnail.Vault);
         }


Example usage added to the XML comments of the ContainerOptions class.

--- SimpleServiceLocator/SimpleInjector.NET/ContainerOptions.cs
+++ SimpleServiceLocator/SimpleInjector.NET/ContainerOptions.cs
@@ -26,6 +26,32 @@
 namespace SimpleInjector
 {
     /// Configuration options for the <see cref="Container"/>.
+    /// <example>
+    /// The following example shows the typical usage of the ContainerOptions class.
+    /// <![CDATA[
+    /// var container = new Container(new ContainerOptions { AllowOverridingRegistrations = true });
+    ///
+    /// container.Register<ITimeProvider, DefaultTimeProvider>();
+    ///
+    /// // Replaces the previous registration of ITimeProvider
+    /// container.Register<ITimeProvider, CustomTimeProvider>();
+    /// ]]>
+    /// Instead of applying the created ContainerOptions directly to the container's constructor, the
+    /// options class can be stored in a local variable. This allows changing the behavior of the container
+    /// during the initialization process.
+    /// <![CDATA[
+    /// var options = new ContainerOptions { AllowOverridingRegistrations = false };
+    ///
+    /// var container = new Container(options);
+    ///
+    /// BusinessLayerBootstrapper.Bootstrap(container);
+    ///
+    /// options.AllowOverridingRegistrations = true;
+    ///
+    /// // Replaces a possibly former registration of ITimeProvider
+    /// container.Register<ITimeProvider, CustomTimeProvider>();
+    /// ]]>
+    /// </example>
     public class ContainerOptions
     {
         ///


Closes #1502 - validatie communicatievorm bij toevoegen

(nieuwe backend)

--- Solution/Chiro.Gap.Services/GelieerdePersonenService.svc.cs
+++ Solution/Chiro.Gap.Services/GelieerdePersonenService.svc.cs
@@ -812,11 +812,26 @@
             communicatieVorm.ID = 0;    // zodat die zeker als nieuw wordt beschouwd
             communicatieVorm.CommunicatieType = _communicatieTypesRepo.ByID(commInfo.CommunicatieTypeID);

-            // Communicatievormen koppelen is een beetje een gedoe, omdat je die voorkeuren hebt,
-            // en het concept 'gezinsgebonden' (wat eigenlijk niet helemaal klopt)
-            // Al die brol handelen we af in de manager.
-
-            var gekoppeld = _communicatieVormenMgr.Koppelen(gelieerdePersoon, communicatieVorm);
+            List<CommunicatieVorm> gekoppeld;
+
+            try
+            {
+                // Communicatievormen koppelen is een beetje een gedoe, omdat je die voorkeuren hebt,
+                // en het concept 'gezinsgebonden' (wat eigenlijk niet helemaal klopt)
+                // Al die brol handelen we af in de manager.
+
+                gekoppeld = _communicatieVormenMgr.Koppelen(gelieerdePersoon, communicatieVorm);
+            }
+            catch (FoutNummerException ex)
+            {
+                if (ex.FoutNummer == FoutNummer.ValidatieFout)
+                {
+                    throw FaultExceptionHelper.FoutNummer(ex.FoutNummer, ex.Message);
+                }
+                // Van validatieexcpetion maken we een faultexception.
+                // Eender welke andere exception throwen we opnieuw.
+                throw;
+            }
             var tesyncen = (from cv in gekoppeld
                             where
                                 cv.GelieerdePersoon.Persoon.AdNummer != null || cv.GelieerdePersoon.Persoon.AdInAanvraag


Closes #363, #269.  De indexaction van de personencontroller, doet nu een redirect naar de listaction.

git-svn-id: 0ffdc289f568b1e7493e560395a00d06174c8a92@971 99b415e2-69d1-4072-8d93-0ed3a15484ab

--- Solution/Chiro.Gap.WebApp/Controllers/PersonenController.cs
+++ Solution/Chiro.Gap.WebApp/Controllers/PersonenController.cs
@@ -40,7 +40,8 @@
 		// GET: /Personen/
 		public ActionResult Index(int groepID)
 		{
-			return List(1, groepID, 0);
+			// redirect naar alle personen van de groep, pagina 1.
+			return RedirectToAction("List", new { groepID = groepID, page = 1, id = 0 });
 		}

 		/// <summary>


Implement PlayerPrefs for mission storage

--- Soomla/Assets/Plugins/Soomla/Levelup/data/MissionStorage.cs
+++ Soomla/Assets/Plugins/Soomla/Levelup/data/MissionStorage.cs
@@ -52,14 +52,38 @@
 		}

-		virtual protected void _setCompleted(Mission mission, bool open, bool notify) {
-			// TODO: WIE
+		protected void _setCompleted(Mission mission, bool completed, bool notify) {
+			string key = keyMissionCompleted (mission.MissionId);
+			if (completed) {
+				PlayerPrefs.SetString(key, "yes");
+
+				if (notify) {
+					LevelUpEvents.OnMissionCompleted(mission);
+				}
+			} else {
+				PlayerPrefs.DeleteKey(key);
+
+				if (notify) {
+					LevelUpEvents.OnMissionCompletionRevoked(mission);
+				}
+			}
 		}

-		virtual protected bool _isCompleted(Mission mission) {
-			// TODO: WIE
-			return false;
+		protected bool _isCompleted(Mission mission) {
+			string key = keyMissionCompleted (mission.MissionId);
+			string val = PlayerPrefs.GetString (key);
+			return val != null;
 		}
+
+		private static string keyMissions(string missionId, string postfix) {
+			return LevelUp.DB_KEY_PREFIX + "missions." + missionId + "." + postfix;
+		}
+
+		private static string keyMissionCompleted(string missionId) {
+			return keyMissions(missionId, "completed");
+		}
+
+
 	}
 }


Made the ambientServices in AppBase.StopApplicationAsync optional. Defaults to AmbientServices.Instance

--- src/Kephas.Core/Application/AppBase.cs
+++ src/Kephas.Core/Application/AppBase.cs
@@ -37,7 +37,7 @@
         /// Starts the application asynchronously.
         /// </summary>
         /// <param name="appArgs">The application arguments (optional).</param>
-        /// <param name="ambientServices">The ambient services (optional). If no ambient services is provided, a default one will be created.</param>
+        /// <param name="ambientServices">The ambient services (optional). If not provided then <see cref="AmbientServices.Instance"/> is considered.</param>
         /// <param name="cancellationToken">The cancellation token (optional).</param>
         /// <returns>
         /// The asynchronous result that yields the provided or the created <see cref="IAmbientServices"/>.
@@ -89,18 +89,20 @@
         /// <summary>
         /// Stops the application asynchronously.
         /// </summary>
-        /// <param name="ambientServices">The ambient services.</param>
+        /// <param name="ambientServices">The ambient services (optional). If not provided then <see cref="AmbientServices.Instance"/> is considered.</param>
         /// <param name="cancellationToken">The cancellation token (optional).</param>
         /// <returns>
         /// The asynchronous result.
         /// </returns>
         public virtual async Task StopApplicationAsync(
-            IAmbientServices ambientServices,
+            IAmbientServices ambientServices = null,
             CancellationToken cancellationToken = default)
         {
             try
             {
                 this.Log(LogLevel.Info, null, Strings.App_StopApplication_Stopping_Message);
+
+                ambientServices = ambientServices ?? AmbientServices.Instance;

                 var appContext = ambientServices.CompositionContainer.GetExport<IAppContext>();
                 var appManager = ambientServices.CompositionContainer.GetExport<IAppManager>();


MiniProfiler.ToString implementation

MiniProfiler.ToString implementation

--- src/Kirkin/Diagnostics/MiniProfiler.cs
+++ src/Kirkin/Diagnostics/MiniProfiler.cs
@@ -2,6 +2,7 @@
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Linq;

 namespace Kirkin.Diagnostics
 {
@@ -88,6 +89,22 @@
         }

         /// <summary>
+        /// Returns a string description of this instance.
+        /// </summary>
+        public override string ToString()
+        {
+            return ToString(Environment.NewLine);
+        }
+
+        /// <summary>
+        /// Returns a string description of this instance.
+        /// </summary>
+        public string ToString(string delimiter)
+        {
+            return string.Join(delimiter, Operations.OrderByDescending(o => o.TotalDuration));
+        }
+
+        /// <summary>
         /// Disposable scope involved in timing an operation.
         /// When the scope is disposed the operation is marked as completed.
         /// </summary>
@@ -121,8 +138,8 @@
         /// </summary>
         public sealed class Operation
         {
+            private int _count;
             private long _sum;
-            private int _count;
             private long _min;
             private long _max;