reduce the number of conditional compilation sections

--- JsonSubTypes/JsonSubtypes.cs
+++ JsonSubTypes/JsonSubtypes.cs
@@ -2,9 +2,13 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
-using System.Reflection;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
+#if (NET35 || NET40)
+using TypeInfo = System.Type;
+#else
+using System.Reflection;
+#endif

 namespace JsonSubTypes
 {
@@ -158,7 +162,8 @@

         private static IList CreateCompatibleList(Type targetContainerType, Type elementType)
         {
-            if (targetContainerType.IsArray || IsAbstract(targetContainerType))
+            var typeInfo = GetTypeInfo(targetContainerType);
+            if (typeInfo.IsArray || typeInfo.IsAbstract)
             {
                 return (IList) Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType));
             }
@@ -213,7 +218,8 @@
         {
             var knownSubTypeAttributes = GetAttributes<KnownSubTypeWithPropertyAttribute>(parentType);

-            return knownSubTypeAttributes.Select(knownType =>
+            return knownSubTypeAttributes
+                .Select(knownType =>
                 {
                     JToken ignore;
                     if (jObject.TryGetValue(knownType.PropertyName, out ignore))
@@ -245,7 +251,7 @@
             if (typeName == null)
                 return null;

-            var insideAssembly = GetAssembly(parentType);
+            var insideAssembly = GetTypeInfo(parentType).Assembly;

             var typeByName = insideAssembly.GetType(typeName);
             if (typeByName != null)
@@ -286,44 +292,29 @@
             }
         }

-        private static bool IsAbstract(Type type)
+        private static IEnumerable<T> GetAttributes<T>(Type type) where T : Attribute
+        {
+            return GetTypeInfo(type)
+                .GetCustomAttributes(false)
+                .OfType<T>();
+        }
+        private static IEnumerable<Type> GetGenericTypeArguments(Type type)
         {
 #if (NET35 || NET40)
-            var isAbstract = type.IsAbstract;
+            var genericTypeArguments = type.GetGenericArguments();
 #else
-            var isAbstract = type.GetTypeInfo().IsAbstract;
-#endif
-            return isAbstract;
-        }
-
-        private static IEnumerable<Type> GetGenericTypeArguments(Type arrayOrGenericContainer)
-        {
-#if (NET35 || NET40)
-            var genericTypeArguments = arrayOrGenericContainer.GetGenericArguments();
-#else
-            var genericTypeArguments = arrayOrGenericContainer.GenericTypeArguments;
+            var genericTypeArguments = type.GenericTypeArguments;
 #endif
             return genericTypeArguments;
         }

-        private static Assembly GetAssembly(Type type)
+        private static TypeInfo GetTypeInfo(Type type)
         {
 #if (NET35 || NET40)
-            var insideAssembly = type.Assembly;
+            return type;
 #else
-            var insideAssembly = type.GetTypeInfo().Assembly;
+            return type.GetTypeInfo();
 #endif
-            return insideAssembly;
-        }
-
-        private static IEnumerable<T> GetAttributes<T>(Type type)
-        {
-#if (NET35 || NET40)
-            var knownSubTypeAttributes = type.GetCustomAttributes(false).OfType<T>();
-#else
-            var knownSubTypeAttributes = type.GetTypeInfo().GetCustomAttributes<T>();
-#endif
-            return knownSubTypeAttributes;
         }
     }
 }


Update ScaleTo on TweenUtil.

Update ScaleTo on TweenUtil.


Minor Changes 20161011

Minor Changes 20161011

--- Source/VissimSimulator/CellularTowerEvent.cs
+++ Source/VissimSimulator/CellularTowerEvent.cs
@@ -11,7 +11,6 @@
         #region public properties
         public string LocationId { set; get; }
         public string CellularTowerId { set; get; }
-
         public Event Event { get; private set; }
         #endregion //public properties


Added better error handling

Added better error handling

--- PoGo.PokeMobBot.Logic/Tasks/SnipePokemonTask.cs
+++ PoGo.PokeMobBot.Logic/Tasks/SnipePokemonTask.cs
@@ -353,7 +353,6 @@
             var uri =
                 $"http://skiplagged.com/api/pokemon.php?bounds={boundLowerLeftLat.ToString(formatter)},{boundLowerLeftLng.ToString(formatter)},{boundUpperRightLat.ToString(formatter)},{boundUpperRightLng.ToString(formatter)}";

-            session.EventDispatcher.Send(new ErrorEvent { Message = uri });
             ScanResult scanResult;
             try
             {
@@ -369,15 +368,48 @@

                 scanResult = JsonConvert.DeserializeObject<ScanResult>(fullresp);
             }
-            catch (Exception ex)
-            {
-                // most likely System.IO.IOException
-                session.EventDispatcher.Send(new ErrorEvent { Message = ex.ToString() });
-                scanResult = new ScanResult
-                {
-                    Status = "fail",
-                    Pokemon = new List<PokemonLocation>()
-                };
+            catch (WebException ex)
+            {
+                if (ex.Status == WebExceptionStatus.ProtocolError &&
+                    ex.Response != null)
+                {
+                    var resp = (HttpWebResponse)ex.Response;
+                    if (resp.StatusCode == HttpStatusCode.NotFound)
+                    {
+                        session.EventDispatcher.Send(new WarnEvent
+                        {
+                            Message = "404 Not Found: Not able to retrieve file from server!"
+                        });
+                    }
+                    else if (resp.StatusCode == HttpStatusCode.GatewayTimeout)
+                    {
+                        session.EventDispatcher.Send(new WarnEvent
+                        {
+                            Message = "504 Gateway Time-out: The server didn't respond in time."
+                        });
+                    }
+                    else
+                    {
+                        session.EventDispatcher.Send(new ErrorEvent
+                        {
+                            Message = ex.ToString()
+                        });
+                    }
+
+                    scanResult = new ScanResult
+                    {
+                        Status = "fail",
+                        Pokemon = new List<PokemonLocation>()
+                    };
+                }
+                else
+                {
+                    scanResult = new ScanResult
+                    {
+                        Status = "fail",
+                        Pokemon = new List<PokemonLocation>()
+                    };
+                }
             }
             return scanResult;
         }


Small change to GL canvas panning

Small change to GL canvas panning

Changed to panning on movement of mouse rather than only on release of
the mouse button. I left the code commented so it can be changed back
easily if whoever's working on it doesn't like it.

--- Pulsar4X/Pulsar4X.WinForms/Controls/GLCanvas.cs
+++ Pulsar4X/Pulsar4X.WinForms/Controls/GLCanvas.cs
@@ -90,8 +90,9 @@
             Resize += new System.EventHandler(this.OnResize);                       // Setep Resize Event Handler
             Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);      // Setep Paint Event Handler
             SizeChanged += new System.EventHandler(this.OnSizeChange);
+            MouseMove += new MouseEventHandler(OnMouseMove);
             MouseDown += new MouseEventHandler(OnMouseDown);
-            MouseUp += new MouseEventHandler(OnMouseUp);
+            //MouseUp += new MouseEventHandler(OnMouseUp);
             //Application.Idle += Application_Idle;
         }

@@ -126,37 +127,58 @@
             this.Invalidate();                                       // Force redraw.
         }

-        private void OnMouseDown(object sender, MouseEventArgs e)
-        {
-            // An left mouse down, start pan.
-            if (e.Button.Equals(System.Windows.Forms.MouseButtons.Left))
-            {
-                m_v3PanStartLocation.X = e.Location.X;
-                m_v3PanStartLocation.Y = e.Location.Y;
-                m_v3PanStartLocation.Z = 0.0f;
-            }
-            else if (e.Button.Equals(System.Windows.Forms.MouseButtons.Middle))
-            {
-                // on middle or mouse wheel button, centre!
-                this.CenterOnZero();
-            }
-        }
-
-        private void OnMouseUp(object sender, MouseEventArgs e)
-        {
-            // On Left mouse release Pan.
-            if (e.Button.Equals(System.Windows.Forms.MouseButtons.Left))
+        private void OnMouseMove(object sender, MouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Left)
             {
                 Vector3 v3PanEndLocation;
                 v3PanEndLocation.X = e.Location.X;
                 v3PanEndLocation.Y = e.Location.Y;
                 v3PanEndLocation.Z = 0.0f;

+                Vector3 v3PanAmount = (v3PanEndLocation - m_v3PanStartLocation);
+
+                v3PanAmount.Y = -v3PanAmount.Y; // we flip Y to make the panning go in the right direction.
+                this.Pan(ref v3PanAmount);
+
+                m_v3PanStartLocation.X = e.Location.X;
+                m_v3PanStartLocation.Y = e.Location.Y;
+                m_v3PanStartLocation.Z = 0.0f;
+            }
+        }
+
+        private void OnMouseDown(object sender, MouseEventArgs e)
+        {
+            // An left mouse down, start pan.
+            if (e.Button.Equals(System.Windows.Forms.MouseButtons.Left))
+            {
+                m_v3PanStartLocation.X = e.Location.X;
+                m_v3PanStartLocation.Y = e.Location.Y;
+                m_v3PanStartLocation.Z = 0.0f;
+            }
+            else if (e.Button.Equals(System.Windows.Forms.MouseButtons.Middle))
+            {
+                // on middle or mouse wheel button, centre!
+                this.CenterOnZero();
+            }
+        }
+        /*
+        private void OnMouseUp(object sender, MouseEventArgs e)
+        {
+            // On Left mouse release Pan.
+            if (e.Button.Equals(System.Windows.Forms.MouseButtons.Left))
+            {
+                Vector3 v3PanEndLocation;
+                v3PanEndLocation.X = e.Location.X;
+                v3PanEndLocation.Y = e.Location.Y;
+                v3PanEndLocation.Z = 0.0f;
+
                 Vector3 v3PanAmount = v3PanEndLocation - m_v3PanStartLocation;
                 v3PanAmount.Y = -v3PanAmount.Y; // we flip Y to make the panning go in the right direction.
                 this.Pan(ref v3PanAmount);
             }
         }
+        */

         /// <summary>


Updating assembly information

Updating assembly information

git-svn-id: 3d7b831feec52606c26f0b051b2f15a4ff7fafff@30651 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5

--- SpriteSheetPacker/Properties/AssemblyInfo.cs
+++ SpriteSheetPacker/Properties/AssemblyInfo.cs
@@ -5,7 +5,7 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("Sprite Sheet Packer")]
-[assembly: AssemblyDescription("This tool packs a set of images into a single image sprite sheet, outputting both the combine image (as a PNG) as well as a text file mapping file names to the rectangular region in which that image resides in the sprite sheet.")]
+[assembly: AssemblyDescription("This tool packs a set of images into a single image sprite sheet, outputting both the combined image as well as a file mapping the image file names to the rectangular region in which that image resides in the sprite sheet.")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Nick Gravelyn")]
 [assembly: AssemblyProduct("Sprite Sheet Packer")]
@@ -30,5 +30,5 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("1.1.*")]
+[assembly: AssemblyVersion("1.2.*")]
 [assembly: AssemblyFileVersion("1.0.0.0")]


Use variable with to write displayInfo.Width

--- SpssLib/FileParser/Records/VariableRecord.cs
+++ SpssLib/FileParser/Records/VariableRecord.cs
@@ -208,7 +208,11 @@

         private static int GetDisplayInfoWith(Variable variable)
         {
-            // TODO verify which value should be the width of the display info, It's supposed to be "The width of the display column for the variable in characters"
+            if (variable.TextWidth > 0)
+            {
+                return variable.Width;
+            }
+
             if (variable.TextWidth > 0)
             {
                 return variable.TextWidth;


Removed logging of EnqueueLog

Removed logging of EnqueueLog

--- Src/PRuntimes/CoyoteRuntime/PLogFormatter.cs
+++ Src/PRuntimes/CoyoteRuntime/PLogFormatter.cs
@@ -144,14 +144,7 @@
             this.Logger.WriteLine(text);
         }

-        public override void OnEnqueueEvent(ActorId id, Event e)
-        {
-
-            string eventName = this.GetEventNameWithPayload(e);
-            string text = $"<EnqueueLog> '{id}' enqueued event '{eventName}'.";
-            this.Logger.WriteLine(text);
-
-        }
+        public override void OnEnqueueEvent(ActorId id, Event e) {   }

         public override void OnReceiveEvent(ActorId id, string stateName, Event e, bool wasBlocked)
         {


don't catch exception anymore here

don't catch exception anymore here

--- TCC.Core/Parsing/Messages/S_NPCGUILD_LIST.cs
+++ TCC.Core/Parsing/Messages/S_NPCGUILD_LIST.cs
@@ -35,11 +35,10 @@
                     reader.BaseStream.Position = next - 4;
                 }
             }
