fixed tests

fixed tests

--- SS.Integration.Adapter.Tests/StreamListenerActorTests.cs
+++ SS.Integration.Adapter.Tests/StreamListenerActorTests.cs
@@ -664,7 +664,7 @@
         ///// <summary>
         ///// If test is failed check maxFixtureUpdateDelayInSeconds and delayedFixtureRecoveryAttemptSchedule
         ///// </summary>
-        //[Test]
+        [Test]
         [Category(STREAM_LISTENER_ACTOR_CATEGORY)]
         public void OnValidationFixtureTimeStampFailedWhenProcessSnapshot()
         {
@@ -732,15 +732,15 @@
             {
                 SuspensionManagerMock.Verify(a =>
                         a.Suspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)),
-                            SuspensionReason.UPDTATE_DELAYED),
+                            SuspensionReason.UPDATE_DELAYED),
                     Times.Once);  //handleupdatedelay
                 resourceFacadeMock.Verify(a => a.GetSnapshot(), Times.Once);
-                //PluginMock.Verify(a =>
-                //        a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
-                //    Times.Once);
+                PluginMock.Verify(a =>
+                        a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
+                    Times.Never);
                 SuspensionManagerMock.Verify(a =>
                         a.Unsuspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
-                    Times.Never);
+                    Times.Once); //o
                 SuspensionManagerMock.Verify(a =>
                         a.Suspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)),
                             SuspensionReason.SUSPENSION),
@@ -1667,110 +1667,6 @@
                 TimeSpan.FromMilliseconds(ASSERT_EXEC_INTERVAL));
         }

-		/// <summary>
-		/// This test ensures that on Initialization when error occurs we move to Errored State
-		/// and try to recover by processing full snapshot, but we fail to recover so we go to Stopped state
-		/// where we notify the parent actor of stopping to kill this child actor
-		/// </summary>
-        //ToDo enable
-		//[Test]
-        [Category(STREAM_LISTENER_ACTOR_CATEGORY)]
-        public void OnInitializingFailedSetErroredStateAndFailToRecover()
-        {
-            //
-            //Arrange
-            //
-            Fixture snapshot;
-            Mock<IResourceFacade> resourceFacadeMock;
-            SetupCommonMockObjects(
-                /*sport*/FootabllSportMock.Object.Name,
-                /*fixtureData*/FixtureSamples.football_inplay_snapshot_2,
-                /*storedData*/new { Epoch = 7, Sequence = 2, MatchStatus = MatchStatus.InRunning },
-                out snapshot,
-                out resourceFacadeMock);
-
-            //this will force initialization to fail
-            resourceFacadeMock.Reset();
-            resourceFacadeMock.Setup(o => o.Id).Returns(snapshot.Id);
-            ServiceMock.Setup(o => o.GetSports()).Returns(new[] { FootabllSportMock.Object });
-            ServiceMock.Setup(o => o.GetResources(It.Is<string>(s => s.Equals(FootabllSportMock.Object.Name))))
-                .Returns(new List<IResourceFacade> { resourceFacadeMock.Object });
-            //
-            //Act
-            //
-            var streamListenerManagerActor =
-                ActorOfAsTestActorRef<StreamListenerManagerActor>(
-                    Props.Create(() =>
-                        new StreamListenerManagerActor(
-                            SettingsMock.Object,
-                            PluginMock.Object,
-                            StateManagerMock.Object,
-                            SuspensionManagerMock.Object,
-                            StreamHealthCheckValidationMock.Object,
-                            FixtureValidationMock.Object)),
-                    StreamListenerManagerActor.ActorName);
-            var sportProcessorRouterActor =
-                ActorOfAsTestActorRef<SportProcessorRouterActor>(
-                    Props.Create(() => new SportProcessorRouterActor(ServiceMock.Object))
-                        .WithRouter(new SmallestMailboxPool(SettingsMock.Object.FixtureCreationConcurrency)),
-                    SportProcessorRouterActor.ActorName);
-
-            sportProcessorRouterActor.Tell(new ProcessSportMsg { Sport = FootabllSportMock.Object.Name });
-
-            //
-            //Assert
-            //
-            AwaitAssert(() =>
-                {
-                    resourceFacadeMock.Verify(a => a.GetSnapshot(), Times.Once);
-                    PluginMock.Verify(a =>
-                            a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
-                        Times.Never);
-                    PluginMock.Verify(a =>
-                            a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), true),
-                        Times.Never);
-                    PluginMock.Verify(a =>
-                            a.ProcessStreamUpdate(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
-                        Times.Never);
-                    SuspensionManagerMock.Verify(a =>
-                            a.Unsuspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
-                        Times.Never);
-                    SuspensionManagerMock.Verify(a =>
-                            a.Suspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)),
-                                SuspensionReason.INTERNALERROR),
-                        Times.Once);
-                    SuspensionManagerMock.Verify(a =>
-                            a.Suspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)),
-                                SuspensionReason.FIXTURE_ERRORED),
-                        Times.Once);
-                    SuspensionManagerMock.Verify(a =>
-                            a.Suspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)),
-                                SuspensionReason.DISCONNECT_EVENT),
-                        Times.Never);
-                    MarketRulesManagerMock.Verify(a =>
-                            a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
-                        Times.Never);
-                    MarketRulesManagerMock.Verify(a =>
-                            a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), It.IsAny<bool>()),
-                        Times.Never);
-                    MarketRulesManagerMock.Verify(a =>
-                            a.CommitChanges(),
-                        Times.Never);
-                    MarketRulesManagerMock.Verify(a =>
-                            a.RollbackChanges(),
-                        Times.Never);
-                    Assert.Throws<AggregateException>(() =>
-                    {
-                        Sys.ActorSelection(
-                                streamListenerManagerActor,
-                                StreamListenerActor.GetName(resourceFacadeMock.Object.Id))
-                            .ResolveOne(TimeSpan.FromSeconds(5)).Wait();
-                    }).InnerException.Should().BeOfType<ActorNotFoundException>();
-                },
-                TimeSpan.FromMilliseconds(ASSERT_WAIT_TIMEOUT),
-                TimeSpan.FromMilliseconds(ASSERT_EXEC_INTERVAL));
-        }
-
         /// <summary>
         /// This test ensures that we don't process the market rules when processing snapshot on-demand
         /// </summary>
@@ -1878,79 +1774,79 @@
         /// <summary>
         /// This test ensures that we don't process the market rules when processing snapshot on-demand
         /// </summary>
-        //[Test]
-        //[Category(STREAM_LISTENER_ACTOR_CATEGORY)]
-        //public void OnProcessSnapshotSkipMarketRulesWhenErrored()
-        //{
-        //    //
-        //    //Arrange
-        //    //
-        //    Fixture snapshot;
-        //    Mock<IResourceFacade> resourceFacadeMock;
-        //    SetupCommonMockObjects(
-        //        /*sport*/FootabllSportMock.Object.Name,
-        //        /*fixtureData*/FixtureSamples.football_inplay_snapshot_2,
-        //        /*storedData*/new { Epoch = 7, Sequence = 2, MatchStatus = MatchStatus.InRunning },
-        //        out snapshot,
-        //        out resourceFacadeMock);
-        //    StreamHealthCheckValidationMock.Setup(a =>
-        //            a.CanConnectToStreamServer(
-        //                It.IsAny<IResourceFacade>(),
-        //                It.IsAny<StreamListenerState>()))
-        //        .Returns(true);
-        //    FixtureValidationMock.SetupSequence(o =>
-        //            o.IsSnapshotNeeded(
-        //                It.IsAny<IResourceFacade>(),
-        //                It.IsAny<FixtureState>()))
-        //        .Throws(new Exception())
-        //        .Returns(false);
-        //    SettingsMock.SetupGet(o => o.SkipRulesOnError).Returns(true);
-
-        //    //
-        //    //Act
-        //    //
-        //    var actor = ActorOfAsTestActorRef(() =>
-        //        new StreamListenerActor(
-        //            SettingsMock.Object,
-        //            PluginMock.Object,
-        //            resourceFacadeMock.Object,
-        //            StateManagerMock.Object,
-        //            SuspensionManagerMock.Object,
-        //            StreamHealthCheckValidationMock.Object,
-        //            FixtureValidationMock.Object));
-
-        //    //
-        //    //Assert
-        //    //
-        //    AwaitAssert(() =>
-        //        {
-        //            resourceFacadeMock.Verify(a => a.GetSnapshot(), Times.Once);
-        //            PluginMock.Verify(a =>
-        //                    a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
-        //                Times.Once);
-        //            SuspensionManagerMock.Verify(a =>
-        //                    a.Unsuspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
-        //                Times.Once);
-        //            MarketRulesManagerMock.Verify(a =>
-        //                    a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
-        //                Times.Never);
-        //            MarketRulesManagerMock.Verify(a =>
-        //                    a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
-        //                Times.Never);
-        //            MarketRulesManagerMock.Verify(a =>
-        //                    a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), true),
-        //                Times.Once);
-        //            MarketRulesManagerMock.Verify(a =>
-        //                    a.CommitChanges(),
-        //                Times.Once);
-        //            MarketRulesManagerMock.Verify(a =>
-        //                    a.RollbackChanges(),
-        //                Times.Never);
-        //            Assert.AreEqual(StreamListenerState.Streaming, actor.UnderlyingActor.State);
-        //        },
-        //        TimeSpan.FromMilliseconds(ASSERT_WAIT_TIMEOUT),
-        //        TimeSpan.FromMilliseconds(ASSERT_EXEC_INTERVAL));
-        //}
+        [Test]
+        [Category(STREAM_LISTENER_ACTOR_CATEGORY)]
+        public void OnProcessSnapshotSkipMarketRulesWhenErrored()
+        {
+            //
+            //Arrange
+            //
+            Fixture snapshot;
+            Mock<IResourceFacade> resourceFacadeMock;
+            SetupCommonMockObjects(
+                /*sport*/FootabllSportMock.Object.Name,
+                /*fixtureData*/FixtureSamples.football_inplay_snapshot_2,
+                /*storedData*/new { Epoch = 7, Sequence = 2, MatchStatus = MatchStatus.InRunning },
+                out snapshot,
+                out resourceFacadeMock);
+            StreamHealthCheckValidationMock.Setup(a =>
+                    a.CanConnectToStreamServer(
+                        It.IsAny<IResourceFacade>(),
+                        It.IsAny<StreamListenerState>()))
+                .Returns(true);
+            FixtureValidationMock.SetupSequence(o =>
+                    o.IsSnapshotNeeded(
+                        It.IsAny<IResourceFacade>(),
+                        It.IsAny<FixtureState>()))
+                .Throws(new Exception())
+                .Returns(false);
+            SettingsMock.SetupGet(o => o.SkipRulesOnError).Returns(true);
+
+            //
+            //Act
+            //
+            var actor = ActorOfAsTestActorRef(() =>
+                new StreamListenerActor(
+                    SettingsMock.Object,
+                    PluginMock.Object,
+                    resourceFacadeMock.Object,
+                    StateManagerMock.Object,
+                    SuspensionManagerMock.Object,
+                    StreamHealthCheckValidationMock.Object,
+                    FixtureValidationMock.Object));
+
+            //
+            //Assert
+            //
+            AwaitAssert(() =>
+                {
+                    resourceFacadeMock.Verify(a => a.GetSnapshot(), Times.Once);
+                    PluginMock.Verify(a =>
+                            a.ProcessSnapshot(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
+                        Times.Once);
+                    SuspensionManagerMock.Verify(a =>
+                            a.Unsuspend(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
+                        Times.Once);
+                    MarketRulesManagerMock.Verify(a =>
+                            a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id))),
+                        Times.Never);
+                    MarketRulesManagerMock.Verify(a =>
+                            a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), false),
+                        Times.Never);
+                    MarketRulesManagerMock.Verify(a =>
+                            a.ApplyRules(It.Is<Fixture>(f => f.Id.Equals(resourceFacadeMock.Object.Id)), true),
+                        Times.Once);
+                    MarketRulesManagerMock.Verify(a =>
+                            a.CommitChanges(),
+                        Times.Once);
+                    MarketRulesManagerMock.Verify(a =>
+                            a.RollbackChanges(),
+                        Times.Never);
+                    Assert.AreEqual(StreamListenerState.Streaming, actor.UnderlyingActor.State);
+                },
+                TimeSpan.FromMilliseconds(ASSERT_WAIT_TIMEOUT),
+                TimeSpan.FromMilliseconds(ASSERT_EXEC_INTERVAL));
+        }

         /// <summary>
         /// This test ensures that when disconnection occurs then the reconnection is automatically done.


