Part 2 of Darok's BulletX patches.

Part 2 of Darok's BulletX patches.

--- OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -1,9 +1,11 @@
+#region Copyright
 /*
 * Copyright (c) Contributors, http://www.openmetaverse.org/
 * See CONTRIBUTORS.TXT for a full list of copyright holders.
 *
 * Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
+* modification, are permitted provided that the following conditions are
+met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
@@ -11,27 +13,33 @@
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the OpenSim Project nor the
 *       names of its contributors may be used to endorse or promote products
-*       derived from this software without specific prior written permission.
+*       derived from this software without specific prior written
+permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
+#endregion
 #region References
 using System;
 using System.Collections.Generic;
 using OpenSim.Region.Physics.Manager;
 using Axiom.Math;
+using AxiomQuaternion = Axiom.Math.Quaternion;
 //Specific References for BulletXPlugin
-using MonoXnaCompactMaths;
+using MonoXnaCompactMaths; //Called as MXCM
 using XnaDevRu.BulletX;
 using XnaDevRu.BulletX.Dynamics;
 #endregion
@@ -43,37 +51,24 @@
     /// </summary>
     public class BulletXConversions
     {
+        //Vector3
         public static MonoXnaCompactMaths.Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector)
         {
             return new MonoXnaCompactMaths.Vector3(physicsVector.X, physicsVector.Y, physicsVector.Z);
         }
-        public static void PhysicsVectorToXnaVector3(PhysicsVector physicsVector, out MonoXnaCompactMaths.Vector3 XnaVector3)
-        {
-            XnaVector3.X = physicsVector.X;
-            XnaVector3.Y = physicsVector.Y;
-            XnaVector3.Z = physicsVector.Z;
-        }
         public static PhysicsVector XnaVector3ToPhysicsVector(MonoXnaCompactMaths.Vector3 xnaVector3)
         {
             return new PhysicsVector(xnaVector3.X, xnaVector3.Y, xnaVector3.Z);
         }
-        /*public static void XnaVector3ToPhysicsVector(MonoXnaCompactMaths.Vector3 xnaVector3, out PhysicsVector physicsVector)
-        {
-            xnaVector3.X = physicsVector.X;
-            xnaVector3.Y = physicsVector.Y;
-            xnaVector3.Z = physicsVector.Z;
-        }*/
-        #region Axiom and Xna
-        ///// <summary>
-        ///// BTW maybe some conversions will be a simply converion that it doesn't require this class, but i don't know
-        ///// </summary>
-        ///// <param name="AxiomVector3"></param>
-        ///// <returns></returns>
-        //public static MonoXnaCompactMaths.Vector3 Vector3AxiomToXna(Axiom.Math.Vector3 AxiomVector3)
-        //{
-        //    return new MonoXnaCompactMaths.Vector3(AxiomVector3.x, AxiomVector3.y, AxiomVector3.z);
-        //}
-        #endregion
+        //Quaternion
+        public static MonoXnaCompactMaths.Quaternion AxiomQuaternionToXnaQuaternion(AxiomQuaternion axiomQuaternion)
+        {
+            return new MonoXnaCompactMaths.Quaternion(axiomQuaternion.x, axiomQuaternion.y, axiomQuaternion.z, axiomQuaternion.w);
+        }
+        public static AxiomQuaternion XnaQuaternionToAxiomQuaternion(MonoXnaCompactMaths.Quaternion xnaQuaternion)
+        {
+            return new AxiomQuaternion(xnaQuaternion.W, xnaQuaternion.X, xnaQuaternion.Y, xnaQuaternion.Z);
+        }
     }
     /// <summary>
     /// PhysicsPlugin Class for BulletX
@@ -127,6 +122,7 @@

         private float[] _heightmap;
         private List<BulletXCharacter> _characters = new List<BulletXCharacter>();
+        private List<BulletXPrim> _prims = new List<BulletXPrim>();

         public static float Gravity { get { return gravity; } }
         public static float HeightLevel0 { get { return heightLevel0; } }
@@ -146,7 +142,6 @@

             this._heightmap = new float[65536];
         }
-
         public override PhysicsActor AddAvatar(PhysicsVector position)
         {
             PhysicsVector pos = new PhysicsVector();
@@ -154,31 +149,26 @@
             pos.Y = position.Y;
             pos.Z = position.Z + 20;
             BulletXCharacter newAv = new BulletXCharacter(this, pos);
-            this._characters.Add(newAv);
+            _characters.Add(newAv);
             return newAv;
         }
-
         public override void RemoveAvatar(PhysicsActor actor)
         {
-
-        }
-
-        public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Axiom.Math.Quaternion rotation)
-        {
-            PhysicsVector pos = new PhysicsVector();
-            pos.X = position.X;
-            pos.Y = position.Y;
-            pos.Z = position.Z;
-            PhysicsVector siz = new PhysicsVector();
-            siz.X = size.X;
-            siz.Y = size.Y;
-            siz.Z = size.Z;
-            return new BulletXPrim();
-        }
-
+            if (actor is BulletXCharacter)
+            {
+                _characters.Remove((BulletXCharacter)actor);
+            }
+        }
+        public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation)
+        {
+            return new BulletXPrim(this, position, size, rotation);
+        }
         public override void RemovePrim(PhysicsActor prim)
         {
-            throw new Exception("The method or operation is not implemented.");
+            if (prim is BulletXPrim)
+            {
+                _prims.Remove((BulletXPrim)prim);
+            }
         }
         public override void Simulate(float timeStep)
         {
@@ -200,12 +190,10 @@
             }

         }
-
         public override void GetResults()
         {

         }
-
         public override bool IsThreaded
         {
             get
@@ -213,7 +201,6 @@
                 return (false); // for now we won't be multithreaded
             }
         }
-
         public override void SetTerrain(float[] heightMap)
         {
             //As the same as ODE, heightmap (x,y) must be swapped for BulletX
@@ -226,7 +213,6 @@
                 this._heightmap[i] = heightMap[x * 256 + y];
             }
         }
-
         public override void DeleteTerrain()
         {

@@ -239,7 +225,9 @@
     {
         private PhysicsVector _position;
         private PhysicsVector _velocity;
+        private PhysicsVector _size;
         private PhysicsVector _acceleration;
+        private AxiomQuaternion _orientation;
         private bool flying;
         private RigidBody rigidBody;
         public Axiom.Math.Vector2 RigidBodyHorizontalPosition
@@ -250,10 +238,18 @@
             }
         }
         public BulletXCharacter(BulletXScene parent_scene, PhysicsVector pos)
-        {
-            _velocity = new PhysicsVector();
+            : this(parent_scene, pos, new PhysicsVector(), new PhysicsVector(), new PhysicsVector(),
+            AxiomQuaternion.Identity)
+        {
+        }
+        public BulletXCharacter(BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity,
+            PhysicsVector size, PhysicsVector acceleration, AxiomQuaternion orientation)
+        {
             _position = pos;
-            _acceleration = new PhysicsVector();
+            _velocity = velocity;
+            _size = size;
+            _acceleration = acceleration;
+            _orientation = orientation;
             float _mass = 50.0f; //This depends of avatar's dimensions
             Matrix _startTransform = Matrix.Identity;
             _startTransform.Translation = BulletXConversions.PhysicsVectorToXnaVector3(pos);
@@ -275,7 +271,57 @@

             parent_scene.ddWorld.AddRigidBody(rigidBody);
         }
-
+        public override PhysicsVector Position
+        {
+            get
+            {
+                return _position;
+            }
+            set
+            {
+                _position = value;
+            }
+        }
+        public override PhysicsVector Velocity
+        {
+            get
+            {
+                return _velocity;
+            }
+            set
+            {
+                _velocity = value;
+            }
+        }
+        public override PhysicsVector Size
+        {
+            get
+            {
+                return _size;
+            }
+            set
+            {
+                _size = value;
+            }
+        }
+        public override PhysicsVector Acceleration
+        {
+            get
+            {
+                return _acceleration;
+            }
+        }
+        public override AxiomQuaternion Orientation
+        {
+            get
+            {
+                return _orientation;
+            }
+            set
+            {
+                _orientation = value;
+            }
+        }
         public override bool Flying
         {
             get
@@ -287,43 +333,10 @@
                 flying = value;
             }
         }
-
-        public override PhysicsVector Size
-        {
-            get
-            {
-                throw new Exception("The method or operation is not implemented.");
-            }
-            set
-            {
-                throw new Exception("The method or operation is not implemented.");
-            }
-        }
-
-        public override PhysicsVector Position
-        {
-            get
-            {
-                return _position;
-            }
-            set
-            {
-                _position = value;
-            }
-        }
-
-        public override PhysicsVector Velocity
-        {
-            get
-            {
-                return _velocity;
-            }
-            set
-            {
-                _velocity = value;
-            }
-        }
-
+        public void SetAcceleration(PhysicsVector accel)
+        {
+            _acceleration = accel;
+        }
         public override bool Kinematic
         {
             get
@@ -335,42 +348,14 @@

             }
         }
-
-        public override Axiom.Math.Quaternion Orientation
-        {
-            get
-            {
-                return Axiom.Math.Quaternion.Identity;
-            }
-            set
-            {
-
-            }
-        }
-
-        public override PhysicsVector Acceleration
-        {
-            get
-            {
-                return _acceleration;
-            }
-
-        }
-        public void SetAcceleration(PhysicsVector accel)
-        {
-            this._acceleration = accel;
-        }
-
         public override void AddForce(PhysicsVector force)
         {

         }
-
         public override void SetMomentum(PhysicsVector momentum)
         {

         }
-
         public void Move(float timeStep)
         {
             MonoXnaCompactMaths.Vector3 vec = new MonoXnaCompactMaths.Vector3();
@@ -419,12 +404,10 @@
             }
             rigidBody.LinearVelocity = vec;
         }
-
         public void UpdatePosition()
         {
             this._position = BulletXConversions.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition);
         }
