delete unused code

delete unused code

--- src/Novell.Directory.Ldap.NETStandard/SupportClass.cs
+++ src/Novell.Directory.Ldap.NETStandard/SupportClass.cs
@@ -1261,463 +1261,6 @@
                 return tempCollectionSupport;
             }
         }
-
-        /*******************************/
-
-        /// <summary>
-        ///     This class contains different methods to manage list collections.
-        /// </summary>
-        public class ListCollectionSupport : ArrayList
-        {
-            /// <summary>
-            ///     Creates a new instance of the class ListCollectionSupport.
-            /// </summary>
-            public ListCollectionSupport()
-            {
-            }
-
-            /// <summary>
-            ///     Creates a new instance of the class ListCollectionSupport.
-            /// </summary>
-            /// <param name="collection">The collection to insert into the new object.</param>
-            public ListCollectionSupport(ICollection collection)
-                : base(collection)
-            {
-            }
-
-            /// <summary>
-            ///     Creates a new instance of the class ListCollectionSupport with the specified capacity.
-            /// </summary>
-            /// <param name="capacity">The capacity of the new array.</param>
-            public ListCollectionSupport(int capacity)
-                : base(capacity)
-            {
-            }
-
-            /// <summary>
-            ///     Adds an object to the end of the List.
-            /// </summary>
-            /// <param name="valueToInsert">The value to insert in the array list.</param>
-            /// <returns>Returns true after adding the value.</returns>
-            public virtual bool Add(object valueToInsert)
-            {
-                Insert(Count, valueToInsert);
-                return true;
-            }
-
-            /// <summary>
-            ///     Adds all the elements contained into the specified collection, starting at the specified position.
-            /// </summary>
-            /// <param name="index">Position at which to add the first element from the specified collection.</param>
-            /// <param name="list">The list used to extract the elements that will be added.</param>
-            /// <returns>Returns true if all the elements were successfuly added. Otherwise returns false.</returns>
-            public virtual bool AddAll(int index, IList list)
-            {
-                var result = false;
-                if (list != null)
-                {
-                    var tempEnumerator = new ArrayList(list).GetEnumerator();
-                    var tempIndex = index;
-                    while (tempEnumerator.MoveNext())
-                    {
-                        Insert(tempIndex++, tempEnumerator.Current);
-                        result = true;
-                    }
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Adds all the elements contained in the specified collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be added.</param>
-            /// <returns>Returns true if all the elements were successfuly added. Otherwise returns false.</returns>
-            public virtual bool AddAll(IList collection)
-            {
-                return AddAll(Count, collection);
-            }
-
-            /// <summary>
-            ///     Adds all the elements contained in the specified support class collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be added.</param>
-            /// <returns>Returns true if all the elements were successfuly added. Otherwise returns false.</returns>
-            public virtual bool AddAll(CollectionSupport collection)
-            {
-                return AddAll(Count, collection);
-            }
-
-            /// <summary>
-            ///     Adds all the elements contained into the specified support class collection, starting at the specified position.
-            /// </summary>
-            /// <param name="index">Position at which to add the first element from the specified collection.</param>
-            /// <param name="list">The list used to extract the elements that will be added.</param>
-            /// <returns>Returns true if all the elements were successfuly added. Otherwise returns false.</returns>
-            public virtual bool AddAll(int index, CollectionSupport collection)
-            {
-                return AddAll(index, (IList)collection);
-            }
-
-            /// <summary>
-            ///     Creates a copy of the ListCollectionSupport.
-            /// </summary>
-            /// <returns> A copy of the ListCollectionSupport.</returns>
-            public virtual object ListCollectionClone()
-            {
-                return MemberwiseClone();
-            }
-
-            /// <summary>
-            ///     Returns an iterator of the collection.
-            /// </summary>
-            /// <returns>An IEnumerator.</returns>
-            public virtual IEnumerator ListIterator()
-            {
-                return GetEnumerator();
-            }
-
-            /// <summary>
-            ///     Removes all the elements contained into the specified collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be removed.</param>
-            /// <returns>Returns true if all the elements were successfuly removed. Otherwise returns false.</returns>
-            public virtual bool RemoveAll(ICollection collection)
-            {
-                var result = false;
-                var tempEnumerator = new ArrayList(collection).GetEnumerator();
-                while (tempEnumerator.MoveNext())
-                {
-                    result = true;
-                    if (Contains(tempEnumerator.Current))
-                    {
-                        Remove(tempEnumerator.Current);
-                    }
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Removes all the elements contained into the specified collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be removed.</param>
-            /// <returns>Returns true if all the elements were successfuly removed. Otherwise returns false.</returns>
-            public virtual bool RemoveAll(CollectionSupport collection)
-            {
-                return RemoveAll((ICollection)collection);
-            }
-
-            /// <summary>
-            ///     Removes the value in the specified index from the list.
-            /// </summary>
-            /// <param name="index">The index of the value to remove.</param>
-            /// <returns>Returns the value removed.</returns>
-            public virtual object RemoveElement(int index)
-            {
-                var objectRemoved = this[index];
-                RemoveAt(index);
-                return objectRemoved;
-            }
-
-            /// <summary>
-            ///     Removes an specified element from the collection.
-            /// </summary>
-            /// <param name="element">The element to be removed.</param>
-            /// <returns>Returns true if the element was successfuly removed. Otherwise returns false.</returns>
-            public virtual bool RemoveElement(object element)
-            {
-                var result = false;
-                if (Contains(element))
-                {
-                    Remove(element);
-                    result = true;
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Removes the first value from an array list.
-            /// </summary>
-            /// <returns>Returns the value removed.</returns>
-            public virtual object RemoveFirst()
-            {
-                var objectRemoved = this[0];
-                RemoveAt(0);
-                return objectRemoved;
-            }
-
-            /// <summary>
-            ///     Removes the last value from an array list.
-            /// </summary>
-            /// <returns>Returns the value removed.</returns>
-            public virtual object RemoveLast()
-            {
-                var objectRemoved = this[Count - 1];
-                RemoveAt(Count - 1);
-                return objectRemoved;
-            }
-
-            /// <summary>
-            ///     Removes all the elements that aren't contained into the specified collection.
-            /// </summary>
-            /// <param name="collection">The collection used to verify the elements that will be retained.</param>
-            /// <returns>Returns true if all the elements were successfully removed. Otherwise returns false.</returns>
-            public virtual bool RetainAll(ICollection collection)
-            {
-                var result = false;
-                var tempEnumerator = GetEnumerator();
-                var tempCollection = new ListCollectionSupport(collection);
-                while (tempEnumerator.MoveNext())
-                {
-                    if (!tempCollection.Contains(tempEnumerator.Current))
-                    {
-                        result = RemoveElement(tempEnumerator.Current);
-
-                        if (result)
-                        {
-                            tempEnumerator = GetEnumerator();
-                        }
-                    }
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Removes all the elements that aren't contained into the specified collection.
-            /// </summary>
-            /// <param name="collection">The collection used to verify the elements that will be retained.</param>
-            /// <returns>Returns true if all the elements were successfully removed. Otherwise returns false.</returns>
-            public virtual bool RetainAll(CollectionSupport collection)
-            {
-                return RetainAll((ICollection)collection);
-            }
-
-            /// <summary>
-            ///     Verifies if all the elements of the specified collection are contained into the current collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be verified.</param>
-            /// <returns>Returns true if all the elements are contained in the collection. Otherwise returns false.</returns>
-            public virtual bool ContainsAll(ICollection collection)
-            {
-                var result = false;
-                var tempEnumerator = new ArrayList(collection).GetEnumerator();
-                while (tempEnumerator.MoveNext())
-                {
-                    if (!(result = Contains(tempEnumerator.Current)))
-                    {
-                        break;
-                    }
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Verifies if all the elements of the specified collection are contained into the current collection.
-            /// </summary>
-            /// <param name="collection">The collection used to extract the elements that will be verified.</param>
-            /// <returns>Returns true if all the elements are contained in the collection. Otherwise returns false.</returns>
-            public virtual bool ContainsAll(CollectionSupport collection)
-            {
-                return ContainsAll((ICollection)collection);
-            }
-
-            /// <summary>
-            ///     Returns a new list containing a portion of the current list between a specified range.
-            /// </summary>
-            /// <param name="startIndex">The start index of the range.</param>
-            /// <param name="endIndex">The end index of the range.</param>
-            /// <returns>A ListCollectionSupport instance containing the specified elements.</returns>
-            public virtual ListCollectionSupport SubList(int startIndex, int endIndex)
-            {
-                var index = 0;
-                var tempEnumerator = GetEnumerator();
-                var result = new ListCollectionSupport();
-                for (index = startIndex; index < endIndex; index++)
-                {
-                    result.Add(this[index]);
-                }
-
-                return result;
-            }
-
-            /// <summary>
-            ///     Obtains an array containing all the elements of the collection.
-            /// </summary>
-            /// <param name="objects">The array into which the elements of the collection will be stored.</param>
-            /// <returns>The array containing all the elements of the collection.</returns>
-            public virtual object[] ToArray(object[] objects)
-            {
-                if (objects.Length < Count)
-                {
-                    objects = new object[Count];
-                }
-
-                var index = 0;
-                var tempEnumerator = GetEnumerator();
-                while (tempEnumerator.MoveNext())
-                {
-                    objects[index++] = tempEnumerator.Current;
-                }
-
-                return objects;
-            }
-
-            /// <summary>
-            ///     Returns an iterator of the collection starting at the specified position.
-            /// </summary>
-            /// <param name="index">The position to set the iterator.</param>
-            /// <returns>An IEnumerator at the specified position.</returns>
-            public virtual IEnumerator ListIterator(int index)
-            {
-                if (index < 0 || index > Count)
-                {
-                    throw new IndexOutOfRangeException();
-                }
-
-                var tempEnumerator = GetEnumerator();
-                if (index > 0)
-                {
-                    var i = 0;
-                    while (tempEnumerator.MoveNext() && i < index - 1)
-                    {
-                        i++;
-                    }
-                }
-
-                return tempEnumerator;
-            }
-
-            /// <summary>
-            ///     Gets the last value from a list.
-            /// </summary>
-            /// <returns>Returns the last element of the list.</returns>
-            public virtual object GetLast()
-            {
-                if (Count == 0)
-                {
-                    throw new ArgumentOutOfRangeException();
-                }
-
-                return this[Count - 1];
-            }
-
-            /// <summary>
-            ///     Return whether this list is empty.
-            /// </summary>
-            /// <returns>True if the list is empty, false if it isn't.</returns>
-            public virtual bool IsEmpty()
-            {
-                return Count == 0;
-            }
-
-            /// <summary>
-            ///     Replaces the element at the specified position in this list with the specified element.
-            /// </summary>
-            /// <param name="index">Index of element to replace.</param>
-            /// <param name="element">Element to be stored at the specified position.</param>
-            /// <returns>The element previously at the specified position.</returns>
-            public virtual object Set(int index, object element)
-            {
-                var result = this[index];
-                this[index] = element;
-                return result;
-            }
-
-            /// <summary>
-            ///     Returns the element at the specified position in the list.
-            /// </summary>
-            /// <param name="index">Index of element to return.</param>
-            /// <param name="element">Element to be stored at the specified position.</param>
-            /// <returns>The element at the specified position in the list.</returns>
-            public virtual object Get(int index)
-            {
-                return this[index];
-            }
-        }
-
-        /*******************************/
-
-        /// <summary>
-        ///     This class manages array operations.
-        /// </summary>
-        public class ArraysSupport
-        {
-            /// <summary>
-            ///     Compares the entire members of one array whith the other one.
-            /// </summary>
-            /// <param name="array1">The array to be compared.</param>
-            /// <param name="array2">The array to be compared with.</param>
-            /// <returns>True if both arrays are equals otherwise it returns false.</returns>
-            /// <remarks>Two arrays are equal if they contains the same elements in the same order.</remarks>
-            public static bool IsArrayEqual(Array array1, Array array2)
-            {
-                if (array1.Length != array2.Length)
-                {
-                    return false;
-                }
-
-                for (var i = 0; i < array1.Length; i++)
-                {
-                    if (!array1.GetValue(i).Equals(array2.GetValue(i)))
-                    {
-                        return false;
-                    }
-                }
-
-                return true;
-            }
-
-            /// <summary>
-            ///     Fills the array with an specific value from an specific index to an specific index.
-            /// </summary>
-            /// <param name="array">The array to be filled.</param>
-            /// <param name="fromindex">The first index to be filled.</param>
-            /// <param name="toindex">The last index to be filled.</param>
-            /// <param name="val">The value to fill the array with.</param>
-            public static void FillArray(Array array, int fromindex, int toindex, object val)
-            {
-                var tempObject = val;
-                var elementtype = array.GetType().GetElementType();
-                if (elementtype != val.GetType())
-                {
-                    tempObject = Convert.ChangeType(val, elementtype);
-                }
-
-                if (array.Length == 0)
-                {
-                    throw new NullReferenceException();
-                }
-
-                if (fromindex > toindex)
-                {
-                    throw new ArgumentException();
-                }
-
-                if (fromindex < 0 || array.Length < toindex)
-                {
-                    throw new IndexOutOfRangeException();
-                }
-
-                for (var index = fromindex > 0 ? fromindex-- : fromindex; index < toindex; index++)
-                {
-                    array.SetValue(tempObject, index);
-                }
-            }
-
-            /// <summary>
-            ///     Fills the array with an specific value.
-            /// </summary>
-            /// <param name="array">The array to be filled.</param>
-            /// <param name="val">The value to fill the array with.</param>
-            public static void FillArray(Array array, object val)
-            {
-                FillArray(array, 0, array.Length, val);
-            }
-        }

         /*******************************/

@@ -1963,152 +1506,5 @@
         public class AbstractSetSupport : SetSupport
         {
         }
-
-        /*******************************/
-
-        /// <summary>
-        ///     Encapsulates the functionality of message digest algorithms such as SHA-1 or MD5.
-        /// </summary>
-        public class MessageDigestSupport
-        {
-            private int _position;
-
-            /// <summary>
-            ///     The HashAlgorithm instance that provide the cryptographic hash algorithm.
-            /// </summary>
-            public HashAlgorithm Algorithm { get; set; }
-
-            /// <summary>
-            ///     The digest data.
-            /// </summary>
-            public byte[] Data { get; set; }
-
-            /// <summary>
-            ///     The name of the cryptographic hash algorithm used in the instance.
-            /// </summary>
-            public string AlgorithmName { get; }
-
-            /// <summary>
-            ///     Computes the hash value for the internal data digest.
-            /// </summary>
-            /// <returns>The array of signed bytes with the resulting hash value.</returns>
-            public byte[] DigestData()
-            {
-                var result = Algorithm.ComputeHash(Data);
-                Reset();
-                return result;
-            }
-
-            /// <summary>
-            ///     Performs and update on the digest with the specified array and then completes the digest
-            ///     computation.
-            /// </summary>
-            /// <param name="newData">The array of bytes for final update to the digest.</param>
-            /// <returns>An array of signed bytes with the resulting hash value.</returns>
-            public byte[] DigestData(byte[] newData)
-            {
-                Update(newData);
-                return DigestData();
-            }
-
-            /// <summary>
-            ///     Updates the digest data with the specified array of bytes by making an append
-            ///     operation in the internal array of data.
-            /// </summary>
-            /// <param name="newData">The array of bytes for the update operation.</param>
-            public void Update(byte[] newData)
-            {
-                if (_position == 0)
-                {
-                    Data = newData;
-                    _position = Data.Length - 1;
-                }
-                else
-                {
-                    var oldData = Data;
-                    Data = new byte[newData.Length + _position + 1];
-                    oldData.CopyTo(Data, 0);
-                    newData.CopyTo(Data, oldData.Length);
-
-                    _position = Data.Length - 1;
-                }
-            }
-
-            /// <summary>
-            ///     Updates the digest data with the input byte by calling the method Update with an array.
-            /// </summary>
-            /// <param name="newData">The input byte for the update.</param>
-            public void Update(byte newData)
-            {
-                var newDataArray = new byte[1];
-                newDataArray[0] = newData;
-                Update(newDataArray);
-            }
-
-            /// <summary>
-            ///     Updates the specified count of bytes with the input array of bytes starting at the
-            ///     input offset.
-            /// </summary>
-            /// <param name="newData">The array of bytes for the update operation.</param>
-            /// <param name="offset">The initial position to start from in the array of bytes.</param>
-            /// <param name="count">The number of bytes fot the update.</param>
-            public void Update(byte[] newData, int offset, int count)
-            {
-                var newDataArray = new byte[count];
-                Array.Copy(newData, offset, newDataArray, 0, count);
-                Update(newDataArray);
-            }
-
-            /// <summary>
-            ///     Resets the digest data to the initial state.
-            /// </summary>
-            public void Reset()
-            {
-                Data = null;
-                _position = 0;
-            }
-
-            /// <summary>
-            ///     Returns a string representation of the Message Digest.
-            /// </summary>
-            /// <returns>A string representation of the object.</returns>
-            public override string ToString()
-            {
-                return Algorithm.ToString();
-            }
-
-            /// <summary>
-            ///     Compares two arrays of signed bytes evaluating equivalence in digest data.
-            /// </summary>
-            /// <param name="firstDigest">An array of signed bytes for comparison.</param>
-            /// <param name="secondDigest">An array of signed bytes for comparison.</param>
-            /// <returns>True if the input digest arrays are equal.</returns>
-            public static bool EquivalentDigest(byte[] firstDigest, byte[] secondDigest)
-            {
-                var result = false;
-                if (firstDigest.Length == secondDigest.Length)
-                {
-                    var index = 0;
-                    result = true;
-                    while (result && index < firstDigest.Length)
-                    {
-                        result = firstDigest[index] == secondDigest[index];
-                        index++;
-                    }
-                }
-
-                return result;
-            }
-        }
-
-        // REMOVED Class not used
-
-        /// *******************************/
-        /// <summary>
-        ///     Interface used by classes which must be single threaded.
-        /// </summary>
-        public interface ISingleThreadModel
-        {
-        }
     }
 }


Update view for displaying package

Update view for displaying package

--- src/NuGetGallery/Views/Packages/DisplayPackage.cshtml
+++ src/NuGetGallery/Views/Packages/DisplayPackage.cshtml
@@ -55,28 +55,13 @@

-

+

             @if (!String.IsNullOrEmpty(Model.ProjectUrl))
             {

                         Project Site

             }
-            @if (!String.IsNullOrEmpty(Model.LicenseUrl))
-            {
-

-                    License
-                    @if ((Model.LicenseNames != null) && (!String.IsNullOrEmpty(Model.LicenseReportUrl)))
-                    {
-

-

-                                @String.Join(", ", Model.LicenseNames)
-

-
License details provided by Sonatype CLM

-
Component report

-

-                    }
-

-            }
+
             @if (Model.IsOwner(User))
             {

@@ -108,6 +93,51 @@
             }

+
+    @if (!String.IsNullOrEmpty(Model.LicenseUrl) || !Model.HideLicenseReport)
+    {
+

+
License

+            @if (Model.IsOwner(User))
+            {
+                if (Model.HideLicenseReport)
+                {
+                    @* TODO: Create action for changing flag HideLicenseReport *@
+                    @* TODO: Change for an icon *@
+
Enable license report

+                }
+                else
+                {
+                    @* TODO: Create action for changing flag HideLicenseReport *@
+                    @* TODO: Change for an icon *@
+
Disable license report

+                }
+            }
+            @if (!Model.HideLicenseReport)
+            {
+                if ((Model.LicenseNames != null)
+                    && (Model.LicenseNames.Count() > 0)
+                    && !String.IsNullOrEmpty(Model.LicenseReportUrl))
+                {
+
@String.Join(", ", Model.LicenseNames)

+                }
+            }
+            @if (!String.IsNullOrEmpty(Model.LicenseUrl))
+            {
+                @* TODO: Change a.title *@
+
View license

+            }
+            @if (!Model.HideLicenseReport)
+            {
+                if ((Model.LicenseNames != null)
+                    && (Model.LicenseNames.Count() > 0)
+                    && !String.IsNullOrEmpty(Model.LicenseReportUrl))
+                {
+
View Sonatype CLM Component Report

+                }
+            }
+

+    }
 }

     @if (Model.HasPendingMetadata)


eureka extension

eureka extension

--- src/Ocelot.Provider.Eureka/OcelotBuilderExtensions.cs
+++ src/Ocelot.Provider.Eureka/OcelotBuilderExtensions.cs
@@ -12,9 +12,7 @@
     {
         public static IOcelotBuilder AddEureka(this IOcelotBuilder builder)
         {
-            var service = builder.Services.First(x => x.ServiceType == typeof(IConfiguration));
-            var configuration = (IConfiguration)service.ImplementationInstance;
-            builder.Services.AddDiscoveryClient(configuration);
+            builder.Services.AddDiscoveryClient(builder.Configuration);
             builder.Services.AddSingleton<ServiceDiscoveryFinderDelegate>(EurekaProviderFactory.Get);
             builder.Services.AddSingleton<OcelotMiddlewareConfigurationDelegate>(EurekaMiddlewareConfigurationProvider.Get);
             return builder;


Changed ConnectedComponentsEx.FilterByLabel signature

--- src/OpenCvSharp/modules/imgproc/ConnectedComponent.cs
+++ src/OpenCvSharp/modules/imgproc/ConnectedComponent.cs
@@ -41,24 +41,28 @@
         /// <summary>
         /// Filter a image with the specified label value.
         /// </summary>
-        /// <param name="img">Source image.</param>
+        /// <param name="src">Source image.</param>
+        /// <param name="dst">Destination image.</param>
         /// <param name="labelValue">Label value.</param>
         /// <returns>Filtered image.</returns>
-        public Mat FilterByLabel(Mat img, int labelValue)
-        {
-            return FilterByLabels(img, new[] {labelValue});
+        public Mat FilterByLabel(Mat src, Mat dst, int labelValue)
+        {
+            return FilterByLabels(src, dst, new[] {labelValue});
         }

         /// <summary>
         /// Filter a image with the specified label values.
         /// </summary>
-        /// <param name="img">Source image.</param>
+        /// <param name="src">Source image.</param>
+        /// <param name="dst">Destination image.</param>
         /// <param name="labelValues">Label values.</param>
         /// <returns>Filtered image.</returns>
-        public Mat FilterByLabels(Mat img, IEnumerable<int> labelValues)
-        {
-            if (img == null)
-                throw new ArgumentNullException("img");
+        public Mat FilterByLabels(Mat src, Mat dst, IEnumerable<int> labelValues)
+        {
+            if (src == null)
+                throw new ArgumentNullException("src");
+            if (dst == null)
+                throw new ArgumentNullException("dst");
             if (labelValues == null)
                 throw new ArgumentNullException("labelValues");
             int[] labelArray = EnumerableEx.ToArray(labelValues);
@@ -81,8 +85,7 @@
                         Cv2.BitwiseOr(mask, maskI, mask);
                     }
                 }
-                Mat dst = new Mat();
-                img.CopyTo(dst, mask);
+                src.CopyTo(dst, mask);
                 return dst;
             }
         }
@@ -90,23 +93,25 @@
         /// <summary>
         /// Filter a image with the specified blob object.
         /// </summary>
-        /// <param name="img">Source image.</param>
+        /// <param name="src">Source image.</param>
+        /// <param name="dst">Destination image.</param>
         /// <param name="blob">Blob value.</param>
         /// <returns>Filtered image.</returns>
-        public Mat FilterByBlob(Mat img, Blob blob)
-        {
-            return FilterByLabels(img, new[] {blob.Label});
+        public Mat FilterByBlob(Mat src, Mat dst, Blob blob)
+        {
+            return FilterByLabels(src, dst, new[] {blob.Label});
         }

         /// <summary>
         /// Filter a image with the specified blob objects.
         /// </summary>
-        /// <param name="img">Source image.</param>
+        /// <param name="src">Source image.</param>
+        /// <param name="dst">Destination image.</param>
         /// <param name="blobs">Blob values.</param>
         /// <returns>Filtered image.</returns>
-        public Mat FilterBlobs(Mat img, IEnumerable<Blob> blobs)
-        {
-            return FilterByLabels(img, EnumerableEx.Select(blobs, b => b.Label));
+        public Mat FilterBlobs(Mat src, Mat dst, IEnumerable<Blob> blobs)
+        {
+            return FilterByLabels(src, dst, EnumerableEx.Select(blobs, b => b.Label));
         }

         /// <summary>


Fix unit tests

Fix unit tests

--HG--
branch : dev

--- src/Orchard.Tests/Localization/CultureManagerTests.cs
+++ src/Orchard.Tests/Localization/CultureManagerTests.cs
@@ -6,6 +6,7 @@
 using Autofac;
 using NHibernate;
 using NUnit.Framework;
+using Orchard.Caching;
 using Orchard.Data;
 using Orchard.Localization.Records;
 using Orchard.Localization.Services;
@@ -33,6 +34,7 @@
             var builder = new ContainerBuilder();
             builder.RegisterType<TestCultureSelector>().As<ICultureSelector>();
             builder.RegisterType<DefaultCultureManager>().As<ICultureManager>();
+            builder.RegisterType<Signals>().As<ISignals>();
             builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
             _session = _sessionFactory.OpenSession();
             builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();


Update version number

Update version number

--- src/Owin.Security.Keycloak/Properties/AssemblyInfo.cs
+++ src/Owin.Security.Keycloak/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("1.0.0.1")]
-[assembly: AssemblyFileVersion("1.0.0.1")]
+[assembly: AssemblyVersion("1.0.1.1")]
+[assembly: AssemblyFileVersion("1.0.1.1")]


remove commented code

remove commented code

--- src/Radical/ComponentModel/Model/IEntityCollection.cs
+++ src/Radical/ComponentModel/Model/IEntityCollection.cs
@@ -82,17 +82,6 @@
         /// </value>
         bool IsInitializing { get; }

-        ///// <summary>
-        ///// Sorts the items in this instance.
-        ///// </summary>
-        //void Sort();
-
-        ///// <summary>
-        ///// Sorts the items in this instance using the specified comparer.
-        ///// </summary>
-        ///// <param name="comparer">The comparer to use to sort items.</param>
-        //void Sort( IComparer<T> comparer );
-
         /// <summary>
         /// Copies the elements of the IEntityCollection to a new array.
         /// </summary>


Update to gov gateway inform content

Update to gov gateway inform content

Updated the content for the goverment gateway inform page

--- src/SFA.DAS.EAS.Web/Views/Shared/GatewayInform.cshtml
+++ src/SFA.DAS.EAS.Web/Views/Shared/GatewayInform.cshtml
@@ -6,20 +6,16 @@

-
Connecting to HMRC

-
To access levy funds you need to connect your account to HMRC.

-
When you continue you'll be asked to:

-

-
Enter the Government Gateway login details for one of your PAYE schemes.

-
'Grant authority' to allow HMRC to access your Government Gateway account.

-

+
Allowing your tax details to be used

+
When you enter your Government Gateway details you'll be asked to 'grant authority' to allow your tax details to be used.

+
This means you allow HMRC to send the SFA details of the levy that you've paid - no other payroll information will be shared.

By continuing you agree to the following:

I have authority to add PAYE schemes to this account.

I understand that all account users will be able to see levy funds from any PAYE schemes I add.

All PAYE schemes I add are owned and operated by an organisation that'll use this account, or owned and operated by a connected organisation.

-
Continue

+
Agree and continue


Refactor evaluator to be more extensible

--- src/Unicorn/Evaluators/SerializedAsMasterEvaluator.cs
+++ src/Unicorn/Evaluators/SerializedAsMasterEvaluator.cs
@@ -21,55 +21,35 @@
 		{
 			Assert.ArgumentNotNull(serializedItem, "serializedItem");
 			Assert.ArgumentNotNull(progress, "progress");
-
-			if(existingItem == null) return true;
+
+			if (existingItem == null) return true;

 			// see if the modified date is different in any version (because disk is master, ANY changes we want to force overwrite)
 			return serializedItem.Versions.Any(version =>
 				{
 					bool passedComparisons = false; // this flag lets us differentiate between items that we could not determine equality for, and items that just matched every criteria and don't need updating

-
-					var serializedModified = version.Updated;
-					if (serializedModified != null)
+					var modifiedMatch = IsModifiedMatch(existingItem, serializedItem, version, progress);
+					if (modifiedMatch != null)
 					{
-						var itemModified = existingItem.GetLastModifiedDate(version.Language, version.VersionNumber);
-						var result = !serializedModified.Equals(itemModified);
-
-						if (result)
-						{
-							progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk modified {3}, Item modified {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedModified.Value.ToString("G"), itemModified.Value.ToString("G")), MessageType.Debug);
-
-							return true;
-						}
+						if (modifiedMatch.Value) return true;

 						passedComparisons = true;
 					}

 					// ocasionally a version will not have a modified date or a modified date will not get updated, only a revision change so we compare those as a backup
-					var serializedRevision = version.Revision;
-
-					if (!string.IsNullOrEmpty(serializedRevision))
+					var revisionMatch = IsRevisionMatch(existingItem, serializedItem, version, progress);
+
+					if (revisionMatch != null)
 					{
-						var itemRevision = existingItem.GetRevision(version.Language, version.VersionNumber);
-						var result = !serializedRevision.Equals(itemRevision);
-
-						if (result)
-						{
-							progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk revision {3}, Item revision {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedRevision, itemRevision), MessageType.Debug);
-							return true;
-						}
+						if (revisionMatch.Value) return true;

 						passedComparisons = true;
 					}

 					// as a last check, see if the names do not match. Renames, for example, only change the name and not the revision or modified date (wtf?)
 					// unlike other checks, this one does not count as 'passing a comparison' if it fails to match a force. Having names be equal is not a strong enough measure of equality.
-					if (!serializedItem.Name.Equals(existingItem.Name))
-					{
-						progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk name {3}, Item name {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedItem.Name, existingItem.Name), MessageType.Debug);
-						return true;
-					}
+					if (IsNameMatch(existingItem, serializedItem, version, progress)) return true;

 					// if we get here and no comparisons were passed, we have no valid updated or revision to compare. Let's ignore the item as if it was a real item it'd have one of these.
 					if (!passedComparisons && !serializedItem.ItemPath.StartsWith("/sitecore/templates/System") && !serializedItem.ItemPath.StartsWith("/sitecore/templates/Sitecore Client")) // this occurs a lot in stock system templates - we ignore warnings for those as it's expected.
@@ -78,5 +58,48 @@
 					return false;
 				});
 		}
+
+		protected virtual bool? IsModifiedMatch(ISourceItem existingItem, ISerializedItem serializedItem, SerializedVersion version, IProgressStatus progress)
+		{
+			var serializedModified = version.Updated;
+			if (serializedModified == null) return null;
+
+			var itemModified = existingItem.GetLastModifiedDate(version.Language, version.VersionNumber);
+
+			if (itemModified == null) return null;
+
+			var result = !serializedModified.Value.Equals(itemModified.Value);
+
+			if (result)
+				progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk modified {3}, Item modified {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedModified.Value.ToString("G"), itemModified.Value.ToString("G")), MessageType.Debug);
+
+			return result;
+		}
+
+		protected virtual bool? IsRevisionMatch(ISourceItem existingItem, ISerializedItem serializedItem, SerializedVersion version, IProgressStatus progress)
+		{
+			var serializedRevision = version.Revision;
+
+			if (string.IsNullOrEmpty(serializedRevision)) return null;
+
+			var itemRevision = existingItem.GetRevision(version.Language, version.VersionNumber);
+			var result = !serializedRevision.Equals(itemRevision);
+
+			if (result)
+				progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk revision {3}, Item revision {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedRevision, itemRevision), MessageType.Debug);
+
+			return result;
+		}
+
+		protected virtual bool IsNameMatch(ISourceItem existingItem, ISerializedItem serializedItem, SerializedVersion version, IProgressStatus progress)
+		{
+			if (!serializedItem.Name.Equals(existingItem.Name))
+			{
+				progress.ReportStatus(string.Format("{0} ({1} #{2}): Disk name {3}, Item name {4}", serializedItem.ItemPath, version.Language, version.VersionNumber, serializedItem.Name, existingItem.Name), MessageType.Debug);
+				return true;
+			}
+
+			return false;
+		}
 	}
 }


Approval details view

Approval details view

* Fixed order loading based on approval

--- src/biz.dfch.CS.Appclusive.UI/Models/Core/Approval.cs
+++ src/biz.dfch.CS.Appclusive.UI/Models/Core/Approval.cs
@@ -71,7 +71,7 @@
         /// set through call of ResolveOrderId()
         /// </summary>
         [Display(Name = "OrderId", ResourceType = typeof(GeneralResources))]
-        public int OrderId { get; private set; }
+        public long OrderId { get; private set; }

         /// <summary>
         /// set through call of ResolveOrderId()
@@ -98,9 +98,6 @@

         /// <summary>
         /// Find Order by Approval
-        /// -> Job-Parent (Name = 'biz.dfch.CS.Appclusive.Core.OdataServices.Core.Approval')
-        /// -> Job (Name== 'biz.dfch.CS.Appclusive.Core.OdataServices.Core.Order')
-        /// -> Order
         /// </summary>
         /// <param name="coreRepository"></param>
         internal void ResolveOrderId(biz.dfch.CS.Appclusive.Api.Core.Core coreRepository)
@@ -112,19 +109,10 @@
                 this.ResolveJob(coreRepository);
             }

-            Api.Core.Job orderJob = coreRepository.Jobs
-                .Where(j => j.RefId == this.Id.ToString() && j.EntityKindId == biz.dfch.CS.Appclusive.Contracts.Constants.EntityKindId.Order.GetHashCode())
-                .FirstOrDefault();
-
-            Contract.Assert(null != orderJob, "no Order-job available");
-
-            int orderId = 0;
-            int.TryParse(orderJob.RefId, out orderId);
-            this.OrderId = orderId;
-
-            if (this.OrderId > 0)
+            this.Order = AutoMapper.Mapper.Map<Order>(coreRepository.InvokeEntityActionWithSingleResult<Api.Core.Order>(this, "Order", null));
+            if (null != this.Order)
             {
-                this.Order = AutoMapper.Mapper.Map<Order>(coreRepository.InvokeEntityActionWithSingleResult<Api.Core.Order>(this, "Order", null));
+                this.OrderId = Order.Id;
             }
         }
     }