degenerate slowdown

degenerate slowdown

go to iterative instead of binary find + InOrderSuccessor because the
latter is very slow scrolling when at beginning of document

--- SassyStudio.2012/Editor/Classification/SassClassifier.cs
+++ SassyStudio.2012/Editor/Classification/SassClassifier.cs
@@ -19,8 +19,8 @@
             Editor = editor;

             Editor.DocumentChanged += OnDocumentChanged;
-        }
-
+        }
+
         public event EventHandler<ClassificationChangedEventArgs> ClassificationChanged;

         void OnDocumentChanged(object sender, DocumentChangedEventArgs e)
@@ -40,28 +40,18 @@
             {
                 try
                 {
-                    var item = stylesheet.Children.FindItemContainingPosition(span.Start);
-                    if (item == null)
-                        item = stylesheet as Stylesheet;
+                    foreach (var current in GetItems(stylesheet.Children, span))
+                    {
+                        if (current.Start > span.End)
+                            break;

-                    if (!(item is IParseItemContainer))
-                        item = item.Parent ?? item;
+                        var type = ClassifierContextCache.Get(current.ClassifierType).GetClassification(Registry);
+                        if (type == null)
+                            continue;

-                    for (var current = item; current != null; current = current.InOrderSuccessor())
-                    {
-                        if (current.Start <= span.End && current.End >= span.Start)
-                        {
-                            if (current.Start > span.End)
-                                break;
-
-                            var type = ClassifierContextCache.Get(current.ClassifierType).GetClassification(Registry);
-                            if (type != null)
-                            {
-                                var start = Math.Max(0, current.Start);
-                                var length = Math.Min(snapshot.Length - start, current.Length);
-                                results.Add(new ClassificationSpan(new SnapshotSpan(snapshot, new Span(start, length)), type));
-                            }
-                        }
+                        var start = Math.Max(0, current.Start);
+                        var length = Math.Min(snapshot.Length - start, current.Length);
+                        results.Add(new ClassificationSpan(new SnapshotSpan(snapshot, new Span(start, length)), type));
                     }
                 }
                 catch (Exception ex)
@@ -72,5 +62,23 @@

             return results;
         }
+
+        static IEnumerable<ParseItem> GetItems(ParseItemList items, SnapshotSpan span)
+        {
+            foreach (var item in items)
+            {
+                if (item.Start <= span.End && item.End >= span.Start)
+                {
+                    yield return item;
+
+                    var container = item as IParseItemContainer;
+                    if (container != null)
+                    {
+                        foreach (var child in GetItems(container.Children, span))
+                            yield return child;
+                    }
+                }
+            }
+        }
     }
 }


multi factura y pagos anulados con apuntes no anulados

(TFS CS 6008)

--- Signum.Web.Extensions/Auth/Controllers/AuthController.cs
+++ Signum.Web.Extensions/Auth/Controllers/AuthController.cs
@@ -18,6 +18,7 @@
 using Signum.Entities;
 using Signum.Engine.Mailing;
 using System.Collections.Generic;
+using Signum.Utilities;
 #endregion

 namespace Signum.Web.Authorization
@@ -110,7 +111,7 @@
                     if (user == null)
                         throw new ApplicationException(Resources.ThereSNotARegisteredUserWithThatEmailAddress);

-                    AuthLogic.ResetPasswordRequest(user, HttpContextUtils.FullyQualifiedApplicationPath);
+                    AuthLogic.ResetPasswordRequest(user, HttpContextUtils.FullyQualifiedApplicationPath);
                 }

                 ViewData["email"] = email;
@@ -210,7 +211,7 @@
                 return RedirectToAction("ResetPasswordSuccess");
             }
             catch (Exception ex)
-            {
+            {
                 return ResetPasswordSetNewError(request.Id, ViewDataKeys.GlobalErrors, ex.Message);
             }
         }
@@ -309,7 +310,7 @@
             {
                 user = AuthLogic.Login(username, Security.EncodePassword(password));
             }
-            catch (Exception ) { }
+            catch (Exception) { }

             if (user == null)
                 return LoginError("_FORM", Resources.InvalidUsernameOrPassword);
@@ -513,7 +514,9 @@
             var newUser = UserDN.Current.ToLite().Retrieve();

             Thread.CurrentPrincipal = newUser;
-            System.Web.HttpContext.Current.Session[SessionUserKey] = newUser;
+
+            if (System.Web.HttpContext.Current != null)
+                System.Web.HttpContext.Current.Session[SessionUserKey] = newUser;
         }

         public static void AddUserSession(string userName, UserDN user)


Fix reward text

Fix reward text

--- Source/ContractsWindow/PanelInterfaces/IntervalNodeUI.cs
+++ Source/ContractsWindow/PanelInterfaces/IntervalNodeUI.cs
@@ -69,12 +69,20 @@
 			return node.getRecord(i).ToString();
 		}

+		private string coloredText(string s, char c, string color)
+		{
+			if (string.IsNullOrEmpty(s))
+				return "";
+
+			return string.Format("<color={0}>{1}{2}</color>  ", color, c, s);
+		}
+
 		public string RewardText(int i)
 		{
 			if (node == null)
 				return "";

-			return string.Format("<color=#69D84FFF>£ {0}</color>  <color=#02D8E9FF>© {1}</color>  <color=#C9B003FF>¡ {2}</color>", node.getFundsString(i), node.getScienceString(i), node.getRepString(i));
+			return string.Format("{0}{1}{2}", coloredText(node.getFundsString(i), '£', "#69D84FFF"), coloredText(node.getScienceString(i), '©', "#02D8E9FF"), coloredText(node.getRepString(i), '¡', "#C9B003FF"));
 		}

 	}


iOS: Adjust size of spinner based on available size for control

--- Source/Eto.Platform.iOS/Forms/Controls/SpinnerHandler.cs
+++ Source/Eto.Platform.iOS/Forms/Controls/SpinnerHandler.cs
@@ -18,6 +18,24 @@
 			};
 		}

+		protected override void Initialize()
+		{
+			base.Initialize();
+			Widget.SizeChanged += HandleSizeChanged;
+		}
+
+		void HandleSizeChanged (object sender, EventArgs e)
+		{
+			var size = Math.Min(Size.Width, Size.Height);
+			if (size < 32)
+				Control.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray;
+			else
+			{
+				Control.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
+				Control.Color = UIColor.Gray;
+			}
+		}
+
 		protected override SizeF GetNaturalSize(SizeF availableSize)
 		{
 			return new SizeF(16, 16);


Fix wrong conversion of byte[] identifiers for MySQL (#1303).

--- Source/LinqToDB/DataProvider/MySql/MySqlMappingSchema.cs
+++ Source/LinqToDB/DataProvider/MySql/MySqlMappingSchema.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Text;
+using System.Data.Linq;

 namespace LinqToDB.DataProvider.MySql
 {
@@ -16,6 +17,8 @@
 		{
 			SetValueToSqlConverter(typeof(String), (sb,dt,v) => ConvertStringToSql(sb, v.ToString()));
 			SetValueToSqlConverter(typeof(Char),   (sb,dt,v) => ConvertCharToSql  (sb, (char)v));
+			SetValueToSqlConverter(typeof(byte[]), (sb,dt,v) => ConvertBinaryToSql(sb, (byte[])v));
+			SetValueToSqlConverter(typeof(Binary), (sb,dt,v) => ConvertBinaryToSql(sb, ((Binary)v).ToArray()));

 			SetDataType(typeof(string), new SqlDataType(DataType.NVarChar, typeof(string), 255));
 		}
@@ -44,5 +47,13 @@
 				stringBuilder.Append('\'');
 			}
 		}
+
+		static void ConvertBinaryToSql(StringBuilder stringBuilder, byte[] value)
+		{
+			stringBuilder.Append("0x");
+
+			foreach (var b in value)
+				stringBuilder.Append(b.ToString("X2"));
+		}
 	}
 }


Reactivated GGX convolution and fixed crash in sky renderer when loading RenderDoc.

--- Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs
+++ Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs
@@ -87,30 +87,40 @@
             };
         }

+        void RebuildTextures()
+        {
+            if(m_SkyboxCubemapRT == null)
+            {
+                m_SkyboxCubemapRT = new RenderTexture(kSkyCubemapSize, kSkyCubemapSize, 1, RenderTextureFormat.ARGBHalf);
+                m_SkyboxCubemapRT.dimension = TextureDimension.Cube;
+                m_SkyboxCubemapRT.useMipMap = true;
+                m_SkyboxCubemapRT.autoGenerateMips = true;
+                m_SkyboxCubemapRT.filterMode = FilterMode.Point;
+                m_SkyboxCubemapRT.Create();
+            }
+
+            if(m_SkyboxGGXCubemapRT == null)
+            {
+                m_SkyboxGGXCubemapRT = new RenderTexture(kSkyCubemapSize, kSkyCubemapSize, 1, RenderTextureFormat.ARGBHalf);
+                m_SkyboxGGXCubemapRT.dimension = TextureDimension.Cube;
+                m_SkyboxGGXCubemapRT.useMipMap = true;
+                m_SkyboxGGXCubemapRT.autoGenerateMips = false;
+                m_SkyboxGGXCubemapRT.filterMode = FilterMode.Trilinear;
+                m_SkyboxGGXCubemapRT.Create();
+            }
+        }
+
         public void Rebuild()
         {
             // TODO: We need to have an API to send our sky information to Enlighten. For now use a workaround through skybox/cubemap material...
             m_StandardSkyboxMaterial = Utilities.CreateEngineMaterial("Skybox/Cubemap");

             m_SkyHDRIMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/SkyHDRI");
-          //  m_GGXConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/GGXConvolve");
+            m_GGXConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/GGXConvolve");

             m_RenderSkyPropertyBlock = new MaterialPropertyBlock();

-            m_SkyboxCubemapRT = new RenderTexture(kSkyCubemapSize, kSkyCubemapSize, 1, RenderTextureFormat.ARGBHalf);
-            m_SkyboxCubemapRT.dimension = TextureDimension.Cube;
-            m_SkyboxCubemapRT.useMipMap = true;
-            m_SkyboxCubemapRT.autoGenerateMips = true;
-            m_SkyboxCubemapRT.filterMode = FilterMode.Point;
-            m_SkyboxCubemapRT.Create();
-
-
-            m_SkyboxGGXCubemapRT = new RenderTexture(kSkyCubemapSize, kSkyCubemapSize, 1, RenderTextureFormat.ARGBHalf);
-            m_SkyboxGGXCubemapRT.dimension = TextureDimension.Cube;
-            m_SkyboxGGXCubemapRT.useMipMap = true;
-            m_SkyboxGGXCubemapRT.autoGenerateMips = false;
-            m_SkyboxGGXCubemapRT.filterMode = FilterMode.Trilinear;
-            m_SkyboxGGXCubemapRT.Create();
+            RebuildTextures();

             Matrix4x4 cubeProj = Matrix4x4.Perspective(90.0f, 1.0f, 0.1f, 1.0f);

@@ -148,7 +158,7 @@
         {
             Utilities.Destroy(m_StandardSkyboxMaterial);
             Utilities.Destroy(m_SkyHDRIMaterial);
-        //    Utilities.Destroy(m_GGXConvolveMaterial);
+            Utilities.Destroy(m_GGXConvolveMaterial);
             Utilities.Destroy(m_SkyboxCubemapRT);
             Utilities.Destroy(m_SkyboxGGXCubemapRT);

@@ -207,7 +217,7 @@
                 skyParams.rotation = 0.0f;
                 skyParams.skyHDRI = input;
                 RenderSkyToCubemap(skyParams, target, renderLoop);
-/*
+
                 // Do the convolution on remaining mipmaps
                 float invOmegaP = (6.0f * input.width * input.width) / (4.0f * Mathf.PI); // Solid angle associated to a pixel of the cubemap;

@@ -233,7 +243,7 @@
                         cmd.Dispose();
                     }
                 }
- */
+
             }
         }

