Fixed [YAF-129] Link to most recent post problem

--- yafsrc/YetAnotherForum.NET/pages/posts.ascx.cs
+++ yafsrc/YetAnotherForum.NET/pages/posts.ascx.cs
@@ -997,9 +997,10 @@
                         (int)Math.Floor((double)selectedMessage.Field<int>("Position") / this.Pager.PageSize);
                 }

+                // NOTE : tha_watcha: I think Not Needed anymore
                 // move to this message on load...
-                PageContext.PageElements.RegisterJsBlockStartup(
-                    this, "GotoAnchorJs", JavaScriptBlocks.LoadGotoAnchor("post{0}".FormatWith(findMessageId)));
+               /* PageContext.PageElements.RegisterJsBlockStartup(
+                    this, "GotoAnchorJs", JavaScriptBlocks.LoadGotoAnchor("post{0}".FormatWith(findMessageId)));*/
             }

             var pagedData = rowList.Skip(this.Pager.SkipIndex).Take(this.Pager.PageSize);


Revert "Merge pull request #121 from romans91/RS_17146_FieldAddressBlock"

This reverts commit 0014207bc73f24d89f1531047b60fc4cc75b7243, reversing
changes made to 1768cd1f7bb642862a1f5481a6640c3d000ed538.

--- ApiExamples/CSharp/ApiExamples/ExField.cs
+++ ApiExamples/CSharp/ApiExamples/ExField.cs
@@ -595,47 +595,5 @@
                 curNode = nextNode;
             }
         }
-
-        [Test]
-        public void FieldAddressBlockEx()
-        {
-            //ExStart
-            //ExFor:Fields.FieldAddressBlock.ExcludedCountryOrRegionName
-            //ExFor:Fields.FieldAddressBlock.FormatAddressOnCountryOrRegion
-            //ExFor:Fields.FieldAddressBlock.IncludeCountryOrRegionName
-            //ExFor:Fields.FieldAddressBlock.LanguageId
-            //ExFor:Fields.FieldAddressBlock.NameAndAddressFormat
-            //ExSummary:Shows how to build a field address block.
-            Document doc = new Document();
-            DocumentBuilder builder = new DocumentBuilder(doc);
-
-            // Use a document builder to insert a field address block
-            FieldAddressBlock field = (FieldAddressBlock)builder.InsertField(FieldType.FieldAddressBlock, true);
-
-            // Initially our field is an empty address block field with null attributes
-            Assert.AreEqual(" ADDRESSBLOCK ", field.GetFieldCode());
-
-            // Setting this to "2" will cause all countries/regions to be included, unless it is the one specified in the ExcludedCountryOrRegionName attribute
-            field.IncludeCountryOrRegionName = "2";
-            field.FormatAddressOnCountryOrRegion = true;
-            field.ExcludedCountryOrRegionName = "United States";
-
-            // Specify our own name and address format
-            field.NameAndAddressFormat = "<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>";
-
-            // By default, the language ID will be set to that of the first character of the document
-            // In this case we will specify it to be English
-            field.LanguageId = "1033";
-
-            // Our field code has changed according to the attribute values that we set
-            Assert.AreEqual(" ADDRESSBLOCK  \\c 2 \\d \\e \"United States\" \\f \"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\" \\l 1033", field.GetFieldCode());
-            //ExEnd
-
-            Assert.AreEqual("2", field.IncludeCountryOrRegionName);
-            Assert.AreEqual(true, field.FormatAddressOnCountryOrRegion);
-            Assert.AreEqual("United States", field.ExcludedCountryOrRegionName);
-            Assert.AreEqual("<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>", field.NameAndAddressFormat);
-            Assert.AreEqual("1033", field.LanguageId);
-        }
     }
 }


Fix song saving bug (lastfm)

Fix song saving bug (lastfm)

--- Apps/Audiotica.Shared/CollectionHelper.cs
+++ Apps/Audiotica.Shared/CollectionHelper.cs
@@ -1360,14 +1360,16 @@
                 return result.Error;
             }