-            catch (Exception e)
+            catch
             {
                 //Log.F($"[{nameof(S_NPCGUILD_LIST)}] Failed to parse packet. \nContent:\n{StringUtils.ByteArrayToString(Payload.Array)}\nException:\n{e.Message}\n{e.StackTrace}");
                 //WindowManager.FloatingButton.NotifyExtended("Warning", "A non-fatal error occured. More detailed info has been written to error.log. Please report this to the developer on Discord or Github.", NotificationType.Warning, 10000);
-
             }
         }
     }


Fix a few tests

Fix a few tests

--- Tests/LibraryTests/DiscFileSystemFileTest.cs
+++ Tests/LibraryTests/DiscFileSystemFileTest.cs
@@ -201,10 +201,7 @@
             fs.CreateDirectory("FOO.TXT");

             DiscFileInfo di = fs.GetFileInfo("foo.txt");
-            using (Stream s = di.Open(FileMode.Create))
-            {
-                Assert.Throws<IOException>(() => s.WriteByte(1));
-            }
+            Assert.Throws<IOException>(() => di.Open(FileMode.Create));
         }

         [TestCaseSource(typeof(FileSystemSource), nameof(FileSystemSource.ReadWriteFileSystems))]
@@ -226,7 +223,6 @@

                 Assert.AreEqual(1, s.ReadByte());
             }
-            Assert.Throws<FileNotFoundException>(() => { });
         }

         [TestCaseSource(typeof(FileSystemSource), nameof(FileSystemSource.ReadWriteFileSystems))]
@@ -416,7 +412,7 @@
         public void Delete_NoFile(NewFileSystemDelegate fsFactory)
         {
             DiscFileSystem fs = fsFactory();
-
+
             Assert.Throws<FileNotFoundException>(() => fs.GetFileInfo("foo.txt").Delete());
         }


Explaining why InitializeThrowingTest fails

I was convinced that the MSDN camp had won, and that documentation were the truth.

Also rearranged the file.

--- Tests/System/Threading/ThreadLocalTestsEx.cs
+++ Tests/System/Threading/ThreadLocalTestsEx.cs
@@ -1,6 +1,4 @@
-#if !NET40
-
-using NUnit.Framework;
+using NUnit.Framework;
 using System;
 using System.Collections.Generic;
 using System.Threading;
@@ -8,10 +6,23 @@
 namespace MonoTests.System.Threading
 {
     [TestFixture]
-    public class ThreadLocalTestsEx
+    public partial class ThreadLocalTestsEx
     {
-#if NET20 || NET30 || NET35 || NET45
+        [Test]
+        public void ThreadLocalDoesNotUseTheDefaultConstructor()
+        {
+            using (var local = new ThreadLocal<Random>())
+            {
+                Assert.AreEqual(null, local.Value);
+            }
+        }
+    }

+#if NET20 || NET30 ||NET35 || NET45
+
+    [TestFixture]
+    public partial class ThreadLocalTestsEx
+    {
         [Test]
         [Category("NotDotNet")] // Running this test against .NET 4.0 fails
         public void InitializeThrowingTest()
@@ -20,13 +31,8 @@
             TestException(true);
         }

-#endif
-
-#if NET20 || NET30 || NET35 || NET45
-
         [Test]
         [Category("NotDotNet")] // nunit results in stack overflow
-        [Ignore]
         public void MultipleReferenceToValueTest()
         {
             if (Environment.Version.Major >= 4)
@@ -57,10 +63,6 @@
             );
         }

-#endif
-
-#if NET20 || NET30 || NET35 || NET45
-
         [Test]
         public void TestValues()
         {
@@ -87,10 +89,6 @@
             }
         }

-#endif
-
-#if NET20 || NET30 || NET35 || NET45
-
         [Test]
         public void TestValuesWithExceptions()
         {
@@ -110,19 +108,6 @@
             Assert.AreEqual(count, 3);
         }

-#endif
-
-        [Test]
-        public void ThreadLocalDoesNotUseTheDefaultConstructor()
-        {
-            using (var local = new ThreadLocal<Random>())
-            {
-                Assert.AreEqual(null, local.Value);
-            }
-        }
-
-#if NET20 || NET30 || NET35 || NET45
-
         [Test]
         public void ValuesIsNewCopy()
         {
@@ -136,8 +121,6 @@
                 Assert.AreEqual(threadLocal.Values.Count, 1);
             }
         }
-
-#endif

         private static void LaunchAndWaitThread(ThreadLocal<int> threadLocal)
         {
@@ -156,8 +139,6 @@
             thread.Start();
             thread.Join();
         }
-
-#if NET20 || NET30 || NET35 || NET45

         private static void TestException(bool tracking)
         {
@@ -196,12 +177,23 @@

                 Assert.IsNotNull(exception, "#4");
                 Assert.That(exception, Is.TypeOf(typeof(ApplicationException)), "#5");
+                // MSDN says on ThreadLocal.Value
+                //
+                // If this instance was not previously initialized for the current thread, accessing Value will attempt to
+                // initialize it. If an initialization function was supplied during the construction, that initialization
+                // will happen by invoking the function to retrieve the initial value for Value. Otherwise, the default
+                // value of will be used. If an exception is thrown, that exception is cached and thrown on each subsequent
+                // access of the property.
+                //
+                // That means that even though we did access ThreadLocal.Value twice, the value factory should have been
+                // executed only once.... because the value factory we used throws an exception, and that should have been
+                // cached and thrown instead of calling the value factory again...
+                //
+                // .NET 4.0 and .NET 4.5 are not doing that, instead they call the value factory again
                 Assert.AreEqual(1, callTime, "#6");
             }
         }
+    }

 #endif
-    }
-}
-
-#endif+}


Find code references in .ts and .html files

--- ResXManager.Model/CodeReferenceConfiguration.cs
+++ ResXManager.Model/CodeReferenceConfiguration.cs
@@ -61,6 +61,8 @@
 {""Expression"":""\\W($Key)\\W"",""Extensions"":"".vb"",""IsCaseSensitive"":false,""SingleLineComment"":""'""},
 {""Expression"":""\\W($File::$Key)\\W"",""Extensions"":"".cpp,.c,.hxx,.h"",""IsCaseSensitive"":true,""SingleLineComment"":""\/\/""},
 {""Expression"":""<%\\$\\s+Resources:\\s*($File)\\s*,\\s*($Key)\\s*%>"",""Extensions"":"".aspx,.ascx,.master"",""IsCaseSensitive"":true,""SingleLineComment"":null},
-{""Expression"":""StringResourceKey\\.($Key)"",""Extensions"":"".cs"",""IsCaseSensitive"":true,""SingleLineComment"":""\/\/""}]}";
+{""Expression"":""StringResourceKey\\.($Key)"",""Extensions"":"".cs"",""IsCaseSensitive"":true,""SingleLineComment"":""\/\/""},
+{""Expression"":""\\.($Key)"",""Extensions"":"".ts,.html"",""IsCaseSensitive"":true,""SingleLineComment"":""\/\/""}
+]}";
     }
 }


Added smoke tests for value distribution

--- Tweek.ApiService.Tests/ServingModuleTests.cs
+++ Tweek.ApiService.Tests/ServingModuleTests.cs
@@ -1,19 +1,24 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
 using System.Threading.Tasks;
 using Newtonsoft.Json.Linq;
 using RestEase;
 using Xunit;
+using Xunit.Abstractions;

 namespace Tweek.ApiService.Tests
 {
     public class ServingModuleTests
     {
+        private readonly ITestOutputHelper mOutput;
         private readonly Dictionary<string, string> mEmptyContext;
         private readonly IConfigurationsApi mConfigurationsApi;

-        public ServingModuleTests()
+        public ServingModuleTests(ITestOutputHelper output)
         {
+            mOutput = output;
             var targetBaseUrl = Environment.GetEnvironmentVariable("TWEEK_SMOKE_TARGET");

             if (string.IsNullOrEmpty(targetBaseUrl))
@@ -61,5 +66,65 @@
             Assert.Equal(JTokenType.String, response.Type);
             Assert.Equal(expectedResult, response.ToString());
         }
+
+        [Fact]
+        public async Task GetSingleKey_WithBernoulliTrialValues_ShouldReturnResultToSome()
+        {
+            // Arrange
+            const double probablityOfTestFailure = 0.001;
+            const double configurationKeyBernoulliTrialSplit = 0.3;
+            var attemptsForHighEnoughProbability =
+                (int)
+                Math.Round(
+                    Math.Max(
+                        Math.Log(probablityOfTestFailure, configurationKeyBernoulliTrialSplit),
+                        Math.Log(probablityOfTestFailure, 1-configurationKeyBernoulliTrialSplit)
+                    )
+                );
+
+            // Act
+            var keyRequests = Enumerable.Range(0, attemptsForHighEnoughProbability)
+                .Select(async i => await mConfigurationsApi.Get("@tests/multivariantkeys/bernoulli", new Dictionary<string, string> {{"device", Guid.NewGuid().ToString()}}));
+
+            var results = await Task.WhenAll(keyRequests);
+            var returnedValues = results.Where(x => x.Type == JTokenType.String).Select(x => x.ToString()).ToList();
+
+            // Assert
+            Assert.Contains("true", returnedValues);
+            Assert.Contains("false", returnedValues);
+            mOutput.WriteLine("Attempts: {0}", attemptsForHighEnoughProbability);
+            mOutput.WriteLine("Key Bernulli Thresold: {0}%", Math.Round(configurationKeyBernoulliTrialSplit * 100));
+            mOutput.WriteLine("Received \"true\" Rate: {0}%", Math.Round(returnedValues.Count(x => x == "true") * 100d / attemptsForHighEnoughProbability));
+            mOutput.WriteLine("Chance for a test fail due to statistics: {0}%", probablityOfTestFailure * 100);
+        }
+
+        [Fact]
+        public async Task GetSingleKey_WithMultiVariantsValues_ShouldReturnResultToSome()
+        {
+            // Arrange
+            // Using Coupon Collectors Problem to find out when we'll probably get all options
+            // Result for success in 99% for 4 equal options of the cases came from here:
+            // http://www.distributome.org/js/calc/CouponCollectorCalculator.html
+            const int numberOfAttempts = 30;
+
+            // Act
+            var keyRequests = Enumerable.Range(0, numberOfAttempts)
+                .Select(async i => await mConfigurationsApi.Get("@tests/multivariantkeys/weighted_normalized", new Dictionary<string, string> { { "device", Guid.NewGuid().ToString() } }));
+
+            var results = await Task.WhenAll(keyRequests);
+            var returnedValues = results.Where(x => x.Type == JTokenType.String).Select(x => x.ToString()).ToList();
+
+            // Assert
+            mOutput.WriteLine("Attempts: {0}", numberOfAttempts);
+            mOutput.WriteLine("Received \"test1\" Rate: {0}%", Math.Round((returnedValues.Count(x => x == "test1") * 100d) / numberOfAttempts));
+            mOutput.WriteLine("Received \"test2\" Rate: {0}%", Math.Round((returnedValues.Count(x => x == "test2") * 100d) / numberOfAttempts));
+            mOutput.WriteLine("Received \"test3\" Rate: {0}%", Math.Round((returnedValues.Count(x => x == "test3") * 100d) / numberOfAttempts));
+            mOutput.WriteLine("Received \"test4\" Rate: {0}%", Math.Round((returnedValues.Count(x => x == "test4") * 100d) / numberOfAttempts));
+            Assert.Contains("test1", returnedValues);
+            Assert.Contains("test2", returnedValues);
+            Assert.Contains("test3", returnedValues);
+            Assert.Contains("test4", returnedValues);
+
+        }
     }
 }