@@ -244,6 +254,9 @@
                 //using (new EditorGUI.DisabledScope(m_LookDevEnvLibrary.hdriList.Count <= 1))
                 if (IsSkyValid(skyParameters))
                 {
+                    // When loading RenderDoc, RenderTextures will go null
+                    RebuildTextures();
+
                     using (new Utilities.ProfilingSample("Sky Pass: Render Cubemap", renderLoop))
                     {
                         // Render sky into a cubemap - doesn't happen every frame, can be controlled


Fixed using command.

Fixed using command.

--- Source/LinqToDB/DataProvider/SqlServer/SqlServerTools.cs
+++ Source/LinqToDB/DataProvider/SqlServer/SqlServerTools.cs
@@ -94,17 +94,19 @@
 									if (version == 8)
 										return _sqlServerDataProvider2000;

-									var cmd = conn.CreateCommand();
-									cmd.CommandText = "SELECT compatibility_level FROM sys.databases WHERE name = db_name()";
-									var level = Converter.ChangeTypeTo<int>(cmd.ExecuteScalar());
-
-									switch (level)
+									using (var cmd = conn.CreateCommand())
 									{
-										case  80 : return _sqlServerDataProvider2000;
-										case  90 : return _sqlServerDataProvider2005;
-										case 100 : return _sqlServerDataProvider2008;
-										case 110 : return _sqlServerDataProvider2012;
-										default  : return _sqlServerDataProvider2012;
+										cmd.CommandText = "SELECT compatibility_level FROM sys.databases WHERE name = db_name()";
+										var level = Converter.ChangeTypeTo<int>(cmd.ExecuteScalar());
+
+										switch (level)
+										{
+											case  80 : return _sqlServerDataProvider2000;
+											case  90 : return _sqlServerDataProvider2005;
+											case 100 : return _sqlServerDataProvider2008;
+											case 110 : return _sqlServerDataProvider2012;
+											default  : return _sqlServerDataProvider2012;
+										}
 									}
 								}
 							}


Updates for 2.0

Updates for 2.0

--- Source/Samples/SampleMvc/Views/Shared/CustomError.cshtml
+++ Source/Samples/SampleMvc/Views/Shared/CustomError.cshtml
@@ -6,7 +6,7 @@

Custom Error

 @using (Html.BeginForm("Error", "Home", FormMethod.Post)) {
     @Html.AntiForgeryToken()
-    @Html.Hidden("Identifier", ExceptionlessClient.Default.GetLastErrorId())
+    @Html.Hidden("Identifier", ExceptionlessClient.Default.GetLastReferenceId())

     @Html.TextBox("EmailAddress")

     @Html.TextArea("Description")


Removed unnecessary using directive

Removed unnecessary using directive

--- Source/Toolkit/SharpDX.Toolkit/Content/ContentManager.cs
+++ Source/Toolkit/SharpDX.Toolkit/Content/ContentManager.cs
@@ -23,7 +23,6 @@
 using System.IO;
 using System.Reflection;
 using SharpDX.Collections;
-using System.Reflection;

 namespace SharpDX.Toolkit.Content
 {
@@ -395,4 +394,4 @@
             }
         }
     }
-}+}


Fixing bugs and optimizing Rewind object

--- BeardedManStudios/Source/Forge/Networking/Objects/Rewind.cs
+++ BeardedManStudios/Source/Forge/Networking/Objects/Rewind.cs
@@ -22,148 +22,209 @@

 namespace BeardedManStudios.Forge.Networking
 {
-	public class Rewind<T>
-	{
-		public TimeManager Time { get; set; }
-		public ulong rewindTime = 0;
-		private Dictionary<ulong, T> rewinds = null;
-
-		public void Register(T value, ulong timestep = 0)
-		{
-			if (timestep == 0)
-				timestep = Time.Timestep;
-
-			if (rewinds.Count > 0)
-			{
-				var keys = rewinds.Keys;
-				foreach (ulong key in keys)
-				{
-					if (key < timestep - rewindTime)
-						rewinds.Remove(key);
-				}
-			}
-
-			rewinds.Add(timestep, value);
-		}
-
-		/// <summary>
-		/// Used to get the value of a variable based on a given time step
-		/// </summary>
-		/// <param name="timestep">The time step that a value should be pulled for</param>
-		/// <returns>The value of the tracked variable at the given time stamp or default() if no history is available</returns>
-		public T Get(ulong timestep)
-		{
-			if (rewinds.Count == 0)
-				return default(T);
-
-			if (rewinds.ContainsKey(timestep))
-				return rewinds[timestep];
-
-			var keys = rewinds.Keys;
-			ulong key = 0;
-
-			foreach (ulong k in keys)
-			{
-				if (timestep < k)
-				{
-					if (timestep - key > k - timestep) key = k;
-					break;
-				}
-
-				key = k;
-			}
-
-			return rewinds[key];
-		}
-
-		/// <summary>
-		/// Used to get the value of a variable based on a given time step but also
-		/// will out the lower and upper if found to allow for getting median
-		/// </summary>
-		/// <param name="timestep">The time step that a value should be pulled for</param>
-		/// <param name="lower">The lover value relative to the timestep</param>
-		/// <param name="upper">The upper value relative to the timestep</param>
-		/// <returns>The value of the tracked variable at the given time stamp or default() if no history is available</returns>
-		public T Get(ulong timestep, out T lower, out T upper)
-		{
-			lower = default(T);
-			upper = lower;
-
-			if (rewinds.Count == 0)
-				return lower;
-
-			if (rewinds.ContainsKey(timestep))
-				return rewinds[timestep];
-
-			var keys = rewinds.Keys;
-			ulong key = 0, lowerKey = 0, upperKey = 0;
-
-			if (keys.Last() < timestep)
-			{
-				// TODO:  The supplied time does not exist, throw exception?
-				return default(T);
-			}
-
-			foreach (ulong k in keys)
-			{
-				if (timestep < k)
-				{
-					lowerKey = key;
-					upperKey = k;
-					if (timestep - key > k - timestep) key = k;
-					break;
-				}
-
-				key = k;
-			}
-
-			lower = rewinds[lowerKey];
-			upper = rewinds[upperKey];
-			return rewinds[key];
-		}
-
-		/// <summary>
-		/// Gets a range of values leading up to a given time step
-		/// </summary>
-		/// <param name="timestep">The time step that a value should be pulled for</param>
-		/// <param name="count">The number of elements to get before the time step</param>
-		/// <returns>The list of found elements leading up to the timestep (including time step value if found</returns>
-		public List<T> GetRange(ulong timestep, int count)
-		{
-			List<T> found = new List<T>();
-
-			if (rewinds.Count == 0)
-				return found;
-
-			var keys = rewinds.Keys.ToArray().Reverse();
-			ulong lastKey = 0;
-
-			if (keys.First() < timestep)
-			{
-				// TODO:  The supplied time does not exist, throw exception?
-				return found;
-			}
-
-			foreach (ulong k in keys)
-			{
-				if (timestep <= k)
-				{
-					if (timestep != k && lastKey != 0)
-					{
-						found.Add(rewinds[lastKey]);
-						lastKey = 0;
-					}
-
-					found.Insert(0, rewinds[k]);
-
-					if (found.Count == count)
-						break;
-				}
-				else
-					lastKey = k;
-			}
-
-			return found;
-		}
-	}
+    public class Rewind<T>
+    {
+        public ulong RewindTime { get; set; }
+        private Dictionary<ulong, T> rewinds = null;
+        private List<ulong> keys = new List<ulong>();
+
+        public Rewind(ulong length)
+        {
+            RewindTime = length;
+            rewinds = new Dictionary<ulong, T>();
+        }
+
+        public void Register(T value, ulong timestep = 0)
+        {
+            lock (rewinds)
+            {
+                if (keys.Contains(timestep))
+                {
+                    rewinds[timestep] = value;
+                    return;
+                }
+
+                if (rewinds.Count > 0)
+                {
+                    for (int i = 0; i < keys.Count; i++)
+                    {
+                        if (keys[i] < timestep - RewindTime && RewindTime < timestep)
+                        {
+                            rewinds.Remove(keys[i]);
+                            keys.RemoveAt(i--);
+                        }
+                        else
+                            break;
+                    }
+                }
+
+                rewinds.Add(timestep, value);
+                keys.Add(timestep);
+            }
+        }
+
+        /// <summary>
+        /// Used to get the value of a variable based on a given time step
+        /// </summary>
+        /// <param name="timestep">The time step that a value should be pulled for</param>
+        /// <returns>The value of the tracked variable at the given time stamp or default() if no history is available</returns>
+        public T Get(ulong timestep)
+        {
+            lock (rewinds)
+            {
+                if (rewinds.Count == 0)
+                    return default(T);
+
+                T result;
+                if (rewinds.TryGetValue(timestep, out result))
+                    return result;
+
+                ulong key = 0;
+                foreach (ulong k in keys)
+                {
+                    if (timestep < k)
+                    {
+                        if (timestep - key > k - timestep)
+                            key = k;
+
+                        break;
+                    }
+
+                    key = k;
+                }
+
+                return rewinds[key];
+            }
+        }
+
+        /// <summary>
+        /// Used to get the value of a variable based on a given time step but also
+        /// will out the lower and upper if found to allow for getting median
+        /// </summary>
+        /// <param name="timestep">The time step that a value should be pulled for</param>
+        /// <param name="lower">The lover value relative to the timestep</param>
+        /// <param name="upper">The upper value relative to the timestep</param>
+        /// <returns>The value of the tracked variable at the given time stamp or default() if no history is available</returns>
+        public T Get(ulong timestep, out T lower, out T upper)
+        {
+            lock (rewinds)
+            {
+                lower = default(T);
+                upper = lower;
+
+                if (rewinds.Count == 0)
+                    return lower;
+
+                if (rewinds.ContainsKey(timestep))
+                    return rewinds[timestep];
+
+                ulong key = 0, lowerKey = 0, upperKey = 0;
+
+                if (keys.Last() < timestep)
+                {
+                    // TODO:  The supplied time does not exist, throw exception?
+                    return default(T);
+                }
+
+                foreach (ulong k in keys)
+                {
+                    if (timestep < k)
+                    {
+                        lowerKey = key;
+                        upperKey = k;
+                        if (timestep - key > k - timestep)
+                            key = k;
+
+                        break;
+                    }
+
+                    key = k;
+                }
+
+                lower = rewinds[lowerKey];
+                upper = rewinds[upperKey];
+                return rewinds[key];
+            }
+        }
+
+        /// <summary>
+        /// Gets a range of values leading up to a given time step
+        /// </summary>
+        /// <param name="timestep">The time step that a value should be pulled for</param>
+        /// <param name="count">The number of elements to get before the time step</param>
+        /// <returns>The list of found elements leading up to the timestep (including time step value if found</returns>
+        public List<T> GetRange(ulong timestep, int count)
+        {
+            lock (rewinds)
+            {
+                List<T> found = new List<T>();
+
+                if (rewinds.Count == 0)
+                    return found;
+
+                var keys = rewinds.Keys.ToArray().Reverse();
+                ulong lastKey = 0;
+
+                if (keys.First() < timestep)
+                {
+                    // TODO:  The supplied time does not exist, throw exception?
+                    return found;
+                }
+
+                foreach (ulong k in keys)
+                {
+                    if (timestep <= k)
+                    {
+                        if (timestep != k && lastKey != 0)
+                        {
+                            found.Add(rewinds[lastKey]);
+                            lastKey = 0;
+                        }
+
+                        found.Insert(0, rewinds[k]);
+
+                        if (found.Count == count)
+                            break;
+                    }
+                    else
+                        lastKey = k;
+                }
+
+                return found;
+            }
+        }
+
+        /// <summary>
+        /// Gets a range of values between the two timesteps (inclusive)
+        /// </summary>
+        /// <param name="timestepMin">The minimum inclusive timestep that a value should be pulled for</param>
+        /// <param name="timestepMax">The maximum inclusive timestep that a value should be pulled for</param>
+        /// <returns>The list of found elements between the two timesteps inclusively </returns>
+        public List<T> GetRange(ulong timestepMin, ulong timestepMax)
+        {
+            lock (rewinds)
+            {
+                List<T> found = new List<T>();
+
+                if (rewinds.Count == 0)
+                    return found;
+
+                var keys = rewinds.Keys.ToArray().Reverse();
+
+                if (keys.First() < timestepMin)
+                {
+                    // TODO:  The supplied time does not exist, throw exception?
+                    return found;
+                }
+
+                foreach (ulong k in keys)
+                {
+                    if (timestepMin <= k && timestepMax >= k)
+                        found.Insert(0, rewinds[k]);
+                }
+
+                return found;
+            }
+        }
+    }
 }