-            if (result.Song != null))
-            {
+            if (result.Song != null)
+            {
+#pragma warning disable 4014
                 if (!result.Song.Album.HasArtwork && !result.Song.Album.NoArtworkFound)
                 {
                     SaveAlbumImageAsync(result.Song.Album, album.Images[0].Url);
                 }

                 DownloadArtistsArtworkAsync();
+#pragma warning restore 4014
             }

             return result.Error;
@@ -1375,6 +1377,11 @@

         private static async Task<SavingError> _SaveTrackAsync(LastTrack track)
         {
+            if (track == null)
+            {
+                return SavingError.Unknown;
+            }
+
             var alreadySaving = LastfmSavingTracks.FirstOrDefault(p => p == track.Id) != null;

             if (alreadySaving)
@@ -1406,19 +1413,24 @@

             LastfmSavingTracks.Remove(track.Id);

-            if (!result.Song.Album.HasArtwork && !result.Song.Album.NoArtworkFound)
-            {
-                if (track.Images != null && track.Images.Largest != null)
-                {
-                    SaveAlbumImageAsync(result.Song.Album, track.Images.Largest.AbsoluteUri);
-                }
-                else
-                {
-                    DownloadAlbumsArtworkAsync();
+#pragma warning disable 4014
+            if (result.Song != null)
+            {
+                if (!result.Song.Album.HasArtwork && !result.Song.Album.NoArtworkFound)
+                {
+                    if (track.Images != null && track.Images.Largest != null)
+                    {
+                        SaveAlbumImageAsync(result.Song.Album, track.Images.Largest.AbsoluteUri);
+                    }
+                    else
+                    {
+                        DownloadAlbumsArtworkAsync();
+                    }
                 }
             }

             DownloadArtistsArtworkAsync();
+#pragma warning restore 4014
             return result.Error;
         }


Votyra: fixed async to be in editor

Votyra: fixed async to be in editor

--- Assets/Votyra/Core.Unity/TerrainConfig.cs
+++ Assets/Votyra/Core.Unity/TerrainConfig.cs
@@ -9,7 +9,7 @@
             CellInGroupCount = cellInGroupCount;
             FlipTriangles = flipTriangles;
             DrawBounds = drawBounds;
-#if UNITY_WEBGL
+#if UNITY_WEBGL && !UNITY_EDITOR
             Async = false;
 #else
             Async = async;


refactored

refactored

--- Backendless/Service/PersistenceService.cs
+++ Backendless/Service/PersistenceService.cs
@@ -902,8 +902,6 @@
         throw new ArgumentNullException( ExceptionMessage.NULL_ENTITY );

       return SubArgsCreator<T>( relations, relationsDepth, entity );
-
-      throw new ArgumentException( ExceptionMessage.WRONG_ENTITY_TYPE );
     }

     private Object[] SubArgsCreator<T>( IList<String> relations, int? Depth, Object obj )
@@ -912,7 +910,7 @@
         relations = new List<String>();

       AddWeborbPropertyMapping<T>();
-      List<Object> args = new List<Object>{ GetTypeName( typeof( T)) };
+      List<Object> args = new List<Object> { GetTypeName( typeof( T ) ) };

       if( obj != null )
         args.Add( obj );


TED-3: Added Exception.ToString() (#4)

TED-3: Added Exception.ToString() (#4)

* TED-3: using Exception.ToString()

--- BunyanLambdaLogger/BunyanLambdaILogger.cs
+++ BunyanLambdaLogger/BunyanLambdaILogger.cs
@@ -121,7 +121,7 @@

       message.time = DateTime.UtcNow;

-      if (exception != null) message.err = JObject.FromObject(exception);
+      if (exception != null) message.err = exception.ToString();

       if (eventId.Id != 0)
       {


Removed [Obsolete] from ValueObject<T>

Removed [Obsolete] from ValueObject<T>

--- CSharpFunctionalExtensions/ValueObject.cs
+++ CSharpFunctionalExtensions/ValueObject.cs
@@ -5,7 +5,9 @@

 namespace CSharpFunctionalExtensions
 {
-    [Obsolete("Use non-generic ValueObject instead: http://bit.ly/vo-new")]
+    /// <summary>
+    /// Use non-generic ValueObject whenever possible: http://bit.ly/vo-new
+    /// </summary>
     public abstract class ValueObject<T>
         where T : ValueObject<T>
     {


Set environment current dir for Cake

Set environment current dir for Cake

--- Cake.FileHelpers.Tests/FileHelperTests.cs
+++ Cake.FileHelpers.Tests/FileHelperTests.cs
@@ -9,6 +9,12 @@
     public class FileHelperTests
     {
         FakeCakeContext context;
+
+		[OneTimeSetUp]
+		public void RunBeforeAnyTests()
+		{
+			Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(typeof(FileHelperTests).Assembly.Location);
+		}

         [SetUp]
         public void Setup ()


fixed application titles

fixed application titles

--- Chapter3/Example3/Example3.Web/AppHost.cs
+++ Chapter3/Example3/Example3.Web/AppHost.cs
@@ -6,7 +6,7 @@
     public class AppHost : AppHostBase
     {
         public AppHost()
-            : base("Chapter3 Example2", typeof (AppHost).Assembly)
+            : base("Chapter3 Example3", typeof (AppHost).Assembly)
         {
         }


Improve error messages in AlpacaBrokerageModel

--- Common/Brokerages/AlpacaBrokerageModel.cs
+++ Common/Brokerages/AlpacaBrokerageModel.cs
@@ -151,7 +151,7 @@
                     var openBuyQuantity = openOrders.Where(x => x.Direction == OrderDirection.Buy).Sum(x => x.Quantity);

                     message = new BrokerageMessageEvent(BrokerageMessageType.Warning, "NotSupported",
-                        $"The {nameof(AlpacaBrokerageModel)} does not support shorting with open buy orders" +
+                        $"The {nameof(AlpacaBrokerageModel)} does not support submitting sell orders with open buy orders" +
                         $" [position:{security.Holdings.Quantity}, order quantity:{order.Quantity}, " +
                         $"open buy orders quantity:{openBuyQuantity}]."
                     );
@@ -165,7 +165,7 @@
                     var openSellQuantity = openOrders.Where(x => x.Direction == OrderDirection.Sell).Sum(x => x.Quantity);

                     message = new BrokerageMessageEvent(BrokerageMessageType.Warning, "NotSupported",
-                        $"The {nameof(AlpacaBrokerageModel)} does not support buying with open sell orders" +
+                        $"The {nameof(AlpacaBrokerageModel)} does not support submitting buy orders with open sell orders" +
                         $" [position:{security.Holdings.Quantity}, order quantity:{order.Quantity}, " +
                         $"open sell orders quantity:{openSellQuantity}]."
                     );


Update MenuTest.cs

Update MenuTest.cs

--- Core/NakedFunctions.Rest.Test/MenuTest.cs
+++ Core/NakedFunctions.Rest.Test/MenuTest.cs
@@ -241,26 +241,28 @@
             Assert.AreEqual("Fred1", resultObj["members"]["Name"]["value"].ToString());
         }

-        //[Test]
-        //public void TestInvokeMenuActionThatUpdatesListAndReturnsIt()
-        //{
-        //    var api = Api();
-        //    api.HttpContext.Request.Method = "POST";
-        //    var result = api.PostInvokeOnService("MenuFunctions", "GetAndUpdateSimpleRecords", new ArgumentMap { Map = new Dictionary<string, IValue>() });
-        //    var (json, sc, headers) = Helpers.ReadActionResult(result, api.ControllerContext.HttpContext);
-
-        //    Assert.AreEqual((int)HttpStatusCode.OK, sc);
-        //    var parsedResult = JObject.Parse(json);
-
-
-        //    Assert.AreEqual("list", parsedResult["resultType"].ToString());
-
-        //    //var resultObj = parsedResult["result"];
-
-        //    //Assert.AreEqual("3", resultObj["instanceId"].ToString());
-        //    //Assert.AreEqual("NakedFunctions.Rest.Test.Data.SimpleRecord", resultObj["domainType"].ToString());
-        //    //Assert.AreEqual("Untitled Simple Record", resultObj["title"].ToString());
-        //    //Assert.AreEqual("Ted0", resultObj["members"]["Name"]["value"].ToString());
-        //}
+        [Test]
+        public void TestInvokeMenuActionThatUpdatesListAndReturnsIt()
+        {
+            var api = Api();
+            api.HttpContext.Request.Method = "POST";
+            var result = api.PostInvokeOnService("MenuFunctions", "GetAndUpdateSimpleRecords", new ArgumentMap { Map = new Dictionary<string, IValue>() });
+            var (json, sc, headers) = Helpers.ReadActionResult(result, api.ControllerContext.HttpContext);
+
+            Assert.AreEqual((int)HttpStatusCode.OK, sc);
+            var parsedResult = JObject.Parse(json);
+
+
+            Assert.AreEqual("list", parsedResult["resultType"].ToString());
+
+            var item1 = parsedResult["result"]["value"][0];
+            var item2 = parsedResult["result"]["value"][1];
+            var item3 = parsedResult["result"]["value"][2];
+
+            item1.AssertObjectElementLink("Untitled Simple Record", "GET", "NakedFunctions.Rest.Test.Data.SimpleRecord", "1");
+            item2.AssertObjectElementLink("Untitled Simple Record", "GET", "NakedFunctions.Rest.Test.Data.SimpleRecord", "2");
+            item3.AssertObjectElementLink("Untitled Simple Record", "GET", "NakedFunctions.Rest.Test.Data.SimpleRecord", "3");
+
+        }
     }
 }


Implemented optimizations

Implemented optimizations

Code taken from http://aggregate.org/MAGIC/#Most%20Significant%201%20Bit

--- Core/Theraot/Core/NumericHelper.Primes.cs
+++ Core/Theraot/Core/NumericHelper.Primes.cs
@@ -719,44 +719,50 @@
         {
             if (number == 0)
             {
-                throw new ArgumentException("The  logarithm  of  zero  is  not  defined.");
+                throw new ArgumentException("The logarithm of zero is not defined.");
             }
             if (number <= 0)
             {
-                throw new ArgumentException("The  logarithm  of  negative  numbers  are  imaginary.");
+                throw new ArgumentException("The logarithm of a negative number is imaginary.");
             }
             else
             {
-                int result = 0;
-                int test = 1;
-                while (true)
-                {
-                    if (number == test)
-                    {
-                        return result;
-                    }
-                    if (number < test)
-                    {
-                        return result - 1;
-                    }
-                    test = test << 1;
-                    result++;
-                }
+                number |= (number >> 1);
+                number |= (number >> 2);
+                number |= (number >> 4);
+                number |= (number >> 8);
+                number |= (number >> 16);
+                return (PopulationCount(number >> 1));
             }
         }

         [global::System.Diagnostics.DebuggerNonUserCode]
         public static int NextPowerOf2(int number)
         {
-            int result = 1;
-            while (true)
-            {
-                if (number <= result)
+            if (number < 0)
+            {
+                return 1;
+            }
+            else
+            {
+                uint _number;
+                unchecked
                 {
-                    return result;
+                    _number = (uint)number;
                 }
-                result = result << 1;
-            }
+                return (int)NextPowerOf2(_number);
+            }
+        }
+
+        [CLSCompliantAttribute(false)]
+        public static uint NextPowerOf2(uint number)
+        {
+            number |= (number >> 1);
+            number |= (number >> 2);
+            number |= (number >> 4);
+            number |= (number >> 8);
+            number |= (number >> 16);
+            return(number+1);
         }

         [global::System.Diagnostics.DebuggerNonUserCode]


[Update] 座標変換行列をEntity#Frame内で更新

[Update] 座標変換行列をEntity#Frame内で更新

--- CurtainFireMakerPlugin/Entities/Entity.cs
+++ CurtainFireMakerPlugin/Entities/Entity.cs
@@ -11,19 +11,11 @@
 {
     public class Entity : DynamicObject
     {
-        public virtual Matrix4 WorldMat => ParentEntity != null ? LocalMat * ParentEntity.WorldMat : LocalMat;
+        public virtual Matrix4 WorldMat { get; private set; }
         public Vector3 WorldPos => WorldMat.Translation;
         public Matrix3 WorldRot => WorldMat;

-        public virtual Matrix4 LocalMat
-        {
-            get => new Matrix4(Rot, Pos);
-            set
-            {
-                Pos = value.Translation;
-                Rot = value;
-            }
-        }
+        public virtual Matrix4 LocalMat { get; private set; }
         public virtual Vector3 Pos { get; set; }
         public virtual Quaternion Rot { get; set; } = Quaternion.Identity;

@@ -58,18 +50,16 @@

         public virtual void Frame()
         {
-            UpdateTasks();
+            TaskManager.Frame();

             FrameCount++;
             if (DiedDecision(this))
             {
                 OnDeath();
             }
-        }

-        protected virtual void UpdateTasks()
-        {
-            TaskManager.Frame();
+            LocalMat = new Matrix4(Rot, Pos);
+            WorldMat = ParentEntity != null ? ParentEntity.WorldMat * LocalMat : LocalMat;
         }

         public void __call__()


Ensure that the core properties are there before saving them, in case they have not yet been lazy-created

--- ooxml/openxml4Net/OPC/ZipPackage.cs
+++ ooxml/openxml4Net/OPC/ZipPackage.cs
@@ -444,6 +444,9 @@
                 {
                     logger.Log(POILogger.DEBUG, "Save core properties part");

+                    // Ensure that core properties are added if missing
+                    GetPackageProperties();
+
                     // Add core properties to part list ...
                     AddPackagePart(this.packageProperties);


move list ctor into CombineReferencedAssemblies()

--- src/Tasks/CodeTaskFactory.cs
+++ src/Tasks/CodeTaskFactory.cs
@@ -732,8 +732,7 @@
         private Assembly CompileInMemoryAssembly()
         {
             // Combine our default assembly references with those specified
-            var finalReferencedAssemblies = new List<string>();
-            CombineReferencedAssemblies(finalReferencedAssemblies);
+            var finalReferencedAssemblies = CombineReferencedAssemblies();

             // Combine our default using's with those specified
             string[] finalUsingNamespaces = CombineUsingNamespaces();
@@ -862,8 +861,10 @@
         /// <summary>
         /// Combine our default referenced assemblies with those explicitly specified
         /// </summary>
-        private void CombineReferencedAssemblies(List<string> finalReferenceList)
-        {
+        private List<string> CombineReferencedAssemblies()
+        {
+            List<string> finalReferenceList = new List<string>(s_defaultReferencedFrameworkAssemblyNames.Length + 2 + _referencedAssemblies.Count);
+
             foreach (string defaultReference in DefaultReferencedAssemblies)
             {
                 AddReferenceAssemblyToReferenceList(finalReferenceList, defaultReference);
@@ -876,6 +877,8 @@
                     AddReferenceAssemblyToReferenceList(finalReferenceList, referenceAssembly);
                 }
             }
+
+            return finalReferenceList;
         }

         /// <summary>


[Maths] Add per component absolute value for vector2

--- Source/SharpDX.Mathematics/Vector2.cs
+++ Source/SharpDX.Mathematics/Vector2.cs
@@ -445,6 +445,29 @@
         }

         /// <summary>
+        /// Returns per component absolute value of a vector
+        /// </summary>
+        /// <param name="value">Input vector</param>
+        /// <param name="result">When the method completes, contains a vector with each component being the absolute value of the input component</param>
+        public static void Abs(ref Vector2 value, out Vector2 result)
+        {
+            result = new Vector2(value.X > 0.0f ? value.X : -value.X,
+                value.Y > 0.0f ? value.Y : -value.Y);
+        }
+
+        /// <summary>
+        /// Returns per component absolute value of a vector
+        /// </summary>
+        /// <param name="value">Input vector</param>
+        /// <returns>A vector with each component being the absolute value of the input component</returns>
+        public static Vector2 Abs(Vector2 value)
+        {
+            return new Vector2(
+                value.X > 0.0f ? value.X : -value.X,
+                value.Y > 0.0f ? value.Y : -value.Y);
+        }
+
+        /// <summary>
         /// Returns a <see cref="Vector2"/> containing the 2D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle.
         /// </summary>
         /// <param name="value1">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 1 of the triangle.</param>


Remove unused property from Track model

Remove unused property from Track model

--- SpotiPeek/SpotiPeek.App/TrackModel.cs
+++ SpotiPeek/SpotiPeek.App/TrackModel.cs
@@ -11,6 +11,5 @@
         public string SongTitle;
         public string ArtistName;
         public string AlbumTitle;
-        public string AlbumYear;
     }
 }


Parse Arguments without parenthesis (parse dot dot WIP)

--- Src/CrysSharp.Core/Compiler/Parser.cs
+++ Src/CrysSharp.Core/Compiler/Parser.cs
@@ -120,10 +120,12 @@
             {
                 String name = this.ParseName();

-                IList<IExpression> arguments = new List<IExpression>();
+                IList<IExpression> arguments;

                 if (this.TryParseToken(TokenType.Separator, "("))
-                    arguments = this.ParseArguments();
+                    arguments = this.ParseEnclosedArguments();
+                else
+                    arguments = this.ParseOpenArguments();

                 expr = new DotExpression(expr, name, arguments);
             }
@@ -131,7 +133,7 @@
             return expr;
         }

-        private IList<IExpression> ParseArguments()
+        private IList<IExpression> ParseEnclosedArguments()
         {
             IList<IExpression> arguments = new List<IExpression>();

@@ -141,6 +143,21 @@
                     this.ParseToken(TokenType.Separator, ",");

                 arguments.Add(this.ParseExpression());
+            }
+
+            return arguments;
+        }
+
+        private IList<IExpression> ParseOpenArguments()
+        {
+            IList<IExpression> arguments = new List<IExpression>();
+
+            for (IExpression expr = this.ParseExpression(); expr != null; expr = this.ParseExpression())
+            {
+                arguments.Add(expr);
+
+                if (!this.TryParseToken(TokenType.Separator, ","))
+                    break;
             }

             return arguments;
@@ -204,8 +221,12 @@
                 return new ClassVariableExpression(token.Value);
             if (token.Type == TokenType.InstanceVarName)
                 return new InstanceVariableExpression(token.Value);
-
-            return new VariableExpression(token.Value);
+            if (token.Type == TokenType.Name)
+                return new VariableExpression(token.Value);
+
+            this.lexer.PushToken(token);
+
+            return null;
         }

         private IExpression ParseTupleExpression()


ResetGame func

ResetGame func

--- Synced/Synced/Interface/GameScreen.cs
+++ Synced/Synced/Interface/GameScreen.cs
@@ -83,6 +83,12 @@
             world.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));
             base.Update(gameTime);
         }
+
+        public void ResetGame()
+        {
+            SyncedGameCollection.ComponentCollection.Clear();
+            world.Clear();
+        }
     }
 }


Added test link.

Added test link.

--- Tests/Linq/DataProvider/MySqlTests.cs
+++ Tests/Linq/DataProvider/MySqlTests.cs
@@ -733,6 +733,7 @@
 			throw new NotImplementedException();
 		}