more logic

more logic

--- ksp_plugin_adapter/map_node_pool.cs
+++ ksp_plugin_adapter/map_node_pool.cs
@@ -78,11 +78,12 @@
         (KSP.UI.Screens.Mapview.MapNode node,
          Mouse.Buttons buttons) => {
           if (buttons == Mouse.Buttons.Left) {
-            if (properties_[node].vessel != null &&
-                PlanetariumCamera.fetch.target !=
-                    properties_[node].vessel.mapObject) {
-              PlanetariumCamera.fetch.SetTarget(
-                  properties_[node].vessel.mapObject);
+            if (properties_[node].vessel != null) {
+              if (PlanetariumCamera.fetch.target !=
+                  properties_[node].vessel.mapObject) {
+                PlanetariumCamera.fetch.SetTarget(
+                    properties_[node].vessel.mapObject);
+              }
             } else if (PlanetariumCamera.fetch.target !=
                        properties_[node].celestial.MapObject) {
               PlanetariumCamera.fetch.SetTarget(


(TFS CS 3152)

(TFS CS 3152)

--- Signum.Engine/DynamicQuery/DynamicQuery.cs
+++ Signum.Engine/DynamicQuery/DynamicQuery.cs
@@ -64,20 +64,18 @@

         public QueryResult ExecuteQuery(List<Filter> filters, int? limit)
         {
-            IEnumerable<T> result;
             if (execute != null)
-                result = execute(filters, limit);
+                return ToQueryResult(execute(filters, limit));
             else
             {
-                query = query.WhereFilters(filters);
+                IQueryable<T> result = query.WhereFilters(filters);

                 if (limit != null)
-                    query = query.Take(limit.Value);
-
-                result = query;
+                    result = result.Take(limit.Value);
+
+                return ToQueryResult(result);
             }

-            return ToQueryResult(result);
         }

         QueryResult ToQueryResult(IEnumerable<T> result)


PaginationAsync returns correct Number of Results

--- Signum.Engine/DynamicQuery/DynamicQuery.cs
+++ Signum.Engine/DynamicQuery/DynamicQuery.cs
@@ -75,13 +75,13 @@
         QueryDescription GetQueryDescription();

         ResultTable ExecuteQuery(QueryRequest request);
-        Task<ResultTable> ExecuteQueryAsync(QueryRequest request, CancellationToken token);
+        Task<ResultTable> ExecuteQueryAsync(QueryRequest request, CancellationToken cancellationToken);
         object ExecuteQueryValue(QueryValueRequest request);
-        Task<object> ExecuteQueryValueAsync(QueryValueRequest request, CancellationToken token);
+        Task<object> ExecuteQueryValueAsync(QueryValueRequest request, CancellationToken cancellationToken);
         Lite<Entity> ExecuteUniqueEntity(UniqueEntityRequest request);
-        Task<Lite<Entity>> ExecuteUniqueEntityAsync(UniqueEntityRequest request, CancellationToken token);
+        Task<Lite<Entity>> ExecuteUniqueEntityAsync(UniqueEntityRequest request, CancellationToken cancellationToken);
         ResultTable ExecuteQueryGroup(QueryGroupRequest request);
-        Task<ResultTable> ExecuteQueryGroupAsync(QueryGroupRequest request, CancellationToken token);
+        Task<ResultTable> ExecuteQueryGroupAsync(QueryGroupRequest request, CancellationToken cancellationToken);

         IQueryable<Lite<Entity>> GetEntities(QueryEntitiesRequest request);
     }
@@ -668,7 +668,7 @@
                 q = q.Take(pag.ElementsPerPage);

                 var listTask = q.ToListAsync();
-                var countTask = q.CountAsync();
+                var countTask = query.Query.CountAsync();

                 return new DEnumerableCount<T>(await listTask, query.Context, await countTask);
             }
@@ -702,10 +702,10 @@

                 q = q.Take(pag.ElementsPerPage);

-                var listTask = q.ToList();
-                var countTask = q.Count();
-
-                return new DEnumerableCount<T>(listTask, query.Context, countTask);
+                var list = q.ToList();
+                var count = list.Count < pag.ElementsPerPage ? pag.ElementsPerPage : query.Query.Count();
+
+                return new DEnumerableCount<T>(list, query.Context, count);
             }

             throw new InvalidOperationException("pagination type {0} not expexted".FormatWith(pagination.GetType().Name));


optimize Count TryPaginate

optimize Count TryPaginate

--- Signum.Engine/DynamicQuery/DynamicQuery.cs
+++ Signum.Engine/DynamicQuery/DynamicQuery.cs
@@ -537,14 +537,14 @@
         {
             if (elementsPerPage == QueryRequest.AllElements)
             {
-                var array = query.Query.ToArray();
-                return new DEnumerableCount<T>(array, query.Context, array.Length);
+                var allList = query.Query.ToList();
+                return new DEnumerableCount<T>(allList, query.Context, allList.Count);
             }

             if (currentPage <= 0)
                 throw new InvalidOperationException("currentPage should be greater than zero");

-            int totalElements = query.Query.Count();
+            int? totalElements = null;

             var q = query.Query;
             if (currentPage != 1)
@@ -552,25 +552,39 @@

             q = q.Take(elementsPerPage);

-            return new DEnumerableCount<T>(q.ToArray(), query.Context, totalElements);
+            var list = q.ToList();
+
+            if (list.Count < elementsPerPage && currentPage == 1)
+                totalElements = list.Count;
+
+            return new DEnumerableCount<T>(list, query.Context, totalElements ?? query.Query.Count());
         }

         public static DEnumerableCount<T> TryPaginate<T>(this DEnumerable<T> collection, int? elementsPerPage, int currentPage)
         {
             if (elementsPerPage == QueryRequest.AllElements)
-                return new DEnumerableCount<T>(collection.Collection, collection.Context, collection.Collection.Count());
+            {
+                var allList = collection.Collection.ToList();
+                return new DEnumerableCount<T>(allList, collection.Context, allList.Count);
+            }

             if (currentPage <= 0)
                 throw new InvalidOperationException("currentPage should be greater than zero");

-            int totalElements = collection.Collection.Count();
+            int? totalElements = null;
+
             var c = collection.Collection;
             if (currentPage != 1)
                 c = c.Skip((currentPage - 1) * elementsPerPage.Value);

             c = c.Take(elementsPerPage.Value);

-            return new DEnumerableCount<T>(c, collection.Context, totalElements);
+            var list = c.ToList();
+
+            if (list.Count < elementsPerPage && currentPage == 1)
+                totalElements = list.Count;
+
+            return new DEnumerableCount<T>(c, collection.Context, totalElements ?? collection.Collection.Count());
         }

         public static DEnumerableCount<T> TryPaginate<T>(this DEnumerableCount<T> collection, int elementsPerPage, int currentPage)


remove debugging if

remove debugging if

--- Signum.Engine/Engine/SchemaSynchronizer.cs
+++ Signum.Engine/Engine/SchemaSynchronizer.cs
@@ -173,11 +173,6 @@
                     removeOld: (tn, dif) => dif.Indices.Values.Where(ix => !ix.IsPrimary).Select(ix => SqlBuilder.DropIndex(dif.Name, ix)).Combine(Spacing.Simple),
                     mergeBoth: (tn, tab, dif) =>
                     {
-                        if(tn == "kostentraeger.Institution")
-                        {
-
-                        }
-
                         Dictionary<string, Index> modelIxs = modelIndices[tab];

                         var removedColums = dif.Columns.Keys.Except(tab.Columns.Keys).ToHashSet();


fix ExcelClient

fix ExcelClient

--- Signum.Web.Extensions/Excel/ExcelClient.cs
+++ Signum.Web.Extensions/Excel/ExcelClient.cs
@@ -26,7 +26,7 @@
     public class ExcelClient
     {
         public static string ViewPrefix = "~/Excel/Views/{0}.cshtml";
-        public static JsModule Module = new JsModule("Extensions/Signum.Web.Extensions/Excel/Scripts/Report");
+        public static JsModule Module = new JsModule("Extensions/Signum.Web.Extensions/Excel/Scripts/Excel");

         public static bool ToExcelPlain { get; private set; }
         public static bool ExcelReport { get; private set; }


EntityLineHelper Link == Navigate

EntityLineHelper Link == Navigate

--- Signum.Web/LineHelpers/EntityLineHelper.cs
+++ Signum.Web/LineHelpers/EntityLineHelper.cs
@@ -46,32 +46,33 @@
                         if (entityLine.Autocomplete && entityLine.Implementations.Value.IsByAll)
                             throw new InvalidOperationException("Autocomplete is not possible with ImplementedByAll");

-                        var htmlAttr = new Dictionary<string, object>
-                        {
-                            {"class", "sf-value-line" + (entityLine.Autocomplete ? " sf-entity-autocomplete" : "")},
-                            { "autocomplete", "off" },
-                            { "style", "display:" + ((entityLine.UntypedValue==null && !entityLine.ReadOnly) ? "block" : "none")}
-                        };
-
                         if (entityLine.Autocomplete)
                         {
+                            var htmlAttr = new Dictionary<string, object>
+                            {
+                                {"class", "sf-value-line" + (entityLine.Autocomplete ? " sf-entity-autocomplete" : "")},
+                                { "autocomplete", "off" },
+                                { "style", "display:" + ((entityLine.UntypedValue==null && !entityLine.ReadOnly) ? "block" : "none")}
+                            };
+
                             htmlAttr.Add("data-types", new StaticInfo(entityLine.Type, entityLine.Implementations, entityLine.PropertyRoute, entityLine.ReadOnly).Types.ToString(Navigator.ResolveWebTypeName, ","));

                             if (entityLine.AutocompleteUrl.HasText())
-                                htmlAttr.Add("data-url", entityLine.AutocompleteUrl);
+                                htmlAttr.Add("data-url", entityLine.AutocompleteUrl);
+
+                            sb.AddLine(helper.TextBox(
+                                entityLine.Compose(EntityBaseKeys.ToStr),
+                                entityLine.ToStr,
+                                htmlAttr));
                         }

-                        sb.AddLine(helper.TextBox(
-                            entityLine.Compose(EntityBaseKeys.ToStr),
-                            entityLine.ToStr,
-                            htmlAttr));
-
-                        int? id = entityLine.IdOrNull;
-                        if (id != null && entityLine.Navigate)
+                        if (entityLine.Navigate)
                         {
                             sb.AddLine(
-                                helper.Href(entityLine.Compose(EntityBaseKeys.ToStrLink),
-                                    entityLine.UntypedValue.ToString(), Navigator.NavigateRoute(entityLine.CleanRuntimeType, id), JavascriptMessage.navigate.NiceToString(), "sf-value-line",
+                                helper.Href(entityLine.Compose(EntityBaseKeys.Link),
+                                    entityLine.UntypedValue.TryToString(),
+                                    entityLine.IdOrNull != null ? Navigator.NavigateRoute(entityLine.CleanRuntimeType, entityLine.IdOrNull.Value) : null,
+                                    JavascriptMessage.navigate.NiceToString(), "sf-value-line",
                                     new Dictionary<string, object> { { "style", "display:" + ((entityLine.UntypedValue == null) ? "none" : "block") } }));
                         }
                         else


Fixed MockProcedure tests

Fixed MockProcedure tests

--- Simple.Data.BehaviourTest/ProcedureTest.cs
+++ Simple.Data.BehaviourTest/ProcedureTest.cs
@@ -39,7 +39,7 @@
             db.ProcedureWithoutParameters();
             Assert.IsNotNull(mockDatabase.Sql);
             Assert.AreEqual("[ProcedureWithoutParameters]".ToLowerInvariant(), mockDatabase.Sql.ToLowerInvariant());
-            Assert.AreEqual(1, mockDatabase.Parameters.Count());
+            Assert.AreEqual(0, mockDatabase.Parameters.Count());
         }

         [Test]
@@ -50,7 +50,7 @@
             db.ProcedureWithParameters(One: 1, Two: 2);
             Assert.AreEqual(1, mockDatabase.CommandTexts.Count);
             Assert.AreEqual("[ProcedureWithParameters]".ToLowerInvariant(), mockDatabase.CommandTexts[0].ToLowerInvariant());
-            Assert.AreEqual(3, mockDatabase.CommandParameters[0].Count);
+            Assert.AreEqual(2, mockDatabase.CommandParameters[0].Count);
             Assert.IsTrue(mockDatabase.CommandParameters[0].ContainsKey("@One"));
             Assert.AreEqual(1, mockDatabase.CommandParameters[0]["@One"]);
             Assert.IsTrue(mockDatabase.CommandParameters[0].ContainsKey("@Two"));
@@ -65,7 +65,7 @@
             db.ProcedureWithParameters(1, 2);
             Assert.AreEqual(1, mockDatabase.CommandTexts.Count);
             Assert.AreEqual("[ProcedureWithParameters]".ToLowerInvariant(), mockDatabase.CommandTexts[0].ToLowerInvariant());
-            Assert.AreEqual(3, mockDatabase.CommandParameters[0].Count);
+            Assert.AreEqual(2, mockDatabase.CommandParameters[0].Count);
             Assert.IsTrue(mockDatabase.CommandParameters[0].ContainsKey("@One"));
             Assert.AreEqual(1, mockDatabase.CommandParameters[0]["@One"]);
             Assert.IsTrue(mockDatabase.CommandParameters[0].ContainsKey("@Two"));


add comment

add comment

--- SolidworksAddinFramework/CurveExtension.cs
+++ SolidworksAddinFramework/CurveExtension.cs
@@ -347,6 +347,13 @@
             return (ICurve)edge.GetCurve();
         }

+        /// <summary>
+        /// Approximation. Be carefull
+        /// </summary>
+        /// <param name="curve"></param>
+        /// <param name="pointDistance"></param>
+        /// <param name="flankHelixDomain"></param>
+        /// <returns></returns>
         public static List<PointParam> GetPointsByLength
             ( this ICurve curve
             , double pointDistance


Wpf: Fix TableLayout when initializing using rows

--- Source/Eto.Wpf/Forms/TableLayoutHandler.cs
+++ Source/Eto.Wpf/Forms/TableLayoutHandler.cs
@@ -11,7 +11,7 @@
 {
 	public class TableLayoutHandler : WpfLayout<swc.Grid, TableLayout, TableLayout.ICallback>, TableLayout.IHandler
 	{
-		swc.Border border;
+		swc.Border border = new swc.Border();
 		Size spacing;
 		Control[,] controls;
 		bool[] columnScale;
@@ -72,7 +72,7 @@
 				for (int x = 0; x < cols; x++)
 					Control.Children.Add(EmptyCell(x, y));

-			border = new swc.Border { Child = Control };
+			border.Child = Control;

 			Spacing = TableLayout.DefaultSpacing;
 			Padding = TableLayout.DefaultPadding;
@@ -112,6 +112,8 @@

 		void SetScale()
 		{
+			if (Control == null)
+				return;
 			for (int y = 0; y < Control.RowDefinitions.Count; y++)
 			{
 				for (int x = 0; x < Control.ColumnDefinitions.Count; x++)


fixed bug. (ground pump on the soil continue to output water)

--- Source/Mizu_Assembly/CompWaterNetOutput.cs
+++ Source/Mizu_Assembly/CompWaterNetOutput.cs
@@ -158,18 +158,18 @@
                     // 定量出力タイプで、入力が出力量を超えている場合、機能する
                     this.OutputWaterType = outWaterType;
                     this.OutputWaterFlow = this.MaxOutputWaterFlow;
+                    return;
                 }
                 else if (this.OutputWaterFlowType == CompProperties_WaterNetOutput.OutputWaterFlowType.Any)
                 {
                     // 任意出力タイプの場合、入力と同じ量だけ出力する
                     this.OutputWaterType = outWaterType;
                     this.OutputWaterFlow = this.InputComp.InputWaterFlow;
+
+                    // 結果的に出力量が0の場合、水の種類をクリアする
+                    if (this.OutputWaterFlow == 0.0f) this.OutputWaterType = WaterType.NoWater;
+                    return;
                 }
-
-                // 結果的に出力量が0の場合、水の種類をクリアする
-                if (this.OutputWaterFlow == 0.0f) this.OutputWaterType = WaterType.NoWater;
-
-                return;
             }

             // 有効な水源無し


Fixed issue where RemoveFriend would crash

--- SteamToolkit/Community/CommunityHandler.cs
+++ SteamToolkit/Community/CommunityHandler.cs
@@ -336,7 +336,7 @@
                 {"steamid", steamId.ToString()}
             };

-            return Convert.ToBoolean(_web.Fetch(url, "POST", data, _account.AuthContainer));
+            return Convert.ToBoolean(_web.Fetch(url, "POST", data, _account.AuthContainer).ReadStream());
         }

         /// <summary>


small xml r/w refactor

small xml r/w refactor

--- TCC.Core/ViewModels/InfoWindowViewModel.cs
+++ TCC.Core/ViewModels/InfoWindowViewModel.cs
@@ -40,7 +40,7 @@
             SpecialEvents = new SynchronizedObservableCollection<DailyEvent>(Dispatcher);
             LoadCharDoc();
             if (Characters.Count > 0) SelectCharacter(Characters[0]);
-            else SelectCharacter(new Character("", Class.None, 0, 0, Dispatcher));
+            else SelectCharacter(new Character());
         }

         public void LoadEvents(DayOfWeek today, string region)
@@ -267,9 +267,9 @@
             var ch = Characters.ToSyncArray().FirstOrDefault(c => c.Id == SessionManager.CurrentPlayer.PlayerId);
             if (ch != null)
             {
-                ch.WeekliesDone = x.WeeklyDone;
-                ch.DailiesDone = x.DailyDone;
-                ch.Credits = x.VanguardCredits;
+                ch.VanguardWeekliesDone = x.WeeklyDone;
+                ch.VanguardDailiesDone = x.DailyDone;
+                ch.VanguardCredits = x.VanguardCredits;
                 SaveToFile();
             }

@@ -307,11 +307,12 @@
                 var ce = new XElement("Character",
                     new XAttribute("name", c.Name),
                     new XAttribute("id", c.Id),
+                    new XAttribute("class", c.Class),
                     new XAttribute("pos", c.Position),
-                    new XAttribute("credits", c.Credits),
-                    new XAttribute("weekly", c.WeekliesDone),
-                    new XAttribute("daily", c.DailiesDone),
-                    new XAttribute("class", c.Class),
+                    new XAttribute("vanguardCredits", c.VanguardCredits),
+                    new XAttribute("guardianCredits", c.GuardianCredits),
+                    new XAttribute("vanguardWeekly", c.VanguardWeekliesDone),
+                    new XAttribute("vanguardDaily", c.VanguardDailiesDone),
                     new XAttribute("guardianQuests", c.ClaimedGuardianQuests),
                     new XAttribute("elleonMarks", c.ElleonMarks)
                     );
@@ -386,47 +387,41 @@
         }
         private void LoadCharacters()
         {
+            //TODO: make reader class and refactor this
             if (!File.Exists("resources/config/characters.xml")) return;
             var doc = XDocument.Load("resources/config/characters.xml");
             // ReSharper disable AssignNullToNotNullAttribute
             SessionManager.IsElite = bool.Parse(doc.Descendants().FirstOrDefault(x => x.Name == "Characters")?.Attribute("elite")?.Value);
             foreach (var c in doc.Descendants().Where(x => x.Name == "Character"))
             {
-                var name = c.Attribute("name")?.Value;
-                var cr = Convert.ToInt32(c.Attribute("credits")?.Value);
-                var w = Convert.ToInt32(c.Attribute("weekly")?.Value);
-                var d = Convert.ToInt32(c.Attribute("daily")?.Value);
-                var id = Convert.ToUInt32(c.Attribute("id")?.Value);
-                var pos = Convert.ToInt32(c.Attribute("pos")?.Value);
-                var guard = c.Attribute("guardianQuests") != null ? Convert.ToInt32(c.Attribute("guardianQuests")?.Value) : 0;
-                var marks = c.Attribute("elleonMarks") != null ? Convert.ToUInt32(c.Attribute("elleonMarks")?.Value) : 0;
-                var classString = c.Attribute("class")?.Value;
-                if (!Enum.TryParse<Class>(classString, out var cl))
-                {
-                    //keep retrocompatibility
-                    if (classString == "Elementalist") classString = "Mystic";
-                    else if (classString == "Fighter") classString = "Brawler";
-                    else if (classString == "Engineer") classString = "Gunner";
-                    else if (classString == "Soulless") classString = "Reaper";
-                    else if (classString == "Glaiver") classString = "Valkyrie";
-                    else if (classString == "Assassin") classString = "Ninja";
-                }
-                cl = (Class)Enum.Parse(typeof(Class), classString);
-
-                var ch = new Character(name, cl, id, pos, Dispatcher)
-                {
-                    Credits = cr,
-                    WeekliesDone = w,
-                    DailiesDone = d,
-                    ClaimedGuardianQuests = guard,
-                    ElleonMarks = marks
-                };
+                var ch = new Character();
+                c.Attributes().ToList().ForEach(attr =>
+                {
+                    if (attr.Name == "name") ch.Name = attr.Value;
+                    else if (attr.Name == "id") ch.Id = Convert.ToUInt32(attr.Value);
+                    else if (attr.Name == "pos") ch.Position = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "vanguardCredits") ch.VanguardCredits = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "guardianCredits") ch.GuardianCredits = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "vanguardWeekly") ch.VanguardWeekliesDone = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "vanguardDaily") ch.VanguardDailiesDone = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "guardianQuests") ch.ClaimedGuardianQuests = Convert.ToInt32(attr.Value);
+                    else if (attr.Name == "elleonMarks") ch.ElleonMarks = Convert.ToUInt32(attr.Value);
+                    else if (attr.Name == "class") ch.Class = (Class)Enum.Parse(typeof(Class), attr.Value);
+                });
+
                 var dgDict = new Dictionary<uint, short>();
                 foreach (var dgEl in c.Descendants().Where(x => x.Name == "Dungeon"))
                 {
-                    var dgId = Convert.ToUInt32(dgEl.Attribute("id")?.Value);
-                    var dgEntries = Convert.ToInt16(dgEl.Attribute("entries")?.Value);
-                    var dgTotal = dgEl.Attribute("total") != null ? Convert.ToInt16(dgEl.Attribute("total")?.Value) : 0;
+                    uint dgId = 0;
+                    short dgEntries = 0;
+                    var dgTotal = 0;
+
+                    dgEl.Attributes().ToList().ForEach(attr =>
+                    {
+                        if (attr.Name == "id") dgId = Convert.ToUInt32(attr.Value);
+                        else if (attr.Name == "entries") dgEntries = Convert.ToInt16(attr.Value);
+                        else if (attr.Name == "total") dgTotal = Convert.ToInt16(attr.Value);
+                    });
                     ch.SetDungeonTotalRuns(dgId, dgTotal);
                     dgDict.Add(dgId, dgEntries);
                 }