update assembly info

update assembly info

--- Citrius.Owin.Security.Foursquare/Properties/AssemblyInfo.cs
+++ Citrius.Owin.Security.Foursquare/Properties/AssemblyInfo.cs
@@ -8,9 +8,9 @@
 [assembly: AssemblyTitle("Citrius.Owin.Security.Foursquare")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Citrius Corporation")]
 [assembly: AssemblyProduct("Citrius.Owin.Security.Foursquare")]
-[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyCopyright("Copyright ©  2013 Citrius Corp.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Comment.

Comment.

--- Cogito.Core/Net/Http/HttpMessageEventSourceWriterHandler.cs
+++ Cogito.Core/Net/Http/HttpMessageEventSourceWriterHandler.cs
@@ -17,7 +17,6 @@
         /// <summary>
         /// Initializes a new instance.
         /// </summary>
-        /// <param name="eventSource"></param>
         /// <param name="innerHandler"></param>
         public HttpMessageEventSourceWriterHandler(HttpMessageHandler innerHandler)
             : base(innerHandler)


Default to 2FA in example program

Default to 2FA in example program

--- SteamBot/Program.cs
+++ SteamBot/Program.cs
@@ -74,7 +74,7 @@
                 return;
             }

-            Bot b = new Bot(configObject.Bots[botIndex], configObject.ApiKey, BotManager.UserHandlerCreator, true, true);
+            Bot b = new Bot(configObject.Bots[botIndex], configObject.ApiKey, BotManager.UserHandlerCreator, true, true, true);
             Console.Title = "Bot Manager";
             b.StartBot();


Delete DxfRenderer.cs

Delete DxfRenderer.cs

--- Test/DxfRenderer.cs
+++ Test/DxfRenderer.cs
@@ -1,754 +0,0 @@
-// Copyright (c) Wiesław Šoltés. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Dxf;
-using Test2d;
-
-namespace Test
-{
-    public class DxfRenderer
-    {
-        private DxfAcadVer _version;
-        private int _handle = 0;
-        private string _defaultStyle = "Standard";
-        private double _pageWidth;
-        private double _pageHeight;
-        private string _stylePrimatyFont = "calibri.ttf"; // "arial.ttf"; "arialuni.ttf";
-        private string _stylePrimatyFontDescription = "Calibri"; // "Arial"; "Arial Unicode MS"
-        private string _styleBigFont = "";
-
-        private int NextHandle() { return _handle += 1; }
-        private double ToDxfX(double x) { return x; }
-        private double ToDxfY(double y) { return _pageHeight - y; }
-
-        private void TableAppids(DxfTable<DxfAppid> appids)
-        {
-            // NOTE: Appid "ACAD" - default must be present
-            if (_version > DxfAcadVer.AC1009)
-            {
-                appids.Items.Add(new DxfAppid(_version, NextHandle())
-                {
-                    ApplicationName = "ACAD",
-                    AppidStandardFlags = DxfAppidStandardFlags.Default
-                });
-            }
-        }
-
-        private void TableDimstyles(DxfTable<DxfDimstyle> dimstyles)
-        {
-            if (_version > DxfAcadVer.AC1009)
-            {
-                dimstyles.Items.Add(new DxfDimstyle(_version, NextHandle())
-                {
-                    Name = "Standard"
-                });
-            }
-        }
-
-        private void TableLayers(DxfTable<DxfLayer> layers, Container container)
-        {
-            // NOTE: Default layer "0" - must be present.
-            if (_version > DxfAcadVer.AC1009)
-            {
-                layers.Items.Add(new DxfLayer(_version, NextHandle())
-                {
-                    Name = "0",
-                    LayerStandardFlags = DxfLayerStandardFlags.Default,
-                    Color = DxfDefaultColors.Default.ToDxfColor(),
-                    LineType = "Continuous",
-                    PlottingFlag = true,
-                    LineWeight = DxfLineWeight.LnWtByLwDefault,
-                    PlotStyleNameHandle = "0"
-                });
-            }
-
-            layers.Items.Add(new DxfLayer(_version, NextHandle())
-            {
-                Name = container.TemplateLayer.Name,
-                LayerStandardFlags = DxfLayerStandardFlags.Default,
-                Color = DxfDefaultColors.Default.ToDxfColor(),
-                LineType = "Continuous",
-                PlottingFlag = true,
-                LineWeight = DxfLineWeight.LnWtByLwDefault,
-                PlotStyleNameHandle = "0"
-            });
-
-            foreach (var layer in container.Layers)
-            {
-                layers.Items.Add(new DxfLayer(_version, NextHandle())
-                {
-                    Name = layer.Name,
-                    LayerStandardFlags = DxfLayerStandardFlags.Default,
-                    Color = DxfDefaultColors.Default.ToDxfColor(),
-                    LineType = "Continuous",
-                    PlottingFlag = true,
-                    LineWeight = DxfLineWeight.LnWtByLwDefault,
-                    PlotStyleNameHandle = "0"
-                });
-            }
-        }
-
-        private void TableLtypes(DxfTable<DxfLtype> ltypes)
-        {
-            // NOTE: Default ltypes ByLayer, ByBlock and Continuous - must be present.
-
-            // ByLayer
-            ltypes.Items.Add(new DxfLtype(_version, NextHandle())
-            {
-                Name = "ByLayer",
-                LtypeStandardFlags = DxfLtypeStandardFlags.Default,
-                Description = "ByLayer",
-                DashLengthItems = 0,
-                TotalPatternLength = 0,
-                DashLengths = null,
-            });
-
-            // ByBlock
-            ltypes.Items.Add(new DxfLtype(_version, NextHandle())
-            {
-                Name = "ByBlock",
-                LtypeStandardFlags = DxfLtypeStandardFlags.Default,
-                Description = "ByBlock",
-                DashLengthItems = 0,
-                TotalPatternLength = 0,
-                DashLengths = null,
-            });
-
-            // Continuous
-            ltypes.Items.Add(new DxfLtype(_version, NextHandle())
-            {
-                Name = "Continuous",
-                LtypeStandardFlags = DxfLtypeStandardFlags.Default,
-                Description = "Solid line",
-                DashLengthItems = 0,
-                TotalPatternLength = 0,
-                DashLengths = null,
-            });
-        }
-
-        private void TableStyles(DxfTable<DxfStyle> styles)
-        {
-            // style: Standard
-            styles.Items.Add(new DxfStyle(_version, NextHandle())
-            {
-                Name = "Standard",
-                StyleStandardFlags = DxfStyleFlags.Default,
-                FixedTextHeight = 0,
-                WidthFactor = 1,
-                ObliqueAngle = 0,
-                TextGenerationFlags = DxfTextGenerationFlags.Default,
-                LastHeightUsed = 1,
-                PrimaryFontFile = _stylePrimatyFont,
-                BifFontFile = _styleBigFont,
-                PrimatyFontDescription = _stylePrimatyFontDescription
-            });
-        }
-
-        private void TableUcss(DxfTable<DxfUcs> ucss)
-        {
-            // NOTE: Currently not used.
-        }
-
-        private void TableViews(DxfTable<DxfView> views)
-        {
-            views.Items.Add(new DxfView(_version, NextHandle())
-            {
-                Name = "View",
-                ViewStandardFlags = DxfViewStandardFlags.Default,
-                Height = _pageHeight,
-                Width = _pageWidth,
-                Center = new DxfVector2(_pageWidth / 2, _pageHeight / 2),
-                ViewDirection = new DxfVector3(0, 0, 1),
-                TargetPoint = new DxfVector3(0, 0, 0),
-                FrontClippingPlane = 0,
-                BackClippingPlane = 0,
-                TwistAngle = 0
-            });
-        }
-
-        private void TableVports(DxfTable<DxfVport> vports)
-        {
-            if (_version > DxfAcadVer.AC1009)
-            {
-                vports.Items.Add(new DxfVport(_version, NextHandle())
-                {
-                    Name = "*Active"
-                });
-            }
-        }
-
-        private IEnumerable<DxfBlock> DefaultBlocks()
-        {
-            if (_version > DxfAcadVer.AC1009)
-            {
-                var blocks = new List<DxfBlock>();
-                string layer = "0";
-
-                blocks.Add(new DxfBlock(_version, NextHandle())
-                {
-                    Name = "*Model_Space",
-                    Layer = layer,
-                    BlockTypeFlags = DxfBlockTypeFlags.Default,
-                    BasePoint = new DxfVector3(0, 0, 0),
-                    XrefPathName = null,
-                    Description = null,
-                    EndId = NextHandle(),
-                    EndLayer = layer,
-                    Entities = null
-                });
-
-                blocks.Add(new DxfBlock(_version, NextHandle())
-                {
-                    Name = "*Paper_Space",
-                    Layer = layer,
-                    BlockTypeFlags = DxfBlockTypeFlags.Default,
-                    BasePoint = new DxfVector3(0, 0, 0),
-                    XrefPathName = null,
-                    Description = null,
-                    EndId = NextHandle(),
-                    EndLayer = layer,
-                    Entities = null
-                });
-
-                blocks.Add(new DxfBlock(_version, NextHandle())
-                {
-                    Name = "*Paper_Space0",
-                    Layer = layer,
-                    BlockTypeFlags = DxfBlockTypeFlags.Default,
-                    BasePoint = new DxfVector3(0, 0, 0),
-                    XrefPathName = null,
-                    Description = null,
-                    EndId = NextHandle(),
-                    EndLayer = layer,
-                    Entities = null
-                });
-
-                return blocks;
-            }
-
-            return Enumerable.Empty<DxfBlock>();
-        }
-
-        private DxfBlockRecord CreateBlockRecordForBlock(string name)
-        {
-            return new DxfBlockRecord(_version, NextHandle())
-            {
-                Name = name
-            };
-        }
-
-        private DxfLine CreateLine(double x1, double y1, double x2, double y2, string layer)
-        {
-            double _x1 = ToDxfX(x1);
-            double _y1 = ToDxfY(y1);
-            double _x2 = ToDxfX(x2);
-            double _y2 = ToDxfY(y2);
-
-            return new DxfLine(_version, NextHandle())
-            {
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                Thickness = 0.0,
-                StartPoint = new DxfVector3(_x1, _y1, 0),
-                EndPoint = new DxfVector3(_x2, _y2, 0),
-                ExtrusionDirection = new DxfVector3(0, 0, 1)
-            };
-        }
-
-        private DxfCircle CreateCircle(double cx, double cy, double radius, string layer)
-        {
-            double _cx = ToDxfX(cx);
-            double _cy = ToDxfY(cy);
-
-            return new DxfCircle(_version, NextHandle())
-            {
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                Thickness = 0.0,
-                CenterPoint = new DxfVector3(_cx, _cy, 0),
-                Radius = radius,
-                ExtrusionDirection = new DxfVector3(0, 0, 1),
-            };
-        }
-
-        private DxfEllipse CreateEllipse(double x, double y, double width, double height, string layer)
-        {
-            double _cx = ToDxfX(x + width / 2.0);
-            double _cy = ToDxfY(y + height / 2.0);
-            double minor = Math.Min(height, width);
-            double major = Math.Max(height, width);
-            double _ex = width >= height ? major / 2.0 : 0.0; // relative to _cx
-            double _ey = width < height ? major / 2.0 : 0.0; // relative to _cy
-
-            return new DxfEllipse(_version, NextHandle())
-            {
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                CenterPoint = new DxfVector3(_cx, _cy, 0),
-                EndPoint = new DxfVector3(_ex, _ey, 0),
-                ExtrusionDirection = new DxfVector3(0, 0, 1),
-                Ratio = minor / major,
-                StartParameter = 0.0,
-                EndParameter = 2.0 * Math.PI
-            };
-        }
-
-        private DxfArc CreateArc(
-            double x, double y,
-            double radius,
-            double startAngle, double endAngle,
-            string layer)
-        {
-            double _cx = ToDxfX(x + radius / 2.0);
-            double _cy = ToDxfY(y + radius / 2.0);
-
-            return new DxfArc(_version, NextHandle())
-            {
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                Thickness = 0.0,
-                CenterPoint = new DxfVector3(_cx, _cy, 0),
-                Radius = radius,
-                StartAngle = startAngle,
-                EndAngle = endAngle,
-                ExtrusionDirection = new DxfVector3(0, 0, 1),
-            };
-        }
-
-        private DxfSpline CreateSpline(
-            double p1x, double p1y,
-            double p2x, double p2y,
-            double p3x, double p3y,
-            double p4x, double p4y,
-            string layer)
-        {
-            double _p1x  = ToDxfX(p1x);
-            double _p1y  = ToDxfY(p1y);
-            double _p2x  = ToDxfX(p2x);
-            double _p2y  = ToDxfY(p2y);
-            double _p3x  = ToDxfX(p3x);
-            double _p3y  = ToDxfY(p3y);
-            double _p4x  = ToDxfX(p4x);
-            double _p4y  = ToDxfY(p4y);
-
-            var spline = new DxfSpline(_version, NextHandle())
-            {
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                NormalVector = new DxfVector3(0.0, 0.0, 1.0),
-                SplineFlags = DxfSplineFlags.Planar,
-                SplineCurveDegree = 3,
-                KnotTolerance =  0.0000001,
-                ControlPointTolerance = 0.0000001,
-                FitTolerance = 0.0000000001,
-                StartTangent = null,
-                EndTangent = null,
-                Knots = new double[8],
-                Weights = null,
-                ControlPoints = new DxfVector3[4],
-                FitPoints = null
-            };
-
-            spline.Knots[0] = 0.0;
-            spline.Knots[1] = 0.0;
-            spline.Knots[2] = 0.0;
-            spline.Knots[3] = 0.0;
-
-            spline.Knots[4] = 1.0;
-            spline.Knots[5] = 1.0;
-            spline.Knots[6] = 1.0;
-            spline.Knots[7] = 1.0;
-
-            spline.ControlPoints[0] = new DxfVector3(_p1x, _p1y, 0.0);
-            spline.ControlPoints[1] = new DxfVector3(_p2x, _p2y, 0.0);
-            spline.ControlPoints[2] = new DxfVector3(_p3x, _p3y, 0.0);
-            spline.ControlPoints[3] = new DxfVector3(_p4x, _p4y, 0.0);
-
-            return spline;
-        }
-
-        private DxfText CreateText(
-            string text,
-            double x, double y,
-            double height,
-            DxfHorizontalTextJustification horizontalJustification,
-            DxfVerticalTextJustification verticalJustification,
-            string style,
-            string layer)
-        {
-            return new DxfText(_version, NextHandle())
-            {
-                Thickness = 0,
-                Layer = layer,
-                Color = DxfDefaultColors.ByLayer.ToDxfColor(),
-                FirstAlignment = new DxfVector3(ToDxfX(x), ToDxfY(y), 0),
-                TextHeight = height,
-                DefaultValue = text.ToDxfText(_version),
-                TextRotation = 0,
-                ScaleFactorX = 1,
-                ObliqueAngle = 0,
-                TextStyle = style,
-                TextGenerationFlags = DxfTextGenerationFlags.Default,
-                HorizontalTextJustification = horizontalJustification,
-                SecondAlignment = new DxfVector3(ToDxfX(x), ToDxfY(y), 0),
-                ExtrusionDirection = new DxfVector3(0, 0, 1),
-                VerticalTextJustification = verticalJustification
-            };
-        }
-
-        private static Rect2 CreateRect(XPoint tl, XPoint br, double dx, double dy)
-        {
-            double tlx = Math.Min(tl.X, br.X);
-            double tly = Math.Min(tl.Y, br.Y);
-            double brx = Math.Max(tl.X, br.X);
-            double bry = Math.Max(tl.Y, br.Y);
-            double width = (brx - tlx);
-            double height = (bry - tly);
-            return new Rect2(tlx + dx, tly + dy, width, height);
-        }
-
-        private void DrawLine(DxfEntities entities, XLine line, string layer)
-        {
-            entities.Entities.Add(CreateLine(line.Start.X, line.Start.Y, line.End.X, line.End.Y, layer));
-        }
-
-        private void DrawRectangle(DxfEntities entities, XRectangle rectangle, string layer)
-        {
-            var rect = CreateRect(rectangle.TopLeft, rectangle.BottomRight, 0.0, 0.0);
-            entities.Entities.Add(CreateLine(rect.X, rect.Y, rect.X + rect.Width, rect.Y, layer));
-            entities.Entities.Add(CreateLine(rect.X, rect.Y + rect.Height, rect.X + rect.Width, rect.Y + rect.Height, layer));
-            entities.Entities.Add(CreateLine(rect.X, rect.Y, rect.X, rect.Y + rect.Height, layer));
-            entities.Entities.Add(CreateLine(rect.X + rect.Width, rect.Y, rect.X + rect.Width, rect.Y + rect.Height, layer));
-        }
-
-        private void DrawEllipse(DxfEntities entities, XEllipse ellipse, string layer)
-        {
-            var rect = CreateRect(ellipse.TopLeft, ellipse.BottomRight, 0.0, 0.0);
-            entities.Entities.Add(CreateEllipse(rect.X, rect.Y, rect.Width, rect.Height, layer));
-        }
-
-        private void DrawArc(DxfEntities entities, XArc arc, string layer)
-        {
-            var a = Arc.FromXArc(arc, 0.0, 0.0);
-            entities.Entities.Add(CreateArc(a.X, a.Y, a.Radius, a.StartAngle, a.EndAngle, layer));
-        }
-
-        private void DrawBezier(DxfEntities entities, XBezier bezier, string layer)
-        {
-            entities.Entities.Add(
-                CreateSpline(
-                    bezier.Point1.X, bezier.Point1.Y,
-                    bezier.Point2.X, bezier.Point2.Y,
-                    bezier.Point3.X, bezier.Point3.Y,
-                    bezier.Point4.X, bezier.Point4.Y,
-                    layer));
-        }
-
-        private void DrawQBezier(DxfEntities entities, XQBezier qbezier, string layer)
-        {
-            double x1 = qbezier.Point1.X;
-            double y1 = qbezier.Point1.Y;
-            double x2 = qbezier.Point1.X + (2.0 * (qbezier.Point2.X - qbezier.Point1.X)) / 3.0;
-            double y2 = qbezier.Point1.Y + (2.0 * (qbezier.Point2.Y - qbezier.Point1.Y)) / 3.0;
-            double x3 = x2 + (qbezier.Point3.X - qbezier.Point1.X) / 3.0;
-            double y3 = y2 + (qbezier.Point3.Y - qbezier.Point1.Y) / 3.0;
-            double x4 = qbezier.Point3.X;
-            double y4 = qbezier.Point3.Y;
-
-            entities.Entities.Add(
-                CreateSpline(
-                    x1, y1,
-                    x2, y2,
-                    x3, y3,
-                    x4, y4,
-                    layer));
-        }
-
-        private void DrawText(DxfEntities entities, XText text, string layer)
-        {
-            DxfHorizontalTextJustification halign;
-            DxfVerticalTextJustification valign;
-            double x, y;
-
-            var rect = CreateRect(text.TopLeft, text.BottomRight, 0.0, 0.0);
-
-            switch (text.Style.TextStyle.TextHAlignment)
-            {
-                default:
-                case TextHAlignment.Left:
-                    halign = DxfHorizontalTextJustification.Left;
-                    x = rect.X;
-                    break;
-                case TextHAlignment.Center:
-                    halign = DxfHorizontalTextJustification.Center;
-                    x = rect.X + rect.Width / 2.0;
-                    break;
-                case TextHAlignment.Right:
-                    halign = DxfHorizontalTextJustification.Right;
-                    x = rect.X + rect.Width;
-                    break;
-            }
-
-            switch (text.Style.TextStyle.TextVAlignment)
-            {
-                default:
-                case TextVAlignment.Top:
-                    valign = DxfVerticalTextJustification.Top;
-                    y = rect.Y;
-                    break;
-                case TextVAlignment.Center:
-                    valign = DxfVerticalTextJustification.Middle;
-                    y = rect.Y + rect.Height / 2.0;
-                    break;
-                case TextVAlignment.Bottom:
-                    valign = DxfVerticalTextJustification.Bottom;
-                    y = rect.Y + rect.Height;
-                    break;
-            }
-
-            entities.Entities.Add(CreateText(
-                text.Text,
-                x, y,
-                text.Style.TextStyle.FontSize * (72.0 / 96.0),
-                halign,
-                valign,
-                _defaultStyle,
-               layer));
-        }
-
-        private void DrawShapes(DxfEntities entities, IEnumerable<BaseShape> shapes, string layer)
-        {
-            foreach (var shape in shapes)
-            {
-                if (shape.State.HasFlag(ShapeState.Printable))
-                {
-                    if (shape is XPoint)
-                    {
-                        var point = shape as XPoint;
-                        // TODO: Draw point.
-                    }
-                    else if (shape is XLine)
-                    {
-                        var line = shape as XLine;
-                        DrawLine(entities, line, layer);
-                        // TODO: Draw start and end arrows.
-                    }
-                    else if (shape is XRectangle)
-                    {
-                        var rectangle = shape as XRectangle;
-                        DrawRectangle(entities, rectangle, layer);
-                    }
-                    else if (shape is XEllipse)
-                    {
-                        var ellipse = shape as XEllipse;
-                        if (_version <= DxfAcadVer.AC1009)
-                        {
-                            // try to use circle for ellipse
-                            var rect = CreateRect(ellipse.TopLeft, ellipse.BottomRight, 0.0, 0.0);
-                            if (rect.Width == rect.Height)
-                            {
-                                double radius = rect.Width / 2.0;
-                                double cx = rect.X + radius;
-                                double cy = rect.Y + radius;
-                                entities.Entities.Add(CreateCircle(cx, cy, radius, layer));
-                            }
-                        }
-                        else
-                        {
-                            DrawEllipse(entities, ellipse, layer);
-                        }
-                    }
-                    else if (shape is XArc)
-                    {
-                        var arc = shape as XArc;
-                        DrawArc(entities, arc, layer);
-                    }
-                    else if (shape is XBezier)
-                    {
-                        var bezier = shape as XBezier;
-                        DrawBezier(entities, bezier, layer);
-                    }
-                    else if (shape is XQBezier)
-                    {
-                        var qbezier = shape as XQBezier;
-                        DrawQBezier(entities, qbezier, layer);
-                    }
-                    else if (shape is XText)
-                    {
-                        var text = shape as XText;
-                        DrawText(entities, text, layer);
-                    }
-                    else if (shape is XGroup)
-                    {
-                        var group = shape as XGroup;
-                        DrawShapes(entities, group.Shapes, layer);
-                    }
-                }
-            }
-        }
-
-        private void Save(string path, string text)
-        {
-            try
-            {
-                if (text != null)
-                {
-                    using (var stream = System.IO.File.CreateText(path))
-                    {
-                        stream.Write(text);
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                System.Diagnostics.Debug.Print(ex.Message);
-                System.Diagnostics.Debug.Print(ex.StackTrace);
-            }
-        }
-
-        public void Create(string path, Container container, DxfAcadVer version)
-        {
-            _version = version;
-
-            _pageWidth = container.Width;
-            _pageHeight = container.Height;
-
-            //_layer = "0";
-            _handle = 0;
-
-            // create dxf file
-            var file = new DxfFile(_version, NextHandle());
-
-            // create header
-            file.Header = new DxfHeader(_version, NextHandle());
-
-            // create classes
-            if (_version > DxfAcadVer.AC1009)
-            {
-                file.Classes = new DxfClasses(_version, NextHandle());
-
-                // classes.Classes.Add(new DxfClass(...));
-
-                // end of classes
-            }
-
-            // create tables
-            file.Tables = new DxfTables(_version, NextHandle());
-
-            file.Tables.AppidTable.Id = NextHandle();
-            TableAppids(file.Tables.AppidTable);
-
-            file.Tables.DimstyleTable.Id = NextHandle();
-            TableDimstyles(file.Tables.DimstyleTable);
-
-            file.Tables.BlockRecordTable.Id = NextHandle();
-            if (_version > DxfAcadVer.AC1009)
-            {
-                // NOTE: Required block records by Dxf format.
-                file.Tables.BlockRecordTable.Items.Add(
-                    CreateBlockRecordForBlock("*Model_Space"));
-
-                file.Tables.BlockRecordTable.Items.Add(
-                    CreateBlockRecordForBlock("*Paper_Space"));
-
-                file.Tables.BlockRecordTable.Items.Add(
-                    CreateBlockRecordForBlock("*Paper_Space0"));
-
-                // NOTE: Each BLOCK must have BLOCK_RECORD entry.
-
-                //file.Tables.BlockRecordTable.Items.Add(
-                //    CreateBlockRecordForBlock("BLOCK_NAME));
-            }
-
-            file.Tables.LtypeTable.Id = NextHandle();
-            TableLtypes(file.Tables.LtypeTable);
-
-            file.Tables.LayerTable.Id = NextHandle();
-            TableLayers(file.Tables.LayerTable, container);
-
-            file.Tables.StyleTable.Id = NextHandle();
-            TableStyles(file.Tables.StyleTable);
-
-            file.Tables.UcsTable.Id = NextHandle();
-            TableUcss(file.Tables.UcsTable);
-
-            file.Tables.ViewTable.Id = NextHandle();
-            TableViews(file.Tables.ViewTable);
-
-            file.Tables.VportTable.Id = NextHandle();
-            TableVports(file.Tables.VportTable);
-
-            // create blocks
-            file.Blocks = new DxfBlocks(_version, NextHandle());
-            foreach (var block in DefaultBlocks())
-            {
-                file.Blocks.Blocks.Add(block);
-            }
-
-            // TODO: Add user blocks.
-
-            // create entities
-            file.Entities = new DxfEntities(_version, NextHandle());
-
-            // TODO: Add user entities.
-
-            if (container.TemplateLayer.IsVisible)
-            {
-                DrawShapes(file.Entities, container.TemplateLayer.Shapes, container.TemplateLayer.Name);
-            }
-
-            foreach (var layer in container.Layers)
-            {
-                if (layer.IsVisible)
-                {
-                    DrawShapes(file.Entities, layer.Shapes, layer.Name);
-                }
-            }
-
-            // end of entities
-
-            // create objects
-            if (_version > DxfAcadVer.AC1009)
-            {
-                file.Objects = new DxfObjects(_version, NextHandle());
-
-                // mamed dictionary
-                var namedDict = new DxfDictionary(_version, NextHandle())
-                {
-                    OwnerDictionaryHandle = 0.ToDxfHandle(),
-                    HardOwnerFlag = false,
-                    DuplicateRecordCloningFlags = DxfDuplicateRecordCloningFlags.KeepExisting
-                };
-
-                // base dictionary
-                var baseDict = new DxfDictionary(_version, NextHandle())
-                {
-                    OwnerDictionaryHandle = namedDict.Id.ToDxfHandle(),
-                    HardOwnerFlag = false,
-                    DuplicateRecordCloningFlags = DxfDuplicateRecordCloningFlags.KeepExisting
-                };
-
-                // add baseDict to namedDict
-                namedDict.Entries.Add(baseDict.Id.ToDxfHandle(), "ACAD_GROUP");
-
-                // finalize dictionaries
-                file.Objects.Objects.Add(namedDict);
-                file.Objects.Objects.Add(baseDict);
-
-                // TODO: Add Group dictionary.
-                // TODO: Add MLine style dictionary.
-                // TODO: Add image dictionary dictionary.
-
-                // end of objects
-            }
-
-            // set only after file is finilized
-            file.Header.NextAvailableHandle = NextHandle();
-
-            Save(path, file.Create());
-        }
-    }
-}


Created bucket from fixture

Created bucket from fixture

--- storage/api/Storage.Samples.Tests/MakeBucketPublicTest.cs
+++ storage/api/Storage.Samples.Tests/MakeBucketPublicTest.cs
@@ -29,15 +29,10 @@
     [Fact]
     public void MakeBucketPublic()
     {
-        var storage = StorageClient.Create();
-
         MakeBucketPublicSample makeBucketPublicSample = new MakeBucketPublicSample();
-        CreateBucketSample createBucketSample = new CreateBucketSample();
-
+        var storage = StorageClient.Create();
         var bucketName = Guid.NewGuid().ToString();
-        createBucketSample.CreateBucket(_fixture.ProjectId, bucketName);
-        _fixture.SleepAfterBucketCreateUpdateDelete();
-        _fixture.TempBucketNames.Add(bucketName);
+        _fixture.CreateBucket(bucketName);

         makeBucketPublicSample.MakeBucketPublic(bucketName);


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpConnection.cs
+++ websocket-sharp/Net/HttpConnection.cs
@@ -487,12 +487,12 @@
         disposeRequestBuffer ();
         if (chunked) {
           _context.Response.SendChunked = true;
-          _inputStream = new ChunkedRequestStream (
-            _stream, buff, _position, len - _position, _context);
+          _inputStream =
+            new ChunkedRequestStream (_stream, buff, _position, len - _position, _context);
         }
         else {
-          _inputStream = new RequestStream (
-            _stream, buff, _position, len - _position, contentLength);
+          _inputStream =
+            new RequestStream (_stream, buff, _position, len - _position, contentLength);
         }

         return _inputStream;


Fix crash in BuildStageOne()

Fix crash in BuildStageOne()

Remove assumption that all match results are in consecutive order. Need to explicit check for null in g.Matches in loop.

--- webstats/SubmittedData/LiveResults.cs
+++ webstats/SubmittedData/LiveResults.cs
@@ -91,12 +91,15 @@

             Groups.ToList().ForEach(g =>
             {
-                var matchCount = g.Matches.Count(m => m != null);
                 tomlBuilder.Append("[");
                 winnersBuilder.Append("[");
                 for (var i = 0; i < g.Teams.Count() * 2 - 2; i++)
                 {
-                    tomlBuilder.Append(i < matchCount ? $"\"{g.Matches.ElementAt(i).ResultSign}\"," : $"\"-\",");
+                    if (g.Matches[i] != null)
+                        tomlBuilder.Append($"\"{g.Matches[i].ResultSign}\",");
+                    else
+                        tomlBuilder.Append($"\"-\",");
+
                     winnersBuilder.Append("\"-\",");
                 }


ProjectX: Fix a bug in thread index symbol naming

     Fix a bug where the exported thread index symbol name of shared library doesn't have OrdinalPrefix while the imported one has. The mistmatching caused a linking failure for multifile dynamic generic tests.

     Also fix a bug in UTC when creating indirs of an IAT indirection cell. The indirs should be nonGC and they should use FIRSTPASINDEX since they are read-only and they don't interfere with any data.

     Some code refactoring is done to the symbol creation to remove redundant code.

[tfs-changeset: 1652937]

--- src/ILCompiler.Compiler/src/Compiler/UtcNameMangler.cs
+++ src/ILCompiler.Compiler/src/Compiler/UtcNameMangler.cs
@@ -538,7 +538,7 @@

             if (HasExport && GetTlsIndexOrdinal(out ordinal))
             {
-                return ordinal.ToString();
+                return OrdinalPrefix + ordinal;
             }
             else
             {


fixed EF Core cast problem

fixed EF Core cast problem

--- test/Abp.EntityFrameworkCore.Tests/Ef/SupportDbContext.cs
+++ test/Abp.EntityFrameworkCore.Tests/Ef/SupportDbContext.cs
@@ -67,8 +67,9 @@
             if (typeof(IPassivable).GetTypeInfo().IsAssignableFrom(typeof(TEntity)))
             {
                 return GetAll()
-                    .Cast<IPassivable>()
-                    .Where(e => e.IsActive)
+                    //.Cast<IPassivable>()
+                    //TODO: Core3.0 update, see https://github.com/aspnet/EntityFrameworkCore/issues/17794
+                    .Where(e => ((IPassivable)e).IsActive)
                     .Cast<TEntity>()
                     .ToList();
             }


added achievement for catching sheeps

added achievement for catching sheeps

--- Documents/Unity3D/Catcheep/Assets/Scripts/sheepDestroyer.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/sheepDestroyer.cs
@@ -210,8 +210,12 @@
         ++gameManager.totalSheepsCaught;
         PlayerPrefs.SetInt("sheepy", PlayerPrefs.GetInt("sheepy") + 1);
         PlayerPrefs.SetInt("mostSheepy", PlayerPrefs.GetInt("mostSheepy") + 1);
-        GameObject.Find("Music Manager").GetComponent<PlayServicesMyVersion>().unlockPartialAchievement(GPGSIds.achievement_catch_1000_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 1000);
-        GameObject.Find("Music Manager").GetComponent<PlayServicesMyVersion>().unlockPartialAchievement(GPGSIds.achievement_catch_2500_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 2500);
+        PlayServicesMyVersion psmv = GameObject.Find("Music Manager").GetComponent<PlayServicesMyVersion>();
+        psmv.unlockPartialAchievement(GPGSIds.achievement_catch_1000_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 1000);
+        psmv.unlockPartialAchievement(GPGSIds.achievement_catch_2500_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 2500);
+        psmv.unlockPartialAchievement(GPGSIds.achievement_catch_5000_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 5000);
+        psmv.unlockPartialAchievement(GPGSIds.achievement_catch_7500_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 7500);
+        psmv.unlockPartialAchievement(GPGSIds.achievement_catche_10000_sheeps, (double) PlayerPrefs.GetInt("mostSheepy") / 10000);
             sheepsCaughtText.GetComponent<TextMeshProUGUI>().text = " x " + gameManager.totalSheepsCaught;
         ++gameManager.combo;
         gameManager.score += 10 * gameManager.combo;


Sorting dtos and consolidating into one function.

--- src/ServiceStack/ServiceHost/ServiceMetadata.cs
+++ src/ServiceStack/ServiceHost/ServiceMetadata.cs
@@ -175,17 +175,17 @@

         public List<string> GetAllOperationNames()
         {
-            return Operations.Select(x => x.RequestType.Name).ToList();
+            return Operations.Select(x => x.RequestType.Name).OrderBy(operation => operation).ToList();
         }

         public List<string> GetOperationNamesForMetadata(IHttpRequest httpReq)
         {
-            return Operations.Select(x => x.RequestType.Name).ToList();
+            return GetAllOperationNames();
         }

         public List<string> GetOperationNamesForMetadata(IHttpRequest httpReq, Format format)
         {
-            return Operations.Select(x => x.RequestType.Name).ToList();
+            return GetAllOperationNames();
         }

         public bool IsVisible(IHttpRequest httpReq, Operation operation)
@@ -417,4 +417,4 @@
     }

-}+}


Fixed bugs in saving out icon resource groups.

--- Src/Workshell.PE.Resources/Graphics/IconGroupResource.cs
+++ Src/Workshell.PE.Resources/Graphics/IconGroupResource.cs
@@ -218,7 +218,7 @@
         {
             byte[] data = GetBytes(languageId);

-            using (MemoryStream mem = new MemoryStream())
+            using (MemoryStream mem = new MemoryStream(data))
             {
                 NEWHEADER header = Utils.Read<NEWHEADER>(mem);

@@ -241,7 +241,7 @@
             }
         }

-        public void Save(string fileName, uint languageId, IconSaveFormat format)
+        public void Save(string fileName, uint languageId, IconGroupSaveFormat format)
         {
             using (FileStream file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None))
             {
@@ -250,9 +250,9 @@
             }
         }

-        public void Save(Stream stream, uint languageId, IconSaveFormat format)
-        {
-            if (format == IconSaveFormat.Raw)
+        public void Save(Stream stream, uint languageId, IconGroupSaveFormat format)
+        {
+            if (format == IconGroupSaveFormat.Raw)
             {
                 Save(stream, languageId);
             }
@@ -278,18 +278,17 @@
                 {
                     IconGroupEntry entry = group[i];

+                    ulong color_count = Convert.ToUInt64(Math.Pow(2, entry.BitCount));
+
+                    if (color_count >= 256)
+                        color_count = 0;
+
                     Utils.Write(Convert.ToByte(entry.Width >= 256 ? 0 : entry.Width), stream);
                     Utils.Write(Convert.ToByte(entry.Height >= 256 ? 0 : entry.Height), stream);
-                    Utils.Write(Convert.ToByte(entry.ColorCount), stream);
+                    Utils.Write(Convert.ToByte(color_count), stream);
                     Utils.Write(Convert.ToByte(0), stream);
                     Utils.Write(Convert.ToUInt16(1), stream);
-
-                    ushort colors = Convert.ToUInt16(Math.Log(entry.ColorCount) / Math.Log(2));
-
-                    if (colors >= 256)
-                        colors = 0;
-
-                    Utils.Write(colors, stream);
+                    Utils.Write(entry.BitCount, stream);
                     Utils.Write(entry.BytesInRes, stream);
                     Utils.Write(offsets[i], stream);
                 }


changed class RE colors

changed class RE colors

--- TCC.Core/Converters/ClassToReColorConverter.cs
+++ TCC.Core/Converters/ClassToReColorConverter.cs
@@ -12,24 +12,27 @@
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
         {
             Color col = Colors.Transparent;
+            var parLight = parameter != null && parameter.ToString().Contains("light") ? "Light" : "";
             if (value != null)
                 switch ((Class)value)
                 {
                     case Class.Gunner:
-                        col = Colors.Aqua;
+                        // ReSharper disable once PossibleNullReferenceException
+                        col = (Color) Application.Current.FindResource("WillpowerColor"+parLight);
                         break;
                     case Class.Brawler:
-                        col = Colors.Orange;
+                        // ReSharper disable once PossibleNullReferenceException
+                        col = (Color)Application.Current.FindResource("RageColor" + parLight);
                         break;
                     case Class.Ninja:
                         // ReSharper disable once PossibleNullReferenceException
-                        col = (Color) Application.Current.FindResource("NinjaColor");
+                        col = (Color) Application.Current.FindResource("ArcaneColor"+parLight);
                         break;
                     case Class.Valkyrie:
                         col = Colors.White;
                         break;
                 }
-            return parameter != null && parameter.ToString() == "color" ? (object)col : new SolidColorBrush(col);
+            return parameter != null && parameter.ToString().Contains("color") ? (object)col : new SolidColorBrush(col);
         }

         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)


Changed Property types

Changed Property types

--- source/DotNetBay.WPF/ViewModel/AuctionListViewModel.cs
+++ source/DotNetBay.WPF/ViewModel/AuctionListViewModel.cs
@@ -23,8 +23,8 @@

         public ObservableCollection<Auction> Auctions { get; private set; }

-        public ICommand NewAuction { get; private set; }
-        public ICommand Bid { get; private set; }
+        public NewAuctionCmd NewAuction { get; private set; }
+        public BidCmd Bid { get; private set; }

         private void InitAuctions()
         {


Remove unused method

Remove unused method

--- src/Sitecore.FakeDb/Data/Engines/DataStorage.cs
+++ src/Sitecore.FakeDb/Data/Engines/DataStorage.cs
@@ -288,17 +288,5 @@
       this.FakeItems.Add(TemplateIDs.TemplateField, new DbItem(TemplateFieldItemName, TemplateIDs.TemplateField, TemplateIDs.Template) { ParentID = ItemIDs.TemplateRoot, FullPath = "/sitecore/templates/template field" });
       this.FakeItems.Add(TemplateIDs.BranchTemplate, new DbItem(BranchItemName, TemplateIDs.BranchTemplate, TemplateIDs.Template) { ParentID = ItemIDs.TemplateRoot, FullPath = "/sitecore/templates/branch" });
     }
-
-    protected void SetStatistics(DbItem item)
-    {
-      var date = DateUtil.IsoNow;
-      var user = Context.User.Name;
-
-      item.Fields.Add(new DbField("__Created", FieldIDs.Created) { Value = date });
-      item.Fields.Add(new DbField("__Created by", FieldIDs.CreatedBy) { Value = user });
-      item.Fields.Add(new DbField("__Revision", FieldIDs.Revision) { Value = ID.NewID.ToString() });
-      item.Fields.Add(new DbField("__Updated", FieldIDs.Updated) { Value = date });
-      item.Fields.Add(new DbField("__Updated by", FieldIDs.UpdatedBy) { Value = user });
-    }
   }
 }


Try to reduce uncaught exception

Try to reduce uncaught exception

--- source/Htc.Vita.Core/Diagnostics/FilePropertiesInfo.cs
+++ source/Htc.Vita.Core/Diagnostics/FilePropertiesInfo.cs
@@ -83,10 +83,19 @@

             Instance = fileInfo;

-            X509Certificate certificate = null;
             try
             {
-                certificate = X509Certificate.CreateFromSignedFile(fileInfo.FullName);
+                var certificate = X509Certificate.CreateFromSignedFile(fileInfo.FullName);
+                IssuerDistinguishedName = certificate.Issuer;
+                IssuerName = DistinguishedName.Parse(IssuerDistinguishedName).O;
+                SubjectDistinguishedName = certificate.Subject;
+                SubjectName = DistinguishedName.Parse(SubjectDistinguishedName).O;
+                PublicKey = certificate.GetPublicKeyString();
+                Verified = Authenticode.IsVerified(fileInfo);
+            }
+            catch (FileLoadException e)
+            {
+                Logger.GetInstance(typeof(FilePropertiesInfo)).Error($"Can not load module to find certificate from file {fileInfo.FullName}. exception: {e}");
             }
             catch (Exception)
             {
@@ -100,15 +109,6 @@
                     Logger.GetInstance(typeof(FilePropertiesInfo)).Warn($"Can not find certificate from file {fileInfo.FullName}");
                     CachedErrorPaths.Add(key);
                 }
-            }
-            if (certificate != null)
-            {
-                IssuerDistinguishedName = certificate.Issuer;
-                IssuerName = DistinguishedName.Parse(IssuerDistinguishedName).O;
-                SubjectDistinguishedName = certificate.Subject;
-                SubjectName = DistinguishedName.Parse(SubjectDistinguishedName).O;
-                PublicKey = certificate.GetPublicKeyString();
-                Verified = Authenticode.IsVerified(fileInfo);
             }

             var versionInfo = FileVersionInfo.GetVersionInfo(fileInfo.FullName);


Fix crash when changing folders that dont contain useful data on disk.

--- StructuredXmlEditor/Tools/ProjectView/ProjectViewTool.cs
+++ StructuredXmlEditor/Tools/ProjectView/ProjectViewTool.cs
@@ -170,8 +170,11 @@
 					}
 					else
 					{
-						var folder = current.ChildFolders[part];
-						current.Children.Remove(folder);
+						if (current.ChildFolders.ContainsKey(part))
+						{
+							var folder = current.ChildFolders[part];
+							current.Children.Remove(folder);
+						}

 						new ProjectItem(Workspace, current, this, part);
 						current.UpdateChildFolders();


Refactor main method

Refactor main method

--- xunit.performance.analysis/Program.cs
+++ xunit.performance.analysis/Program.cs
@@ -82,6 +82,20 @@

             var allIterations = ParseEtlFiles(etlPaths);

+            var testResults = SummarizeTestResults(allIterations);
+
+            var xmlDoc = WriteTestResultsXml(testResults);
+
+            if (xmlOutputPath == null)
+                Console.WriteLine(xmlDoc);
+            else
+                xmlDoc.Save(xmlOutputPath);
+
+            return 0;
+        }
+
+        private static Dictionary<string, Dictionary<string, TestResult>> SummarizeTestResults(IEnumerable<TestIterationResult> allIterations)
+        {
             var testResults = new Dictionary<string, Dictionary<string, TestResult>>();

             foreach (var iteration in allIterations)
@@ -103,6 +117,11 @@
                 result.Failed |= iteration.Failed;
             }

+            return testResults;
+        }
+
+        private static XDocument WriteTestResultsXml(Dictionary<string, Dictionary<string, TestResult>> testResults)
+        {
             var resultElem = new XElement("results");
             var xmlDoc = new XDocument(resultElem);

@@ -146,14 +165,8 @@
                 }
             }

