Better names for these tests

Better names for these tests

--- src/SqlStreamStore.AcceptanceTests/SqlStreamStoreAcceptanceTests.Subscriptions.cs
+++ src/SqlStreamStore.AcceptanceTests/SqlStreamStoreAcceptanceTests.Subscriptions.cs
@@ -469,17 +469,7 @@
         }

         [Fact]
-        public async Task When_subscribe_from_end_and_stream_store_throws_then_should_drop_subscription()
-        {
-            using(var fixture = GetFixture())
-            {
-                using(var store = await fixture.GetStreamStore())
-                {}
-            }
-        }
-
-        [Fact]
-        public async Task When_exception_throw_by_subscriber_then_should_drop_subscription_with_reson_SubscriberError()
+        public async Task When_exception_throw_by_stream_subscriber_then_should_drop_subscription_with_reson_SubscriberError()
         {
             using(var fixture = GetFixture())
             {
@@ -513,7 +503,7 @@
         }

         [Fact]
-        public async Task When_disposed_then_should_drop_subscription_with_reason_Disposed()
+        public async Task When_stream_subscription_disposed_then_should_drop_subscription_with_reason_Disposed()
         {
             using(var fixture = GetFixture())
             {
@@ -536,7 +526,7 @@
         }

         [Fact]
-        public async Task When_disposed_while_handling_messages_then_should_drop_subscription_with_reason_Disposed2()
+        public async Task When_stream_subscriptiondisposed_while_handling_messages_then_should_drop_subscription_with_reason_Disposed()
         {
             using(var fixture = GetFixture())
             {


Remove unnecessary null check.

Remove unnecessary null check.

--- src/Workspaces/Core/Portable/Shared/Extensions/ITypeInferenceServiceExtensions.cs
+++ src/Workspaces/Core/Portable/Shared/Extensions/ITypeInferenceServiceExtensions.cs
@@ -17,7 +17,7 @@
             CancellationToken cancellationToken)
         {
             var types = typeInferenceService.InferTypes(semanticModel, expression, cancellationToken);
-            var delegateTypes = types.Select(t => t?.GetDelegateType(semanticModel.Compilation));
+            var delegateTypes = types.Select(t => t.GetDelegateType(semanticModel.Compilation));
             return delegateTypes.WhereNotNull().FirstOrDefault();
         }


revert unintended whitespace change

revert unintended whitespace change

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

--- src/Appender/EventLogAppender.cs
+++ src/Appender/EventLogAppender.cs
@@ -275,34 +275,41 @@
 		/// </remarks>
 		override public void ActivateOptions()
 		{
-            try {
+            try
+            {
                 base.ActivateOptions();

-                if (m_securityContext == null) {
+                if (m_securityContext == null)
+                {
                     m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this);
                 }

                 bool sourceAlreadyExists = false;
                 string currentLogName = null;

-                using (SecurityContext.Impersonate(this)) {
+                using (SecurityContext.Impersonate(this))
+                {
                     sourceAlreadyExists = EventLog.SourceExists(m_applicationName);
                     if (sourceAlreadyExists) {
                         currentLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName);
                     }
                 }

-                if (sourceAlreadyExists && currentLogName != m_logName) {
+                if (sourceAlreadyExists && currentLogName != m_logName)
+                {
                     LogLog.Debug(declaringType, "Changing event source [" + m_applicationName + "] from log [" + currentLogName + "] to log [" + m_logName + "]");
                 }
-                else if (!sourceAlreadyExists) {
+                else if (!sourceAlreadyExists)
+                {
                     LogLog.Debug(declaringType, "Creating event source Source [" + m_applicationName + "] in log " + m_logName + "]");
                 }

                 string registeredLogName = null;

-                using (SecurityContext.Impersonate(this)) {
-                    if (sourceAlreadyExists && currentLogName != m_logName) {
+                using (SecurityContext.Impersonate(this))
+                {
+                    if (sourceAlreadyExists && currentLogName != m_logName)
+                    {
                         //
                         // Re-register this to the current application if the user has changed
                         // the application / logfile association
@@ -312,7 +319,8 @@

                         registeredLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName);
                     }
-                    else if (!sourceAlreadyExists) {
+                    else if (!sourceAlreadyExists)
+                    {
                         CreateEventSource(m_applicationName, m_logName, m_machineName);

                         registeredLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName);
@@ -323,7 +331,8 @@

                 LogLog.Debug(declaringType, "Source [" + m_applicationName + "] is registered to log [" + registeredLogName + "]");
             }
-            catch (System.Security.SecurityException ex) {
+            catch (System.Security.SecurityException ex)
+            {
                 ErrorHandler.Error("Caught a SecurityException trying to access the EventLog.  Most likely the event source "
                     + m_applicationName
                     + " doesn't exist and must be created by a local administrator.  Will disable EventLogAppender."


Use SpanBasedConcatenator in ExpandPropertiesLeaveTypedAndEscaped

--- src/Build/Evaluation/Expander.cs
+++ src/Build/Evaluation/Expander.cs
@@ -1106,7 +1106,7 @@
                 // so that we can either maintain the object's type in the event
                 // that we have a single component, or convert to a string
                 // if concatenation is required.
-                List<object> results = new List<object>();
+                using Expander<P, I>.SpanBasedConcatenator results = new Expander<P, I>.SpanBasedConcatenator();

                 // The sourceIndex is the zero-based index into the expression,
                 // where we've essentially read up to and copied into the target string.
@@ -1120,7 +1120,7 @@
                     // (but not including) the "$(", and advance the sourceIndex pointer.
                     if (propertyStartIndex - sourceIndex > 0)
                     {
-                        results.Add(expression.Substring(sourceIndex, propertyStartIndex - sourceIndex));
+                        results.Add(expression.AsMemory(sourceIndex, propertyStartIndex - sourceIndex));
                     }

                     // Following the "$(" we need to locate the matching ')'
@@ -1135,7 +1135,7 @@
                         // isn't really a well-formed property tag.  Just literally
                         // copy the remainder of the expression (starting with the "$("
                         // that we found) into the result, and quit.
-                        results.Add(expression.Substring(propertyStartIndex, expression.Length - propertyStartIndex));
+                        results.Add(expression.AsMemory(propertyStartIndex, expression.Length - propertyStartIndex));
                         sourceIndex = expression.Length;
                     }
                     else
@@ -1219,43 +1219,13 @@
                     propertyStartIndex = s_invariantCompareInfo.IndexOf(expression, "$(", sourceIndex, CompareOptions.Ordinal);
                 }

-                // If we have only a single result, then just return it
-                if (results.Count == 1 && expression.Length == sourceIndex)
-                {
-                    var resultString = results[0] as string;
-                    return resultString != null ? FileUtilities.MaybeAdjustFilePath(resultString) : results[0];
-                }
-                else
-                {
-                    // The expression is constant, return it as is
-                    if (sourceIndex == 0)
-                    {
-                        return expression;
-                    }
-
-                    // We have more than one result collected, therefore we need to concatenate
-                    // into the final result string. This does mean that we will lose type information.
-                    // However since the user wanted contatenation, then they clearly wanted that to happen.
-
-                    // Initialize our output string to empty string.
-                    // This method is called very often - of the order of 3,000 times per project.
-                    using SpanBasedStringBuilder result = Strings.GetSpanBasedStringBuilder();
-
-                    // Create a combined result string from the result components that we've gathered
-                    foreach (object component in results)
-                    {
-                        result.Append(FileUtilities.MaybeAdjustFilePath(component.ToString()));
-                    }
-
-                    // And if we couldn't find anymore property tags in the expression,
-                    // so just literally copy the remainder into the result.
-                    if (expression.Length - sourceIndex > 0)
-                    {
-                        result.Append(expression, sourceIndex, expression.Length - sourceIndex);
-                    }
-
-                    return result.ToString();
-                }
+                // If we couldn't find any more property tags in the expression just copy the remainder into the result.
+                if (expression.Length - sourceIndex > 0)
+                {
+                    results.Add(expression.AsMemory(sourceIndex, expression.Length - sourceIndex));
+                }
+
+                return results.GetResult();
             }

             /// <summary>


Remove lazy initialization of results (prep for more changes)

--- src/Build/Evaluation/Expander.cs
+++ src/Build/Evaluation/Expander.cs
@@ -976,8 +976,7 @@
                 // so that we can either maintain the object's type in the event
                 // that we have a single component, or convert to a string
                 // if concatenation is required.
-                List<object> results = null;
-                object lastResult = null;
+                List<object> results = new List<object>();

                 // The sourceIndex is the zero-based index into the expression,
                 // where we've essentially read up to and copied into the target string.
@@ -987,26 +986,10 @@
                 // any more.
                 while (propertyStartIndex != -1)
                 {
-                    if (lastResult != null)
-                    {
-                        if (results == null)
-                        {
-                            results = new List<object>(4);
-                        }
-
-                        results.Add(lastResult);
-                    }
-
-
                     // Append the result with the portion of the expression up to
                     // (but not including) the "$(", and advance the sourceIndex pointer.
                     if (propertyStartIndex - sourceIndex > 0)
                     {
-                        if (results == null)
-                        {
-                            results = new List<object>(4);
-                        }
-
                         results.Add(expression.Substring(sourceIndex, propertyStartIndex - sourceIndex));
                     }

@@ -1022,7 +1005,7 @@
                         // isn't really a well-formed property tag.  Just literally
                         // copy the remainder of the expression (starting with the "$("
                         // that we found) into the result, and quit.
-                        lastResult = expression.Substring(propertyStartIndex, expression.Length - propertyStartIndex);
+                        results.Add(expression.Substring(propertyStartIndex, expression.Length - propertyStartIndex));
                         sourceIndex = expression.Length;
                     }
                     else
@@ -1099,7 +1082,7 @@
                         // Record our result, and advance
                         // our sourceIndex pointer to the character just after the closing
                         // parenthesis.
-                        lastResult = propertyValue;
+                        results.Add(propertyValue);
                         sourceIndex = propertyEndIndex + 1;
                     }

@@ -1107,10 +1090,10 @@
                 }

                 // If we have only a single result, then just return it
-                if (results == null && expression.Length == sourceIndex)
-                {
-                    var resultString = lastResult as string;
-                    return resultString != null ? FileUtilities.MaybeAdjustFilePath(resultString) : lastResult;
+                if (results.Count == 1 && expression.Length == sourceIndex)
+                {
+                    var resultString = results[0] as string;
+                    return resultString != null ? FileUtilities.MaybeAdjustFilePath(resultString) : results[0];
                 }
                 else
                 {
@@ -1128,20 +1111,10 @@
                     // This method is called very often - of the order of 3,000 times per project.
                     using SpanBasedStringBuilder result = Strings.GetSpanBasedStringBuilder();

-                    // Append our collected results
-                    if (results != null)
-                    {
-                        // Create a combined result string from the result components that we've gathered
-                        foreach (object component in results)
-                        {
-                            result.Append(FileUtilities.MaybeAdjustFilePath(component.ToString()));
-                        }
-                    }
-
-                    // Append the last result we collected (it wasn't added to the list)
-                    if (lastResult != null)
-                    {
-                        result.Append(FileUtilities.MaybeAdjustFilePath(lastResult.ToString()));
+                    // Create a combined result string from the result components that we've gathered
+                    foreach (object component in results)
+                    {
+                        result.Append(FileUtilities.MaybeAdjustFilePath(component.ToString()));
                     }

                     // And if we couldn't find anymore property tags in the expression,


Warn & ignore, not fail duplicate envvar

* fixes #1319

--- src/Cake.Core/CakeEnvironment.cs
+++ src/Cake.Core/CakeEnvironment.cs
@@ -6,6 +6,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.Versioning;
+using Cake.Core.Diagnostics;
 using Cake.Core.IO;
 using Cake.Core.Polyfill;

@@ -16,6 +17,8 @@
     /// </summary>
     public sealed class CakeEnvironment : ICakeEnvironment
     {
+        private readonly ICakeLog _log;
+
         /// <summary>
         /// Gets or sets the working directory.
         /// </summary>
@@ -49,10 +52,12 @@
         /// </summary>
         /// <param name="platform">The platform.</param>
         /// <param name="runtime">The runtime.</param>
-        public CakeEnvironment(ICakePlatform platform, ICakeRuntime runtime)
+        /// <param name="log">The log.</param>
+        public CakeEnvironment(ICakePlatform platform, ICakeRuntime runtime, ICakeLog log)
         {
             Platform = platform;
             Runtime = runtime;
+            _log = log;

             // Get the application root.
             var assembly = AssemblyHelper.GetExecutingAssembly();
@@ -95,10 +100,31 @@
         {
             return Environment.GetEnvironmentVariables()
                 .Cast<System.Collections.DictionaryEntry>()
-                .ToDictionary(
-                    key => (string)key.Key,
-                    value => value.Value as string,
-                    StringComparer.OrdinalIgnoreCase);
+                .Aggregate(
+                    new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase),
+                    (dictionary, entry) =>
+                    {
+                        var key = (string)entry.Key;
+                        var value = entry.Value as string;
+                        string existingValue;
+                        if (dictionary.TryGetValue(key, out existingValue))
+                        {
+                            if (!StringComparer.OrdinalIgnoreCase.Equals(value, existingValue))
+                            {
+                                _log.Warning("GetEnvironmentVariables() encountered duplicate for key: {0}, value: {1} (existing value: {2})",
+                                    key,
+                                    value,
+                                    existingValue);
+                            }
+                        }
+                        else
+                        {
+                            dictionary.Add(key, value);
+                        }
+
+                        return dictionary;
+                    },
+                    dictionary => dictionary);
         }

         /// <summary>


Enable running UI in Web

Enable running UI in Web

Two changes are required.
1) .less files need to be served.
2) gravatar needs to be allowed for user images (CSP).

--- src/Exceptionless.Web/Startup.cs
+++ src/Exceptionless.Web/Startup.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.IO;
 using System.Security.Claims;
 using Exceptionless.Core;
@@ -20,6 +20,7 @@
 using System.Collections.Generic;
 using Foundatio.Hosting.Startup;
 using Microsoft.AspNetCore.Diagnostics.HealthChecks;
+using Microsoft.AspNetCore.StaticFiles;
 using Microsoft.Extensions.Options;

 namespace Exceptionless.Web {
@@ -138,7 +139,8 @@
                     .From("https://maxcdn.bootstrapcdn.com");
                 csp.AllowImages.FromSelf()
                     .From("data:")
-                    .From("https://q.stripe.com");
+                    .From("https://q.stripe.com")
+                    .From("https://www.gravatar.com");
                 csp.AllowScripts.FromSelf()
                     .AllowUnsafeInline()
                     .AllowUnsafeEval()
@@ -151,6 +153,16 @@
                     .From("https://maxcdn.bootstrapcdn.com");
             });

+            var contentTypeProvider = new FileExtensionContentTypeProvider {
+                Mappings = {
+                    [".less"] = "plain/text"
+                }
+            };
+
+            app.UseStaticFiles(new StaticFileOptions {
+                ContentTypeProvider = contentTypeProvider
+            });
+
             app.Use(async (context, next) => {
                 context.Response.Headers.Add("Referrer-Policy", "strict-origin-when-cross-origin");
                 context.Response.Headers.Add("Strict-Transport-Security", "max-age=31536000; includeSubDomains");
@@ -194,4 +206,4 @@
             }
         }
     }
-}+}


fix config UI letting you save value containing commas

This would have odd effects, since commas are used as value delimiters in Content Patcher.

--- ContentPatcher/ModEntry.cs
+++ ContentPatcher/ModEntry.cs
@@ -577,9 +577,11 @@
                     get: config => string.Join(", ", configField.Value.ToArray()),
                     set: (config, newValue) =>
                     {
-                        configField.Value = configField.AllowMultiple
-                            ? this.ParseCommaDelimitedField(newValue)
-                            : new InvariantHashSet(newValue);
+                        configField.Value = this.ParseCommaDelimitedField(newValue);
+
+                        if (!configField.AllowMultiple && configField.Value.Count > 1)
+                            configField.Value = new InvariantHashSet(configField.Value.Take(1));
+
                         resetToken();
                     }
                 );


Changed RawParseUtils.decodeNoFallback() to closer match jgit code. Made two more tests pass.

--- Core/Util/RawParseUtils.cs
+++ Core/Util/RawParseUtils.cs
@@ -917,32 +917,42 @@
 				b[i] = buffer[start + i];

-            if (cs != null)
-            {
-                // Try the suggested encoding, it might be right since it was
-                // provided by the caller.
-                //
-                try
-                {
-                    return decode(b, cs);
-                }
-				catch (DecoderFallbackException)
-                {
-                    //b.reset();
-                }
-            }
-            // No encoding specified or decoding failed, try default charset
-            //
-            try
-            {
-                return decode(b, Constants.CHARSET);
-            }
-			catch (DecoderFallbackException)
-            {
-                //b.reset();
-            }
-
-			throw new DecoderFallbackException("decoding failed with encoding: " + cs.HeaderName);
+              // Try our built-in favorite. The assumption here is that
+                 // decoding will fail if the data is not actually encoded
+                 // using that encoder.
+                 //
+                 try {
+                         return decode(b, Constants.CHARSET);
+                 } catch (DecoderFallbackException e) {
+                         //b.reset();
+                 }
+
+                 if (!cs.Equals(Constants.CHARSET)) {
+                         // Try the suggested encoding, it might be right since it was
+                         // provided by the caller.
+                         //
+                         try {
+                                 return decode(b, cs);
+                         } catch (DecoderFallbackException e) {
+                                 //b.reset();
+                         }
+                 }
+
+                 // Try the default character set. A small group of people
+                 // might actually use the same (or very similar) locale.
+                 //
+                 Encoding defcs = Encoding.Default;
+                 if (!defcs.Equals(cs) && !defcs.Equals(Constants.CHARSET)) {
+                         try {
+                                 return decode(b, defcs);
+                         }
+                         catch (DecoderFallbackException e)
+                         {
+                                 //b.reset();
+                         }
+                 }
+
+                 throw new DecoderFallbackException(string.Format("Unable to decode provided buffer using encoder '{0}'.", cs.WebName) );
 		}

 		/**


don't allow delays for immediate messages

--- CrewChiefV2/AudioPlayer.cs
+++ CrewChiefV2/AudioPlayer.cs
@@ -428,7 +428,7 @@
                 foreach (String key in queueToPlay.Keys)
                 {
                     QueuedMessage queuedMessage = (QueuedMessage)queueToPlay[key];
-                    if (queuedMessage.dueTime <= milliseconds)
+                    if (isImmediateMessages || queuedMessage.dueTime <= milliseconds)
                     {
                         if ((isImmediateMessages || !keepQuiet) &&
                             (queuedMessage.abstractEvent == null || queuedMessage.abstractEvent.isClipStillValid(key)) &&


Fix class name

Fix class name

--- CvsGitTest/RevisionTest.cs
+++ CvsGitTest/RevisionTest.cs
@@ -10,7 +10,7 @@
 namespace CvsGitTest
 {
 	[TestClass]
-	public class UnitTest1
+	public class RevisionTest
 	{
 		[TestMethod]
 		public void IsBranch_NonBranchRevision()


Fixed painting problem with text

Fixed painting problem with text

--- src/HearThis/UI/ScriptControl.cs
+++ src/HearThis/UI/ScriptControl.cs
@@ -297,7 +297,7 @@

 			public float Paint(string input)
 			{
-				return LayoutString(input, LayoutAction.Measure & LayoutAction.Draw);
+				return LayoutString(input, LayoutAction.Measure | LayoutAction.Draw);
 			}

 			public float Measure()


Improved PowerTypeApiTests

Improved PowerTypeApiTests

Improved PowerTypeApiTests by using the test utilities for deep comparison.

--- tests/ArgentPonyWarcraftClient.Integration.Tests/GameDataApi/PowerTypeApiTests.cs
+++ tests/ArgentPonyWarcraftClient.Integration.Tests/GameDataApi/PowerTypeApiTests.cs
@@ -1,5 +1,6 @@
 using System.Threading.Tasks;
-using Xunit;
+using ArgentPonyWarcraftClient.Integration.Tests.TestUtilities;
+using ArgentPonyWarcraftClient.Tests.Assertions;

 namespace ArgentPonyWarcraftClient.Integration.Tests.GameDataApi
 {
@@ -9,16 +10,22 @@
         public async Task GetPowerTypesIndexAsync_Gets_PowerTypesIndex()
         {
             IPowerTypeApi warcraftClient = ClientFactory.BuildClient();
+
             RequestResult<PowerTypesIndex> result = await warcraftClient.GetPowerTypesIndexAsync("static-us");
-            Assert.NotNull(result.Value);
+
+            await result.Should().BeSuccessfulRequest()
+                .BeEquivalentToBlizzardResponseAsync("https://us.api.blizzard.com/data/wow/power-type/index?namespace=static-us&locale=en_US");
         }

         [ResilientFact]
         public async Task GetPowerTypeAsync_Gets_PowerType()
         {
             IPowerTypeApi warcraftClient = ClientFactory.BuildClient();
+
             RequestResult<PowerType> result = await warcraftClient.GetPowerTypeAsync(0, "static-us");
-            Assert.NotNull(result.Value);
+
+            await result.Should().BeSuccessfulRequest()
+                .BeEquivalentToBlizzardResponseAsync("https://us.api.blizzard.com/data/wow/power-type/0?namespace=static-us&locale=en_US");
         }
     }
 }


Updated unit tests.

Updated unit tests.

--- tests/Magick.NET.Tests/Formats/Png/PngReadDefinesTests/TheSkipProfilesProperty.cs
+++ tests/Magick.NET.Tests/Formats/Png/PngReadDefinesTests/TheSkipProfilesProperty.cs
@@ -21,7 +21,7 @@
                         SkipProfiles = (PngProfileTypes)64,
                     });

-                    Assert.Null(image.Settings.GetDefine("profile:skip"));
+                    Assert.Equal("64", image.Settings.GetDefine("profile:skip"));
                 }
             }

@@ -35,7 +35,7 @@
                         SkipProfiles = PngProfileTypes.Icc | PngProfileTypes.Iptc,
                     });

-                    Assert.Equal("Icc,Iptc", image.Settings.GetDefine("profile:skip"));
+                    Assert.Equal("Icc, Iptc", image.Settings.GetDefine("profile:skip"));
                 }
             }


Makes ahelp relay messages a little less disgusting to look at (#11149)

* Makes ahelp relay messages a little less disgusting to look at

* Improve title

--- Content.Server/Administration/Systems/BwoinkSystem.cs
+++ Content.Server/Administration/Systems/BwoinkSystem.cs
@@ -43,7 +43,7 @@
             _config.OnValueChanged(CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
             _config.OnValueChanged(CVars.GameHostName, OnServerNameChanged, true);
             _sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
-            _maxAdditionalChars = GenerateAHelpMessage("", "", true, true).Length + Header("").Length;
+            _maxAdditionalChars = GenerateAHelpMessage("", "", true, true).Length;

             SubscribeLocalEvent<RoundStartingEvent>(RoundStarting);
         }
@@ -70,8 +70,6 @@
             _webhookUrl = obj;
         }

-        private string Header(string serverName) => $"Server: {serverName}";
-
         private async void ProcessQueue(NetUserId channelId, Queue<string> messages)
         {
             if (!_relayMessages.TryGetValue(channelId, out var oldMessage) || messages.Sum(x => x.Length+2) + oldMessage.content.Length > MessageMax)
@@ -85,7 +83,7 @@
                     return;
                 }

-                oldMessage = (string.Empty, lookup.Username, Header(_serverName));
+                oldMessage = (string.Empty, lookup.Username, "");
             }

             while (messages.TryDequeue(out var message))
@@ -95,7 +93,7 @@

             var payload = new WebhookPayload()
             {
-                Username = $"R:{_gameTicker.RoundId}|N:{oldMessage.username}",
+                Username = $"{oldMessage.username} on {_serverName} (round {_gameTicker.RoundId})",
                 Content = oldMessage.content
             };

@@ -237,9 +235,9 @@
             if (noReceiver)
                 stringbuilder.Append(":sos:");
             stringbuilder.Append(admin ? ":outbox_tray:" : ":inbox_tray:");
-            stringbuilder.Append(' ');
+            stringbuilder.Append(" **");
             stringbuilder.Append(username);
-            stringbuilder.Append(": ");
+            stringbuilder.Append(":** ");
             stringbuilder.Append(message);
             return stringbuilder.ToString();
         }


Made internal hash table private.

Made internal hash table private.

--- DotJEM.Web.Host/Providers/Pipeline/PipelineContext.cs
+++ DotJEM.Web.Host/Providers/Pipeline/PipelineContext.cs
@@ -9,11 +9,19 @@
 {
     public class PipelineContext
     {
-        public Hashtable Items { get; set; }
+        private readonly Hashtable inner = new Hashtable();

-        public PipelineContext()
+        public void Add(object key, object value)
         {
-            Items = new Hashtable();
+            inner.Add(key, value);
         }
+
+        public object this[object key]
+        {
+            get { return inner[key]; }
+            set { inner[key] = value; }
+        }
+
+        public ICollection Keys => inner.Keys;
     }
 }


Adjust scaling numbers to be closer to stable

--- osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs
+++ osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyHitExplosion.cs
@@ -28,7 +28,7 @@
             Anchor = Anchor.BottomCentre;
             Origin = Anchor.BottomCentre;
             RelativeSizeAxes = Axes.Both;
-            Scale = new Vector2(0.4f);
+            Scale = new Vector2(0.5f);

             InternalChildren = new[]
             {
@@ -78,7 +78,7 @@
                     explosion1.Position = new Vector2(explosionOffset, 0);

                     explosion1.FadeOutFromOne(300);
-                    explosion1.ScaleTo(new Vector2(20 * scale, 1.1f), 160, Easing.Out);
+                    explosion1.ScaleTo(new Vector2(16 * scale, 1.1f), 160, Easing.Out);
                 }

                 explosion2.Scale = new Vector2(0.9f, 1);


Make difficulty switching test scene use `EditorTestScene`

--- osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs
+++ osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs
@@ -9,26 +9,20 @@
 using osu.Game.Beatmaps;
 using osu.Game.Graphics.UserInterface;
 using osu.Game.Overlays.Dialog;
+using osu.Game.Rulesets;
+using osu.Game.Rulesets.Osu;
 using osu.Game.Screens.Edit;
 using osu.Game.Screens.Edit.Components.Menus;
-using osu.Game.Screens.Menu;
 using osu.Game.Tests.Beatmaps.IO;
 using osuTK.Input;

 namespace osu.Game.Tests.Visual.Editing
 {
-    public class TestSceneDifficultySwitching : ScreenTestScene
+    public class TestSceneDifficultySwitching : EditorTestScene
     {
-        private BeatmapSetInfo importedBeatmapSet;
-        private Editor editor;
+        protected override Ruleset CreateEditorRuleset() => new OsuRuleset();

-        // required for screen transitions to work properly
-        // (see comment in EditorLoader.LogoArriving).
-        [Cached]
-        private OsuLogo logo = new OsuLogo
-        {
-            Alpha = 0
-        };
+        protected override bool IsolateSavingFromDatabase => false;

         [Resolved]
         private OsuGameBase game { get; set; }
@@ -36,20 +30,18 @@
         [Resolved]
         private BeatmapManager beatmaps { get; set; }

-        [BackgroundDependencyLoader]
-        private void load() => Add(logo);
+        private BeatmapSetInfo importedBeatmapSet;

-        [SetUpSteps]
-        public void SetUp()
+        public override void SetUpSteps()
         {
             AddStep("import test beatmap", () => importedBeatmapSet = ImportBeatmapTest.LoadOszIntoOsu(game, virtualTrack: true).Result);
+            base.SetUpSteps();
+        }

-            AddStep("set current beatmap", () => Beatmap.Value = beatmaps.GetWorkingBeatmap(importedBeatmapSet.Beatmaps.First()));
-            AddStep("push loader", () => Stack.Push(new EditorLoader()));
-
-            AddUntilStep("wait for editor push", () => Stack.CurrentScreen is Editor);
-            AddStep("store editor", () => editor = (Editor)Stack.CurrentScreen);
-            AddUntilStep("wait for editor to load", () => editor.IsLoaded);
+        protected override void LoadEditor()
+        {
+            Beatmap.Value = beatmaps.GetWorkingBeatmap(importedBeatmapSet.Beatmaps.First());
+            base.LoadEditor();
         }

         [Test]
@@ -72,11 +64,7 @@
             BeatmapInfo targetDifficulty = null;
             PromptForSaveDialog saveDialog = null;

-            AddStep("remove first hitobject", () =>
-            {
-                var editorBeatmap = editor.ChildrenOfType<EditorBeatmap>().Single();
-                editorBeatmap.RemoveAt(0);
-            });
+            AddStep("remove first hitobject", () => EditorBeatmap.RemoveAt(0));

             AddStep("set target difficulty", () => targetDifficulty = importedBeatmapSet.Beatmaps.Last(beatmap => !beatmap.Equals(Beatmap.Value.BeatmapInfo)));
             switchToDifficulty(() => targetDifficulty);
@@ -105,11 +93,7 @@
             BeatmapInfo targetDifficulty = null;
             PromptForSaveDialog saveDialog = null;

-            AddStep("remove first hitobject", () =>
-            {
-                var editorBeatmap = editor.ChildrenOfType<EditorBeatmap>().Single();
-                editorBeatmap.RemoveAt(0);
-            });
+            AddStep("remove first hitobject", () => EditorBeatmap.RemoveAt(0));

             AddStep("set target difficulty", () => targetDifficulty = importedBeatmapSet.Beatmaps.Last(beatmap => !beatmap.Equals(Beatmap.Value.BeatmapInfo)));
             switchToDifficulty(() => targetDifficulty);
@@ -134,10 +118,10 @@

         private void switchToDifficulty(Func<BeatmapInfo> difficulty)
         {
-            AddUntilStep("wait for menubar to load", () => editor.ChildrenOfType<EditorMenuBar>().Any());
+            AddUntilStep("wait for menubar to load", () => Editor.ChildrenOfType<EditorMenuBar>().Any());
             AddStep("open file menu", () =>
             {
-                var menuBar = editor.ChildrenOfType<EditorMenuBar>().Single();
+                var menuBar = Editor.ChildrenOfType<EditorMenuBar>().Single();
                 var fileMenu = menuBar.ChildrenOfType<DrawableOsuMenuItem>().First();
                 InputManager.MoveMouseTo(fileMenu);
                 InputManager.Click(MouseButton.Left);
@@ -146,7 +130,7 @@
             AddStep("open difficulty menu", () =>
             {
                 var difficultySelector =
-                    editor.ChildrenOfType<DrawableOsuMenuItem>().Single(item => item.Item.Text.Value.ToString().Contains("Change difficulty"));
+                    Editor.ChildrenOfType<DrawableOsuMenuItem>().Single(item => item.Item.Text.Value.ToString().Contains("Change difficulty"));
                 InputManager.MoveMouseTo(difficultySelector);
             });
             AddWaitStep("wait for open", 3);
@@ -154,7 +138,7 @@
             AddStep("switch to target difficulty", () =>
             {
                 var difficultyMenuItem =
-                    editor.ChildrenOfType<DrawableOsuMenuItem>()
+                    Editor.ChildrenOfType<DrawableOsuMenuItem>()
                           .Last(item => item.Item is DifficultyMenuItem difficultyItem && difficultyItem.Beatmap.Equals(difficulty.Invoke()));
                 InputManager.MoveMouseTo(difficultyMenuItem);
                 InputManager.Click(MouseButton.Left);


Migrated ObservableConcat.

Migrated ObservableConcat.

--- Expressions/Expressions.Linq/Linq/ObservableConcat.cs
+++ Expressions/Expressions.Linq/Linq/ObservableConcat.cs
@@ -10,6 +10,17 @@
     {
         private INotifyEnumerable<TSource> source;
         private IEnumerable<TSource> source2;
+        private INotifyEnumerable<TSource> observableSource2;
+
+        public override IEnumerable<INotifiable> Dependencies
+        {
+            get
+            {
+                yield return source;
+                if (observableSource2 != null)
+                    yield return observableSource2;
+            }
+        }

         public ObservableConcat(INotifyEnumerable<TSource> source, IEnumerable<TSource> source2)
         {
@@ -18,63 +29,28 @@

             this.source = source;
             this.source2 = source2;
-
-            Attach();
+            this.observableSource2 = source2 as INotifyEnumerable<TSource>;
         }

         public override IEnumerator<TSource> GetEnumerator()
         {
             return SL.Concat(source, source2).GetEnumerator();
         }
-
-        protected override void AttachCore()
+
+        public override INotificationResult Notify(IList<INotificationResult> sources)
         {
-            source.CollectionChanged += SourceCollectionChanged;
-            var notifier = source2 as INotifyCollectionChanged;
-            if (notifier != null)
+            var change1 = (CollectionChangedNotificationResult<TSource>)sources[0];
+            if (sources.Count > 1)
             {
-                notifier.CollectionChanged += Source2CollectionChanged;
+                var change2 = (CollectionChangedNotificationResult<TSource>)sources[1];
+                change1.AddedItems.AddRange(change2.AddedItems);
+                change1.RemovedItems.AddRange(change2.RemovedItems);
+                return new CollectionChangedNotificationResult<TSource>(this, change1.AddedItems, change1.RemovedItems);
             }
-        }
-
-        private void Source2CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            int sourceCount = SL.Count(source);
-            switch (e.Action)
+            else
             {
-                case NotifyCollectionChangedAction.Add:
-                    e = new NotifyCollectionChangedEventArgs(e.Action, e.NewItems, sourceCount + e.NewStartingIndex);
-                    break;
-                case NotifyCollectionChangedAction.Move:
-                    e = new NotifyCollectionChangedEventArgs(e.Action, e.NewItems, sourceCount + e.NewStartingIndex, sourceCount + e.OldStartingIndex);
-                    break;
-                case NotifyCollectionChangedAction.Remove:
-                    e = new NotifyCollectionChangedEventArgs(e.Action, e.OldItems, sourceCount + e.OldStartingIndex);
-                    break;
-                case NotifyCollectionChangedAction.Replace:
-                    e = new NotifyCollectionChangedEventArgs(e.Action, e.NewItems, e.OldItems, sourceCount + e.OldStartingIndex);
-                    break;
-                case NotifyCollectionChangedAction.Reset:
-                    OnCleared();
-                    return;
-                default:
-                    throw new InvalidOperationException();
-            }
-            OnCollectionChanged(e);
-        }
-
-        private void SourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            OnCollectionChanged(e);
-        }
-
-        protected override void DetachCore()
-        {
-            source.CollectionChanged -= SourceCollectionChanged;
-            var notifier = source2 as INotifyCollectionChanged;
-            if (notifier != null)
-            {
-                notifier.CollectionChanged -= Source2CollectionChanged;
+                change1.Source = this;
+                return change1;
             }
         }
     }


Added new content loader for doing date caching.

--- FRBDK/FlatRedBall.AnimationEditorForms/MainControl.cs
+++ FRBDK/FlatRedBall.AnimationEditorForms/MainControl.cs
@@ -20,6 +20,8 @@
 using Microsoft.Xna.Framework.Graphics;
 using FlatRedBall.AnimationEditorForms.ViewModels;
 using FlatRedBall.SpecializedXnaControls.Scrolling;
+using FlatRedBall.AnimationEditorForms.Content;
+using RenderingLibrary.Content;

 namespace FlatRedBall.AnimationEditorForms
 {
@@ -138,6 +140,7 @@

             RenderingLibrary.Graphics.Renderer.UseBasicEffectRendering = false;

+
             StatusBarManager.Self.Initialize(statusStrip1, CursorStatusLabel);

             WireframeManager.Self.AnimationFrameChange += HandleAnimationFrameChanges;
@@ -268,6 +271,8 @@
                 WireframeManager.Self.AnimationChainChange += RaiseAnimationChainChanges;

                 mScrollBarControlLogic.Managers = imageRegionSelectionControl1.SystemManagers;
+                var contentLoader = new DateCheckingContentLoader(imageRegionSelectionControl1.SystemManagers);
+                LoaderManager.Self.ContentLoader = contentLoader;

                 if (XnaInitialize != null)
                 {


Increased policy retry-wait seconds

Increased policy retry-wait seconds

--- FluentAutomation.SeleniumWebDriver/CommandProvider.cs
+++ FluentAutomation.SeleniumWebDriver/CommandProvider.cs
@@ -45,7 +45,7 @@
             const int NumberOfRetries = 10;
             try
             {
-                var policy = Policy.Handle<InvalidOperationException>().WaitAndRetry(NumberOfRetries, i => TimeSpan.FromSeconds(5));
+                var policy = Policy.Handle<InvalidOperationException>().WaitAndRetry(NumberOfRetries, i => TimeSpan.FromSeconds(18));
                 return policy.Execute(
                     () =>
                     {


Product Entity -> ViewModel tests implemented (no production code yet)

--- FossLock.Test.Web/Converter/CustomerConverterTests.cs
+++ FossLock.Test.Web/Converter/CustomerConverterTests.cs
@@ -207,7 +207,34 @@
         [Test]
         public void EntityToViewmodel_ReturnValue_MatchesExpectedState()
         {
-            Assert.Inconclusive("Not Implemented");
+            var vm = converter.EntityToViewmodel(fakeEntity);
+
+            Assert.That(vm.Id, Is.EqualTo(fakeEntity.Id));
+            Assert.That(vm.Name, Is.EqualTo(fakeEntity.Name));
+            Assert.That(vm.CanLicensePreReleaseVersions, Is.EqualTo(fakeEntity.CanLicensePreReleaseVersions));
+            // first run, billing+street should be different
+            Assert.That(vm.StreetAddress, Is.EqualTo(fakeEntity.StreetAddress));
+            Assert.That(vm.BillingAddress, Is.EqualTo(fakeEntity.BillingAddress));
+            Assert.That(vm.BillingMatchesStreetAddress, Is.False);
+            Assert.That(vm.OfficePhone1, Is.EqualTo(fakeEntity.OfficePhone1));
+            Assert.That(vm.OfficePhone2, Is.EqualTo(fakeEntity.OfficePhone2));
+            Assert.That(vm.OfficeFax, Is.EqualTo(fakeEntity.OfficeFax));
+            Assert.That(vm.Email, Is.EqualTo(fakeEntity.Email));
+            Assert.That(vm.Notes, Is.EqualTo(fakeEntity.Notes));
+            Assert.That(vm.PrimaryContact, Is.EqualTo(fakeEntity.PrimaryContact));
+
+            // now, we're going to make a shallow copy of the street address so it's equal to billing.
+            fakeEntity.BillingAddress.Address1 = fakeEntity.StreetAddress.Address1;
+            fakeEntity.BillingAddress.Address2 = fakeEntity.StreetAddress.Address2;
+            fakeEntity.BillingAddress.City = fakeEntity.StreetAddress.City;
+            fakeEntity.BillingAddress.State = fakeEntity.StreetAddress.State;
+            fakeEntity.BillingAddress.PostalCode = fakeEntity.StreetAddress.PostalCode;
+            fakeEntity.BillingAddress.Country = fakeEntity.StreetAddress.Country;
+
+            vm = converter.EntityToViewmodel(fakeEntity);
+
+            Assert.That(vm.StreetAddress, Is.EqualTo(vm.BillingAddress));
+            Assert.That(vm.BillingMatchesStreetAddress, Is.True);
         }
     }
 }


Minor code fixes

Minor code fixes

--- Goodreads/Endpoints/Implementations/SeriesEndpoint.cs
+++ Goodreads/Endpoints/Implementations/SeriesEndpoint.cs
@@ -45,19 +45,22 @@
                     {
                         var document = XDocument.Parse(content);
                         var series = document.XPathSelectElements("GoodreadsResponse/series_works/series_work/series");
-                        var seriesModels = new List<Series>();
-                        foreach (var seriesElement in series)
+                        if (series.Any())
                         {
-                            var seriesModel = new Series();
-                            seriesModel.Parse(seriesElement);
-                            seriesModels.Add(seriesModel);
+                            var seriesModels = new List<Series>();
+                            foreach (var seriesElement in series)
+                            {
+                                var seriesModel = new Series();
+                                seriesModel.Parse(seriesElement);
+                                seriesModels.Add(seriesModel);
+                            }
+
+                            // Goodreads returns way too many duplicates, group by them by id first.
+                            var grouped = seriesModels.GroupBy(x => x.Id);
+                            var uniqueSeries = grouped.Select(x => x.First()).ToList();
+
+                            return uniqueSeries;
                         }
-
-                        // Goodreads returns way too many duplicates, group by them by id first.
-                        var grouped = seriesModels.GroupBy(x => x.Id);
-                        var uniqueSeries = grouped.Select(x => x.First()).ToList();
-
-                        return uniqueSeries;
                     }
                 }
             }
@@ -91,15 +94,18 @@
                     {
                         var document = XDocument.Parse(content);
                         var series = document.XPathSelectElements("GoodreadsResponse/series_works/series_work/series");
-                        var seriesModels = new List<Series>();
-                        foreach (var seriesElement in series)
+                        if (series.Any())
                         {
-                            var seriesModel = new Series();
-                            seriesModel.Parse(seriesElement);
-                            seriesModels.Add(seriesModel);
+                            var seriesModels = new List<Series>();
+                            foreach (var seriesElement in series)
+                            {
+                                var seriesModel = new Series();
+                                seriesModel.Parse(seriesElement);
+                                seriesModels.Add(seriesModel);
+                            }
+
+                            return seriesModels;
                         }
-
-                        return seriesModels;
                     }
                 }
             }


add support for dotnet adapter in asset retargeter

--- Assets/MixedRealityToolkit.Tools/MSBuild/Scripts/AssetScriptReferenceRetargeter.cs
+++ Assets/MixedRealityToolkit.Tools/MSBuild/Scripts/AssetScriptReferenceRetargeter.cs
@@ -374,9 +374,11 @@
                                 {
                                     Debug.LogError($"Encountered a MonoScript we get a null Type from: '{monoScript.name}'");
                                 }
-                                else if (type.Namespace == null || !type.Namespace.Contains("Microsoft.MixedReality.Toolkit"))
+                                else if ((type.Namespace == null) ||
+                                        !type.Namespace.Contains("Microsoft.MixedReality.Toolkit") ||
+                                        !type.Namespace.Contains."Microsoft.Windows.MixedReality")) // DotNetWinRT adapter
                                 {
-                                    throw new InvalidDataException($"Type {type.Name} is not a member of the Microsoft.MixedReality.Toolkit namespace");
+                                    throw new InvalidDataException($"Type {type.Name} is not a member of an approved (typically, 'Microsoft.MixedReality.Toolkit') namespace");
                                 }
                                 else
                                 {


fix(Highlighter): fix syntax error with use of CombineMeshes

CombineMeshes can only be called on a mesh object and not on a
MeshFilter. This was throwing a critical error and has now been
fixed.

--- Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_OutlineObjectCopyHighlighter.cs
+++ Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_OutlineObjectCopyHighlighter.cs
@@ -179,7 +179,7 @@
                     }

                     highlightMesh.mesh = new Mesh();
-                    highlightMesh.CombineMeshes(combine.ToArray(), true, false);
+                    highlightMesh.mesh.CombineMeshes(combine.ToArray(), true, false);
                 }
                 else
                 {


renamed MustHaveValueBenchmark to MustHaveValueBenchmarks

--- Code/Light.GuardClauses.Performance/MustNotHaveValue/MustNotHaveValueBenchmarks.cs
+++ Code/Light.GuardClauses.Performance/MustNotHaveValue/MustNotHaveValueBenchmarks.cs
@@ -7,7 +7,8 @@
 {
     [ClrJob, CoreJob]
     [MemoryDiagnoser]
-    public class MustNotHaveValueBenchmark
+    [DisassemblyDiagnoser]
+    public class MustNotHaveValueBenchmarks
     {
         public static readonly double? Nullable = null;


Fix for token parsing of folder property field name

--- Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs
+++ Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs
@@ -2205,7 +2205,7 @@
                     parentFolder.Context.ExecuteQueryRetry();
                     foreach (var p in folder.Properties.Where(p => !p.Key.Equals("ContentTypeId")))
                     {
-                        currentFolderItem[p.Key] = parser.ParseString(p.Value);
+                        currentFolderItem[parser.ParseString(p.Key)] = parser.ParseString(p.Value);
                     }
 #if !SP2013 && !SP2016
                     currentFolderItem.UpdateOverwriteVersion();


slight UI-behavior improvement

slight UI-behavior improvement

--- OpenQuoridorFramework/OQF.PlayerVsBot/ViewModels/MainWindow/MainWindowViewModel.cs
+++ OpenQuoridorFramework/OQF.PlayerVsBot/ViewModels/MainWindow/MainWindowViewModel.cs
@@ -79,10 +79,12 @@
 			IsAutoScrollDebugMsgActive = true;
 			IsAutoScrollProgressActive = true;

-			BrowseDll = new Command(DoBrowseDll);
+			BrowseDll = new Command(DoBrowseDll,
+								    () => GameStatus != GameStatus.Active,
+									new PropertyChangedCommandUpdater(this, nameof(GameStatus)));
 			Start = new Command(DoStart,
-								() => GameStatus != GameStatus.Active,
-								new PropertyChangedCommandUpdater(this, nameof(GameStatus)));
+								() => GameStatus != GameStatus.Active && !string.IsNullOrWhiteSpace(DllPathInput),
+								new PropertyChangedCommandUpdater(this, nameof(GameStatus), nameof(DllPathInput)));
 			Capitulate = new Command(DoCapitulate,
 									 IsMoveApplyable,
 									 new PropertyChangedCommandUpdater(this, nameof(GameStatus)));


Add ToString method

Add ToString method


added a method to get hidden field value


Improve ModerationPoints.FromString.

Improve ModerationPoints.FromString.


Remove command prefix caching.

Remove command prefix caching.

--- src/MitternachtBot/Services/CommandHandler.cs
+++ src/MitternachtBot/Services/CommandHandler.cs
@@ -11,12 +11,9 @@
 using Discord.Net;
 using Discord.WebSocket;
 using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.DependencyInjection;
 using Mitternacht.Common.Collections;
 using Mitternacht.Common.ModuleBehaviors;
 using Mitternacht.Extensions;
-using Mitternacht.Services.Database;
-using Mitternacht.Services.Database.Models;
 using NLog;
 using Npgsql;

@@ -40,7 +37,6 @@
 		private readonly IBotCredentials                     _bc;
 		private          INServiceProvider                   _services;
 		public           string                              DefaultPrefix => _bcp.BotConfig.DefaultPrefix;
-		private          ConcurrentDictionary<ulong, string> Prefixes      { get; }

 		public event Func<SocketUserMessage, Task>                 OnValidMessage     = delegate { return Task.CompletedTask; };
 		public event Func<IUserMessage, CommandInfo, Task>         CommandExecuted    = delegate { return Task.CompletedTask; };
@@ -53,7 +49,7 @@

 		private readonly Timer _clearUsersOnShortCooldown;

-		public CommandHandler(DiscordSocketClient client, DbService db, IBotConfigProvider bcp, IEnumerable<GuildConfig> gcs, CommandService commandService, MitternachtBot bot, IBotCredentials bc) {
+		public CommandHandler(DiscordSocketClient client, DbService db, IBotConfigProvider bcp, CommandService commandService, MitternachtBot bot, IBotCredentials bc) {
 			_client         = client;
 			_commandService = commandService;
 			_bot            = bot;
@@ -64,15 +60,19 @@
 			_log = LogManager.GetCurrentClassLogger();

 			_clearUsersOnShortCooldown = new Timer(_ => { UsersOnShortCooldown.Clear(); }, null, GlobalCommandsCooldown, GlobalCommandsCooldown);
-
-			Prefixes = gcs.Where(x => x.Prefix != null).ToDictionary(x => x.GuildId, x => x.Prefix).ToConcurrent();
 		}

 		public string GetPrefix(IGuild guild)
 			=> GetPrefix(guild?.Id);

-		public string GetPrefix(ulong? id)
-			=> id == null || !Prefixes.TryGetValue(id.Value, out var prefix) ? DefaultPrefix : prefix;
+		public string GetPrefix(ulong? guildId) {
+			if(!guildId.HasValue)
+				return DefaultPrefix;
+
+			using var uow = _db.UnitOfWork;
+			var prefix = uow.GuildConfigs.For(guildId.Value).Prefix;
+			return string.IsNullOrWhiteSpace(prefix) ? DefaultPrefix : prefix;
+		}

 		public string SetDefaultPrefix(string prefix) {
 			if(string.IsNullOrWhiteSpace(prefix)) throw new ArgumentNullException(nameof(prefix));
@@ -92,15 +92,10 @@
 			if(string.IsNullOrWhiteSpace(prefix)) throw new ArgumentNullException(nameof(prefix));
 			if(guild == null) throw new ArgumentNullException(nameof(guild));

-			prefix = prefix.ToLowerInvariant();
-
-			using(var uow = _db.UnitOfWork) {
-				var gc = uow.GuildConfigs.For(guild.Id);
-				gc.Prefix = prefix;
-				uow.SaveChanges();
-			}
-
-			Prefixes.AddOrUpdate(guild.Id, prefix, (key, old) => prefix);
+			using var uow = _db.UnitOfWork;
+			var gc = uow.GuildConfigs.For(guild.Id);
+			gc.Prefix = prefix;
+			uow.SaveChanges();

 			return prefix;
 		}
@@ -201,9 +196,9 @@
 			}

 			var prefix          = GetPrefix(guild?.Id);
-			var isPrefixCommand = messageContent.StartsWith(".prefix");
+			var isPrefixCommand = messageContent.StartsWith(".prefix", StringComparison.OrdinalIgnoreCase);
 			// execute the command and measure the time it took
-			if(messageContent.StartsWith(prefix) || isPrefixCommand) {
+			if(messageContent.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) || isPrefixCommand) {
 				var (success, error, info) = await ExecuteCommandAsync(new CommandContext(_client, userMsg), messageContent, isPrefixCommand ? 1 : prefix.Length, _services, MultiMatchHandling.Best);

 				startTickCount = Environment.TickCount - startTickCount;
@@ -366,7 +361,7 @@
 				}

 				var prefix          = GetPrefix(guild?.Id);
-				var isPrefixCommand = messageContent.StartsWith(".prefix");
+				var isPrefixCommand = messageContent.StartsWith(".prefix", StringComparison.OrdinalIgnoreCase);

 				return messageContent.StartsWith(prefix) || isPrefixCommand;
 			} catch(Exception) {


Sneaking in some code clean-up

Sneaking in some code clean-up

--- src/Nancy.Testing/ConfigurableBootstrapper.cs
+++ src/Nancy.Testing/ConfigurableBootstrapper.cs
@@ -77,6 +77,7 @@
                 configuration.Invoke(configurator);
             }
         }
+
         protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
         {
             base.ApplicationStartup(container, pipelines);
@@ -85,6 +86,7 @@
                 action.Invoke(container,pipelines);
             }
         }
+
         protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
         {
             base.RequestStartup(container, pipelines, context);


remove file:// from strings returned by mac file dialogs.

--- src/OSX/Avalonia.MonoMac/SystemDialogsImpl.cs
+++ src/OSX/Avalonia.MonoMac/SystemDialogsImpl.cs
@@ -25,9 +25,9 @@
                 else
                 {
                     if (panel is NSOpenPanel openPanel)
-                        tcs.SetResult(openPanel.Urls.Select(url => url.AbsoluteString).ToArray());
+                        tcs.SetResult(openPanel.Urls.Select(url => url.AbsoluteString.Replace("file://", "")).ToArray());
                     else
-                        tcs.SetResult(new[] { panel.Url.AbsoluteString });
+                        tcs.SetResult(new[] { panel.Url.AbsoluteString.Replace("file://", "") });
                 }
                 panel.OrderOut(panel);
                 keyWindow?.MakeKeyAndOrderFront(keyWindow);


squeeze a bit more in before heading out :)

--- src/PortableWikiViewer.Core/XZStreamReader.cs
+++ src/PortableWikiViewer.Core/XZStreamReader.cs
@@ -13,6 +13,8 @@
         {
             public long BlockStart { get; set; }
             public int BlockSize { get; set; }
+            public long? CompressedSize { get; set; }
+            public long? UncompressedSize { get; set; }
         }

         public enum CheckType : byte
@@ -37,6 +39,18 @@
             _streamStart = stream.Position;
             ProcessHeader();
             PreProcessBlocks();
+            ProcessIndex();
+            ProcessFooter();
+        }
+
+        private void ProcessFooter()
+        {
+            throw new NotImplementedException();
+        }
+
+        private void ProcessIndex()
+        {
+            throw new NotImplementedException();
         }

         private void PreProcessBlocks()
@@ -55,6 +69,13 @@
             var info = new BlockInfo();
             info.BlockStart = _reader.BaseStream.Position - 1;
             info.BlockSize = (blockSizeByte + 1) * 4;
+
+            var blockFlags = _reader.ReadByte();
+            byte filters = (byte)(blockFlags & 0x03);
+            byte reserved = (byte)(blockFlags & 0x3C);
+            byte compressedSizePresentByte = (byte)(blockFlags & 0x40);
+            byte uncompressedSizePresentByte = (byte)(blockFlags & 0x80);
+
             return info;
         }


Added validation to the input fields in the PostgreSQL database setup screen of the Configuration Setup Utility.

--- Source/Tools/ConfigurationSetupUtility/Screens/PostgresDatabaseSetupScreen.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/Screens/PostgresDatabaseSetupScreen.xaml.cs
@@ -149,6 +149,48 @@
                     return false;
                 }

+                if (string.IsNullOrEmpty(m_portTextBox.Text))
+                {
+                    MessageBox.Show("Please enter a valid name for the port number (default: 5432).");
+                    m_portTextBox.Focus();
+                    return false;
+                }
+
+                if (string.IsNullOrEmpty(m_databaseTextBox.Text))
+                {
+                    MessageBox.Show("Please enter a valid name for the database name.");
+                    m_databaseTextBox.Focus();
+                    return false;
+                }
+
+                if (string.IsNullOrEmpty(m_adminUserNameTextBox.Text))
+                {
+                    MessageBox.Show("Please enter a valid name for the admin user.");
+                    m_adminUserNameTextBox.Focus();
+                    return false;
+                }
+
+                if (m_adminPasswordTextBox.SecurePassword.Length == 0)
+                {
+                    MessageBox.Show("Please enter a valid password for the admin user.");
+                    m_adminPasswordTextBox.Focus();
+                    return false;
+                }
+
+                if (string.IsNullOrEmpty(m_roleNameTextBox.Text))
+                {
+                    MessageBox.Show("Please enter a valid name for the role to grant permissions to.");
+                    m_roleNameTextBox.Focus();
+                    return false;
+                }
+
+                if (m_rolePasswordTextBox.SecurePassword.Length == 0)
+                {
+                    MessageBox.Show("Please enter a valid password for the role to grant permissions to.");
+                    m_rolePasswordTextBox.Focus();
+                    return false;
+                }
+
                 bool existing = Convert.ToBoolean(m_state["existing"]);
                 bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]);


Delete OxfordAPIHelper.cs

Delete OxfordAPIHelper.cs

--- Lab-Projects/IoTLab.Common/Helpers/OxfordAPIHelper.cs
+++ Lab-Projects/IoTLab.Common/Helpers/OxfordAPIHelper.cs
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using IoTLab.Common.Constants;
-using Microsoft.ProjectOxford.Emotion;
-using Microsoft.ProjectOxford.Emotion.Contract;
-using Microsoft.ProjectOxford.Face;
-using Microsoft.ProjectOxford.Face.Contract;
-
-namespace IoTLab.Common.Helpers
-{
-    /// <summary>
-    /// Allows easy access to oxford functions such as adding a visitor to whitelist and checing to see if a visitor is on the whitelist
-    /// </summary>
-    internal static class OxfordAPIHelper
-    {
-        // The Oxford Emotion API client
-        private static readonly EmotionServiceClient emotionApiClient = new EmotionServiceClient(GeneralConstants.OxfordEmotionAPIKey);
-
-        // The Oxford Face API client
-        private static readonly IFaceServiceClient faceApiClient = new FaceServiceClient(GeneralConstants.OxfordFaceAPIKey);
-
-        public static async Task<bool> DetectFaces(Stream ImageStream)
-        {
-            // Set up the facial attributes we want returned
-            var requiredFaceAttributes = new FaceAttributeType[]
-            {
-                FaceAttributeType.Age,
-                FaceAttributeType.Gender
-            };
-
-            // Convert the inbound stream to a bitmap so we can slice off faces later for the emotion API
-
-            // Process the inbound image via the Face API
-            var faces = await faceApiClient.DetectAsync(ImageStream, returnFaceLandmarks: true, returnFaceAttributes: requiredFaceAttributes);
-            if (!faces.Any())
-            {
-                return false;
-            }
-
-            // Now process via the Emotion API
-            var emotions = await emotionApiClient.RecognizeAsync(ImageStream);
-            foreach (Emotion emotion in emotions)
-            {
-            }
-
-            // We have faces, so process the return values
-            foreach (Face face in faces)
-            {
-            }
-
-            // And return the result
-            return true;
-        }
-    }
-}


Log more info

Log more info

--- LocationLib/ForeignAccess/Spot/SpotLocationRequest.cs
+++ LocationLib/ForeignAccess/Spot/SpotLocationRequest.cs
@@ -311,13 +311,22 @@
       {
         if ( result.Error != null ) // should never happen because here TrackerState is after succ.request, but let's check
         {
+          string trackStat;
+          if ( mergedTrack == null )
+            trackStat = "null";
+          else if ( mergedTrack.Length == 0 )
+            trackStat = "none";
+          else
+            trackStat = string.Format( "{0} ## {1} ## {2}", mergedTrack.Length, mergedTrack.First( ), mergedTrack.Last( ) );
+
           Log.ErrorFormat(
-            "result.Error != null: {0} \\ {1}\r\nPage={2}\r\nprevTrackExisted={3}\r\nId2={4}",
+            "result.Error != null: {0} \\ {1}\r\nPage={2}\r\nprevTrackExisted={3}\r\nId2={4}\r\ntrack={5}",
             Id,
             result,
             this.currentRequest.Page,
             prevTrackExisted ,
-            this.currentRequest.TrackerForeignId
+            this.currentRequest.TrackerForeignId,
+            trackStat
           );
         }


Added Mime_Type property to MetaData model

--- DropNet/Models/MetaData.cs
+++ DropNet/Models/MetaData.cs
@@ -19,6 +19,7 @@
         public int Revision { get; set; }
 		public string Rev { get; set; }
         public List<MetaData> Contents { get; set; }
+        public String Mime_Type { get; set; }

         public DateTime ModifiedDate
         {


Corrected bugfix

Corrected bugfix

--- EEPhysics/PhysicsPlayer.cs
+++ EEPhysics/PhysicsPlayer.cs
@@ -406,7 +406,7 @@
                 speedX = (speedX * PhysicsConfig.BaseDrag);
                 if (currentBelow != 216 && !isGodMode)
                 {
-                    if ((mx == 0 && mox != 0) || (speedX < 0 && mx > 0) || (speedX > 0 && mx < 0) || ItemId.isClimbable(current))
+                    if ((mx == 0 && moy != 0) || (speedX < 0 && mx > 0) || (speedX > 0 && mx < 0) || ItemId.isClimbable(current))
                     {
                         speedX = (speedX * PhysicsConfig.NoModifierDrag);
                     }
@@ -443,7 +443,7 @@
                 speedY = (speedY * PhysicsConfig.BaseDrag);
                 if (currentBelow != 216 && !isGodMode)
                 {
-                    if ((my == 0 && moy != 0) || (speedY < 0 && my > 0) || (speedY > 0 && my < 0) || ItemId.isClimbable(current))
+                    if ((my == 0 && mox != 0) || (speedY < 0 && my > 0) || (speedY > 0 && my < 0) || ItemId.isClimbable(current))
                     {
                         speedY = (speedY * PhysicsConfig.NoModifierDrag);
                     }


Fix for scrollview on uwp

Fix for scrollview on uwp

--- MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs
+++ MediaManager.Forms/Platforms/Uap/VideoViewRenderer.cs
@@ -10,6 +10,7 @@
     public class VideoViewRenderer : ViewRenderer<VideoView, MediaManager.Platforms.Uap.Video.VideoView>
     {
         private MediaManager.Platforms.Uap.Video.VideoView _videoView;
+        private static IMediaManager MediaManager => CrossMediaManager.Windows;

         protected override void OnElementChanged(ElementChangedEventArgs<VideoView> args)
         {
@@ -33,10 +34,18 @@
         {
             if (_videoView != null)
             {
-                _videoView.Height = availableSize.Height;
+                if(!double.IsInfinity(availableSize.Height))
+                {
+                    _videoView.Height = availableSize.Height;
+                    _videoView.PlayerView.Height = availableSize.Height;
+                }
+                else
+                {
+                    _videoView.Height = MediaManager.MediaPlayer.VideoHeight > 0 ? MediaManager.MediaPlayer.VideoHeight : 300;
+                    _videoView.PlayerView.Height = MediaManager.MediaPlayer.VideoHeight > 0 ? MediaManager.MediaPlayer.VideoHeight : 300;
+                }
+
                 _videoView.Width = availableSize.Width;
-
-                _videoView.PlayerView.Height = availableSize.Height;
                 _videoView.PlayerView.Width = availableSize.Width;
             }
             try


Fixed parameters check

Fixed parameters check

--- src/KProjectConverter/Options.cs
+++ src/KProjectConverter/Options.cs
@@ -20,7 +20,7 @@
                 return;
             }

-            if(args.Length > 1)
+            if(args.Length == 0)
             {
                 throw new Exception("First command line arg must be the path to process.");
             }


Remove incompatibility warning with DynamicBatteryStorage. (#561)

* Remove incompatibility warning with DynamicBatteryStorage.

--- src/Kerbalism/System/Settings.cs
+++ src/Kerbalism/System/Settings.cs
@@ -17,7 +17,7 @@

     public static class Settings
     {
-		private static string MODS_INCOMPATIBLE = "TacLifeSupport,Snacks,BackgroundResources,BackgroundProcessing,DynamicBatteryStorage,KolonyTools,USILifeSupport";
+		private static string MODS_INCOMPATIBLE = "TacLifeSupport,Snacks,BackgroundResources,BackgroundProcessing,KolonyTools,USILifeSupport";
 		private static string MODS_WARNING = "RemoteTech,ResearchBodies";
 		private static string MODS_SCIENCE = "KEI,[x] Science!";


Fix issue #70 - add DecimalConstantAttribute to allow c# compiler to generate IL needed for const decimals

--- src/Libraries/CoreLib/Runtime.cs
+++ src/Libraries/CoreLib/Runtime.cs
@@ -558,6 +558,26 @@
         public CompilerGeneratedAttribute() {
         }
     }
+
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field, Inherited = false)]
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    [NonScriptable]
+    [Imported]
+    public sealed class DecimalConstantAttribute : Attribute {
+
+        public DecimalConstantAttribute(byte scale, byte sign, int hi, int mid, int low) {
+        }
+
+        [CLSCompliant(false)]
+        public DecimalConstantAttribute(byte scale, byte sign, uint hi, uint mid, uint low) {
+        }
+
+        public decimal Value {
+            get {
+                return 0m;
+            }
+        }
+    }
 }

 namespace System.Runtime.InteropServices {


Scroll Style changed

Scroll Style changed

--- Monotouch/RisksApp/RisksApp/RisksAppViewController.cs
+++ Monotouch/RisksApp/RisksApp/RisksAppViewController.cs
@@ -8,9 +8,11 @@
 {
 	public partial class RisksAppViewController : UIPageViewController
 	{
-		public RisksAppViewController () : base ("RisksAppViewController", null)
+        public RisksAppViewController () : base (UIPageViewControllerTransitionStyle.Scroll,
+            UIPageViewControllerNavigationOrientation.Horizontal)
 		{
 		}
+

 		public override void DidReceiveMemoryWarning ()
 		{
@@ -27,10 +29,6 @@
 			var pageDataSource = new NavigationPageDataSource ();
 			DataSource = pageDataSource;
 			SetViewControllers (new UIViewController[] { pageDataSource.controllers [0] }, UIPageViewControllerNavigationDirection.Forward, true, (e) => {});
-
-			//UIPageViewControllerTransitionStyle = UIPageViewControllerTransitionStyle.Scroll;
-
-
 		}

 		partial void ShowDirectory () {


Remove AirTime Productions from the component menu

--- Editor/ComponentCreator.cs
+++ Editor/ComponentCreator.cs
@@ -15,45 +15,45 @@

     public static class ComponentCreator {

-        [MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimationPathAnimator")]
+        [MenuItem("Component/AnimationPath Animator/AnimationPathAnimator")]
         private static void AddAnimationPathAnimatorComponent() {
             if (Selection.activeGameObject != null) {
                 Selection.activeGameObject.AddComponent(typeof(AnimationPathAnimator));
             }
         }

-        [MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimatorEvents")]
+        [MenuItem("Component/AnimationPath Animator/AnimatorEvents")]
         private static void AddAnimatorEventsComponent() {
             if (Selection.activeGameObject != null) {
                 Selection.activeGameObject.AddComponent(typeof(AnimatorEvents));
             }
         }

-        [MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimatorSynchronizer")]
+        [MenuItem("Component/AnimationPath Animator/AnimatorSynchronizer")]
         private static void AddAnimatorSynchronizerComponent() {
             if (Selection.activeGameObject != null) {
                 Selection.activeGameObject.AddComponent(typeof(AnimatorSynchronizer));
             }
         }

-        [MenuItem("Component/AirTime Productions/AnimationPath Animator/AudioSynchronizer")]
+        [MenuItem("Component/AnimationPath Animator/AudioSynchronizer")]
         private static void AddAudioSynchronizerComponent() {
             if (Selection.activeGameObject != null) {
                 Selection.activeGameObject.AddComponent(typeof(AudioSynchronizer));
             }
         }

-        [MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/Animator Settings")]
+        [MenuItem("Assets/Create/AnimationPath Animator/Animator Settings")]
         private static void CreateAnimatorSettingsAsset() {
             ScriptableObjectUtility.CreateAsset<AnimatorSettings>("AnimatorSettings");
         }

-        [MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/AnimatorEvents Settings")]
+        [MenuItem("Assets/Create/AnimationPath Animator/AnimatorEvents Settings")]
         private static void CreateAPEventsReflectionSettingsAsset() {
             ScriptableObjectUtility.CreateAsset<AnimatorEventsSettings>("AnimatorEventsSettings");
         }

-        [MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/Animation Path")]
+        [MenuItem("Assets/Create/AnimationPath Animator/Animation Path")]
         private static void CreatePathAsset() {
             ScriptableObjectUtility.CreateAsset<PathData>("AnimationPath");
         }


.rar should no longer error out if user has managed roles. closes #274

--- NadekoBot.Core/Modules/Administration/RoleCommands.cs
+++ NadekoBot.Core/Modules/Administration/RoleCommands.cs
@@ -243,7 +243,10 @@
             {
                 var guser = (IGuildUser)ctx.User;

-                var userRoles = user.GetRoles().Except(new[] { guser.Guild.EveryoneRole });
+                var userRoles = user.GetRoles()
+                    .Where(x => !x.IsManaged && x != x.Guild.EveryoneRole)
+                    .ToList();
+
                 if (user.Id == ctx.Guild.OwnerId || (ctx.User.Id != ctx.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= userRoles.Max(x => x.Position)))
                     return;
                 try


Prevents security removal from portfolio when delisted

Removing delisted securities from portfolio causes loss of information that is necessary to compute the algorithm statistics.

--- Engine/AlgorithmManager.cs
+++ Engine/AlgorithmManager.cs
@@ -331,20 +331,6 @@
                 // process fill models on the updated data before entering algorithm, applies to all non-market orders
                 transactions.ProcessSynchronousEvents();

-                if (delistingTickets.Count != 0)
-                {
-                    for (int i = 0; i < delistingTickets.Count; i++)
-                    {
-                        var ticket = delistingTickets[i];
-                        if (ticket.Status == OrderStatus.Filled)
-                        {
-                            algorithm.Securities.Remove(ticket.Symbol);
-                            delistingTickets.RemoveAt(i--);
-                            Log.Trace("AlgorithmManager.Run(): Delisted Security removed: " + ticket.Symbol.ToString());
-                        }
-                    }
-                }
-
                 //Check if the user's signalled Quit: loop over data until day changes.
                 if (algorithm.Status == AlgorithmStatus.Stopped)
                 {


Empêche l'utilisateur d'appuyer plusieurs fois sur la touche espace dans le même tour

--- Enigmas/ClouEnigmaPanel.cs
+++ Enigmas/ClouEnigmaPanel.cs
@@ -1,5 +1,7 @@
 using Cpln.Enigmos.Enigmas.Components.Clou;
+using System;
 using System.Drawing;
+using System.Threading.Tasks;
 using System.Windows.Forms;

 namespace Cpln.Enigmos.Enigmas
@@ -18,6 +20,7 @@
         private Player player = new Player();

         private int round = 1;
+        private bool isKeyDown;

         /// <summary>
         /// Constructeur: ajout des contrôles sur l'affichage
@@ -111,6 +114,7 @@
                 UpdateStatusLabel();
                 bar.StartCursor();
                 nail.ResetPosition();
+                isKeyDown = false;

                 return true;
             }
@@ -123,10 +127,12 @@
         /// <summary>
         /// Frappe le clou quand la touche espace est enfoncée, c'est ici que les manches se calculent.
         /// </summary>
-        public override void PressKey(object sender, KeyEventArgs e)
+        public override async void PressKey(object sender, KeyEventArgs e)
         {
-            if (e.KeyCode == Keys.Space)
+            if (e.KeyCode == Keys.Space && !isKeyDown)
             {
+                isKeyDown = true;
+
                 #region Tour joueur
                 //Ramène l'image de la table devant le clou.
                 table.BringToFront();
@@ -148,11 +154,8 @@
                 //Update l'UI
                 UpdateStatusLabel();

-                //Force l'interface à se refresh avant que l'IA réfléchisse.
-                Application.DoEvents();
-
                 //Simule le temps de réflexion de l'IA
-                System.Threading.Thread.Sleep(2000);
+                await Task.Delay(2000);

                 //L'IA frappe le clou
                 ia.Blow(nail, ia.CalculateBlowPower(nail, player));
@@ -171,6 +174,8 @@
                 //Relance le curseur sur la barre d'énergie
                 bar.StartCursor();
                 #endregion
+
+                isKeyDown = false;
             }
         }

@@ -182,6 +187,7 @@
             ia.WinnedRound = 0;
             player.WinnedRound = 0;
             round = 1;
+            isKeyDown = false;
             UpdateStatusLabel();
             bar.StartCursor();
             nail.ResetPosition();


some more japanese kanjis

some more japanese kanjis


* Fixes CAPS InventoryDescendants and the notorious 'LLSDParseException:expected </llsd>' error. * Objects folder still exhibits strange behavior.

--- OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -197,16 +197,53 @@

         public string FetchInventoryRequest(string request, string path, string param)
         {
-            request = request.Replace("<llsd><map><key>folders</key><array>", "<llsd>");
-            request = request.Replace("\n", "");
-            request = request.Replace("</map></array></map>", "</map>");
-
-            //Console.WriteLine("inventory request " + request);
-            Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request));
-            LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
-            LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
-            LLSDInventoryDescendents reply = FetchInventory(llsdRequest);
-            string response = LLSDHelpers.SerialiseLLSDReply(reply);
+            string unmodifiedRequest = request.ToString();
+
+
+            Hashtable hash = new Hashtable();
+            try
+            {
+
+                hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request));
+            }
+            catch (LLSD.LLSDParseException pe)
+            {
+                m_log.Error("[INVENTORY]: Fetch error: " + pe.Message);
+                m_log.Error("Request:" + request.ToString());
+                m_log.Error("OriginalRequest:" + unmodifiedRequest.ToString());
+            }
+            //LLSDArray llsdFolderRequest = LLSDHelpers.
+            ArrayList foldersrequested = (ArrayList)hash["folders"];
+
+            string response = "";
+
+            for (int i = 0; i < foldersrequested.Count; i++)
+            {
+                string inventoryitemstr = "";
+                Hashtable inventoryhash = (Hashtable)foldersrequested[i];
+
+                LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
+                LLSDHelpers.DeserialiseLLSDMap(inventoryhash, llsdRequest);
+                LLSDInventoryDescendents reply = FetchInventory(llsdRequest);
+
+                inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
+                inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", "");
+                inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", "");
+                response += inventoryitemstr;
+            }
+            if (response.Length == 0)
+            {
+                // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
+                // Therefore, I'm concluding that the client only has so many threads available to do requests
+                // and when a thread stalls..   is stays stalled.
+                // Therefore we need to return something valid
+                response = "<llsd><map><key>folders</key><array /></map></llsd>";
+            }
+            else
+            {
+                response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>";
+            }
+
             return response;
         }


1281:

--- a_mini/projects/PixelFarm/MiniAgg/04_Scanline/5_ScanlineRasToDestBitmapRenderer.cs
+++ a_mini/projects/PixelFarm/MiniAgg/04_Scanline/5_ScanlineRasToDestBitmapRenderer.cs
@@ -79,7 +79,7 @@
             //1. ensure single line buffer width
             _grayScaleLine.EnsureLineStride(dest.Width + 4);
             //2. setup vars
-            _currentLcdLut = s_g4_1_3LcdLut;
+            _currentLcdLut = s_g4_1_2LcdLut;// s_g4_1_3LcdLut;
             byte[] dest_buffer = dest.GetBuffer();
             int dest_w = dest.Width;
             int dest_h = dest.Height;


Refactored ResponseStream.cs

Refactored ResponseStream.cs

--- websocket-sharp/Net/ResponseStream.cs
+++ websocket-sharp/Net/ResponseStream.cs
@@ -51,10 +51,12 @@
   {
     #region Private Fields

+    private MemoryStream           _buffer;
     private static readonly byte[] _crlf = new byte[] { 13, 10 };
     private bool                   _disposed;
-    private bool                   _ignoreErrors;
+    private bool                   _ignoreWriteExceptions;
     private HttpListenerResponse   _response;
+    private long                   _start;
     private Stream                 _stream;
     private bool                   _trailerSent;

@@ -62,11 +64,12 @@

     #region Internal Constructors

-    internal ResponseStream (Stream stream, HttpListenerResponse response, bool ignoreErrors)
+    internal ResponseStream (
+      Stream stream, HttpListenerResponse response, bool ignoreWriteExceptions)
     {
       _stream = stream;
       _response = response;
-      _ignoreErrors = ignoreErrors;
+      _ignoreWriteExceptions = ignoreWriteExceptions;
     }

     #endregion
@@ -87,7 +90,7 @@

     public override bool CanWrite {
       get {
-        return true;
+        return !_disposed;
       }
     }

@@ -127,29 +130,61 @@
           "The sum of 'offset' and 'count' is greater than 'buffer' length.");
     }

+    private MemoryStream getBuffer (bool closing)
+    {
+      if (_buffer != null)
+        return _buffer;
+
+      _buffer = new MemoryStream ();
+      _response.SendHeaders (_buffer, closing);
+      _start = _buffer.Position;
+      _buffer.Position = _buffer.Length;
+
+      return _buffer;
+    }
+
     private static byte[] getChunkSizeBytes (int size, bool final)
     {
       return Encoding.ASCII.GetBytes (String.Format ("{0:x}\r\n{1}", size, final ? "\r\n" : ""));
     }

-    private MemoryStream getHeaders (bool closing)
-    {
-      if (_response.HeadersSent)
-        return null;
-
-      var stream = new MemoryStream ();
-      _response.SendHeaders (stream, closing);
-
-      return stream;
-    }
-
     #endregion

     #region Internal Methods

+    internal void Close (bool force)
+    {
+      if (_disposed)
+        return;
+
+      _disposed = true;
+      if (!force) {
+        var buff = getBuffer (true);
+        if (_response.SendChunked && !_trailerSent) {
+          var size = getChunkSizeBytes (0, true);
+          buff.Write (size, 0, size.Length);
+          _trailerSent = true;
+        }
+
+        InternalWrite (buff.GetBuffer (), (int) _start, (int) (buff.Position - _start));
+        _response.Close ();
+      }
+      else {
+        _response.Abort ();
+      }
+
+      if (_buffer != null) {
+        _buffer.Dispose ();
+        _buffer = null;
+      }
+
+      _response = null;
+      _stream = null;
+    }
+
     internal void InternalWrite (byte[] buffer, int offset, int count)
     {
-      if (_ignoreErrors) {
+      if (_ignoreWriteExceptions) {
         try {
           _stream.Write (buffer, offset, count);
         }
@@ -181,61 +216,23 @@
       if (count == 0)
         return null;

-      var headers = getHeaders (false);
-      var chunked = _response.SendChunked;
-      if (headers != null) {
-        using (headers) {
-          var start = headers.Position;
-          headers.Position = headers.Length;
-          if (chunked) {
-            var size = getChunkSizeBytes (count, false);
-            headers.Write (size, 0, size.Length);
-          }
-
-          headers.Write (buffer, offset, count);
-          buffer = headers.GetBuffer ();
-          offset = (int) start;
-          count = (int) (headers.Position - start);
-        }
-      }
-      else if (chunked) {
+      var buff = getBuffer (false);
+      if (_response.SendChunked) {
         var size = getChunkSizeBytes (count, false);
-        InternalWrite (size, 0, size.Length);
-      }
-
-      return _stream.BeginWrite (buffer, offset, count, callback, state);
+        buff.Write (size, 0, size.Length);
+      }
+
+      return buff.BeginWrite (buffer, offset, count, callback, state);
     }

     public override void Close ()
     {
-      if (_disposed)
-        return;
-
-      _disposed = true;
-
-      var headers = getHeaders (true);
-      var chunked = _response.SendChunked;
-      if (headers != null) {
-        using (headers) {
-          var start = headers.Position;
-          headers.Position = headers.Length;
-          if (chunked && !_trailerSent) {
-            var size = getChunkSizeBytes (0, true);
-            headers.Write (size, 0, size.Length);
-          }
-
-          InternalWrite (headers.GetBuffer (), (int) start, (int) (headers.Position - start));
-        }
-
-        _trailerSent = true;
-      }
-      else if (chunked && !_trailerSent) {
-        var size = getChunkSizeBytes (0, true);
-        InternalWrite (size, 0, size.Length);
-        _trailerSent = true;
-      }
-
-      _response.Close ();
+      Close (false);
+    }
+
+    protected override void Dispose (bool disposing)
+    {
+      Close (!disposing);
     }

     public override int EndRead (IAsyncResult asyncResult)
@@ -248,25 +245,16 @@
       if (_disposed)
         throw new ObjectDisposedException (GetType ().ToString ());

+      if (_buffer == null)
+        throw new InvalidOperationException ("The BeginWrite method hasn't been done.");
+
       if (asyncResult == null)
         throw new ArgumentNullException ("asyncResult");

-      Action<IAsyncResult> endWrite = ares => {
-        _stream.EndWrite (ares);
-        if (_response.SendChunked)
-          _stream.Write (_crlf, 0, 2);
-      };
-
-      if (_ignoreErrors) {
-        try {
-          endWrite (asyncResult);
-        }
-        catch {
-        }
-      }
-      else {
-        endWrite (asyncResult);
-      }
+      var buff = getBuffer (false);
+      buff.EndWrite (asyncResult);
+      if (_response.SendChunked)
+        buff.Write (_crlf, 0, 2);
     }

     public override void Flush ()
@@ -297,32 +285,16 @@
       if (count == 0)
         return;

-      var headers = getHeaders (false);
+      var buff = getBuffer (false);
       var chunked = _response.SendChunked;
-      if (headers != null) {
-        // After the possible preamble for the encoding.
-        using (headers) {
-          var start = headers.Position;
-          headers.Position = headers.Length;
-          if (chunked) {
-            var size = getChunkSizeBytes (count, false);
-            headers.Write (size, 0, size.Length);
-          }
-
-          headers.Write (buffer, offset, count);
-          buffer = headers.GetBuffer ();
-          offset = (int) start;
-          count = (int) (headers.Position - start);
-        }
-      }
-      else if (chunked) {
+      if (chunked) {
         var size = getChunkSizeBytes (count, false);
-        InternalWrite (size, 0, size.Length);
-      }
-
-      InternalWrite (buffer, offset, count);
+        buff.Write (size, 0, size.Length);
+      }
+
+      buff.Write (buffer, offset, count);
       if (chunked)
-        InternalWrite (_crlf, 0, 2);
+        buff.Write (_crlf, 0, 2);
     }

     #endregion


calculation improvements

calculation improvements

--- ParticleSwarmOptimization/CocoSingleCpuApp/Program.cs
+++ ParticleSwarmOptimization/CocoSingleCpuApp/Program.cs
@@ -14,16 +14,23 @@
     class Program
     {

-        public const int BUDGET_MULTIPLIER = 1000;
+        public const int BUDGET_MULTIPLIER = 100000;
         public const int INDEPENDENT_RESTARTS = 10000;
         public const int RANDOM_SEED = 12;
         public static Problem PROBLEM;
         static void Main(string[] args)
         {
+            Console.WriteLine("Podaj liczbe wymiarow do przeprowadzenia obliczen (jesli wiecej niz jeden oddziel przecinkiem): ");
+            string dims = Console.ReadLine().Trim();
+            Console.WriteLine("Podaj zakres funkcji do obliczen: ");
+            Console.Write("Od: ");
+            var functionsFrom = int.Parse(Console.ReadLine());
+            Console.Write("Do: ");
+            var functionsTo = int.Parse(Console.ReadLine());
             RandomGenerator randomGenerator = RandomGenerator.GetInstance(RANDOM_SEED);
             CocoLibraryWrapper.cocoSetLogLevel("info");
             var functionsToOptimize = new List<string>();
-            for(var i = 1; i <= 24; i++){
+            for(var i = functionsFrom; i <= functionsTo; i++){
                 functionsToOptimize.Add(String.Format("f{0:D3}",i));
             }
             Console.WriteLine("Running the example experiment... (might take time, be patient)");
@@ -37,7 +44,7 @@
                         + " algorithm_name: PSO"
                         + " algorithm_info: \"A simple Random search algorithm\"";
                 /* Initialize the suite and observer */
-                Suite suite = new Suite("bbob", "year: 2016", "dimensions: 2,3");
+                Suite suite = new Suite("bbob", "year: 2016", "dimensions: "+dims);
                 Observer observer = new Observer("bbob", observerOptions);
                 Benchmark benchmark = new Benchmark(suite, observer);
                 /* Iterate over all problems in the suite */


Updated LineChart example

Updated LineChart example

correctly call some methods for Axes manipulation

--- examples/xssf/LineChart/Program.cs
+++ examples/xssf/LineChart/Program.cs
@@ -17,8 +17,6 @@

           static void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, string serie1, string serie2)
         {
-
-
             IChart chart = drawing.CreateChart(anchor);
             IChartLegend legend = chart.GetOrCreateLegend();
             legend.Position = LegendPosition.TopRight;
@@ -26,14 +24,13 @@
             ILineChartData<double, double> data = chart.ChartDataFactory.CreateLineChartData<double, double>();

             // Use a category axis for the bottom axis.
-            IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
-            IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
-            leftAxis.Crosses = AxisCrosses.AutoZero;
+            IChartAxis bottomAxis = p10Chart.GetChartAxisFactory().CreateCategoryAxis(AxisPosition.Bottom);
+            IValueAxis leftAxis = p10Chart.GetChartAxisFactory().CreateValueAxis(AxisPosition.Left);
+            leftAxis.SetCrosses(AxisCrosses.AutoZero);

             IChartDataSource<double> xs = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
             IChartDataSource<double> ys1 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1));
             IChartDataSource<double> ys2 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));