-
         //This validation is very basic
         internal void ValidateHeight(float heighmapPositionValue)
         {
@@ -445,13 +428,74 @@
     {
         private PhysicsVector _position;
         private PhysicsVector _velocity;
+        private PhysicsVector _size;
         private PhysicsVector _acceleration;
-
-        public BulletXPrim()
-        {
-            _velocity = new PhysicsVector();
-            _position = new PhysicsVector();
-            _acceleration = new PhysicsVector();
+        private AxiomQuaternion _orientation;
+
+        public BulletXPrim(BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size, AxiomQuaternion rotation)
+            : this(parent_scene, pos, new PhysicsVector(), size, new PhysicsVector(), rotation)
+        {
+        }
+        public BulletXPrim(BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, PhysicsVector size,
+            PhysicsVector aceleration, AxiomQuaternion rotation)
+        {
+            _position = pos;
+            _velocity = velocity;
+            _size = size;
+            _acceleration = aceleration;
+            _orientation = rotation;
+        }
+        public override PhysicsVector Position
+        {
+            get
+            {
+                return _position;
+
+            }
+            set
+            {
+                _position = value;
+            }
+        }
+        public override PhysicsVector Velocity
+        {
+            get
+            {
+                return _velocity;
+            }
+            set
+            {
+                _velocity = value;
+            }
+        }
+        public override PhysicsVector Size
+        {
+            get
+            {
+                return _size;
+            }
+            set
+            {
+                _size = value;
+            }
+        }
+        public override PhysicsVector Acceleration
+        {
+            get
+            {
+                return _acceleration;
+            }
+        }
+        public override AxiomQuaternion Orientation
+        {
+            get
+            {
+                return _orientation;
+            }
+            set
+            {
+                _orientation = value;
+            }
         }
         public override bool Flying
         {
@@ -464,49 +508,9 @@

             }
         }
-        public override PhysicsVector Size
-        {
-            get
-            {
-                throw new Exception("The method or operation is not implemented.");
-            }
-            set
-            {
-                throw new Exception("The method or operation is not implemented.");
-            }
-        }
-        public override PhysicsVector Position
-        {
-            get
-            {
-                PhysicsVector pos = new PhysicsVector();
-                //	PhysicsVector vec = this._prim.Position;
-                //pos.X = vec.X;
-                //pos.Y = vec.Y;
-                //pos.Z = vec.Z;
-                return pos;
-
-            }
-            set
-            {
-                /*PhysicsVector vec = value;
-                PhysicsVector pos = new PhysicsVector();
-                pos.X = vec.X;
-                pos.Y = vec.Y;
-                pos.Z = vec.Z;
-                this._prim.Position = pos;*/
-            }
-        }
-        public override PhysicsVector Velocity
-        {
-            get
-            {
-                return _velocity;
-            }
-            set
-            {
-                _velocity = value;
-            }
+        public void SetAcceleration(PhysicsVector accel)
+        {
+            _acceleration = accel;
         }
         public override bool Kinematic
         {
@@ -520,30 +524,6 @@
                 //this._prim.Kinematic = value;
             }
         }
-        public override Axiom.Math.Quaternion Orientation
-        {
-            get
-            {
-                Axiom.Math.Quaternion res = new Axiom.Math.Quaternion();
-                return res;
-            }
-            set
-            {
-
-            }
-        }
-        public override PhysicsVector Acceleration
-        {
-            get
-            {
-                return _acceleration;
-            }
-
-        }
-        public void SetAcceleration(PhysicsVector accel)
-        {
-            this._acceleration = accel;
-        }
         public override void AddForce(PhysicsVector force)
         {


Replace Task.FromResult(0) with Task.CompletedTask (#17810)

--- src/Middleware/Session/src/SessionMiddleware.cs
+++ src/Middleware/Session/src/SessionMiddleware.cs
@@ -151,7 +151,7 @@
                 {
                     establisher.SetCookie();
                 }
-                return Task.FromResult(0);
+                return Task.CompletedTask;
             }

             private void SetCookie()


fixed formatting issue

fixed formatting issue

--- src/FluentAssertions.BestPractices.Tests/DiagnosticVerifier.cs
+++ src/FluentAssertions.BestPractices.Tests/DiagnosticVerifier.cs
@@ -279,7 +279,7 @@

                 var code = documents[0].GetSyntaxRootAsync().Result.ToFullString();

-                other.Should().BeEmpty($"there should be no error diagnostics that are not related to the test.{Environment.NewLine}code: {code}");
+                other.Should().BeEmpty("there should be no error diagnostics that are not related to the test.{0}code: {1}", Environment.NewLine, code);

                 foreach (var diag in relevantDiagnostics)
                 {


Removed tests not working under net core

--- src/NUnitTestAdapterTests/TestExecutionTests.cs
+++ src/NUnitTestAdapterTests/TestExecutionTests.cs
@@ -251,7 +251,7 @@
                 .ToList();
             Summary = new ResultSummary(testResults);
         }
-
+#if !NETCOREAPP1_0
         [Test]
         public void ThatTestOutputXmlHasBeenCreatedBelowAssemblyFolder()
         {
@@ -279,7 +279,7 @@
             var expectedFile = Path.Combine(expectedFolder, "mock-assembly.xml");
             Assert.That(File.Exists(expectedFile), $"File {expectedFile} not found");
         }
-
+#endif

     }


Modify tests no longer correct under NUnit beta 3

--- src/NUnitTestAdapterTests/TestExecutionTests.cs
+++ src/NUnitTestAdapterTests/TestExecutionTests.cs
@@ -92,15 +92,15 @@
             const FakeFrameworkHandle.EventType eventType = FakeFrameworkHandle.EventType.RecordResult;
             Assert.That(
                 testLog.Events.FindAll(e => e.EventType == eventType).Count,
-                Is.EqualTo(MockAssembly.ResultCount - TestsUnderBadOrIgnoredFixtures));
+                Is.EqualTo(MockAssembly.ResultCount - BadFixture.Tests));
         }

-        readonly TestCaseData[] outcomes =
+        static readonly TestCaseData[] outcomes =
         {
             // NOTE: One inconclusive test is reported as None
             new TestCaseData(TestOutcome.Passed).Returns(MockAssembly.Success),
             new TestCaseData(TestOutcome.Failed).Returns(MockAssembly.ErrorsAndFailures - BadFixture.Tests),
-            new TestCaseData(TestOutcome.Skipped).Returns(MockAssembly.Ignored - IgnoredFixture.Tests),
+            new TestCaseData(TestOutcome.Skipped).Returns(MockAssembly.Ignored),
             new TestCaseData(TestOutcome.None).Returns(1),
             new TestCaseData(TestOutcome.NotFound).Returns(0)
         };


Removed unwanted command

Removed unwanted command

--- src/NadekoBot/Modules/Utility/RemindCommands.cs
+++ src/NadekoBot/Modules/Utility/RemindCommands.cs
@@ -195,37 +195,6 @@
                     await ReplyConfirmLocalizedAsync(strs.reminder_deleted(index + 1));
                 }
             }
-
-            [NadekoCommand, Aliases]
-            public async Task ServerRemindDelete(int index)
-            {
-                if (--index < 0)
-                    return;
-
-                Reminder rem = null;
-                using (var uow = _db.GetDbContext())
-                {
-                    var rems = uow.Reminders
-                        .RemindersForServer(ctx.Guild.Id, index / 10)
-                        .ToList();
-                    var pageIndex = index % 10;
-                    if (rems.Count > pageIndex)
-                    {
-                        rem = rems[pageIndex];
-                        uow.Reminders.Remove(rem);
-                        uow.SaveChanges();
-                    }
-                }
-
-                if (rem is null)
-                {
-                    await ReplyErrorLocalizedAsync(strs.reminder_not_exist).ConfigureAwait(false);
-                }
-                else
-                {
-                    await ReplyConfirmLocalizedAsync(strs.reminder_deleted(index + 1));
-                }
-            }

             private async Task<bool> RemindInternal(ulong targetId, bool isPrivate, TimeSpan ts, string message)
             {


Explicitly treat targetFile "-" as console out

The app threw exceptions saying the target file path is invalid. This did work for the binary distro

--- AssemblyComparer.Console/Program.cs
+++ AssemblyComparer.Console/Program.cs
@@ -1,13 +1,16 @@
-namespace AssemblyComparer.Console
+namespace AssemblyComparer.Console
 {
     public class Program
     {
         private static void Main(string[] args)
         {
-            System.Console.WriteLine("asmcomp version 0.1");
-            System.Console.WriteLine(string.Format("Converting {0} to comparable text representation at {1}", args[0], args[1]));
+            if (!args[1].Equals("-"))
+            {
+                System.Console.WriteLine("asmcomp version 0.1");
+                System.Console.WriteLine(string.Format("Converting {0} to comparable text representation at {1}", args[0], args[1]));
+            }
             var converter = new ComparisonConverter();
             converter.Convert(args[0], args[1]);
         }
     }
-}+}


Fixing up flying

Fixing up flying

--- Assets/Code/Models/Blocks/Flying.cs
+++ Assets/Code/Models/Blocks/Flying.cs
@@ -8,11 +8,11 @@

     public class Flying : IState
     {
-        private static readonly Random random = new Random();
+        private static readonly Random Random = new Random();

-        private const float Torque = 30;
+        private const float Torque = 60;

-        private const float YAcceleration = 0f;
+        private const float YAcceleration = 0.5f;

         private const float StartingYVelocity = -6;

@@ -38,11 +38,10 @@
         {
             this.block = block;
             this.board = board;
-            this.xVelocity = random.NextDouble() > 0.5 ? Flying.XVelocity : -Flying.XVelocity;
-            this.torque = random.NextDouble() > 0.5 ? Flying.Torque : -Flying.Torque;
-            this.xVelocity = Flying.XVelocity;
+            this.xVelocity = Random.NextDouble() > 0.5 ? Flying.XVelocity : -Flying.XVelocity;
+            this.torque = Random.NextDouble() > 0.5 ? Flying.Torque : -Flying.Torque;
             this.yVelocity = Flying.StartingYVelocity;
-            this.timeRemaining = TimeSpan.FromSeconds(1);
+            this.timeRemaining = TimeSpan.FromSeconds(0.5);
             this.opacityTween = TweenFactory.Tween(1, 0, this.timeRemaining);
         }

@@ -63,7 +62,6 @@
             this.block.Y += this.yVelocity * (float)elapsedTime.TotalSeconds;
             this.block.Z += Flying.ZVelocity * (float)elapsedTime.TotalSeconds;
             this.block.Rotation += this.torque * (float)elapsedTime.TotalSeconds;
-            this.block.Rotation += Flying.Torque * (float)elapsedTime.TotalSeconds;
             this.yVelocity += Flying.YAcceleration;

             if (this.IsComplete)


Fixed typo

Fixed typo

--- Assets/Plugins/XBox360Controller.cs
+++ Assets/Plugins/XBox360Controller.cs
@@ -92,7 +92,7 @@
                 {
                     OuyaSDK.KeyEnum.BUTTON_LB,
                     OuyaSDK.KeyEnum.BUTTON_RB,
-                    OuyaSDK.KeyEnum.BUTTON_O.
+                    OuyaSDK.KeyEnum.BUTTON_O,
                     OuyaSDK.KeyEnum.BUTTON_U,
                     OuyaSDK.KeyEnum.BUTTON_Y,
                     OuyaSDK.KeyEnum.BUTTON_A,


Case BMD is correct but not sure about small number

--- Assets/Scripts/Beam/BeamAnalyzer.cs
+++ Assets/Scripts/Beam/BeamAnalyzer.cs
@@ -739,9 +739,13 @@
             foreach (IndexArray qii in qi)
             {
                 if (qii.index.IndexOf(property.number * 2) >= 0)
+                {
                     q[property.number * 2] += qii.val[qii.index.IndexOf(property.number * 2)];
+                }
                 if (qii.index.IndexOf(property.number * 2+1) >= 0)
-                    q[property.number * 2+1] += qii.val[qii.index.IndexOf(property.number * 2+1)];
+                {
+                    q[property.number * 2 + 1] += qii.val[qii.index.IndexOf(property.number * 2 + 1)];
+                }
             }
         }

@@ -770,10 +774,7 @@
                 valSFD[property.number] += property.pointLoad.load;
             }
             valBMD[property.number] = q[property.number * 2 + 1];
-            /*if (property.momentum)
-            {
-                valBMD[property.number] += property.momentum.momentum;
-            }*/
+
         }
         sfd = new IndexArray(indexSFD, valSFD);
         bmd = new IndexArray(indexBMD, valBMD);


level 2 confirmation level required to process transaction else requeue