-            if (xmlOutputPath == null)
-                Console.WriteLine(xmlDoc);
-            else
-                xmlDoc.Save(xmlOutputPath);
-
-            return 0;
-        }
-
+            return xmlDoc;
+        }

         static IEnumerable<string> ExpandFilePath(string path)
         {


PeriodicReport: simplifying code

PeriodicReport: simplifying code

--- projects/Epicycle.Commons_cs/Reporting/PeriodicReport.cs
+++ projects/Epicycle.Commons_cs/Reporting/PeriodicReport.cs
@@ -19,7 +19,6 @@
 using Epicycle.Commons.FileSystem;
 using System;
 using System.Collections.Generic;
-using System.Text;

 namespace Epicycle.Commons.Reporting
 {
@@ -67,23 +66,15 @@
             {
                 var report = new SerializableReport();

+                report.Prefix = string.Format("######## {0}", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"));
+
                 foreach(var reporter in _reporters)
                 {
                     reporter(report);
                 }

-                _fileSystem.WriteTextFile(_reportFilePath, GenerateReportText(report), append: true);
+                _fileSystem.WriteReport(_reportFilePath, report, append: true);
             }
-        }
-
-        private string GenerateReportText(SerializableReport report)
-        {
-            var result = new StringBuilder();
-
-            result.AppendFormat("######## {0}\n", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"));
-            result.Append(report.Serialize());
-
-            return result.ToString();
         }
     }
 }


I think version one of this terminal is almost done

--- TaskHistory.Impl/Terminal/TerminalProxyRepo.cs
+++ TaskHistory.Impl/Terminal/TerminalProxyRepo.cs
@@ -24,34 +24,61 @@
 			if (user == null)
 				throw new ArgumentNullException ("user");

+			if (commandResponse.CommandAction != TerminalCommandAction.Insert)
+				throw new InvalidOperationException ($"Command action for this operation must be list instead of {commandResponse.CommandAction}");
+
+			switch (commandResponse.RegisteredObject)
+			{
+			case TerminalRegisteredObject.Label:
+				_registeredObjProxy.LabelRepo.CreateNewLabel ("some content from command response's option");
+				break;
+			case TerminalRegisteredObject.Task:
+				_registeredObjProxy.TaskRepo.CreateNewTaskForUser(user, "some content from command response's object");
+				break;
+			}
+
+			return 1;
+		}
+
+		public IEnumerable<ITerminalObject> PerformReadOperation(TerminalCommandResponse2 commandResponse, IUser user)
+		{
+			if (user == null)
+				throw new ArgumentNullException ("user");
+
 			if (commandResponse.CommandAction != TerminalCommandAction.List)
 				throw new InvalidOperationException ($"Command action for this operation must be list instead of {commandResponse.CommandAction}");

+			var returnVal = new List<ITerminalObject> ();
+
+			//TODO refactor this switch statement into a function which transforms an enum + IUser into a collection of ITerminalObjects
 			switch (commandResponse.RegisteredObject)
 			{
 			case TerminalRegisteredObject.Label:
-				_registeredObjProxy.LabelRepo.CreateNewLabel ("some content from command response's option");
-				break;
-			case TerminalRegisteredObject.Task:
-				_registeredObjProxy.TaskRepo.CreateNewTaskForUser(user, "some content from command response's object");
-				break;
-			}
-
-			return 1;
-		}
-
-		public IEnumerable<ITerminalObject> PerformReadOperation(TerminalCommandResponse2 commandResponse, IUser user)
-		{
-			if (user == null)
-				throw new ArgumentNullException ("user");
-
-			return new List<ITerminalObject> ();
+				var labels = _registeredObjProxy.LabelRepo.ReadAllLabelsForUser (user);
+				var labelTerminalObjects = _terminalObjectMapper.ConvertLabels (labels);
+				returnVal.AddRange (labelTerminalObjects);
+				//TODO consider adding in an attribute onto Label to denote that field x is the Id and field y is the Value
+				//TODO should that attribute be on ILabel or Label?
+
+				break;
+			case TerminalRegisteredObject.Task:
+				var tasks = _registeredObjProxy.TaskRepo.ReadTasksForUser (user);
+				var taskTerminalObjects = _terminalObjectMapper.ConvertTasks (tasks);
+				returnVal.AddRange (taskTerminalObjects);
+
+				break;
+			}
+
+			return returnVal;
 		}

 		public int PerformUpdateOperation(TerminalCommandResponse2 commandResponse, IUser user)
 		{
 			if (user == null)
 				throw new ArgumentNullException ("user");
+
+			if (commandResponse.CommandAction != TerminalCommandAction.Update)
+				throw new InvalidOperationException ($"Command action for this operation must be list instead of {commandResponse.CommandAction}");

 			switch (commandResponse.RegisteredObject)
 			{
@@ -60,7 +87,8 @@
 				_registeredObjProxy.LabelRepo.UpdateLabel (null);
 				break;
 			case TerminalRegisteredObject.Task:
-				_registeredObjProxy.TaskRepo.CreateNewTaskForUser(user, "some content from command response's object");
+				// need to create task updating parameters
+				_registeredObjProxy.TaskRepo.UpdateTask (null);
 				break;
 			}

@@ -71,7 +99,10 @@
 		{
 			if (user == null)
 				throw new ArgumentNullException ("user");
-
+
+			if (commandResponse.CommandAction != TerminalCommandAction.Delete)
+				throw new InvalidOperationException ($"Command action for this operation must be list instead of {commandResponse.CommandAction}");
+
 			return -1;
 		}


chnage version number

chnage version number

--- src/Lime.Client.TestConsole/Properties/AssemblyInfo.cs
+++ src/Lime.Client.TestConsole/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.7.0.0")]
-[assembly: AssemblyFileVersion("0.7.0.0")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]


Fixed SAN retrieving on linux

Fixed SAN retrieving on linux

--- src/Lime.Protocol/Network/X509CertificateExtensions.cs
+++ src/Lime.Protocol/Network/X509CertificateExtensions.cs
@@ -24,7 +24,9 @@
                     // https://stackoverflow.com/a/5937270/704742
                     // https://tools.ietf.org/html/rfc6125#section-6.4.4
                     var asnEncodedData = new AsnEncodedData(sanExtension.Oid, sanExtension.RawData);
-                    subject = asnEncodedData.Format(false);
+                    subject = asnEncodedData
+                        .Format(false)
+                        .Replace("DNS:", "DNS Name="); // The behavior is different on linux: https://github.com/dotnet/core/issues/2243
                 }
             }