@@ -434,11 +429,20 @@
                 var gear = new List<GearItem>();
                 foreach (var gearEl in c.Descendants().Where(x => x.Name == "Gear"))
                 {
-                    var pieceId = Convert.ToUInt32(gearEl.Attribute("id")?.Value);
-                    var pieceType = (GearPiece)Enum.Parse(typeof(GearPiece), gearEl.Attribute("piece")?.Value);
-                    var pieceTier = (GearTier)Enum.Parse(typeof(GearTier), gearEl.Attribute("tier")?.Value);
-                    var pieceEnchant = Convert.ToInt32(gearEl.Attribute("enchant")?.Value);
-                    var exp = Convert.ToUInt32(gearEl.Attribute("exp")?.Value);
+                    uint pieceId = 0;
+                    var pieceType = GearPiece.Weapon;
+                    var pieceTier = GearTier.Low;
+                    var pieceEnchant = 0;
+                    uint exp = 0;
+
+                    gearEl.Attributes().ToList().ForEach(attr =>
+                    {
+                        if (attr.Name == "id") pieceId = Convert.ToUInt32(attr.Value);
+                        if (attr.Name == "piece") pieceType = (GearPiece)Enum.Parse(typeof(GearPiece), attr.Value);
+                        if (attr.Name == "tier") pieceTier = (GearTier)Enum.Parse(typeof(GearTier), attr.Value);
+                        if (attr.Name == "enchant") pieceEnchant = Convert.ToInt32(attr.Value);
+                        if (attr.Name == "exp") exp = Convert.ToUInt32(attr.Value);
+                    });
                     gear.Add(new GearItem(pieceId, pieceTier, pieceType, pieceEnchant, exp));
                 }
                 ch.UpdateGear(gear);


