Cosmetics: Matrix class structure (no code changes)

--- src/Numerics/LinearAlgebra/Generic/Matrix.cs
+++ src/Numerics/LinearAlgebra/Generic/Matrix.cs
@@ -35,8 +35,6 @@
     using Numerics;
     using Properties;
     using Storage;
-    using Threading;
-

     ///
     /// Defines the base class for <c>Matrix</c> classes.
@@ -290,6 +288,19 @@
             return result;
         }

+#if !PORTABLE
+        ///
+        /// Creates a new object that is a copy of the current instance.
+        ///
+        /// <returns>
+        /// A new object that is a copy of this instance.
+        /// </returns>
+        object ICloneable.Clone()
+        {
+            return Clone();
+        }
+#endif
+
         ///
         /// Copies the elements of this matrix to the given matrix.
         ///
@@ -340,17 +351,6 @@
         public abstract Vector<T> CreateVector(int size, bool fullyMutable = false);

         ///
-        /// Returns a <see cref="System.String"/> that represents this instance.
-        ///
-        /// <returns>
-        /// A <see cref="System.String"/> that represents this instance.
-        /// </returns>
-        public override string ToString()
-        {
-            return ToString(null);
-        }
-
-        ///
         /// Copies a row into an Vector.
         ///
         /// <param name="index">The row to copy.</param>
@@ -400,7 +400,7 @@
         /// or greater than or equal to the number of rows.</item>
         /// <item><paramref name="columnIndex"/> is negative,
         /// or greater than or equal to the number of columns.</item>
-        /// <item><c>(columnIndex + length) >= Columns.</c></item></list></exception>
+        /// <item><c>(columnIndex + length) >= Columns.</c></item></list></exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="length"/> is not positive.</exception>
         public Vector<T> Row(int rowIndex, int columnIndex, int length)
         {
@@ -418,10 +418,10 @@
         /// <param name="result">The Vector to copy the column into.</param>
         /// <exception cref="ArgumentNullException">If the result Vector is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> is negative,
-        /// or greater than or equal to the number of columns.</exception>
+        /// or greater than or equal to the number of columns.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> is negative,
-        /// or greater than or equal to the number of rows.</exception>
-        /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> + <paramref name="length"/>
+        /// or greater than or equal to the number of rows.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> + <paramref name="length"/>
         /// is greater than or equal to the number of rows.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="length"/> is not positive.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If result.Count < length.</exception>
@@ -486,7 +486,7 @@
         /// <item><paramref name="rowIndex"/> is negative,
         /// or greater than or equal to the number of rows.</item>
         /// <item><c>(rowIndex + length) >= Rows.</c></item></list>
-        /// </exception>
+        /// </exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="length"/> is not positive.</exception>
         public Vector<T> Column(int columnIndex, int rowIndex, int length)
         {
@@ -504,10 +504,10 @@
         /// <param name="result">The Vector to copy the column into.</param>
         /// <exception cref="ArgumentNullException">If the result Vector is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> is negative,
-        /// or greater than or equal to the number of columns.</exception>
+        /// or greater than or equal to the number of columns.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> is negative,
-        /// or greater than or equal to the number of rows.</exception>
-        /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> + <paramref name="length"/>
+        /// or greater than or equal to the number of rows.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> + <paramref name="length"/>
         /// is greater than or equal to the number of rows.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="length"/> is not positive.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If result.Count < length.</exception>
@@ -522,9 +522,28 @@
         }

         ///
+        /// Returns a new matrix containing the upper triangle of this matrix.
+        ///
+        /// <returns>The upper triangle of this matrix.</returns>
+        public virtual Matrix<T> UpperTriangle()
+        {
+            var ret = CreateMatrix(RowCount, ColumnCount);
+
+            for (var row = 0; row < RowCount; row++)
+            {
+                for (var column = row; column < ColumnCount; column++)
+                {
+                    ret.At(row, column, At(row, column));
+                }
+            }
+
+            return ret;
+        }
+
+        ///
         /// Returns a new matrix containing the lower triangle of this matrix.
         ///
-        /// <returns>The lower triangle of this matrix.</returns>
+        /// <returns>The lower triangle of this matrix.</returns>
         public virtual Matrix<T> LowerTriangle()
         {
             var ret = CreateMatrix(RowCount, ColumnCount);
@@ -565,25 +584,6 @@
                     result.At(row, column, row >= column ? At(row, column) : default(T));
                 }
             }
-        }
-
-        ///
-        /// Returns a new matrix containing the upper triangle of this matrix.
-        ///
-        /// <returns>The upper triangle of this matrix.</returns>
-        public virtual Matrix<T> UpperTriangle()
-        {
-            var ret = CreateMatrix(RowCount, ColumnCount);
-
-            for (var row = 0; row < RowCount; row++)
-            {
-                for (var column = row; column < ColumnCount; column++)
-                {
-                    ret.At(row, column, At(row, column));
-                }
-            }
-
-            return ret;
         }

         ///
@@ -623,10 +623,10 @@
         /// <returns>The requested sub-matrix.</returns>
         /// <exception cref="ArgumentOutOfRangeException">If: <list><item><paramref name="rowIndex"/> is
         /// negative, or greater than or equal to the number of rows.</item>
-        /// <item><paramref name="columnIndex"/> is negative, or greater than or equal to the number
+        /// <item><paramref name="columnIndex"/> is negative, or greater than or equal to the number
         /// of columns.</item>
         /// <item><c>(columnIndex + columnLength) >= Columns</c></item>
-        /// <item><c>(rowIndex + rowLength) >= Rows</c></item></list></exception>
+        /// <item><c>(rowIndex + rowLength) >= Rows</c></item></list></exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowCount"/> or <paramref name="columnCount"/>
         /// is not positive.</exception>
         public virtual Matrix<T> SubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount)
@@ -634,105 +634,6 @@
             var target = CreateMatrix(rowCount, columnCount);
             Storage.CopySubMatrixTo(target.Storage, rowIndex, 0, rowCount, columnIndex, 0, columnCount);
             return target;
-        }
-
-        ///
-        /// Returns an <see cref="IEnumerator{T}"/> that enumerates over the matrix columns.
-        ///
-        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over the matrix columns</returns>
-        /// <seealso cref="IEnumerator{T}"/>
-        public virtual IEnumerable<Tuple<int, Vector<T>>> ColumnEnumerator()
-        {
-            for (var i = 0; i < ColumnCount; i++)
-            {
-                yield return new Tuple<int, Vector<T>>(i, Column(i));
-            }
-        }
-
-        ///
-        /// Returns an <see cref="IEnumerator{T}"/> that enumerates the requested matrix columns.
-        ///
-        /// <param name="index">The column to start enumerating over.</param>
-        /// <param name="length">The number of columns to enumerating over.</param>
-        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over requested matrix columns.</returns>
-        /// <seealso cref="IEnumerator{T}"/>
-        /// <exception cref="ArgumentOutOfRangeException">If:
-        /// <list><item><paramref name="index"/> is negative,
-        /// or greater than or equal to the number of columns.</item>
-        /// <item><c>(index + length) >= Columns.</c></item></list>
-        /// </exception>
-        /// <exception cref="ArgumentException">If <paramref name="length"/> is not positive.</exception>
-        public virtual IEnumerable<Tuple<int, Vector<T>>> ColumnEnumerator(int index, int length)
-        {
-            if (index >= ColumnCount || index < 0)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-
-            if (index + length > ColumnCount)
-            {
-                throw new ArgumentOutOfRangeException("length");
-            }
-
-            if (length < 1)
-            {
-                throw new ArgumentException(Resources.ArgumentMustBePositive, "length");
-            }
-
-            var maxIndex = index + length;
-            for (var i = index; i < maxIndex; i++)
-            {
-                yield return new Tuple<int, Vector<T>>(i, Column(i));
-            }
-        }
-
-        ///
-        /// Returns an <see cref="IEnumerator{T}"/> that enumerates the requested matrix rows.
-        ///
-        /// <param name="index">The row to start enumerating over.</param>
-        /// <param name="length">The number of rows to enumerating over.</param>
-        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over requested matrix rows.</returns>
-        /// <seealso cref="IEnumerator{T}"/>
-        /// <exception cref="ArgumentOutOfRangeException">If:
-        /// <list><item><paramref name="index"/> is negative,
-        /// or greater than or equal to the number of rows.</item>
-        /// <item><c>(index + length) >= Rows.</c></item></list></exception>
-        /// <exception cref="ArgumentException">If <paramref name="length"/> is not positive.</exception>
-        public virtual IEnumerable<Tuple<int, Vector<T>>> RowEnumerator(int index, int length)
-        {
-            if (index >= RowCount || index < 0)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-
-            if (index + length > RowCount)
-            {
-                throw new ArgumentOutOfRangeException("length");
-            }
-
-            if (length < 1)
-            {
-                throw new ArgumentException(Resources.ArgumentMustBePositive, "length");
-            }
-
-            var maxi = index + length;
-            for (var i = index; i < maxi; i++)
-            {
-                yield return new Tuple<int, Vector<T>>(i, Row(i));
-            }
-        }
-
-        ///
-        /// Returns an <see cref="IEnumerator{T}"/> that enumerates over the matrix rows.
-        ///
-        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over the matrix rows</returns>
-        /// <seealso cref="IEnumerator{T}"/>
-        public virtual IEnumerable<Tuple<int, Vector<T>>> RowEnumerator()
-        {
-            for (var i = 0; i < RowCount; i++)
-            {
-                yield return new Tuple<int, Vector<T>>(i, Row(i));
-            }
         }

         ///
@@ -896,7 +797,7 @@
         ///
         /// <param name="columnIndex">The column to copy the values to.</param>
         /// <param name="column">The array to copy the values from.</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="column"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="column"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> is less than zero,
         /// or greater than or equal to the number of columns.</exception>
         /// <exception cref="ArgumentException">If the size of <paramref name="column"/> does not