Rename PreconditionIsValid

Rename PreconditionIsValid

--- src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
+++ src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs
@@ -106,7 +106,7 @@
             // dates aren't guaranteed to be strong validators, the standard allows
             // using these.  It's up to the server to ensure they are strong
             // if they want to allow using them.
-            if (!(await PreconditionIsValid(httpContext)))
+            if (!(await ConditionalPUTorPATCHIsValid(httpContext)))
             {
                 // not valid anymore.  Return a 412 response
                 await Generate412PreconditionFailedResponse(httpContext);
@@ -289,7 +289,7 @@
             return false;
         }

-        private async Task<bool> PreconditionIsValid(HttpContext httpContext)
+        private async Task<bool> ConditionalPUTorPATCHIsValid(HttpContext httpContext)
         {
             // Preconditional checks are used for concurrency checks only,
             // on updates: PUT or PATCH


Fix build break

Fix build break

Arcade hasn't been updated in a while and doesn't like ??=.

--- src/Microsoft.Diagnostics.Runtime/src/Common/GCRoot.cs
+++ src/Microsoft.Diagnostics.Runtime/src/Common/GCRoot.cs
@@ -423,7 +423,7 @@

                         if (!seen.Contains(reference.Address))
                         {
-                            result ??= new Stack<ClrObject>();
+                            result = result ?? new Stack<ClrObject>();
                             result.Push(reference);
                         }
                     }