changes to time marker logic, discard 1st vanguard packet after login

--- TCC.Core/ViewModels/InfoWindowViewModel.cs
+++ TCC.Core/ViewModels/InfoWindowViewModel.cs
@@ -5,11 +5,14 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Data;
+using System.Windows.Media;
 using System.Windows.Threading;
 using System.Xml.Linq;
 using TCC.Data;
 using TCC.Data.Databases;
+using TCC.Parsing.Messages;
 using TCC.Windows;

 namespace TCC.ViewModels
@@ -18,10 +21,12 @@
     {
         static InfoWindowViewModel _instance;
         uint _selectedCharacterId;
+        public bool DiscardFirstVanguardPacket = true;
         public static InfoWindowViewModel Instance => _instance ?? (_instance = new InfoWindowViewModel());
         public SynchronizedObservableCollection<Character> Characters { get; set; }
         public SynchronizedObservableCollection<EventGroup> EventGroups { get; set; }
         public SynchronizedObservableCollection<TimeMarker> Markers { get; set; }
+        public SynchronizedObservableCollection<DailyEvent> SpecialEvents{ get; set; }
         public ICollectionView SoloDungs { get; set; }
         public ICollectionView T2Dungs { get; set; }
         public ICollectionView T3Dungs { get; set; }
@@ -43,8 +48,9 @@
             Characters = new SynchronizedObservableCollection<Character>(_dispatcher);
             EventGroups = new SynchronizedObservableCollection<EventGroup>(_dispatcher);
             Markers = new SynchronizedObservableCollection<TimeMarker>(_dispatcher);
-
-            Markers.Add(new TimeMarker(DateTime.Now, "Local time"));
+            SpecialEvents = new SynchronizedObservableCollection<DailyEvent>(_dispatcher);
+
+            //Markers.Add(new TimeMarker(DateTime.Now, "Local time"));
             LoadCharacters();
         }