Update DescriptiveDto.cs

Update DescriptiveDto.cs

delete commented code

--- Visma.net/Models/CustomDto/DescriptiveDto.cs
+++ Visma.net/Models/CustomDto/DescriptiveDto.cs
@@ -289,37 +289,4 @@
         }
     }

-  //public class DefaultWarehouse : DescriptiveDto
-  //{
-  //  public DefaultWarehouse()
-  //  {
-  //  }
-
-  //  public DefaultWarehouse(string id) : base(id)
-  //  {
-  //  }
-
-  //  public static implicit operator DefaultWarehouse(string id)
-  //  {
-  //    return new DefaultWarehouse(id);
-  //  }
-  //}
-
-  //public class DefaultWarehouse : DescriptiveDto
-  //{
-  //  public DefaultWarehouse()
-  //  {
-  //  }
-
-  //  public DefaultWarehouse(string id) : base(id)
-  //  {
-  //  }
-
-  //  public static implicit operator DefaultWarehouse(string id)
-  //  {
-  //    return new DefaultWarehouse(id);
-  //  }
-  //}
-
-
 }


Use FirstOrDefault instead of SingleOrDefault.

--- WalletWasabi/Services/IndexBuilderService.cs
+++ WalletWasabi/Services/IndexBuilderService.cs
@@ -300,7 +300,7 @@

 								foreach (var input in tx.Inputs)
 								{
-									var found = Bech32UtxoSet.SingleOrDefault(x => x.Key == input.PrevOut);
+									var found = Bech32UtxoSet.FirstOrDefault(x => x.Key == input.PrevOut); // Performance: Don't use SingleOrDefault here.
 									if (found.Key != default)
 									{
 										Script val = Bech32UtxoSet[input.PrevOut];


Accept longer swipes.

Accept longer swipes.

--- Widgets/WidgetBase/VarmintWidgetUserInput.cs
+++ Widgets/WidgetBase/VarmintWidgetUserInput.cs
@@ -57,7 +57,7 @@
         }

         public float DragLengthThreshhold { get; set; } = .05f;
-        public double FlickThreshholdSeconds { get; set; } = 0.15;
+        public double FlickThreshholdSeconds { get; set; } = 0.3;
         public double DoubleTapIntervalSeconds { get; set; } = 0.25;
         public double ContextHoldThreshholdSeconds { get; set; } = 0.4;
         public double TouchOrphanTimeoutSeconds { get; set; } = 1.0;


Fix potential memory leak in FocusManager

If ResumeFocusTracking was called without any call to SuspendFocusTracking,
then the FocusManagerImpl would be subscribed to the windows hook event twice,
and remain subscribed even if it was disposed.

--- WinFormsUI/Docking/DockPanel.FocusManager.cs
+++ WinFormsUI/Docking/DockPanel.FocusManager.cs
@@ -304,7 +304,7 @@
                 return false;
             }