Added NodaTime.LocalTime handling

Added NodaTime.LocalTime handling

--- src/NJsonSchema/Generation/DefaultReflectionService.cs
+++ src/NJsonSchema/Generation/DefaultReflectionService.cs
@@ -36,16 +36,20 @@
                     isStringEnum ? JsonObjectType.String : JsonObjectType.Integer, false);
             }

-            if (type == typeof(short) || type == typeof(uint) || type == typeof(ushort))
+            if (type == typeof(short) ||
+                type == typeof(uint) ||
+                type == typeof(ushort))
                 return JsonTypeDescription.Create(type, JsonObjectType.Integer, false, null);

             if (type == typeof(int))
                 return JsonTypeDescription.Create(type, JsonObjectType.Integer, false, JsonFormatStrings.Integer);

-            if ((type == typeof(long)) || (type == typeof(ulong)))
+            if (type == typeof(long) ||
+                type == typeof(ulong))
                 return JsonTypeDescription.Create(type, JsonObjectType.Integer, false, JsonFormatStrings.Long);

-            if (type == typeof(double) || type == typeof(float))
+            if (type == typeof(double) ||
+                type == typeof(float))
                 return JsonTypeDescription.Create(type, JsonObjectType.Number, false, JsonFormatStrings.Double);

             if (type == typeof(decimal))