@@ -136,10 +142,12 @@
                 }
                 AddEventGroup(eg);
             }
+            SpecialEvents.Add(new DailyEvent("Reset", TimeManager.Instance.ResetHour,0,"ff0000"));
         }
         public void ClearEvents()
         {
             EventGroups.Clear();
+            SpecialEvents.Clear();
         }
         public void SelectCharacter(Character c)
         {
@@ -176,6 +184,24 @@
             if (!_dispatcher.Thread.IsAlive) return;
             WindowManager.InfoWindow.ShowWindow();
         }
+
+        public void SetVanguard(S_AVAILABLE_EVENT_MATCHING_LIST x)
+        {
+            if (DiscardFirstVanguardPacket)
+            {
+                DiscardFirstVanguardPacket = false;
+                return;
+            }
+            var ch = Characters.FirstOrDefault(c => c.Id == SessionManager.CurrentPlayer.PlayerId);
+            if (ch != null)
+            {
+                ch.WeekliesDone = x.WeeklyDone;
+                ch.DailiesDone = x.DailyDone;
+                ch.Credits = x.VanguardCredits;
+                SaveToFile();
+            }
+
+        }
         public void SetLoggedIn(uint id)
         {
             foreach (var ch in Characters)
@@ -183,6 +209,7 @@
                 if (ch.Id == id)
                 {
                     ch.IsLoggedIn = true;
+                    DiscardFirstVanguardPacket = true;
                     NotifyPropertyChanged(nameof(CurrentCharacter));
                     SelectCharacter(CurrentCharacter);
                 }
@@ -275,9 +302,9 @@

     public class TimeMarker : TSPropertyChanged
     {
-        private readonly DispatcherTimer t = new DispatcherTimer();
+        private readonly DispatcherTimer _t = new DispatcherTimer();
         private DateTime _dateTime;
-
+        private readonly int _hourOffset;
         public string TimeString
         {
             get => _dateTime.ToShortTimeString();
@@ -288,20 +315,21 @@
         }
         public string Name { get; }
         public string Color { get; }
-        public TimeMarker(DateTime time, string name, string color = "ffffff")
+        public TimeMarker(int hourOffset, string name, string color = "ffffff")
         {
             _dispatcher = Dispatcher.CurrentDispatcher;
             Name = name;
             Color = color;
-            _dateTime = time;
-            t.Interval = TimeSpan.FromSeconds(1);
-            t.Tick += T_Tick;
-            t.Start();
+            _hourOffset = hourOffset;
+            _dateTime = DateTime.Now.AddHours(_hourOffset);
+            _t.Interval = TimeSpan.FromSeconds(1);
+            _t.Tick += T_Tick;
+            _t.Start();
         }

         private void T_Tick(object sender, EventArgs e)
         {
-            _dateTime = _dateTime.AddSeconds(1);
+            _dateTime = DateTime.Now.AddHours(_hourOffset);
             NotifyPropertyChanged(nameof(TimeString));
             NotifyPropertyChanged(nameof(TimeFactor));
         }
@@ -309,9 +337,9 @@

     public class DailyEvent : TSPropertyChanged
     {
-        DateTime _start;
-        TimeSpan _duration;
-        TimeSpan _realDuration;
+        private DateTime _start;
+        private TimeSpan _duration;
+        private readonly TimeSpan _realDuration;
         public double StartFactor
         {
             get
@@ -325,6 +353,14 @@
             {
                 return _duration.TotalSeconds / TimeManager.SecondsInDay;

+            }
+        }
+        public bool IsClose
+        {
+            get
+            {
+                var ts = _start - TimeManager.Instance.CurrentServerTime;
+                return ts.TotalMinutes > 0 && ts.TotalMinutes <= 5;
             }
         }
         public string Name { get; }
@@ -352,5 +388,6 @@
             Name = name;
             Color = color;
         }
+
     }
 }