@@ -931,7 +832,7 @@
         ///
         /// <param name="columnIndex">The column to copy the values to.</param>
         /// <param name="column">The vector to copy the values from.</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="column"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="column"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="columnIndex"/> is less than zero,
         /// or greater than or equal to the number of columns.</exception>
         /// <exception cref="ArgumentException">If the size of <paramref name="column"/> does not
@@ -1007,7 +908,7 @@
         ///
         /// <param name="rowIndex">The row to copy the values to.</param>
         /// <param name="row">The vector to copy the values from.</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="row"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="row"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> is less than zero,
         /// or greater than or equal to the number of rows.</exception>
         /// <exception cref="ArgumentException">If the size of <paramref name="row"/> does not
@@ -1040,7 +941,7 @@
         ///
         /// <param name="rowIndex">The row to copy the values to.</param>
         /// <param name="row">The array to copy the values from.</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="row"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="row"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowIndex"/> is less than zero,
         /// or greater than or equal to the number of rows.</exception>
         /// <exception cref="ArgumentException">If the size of <paramref name="row"/> does not
@@ -1078,10 +979,10 @@
         /// <param name="subMatrix">The sub-matrix to copy from.</param>
         /// <exception cref="ArgumentOutOfRangeException">If: <list><item><paramref name="rowIndex"/> is
         /// negative, or greater than or equal to the number of rows.</item>
-        /// <item><paramref name="columnIndex"/> is negative, or greater than or equal to the number
+        /// <item><paramref name="columnIndex"/> is negative, or greater than or equal to the number
         /// of columns.</item>
         /// <item><c>(columnIndex + columnLength) >= Columns</c></item>
-        /// <item><c>(rowIndex + rowLength) >= Rows</c></item></list></exception>
+        /// <item><c>(rowIndex + rowLength) >= Rows</c></item></list></exception>
         /// <exception cref="ArgumentNullException">If <paramref name="subMatrix"/> is <see langword="null" /></exception>
         /// <item>the size of <paramref name="subMatrix"/> is not at least <paramref name="rowCount"/> x <paramref name="columnCount"/>.</item>
         /// <exception cref="ArgumentOutOfRangeException">If <paramref name="rowCount"/> or <paramref name="columnCount"/>
@@ -1101,7 +1002,7 @@
         ///
         /// <param name="source">The vector to copy the values from. The length of the vector should be
         /// Min(Rows, Columns).</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="source"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="source"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">If the length of <paramref name="source"/> does not
         /// equal Min(Rows, Columns).</exception>
         /// <remarks>For non-square matrices, the elements of <paramref name="source"/> are copied to
@@ -1131,7 +1032,7 @@
         ///
         /// <param name="source">The array to copy the values from. The length of the vector should be
         /// Min(Rows, Columns).</param>
-        /// <exception cref="ArgumentNullException">If <paramref name="source"/> is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="source"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">If the length of <paramref name="source"/> does not
         /// equal Min(Rows, Columns).</exception>
         /// <remarks>For non-square matrices, the elements of <paramref name="source"/> are copied to
@@ -1157,9 +1058,415 @@
         }

         ///
+        /// Returns the transpose of this matrix.
+        ///
+        /// <returns>The transpose of this matrix.</returns>
+        public virtual Matrix<T> Transpose()
+        {
+            var ret = CreateMatrix(ColumnCount, RowCount);
+            for (var j = 0; j < ColumnCount; j++)
+            {
+                for (var i = 0; i < RowCount; i++)
+                {
+                    ret.At(j, i, At(i, j));
+                }
+            }
+
+            return ret;
+        }
+
+        ///
+        /// Returns the conjugate transpose of this matrix.
+        ///
+        /// <returns>The conjugate transpose of this matrix.</returns>
+        public abstract Matrix<T> ConjugateTranspose();
+
+        ///
+        /// Permute the rows of a matrix according to a permutation.
+        ///
+        /// <param name="p">The row permutation to apply to this matrix.</param>
+        public virtual void PermuteRows(Permutation p)
+        {
+            if (p.Dimension != RowCount)
+            {
+                throw new ArgumentException(Resources.ArgumentArraysSameLength, "p");
+            }
+
+            // Get a sequence of inversions from the permutation.
+            var inv = p.ToInversions();
+
+            for (var i = 0; i < inv.Length; i++)
+            {
+                if (inv[i] != i)
+                {
+                    var q = inv[i];
+                    for (var j = 0; j < ColumnCount; j++)
+                    {
+                        var temp = At(q, j);
+                        At(q, j, At(i, j));
+                        At(i, j, temp);
+                    }
+                }
+            }
+        }
+
+        ///
+        /// Permute the columns of a matrix according to a permutation.
+        ///
+        /// <param name="p">The column permutation to apply to this matrix.</param>
+        public virtual void PermuteColumns(Permutation p)
+        {
+            if (p.Dimension != ColumnCount)
+            {
+                throw new ArgumentException(Resources.ArgumentArraysSameLength, "p");
+            }
+
+            // Get a sequence of inversions from the permutation.
+            var inv = p.ToInversions();
+
+            for (var i = 0; i < inv.Length; i++)
+            {
+                if (inv[i] != i)
+                {
+                    var q = inv[i];
+                    for (var j = 0; j < RowCount; j++)
+                    {
+                        var temp = At(j, q);
+                        At(j, q, At(j, i));
+                        At(j, i, temp);
+                    }
+                }
+            }
+        }
+
+        ///
+        ///  Concatenates this matrix with the given matrix.
+        ///
+        /// <param name="right">The matrix to concatenate.</param>
+        /// <returns>The combined matrix.</returns>
+        public Matrix<T> Append(Matrix<T> right)
+        {
+            if (right == null)
+            {
+                throw new ArgumentNullException("right");
+            }
+
+            if (right.RowCount != RowCount)
+            {
+                throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension);
+            }
+
+            var result = CreateMatrix(RowCount, ColumnCount + right.ColumnCount, fullyMutable: true);
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, skipClearing: true);
+            right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount, skipClearing: true);
+            return result;
+        }
+
+        ///
+        /// Concatenates this matrix with the given matrix and places the result into the result matrix.
+        ///
+        /// <param name="right">The matrix to concatenate.</param>
+        /// <param name="result">The combined matrix.</param>
+        public void Append(Matrix<T> right, Matrix<T> result)
+        {
+            if (right == null)
+            {
+                throw new ArgumentNullException("right");
+            }
+
+            if (right.RowCount != RowCount)
+            {
+                throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension);
+            }
+
+            if (result == null)
+            {
+                throw new ArgumentNullException("result");
+            }
+
+            if (result.ColumnCount != (ColumnCount + right.ColumnCount) || result.RowCount != RowCount)
+            {
+                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension);
+            }
+
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
+            right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount);
+        }
+
+        ///
+        /// Stacks this matrix on top of the given matrix and places the result into the result matrix.
+        ///
+        /// <param name="lower">The matrix to stack this matrix upon.</param>
+        /// <returns>The combined matrix.</returns>
+        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentException">If upper.Columns != lower.Columns.</exception>
+        public Matrix<T> Stack(Matrix<T> lower)
+        {
+            if (lower == null)
+            {
+                throw new ArgumentNullException("lower");
+            }
+
+            if (lower.ColumnCount != ColumnCount)
+            {
+                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, "lower");
+            }
+
+            var result = CreateMatrix(RowCount + lower.RowCount, ColumnCount, fullyMutable: true);
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, skipClearing: true);
+            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount, skipClearing: true);
+            return result;
+        }
+
+        ///
+        /// Stacks this matrix on top of the given matrix and places the result into the result matrix.
+        ///
+        /// <param name="lower">The matrix to stack this matrix upon.</param>
+        /// <param name="result">The combined matrix.</param>
+        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentException">If upper.Columns != lower.Columns.</exception>
+        public void Stack(Matrix<T> lower, Matrix<T> result)
+        {
+            if (lower == null)
+            {
+                throw new ArgumentNullException("lower");
+            }
+
+            if (lower.ColumnCount != ColumnCount)
+            {
+                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, "lower");
+            }
+
+            if (result == null)
+            {
+                throw new ArgumentNullException("result");
+            }
+
+            if (result.RowCount != (RowCount + lower.RowCount) || result.ColumnCount != ColumnCount)
+            {
+                throw DimensionsDontMatch<ArgumentException>(this, result, "result");
+            }
+
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
+            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount);
+        }
+
+        ///
+        /// Diagonally stacks his matrix on top of the given matrix. The new matrix is a M-by-N matrix,
+        /// where M = this.Rows + lower.Rows and N = this.Columns + lower.Columns.
+        /// The values of off the off diagonal matrices/blocks are set to zero.
+        ///
+        /// <param name="lower">The lower, right matrix.</param>
+        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
+        /// <returns>the combined matrix</returns>
+        public Matrix<T> DiagonalStack(Matrix<T> lower)
+        {
+            if (lower == null)
+            {
+                throw new ArgumentNullException("lower");
+            }
+
+            var result = CreateMatrix(RowCount + lower.RowCount, ColumnCount + lower.ColumnCount, fullyMutable: true);
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
+            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount);
+            return result;
+        }
+
+        ///
+        /// Diagonally stacks his matrix on top of the given matrix and places the combined matrix into the result matrix.
+        ///
+        /// <param name="lower">The lower, right matrix.</param>
+        /// <param name="result">The combined matrix</param>
+        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If the result matrix is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentException">If the result matrix's dimensions are not (this.Rows + lower.rows) x (this.Columns + lower.Columns).</exception>
+        public void DiagonalStack(Matrix<T> lower, Matrix<T> result)
+        {
+            if (lower == null)
+            {
+                throw new ArgumentNullException("lower");
+            }
+
+            if (result == null)
+            {
+                throw new ArgumentNullException("result");
+            }
+
+            if (result.RowCount != RowCount + lower.RowCount || result.ColumnCount != ColumnCount + lower.ColumnCount)
+            {
+                throw DimensionsDontMatch<ArgumentException>(this, result, "result");
+            }
+
+            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
+            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount);
+        }
+
+        /// Calculates the L1 norm.
+        /// <returns>The L1 norm of the matrix.</returns>
+        public abstract T L1Norm();
+
+        /// Calculates the L2 norm.
+        /// <returns>The L2 norm of the matrix.</returns>
+        /// <remarks>For sparse matrices, the L2 norm is computed using a dense implementation of singular value decomposition.
+        /// In a later release, it will be replaced with a sparse implementation.</remarks>
+        public virtual T L2Norm()
+        {
+            return Svd<T>.Create(this, false).Norm2;
+        }
+
+        /// Calculates the Frobenius norm of this matrix.
+        /// <returns>The Frobenius norm of this matrix.</returns>
+        public abstract T FrobeniusNorm();
+
+        /// Calculates the infinity norm of this matrix.
+        /// <returns>The infinity norm of this matrix.</returns>
+        public abstract T InfinityNorm();
+
+        ///
+        /// Gets a value indicating whether this matrix is symmetric.
+        ///
+        public virtual bool IsSymmetric
+        {
+            get
+            {
+                if (RowCount != ColumnCount)
+                {
+                    return false;
+                }
+
+                for (var row = 0; row < RowCount; row++)
+                {
+                    for (var column = row + 1; column < ColumnCount; column++)
+                    {
+                        if (!At(row, column).Equals(At(column, row)))
+                        {
+                            return false;
+                        }
+                    }
+                }
+
+                return true;
+            }
+        }
+
+        ///
+        /// Returns an <see cref="IEnumerator{T}"/> that enumerates over the matrix columns.
+        ///
+        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over the matrix columns</returns>
+        /// <seealso cref="IEnumerator{T}"/>
+        public virtual IEnumerable<Tuple<int, Vector<T>>> ColumnEnumerator()
+        {
+            for (var i = 0; i < ColumnCount; i++)
+            {
+                yield return new Tuple<int, Vector<T>>(i, Column(i));
+            }
+        }
+
+        ///
+        /// Returns an <see cref="IEnumerator{T}"/> that enumerates the requested matrix columns.
+        ///
+        /// <param name="index">The column to start enumerating over.</param>
+        /// <param name="length">The number of columns to enumerating over.</param>
+        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over requested matrix columns.</returns>
+        /// <seealso cref="IEnumerator{T}"/>
+        /// <exception cref="ArgumentOutOfRangeException">If:
+        /// <list><item><paramref name="index"/> is negative,
+        /// or greater than or equal to the number of columns.</item>
+        /// <item><c>(index + length) >= Columns.</c></item></list>
+        /// </exception>
+        /// <exception cref="ArgumentException">If <paramref name="length"/> is not positive.</exception>
+        public virtual IEnumerable<Tuple<int, Vector<T>>> ColumnEnumerator(int index, int length)
+        {
+            if (index >= ColumnCount || index < 0)
+            {
+                throw new ArgumentOutOfRangeException("index");
+            }
+
+            if (index + length > ColumnCount)
+            {
+                throw new ArgumentOutOfRangeException("length");
+            }
+
+            if (length < 1)
+            {
+                throw new ArgumentException(Resources.ArgumentMustBePositive, "length");
+            }
+
+            var maxIndex = index + length;
+            for (var i = index; i < maxIndex; i++)
+            {
+                yield return new Tuple<int, Vector<T>>(i, Column(i));
+            }
+        }
+
+        ///
+        /// Returns an <see cref="IEnumerator{T}"/> that enumerates the requested matrix rows.
+        ///
+        /// <param name="index">The row to start enumerating over.</param>
+        /// <param name="length">The number of rows to enumerating over.</param>
+        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over requested matrix rows.</returns>
+        /// <seealso cref="IEnumerator{T}"/>
+        /// <exception cref="ArgumentOutOfRangeException">If:
+        /// <list><item><paramref name="index"/> is negative,
+        /// or greater than or equal to the number of rows.</item>
+        /// <item><c>(index + length) >= Rows.</c></item></list></exception>
+        /// <exception cref="ArgumentException">If <paramref name="length"/> is not positive.</exception>
+        public virtual IEnumerable<Tuple<int, Vector<T>>> RowEnumerator(int index, int length)
+        {
+            if (index >= RowCount || index < 0)
+            {
+                throw new ArgumentOutOfRangeException("index");
+            }
+
+            if (index + length > RowCount)
+            {
+                throw new ArgumentOutOfRangeException("length");
+            }
+
+            if (length < 1)
+            {
+                throw new ArgumentException(Resources.ArgumentMustBePositive, "length");
+            }
+
+            var maxi = index + length;
+            for (var i = index; i < maxi; i++)
+            {
+                yield return new Tuple<int, Vector<T>>(i, Row(i));
+            }
+        }
+
+        ///
+        /// Returns an <see cref="IEnumerator{T}"/> that enumerates over the matrix rows.
+        ///
+        /// <returns>An <see cref="IEnumerator{T}"/> that enumerates over the matrix rows</returns>
+        /// <seealso cref="IEnumerator{T}"/>
+        public virtual IEnumerable<Tuple<int, Vector<T>>> RowEnumerator()
+        {
+            for (var i = 0; i < RowCount; i++)
+            {
+                yield return new Tuple<int, Vector<T>>(i, Row(i));
+            }
+        }
+
+        ///
+        /// Iterates throw each element in the matrix (row-wise).
+        ///
+        /// <returns>The value at the current iteration along with its position (row, column, value).</returns>
+        public virtual IEnumerable<Tuple<int, int, T>> IndexedEnumerator()
+        {
+            for (var row = 0; row < RowCount; row++)
+            {
+                for (var column = 0; column < ColumnCount; column++)
+                {
+                    yield return new Tuple<int, int, T>(row, column, At(row, column));
+                }
+            }
+        }
+
+        ///
         /// Returns this matrix as a multidimensional array.
         ///