--- src/Lykke.Job.EthereumCore/Job/MonitoringCoinTransactionJob.cs
+++ src/Lykke.Job.EthereumCore/Job/MonitoringCoinTransactionJob.cs
@@ -96,7 +96,7 @@
             }
             else
             {
-                if (coinTransaction != null && coinTransaction.ConfirmationLevel != 0)
+                if (coinTransaction != null && coinTransaction.ConfirmationLevel >= CoinTransactionService.Level2Confirm)
                 {
                     if (!coinTransaction.Error)
                     {


Simplify embedded assembly loading

Simplify embedded assembly loading

--- src/Pandell.PackageRunner/AssemblyExtensions.cs
+++ src/Pandell.PackageRunner/AssemblyExtensions.cs
@@ -4,6 +4,8 @@
 using System.Reflection;

 using JetBrains.Annotations;
+
+using NuGet;

 namespace PackageRunner
 {
@@ -33,11 +35,11 @@
                 .Select(s =>
                 {
                     using (var stream = assembly.GetManifestResourceStream(s))
-                    using (var ms = new MemoryStream())
                     {
-                        if (stream == null) { throw new InvalidOperationException("Embedded resource \"" + s + "\" is null");}
-                        stream.CopyTo(ms);
-                        return Assembly.Load(ms.ToArray());
+                        if (stream == null) { throw new InvalidDataException("Embedded resource \"" + s + "\" is null"); }
+                        var assemblyBytes = new byte[stream.Length];
+                        stream.Read(assemblyBytes, 0, assemblyBytes.Length);
+                        return Assembly.Load(assemblyBytes);
                     }
                 })
                 .ToArray();


Renamed functions

Renamed functions

--- Assets/Scripts/UICornersGradient.cs
+++ Assets/Scripts/UICornersGradient.cs
@@ -19,21 +19,21 @@
 			UIVertex vertex = default(UIVertex);
 			for (int i = 0; i < vh.currentVertCount; i++) {
 				vh.PopulateUIVertex (ref vertex, i);
-				Vector2 normalizedPosition = GetNormalizedPosition(vertex.position, rect);
-				vertex.color *= GetColor(normalizedPosition, m_topLeftColor, m_topRightColor, m_bottomLeftColor, m_bottomRightColor);
+				Vector2 normalizedPosition = NormalizedPosition(vertex.position, rect);
+				vertex.color *= InterpolatedColor(normalizedPosition, m_topLeftColor, m_topRightColor, m_bottomLeftColor, m_bottomRightColor);
 				vh.SetUIVertex (vertex, i);
 			}
 		}
     }

-	public static Vector2 GetNormalizedPosition(Vector2 position, Rect rect)
+	public static Vector2 NormalizedPosition(Vector2 position, Rect rect)
 	{
 		float x = Mathf.InverseLerp (rect.xMin, rect.xMax, position.x);
 		float y = Mathf.InverseLerp (rect.yMin, rect.yMax, position.y);
 		return new Vector2(x, y);
 	}

-	public static Color GetColor(Vector2 normalizedPosition, Color topLeft, Color topRight, Color bottomLeft, Color bottomRight)
+	public static Color InterpolatedColor(Vector2 normalizedPosition, Color topLeft, Color topRight, Color bottomLeft, Color bottomRight)
 	{
 		Color top = Color.Lerp(topLeft, topRight, normalizedPosition.x);
 		Color bottom = Color.Lerp(bottomLeft, bottomRight, normalizedPosition.x);


Make comparison more stable.

Make comparison more stable.

--- src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
+++ src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
@@ -457,7 +457,7 @@
 				throw new ArgumentNullException( "context" );
 			}

-			if ( context.BoundTransport != this )
+			if ( !Object.ReferenceEquals( context.BoundTransport, this ) )
 			{
 				throw new ArgumentException( "Context is not bound to this object.", "context" );
 			}


Fix the NullReferenceException when the operation is succeeded.

--- src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
+++ src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
@@ -245,7 +245,11 @@
 		private bool HandleSocketError( Socket socket, MessageContext context )
 		{
 			var rpcError = this.Manager.HandleSocketError( socket, context );
-			this.RaiseError( context.MessageId, context.SessionId, rpcError.Value, context.CompletedSynchronously );
+			if ( rpcError != null )
+			{
+				this.RaiseError( context.MessageId, context.SessionId, rpcError.Value, context.CompletedSynchronously );
+			}
+
 			return rpcError == null;
 		}


Fix the Socket sending will not be shutdown if there are no active sessions when BeginShutdown is called.

--- src/MsgPack.Rpc.Server/Rpc/Server/Protocols/ServerTransport.cs
+++ src/MsgPack.Rpc.Server/Rpc/Server/Protocols/ServerTransport.cs
@@ -273,6 +273,7 @@

 				if ( Interlocked.CompareExchange( ref this._processing, 0, 0 ) == 0 )
 				{
+					this.ShutdownSending();
 					this.OnShutdownCompleted();
 				}
 			}


Removed unused import

Removed unused import

--- src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs
+++ src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs
@@ -25,7 +25,6 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
-using System.Xml;
 using Mono.Cecil;
 using NUnit.Engine.Extensibility;
 using NUnit.Engine.Internal;


tests

tests

--- src/OpenInApp.Common.Tests/Helpers/OpenInAppHelperTestsTODO.cs
+++ src/OpenInApp.Common.Tests/Helpers/OpenInAppHelperTestsTODO.cs
@@ -11,7 +11,8 @@
         private const string altovaXMLSpy = @"D:\Program Files (x86)\Altova\XMLSpy2017\XMLSpy.exe";
         private const string firefoxDeveloperEdition = @"C:\Program Files\Firefox Developer Edition\firefox.exe";
         private const string gimp = @"D:\Program Files\GIMP 2\bin\gimp-2.8.exe";
-        private const string markdownMonster = @"D:\Program Files (x86)\Markdown Monster\MarkdownMonster.exe";
+        //private const string markdownMonster = @"D:\Program Files (x86)\Markdown Monster\MarkdownMonster.exe";
+        private const string markdownMonster = @"C:\Program Files (x86)\Markdown Monster\MarkdownMonster.exe";
         private const string msPaint = @"C:\Windows\system32\mspaint.exe";
         private const string opera = @"D:\Program Files\Opera\launcher.exe";
         private const string operaDeveloperEdition = @"D:\Program Files\Opera developer\launcher.exe";
@@ -22,38 +23,38 @@
         private const string vs2017Community = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe";
         private const string winDirStat = @"D:\Program Files (x86)\WinDirStat\windirstat.exe";

-        [Test()]
-        [Category("E2E")]
+//        [Test()]
+//        [Category("E2E")]
         //[TestCase(KeyToExecutableEnum.AltovaXMLSpy, altovaXMLSpy)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.FirefoxDeveloperEdition, firefoxDeveloperEdition)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.Gimp, gimp)]//opens a single jpg fine
-        [TestCase(KeyToExecutableEnum.MarkdownMonster, markdownMonster)]
+        //[TestCase(KeyToExecutableEnum.MarkdownMonster, markdownMonster)]//opens a single text file fine (in the office at least)
         //[TestCase(KeyToExecutableEnum.MSPaint, msPaint)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.Opera, opera)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.OperaDeveloperEdition, operaDeveloperEdition)]//opens a single jpg fine
-        [TestCase(KeyToExecutableEnum.PaintDotNet, paintDotNet)]
+        //[TestCase(KeyToExecutableEnum.PaintDotNet, paintDotNet)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.TreeSizeFree, treeSizeFree)]//opens a single jpg's folder fine
-        [TestCase(KeyToExecutableEnum.Vivaldi, vivaldi)]
+//        [TestCase(KeyToExecutableEnum.Vivaldi, vivaldi)]
         //[TestCase(KeyToExecutableEnum.VS2015, vs2015)]//opens a single jpg fine
         //[TestCase(KeyToExecutableEnum.VS2017Community, vs2017Community)]//opens a single jpg fine (albeit in vs2017's default app of MSPaint in my case)
         //[TestCase(KeyToExecutableEnum.WinDirStat, winDirStat)]//opens a single jpg's folder fine
-        public void InvokeCommandTest_SingleArtefact(KeyToExecutableEnum keyToExecutableEnum, string executableFullPath)
-        {
-            InvokeApplication(keyToExecutableEnum, executableFullPath, "Single");
-        }
+//        public void InvokeCommandTest_SingleArtefact(KeyToExecutableEnum keyToExecutableEnum, string executableFullPath)
+//        {
+//            InvokeApplication(keyToExecutableEnum, executableFullPath, "Single");
+//        }

         [Test()]
         [Category("E2E")]
         //[TestCase(KeyToExecutableEnum.AltovaXMLSpy, altovaXMLSpy)]//yes opens both in a single xmpspy
         //[TestCase(KeyToExecutableEnum.FirefoxDeveloperEdition, firefoxDeveloperEdition)]//yes opens both in a single browser
         //[TestCase(KeyToExecutableEnum.Gimp, gimp)]//yes opens a single app for both images
-        [TestCase(KeyToExecutableEnum.MarkdownMonster, markdownMonster)]
+        //[TestCase(KeyToExecutableEnum.MarkdownMonster, markdownMonster)]//yes opens both in a single IDE
         //[TestCase(KeyToExecutableEnum.MSPaint, msPaint)]//yes opens both images fine
         //[TestCase(KeyToExecutableEnum.Opera, opera)]//yes opens both in 1 browser
         //[TestCase(KeyToExecutableEnum.OperaDeveloperEdition, operaDeveloperEdition)]//yes opens both in 1 browser
         //[TestCase(KeyToExecutableEnum.PaintDotNet, paintDotNet)]//yes opens a single app for both images
         //[TestCase(KeyToExecutableEnum.TreeSizeFree, treeSizeFree)]//yes opens both folders
-        [TestCase(KeyToExecutableEnum.Vivaldi, vivaldi)]
+//        [TestCase(KeyToExecutableEnum.Vivaldi, vivaldi)]
         //[TestCase(KeyToExecutableEnum.VS2015, vs2015)]//yes opens both in a single IDE
         //[TestCase(KeyToExecutableEnum.VS2017Community, vs2017Community)]//yes opens both in a single IDE
         //[TestCase(KeyToExecutableEnum.WinDirStat, winDirStat)]//yes opens both folders
@@ -86,15 +87,18 @@
                             case KeyToExecutableEnum.VS2015:
                             case KeyToExecutableEnum.VS2017Community:
                             case KeyToExecutableEnum.WinDirStat:
-                                artefactsToBeOpened = new List<string> { @"D:\Temp\1.jpg" };
+                                //artefactsToBeOpened = new List<string> { @"D:\Temp\1.jpg" };
+                                artefactsToBeOpened = new List<string> { @"C:\Temp\1.jpg" };
                                 break;
                             default:
-                                artefactsToBeOpened = new List<string> { @"D:\Temp\a.txt" };
+                                //artefactsToBeOpened = new List<string> { @"D:\Temp\a.txt" };
+                                artefactsToBeOpened = new List<string> { @"C:\Temp\a.txt" };
                                 break;
                         }
                         break;
                     case ArtefactTypeToOpen.Folder:
-                        artefactsToBeOpened = new List<string> { @"D:\Temp\" };
+                        //artefactsToBeOpened = new List<string> { @"D:\Temp\" };
+                        artefactsToBeOpened = new List<string> { @"C:\Temp\" };
                         break;
                 }
             }
@@ -127,20 +131,26 @@

         private List<string> artefactsToBeOpened_TextFiles = new List<string>
                     {
-                        @"D:\Temp\a.txt",
-                        @"D:\Temp\b.txt",
+                        //@"D:\Temp\a.txt",
+                        //@"D:\Temp\b.txt",
+                        @"C:\Temp\a.txt",
+                        @"C:\Temp\b.txt",
                     };

         private List<string> artefactsToBeOpened_ImageFiles = new List<string>
                     {
-                        @"D:\Temp\1.jpg",
-                        @"D:\Temp\2.jpg",
+                        //@"D:\Temp\1.jpg",
+                        //@"D:\Temp\2.jpg",
+                        @"C:\Temp\1.jpg",
+                        @"C:\Temp\2.jpg",
                     };

         private List<string> artefactsToBeOpened_Folders = new List<string>
                     {
-                        @"D:\Temp\",
-                        @"D:\Temp\Test",
+                        //@"D:\Temp\",
+                        //@"D:\Temp\Test",
+                        @"C:\Temp\",
+                        @"C:\Temp\Test",
                     };

         //Open in intellij