Fixes, i think

Fixes, i think

--- Curves/CatmullRom.cs
+++ Curves/CatmullRom.cs
@@ -42,9 +42,9 @@
         // t on the curve. this lets us step through the curve at a constant pace.
         _distToTimeOnCurve = new List<KeyValuePair<float, float>>();
         _distToTimeOnCurve.Add(new KeyValuePair<float, float>(0.0f, 0.0f));
-        CPDists = new float[ControlPoints.Length];
-
-        for (int i = 0; i < ControlPoints.Length; i++)
+        int nbPoints = CloseLoop ? ControlPoints.Length : ControlPoints.Length - 1;
+        CPDists = new float[nbPoints];
+        for (int i = 0; i < nbPoints; i++)
         {
             CPDists[i] = distance;

@@ -136,7 +136,8 @@
         }

         // First for loop goes through each individual control point and connects it to the next, so 0-1, 1-2, 2-3 and so on
-        for (int i = 0; i < ControlPoints.Length; i++)
+        int nbPoints = CloseLoop ? ControlPoints.Length : ControlPoints.Length - 1;
+        for (int i = 0; i < nbPoints; i++)
         {
             Vector3 p0 = ControlPoints[i];
             Vector3 p1 = ControlPoints[GetClampedPointIdx(i + 1)];
@@ -186,9 +187,9 @@
 	int GetClampedPointIdx(int pointIdx)
 	{
         if (pointIdx < 0)
-            return CloseLoop ? ControlPoints.Length - 1 : 0;
+            return CloseLoop ? ControlPoints.Length + pointIdx : 0;
         if (pointIdx >= ControlPoints.Length)
-            return CloseLoop ? 0 : ControlPoints.Length - 1;
+            return CloseLoop ? pointIdx % ControlPoints.Length : ControlPoints.Length - 1;
         return pointIdx;
 	}
 }