-            private int m_countSuspendFocusTracking = 0;
+            private uint m_countSuspendFocusTracking = 0;
             public void SuspendFocusTracking()
             {
                 m_countSuspendFocusTracking++;
@@ -314,10 +314,10 @@

             public void ResumeFocusTracking()
             {
-                if (m_countSuspendFocusTracking > 0)
-                    m_countSuspendFocusTracking--;
-
                 if (m_countSuspendFocusTracking == 0)
+                    return;
+
+                if (--m_countSuspendFocusTracking == 0)
                 {
                     if (ContentActivating != null)
                     {


#129 fix space issues in searching programs

--- Wox.Plugin.SystemPlugins/Program/Programs.cs
+++ Wox.Plugin.SystemPlugins/Program/Programs.cs
@@ -51,7 +51,7 @@

         protected override List<Result> QueryInternal(Query query)
         {
-            if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
+            if (query.RawQuery.Length <= 1) return new List<Result>();

             var fuzzyMather = FuzzyMatcher.Create(query.RawQuery);
             List<Program> returnList = installedList.Where(o => MatchProgram(o, fuzzyMather)).ToList();


that might fix something

that might fix something

--- devinmajordotcom/PerformanceHub.cs
+++ devinmajordotcom/PerformanceHub.cs
@@ -74,7 +74,7 @@
                     }
                 }

-                foreach (IHardware t2 in computer.Hardware)
+                foreach (var t2 in computer.Hardware)
                 {
                     if (t2.HardwareType == HardwareType.CPU)
                     {
@@ -84,7 +84,7 @@
                             var packageTemp = t2.Sensors.FirstOrDefault(x => x.SensorType == SensorType.Temperature && x.Name == "CPU Package");
                             hasPackageTemp = packageTemp != null;
                         }
-                        foreach (ISensor t1 in t2.Sensors)
+                        foreach (var t1 in t2.Sensors)
                         {
                             if (t1.SensorType == SensorType.Temperature && (hasPackageTemp.Value && t1.Name == "CPU Package") || (!hasPackageTemp.Value && t1.Name == "CPU Core #1"))
                             {
@@ -96,24 +96,20 @@
                             }
                         }
                     }
-                    if (t2.HardwareType == HardwareType.RAM)
+
+                    if (t2.HardwareType != HardwareType.RAM) continue;
+
+                    foreach (var t1 in t2.Sensors)
                     {
-                        foreach (ISensor t1 in t2.Sensors)
+                        if (t1.SensorType == SensorType.Load)
                         {
-                            if (t1.SensorType == SensorType.Load)
-                            {
-                                ramLoad = t1.Value.GetValueOrDefault();
-                            }
-                            if (t1.SensorType == SensorType.Data && t1.Name == "Used Memory")
-                            {
-                                var available = t2.Sensors.FirstOrDefault(x => x.SensorType == SensorType.Data && x.Name == "Available Memory");
-                                if(available != null)
-                                {
-                                    var used = t1.Value.GetValueOrDefault();
-                                    ramString = Math.Round(used ,0) + "/" + Math.Round(used + available.Value.GetValueOrDefault(), 0) + " GB In Use";
-                                }
-                            }
+                            ramLoad = t1.Value.GetValueOrDefault();
                         }
+                        if (t1.SensorType != SensorType.Data || t1.Name != "Used Memory") continue;
+                        var available = t2.Sensors.FirstOrDefault(x => x.SensorType == SensorType.Data && x.Name == "Available Memory");
+                        if (available == null) continue;
+                        var used = t1.Value.GetValueOrDefault();
+                        ramString = Math.Round(used ,0) + "/" + Math.Round(used + available.Value.GetValueOrDefault(), 0) + " GB In Use";
                     }
                 }


Storage, twilio

Storage, twilio

--- appengine/flexible/CloudStorage/Controllers/HomeController.cs
+++ appengine/flexible/CloudStorage/Controllers/HomeController.cs
@@ -26,7 +26,7 @@

 namespace CloudStorage.Controllers
 {
-    // [START cloud_storage]
+    // [START gae_flex_storage_app]
     public class HomeController : Controller
     {
         // Contains the bucket name and object name
@@ -44,18 +44,16 @@
         public async Task<IActionResult> Index()
         {
             var model = new HomeIndex();
-            // [END cloud_storage]
             if (new string[] { null, "", "your-google-bucket-name" }
                 .Contains(_options.BucketName))
             {
                 model.MissingBucketName = true;
                 return View(model);
             }
-            // [START cloud_storage]
             try
             {
                 // Get the storage object.
-                var storageObject =
+                var storageObject =
                     await _storage.GetObjectAsync(_options.BucketName, _options.ObjectName);
                 // Get a direct link to the storage object.
                 model.MediaLink = storageObject.MediaLink;
@@ -92,14 +90,12 @@
             model.MediaLink = storageObject.MediaLink;
             return View(model);
         }
-        // [END cloud_storage]
+        // [END gae_flex_storage_app]

         public IActionResult Error()
         {
             return View();
         }
-        // [START cloud_storage]
     }
-    // [END cloud_storage]
 }


made webookcaller lazy

made webookcaller lazy


Fix language generation

Fix language generation

--- nuve/Lang/Language.cs
+++ nuve/Lang/Language.cs
@@ -160,12 +160,12 @@
         {
             StringExtensions.ThrowIfNullAny(morphemes);

-            var index  = StringExtensions.ContainsWhitespaceAny(morphemes);
-
-            if (index >= 0)
-            {
-                throw new ArgumentException($"Morpheme identifier can not contain whitespace: \"{morphemes[index]}\"");
-            }
+            //var index  = StringExtensions.ContainsWhitespaceAny(morphemes);
+
+            //if (index >= 0)
+            //{
+            //    throw new ArgumentException($"Morpheme identifier can not contain whitespace: \"{morphemes[index]}\"");
+            //}

             var root = GetRoot(morphemes[0]);


Update BufferTags.cs

Update BufferTags.cs


[Xwt.Samples] Give the listview a red background

--- Samples/Samples/ListView1.cs
+++ Samples/Samples/ListView1.cs
@@ -13,7 +13,10 @@

 		public ListView1 ()
 		{
-			ListView list = new ListView ();
+			PackStart (new Label ("The listview should have a red background"));
+			ListView list = new ListView () {
+				BackgroundColor = Colors.Red
+			};
 			ListStore store = new ListStore (name, icon, text, icon2);
 			list.DataSource = store;
 			list.Columns.Add ("Name", icon, name);


updated

updated

--- Src/Pc/Compiler/PToCSharp.cs
+++ Src/Pc/Compiler/PToCSharp.cs
@@ -372,7 +372,12 @@
         //#endregion

         #region CSharpCompiler
-        public bool GenerateCSharp(string csharpFileName, ref AST<Model> outModel)
+
+        //for storing members of the Application class:
+        List <SyntaxNode> members = new List<SyntaxNode>();
+        //final C# program:
+        SyntaxNode result = null;
+        public bool GenerateCSharp(string csharpFileName)
         {
             if (!allMachines.ContainsKey("Main"))
             {
@@ -391,39 +396,75 @@

             List<AST<Node>> elements = new List<AST<Node>>();
             MkApplConstructors(generator);
-            //MkEvents(elements, workspace, generator);
+            MkEvents(generator);
             //MkStaticFunctions(elements, workspace, generator);
             //MkOtherAppFields(elements, workspace, generator);
             //MkMachineClasses(elements, workspace, generator);
             //MkMonitorClasses(elements, workspace, generator);
-            //MkCSharpOutput(elements, workspace, generator);
-            //EmitCSharpOutput();
-            //outModel = Add(outModel, MkCSharpFile(csharpFileName, elements));
+            MkCSharpOutput(generator);
+            EmitCSharpOutput();
             return true;
         }
         private void MkApplConstructors(SyntaxGenerator generator)
         {
             // Generate empty list of parameters for the "public Application() :base()" constructor
             var constructor_1 = generator.ConstructorDeclaration("Application", new SyntaxNode[0], Accessibility.Public, baseConstructorArguments: new SyntaxNode[0]);
+            members.Add(constructor_1);
             var constructorParameters = new SyntaxNode[] {
                 generator.ParameterDeclaration("initialize",
                     generator.TypeExpression(SpecialType.System_Boolean)) };
             var constructorBody = generator.ExpressionStatement(generator.InvocationExpression(generator.IdentifierName("CreateMainMachine")));
             var constructor_2 = generator.ConstructorDeclaration("Application", constructorParameters, Accessibility.Public, baseConstructorArguments: new SyntaxNode[0],
                                                                 statements: new SyntaxNode[] { constructorBody });
+            members.Add(constructor_2);
             //TODO: would this result in "new Application();" or "new Application;"?
             var makeSkeletonMethodBody = generator.ReturnStatement(generator.ObjectCreationExpression(generator.IdentifierName("Application")));
             var makeSkeletonMethodDecl = generator.MethodDeclaration("MakeSkeleton", null,
               //Would that work for the method return type "StateImpl"?
-              null, generator.TypeExpression(typeSymbol: (ITypeSymbol) generator.IdentifierName("StateImpl")),
+              null, generator.IdentifierName("StateImpl"),
               Accessibility.Public,
               DeclarationModifiers.Override,
               new SyntaxNode[] { makeSkeletonMethodBody });
-        }
-        private void MkEvents(List<AST<Node>> elements)
-        {
-
-        }
+            members.Add(makeSkeletonMethodDecl);
+        }
+        private void MkEvents(SyntaxGenerator generator)
+        {
+
+        }
+        private void MkCSharpOutput(SyntaxGenerator generator)
+        {
+            var applicationcClassDeclaration = generator.ClassDeclaration(
+              "Application", typeParameters: null,
+              accessibility: Accessibility.Public,
+              baseType: generator.IdentifierName("StateImpl"),
+              members: members);
+
+            // Declare a namespace
+            var programNameSpaceDeclaration = generator.NamespaceDeclaration("MyPProgram", applicationcClassDeclaration);
+
+            List<SyntaxNode> usingDirectivesList = new List<SyntaxNode>();
+            usingDirectivesList.Add(generator.NamespaceImportDeclaration("P.Runtime"));
+            usingDirectivesList.Add(generator.NamespaceImportDeclaration("System.Collections.Generic"));
+
+            // Get a CompilationUnit (code file) for the generated code
+            //var newNode = generator.CompilationUnit(programNameSpaceDeclaration).
+            // NormalizeWhitespace();
+
+            // Get a CompilationUnit (code file) for the generated code
+            result = generator.CompilationUnit(usingDirectivesList[0], usingDirectivesList[1], programNameSpaceDeclaration).
+              NormalizeWhitespace();
+        }
+
+        private void EmitCSharpOutput()
+        {
+            StringBuilder sb = new StringBuilder();
+            using (StringWriter writer = new StringWriter(sb))
+            {
+                result.WriteTo(writer);
+                Console.WriteLine(writer);
+            }
+        }
+
         /*
         /// ///////////////////////////////////////////////////////////////////////////PToZing.cs
         private void MkZingEnums(List<AST<Node>> elements)


duplicated field removed

duplicated field removed


QuitRpc ported

QuitRpc ported

--- TomP2P/TomP2P/Rpc/QuitRpc.cs
+++ TomP2P/TomP2P/Rpc/QuitRpc.cs
@@ -5,6 +5,7 @@
 using System.Threading.Tasks;
 using NLog;
 using TomP2P.Connection;
+using TomP2P.P2P.Builder;
 using TomP2P.Peers;

 namespace TomP2P.Rpc
@@ -50,13 +51,50 @@
         public Task<Message.Message> Quit(PeerAddress remotePeer, ShutdownBuilder shutdownBuilder,
             ChannelCreator channelCreator)
         {
-            // TODO implement
-            throw new NotImplementedException();
+            var message = CreateRequestMessage(remotePeer, Rpc.Commands.Quit.GetNr(),
+                Message.Message.MessageType.RequestFf1);
+            if (shutdownBuilder.IsSign)
+            {
+                message.SetPublicKeyAndSign(shutdownBuilder.KeyPair);
+            }
+
+            var tcsResponse = new TaskCompletionSource<Message.Message>(message);
+            var requestHandler = new RequestHandler(tcsResponse, PeerBean, ConnectionBean, shutdownBuilder);
+            Logger.Debug("Send QUIT message {0}.", message);
+            if (!shutdownBuilder.IsForceTcp)
+            {
+                return requestHandler.FireAndForgetUdpAsync(channelCreator);
+            }
+            else
+            {
+                return requestHandler.SendTcpAsync(channelCreator);
+            }
         }

         public override void HandleResponse(Message.Message requestMessage, Connection.PeerConnection peerConnection, bool sign, Message.IResponder responder)
         {
-            throw new NotImplementedException();
+            if (!(requestMessage.Type == Message.Message.MessageType.RequestFf1 && requestMessage.Command == Rpc.Commands.Quit.GetNr()))
+            {
+                throw new ArgumentException("Message content is wrong for this handler.");
+            }
+            Logger.Debug("Received QUIT message {0}.", requestMessage);
+
+            lock (PeerBean.PeerStatusListeners)
+            {
+                foreach (var listener in PeerBean.PeerStatusListeners)
+                {
+                    listener.PeerFailed(requestMessage.Sender,
+                        new PeerException(PeerException.AbortCauseEnum.Shutdown, "shutdown"));
+                }
+            }
+            if (requestMessage.IsUdp)
+            {
+                responder.ResponseFireAndForget();
+            }
+            else
+            {
+                responder.Response(CreateResponseMessage(requestMessage, Message.Message.MessageType.Ok));
+            }
         }
     }
 }


Entities extra constructor added

Entities extra constructor added

--- eFormData/Entities.cs
+++ eFormData/Entities.cs
@@ -11,6 +11,14 @@
         public EntityGroup()
         {

+        }
+
+        public EntityGroup(string name, string type, string entityGroupMUId, List<EntityItem> entityGroupItemLst)
+        {
+            Name = name;
+            Type = type;
+            EntityGroupMUId = entityGroupMUId;
+            EntityGroupItemLst = entityGroupItemLst;
         }

         public EntityGroup(string name, string type, string entityGroupMUId, List<EntityItem> entityGroupItemLst, string workflowState)
@@ -61,6 +69,13 @@
             EntityItemUId = "";
         }

+        public EntityItem(string name, string description, string entityItemUId)
+        {
+            Name = name;
+            Description = description;
+            EntityItemUId = entityItemUId;
+        }
+
         public EntityItem(string name, string description, string entityItemUId, string workflowState)
         {
             Name = name;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/ReadBufferState.cs
+++ websocket-sharp/Net/ReadBufferState.cs
@@ -62,8 +62,9 @@
       _buffer = buffer;
       _offset = offset;
       _count = count;
+      _asyncResult = asyncResult;
+
       _initialCount = count;
-      _asyncResult = asyncResult;
     }

     #endregion


Adding interface IMultiTenantUserService

The id provider connectors that support MultiTenants will implement this
interface

--- source/Core/Services/IUserService.cs
+++ source/Core/Services/IUserService.cs
@@ -12,6 +12,13 @@

 namespace Thinktecture.IdentityServer.Core.Services
 {
+    public interface IMultiTenantUserService
+    {
+        Task<AuthenticateResult> AuthenticateLocalAsync(string tenant, string username, string password);
+        Task<ExternalAuthenticateResult> AuthenticateExternalAsync(string tenant, string subject, ExternalIdentity externalUser);
+        Task<IEnumerable<Claim>> GetProfileDataAsync(string subject, IEnumerable<string> requestedClaimTypes = null);
+    }
+
     public interface IUserService
     {
         Task<AuthenticateResult> AuthenticateLocalAsync(string username, string password);


Add milliseconds value alongside

Add milliseconds value alongside

--- osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs
+++ osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs
@@ -26,7 +26,8 @@

         public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
         {
-            new TrackedSetting<double>(ManiaRulesetSetting.ScrollTime, v => new SettingDescription(v, "Scroll Speed", $"{(int)Math.Round(DrawableManiaRuleset.MAX_TIME_RANGE / v)}"))
+            new TrackedSetting<double>(ManiaRulesetSetting.ScrollTime,
+                v => new SettingDescription(v, "Scroll Speed", $"{(int)Math.Round(DrawableManiaRuleset.MAX_TIME_RANGE / v)} ({v}ms)"))
         };
     }


Shorten test player count to 4 for less steps

--- osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs
+++ osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs
@@ -319,18 +319,18 @@
         [Test]
         public void TestPlayersLeaveWhileSpectating()
         {
-            start(getPlayerIds(8));
-            sendFrames(getPlayerIds(8), 300);
-
-            loadSpectateScreen();
-
-            for (int count = 7; count >= 0; count--)
+            start(getPlayerIds(4));
+            sendFrames(getPlayerIds(4), 300);
+
+            loadSpectateScreen();
+
+            for (int count = 3; count >= 0; count--)
             {
                 var id = PLAYER_1_ID + count;

                 end(id);
-                AddUntilStep("player area grayed", () => getInstance(id).Colour != Color4.White);
-                AddUntilStep("score quit set", () => getLeaderboardScore(id).HasQuit.Value);
+                AddUntilStep($"{id} area grayed", () => getInstance(id).Colour != Color4.White);
+                AddUntilStep($"{id} score quit set", () => getLeaderboardScore(id).HasQuit.Value);
                 sendFrames(getPlayerIds(count), 300);
             }
         }


Example of using options in console app

Example of using options in console app

--- samples/Elmah.Io.Client.Console/Program.cs
+++ samples/Elmah.Io.Client.Console/Program.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net;

 namespace Elmah.Io.Client.Console
 {
@@ -11,7 +12,17 @@
             var apiKey = "API_KEY";
             var logId = new Guid("LOG_ID");

-            var client = ElmahioAPI.Create(apiKey);
+            var client = ElmahioAPI.Create(apiKey, new ElmahIoOptions
+            {
+                // Remove comment on the following line to change the default timeout from 5 seconds to something else.
+                //Timeout = TimeSpan.FromSeconds(10),
+                // Remove comment on the following line to identify your program with a custom user agent.
+                //UserAgent = "Elmah.Io.Client.Console/1.0.0.0",
+                // Remove comment on the following line to automatically obfuscate form keys by name.
+                //FormKeysToObfuscate = new List<string> { "password", "pwd", "adgangskode", "passwort", "contraseña" },
+                // Remove comment on the following line to log through a proxy (in this case Fiddler).
+                //WebProxy = new WebProxy("localhost", 8888),
+            });

             // Examples of severity helper methods
             client.Messages.Fatal(logId, new ApplicationException("A fatal exception"), "Fatal message");


With utc time

With utc time

--- Snittlistan.Web/Infrastructure/ICalFormatter.cs
+++ Snittlistan.Web/Infrastructure/ICalFormatter.cs
@@ -55,6 +55,7 @@
                 writer.WriteLine("VERSION:2.0");
                 writer.WriteLine("X-PUBLISHED-TTL:PT1H");
                 writer.WriteLine("X-WR-CALNAME:Snittlistan");
+                writer.WriteLine("TZ:+00");
                 var rosters = value as IEnumerable<RosterCalendarEvent>;
                 if (rosters != null)
                 {
@@ -85,8 +86,8 @@
             writer.WriteLine("BEGIN:VEVENT");
             writer.WriteLine("UID:" + roster.Id);
             writer.WriteLine("DTSTAMP:" + string.Format("{0:yyyyMMddTHHmmssZ}", DateTime.UtcNow));
-            writer.WriteLine("DTSTART;TZID=Europe/Stockholm:" + string.Format("{0:yyyyMMddTHHmmss}", roster.Date));
-            writer.WriteLine("DTEND;TZID=Europe/Stockholm:" + string.Format("{0:yyyyMMddTHHmmss}", roster.Date.AddMinutes(60 + 45)));
+            writer.WriteLine("DTSTART:" + string.Format("{0:yyyyMMddTHHmmssZ}", roster.Date.ToUniversalTime()));
+            writer.WriteLine("DTEND:" + string.Format("{0:yyyyMMddTHHmmssZ}", roster.Date.ToUniversalTime().AddMinutes(60 + 40)));
             writer.WriteLine("SUMMARY:{0} - {1}", roster.Team, roster.Opponent);
             var description = string.Format("DESCRIPTION:{0}", roster.Description);
             writer.WriteLine(description.Substring(0, Math.Min(description.Length, 74)));


GSF.Communication: Updated GetInterfaceIPStack to base IPStack off of the server IP if interface is not specified

--- Source/Libraries/GSF.Communication/Transport.cs
+++ Source/Libraries/GSF.Communication/Transport.cs
@@ -295,12 +295,14 @@

         /// <summary>
         /// Derives the desired <see cref="IPStack"/> from the "interface" setting in the connection string key/value pairs.
+        /// If interface is not specified, <see cref="IPStack"/> is derived from the server value in connectionStringEntries
         /// </summary>
         /// <param name="connectionStringEntries">Connection string key/value pairs.</param>
         /// <returns>Desired <see cref="IPStack"/> based on "interface" setting.</returns>
         /// <remarks>
         /// The "interface" setting will be added to the <paramref name="connectionStringEntries"/> if it
-        /// doesn't exist, in this case return value will be <see cref="IPStack.Default"/>.
+        /// doesn't exist. in this case the return value will be based off of the "server" value. If the server parameter
+        /// doesn't exist, the return value will be <see cref="IPStack.Default"/>.
         /// </remarks>
         public static IPStack GetInterfaceIPStack(Dictionary<string, string> connectionStringEntries)
         {
@@ -310,6 +312,9 @@
                 return IsIPv6IP(ipAddress) ? IPStack.IPv6 : IPStack.IPv4;

             connectionStringEntries.Add("interface", string.Empty);
+
+            if (connectionStringEntries.TryGetValue("server", out ipAddress))
+                return IsIPv6IP(ipAddress) ? IPStack.IPv6 : IPStack.IPv4;

             return IPStack.Default;
         }


Issue 9978: changed PolygonAnnotation.Points to IList<DataPoint>

--- Source/OxyPlot/Annotations/PolygonAnnotation.cs
+++ Source/OxyPlot/Annotations/PolygonAnnotation.cs
@@ -68,7 +68,7 @@
         ///   Gets or sets the points.
         /// </summary>
         /// <value> The points. </value>
-        public IEnumerable<DataPoint> Points { get; set; }
+        public IList<DataPoint> Points { get; set; }

         /// <summary>
         ///   Gets or sets the stroke thickness.


Fixed view resolver null ref on implicit variants.

--- Sources/Silphid.Showzup/Sources/ViewResolver.cs
+++ Sources/Silphid.Showzup/Sources/ViewResolver.cs
@@ -167,7 +167,7 @@

             var resolved = candidates
                 .Select(candidate => new CandidateMapping<TypeToUriMapping>(candidate,
-                    _scoreEvaluator.GetVariantScore(requestedVariants, candidate.Variants, null)))
+                    _scoreEvaluator.GetVariantScore(requestedVariants, candidate.Variants, VariantSet.Empty)))
                 .Where(candidate => candidate.Score.HasValue)
                 .WithMax(candidate => candidate.Score.Value)
                 ?.Mapping;


Doc strings updates

Doc strings updates

--- SplunkSDK/ModularInputs/SingleValueParameter.cs
+++ SplunkSDK/ModularInputs/SingleValueParameter.cs
@@ -20,14 +20,13 @@
 {
     /// <summary>
     /// The <see cref="SingleValueParameter"/> class represents a parameter
- 	/// that contains a single value.
+    /// that contains a single value.
     /// </summary>
     [XmlRoot("param")]
     public class SingleValueParameter : ParameterBase
     {
         // XML Example:
         // <param name="param1">value1</param>
-
         /// <summary>
         /// The value of the parameter.
         /// </summary>
@@ -38,7 +37,7 @@
         public string ValueXmlText { get; set; }

         /// <summary>
-        /// The value of the parameter.
+        /// Gets the value of the parameter.
         /// </summary>
         internal override ValueBase ValueAsBaseType
         {
@@ -46,7 +45,7 @@
         }

         /// <summary>
-        /// Represents a single value.
+        /// The <see cref="Value"/> class represents a single value.
         /// </summary>
         public class Value : ValueBase
         {
@@ -84,4 +83,4 @@
             }
         }
     }
-}+}


4.6.0.5

--- Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs
+++ Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.6.0.4")]
-[assembly: AssemblyFileVersion("4.6.0.4")]
+[assembly: AssemblyVersion("4.6.0.5")]
+[assembly: AssemblyFileVersion("4.6.0.5")]


- Added generic functions for grouping components such as ComponentGroup, ComponentGroupByTemplate and ComponentGroupBySchema

--- TcmTemplating/Extensions/ComponentExtensions.cs
+++ TcmTemplating/Extensions/ComponentExtensions.cs
@@ -6,6 +6,11 @@
 //	Date Created	: May 15, 2014
 //	Author			: Rob van Oostenrijk
 // ---------------------------------------------------------------------------------
+// 	Change History
+//	Date Modified		: December 7, 2014
+//	Changed By			: Venkata Siva Charan Sandra
+//	Change Description	: Added generic functions for grouping components such as
+//							ComponentGroup, ComponentGroupByTemplate and ComponentGroupBySchema
 //
 ////////////////////////////////////////////////////////////////////////////////////
 #endregion
@@ -765,6 +770,85 @@
 			}

 			return -1;
+        }
+
+		/// <summary>
+		/// Returns grouped components from the current <see cref="T:Tridion.ContentManager.CommunicationManagement.Page" />
+		/// list of <see cref="T:Tridion.ContentManager.CommunicationManagement.ComponentPresentation" />
+		/// </summary>
+		/// <param name="component"><see cref="T:Tridion.ContentManager.ContentManagement.Component"/></param>
+		/// <param name="page"><see cref="T:Tridion.ContentManager.CommunicationManagement.Page"/></param>
+		/// <param name="predicate"><see cref="T:System.Func{Tridion.ContentManager.CommunicationManagement.ComponentPresentation, Tridion.ContentManager.CommunicationManagement.ComponentPresentation, System.Boolean}"/></param>
+		/// <returns>List of <see cref="T:Tridion.ContentManager.ContentManagement.Component"/></returns>
+		/// <exception cref="System.ArgumentNullException">
+		/// component or page or predicate
+		/// </exception>
+		public static IList<Component> ComponentGroup(this Component component, Page page, Func<ComponentPresentation, ComponentPresentation, Boolean> predicate)
+		{
+			if (component == null)
+				throw new ArgumentNullException("component");
+
+			if (page == null)
+				throw new ArgumentNullException("page");
+
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			// Obtain the component presentations after our current component
+			IEnumerable<ComponentPresentation> presentations = page.ComponentPresentations.SkipWhile((cp) =>
+			{
+				return cp.Component.Id.ItemId != component.Id.ItemId;
+			});
+
+			ComponentPresentation matchedPresentation = presentations.FirstOrDefault();
+
+			if (matchedPresentation == null)
+				return new List<Component>();
+
+			int matchedIndex = page.ComponentPresentations.IndexOf(matchedPresentation);
+
+			if (matchedIndex > 0 && predicate(page.ComponentPresentations[matchedIndex - 1], matchedPresentation))
+				return new List<Component>();
+
+			if (matchedPresentation.Component.Id.ItemId != component.Id.ItemId)
+				return new List<Component>();
+
+			return presentations.TakeWhile((cp) =>
+			{
+				return predicate(matchedPresentation, cp);
+			}).Select(cp => cp.Component).ToList();
+		}
+
+		/// <summary>
+		/// Returns grouped components from the current <see cref="T:Tridion.ContentManager.CommunicationManagement.Page" />
+		/// list of <see cref="T:Tridion.ContentManager.CommunicationManagement.ComponentPresentation" /> based on
+		/// <see cref="T:Tridion.ContentManager.CommunicationManagement.ComponentTemplate"/>
+		/// </summary>
+		/// <param name="component"><see cref="T:Tridion.ContentManager.ContentManagement.Component"/></param>
+		/// <param name="page"><see cref="T:Tridion.ContentManager.CommunicationManagement.Page"/></param>
+		/// <returns>List of <see cref="T:Tridion.ContentManager.ContentManagement.Component"/></returns>
+		public static IList<Component> ComponentGroupByTemplate(this Component component, Page page)
+		{
+			return ComponentGroup(component, page, (cp1, cp2) =>
+			{
+				return (cp1.ComponentTemplate.Id.ItemId == cp2.ComponentTemplate.Id.ItemId);
+			});
+		}
+
+		/// <summary>
+		/// Returns grouped components from the current <see cref="T:Tridion.ContentManager.CommunicationManagement.Page" />
+		/// list of <see cref="T:Tridion.ContentManager.CommunicationManagement.ComponentPresentation" /> based on
+		/// <see cref="T:Tridion.ContentManager.ContentManagement.Schema"/>
+		/// </summary>
+		/// <param name="component"><see cref="T:Tridion.ContentManager.ContentManagement.Component"/></param>
+		/// <param name="page"><see cref="T:Tridion.ContentManager.CommunicationManagement.Page"/></param>
+		/// <returns>List of <see cref="T:Tridion.ContentManager.ContentManagement.Component"/></returns>
+		public static IList<Component> ComponentGroupBySchema(this Component component, Page page)
+		{
+			return ComponentGroup(component, page, (cp1, cp2) =>
+			{
+				return (cp1.Component.Schema.Id.ItemId == cp2.Component.Schema.Id.ItemId);
+			});
 		}
 	}
 }


Fixed an issue where the timer would start when the game process exits while the timer is paused.

--- pet-the-pup/AutosplitterComponent.cs
+++ pet-the-pup/AutosplitterComponent.cs
@@ -21,12 +21,15 @@
     private readonly GameMemoryImpl _memory = GameMemoryImpl.Instance;
     private readonly PuppyGallery _registry = PuppyGallery.Instance;

+    private bool _timerAlive;
+
     public AutosplitterComponent(LiveSplitState state) {
       this._state = state;
       this.Settings = new AutosplitterSettings();

       this._timer = new TimerModel {CurrentState = state};
       this._timer.OnStart += this.OnTimerStart;
+      this._timer.OnPause += this.OnTimerPause;

       this._memory.OnGameStart += this.OnGameStart;
       this._memory.OnGameReset += this.OnGameReset;
@@ -45,6 +48,8 @@
     /// <param name="sender"></param>
     /// <param name="e"></param>
     private void OnTimerStart(object sender, EventArgs e) {
+      this._timerAlive = true;
+
       // TODO: Right now we do not account for loading screens between the different levels and thus
       // we do not need to initialize game time on our timer model (for now)
       // this._timer.InitializeGameTime();
@@ -53,6 +58,15 @@
         Debug.WriteLine("[Pet the Pup] Deleting registry keys");
         this._registry.DeleteKeys();
       }
+    }
+
+    /// <summary>
+    /// Handles pausing of the timer.
+    /// </summary>
+    /// <param name="sender"></param>
+    /// <param name="e"></param>
+    private void OnTimerPause(object sender, EventArgs e) {
+      this._timerAlive = false;
     }

     /// <summary>
@@ -88,7 +102,10 @@
     /// <param name="e">a set of event arguments</param>
     private void OnGameCrash(object sender, EventArgs e) {
       Debug.Write("[Pet the Pup] Game process has died");
-      this._timer.Pause();
+
+      if (this._timerAlive) {
+        this._timer.Pause();
+      }
     }

     /// <summary>
@@ -141,6 +158,16 @@

     /// <inheritdoc />
     public override void Dispose() {
+      this._timer.OnStart -= this.OnTimerStart;
+
+      this._memory.OnGameStart -= this.OnGameStart;
+      this._memory.OnGameReset -= this.OnGameReset;
+      this._memory.OnProcessDied -= this.OnGameCrash;
+      this._memory.OnGameAdvance -= this.OnAdvance;
+
+      this._registry.OnPuppyDiscovered -= this.OnDiscoverPup;
+      this._registry.OnAllPuppiesDiscovered -= this.OnDiscoverAllPups;
+
       this._memory.Dispose();
       this.Disposed = true;
     }


Send then receive with greater data size completes sync

--- projects/CommSample/test/CommSample.Test.Unit/MemoryChannelTest.cs
+++ projects/CommSample/test/CommSample.Test.Unit/MemoryChannelTest.cs
@@ -212,6 +212,19 @@
             Assert.Equal(new byte[] { 1, 2 }, receiveBuffer);
         }

+        [Fact]
+        public void Send_then_receive_with_greater_data_size_completes_sync()
+        {
+            MemoryChannel channel = new MemoryChannel();
+
+            byte[] sendBuffer = new byte[] { 1, 2, 3 };
+            channel.Send(sendBuffer);
+
+            byte[] receiveBuffer = new byte[4];
+            AssertTaskCompleted(3, channel.ReceiveAsync(receiveBuffer));
+            Assert.Equal(new byte[] { 1, 2, 3, 0 }, receiveBuffer);
+        }
+
         private static Task<TResult> AssertTaskPending<TResult>(Task<TResult> task)
         {
             Assert.False(task.IsCompleted, "Task should not be completed.");


Better error handling.

Better error handling.

--- Library/SwiftypeClientBase.cs
+++ Library/SwiftypeClientBase.cs
@@ -26,6 +26,7 @@

 		public IDescriber FieldParser { get; set; }
 		public string Token { get; set; }
+		public int Retries { get; set; }
 		protected SwiftypeClientBase(string token) {
 			this.Token = token;
 			FieldParser = new ReflectionBasedDescriber();
@@ -41,15 +42,21 @@
 			if(payload!=null) {
 				request.Content = new StringContent(encodedPayload, Encoding.UTF8, "application/json");
 			}
-			var response = await new HttpClient().SendAsync(request);
-			var responseContent = await response.Content.ReadAsStringAsync();
-			if(response.IsSuccessStatusCode)
-				return JsonConvert.DeserializeObject<TResponse>(responseContent, deserializingSettings);
+
+			var retriesLeft = Retries;
+			HttpResponseMessage response = null;
+			while(retriesLeft-- >= 0) {
+				response = await new HttpClient().SendAsync(request);
+				if(response.IsSuccessStatusCode) {
+					var responseContent = await response.Content.ReadAsStringAsync();
+					return JsonConvert.DeserializeObject<TResponse>(responseContent, deserializingSettings);
+				}
+			}
+			var errorContent = await response.Content.ReadAsStringAsync();
+			if(response.Content.Headers.ContentType.MediaType == "application/json")
+				throw new SwiftypeClientException(JsonConvert.DeserializeObject<SwiftypeErrorResponse>(errorContent, deserializingSettings));

-			if(response.Content.Headers.ContentType.MediaType == "application/json")
-				throw new SwiftypeClientException(JsonConvert.DeserializeObject<SwiftypeErrorResponse>(responseContent, deserializingSettings));
-
-			throw new SwiftypeClientException(responseContent);
+			throw new SwiftypeClientException(errorContent);
 		}

 		public struct SwiftypeErrorResponse {


Fixing bug with group disclaimers producing an error when the user has not yet created their profile

--- Trifolia.Web/Controllers/API/GroupController.cs
+++ Trifolia.Web/Controllers/API/GroupController.cs
@@ -48,6 +48,10 @@
                 return new List<GroupDisclaimer>();

             var currentUser = CheckPoint.Instance.GetUser(this.tdb);
+
+            if (currentUser == null)
+                return new List<GroupDisclaimer>();
+
             var groupsWithDisclaimers = currentUser.Groups
                 .Where(y => !string.IsNullOrEmpty(y.Group.Disclaimer))
                 .Select(y => y.Group);


Added keep-alive header

Added keep-alive header

--- UltimateTeam.Toolkit/Requests/FutRequestBase.cs
+++ UltimateTeam.Toolkit/Requests/FutRequestBase.cs
@@ -39,6 +39,7 @@
             HttpClient.DefaultRequestHeaders.TryAddWithoutValidation(HttpHeaders.ContentType, "application/json");
             AddReferrerHeader("http://www.easports.com/iframe/fut/bundles/futweb/web/flash/FifaUltimateTeam.swf");
             AddUserAgent();
+            HttpClient.DefaultRequestHeaders.Connection.Add("keep-alive");
         }

         protected void AddUserAgent()


Fix UnitTest assembly name.

Fix UnitTest assembly name.

--- cli/src/MsgPack.WindowsPhone.7.1/Properties/AssemblyInfo.cs
+++ cli/src/MsgPack.WindowsPhone.7.1/Properties/AssemblyInfo.cs
@@ -30,7 +30,7 @@
 [assembly: AssemblyFileVersion( "0.2.0.0" )]

 #if DEBUG || PERFORMANCE_TEST
-[assembly: InternalsVisibleTo( "MsgPack.Silverlight.UnitTest" )]
+[assembly: InternalsVisibleTo( "MsgPack.WindowsPhone.UnitTest" )]
 #endif


Fixed trimming delimeters from the end of folder names in IMAP

--- MailKit/Net/Imap/ImapUtils.cs
+++ MailKit/Net/Imap/ImapUtils.cs
@@ -439,22 +439,19 @@
 			switch (token.Type) {
 			case ImapTokenType.Literal:
 				encodedName = await engine.ReadLiteralAsync (doAsync, cancellationToken).ConfigureAwait (false);
-				encodedName.TrimEnd (delim);
 				break;
 			case ImapTokenType.QString:
 			case ImapTokenType.Atom:
 				encodedName = (string) token.Value;
-				encodedName.TrimEnd (delim);
 				break;
 			case ImapTokenType.Nil:
 				// Note: according to rfc3501, section 4.5, NIL is acceptable as a mailbox name.
-				encodedName = "NIL";
-				break;
+				return "NIL";
 			default:
 				throw ImapEngine.UnexpectedToken (format, token);
 			}

-			return encodedName;
+			return encodedName.TrimEnd (delim);
 		}

 		/// <summary>


Som refactoring on TileFetcher

Som refactoring on TileFetcher

--- Mapsui/Fetcher/TileFetcher.cs
+++ Mapsui/Fetcher/TileFetcher.cs
@@ -36,7 +36,6 @@
         private double _resolution;
         private readonly IList<TileIndex> _tilesInProgress = new List<TileIndex>();
         private IList<TileInfo> _missingTiles = new List<TileInfo>();
-        private readonly IDictionary<TileIndex, int> _retries = new Dictionary<TileIndex, int>();
         private readonly int _maxThreads;
         private int _threadCount;
         private readonly AutoResetEvent _waitHandle = new AutoResetEvent(true);
@@ -55,7 +54,7 @@
         {
             if (tileSource == null) throw new ArgumentException("TileProvider can not be null");
             if (memoryCache == null) throw new ArgumentException("MemoryCache can not be null");
-
+
             _tileSource = tileSource;
             _memoryCache = memoryCache;
             _maxAttempts = maxAttempts;
@@ -110,6 +109,8 @@
         {
             try
             {
+                var retries = new Retries(_maxAttempts);
+
                 while (_isThreadRunning)
                 {
                     if (_tileSource.Schema == null) _waitHandle.Reset();
@@ -122,13 +123,13 @@
                         var levelId = BruTile.Utilities.GetNearestLevel(_tileSource.Schema.Resolutions, _resolution);
                         _missingTiles = _strategy.GetTilesWanted(_tileSource.Schema, _extent.ToExtent(), levelId);
                         _numberTilesNeeded = _missingTiles.Count;
-                        _retries.Clear();
+                        retries.Clear();
                         _isViewChanged = false;
                     }

-                    _missingTiles = GetTilesMissing(_missingTiles, _memoryCache, _retries, _maxAttempts);
-
-                    FetchTiles();
+                    _missingTiles = GetTilesMissing(_missingTiles, _memoryCache, retries);
+
+                    FetchTiles(retries);

                     if (_missingTiles.Count == 0)
                     {
@@ -145,41 +146,42 @@
             }
         }

-        private static IList<TileInfo> GetTilesMissing(IEnumerable<TileInfo> infosIn, MemoryCache<Feature> memoryCache,
-            IDictionary<TileIndex, int> retries, int maxRetries)
-        {
-            IList<TileInfo> tilesOut = new List<TileInfo>();
-            foreach (TileInfo info in infosIn)
-            {
-                if ((memoryCache.Find(info.Index) == null) &&
-                    (!retries.Keys.Contains(info.Index) || retries[info.Index] < maxRetries))
-
-                    tilesOut.Add(info);
-            }
-            return tilesOut;
-        }
-
-        private void FetchTiles()
-        {
-            foreach (TileInfo info in _missingTiles)
-            {
-                if (_threadCount >= _maxThreads) return;
-                FetchTile(info);
-            }
-        }
-
-        private void FetchTile(TileInfo info)
-        {
-            //first a number of checks
-            if (_tilesInProgress.Contains(info.Index)) return;
-            if (_retries.Keys.Contains(info.Index) && _retries[info.Index] >= _maxAttempts) return;
-            if (_memoryCache.Find(info.Index) != null) return;
-
-            //now we can go for the request.
-            lock (_tilesInProgress) { _tilesInProgress.Add(info.Index); }
-            if (!_retries.Keys.Contains(info.Index)) _retries.Add(info.Index, 0);
-            else _retries[info.Index]++;
+        private static IList<TileInfo> GetTilesMissing(IEnumerable<TileInfo> tileInfos, MemoryCache<Feature> memoryCache,
+            Retries retries)
+        {
+            var result = new List<TileInfo>();
+
+            foreach (var info in tileInfos)
+            {
+                if (retries.ReachedMax(info.Index)) continue;
+                if (memoryCache.Find(info.Index) == null) result.Add(info);
+            }
+
+            return result;
+        }
+
+        private void FetchTiles(Retries retries)
+        {
+            foreach (var info in _missingTiles)
+            {
+                if (_threadCount >= _maxThreads) break;
+                FetchTile(info, retries);
+            }
+        }
+
+        private void FetchTile(TileInfo info, Retries retries)
+        {
+            if (retries.ReachedMax(info.Index)) return;
+
+            lock (_tilesInProgress)
+            {
+                if (_tilesInProgress.Contains(info.Index)) return;
+                _tilesInProgress.Add(info.Index);
+            }
+
+            retries.PlusOne(info.Index);
             _threadCount++;
+
             StartFetchOnThread(info);
         }

@@ -222,6 +224,46 @@
                 DataChanged(this, new DataChangedEventArgs(e.Error, e.Cancelled, e.TileInfo));
         }

+                /// <summary>
+        /// Keeps track of retries per tile. This class doesn't do much interesting work
+        /// but makes the rest of the code a bit easier to read.
+        /// </summary>
+        class Retries
+        {
+            private readonly IDictionary<TileIndex, int> _retries = new Dictionary<TileIndex, int>();
+            private readonly int _maxRetries;
+            private readonly int _threadId;
+            private const string CrossThreadExceptionMessage = "Cross thread access not allowed on class Retries";
+
+            public Retries(int maxRetries)
+            {
+                _maxRetries = maxRetries;
+                _threadId = Thread.CurrentThread.ManagedThreadId;
+            }
+
+            public bool ReachedMax(TileIndex index)
+            {
+                if (_threadId != Thread.CurrentThread.ManagedThreadId) throw new Exception(CrossThreadExceptionMessage);
+
+                var retryCount = (!_retries.Keys.Contains(index)) ? 0 : _retries[index];
+                return retryCount > _maxRetries;
+            }
+
+            public void PlusOne(TileIndex index)
+            {
+                if (_threadId != Thread.CurrentThread.ManagedThreadId) throw new Exception(CrossThreadExceptionMessage);
+
+                if (!_retries.Keys.Contains(index)) _retries.Add(index, 0);
+                else _retries[index]++;
+            }
+
+            public void Clear()
+            {
+                if (_threadId != Thread.CurrentThread.ManagedThreadId) throw new Exception(CrossThreadExceptionMessage);
+
+                _retries.Clear();
+            }
+        }

         public event PropertyChangedEventHandler PropertyChanged;


mistake assigning field

mistake assigning field

--- NSpecRunner/NSpecDomain.cs
+++ NSpecRunner/NSpecDomain.cs
@@ -19,7 +19,7 @@

         public void Run(RunnerInvocation invocation, Action<RunnerInvocation> action)
         {
-            this.dll = dll;
+            this.dll = invocation.Dll;

             var setup = new AppDomainSetup();


Formatting tweak

Formatting tweak

--- Navigation/StateHandler.cs
+++ Navigation/StateHandler.cs
@@ -3,6 +3,7 @@
 #if NET40Plus
 using System.Web.Routing;
 #endif
+
 namespace Navigation
 {
 	public class StateHandler : IStateHandler


Skip running gpt2 model in C# x86 (#6722)

--- csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
+++ csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
@@ -822,6 +822,7 @@
                 skipModels["test_vgg19"] = "Get preallocated buffer for initializer conv4_4_b_0 failed";
                 skipModels["GPT2_LM_HEAD"] = "System out of memory";
                 skipModels["GPT2"] = "System out of memory";
+                skipModels["test_GPT2"] = "System out of memory";
                 skipModels["tf_pnasnet_large"] = "Get preallocated buffer for initializer ConvBnFusion_BN_B_cell_5/comb_iter_1/left/bn_sep_7x7_1/beta:0_203 failed";
                 skipModels["tf_nasnet_large"] = "Get preallocated buffer for initializer ConvBnFusion_BN_B_cell_11/beginning_bn/beta:0_331 failed";
                 skipModels["test_zfnet512"] = "System out of memory";


Reminders: debug support for <30s reminders, fix remindme subcommand invocation not actually working

--- ModCore/Commands/Reminders.cs
+++ ModCore/Commands/Reminders.cs
@@ -1,4 +1,5 @@
-using System;
+#define HANSEN
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -15,7 +16,7 @@

 namespace ModCore.Commands
 {
-    [Group("reminder"), Aliases("remindme"), Description("Commands for managing your reminders.")]
+    [Group("reminder", CanInvokeWithoutSubcommand = true), Aliases("remindme"), Description("Commands for managing your reminders.")]
     public class Reminders
     {
         public SharedData Shared { get; }
@@ -102,7 +103,7 @@
             await ctx.TriggerTypingAsync();

             var (duration, text) = await Dates.ParseTime(dataToParse);
-            if (duration == TimeSpan.MinValue)
+            if (duration == Dates.ParsingError)
             {
                 await ctx.RespondAsync(
                     $"Sorry, there was an error parsing your reminder.\nIf you see a developer, this info might help them: {text}");
@@ -115,12 +116,13 @@
                     "Reminder text must to be no longer than 128 characters, not empty and not whitespace.");
                 return;
             }
-
+#if !HANSEN
             if (duration < TimeSpan.FromSeconds(30))
             {
                 await ctx.RespondAsync("Minimum required time span to set a reminder is 30 seconds.");
                 return;
             }
+#endif

             var now = DateTimeOffset.UtcNow;
             var dispatchAt = now + duration;


Se añade recuperación de Orders de un Customer

--- Northwind.Host.Web/AppHost.cs
+++ Northwind.Host.Web/AppHost.cs
@@ -51,6 +51,7 @@
 			JsConfig.EmitCamelCaseNames = true;
 			JsConfig.IncludeNullValues = false;
 			JsConfig.DateHandler = JsonDateHandler.ISO8601;
+			JsConfig.EscapeUnicode = true;

 			// ServiceStack
 			SetConfig(new EndpointHostConfig
@@ -58,13 +59,16 @@
 				DebugMode = true,
 			});

-			// Rutas
+			// Rutas
 			Routes
-				.Add<CollectionRequest<Customer>>("/customers", "GET, PUT")
-				.Add<SingleRequest<Customer>>("/customers/{Id}", "GET, DELETE, POST");
+				.Add<CollectionRequest<Customer>>("/customers", "GET, PUT")
+				.Add<SingleRequest<Customer>>("/customers/{Id}", "GET, DELETE, POST")
+				.Add<CollectionRequest<Order>>("/orders", "GET, PUT")
+				.Add<CustomerOrders>("/customers/{Id}/orders")
+				.Add<SingleRequest<Order>>("/orders/{Id}", "GET, DELETE, POST");

 			// Formatos
-			AtomFeedFormat.Register(this);
+			//AtomFeedFormat.Register(this);

 			// Plugins
 			Plugins.Add(new ValidationFeature());


Se corrige el registro de dependencias

Se corrige el registro de dependencias

--- Northwind.Test/TestAppHost.cs
+++ Northwind.Test/TestAppHost.cs
@@ -124,7 +124,8 @@
 			// Acceso a datos
 			var dbFactory = new OrmLiteConnectionFactory(":memory:", /*false,*/ SqliteDialect.Provider);

-			container.Register<IDbConnectionFactory>(dbFactory);
+			//container.Register<IDbConnectionFactory>(dbFactory);
+            container.Register(dbFactory);

 			using ( var db = dbFactory.OpenDbConnection() )
 			{
@@ -154,7 +155,10 @@
             //container.RegisterAs<RegionEntityRepository, IRegionEntityRepository>();
             //container.RegisterAs<TerritoryEntityRepository, ITerritoryEntityRepository>();

-            container.Register<ICustomerEntityRepository>(c => new CustomerEntityRepository(dbFactory));
+            container.Register<ICustomerEntityRepository>(c => new CustomerEntityRepository(dbFactory)
+            {
+                OrderRepository = new OrderEntityRepository(dbFactory)
+            });
             container.Register<IOrderEntityRepository>(c => new OrderEntityRepository(dbFactory));

             //container.RegisterAs<CategoryEntityRepository, IRepository<CategoryEntity>>();


Removing Interlocked

Removing Interlocked

Starting using a lock for the pages, so interlocked is kind of
guaranteed.

--- Nova/Controls/ExtendedPage.cs
+++ Nova/Controls/ExtendedPage.cs
@@ -155,7 +155,7 @@
         {
             lock (_Lock)
             {
-                var isLoading = Interlocked.Increment(ref _LoadingCounter) > 0;
+                var isLoading = ++_LoadingCounter > 0;

                 if (IsLoading == isLoading) return;

@@ -175,7 +175,7 @@
         {
             lock (_Lock)
             {
-                var isLoading = Interlocked.Decrement(ref _LoadingCounter) > 0;
+                var isLoading = --_LoadingCounter > 0;

                 if (IsLoading == isLoading) return;


[Core] Use NonValidated headers

[Core] Use NonValidated headers

--- src/Amazon.Core/Security/SignerV4.cs
+++ src/Amazon.Core/Security/SignerV4.cs
@@ -28,8 +28,8 @@

     public static string GetStringToSign(in CredentialScope scope, HttpRequestMessage request, out List<string> signedHeaders)
     {
-        string timestamp = request.Headers.TryGetValues("x-amz-date", out IEnumerable<string>? dateHeaderValues)
-            ? dateHeaderValues.First()
+        string timestamp = request.Headers.NonValidated.TryGetValues("x-amz-date", out var xAmzDateHeader)
+            ? xAmzDateHeader.ToString()
             : throw new Exception("Missing 'x-amz-date' header");

         return GetStringToSign(
@@ -157,8 +157,8 @@
         // STREAMING-AWS4-HMAC-SHA256-PAYLOAD
         // UNSIGNED-PAYLOAD

-        return request.Headers.TryGetValues("x-amz-content-sha256", out var contentSha256Header)
-            ? contentSha256Header.First()
+        return request.Headers.NonValidated.TryGetValues("x-amz-content-sha256", out var contentSha256Header)
+            ? contentSha256Header.ToString()
             : ComputeSHA256(request.Content);
     }

@@ -244,7 +244,7 @@

         string canonicalHeaders = requestUri.IsDefaultPort
             ? "host:" + requestUri.Host
-            : "host:" + requestUri.Host + ":" + requestUri.Port.ToString(CultureInfo.InvariantCulture);
+            : string.Create(CultureInfo.InvariantCulture, $"host:{requestUri.Host}:{requestUri.Port}");

         string canonicalRequest = GetCanonicalRequest(
             method               : method,
@@ -306,9 +306,9 @@
         ArgumentNullException.ThrowIfNull(credential);

         // If we're using S3, ensure the request content has been signed
-        if (scope.Service.Equals(AwsService.S3) && !request.Headers.Contains("x-amz-content-sha256"))
-        {
-            request.Headers.Add("x-amz-content-sha256", ComputeSHA256(request.Content!));
+        if (scope.Service.Equals(AwsService.S3) && !request.Headers.NonValidated.Contains("x-amz-content-sha256"))
+        {
+            request.Headers.TryAddWithoutValidation("x-amz-content-sha256", ComputeSHA256(request.Content!));
         }

         byte[] signingKey = ComputeSigningKey(credential.SecretAccessKey, scope);
@@ -438,16 +438,16 @@
     {
         signedHeaderNames = new List<string>(8);

-        if (request.Content is not null && request.Content.Headers.TryGetValues("Content-MD5", out var md5Header))
+        if (request.Content is not null && request.Content.Headers.NonValidated.TryGetValues("Content-MD5", out var md5Header))
         {
             signedHeaderNames.Add("content-md5");

             output.Append("content-md5:");
-            output.Append(md5Header.First());
+            output.Append(md5Header.ToString());
             output.Append('\n');
         }

-        if (!request.Headers.Contains("x-amz-date") && request.Headers.TryGetValues("Date", out var dateHeader))
+        if (!request.Headers.NonValidated.Contains("x-amz-date") && request.Headers.NonValidated.TryGetValues("Date", out var dateHeader))
         {
             signedHeaderNames.Add("date");

@@ -461,7 +461,7 @@
         output.Append("host:");
         output.Append(request.Headers.Host);

-        foreach (var header in request.Headers
+        foreach (var header in request.Headers.NonValidated
             .Where(item => item.Key.StartsWith("x-amz-", StringComparison.OrdinalIgnoreCase))
             .OrderBy(item => item.Key, StringComparer.OrdinalIgnoreCase))
         {
@@ -471,7 +471,7 @@

             output.Append(headerName);
             output.Append(':');
-            output.Append(header.Value.First());
+            output.Append(header.Value.ToString());

             signedHeaderNames.Add(headerName);
         }


Fixed issue with returning the same key list from BoboSubBrowser.GetNames, causing problems when trying to iterate the list.

--- src/BoboBrowse.Net/BoboSubBrowser.cs
+++ src/BoboBrowse.Net/BoboSubBrowser.cs
@@ -121,7 +121,7 @@
             get
             {
                 var map = FacetHandlerMap;
-                return map.Keys;
+                return map.Keys.ToArray();
             }
         }


Minor refactoring & TODO removal

Minor refactoring & TODO removal

--- src/FireworksNet/Problems/Problem.cs
+++ src/FireworksNet/Problems/Problem.cs
@@ -94,16 +94,25 @@

         public virtual Firework GetBest(IEnumerable<Firework> fireworks)
         {
-            // TODO: Cache IsGreater/IsLess in the class
             if (Target == ProblemTarget.Minimum)
             {
-                return fireworks.Aggregate((agg, next) => next.Quality.IsLess(agg.Quality) ? next : agg);
+				return fireworks.Aggregate(GetLessQualityFirework);
             }
             else
             {
-                return fireworks.Aggregate((agg, next) => next.Quality.IsGreater(agg.Quality) ? next : agg);
+				return fireworks.Aggregate(GetGreaterQualityFirework);
             }
         }
+
+		protected virtual Firework GetLessQualityFirework(Firework currentMin, Firework candidate)
+		{
+			return candidate.Quality.IsLess(currentMin.Quality) ? candidate : currentMin;
+		}
+
+		protected virtual Firework GetGreaterQualityFirework(Firework currentMax, Firework candidate)
+		{
+			return candidate.Quality.IsGreater(currentMax.Quality) ? candidate : currentMax;
+		}

         protected virtual void OnQualityCalculating(QualityCalculatingEventArgs eventArgs)
         {


updated plugin properties

updated plugin properties

--- SparseApp/Plugin/Plugin.cs
+++ SparseApp/Plugin/Plugin.cs
@@ -7,6 +7,12 @@
 {
     public class Plugin
     {
+        public bool RunOnStart { get; set; }

+        public bool RunOnRepoLoad { get; set; }
+
+        public string Name { get; set; }
+
+        public string Command { get; set; }
     }
 }


Command for setting game mode

Command for setting game mode

--- src/MiNET/TestPlugin/CoreCommands.cs
+++ src/MiNET/TestPlugin/CoreCommands.cs
@@ -67,6 +67,24 @@
 			}
 		}

+		[Command(Command = "gm")]
+		public void GameMode(Player player, int gameMode)
+		{
+			player.SendPackage(new McpeStartGame
+			{
+				seed = -1,
+				generator = 1,
+				gamemode = gameMode,
+				entityId = player.EntityId,
+				spawnX = player.Level.SpawnPoint.X,
+				spawnY = player.Level.SpawnPoint.Y,
+				spawnZ = player.Level.SpawnPoint.Z,
+				x = player.KnownPosition.X,
+				y = player.KnownPosition.Y,
+				z = player.KnownPosition.Z
+			});
+		}
+
 		[Command(Command = "tp")]
 		public void Teleport(Player player, int x, int y, int z)
 		{


Fix bug when splitting conjunctions

Fix bug when splitting conjunctions

--- src/NQuery/Optimization/Condition.cs
+++ src/NQuery/Optimization/Condition.cs
@@ -41,7 +41,7 @@
                 }
                 else
                 {
-                    yield return binary;
+                    yield return current;
                 }
             }
         }


Re-enable two methods in XmlReaderExtensions.

--- src/Narvalo.Common/Xml/XmlReader$.cs
+++ src/Narvalo.Common/Xml/XmlReader$.cs
@@ -149,21 +149,21 @@

         #region Wrappers not available with PCL.

-        ////public static DateTime ReadElementContentAsDateTime(this XmlReader @this, XName name)
-        ////{
-        ////    Require.NotNull(@this, nameof(@this));
-        ////    Require.NotNull(name, "name");
+        public static DateTime ReadElementContentAsDateTime(this XmlReader @this, XName name)
+        {
+            Require.NotNull(@this, nameof(@this));
+            Require.NotNull(name, "name");

-        ////    return @this.ReadElementContentAsDateTime(name.LocalName, name.NamespaceName);
-        ////}
+            return @this.ReadElementContentAsDateTime(name.LocalName, name.NamespaceName);
+        }

-        ////public static string ReadElementString(this XmlReader @this, XName name)
-        ////{
-        ////    Require.NotNull(@this, nameof(@this));
-        ////    Require.NotNull(name, "name");
+        public static string ReadElementString(this XmlReader @this, XName name)
+        {
+            Require.NotNull(@this, nameof(@this));
+            Require.NotNull(name, "name");

-        ////    return @this.ReadElementString(name.LocalName, name.NamespaceName);
-        ////}
+            return @this.ReadElementString(name.LocalName, name.NamespaceName);
+        }

         #endregion
     }


fix unit test

fix unit test

--- src/Parquet.Test/EndToEndTypeTest.cs
+++ src/Parquet.Test/EndToEndTypeTest.cs
@@ -70,13 +70,8 @@
          if(schema.ElementType == typeof(DateTime))
             actualValue = ((DateTimeOffset) actualValue).DateTime;

-         Assert.True(expectedValue == null && actualValue == null,
+         Assert.True(expectedValue == null && actualValue == null || expectedValue.Equals(actualValue),
             $"{name}| expected: {expectedValue}, actual: {actualValue}, schema element: {schema}");
-
-         Assert.True(expectedValue == null || expectedValue.Equals(actualValue),
-            $"{name}| expected: {expectedValue}, actual: {actualValue}, schema element: {schema}");
-
-         //if (schema.ElementType == typeof(decimal)) ParquetWriter.WriteFile(ds1, "c:\\tmp\\decimals.parquet");
       }
    }
 }


Bugfixes

Bugfixes


PhpArray implements IDictionary

PhpArray implements IDictionary

fixes https://github.com/peachpiecompiler/peachpie/issues/1034

--- src/Peachpie.Runtime/PhpHashtable.cs
+++ src/Peachpie.Runtime/PhpHashtable.cs
@@ -14,7 +14,7 @@
 	/// The hashtable storing entries with <see cref="string"/> and <see cref="int"/> keys in a manner of PHP.
 	///
 	[DebuggerNonUserCode]
-    public class PhpHashtable : IDictionary<IntStringKey, PhpValue>, IList, IList<PhpValue> // , IDictionary // , ICloneable
+    public class PhpHashtable : IDictionary<IntStringKey, PhpValue>, IList, IList<PhpValue>, IDictionary // , ICloneable
     {
         #region Fields and Properties

@@ -241,91 +241,132 @@
         #region IDictionaryAdapter

         //[Serializable]
-        public class IDictionaryAdapter : IDictionaryEnumerator
+        sealed class DictionaryAdapter : IDictionaryEnumerator
         {
             #region Fields

             ///
             /// Currently pointed element.
             ///
-            private OrderedDictionary.FastEnumerator enumerator;
+            OrderedDictionary.FastEnumerator _enumerator;

             #endregion

             #region Construction

-            public IDictionaryAdapter(PhpHashtable/*!*/table)
+            public DictionaryAdapter(PhpHashtable/*!*/table)
             {
                 Debug.Assert(table != null);
-                this.enumerator = table.GetFastEnumerator();
+                _enumerator = table.GetFastEnumerator();
             }

             #endregion

             #region IDictionaryEnumerator Members

-            public DictionaryEntry Entry
-            {
-                get { return new DictionaryEntry(Key, Value); }
-            }
-
-            public object Key
-            {
-                get
+            public DictionaryEntry Entry => new DictionaryEntry(Key, Value);
+
+            public object Key => _enumerator.CurrentKey.Object;
+
+            public object Value => _enumerator.CurrentValue.ToClr();
+
+            #endregion
+
+            #region IEnumerator Members
+
+            public object Current => this.Entry;
+
+            public bool MoveNext() => _enumerator.MoveNext();
+
+            public void Reset() => _enumerator.Reset();
+
+            #endregion
+        }
+
+        #endregion
+
+        #region DictionaryKeysValuesCollection
+
+        /// <remarks>Thread safe.</remarks>
+        sealed class DictionaryKeysOrValuesCollection : ICollection
+        {
+            ///
+            /// Array to be enumerated.
+            ///
+            readonly PhpHashtable _array;
+
+            ///
+            /// Whether the collection represents keys or values.
+            ///
+            readonly bool _keys;
+
+            ///
+            /// If the collection represents keys.
+            ///
+            public bool IsKeyCollection => _keys == true;
+
+            ///
+            /// If the collection represents values.
+            ///
+            public bool IsValueCollection => !IsKeyCollection;
+
+            ///
+            /// Creates the collection of keys or values over the given array.
+            ///
+            /// <exception cref="ArgumentNullException"></exception>
+            public DictionaryKeysOrValuesCollection(PhpHashtable array, bool keys)
+            {
+                _array = array ?? throw new ArgumentNullException(nameof(array));
+                _keys = keys;
+            }
+
+            public int Count => _array.Count;
+
+            public bool IsSynchronized => true;
+
+            public object SyncRoot => _array;
+
+            public void CopyTo(Array array, int index)
+            {
+                var enumerator = _array.GetFastEnumerator();
+                while (enumerator.MoveNext())
                 {
-                    return this.enumerator.CurrentKey.Object;
+                    array.SetValue(
+                        IsKeyCollection ? enumerator.CurrentKey.Object : enumerator.CurrentValue.ToClr(),
+                        index++);
                 }
             }

-            public object Value
-            {
-                get
+            public IEnumerator GetEnumerator()
+            {
+                var enumerator = _array.GetFastEnumerator();
+                while (enumerator.MoveNext())
                 {
-                    return this.enumerator.CurrentValue.ToClr();
+                    yield return IsKeyCollection ? enumerator.CurrentKey.Object : enumerator.CurrentValue.ToClr();
                 }
             }
-
-            #endregion
-
-            #region IEnumerator Members
-
-            public object Current
-            {
-                get { return this.Entry; }
-            }
-
-            public bool MoveNext()
-            {
-                return this.enumerator.MoveNext();
-            }
-
-            public void Reset()
-            {
-                this.enumerator.Reset();
-            }
-
-            #endregion
         }

         #endregion

         /// This property is always false.
-		public bool IsFixedSize { get { return false; } }
+        public bool IsFixedSize { get { return false; } }

         /// This property is always false.
 		public bool IsReadOnly { get { return false; } }

-        /////
-        ///// Returns an enumerator which iterates through values in this instance in order as they were added in it.
-        /////
-        ///// <returns>The enumerator.</returns>
-        //IDictionaryEnumerator/*!*/ IDictionary.GetEnumerator()
-        //{
-        //    if (this.Count == 0)
-        //        return OrderedDictionary.EmptyEnumerator.SingletonInstance;
-
-        //    return new IDictionaryAdapter(this); // new GenericDictionaryAdapter<object, object>(GetDictionaryEnumerator(), false);
-        //}
+        ///
+        /// Returns an enumerator which iterates through values in this instance in order as they were added in it.
+        ///
+        /// <returns>The enumerator.</returns>
+        IDictionaryEnumerator/*!*/ IDictionary.GetEnumerator()
+        {
+            return new DictionaryAdapter(this); // new GenericDictionaryAdapter<object, object>(GetDictionaryEnumerator(), false);
+        }
+
+        ICollection IDictionary.Keys => new DictionaryKeysOrValuesCollection(this, keys: true);
+
+        ICollection IDictionary.Values => new DictionaryKeysOrValuesCollection(this, keys: false);

         //private IEnumerator<KeyValuePair<object, object>>/*!*/ GetDictionaryEnumerator()
         //{


Dont use empty namespace as parameter namespace

--- src/SoapCore/OperationDescription.cs
+++ src/SoapCore/OperationDescription.cs
@@ -92,7 +92,7 @@
 				?? arrayAttribute?.Namespace
 				?? contract.Namespace;
 			var dataContractAttribute = info.ParameterType.GetCustomAttribute<DataContractAttribute>();
-			if (dataContractAttribute != null && dataContractAttribute.IsNamespaceSetExplicitly)
+			if (dataContractAttribute != null && dataContractAttribute.IsNamespaceSetExplicitly && !string.IsNullOrWhiteSpace(dataContractAttribute.Namespace))
 			{
 				parameterNs = dataContractAttribute.Namespace;
 			}


Fix docs on ProxyClientHandler

Fix docs on ProxyClientHandler

--- src/SocksSharp/ProxyClientHandler.cs
+++ src/SocksSharp/ProxyClientHandler.cs
@@ -26,7 +26,7 @@
         #region Properties

         /// <summary>
-        /// Current ProxyClient
+        /// Gets a current ProxyClient
         /// </summary>
         public IProxyClient<T> Proxy => proxyClient;

@@ -94,7 +94,7 @@
         #endregion

         /// <summary>
-        /// Create instance of new ProxyClientHandler with <see cref="ProxySettings"/> settings
+        /// Initializes a new instance of the <see cref="ProxyClientHandler{T}"/> with <see cref="ProxySettings"/> settings
         /// </summary>
         /// <param name="proxySettings">Proxy settings</param>
         /// <exception cref="ArgumentNullException">


Remove uneccessary if condition in CombinedImageTag

https://bugzilla.gnome.org/show_bug.cgi?id=619200

--- src/TagLib/Image/CombinedImageTag.cs
+++ src/TagLib/Image/CombinedImageTag.cs
@@ -519,7 +519,6 @@
 				foreach (ImageTag tag in AllTags) {
 					string value = tag.Model;

-					if (value != null)
 					if (!string.IsNullOrEmpty(value))
 						return value;
 				}


Set display window to false

Set display window to false

--- src/Tools/Source/RunTests/Program.cs
+++ src/Tools/Source/RunTests/Program.cs
@@ -258,7 +258,7 @@
             {
                 var screenshotPath = Path.Combine(options.LogFilesDirectory, $"timeout.png");
                 ConsoleUtil.WriteLine($"Taking screenshot on timeout at {screenshotPath}");
-                var output = await ProcessRunner.CreateProcess("Powershell.exe", $"-command \"& {{ . .\\eng\\build-utils-win.ps1; Capture-Screenshot {screenshotPath} }}\"", cancellationToken: cancellationToken).Result;
+                var output = await ProcessRunner.CreateProcess("Powershell.exe", $"-command \"& {{ . .\\eng\\build-utils-win.ps1; Capture-Screenshot {screenshotPath} }}\"", displayWindow: false, cancellationToken: cancellationToken).Result;
                 ConsoleUtil.WriteLine(string.Join(Environment.NewLine, output.OutputLines));
                 ConsoleUtil.WriteLine(string.Join(Environment.NewLine, output.ErrorLines));
             }