-        /// <returns>A multidimensional containing the values of this matrix.</returns>
+        /// <returns>A multidimensional containing the values of this matrix.</returns>
         public T[,] ToArray()
         {
             return Storage.ToArray();
@@ -1193,51 +1500,16 @@
             return Storage.ToRowMajorArray();
         }

-        #region Implemented Interfaces
-
-#if !PORTABLE
-
-        #region ICloneable
-
-        ///
-        /// Creates a new object that is a copy of the current instance.
+        ///
+        /// Returns a <see cref="System.String"/> that represents this instance.
         ///
         /// <returns>
-        /// A new object that is a copy of this instance.
+        /// A <see cref="System.String"/> that represents this instance.
         /// </returns>
-        object ICloneable.Clone()
-        {
-            return Clone();
-        }
-
-        #endregion
-
-#endif
-
-        #region IEquatable<Matrix<T>>
-
-        ///
-        /// Indicates whether the current object is equal to another object of the same type.
-        ///
-        /// <param name="other">
-        /// An object to compare with this object.
-        /// </param>
-        /// <returns>
-        /// <c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
-        /// </returns>
-        public bool Equals(Matrix<T> other)
-        {
-            if (other == null)
-            {
-                return false;
-            }
-
-            return Storage.Equals(other.Storage);
-        }
-
-        #endregion
-
-        #region IFormattable
+        public override string ToString()
+        {
+            return ToString(null);
+        }

         ///
         /// Returns a <see cref="System.String"/> that represents this instance.
@@ -1274,11 +1546,30 @@
             return stringBuilder.ToString();
         }

-        #endregion
-
-        #endregion
-
-        #region System.Object overrides
+        ///
+        /// Returns a hash code for this instance.
+        ///
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
+        /// </returns>
+        public override int GetHashCode()
+        {
+            return Storage.GetHashCode();
+        }
+
+        ///
+        /// Indicates whether the current object is equal to another object of the same type.
+        ///
+        /// <param name="other">
+        /// An object to compare with this object.
+        /// </param>
+        /// <returns>
+        /// <c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
+        /// </returns>
+        public bool Equals(Matrix<T> other)
+        {
+            return other != null && Storage.Equals(other.Storage);
+        }

         ///
         /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
@@ -1292,325 +1583,5 @@
             var other = obj as Matrix<T>;
             return other != null && Storage.Equals(other.Storage);
         }