- Changing where we alter type definitions in the setup service so the types can be initialized with the right parts.

--HG--
branch : dev

--- src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs
+++ src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs
@@ -148,6 +148,11 @@
                     //var hackInstallationGenerator = environment.Resolve<IHackInstallationGenerator>();
                     //hackInstallationGenerator.GenerateInstallEvents();

+                    var contentDefinitionManager = environment.Resolve<IContentDefinitionManager>();
+                    contentDefinitionManager.AlterTypeDefinition("blogpost", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
+                    contentDefinitionManager.AlterTypeDefinition("page", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
+                    contentDefinitionManager.AlterTypeDefinition("sandboxpage", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
+
                     // create home page as a CMS page
                     var page = contentManager.Create("page", VersionOptions.Draft);
                     page.As<BodyAspect>().Text = "
Welcome to Orchard!

Congratulations, you've successfully set-up your Orchard site.

This is the home page of your new site. We've taken the liberty to write here about a few things you could look at next in order to get familiar with the application. Once you feel confident you don't need this anymore, just click Edit to go into edit mode and replace this with whatever you want on your home page to make it your own.

One thing you could do (but you don't have to) is go into Manage Settings (follow the Admin link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.

You probably want to make the site your own. One of the ways you can do that is by clicking Manage Themes in the admin menu. A theme is a packaged look and feel that affects the whole site.

Next, you can start playing with the content types that we installed. For example, go ahead and click Add New Page in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to Manage Menu. You can also click Add New Blog and start posting by clicking \"Add New Post\".

Finally, Orchard has been designed to be extended. It comes with a few built-in modules such as pages and blogs or themes. You can install new themes by going to Manage Themes and clicking Install a new Theme. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please consider participating.

--The Orchard Crew
";
@@ -172,11 +177,6 @@
                         var authenticationService = environment.Resolve<IAuthenticationService>();
                         authenticationService.SignIn(user, true);
                     }
-
-                    var contentDefinitionManager = environment.Resolve<IContentDefinitionManager>();
-                    contentDefinitionManager.AlterTypeDefinition("blogpost", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
-                    contentDefinitionManager.AlterTypeDefinition("page", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
-                    contentDefinitionManager.AlterTypeDefinition("sandboxpage", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
                 }
                 catch {
                     environment.Resolve<ITransactionManager>().Cancel();


Reusing the `ConverterHelper.UmbracoHelper` property (from PR #24)

--- src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs
+++ src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs
@@ -29,11 +29,6 @@
         /// </summary>
         private static readonly ConcurrentDictionary<Type, PropertyInfo[]> PropertyCache
             = new ConcurrentDictionary<Type, PropertyInfo[]>();
-
-        /// <summary>
-        /// Stores a private instance of <see cref="Umbraco.Web.UmbracoHelper"/>.
-        /// </summary>
-        private static UmbracoHelper UmbracoHelper;

         /// <summary>
         /// Returns the given instance of <see cref="IPublishedContent"/> as the specified type.
@@ -281,14 +276,7 @@
                         var dictionaryValueAttr = propertyInfo.GetCustomAttribute<UmbracoDictionaryValueAttribute>();
                         if (dictionaryValueAttr != null && !dictionaryValueAttr.DictionaryKey.IsNullOrWhiteSpace())
                         {
-                            // HACK: [LK:2015-01-23] This feels hacky. I'd prefer to use `CultureDictionaryFactoryResolver`,
-                            // but it was marked as `internal` until v7.2.0
-                            if (UmbracoHelper == null)
-                            {
-                                UmbracoHelper = new UmbracoHelper(UmbracoContext.Current);
-                            }
-
-                            propertyValue = UmbracoHelper.GetDictionaryValue(dictionaryValueAttr.DictionaryKey);
+                            propertyValue = ConverterHelper.UmbracoHelper.GetDictionaryValue(dictionaryValueAttr.DictionaryKey);
                         }
                     }


Check if query in GraphQL batch contains any errors

Fixes #36

--- src/SAHB.GraphQLClient/Batching/Internal/GraphQLBatchMerger.cs
+++ src/SAHB.GraphQLClient/Batching/Internal/GraphQLBatchMerger.cs
@@ -4,6 +4,7 @@
 using System.Net.Http;
 using System.Threading.Tasks;
 using Newtonsoft.Json.Linq;
+using SAHB.GraphQLClient.Exceptions;
 using SAHB.GraphQLClient.Executor;
 using SAHB.GraphQLClient.FieldBuilder;
 using SAHB.GraphQLClient.Internal;
@@ -66,6 +67,11 @@
         {
             if (!_isExecuted)
                 await Execute();
+
+            if (_result.ContainsErrors)
+            {
+                throw new GraphQLErrorException(_result.Errors);
+            }

             // Create new JObject
             JObject deserilizeFrom = new JObject();


Fix confusing output produced by CallGrindFilePrinter when display jumps
from GotoCmds. Previously we might of emitted something like

4 out of 9 jumps to ...
5 out of 9 jumps to ...

even though the GotoCmd was only visited 5 times. Instead it is clearer
to just use the coverage number instead of the sum of jumps so instead
we write something like

4 out of 5 jumps to ...
5 out of 5 jumps to ...

--- src/Symbooglix/Executor/CallGrindFilePrinter.cs
+++ src/Symbooglix/Executor/CallGrindFilePrinter.cs
@@ -85,7 +85,7 @@
                 {
                     // Non conditional jump
                     int targetLineNumber = GetBlockLineNumber(gotoCmd.labelTargets[0]);
-                    TW.WriteLine("jump={0} {1}", gotoCmdStats.TotalJumps, targetLineNumber);
+                    TW.WriteLine("jump={0} {1}", gotoCmdStats.Covered, targetLineNumber);
                     TW.WriteLine("{0}", gotoCmd.tok.line);
                 }
                 else
@@ -94,7 +94,12 @@
                     foreach (var target in gotoCmd.labelTargets)
                     {
                         int targetLineNumber = GetBlockLineNumber(target);
-                        TW.WriteLine("jcnd={0}/{1} {2}", gotoCmdStats.GetJumpsTo(target), gotoCmdStats.TotalJumps, targetLineNumber);
+
+                        // Note we use gotoCmdStats.Covered instead of gotoCmdStats.TotalJumps. The reason is that using
+                        // TotalJumps can be confusing because this number can be greater than the number of times the
+                        // GotoCmd was visited. E.g. We could say "4 out 9 times went to ..." when the GotoCmd was only visited
+                        // 5 times.
+                        TW.WriteLine("jcnd={0}/{1} {2}", gotoCmdStats.GetJumpsTo(target), gotoCmdStats.Covered, targetLineNumber);
                         TW.WriteLine("{0}", gotoCmd.tok.line);
                     }
                 }


Revert "Store the continue url in the session for use after Facebook authentication"

This reverts commit c964f47c8f8d5b6094c4992bbb7d53e76807f04d.

--- src/ServiceStack.ServiceInterface/Auth/FacebookAuthProvider.cs
+++ src/ServiceStack.ServiceInterface/Auth/FacebookAuthProvider.cs
@@ -34,15 +34,8 @@

             var code = authService.RequestContext.Get<IHttpRequest>().QueryString["code"];
             var isPreAuthCallback = !code.IsNullOrEmpty();
-
             if (!isPreAuthCallback)
             {
-                if (!request.Continue.IsNullOrEmpty())
-                {
-                    // store the continue url in the session for the return trip
-                    session.ReferrerUrl = request.Continue;
-                }
-
                 var preAuthUrl = PreAuthUrl + "?client_id={0}&redirect_uri={1}&scope={2}"
                     .Fmt(AppId, this.CallbackUrl.UrlEncode(), string.Join(",", Permissions));


Hook tests

Hook tests

--- src/SevenDigital.Messaging.Integration.Tests/EventHookTests.cs
+++ src/SevenDigital.Messaging.Integration.Tests/EventHookTests.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Threading;
 using Moq;
 using NUnit.Framework;
 using SevenDigital.Messaging.Integration.Tests.Handlers;
@@ -57,7 +58,26 @@

 				ColourMessageHandler.AutoResetEvent.WaitOne(LongInterval);

+				mock_event_hook.Verify(h=>h.MessageReceived(It.Is<IColourMessage>(im => im.CorrelationId == message.CorrelationId)));
+			}
+		}
+
+		[Test]
+		public void Should_trigger_event_hook_with_message_when_receiving_a_message_from_a_base_type ()
+		{
+			using (var receiverNode = node_factory.Listen())
+			{
+				var message = new GreenMessage();
+
+				receiverNode.Handle<IMessage>().With<GenericHandler>();
+				senderNode.SendMessage(message);
+
+				GenericHandler.AutoResetEvent.WaitOne(LongInterval);
+
 				mock_event_hook.Verify(h=>h.MessageReceived(It.Is<IMessage>(im => im.CorrelationId == message.CorrelationId)));
+
+				// Should be able to check for this, but MassTransit loses the type information :-(
+				//mock_event_hook.Verify(h=>h.MessageReceived(It.Is<IColorMessage>(im => im.CorrelationId == message.CorrelationId)));
 			}
 		}

@@ -80,4 +100,14 @@
 			}
 		}
 	}
+
+	public class GenericHandler:IHandle<IMessage>
+	{
+        public static AutoResetEvent AutoResetEvent = new AutoResetEvent(false);
+
+        public void Handle(IMessage message)
+        {
+            AutoResetEvent.Set();
+        }
+	}
 }


Fix X509SecurityKey support

Fix X509SecurityKey support

--- src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs
+++ src/System.IdentityModel.Tokens/AsymmetricSignatureProvider.cs
@@ -28,7 +28,7 @@
     public class AsymmetricSignatureProvider : SignatureProvider
     {
         private bool disposed;
-        private RSACryptoServiceProvider rsa;
+        private RSACryptoServiceProvider rsaCryptoServiceProvider;
         private HashAlgorithm hash;

         /// <summary>
@@ -96,8 +96,8 @@
             RsaSecurityKey rsaKey = key as RsaSecurityKey;
             if (rsaKey != null)
             {
-                rsa = new RSACryptoServiceProvider();
-                rsa.ImportParameters(rsaKey.Parameters);
+                rsaCryptoServiceProvider = new RSACryptoServiceProvider();
+                (rsaCryptoServiceProvider as RSA).ImportParameters(rsaKey.Parameters);

                 // TODO - brentsch - SHA384, SHA512
                 if (algorithm == SecurityAlgorithms.RsaSha1Signature)
@@ -116,8 +116,15 @@
             X509SecurityKey x509Key = key as X509SecurityKey;
             if (x509Key != null)
             {
-                rsa = new RSACryptoServiceProvider();
-                rsa.ImportParameters(rsaKey.Parameters);
+                if (willCreateSignatures)
+                {
+                    rsaCryptoServiceProvider = x509Key.PrivateKey as RSACryptoServiceProvider;
+                }
+                else
+                {
+                    rsaCryptoServiceProvider = new RSACryptoServiceProvider();
+                    (rsaCryptoServiceProvider as RSA).ImportParameters((x509Key.PrivateKey as RSA).ExportParameters(false));
+                }

                 // TODO - brentsch - SHA384, SHA512
                 if (algorithm == SecurityAlgorithms.RsaSha1Signature)
@@ -133,8 +140,7 @@
                 return;
             }

-            throw new NotSupportedException("algorithm not supported");
-
+            throw new NotSupportedException("algorithm OR key type not supported not supported: " + algorithm + ", " + key.GetType().ToString());
         }

         public override bool IsSupportedAlgorithm(SecurityKey key, string algorithm)
@@ -212,7 +218,7 @@
                 throw new ObjectDisposedException(GetType().ToString());
             }

-            return rsa.SignData(input, hash);
+            return rsaCryptoServiceProvider.SignData(input, hash);
         }

         /// <summary>