Make ConstantTimeEquals have no loop conditions

Currently Arrays.ConstantTimeEquals isn't truly constant-time. Every time a value between the expected and actual byte mismatch there are two additional instructions executed. For the current implementation the following IL code is generated for the loop:

	IL_003b:  ldarg.0
	IL_003c:  ldloc.s 5
	IL_003e:  ldelem.u1
	IL_003f:  ldarg.1
	IL_0040:  ldloc.s 5
	IL_0042:  ldelem.u1
	IL_0043:  ceq
	IL_0045:  ldc.i4.0
	IL_0046:  ceq
	IL_0048:  stloc.s 6
	IL_004a:  ldloc.s 6
	IL_004c:  brfalse.s IL_0050 # byte compare here

	IL_004e:  ldc.i4.0  # this
	IL_004f:  stloc.0  # and this execute when bytes don't match
	IL_0050:  ldloc.s 5
	IL_0052:  ldc.i4.1
	IL_0053:  add
	IL_0054:  stloc.s 5
	IL_0056:  ldloc.s 5
	IL_0058:  ldarg.0
	IL_0059:  ldlen
	IL_005a:  conv.i4
	IL_005b:  clt
	IL_005d:  stloc.s 7
	IL_005f:  ldloc.s 7
	IL_0061:  brtrue.s IL_003b

Here's the IL code generated for an OR/XOR loop:

	IL_003b:  ldloc.0
	IL_003c:  ldarg.0
	IL_003d:  ldloc.s 5
	IL_003f:  ldelem.u1
	IL_0040:  ldarg.1
	IL_0041:  ldloc.s 5
	IL_0043:  ldelem.u1
	IL_0044:  xor
	IL_0045:  conv.u1
	IL_0046:  or
	IL_0047:  conv.u1
	IL_0048:  stloc.0
	IL_0049:  ldloc.s 5
	IL_004b:  ldc.i4.1
	IL_004c:  add
	IL_004d:  stloc.s 5
	IL_004f:  ldloc.s 5
	IL_0051:  ldarg.0
	IL_0052:  ldlen
	IL_0053:  conv.i4
	IL_0054:  clt
	IL_0056:  stloc.s 6
	IL_0058:  ldloc.s 6
	IL_005a:  brtrue.s IL_003b

There are no conditions based off the byte values. Therefore the same amount of instructions will execute per iteration which won't leak timing info.

--- jose-jwt/util/Arrays.cs
+++ jose-jwt/util/Arrays.cs
@@ -114,13 +114,11 @@
             if (expected.Length != actual.Length)
                 return false;

-            bool equals = true;
-
+            byte result = 0;
             for (int i = 0; i < expected.Length; i++)
-                if (expected[i] != actual[i])
-                    equals = false;
-
-            return equals;
+                result |= (byte)(expected[i] ^ actual[i]);
+
+            return result == 0;
         }

         public static string Dump(byte[] arr, string label = "")


explicitly check for maginternal as the allowMag checks are not enough