-
-        ///
-        /// Returns a hash code for this instance.
-        ///
-        /// <returns>
-        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
-        /// </returns>
-        public override int GetHashCode()
-        {
-            return Storage.GetHashCode();
-        }
-
-        #endregion
-
-        ///
-        /// Returns the transpose of this matrix.
-        ///
-        /// <returns>The transpose of this matrix.</returns>
-        public virtual Matrix<T> Transpose()
-        {
-            var ret = CreateMatrix(ColumnCount, RowCount);
-            for (var j = 0; j < ColumnCount; j++)
-            {
-                for (var i = 0; i < RowCount; i++)
-                {
-                    ret.At(j, i, At(i, j));
-                }
-            }
-
-            return ret;
-        }
-
-        ///
-        /// Returns the conjugate transpose of this matrix.
-        ///
-        /// <returns>The conjugate transpose of this matrix.</returns>
-        public abstract Matrix<T> ConjugateTranspose();
-
-        ///
-        /// Permute the rows of a matrix according to a permutation.
-        ///
-        /// <param name="p">The row permutation to apply to this matrix.</param>
-        public virtual void PermuteRows(Permutation p)
-        {
-            if (p.Dimension != RowCount)
-            {
-                throw new ArgumentException(Resources.ArgumentArraysSameLength, "p");
-            }
-
-            // Get a sequence of inversions from the permutation.
-            var inv = p.ToInversions();
-
-            for (var i = 0; i < inv.Length; i++)
-            {
-                if (inv[i] != i)
-                {
-                    var q = inv[i];
-                    for (var j = 0; j < ColumnCount; j++)
-                    {
-                        var temp = At(q, j);
-                        At(q, j, At(i, j));
-                        At(i, j, temp);
-                    }
-                }
-            }
-        }
-
-        ///
-        /// Permute the columns of a matrix according to a permutation.
-        ///
-        /// <param name="p">The column permutation to apply to this matrix.</param>
-        public virtual void PermuteColumns(Permutation p)
-        {
-            if (p.Dimension != ColumnCount)
-            {
-                throw new ArgumentException(Resources.ArgumentArraysSameLength, "p");
-            }
-
-            // Get a sequence of inversions from the permutation.
-            var inv = p.ToInversions();
-
-            for (var i = 0; i < inv.Length; i++)
-            {
-                if (inv[i] != i)
-                {
-                    var q = inv[i];
-                    for (var j = 0; j < RowCount; j++)
-                    {
-                        var temp = At(j, q);
-                        At(j, q, At(j, i));
-                        At(j, i, temp);
-                    }
-                }
-            }
-        }
-
-        ///
-        ///  Concatenates this matrix with the given matrix.
-        ///
-        /// <param name="right">The matrix to concatenate.</param>
-        /// <returns>The combined matrix.</returns>
-        public Matrix<T> Append(Matrix<T> right)
-        {
-            if (right == null)
-            {
-                throw new ArgumentNullException("right");
-            }
-
-            if (right.RowCount != RowCount)
-            {
-                throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension);
-            }
-
-            var result = CreateMatrix(RowCount, ColumnCount + right.ColumnCount, fullyMutable: true);
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, skipClearing: true);
-            right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount, skipClearing: true);
-            return result;
-        }
-
-        ///
-        /// Concatenates this matrix with the given matrix and places the result into the result matrix.
-        ///
-        /// <param name="right">The matrix to concatenate.</param>
-        /// <param name="result">The combined matrix.</param>
-        public void Append(Matrix<T> right, Matrix<T> result)
-        {
-            if (right == null)
-            {
-                throw new ArgumentNullException("right");
-            }
-
-            if (right.RowCount != RowCount)
-            {
-                throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension);
-            }
-
-            if (result == null)
-            {
-                throw new ArgumentNullException("result");
-            }
-
-            if (result.ColumnCount != (ColumnCount + right.ColumnCount) || result.RowCount != RowCount)
-            {
-                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension);
-            }
-
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
-            right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount);
-        }
-
-        ///
-        /// Stacks this matrix on top of the given matrix and places the result into the result matrix.
-        ///
-        /// <param name="lower">The matrix to stack this matrix upon.</param>
-        /// <returns>The combined matrix.</returns>
-        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
-        /// <exception cref="ArgumentException">If upper.Columns != lower.Columns.</exception>
-        public Matrix<T> Stack(Matrix<T> lower)
-        {
-            if (lower == null)
-            {
-                throw new ArgumentNullException("lower");
-            }
-
-            if (lower.ColumnCount != ColumnCount)
-            {
-                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, "lower");
-            }
-
-            var result = CreateMatrix(RowCount + lower.RowCount, ColumnCount, fullyMutable: true);
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, skipClearing: true);
-            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount, skipClearing: true);
-            return result;
-        }
-
-        ///
-        /// Stacks this matrix on top of the given matrix and places the result into the result matrix.
-        ///
-        /// <param name="lower">The matrix to stack this matrix upon.</param>
-        /// <param name="result">The combined matrix.</param>
-        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
-        /// <exception cref="ArgumentException">If upper.Columns != lower.Columns.</exception>
-        public void Stack(Matrix<T> lower, Matrix<T> result)
-        {
-            if (lower == null)
-            {
-                throw new ArgumentNullException("lower");
-            }
-
-            if (lower.ColumnCount != ColumnCount)
-            {
-                throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, "lower");
-            }
-
-            if (result == null)
-            {
-                throw new ArgumentNullException("result");
-            }
-
-            if (result.RowCount != (RowCount + lower.RowCount) || result.ColumnCount != ColumnCount)
-            {
-                throw DimensionsDontMatch<ArgumentException>(this, result, "result");
-            }
-
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
-            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount);
-        }
-
-        ///
-        /// Diagonally stacks his matrix on top of the given matrix. The new matrix is a M-by-N matrix,
-        /// where M = this.Rows + lower.Rows and N = this.Columns + lower.Columns.
-        /// The values of off the off diagonal matrices/blocks are set to zero.
-        ///
-        /// <param name="lower">The lower, right matrix.</param>
-        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
-        /// <returns>the combined matrix</returns>
-        public Matrix<T> DiagonalStack(Matrix<T> lower)
-        {
-            if (lower == null)
-            {
-                throw new ArgumentNullException("lower");
-            }
-
-            var result = CreateMatrix(RowCount + lower.RowCount, ColumnCount + lower.ColumnCount, fullyMutable: true);
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
-            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount);
-            return result;
-        }
-
-        ///
-        /// Diagonally stacks his matrix on top of the given matrix and places the combined matrix into the result matrix.
-        ///
-        /// <param name="lower">The lower, right matrix.</param>
-        /// <param name="result">The combined matrix</param>
-        /// <exception cref="ArgumentNullException">If lower is <see langword="null" />.</exception>
-        /// <exception cref="ArgumentNullException">If the result matrix is <see langword="null" />.</exception>
-        /// <exception cref="ArgumentException">If the result matrix's dimensions are not (this.Rows + lower.rows) x (this.Columns + lower.Columns).</exception>
-        public void DiagonalStack(Matrix<T> lower, Matrix<T> result)
-        {
-            if (lower == null)
-            {
-                throw new ArgumentNullException("lower");
-            }
-
-            if (result == null)
-            {
-                throw new ArgumentNullException("result");
-            }
-
-            if (result.RowCount != RowCount + lower.RowCount || result.ColumnCount != ColumnCount + lower.ColumnCount)
-            {
-                throw DimensionsDontMatch<ArgumentException>(this, result, "result");
-            }
-
-            Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount);
-            lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount);
-        }
-
-        /// Calculates the L1 norm.
-        /// <returns>The L1 norm of the matrix.</returns>
-        public abstract T L1Norm();
-
-        /// Calculates the L2 norm.
-        /// <returns>The L2 norm of the matrix.</returns>
-        /// <remarks>For sparse matrices, the L2 norm is computed using a dense implementation of singular value decomposition.
-        /// In a later release, it will be replaced with a sparse implementation.</remarks>
-        public virtual T L2Norm()
-        {
-            return Svd<T>.Create(this, false).Norm2;
-        }
-
-        /// Calculates the Frobenius norm of this matrix.
-        /// <returns>The Frobenius norm of this matrix.</returns>
-        public abstract T FrobeniusNorm();
-
-        /// Calculates the infinity norm of this matrix.
-        /// <returns>The infinity norm of this matrix.</returns>
-        public abstract T InfinityNorm();
-
-        ///
-        /// Iterates throw each element in the matrix (row-wise).
-        ///
-        /// <returns>The value at the current iteration along with its position (row, column, value).</returns>
-        public virtual IEnumerable<Tuple<int, int, T>> IndexedEnumerator()
-        {
-            for (var row = 0; row < RowCount; row++)
-            {
-                for (var column = 0; column < ColumnCount; column++)
-                {
-                    yield return new Tuple<int, int, T>(row, column, At(row, column));
-                }
-            }
-        }
-
-        ///
-        /// Gets a value indicating whether this matrix is symmetric.
-        ///
-        public virtual bool IsSymmetric
-        {
-            get
-            {
-                if (RowCount != ColumnCount)
-                {
-                    return false;
-                }
-
-                for (var row = 0; row < RowCount; row++)
-                {
-                    for (var column = row + 1; column < ColumnCount; column++)
-                    {
-                        if (!At(row, column).Equals(At(column, row)))
-                        {
-                            return false;
-                        }
-                    }
-                }
-
-                return true;
-            }
-        }
     }
 }


Remove unused namespace imports.

Remove unused namespace imports.

--- RenderEngine.Utils.cs
+++ RenderEngine.Utils.cs
@@ -13,13 +13,12 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 **/
+
 using System;
 using System.Drawing;
 using ccl;
 using ccl.ShaderNodes;
-using Rhino;
 using Rhino.Render;
-using Rhino.Render.ChangeQueue;

 namespace RhinoCycles
 {


Updated test to check reeval works

Updated test to check reeval works

--- src/ReactGraph.Tests/ExpressionParserTest.cs
+++ src/ReactGraph.Tests/ExpressionParserTest.cs
@@ -1,4 +1,5 @@
-using Shouldly;
+using System.Linq;
+using Shouldly;
 using Xunit;

 namespace ReactGraph.Tests
@@ -11,7 +12,11 @@
             var graph = new DirectedGraph<NodeInfo>();
             var expressionParser = new ExpressionParser();

-            var basicType = new BasicType();
+            var basicType = new BasicType
+            {
+                Source1 = 1,
+                Source2 = 2
+            };
             expressionParser.AddToGraph(graph, () => basicType.Target, () => TargetFormula(basicType.Source1, basicType.Source2));

             graph.EdgesCount.ShouldBe(2);
@@ -19,6 +24,8 @@
             graph.Verticies.ShouldContain(v => v.Data.PropertyInfo.Name == "Target" && v.Data.Instance == basicType);
             graph.Verticies.ShouldContain(v => v.Data.PropertyInfo.Name == "Source1" && v.Data.Instance == basicType);
             graph.Verticies.ShouldContain(v => v.Data.PropertyInfo.Name == "Source2" && v.Data.Instance == basicType);
+            graph.Verticies.Single(v => v.Data.PropertyInfo.Name == "Target" && v.Data.Instance == basicType).Data.ReevalValue();
+            basicType.Target.ShouldBe("3");
         }

         private string TargetFormula(int source1, int source2)


New minor

New minor

--- src/RestSharp/Serializers/Json/SimpleJson.cs
+++ src/RestSharp/Serializers/Json/SimpleJson.cs
@@ -63,6 +63,7 @@
 // ReSharper disable ArrangeTypeMemberModifiers
 // ReSharper disable RemoveRedundantBraces
 // ReSharper disable BuiltInTypeReferenceStyle