@@ -260,7 +266,7 @@
                 throw new InvalidOperationException(ErrorMessages.IDX10621);
             }

-            return rsa.VerifyData(input, hash, signature);
+            return rsaCryptoServiceProvider.VerifyData(input, hash, signature);
         }

         /// <summary>


U4-9093 Fix SQL used to rebuild the media & content xml structures in the data integrity check

--- src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
+++ src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
@@ -183,30 +183,25 @@
                 if (contentTypeIds == null)
                 {
                     var subQuery = new Sql()
-                            .Select("DISTINCT cmsContentXml.nodeId")
-                            .From<ContentXmlDto>()
-                            .InnerJoin<DocumentDto>()
-                            .On<ContentXmlDto, DocumentDto>(left => left.NodeId, right => right.NodeId);
+                        .Select("id")
+                        .From<NodeDto>(SqlSyntax)
+                        .Where<NodeDto>(x => x.NodeObjectType == NodeObjectTypeId);

                     var deleteSql = SqlSyntax.GetDeleteSubquery("cmsContentXml", "nodeId", subQuery);
                     Database.Execute(deleteSql);
                 }
                 else
                 {
-                    foreach (var id in contentTypeIds)
-                    {
-                        var id1 = id;
-                        var subQuery = new Sql()
-                            .Select("cmsDocument.nodeId")
-                            .From<DocumentDto>()
-                            .InnerJoin<ContentDto>()
-                            .On<DocumentDto, ContentDto>(left => left.NodeId, right => right.NodeId)
-                            .Where<DocumentDto>(dto => dto.Published)
-                            .Where<ContentDto>(dto => dto.ContentTypeId == id1);
-
-                        var deleteSql = SqlSyntax.GetDeleteSubquery("cmsContentXml", "nodeId", subQuery);
-                        Database.Execute(deleteSql);
-                    }
+                    var subQuery = new Sql()
+                        .Select("DISTINCT umbracoNode.id")
+                        .From<ContentDto>(SqlSyntax)
+                        .InnerJoin<NodeDto>(SqlSyntax)
+                        .On<ContentDto, NodeDto>(SqlSyntax, left => left.NodeId, right => right.NodeId)
+                        .WhereIn<ContentDto>(dto => dto.ContentTypeId, contentTypeIds, SqlSyntax)
+                        .Where<NodeDto>(x => x.NodeObjectType == NodeObjectTypeId);
+
+                    var deleteSql = SqlSyntax.GetDeleteSubquery("cmsContentXml", "nodeId", subQuery);
+                    Database.Execute(deleteSql);
                 }

                 //now insert the data, again if something fails here, the whole transaction is reversed


fix how we resolve "default node", now using sortOrder

--- src/Umbraco.Web/DefaultPublishedContentStore.cs
+++ src/Umbraco.Web/DefaultPublishedContentStore.cs
@@ -119,8 +119,8 @@
                 else
                 {
                     // if not in a domain - what is the default page?
-                    // let's say it is the first one in the tree, if any
-                    xpath = "(/root/*[@isDoc])[1]";
+                    // let's say it is the first one in the tree, if any -- order by sortOrder
+                    xpath = "/root/*[@isDoc and @sortOrder='0']";
                 }
             }
             else


removes commented lines

removes commented lines

--- src/Umbraco.Web/umbraco.presentation/content.cs
+++ src/Umbraco.Web/umbraco.presentation/content.cs
@@ -207,20 +207,17 @@
         private static XmlNode GetPreviewOrPublishedNode(Document d, XmlDocument xmlContentCopy, bool isPreview)
         {
             var contentItem = d.ContentEntity;
-            var serializer = new EntityXmlSerializer();
             var services = ApplicationContext.Current.Services;

             if (isPreview)
             {
                 var xml = services.ContentService.GetContentPreviewXml(contentItem.Id, contentItem.Version);
                 return xml.GetXmlNode(xmlContentCopy);
-                //return d.ToPreviewXml(xmlContentCopy);
             }
             else
             {
                 var xml = services.ContentService.GetContentXml(contentItem.Id);
                 return xml.GetXmlNode(xmlContentCopy);
-                //return d.ToXml(xmlContentCopy, false);
             }
         }


Hide virtual project node when no project open.

--- src/VsChromium/Features/SourceExplorerHierarchy/VsHierarchy.cs
+++ src/VsChromium/Features/SourceExplorerHierarchy/VsHierarchy.cs
@@ -67,6 +67,11 @@
     }

     private void EndRefresh() {
+      if (_nodes.RootNode.GetChildrenCount() == 0) {
+        CloseVsHierarchy();
+        return;
+      }
+
       OpenVsHierarchy();
       Redraw();
     }


- Fixed error in comments

- Fixed error in comments

git-svn-id: ad71a101fa69fb252e58119732bf51384d5dbd95@1373 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/Axiom/Source/Engine/Collections/RadixSort.cs
+++ Projects/Axiom/Source/Engine/Collections/RadixSort.cs
@@ -83,7 +83,7 @@
 	///
 	/// RadixSortSingle<BibbleList, Bibble> radixSorter;
 	///
-	/// radixSorter.sort(myBibbleList, BibbleSortDelegate.Doobrie);
+	/// radixSorter.Sort(myBibbleList, BibbleSortDelegate.Doobrie);
 	///
 	/// You should try to reuse RadixSort instances, since repeated allocation of the
 	/// internal storage is then avoided.
@@ -320,7 +320,7 @@
 	///
 	/// RadixSortInt32<BibbleList, Bibble> radixSorter;
 	///
-	/// radixSorter.sort(myBibbleList, BibbleSortDelegate.Doobrie);
+	/// radixSorter.Sort(myBibbleList, BibbleSortDelegate.Doobrie);
 	///
 	/// You should try to reuse RadixSort instances, since repeated allocation of the
 	/// internal storage is then avoided.
@@ -558,7 +558,7 @@
 	///
 	/// RadixSortUInt32<BibbleList, Bibble> radixSorter;
 	///
-	/// radixSorter.sort(myBibbleList, BibbleSortDelegate.Doobrie);
+	/// radixSorter.Sort(myBibbleList, BibbleSortDelegate.Doobrie);
 	///
 	/// You should try to reuse RadixSort instances, since repeated allocation of the
 	/// internal storage is then avoided.


Fix bug for missing table name in Audit

Fix bug for missing table name in Audit

--- RussellGroup.Pims.DataAccess/Migrations/SqlFactory.cs
+++ RussellGroup.Pims.DataAccess/Migrations/SqlFactory.cs
@@ -42,6 +42,7 @@
         public void GenerateAuditTrigger(string tableName, string primaryKeyName1, string primaryKeyName2 = null)
         {
             var data = new {
+                tableName,
                 table = string.Format("[dbo].[{0}]", tableName),
                 trigger = string.Format("[dbo].[TR_{0}{1}]", tableName, AuditTableName),
                 primaryKeyName1 = primaryKeyName1,


Re-add TorrentParser to BencodeParser default parser list

--- BencodeNET/Parsing/BencodeParser.cs
+++ BencodeNET/Parsing/BencodeParser.cs
@@ -5,6 +5,7 @@
 using BencodeNET.Exceptions;
 using BencodeNET.IO;
 using BencodeNET.Objects;
+using BencodeNET.Torrents;

 namespace BencodeNET.Parsing
 {
@@ -46,7 +47,8 @@
                 new BNumberParser(),
                 new BStringParser(_encoding),
                 new BListParser(this),
-                new BDictionaryParser(this)
+                new BDictionaryParser(this),
+                new TorrentParser(this)
             };
         }


fix LineFindAndSelectElementById

fix LineFindAndSelectElementById

--- Signum.Web.Extensions.Selenium/LinesTestExtensions.cs
+++ Signum.Web.Extensions.Selenium/LinesTestExtensions.cs
@@ -298,7 +298,7 @@

             selenium.FilterSelectToken(0, "Id", false, prefix);
             selenium.AddFilter(0, prefix);
-            selenium.Type(prefix + "value_0", elementId.ToString());
+            selenium.Type("jq=#{0}tblFilters > tbody > tr:last td:last :text".Formato(prefix), elementId.ToString());

             selenium.Search(prefix);
             SearchTestExtensions.SelectRow(selenium, 0, prefix);


Add the 'Labels' property to the TemplateCategory model

Resolves #46

--- Source/CakeMail.RestClient/Models/TemplateCategory.cs
+++ Source/CakeMail.RestClient/Models/TemplateCategory.cs
@@ -1,5 +1,6 @@
 using CakeMail.RestClient.Utilities;
 using Newtonsoft.Json;
+using System.Collections.Generic;

 namespace CakeMail.RestClient.Models
 {
@@ -36,6 +37,9 @@
 		[JsonProperty("level")]
 		public long Level { get; set; }

+		[JsonProperty("labels")]
+		public KeyValuePair<string, string>[] Labels { get; set; }
+
 		#endregion
 	}
 }


Correct iOS assembly title

Correct iOS assembly title

--- Source/OxyPlot.Xamarin.iOS/Properties/AssemblyInfo.cs
+++ Source/OxyPlot.Xamarin.iOS/Properties/AssemblyInfo.cs
@@ -6,5 +6,5 @@

 using System.Reflection;

-[assembly: AssemblyTitle("OxyPlot.XamarinIOS")]
+[assembly: AssemblyTitle("OxyPlot.Xamarin.iOS")]
 [assembly: AssemblyDescription("OxyPlot for Xamarin.iOS")]


PropertyGrid should check the index when setting the selected tab

--- Source/PropertyTools.Wpf/PropertyGrid/PropertyGrid.cs
+++ Source/PropertyTools.Wpf/PropertyGrid/PropertyGrid.cs
@@ -1768,7 +1768,7 @@
                 this.tabControl.SelectedItem = tab;
             }
         }
-
+
         /// <summary>
         /// Handles changes of the selected tab index.
         /// </summary>
@@ -1782,11 +1782,15 @@
                 return;
             }

-            int tabIndex;
+            int tabIndex;
             int.TryParse(e.NewValue.ToString(), out tabIndex);
             if (tabIndex >= 0)
             {
-                this.SelectedTabId = this.tabControl.Items.Cast<TabItem>().ToArray()[tabIndex].Name;
+                var tabItems = this.tabControl.Items.Cast<TabItem>().ToArray();
+                if (tabIndex < tabItems.Length)
+                {
+                    this.SelectedTabId = tabItems[tabIndex].Name;
+                }
             }
         }
     }


We are now getting the correct GlyphParts for our square root, but still putting them together wrong.

--- CSharpMath/Display/FontMathTable.cs
+++ CSharpMath/Display/FontMathTable.cs
@@ -196,11 +196,12 @@
         var endConnectorLength = _FontUnitsToPt(font, partInfo[_endConnectorKey].Value<int>());
         var startConnectorLength = _FontUnitsToPt(font, partInfo[_startConnectorKey].Value<int>());
         var fullAdvance = _FontUnitsToPt(font, partInfo[_advanceKey].Value<int>());
