Fix failing unit tests

Fix failing unit tests

--- Tests/Algorithm/Framework/Portfolio/PortfolioTargetTests.cs
+++ Tests/Algorithm/Framework/Portfolio/PortfolioTargetTests.cs
@@ -41,7 +41,7 @@
             security.Holdings.SetHoldings(1m, holdings);

             var buyingPowerMock = new Mock<IBuyingPowerModel>();
-            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(algorithm.Portfolio, security, targetPercent * (1 - algorithm.Settings.FreePortfolioValuePercentage)))
+            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(It.IsAny<GetMaximumOrderQuantityForTargetValueContext>()))
                 .Returns(new GetMaximumOrderQuantityForTargetValueResult(bpmQuantity, null, false));
             security.BuyingPowerModel = buyingPowerMock.Object;

@@ -83,7 +83,7 @@
             security.Holdings.SetHoldings(1m, holdings);

             var buyingPowerMock = new Mock<IBuyingPowerModel>();
-            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(algorithm.Portfolio, security, targetPercent * (1 - algorithm.Settings.FreePortfolioValuePercentage)))
+            buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(It.IsAny<GetMaximumOrderQuantityForTargetValueContext>()))
                 .Returns(new GetMaximumOrderQuantityForTargetValueResult(0, "The portfolio does not have enough margin available."));
             security.BuyingPowerModel = buyingPowerMock.Object;


Attempt to delete Downloads subdirectory, suppress error on fail

- Possible fix for Automation Tests 'file access' error

--- Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs
+++ Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs
@@ -119,19 +119,18 @@
 					MatterControlUtilities.PrepForTestRun(testRunner);
 					MatterControlUtilities.CreateDownloadsSubFolder();

-					//Navigate to Downloads Library Provider
-					testRunner.ClickByName("Library Tab");
-					MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
-					MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");
-					testRunner.ClickByName("Library Add Button");
-					testRunner.Wait(2);
-
-					//Add AMF part items to Downloads and then type paths into file dialogues
+					// Navigate to Downloads Library Provider
+					testRunner.ClickByName("Library Tab");
+					MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
+					MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");
+					testRunner.ClickByName("Library Add Button");
+					testRunner.Wait(2);
+
+					// Add AMF part items to Downloads and then type paths into file dialogs
 					testRunner.Wait(2);
 					testRunner.Type(MatterControlUtilities.GetTestItemPath("Test.zip"));
 					testRunner.Wait(1);
 					testRunner.Type("{Enter}");
-

 					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Chinese Dragon", 2), "Chinese Dragon item exists");
 					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item chichen-itza pyramid", 2), "chichen-itza item exists");
@@ -149,10 +148,15 @@
 				testHarness = MatterControlUtilities.RunTest(testToRun);
 			}
 			catch { }
-			finally
-			{
-				MatterControlUtilities.DeleteDownloadsSubFolder();
-			}
+
+			// Give MatterControl a moment to shutdown
+			Thread.Sleep(2000);
+			try
+			{
+				// Then attempt to clean up
+				MatterControlUtilities.DeleteDownloadsSubFolder();
+			}
+			catch { }

 			Assert.IsTrue(testHarness.AllTestsPassed(3));
 		}


Don't run Controls unit tests in parallel.

--- Tests/Perspex.Controls.UnitTests/Properties/AssemblyInfo.cs
+++ Tests/Perspex.Controls.UnitTests/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
+using Xunit;

 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
@@ -34,3 +35,6 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
+
+// Don't run tests in parallel.
+[assembly: CollectionBehavior(DisableTestParallelization = true)]


Remove dead code

Remove dead code

--- Desktop/Tempest/ObjectSerializer.cs
+++ Desktop/Tempest/ObjectSerializer.cs
@@ -206,21 +206,6 @@
 					#endif

 					throw new ArgumentException ("No serializer found for type " + t);
-
-					//oserializer.LoadMembers (t);
-
-					//value = oserializer.ctor.Invoke (null);
-
-					//foreach (var kvp in oserializer.members)
-					//{
-					//    object mvalue = kvp.Value.Deserializer (c, r, false);
-					//    if (kvp.Key.MemberType == MemberTypes.Field)
-					//        ((FieldInfo)kvp.Key).SetValue (value, mvalue);
-					//    else if (kvp.Key.MemberType == MemberTypes.Property)
-					//        ((PropertyInfo)kvp.Key).SetValue (value, mvalue, null);
-					//}
-
-					//return value;
 				};
 			}
 		}
@@ -362,59 +347,9 @@
 					#endif

 					throw new ArgumentException ("No serializer found or specified for type " + t, "value");
-
-					//LoadMembers (t);
-
-					//var props = this.members;
-
-					//foreach (var kvp in props)
-					//{
-					//    if (kvp.Key.MemberType == MemberTypes.Field)
-					//        kvp.Value.Serializer (c, w, ((FieldInfo)kvp.Key).GetValue (v), false);
-					//    else if (kvp.Key.MemberType == MemberTypes.Property)
-					//        kvp.Value.Serializer (c, w, ((PropertyInfo)kvp.Key).GetValue (v, null), false);
-					//}
 				};
 			}
 		}