+		[Description("https://stackoverflow.com/questions/50858172/linq2db-mysql-set-row-index/50958483")]
 		[Test, MySqlDataContext]
 		public void RowIndexTest(string context)
 		{


修改 sqlite连接字符串去除Version=3; 修改password提示

修改 sqlite连接字符串去除Version=3; 修改password提示

--- ToolGood.ReadyGo3/SqlHelperFactory.cs
+++ ToolGood.ReadyGo3/SqlHelperFactory.cs
@@ -219,14 +219,14 @@
         /// 打开Sqlite数据库 使用System.Data.SQLite类库
         /// </summary>
         /// <param name="filePath">文件目录</param>
-        /// <param name="pwd">密码</param>
+        /// <param name="pwd">密码，新版本dll不支持</param>
         /// <param name="useSynchronous">使用同步，为False则更快</param>
         /// <param name="journalMode">Journal模式</param>
         /// <returns></returns>
         public static SqlHelper OpenSqliteFile(string filePath, string pwd = "", bool useSynchronous = true, JournalMode journalMode = JournalMode.Delete)
         {
             StringBuilder sb = new StringBuilder();
-            sb.AppendFormat("Data Source={0};Version=3;", filePath);
+            sb.AppendFormat("Data Source={0};", filePath);
             //sb.AppendFormat("Data Source={0};", filePath);
             if (string.IsNullOrEmpty(pwd) == false) {
                 sb.AppendFormat("Password={0};", pwd);


CA-238901: PVS proxy not setup for imported VM

For ElyOrGreater hosts, we try move the existing VIFs to the desired networks. We will only destroy and create new ones for older hosts or when a corresponding VIF cannot be found in the network mapping.

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenModel/Actions/VM/ImportVmAction.cs
+++ XenModel/Actions/VM/ImportVmAction.cs
@@ -33,6 +33,7 @@
 using System.ComponentModel;
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Text;
 using System.Net;
 using XenAdmin.Core;
@@ -166,10 +167,13 @@
                 {
                     Description = isTemplate ? Messages.IMPORT_TEMPLATE_UPDATING_NETWORKS : Messages.IMPORTVM_UPDATING_NETWORKS;

-                    // We need to destroy all vifs and recreate them.
+                    // For ElyOrGreater hosts, we can move the VIFs to another network,
+                    // but for older hosts we need to destroy all vifs and recreate them

                     List<XenRef<VIF>> vifs = VM.get_VIFs(Session, vmRef);
                     List<XenAPI.Network> networks = new List<XenAPI.Network>();
+
+                    bool canMoveVifs = Helpers.ElyOrGreater(Connection);

                     foreach (XenRef<VIF> vif in vifs)
                     {
@@ -178,9 +182,27 @@
                         if (network != null)
                             networks.Add(network);

+                        if (canMoveVifs)
+                        {
+                            var vifObj = Connection.Resolve(vif);
+                            if (vifObj == null)
+                                continue;
+                            // try to find a matching VIF in the m_proxyVIFs list, based on the device field
+                            var matchingProxyVif = m_proxyVIFs.FirstOrDefault(proxyVIF => proxyVIF.device == vifObj.device);
+                            if (matchingProxyVif != null)
+                            {
+                                // move the VIF to the desired network
+                                VIF.move(Session, vif, matchingProxyVif.network);
+                                // remove matchingProxyVif from the list, so we don't create the VIF again later
+                                m_proxyVIFs.Remove(matchingProxyVif);
+                                continue;
+                            }
+                        }
+                        // destroy the VIF, if we haven't managed to move it
                         VIF.destroy(Session, vif);
                     }

+                    // recreate VIFs if needed (m_proxyVIFs can be empty, if we moved all the VIFs in the previous step)
                     foreach (Proxy_VIF proxyVIF in m_proxyVIFs)
                     {
                         VIF vif = new VIF(proxyVIF) {VM = new XenRef<VM>(vmRef)};


Fixed bug in Configuration Command Class

--- ZWave/CommandClasses/Configuration.cs
+++ ZWave/CommandClasses/Configuration.cs
@@ -63,10 +63,10 @@

         public async Task Set(byte parameter, ulong value)
         {
-            await Set(parameter, value, false);
+            await Set(parameter, (long)value, false);
         }

-        private async Task Set(byte parameter, object value, bool signed)
+        private async Task Set(byte parameter, long value, bool signed)
         {
             // extra roundtrip to get the correct size of the parameter
             var response = await Channel.Send(Node, new Command(Class, command.Get, parameter), command.Report);


Suppressing .NET static analysis warnings

--- dotnet/src/webdriver/Remote/RemoteWebDriver.cs
+++ dotnet/src/webdriver/Remote/RemoteWebDriver.cs
@@ -568,7 +568,7 @@
             if (this.IsSpecificationCompliant)
             {
                 string selector = EscapeCssSelector(id);
-                if (selector == string.Empty)
+                if (string.IsNullOrEmpty(selector))
                 {
                     // Finding multiple elements with an empty ID will return
                     // an empty list. However, finding by a CSS selector of '#'


Fix hosting startup tests (#81).

Fix hosting startup tests (#81).

--- sample/ApplicationInsightsHostingStartupSample/Startup.cs
+++ sample/ApplicationInsightsHostingStartupSample/Startup.cs
@@ -73,13 +73,13 @@

         public static void Main(string[] args)
         {
+            var config = new ConfigurationBuilder()
+                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+                .AddCommandLine(args)
+                .Build();

             var host = new WebHostBuilder()
-                .ConfigureAppConfiguration((hostingContext, config) =>
-                {
-                    config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
-                    config.AddCommandLine(args);
-                })
+                .UseConfiguration(config)
                 .ConfigureLogging((hostingContext, builder) =>
                 {
                     builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));


add DefaultFileSystems

add DefaultFileSystems

--- source/Cosmos.System2/FileSystem/VFS/FileSystemManager.cs
+++ source/Cosmos.System2/FileSystem/VFS/FileSystemManager.cs
@@ -5,12 +5,17 @@
 {
     public static class FileSystemManager
     {
-        private static List<FileSystemFactory> registeredFileSystems =
-            new List<FileSystemFactory>() {
-                new FAT.FatFileSystemFactory(),
-                new ISO9660.ISO9660FileSystemFactory()
-            };
-
+        private static List<FileSystemFactory> registeredFileSystems = DefaultFileSystems;
+
+        public static List<FileSystemFactory> DefaultFileSystems {
+            get {
+                return new List<FileSystemFactory>() {
+                    new FAT.FatFileSystemFactory(),
+                    new ISO9660.ISO9660FileSystemFactory()
+                };
+            }
+        }
+
         public static List<FileSystemFactory> RegisteredFileSystems { get {
             return registeredFileSystems;
         }}


Fix Empty

Fix Empty

--- src/CommonTasks.cs
+++ src/CommonTasks.cs
@@ -29,9 +29,9 @@

     static class Empty
     {
-        public static Array<T> => Backing<T>.Array;
-        public static List<T> => Backing<T>.List;
-        public static Dictionary<TKey, TValue> => Backing<TKey, TValue>.Dictionary;
+        public static T[] Array<T>() => Backing<T>.Array;
+        public static List<T> List<T>() => Backing<T>.List;
+        public static Dictionary<TKey, TValue> Dictionary<TKey, TValue>() => Backing<TKey, TValue>.Dictionary;

         class Backing<T>
         {


Update SpeciesData.cs

Update SpeciesData.cs

--- src/SpeciesData.cs
+++ src/SpeciesData.cs
@@ -1,4 +1,3 @@
-//  Copyright 2007-2010 Portland State University, University of Wisconsin-Madison
 //  Author: Robert Scheller, Melissa Lucash

 using Landis.Core;


More efficient adding testdata (demo-project)


Make sure ScriptLoader uses correct root path


removed useless stuff

removed useless stuff


added ToString in MainAvatar.InstantMessage

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1408 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/MainAvatar.cs
+++ libsecondlife/MainAvatar.cs
@@ -31,6 +31,7 @@
 using System.Collections.Generic;
 using System.Threading;
 using System.Text;
+using System.Reflection;
 using libsecondlife.Packets;

 namespace libsecondlife
@@ -419,6 +420,17 @@
         public InstantMessageOnline Offline;
         /// <summary>Context specific packed data</summary>
         public byte[] BinaryBucket;
+		//Print the contents of a message
+		public override string ToString(){
+			string result="";
+			Type imType = this.GetType();
+			FieldInfo[] fields = imType.GetFields();
+			foreach (FieldInfo field in fields){
+				result += (field.Name + " = " + field.GetValue(this) );
+			}
+			return result;
+
+		}
 	}

 	#endregion Structs


Move GameMode's Anchor and Origin to constructor to allow overriding.

--- osu.Framework/GameModes/GameMode.cs
+++ osu.Framework/GameModes/GameMode.cs
@@ -17,7 +17,7 @@

         public bool IsCurrentGameMode => ChildGameMode == null;

-        protected ContentContainer Content;
+        public Container Content;

         protected override Container AddTarget => Content;

@@ -28,6 +28,8 @@
         public GameMode()
         {
             RelativeSizeAxes = Axes.Both;
+            Anchor = Anchor.Centre;
+            Origin = Anchor.Centre;
         }

         /// <summary>
@@ -75,9 +77,6 @@
         public override void Load()
         {
             base.Load();
-
-            Anchor = Anchor.Centre;
-            Origin = Anchor.Centre;

             AddTopLevel(Content = new ContentContainer()
             {


Add osu! prefix to mode descriptions.

Add osu! prefix to mode descriptions.

--- osu.Game/GameModes/Play/PlayMode.cs
+++ osu.Game/GameModes/Play/PlayMode.cs
@@ -10,11 +10,11 @@
     {
         [Description(@"osu!")]
         Osu = 0,
-        [Description(@"taiko")]
+        [Description(@"osu!taiko")]
         Taiko = 1,
-        [Description(@"catch")]
+        [Description(@"osu!catch")]
         Catch = 2,
-        [Description(@"mania")]
+        [Description(@"osu!mania")]
         Mania = 3
     }
 }


Added another constructor in EventSourcingDomainRepository to support the routing of the publishing events.

--- src/Apworks/Repositories/EventSourcingDomainRepository.cs
+++ src/Apworks/Repositories/EventSourcingDomainRepository.cs
@@ -11,13 +11,24 @@
     {
         private readonly IEventStore eventStore;
         private readonly ISnapshotProvider snapshotProvider;
+        private readonly string route;

         public EventSourcingDomainRepository(IEventStore eventStore,
             IEventPublisher publisher,
-            ISnapshotProvider snapshotProvider) : base(publisher)
+            ISnapshotProvider snapshotProvider)
+            : this(eventStore, publisher, snapshotProvider, null)
+        {
+
+        }
+
+        public EventSourcingDomainRepository(IEventStore eventStore,
+            IEventPublisher publisher,
+            ISnapshotProvider snapshotProvider,
+            string route) : base(publisher)
         {
             this.eventStore = eventStore;
             this.snapshotProvider = snapshotProvider;
+            this.route = route;
         }

         public override TAggregateRoot GetById<TKey, TAggregateRoot>(TKey id)
@@ -79,7 +90,7 @@
             this.eventStore.Save(uncommittedEvents); // This will save the uncommitted events in a transaction.

             // Publishes the events.
-            this.Publisher.PublishAll(uncommittedEvents);
+            this.Publisher.PublishAll(uncommittedEvents, this.route);

             // Purges the uncommitted events.
             ((IPurgeable)aggregateRoot).Purge();
@@ -103,7 +114,7 @@
             await this.eventStore.SaveAsync(uncommittedEvents, cancellationToken); // This will save the uncommitted events in a transaction.

             // Publishes the events.
-            await this.Publisher.PublishAllAsync(uncommittedEvents);
+            await this.Publisher.PublishAllAsync(uncommittedEvents, this.route, cancellationToken);

             // Purges the uncommitted events.
             ((IPurgeable)aggregateRoot).Purge();


[SlidingTextWindow] Add another common case for GetText optimization

For files that use \n as EOL instead of \r\n, this would not hit the optimization path of reusing the same token text.

--- src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs
+++ src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs
@@ -668,6 +668,10 @@
                     {
                         return " ";
                     }
+                    if (_characterWindow[offset] == '\n')
+                    {
+                        return "\n";
+                    }
                     break;

                 case 2:


Run tests only in English locale

Run tests only in English locale

--- src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
+++ src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
@@ -11470,7 +11470,7 @@
         }

         [WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
-        [Fact]
+        [ConditionalFact(typeof(IsEnglishLocal))]
         public void TestSuppression_CompilerParserWarningAsError()
         {
             string source = @"
@@ -11508,8 +11508,7 @@
             Assert.DoesNotContain($"warning CS0078", output, StringComparison.Ordinal);

             // Diagnostic '{0}: {1}' was programmatically suppressed by a DiagnosticSuppressor with suppression ID '{2}' and justification '{3}'
-            var suppressionMessage = string.Format(CultureHelpers.EnglishCulture,
-                CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
+            var suppressionMessage = string.Format(CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
                 suppressor.SuppressionDescriptor.SuppressedDiagnosticId,
                 new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix, "l"), Location.None).GetMessage(CultureInfo.InvariantCulture),
                 suppressor.SuppressionDescriptor.Id,
@@ -11521,7 +11520,7 @@
         }

         [WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
-        [Fact]
+        [ConditionalFact(typeof(IsEnglishLocal))]
         public void TestSuppression_CompilerSyntaxWarning()
         {
             // warning CS1522: Empty switch block
@@ -11549,8 +11548,7 @@
             var suppressor = new DiagnosticSuppressorForId("CS1522");

             // Diagnostic '{0}: {1}' was programmatically suppressed by a DiagnosticSuppressor with suppression ID '{2}' and justification '{3}'
-            var suppressionMessage = string.Format(CultureHelpers.EnglishCulture,
-                CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
+            var suppressionMessage = string.Format(CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
                 suppressor.SuppressionDescriptor.SuppressedDiagnosticId,
                 new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_EmptySwitch), Location.None).GetMessage(CultureInfo.InvariantCulture),
                 suppressor.SuppressionDescriptor.Id,
@@ -11583,7 +11581,7 @@
         }

         [WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
-        [Fact]
+        [ConditionalFact(typeof(IsEnglishLocal))]
         public void TestSuppression_CompilerSemanticWarning()
         {
             string source = @"
@@ -11605,8 +11603,7 @@
             var suppressor = new DiagnosticSuppressorForId("CS0169");

             // Diagnostic '{0}: {1}' was programmatically suppressed by a DiagnosticSuppressor with suppression ID '{2}' and justification '{3}'
-            var suppressionMessage = string.Format(CultureHelpers.EnglishCulture,
-                CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
+            var suppressionMessage = string.Format(CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
                 suppressor.SuppressionDescriptor.SuppressedDiagnosticId,
                 new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_UnreferencedField, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture),
                 suppressor.SuppressionDescriptor.Id,
@@ -11688,7 +11685,7 @@
         }

         [WorkItem(20242, "https://github.com/dotnet/roslyn/issues/20242")]
-        [Fact]
+        [ConditionalFact(typeof(IsEnglishLocal))]
         public void TestSuppression_AnalyzerWarning()
         {
             string source = @"
@@ -11709,8 +11706,7 @@
             var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id);

             // Diagnostic '{0}: {1}' was programmatically suppressed by a DiagnosticSuppressor with suppression ID '{2}' and justification '{3}'
-            var suppressionMessage = string.Format(CultureHelpers.EnglishCulture,
-                CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
+            var suppressionMessage = string.Format(CodeAnalysisResources.SuppressionDiagnosticDescriptorMessage,
                 suppressor.SuppressionDescriptor.SuppressedDiagnosticId,
                 analyzer.Descriptor.MessageFormat,
                 suppressor.SuppressionDescriptor.Id,


RichTextBox AppendTextColor

RichTextBox AppendTextColor

--- ControlUtil.cs
+++ ControlUtil.cs
@@ -144,6 +144,26 @@
             return (float)nud.Value;
         }

+        public static void AppendText(this RichTextBox box, char text, Color color)
+        {
+            box.AppendText(text.ToString(), color);
+        }
+
+        public static void AppendText(this RichTextBox box, string text, Color color)
+        {
+            box.SelectionStart = box.TextLength;
+            box.SelectionLength = 0;
+            box.SelectionColor = color;
+
+            box.AppendText(text);
+            box.SelectionColor = box.ForeColor;
+        }
+
+
+
+
+
+

@@ -160,6 +180,16 @@
             else if (c.Parent == null) return null;
             else return c.Parent.GetParent<T>();
         }
+
+
+
+
+
+
+
+
+
+

         public static void LoadFormState(this Form f)
         {


autoFlush in Debug-Mode

autoFlush in Debug-Mode

the logger writes directly into the file in debug mode

--- Core/Logger.cs
+++ Core/Logger.cs
@@ -250,6 +250,9 @@
         public FileWriter(String filename)
         {
             _fileWriter = new StreamWriter(filename);
+#if DEBUG
+            _fileWriter.AutoFlush = true;
+#endif
         }

         public void Dispose()


Fix Microsoft account button styling

Fix Microsoft account button styling

Fix the styling of the Microsoft account button as the icon and button
class names differed.

--- src/LondonTravel.Site/Extensions/IHtmlHelperExtensions.cs
+++ src/LondonTravel.Site/Extensions/IHtmlHelperExtensions.cs
@@ -13,9 +13,9 @@
     public static class IHtmlHelperExtensions
     {
         /// <summary>
-        /// A mapping of authentication schems to icon classes. This field is read-only.
+        /// A mapping of authentication schemes to icon classes. This field is read-only.
         /// </summary>
-        private static readonly IDictionary<string, string> _iconClassMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
+        private static readonly IDictionary<string, string> _iconImageMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
         {
             { "Amazon", "amazon" },
             { "Facebook", "facebook" },
@@ -35,7 +35,7 @@
         /// </returns>
         public static string GetSocialLoginButtonCss(this IHtmlHelper html, string authenticationScheme)
         {
-            return html.GetSocialLoginCss(authenticationScheme, "btn");
+            return $"btn-{authenticationScheme?.ToLowerInvariant()}";
         }

         /// <summary>
@@ -48,20 +48,6 @@
         /// </returns>
         public static string GetSocialLoginIconCss(this IHtmlHelper html, string authenticationScheme)
         {
-            return html.GetSocialLoginCss(authenticationScheme, "fa");
-        }
-
-        /// <summary>
-        /// Gets the CSS class to use for a social login.
-        /// </summary>
-        /// <param name="html">The <see cref="IHtmlHelper"/> to use.</param>
-        /// <param name="authenticationScheme">The Id/name of the authentication scheme.</param>
-        /// <param name="prefix">The CSS prefix to use.</param>
-        /// <returns>
-        /// The CSS class to use for the authentication scheme.
-        /// </returns>
-        private static string GetSocialLoginCss(this IHtmlHelper html, string authenticationScheme, string prefix)
-        {
             if (string.IsNullOrEmpty(authenticationScheme))
             {
                 return string.Empty;
@@ -69,9 +55,9 @@

             string iconClass = string.Empty;

-            if (_iconClassMap.TryGetValue(authenticationScheme, out string modifier))
+            if (_iconImageMap.TryGetValue(authenticationScheme, out string modifier))
             {
-                iconClass = $"{prefix}-{modifier}";
+                iconClass = $"fa-{modifier}";
             }

             return iconClass;


React to StringSegment change

React to StringSegment change

--- src/Microsoft.AspNetCore.Server.HttpSys/FeatureContext.cs
+++ src/Microsoft.AspNetCore.Server.HttpSys/FeatureContext.cs
@@ -524,7 +524,7 @@

             // We require 'public' and 's-max-age' or 'max-age' or the Expires header.
             CacheControlHeaderValue cacheControl;
-            if (CacheControlHeaderValue.TryParse(cacheControlHeader, out cacheControl) && cacheControl.Public)
+            if (CacheControlHeaderValue.TryParse(cacheControlHeader.ToString(), out cacheControl) && cacheControl.Public)
             {
                 if (cacheControl.SharedMaxAge.HasValue)
                 {


KT01: DisconnectHandler.GetDisconnectToken: Fix race condition and avoid speed up read case.

This fixes a thread safety problem that the CreateToken call was not syncrhonized. Calls to GetDisconnectToken take 0.8% inclusive of WebAPI scenarios. This change speeds up the read case by avoiding the allocation of a delegate and closure and by optimizing for the more common get read case when pulling on the concurrent dictionary. It also replaces the Lazy<T> which needs 3 GC objects for the lifetime of each connection with a single GC object.

--- src/Microsoft.Owin.Host.HttpListener/DisconnectHandler.cs
+++ src/Microsoft.Owin.Host.HttpListener/DisconnectHandler.cs
@@ -29,7 +29,7 @@

     internal class DisconnectHandler
     {
-        private readonly ConcurrentDictionary<ulong, Lazy<CancellationToken>> _connectionCancellationTokens;
+        private readonly ConcurrentDictionary<ulong, ConnectionCancellation> _connectionCancellationTokens;
         private readonly System.Net.HttpListener _listener;
         private readonly CriticalHandle _requestQueueHandle;
         private readonly FieldInfo _connectionIdField;
@@ -37,7 +37,7 @@

         internal DisconnectHandler(System.Net.HttpListener listener, LoggerFunc logger)
         {
-            _connectionCancellationTokens = new ConcurrentDictionary<ulong, Lazy<CancellationToken>>();
+            _connectionCancellationTokens = new ConcurrentDictionary<ulong, ConnectionCancellation>();
             _listener = listener;
             _logger = logger;

@@ -65,7 +65,26 @@
             }

             var connectionId = (ulong)_connectionIdField.GetValue(context.Request);
-            return _connectionCancellationTokens.GetOrAdd(connectionId, key => new Lazy<CancellationToken>(() => CreateToken(key))).Value;
+            ConnectionCancellation cancellation = GetConnectionCancellation(connectionId);
+            return cancellation.GetCancellationToken(this, connectionId);
+        }
+
+        private ConnectionCancellation GetConnectionCancellation(ulong connectionId)
+        {
+            // Read case is performance senstive
+            ConnectionCancellation cancellation;
+            if (_connectionCancellationTokens.TryGetValue(connectionId, out cancellation))
+            {
+                return cancellation;
+            }
+            return GetCreatedConnectionCancellation(connectionId);
+        }
+
+        private ConnectionCancellation GetCreatedConnectionCancellation(ulong connectionId)
+        {
+            // Race condition on creation has no side effects
+            ConnectionCancellation cancellation = new ConnectionCancellation();
+            return _connectionCancellationTokens.GetOrAdd(connectionId, cancellation);
         }

         private unsafe CancellationToken CreateToken(ulong connectionId)
@@ -87,8 +106,8 @@
                     }

                     // Pull the token out of the list and Cancel it.
-                    Lazy<CancellationToken> token;
-                    _connectionCancellationTokens.TryRemove(connectionId, out token);
+                    ConnectionCancellation cancellation;
+                    _connectionCancellationTokens.TryRemove(connectionId, out cancellation);

                     bool success = ThreadPool.UnsafeQueueUserWorkItem(CancelToken, cts);
                     Debug.Assert(success, "Unable to queue disconnect notification.");
@@ -102,8 +121,8 @@
             {
                 // We got an unknown result, assume the connection has been closed.
                 Overlapped.Free(nativeOverlapped);
-                Lazy<CancellationToken> lazyToken;
-                _connectionCancellationTokens.TryRemove(connectionId, out lazyToken);
+                ConnectionCancellation cancellation;
+                _connectionCancellationTokens.TryRemove(connectionId, out cancellation);
                 LogHelper.LogException(_logger, "HttpWaitForDisconnect", new Win32Exception((int)hr));
                 cts.Cancel();
                 cts.Dispose();
@@ -125,5 +144,29 @@
             }
             cts.Dispose();
         }
+
+        private class ConnectionCancellation
+        {
+            private volatile bool _initialized; // Must be volatile because initialization is synchronized
+            private CancellationToken _cancellationToken;
+
+            internal CancellationToken GetCancellationToken(DisconnectHandler disconnectHandler, ulong connectionId)
+            {
+                // Initialized case is performance sensitive
+                if (_initialized)
+                {
+                    return _cancellationToken;
+                }
+                return InitializeCancellationToken(disconnectHandler, connectionId);
+            }
+
+            private CancellationToken InitializeCancellationToken(DisconnectHandler disconnectHandler, ulong connectionId)
+            {
+                object syncObject = this;
+#pragma warning disable 420 // Disable warning about volatile by reference since EnsureInitialized does volatile operations
+                return LazyInitializer.EnsureInitialized(ref _cancellationToken, ref _initialized, ref syncObject, () => disconnectHandler.CreateToken(connectionId));
+#pragma warning restore 420
+            }
+        }
     }
 }


Remove empty line.

Remove empty line.

--- src/MitternachtBot/Modules/Games/Services/GamesService.cs
+++ src/MitternachtBot/Modules/Games/Services/GamesService.cs
@@ -19,7 +19,6 @@
 			var timer = new Timer(_ => {
 				GirlRatings.Clear();
 			}, null, TimeSpan.FromDays(1), TimeSpan.FromDays(1));
-
 		}
 	}
 }


Bugfix

Bugfix

svn path=/trunk/bitsharp/; revision=81757

--- src/MonoTorrent/Collections/PeerConnectionIDCollection.cs
+++ src/MonoTorrent/Collections/PeerConnectionIDCollection.cs
@@ -15,7 +15,7 @@
         #region Private Fields

 #if NET_2_0
-        private List<PeerId> list;
+        private List<PeerIdInternal> list;
 #else
         private ArrayList list;
 #endif
@@ -28,7 +28,7 @@
         public PeerIdCollection()
         {
 #if NET_2_0
-            list = new List<PeerId>();
+            list = new List<PeerIdInternal>();
 #else
             list = new ArrayList();
 #endif
@@ -37,7 +37,7 @@
         public PeerIdCollection(int capacity)
         {
 #if NET_2_0
-            list = new List<PeerId>(capacity);
+            list = new List<PeerIdInternal>(capacity);
 #else
             list = new ArrayList(capacity);
 #endif


Fixed exception thrown when first initialized

--- src/Perspex.Xaml.Interactions/Core/DataTriggerBehavior.cs
+++ src/Perspex.Xaml.Interactions/Core/DataTriggerBehavior.cs
@@ -207,10 +207,16 @@

             DataBindingHelper.RefreshDataBindingsOnActions(dataTriggerBehavior.Actions);

-            // Some value has changed--either the binding value, reference value, or the comparison condition. Re-evaluate the equation.
-            if (DataTriggerBehavior.Compare(dataTriggerBehavior.Binding, dataTriggerBehavior.ComparisonCondition, dataTriggerBehavior.Value))
-            {
-                Interaction.ExecuteActions(dataTriggerBehavior.AssociatedObject, dataTriggerBehavior.Actions, args);
+            // NOTE: In UWP version binding and value null checks are not present, Perspex throws exception as Bindings are null when first initialized.
+            var bidning = dataTriggerBehavior.Binding;
+            var value = dataTriggerBehavior.Value;
+            if (bidning != null && value != null)
+            {
+                // Some value has changed--either the binding value, reference value, or the comparison condition. Re-evaluate the equation.
+                if (DataTriggerBehavior.Compare(dataTriggerBehavior.Binding, dataTriggerBehavior.ComparisonCondition, dataTriggerBehavior.Value))
+                {
+                    Interaction.ExecuteActions(dataTriggerBehavior.AssociatedObject, dataTriggerBehavior.Actions, args);
+                }
             }
         }
     }


Lors du chargement, on restaure les valeurs par défaut

--- Enigmas/ClouEnigmaPanel.cs
+++ Enigmas/ClouEnigmaPanel.cs
@@ -173,6 +173,19 @@
                 #endregion
             }
         }
+
+        /// <summary>
+        /// Lors du chargement, on restaure avec les valeurs par défaut.
+        /// </summary>
+        public override void Load()
+        {
+            ia.WinnedRound = 0;
+            player.WinnedRound = 0;
+            round = 0;
+            UpdateStatusLabel();
+            bar.StartCursor();
+            nail.ResetPosition();
+        }
         #endregion
     }
 }


Cause Communicator.Stop() to work against a copy of the available connexions.  Prevents concurrent modification problems such as Stop() being called from multiple threads.

--- GTBase/Net/ClientServer.cs
+++ GTBase/Net/ClientServer.cs
@@ -165,11 +165,17 @@
         /// <summary>
         /// Stop the instance.  Instances can be stopped multiple times.
         /// Stopping an instance may throw an exception on error.
+        /// This method should be overridden; implementors should
+        /// ensure they cause <see cref="Active"/> will be false.
         /// </summary>
         public virtual void Stop()
         {
             // Should we call ConnexionRemoved on stop?
-            foreach(IConnexion cnx in connexions)
+            // No: it's an operation under programmatic control, so
+            // the caller is aware that they are being removed
+            List<IConnexion> copy = new List<IConnexion>(connexions);
+            connexions.Clear();
+            foreach (IConnexion cnx in copy)
             {
                 try { cnx.ShutDown(); }
                 catch (Exception e)
@@ -177,7 +183,6 @@
                     log.Info("exception thrown when shutting down " + cnx, e);
                 }
             }
-            connexions.Clear();
         }

         /// <summary>
@@ -245,7 +250,11 @@
         {
             Thread t = listeningThread;
             listeningThread = null;
-            if(t != null && t != Thread.CurrentThread) { t.Abort(); }
+            if(t != null && t != Thread.CurrentThread)
+            {
+                t.Abort();
+                t.Join(500);    // wait up to 500ms for the listener to finish
+            }
         }

         /// <summary>Starts an infinite loop to periodically call


An attempt that doesn't work.

An attempt that doesn't work.

--- ksp_plugin_adapter/burn_editor.cs
+++ ksp_plugin_adapter/burn_editor.cs
@@ -66,13 +66,13 @@
     bool changed = false;
     using (new UnityEngine.GUILayout.HorizontalScope()) {
       UnityEngine.GUILayout.Label(header);
-      string frame_warning = "";
-      if (!reference_frame_selector_.FrameParameters().Equals(
+      if (manoeuvre_warning_ == "" &
+          !reference_frame_selector_.FrameParameters().Equals(
               adapter_.plotting_frame_selector_.FrameParameters())) {
-        frame_warning = "Manœuvre frame differs from plotting frame";
+        manoeuvre_warning_ = "Manœuvre frame differs from plotting frame";
       }
       UnityEngine.GUILayout.Label(
-          frame_warning,
+          manoeuvre_warning_,
           Style.RightAligned(Style.Warning(UnityEngine.GUI.skin.label)));
     }
     using (new UnityEngine.GUILayout.VerticalScope()) {
@@ -146,8 +146,16 @@
     Δv_tangent_.value = burn.delta_v.x;
     Δv_normal_.value = burn.delta_v.y;
     Δv_binormal_.value = burn.delta_v.z;
-    previous_coast_duration_.value =
-        burn.initial_time - time_base;
+    if (previous_coast_duration_.value != burn.initial_time - time_base) {
+      //UnityEngine.Debug.LogError(previous_coast_duration_.value+" "+
+      //burn.initial_time+" "+time_base+" "+
+      //(previous_coast_duration_.value -( burn.initial_time - time_base)));
+      previous_coast_duration_.value = burn.initial_time - time_base;
+      manoeuvre_warning_ =
+          "Manoeuvre corrected to be consistent with the flight plan";
+    } else {
+      manoeuvre_warning_ = "";
+    }
     reference_frame_selector_.SetFrameParameters(burn.frame);
     is_inertially_fixed_ = burn.is_inertially_fixed;
     duration_ = manoeuvre.duration;
@@ -292,6 +300,7 @@
   private double initial_mass_in_tonnes_;

   private bool first_time_rendering = true;
+  private string manoeuvre_warning_ = "";

   private const double Log10ΔvLowerRate = -3.0;
   private const double Log10ΔvUpperRate = 3.5;


Set connectionClass to vanilla metro

Set connectionClass to vanilla metro

--- Initializer.cs
+++ Initializer.cs
@@ -1121,7 +1121,11 @@
                     lane.m_speedLimit = speedLimit;
                 }
             }
-
+            var vanillaMetroClass = FindOriginalNetInfo("Metro Track")?.m_class;
+            if (vanillaMetroClass != null)
+            {
+                prefab.m_connectionClass = vanillaMetroClass;
+            }
             Modifiers.RemoveElectricityPoles(prefab);
         }


MAil log start and end

MAil log start and end

--- Mail/Mailer.cs
+++ Mail/Mailer.cs
@@ -6,15 +6,20 @@
 using Core.DomainModel;
 using Core.DomainServices;
 using Ninject;
+using Core.ApplicationServices.Logger;

 namespace Mail
 {
     public class Mailer
     {
+
         public static void Main(string[] args)
         {
+            ILogger _logger = NinjectWebKernel.CreateKernel().Get<ILogger>();
+            _logger.Log($"************* Mail started ***************", "mail", 3);
             var service = NinjectWebKernel.CreateKernel().Get<ConsoleMailerService>();
             service.RunMailService();
+            _logger.Log($"************* Mail ended ***************", "mail", 3);
         }


Added delete attachment test case

Added delete attachment test case

--- src/test/Document.cs
+++ src/test/Document.cs
@@ -170,8 +170,21 @@
             Assert.True(expectedSize.Count() == result.Count(),"File size is different");
         }

+        [Fact]
         public void DeleteAttachement(){
-
+            _CreateDocument().Wait();
+            var file = RandomTextFile();
+            Assert.True( File.Exists(file));
+            _AddAttachment(file).Wait();
+            _DeleteAttachment().Wait();
+        }
+
+        private async Task _DeleteAttachment()
+        {
+             var client = CouchSettings.GetTestClient();
+             var result = await client.DeleteAttachment(LastDocument,"test.txt");
+             Assert.True(result.ok,"Returned result was not true");
+             Assert.True(result.rev == LastDocument._rev,"Revision was not updated as expected");
         }

         public void Dispose()


Updated Rider plugin

Updated Rider plugin

--- Assets/Plugins/Editor/JetBrains/Unity3DRider.cs
+++ Assets/Plugins/Editor/JetBrains/Unity3DRider.cs
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Version: 2.0.4.2575
+//     Version: 2.1.2.1737
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -135,21 +135,29 @@
     private const string UNITY_EDITOR_PROJECT_NAME = "Assembly-CSharp-Editor.csproj";
     private const string UNITY_UNSAFE_KEYWORD = "-unsafe";
     private const string UNITY_DEFINE_KEYWORD = "-define:";
-    private const string PLAYER_PROJECT_MANUAL_CONFIG_RELATIVE_FILE_PATH = "smcs.rsp";
-    private static readonly string  PLAYER_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.Combine(UnityEngine.Application.dataPath, PLAYER_PROJECT_MANUAL_CONFIG_RELATIVE_FILE_PATH);
-    private const string EDITOR_PROJECT_MANUAL_CONFIG_RELATIVE_FILE_PATH = "gmcs.rsp";
-    private static readonly string  EDITOR_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.Combine(UnityEngine.Application.dataPath, EDITOR_PROJECT_MANUAL_CONFIG_RELATIVE_FILE_PATH);
+    private static readonly string  PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.Combine(UnityEngine.Application.dataPath, "mcs.rsp");
+    private static readonly string  PLAYER_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.Combine(UnityEngine.Application.dataPath, "smcs.rsp");
+    private static readonly string  EDITOR_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH = Path.Combine(UnityEngine.Application.dataPath, "gmcs.rsp");

     private static void SetManuallyDefinedComilingSettings(string projectFile, XElement projectContentElement, XNamespace xmlns)
     {
-      string configPath;
-
-      if (IsPlayerProjectFile(projectFile))
-        configPath = PLAYER_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH;
-      else if (IsEditorProjectFile(projectFile))
-        configPath = EDITOR_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH;
-      else
-        configPath = null;
+      string configPath = null;
+
+      if (IsPlayerProjectFile(projectFile) || IsEditorProjectFile(projectFile))
+      {
+        //Prefer mcs.rsp if it exists
+        if (File.Exists(PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH))
+        {
+          configPath = PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH;
+        }
+        else
+        {
+          if (IsPlayerProjectFile(projectFile))
+            configPath = PLAYER_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH;
+          else if (IsEditorProjectFile(projectFile))
+            configPath = EDITOR_PROJECT_MANUAL_CONFIG_ABSOLUTE_FILE_PATH;
+        }
+      }

       if(!string.IsNullOrEmpty(configPath))
         ApplyManualCompilingSettings(configPath


* Made class public.

* Made class public.

--- Assets/Plugins/Watson/Utilities/EventManager.cs
+++ Assets/Plugins/Watson/Utilities/EventManager.cs
@@ -24,7 +24,7 @@
     /// <summary>
     /// Singleton class for sending and receiving events.
     /// </summary>
-    class EventManager
+    public class EventManager
     {
         #region Public Properties
         public static EventManager Instance { get { return Singleton<EventManager>.Instance; } }


Fixing rtl name on macos.

Fixing rtl name on macos.

--- Assets/Scripts/Content/AssetImport/RtLFinder.cs
+++ Assets/Scripts/Content/AssetImport/RtLFinder.cs
@@ -35,7 +35,7 @@
     {
         if (Application.platform == RuntimePlatform.OSXPlayer)
         {
-            return "Descent Road to Legend.app";
+            return "Road to Legend.app";
         }
         return "Road to Legend.exe";
     }


Improve parent coordinate translation

Improve parent coordinate translation

--- Dependiator/Modeling/Items/ItemsCanvas.cs
+++ Dependiator/Modeling/Items/ItemsCanvas.cs
@@ -13,7 +13,7 @@

 		private readonly ItemsSource itemsSource;
 		private NodesView view;
-		private Vector relative;
+		//private Vector relative;

 		private ZoomableCanvas zoomableCanvas;
 		private double scale = 1.0;
@@ -86,9 +86,9 @@
 		public Point GetParentCanvasPoint(Point canvasPoint)
 		{
 			if (ParentItemsCanvas?.view != null && view != null)
-			{
+			{
 				// Compensate the canvas view for the nodes vew position relative nodes border
-				Point compensatedPoint = canvasPoint + relative;
+				Point compensatedPoint = canvasPoint;

 				Vector vector = (Vector)ParentItemsCanvas.Offset / ParentItemsCanvas.Scale;

@@ -116,11 +116,13 @@
 		{
 			view = nodesView;

-			// Get the position of the nodes view relative the nodes border
-			UIElement innerBorder = VisualTreeHelper.GetParent(view) as UIElement;
-			UIElement grid = VisualTreeHelper.GetParent(innerBorder) as UIElement;
-			UIElement nodesBorder = VisualTreeHelper.GetParent(grid) as UIElement;
-			relative = (Vector)view.TranslatePoint(new Point(0, 0), nodesBorder);
+			//// Get the position of the nodes view relative the nodes border
+			//UIElement innerBorder = VisualTreeHelper.GetParent(view) as UIElement;
+			//UIElement grid = VisualTreeHelper.GetParent(innerBorder) as UIElement;
+			//UIElement nodesBorder = VisualTreeHelper.GetParent(grid) as UIElement;
+
+			//relative = (Vector)view.TranslatePoint(new Point(0, 0), nodesBorder);
+

 			if (zoomableCanvas != null)
 			{


Fix a bug where it sometimes skip a frame in the Viewer

# Conflicts:
#	Dev/Editor/EffekseerCoreGUI/GUI/Viewer.cs

--- Dev/Editor/EffekseerCoreGUI/GUI/Viewer.cs
+++ Dev/Editor/EffekseerCoreGUI/GUI/Viewer.cs
@@ -79,7 +79,7 @@
 			return native.PlayEffect();
 		}

-		public bool MoveEffectFrame(int frame)
+		public bool StepEffectFrame(int frame)
 		{
 			return native.StepEffect(frame);
 		}
@@ -739,9 +739,6 @@
 			}
 		}

-		/// <summary>
-		/// 新規再生
-		/// </summary>
 		unsafe void PlayNew()
 		{
 			native.StopEffect();
@@ -762,7 +759,7 @@

 			if (Core.StartFrame > 0)
 			{
-				MoveEffectFrame(Core.StartFrame);
+				StepEffectFrame(Core.StartFrame);
 			}
 			current = Core.StartFrame;
 		}
@@ -785,7 +782,7 @@

 			SetRandomSeed(random_seed);
 			PlayEffect();
-			MoveEffectFrame((int)Current);
+			StepEffectFrame((int)Current);
 		}

 		unsafe void MoveFrame(float new_frame)
@@ -814,11 +811,11 @@
 						native.StopEffect();
 						SetRandomSeed(random_seed);
 						PlayEffect();
-						MoveEffectFrame((int)new_frame);
+						StepEffectFrame((int)new_frame);
 					}
 					else
 					{
-						MoveEffectFrame((int)(new_frame - current));
+						StepEffectFrame((int)new_frame - (int)current);
 					}
 				}
 				else
@@ -831,11 +828,11 @@
 						native.StopEffect();

 						PlayEffect();
-						MoveEffectFrame((int)new_frame);
+						StepEffectFrame((int)new_frame);
 					}
 					else
 					{
-						MoveEffectFrame((int)(new_frame - current));
+						StepEffectFrame((int)new_frame - (int)current);
 					}
 				}
 				current = new_frame;


organize using

organize using

--- AzureMediaPortal/Controllers/MediaController.cs
+++ AzureMediaPortal/Controllers/MediaController.cs
@@ -7,9 +7,7 @@
 using System;
 using System.Collections.Generic;
 using System.Configuration;
-using System.Data;
 using System.Data.Entity;
-using System.Drawing;
 using System.Globalization;
 using System.IO;
 using System.Linq;


GJK style paths working.

GJK style paths working.

--- BepuPhysics/CollisionDetection/SimplexTilter.cs
+++ BepuPhysics/CollisionDetection/SimplexTilter.cs
@@ -23,9 +23,10 @@
     {
         Initialization = -1,
         TriangleFace = 0,
-        Edge = 1,
-        Vertex = 2,
-        GJKEdgeStyle = 3,
+        TriangleFaceGJK = 1,
+        Edge = 2,
+        Vertex = 3,
+        EdgeGJK = 4,
         //EdgeReflect = 2,
         //Contraction = 3,
     }
@@ -138,8 +139,8 @@

         struct HasNewSupport { }
         struct HasNoNewSupport { }
-        static void GetNextNormal<T>(ref Simplex simplex, in Vector3Wide localOffsetB, in Vector3Wide support, in Vector3Wide normal, in Vector<float> depth, ref Vector<float> progressionScale, in Vector<int> terminatedLanes,
-            in Vector3Wide bestNormal, in Vector<float> bestDepth,
+        static void GetNextNormal<T>(ref Simplex simplex, in Vector3Wide localOffsetB, in Vector3Wide support, in Vector3Wide normal, in Vector<float> depth, in Vector<int> terminatedLanes,
+            in Vector3Wide bestNormal, in Vector<float> bestDepth, ref Vector<int> previousIterationWasGJKStyle,
             out Vector3Wide nextNormal, out SimplexTilterStep step)
         {
             {
@@ -171,20 +172,40 @@
                 FillSlot(ref simplex.B, support, normal, depth);
                 FillSlot(ref simplex.C, support, normal, depth);

-
-
                 var activeFullSimplex = Vector.AndNot(simplexFull, terminatedLanes);
                 if (Vector.LessThanAny(activeFullSimplex, Vector<int>.Zero))
                 {
                     //At least one active lane has a full simplex and an incoming new sample.
-                    //Choose one of the resulting triangles based on which triangle contains the current best normal.
-                    //The three edges we need to test are: ADO, BDO, CDO.
-                    Vector3Wide.CrossWithoutOverlap(simplex.A.Support, support, out var axd);
-                    Vector3Wide.CrossWithoutOverlap(simplex.B.Support, support, out var bxd);
-                    Vector3Wide.CrossWithoutOverlap(simplex.C.Support, support, out var cxd);
-                    Vector3Wide.Dot(axd, bestNormal, out var adPlaneTest);
-                    Vector3Wide.Dot(bxd, bestNormal, out var bdPlaneTest);
-                    Vector3Wide.Dot(cxd, bestNormal, out var cdPlaneTest);
+
+                    Vector<float> adPlaneTest = default, bdPlaneTest = default, cdPlaneTest = default;
+                    if (Vector.LessThanAny(Vector.BitwiseAnd(activeFullSimplex, previousIterationWasGJKStyle), Vector<int>.Zero))
+                    {
+                        Vector3Wide.Subtract(simplex.B.Support, simplex.A.Support, out var abEarly);
+                        Vector3Wide.Subtract(simplex.A.Support, simplex.C.Support, out var caEarly);
+                        Vector3Wide.Subtract(support, simplex.A.Support, out var ad);
+                        Vector3Wide.Subtract(support, simplex.B.Support, out var bd);
+                        Vector3Wide.Subtract(support, simplex.C.Support, out var cd);
+                        Vector3Wide.CrossWithoutOverlap(abEarly, caEarly, out var triangleNormalEarly);
+                        //(ad x n) * d = (n x d) * ad
+                        Vector3Wide.CrossWithoutOverlap(triangleNormalEarly, support, out var dxn);
+                        Vector3Wide.Dot(dxn, ad, out adPlaneTest);
+                        Vector3Wide.Dot(dxn, bd, out bdPlaneTest);
+                        Vector3Wide.Dot(dxn, cd, out cdPlaneTest);
+                    }
+                    if (Vector.LessThanAny(Vector.AndNot(activeFullSimplex, previousIterationWasGJKStyle), Vector<int>.Zero))
+                    {
+                        //Choose one of the resulting triangles based on which triangle contains the current best normal.
+                        //The three edges we need to test are: ADO, BDO, CDO.
+                        Vector3Wide.CrossWithoutOverlap(simplex.A.Support, support, out var axd);
+                        Vector3Wide.CrossWithoutOverlap(simplex.B.Support, support, out var bxd);
+                        Vector3Wide.CrossWithoutOverlap(simplex.C.Support, support, out var cxd);
+                        Vector3Wide.Dot(axd, bestNormal, out var adPlaneTestCandidate);
+                        Vector3Wide.Dot(bxd, bestNormal, out var bdPlaneTestCandidate);
+                        Vector3Wide.Dot(cxd, bestNormal, out var cdPlaneTestCandidate);
+                        adPlaneTest = Vector.ConditionalSelect(previousIterationWasGJKStyle, adPlaneTest, adPlaneTestCandidate);
+                        bdPlaneTest = Vector.ConditionalSelect(previousIterationWasGJKStyle, bdPlaneTest, bdPlaneTestCandidate);
+                        cdPlaneTest = Vector.ConditionalSelect(previousIterationWasGJKStyle, cdPlaneTest, cdPlaneTestCandidate);
+                    }

                     var useABD = Vector.BitwiseAnd(Vector.GreaterThanOrEqual(adPlaneTest, Vector<float>.Zero), Vector.LessThan(bdPlaneTest, Vector<float>.Zero));
                     var useBCD = Vector.BitwiseAnd(Vector.GreaterThanOrEqual(bdPlaneTest, Vector<float>.Zero), Vector.LessThan(cdPlaneTest, Vector<float>.Zero));
@@ -230,86 +251,130 @@
             //Just assume the triangle normal will be used for now.
             nextNormal = triangleNormal;

-            Vector3Wide.CrossWithoutOverlap(simplex.B.Support, simplex.A.Support, out var bxa);
-            Vector3Wide.CrossWithoutOverlap(simplex.C.Support, simplex.B.Support, out var cxb);
-            Vector3Wide.CrossWithoutOverlap(simplex.A.Support, simplex.C.Support, out var axc);
-            Vector3Wide.Dot(bxa, bestNormal, out var abPlaneTest);
-            Vector3Wide.Dot(cxb, bestNormal, out var bcPlaneTest);
-            Vector3Wide.Dot(axc, bestNormal, out var caPlaneTest);
-
-            //Note that these tests will mark degenerate edges as containing the normal, since a degenerate plane test will be 0.
-            var outsideAB = Vector.LessThan(abPlaneTest, Vector<float>.Zero);
-            var outsideBC = Vector.LessThan(bcPlaneTest, Vector<float>.Zero);
-            var outsideCA = Vector.LessThan(caPlaneTest, Vector<float>.Zero);
-
-            //If the origin is outside the edge planes and the objects are separated, use a GJK-style search.
-            var outsideSum = outsideAB + outsideBC + outsideCA;
-            var bestNormalContained = Vector.AndNot(Vector.Equals(outsideSum, Vector<int>.Zero), simplexDegenerate);
+            Vector3Wide.Dot(triangleNormal, simplex.A.Support, out var aDot);
+            var originOutsideTrianglePlane = Vector.LessThan(aDot, Vector<float>.Zero);
+
+            var useGJKStyleSearch = Vector.BitwiseOr(Vector.LessThan(bestDepth, Vector<float>.Zero), originOutsideTrianglePlane);
+            previousIterationWasGJKStyle = useGJKStyleSearch;
             var relevantFeatures = new Vector<int>(1 + 2 + 4);
-            var useGJKStyleEdge = Vector.AndNot(Vector.AndNot(Vector.LessThan(bestDepth, Vector<float>.Zero), bestNormalContained), terminatedLanes);
-            if (Vector.LessThanAny(useGJKStyleEdge, Vector<int>.Zero))
-            {
-                var useAB = Vector.BitwiseOr(Vector.AndNot(outsideAB, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, abLengthSquared), simplexDegenerate));
-                var useBC = Vector.BitwiseOr(Vector.AndNot(outsideBC, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, bcLengthSquared), simplexDegenerate));
-                var useCA = Vector.BitwiseOr(Vector.AndNot(outsideCA, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, caLengthSquared), simplexDegenerate));
-                Vector3Wide.ConditionalSelect(useCA, ca, bc, out var edgeOffset);
-                Vector3Wide.ConditionalSelect(useAB, ab, edgeOffset, out edgeOffset);
-                var edgeLengthSquared = Vector.ConditionalSelect(useCA, caLengthSquared, Vector.ConditionalSelect(useAB, abLengthSquared, bcLengthSquared));
-                var inverseEdgeLengthSquared = Vector<float>.One / edgeLengthSquared;
-                Vector3Wide.ConditionalSelect(useCA, simplex.C.Support, simplex.B.Support, out var edgeStart);
-                Vector3Wide.ConditionalSelect(useAB, simplex.A.Support, edgeStart, out edgeStart);
-                relevantFeatures = Vector.ConditionalSelect(useGJKStyleEdge, Vector.ConditionalSelect(outsideAB, new Vector<int>(1 + 2), Vector.ConditionalSelect(outsideCA, new Vector<int>(1 + 4), new Vector<int>(2 + 4))), relevantFeatures);
-                Vector3Wide.Dot(edgeStart, edgeOffset, out var startDot);
-                var negatedT = Vector.ConditionalSelect(Vector.GreaterThan(edgeLengthSquared, Vector<float>.Zero), Vector.Max(new Vector<float>(-1f), Vector.Min(Vector<float>.Zero, startDot * inverseEdgeLengthSquared)), Vector<float>.Zero);
-                Vector3Wide.Scale(edgeOffset, negatedT, out var negatedScaledOffset);
-                Vector3Wide.Subtract(negatedScaledOffset, edgeStart, out var nextNormalCandidate);
-                Vector3Wide.LengthSquared(nextNormalCandidate, out var normalCandidateLengthSquared);
-                var originIsOnEdge = Vector.LessThan(normalCandidateLengthSquared, degeneracyEpsilon);
-                Vector3Wide.ConditionalSelect(Vector.AndNot(useGJKStyleEdge, originIsOnEdge), nextNormalCandidate, nextNormal, out nextNormal);
-
-            }
-            //If the best normal is not contained, then the simplex needs to search it out. We already know which edge(s) see the origin as being outside.
-            var useVertex = Vector.AndNot(simplexIsAVertex, useGJKStyleEdge);
-            var pushScale = Vector<float>.One;// Vector.ConditionalSelect(flipBestNormal, new Vector<float>(-1f), Vector<float>.One);
-            if (Vector.LessThanAny(Vector.AndNot(useVertex, terminatedLanes), Vector<int>.Zero))
-            {
-                //At least one lane has a vertex normal offset source.
-                var abDegenerate = Vector.LessThan(abLengthSquared, degeneracyEpsilon);
-                var bcDegenerate = Vector.LessThan(bcLengthSquared, degeneracyEpsilon);
-                var caDegenerate = Vector.LessThan(caLengthSquared, degeneracyEpsilon);
-                var outsideABOrDegenerate = Vector.BitwiseOr(outsideAB, abDegenerate);
-                var outsideBCOrDegenerate = Vector.BitwiseOr(outsideBC, bcDegenerate);
-                var outsideCAOrDegenerate = Vector.BitwiseOr(outsideCA, caDegenerate);
-                var useA = Vector.BitwiseAnd(outsideCAOrDegenerate, outsideABOrDegenerate);
-                var useB = Vector.BitwiseAnd(outsideABOrDegenerate, outsideBCOrDegenerate);
-                var useC = Vector.BitwiseAnd(outsideBCOrDegenerate, outsideCAOrDegenerate);
-                Vector3Wide.ConditionalSelect(useC, simplex.C.Support, simplex.B.Support, out var vertex);
-                Vector3Wide.ConditionalSelect(useA, simplex.A.Support, vertex, out vertex);
-                Vector3Wide.Dot(vertex, bestNormal, out var vertexDot);
-                Vector3Wide.LengthSquared(vertex, out var vertexLengthSquared);
-                //TODO: Vertex can be on top of the origin and it's not a termination condition.
-                Vector3Wide.Scale(vertex, vertexDot / vertexLengthSquared, out var pointOnVertexLine);
-                Vector3Wide.Subtract(bestNormal, pointOnVertexLine, out var offsetToBestNormal);
-                Vector3Wide.Scale(offsetToBestNormal, pushScale, out var normalPushOffset);
-                //TODO: Push offset can be zero length.
-                Vector3Wide.Add(normalPushOffset, bestNormal, out var nextNormalCandidate);
-                Vector3Wide.ConditionalSelect(simplexIsAVertex, nextNormalCandidate, nextNormal, out nextNormal);
-                relevantFeatures = Vector.ConditionalSelect(simplexIsAVertex, Vector.ConditionalSelect(useA, Vector<int>.One, Vector.ConditionalSelect(useB, new Vector<int>(2), new Vector<int>(4))), relevantFeatures);
-            }
-            var useEdge = Vector.AndNot(Vector.AndNot(Vector.OnesComplement(bestNormalContained), useVertex), useGJKStyleEdge);
-            if (Vector.LessThanAny(Vector.AndNot(useEdge, terminatedLanes), Vector<int>.Zero))
-            {
-                //At least one lane has an edge normal offset source.
-                Vector3Wide.ConditionalSelect(outsideCA, axc, cxb, out var edgePlaneNormal);
-                Vector3Wide.ConditionalSelect(outsideAB, bxa, edgePlaneNormal, out edgePlaneNormal);
-                Vector3Wide.Dot(edgePlaneNormal, bestNormal, out var edgeDot);
-                Vector3Wide.LengthSquared(edgePlaneNormal, out var edgePlaneNormalLengthSquared);
-                //The edge plane normal can't be zero length. If it was, the edge would be considered to containing the best normal.
-                Vector3Wide.Scale(edgePlaneNormal, pushScale * edgeDot / edgePlaneNormalLengthSquared, out var normalPushOffset);
-                //TODO: normal push offset can be zero length.
-                Vector3Wide.Add(normalPushOffset, bestNormal, out var nextNormalCandidate);
-                Vector3Wide.ConditionalSelect(useEdge, nextNormalCandidate, nextNormal, out nextNormal);
-                relevantFeatures = Vector.ConditionalSelect(useEdge, Vector.ConditionalSelect(outsideAB, new Vector<int>(1 + 2), Vector.ConditionalSelect(outsideCA, new Vector<int>(1 + 4), new Vector<int>(2 + 4))), relevantFeatures);
+            if (Vector.LessThanAny(Vector.AndNot(useGJKStyleSearch, terminatedLanes), Vector<int>.Zero))
+            {
+                //At least one active lane wants to run a GJK-like search.
+                //Note that ab/bc/ca were computed pre-swap, so we recompute based on current simplex state.
+                Vector3Wide.Subtract(simplex.B.Support, simplex.A.Support, out ab);
+                Vector3Wide.Subtract(simplex.A.Support, simplex.C.Support, out ca);
+                //Compute the plane sign tests. Note that these are barycentric weights that have not been scaled by the inverse triangle normal length squared;
+                //we do not have to compute the correct magnitude to know the sign, and the sign is all we care about.
+                Vector3Wide.CrossWithoutOverlap(ab, simplex.A.Support, out var abxa);
+                Vector3Wide.CrossWithoutOverlap(ca, simplex.C.Support, out var caxc);
+                Vector3Wide.Dot(abxa, triangleNormal, out var abPlaneTest);
+                Vector3Wide.Dot(caxc, triangleNormal, out var caPlaneTest);
+                var bcPlaneTest = triangleNormalLengthSquared - caPlaneTest - abPlaneTest;
+
+                var outsideAB = Vector.LessThan(abPlaneTest, Vector<float>.Zero);
+                var outsideBC = Vector.LessThan(bcPlaneTest, Vector<float>.Zero);
+                var outsideCA = Vector.LessThan(caPlaneTest, Vector<float>.Zero);
+
+                var bestNormalContained = Vector.AndNot(Vector.OnesComplement(Vector.BitwiseOr(Vector.BitwiseOr(outsideAB, outsideBC), outsideCA)), simplexDegenerate);
+
+                //If the origin is outside the edge planes and the objects are separated, use a GJK-style search.
+                var useGJKStyleEdge = Vector.AndNot(Vector.AndNot(useGJKStyleSearch, bestNormalContained), terminatedLanes);
+                if (Vector.LessThanAny(useGJKStyleEdge, Vector<int>.Zero))
+                {
+                    var useAB = Vector.BitwiseOr(Vector.AndNot(outsideAB, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, abLengthSquared), simplexDegenerate));
+                    var useBC = Vector.BitwiseOr(Vector.AndNot(outsideBC, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, bcLengthSquared), simplexDegenerate));
+                    var useCA = Vector.BitwiseOr(Vector.AndNot(outsideCA, simplexDegenerate), Vector.BitwiseAnd(Vector.Equals(longestEdgeLengthSquared, caLengthSquared), simplexDegenerate));
+                    Vector3Wide.ConditionalSelect(useCA, ca, bc, out var edgeOffset);
+                    Vector3Wide.ConditionalSelect(useAB, ab, edgeOffset, out edgeOffset);
+                    var edgeLengthSquared = Vector.ConditionalSelect(useCA, caLengthSquared, Vector.ConditionalSelect(useAB, abLengthSquared, bcLengthSquared));
+                    var inverseEdgeLengthSquared = Vector<float>.One / edgeLengthSquared;
+                    Vector3Wide.ConditionalSelect(useCA, simplex.C.Support, simplex.B.Support, out var edgeStart);
+                    Vector3Wide.ConditionalSelect(useAB, simplex.A.Support, edgeStart, out edgeStart);
+                    relevantFeatures = Vector.ConditionalSelect(useGJKStyleEdge, Vector.ConditionalSelect(useAB, new Vector<int>(1 + 2), Vector.ConditionalSelect(useCA, new Vector<int>(1 + 4), new Vector<int>(2 + 4))), relevantFeatures);
+                    Vector3Wide.Dot(edgeStart, edgeOffset, out var startDot);
+                    var negatedT = Vector.ConditionalSelect(Vector.GreaterThan(edgeLengthSquared, Vector<float>.Zero), Vector.Max(new Vector<float>(-1f), Vector.Min(Vector<float>.Zero, startDot * inverseEdgeLengthSquared)), Vector<float>.Zero);
+                    Vector3Wide.Scale(edgeOffset, negatedT, out var negatedScaledOffset);
+                    Vector3Wide.Subtract(negatedScaledOffset, edgeStart, out var nextNormalCandidate);
+                    Vector3Wide.LengthSquared(nextNormalCandidate, out var normalCandidateLengthSquared);
+                    var originIsOnEdge = Vector.LessThan(normalCandidateLengthSquared, degeneracyEpsilon);
+                    //TODO: If simplex is degenerate and origin is on edge, we need a fallback.
+                    Vector3Wide.ConditionalSelect(Vector.AndNot(useGJKStyleEdge, originIsOnEdge), nextNormalCandidate, nextNormal, out nextNormal);
+                }
+
+                {
+                    //DEBUG STUFF
+                    if (useGJKStyleSearch[0] < 0)
+                        step.NextNormalSource = useGJKStyleEdge[0] < 0 ? SimplexTilterNormalSource.EdgeGJK : SimplexTilterNormalSource.TriangleFaceGJK;
+                }
+            }
+
+            if (Vector.LessThanAny(Vector.AndNot(Vector.OnesComplement(useGJKStyleSearch), terminatedLanes), Vector<int>.Zero))
+            {
+                //At least one active lane wants to run a penetration search.
+                Vector3Wide.CrossWithoutOverlap(simplex.B.Support, simplex.A.Support, out var bxa);
+                Vector3Wide.CrossWithoutOverlap(simplex.C.Support, simplex.B.Support, out var cxb);
+                Vector3Wide.CrossWithoutOverlap(simplex.A.Support, simplex.C.Support, out var axc);
+                Vector3Wide.Dot(bxa, bestNormal, out var abPlaneTest);
+                Vector3Wide.Dot(cxb, bestNormal, out var bcPlaneTest);
+                Vector3Wide.Dot(axc, bestNormal, out var caPlaneTest);
+
+                //Note that these tests will mark degenerate edges as containing the normal, since a degenerate plane test will be 0.
+                var outsideAB = Vector.LessThan(abPlaneTest, Vector<float>.Zero);
+                var outsideBC = Vector.LessThan(bcPlaneTest, Vector<float>.Zero);
+                var outsideCA = Vector.LessThan(caPlaneTest, Vector<float>.Zero);
+
+                var outsideSum = outsideAB + outsideBC + outsideCA;
+                var bestNormalContained = Vector.AndNot(Vector.Equals(outsideSum, Vector<int>.Zero), simplexDegenerate);
+
+                //If the best normal is not contained, then the simplex needs to search it out. We already know which edge(s) see the origin as being outside.
+                var useVertex = Vector.AndNot(simplexIsAVertex, useGJKStyleSearch);
+                var pushScale = Vector<float>.One;// Vector.ConditionalSelect(flipBestNormal, new Vector<float>(-1f), Vector<float>.One);
+                if (Vector.LessThanAny(Vector.AndNot(useVertex, terminatedLanes), Vector<int>.Zero))
+                {
+                    //At least one lane has a vertex normal offset source.
+                    var abDegenerate = Vector.LessThan(abLengthSquared, degeneracyEpsilon);
+                    var bcDegenerate = Vector.LessThan(bcLengthSquared, degeneracyEpsilon);
+                    var caDegenerate = Vector.LessThan(caLengthSquared, degeneracyEpsilon);
+                    var outsideABOrDegenerate = Vector.BitwiseOr(outsideAB, abDegenerate);
+                    var outsideBCOrDegenerate = Vector.BitwiseOr(outsideBC, bcDegenerate);
+                    var outsideCAOrDegenerate = Vector.BitwiseOr(outsideCA, caDegenerate);
+                    var useA = Vector.BitwiseAnd(outsideCAOrDegenerate, outsideABOrDegenerate);
+                    var useB = Vector.BitwiseAnd(outsideABOrDegenerate, outsideBCOrDegenerate);
+                    var useC = Vector.BitwiseAnd(outsideBCOrDegenerate, outsideCAOrDegenerate);
+                    Vector3Wide.ConditionalSelect(useC, simplex.C.Support, simplex.B.Support, out var vertex);
+                    Vector3Wide.ConditionalSelect(useA, simplex.A.Support, vertex, out vertex);
+                    Vector3Wide.Dot(vertex, bestNormal, out var vertexDot);
+                    Vector3Wide.LengthSquared(vertex, out var vertexLengthSquared);
+                    //TODO: Vertex can be on top of the origin and it's not a termination condition.
+                    Vector3Wide.Scale(vertex, vertexDot / vertexLengthSquared, out var pointOnVertexLine);
+                    Vector3Wide.Subtract(bestNormal, pointOnVertexLine, out var offsetToBestNormal);
+                    Vector3Wide.Scale(offsetToBestNormal, pushScale, out var normalPushOffset);
+                    //TODO: Push offset can be zero length.
+                    Vector3Wide.Add(normalPushOffset, bestNormal, out var nextNormalCandidate);
+                    Vector3Wide.ConditionalSelect(simplexIsAVertex, nextNormalCandidate, nextNormal, out nextNormal);
+                    relevantFeatures = Vector.ConditionalSelect(simplexIsAVertex, Vector.ConditionalSelect(useA, Vector<int>.One, Vector.ConditionalSelect(useB, new Vector<int>(2), new Vector<int>(4))), relevantFeatures);
+                }
+                var useEdge = Vector.AndNot(Vector.AndNot(Vector.OnesComplement(bestNormalContained), useVertex), useGJKStyleSearch);
+                if (Vector.LessThanAny(Vector.AndNot(useEdge, terminatedLanes), Vector<int>.Zero))
+                {
+                    //At least one lane has an edge normal offset source.
+                    Vector3Wide.ConditionalSelect(outsideCA, axc, cxb, out var edgePlaneNormal);
+                    Vector3Wide.ConditionalSelect(outsideAB, bxa, edgePlaneNormal, out edgePlaneNormal);
+                    Vector3Wide.Dot(edgePlaneNormal, bestNormal, out var edgeDot);
+                    Vector3Wide.LengthSquared(edgePlaneNormal, out var edgePlaneNormalLengthSquared);
+                    //The edge plane normal can't be zero length. If it was, the edge would be considered to containing the best normal.
+                    Vector3Wide.Scale(edgePlaneNormal, pushScale * edgeDot / edgePlaneNormalLengthSquared, out var normalPushOffset);
+                    //TODO: normal push offset can be zero length.
+                    Vector3Wide.Add(normalPushOffset, bestNormal, out var nextNormalCandidate);
+                    Vector3Wide.ConditionalSelect(useEdge, nextNormalCandidate, nextNormal, out nextNormal);
+                    relevantFeatures = Vector.ConditionalSelect(useEdge, Vector.ConditionalSelect(outsideAB, new Vector<int>(1 + 2), Vector.ConditionalSelect(outsideCA, new Vector<int>(1 + 4), new Vector<int>(2 + 4))), relevantFeatures);
+                }
+
+                {
+                    //DEBUG STUFF
+                    if (useGJKStyleSearch[0] == 0)
+                        step.NextNormalSource = bestNormalContained[0] < 0 ? SimplexTilterNormalSource.TriangleFace : useVertex[0] < 0 ? SimplexTilterNormalSource.Vertex : SimplexTilterNormalSource.Edge;
+                }
             }

             simplex.A.Exists = Vector.GreaterThan(Vector.BitwiseAnd(relevantFeatures, Vector<int>.One), Vector<int>.Zero);
@@ -319,10 +384,7 @@
             Vector3Wide.Scale(nextNormal, Vector<float>.One / nextNormalLength, out nextNormal);
             {
                 //DEBUG STUFF
-                step.NextNormalSource = bestNormalContained[0] < 0 ? SimplexTilterNormalSource.TriangleFace : useVertex[0] < 0 ? SimplexTilterNormalSource.Vertex : useEdge[0] < 0 ? SimplexTilterNormalSource.Edge : SimplexTilterNormalSource.GJKEdgeStyle;
-
                 Vector3Wide.ReadFirst(nextNormal, out step.NextNormal);
-                step.ProgressionScale = progressionScale[0];
             }
         }

@@ -359,8 +421,8 @@
                 return;
             }

-            var progressionScale = new Vector<float>(0.5f);
-            GetNextNormal<HasNoNewSupport>(ref simplex, localOffsetB, default, default, default, ref progressionScale, terminatedLanes, refinedNormal, refinedDepth, out var normal, out var debugStep);
+            var previousIterationWasGJKStyle = Vector<int>.Zero;
+            GetNextNormal<HasNoNewSupport>(ref simplex, localOffsetB, default, default, default, terminatedLanes, refinedNormal, refinedDepth, ref previousIterationWasGJKStyle, out var normal, out var debugStep);
             debugStep.BestDepth = refinedDepth[0];
             Vector3Wide.ReadSlot(ref refinedNormal, 0, out debugStep.BestNormal);
             steps.Add(debugStep);
@@ -375,7 +437,7 @@
                 Vector3Wide.ConditionalSelect(useNewDepth, normal, refinedNormal, out refinedNormal);
                 //progressionScale = Vector.ConditionalSelect(useNewDepth, progressionScale, progressionScale * 0.85f);

-                GetNextNormal<HasNewSupport>(ref simplex, localOffsetB, support, normal, depth, ref progressionScale, terminatedLanes, refinedNormal, refinedDepth, out normal, out debugStep);
+                GetNextNormal<HasNewSupport>(ref simplex, localOffsetB, support, normal, depth, terminatedLanes, refinedNormal, refinedDepth, ref previousIterationWasGJKStyle, out normal, out debugStep);

                 debugStep.BestDepth = refinedDepth[0];
                 Vector3Wide.ReadSlot(ref refinedNormal, 0, out debugStep.BestNormal);


Refactored Entity Controller tests.

Refactored Entity Controller tests.

--- Bieb.Tests/Controllers/EntityControllerTests.cs
+++ Bieb.Tests/Controllers/EntityControllerTests.cs
@@ -17,7 +17,7 @@
     public class EntityControllerTests
     {
         [Test]
-        public void Can_Get_LibraryBook_Details()
+        public void Can_Get_Item_Details()
         {
             // Arrange
             var mock = new Mock<IEntityRepository<LibraryBook>>();
@@ -37,7 +37,7 @@
         }

         [Test]
-        public void Can_List_All_LibraryBooks()
+        public void Can_List_All_Items()
         {
             // Arrange
             var mock = new Mock<IEntityRepository<LibraryBook>>();
@@ -136,12 +136,18 @@
         }

         [Test]
-        public void RecentlyAdded_Action_Will_Give_LibraryBook_With_Newest_ID()
-        {
-            // Arrange
-            var mock = new Mock<IEntityRepository<LibraryBook>>();
-            var LibraryBook1 = new LibraryBook { Title = "Zoltan the Great", Id = 1 };
-            var LibraryBook2 = new LibraryBook { Title = "Middle-man", Id = 2 };
+        public void RecentlyAdded_Action_Will_Sort_By_CreatedDate()
+        {
+            // Arrange
+            var insertionDateEarly = new DateTime(2013, 01, 10);
+            var insertionDateLate = new DateTime(2013, 01, 25);
+
+            var mock = new Mock<IEntityRepository<LibraryBook>>();
+            var LibraryBook1 = new LibraryBook { Title = "Zoltan the Great", Id = 1, CreatedDate = insertionDateLate };
+
+            // Higher ("later") Id value, but earlier CreatedDate
+            var LibraryBook2 = new LibraryBook { Title = "Middle-man", Id = 2, CreatedDate = insertionDateEarly };
+
             mock.Setup(repo => repo.Items).Returns((new[] { LibraryBook1, LibraryBook2 }).AsQueryable());
             var controller = new LibraryBooksController(mock.Object);

@@ -156,11 +162,38 @@

             var LibraryBook = (LibraryBook)vresult.Model;

+            Assert.That(LibraryBook.Id, Is.EqualTo(1));
+        }
+
+        [Test]
+        public void RecentlyAdded_Action_Will_Sort_By_CreatedDate_ThenBy_Id()
+        {
+            // Arrange
+            var bulkInsertDate = new DateTime(2013, 01, 10);
+
+            var mock = new Mock<IEntityRepository<LibraryBook>>();
+            var LibraryBook1 = new LibraryBook { Title = "Zoltan the Great", Id = 1, CreatedDate = bulkInsertDate };
+            var LibraryBook2 = new LibraryBook { Title = "Middle-man", Id = 2, CreatedDate = bulkInsertDate };
+
+            mock.Setup(repo => repo.Items).Returns((new[] { LibraryBook1, LibraryBook2 }).AsQueryable());
+            var controller = new LibraryBooksController(mock.Object);
+
+            // Act & Assert
+            ActionResult result = controller.RecentlyAdded();
+            Assert.That(result, Is.Not.Null);
+            Assert.That(result, Is.InstanceOf<PartialViewResult>());
+
+            var vresult = (PartialViewResult)result;
+
+            Assert.That(vresult.Model, Is.InstanceOf<LibraryBook>());
+
+            var LibraryBook = (LibraryBook)vresult.Model;
+
             Assert.That(LibraryBook.Id, Is.EqualTo(2));
         }

         [Test]
-        public void RecentlyAdded_Action_Will_Return_Null_If_No_LibraryBooks_Are_In_Repository()
+        public void RecentlyAdded_Action_Will_Return_Null_If_Repository_Is_Empty()
         {
             // Arrange
             var mock = new Mock<IEntityRepository<LibraryBook>>();


Changed the input parameter of ClipRasterWithPolygon from FeatureSet to PolygonFeatureSet. See HydroDesktop issue 8665.

--- DotSpatial.Tools/ClipRasterWithPolygon.cs
+++ DotSpatial.Tools/ClipRasterWithPolygon.cs
@@ -102,7 +102,7 @@
         {
             _inputParam = new Parameter[2];
             _inputParam[0] = new RasterParam(TextStrings.input1Raster) { HelpText = TextStrings.InputRasterforCliping };
-            _inputParam[1] = new FeatureSetParam(TextStrings.input2PolygonforCliping)
+            _inputParam[1] = new PolygonFeatureSetParam(TextStrings.input2PolygonforCliping)
                                  {
                                      HelpText = TextStrings.InputPolygonforclipingtoRaster
                                  };


Cleanup

Cleanup

--- CSharpTradeOffers/Community/SteamChatHandler.cs
+++ CSharpTradeOffers/Community/SteamChatHandler.cs
@@ -65,9 +65,9 @@
         private string GetAccessToken()
         {
             string response = _web.Fetch(BaseChatUrl, "GET", null, _account.AuthContainer).ReadStream();
-            string removed = response.Remove(0, response.IndexOf("\'https://api.steampowered.com/\', \"") + 34);
-            string token = removed.Substring(0, 32);
-            return token;
+            string removed = response.Remove(0, response.IndexOf("\'https://api.steampowered.com/\', \"", StringComparison.Ordinal) + 34);
+            return removed.Substring(0, 32);
+
         }

         /// <summary>