+        var glyphPartName = partInfo[_glyphKey].Value<string>();
         r.Add(new GlyphPart<TGlyph> {
           EndConnectorLength = endConnectorLength,
           StartConnectorLength = startConnectorLength,
           IsExtender = partInfo[_extenderKey].Value<bool>(),
-          Glyph = _glyphNameProvider.GetGlyph(glyphName)
+          Glyph = _glyphNameProvider.GetGlyph(glyphPartName)
         });
       }
       return r.ToArray();


Fix (or hack) for null parsers.

Fix (or hack) for null parsers.

--- CSharpMonad/src/parsec/ParserExt.cs
+++ CSharpMonad/src/parsec/ParserExt.cs
@@ -82,7 +82,7 @@
                 {
                     if (parser == null)
                     {
-                        parser = parser;
+                        return ParserResult.Fail<V>("parser is null",input);
                     }

                     var res = parser.Parse(input);


try on chrome

try on chrome

--- Spa/NakedObjects.Spa.Selenium.Test/tests/HomeTests.cs
+++ Spa/NakedObjects.Spa.Selenium.Test/tests/HomeTests.cs
@@ -285,14 +285,14 @@
     public class MegaHomeTestBase : HomeTestsRoot {
         [TestMethod] //Mega
         public virtual void MegaHomeTest() {
-            WaitForSingleHome();
-            ClickOnVariousMenus();
-            OpenAndCloseSubMenus();
+            //WaitForSingleHome();
+            //ClickOnVariousMenus();
+            //OpenAndCloseSubMenus();
             SelectSuccessiveDialogActionsThenCancel();
-            ZeroParamReturnsObject();
-            ZeroParamReturnsCollection();
-            ZeroParamReturnsEmptyCollection();
-            DialogActionOK();
+            //ZeroParamReturnsObject();
+            //ZeroParamReturnsCollection();
+            //ZeroParamReturnsEmptyCollection();
+            //DialogActionOK();
         }
     }

@@ -315,11 +315,31 @@
         }
     }

+    //[TestClass]
+    public class MegaHomeTestIe : MegaHomeTestBase {
+        [ClassInitialize]
+        public new static void InitialiseClass(TestContext context) {
+            FilePath(@"drivers.IEDriverServer.exe");
+            AWTest.InitialiseClass(context);
+        }
+
+        [TestInitialize]
+        public virtual void InitializeTest() {
+            InitIeDriver();
+            Url(BaseUrl);
+        }
+
+        [TestCleanup]
+        public virtual void CleanupTest() {
+            base.CleanUpTest();
+        }
+    }
+
     [TestClass]
-    public class MegaHomeTestIe : MegaHomeTestBase {
-        [ClassInitialize]
-        public new static void InitialiseClass(TestContext context) {
-            FilePath(@"drivers.IEDriverServer.exe");
+    public class MegaHomeTestChrome : MegaHomeTestBase {
+        [ClassInitialize]
+        public new static void InitialiseClass(TestContext context) {
+            FilePath(@"drivers.chromedriver.exe");
             AWTest.InitialiseClass(context);
         }

@@ -334,24 +354,4 @@
             base.CleanUpTest();
         }
     }
-
-    //[TestClass]
-    public class MegaHomeTestChrome : MegaHomeTestBase {
-        [ClassInitialize]
-        public new static void InitialiseClass(TestContext context) {
-            FilePath(@"drivers.chromedriver.exe");
-            AWTest.InitialiseClass(context);
-        }
-
-        [TestInitialize]
-        public virtual void InitializeTest() {
-            InitIeDriver();
-            Url(BaseUrl);
-        }
-
-        [TestCleanup]
-        public virtual void CleanupTest() {
-            base.CleanUpTest();
-        }
-    }
 }


Remove Administrator authentication

Remove Administrator authentication

--- SpaceBlog/SpaceBlog/Views/Shared/_LoginPartial.cshtml
+++ SpaceBlog/SpaceBlog/Views/Shared/_LoginPartial.cshtml
@@ -3,30 +3,26 @@
 {
     using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
     {
-    @Html.AntiForgeryToken()
+        @Html.AntiForgeryToken()

-

-         @if (User.IsInRole("Administrators"))
-         {
-

-                @($"Hello {User.Identity.GetUserName()}")
-

-
@Html.ActionLink("My Profile", "Profile", "Users")

-
@Html.ActionLink("Manage Account", "Index", "Manage")

-

-                        Log off
-

-

-

-
-         }
-

-    }
+

+

+                    @($"Hello {User.Identity.GetUserName()}")
+

+
@Html.ActionLink("My Profile", "Profile", "Users")

+
@Html.ActionLink("Manage Account", "Index", "Manage")

+

+                            Log off
+

+

+

+

+        }
 }
 else
 {

-
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })

-
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })

+
@Html.ActionLink("Register", "Register", "Account", null, new { id = "registerLink" })

+
@Html.ActionLink("Log in", "Login", "Account", null, new { id = "loginLink" })

 }


Atualização nos comentários de parâmetro na assinatura do método EscreverCampos.

--- SpedBr/SpedBr.Common/EscreverCamposSpedByAttribute.cs
+++ SpedBr/SpedBr.Common/EscreverCamposSpedByAttribute.cs
@@ -9,8 +9,9 @@
         /// <summary>
         /// Escrever campos p/ qualquer arquivo do projeto SPED (Contábil, Fiscal, Pis/Cofins)
         /// </summary>
-        /// <param name="source"></param>
-        /// <param name="competenciaDeclaracao"></param>
+        /// <param name="source">Objeto com os dados a serem tratados e gerados na linha do arquivo.</param>
+        /// <param name="competenciaDeclaracao">Mês a que se referem as informações no arquivo(exceto informações extemporâneas).</param>
+        /// <param name="tryTrim">Remove a quebra de linha no final de cada registro.</param>
         /// <returns></returns>
         public static string EscreverCampos(this object source, DateTime competenciaDeclaracao, bool tryTrim = false)
         {


Changed a use of NoSpecimen to the ctor w/out req.

--- Src/AutoFixtureUnitTest/Kernel/DictionaryRelayTest.cs
+++ Src/AutoFixtureUnitTest/Kernel/DictionaryRelayTest.cs
@@ -74,9 +74,7 @@
             // Fixture setup
             var expectedRequest = typeof(Dictionary<,>).MakeGenericType(keyType, itemType);
             object contextResult = typeof(Dictionary<,>).MakeGenericType(keyType, itemType).GetConstructor(Type.EmptyTypes).Invoke(new object[0]);
-#pragma warning disable 618
-            var context = new DelegatingSpecimenContext { OnResolve = r => expectedRequest.Equals(r) ? contextResult : new NoSpecimen(r) };
-#pragma warning restore 618
+            var context = new DelegatingSpecimenContext { OnResolve = r => expectedRequest.Equals(r) ? contextResult : new NoSpecimen() };

             var sut = new DictionaryRelay();
             // Exercise system


Add logging for RedisCache.TryGet

Add logging for RedisCache.TryGet

--- CertiPay.Common/Redis/RedisCache.cs
+++ CertiPay.Common/Redis/RedisCache.cs
@@ -1,4 +1,5 @@
 using CertiPay.Common.Cache;
+using CertiPay.Common.Logging;
 using Newtonsoft.Json;
 using StackExchange.Redis;
 using System;
@@ -11,6 +12,8 @@
     /// </summary>
     public class RedisCache : ICache
     {
+        private static readonly ILog Log = LogManager.GetLogger<RedisCache>();
+
         private readonly RedisConnection _connection;

         public RedisCache(RedisConnection connection)
@@ -41,15 +44,18 @@

         public Boolean TryGet<T>(string key, out T value)
         {
-            value = default(T);
+            using (Log.Timer("RedisCache.TryGet", context: key, level: LogLevel.Debug))
+            {
+                value = default(T);

-            string json = _connection.GetClient().StringGet(key);
+                string json = _connection.GetClient().StringGet(key);

-            if (String.IsNullOrWhiteSpace(json)) return false;
+                if (String.IsNullOrWhiteSpace(json)) return false;

-            value = JsonConvert.DeserializeObject<T>(json);
+                value = JsonConvert.DeserializeObject<T>(json);

-            return true;
+                return true;
+            }
         }

         public async Task Add<T>(string key, T value)


Added StockHistoryController to DatabaseAdapter.

--- StockExchangeGame/Database/Generic/DatabaseAdapter.cs
+++ StockExchangeGame/Database/Generic/DatabaseAdapter.cs
@@ -15,6 +15,7 @@
         private readonly IEntityController<Names> _namesController;
         private readonly IEntityController<Sold> _soldController;
         private readonly IEntityController<Stock> _stockController;
+        private readonly IEntityController<StockHistory> _stockHistoryController;
         private const string SqlDbFileName = "StockGame.sqlite3";

         public DatabaseAdapter()
@@ -28,6 +29,7 @@
             _namesController = new NamesController(connectionString);
             _soldController = new SoldController(connectionString);
             _stockController = new StockController(connectionString);
+            _stockHistoryController = new StockHistoryController(connectionString);
         }

         public string GetConnectionString()
@@ -86,7 +88,7 @@

         public void CreateStockHistoryTable()
         {
-            return await GetConnection().CreateTableAsync<StockHistory>();
+            _stockHistoryController.CreateTable();
         }

         public void CreateStockMarketTable()


Convert a List of matrices from Xna to Chamber.

--- ChamberLib.MonoGame/MatrixHelper.cs
+++ ChamberLib.MonoGame/MatrixHelper.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Linq;
+using System.Collections.Generic;

 namespace ChamberLib
 {
@@ -32,6 +33,11 @@
         {
             return m.Select(mm => mm.ToChamber()).ToArray();
         }
+
+        public static List<ChamberLib.Matrix> ToChamber(this List<Microsoft.Xna.Framework.Matrix> m)
+        {
+            return m.Select(mm => mm.ToChamber()).ToList();
+        }
     }
 }


The time for ViewportInfo userdata is not just yet.

--- Commands/TestAddViewportSettings.cs
+++ Commands/TestAddViewportSettings.cs
@@ -23,6 +23,7 @@

 		protected override Result RunCommand(RhinoDoc doc, RunMode mode)
 		{
+#if ITSDONE
 			var vpi = ViewportInfo.FromRhinoViewport(doc.Views.ActiveView.ActiveViewport);

 			var vud = vpi.UserData.Find(typeof (ViewportSettings)) as ViewportSettings;
@@ -45,6 +46,9 @@
 				nvud.Dictionary.Set("test", 1);
 				vpi.UserData.Add(nvud);
 			}
+#else
+			RhinoApp.WriteLine("waiting for lessons on userdata usage");
+#endif

 			return Result.Success;
 		}


[API] Fix failing test for AppointmentsEndpoint