+// ReSharper disable once CheckNamespace

 namespace RestSharp
 {


User RestSharp for GetActivityMeasures

User RestSharp for GetActivityMeasures

--- Withings.NET/Client/WithingsClient.cs
+++ Withings.NET/Client/WithingsClient.cs
@@ -1,22 +1,22 @@
-using System;
-using System.IO;
-using System.Net;
-using System.Text;
-using Material.Infrastructure.Credentials;
+using Material.Infrastructure.Credentials;
 using RestSharp;
 using RestSharp.Authenticators;
 using RestSharp.Authenticators.OAuth;
 using RestSharp.Extensions.MonoHttp;
+using System;
+using System.Text;

 namespace Withings.NET.Client
 {
     public class WithingsClient
     {
         internal RestClient Client;
-        private readonly OAuth1Credentials _credentials;
+        readonly OAuth1Credentials _credentials;
+        string baseUri = "http://wbsapi.withings.net/v2";
+
         public WithingsClient(OAuth1Credentials credentials)
         {
-            Client = new RestClient("http://wbsapi.withings.net/")
+            Client = new RestClient(baseUri)
             {
                 Authenticator = OAuth1Authenticator.ForProtectedResource
                 (
@@ -32,35 +32,61 @@

         public string GetActivityMeasures(string startDay, string endDay, string userId, string token, string secret)
         {
+            var request = new RestRequest("measures");
+            request.AddParameter("action", "getactivity");
+            request.AddParameter("userid", userId);
+            request.AddParameter("startdateymd", startDay);
+            request.AddParameter("enddateymd", endDay);
             var oAuth = new OAuthBase();

             var nonce = Convert.ToBase64String(new ASCIIEncoding().GetBytes(DateTime.Now.Ticks.ToString()));
             var timeStamp = oAuth.GenerateTimeStamp();
-            var uri = $"http://wbsapi.withings.net/v2/measure?action=getactivity&userid={userId}&startdateymd={startDay}&enddateymd={endDay}";
+            var uri = $"{baseUri}measure?action=getactivity&userid={userId}&startdateymd={startDay}&enddateymd={endDay}";
             string normalizedUrl;
             string parameters;
-            var signature = oAuth.GenerateSignature(new Uri(uri), _credentials.ConsumerKey, _credentials.ConsumerSecret,
-                token, secret, "GET", timeStamp, nonce,
-                OAuthBase.SignatureTypes.HMACSHA1, out normalizedUrl, out parameters);
+            var signature = oAuth.GenerateSignature
+                (
+                    new Uri(uri),
+                    _credentials.ConsumerKey,
+                  _credentials.ConsumerSecret,
+                   token,
+                   secret,
+                   "GET",
+                   timeStamp,
+                   nonce,
+                    OAuthBase.SignatureTypes.HMACSHA1,
+                    out normalizedUrl,
+                    out parameters
+                );

             signature = HttpUtility.UrlEncode(signature);

-            var requestUri = new StringBuilder(uri);
-            requestUri.AppendFormat("&oauth_consumer_key={0}&", _credentials.ConsumerKey);
-            requestUri.AppendFormat("oauth_nonce={0}&", nonce);
-            requestUri.AppendFormat("oauth_signature={0}&", signature);
-            requestUri.AppendFormat("oauth_signature_method={0}&", "HMAC-SHA1");
-            requestUri.AppendFormat("oauth_timestamp={0}&", timeStamp);
-            requestUri.AppendFormat("oauth_token={0}&", token);
-            requestUri.AppendFormat("oauth_version={0}", "1.0");
+            request.AddParameter("oauth_consumer_key", _credentials.ConsumerKey);
+            request.AddParameter("oauth_nonce", nonce);
+            request.AddParameter("oauth_signature", signature);
+            request.AddParameter("oauth_signature_method", "HMAC-SHA1");
+            request.AddParameter("oauth_timestamp", timeStamp);
+            request.AddParameter("oauth_token", token);
+            request.AddParameter("oauth_version", "1.0");

-            var wrGeturl = WebRequest.Create(requestUri.ToString());
-            var objStream = wrGeturl.GetResponse().GetResponseStream();
-            const string sLine = "";
+            var response = Client.Execute(request);
+            return response.Content;
+            //var requestUri = new StringBuilder(uri);
+            //requestUri.AppendFormat("&oauth_consumer_key={0}&", _credentials.ConsumerKey);
+            //requestUri.AppendFormat("oauth_nonce={0}&", nonce);
+            //requestUri.AppendFormat("oauth_signature={0}&", signature);
+            //requestUri.AppendFormat("oauth_signature_method={0}&", "HMAC-SHA1");
+            //requestUri.AppendFormat("oauth_timestamp={0}&", timeStamp);
+            //requestUri.AppendFormat("oauth_token={0}&", token);
+            //requestUri.AppendFormat("oauth_version={0}", "1.0");

-            if (objStream == null) return sLine;
-            var objReader = new StreamReader(objStream);
-            return objReader.ReadLine();
+            //var wrGeturl = WebRequest.Create(requestUri.ToString());
+            //var objStream = wrGeturl.GetResponse().GetResponseStream();
+            //const string sLine = "";
+
+            //if (objStream == null) return sLine;
+            //var objReader = new StreamReader(objStream);
+            //return objReader.ReadLine();
         }
     }
 }


Document PoEItemFrameType

Document PoEItemFrameType

--- Yeena/PathOfExile/PoEItemFrameType.cs
+++ Yeena/PathOfExile/PoEItemFrameType.cs
@@ -13,6 +13,9 @@
 // limitations under the License.

 namespace Yeena.PathOfExile {
+    /// <summary>
+    /// Represents an item's rarity.
+    /// </summary>
     enum PoEItemFrameType {
         Normal = 0,
         Magic = 1,


Add copyright information

Add copyright information

--- ZPLUtility/Properties/AssemblyInfo.cs
+++ ZPLUtility/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Binary Kits Pte. Ltd.")]
 [assembly: AssemblyProduct("ZPLUtility")]
-[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyCopyright("BinaryKits Pte. Ltd.  2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


ParseProcesses done

ParseProcesses done

--- src/SME.AST/ParseProcesses/ParseProcesses.cs
+++ src/SME.AST/ParseProcesses/ParseProcesses.cs
@@ -101,8 +101,11 @@
                     {
                         var elt = (ft as IArrayTypeSymbol).ElementType.ContainingType;
                         if (elt.IsGenericType)
+						{
 							// https://stackoverflow.com/questions/43356807/how-to-create-a-roslyn-itypesymbol-for-an-arbitrary-type
-                            return Mono.Cecil.Rocks.TypeReferenceRocks.MakeArrayType(this.GenericTypes[elt.Name]);
+							// TODO ok jeg ved ikke om compilation tillader det?
+							return (INamedTypeSymbol)compilation.CreateArrayTypeSymbol(GenericTypes[elt.Name]);
+						}
                     }
                     else if (ft.IsGenericType)
                     {


Adding String.IsGuid() extension method.

--- src/StevenVolckaert.Core/StringExtensions.cs
+++ src/StevenVolckaert.Core/StringExtensions.cs
@@ -125,6 +125,32 @@
         }

         /// <summary>
+        ///     Returns a value that indicates whether the string represents a <see cref="Guid"/> value.
+        /// </summary>
+        /// <param name="value">The <see cref="string"/> value this extension method affects.</param>
+        /// <returns>
+        ///     <c>true</c> if <paramref name="value"/> represents a <see cref="Guid"/> value;
+        ///     otherwise, <c>false</c>.
+        /// </returns>
+        public static bool IsGuid(this string value)
+        {
+#if NET35
+            try
+            {
+                var guid = new Guid(value);
+                return true;
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+#else
+            Guid guid;
+            return Guid.TryParse(value, out guid);
+#endif
+        }
+
+        /// <summary>
         ///     Returns a value that indicates whether the string represents a 32-bit signed integer.
         /// </summary>
         /// <param name="value">The <see cref="string"/> value this extension method affects.</param>


fixed a bug in DefaultObjectPipe

fixed a bug in DefaultObjectPipe

--- src/SuperSocket.Channel/DefaultObjectPipe.cs
+++ src/SuperSocket.Channel/DefaultObjectPipe.cs
@@ -73,8 +73,8 @@
             {
                 if (_waiting)
                 {
-                    _taskSourceCore.SetResult(target);
-                    _waiting = false;
+                    _waiting = false;
+                    _taskSourceCore.SetResult(target);
                     return _length;
                 }

@@ -140,7 +140,7 @@
                         _lastReadIsWait = false;
                     }

-                    _length--;
+                    _length--;
                     return new ValueTask<T>(value);
                 }


Cache key name is unique PER type.

Cache key name is unique PER type.

--- yafsrc/YAF.Core/Cache/HttpRuntimeCache.cs
+++ yafsrc/YAF.Core/Cache/HttpRuntimeCache.cs
@@ -57,6 +57,11 @@
     /// </summary>
     private readonly ITreatCacheKey _treatCacheKey;

+    /// <summary>
+    /// The _type name.
+    /// </summary>
+    private readonly string _typeName = string.Empty;
+
     #endregion

     #region Constructors and Destructors
@@ -84,6 +89,7 @@
       this._eventRaiser = eventRaiser;
       this._haveLockObject = haveLockObject;
       this._treatCacheKey = treatCacheKey;
+      this._typeName = typeof(T).ToString();
     }

     #endregion
@@ -330,7 +336,7 @@
     /// </returns>
     private string CreateKey([NotNull] string key)
     {
-      return this._treatCacheKey.Treat(key);
+      return this._treatCacheKey.Treat(this._typeName + key);
     }

     /// <summary>


Fix for History<Tick>

Fix for History<Tick>

--- Common/Data/Slice.cs
+++ Common/Data/Slice.cs
@@ -27,7 +27,7 @@
     /// </summary>
     public class Slice : IEnumerable<KeyValuePair<Symbol, BaseData>>
     {
-        private readonly Ticks _ticks;
+        private readonly Ticks _ticks;
         private readonly TradeBars _bars;

         // aux data
@@ -207,10 +207,18 @@
             Lazy<object> dictionary;
             if (!_dataByType.TryGetValue(typeof(T), out dictionary))
             {
-                dictionary = new Lazy<object>(() => new DataDictionary<T>(_data.Value.Values.Select(x => x.GetData()).OfType<T>(), x => x.Symbol));
-                _dataByType[typeof (T)] = dictionary;
-            }
-            return (DataDictionary<T>) dictionary.Value;
+                if (typeof(T) == typeof(Tick))
+                {
+                    dictionary = new Lazy<object>(() => new DataDictionary<T>(_data.Value.Values.SelectMany<dynamic, dynamic>(x => x.GetData()).OfType<T>(), x => x.Symbol));
+                }
+                else
+                {
+                    dictionary = new Lazy<object>(() => new DataDictionary<T>(_data.Value.Values.Select(x => x.GetData()).OfType<T>(), x => x.Symbol));
+                }
+
+                _dataByType[typeof(T)] = dictionary;
+            }
+            return (DataDictionary<T>)dictionary.Value;
         }

         /// <summary>
@@ -277,12 +285,12 @@

                     case MarketDataType.TradeBar:
                         symbolData.Type = SubscriptionType.TradeBar;
-                        symbolData.TradeBar = (TradeBar) datum;
+                        symbolData.TradeBar = (TradeBar)datum;
                         break;

                     case MarketDataType.Tick:
                         symbolData.Type = SubscriptionType.Tick;
-                        symbolData.Ticks.Add((Tick) datum);
+                        symbolData.Ticks.Add((Tick)datum);
                         break;

                     case MarketDataType.Auxiliary:
@@ -322,7 +330,7 @@
             where TItem : BaseData
         {
             if (collection != null) return collection;
-            collection = new T();
+            collection = new T();
 #pragma warning disable 618 // This assignment is left here until the Time property is removed.
             collection.Time = Time;
 #pragma warning restore 618


Adds encoding to GetString extension method

--- Common/Extensions.cs
+++ Common/Extensions.cs
@@ -81,12 +81,13 @@
         /// Extension method to convert a byte array into a string.
         /// </summary>
         /// <param name="bytes">Byte array to convert.</param>
+        /// <param name="encoding">The encoding to use for the conversion. Defaults to Encoding.ASCII</param>
         /// <returns>String from bytes.</returns>
-        public static string GetString(this byte[] bytes)
-        {
-            var chars = new char[bytes.Length / sizeof(char)];
-            Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
-            return new string(chars);
+        public static string GetString(this byte[] bytes, Encoding encoding = null)
+        {
+            if (encoding == null) encoding = Encoding.ASCII;
+
+            return encoding.GetString(bytes);
         }

         /// <summary>


projectiles now destroy themselves after a 5 second delay


Hotfix: Fixed a stat bug for powerups

Hotfix: Fixed a stat bug for powerups

--- Assets/Scripts/controller.cs
+++ Assets/Scripts/controller.cs
@@ -91,6 +91,10 @@
 				stats.score += scoreValue;
 			} else if (player_y < enemy_y && stats.invincible == false) {
 				stats.lives--;
+
+				if (stats.powerups != EnumPowerup.NONE)
+					PowerupFactory.INSTANCE.CallPowerup (stats.powerups).OnTimeout (gameObject);
+
 				stats.powerups = EnumPowerup.SHEILD;
 				IPowerup thePowerup = PowerupFactory.INSTANCE.CallPowerup (EnumPowerup.SHEILD);


Implements FourHitted

Implements FourHitted


Delete cache file if it is over 2 times the maximum size

--- BlobCache/BlobCache/Cache.cs
+++ BlobCache/BlobCache/Cache.cs
@@ -4,6 +4,7 @@
     using System.Collections.Generic;
     using System.IO;
     using System.Linq;
+    using System.Security;
     using System.Text;
     using System.Threading.Tasks;
     using CityHash;
@@ -138,7 +139,7 @@
                 // Cut excess space at the storage end
                 await Storage.CutBackPadding();

-                if (MaximumSize == 0)
+                if (MaximumSize <= 0)
                     return;

                 // Check storage size is over maximum
@@ -259,6 +260,16 @@

         public async Task<bool> Initialize()
         {
+            // If storage size exceeds two times the maximum size try to delete the cache and start over
+            if (MaximumSize > 0 && Storage.Info.Exists && Storage.Info.Length > MaximumSize * 2)
+                try
+                {
+                    Storage.Info.Delete();
+                }
+                catch (IOException) { }
+                catch (SecurityException) { }
+                catch (UnauthorizedAccessException) { }
+
             var res = await Storage.Initialize<SessionConcurrencyHandler>();

             if (res && (CleanupNeeded || Storage.FreshlyInitialized))


Reorganize code

Reorganize code

Move methods to top of file

--- CSGL.Vulkan/CommandBuffer.cs
+++ CSGL.Vulkan/CommandBuffer.cs
@@ -148,6 +148,20 @@

         public void NextSubpass(VkSubpassContents contents) {
             Device.Commands.cmdNextSubpass(commandBuffer, contents);
+        }
+
+        public void EndRenderPass() {
+            Device.Commands.cmdEndRenderPass(commandBuffer);
+        }
+
+        public void End() {
+            var result = Device.Commands.endCommandBuffer(commandBuffer);
+            if (result != VkResult.Success) throw new CommandBufferException(result, string.Format("Error ending command buffer: {0}", result));
+        }
+
+        public void Reset(VkCommandBufferResetFlags flags) {
+            var result = Device.Commands.resetCommandBuffers(commandBuffer, flags);
+            if (result != VkResult.Success) throw new CommandBufferException(result, string.Format("Error resetting command buffer: {0}"));
         }

         public void BindPipeline(VkPipelineBindPoint bindPoint, Pipeline pipeline) {
@@ -645,20 +659,6 @@
         public void DispatchIndirect(Buffer buffer, ulong offset) {
             Device.Commands.cmdDispatchIndirect(commandBuffer, buffer.Native, offset);
         }
-
-        public void EndRenderPass() {
-            Device.Commands.cmdEndRenderPass(commandBuffer);
-        }
-
-        public void End() {
-            var result = Device.Commands.endCommandBuffer(commandBuffer);
-            if (result != VkResult.Success) throw new CommandBufferException(result, string.Format("Error ending command buffer: {0}", result));
-        }
-
-        public void Reset(VkCommandBufferResetFlags flags) {
-            var result = Device.Commands.resetCommandBuffers(commandBuffer, flags);
-            if (result != VkResult.Success) throw new CommandBufferException(result, string.Format("Error resetting command buffer: {0}"));
-        }
     }

     public class CommandBufferException : VulkanException {


Add PipelineCacheCreateInfo

Add PipelineCacheCreateInfo

--- CSGL.Vulkan/PipelineCache.cs
+++ CSGL.Vulkan/PipelineCache.cs
@@ -1,7 +1,12 @@
 using System;
+using System.Collections.Generic;
 using System.Runtime.InteropServices;

 namespace CSGL.Vulkan {
+    public class PipelineCacheCreateInfo {
+        public IList<byte> initialData;
+    }
+
     public class PipelineCache : INative<VkPipelineCache>, IDisposable {
         bool disposed;
         VkPipelineCache pipelineCache;
@@ -13,18 +18,18 @@
             }
         }

-        public PipelineCache(Device device, byte[] initialData) {
+        public PipelineCache(Device device, PipelineCacheCreateInfo info) {
             Device = device;

-            CreateCache(initialData);
+            CreateCache(info);
         }

-        void CreateCache(byte[] initialData) {
+        void CreateCache(PipelineCacheCreateInfo mInfo) {
             var info = new VkPipelineCacheCreateInfo();
             info.sType = VkStructureType.PipelineCacheCreateInfo;
-            info.initialDataSize = (IntPtr)initialData.Length;
+            info.initialDataSize = (IntPtr)mInfo.initialData.Count;

-            var initialDataMarshalled = new PinnedArray<byte>(initialData);
+            var initialDataMarshalled = new NativeArray<byte>(mInfo.initialData);
             info.pInitialData = initialDataMarshalled.Address;

             using (initialDataMarshalled) {
@@ -45,12 +50,12 @@
             return result;
         }

-        public void Merge(PipelineCache[] srcCaches) {
+        public void Merge(IList<PipelineCache> srcCaches) {
             unsafe {
-                VkPipelineCache* srcNative = stackalloc VkPipelineCache[srcCaches.Length];
+                VkPipelineCache* srcNative = stackalloc VkPipelineCache[srcCaches.Count];
                 Interop.Marshal<VkPipelineCache, PipelineCache>(srcCaches, srcNative);

-                Device.Commands.mergePipelineCache(Device.Native, pipelineCache, (uint)srcCaches.Length, (IntPtr)srcNative);
+                Device.Commands.mergePipelineCache(Device.Native, pipelineCache, (uint)srcCaches.Count, (IntPtr)srcNative);
             }
         }


Fix ci marker for long form: ci.BuildIndex.BranchName instead of ci-BuildIndex.BranchName.

--- CSemVer/CIBuildDescriptor.cs
+++ CSemVer/CIBuildDescriptor.cs
@@ -64,7 +64,7 @@
         /// <returns></returns>
         public override string ToString()
         {
-            return IsValid ? string.Format( "ci-{0}.{1}", BuildIndex, BranchName ) : string.Empty;
+            return IsValid ? string.Format( "ci.{0}.{1}", BuildIndex, BranchName ) : string.Empty;
         }

         /// <summary>


fix StackOverflowException introduced in b4fb9f6

Because the arrays weren't cast to IList<string>, the call to the
MediaTypeMap#Add method resulted in an infinite recursion.

--- Core/MediaTypeMap.cs
+++ Core/MediaTypeMap.cs
@@ -161,7 +161,7 @@
             return this.Add(
                 mediaType:  mediaType,
                 handler:    MediaTypeMap.DefaultMediaTypeHandler,
-                extensions: extensions
+                extensions: (IList<string>)extensions
                 );
         }
         /// <summary>
@@ -225,7 +225,7 @@
             return this.Add(
                 mediaType:  mediaType,
                 handler:    handler,
-                extensions: extensions
+                extensions: (IList<string>)extensions
                 );
         }
         /// <summary>


Dropping out commented dead-code from CallTrees.

--- CoreVis/CallTrees.cs
+++ CoreVis/CallTrees.cs
@@ -193,7 +193,6 @@

 			using(var session = m_mainWindow.OpenActiveSnapshot())
 			{
-				//var data = m_connection.DataEngine.RawQuery(kTopLevelQuery);
 				var query = session.CreateQuery(kQuery);
 				query.SetInt32("parentId", 0);
 				var threads = query.List<Call>();
@@ -237,7 +236,6 @@
 				using(var session = m_mainWindow.OpenActiveSnapshot())
 				{
 					var parent = (NodeData) node.Tag;
-					//var data = m_connection.DataEngine.RawQuery(string.Format(kChildQuery, parent.Id, parent.ThreadId));
 					var query = session.CreateQuery(kQuery);
 					query.SetInt32("parentId", parent.Id);
 					session.EnableFilter("Thread").SetParameter("threadId", parent.ThreadId);
@@ -250,8 +248,6 @@
 						totalTime += c.Time;
 					}

-					//find out what the current number of calls by the parent is
-					//var parentHits = Convert.ToInt32(m_connection.StorageEngine.QueryScalar(string.Format(kParentHits, parent.Id, parent.ThreadId)));
 					foreach(Call c in calls)
 					{
 						if(c.ChildId == 0)


Optimizations

Optimizations

--- Client/Base/MessageSystem.cs
+++ Client/Base/MessageSystem.cs
@@ -31,26 +31,26 @@
             }
             else
             {
-                TaskFactory.StartNew(() =>
-                {
-                    HandleMessage(msg);
-                    msg.Recycle();
-                });
+                TaskFactory.StartNew(()=> HandleMessage(msg));
             }
         }

         protected override void OnDisabled()
         {
             base.OnDisabled();
+
             //Clear the message queue on disabling
-            MessageHandler.IncomingMessages = new ConcurrentQueue<IServerMessageBase>();
+            if (ProcessMessagesInUnityThread)
+                MessageHandler.IncomingMessages = new ConcurrentQueue<IServerMessageBase>();
         }

         protected override void OnEnabled()
         {
             base.OnEnabled();
+
             //During the update we receive and handle all received messages
-            SetupRoutine(new RoutineDefinition(0, RoutineExecution.Update, ReadAndHandleAllReceivedMessages));
+            if (ProcessMessagesInUnityThread)
+                SetupRoutine(new RoutineDefinition(0, RoutineExecution.Update, ReadAndHandleAllReceivedMessages));
         }

         /// <summary>
@@ -58,13 +58,9 @@
         /// </summary>
         private void ReadAndHandleAllReceivedMessages()
         {
-            if (!ProcessMessagesInUnityThread)
-                return;
-
             while (MessageHandler.IncomingMessages.TryDequeue(out var msg))
             {
                 HandleMessage(msg);
-                msg.Recycle();
             }
         }

@@ -79,6 +75,10 @@
                 LunaLog.LogError($"[LMP]: Error handling Message type {msg.Data.GetType()}, exception: {e}");
                 NetworkConnection.Disconnect($"Error handling {msg.Data.GetType()} Message");
             }
+            finally
+            {
+                msg.Recycle();
+            }
         }
     }
 }


pixel perfect centering?

pixel perfect centering?

--- Colours/MainForm.Designer.cs
+++ Colours/MainForm.Designer.cs
@@ -35,9 +35,9 @@
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.copyHexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.copyCSSRGBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.copyCSSHSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.randomButton = new System.Windows.Forms.Button();
             this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
-            this.copyCSSHSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.contextMenuStrip1.SuspendLayout();
             this.SuspendLayout();
             //
@@ -54,7 +54,7 @@
             "Tetrads",
             "Analogous",
             "Monochromatic"});
-            this.comboBox1.Location = new System.Drawing.Point(12, 14);
+            this.comboBox1.Location = new System.Drawing.Point(12, 13);
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Size = new System.Drawing.Size(179, 21);
             this.comboBox1.TabIndex = 2;
@@ -89,7 +89,7 @@
             this.copyCSSRGBToolStripMenuItem,
             this.copyCSSHSLToolStripMenuItem});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(159, 92);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(159, 70);
             //
             // copyHexToolStripMenuItem
             //
@@ -105,6 +105,13 @@
             this.copyCSSRGBToolStripMenuItem.Text = "Copy &CSS (RGB)";
             this.copyCSSRGBToolStripMenuItem.Click += new System.EventHandler(this.copyCSSRGBToolStripMenuItem_Click);
             //
+            // copyCSSHSLToolStripMenuItem
+            //
+            this.copyCSSHSLToolStripMenuItem.Name = "copyCSSHSLToolStripMenuItem";
+            this.copyCSSHSLToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
+            this.copyCSSHSLToolStripMenuItem.Text = "Copy CSS (&HSL)";
+            this.copyCSSHSLToolStripMenuItem.Click += new System.EventHandler(this.copyCSSHSLToolStripMenuItem_Click);
+            //
             // randomButton
             //
             this.randomButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -115,13 +122,6 @@
             this.randomButton.Text = "Random";
             this.randomButton.UseVisualStyleBackColor = true;
             this.randomButton.Click += new System.EventHandler(this.randomButton_Click);
-            //
-            // copyCSSHSLToolStripMenuItem
-            //
-            this.copyCSSHSLToolStripMenuItem.Name = "copyCSSHSLToolStripMenuItem";
-            this.copyCSSHSLToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
-            this.copyCSSHSLToolStripMenuItem.Text = "Copy CSS (&HSL)";
-            this.copyCSSHSLToolStripMenuItem.Click += new System.EventHandler(this.copyCSSHSLToolStripMenuItem_Click);
             //
             // MainForm
             //


try to improve image tagging object boxes?

--- CompatBot/Commands/Vision.cs
+++ CompatBot/Commands/Vision.cs
@@ -73,31 +73,11 @@

         [Command("describe")]
         [Description("Generates an image description from the attached image, or from the url")]
-        public async Task Describe(CommandContext ctx, [RemainingText] string imageUrl = null)
-        {
-            try
-            {
-                if (imageUrl?.StartsWith("tag") ?? false)
-                {
-                    await Tag(ctx, imageUrl[3..].TrimStart()).ConfigureAwait(false);
-                    return;
-                }
-
-                imageUrl = await GetImageUrlAsync(ctx, imageUrl).ConfigureAwait(false);
-                if (string.IsNullOrEmpty(imageUrl))
-                    return;
-
-                var client = new ComputerVisionClient(new ApiKeyServiceClientCredentials(Config.AzureComputerVisionKey)) {Endpoint = Config.AzureComputerVisionEndpoint};
-                var result = await client.AnalyzeImageAsync(imageUrl, new List<VisualFeatureTypes> {VisualFeatureTypes.Description}, cancellationToken: Config.Cts.Token).ConfigureAwait(false);
-                var description = GetDescription(result.Description);
-                await ReactToTagsAsync(ctx.Message, result.Description.Tags).ConfigureAwait(false);
-                await ctx.RespondAsync(description).ConfigureAwait(false);
-            }
-            catch (Exception e)
-            {
-                Config.Log.Warn(e, "Failed to get image description");
-                await ctx.RespondAsync("Failed to generate image description, probably because image is too large (dimensions or file size)").ConfigureAwait(false);
-            }
+        public Task Describe(CommandContext ctx, [RemainingText] string imageUrl = null)
+        {
+            if (imageUrl?.StartsWith("tag") ?? false)
+                return Tag(ctx, imageUrl[3..].TrimStart());
+            return Tag(ctx, imageUrl);
         }

         [Command("tag")]
@@ -170,18 +150,20 @@
                 var scale = Math.Max(1.0f, img.Width / 400.0f);
                 if (objects.Count > 0)
                 {
-                    //List<Color> palette = new List<Color> { Color.DeepSkyBlue, Color.Magenta, Color.GreenYellow, };
-
                     var analyzer = new ColorThief();
-                    List<Color> palette;
-                    using (var tmpStream = Config.MemoryStreamManager.GetStream())
-                    {
-                        img.SaveAsBmp(tmpStream);
+                    List<Color> palette = new List<Color>(objects.Count);
+                    var dcc = 0;
+                    foreach (var obj in objects)
+                    {
+                        var r = obj.Rectangle;
+                        using var tmpStream = Config.MemoryStreamManager.GetStream();
+                        using var boxCopy = img.Clone(i => i.Crop(new Rectangle(r.X, r.Y, r.W, r.H)));
+                        await boxCopy.SaveAsBmpAsync(tmpStream).ConfigureAwait(false);
                         tmpStream.Seek(0, SeekOrigin.Begin);
-                        using (var b = new Bitmap(tmpStream))
-                            palette = analyzer.GetPalette(b, Math.Max(objects.Count, 5), ignoreWhite: false).Select(c => c.Color.ToStandardColor()).ToList();
-                    }
-                    palette.AddRange(DefaultColors);
+                        using var b = new Bitmap(tmpStream);
+                        var dominantColor = analyzer.GetColor(b, 1, false);
+                        palette.Add(dominantColor.Color.ToStandardColor());
+                    }
                     var complementaryPalette = palette.Select(c => c.GetComplementary()).ToList();
                     var tmpP = new List<Color>();
                     var tmpCp = new List<Color>();
@@ -291,9 +273,11 @@
                         if (bgBox.Y + bgBox.Height > img.Height)
                             bgBox.Y = img.Height - bgBox.Height;
                         drawnBoxes.Add(bgBox);
+                        var textboxColor = complementaryColor;
+                        var textColor = color;
                         try
                         {
-                            img.Mutate(i => i.Fill(bgSgo, complementaryColor, bgBox));
+                            img.Mutate(i => i.Fill(bgSgo, textboxColor, bgBox));
                             img.Mutate(i => i.GaussianBlur(10 * scale, Rectangle.Round(bgBox)));
                         }
                         catch (Exception ex)
@@ -304,7 +288,7 @@
                         // label text
                         try
                         {
-                            img.Mutate(i => i.DrawText(textGraphicsOptions, label, font, complementaryColor, new PointF(bgBox.X + bboxBorder, bgBox.Y + bboxBorder)));
+                            img.Mutate(i => i.DrawText(textGraphicsOptions, label, font, textColor, new PointF(bgBox.X + bboxBorder, bgBox.Y + bboxBorder)));
                             //img.Mutate(i => i.DrawText(textGraphicsOptions, $"{obj.ObjectProperty} ({obj.Confidence:P1})", font, brush, pen, new PointF(r.X + 5, r.Y + 5))); // throws exception
                         }
                         catch (Exception ex)


Waiting time changed to /100th original speed. Todo: Make a slider to change waiting time

--- CrossRoad/CrossRoad/Form1.cs
+++ CrossRoad/CrossRoad/Form1.cs
@@ -25,8 +25,8 @@
         private DateTime previousTimestamp;
         private bool firstRun = true;

-        private int maxGreenTime = 30000;
-        private int maxOrangeTime = 10000;
+        private int maxGreenTime = 3000;//30000
+        private int maxOrangeTime = 1000;//10000
         private int maxWaitingTime = 120000;
         private int lastIndex = 0;

@@ -82,7 +82,6 @@
                             r.status = Status.red;
                             r.changed = true;
                             r.milliSec = 0;
-                            safeToCross = false;
                         }
                     }
                     /*


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/HttpRequest.cs
+++ websocket-sharp/HttpRequest.cs
@@ -212,20 +212,24 @@

     public override string ToString ()
     {
-      var output = new StringBuilder (64);
-      output.AppendFormat ("{0} {1} HTTP/{2}{3}", _method, _uri, ProtocolVersion, CrLf);
+      var buff = new StringBuilder (64);
+
+      var fmt = "{0} {1} HTTP/{2}{3}";
+      buff.AppendFormat (fmt, _method, _uri, ProtocolVersion, CrLf);

       var headers = Headers;
+
       foreach (var key in headers.AllKeys)
-        output.AppendFormat ("{0}: {1}{2}", key, headers[key], CrLf);
-
-      output.Append (CrLf);
+        buff.AppendFormat ("{0}: {1}{2}", key, headers[key], CrLf);
+
+      buff.Append (CrLf);

       var entity = EntityBody;
+
       if (entity.Length > 0)
-        output.Append (entity);
-
-      return output.ToString ();
+        buff.Append (entity);
+
+      return buff.ToString ();
     }

     #endregion


Remove unused usings

Remove unused usings

--- src/Umbraco.Examine/ContentIndexPopulator.cs
+++ src/Umbraco.Examine/ContentIndexPopulator.cs
@@ -2,9 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using Examine;
-using Umbraco.Core;
 using Umbraco.Core.Models;
-using Umbraco.Core.Models.Blocks;
 using Umbraco.Core.Services;
 using Umbraco.Core.Persistence;
 using Umbraco.Core.Persistence.DatabaseModelDefinitions;
@@ -125,7 +123,7 @@
                 content = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out _, _publishedQuery,
                     Ordering.By("Path", Direction.Ascending)).ToArray();

-
+
                 if (content.Length > 0)
                 {
                     var indexableContent = new List<IContent>();


Fixed up the V2-interop source

Fixed up the V2-interop source

--- src/V3/NuGet.Client/Interop/PackageJsonLd.cs
+++ src/V3/NuGet.Client/Interop/PackageJsonLd.cs
@@ -38,12 +38,12 @@
             AddProp(value, Properties.Version, version.Version.ToString());
             AddProp(value, Properties.Summary, version.Summary);
             AddProp(value, Properties.Description, version.Description);
-            AddProp(value, Properties.Authors, version.Authors);
-            AddProp(value, Properties.Owners, version.Owners);
+            AddProp(value, Properties.Authors, String.Join(", ", version.Authors));
+            AddProp(value, Properties.Owners, String.Join(", ", version.Owners));
             AddProp(value, Properties.IconUrl, version.IconUrl);
             AddProp(value, Properties.LicenseUrl, version.LicenseUrl);
             AddProp(value, Properties.ProjectUrl, version.ProjectUrl);
-            AddProp(value, Properties.Tags, (version.Tags ?? String.Empty).Split(' '));
+            AddProp(value, Properties.Tags, version.Tags == null ? null : version.Tags.Split(' '));
             AddProp(value, Properties.DownloadCount, version.DownloadCount);
             AddProp(value, Properties.Published, version.Published.HasValue ? version.Published.Value.ToString("O", CultureInfo.InvariantCulture) : null);
             AddProp(value, Properties.RequireLicenseAcceptance, version.RequireLicenseAcceptance);


Cleanup code

Cleanup code

--- src/WebApiToTypeScript/Views/ViewsService.cs
+++ src/WebApiToTypeScript/Views/ViewsService.cs
@@ -53,11 +53,9 @@
             var viewsIgnoredExtensions = Config.ViewsIgnoredExtensions;
             var viewsSourceDirectory = Path.GetFullPath(sourceDirectory);

-            var viewFiles = Directory.GetFiles(viewsSourceDirectory, $"*{Config.ViewsPattern}*", SearchOption.AllDirectories);
-
-            viewFiles = viewFiles.Where(filename => {
-                return !viewsIgnoredExtensions.Any(ext => filename.EndsWith(ext));
-            }).ToArray();
+            var viewFiles = Directory.GetFiles(viewsSourceDirectory, $"*{Config.ViewsPattern}*", SearchOption.AllDirectories)
+                .Where(filename => !viewsIgnoredExtensions.Any(ext => filename.EndsWith(ext)))
+                .ToArray();

             foreach (var viewFile in viewFiles)
             {


Forgot to bump version in Shared Assembly Info

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -1,5 +1,5 @@
 using System.Reflection;

 [assembly: AssemblyCopyright("Copyright © Productive Rage 2018")]
-[assembly: AssemblyVersion("2.11.1.0")]
-[assembly: AssemblyFileVersion("2.11.1.0")]
+[assembly: AssemblyVersion("3.0.0.0")]
+[assembly: AssemblyFileVersion("3.0.0.0")]


assembly info

assembly info

--- SharedAssemblyInfo.cs
+++ SharedAssemblyInfo.cs
@@ -4,5 +4,5 @@
 [assembly: AssemblyCompany("Serenity")]
 [assembly: AssemblyProduct("Serenity Platform")]
 [assembly: AssemblyCopyright("Copyright © Volkan Ceylan")]
-[assembly: AssemblyVersion("1.8.6")]
-[assembly: AssemblyFileVersion("1.8.6")]
+[assembly: AssemblyVersion("1.8.7")]
+[assembly: AssemblyFileVersion("1.8.7")]


Removes .ForEach()

Removes .ForEach()

--- ShittyLINQ/ForEach.cs
+++ ShittyLINQ/ForEach.cs
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace ShittyLINQ
-{
-    public static partial class Extensions
-    {
-        /// <summary>
-        /// Iterate over your shit any perform an action.
-        /// </summary>
-        /// <typeparam name="T">The type of shit.</typeparam>
-        /// <param name="self">A whole bunch of your shit.</param>
-        /// <param name="verb">What to do with all of this shit.</param>
-        public static void ForEach<T>(this IEnumerable<T> self, Action<T> verb)
-        {
-            var iterator = self.GetEnumerator();
-            while (iterator.MoveNext())
-            {
-                verb(iterator.Current);
-            }
-        }
-    }
-}


Fixed an error which caused an empty message to be sent

--- SimpleMaid/Program.cs
+++ SimpleMaid/Program.cs
@@ -818,7 +818,7 @@

         sRemoteMessage = GetUntilGet("messages." + machine);

-        if (UserChatMessage != null)
+        if (!String.IsNullOrEmpty(UserChatMessage))
         {
           SetUntilSet("messages." + machine, ans + UserChatMessage);
           UserChatMessage = null;


Clarified openChatWindow inner workings

Clarified openChatWindow inner workings

--- SimpleMaid/Program.cs
+++ SimpleMaid/Program.cs
@@ -406,17 +406,18 @@

       ChatboxWindow = new frmChatWindow();
       ChatboxWindow.ShowDialog();
+
+      // ! code below only executes after ChatboxWindow is closed
+
       ChatboxExit = false;

       busyChatWise = false;

-      #region ChatWindow_Closed
       while (resources.WebErrorMessage == Set("commands." + machine, resources.AnswerPrefix +
         String.Format("{0},{1}", resources.MessageCommand, ChatboxWindow.Visible.ToString())))
       {
         Thread.Sleep(1000);
       }
-      #endregion
     }

     private static void closeChatWindow()


Making sure we can build with new version of Windsor

git-svn-id: 6eea8ec865c4fa60105bc56808c028bdcf72a817@1479 079b0acf-d9fa-0310-9935-e5ade295c882

--- rhino-testing/Rhino.Testing/AutoMocking/AutoMockingNamingSubSystem.cs
+++ rhino-testing/Rhino.Testing/AutoMocking/AutoMockingNamingSubSystem.cs
@@ -88,6 +88,11 @@
 				get { return model; }
 			}

+			public Type Service
+			{
+				get { return model.Service; }
+			}
+
 			public object Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)
 			{
 				throw new NotImplementedException();


Implemented * == != operators in Force.cs Implemented Equals and GetHashCode methods in Force.cs

--- Src/UnitsNet/Force.cs
+++ Src/UnitsNet/Force.cs
@@ -149,6 +149,11 @@
             return new Force(left*right.Newtons);
         }

+        public static Force operator *(Force left, double right)
+        {
+            return new Force(left.Newtons*right);
+        }
+
         public static Force operator /(Force left, double right)
         {
             return new Force(left.Newtons/right);
@@ -190,6 +195,31 @@
             return left.Newtons > right.Newtons;
         }

+        public static bool operator ==(Force left, Force right)
+        {
+            return left.Newtons == right.Newtons;
+        }
+
+        public static bool operator !=(Force left, Force right)
+        {
+            return left.Newtons != right.Newtons;
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (obj == null || GetType() != obj.GetType())
+            {
+                return false;
+            }
+
+            return Newtons.Equals(((Force) obj).Newtons);
+        }
+
+        public override int GetHashCode()
+        {
+            return Newtons.GetHashCode();
+        }
+
         #endregion

         public override string ToString()