@@ -64,15 +68,22 @@
             if (type == typeof(Guid))
                 return JsonTypeDescription.Create(type, JsonObjectType.String, false, JsonFormatStrings.Guid);

-            if (type == typeof(DateTime) || type == typeof(DateTimeOffset) || type.FullName == "NodaTime.OffsetDateTime" || type.FullName == "NodaTime.ZonedDateTime")
+            if (type == typeof(DateTime) ||
+                type == typeof(DateTimeOffset) ||
+                type.FullName == "NodaTime.OffsetDateTime" ||
+                type.FullName == "NodaTime.ZonedDateTime")
                 return JsonTypeDescription.Create(type, JsonObjectType.String, false, JsonFormatStrings.DateTime);

-            if (type == typeof(TimeSpan) || type.FullName == "NodaTime.Duration")
+            if (type == typeof(TimeSpan) ||
+                type.FullName == "NodaTime.Duration")
                 return JsonTypeDescription.Create(type, JsonObjectType.String, false, JsonFormatStrings.TimeSpan);

             if (type.FullName == "NodaTime.LocalDate")
                 return JsonTypeDescription.Create(type, JsonObjectType.String, false, JsonFormatStrings.Date);

+            if (type.FullName == "NodaTime.LocalTime")
+                return JsonTypeDescription.Create(type, JsonObjectType.String, false, JsonFormatStrings.Time);
+
             if (type == typeof(Uri))
                 return JsonTypeDescription.Create(type, JsonObjectType.String, isNullable, JsonFormatStrings.Uri);

@@ -82,7 +93,9 @@
             if (type == typeof(byte[]))
                 return JsonTypeDescription.Create(type, JsonObjectType.String, isNullable, JsonFormatStrings.Byte);

-            if (type == typeof(JObject) || type == typeof(JToken) || type == typeof(object))
+            if (type == typeof(JObject) ||
+                type == typeof(JToken) ||
+                type == typeof(object))
                 return JsonTypeDescription.Create(type, JsonObjectType.None, isNullable, null);

             if (IsFileType(type, parentAttributes))