--- UnityProject/Assets/Scripts/Weapons/Gun.cs
+++ UnityProject/Assets/Scripts/Weapons/Gun.cs
@@ -365,7 +365,7 @@
 		public bool Interact(HandActivate interaction)
 		{
 			//try ejecting the mag if external
-			if (CurrentMagazine != null && allowMagazineRemoval)
+			if (CurrentMagazine != null && allowMagazineRemoval && !MagInternal)
 			{
 				RequestUnload(CurrentMagazine);
 				return true;
@@ -440,7 +440,7 @@
 				DequeueAndProcessServerShot();
 			}

-			if (queuedUnload && queuedShots.Count == 0 && allowMagazineRemoval)
+			if (queuedUnload && queuedShots.Count == 0 && allowMagazineRemoval && !MagInternal)
 			{
 				// done processing shot queue,
 				// perform the queued unload action, causing all clients and server to update their version of this Weapon


Added implicit cast from ReactivePropertyBase to it's value type.

--- Utilities.Reactive/ReactivePropertyBase.cs
+++ Utilities.Reactive/ReactivePropertyBase.cs
@@ -276,6 +276,14 @@
             return this.SetValidateNotifyError(xs => xs.Select(x => validator(x)));
         }

+        /// <summary>
+        /// Implicit conversion to the value
+        /// </summary>
+        public static implicit operator T(ReactivePropertyBase<T> property)
+        {
+            return property._latestValue;
+        }
+
         /// <summary>Get INotifyDataErrorInfo's error store</summary>
         public System.Collections.IEnumerable GetErrors(string propertyName)
         {


Using modified version of reactive command

--- ViewModels/ViewModels/MainPageViewModel.cs
+++ ViewModels/ViewModels/MainPageViewModel.cs
@@ -13,8 +13,6 @@
     public class MainPageViewModel : ViewModel, IDisposable
     {
         private readonly ReadonlyReactiveProperty<string> _formattedString;
-
-        private readonly IDisposable _shareSubscription;
         public ReadonlyReactiveProperty<bool> UpdateProperty { get; private set; }

         public ReactiveProperty<string> Text { get; private set; }
@@ -41,10 +39,9 @@
                                    .ToReadonlyReactiveProperty();

             ShareCommand = _formattedString.Select(text => Uri.IsWellFormedUriString(text, UriKind.Absolute))
-                                       .DistinctUntilChanged()
-                                       .ToReactiveCommand();
+                                           .DistinctUntilChanged()
+                                           .ToReactiveCommand(_ => dataTransferService.Share("Share link", _formattedString.Value, new Uri(_formattedString.Value)));

-            _shareSubscription = ShareCommand.Subscribe(_ => dataTransferService.Share("Share link", _formattedString.Value, new Uri(_formattedString.Value)));

             var enterPressed = new Subject<bool>();

@@ -56,7 +53,6 @@

         public void Dispose()
         {
-            _shareSubscription.Dispose();
             _formattedString.Dispose();
             ShareCommand.Dispose();
             Text.Dispose();


- Adding option to YouTube chat client to indicate whether to poll for chat message or not

--- YouTube/YouTube.Base/Clients/ChatClient.cs
+++ YouTube/YouTube.Base/Clients/ChatClient.cs
@@ -35,22 +35,27 @@
         /// <summary>
         /// Connects to the chat for the current broadcast.
         /// </summary>
+        /// <param name="listenForMessage">Whether to enable message listen polling</param>
         /// <returns>Whether the connection was successful</returns>
-        public async Task<bool> Connect() { return await this.Connect(await this.connection.LiveBroadcasts.GetActiveBroadcast()); }
+        public async Task<bool> Connect(bool listenForMessage = true) { return await this.Connect(await this.connection.LiveBroadcasts.GetActiveBroadcast(), listenForMessage); }

         /// <summary>
         /// Connects to the specified broadcast.
         /// </summary>
         /// <param name="broadcast">The broadcast to connect to</param>
+        /// <param name="listenForMessage">Whether to enable message listen polling</param>
         /// <returns>Whether the connection was successful</returns>
-        public Task<bool> Connect(LiveBroadcast broadcast)
+        public Task<bool> Connect(LiveBroadcast broadcast, bool listenForMessage = true)
         {
             this.broadcast = broadcast;

-            this.messageBackgroundPollingTokenSource = new CancellationTokenSource();
+            if (listenForMessage)
+            {
+                this.messageBackgroundPollingTokenSource = new CancellationTokenSource();
 #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
-            Task.Run(this.MessageBackgroundPolling, this.messageBackgroundPollingTokenSource.Token);
+                Task.Run(this.MessageBackgroundPolling, this.messageBackgroundPollingTokenSource.Token);
 #pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
+            }

             return Task.FromResult(true);
         }


I made the menu interactive, added a pointer and a better functionality, also the position of the properties is fixed in the center.

--- AFTH/Game/Game.cs
+++ AFTH/Game/Game.cs
@@ -5,6 +5,7 @@
 using System.Threading.Tasks;
 using System.Threading;
 using System.IO;
+

 namespace Game
 {
@@ -22,7 +23,7 @@
         static long currentScore = 0; // The current score of the player
         static int lineHeight = 0; // Line position according to the player
         static bool gameNotOver = true; // Checks if the game is over - Tosho use this variable to switch it to false if it is over
-        static int[] bonusPosition = {1, size[1] / 2}; // Position of the bonus
+        static int[] bonusPosition = { 1, size[1] / 2 }; // Position of the bonus

         static void Main() //Main menu of the game
         {
@@ -30,27 +31,74 @@

             while (true)
             {
-                Console.Clear();
-                Console.WriteLine("Please choose:");
-                Console.WriteLine("1. Play");
-                Console.WriteLine("2. Highscores");
-                Console.WriteLine("3. Options");
-                Console.WriteLine("4. Exit");
+                Console.Clear();
+                for (int i = 0; i < 5; i++)                //If this for was missing
+                {
+                    Console.WriteLine();
+                }
+
+                Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "Play"));        //Using basic formating, to be sure that everything is..
+                Console.WriteLine();                                                                    //..in the center.
+                Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "Highscores"));
+                Console.WriteLine();
+                Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "Options"));
+                Console.WriteLine();
+                Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "Exit"));
+                int startCol = 43;  int positionUpDown = 5;  //I just had to guess the right cordinates for the pointer.I've written them on one row so you know that these are the coordinates.
+                char arrowForMenu = (char)17; //The arrow for the menu.
+                while (true)
+                {
+                    Console.CursorVisible = false; //This here is making sure that the arrow wont be flashin
+                    Console.SetCursorPosition(startCol, positionUpDown);
+                    Console.WriteLine(arrowForMenu);
+                    Console.SetCursorPosition(startCol, positionUpDown);
+                    ConsoleKeyInfo MenuArrowPosition = Console.ReadKey();
+                    if (positionUpDown > 5 || positionUpDown <= 12)
+                    {
+
+                        if (MenuArrowPosition.Key == ConsoleKey.UpArrow)              //If up arrow is pressed the pointer goes down.
+                        {
+                            Console.SetCursorPosition(startCol, positionUpDown);
+                            Console.WriteLine(" ");
+
+                            positionUpDown -= 2;
+                        }
+                        else if (MenuArrowPosition.Key == ConsoleKey.DownArrow)       //If down arrow is pressed the pointer goes down.
+                        {
+                            Console.SetCursorPosition(startCol, positionUpDown);
+                            Console.WriteLine(" ");
+                            positionUpDown += 2;
+                        }
+                    }
+                    if (positionUpDown < 5)  //Making sure that the arrow will not get too high.
+                    {
+                        positionUpDown = 11;
+                    }
+                    if (positionUpDown > 12) //Making sure that the arrow will not get too low.
+                    {
+                        positionUpDown = 5;
+                    }
+                    if (MenuArrowPosition.Key == ConsoleKey.Enter)   //This break here is making sure that we break to switch .
+                    {
+                        break;
+                    }
+                }
+
                 try
                 {
-                    int choice = int.Parse(Console.ReadLine());
-                    switch (choice)
+
+                    switch (positionUpDown - 4)
                     {
                         case 1:
                             Play(size[0], size[1]);
                             break;
-                        case 2:
+                        case 3:
                             Highscores();
                             break;
-                        case 3:
+                        case 5:
                             size = Options(size);
                             break;
-                        case 4:
+                        case 7:
                             ExitConfirm();
                             break;
                         default:
@@ -87,15 +135,15 @@
                     if (i == size[1] / 2)
                     {
                         if (gameNotOver)
-                        {
+                        {
                             renderer.Append("  Score: "); // Draws the score
                             renderer.Append(currentScore);
                         }
                         else
-	                    {
+                        {
                             Console.ForegroundColor = ConsoleColor.Red;
                             renderer.Append("  GAME OVER!!!"); // Game over message
-	                    }
+                        }
                     }
                     renderer.Append("\n");
                 }
@@ -156,9 +204,10 @@
             ReadScores();
             Console.ReadLine();
         }
-
+
         static char[,] Board(char[,] board, int[] line, int[] playerPosition, int[] bonusPosition) //Fills the game board
-        {
+        {
+            char characterFace = (char)1;
             try
             {
                 for (int i = 0; i < board.GetLength(0); i++)
@@ -179,7 +228,7 @@
                     board[i, line[1]] = 'X';
                 }
                 board[line[0], line[1]] = ' ';
-                board[playerPosition[0], playerPosition[1]] = '@';
+                board[playerPosition[0], playerPosition[1]] = characterFace;
                 board[bonusPosition[0], bonusPosition[1]] = '+';
                 lineHeight = line[1]; // Check the position of the player according to the line
             }


Connector. Small fix.

Connector. Small fix.

--- Algo/Connector.cs
+++ Algo/Connector.cs
@@ -631,6 +631,9 @@
 		/// <param name="criteria">The instrument whose fields will be used as a filter.</param>
 		public void LookupSecurities(Security criteria)
 		{
+			if (criteria == null)
+				throw new ArgumentNullException(nameof(criteria));
+
 			var boardCode = criteria.Board != null ? criteria.Board.Code : string.Empty;
 			var securityCode = criteria.Code ?? string.Empty;


Added names to tasks

Added names to tasks

--- Assets/Scripts/Data/DTask.cs
+++ Assets/Scripts/Data/DTask.cs
@@ -9,17 +9,24 @@
     private static int NEXT_ID = 0;

     private int id;
+    private string taskName;
     private DBuilding building;
     private DPerson person;
     private DResource output;

-    public DTask(DBuilding dBuilding, DResource dOutput)
+    public DTask(DBuilding dBuilding, DResource dOutput, string name)
     {
         id = NEXT_ID++;
         building = dBuilding;
         output = dOutput;

+        taskName = "default_task";
+
         dBuilding.AddTask(this);
+    }
+
+    public DTask(DBuilding dBuilding, DResource dOutput) : this(dBuilding, dOutput, "default_name")
+    {
     }

     public void ClearPerson()
@@ -31,6 +38,12 @@
     {
         get { return person; }
         set { person = value; }
+    }
+
+    public string Name
+    {
+        get { return taskName; }
+        set { taskName = value; }
     }

     public int Id


rocket timeout

rocket timeout

--- Assets/Scripts/Projectile.cs
+++ Assets/Scripts/Projectile.cs
@@ -10,6 +10,7 @@
 	internal Transform xform;
 	internal Rigidbody body;
 	internal ParticleSystem particles;
+	float timeout;

 	public bool IsPrefab { get { return prefab == null; } }

@@ -38,6 +39,7 @@
 	}

 	void Init(Vector2 initDir) {
+		timeout = 0f;
 		particles.Clear();
 		body.velocity = Hero.inst.body.velocity.magnitude * initDir;
 		body.rotation = Quaternion.FromToRotation (new Vector3 (1, 0, 0), initDir);
@@ -66,8 +68,13 @@
 	}

 	void FixedUpdate() {
-		body.AddForce (Vec(0, -1, 0));
-		body.AddForce (xform.right * 10f);
+		timeout += Time.fixedDeltaTime;
+		if (timeout > 10f) {
+			Release();
+		} else {
+			body.AddForce (Vec(0, -1, 0));
+			body.AddForce (xform.right * 10f);
+		}

 	}


Syntax error for project tile threshold fixed

Syntax error for project tile threshold fixed - PT

--- Assets/Scripts/Projectile.cs
+++ Assets/Scripts/Projectile.cs
@@ -11,7 +11,7 @@
 	private int currFire;
 	public float bulletSpeed = 100;

-	public static shootVolumeTreshold = 0.2f;
+	public static float shootVolumeTreshold = 0.2f;
 	//buffer so you can buffer shots
 	private int bufferFrames = 1;
 	private int currBuff;


FindLast test pass.

FindLast test pass.

--- BTDB/BTreeLib/BTreeImpl12.cs
+++ BTDB/BTreeLib/BTreeImpl12.cs
@@ -494,6 +494,28 @@
             return l * 2;
         }

+        int BinarySearchKeysLast(Span<ushort> offsets, Span<byte> keys, ReadOnlySpan<byte> key)
+        {
+            var l = 0;
+            var r = offsets.Length - 1;
+            while (l < r)
+            {
+                var m = (l + r) / 2;
+                var start = offsets[m];
+                var middleKey = keys.Slice(start, Math.Min(offsets[m + 1] - start, key.Length));
+                var comp = middleKey.SequenceCompareTo(key);
+                if (comp <= 0)
+                {
+                    l = m + 1;
+                }
+                else
+                {
+                    r = m;
+                }
+            }
+            return l;
+        }
+
         int BinarySearchLongKeys(Span<IntPtr> keys, ReadOnlySpan<byte> key)
         {
             var l = 0;
@@ -519,6 +541,27 @@
             return l * 2;
         }

+        int BinarySearchLongKeysLast(Span<IntPtr> keys, ReadOnlySpan<byte> key)
+        {
+            var l = 0;
+            var r = keys.Length;
+            while (l < r)
+            {
+                var m = (l + r) / 2;
+                var middleKey = NodeUtils12.LongKeyPtrToSpan(keys[m]);
+                var comp = middleKey.Slice(0, Math.Min(middleKey.Length, key.Length)).SequenceCompareTo(key);
+                if (comp <= 0)
+                {
+                    l = m + 1;
+                }
+                else
+                {
+                    r = m;
+                }
+            }
+            return l;
+        }
+
         internal unsafe FindResult Find(RootNode12 rootNode, ref StructList<CursorItem> stack, ReadOnlySpan<byte> key)
         {
             stack.Clear();
@@ -670,36 +713,93 @@
                 if (header._keyPrefixLength > 0)
                 {
                     var prefix = new Span<byte>((top + (int)header.Size).ToPointer(), header._keyPrefixLength);
-                    if (prefix.SequenceCompareTo(keyPrefix) < 0)
-                    {
+                    var commonLen = Math.Min(prefix.Length, keyPrefix.Length);
+                    var comp = prefix.Slice(0, commonLen).SequenceCompareTo(keyPrefix.Slice(0, commonLen));
+                    if (comp < 0)
+                    {
+                        if (!header.IsNodeLeaf)
+                        {
+                            stack.Add().Set(top, (byte)(header._childCount - 1));
+                            top = NodeUtils12.GetBranchValuePtr(top, header._childCount - 1);
+                            continue;
+                        }
                         stack.Clear();
                         return false;
                     }
-                    throw new NotImplementedException();
+                    if (comp > 0)
+                    {
+                        if (!header.IsNodeLeaf)
+                        {
+                            stack.Add().Set(top, 0);
+                            top = NodeUtils12.GetBranchValuePtr(top, 0);
+                            continue;
+                        }
+                        stack.Clear();
+                        return false;
+                    }
+                    if (prefix.Length >= keyPrefix.Length)
+                    {
+                        stack.Add().Set(top, (byte)(header._childCount - 1));
+                        if (!header.IsNodeLeaf)
+                        {
+                            top = NodeUtils12.GetBranchValuePtr(top, header._childCount - 1);
+                            continue;
+                        }
+                        return true;
+                    }
                 }
                 var keyRest = keyPrefix.Slice(header._keyPrefixLength);
                 int idx;
                 if (header.HasLongKeys)
                 {
                     var keys = NodeUtils12.GetLongKeyPtrs(top);
-                    idx = BinarySearchLongKeys(keys, keyRest);
+                    idx = BinarySearchLongKeysLast(keys, keyRest);
+                    if (header.IsNodeLeaf)
+                    {
+                        if (idx >= header._childCount)
+                        {
+                            idx--;
+                        }
+                        else if (idx > 0)
+                        {
+                            var k = NodeUtils12.LongKeyPtrToSpan(keys[idx]);
+                            if (k.Slice(0, Math.Min(k.Length, keyPrefix.Length)).SequenceCompareTo(keyPrefix) > 0)
+                                idx--;
+                        }
+                        if (!IsKeyPrefix(top, idx, keyPrefix))
+                        {
+                            stack.Clear();
+                            return false;
+                        }
+                        stack.Add().Set(top, (byte)idx);
+                        return true;
+                    }
                 }
                 else
                 {
                     var offsets = NodeUtils12.GetKeySpans(top, out var keys);
-                    idx = BinarySearchKeys(offsets, keys, keyRest);
-                }
-                if (header.IsNodeLeaf)
-                {
-                    if ((idx & 1) != 0)
-                    {
-                        stack.Add().Set(top, (byte)(idx >> 1));
+                    idx = BinarySearchKeysLast(offsets, keys, keyRest);
+                    if (header.IsNodeLeaf)
+                    {
+                        if (idx >= header._childCount)
+                        {
+                            idx--;
+                        }
+                        else if (idx > 0)
+                        {
+                            var k = GetShortKey(offsets, keys, idx);
+                            if (k.Slice(0, Math.Min(k.Length, keyPrefix.Length)).SequenceCompareTo(keyPrefix) > 0)
+                                idx--;
+                        }
+                        if (!IsKeyPrefix(top, idx, keyPrefix))
+                        {
+                            stack.Clear();
+                            return false;
+                        }
+                        stack.Add().Set(top, (byte)idx);
                         return true;
                     }
-                    stack.Clear();
-                    return false;
-                }
-                idx = (idx + 1) >> 1;
+                }
                 stack.Add().Set(top, (byte)idx);
                 top = NodeUtils12.GetBranchValuePtr(top, idx);
             }


notes

notes

--- Bend/Database/StepsReplDB.cs
+++ Bend/Database/StepsReplDB.cs
@@ -14,6 +14,10 @@

 // TODO: need to generate a new LOG server-guid EVERYTIME we restart a log, to be sure we don't
 //        collide with our old log.
+
+// TODO: make sure non-active servers will never respond to getServerLogStatus() requests
+
+// TODO: fix repl-full-copy so it doesn't jsut happen to work because data happens before logs in the keyspace!

 /*
  * TODO:
@@ -331,7 +335,6 @@

                 yield return _statusForLog(server_guid);
             }
-
         }

         public string getDataInstanceId() {