--- Zermelo/Zermelo.API/Endpoints/AppointmentsEndpoint.cs
+++ Zermelo/Zermelo.API/Endpoints/AppointmentsEndpoint.cs
@@ -34,7 +34,7 @@
         /// <returns>List of appointments.</returns>
         public async Task<IEnumerable<Appointment>> GetByDateAsync(DateTimeOffset start, DateTimeOffset end, string user = "~me", List<string> fields = null)
         {
-            if (start <= end)
+            if (start >= end)
                 throw new ArgumentOutOfRangeException(nameof(end), end,
                     $"The value of the {nameof(end)} parameter should be later in time " +
                     $"than the value of the {nameof(start)} parameter (value: {start.ToString()}).");


Improvement: give more information when determining email failed

--- Components/OpenFormAPIController.cs
+++ Components/OpenFormAPIController.cs
@@ -120,7 +120,7 @@

                 JObject schemaJson = JObject.Parse(File.ReadAllText(schemaFilename));
                 json["schema"] = schemaJson;
-                string optionsFilename = path + "settings-options." + DnnUtils.GetCurrentCultureCode()  + ".json";
+                string optionsFilename = path + "settings-options." + DnnUtils.GetCurrentCultureCode() + ".json";
                 if (!File.Exists(optionsFilename))
                 {
                     optionsFilename = path + "settings-options.json";
@@ -165,7 +165,7 @@
                 {
                     Message = "Form submitted."
                 };
-
+
                 string jsonSettings = ActiveModule.ModuleSettings["data"] as string;
                 if (!string.IsNullOrEmpty(jsonSettings))
                 {
@@ -188,7 +188,7 @@

                         data = OpenFormUtils.GenerateFormData(form.ToString(), out FormData);
                     }
-
+

                     if (settings != null && settings.Notifications != null)
                     {
@@ -217,7 +217,7 @@
                             }
                             catch (Exception exc)
                             {
-                                res.Errors.Add("Notification "+(settings.Notifications.IndexOf(notification)+1)+ " : " + exc.Message + " - " + (UserInfo.IsSuperUser ? exc.StackTrace : ""));
+                                res.Errors.Add("Notification " + (settings.Notifications.IndexOf(notification) + 1) + " : " + exc.Message + " - " + (UserInfo.IsSuperUser ? exc.StackTrace : ""));
                                 Logger.Error(exc);
                             }
                         }
@@ -232,7 +232,7 @@
                         }
                     }
                 }
-
+
                 return Request.CreateResponse(HttpStatusCode.OK, res);
             }
             catch (Exception exc)
@@ -255,6 +255,7 @@
         private MailAddress GenerateMailAddress(string TypeOfAddress, string Email, string Name, string FormEmailField, string FormNameField, JObject form)
         {
             MailAddress adr = null;
+
             if (TypeOfAddress == "host")
             {
                 adr = new MailAddress(Host.HostEmail, Host.HostTitle);
@@ -283,6 +284,12 @@
             {
                 adr = new MailAddress(UserInfo.Email, UserInfo.DisplayName);
             }
+
+            if (adr == null)
+            {
+                throw new Exception(string.Format("Can't determine email address. Parameters were TypeOfAddress: [{0}], Email: [{1}], Name: [{2}], FormEmailField: [{3}], FormNameField: [{4}], FormNameField: [{5}]", TypeOfAddress, Email, Name, FormEmailField, FormNameField, form));
+            }
+
             return adr;
         }
         private string SendMail(string mailFrom, string mailTo, string replyTo, string subject, string body)
@@ -353,7 +360,7 @@
         public string Tracking { get; set; }
         public string SiteKey { get; set; }
         public string SecretKey { get; set; }
-
+
     }

     public class SettingsDTO


Cancelled orders don't appear in the list unless you explicitly filter for them.

--- Controllers/OrderAdminController.cs
+++ Controllers/OrderAdminController.cs
@@ -74,7 +74,7 @@
                     query = query.Where(o => o.Status == filterOption);
                 }
                 else {
-                    query = query.Where(o => o.Status != OrderPart.Archived);
+                    query = query.Where(o => o.Status != OrderPart.Archived && o.Status != OrderPart.Cancelled);
                 }

                 switch (model.Options.OrderBy) {


give option to specify collection names

give option to specify collection names

Signed-off-by: Jonas.VanderBiest <35a2c6fae61f8077aab61faa4019722abf05093c@vanderbiest.be>

--- src/identity.documentdb/IdentityCloudContext.cs
+++ src/identity.documentdb/IdentityCloudContext.cs
@@ -1,15 +1,12 @@
 // MIT License Copyright 2017 (c) David Melendez. All rights reserved. See License.txt in the project root for license information.
 using Microsoft.Azure.Documents.Client;
-using Microsoft.Azure.Documents.Linq;
 using System;
-using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using ElCamino.AspNet.Identity.DocumentDB.Model;
 using Microsoft.Azure.Documents;
 using System.Configuration;
-using System.Diagnostics;
 using System.Reflection;
 using System.IO;
 using System.Collections.ObjectModel;
@@ -50,8 +47,8 @@
     {
         private DocumentClient _client = null;
         private Database _db = null;
-        private DocumentCollection _roleDocumentCollection = new DocumentCollection() { Id = Constants.DocumentCollectionIds.RolesCollection };
-        private DocumentCollection _userDocumentCollection = new DocumentCollection() { Id = Constants.DocumentCollectionIds.UsersCollection };
+        private DocumentCollection _roleDocumentCollection;
+        private DocumentCollection _userDocumentCollection;
         private StoredProcedure _getUserByEmailSproc = null;
         private StoredProcedure _getUserByUserNameSproc = null;
         private StoredProcedure _getUserByIdSproc = null;
@@ -80,12 +77,21 @@
         private bool _disposed = false;

         public IdentityCloudContext() :
-            this(ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseUriKey].ToString(),
-            ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseAuthKey].ToString(),
-            ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseNameKey].ToString(),
-            null)
-        {
-
+            this(Constants.DocumentCollectionIds.UsersCollection, Constants.DocumentCollectionIds.RolesCollection) { }
+
+        /// <summary>
+        /// Creates a new context using specific collection names
+        /// </summary>
+        /// <param name="usersCollection">The name of the user collection to use</param>
+        /// <param name="rolesCollection">The name of the role collection to use</param>
+        public IdentityCloudContext(string usersCollection, string rolesCollection) :
+            this(ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseUriKey],
+                ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseAuthKey],
+                ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseNameKey],
+                null)
+        {
+            _userDocumentCollection = new DocumentCollection { Id = usersCollection };
+            _roleDocumentCollection = new DocumentCollection { Id = rolesCollection };
         }

         public IdentityCloudContext(string uri, string authKey, string database, ConnectionPolicy policy = null)


Fix length of hold notes

Fix length of hold notes

--- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
+++ osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
@@ -42,8 +42,7 @@
         public DrawableHoldNote(HoldNote hitObject, ManiaAction action)
             : base(hitObject, action)
         {
-            RelativeSizeAxes = Axes.Both;
-            Height = (float)HitObject.Duration;
+            RelativeSizeAxes = Axes.X;

             AddRange(new Drawable[]
             {


Add test coverage of cross-thread transforms if a dialog is pushed too early

--- osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs
+++ osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs
@@ -1,10 +1,12 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
+using System.Threading;
 using NUnit.Framework;
+using osu.Framework.Allocation;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Sprites;
-using osu.Framework.Testing;
 using osu.Game.Overlays;
 using osu.Game.Overlays.Dialog;

@@ -15,15 +17,11 @@
     {
         private DialogOverlay overlay;

-        [SetUpSteps]
-        public void SetUpSteps()
-        {
-            AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay());
-        }
-
         [Test]
         public void TestBasic()
         {
+            AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay());
+
             TestPopupDialog firstDialog = null;
             TestPopupDialog secondDialog = null;

@@ -37,12 +35,12 @@
                     new PopupDialogOkButton
                     {
                         Text = @"I never want to see this again.",
-                        Action = () => System.Console.WriteLine(@"OK"),
+                        Action = () => Console.WriteLine(@"OK"),
                     },
                     new PopupDialogCancelButton
                     {
                         Text = @"Firetruck, I still want quick ranks!",
-                        Action = () => System.Console.WriteLine(@"Cancel"),
+                        Action = () => Console.WriteLine(@"Cancel"),
                     },
                 },
             }));
@@ -88,8 +86,50 @@
         }

         [Test]
+        public void TestPushBeforeLoad()
+        {
+            PopupDialog dialog = null;
+
+            AddStep("create dialog overlay", () => overlay = new SlowLoadingDialogOverlay());
+
+            AddStep("start loading overlay", () => LoadComponentAsync(overlay, Add));
+
+            AddStep("push dialog before loaded", () =>
+            {
+                overlay.Push(dialog = new TestPopupDialog
+                {
+                    Buttons = new PopupDialogButton[]
+                    {
+                        new PopupDialogOkButton { Text = @"OK" },
+                    },
+                });
+            });
+
+            AddAssert("dialog not displayed", () => overlay.CurrentDialog != dialog);
+
+            AddStep("complete load", () => ((SlowLoadingDialogOverlay)overlay).LoadEvent.Set());
+
+            AddUntilStep("wait for load", () => overlay.IsLoaded);
+
+            AddAssert("dialog displayed", () => overlay.CurrentDialog == dialog);
+        }
+
+        public class SlowLoadingDialogOverlay : DialogOverlay
+        {
+            public ManualResetEventSlim LoadEvent = new ManualResetEventSlim();
+
+            [BackgroundDependencyLoader]
+            private void load()
+            {
+                LoadEvent.Wait(10000);
+            }
+        }
+
+        [Test]
         public void TestDismissBeforePush()
         {
+            AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay());
+
             TestPopupDialog testDialog = null;
             AddStep("dismissed dialog push", () =>
             {
@@ -106,6 +146,8 @@
         [Test]
         public void TestDismissBeforePushViaButtonPress()
         {
+            AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay());
+
             TestPopupDialog testDialog = null;
             AddStep("dismissed dialog push", () =>
             {


Fix `Timeline` potentially not updating visuals to correct state on first display

--- osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
+++ osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
@@ -163,10 +163,11 @@
         {
             base.LoadComplete();

+            WaveformVisible.BindValueChanged(_ => updateWaveformOpacity());
             waveformOpacity.BindValueChanged(_ => updateWaveformOpacity(), true);

-            WaveformVisible.ValueChanged += _ => updateWaveformOpacity();
-            TicksVisible.ValueChanged += visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
+            TicksVisible.BindValueChanged(visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
+
             ControlPointsVisible.BindValueChanged(visible =>
             {
                 if (visible.NewValue)


Another attempt to make Enable of the DarkDataGridViewButton work.

--- DarkUI/Controls/DarkDataGridView.cs
+++ DarkUI/Controls/DarkDataGridView.cs
@@ -1079,8 +1079,9 @@
             }
             set
             {
-                if (value != Enabled)
-                    _enabled = value;
+                if (value == Enabled)
+                    return;
+                _enabled = value;
                 DataGridView?.InvalidateCell(this);
             }
         }
@@ -1223,6 +1224,8 @@
             get { return _enabled; }
             set
             {
+                if (value == _enabled)
+                    return;
                 _enabled = value;
                 DataGridView?.InvalidateColumn(Index);
             }


Fixed build error

Fixed build error

--- src/stashbox/Extensions/ExpressionExtensions.cs
+++ src/stashbox/Extensions/ExpressionExtensions.cs
@@ -20,7 +20,7 @@

             return (Func<object>)factory;
 #else
-                return Expression.Lambda<Func<object>>(expression).Compile();
+            return Expression.Lambda<Func<object>>(expression).Compile();
 #endif
         }

@@ -32,7 +32,7 @@

             return (Delegate)factory;
 #else
-            return Expression.Lambda(expression).Compile();
+            return expression.Compile();
 #endif
         }
     }


Dispose proxy when released.

Dispose proxy when released.

--- cslacs/Csla/DataPortal/Client/DataPortal.cs
+++ cslacs/Csla/DataPortal/Client/DataPortal.cs
@@ -600,6 +600,9 @@
     [EditorBrowsable(EditorBrowsableState.Advanced)]
     public static void ReleaseProxy()
     {
+      var disp = _portal as IDisposable;
+      if (disp != null)
+        disp.Dispose();
       _portal = null;
     }


Added support precipation call.

Added support precipation call.

--- DarkSky.Tests/DarkSkyTest.cs
+++ DarkSky.Tests/DarkSkyTest.cs
@@ -1,6 +1,7 @@
 using DarkSkySharp;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using System;
+using System.Collections.Generic;

 namespace DarkSkySharp.Tests
 {
@@ -81,5 +82,23 @@
             //Assert.AreEqual(expected, actual);
             Assert.Inconclusive("Verify the correctness of this test method.");
         }
+
+        /// <summary>
+        ///A test for Precipitation
+        ///</summary>
+        [TestMethod()]
+        public void PrecipitationTest()
+        {
+            DarkSky darkSky = new DarkSky();
+            Geolocation location = new Geolocation();
+            //string expected = string.Empty; // TODO: Initialize to an appropriate value
+            List<KeyValuePair<Geolocation, int>> list = new List<KeyValuePair<Geolocation, int>>();
+            KeyValuePair<Geolocation, int> kv = new KeyValuePair<Geolocation, int>(location, 1331416523);
+            list.Add(kv);
+            PrecipitationObject po = darkSky.Precipitation(list);
+            Console.WriteLine("{0}", po.PrecipitationList[0].Type);
+            //Assert.AreEqual(expected, actual);
+            Assert.Inconclusive("Verify the correctness of this test method.");
+        }
     }
 }


Adjust Store id

Adjust Store id

--- DependinatorTest/Utils/StoreTest.cs
+++ DependinatorTest/Utils/StoreTest.cs
@@ -15,7 +15,7 @@
 	{
 		private readonly string dbDir = Path.Combine(Path.GetTempPath(), "StoreTest");

-		private readonly SHA1 hash = SHA1.Create();
+		private readonly SHA256 hash = SHA256.Create();

 		[Test]
@@ -31,7 +31,7 @@
 			{
 				string guid = Guid.NewGuid().ToString();
 				string data = guid + Guid.NewGuid() + Guid.NewGuid();
-				string key = ToKey(data);
+				string key = ToKey2(data);
 				items.Add(new KeyValuePair<string, string>(key, data));
 			}
 			t.Log($"Created {count} values");
@@ -60,6 +60,15 @@
 			return hashBytes.ToHex();
 		}

+		private string ToKey2(string value)
+		{
+			byte[] dataBytes = Encoding.UTF8.GetBytes(value);
+			byte[] hashBytes = hash.ComputeHash(dataBytes);
+			string base64String = Convert.ToBase64String(hashBytes, 0, 16);
+
+			return base64String.Substring(0, 22);
+		}
+

 		[Test]
 		public void TestRead()


Increment version

Increment version

--- vmPing/Properties/AssemblyInfo.cs
+++ vmPing/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("1.3.12.0")]
-[assembly: AssemblyFileVersion("1.3.12.0")]
+[assembly: AssemblyVersion("1.3.13.0")]
+[assembly: AssemblyFileVersion("1.3.13.0")]