-
-		//private void LoadMembers (Type t)
-		//{
-		//	LoadCtor (t);
-
-		//	if (this.members != null)
-		//		return;
-
-		//	this.members = t.GetMembers (BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.GetField | BindingFlags.NonPublic)
-		//					.Where (mi =>
-		//					{
-		//						if (mi.MemberType == MemberTypes.Field)
-		//						{
-		//							var fi = (FieldInfo)mi;
-		//							if (typeof(Delegate).IsAssignableFrom (fi.FieldType.BaseType))
-		//								return false;
-
-		//							return !fi.IsInitOnly;
-		//						}
-		//						else if (mi.MemberType == MemberTypes.Property)
-		//						{
-		//							var p = (PropertyInfo)mi;
-		//							return (p.GetSetMethod() != null && p.GetIndexParameters().Length == 0);
-		//						}
-
-		//						return false;
-		//					})
-		//					.ToDictionary (mi => mi, mi =>
-		//					{
-		//						ObjectSerializer os = null;
-		//						if (mi.MemberType == MemberTypes.Field)
-		//							os = GetSerializerInternal (((FieldInfo)mi).FieldType);
-		//						else if (mi.MemberType == MemberTypes.Property)
-		//							os = GetSerializerInternal (((PropertyInfo)mi).PropertyType);
-
-		//						return new SerializationPair (os.Deserialize, os.Serialize);
-		//					});
-		//}

 		private void LoadCtor (Type t)
 		{


tester seems to be working

tester seems to be working

--- Tester/FormMain.cs
+++ Tester/FormMain.cs
@@ -1520,13 +1520,14 @@
         {
             groupBoxDistribution2.Controls.Clear();

-            var propertyInfos =
-                currentDistribution.GetType()
-                                   .GetProperties(BindingFlags.Public | BindingFlags.Instance |
-                                                  BindingFlags.DeclaredOnly);
+            // We get IDistribution properties, so we can eliminate them from the specific distribution type.
+            var distProps = typeDistribution.GetProperties(BindingFlags.Public | BindingFlags.Instance);
+            var distPropsSet = new HashSet<string>(distProps.Select(p => p.Name));
+
+            var propertyInfos = currentDistribution.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
             var count = 0;
             foreach (var propertyInfo in propertyInfos) {
-                if ((propertyInfo.PropertyType != typeof(double) && propertyInfo.PropertyType != typeof(int)) ||
+                if (distPropsSet.Contains(propertyInfo.Name) || (propertyInfo.PropertyType != typeof(double) && propertyInfo.PropertyType != typeof(int)) ||
                     !propertyInfo.CanRead || !propertyInfo.CanWrite) {
                     continue;
                 }


Clean up the tracking collection and document more

--- TrackingCollection/TrackingCollection/TrackingCollection.cs
+++ TrackingCollection/TrackingCollection/TrackingCollection.cs
@@ -19,10 +19,20 @@

 namespace GitHub.Collections
 {
-    public class TrackingCollection<T> : ObservableCollection<T>, IDisposable
-        where T : class, ICopyable<T>
+    /// <summary>
+    /// TrackingCollection is a specialization of ObservableCollection that gets items from
+    /// an observable sequence and updates its contents in such a way that two updates to
+    /// the same object (as defined by an Equals call) will result in one object on
+    /// the list being updated (as opposed to having two different instances of the object
+    /// added to the list).
+    /// It is always sorted, either via the supplied comparer or using the default comparer
+    /// for T
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public class TrackingCollection<T> : ObservableCollection<T>, ITrackingCollection<T>, IDisposable
+        where T : class, ICopyable<T>, IComparable<T>
     {
-        protected enum TheAction
+        enum TheAction
         {
             None,
             Move,
@@ -30,7 +40,7 @@
             Insert
         }

-        CompositeDisposable disposables = new CompositeDisposable();
+        readonly CompositeDisposable disposables = new CompositeDisposable();
         IObservable<T> source;
         IObservable<T> sourceQueue;
         Func<T, T, int> comparer;
@@ -39,15 +49,23 @@
         int itemCount = 0;
         ConcurrentQueue<T> queue;

-        List<T> original = new List<T>();
+        readonly List<T> original = new List<T>();
 #if DEBUG
         public IList<T> DebugInternalList => original;
 #endif

+        // lookup optimizations
+        // for speeding up IndexOf in the unfiltered list
+        readonly Dictionary<T, int> sortedIndexCache = new Dictionary<T, int>();
+
+        // for speeding up IndexOf in the filtered list
+        readonly Dictionary<T, int> filteredIndexCache = new Dictionary<T, int>();
+
         TimeSpan delay;
         TimeSpan requestedDelay;
         TimeSpan fuzziness;
-        public TimeSpan ProcessingDelay {
+        public TimeSpan ProcessingDelay
+        {
             get { return requestedDelay; }
             set
             {
@@ -55,7 +73,7 @@
                 delay = value;
             }
         }
-
+

         public TrackingCollection()
         {
@@ -72,9 +90,8 @@
 #else
             this.scheduler = scheduler ?? RxApp.MainThreadScheduler;
 #endif
-            this.comparer = comparer;
+            this.comparer = comparer ?? new Func<T, T, int>((o, p) => Comparer<T>.Default.Compare(o, p));
             this.filter = filter;
-            original = new List<T>();
         }

         public TrackingCollection(IObservable<T> source,
@@ -87,15 +104,25 @@
             Listen(source);
         }

+        /// <summary>
+        /// Sets up an observable as source for the collection.
+        /// </summary>
+        /// <param name="obs"></param>
+        /// <returns>An observable that will return all the items that are
+        /// fed via the original observer, for further processing by user code
+        /// if desired</returns>
         public IObservable<T> Listen(IObservable<T> obs)
         {
+            if (disposed)
+                throw new ObjectDisposedException("TrackingCollection");
+
             sourceQueue = obs
                 .Do(data => queue.Enqueue(data));

             source = Observable
                 .Generate(StartQueue(),
                     i => !disposed,
-                    i => i+1,
+                    i => i + 1,
                     i => GetFromQueue(),
                     i => delay
                 )
@@ -121,6 +148,30 @@
             return source;
         }

+        /// <summary>
+        /// Set a new comparer for the existing data. This will cause the
+        /// collection to be resorted and refiltered.
+        /// </summary>
+        /// <param name="theComparer">The comparer method for sorting, or null if not sorting</param>
+        public void SetComparer(Func<T, T, int> theComparer)
+        {
+            if (disposed)
+                throw new ObjectDisposedException("TrackingCollection");
+            SetAndRecalculateSort(theComparer);
+            SetAndRecalculateFilter(filter);
+        }
+
+        /// <summary>
+        /// Set a new filter. This will cause the collection to be filtered
+        /// </summary>
+        /// <param name="theFilter">The new filter, or null to not have any filtering</param>
+        public void SetFilter(Func<T, int, IList<T>, bool> theFilter)
+        {
+            if (disposed)
+                throw new ObjectDisposedException("TrackingCollection");
+            SetAndRecalculateFilter(theFilter);
+        }
+
         public IDisposable Subscribe()
         {
             if (source == null)
@@ -152,81 +203,56 @@
         {
             if (disposed)
                 throw new ObjectDisposedException("TrackingCollection");
-            var position = GetIndexUnfiltered(original, item);
-            var index = GetIndex(item);
+            var position = GetIndexUnfiltered(item);
+            if (position < 0)
+                return;
+            // unfiltered list update
             original.Remove(item);
+            sortedIndexCache.Remove(item);
+            UpdateIndexCache(original.Count - 1, position, original, sortedIndexCache);
+
+            // filtered list update
+            var index = GetIndexFiltered(item);
             InternalRemoveItem(item);
             RecalculateFilter(original, index, position, original.Count);
         }

-        Dictionary<T, int> objectToIndex = new Dictionary<T, int>();
-        void InternalAddItem(T item)
-        {
-            // optimization
-            objectToIndex.Add(item, Count);
-            // end of optimization
-            Add(item);
-        }
-
-        void InternalInsertItem(T item, int position)
-        {
-            // optimization
-            var keys = objectToIndex.Keys.ToList();
-            foreach (var o in keys)
-            {
-                if (objectToIndex[o] >= position)
-                    objectToIndex[o]++;
-            }
-            objectToIndex.Add(item, position);
-            // end of optimization
-            Insert(position, item);
-        }
-
-        void InternalRemoveItem(T item)
-        {
-            // optimization
-            var idx = objectToIndex[item];
-            objectToIndex.Remove(item);
-            var keys = objectToIndex.Keys.ToList();
-            foreach (var o in keys)
-            {
-                if (objectToIndex[o] > idx)
-                    objectToIndex[o]--;
-            }
-            // end of optimization
-
-            Remove(item);
-        }
-
-        void InternalMoveItem(T item, int positionFrom, int positionTo)
-        {
-            // optimization
-            if (positionFrom != positionTo)
-            {
-                objectToIndex.Remove(item);
-                var idxTo = positionFrom < positionTo ? positionTo - 1 : positionTo;
-                var keys = objectToIndex.Keys.ToList();
-                if (positionFrom < idxTo)
-                {
-                    foreach (var o in keys)
-                    {
-                        if (objectToIndex[o] > positionFrom && objectToIndex[o] <= idxTo)
-                            objectToIndex[o]--;
-                    }
-                }
-                else
-                {
-                    foreach (var o in keys)
-                    {
-                        if (objectToIndex[o] >= idxTo && objectToIndex[o] < positionFrom)
-                            objectToIndex[o]++;
-                    }
-                }
-                objectToIndex.Add(item, idxTo);
-            }
-            // end of optimization
-
-            Move(positionFrom, positionFrom < positionTo ? positionTo - 1 : positionTo);
+        void SetAndRecalculateSort(Func<T, T, int> compare)
+        {
+            comparer = compare;
+            var list = filter != null ? original : Items as List<T>;
+            RecalculateSort(list, 0, list.Count);
+        }
+
+        void RecalculateSort(List<T> list, int start, int end)
+        {
+            if (comparer == null)
+                return;
+
+            list.Sort(start, end, new LambdaComparer<T>(comparer));
+
+            // if there's a filter, then it's going to trigger events and we don't need to manually trigger them
+            if (filter == null)
+            {
+                OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+            }
+        }
+
+        void SetAndRecalculateFilter(Func<T, int, IList<T>, bool> newFilter)
+        {
+            if (filter == null && newFilter == null)
+                return; // nothing to do
+
+            ClearItems();
+            filter = newFilter;
+            RecalculateFilter(original, 0, 0, original.Count);
+        }
+
+        protected override void ClearItems()
+        {
+            filteredIndexCache.Clear();
+            base.ClearItems();
         }

         ActionData CheckFilter(ActionData data)
@@ -255,20 +281,18 @@
             return null;
         }

-        ActionData ProcessItem(T item, IList<T> list)
+        ActionData ProcessItem(T item, List<T> list)
         {
             ActionData ret;

-            var idx = list.IndexOf(item);
+            var idx = GetIndexUnfiltered(item);
             if (idx >= 0)
             {
                 var old = list[idx];
-                var comparison = 0;
-                if (comparer != null)
-                    comparison = comparer(item, old);
+                var comparison = comparer(item, old);

                 // no sorting to be done, just replacing the element in-place
-                if (comparer == null || comparison == 0)
+                if (comparison == 0)
                     ret = new ActionData(TheAction.None, item, null, idx, idx, list);
                 else
                     // element has moved, save the original object, because we want to update its contents and move it
@@ -278,7 +302,7 @@
             // the element doesn't exist yet
             // figure out whether we're larger than the last element or smaller than the first or
             // if we have to place the new item somewhere in the middle
-            else if (comparer != null && list.Count > 0)
+            else if (list.Count > 0)
             {
                 if (comparer(list[0], item) >= 0)
                     ret = new ActionData(TheAction.Insert, item, null, 0, -1, list);
@@ -290,10 +314,11 @@
                 // match the comparer that has been set
                 else
                 {
-                    idx = BinarySearch(list, 0, item, comparer);
+                    idx = BinarySearch(list, item, comparer);
                     if (idx < 0)
+                        idx = ~idx;
+                    if (idx == list.Count)
                         ret = new ActionData(TheAction.Add, item, null, list.Count, -1, list);
-
                     else
                         ret = new ActionData(TheAction.Insert, item, null, idx, -1, list);
                 }
@@ -324,6 +349,7 @@
             if (data.TheAction != TheAction.Insert)
                 return data;
             data.List.Insert(data.Position, data.Item);
+            UpdateIndexCache(data.Position, data.List.Count, data.List, sortedIndexCache);
             return data;
         }
         ActionData SortedMove(ActionData data)
@@ -331,7 +357,7 @@
             if (data.TheAction != TheAction.Move)
                 return data;
             data.OldItem.CopyFrom(data.Item);
-            var pos = FindNewPositionForItem(data.OldPosition, data.Position < 0, data.List, comparer);
+            var pos = FindNewPositionForItem(data.OldPosition, data.Position < 0, data.List, comparer, sortedIndexCache);
             // the old item is the one moving around
             return new ActionData(data.TheAction, data.OldItem, null, pos, data.OldPosition, data.List);
         }
@@ -348,7 +374,7 @@

         ActionData CalculateIndexes(ActionData data)
         {
-            data.Index = GetIndex(data.Item);
+            data.Index = GetIndexFiltered(data.Item);
             data.IndexPivot = GetLiveListPivot(data.Position, data.List);
             return data;
         }
@@ -405,7 +431,7 @@
             // if there's no filter, the filtered list is equal to the unfiltered list, just move
             if (filter == null)
             {
-                MoveAndRecalculate(data.List, data.Item, data.Index, data.IndexPivot, start, end);
+                MoveAndRecalculate(data.List, data.Index, data.IndexPivot, start, end);
                 return data;
             }

@@ -416,8 +442,8 @@
             // moving an item outside the bounds of the filter can affect the items being currently shown/hidden)
             if (Count > 0)
             {
-                startPosition = GetIndexUnfiltered(data.List, this[0]);
-                endPosition = GetIndexUnfiltered(data.List, this[Count - 1]);
+                startPosition = GetIndexUnfiltered(this[0]);
+                endPosition = GetIndexUnfiltered(this[Count - 1]);
                 // true if the filtered list has been indirectly affected by this objects' move
                 filteredListChanged = (!filter(this[0], startPosition, this) || !filter(this[Count - 1], endPosition, this));
             }
@@ -437,7 +463,7 @@

             // move the object and recalculate the filter between the bounds of the move
             else if (data.IsIncluded)
-                MoveAndRecalculate(data.List, data.Item, data.Index, data.IndexPivot, start, end);
+                MoveAndRecalculate(data.List, data.Index, data.IndexPivot, start, end);

             // recalculate the filter for every item, there's no way of telling what changed
             else if (filteredListChanged)
@@ -490,7 +516,7 @@
                 var needToBacktrack = false;
                 if (!Equals(item, list[position]))
                 {
-                    var idx = GetIndex(list[position]);
+                    var idx = GetIndexFiltered(list[position]);
                     if (idx >= 0)
                     {
                         needToBacktrack = true;
@@ -526,17 +552,17 @@
         /// for all objects between the bounds of the affected indexes
         /// </summary>
         /// <param name="list">The unfiltered, sorted list of items</param>
-        /// <param name="obj"></param>
         /// <param name="from">Index in the live list where the object is</param>
         /// <param name="to">Index in the live list where the object is going to be</param>
         /// <param name="start">Index in the unfiltered, sorted list to start reevaluating the filter</param>
         /// <param name="end">Index in the unfiltered, sorted list to end reevaluating the filter</param>
-        void MoveAndRecalculate(IList<T> list, T item, int from, int to, int start, int end)
+        /// <param name="obj"></param>
+        void MoveAndRecalculate(IList<T> list, int from, int to, int start, int end)
         {
             if (start > end)
                 throw new ArgumentOutOfRangeException(nameof(start), "Start cannot be bigger than end, evaluation of the filter goes forward.");

-            InternalMoveItem(item, from, to);
+            InternalMoveItem(from, to);
             to++;
             start++;
             RecalculateFilter(list, to, start, end);
@@ -557,7 +583,7 @@
             for (int i = start; i < end; i++)
             {
                 var obj = list[i];
-                var idx = GetIndex(obj);
+                var idx = GetIndexFiltered(obj);
                 var isIncluded = filter(obj, i, this);

                 // element is still included and hasn't changed positions
@@ -593,7 +619,7 @@
             {
                 for (int i = position - 1; i >= 0; i--)
                 {
-                    index = GetIndex(list[i]);
+                    index = GetIndexFiltered(list[i]);
                     if (index >= 0)
                     {
                         // found an element to the left of what we want, so now we know the index where to start
@@ -610,51 +636,146 @@
             return index;
         }

-        int GetIndex(T item)
-        {
-            // optimization
+        void RaiseMoveEvent(T item, int from, int to)
+        {
+            OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, item, to, from));
+        }
+
+        void RaiseResetEvent()
+        {
+            OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+        }
+
+        /// <summary>
+        /// Adds an item to the filtered list
+        /// </summary>
+        void InternalAddItem(T item)
+        {
+            Add(item);
+        }
+
+        /// <summary>
+        /// Inserts an item into the filtered list
+        /// </summary>
+        void InternalInsertItem(T item, int position)
+        {
+            Insert(position, item);
+        }
+
+        protected override void InsertItem(int index, T item)
+        {
+            filteredIndexCache.Add(item, index);
+            UpdateIndexCache(index, Count, Items, filteredIndexCache);
+            base.InsertItem(index, item);
+        }
+
+        /// <summary>
+        /// Removes an item from the filtered list
+        /// </summary>
+        void InternalRemoveItem(T item)
+        {
             int idx = -1;
-            if (objectToIndex.TryGetValue(item, out idx))
+            if (!filteredIndexCache.TryGetValue(item, out idx))
+                return;
+            RemoveItem(idx);
+        }
+
+        protected override void RemoveItem(int index)
+        {
+            filteredIndexCache.Remove(this[index]);
+            UpdateIndexCache(Count - 1, index, Items, filteredIndexCache);
+            base.RemoveItem(index);
+        }
+
+        /// <summary>
+        /// Moves an item in the filtered list
+        /// </summary>
+        void InternalMoveItem(int positionFrom, int positionTo)
+        {
+            positionTo = positionFrom < positionTo ? positionTo - 1 : positionTo;
+            Move(positionFrom, positionTo);
+        }
+
+        protected override void MoveItem(int oldIndex, int newIndex)
+        {
+            if (oldIndex != newIndex)
+            {
+                UpdateIndexCache(newIndex, oldIndex, Items, filteredIndexCache);
+                filteredIndexCache[this[oldIndex]] = newIndex;
+            }
+            base.MoveItem(oldIndex, newIndex);
+        }
+
+        /// <summary>
+        /// The filtered list always has a cache filled up with
+        /// all the items that are visible.
+        /// </summary>
+        int GetIndexFiltered(T item)
+        {
+            int idx = -1;
+            if (filteredIndexCache.TryGetValue(item, out idx))
                 return idx;
             return -1;
-            //return IndexOf(item);
-        }
-
-        int GetIndexUnfiltered(IList<T> list, T item)
-        {
-            return list.IndexOf(item);
-        }
-
-        void RaiseMoveEvent(T item, int from, int to)
-        {
-            OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, item, to, from));
-        }
-
-        void RaiseResetEvent()
-        {
-            OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
-        }
-
-        static int FindNewPositionForItem(int idx, bool lower, IList<T> list, Func<T, T, int> comparer)
+        }
+
+        /// <summary>
+        /// The unfiltered has a lazy cache that gets filled
+        /// up when something is looked up.
+        /// </summary>
+        /// <param name="item"></param>
+        /// <returns></returns>
+        int GetIndexUnfiltered(T item)
+        {
+            int ret = -1;
+            if (!sortedIndexCache.TryGetValue(item, out ret))
+            {
+                ret = original.IndexOf(item);
+                if (ret >= 0)
+                    sortedIndexCache.Add(item, ret);
+            }
+            return ret;
+        }
+
+        /// <summary>
+        /// When items get moved/inserted/deleted, update the indexes in the cache.
+        /// If start < end, we're inserting an item and want to shift all the indexes
+        /// between start and end to the right (+1)
+        /// If start > end, we're removing an item and want to shift all
+        /// indexes to the left (-1).
+        /// </summary>
+        static void UpdateIndexCache(int start, int end, IList<T> list, Dictionary<T, int> indexCache)
+        {
+            var change = end < start ? -1 : 1;
+            for (int i = start; i != end; i += change)
+                if (indexCache.ContainsKey(list[i]))
+                    indexCache[list[i]] += change;
+        }
+
+        static int FindNewPositionForItem(int idx, bool lower, IList<T> list, Func<T, T, int> comparer, Dictionary<T, int> indexCache)
         {
             var i = idx;
             if (lower) // replacing element has lower sorting order, find the correct spot towards the beginning
                 for (var pos = i - 1; i > 0 && comparer(list[i], list[pos]) < 0; i--, pos--)
+                {
                     Swap(list, i, pos);
+                    SwapIndex(list, i, 1, indexCache);
+                }
+
             else // replacing element has higher sorting order, find the correct spot towards the end
                 for (var pos = i + 1; i < list.Count - 1 && comparer(list[i], list[pos]) > 0; i++, pos++)
+                {
                     Swap(list, i, pos);
+                    SwapIndex(list, i, -1, indexCache);
+                }
+            indexCache[list[i]] = i;
             return i;
         }

         /// <summary>
         /// Swap two elements
         /// </summary>
-        /// <param name="list"></param>
-        /// <param name="left"></param>
-        /// <param name="right"></param>
         static void Swap(IList<T> list, int left, int right)
         {
             var l = list[left];
@@ -662,41 +783,18 @@
             list[right] = l;
         }

-        /// <summary>
-        /// Does a binary search for <paramref name="item"/>, and returns
-        /// its position. If <paramref name="item"/> is not on the list, returns
-        /// where it should be.
-        /// </summary>
-        /// <param name="list"></param>
-        /// <param name="start"></param>
-        /// <param name="item"></param>
-        /// <param name="comparer"></param>
-        /// <returns></returns>
-        static int BinarySearch(IList<T> list, int start, T item, Func<T, T, int> comparer)
-        {
-            int end = start + list.Count - 1;
-            while (start <= end)
-            {
-                var pivot = start + (end - start >> 1);
-                var result = comparer(list[pivot], item);
-                if (result == 0)
-                    return pivot;
-                if (result < 0)
-                {
-                    if (pivot > 0 && comparer(list[pivot + 1], item) >= 0)
-                        return pivot;
-                    start = pivot + 1;
-                }
-                else
-                {
-                    if (pivot < list.Count - 1 && comparer(list[pivot - 1], item) <= 0)
-                        return pivot;
-                    end = pivot - 1;
-                }
-            }
-            return start;
-        }
-
+        static void SwapIndex(IList<T> list, int pos, int change, Dictionary<T, int> cache)
+        {
+            if (cache.ContainsKey(list[pos]))
+                cache[list[pos]] += change;
+        }
+
+        static int BinarySearch(List<T> list, T item, Func<T, T, int> comparer)
+        {
+            return list.BinarySearch(item, new LambdaComparer<T>(comparer));
+        }
+
+#if DISABLE_REACTIVEUI
         static IScheduler GetScheduler(IScheduler scheduler)
         {
             Dispatcher d = null;
@@ -704,6 +802,7 @@
                 d = Dispatcher.FromThread(Thread.CurrentThread);
             return scheduler ?? (d != null ? new DispatcherScheduler(d) : null as IScheduler) ?? CurrentThreadScheduler.Instance;
         }
+#endif

         bool disposed = false;
         void Dispose(bool disposing)
@@ -725,20 +824,20 @@
             GC.SuppressFinalize(this);
         }

-        protected class ActionData : Tuple<TheAction, T, T, int, int, IList<T>>
+        class ActionData : Tuple<TheAction, T, T, int, int, List<T>>
         {
             public TheAction TheAction => Item1;
             public T Item => Item2;
             public T OldItem => Item3;
             public int Position => Item4;
             public int OldPosition => Item5;
-            public IList<T> List => Item6;
+            public List<T> List => Item6;

             public int Index { get; set; }
             public int IndexPivot { get; set; }
             public bool IsIncluded { get; set; }

-            public ActionData(TheAction action, T item, T oldItem, int position, int oldPosition, IList<T> list)
+            public ActionData(TheAction action, T item, T oldItem, int position, int oldPosition, List<T> list)
                 : base(action, item, oldItem, position, oldPosition, list)
             {
             }


Assembly info updated

Assembly info updated

--- DocForge/Properties/AssemblyInfo.cs
+++ DocForge/Properties/AssemblyInfo.cs
@@ -1,55 +1,55 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("DocForge")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("DocForge")]
-[assembly: AssemblyCopyright("Copyright ©  2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
-//inside a <PropertyGroup>.  For example, if you are using US english
-//in your source files, set the <UICulture> to en-US.  Then uncomment
-//the NeutralResourceLanguage attribute below.  Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
-    //(used if a resource is not found in the page,
-    // or application resource dictionaries)
-    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
-    //(used if a resource is not found in the page,
-    // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DocForge")]
+[assembly: AssemblyDescription("Class documentation generator")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Red Hammer Studios")]
+[assembly: AssemblyProduct("DocForge")]
+[assembly: AssemblyCopyright("Copyright ©  2015 Red Hammer Studios")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>.  For example, if you are using US english
+//in your source files, set the <UICulture> to en-US.  Then uncomment
+//the NeutralResourceLanguage attribute below.  Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+    //(used if a resource is not found in the page,
+    // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+    //(used if a resource is not found in the page,
+    // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]


Fix "dirty code"

Fix "dirty code"

--- WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -38,41 +38,51 @@

 			Actions = new ObservableCollection<WalletActionViewModel>();

+			SendTabViewModel sendTab = null;
 			// If hardware wallet then we need the Send tab.
 			if (walletService?.KeyManager?.IsHardwareWallet is true)
 			{
-				Actions.Add(new SendTabViewModel(this));
+				sendTab = new SendTabViewModel(this);
+				Actions.Add(sendTab);
 			}
 			// If not hardware wallet, but neither watch only then we also need the send tab.
 			else if (walletService?.KeyManager?.IsWatchOnly is false)
 			{
-				Actions.Add(new SendTabViewModel(this));
+				sendTab = new SendTabViewModel(this);
+				Actions.Add(sendTab);
 			}

-			Actions.Add(new ReceiveTabViewModel(this));
-			Actions.Add(new CoinJoinTabViewModel(this));
-			Actions.Add(new HistoryTabViewModel(this));
+			ReceiveTabViewModel receiveTab = new ReceiveTabViewModel(this);
+			CoinJoinTabViewModel coinjoinTab = new CoinJoinTabViewModel(this);
+			HistoryTabViewModel historyTab = new HistoryTabViewModel(this);

-			var advanced = new WalletAdvancedViewModel(this);
-			Actions.Add(advanced);
-			advanced.Items.Add(new WalletInfoViewModel(this));
-			advanced.Items.Add(new SendTabViewModel(this, isTransactionBuilder: true));
-			advanced.Items.Add(new TransactionBroadcasterViewModel(this));
+			var advancedAction = new WalletAdvancedViewModel(this);
+			WalletInfoViewModel infoTab = new WalletInfoViewModel(this);
+			SendTabViewModel buildTab = new SendTabViewModel(this, isTransactionBuilder: true);
+			TransactionBroadcasterViewModel broadcastTab = new TransactionBroadcasterViewModel(this);
+
+			Actions.Add(receiveTab);
+			Actions.Add(coinjoinTab);
+			Actions.Add(historyTab);
+
+			Actions.Add(advancedAction);
+			advancedAction.Items.Add(infoTab);
+			advancedAction.Items.Add(buildTab);
+			advancedAction.Items.Add(broadcastTab);

 			// Open and select tabs.
-
-			Actions?.OfType<SendTabViewModel>()?.FirstOrDefault()?.DisplayActionTab(); // If watchnonly this'll select and open the transaction builder.
+			sendTab?.DisplayActionTab();
 			if (receiveDominant)
 			{
-				Actions?.OfType<CoinJoinTabViewModel>()?.FirstOrDefault()?.DisplayActionTab();
-				Actions?.OfType<HistoryTabViewModel>()?.FirstOrDefault()?.DisplayActionTab();
-				Actions?.OfType<ReceiveTabViewModel>()?.FirstOrDefault()?.DisplayActionTab(); // So receive should be shown to the user.
+				coinjoinTab.DisplayActionTab();
+				historyTab.DisplayActionTab();
+				receiveTab.DisplayActionTab(); // So receive should be shown to the user.
 			}
 			else
 			{
-				Actions?.OfType<ReceiveTabViewModel>()?.FirstOrDefault()?.DisplayActionTab();
-				Actions?.OfType<CoinJoinTabViewModel>()?.FirstOrDefault()?.DisplayActionTab();
-				Actions?.OfType<HistoryTabViewModel>()?.FirstOrDefault()?.DisplayActionTab(); // So history should be shown to the user.
+				receiveTab.DisplayActionTab();
+				coinjoinTab.DisplayActionTab();
+				historyTab.DisplayActionTab(); // So history should be shown to the user.
 			}

 			LurkingWifeModeCommand = ReactiveCommand.CreateFromTask(async () =>


Fixed it! hehe xd

Fixed it! hehe xd

--- TexasHoldEm/Bot.cs
+++ TexasHoldEm/Bot.cs
@@ -28,7 +28,7 @@

 	private static double shownValuation(Gene gene, int state) {
 		double sum = 0;
-		for (int i = 0; i < 5; i++) {
+		for (int i = 0; i < state; i++) {
 			sum += gene.get(6 + (2 * i)) * similarity(GameStateWrapper.tableCard(i + 1), GameStateWrapper.ourCard(1)) + gene.get(7 + (2 * i)) * similarity(GameStateWrapper.tableCard(i + 1), GameStateWrapper.ourCard(2));
 		}
 		return sum;


fix: searching point here.

fix: searching point here.

--- CSharpGL/Scene/SceneNodes/PickableNode/PickableNode.IPickable/Pickers/+DrawArraysPicker/DrawArraysPicker.cs
+++ CSharpGL/Scene/SceneNodes/PickableNode/PickableNode.IPickable/Pickers/+DrawArraysPicker/DrawArraysPicker.cs
@@ -107,7 +107,7 @@
         {
             var vertexIds = new uint[] { searcher.Search(arg, lastVertexId, this), };
             vec3[] positions = FillPickedGeometrysPosition(vertexIds);
-            var pickedGeometry = new PickedGeometry(GeometryType.Line, positions, vertexIds, stageVertexId, this.Node);
+            var pickedGeometry = new PickedGeometry(GeometryType.Point, positions, vertexIds, stageVertexId, this.Node);

             return pickedGeometry;
         }


tests: fix failing test

tests: fix failing test

--- code/tests/NFluent.Tests/StructuredCheckShould.cs
+++ code/tests/NFluent.Tests/StructuredCheckShould.cs
@@ -31,7 +31,6 @@
         }

         [Test]
-        //[Ignore("WIP")]
         public void OfferErrorMessageWhenFailing()
         {
             var sut = new Dummy();
@@ -47,7 +46,7 @@
         }

         [Test]
-        [Ignore("WIP")]
+        //[Ignore("WIP")]
         public void SupportMultipleCriteria()
         {
             var sut = new Dummy();
@@ -59,7 +58,12 @@
                     "The checked value's x:",
                     "\t[0]",
                     "The expected value's x:",
-                    "\t[1]");
+                    "\t[1]",
+                    "The checked value's x is equal to the given one.",
+                    "The checked value's x:",
+                    "\t[0]",
+                    "The expected value's x: strictly greater than",
+                    "\t[0]");
         }

         [Test]


Remove redundant Invoke.

Remove redundant Invoke.

--- src/dotless.Core/engine/LessNodes/Selector.cs
+++ src/dotless.Core/engine/LessNodes/Selector.cs
@@ -36,7 +36,7 @@

         public static Selector Get(string key)
         {
-            return Selectors[key].Invoke();
+            return Selectors[key]();
         }
     }


added allow empty description in helpscreen

--- DotNet.Basics/ConsoleApp/CmdLine.cs
+++ DotNet.Basics/ConsoleApp/CmdLine.cs
@@ -194,9 +194,9 @@
                 while (s.Length < len + 3)
                     s += " ";
                 if (parameter.Required == Required.Yes)
-                    s += "<Required> ";
+                    s += "[Required] ";
                 if (parameter.AllowEmptyValue == AllowEmpty.Yes)
-                    s += "<EmptyValueAllowed> ";
+                    s += "[EmptyValueAllowed] ";
                 s += parameter.Help + Environment.NewLine;
                 help += s;
             }


Make detection of '!' token more consistent with other operator tokens

--- EOBot/Interpreter/BotTokenParser.cs
+++ EOBot/Interpreter/BotTokenParser.cs
@@ -64,19 +64,19 @@
                     return Token(BotTokenType.NewLine, inputChar.ToString());
                 }

-                if (inputChar == '/' && !_inputStream.EndOfStream && (char)_inputStream.Peek() == '*')
+                if (inputChar == '/' && !_inputStream.EndOfStream && Peek() == '*')
                 {
                     // skip the comment: block format
                     do
                     {
                         inputChar = Read();
-                    } while (!(inputChar == '*' && !_inputStream.EndOfStream && _inputStream.Peek() == '/'));
+                    } while (!(inputChar == '*' && !_inputStream.EndOfStream && Peek() == '/'));

                     // skip the slash ending the comment and set input char to the character after the comment
                     Read();
                     inputChar = Read();
                 }
-                else if (inputChar == '/' && !_inputStream.EndOfStream && (char)_inputStream.Peek() == '/')
+                else if (inputChar == '/' && !_inputStream.EndOfStream && Peek() == '/')
                 {
                     // skip the comment: line format
                     do
@@ -107,7 +107,7 @@
             else if (char.IsDigit(inputChar))
             {
                 var number = inputChar.ToString();
-                while (char.IsDigit((char)_inputStream.Peek()) && !_inputStream.EndOfStream)
+                while (char.IsDigit(Peek()) && !_inputStream.EndOfStream)
                     number += Read();
                 return Token(BotTokenType.Literal, number);
             }
@@ -126,7 +126,7 @@
                     case '"':
                         {
                             var stringLiteral = string.Empty;
-                            while ((char)_inputStream.Peek() != '"' && !_inputStream.EndOfStream)
+                            while (Peek() != '"' && !_inputStream.EndOfStream)
                                 stringLiteral += Read();

                             if (_inputStream.EndOfStream)
@@ -137,7 +137,7 @@
                         }
                     case '=':
                         {
-                            switch((char)_inputStream.Peek())
+                            switch(Peek())
                             {
                                 case '=':
                                     var nextChar = Read();
@@ -148,16 +148,18 @@
                         }
                     case '!':
                         {
-                            var nextChar = Peek();
-                            if (nextChar != '=')
-                                return Token(BotTokenType.NotOperator, inputChar.ToString());
-
-                            Read();
-                            return Token(BotTokenType.NotEqualOperator, inputChar.ToString() + nextChar);
+                            switch(Peek())
+                            {
+                                case '=':
+                                    var nextChar = Read();
+                                    return Token(BotTokenType.NotEqualOperator, inputChar.ToString() + nextChar);
+                                default:
+                                    return Token(BotTokenType.NotOperator, inputChar.ToString());
+                            }
                         }
                     case '>':
                         {
-                            switch ((char)_inputStream.Peek())
+                            switch (Peek())
                             {
                                 case '=':
                                     var nextChar = Read();
@@ -168,7 +170,7 @@
                         }
                     case '<':
                         {
-                            switch ((char)_inputStream.Peek())
+                            switch (Peek())
                             {
                                 case '=':
                                     var nextChar = Read();
@@ -183,7 +185,7 @@
                                 return Token(BotTokenType.Error, inputChar.ToString());

                             // ensure variable starts with letter or underscore before getting variable name
-                            inputChar = (char)_inputStream.Peek();
+                            inputChar = Peek();
                             if (!char.IsLetter(inputChar) && inputChar != '_')
                                 return Token(BotTokenType.Error, inputChar.ToString());


add gui layout options to bv

add gui layout options to bv

--- Editor/YesAndEditor/YesAndLayout.cs
+++ Editor/YesAndEditor/YesAndLayout.cs
@@ -398,8 +398,13 @@
 		}

 		// Begin a vertical layout.
-		public void BV () {
-			EditorGUILayout.BeginVertical ();
+		public void BV (GUIStyle style = null) {
+			if (style == null) {
+				EditorGUILayout.BeginVertical ();
+			}
+			else {
+				EditorGUILayout.BeginVertical (style);
+			}
 		}

 		// End a vertical layout.


add param

add param

--- ExpressionToCodeLib/ObjectToCode.cs
+++ ExpressionToCodeLib/ObjectToCode.cs
@@ -22,8 +22,8 @@
         => new CSharpFriendlyTypeName { IncludeGenericTypeArgumentNames = true, }.GetTypeName(type);

     public static string ToCSharpFriendlyTypeName(this Type type, ExpressionToCodeConfiguration config)
-        => type.ToCSharpFriendlyTypeName(config.UseFullyQualifiedTypeNames);
+        => type.ToCSharpFriendlyTypeName(config.UseFullyQualifiedTypeNames, true);

-    public static string ToCSharpFriendlyTypeName(this Type type, bool useFullyQualifiedTypeNames)
-        => new CSharpFriendlyTypeName { IncludeGenericTypeArgumentNames = true, UseFullyQualifiedTypeNames = useFullyQualifiedTypeNames, }.GetTypeName(type);
+    public static string ToCSharpFriendlyTypeName(this Type type, bool useFullyQualifiedTypeNames, bool includeGenericTypeArgumentNames)
+        => new CSharpFriendlyTypeName { IncludeGenericTypeArgumentNames = includeGenericTypeArgumentNames, UseFullyQualifiedTypeNames = useFullyQualifiedTypeNames, }.GetTypeName(type);
 }


Launcher Minor changes

Launcher Minor changes

--- FinesSE/FinesSE.Launcher/Program.cs
+++ FinesSE/FinesSE.Launcher/Program.cs
@@ -20,17 +20,7 @@
         static FitRunner CreateRunner()
         {
             var assemblies = new[] {
-                $"{nameof(FinesSE)}.{nameof(Bootstrapper)}.dll",
-                $"{nameof(FinesSE)}.Contracts.dll",
-                $"{nameof(FinesSE)}.Core.dll",
-                $"{nameof(FinesSE)}.Drivers.dll",
-                $"{nameof(FinesSE)}.Expressions.dll",
-                $"{nameof(FinesSE)}.Outil.dll",
-                $"{nameof(FinesSE)}.Outil.Expressions.dll",
-                $"{nameof(FinesSE)}.Outil.Reports.dll",
-                $"{nameof(FinesSE)}.Outil.VisualRegression.dll",
-                $"{nameof(FinesSE)}.Reports.dll",
-                $"{nameof(FinesSE)}.VisualRegression.dll",
+                $"{nameof(FinesSE)}.{nameof(Bootstrapper)}.dll"
             };
             var namespaces = new[] { $"{nameof(FinesSE)}.{nameof(Bootstrapper)}" };
             return new FitRunner(assemblies, namespaces);


move some Feature tests to reorganize code

--- FlipperDotNet.Tests/FeatureTests.cs
+++ FlipperDotNet.Tests/FeatureTests.cs
@@ -240,6 +240,12 @@
             Assert.That(_feature.BooleanValue, Is.False);
         }
     }
+
+    [TestFixture, Ignore]
+    public class FeatureGroupsValueTests { }
+
+    [TestFixture, Ignore]
+    public class FeatureActorsValueTests { }

     [TestFixture]
     public class FeaturePercentageOfTimeValueTests
@@ -370,12 +376,4 @@

     [TestFixture, Ignore]
     public class DisabledGroupsTests { }
-
-    [TestFixture, Ignore]
-    public class FeatureGroupsValueTests { }
-
-
-    [TestFixture, Ignore]
-    public class FeatureActorsValueTests { }
-
 }


Check for null

Check for null

--- GUI/Types/Renderer/WorldRenderer.cs
+++ GUI/Types/Renderer/WorldRenderer.cs
@@ -261,7 +261,7 @@
                 var objColor = Vector4.One;

                 // Parse colour if present
-                if (colour.Length == 4)
+                if (colour != default && colour.Length == 4)
                 {
                     objColor.X = colour[0] / 255.0f;
                     objColor.Y = colour[1] / 255.0f;


registration ifx

registration ifx

--- HRI/Controllers/HriApiController.cs
+++ HRI/Controllers/HriApiController.cs
@@ -138,11 +138,6 @@
                 {

                     // If there was an error, return an error and message in the JSON string
-
-                    Trace.WriteLine("HRI-API-Register");
-                    Trace.TraceError(ex.Message);
-                    Trace.TraceError(ex.InnerException.Message);
-
                     json.Add("error", "true");
                     json.Add("message", ex.Message + ". " + ex.InnerException);
                 }
@@ -152,9 +147,10 @@
             if (json["MemberId"] != null)
             {
                 // Assign this user their member id
-                member.SetValue("memberId", json["RegId"]);
+                member.SetValue("memberId", json["RegId"].ToString());
                 // Assign their Morneau Shapell Y Number
-                member.SetValue("yNumber", json["MemberId"]);
+                member.SetValue("yNumber", json["MemberId"].ToString());
+                Membership.UpdateUser(member);
                 // Return successful registration
                 json.Add("error", "false");
                 return json.ToString(Formatting.None);


リファクタリング

リファクタリング

--- Hidder/Models/ApplicationProcess.cs
+++ Hidder/Models/ApplicationProcess.cs
@@ -9,9 +9,6 @@
 {
     public class ApplicationProcess : PropertyChangeNotification
     {
-        [DllImport("user32.dll")]
-        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
-
         private System.Diagnostics.Process _process;

         /// <summary>
@@ -67,8 +64,6 @@
             }
         }

-        //以下、実行後変わらないはずなので、変更通知しない。
-
         private string _processId = "-";
         /// <summary>
         /// プロセスID
@@ -83,37 +78,21 @@
             }
         }

-        private string _fullPath;
         /// <summary>
         /// パス
         /// </summary>
-        public string FullPath
-        {
-            get { return this._fullPath; }
-            private set
-            {
-                this._fullPath = value;
-            }
-        }
+        public string FullPath { get; private set; }

         /// <summary>
         /// ファイル名
         /// </summary>
         public string FileName { get { return Path.GetFileName(this.FullPath); } }

-
-        private string _argument;
         /// <summary>
         /// 引数
         /// </summary>
-        public string Argument
-        {
-            get { return this._argument; }
-            private set
-            {
-                this._argument = value;
-            }
-        }
+        public string Argument { get; private set; }
+

         #endregion


Removed dead code from Security.Cryptography.X509Certificates for issue #17905. (#19144)

Removed dead code from Security Cryptography X509Certificates

--- src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs
+++ src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs
@@ -401,22 +401,7 @@
         EXPORT_PRIVATE_KEYS                   = 0x00000004,
         None                                  = 0x00000000,
     }
-
-    internal enum KeyContextSpec : uint
-    {
-        AT_KEYEXCHANGE = 1,
-        AT_SIGNATURE = 2,
-        CERT_NCRYPT_KEY_SPEC = 0xFFFFFFFF,
-    }
-
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct CERT_KEY_CONTEXT
-    {
-        public int cbSize;
-        public IntPtr hProvOrNcryptKey;
-        public KeyContextSpec dwKeySpec;
-    }
-
+
     [StructLayout(LayoutKind.Sequential)]
     internal unsafe struct CRYPT_KEY_PROV_INFO
     {
@@ -567,15 +552,6 @@
     }

     [StructLayout(LayoutKind.Sequential)]
-    internal struct BLOBHEADER
-    {
-        public byte bType;
-        public byte bVersion;
-        public short reserved;
-        public uint aiKeyAlg;
-    };
-
-    [StructLayout(LayoutKind.Sequential)]
     internal unsafe struct CERT_BASIC_CONSTRAINTS_INFO
     {
         public CRYPT_BIT_BLOB SubjectType;


Fix: Observing a RemotePublish process locally failed

It failed because GetDispatcher would always return a local IObservable, and not observe the Redis stream.  To keep the consistency of GetDispatcher, Publish now publishes to both Redis and the local stream.

https://github.com/louthy/language-ext/issues/55

--- LanguageExt.Process/ActorContext.cs
+++ LanguageExt.Process/ActorContext.cs
@@ -450,10 +450,7 @@
             {
                 cluster.IfSome(c => c.PublishToChannel(ActorInboxCommon.ClusterPubSubKey(Self), message));
             }
-            else
-            {
-                SelfProcess.Actor.Publish(message);
-            }
+            SelfProcess.Actor.Publish(message);
             return unit;
         }


set the HasPublicKey flags when setting the PublicKey of an assembly

--- Mono.Cecil/AssemblyNameReference.cs
+++ Mono.Cecil/AssemblyNameReference.cs
@@ -96,7 +96,8 @@
 			get { return public_key; }
 			set {
 				public_key = value;
-				public_key_token = null;
+				HasPublicKey = !public_key.IsNullOrEmpty ();
+				public_key_token = Empty<byte>.Array;
 				full_name = null;
 			}
 		}


add private EditorThreadDispatcher

add private EditorThreadDispatcher

--- Assets/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs
+++ Assets/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs
@@ -1,23 +1,152 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Reflection;
 using System.Threading;
 using UniRx.InternalUtil;
 using UnityEngine;

 namespace UniRx
 {
-    public class MainThreadDispatcher : MonoBehaviour
+    public sealed class MainThreadDispatcher : MonoBehaviour
     {
+        // In UnityEditor's EditorMode can't instantiate and work MonoBehaviour.Update.
+        // EditorThreadDispatcher use EditorApplication.update instead of MonoBehaviour.Update.
+        class EditorThreadDispatcher : IDisposable
+        {
+            static object gate = new object();
+            static EditorThreadDispatcher instance;
+            public static EditorThreadDispatcher Instance
+            {
+                get
+                {
+                    // Activate EditorThreadDispatcher is dangerous, completely Lazy.
+                    lock (gate)
+                    {
+                        if (instance == null)
+                        {
+                            instance = new EditorThreadDispatcher();
+                        }
+
+                        return instance;
+                    }
+                }
+            }
+
+            bool isDisposed;
+            ThreadSafeQueueWorker queueWorker = new ThreadSafeQueueWorker();
+
+            EditorThreadDispatcher()
+            {
+                UnityEditor.EditorApplication.update += Update;
+            }
+
+            public void Enqueue(Action action)
+            {
+                queueWorker.Enqueue(action);
+            }
+
+            public void UnsafeInvoke(Action action)
+            {
+                try
+                {
+                    action();
+                }
+                catch (Exception ex)
+                {
+                    Debug.LogException(ex);
+                }
+            }
+
+            public void PseudoStartCoroutine(IEnumerator routine)
+            {
+                queueWorker.Enqueue(() => ConsumeEnumerator(routine));
+            }
+
+            void Update()
+            {
+                queueWorker.ExecuteAll(x => Debug.LogException(x));
+            }
+
+            void ConsumeEnumerator(IEnumerator routine)
+            {
+                if (routine.MoveNext())
+                {
+                    var current = routine.Current;
+                    if (current == null)
+                    {
+                        goto ENQUEUE;
+                    }
+
+                    var type = current.GetType();
+                    if (type == typeof(WWW))
+                    {
+                        var www = (WWW)current;
+                        queueWorker.Enqueue(() => ConsumeEnumerator(UnwrapWaitWWW(www)));
+                        return;
+                    }
+                    else if (type == typeof(WaitForSeconds))
+                    {
+                        var waitForSeconds = (WaitForSeconds)current;
+                        var accessor = typeof(WaitForSeconds).GetField("m_Seconds", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic);
+                        var second = (float)accessor.GetValue(waitForSeconds);
+                        // m_Seconds
+                    }
+                    else if (type == typeof(Coroutine) || type == typeof(ImitationCoroutine))
+                    {
+                        Debug.Log("Can't wait coroutine on UnityEditor");
+                        goto ENQUEUE;
+                    }
+
+                ENQUEUE:
+                    queueWorker.Enqueue(() => ConsumeEnumerator(routine)); // next update
+                }
+            }
+
+            IEnumerator UnwrapWaitWWW(WWW www)
+            {
+                while (!www.isDone)
+                {
+                    yield return null;
+                }
+            }
+
+            public void Dispose()
+            {
+                lock (gate)
+                {
+                    if (!isDisposed)
+                    {
+                        isDisposed = true;
+                        UnityEditor.EditorApplication.update -= Update;
+                    }
+                    instance = null;
+                }
+            }
+        }
+
+        class ImitationCoroutine
+        {
+
+        }
+
         /// Dispatch Asyncrhonous action.
-        public static void Post(Action item)
-        {
-            Instance.queueWorker.Enqueue(item);
+        public static void Post(Action action)
+        {
+#if UNITY_EDITOR
+            if (!Application.isPlaying) { EditorThreadDispatcher.Instance.Enqueue(action); return; }
+#endif
+
+            Instance.queueWorker.Enqueue(action);
         }

         /// Dispatch Synchronous action if possible.
         public static void Send(Action action)
         {
+#if UNITY_EDITOR
+            if (!Application.isPlaying) { EditorThreadDispatcher.Instance.Enqueue(action); return; }
+#endif
+
             if (mainThreadToken != null)
             {
                 try
@@ -38,6 +167,10 @@
         /// Run Synchronous action.
         public static void UnsafeSend(Action action)
         {
+#if UNITY_EDITOR
+            if (!Application.isPlaying) { EditorThreadDispatcher.Instance.UnsafeInvoke(action); return; }
+#endif
+
             try
             {
                 action();
@@ -51,6 +184,10 @@
         /// ThreadSafe StartCoroutine.
         public static void SendStartCoroutine(IEnumerator routine)
         {
+#if UNITY_EDITOR
+            if (!Application.isPlaying) { EditorThreadDispatcher.Instance.PseudoStartCoroutine(routine); return; }
+#endif
+
             if (mainThreadToken != null)
             {
                 StartCoroutine(routine);
@@ -63,6 +200,10 @@

         new public static Coroutine StartCoroutine(IEnumerator routine)
         {
+#if UNITY_EDITOR
+            if (!Application.isPlaying) { EditorThreadDispatcher.Instance.PseudoStartCoroutine(routine); return null; }
+#endif
+
             return Instance.StartCoroutine_Auto(routine);
         }

@@ -79,7 +220,6 @@
             }
         }

-
         ThreadSafeQueueWorker queueWorker = new ThreadSafeQueueWorker();
         Action<Exception> unhandledExceptionCallback = ex => Debug.LogException(ex); // default

@@ -107,7 +247,9 @@
         {
             if (!initialized)
             {
+                // in Editor, EditorView
                 if (!Application.isPlaying) return;
+
                 initialized = true;
                 instance = new GameObject("MainThreadDispatcher").AddComponent<MainThreadDispatcher>();
                 DontDestroyOnLoad(instance);


clean

clean

--- CSharpGL/0Foundations/OpenGLObjects/Textures/NewTextureBase.cs
+++ CSharpGL/0Foundations/OpenGLObjects/Textures/NewTextureBase.cs
@@ -82,9 +82,5 @@
         /// </summary>
         public NewSamplerBase SamplerBuilder { get; private set; }

-        void IDisposable.Dispose()
-        {
-            throw new NotImplementedException();
-        }
     }
 }


Tilføjet mulighed for at indtaste dato til nyhedsartklens filnavn

--- ChangeDatabase/ChangeDatabase/ChangeDatabase/ChangeDatabase.cs
+++ ChangeDatabase/ChangeDatabase/ChangeDatabase/ChangeDatabase.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.IO;

 // Remove article: Fjern inde i trashbin
 // Fjerne = navn
@@ -48,16 +49,16 @@
             string destFile = System.IO.Path.Combine(TargetPath, FileName);

             // If folder is not found, create one.
-            if (!System.IO.Directory.Exists(TargetPath))
+            if (!Directory.Exists(TargetPath))
             {
-                System.IO.Directory.CreateDirectory(TargetPath);
+                Directory.CreateDirectory(TargetPath);
             }
             // Copy file to chosen file. Overwrite if file is already there
-            System.IO.File.Copy(sourceFile, destFile, true);
+            File.Copy(sourceFile, destFile, true);

             // If file is in both source and dest. Delete file in source.
-            if (System.IO.File.Exists(destFile) && System.IO.File.Exists(sourceFile))
-                System.IO.File.Delete(sourceFile);
+            if (File.Exists(destFile) && System.IO.File.Exists(sourceFile))
+                File.Delete(sourceFile);

             Console.WriteLine("done");
             Console.ReadLine();
@@ -70,18 +71,23 @@
             // for at lave en txtfil, brug File.WriteAllLines
             // https://msdn.microsoft.com/da-dk/library/8bh11f1k.aspx

+            // Tilføjer dato til filnavnet på nyhedsartiklen.
+            Console.WriteLine("Please enter the date, the newsarticle was written in format dd_mm_yy_Name");
+            string dateOfArticle = Console.ReadLine();
+            FileName = dateOfArticle + FileName;
+
             // Opretter path for fil og filens tekst.
             string destFile = System.IO.Path.Combine(SourcePath, FileName);
             string text = "YabbaDabbaDUUU";

             // Sikre sig at der ikke bliver overwrited.
-            if (!System.IO.File.Exists(destFile))
-                System.IO.File.WriteAllText(destFile, text);
+            if (!File.Exists(destFile))
+                File.WriteAllText(destFile, text);
             else
                 Console.WriteLine("Article already in database");

             // Kontrol af, at alt virkede.
-            if(System.IO.File.Exists(destFile))
+            if(File.Exists(destFile))
                 Console.WriteLine("Done");
             else
                 Console.WriteLine("Fail");


Disable package modification buttons whilst working

--- ChocolateyExplorer.WPF/ViewModel/InstalledPackagesViewModel.cs
+++ ChocolateyExplorer.WPF/ViewModel/InstalledPackagesViewModel.cs
@@ -27,8 +27,8 @@
             this._installer = installer;
             this._console = console;

-            this.UninstallPackageCommand = new RelayCommand<ChocolateyPackageVersion>(async p => await this.UninstallPackage(p), p => p != null);
-            this.UpdatePackageCommand = new RelayCommand<ChocolateyPackageVersion>(async p => await this.UpdatePackage(p), p => p != null);
+            this.UninstallPackageCommand = new RelayCommand<ChocolateyPackageVersion>(async p => await this.UninstallPackage(p), p => p != null && !this.IsWorking);
+            this.UpdatePackageCommand = new RelayCommand<ChocolateyPackageVersion>(async p => await this.UpdatePackage(p), p => p != null && !this.IsWorking);
             this.RefreshInstalledPackagesCommand = new RelayCommand(async () => await this.RefreshPackages(), () => !this.IsWorking);

             this.IsWorking = false;
@@ -61,6 +61,8 @@
                 this.RaisePropertyChanged(() => this.IsWorking);
                 this.RaisePropertyChanged(() => this.CanSelectPackage);
                 this.RefreshInstalledPackagesCommand.RaiseCanExecuteChanged();
+                this.UpdatePackageCommand.RaiseCanExecuteChanged();
+                this.UninstallPackageCommand.RaiseCanExecuteChanged();
             }
         }


Fix broken build

Fix broken build

--- Client/Systems/VesselPositionAltSys/VesselPositionAltUpdate.cs
+++ Client/Systems/VesselPositionAltSys/VesselPositionAltUpdate.cs
@@ -116,11 +116,6 @@
                 LatLonAlt = LatLonAlt,
                 TransformPosition = TransformPosition,
                 TransformRotation = TransformRotation,
-                RefTransformRotation = RefTransformRotation,
-                RefTransformPosition = RefTransformPosition,
-                ComVector = ComVector,
-                ComdVector = ComdVector,
-                LocalComVector = LocalComVector
             };
         }

@@ -133,11 +128,6 @@
             BodyName = msgData.BodyName;
             TransformRotation = msgData.TransformRotation;
             TransformPosition = msgData.TransformPosition;
-            RefTransformRotation = msgData.RefTransformRotation;
-            RefTransformPosition = msgData.RefTransformPosition;
-            ComVector = msgData.ComVector;
-            ComdVector = msgData.ComdVector;
-            LocalComVector = msgData.LocalComVector;
             LatLonAlt = msgData.LatLonAlt;
             Orbit = msgData.Orbit;
         }


Remove obsoleted addition causing dup type

This should fix #80

--- Facebook.Android/source/facebook-common/additions/additions.cs
+++ Facebook.Android/source/facebook-common/additions/additions.cs
@@ -1,17 +1,6 @@
 using Android.Runtime;
 using System;
 using System.Linq;
-
-namespace Xamarin.Facebook
-{
-	public partial class GraphRequestAsyncTask : global::Android.OS.AsyncTask
-	{
-		protected override Java.Lang.Object DoInBackground(params Java.Lang.Object[] @params)
-		{
-			return new Java.Lang.Object(JNIEnv.CallObjectMethod(Handle, JNIEnv.GetMethodID(JNIEnv.GetObjectClass(Handle), "doInBackground", "([Ljava/lang/Object;)Ljava/lang/Object;")), JniHandleOwnership.TransferLocalRef);
-		}
-	}
-}

 namespace Xamarin.Facebook.Share.Model
 {
@@ -48,7 +37,6 @@
 			}
 		}
 	}
-

 	public partial class ShareMedia
 	{


CIT-400 displayed round for relief program

--- Web/Areas/EarlyWarning/Views/Request/Index.cshtml
+++ Web/Areas/EarlyWarning/Views/Request/Index.cshtml
@@ -35,6 +35,7 @@
                      columns.Bound(request => request.Region);
                      columns.Bound(request => request.Year);
                      columns.Bound(request => request.MonthName).Title(Html.Translate("Month"));
+                     if (Model.ProgramID == 1) columns.Bound(request => request.Round).Width(50).Title(Html.Translate("Round"));
                      columns.Bound(request => request.Program);
                      columns.Bound(request => request.RequestDate).HeaderHtmlAttributes(new { @class = "cats-date-pref-grid" }).Width(160);


Build fix

Build fix

--- example-xaml/BottomBarXFExampleXaml/App.xaml.cs
+++ example-xaml/BottomBarXFExampleXaml/App.xaml.cs
@@ -1,6 +1,6 @@
 using Xamarin.Forms;

-namespace BottomBarXFExample
+namespace BottomBarXFExampleXaml
 {
 	public partial class App : Application
 	{


Added placeholders for job methods

Added placeholders for job methods

--- Winterday.External.Gengo/Endpoints/JobEndpoint.cs
+++ Winterday.External.Gengo/Endpoints/JobEndpoint.cs
@@ -1,12 +1,81 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+//
+// JobEndpoint.cs
+//
+// Author:
+//       Jarl Erik Schmidt <github@jarlerik.com>
+//
+// Copyright (c) 2013 Jarl Erik Schmidt
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.

 namespace Winterday.External.Gengo.Endpoints
 {
-    class JobEndpoint
+    using System;
+    using System.Threading.Tasks;
+
+    using Winterday.External.Gengo.Payloads;
+
+    public class JobEndpoint
     {
+        readonly GengoClient _client;
+
+        internal JobEndpoint(GengoClient client)
+        {
+            if (client == null)
+                throw new ArgumentNullException("client");
+
+            _client = client;
+        }
+
+        public async Task Approve(int jobId, Stars stars,
+            string commentForTranslator,
+            string commentForGengo,
+            bool gengoCommentIsPublic)
+        {
+            throw new NotImplementedException();
+        }
+
+        public async Task<SubmittedJob> Get(int jobId)
+        {
+            throw new NotImplementedException();
+        }
+
+        public async Task<byte[]> GetPreviewImage(int jobId)
+        {
+            throw new NotImplementedException();
+        }
+
+        public async Task Reject(int jobId, RejectionReason reason,
+            string comment, string captcha, bool requeueJob)
+        {
+            throw new NotImplementedException();
+        }
+
+        public async Task Revise(int jobId, string comment)
+        {
+            throw new NotImplementedException();
+        }
+
+        public async Task Delete(int jobId)
+        {
+            throw new NotImplementedException();
+        }
+
     }
 }


・強制非表示時に、データ構成によっては、Null参照例外が出る症状があったので、修正。

--- Assets/SpriteStudio/ScriptLibrary/Library_SpriteStudio.cs
+++ Assets/SpriteStudio/ScriptLibrary/Library_SpriteStudio.cs
@@ -1918,23 +1918,26 @@

 		public void DrawEntry(Library_SpriteStudio.DrawManager.InformationMeshData MeshDataInformation, int FrameNo, Script_SpriteStudio_PartsRoot ScriptRoot)
 		{
-			float Priority = (0 < AnimationDataPriority.Length) ? AnimationDataPriority[FrameNo] : 0.0f;
-			int TextureNo = (0 < AnimationDataCell.Length) ? AnimationDataCell[FrameNo].DataBody.TextureNo : -1;
-
-			MeshDataInformation.Priority = PriorityGet(Priority, ID);
-			Library_SpriteStudio.DrawManager.ArrayListMeshDraw ArrayListMeshDraw = ScriptRoot.ArrayListMeshDraw;
-			if(null != ArrayListMeshDraw)
-			{
+			if(false == ScriptRoot.FlagHideForce)
+			{
+				float Priority = (0 < AnimationDataPriority.Length) ? AnimationDataPriority[FrameNo] : 0.0f;
+				int TextureNo = (0 < AnimationDataCell.Length) ? AnimationDataCell[FrameNo].DataBody.TextureNo : -1;
+
+				MeshDataInformation.Priority = PriorityGet(Priority, ID);
+				Library_SpriteStudio.DrawManager.ArrayListMeshDraw ArrayListMeshDraw = ScriptRoot.ArrayListMeshDraw;
+				if(null != ArrayListMeshDraw)
+				{
 #if false
-				ArrayListMeshDraw.MeshAdd(ScriptRoot.MaterialGet(TextureNo, KindBlendTarget), MeshDataInformation);
+					ArrayListMeshDraw.MeshAdd(ScriptRoot.MaterialGet(TextureNo, KindBlendTarget), MeshDataInformation);
 #else
-				Material MaterialNow = ScriptRoot.MaterialGet(TextureNo, KindBlendTarget);
-				if(null == MaterialNow)
-				{	/* has Illegal-Material */
-					return;
-				}
-				ArrayListMeshDraw.MeshAdd(MaterialNow, MeshDataInformation);
+					Material MaterialNow = ScriptRoot.MaterialGet(TextureNo, KindBlendTarget);
+					if(null == MaterialNow)
+					{	/* has Illegal-Material */
+						return;
+					}
+					ArrayListMeshDraw.MeshAdd(MaterialNow, MeshDataInformation);
 #endif
+				}
 			}
 		}
 	}


Remove diagonal drag test case in favour of horizontal & vertical

--- osu.Framework.Tests/Visual/Input/TestSceneClickLenience.cs
+++ osu.Framework.Tests/Visual/Input/TestSceneClickLenience.cs
@@ -85,21 +85,6 @@
         [TestCase(TestType.Direct)]
         [TestCase(TestType.Scroll)]
         [TestCase(TestType.NonBlockingScroll)]
-        public void TestDiagonalDragOnButton(TestType type)
-        {
-            AddStep("create button", () => Child = createClickBox(type));
-
-            AddStep("move to TopLeft", () => InputManager.MoveMouseTo(box.ScreenSpaceDrawQuad.AABBFloat.Shrink(10).TopLeft));
-            AddStep("mouse down", () => InputManager.PressButton(MouseButton.Left));
-            AddStep("move to BottomRight", () => InputManager.MoveMouseTo(box.ScreenSpaceDrawQuad.AABBFloat.Shrink(10).BottomRight));
-            AddStep("mouse up", () => InputManager.ReleaseButton(MouseButton.Left));
-
-            checkClicked(type != TestType.Scroll);
-        }
-
-        [TestCase(TestType.Direct)]
-        [TestCase(TestType.Scroll)]
-        [TestCase(TestType.NonBlockingScroll)]
         public void TestHorizontalDragOut(TestType type)
         {
             AddStep("create button", () => Child = createClickBox(type));


Fix constant casing

Fix constant casing

--- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
+++ osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
@@ -85,8 +85,8 @@
         }

         private SkinnableSound spinningSample;
-        private const float SPINNING_SAMPLE_INITIAL_FREQUENCY = 1.0f;
-        private const float SPINNING_SAMPLE_MODULATED_BASE_FREQUENCY = 0.5f;
+        private const float spinning_sample_initial_frequency = 1.0f;
+        private const float spinning_sample_modulated_base_frequency = 0.5f;

         protected override void LoadSamples()
         {
@@ -106,7 +106,7 @@
                 {
                     Volume = { Value = 0 },
                     Looping = true,
-                    Frequency = { Value = SPINNING_SAMPLE_INITIAL_FREQUENCY }
+                    Frequency = { Value = spinning_sample_initial_frequency }
                 });
             }
         }
@@ -233,7 +233,7 @@
                 RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);

             if (spinningSample != null && spinnerFrequencyModulate)
-                spinningSample.Frequency.Value = SPINNING_SAMPLE_MODULATED_BASE_FREQUENCY + Progress;
+                spinningSample.Frequency.Value = spinning_sample_modulated_base_frequency + Progress;
         }

         protected override void UpdateAfterChildren()


Fix test scene broken on master

Fix test scene broken on master

--- osu.Game.Tests/Visual/Editing/TestSceneComposeSelectBox.cs
+++ osu.Game.Tests/Visual/Editing/TestSceneComposeSelectBox.cs
@@ -30,6 +30,8 @@
                 {
                     selectionBox = new SelectionBox
                     {
+                        RelativeSizeAxes = Axes.Both,
+
                         CanRotate = true,
                         CanScaleX = true,
                         CanScaleY = true,


Make ctor protected

Make ctor protected

--- osu.Game/Overlays/Comments/Buttons/CommentRepliesButton.cs
+++ osu.Game/Overlays/Comments/Buttons/CommentRepliesButton.cs
@@ -32,7 +32,7 @@
         private readonly Box background;
         private readonly OsuSpriteText text;

-        public CommentRepliesButton()
+        protected CommentRepliesButton()
         {
             AutoSizeAxes = Axes.Both;
             Margin = new MarginPadding


Can Resolve Exception Logger

Can Resolve Exception Logger

--- test/UnitTest/ConfigTest.cs
+++ test/UnitTest/ConfigTest.cs
@@ -1,4 +1,5 @@
-using Castle.Windsor;
+using System.Web.Http.ExceptionHandling;
+using Castle.Windsor;
 using Microsoft.Owin.Logging;
 using NUnit.Framework;
 using Beginor.Owin.StaticFile;
@@ -19,7 +20,7 @@
         [Test]
         public void CanResolveContainer() {
             var container = Container.Resolve<IWindsorContainer>();
-            Assert.IsNotNull(Container);
+            Assert.IsNotNull(container);
         }

         [Test]
@@ -35,5 +36,11 @@
             var controller = Container.Resolve<SampleController>();
             Assert.IsNotNull(controller);
         }
+
+        [Test]
+        public void CanResolveExceptionLogger() {
+            var exLogger = Container.Resolve<IExceptionLogger>();
+            Assert.IsNotNull(exLogger);
+        }
     }
 }


Another stab at the timestamp compare.

Another stab at the timestamp compare.

--- BoozeHoundCloud/Areas/Core/Services/TransactionService.cs
+++ BoozeHoundCloud/Areas/Core/Services/TransactionService.cs
@@ -99,7 +99,7 @@
         throw new BusinessLogicException("Transaction date cannot change.");
       }

-      if ((modifiedTransaction.CreatedTimestamp - orignalTransaction.CreatedTimestamp).Ticks != 0)
+      if ((int)(modifiedTransaction.CreatedTimestamp - orignalTransaction.CreatedTimestamp).TotalSeconds != 0)
       {
         throw new BusinessLogicException("Transaction created-timestamp cannot change.");
       }


--- BotSample/EmotionBotApi/Controllers/MessagesController.cs
+++ BotSample/EmotionBotApi/Controllers/MessagesController.cs
@@ -30,11 +30,13 @@
                 return Request.CreateResponse(HttpStatusCode.OK);

             var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
+            // In Slack, URLs are qualified by '<' and '>'.
+            var text = activity.Text.Trim('<', '>');

-            var echoMessage = $"You sent this picture.  \n![]({activity.Text})";
+            var echoMessage = $"You sent this picture.  \n![]({text})";
             await Reply(connector, activity, echoMessage);

-            var mainMessage = await GetEmotionsAsync(activity.Text);
+            var mainMessage = await GetEmotionsAsync(text);
             await Reply(connector, activity, mainMessage);

             return Request.CreateResponse(HttpStatusCode.OK);


Update rubiks matrix

Update rubiks matrix

--- C#Advanced/04.MatricesExercise/05.RubiksMatrix/StartUp.cs
+++ C#Advanced/04.MatricesExercise/05.RubiksMatrix/StartUp.cs
@@ -7,71 +7,106 @@
     {
         public static void Main()
         {
-            var matrixSize = Console.ReadLine().Split(new char[] { ' ' }).Select(int.Parse).ToArray();
+            var matrixSize = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
+                .Select(int.Parse).ToArray();
             var row = matrixSize[0];
             var col = matrixSize[1];

-            var matrix = new string[row][];
+            var matrix = new int[row][];
+            int counter = 1;

-            int countNum = 1;
-            for (int i = 0; i < row; i++)
+            for (int rowIndex = 0; rowIndex < row; rowIndex++)
             {
-                string line = Console.ReadLine().Trim();
-                var currentColumn = new string[line.Length];
-                for (int j = 0; j < line.Length; j++)
+                matrix[rowIndex] = new int[col];
+                for (int colIndex = 0; colIndex < matrix[0].Length; colIndex++)
                 {
-                    currentColumn[j] = line[j].ToString();
+                    matrix[rowIndex][colIndex] = counter;
+                    counter++;
                 }
-                matrix[i] = currentColumn;
             }
-            //for (int rowIndex = 0; rowIndex < row; rowIndex++)
-            //{
-            //    matrix[rowIndex] = new int[col];

-            //    for (int colIndex = 0; colIndex < matrix[0].Length; colIndex++)
-            //    {
-            //        matrix[rowIndex][colIndex] = countNum;
-            //        countNum++;
-            //    }
-            //}
+            int numberOfCommands = int.Parse(Console.ReadLine());
+            for (int i = 0; i < numberOfCommands; i++)
+            {
+                var currentLine = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+                var indexOfRowOrCol = int.Parse(currentLine[0]);
+                var direction = currentLine[1];
+                var moves = int.Parse(currentLine[2]);

-            int n = int.Parse(Console.ReadLine());
-            for (int i = 0; i < n; i++)
+                switch (direction)
+                {
+                    case "up":
+                        MoveUpAndDown(matrix, indexOfRowOrCol, moves);
+                        break;
+                    case "down":
+                        MoveUpAndDown(matrix, indexOfRowOrCol, row - moves % row);
+                        break;
+                    case "left":
+                        MoveRightAndLeft(matrix, indexOfRowOrCol, moves);
+                        break;
+                    case "right":
+                        MoveRightAndLeft(matrix, indexOfRowOrCol, col - moves % col);
+                        break;
+                }
+            }
+            var element = 1;
+
+            for (int rowIndex = 0; rowIndex < matrix.Length; rowIndex++)
             {
-                var line = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
-                var column = int.Parse(line[0]);
-                var command = line[1];
-                var count = int.Parse(line[2]);
+                for (int colIndex = 0; colIndex < matrix[0].Length; colIndex++)
+                {
+                    if (matrix[rowIndex][colIndex] == element)
+                    {
+                        Console.WriteLine("No swap required");
+                    }

-                if (command == "up")
-                {
-                    for (int rowIndex = 0; rowIndex < row; rowIndex++)
+                    else
                     {
-                        for (int colIndex = 0; colIndex < matrix[0].Length; colIndex++)
+                        for (int r = 0; r < matrix.Length; r++)
                         {
-                            if (colIndex == column)
+                            for (int c = 0; c < matrix[0].Length; c++)
                             {
-                                for (int j = 0; j < count; j++)
+                                if (matrix[r][c] == element)
                                 {
+                                    var currentElement = matrix[rowIndex][colIndex];
+                                    matrix[rowIndex][colIndex] = element;
+                                    matrix[r][c] = currentElement;
+                                    Console.WriteLine($"Swap ({rowIndex}, {colIndex}) with ({r}, {c})");
+                                    break;
                                 }
                             }
                         }
                     }
-                }
-                else if (command == "down")
-                {
-                }
-                else if (command == "right")
-                {
-                }
-                else if (command == "left")
-                {
+                    element++;
                 }
             }
-            //foreach (var rowe in matrix)
-            //{
-            //    Console.WriteLine(string.Join(" ",rowe));
-            //}
+
+        }
+        private static void MoveRightAndLeft(int[][] matrix, int indexOfRowOrCol, int moves)
+        {
+            int[] temp = new int[matrix[0].Length];
+            for (int colIndex = 0; colIndex < matrix[0].Length; colIndex++)
+            {
+                temp[colIndex] = matrix[indexOfRowOrCol][(colIndex + moves) % matrix[0].Length];
+            }
+
+            matrix[indexOfRowOrCol] = temp;
+        }
+
+        private static void MoveUpAndDown(int[][] matrix, int indexOfRowOrCol, int moves)
+        {
+            int[] temp = new int[matrix.Length];
+
+            for (int rowIndex = 0; rowIndex < matrix.Length; rowIndex++)
+            {
+                temp[rowIndex] = matrix[(rowIndex + moves) % matrix.Length][indexOfRowOrCol];
+            }
+
+            for (int rowIndex = 0; rowIndex < matrix.Length; rowIndex++)
+            {
+                matrix[rowIndex][indexOfRowOrCol] = temp[rowIndex];
+            }
         }
     }
+}
 }


better move effect for alien ships

better move effect for alien ships

--- Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
@@ -13,6 +13,7 @@
 	// Use this for initialization
 	void Start () {
 		edgeOfScreen = new Vector2(Screen.width,Screen.height);
+	    StartCoroutine(alienSpawner());
 	}

 	// Update is called once per frame
@@ -22,13 +23,18 @@

     IEnumerator alienSpawner()
     {
-        GameObject spaceShip = Instantiate(alienShip, alienShip.transform.position, alienShip.transform.rotation);
-        Vector3 destination = new Vector3(0f,edgeOfScreen.y * 0.2f, 0f);
+        GameObject spaceShip = Instantiate(alienShip, alienShip.transform.localPosition, alienShip.transform.rotation);
+        yield return new WaitForSeconds(1);
+        spaceShip.transform.parent = GameObject.Find("Canvas").transform;
+        //next line is necessary, plz dnt remove it when your bored
+        spaceShip.transform.localPosition = alienShip.transform.localPosition;
+        /*Vector3 destination = new Vector3(0f,edgeOfScreen.y * 0.2f, 0f);
         do
         {
-            spaceShip.transform.localPosition = Vector3.Lerp(spaceShip.transform.localPosition, destination,0.1f);
-            yield return new WaitForSeconds(0.01f);
+            spaceShip.transform.localPosition = Vector3.Lerp(spaceShip.transform.localPosition, destination,0.1f * Time.deltaTime);
+            yield return new WaitForSeconds(0.5f);
         } while (spaceShip.transform.localPosition.y > (edgeOfScreen.y * 0.2));
+        */
     }

     public void startMenu()


Log brokerage/account inconsistencies as error

--- Engine/TransactionHandlers/BrokerageTransactionHandler.cs
+++ Engine/TransactionHandlers/BrokerageTransactionHandler.cs
@@ -339,7 +339,7 @@
             var delta = _algorithm.Portfolio.CashBook[account.CurrencySymbol].Quantity - account.CashBalance;
             if (delta != 0)
             {
-                Log.Trace(string.Format("BrokerageTransactionHandler.HandleAccountChanged(): {0} Cash Delta: {1}", account.CurrencySymbol, delta));
+                Log.Error(string.Format("BrokerageTransactionHandler.HandleAccountChanged(): {0} Cash Delta: {1}", account.CurrencySymbol, delta));
             }

             // override the current cash value to we're always gauranted to be in sync with the brokerage's push updates
@@ -358,7 +358,7 @@
             var deltaAvgPrice = securityHolding.AveragePrice - holding.AveragePrice;
             if (deltaQuantity != 0 || deltaAvgPrice != 0)
             {
-                Log.Trace(string.Format("BrokerageTransactionHandler.HandleSecurityHoldingUpdated(): {0} DeltaQuantity: {1} DeltaAvgPrice: {2}", holding.Symbol, deltaQuantity, deltaAvgPrice));
+                Log.Error(string.Format("BrokerageTransactionHandler.HandleSecurityHoldingUpdated(): {0} DeltaQuantity: {1} DeltaAvgPrice: {2}", holding.Symbol, deltaQuantity, deltaAvgPrice));
             }

             securityHolding.SetHoldings(holding.AveragePrice, holding.Quantity);


Adds the currenies to the cashbook the user might have deposited

--- Engine/TransactionHandlers/BrokerageTransactionHandler.cs
+++ Engine/TransactionHandlers/BrokerageTransactionHandler.cs
@@ -534,6 +534,17 @@
                 if (balances.Count == 0)
                 {
                     return;
+                }
+
+                //Adds currency to the cashbook that the user might have deposited
+                foreach (var balance in balances)
+                {
+                    Cash cash;
+                    if (!_algorithm.Portfolio.CashBook.TryGetValue(balance.Symbol, out cash))
+                    {
+                        Log.LogHandler.Trace("BrokerageTransactionHandler.PerformCashSync(): Unexpected cash found {0} {1}", balance.Amount, balance.Symbol);
+                        _algorithm.Portfolio.SetCash(balance.Symbol, balance.Amount, balance.ConversionRate);
+                    }
                 }

                 // if we were returned our balances, update everything and flip our flag as having performed sync today


Update SharePointRepository.cs

Update SharePointRepository.cs

En SetDefault, en el caso de que fuera del tipo URL, ejecuta siempre también SetFieldTypeDefault, saltando al catch, donde se producía un error al ejecutar (listItem[nameInternal] != null ? listItem[nameInternal].ToString() : ""));

--- Enmarcha.SharePoint/Entities/Data/SharePointRepository.cs
+++ Enmarcha.SharePoint/Entities/Data/SharePointRepository.cs
@@ -221,19 +221,19 @@
             }
         }

-        private void SetDefault(SPListItem listItem, PropertyInfo prop, T valor, string nameInternal, string type, bool multiple)
+                private void SetDefault(SPListItem listItem, PropertyInfo prop, T valor, string nameInternal, string type, bool multiple)
         {
             try
             {
                 var field = listItem.Fields.GetFieldByInternalName(nameInternal);
-                var fieldValueType = field.FieldValueType.Name;
+                var fieldValueType = field.FieldValueType !=null ? field.FieldValueType.Name : field.TypeAsString;
                 if (fieldValueType.Contains("Boolean"))
                 {
                     SetFieldBoolean(listItem, prop, valor, nameInternal);
                     return;
                 }

-                if (fieldValueType.Contains("Double"))
+                if (fieldValueType.Contains("Double") || fieldValueType.Contains("Counter"))
                 {
                     SetFieldDouble(listItem, prop, valor, type, nameInternal);
                     return;
@@ -246,22 +246,29 @@
                 if (fieldValueType.Contains("Url"))
                 {
                     SetFieldUrl(listItem, prop, valor, nameInternal);
+                    return;
                 }
                 if (fieldValueType.Contains("User"))
                 {
                     SetFieldTypeUSer(listItem, prop, valor, nameInternal, multiple);
-                }
-                else
-                {
-                    SetFieldTypeDefault(listItem, prop, valor, nameInternal);
-                }
-
-            }
-            catch (Exception exception)
-            {
-                Logger.Warn("Aviso" + exception.Message);
-                prop.SetValue(valor,
-                    (listItem[nameInternal] != null ? listItem[nameInternal].ToString() : ""));
+                    return;
+                }
+
+                SetFieldTypeDefault(listItem, prop, valor, nameInternal);
+            }
+            catch (Exception exception)
+            {
+                Logger.Warn("Aviso " + exception.Message);
+                try
+                {
+                    prop.SetValue(valor,
+                   (listItem[nameInternal] != null ? listItem[nameInternal].ToString() : ""));
+                }
+                catch (Exception ex)
+                {
+                    Logger.Error(ex.Message);
+                }
+
             }
         }


In `Evbpc.Framework.Integrations.StackExchange.API.Handler.SubmitRequest<T>(IRequest<T>, bool)` the `webResponse` is `IDisposable`.

--- Evbpc.Framework/Integrations/StackExchange/API/Handler.cs
+++ Evbpc.Framework/Integrations/StackExchange/API/Handler.cs
@@ -59,8 +59,8 @@
             var webRequest = (HttpWebRequest)WebRequest.Create(url);
             webRequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
             webRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
-            var webResponse = webRequest.GetResponse();

+            using (var webResponse = webRequest.GetResponse())
             using (var sr = new StreamReader(webResponse.GetResponseStream()))
             {
                 response = sr.ReadToEnd();


HttpService

HttpService

--- Imagine.Uwp.Kits/Imagine.Uwp.Kits/Services/HttpService.cs
+++ Imagine.Uwp.Kits/Imagine.Uwp.Kits/Services/HttpService.cs
@@ -49,10 +49,12 @@
                 if (inputs != null)
                     contents = inputs.ToList();

+#if DEBUG
                 foreach (var content in contents)
                 {
                     Debug.WriteLine(content.ToString());
-                }
+                }
+#endif

                 HttpClient httpClient = new HttpClient();

@@ -129,11 +131,6 @@
                 Debug.WriteLine("Host: {0}", domain);

                 var contents = new List<KeyValuePair<string, string>>();
-
-                if (!String.IsNullOrEmpty(data))
-                {
-                    contents.Add(new KeyValuePair<string, string>("data", BaseRC4.Encrypt("153748f6d14&#@!#b6108179512d20%!@35D!#84428550a", data)));
-                }

                 var httpClient = new HttpClient();