-

             var s1 = data.AddSeries(xs, ys1);
             s1.SetTitle(serie1);


Added bass.net registration code

Added bass.net registration code

--- ShockLog/Logger.cs
+++ ShockLog/Logger.cs
@@ -79,7 +79,7 @@
         {
             // Registration code for Bass.Net
             // Provided value should be used only for ShockLog, not derived products
-            //BassNet.Registration("your mail", "your registration key");
+            BassNet.Registration("orry@orryverducci.co.uk", "2X24373423243720");
             // Set dll locations
             if (IntPtr.Size == 8) // If running in 64 bit
             {


Fix: HKCAZ camt052 account informations

Fix: HKCAZ camt052 account informations

--- libfintx/Segments/HKCAZ.cs
+++ libfintx/Segments/HKCAZ.cs
@@ -41,22 +41,22 @@
             {
                 if (String.IsNullOrEmpty(Startpoint))
                 {
-                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":::280:+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N'";
+                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N'";
                 }
                 else
                 {
-                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":::280:+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N++++" + Startpoint + "'";
+                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N++++" + Startpoint + "'";
                 }
             }
             else
             {
                 if (String.IsNullOrEmpty(Startpoint))
                 {
-                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":::280:+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N+" + FromDate + "+" + ToDate + "'";
+                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N+" + FromDate + "+" + ToDate + "'";
                 }
                 else
                 {
-                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":::280:+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N+" + FromDate + "+" + ToDate + "++" + Startpoint + "'";
+                    segments = "HKCAZ:" + SEGNUM.SETVal(3) + ":" + Segment.HKCAZ + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + ":" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+N+" + FromDate + "+" + ToDate + "++" + Startpoint + "'";
                 }
             }