some cents stuff.

some cents stuff.

--- Destrier/StringExtensions.cs
+++ Destrier/StringExtensions.cs
@@ -449,9 +449,15 @@
                 }
             }

-            double output = default(double);
-            var success = double.TryParse(textBuilder.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out output);
-            return success ? (double?)output : null;
+            double value = default(double);
+            var stringValue = textBuilder.ToString().Trim();
+            var numberFormat = (System.Globalization.NumberFormatInfo)CultureInfo.InvariantCulture.NumberFormat.Clone();
+            numberFormat.CurrencyDecimalSeparator = ".";
+            numberFormat.NumberDecimalSeparator = ".";
+            numberFormat.PercentDecimalSeparator = ".";
+
+            var success = double.TryParse(stringValue, NumberStyles.Any, numberFormat, out value);
+            return success ? (double?)value : null;
         }

         public static Boolean IsNumeric(this String text)


Bug fixes #FIX: Updated Texture so that when uploading compressed data from a pixmap, it only uploads the actual image data, instead of all data in the pixmap memory pool.

--- Duality/Resources/Texture.cs
+++ Duality/Resources/Texture.cs
@@ -577,7 +577,7 @@
 				if (Compressed && pixelData.CompressedData != null)
 				{
 					GL.CompressedTexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.CompressedRgbaS3tcDxt5Ext, pixelData.Width, pixelData.Height, 0,
-						pixelData.CompressedData.Length, pixelData.CompressedData);
+						pixelData.CompressedImageSize, pixelData.CompressedData);
 				}
 				else
 				{


Consolidate ctrl.Display

Consolidate ctrl.Display

--- EDDiscovery/TravelHistoryControl.cs
+++ EDDiscovery/TravelHistoryControl.cs
@@ -210,6 +210,7 @@
             if (uc != null)
             {
                 UserControlPostCreate(displaynumber, uc);
+                uc.Display(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history);
             }

             System.Diagnostics.Debug.WriteLine("And theme {0}", i);
@@ -237,36 +238,29 @@
                 UserControlMaterials ucm = ctrl as UserControlMaterials;
                 ucm.OnChangedCount += MaterialCommodityChangeCount;
                 ucm.OnRequestRefresh += MaterialCommodityRequireRefresh;
-                if (userControlTravelGrid.GetCurrentHistoryEntry != null)
-                    ucm.Display(userControlTravelGrid.GetCurrentHistoryEntry.MaterialCommodity.Sort(false));
             }
             else if (ctrl is UserControlCommodities)
             {
                 UserControlCommodities ucm = ctrl as UserControlCommodities;
                 ucm.OnChangedCount += MaterialCommodityChangeCount;
                 ucm.OnRequestRefresh += MaterialCommodityRequireRefresh;
-                if (userControlTravelGrid.GetCurrentHistoryEntry != null)
-                    ucm.Display(userControlTravelGrid.GetCurrentHistoryEntry.MaterialCommodity.Sort(true));
             }
             else if (ctrl is UserControlLedger)
             {
                 UserControlLedger ucm = ctrl as UserControlLedger;
                 ucm.OnGotoJID += GotoJID;
-                ucm.Display(_discoveryForm.history.materialcommodititiesledger);
             }
             else if (ctrl is UserControlJournalGrid)
             {
                 UserControlJournalGrid ucm = ctrl as UserControlJournalGrid;
                 ucm.NoHistoryIcon();
                 ucm.NoPopOutIcon();
-                ucm.Display(_discoveryForm.history);
             }
             else if (ctrl is UserControlTravelGrid)
             {
                 UserControlTravelGrid ucm = ctrl as UserControlTravelGrid;
                 ucm.NoHistoryIcon();
                 ucm.NoPopOutIcon();
-                ucm.Display(_discoveryForm.history);
             }
             else if (ctrl is UserControlScreenshot)
             {
@@ -275,12 +269,10 @@
             else if (ctrl is UserControlStats)
             {
                 UserControlStats ucm = ctrl as UserControlStats;
-                ucm.SelectionChanged(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history);
             }
             else if (ctrl is UserControlScan)
             {
                 UserControlScan ucm = ctrl as UserControlScan;
-                ucm.Display(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history);
             }
         }


Clear rows when status goes from valid to invalid

--- EDDiscovery/TrilaterationControl.cs
+++ EDDiscovery/TrilaterationControl.cs
@@ -180,17 +180,7 @@
                 textBoxCoordinateY.Text = "?";
                 textBoxCoordinateZ.Text = "?";

-                // keep systems, clear distances
-                for (int i = 0, count = dataGridViewDistances.Rows.Count - 1; i < count; i++)
-                {
-                    var distanceCell = dataGridViewDistances[1, i];
-                    var calculatedDistanceCell = dataGridViewDistances[2, i];
-                    var statusCell = dataGridViewDistances[3, i];
-
-                    distanceCell.Value = null;
-                    calculatedDistanceCell.Value = null;
-                    statusCell.Value = null;
-                }
+                ClearDataGridRows();
             }
         }

@@ -263,6 +253,7 @@
                     TravelHistoryControl.LogText("Enter more distances." + Environment.NewLine);
                     labelStatus.Text = "Enter More Distances";
                     labelStatus.BackColor = Color.Red;
+                    ClearCalculatedDataGridRows();
                 });
             }

@@ -329,8 +320,35 @@
                         statusCell.Value = "Wrong distance";
                         statusCell.Style.ForeColor = Color.Red;
                     }
-
-                }
+                }
+            }
+        }
+
+        private void ClearDataGridRows()
+        {
+            // keep systems, clear distances
+            for (int i = 0, count = dataGridViewDistances.Rows.Count - 1; i < count; i++)
+            {
+                var distanceCell = dataGridViewDistances[1, i];
+                var calculatedDistanceCell = dataGridViewDistances[2, i];
+                var statusCell = dataGridViewDistances[3, i];
+
+                distanceCell.Value = null;
+                calculatedDistanceCell.Value = null;
+                statusCell.Value = null;
+            }
+        }
+
+        private void ClearCalculatedDataGridRows()
+        {
+            // keep systems and distances, clear calculated distances and statuses
+            for (int i = 0, count = dataGridViewDistances.Rows.Count - 1; i < count; i++)
+            {
+                var calculatedDistanceCell = dataGridViewDistances[2, i];
+                var statusCell = dataGridViewDistances[3, i];
+
+                calculatedDistanceCell.Value = null;
+                statusCell.Value = null;
             }
         }
     }


[KMS] Tooltip.CashPackage (3)

[KMS] Tooltip.CashPackage (3)

--- WzComparerR2/CharaSimControl/CashPackageRender.cs
+++ WzComparerR2/CharaSimControl/CashPackageRender.cs
@@ -174,7 +174,7 @@
                 }
                 if (limit != null && limit.Length > 0)
                 {
-                    TextRenderer.DrawText(g, "< " + limit + " 한정판매 >", GearGraphics.ItemDetailFont2, new Point(cashBitmap.Width, picH), ((SolidBrush)GearGraphics.OrangeBrush).Color, TextFormatFlags.HorizontalCenter);
+                    TextRenderer.DrawText(g, "< " + limit + " 한정판매 >", GearGraphics.ItemDetailFont2, new Point(cashBitmap.Width, picH), ((SolidBrush)GearGraphics.GearNameBrushC).Color, TextFormatFlags.HorizontalCenter);
                     picH += 12;
                 }
             }


Revert 0cb579925586c82cf6ec837dc55c66d37ad46fec Slider detection fix

--- XOutput/Devices/Input/DirectInput/DirectDevice.cs
+++ XOutput/Devices/Input/DirectInput/DirectDevice.cs
@@ -459,21 +459,6 @@

         private DirectInputTypes? MapAxisByInstanceNumber(DeviceObjectInstance instance)
         {
-            if (joystick.Information.Type != DeviceType.Mouse)
-            {
-                JoystickOffset offset = (JoystickOffset)instance.Offset;
-                if (offset == JoystickOffset.Sliders0 ||
-                    offset == JoystickOffset.Sliders1 ||
-                    offset == JoystickOffset.VelocitySliders0 ||
-                    offset == JoystickOffset.VelocitySliders1 ||
-                    offset == JoystickOffset.AccelerationSliders0 ||
-                    offset == JoystickOffset.AccelerationSliders1 ||
-                    offset == JoystickOffset.ForceSliders0 ||
-                    offset == JoystickOffset.ForceSliders1)
-                {
-                    return null;
-                }
-            }
             return DirectInputHelper.Instance.Axes.ElementAtOrDefault(instance.ObjectId.InstanceNumber);
         }