jib jab

jib jab

--- ServicesCORS/ServicesCORS/Views/Home/Index.cshtml
+++ ServicesCORS/ServicesCORS/Views/Home/Index.cshtml
@@ -27,10 +27,6 @@
             $trh.append($th.clone(true));
             $th.html('Team');
             $trh.append($th.clone(true));
-            $trh.append($th.clone(true));
-            $trh.append($th.clone(true));
-            $trh.append($th.clone(true));
-            $trh.append($th.clone(true));
             $thead.append($trh.clone(true));
             $table.append($thead.clone(true));


Update ServiceBusConfiguration.cs

Update ServiceBusConfiguration.cs

--- Shuttle.Esb/ServiceBus/ServiceBusConfiguration.cs
+++ Shuttle.Esb/ServiceBus/ServiceBusConfiguration.cs
@@ -55,7 +55,7 @@
             {
                 return _transactionScope ?? Synchronised(() => _transactionScope = new TransactionScopeConfiguration());
             }
-            set { _transactionScope = value; }
+            set => _transactionScope = value;
         }

         public bool CreateQueues { get; set; }


remove isModel considerations in MListJsonConverter and use Attributes always

--- Signum.React/JsonConverters/MListJsonConverter.cs
+++ Signum.React/JsonConverters/MListJsonConverter.cs
@@ -75,11 +75,8 @@

             var elementPr = pr.Add("Item");

-            var isModel = typeof(ModelEntity).IsAssignableFrom(pr.RootType);
-
-            var rowIdType = isModel ?
-                GetRowIdTypeFromAttribute(pr):
-                GetRowIdTypeFromSchema(pr);
+            var rowIdType = GetRowIdTypeFromAttribute(pr);
+

             reader.Assert(JsonToken.StartArray);

@@ -111,9 +108,6 @@

                         if (oldValue == null)
                         {
-                            if (!isModel)
-                                throw new KeyNotFoundException("RowID {0} not found".FormatWith(rowId));
-
                             T newValue = (T)serializer.DeserializeValue(reader, typeof(T), null);

                             newList.Add(new MList<T>.RowIdElement(newValue, rowId, null));
@@ -163,16 +157,6 @@
             return (MList<T>)existingValue;
         }

-        private static Type GetRowIdTypeFromSchema(PropertyRoute route)
-        {
-            var tryField = Schema.Current.TryField(route) as FieldMList;
-
-            if (tryField == null)
-                throw new InvalidOperationException($"Impossible to determine RowId type for {route} from schema.");
-
-            return tryField.TableMList.PrimaryKey.Type;
-        }
-
         private static Type GetRowIdTypeFromAttribute(PropertyRoute route)
         {
             var att = Schema.Current.Settings.FieldAttribute<PrimaryKeyAttribute>(route) ?? Schema.Current.Settings.DefaultPrimaryKeyAttribute;


add some comment.

add some comment.

--- Control/Fish.MovieManager.MovieControl/Class1.cs
+++ Control/Fish.MovieManager.MovieControl/Class1.cs
@@ -148,6 +148,10 @@
             }
         }

+        /// <summary>
+        /// 刷新豆瓣信息
+        /// </summary>
+        /// <param name="id">豆瓣ID</param>
         public void RefreshInfo(int id)
         {
             //if (id != 0) return;


Removed comment, will document before merging

--- Connect4/Board.cs
+++ Connect4/Board.cs
@@ -5,9 +5,6 @@

 namespace Connect4
 {
-    /// <summary>
-    /// Main board class.
-    /// </summary>
     public class Board
     {
         #region Constructors


correct MediaTypeRegistrationTree doc commentrename MediaType#Category -> RegistrationTree

Also changes mentions of Category/Prefix to RegTree/RegistrationTree

--- Core/MediaType.cs
+++ Core/MediaType.cs
@@ -15,7 +15,7 @@
     /// <summary>
     /// The category the media type is in.
     /// </summary>
-    public enum MediaTypeCategory
+    public enum MediaTypeRegTree
     {
         /// <summary>
         /// The media type is a standard media type, and does not
@@ -70,13 +70,13 @@
             /// </summary>
             Parameter
         }
-        private static readonly Dictionary<MediaTypeCategory, string>
-            MediaTypeCategoryStrings = new Dictionary<MediaTypeCategory, string>()
-        {
-            {   MediaTypeCategory.Standard,       ""        },
-            {   MediaTypeCategory.Vendor,         "vnd"     },
-            {   MediaTypeCategory.Personal,       "prs"     },
-            {   MediaTypeCategory.Unregistered,   "x"       },
+        private static readonly Dictionary<MediaTypeRegTree, string>
+            MediaTypeRegTreeStrings = new Dictionary<MediaTypeRegTree, string>()
+        {
+            {   MediaTypeRegTree.Standard,       ""        },
+            {   MediaTypeRegTree.Vendor,         "vnd"     },
+            {   MediaTypeRegTree.Personal,       "prs"     },
+            {   MediaTypeRegTree.Unregistered,   "x"       },
         };
         private static readonly Dictionary<string, string>
             MTSfxEquivalencyMap = new Dictionary<string, string>()
@@ -113,9 +113,9 @@
         /// <returns>
         /// The string associated with the category, sans trailing period.
         /// </returns>
-        public static string GetCategoryString(MediaTypeCategory category)
-        {
-            return MediaTypeCategoryStrings[category];
+        public static string GetCategoryString(MediaTypeRegTree category)
+        {
+            return MediaTypeRegTreeStrings[category];
         }
         /// <summary>
         /// Creates a MediaType class from a string.
@@ -147,7 +147,7 @@
             PState state = PState.SuperType;
             // Gets the length of the longest prefix we can
             // recognise.
-            var prefixes = MediaType.MediaTypeCategoryStrings
+            var prefixes = MediaType.MediaTypeRegTreeStrings
                 .OrderByDescending(kvp => kvp.Value.Length)
                 .Select(kvp => kvp.Value.Length);
             int longestPrefix = prefixes.First(),
@@ -256,7 +256,7 @@
                     // that it's a prefix we recognise.
                     else if (c == PrefixSeparator)
                     {
-                        var pfx = MediaTypeCategoryStrings
+                        var pfx = MediaTypeRegTreeStrings
                             // Check the prefix string against all prefix strings
                             // we know of.
                             .Where(
@@ -266,7 +266,7 @@
                             .Select(kvp => kvp.Key)
                             // If there are no matches, set it to a default
                             // value that we'll be able to recognise.
-                            .DefaultIfEmpty((MediaTypeCategory)(-1))
+                            .DefaultIfEmpty((MediaTypeRegTree)(-1))
                             // Get the first result.
                             .First();

@@ -282,7 +282,7 @@
                             // Clear the storage of the prefix string.
                             storage.Clear();
                             // Set the MediaType's property.
-                            type.Category = pfx;
+                            type.RegistrationTree = pfx;
                             // Set the new section start value.
                             sectionStart = i + 1;
                         }
@@ -506,7 +506,7 @@
         /// <summary>
         /// The media type's category, or registration tree.
         /// </summary>
-        public MediaTypeCategory Category
+        public MediaTypeRegTree RegistrationTree
         {
             get;
             private set;
@@ -559,11 +559,11 @@
         public bool Equals(MediaType type)
         {
             return
-                type.Category           == this.Category        &&
-                type.SuperType          == this.SuperType       &&
-                type.SubType            == this.SubType         &&
-                type.Parameters         == this.Parameters      &&
-                type.Suffix             == this.Suffix          ;;
+                type.RegistrationTree   == this.RegistrationTree    &&
+                type.SuperType          == this.SuperType           &&
+                type.SubType            == this.SubType             &&
+                type.Parameters         == this.Parameters          &&
+                type.Suffix             == this.Suffix              ;;
         }
         /// <summary>
         /// Determines whether the provided MediaType
@@ -673,11 +673,11 @@
             unchecked
             {
                 hashCode =
-                    Category.GetHashCode()      +
-                    SuperType.GetHashCode()     +
-                    SubType.GetHashCode()       +
-                    Suffix.GetHashCode()        +
-                    Parameters.GetHashCode()    ;
+                    RegistrationTree.GetHashCode()  +
+                    SuperType.GetHashCode()         +
+                    SubType.GetHashCode()           +
+                    Suffix.GetHashCode()            +
+                    Parameters.GetHashCode()        ;
             }

             return hashCode;
@@ -700,9 +700,12 @@
             // The standard registration tree/category does not
             // have a prefix. If it isn't a standard-category
             // media type, it will have a prefix.
-            if (this.Category != MediaTypeCategory.Standard)
-            {
-                sb.AppendFormat("{0}.", MediaType.GetCategoryString(this.Category));
+            if (this.RegistrationTree != MediaTypeRegTree.Standard)
+            {
+                sb.AppendFormat(
+                    "{0}.",
+                    MediaType.GetCategoryString(this.RegistrationTree)
+                    );
             }

             // The subtype comes after the vendor prefix, and specifies


define MediaType#IsCompatible method

define MediaType#IsCompatible method

Uses the media type suffixes, if any, to tentatively determine whether two media types may be compatible.

--- Core/MediaType.cs
+++ Core/MediaType.cs
@@ -52,6 +52,16 @@
             {   MediaTypeCategory.Personal,       "prs"     },
             {   MediaTypeCategory.Unregistered,   "x"       },
         };
+        private static readonly Dictionary<string, string>
+            MTSfxEquivalencyMap = new Dictionary<string, string>()
+        {
+            {   "json",         "application/json"          },
+            {   "fastinfoset",  "application/fastinfoset"   },
+            {   "wbxml",        "application/vnd.wab.wbxml" },
+            {   "zip",          "application/zip"           },
+            {   "xml",          "application/xml"           },
+            {   "cbor",         "application/cbor"          },
+        };
         private const char
             SubTypeSeparator        = '/',
             ParameterSeparator      = ';',
@@ -136,6 +146,103 @@
         }

         /// <summary>
+        /// Determines whether the provided media type is
+        /// equal to this media type.
+        /// </summary>
+        /// <param name="type">The media type to compare.</param>
+        /// <returns>True if the media types are equal.</returns>
+        public bool Equals(MediaType type)
+        {
+            return
+                type.Category == this.Category &&
+                type.SuperType == this.SuperType &&
+                type.SubType == this.SubType &&
+                type.Parameters == this.Parameters &&
+                type.Suffix == this.Suffix; ;
+        }
+        /// <summary>
+        /// Determines whether the provided MediaType
+        /// may be compatible, based on the suffix (if
+        /// one is present).
+        /// </summary>
+        /// <param name="type">
+        /// The MediaType to determine compatibility with.
+        /// </param>
+        /// <returns>
+        /// True if the provided MediaType could be compatible
+        /// with this media type.
+        /// </returns>
+        /// <exception cref="System.ArgumentNullException">
+        /// Thrown when the provided MediaType is null.
+        /// </exception>
+        public bool IsCompatible(MediaType type)
+        {
+            if (type == null)
+            {
+                throw new ArgumentNullException(
+                    "The MediaType to compare must not be null."
+                    );
+            }
+
+            bool
+                // Whether this MediaType has no suffix.
+                thisNoSfx = this.Suffix == null,
+                // Whether the MediaType to compare has
+                // no suffix.
+                thatNoSfx = type.Suffix == null;
+
+            // If both of the suffixes are null, it isn't
+            // possible to determine tentative compatibility.
+            if (thisNoSfx && thatNoSfx) return false;
+            // If both MediaTypes have a suffix, we can just
+            // compare the suffixes.
+            else if (!thisNoSfx && !thatNoSfx)
+            {
+                return this.Suffix == type.Suffix;
+            }
+            // If this MediaType doesn't have a suffix, we have
+            // to compare this MediaType's Super+SubType with the
+            // Super+SubType pair that is equivalent to the provided
+            // MediaType's suffix.
+            else
+            {
+                MediaType suffixed, unsuffixed;
+                if (thisNoSfx)
+                {
+                    suffixed    = type;
+                    unsuffixed  = this;
+                }
+                else
+                {
+                    suffixed    = this;
+                    unsuffixed  = type;
+                }
+
+                string
+                    // Will contain the media type Super+SubType pair
+                    // that is equivalent to the suffix.
+                    equiv,
+                    // Will contain the Super+SubType pair that is being
+                    // compared to the suffix's equivalent pair.
+                    actual = String.Format(
+                        "{0}/{1}",
+                        unsuffixed, SuperType, unsuffixed.SubType
+                        );
+                // Attempt to retrieve a media type Super+SubType pair
+                // from the equivalency map.
+                if (!MTSfxEquivalencyMap.TryGetValue(suffixed.Suffix, out equiv))
+                {
+                    // We don't know what the suffix means, and so
+                    // we aren't able to determine its equivalent
+                    // Super+SubType pair.
+                    return false;
+                }
+
+                return equiv == actual;
+            }
+        }
+
+        /// <summary>
         /// Determines whether the provided object is equal
         /// to this media type.
         /// </summary>
@@ -147,21 +254,6 @@

             if (mt == null) return false;
             else            return mt.Equals(type: mt);
-        }
-        /// <summary>
-        /// Determines whether the provided media type is
-        /// equal to this media type.
-        /// </summary>
-        /// <param name="type">The media type to compare.</param>
-        /// <returns>True if the media types are equal.</returns>
-        public bool Equals(MediaType type)
-        {
-            return
-                type.Category   == this.Category    &&
-                type.SuperType  == this.SuperType   &&
-                type.SubType    == this.SubType     &&
-                type.Parameters == this.Parameters  &&
-                type.Suffix     == this.Suffix      ;;
         }
         /// <summary>
         /// Retrieves a hash code for the MediaType. This is


Update GetRelativeTime.cs

Update GetRelativeTime.cs

--- commands/time/GetRelativeTime.cs
+++ commands/time/GetRelativeTime.cs
@@ -39,17 +39,25 @@
       if (delta < 12 * MONTH) {
         var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
         var monthsDouble = (double)ts.Days / (double)30;
-
         return monthsDouble <= 1
           ? "one month ago"
-          : monthsDouble.ToString("n1") + " months ago"
+          : (
+            monthsDouble.ToString("n1").EndsWith(".0")
+              ? months + " months ago"
+              : monthsDouble.ToString("n1") + " months ago"
+          )
         ;
       } else {
         var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
-        var yearDouble = (double)ts.Days / (double)365;
-        return yearDouble <= 1
-          ? "one year ago"
-          : yearDouble.ToString("n1") + " years ago";
+        var yearsDouble = (double)ts.Days / (double)365;
+        return yearsDouble <= 1
+          ? "one year ago"
+          : (
+            yearsDouble.ToString("n1").EndsWith(".0")
+              ? years + " years ago"
+              : yearsDouble.ToString("n1") + " years ago"
+          )
+        ;
       }
     }


Adds BasicTemplateFuturesAlgorithm as regression test.

--- Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs
+++ Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs
@@ -15,8 +15,10 @@
 */

 using System;
+using System.Collections.Generic;
 using System.Linq;
 using QuantConnect.Data;
+using QuantConnect.Interfaces;
 using QuantConnect.Orders;
 using QuantConnect.Securities;

@@ -30,7 +32,7 @@
     /// <meta name="tag" content="using data" />
     /// <meta name="tag" content="benchmarks" />
     /// <meta name="tag" content="futures" />
-    public class BasicTemplateFuturesAlgorithm : QCAlgorithm
+    public class BasicTemplateFuturesAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
     {
         // S&P 500 EMini futures
         private const string RootSP500 = Futures.Indices.SP500EMini;
@@ -45,8 +47,8 @@
         /// </summary>
         public override void Initialize()
         {
-            SetStartDate(2013, 10, 07);
-            SetEndDate(2013, 10, 11);
+            SetStartDate(2013, 10, 08);
+            SetEndDate(2013, 10, 10);
             SetCash(1000000);

             var futureSP500 = AddFuture(RootSP500);
@@ -75,7 +77,7 @@
                         from futuresContract in chain.Value.OrderBy(x => x.Expiry)
                         where futuresContract.Expiry > Time.Date.AddDays(90)
                         select futuresContract
-                        ).FirstOrDefault();
+                    ).FirstOrDefault();

                     // if found, trade it
                     if (contract != null)
@@ -99,5 +101,30 @@
         {
             Log(orderEvent.ToString());
         }
+
+        public Language[] Languages { get; } = { Language.CSharp };
+
+        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
+        {
+            {"Total Trades", "8218"},
+            {"Average Win", "0.00%"},
+            {"Average Loss", "-0.01%"},
+            {"Compounding Annual Return", "-100.0%"},
+            {"Drawdown", "26.400%"},
+            {"Expectancy", "-0.862"},
+            {"Net Profit", "-26.370%"},
+            {"Sharpe Ratio", "-32.599"},
+            {"Loss Rate", "90%"},
+            {"Win Rate", "10%"},
+            {"Profit-Loss Ratio", "0.39"},
+            {"Alpha", "-15.5"},
+            {"Beta", "-2.098"},
+            {"Annual Standard Deviation", "0.566"},
+            {"Annual Variance", "0.32"},
+            {"Information Ratio", "-28.931"},
+            {"Tracking Error", "0.686"},
+            {"Treynor Ratio", "8.788"},
+            {"Total Fees", "$15203.30"}
+        };
     }
 }


code cleanup removing extrneous totalNumColliders variable

--- Assets/MRTK/Services/InputSystem/FocusProvider.cs
+++ Assets/MRTK/Services/InputSystem/FocusProvider.cs
@@ -1230,17 +1230,15 @@
                             Vector3 objectHitPoint = testPoint;
                             GameObject closest = null;
                             float closestDistance = Mathf.Infinity;
-                            int totalNumColliders = 0;

                             // Go through each layerMask and ensure perform the appropriate OverlapSphereCalculation
                             // Since this is usually done when a pointer passes a IsInteractionEnabled, maybe we can cache the selected colliders inside the pointer?
                             foreach (LayerMask layerMask in prioritizedLayerMasks)
                             {
                                 int numColliders = UnityEngine.Physics.OverlapSphereNonAlloc(pointer.Rays[i].Origin, pointer.SphereCastRadius, colliders, layerMask);
-                                totalNumColliders += numColliders;
                                 if (numColliders > 0)
                                 {
-                                    if (totalNumColliders >= maxQuerySceneResults)
+                                    if (numColliders >= maxQuerySceneResults)
                                     {
                                         Debug.LogWarning($"Maximum number of {totalNumColliders} colliders found in FocusProvider overlap query. Consider increasing the focus query buffer size in the input profile.");
                                     }


First -> FirstAsync()

First -> FirstAsync()

--- Assets/Plugins/UniRx/Scripts/Observable.Paging.cs
+++ Assets/Plugins/UniRx/Scripts/Observable.Paging.cs
@@ -235,8 +235,24 @@
         public static IObservable<T> LastOrDefault<T>(this IObservable<T> source, Func<T, bool> predicate)
         {
             return new LastObservable<T>(source, predicate, true);
-        }
-
+        }
+
+#if SystemReactive
+        public static IObservable<T> FirstAsync<T>(this IObservable<T> source)
+        {
+            return new FirstObservable<T>(source, false);
+        }
+        public static IObservable<T> FirstAsync<T>(this IObservable<T> source, Func<T, bool> predicate)
+        {
+            return new FirstObservable<T>(source, predicate, false);
+        }
+
+        [Obsolete]
+        public static IObservable<T> First<T>(this IObservable<T> source) { throw new NotImplementedException(); }
+
+        [Obsolete]
+        public static IObservable<T> First<T>(this IObservable<T> source, Func<T, bool> predicate) { throw new NotImplementedException(); }
+#else
         public static IObservable<T> First<T>(this IObservable<T> source)
         {
             return new FirstObservable<T>(source, false);
@@ -245,12 +261,12 @@
         {
             return new FirstObservable<T>(source, predicate, false);
         }
+#endif

         public static IObservable<T> FirstOrDefault<T>(this IObservable<T> source)
         {
             return new FirstObservable<T>(source, true);
         }
-
         public static IObservable<T> FirstOrDefault<T>(this IObservable<T> source, Func<T, bool> predicate)
         {
             return new FirstObservable<T>(source, predicate, true);


Need the colvis plugin

Need the colvis plugin

--- Battery-Commander.Web/Views/Shared/_Layout.cshtml
+++ Battery-Commander.Web/Views/Shared/_Layout.cshtml
@@ -93,6 +93,7 @@
     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.31/pdfmake.min.js"></script>
     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.31/vfs_fonts.js"></script>
+    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.3.1/js/buttons.colVis.min.js"></script>
     <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
     <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>


Windows.Chart - UserCharts fix

Windows.Chart - UserCharts fix

--- Signum.Windows.Extensions/Chart/UserChart.xaml.cs
+++ Signum.Windows.Extensions/Chart/UserChart.xaml.cs
@@ -24,17 +24,23 @@
     /// </summary>
     public partial class UserChart : UserControl
     {
-        public UserChart()
-        {
-            InitializeComponent();
-        }
-
         public static readonly DependencyProperty QueryDescriptionProperty =
-            DependencyProperty.Register("QueryDescription", typeof(QueryDescription), typeof(UserChart), new UIPropertyMetadata(null));
+           DependencyProperty.Register("QueryDescription", typeof(QueryDescription), typeof(UserChart), new UIPropertyMetadata(null));
         public QueryDescription QueryDescription
         {
             get { return (QueryDescription)GetValue(QueryDescriptionProperty); }
             set { SetValue(QueryDescriptionProperty, value); }
+        }
+
+        public UserChart()
+        {
+            InitializeComponent();
+            this.Loaded += new RoutedEventHandler(UserChart_Loaded);
+        }
+
+        void UserChart_Loaded(object sender, RoutedEventArgs e)
+        {
+            chartBuilder.Description = QueryDescription;
         }

         private QueryToken[] QueryTokenBuilderFilter_SubTokensEvent(QueryToken token)


fixes SearchControl

fixes SearchControl

--- Signum.Windows/DynamicQuery/SearchControl.xaml.cs
+++ Signum.Windows/DynamicQuery/SearchControl.xaml.cs
@@ -30,7 +30,7 @@
     public partial class SearchControl
     {
         public static readonly DependencyProperty QueryNameProperty =
-            DependencyProperty.Register("QueryName", typeof(object), typeof(SearchControl), new UIPropertyMetadata(null));
+            DependencyProperty.Register("QueryName", typeof(object), typeof(SearchControl), new UIPropertyMetadata((o,s)=>((SearchControl)o).QueryNameChanged(s)));
         public object QueryName
         {
             get { return (object)GetValue(QueryNameProperty); }
@@ -250,8 +250,6 @@

         public SearchControl()
         {
-
-            this.Initialized += new EventHandler(SearchControl_Initialized);
             //ColumnDragController = new DragController(col => CreateFilter((GridViewColumnHeader)col), DragDropEffects.Copy);

             this.InitializeComponent();
@@ -265,16 +263,16 @@
             timer.Tick += new EventHandler(timer_Tick);
         }

-        void SearchControl_Initialized(object sender, EventArgs e)
-        {
-            if (DesignerProperties.GetIsInDesignMode(this) || QueryName == null)
+        private void QueryNameChanged(DependencyPropertyChangedEventArgs s)
+        {
+            if (DesignerProperties.GetIsInDesignMode(this) || s.NewValue == null)
             {
                 return;
             }

-            Settings = Navigator.GetQuerySettings(QueryName);
-
-            Description = Navigator.Manager.GetQueryDescription(QueryName);
+            Settings = Navigator.GetQuerySettings(s.NewValue);
+
+            Description = Navigator.Manager.GetQueryDescription(s.NewValue);

             tokenBuilder.Token = null;
             tokenBuilder.SubTokensEvent += tokenBuilder_SubTokensEvent;


feat: Randomizes the distance between spikes

--- Assets/Scripts/GamePlay/ObstacleGenerator.cs
+++ Assets/Scripts/GamePlay/ObstacleGenerator.cs
@@ -37,15 +37,21 @@

 		yield return new WaitForSeconds(1.8f);

+		float waitTime = 1.8f;
+
 		while(!isGameOver){
 			Spawn(objectPoolers[spikeId].GetPooledObject());

 			//Generate the next spike id and decide its generation rate.
 			spikeId = GetspikeId(queue);
-			float waitTime = 0.8f;
-			if(queue.IsCenterSpike()) waitTime = 1f;
+
+			if(queue.IsCenterSpike()) waitTime = waitTime + 0.3f;

 			yield return new WaitForSeconds(waitTime);
+			waitTime -= Random.Range(0, 0.2f);
+			if (waitTime < 0.8f) {
+				waitTime = 0.8f;
+			}
 		}

 	}


Fixed bug in statuslog updater

Fixed bug in statuslog updater

--- Source/Applications/openMIC/openMIC/Downloader.cs
+++ Source/Applications/openMIC/openMIC/Downloader.cs
@@ -1572,7 +1572,7 @@
             {
                 using (DataContext dataContext = new DataContext(new AdoDataConnection("systemSettings")))
                 {
-                    IEnumerable<StatusLog> logs = dataContext.Table<StatusLog>().QueryRecords(restriction: new RecordRestriction("DeviceID IN (Select ID FROM Device WHERE Acronym LIKE {0})", m_deviceRecord.Acronym));
+                    IEnumerable<StatusLog> logs = dataContext.Table<StatusLog>().QueryRecords(restriction: new RecordRestriction("DeviceID = {0}", m_deviceRecord.ID));
                     StatusLog log = new StatusLog();

                     if (success)
@@ -1608,7 +1608,7 @@
                         {
                             log.LastFailure = DateTime.UtcNow;
                             log.Message = message;
-                            log.DeviceID = dataContext.Connection.ExecuteScalar<int>($"Select ID FROM Device WHERE Acronym LIKE '{m_deviceRecord.Acronym}'");
+                            log.DeviceID = m_deviceRecord.ID;
                             dataContext.Table<StatusLog>().AddNewRecord(log);
                         }


Revert "Added logic to disable device if too many files are produced."

This reverts commit 91b4e2d12c966bf65d61c6b5bf7d475c404bd8b8.

--- Source/Applications/openMIC/openMIC/Downloader.cs
+++ Source/Applications/openMIC/openMIC/Downloader.cs
@@ -1689,110 +1689,101 @@
                     IEnumerable<StatusLog> logs = dataContext.Table<StatusLog>().QueryRecords(restriction: new RecordRestriction("DeviceID = {0}", m_deviceRecord.ID));
                     StatusLog log = new StatusLog();

-                    if (m_deviceRecord.Enabled)
+                    if (success)
                     {
-                        if (success)
+                        if (logs.Any())
                         {
-                            if (logs.Any())
-                            {
-                                log = logs.First();
-                                log.LastSuccess = DateTime.UtcNow;
-                                if (extensions.Any(x => file.Name.Contains(x)) && !exclusions.Any(x => file.Name.Contains(x)))
-                                {
-                                    log.LastFile = file.Name;
-                                    log.FileDownloadTimestamp = (DateTime)log.LastSuccess;
+                            log = logs.First();
+                            log.LastSuccess = DateTime.UtcNow;
+                            if(extensions.Any(x => file.Name.Contains(x)) && !exclusions.Any(x => file.Name.Contains(x)))
+                            {
+                                log.LastFile = file.Name;
+                                log.FileDownloadTimestamp = (DateTime)log.LastSuccess;

-                                    dataContext.Table<DownloadedFile>().AddNewRecord(new DownloadedFile()
-                                    {
-                                        DeviceID = m_deviceRecord.ID,
-                                        CreationTime = new FileInfo(localFileName).CreationTimeUtc,
-                                        File = file.Name,
-                                        Timestamp = (DateTime)log.LastSuccess
-                                    });
+                                dataContext.Table<DownloadedFile>().AddNewRecord(new DownloadedFile()
+                                {
+                                    DeviceID = m_deviceRecord.ID,
+                                    CreationTime = new FileInfo(localFileName).CreationTimeUtc,
+                                    File = file.Name,
+                                    Timestamp = (DateTime)log.LastSuccess
+                                });

-                                    int maxDownloadThreshold = ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThreshold"].ValueAsInt32() ?? 0;
-                                    if (maxDownloadThreshold > 0)
-                                    {
-                                        DateTime timeWindow = DateTime.UtcNow.AddHours(-(ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThresholdTimeWindow"].ValueAsInt32() ?? 24));
-                                        int count = dataContext.Table<DownloadedFile>().QueryRecordCount(new RecordRestriction("Timestamp >= {0} AND DeviceID = {1}", timeWindow, m_deviceRecord.ID));
-
-                                        if (count > maxDownloadThreshold)
-                                        {
-                                            dataContext.Connection.ExecuteNonQuery("UPDATE Device SET Enabled = 0 WHERE ID = {0}", m_deviceRecord.ID);
-                                            log.Message = "Disabled due to excessive file production.";
-                                            log.LastFailure = log.LastSuccess;
-                                            Program.Host.SendRequest(m_deviceRecord.NodeID, "reloadconfig");
-                                            OnStatusMessage($"[{m_deviceRecord.Name}] Disabled due to excessive file downloads. Setting: {maxDownloadThreshold}; Count: {count}");
-                                            m_deviceRecord.Enabled = false;
-
-                                            // TODO: ADD email notification.
-                                        }
-                                    }
+                                int maxDownloadThreshold = ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThreshold"].ValueAsInt32() ?? 0;
+                                if (maxDownloadThreshold > 0)
+                                {
+                                    DateTime timeWindow = DateTime.UtcNow.AddHours(-(ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThresholdTimeWindow"].ValueAsInt32() ?? 24));
+                                    int count = dataContext.Table<DownloadedFile>().QueryRecordCount(new RecordRestriction("Timestamp >= {0}", timeWindow));
+
+                                    if (count > maxDownloadThreshold)
+                                    {
+                                        dataContext.Connection.ExecuteNonQuery("UPDATE Device SET Enabled = 0 WHERE ID = {0}", m_deviceRecord.ID);
+                                        dataContext.Connection.ExecuteNonQuery("UPDATE StatusLog SET Message = 'Disabled due to excessive file production.' WHERE DeviceID = {0}", m_deviceRecord.ID);
+                                        Program.Host.SendRequest(m_deviceRecord.NodeID, "reloadconfig");
+
+                                        // TODO: ADD email notification.
+                                    }
                                 }
-                                dataContext.Table<StatusLog>().UpdateRecord(log);
                             }
-                            else
-                            {
-                                log.LastSuccess = DateTime.UtcNow;
-                                log.DeviceID = m_deviceRecord.ID;
-                                if (extensions.Any(x => file.Name.Contains(x)) && !exclusions.Any(x => file.Name.Contains(x)))
-                                {
-                                    log.LastFile = file.Name;
-                                    log.FileDownloadTimestamp = (DateTime)log.LastSuccess;
-
-                                    dataContext.Table<DownloadedFile>().AddNewRecord(new DownloadedFile()
-                                    {
-                                        DeviceID = m_deviceRecord.ID,
-                                        CreationTime = new FileInfo(localFileName).CreationTimeUtc,
-                                        File = file.Name,
-                                        Timestamp = (DateTime)log.LastSuccess
-                                    });
-
-                                    int maxDownloadThreshold = ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThreshold"].ValueAsInt32() ?? 0;
-                                    if (maxDownloadThreshold > 0)
-                                    {
-                                        DateTime timeWindow = DateTime.UtcNow.AddHours(-(ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThresholdTimeWindow"].ValueAsInt32() ?? 24));
-                                        int count = dataContext.Table<DownloadedFile>().QueryRecordCount(new RecordRestriction("Timestamp >= {0} AND DeviceID = {1}", timeWindow, m_deviceRecord.ID));
-
-                                        if (count > maxDownloadThreshold)
-                                        {
-                                            dataContext.Connection.ExecuteNonQuery("UPDATE Device SET Enabled = 0 WHERE ID = {0}", m_deviceRecord.ID);
-                                            log.Message = "Disabled due to excessive file production.";
-                                            log.LastFailure = log.LastSuccess;
-                                            Program.Host.SendRequest(m_deviceRecord.NodeID, "reloadconfig");
-                                            OnStatusMessage($"[{m_deviceRecord.Name}] Disabled due to excessive file downloads. Setting: {maxDownloadThreshold}; Count: {count}");
-                                            m_deviceRecord.Enabled = false;
-
-                                            // TODO: ADD email notification.
-                                        }
-                                    }
-
-
-                                }
-                                dataContext.Table<StatusLog>().AddNewRecord(log);
-                            }
-
+                            dataContext.Table<StatusLog>().UpdateRecord(log);
                         }
                         else
                         {
+                            log.LastSuccess = DateTime.UtcNow;
+                            log.DeviceID = m_deviceRecord.ID;
+                            if (extensions.Any(x => file.Name.Contains(x)) && !exclusions.Any(x => file.Name.Contains(x)))
+                            {
+                                log.LastFile = file.Name;
+                                log.FileDownloadTimestamp = (DateTime)log.LastSuccess;

-                            if (logs.Any())
-                            {
-                                log = logs.First();
-                                log.LastFailure = DateTime.UtcNow;
-                                log.Message = message;
-                                dataContext.Table<StatusLog>().UpdateRecord(log);
+                                dataContext.Table<DownloadedFile>().AddNewRecord(new DownloadedFile()
+                                {
+                                    DeviceID = m_deviceRecord.ID,
+                                    CreationTime = new FileInfo(localFileName).CreationTimeUtc,
+                                    File = file.Name,
+                                    Timestamp = (DateTime)log.LastSuccess
+                                });
+
+                                int maxDownloadThreshold = ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThreshold"].ValueAsInt32() ?? 0;
+                                if (maxDownloadThreshold > 0)
+                                {
+                                    DateTime timeWindow = DateTime.UtcNow.AddHours(-(ConfigurationFile.Current.Settings?["systemSettings"]["MaxDownloadThresholdTimeWindow"].ValueAsInt32() ?? 24));
+                                    int count = dataContext.Table<DownloadedFile>().QueryRecordCount(new RecordRestriction("Timestamp >= {0}", timeWindow));
+
+                                    if (count > maxDownloadThreshold)
+                                    {
+                                        dataContext.Connection.ExecuteNonQuery("UPDATE Device SET Enabled = 0 WHERE ID = {0}", m_deviceRecord.ID);
+                                        dataContext.Connection.ExecuteNonQuery("UPDATE StatusLog SET Message = 'Disabled due to excessive file production.' WHERE DeviceID = {0}", m_deviceRecord.ID);
+                                        Program.Host.SendRequest(m_deviceRecord.NodeID, "reloadconfig");
+
+                                        // TODO: ADD email notification.
+                                    }
+                                }
+
+
                             }
-                            else
-                            {
-                                log.LastFailure = DateTime.UtcNow;
-                                log.Message = message;
-                                log.DeviceID = m_deviceRecord.ID;
-                                log.FileDownloadTimestamp = null;
-                                dataContext.Table<StatusLog>().AddNewRecord(log);
-                            }
+                            dataContext.Table<StatusLog>().AddNewRecord(log);
+                        }

+                    }
+                    else
+                    {
+
+                        if (logs.Any())
+                        {
+                            log = logs.First();
+                            log.LastFailure = DateTime.UtcNow;
+                            log.Message = message;
+                            dataContext.Table<StatusLog>().UpdateRecord(log);
                         }
+                        else
+                        {
+                            log.LastFailure = DateTime.UtcNow;
+                            log.Message = message;
+                            log.DeviceID = m_deviceRecord.ID;
+                            log.FileDownloadTimestamp = null;
+                            dataContext.Table<StatusLog>().AddNewRecord(log);
+                        }
+
                     }
                 }
             }


Fixed VelocityTracker Values #FIX: VelocityTracker values are no longer framerate-dependent.

--- Source/Core/Duality/Components/VelocityTracker.cs
+++ Source/Core/Duality/Components/VelocityTracker.cs
@@ -66,8 +66,8 @@
 				Vector3 pos = transform.Pos;
 				float angle = transform.Angle;

-				this.velocity = pos - this.lastPosition;
-				this.angleVelocity = MathF.TurnDir(this.lastAngle, angle) * MathF.CircularDist(this.lastAngle, angle);
+				this.velocity = (pos - this.lastPosition) / Time.TimeMult;
+				this.angleVelocity = (MathF.TurnDir(this.lastAngle, angle) * MathF.CircularDist(this.lastAngle, angle)) / Time.TimeMult;
 				this.lastPosition = pos;
 				this.lastAngle = angle;
 			}
@@ -88,7 +88,7 @@
 			base.OnCopyDataTo(targetObj, operation);
 			VelocityTracker target = targetObj as VelocityTracker;
 			target.lastPosition   = this.lastPosition;
-			target.lastAngle = this.lastAngle;
+			target.lastAngle      = this.lastAngle;
 			target.velocity       = this.velocity;
 			target.angleVelocity  = this.angleVelocity;
 		}


- Tweaked exception message.

- Tweaked exception message.

--- Source/Ether.TextAnalysis/PipelineConfigurator.cs
+++ Source/Ether.TextAnalysis/PipelineConfigurator.cs
@@ -45,11 +45,13 @@
         {
             if (string.IsNullOrWhiteSpace(modelFolder))
                 throw new InvalidOperationException("The AppSetting CoreNLP.ModelDirectory was not found. " +
-                                                    "This must be set to a folder containing the CoreNLP models jar, " +
+                                                    "This must be set to a folder containing the CoreNLP, " +
                                                     "which can be downloaded here: http://stanfordnlp.github.io/CoreNLP/");

             if (!Directory.Exists(modelFolder))
-                throw new InvalidOperationException("CoreNLP.ModelDirectory: directory not found.");
+                throw new InvalidOperationException("Model directory not found. Make sure the AppSetting " +
+                                                    "named CoreNLP.ModelDirectory exists and that the folder contains the training models." +
+                                                    "See the github page for details.");
         }

         /// <summary>


Remove unnecessary disposal of bounded observable

--- Source/Totem.Runtime/Timeline/TimelineSchedule.cs
+++ Source/Totem.Runtime/Timeline/TimelineSchedule.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reactive.Concurrency;
 using System.Reactive.Linq;

 namespace Totem.Runtime.Timeline
@@ -10,82 +11,69 @@
 	/// </summary>
 	internal sealed class TimelineSchedule : PushScope
 	{
-    private readonly HashSet<IDisposable> _timers = new HashSet<IDisposable>();
-    private readonly HashSet<TimelinePosition> _resumedPositions = new HashSet<TimelinePosition>();
+		private readonly HashSet<TimelinePosition> _resumedPositions = new HashSet<TimelinePosition>();
 		private readonly TimelineScope _scope;
-    private TimelinePosition _resumeCheckpoint;
+		private TimelinePosition _resumeCheckpoint;

 		internal TimelineSchedule(TimelineScope scope)
 		{
 			_scope = scope;
 		}

-    internal void ResumeWith(ResumeInfo info)
-    {
-      foreach(var pointInfo in info.Points)
-      {
-        if(pointInfo.OnSchedule)
-        {
-          _resumedPositions.Add(pointInfo.Point.Position);
-        }
+		internal void ResumeWith(ResumeInfo info)
+		{
+			foreach(var pointInfo in info.Points)
+			{
+				if(pointInfo.OnSchedule)
+				{
+					_resumedPositions.Add(pointInfo.Point.Position);
+				}

-        _resumeCheckpoint = pointInfo.Point.Position;
-      }
-    }
+				_resumeCheckpoint = pointInfo.Point.Position;
+			}
+		}

-    protected override void Close()
-    {
-      base.Close();
+		protected override void Close()
+		{
+			base.Close();

-      foreach(var timer in _timers.RemoveAll())
-      {
-        timer.Dispose();
-      }
-
-      _resumedPositions.Clear();
-    }
+			_resumedPositions.Clear();
+		}

 		protected override void Push()
 		{
-      if(Point.Scheduled && CanPush())
-      {
-        AddTimer();
-      }
+			if(Point.Scheduled && CanPush())
+			{
+				AddTimer();
+			}
 		}

-    private bool CanPush()
-    {
-      return _resumedPositions.Remove(Point.Position) || Point.Position > _resumeCheckpoint;
-    }
+		private bool CanPush()
+		{
+			return _resumedPositions.Remove(Point.Position) || Point.Position > _resumeCheckpoint;
+		}

 		private void AddTimer()
 		{
-      var point = Point;
+			var point = Point;

-      IDisposable timer = null;
-
-      timer = Observable
-        .Timer(new DateTimeOffset(point.Event.When))
-        .Take(1)
-        .Subscribe(_ => Push(point, timer));
-
-      _timers.Add(timer);
+			Observable
+				.Timer(new DateTimeOffset(point.Event.When))
+				.Take(1)
+				.ObserveOn(ThreadPoolScheduler.Instance)
+				.Subscribe(_ => Push(point));
 		}

-    private void Push(TimelinePoint point, IDisposable timer)
-    {
-      if(State.IsConnecting || State.IsConnected)
-      {
-        _timers.Remove(timer);
-
-        timer.Dispose();
-
-        _scope.PushScheduled(point);
-      }
-      else
-      {
-        Log.Warning("[timeline] Cannot push to schedule when {Phase:l} - ignoring {Point:l}", State.Phase, point);
-      }
-    }
-  }
+		private void Push(TimelinePoint point)
+		{
+			if(State.IsConnecting || State.IsConnected)
+			{
+				_scope.PushScheduled(point);
+			}
+			else
+			{
+				Log.Warning("[timeline] Cannot push to schedule when {Phase:l} - ignoring {Point:l}", State.Phase, point);
+			}
+		}
+	}
 }


Mining should check player position everytime we look for new nodes

--- FFTools_Mining.cs
+++ FFTools_Mining.cs
@@ -27,6 +27,7 @@
             //}

             while (true) {
+                thePlayer = theMemory.readPlayer();
                 List<IntPtr> MineTypeAddresses = theMemory.findAddresses(MineTypeByteArray);
                 List<MineralDeposit> theMinDepList = theMemory.readMineralDepositList(MineTypeAddresses);
                 System.Console.WriteLine("-------");
@@ -35,6 +36,7 @@
                 System.Console.WriteLine(md);
                 System.Console.WriteLine("With a distance of " + findDistanceBetween(thePlayer, md.x, md.y));
                 System.Console.WriteLine("Need to face " + findOrientationRelativeTo(thePlayer, md.x, md.y));
+                Console.ReadLine();
                 System.Console.WriteLine("Traveling to the node...");
                 travelTo(theMemory, md.x, md.y);
                 mineFrom(theMemory);
@@ -45,12 +47,12 @@
         private static void mineFrom(MemoryManager theMemory) {
             theMemory.sendKeyPressMsg(Keys.End, 500);
             Thread.Sleep(500);
-            theMemory.sendKeyPressMsg(Keys.F9, 500);
+            theMemory.sendKeyPressMsg(Keys.Enter, 500);
             Thread.Sleep(200);
-            theMemory.sendKeyPressMsg(Keys.NumPad1, 500);
+            theMemory.sendKeyPressMsg(Keys.Enter, 500);
             Thread.Sleep(1500);
             for (int i = 0; i < 4; i++) {
-                theMemory.sendKeyPressMsg(Keys.NumPad1, 500);
+                theMemory.sendKeyPressMsg(Keys.Enter, 500);
                 Thread.Sleep(3600);
             }
             Thread.Sleep(3000);


- added one check for range() : step must not be 0
- added check against max < 0 for NET_2_0 range(max) to match compiler-optimized for-in-range loops behavior.
- more useful exception messages

git-svn-id: fcce7d6ce0ac15bf24f68871b5145d46fc068279@2422 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang/Builtins.cs
+++ src/Boo.Lang/Builtins.cs
@@ -298,6 +298,12 @@
 #if NET_2_0
 		public static IEnumerable<int> range(int max)
 		{
+			if (max < 0) /* added for coherence with behavior of compiler-optimized
+						  * for-in-range() loops, should compiler loops automatically
+						  * inverse iteration in this case? */
+			{
+				throw new ArgumentOutOfRangeException("max < 0");
+			}
 			return range(0, max);
 		}

@@ -305,30 +311,33 @@
 		{
 			if (begin < end)
 			{
-				for (int i = begin; i<end; ++i) yield return i;
+				for (int i = begin; i < end; ++i) yield return i;
+			}
+			else if (begin > end)
+			{
+				for (int i = begin; i > end; --i) yield return i;
+			}
+		}
+
+		public static IEnumerable<int> range(int begin, int end, int step)
+		{
+			if (0 ==step)
+			{
+				throw new ArgumentOutOfRangeException("step == 0");
+			}
+			if (step < 0)
+			{
+				if (begin < end)
+				{
+					throw new ArgumentOutOfRangeException("begin < end && step < 0");
+				}
+				for (int i = begin; i > end; i += step) yield return i;
 			}
 			else
 			{
-				for (int i = begin; i>end; --i) yield return i;
-			}
-		}
-
-		public static IEnumerable<int> range(int begin, int end, int step)
-		{
-			if (step < 0)
-			{
-				if (begin < end)
-				{
-					throw new ArgumentOutOfRangeException("step");
-				}
-
-				for (int i = begin; i > end; i += step) yield return i;
-			}
-			else
-			{
 				if (begin > end)
 				{
-					throw new ArgumentOutOfRangeException("step");
+					throw new ArgumentOutOfRangeException("begin > end && step > 0");
 				}
 				for (int i = begin; i < end; i += step) yield return i;
 			}
@@ -339,9 +348,8 @@
 		{
 			if (max < 0)
 			{
-				throw new ArgumentOutOfRangeException("max");
-			}
-
+				throw new ArgumentOutOfRangeException("max < 0");
+			}
 			return new RangeEnumerable(0, max, 1);
 		}

@@ -357,21 +365,95 @@

 		public static RangeEnumerable range(int begin, int end, int step)
 		{
+			if (0 ==step)
+			{
+				throw new ArgumentOutOfRangeException("step == 0");
+			}
 			if (step < 0)
 			{
 				if (begin < end)
 				{
-					throw new ArgumentOutOfRangeException("step");
+					throw new ArgumentOutOfRangeException("begin < end && step < 0");
 				}
 			}
 			else
 			{
 				if (begin > end)
 				{
-					throw new ArgumentOutOfRangeException("step");
+					throw new ArgumentOutOfRangeException("begin > end && step > 0");
 				}
 			}
 			return new RangeEnumerable(begin, end, step);
+		}
+
+		[EnumeratorItemType(typeof(int))]
+		public class RangeEnumerable : IEnumerable
+		{
+			int _begin;
+			int _end;
+			int _step;
+
+			internal RangeEnumerable(int begin, int end, int step)
+			{
+				_begin = begin;
+				_end = end;
+				_step = step;
+			}
+
+			public IEnumerator GetEnumerator()
+			{
+				return new RangeEnumerator(_begin, _end, _step);
+			}
+		}
+
+		[EnumeratorItemType(typeof(int))]
+		public class RangeEnumerator : IEnumerator
+		{
+			int _index;
+			int _begin;
+			int _end;
+			int _step;
+
+			internal RangeEnumerator(int begin, int end, int step)
+			{
+				if (step > 0)
+				{
+					_end = begin + (step * (int)Math.Ceiling(Math.Abs(end-begin)/((double)step)));
+				}
+				else
+				{
+					_end = begin + (step * (int)Math.Ceiling(Math.Abs(begin-end)/((double)Math.Abs(step))));
+				}
+
+				_end -= step;
+				_begin = begin-step;
+				_step = step;
+				_index = _begin;
+			}
+
+			public void Reset()
+			{
+				_index = _begin;
+			}
+
+			public bool MoveNext()
+			{
+				if (_index != _end)
+				{
+					_index += _step;
+					return true;
+				}
+				return false;
+			}
+
+			public object Current
+			{
+				get
+				{
+					return _index;
+				}
+			}
+
 		}
 #endif

@@ -501,76 +583,6 @@
 				return this;
 			}
 		}
-
-		[EnumeratorItemType(typeof(int))]
-		public class RangeEnumerable : IEnumerable
-		{
-			int _begin;
-			int _end;
-			int _step;
-
-			internal RangeEnumerable(int begin, int end, int step)
-			{
-				_begin = begin;
-				_end = end;
-				_step = step;
-			}
-
-			public IEnumerator GetEnumerator()
-			{
-				return new RangeEnumerator(_begin, _end, _step);
-			}
-		}
-
-		[EnumeratorItemType(typeof(int))]
-		public class RangeEnumerator : IEnumerator
-		{
-			int _index;
-			int _begin;
-			int _end;
-			int _step;
-
-			internal RangeEnumerator(int begin, int end, int step)
-			{
-				if (step > 0)
-				{
-					_end = begin + (step * (int)Math.Ceiling(Math.Abs(end-begin)/((double)step)));
-				}
-				else
-				{
-					_end = begin + (step * (int)Math.Ceiling(Math.Abs(begin-end)/((double)Math.Abs(step))));
-				}
-
-				_end -= step;
-				_begin = begin-step;
-				_step = step;
-				_index = _begin;
-			}
-
-			public void Reset()
-			{
-				_index = _begin;
-			}
-
-			public bool MoveNext()
-			{
-				if (_index != _end)
-				{
-					_index += _step;
-					return true;
-				}
-				return false;
-			}
-
-			public object Current
-			{
-				get
-				{
-					return _index;
-				}
-			}
-
-		}

 		public class ConcatEnumerator : IEnumerator, IEnumerable
 		{


missing bit in assemblyinfo

missing bit in assemblyinfo

--- AgileTools.CommandLine/Properties/AssemblyInfo.cs
+++ AgileTools.CommandLine/Properties/AssemblyInfo.cs
@@ -34,3 +34,5 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+


Update SFieldCalculator.cs

Update SFieldCalculator.cs

Have status-curing spells cure statuses according to StatusSets.csv in the field menu.
Thanks DV (Qhimm) for spotting the issue.

--- Assembly-CSharp/Memoria/Field/SFieldCalculator.cs
+++ Assembly-CSharp/Memoria/Field/SFieldCalculator.cs
@@ -258,8 +258,9 @@

         private static void FldCalcSub_302(Context v)
         {
-            Byte[] numArray = new Byte[6] { 0, 0, 0, 2, 1, 24 };
-            if ((Int32)FieldRemoveStatuses(v.Target, numArray[v.Tbl.AddNo]) == 2)
+            // Use the status set list initialized through CSV reading
+            // Might use "....Value & 127" instead of the plain Value although that doesn't seem required
+            if ((Int32)FieldRemoveStatuses(v.Target, (Byte)FF9BattleDB.StatusSets[v.Tbl.AddNo].Value) == 2)
                 return;
             v.Flags |= 1;
         }
@@ -363,4 +364,4 @@
             public Int32 TargetMp;
         }
     }
-}+}


next step to cursors

next step to cursors

--- Bend/LayerManager/RootMetadata/RangemapManager.cs
+++ Bend/LayerManager/RootMetadata/RangemapManager.cs
@@ -475,33 +475,42 @@
                         }
                     }

-                    try {
-                        foreach (var out_rec in chain) {
-                            if (out_rec.Value.type == RecordUpdateTypes.FULL) {
-                                if (equal_ok || (cur_key.CompareTo(out_rec.Key)) != 0) {
-                                    record = new RecordData(RecordDataState.NOT_PROVIDED, out_rec.Key);
-                                    record.applyUpdate(out_rec.Value);
-                                    key = out_rec.Key;
-                                    return GetStatus.PRESENT;
-                                }
+                    var chain_enum = chain.GetEnumerator();
+                    bool chain_hasmore = true;
+
+                    while (chain_hasmore) {
+                        try {
+                            chain_hasmore = chain_enum.MoveNext();
+                        } catch (SortedSetExhaustedException e) {
+                            Console.WriteLine("One ran out: " + e.ToString());
+                            // we need to prime the next key properly
+                            Console.WriteLine("lowkey: {0}  cur_key:{1}", lowkey, cur_key);
+                            // throw new Exception(e.ToString());
+                            KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>> seg_ranout =
+                                (KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>)e.payload;
+                            // set cur_key to the last key in the RangeKey??
+
+                            cur_key = RecordKey.AfterPrefix(seg_ranout.Key.highkey);
+                            continue;
+                        }
+
+
+
+                        var out_rec = chain_enum.Current;
+                        if (out_rec.Value.type == RecordUpdateTypes.FULL) {
+                            if (equal_ok || (cur_key.CompareTo(out_rec.Key)) != 0) {
+                                record = new RecordData(RecordDataState.NOT_PROVIDED, out_rec.Key);
+                                record.applyUpdate(out_rec.Value);
+                                key = out_rec.Key;
+                                return GetStatus.PRESENT;
                             }
-                            cur_key = out_rec.Key;
-                            equal_ok = false;
-                            Console.WriteLine("advance past. {0}", out_rec);
-
-                        }
-                    } catch (SortedSetExhaustedException e) {
-                        Console.WriteLine("One ran out: " + e.ToString());
-                        // we need to prime the next key properly
-                        Console.WriteLine("lowkey: {0}  cur_key:{1}", lowkey, cur_key);
-                        // throw new Exception(e.ToString());
-                        KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>> seg_ranout =
-                            (KeyValuePair<RangeKey, IScannable<RecordKey, RecordUpdate>>)e.payload;
-                        // set cur_key to the last key in the RangeKey??
-
-                        cur_key = RecordKey.AfterPrefix(seg_ranout.Key.highkey);
-                        continue;
-                    }
+                        }
+                        cur_key = out_rec.Key;
+                        equal_ok = false;
+                        Console.WriteLine("advance past. {0}", out_rec);
+                    }
+
+
                     return GetStatus.MISSING;
                 }
         }


Fix build

Fix build

--- Builder.Tests/Features/StagerCanRunBuilderSpec.cs
+++ Builder.Tests/Features/StagerCanRunBuilderSpec.cs
@@ -286,18 +286,24 @@
             context["given a zip url buildpack and a valid app"] = () =>
             {
                 string resultFile = null;
+                HttpListener zipServer = null;

                 before = () =>
                 {
                     var port = GetFreeTcpPort();
                     tmpZip = Path.GetTempFileName();
                     File.Delete(tmpZip);
-                    StartZipServer("127.0.0.1", port, Path.Combine(currentDirectory, "Builder.Tests", "Fixtures", "buildpacks", "run-buildpack"), tmpZip);
+                    zipServer = StartZipServer("127.0.0.1", port, Path.Combine(currentDirectory, "Builder.Tests", "Fixtures", "buildpacks", "run-buildpack"), tmpZip);

                     resultFile = Path.Combine(tmpDir, "result.json");

                     Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(Path.Combine(currentDirectory, "Builder.Tests", "Fixtures", "apps", "run"), appDir);
                     arguments["-buildpackOrder"] = "\"http://localhost:" + port + "/buildpack.zip\"";
+                };
+
+                after = () =>
+                {
+                    zipServer.Stop();
                 };

                 it["Exit code is 0"] = () =>


Add missing ValidationMessage constant

Add missing ValidationMessage constant

--- src/BrockAllen.MembershipReboot/Constants/MembershipRebootConstants.cs
+++ src/BrockAllen.MembershipReboot/Constants/MembershipRebootConstants.cs
@@ -112,6 +112,7 @@
             public const string UsernameCannotRepeatSpecialCharacters = "UsernameCannotRepeatSpecialCharacters";
             public const string UsernameRequired = "UsernameRequired";
             public const string UsernameCanOnlyStartOrEndWithLetterOrDigit = "UsernameCanOnlyStartOrEndWithLetterOrDigit";
+            public const string LinkedAccountAlreadyInUse = "LinkedAccountAlreadyInUse";
         }
     }
 }


(GH-501) Corrected parsing of ComVisible attribute

Fixes GH-501

--- src/Cake.Common/Solution/Project/Properties/AssemblyInfoParseResult.cs
+++ src/Cake.Common/Solution/Project/Properties/AssemblyInfoParseResult.cs
@@ -180,7 +180,7 @@
         {
             _clsCompliant = !string.IsNullOrWhiteSpace(clsCompliant) && bool.Parse(clsCompliant);
             _company = company;
-            _comVisible = !string.IsNullOrWhiteSpace(clsCompliant) && bool.Parse(comVisible);
+            _comVisible = !string.IsNullOrWhiteSpace(comVisible) && bool.Parse(comVisible);
             _configuration = configuration;
             _copyright = copyright;
             _description = description;


Change return type of IGameRepository.Get

--- src/ChessVariantsTraining/DbRepositories/Variant960/IGameRepository.cs
+++ src/ChessVariantsTraining/DbRepositories/Variant960/IGameRepository.cs
@@ -5,7 +5,7 @@
     public interface IGameRepository
     {
         void Add(Game game);
-        void Get(string id);
+        Game Get(string id);
         void Update(Game game);
     }
 }


Add tests for the C# brace matcher with function pointers

--- src/EditorFeatures/CSharpTest/BraceMatching/CSharpBraceMatcherTests.cs
+++ src/EditorFeatures/CSharpTest/BraceMatching/CSharpBraceMatcherTests.cs
@@ -820,5 +820,14 @@

             await TestAsync(code, expected, TestOptions.Regular);
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.BraceMatching)]
+        public async Task TestFunctionPointer()
+        {
+            var code = @"public unsafe class C { delegate*<$$int, int> functionPointer; }";
+            var expected = @"public unsafe class C { delegate*<int, int[|>|] functionPointer; }";
+
+            await TestAsync(code, expected, TestOptions.Regular);
+        }
     }
 }


Set UnidirectionalHierarchyCascade to true

--- src/EditorFeatures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs
+++ src/EditorFeatures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs
@@ -77,7 +77,7 @@
         {
             return ToDefinitionItemAsync(
                 definition, solution, isPrimary: false, includeHiddenLocations, includeClassifiedSpans: false,
-                options: FindReferencesSearchOptions.Default, cancellationToken: cancellationToken);
+                options: FindReferencesSearchOptions.Default.With(unidirectionalHierarchyCascade: true), cancellationToken: cancellationToken);
         }

         public static Task<DefinitionItem> ToClassifiedDefinitionItemAsync(


Change Sidebar large number of shortcuts warning message and trigger

--- DesktopWidgets/Widgets/Sidebar/ShortcutHelper.cs
+++ DesktopWidgets/Widgets/Sidebar/ShortcutHelper.cs
@@ -49,8 +49,8 @@

         public static void ProcessFiles(this ViewModel viewModel, string[] files, bool msg = true, int position = -1)
         {
-            if (files.Length >= 5 && msg &&
-                Popup.Show($"You are attempting to add {files.Length} shortcuts.\n\nAre you sure?",
+            if (files.Length >= 10 && msg &&
+                Popup.Show($"Are you sure you want to add {files.Length} shortcuts?",
                     MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes) == MessageBoxResult.No)
             {
                 return;


work around plugin loading multiple times (#805)

* work around plugin loading multiple times

* resolve comments

--- src/docfx/SubCommands/DocumentBuilderWrapper.cs
+++ src/docfx/SubCommands/DocumentBuilderWrapper.cs
@@ -160,6 +160,12 @@
                         Logger.LogWarning("Skipping assembly: Microsoft.DocAsCode.EntityModel.");
                         continue;
                     }
+                    if (assemblyName == typeof(ValidateBookmark).Assembly.GetName().Name)
+                    {
+                        // work around, don't load assembly that has ValidateBookmark.
+                        Logger.LogWarning($"Skipping assembly: {assemblyName}.");
+                        continue;
+                    }
                     try
                     {
                         assembly = Assembly.Load(assemblyName);


TDD - CONJURED ITEMS - PASS - GREEN

TDD - CONJURED ITEMS - PASS - GREEN

Tests pass for conjured items so we can now implement in the Factory
class

--- src/Kata.GildedRose.CSharp.Domain/Strategies/ConjuredUpdateStrategy.cs
+++ src/Kata.GildedRose.CSharp.Domain/Strategies/ConjuredUpdateStrategy.cs
@@ -1,5 +1,4 @@
-using System;
-using Kata.GildedRose.CSharp.Domain;
+using Kata.GildedRose.CSharp.Domain;

 namespace ata.GildedRose.CSharp.Domain.Strategies
 {
@@ -7,7 +6,11 @@
     {
         public void UpdateItem(Item item)
         {
-            throw new NotImplementedException();
+            item.Quality -= 2;
+            if (item.SellIn > 0)
+                item.SellIn--;
+            if (item.SellIn <= 0)
+                item.Quality -= 2;
         }
     }
 }


Remove redundant interface implementation.

--- Duplicati/Library/Modules/Builtin/HttpOptions.cs
+++ Duplicati/Library/Modules/Builtin/HttpOptions.cs
@@ -24,7 +24,7 @@

 namespace Duplicati.Library.Modules.Builtin
 {
-    public class HttpOptions : Duplicati.Library.Interface.IGenericModule, Duplicati.Library.Interface.IConnectionModule, IDisposable
+    public class HttpOptions : Duplicati.Library.Interface.IConnectionModule, IDisposable
     {
         private const string OPTION_DISABLE_EXPECT100 = "disable-expect100-continue";
         private const string OPTION_DISABLE_NAGLING = "disable-nagling";


Removed a redundant [InternalsVisibleTo] attribute

that never should have been there in the first place, but went unnoticed
until now.

--- Src/AutoFixture.NUnit2/Properties/AssemblyInfo.cs
+++ Src/AutoFixture.NUnit2/Properties/AssemblyInfo.cs
@@ -20,7 +20,6 @@
 // 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)]
-[assembly: InternalsVisibleTo("AutoFixture.NUnit2.UnitTest")]

 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("3a54aa4b-be9b-4591-bf8c-0a463e91088f")]


Adicionado evento TextChanged no form.

Adicionado evento TextChanged no form.

--- Form1.Designer.cs
+++ Form1.Designer.cs
@@ -254,6 +254,7 @@
             this.TextEditor.TabIndex = 5;
             this.TextEditor.Text = "";
             this.TextEditor.WordWrap = false;
+            this.TextEditor.TextChanged += TextEditor_TextChanged;
             //
             // RichLineNumbers
             //


Add MDToken ToInt32() and ToUInt32() methods

--- src/DotNet/MD/MDToken.cs
+++ src/DotNet/MD/MDToken.cs
@@ -122,6 +122,20 @@
 			return ToTable((uint)token);
 		}

+		/// <summary>
+		/// Gets the token as a raw 32-bit signed integer
+		/// </summary>
+		public int ToInt32() {
+			return (int)token;
+		}
+
+		/// <summary>
+		/// Gets the token as a raw 32-bit unsigned integer
+		/// </summary>
+		public uint ToUInt32() {
+			return token;
+		}
+
 		/// <summary>Overloaded operator</summary>
 		public static bool operator ==(MDToken left, MDToken right) {
 			return left.CompareTo(right) == 0;


Unique index on datasource names.

Unique index on datasource names.

--- EntityData/Migrations/201401191518010_Initial.cs
+++ EntityData/Migrations/201401191518010_Initial.cs
@@ -90,6 +90,11 @@
                         Name = c.String(maxLength: 255, unicode: false, storeType: "nvarchar"),
                     })
                 .PrimaryKey(t => t.ID);
+
+            CreateIndex(
+            "dbo.Datasources",
+            "Name",
+            unique: true);

             CreateTable(
                 "dbo.Exchanges",
@@ -106,8 +111,6 @@
                 "dbo.Exchanges",
                 "Name",
                 unique: true);
-
-

             CreateTable(
                 "dbo.exchangesessions",


Removed unused test

Removed unused test

--- FileHelpers.Tests/Tests/Common/ChineseSupport.cs
+++ FileHelpers.Tests/Tests/Common/ChineseSupport.cs
@@ -44,25 +44,6 @@
             Assert.AreEqual("A123456789", res[0].id);
         }

-//
-//		[Test]
-//		public void ReadFileUnicode()
-//		{
-//			engine = new FileHelperEngine(typeof (ChineseTest));
-//
-//			ChineseTest[] res;
-//			engine.Encoding = Encoding.Unicode;
-//			res = (ChineseTest[]) Common.ReadTest(engine, "Good", "ChineseUnicode.txt");
-//
-//			Assert.AreEqual(2, res.Length);
-//			Assert.AreEqual(2, engine.TotalRecords);
-//			Assert.AreEqual(0, engine.ErrorManager.ErrorCount);
-//
-//			Assert.AreEqual(new DateTime(2006, 10, 08), res[0].fecha);
-//			Assert.AreEqual("x_vFF3           ", res[0].chino);
-//			Assert.AreEqual("A123456789", res[0].id);
-//		}
-
         [FixedLengthRecord(FixedMode.ExactLength)]
         private class ChineseTest
         {


Fix tests for new icons

Fix tests for new icons

--- FontAwesome.Sharp.Tests/WPF/IconHelper_Should.cs
+++ FontAwesome.Sharp.Tests/WPF/IconHelper_Should.cs
@@ -41,11 +41,11 @@
             foreach (var icon in Icons)
             {
                 const int size = 16;
+                const int delta = +2;
                 var imageSource = icon.ToImageSource(Brushes.Black, size);
                 imageSource.Should().NotBeNull($"an image should be generated for '{icon}'");
                 imageSource.Should().BeOfType<DrawingImage>();
-                Math.Round(imageSource.Width).Should().BeLessOrEqualTo(size + 1);
-                Math.Round(imageSource.Height).Should().BeLessOrEqualTo(size + 1);
+                Math.Max(imageSource.Width, imageSource.Height).Should().BeLessOrEqualTo(size+delta, $"{icon} size should be less than {size}+{delta}.");
             }
         }


Fix for unit tests

Fix for unit tests

--- Binance.Net.UnitTests/BinanceSocketClientTests.cs
+++ Binance.Net.UnitTests/BinanceSocketClientTests.cs
@@ -281,10 +281,10 @@
                 Event = "TestTradeStream",
                 EventTime = new DateTime(2017, 1, 1),
                 Symbol = "test",
-                AggregatedTradeId = 1000000000000,
+                TradeId = 1000000000000,
                 BuyerIsMaker = true,
-                FirstTradeId = 10000000000000,
-                LastTradeId = 2000000000000,
+                BuyerOrderId = 10000000000000,
+                SellerOrderId = 2000000000000,
                 Price = 1.1m,
                 Quantity = 2.2m,
                 TradeTime = new DateTime(2017, 1, 1)


removed stray file

removed stray file

--- BrightWire.Source/TrainingData/WellKnown/MNIST.cs
+++ BrightWire.Source/TrainingData/WellKnown/MNIST.cs
@@ -1,169 +0,0 @@
-using BrightWire.Models;
-using BrightWire.TrainingData.Helper;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-using System.Linq;
-
-namespace BrightWire.TrainingData.WellKnown
-{
-    /// <summary>
-    /// Helper class for MNIST data: http://yann.lecun.com/exdb/mnist/
-    /// </summary>
-    public static class Mnist
-    {
-        /// <summary>
-        /// Input layer size
-        /// </summary>
-        public const int INPUT_SIZE = 784;
-
-        /// <summary>
-        /// Output layer size
-        /// </summary>
-        public const int OUTPUT_SIZE = 10;
-
-        /// <summary>
-        /// Image data
-        /// </summary>
-        public class Image
-        {
-            readonly byte[] _data;
-            readonly int _label;
-
-            internal Image(byte[] data, int label)
-            {
-                _data = data;
-                _label = label;
-            }
-
-            /// <summary>
-            /// The image data
-            /// </summary>
-            public byte[] Data => _data;
-
-            /// <summary>
-            /// The image number (0-9)
-            /// </summary>
-            public int Label => _label;
-
-            /// <summary>
-            /// Converts the image to one hot encoded float arrays
-            /// </summary>
-            public (FloatVector Data, FloatVector Label) AsFloatArray
-            {
-                get
-                {
-                    var label = new float[10];
-                    label[_label] = 1;
-
-                    return (
-                        new FloatVector { Data = _data.Select(b => Convert.ToSingle((int)b) / 255f).ToArray() },
-                        new FloatVector { Data = label }
-                    );
-                }
-            }
-
-            /// <summary>
-            /// Converts the image to a tensor with one hot encoded label vector
-            /// </summary>
-            public (FloatTensor Tensor, FloatVector Label) AsFloatTensor
-            {
-                get
-                {
-                    const int SIZE = 28;
-                    var data = AsFloatArray;
-                    var rows = new List<FloatVector>();
-                    var vector = data.Data.Data;
-
-                    for (var y = 0; y < SIZE; y++)
-                    {
-                        var row = new float[SIZE];
-                        for (var x = 0; x < SIZE; x++)
-                            row[x] = vector[(y * SIZE) + x];
-                        rows.Add(new FloatVector { Data = row });
-                    }
-                    var tensor = new FloatTensor
-                    {
-                        Matrix = new[] {
-                            FloatMatrix.Create(rows.ToArray())
-                        }
-                    };
-                    return (tensor, data.Label);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Downloads MNIST data sets if they are missing.
-        /// </summary>
-        /// <param name="destPath"></param>
-        private static void AssurateMNISTData(string destPath)
-        {
-            if (!File.Exists(destPath))
-            {
-                FileInfo compressed = new FileInfo(destPath + ".gz");
-                compressed.Directory.Create();
-                var source = $"http://yann.lecun.com/exdb/mnist/{Path.GetFileNameWithoutExtension(compressed.Name).Replace(".", "-")}.gz";
-                Console.WriteLine("Downloading: {0}", source);
-                using (var client = new System.Net.WebClient())
-                    client.DownloadFile(source, compressed.FullName);
-
-
-
-                using (var src = compressed.OpenRead())
-                using (FileStream decompressedFileStream = File.Create(destPath))
-                using (GZipStream decompressionStream = new GZipStream(src, CompressionMode.Decompress))
-                    decompressionStream.CopyTo(decompressedFileStream);
-
-                Console.WriteLine("Decompressed: {0}", compressed.FullName);
-            }
-        }
-
-        /// <summary>
-        /// Loads a set of images from the MNIST data files
-        /// </summary>
-        /// <param name="labelPath">Path to the label data file</param>
-        /// <param name="imagePath">Path to the image data file</param>
-        /// <param name="total">Maximum number of images to load</param>
-        public static IReadOnlyList<Image> Load(string labelPath, string imagePath, int total = int.MaxValue)
-        {
-            AssurateMNISTData(labelPath);
-            var labels = new List<byte>();
-
-            using (var file = new FileStream(labelPath, FileMode.Open, FileAccess.Read))
-            using (var reader = new BigEndianBinaryReader(file))
-            {
-                reader.ReadInt32();
-                var count = reader.ReadUInt32();
-                for (var i = 0; i < count && i < total; i++)
-                {
-                    labels.Add(reader.ReadByte());
-                }
-            }
-
-            AssurateMNISTData(imagePath);
-            var images = new List<byte[]>();
-            using (var file = new FileStream(imagePath, FileMode.Open, FileAccess.Read))
-            using (var reader = new BigEndianBinaryReader(file))
-            {
-                reader.ReadInt32();
-                var count = reader.ReadUInt32();
-                var numRows = reader.ReadUInt32();
-                var numCols = reader.ReadUInt32();
-                var imageSize = numRows * numCols;
-                for (var i = 0; i < count && i < total; i++)
-                {
-                    var imageData = new byte[imageSize];
-                    for (var j = 0; j < imageSize; j++)
-                    {
-                        imageData[j] = reader.ReadByte();
-                    }
-                    images.Add(imageData);
-                }
-            }
-
-            return labels.Zip(images, (l, d) => new Image(d, l)).ToList();
-        }
-    }
-}


Revert "Hack for new version of RunTextWithXmlResults which returns multiple results"

This reverts commit ec4cab5ca645819b33c2dd8d50098b428fc27fb0.

--- CLR/tSQLt.Client.Net/Gateways/SqlServerGateway.cs
+++ CLR/tSQLt.Client.Net/Gateways/SqlServerGateway.cs
@@ -55,20 +55,7 @@
                                 string.Format("Expecting to get a data reader with the response to: \"{0}\" ", query));
                         }

-                        var result =  reader[0] as string;
-                        var testCount = 0;
-                        if (Int32.TryParse(result, out testCount))
-                        {
-                            if (reader.NextResult())
-                            {
-                                if (reader.Read())
-                                {
-                                    return reader[0] as string;
-                                }
-                            }
-                        }
-
-                        return result;
+                        return reader[0] as string;
                     }
                 }
         }


update

update

--- CSharpGL/0Foundations/Utilities/PositionHelper.cs
+++ CSharpGL/0Foundations/Utilities/PositionHelper.cs
@@ -7,6 +7,7 @@
     /// </summary>
     public static class PositionHelper
     {
+
         /// <summary>
         /// Move positions where around (0, 0)
         /// </summary>
@@ -90,6 +91,25 @@
             return new BoundingBox(min, max);
         }

+        public static BoundingBox GetBoundingBox(this vec3[] positions)
+        {
+            if (positions.Length == 0) { return new BoundingBox(); }
+
+            vec3 min = positions[0], max = positions[0];
+            for (int i = 1; i < positions.Length; i++)
+            {
+                vec3 value = positions[i];
+                if (value.x < min.x) { min.x = value.x; }
+                if (value.y < min.y) { min.y = value.y; }
+                if (value.z < min.z) { min.z = value.z; }
+                if (max.x < value.x) { max.x = value.x; }
+                if (max.y < value.y) { max.y = value.y; }
+                if (max.z < value.z) { max.z = value.z; }
+            }
+
+            return new BoundingBox(min, max);
+        }
+
         /// <summary>
         /// Move positions where around (0, 0, 0)
         /// </summary>
@@ -118,5 +138,24 @@

             return new BoundingBox(min, max);
         }
+
+        public static BoundingBox GetBoundingBox(this IList<vec3> positions)
+        {
+            if (positions.Count == 0) { return new BoundingBox(); }
+
+            vec3 min = positions[0], max = positions[0];
+            for (int i = 1; i < positions.Count; i++)
+            {
+                vec3 value = positions[i];
+                if (value.x < min.x) { min.x = value.x; }
+                if (value.y < min.y) { min.y = value.y; }
+                if (value.z < min.z) { min.z = value.z; }
+                if (max.x < value.x) { max.x = value.x; }
+                if (max.y < value.y) { max.y = value.y; }
+                if (max.z < value.z) { max.z = value.z; }
+            }
+
+            return new BoundingBox(min, max);
+        }
     }
 }


Improved logging for DebugMode

Improved logging for DebugMode

--- Checkout.ApiClient.Net45/Helpers/ApiHttpClient.cs
+++ Checkout.ApiClient.Net45/Helpers/ApiHttpClient.cs
@@ -8,6 +8,7 @@
 using System.Net;
 using System.Net.Http;
 using System.Net.Http.Headers;
+using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -75,11 +76,12 @@
             return null;
         }

-
+
+        public string callerSection = "";
         /// <summary>
         /// Submits a get request to the given web address with default content type e.g. text/plain
         /// </summary>
-        public HttpResponse<T> GetRequest<T>(string requestUri,string authenticationKey)
+        public HttpResponse<T> GetRequest<T>(string requestUri,string authenticationKey, [CallerMemberName] string callerFunction = "")
         {
             var httpRequestMsg = new HttpRequestMessage();

@@ -91,7 +93,9 @@

             if (AppSettings.DebugMode)
             {
-                Console.WriteLine(string.Format("\n\n** HttpRequest ** GET {0}", requestUri));
+                callerSection = callerFunction;
+                Console.WriteLine(string.Format("\n\n<{0}>", callerSection));
+                Console.WriteLine(string.Format("\n** HttpRequest ** - Type GET\n\n\t{0}", requestUri));
             }

             return SendRequest<T>(httpRequestMsg).Result;
@@ -100,7 +104,7 @@
         /// <summary>
         /// Submits a post request to the given web address
         /// </summary>
-        public HttpResponse<T> PostRequest<T>(string requestUri,string authenticationKey, object requestPayload = null)
+        public HttpResponse<T> PostRequest<T>(string requestUri,string authenticationKey, object requestPayload = null, [CallerMemberName] string callerFunction = "")
         {
             var httpRequestMsg = new HttpRequestMessage(HttpMethod.Post, requestUri);
             var requestPayloadAsString = GetObjectAsString(requestPayload);
@@ -112,8 +116,10 @@

             if (AppSettings.DebugMode)
             {
-                Console.WriteLine(string.Format("\n\n** HttpRequest ** POST {0}", requestUri));
-                Console.WriteLine(string.Format("\n\n** Payload ** \n {0} \n", requestPayloadAsString));
+                callerSection = callerFunction;
+                Console.WriteLine(string.Format("\n<{0}>", callerSection));
+                Console.WriteLine(string.Format("\n** HttpRequest ** - Type POST\n\n\t{0}\n", requestUri));
+                Console.WriteLine(string.Format("\n** Payload **\n\n\t{0}\n", requestPayloadAsString));
             }

             return SendRequest<T>(httpRequestMsg).Result;
@@ -122,7 +128,7 @@
         /// <summary>
         /// Submits a put request to the given web address
         /// </summary>
-        public HttpResponse<T> PutRequest<T>(string requestUri, string authenticationKey, object requestPayload = null)
+        public HttpResponse<T> PutRequest<T>(string requestUri, string authenticationKey, object requestPayload = null, [CallerMemberName] string callerFunction = "")
         {
             var httpRequestMsg = new HttpRequestMessage(HttpMethod.Put, requestUri);
             var requestPayloadAsString = GetObjectAsString(requestPayload);
@@ -134,8 +140,9 @@

             if (AppSettings.DebugMode)
             {
-                Console.WriteLine(string.Format("\n\n** HttpRequest ** PUT {0}", requestUri));
-                Console.WriteLine(string.Format("\n\n** Payload ** \n {0} \n", requestPayloadAsString));
+                Console.WriteLine(string.Format("\n[{0}]", callerFunction));
+                Console.WriteLine(string.Format("\n** HttpRequest ** - Type PUT\n\n\t{0}\n", requestUri));
+                Console.WriteLine(string.Format("\n** Payload **\n\n\t{0}\n", requestPayloadAsString));
             }

             return SendRequest<T>(httpRequestMsg).Result;
@@ -144,7 +151,7 @@
         /// <summary>
         /// Submits a delete request to the given web address
         /// </summary>
-        public HttpResponse<T> DeleteRequest<T>(string requestUri, string authenticationKey)
+        public HttpResponse<T> DeleteRequest<T>(string requestUri, string authenticationKey, [CallerMemberName] string callerFunction = "")
         {
             var httpRequestMsg = new HttpRequestMessage();

@@ -156,7 +163,8 @@

             if (AppSettings.DebugMode)
             {
-                Console.WriteLine(string.Format("\n\n** HttpRequest ** DELETE {0}", requestUri));
+                Console.WriteLine(string.Format("\n[{0}]", callerFunction));
+                Console.WriteLine(string.Format("\n** HttpRequest ** - Type DELETE\n\n\t{0}\n", requestUri));
             }

             return SendRequest<T>(httpRequestMsg).Result;
@@ -190,7 +198,9 @@

                     if (AppSettings.DebugMode)
                     {
-                        Console.WriteLine(string.Format("\n** HttpResponse - Status {0}**\n {1}\n", responseMessage.StatusCode, responseAsString));
+                        Console.WriteLine(string.Format("\n** HttpResponse ** - Status {0}\n\n\t{1}\n", responseMessage.StatusCode, responseAsString));
+                        Console.WriteLine(string.Format("</{0}>\n", callerSection));
+                        callerSection = "";
                     }
                 }


Comment out RequestContext from WPF example - it's not required. Add a comment about OnBeforePluginLoad

--- CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs
+++ CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs
@@ -23,9 +23,11 @@
             browser.MenuHandler = new MenuHandler();
             browser.GeolocationHandler = new GeolocationHandler();
             browser.DownloadHandler = new DownloadHandler();
-            browser.RequestContext = new RequestContext(new PluginHandler());
+            //You can specify a custom RequestContext to share settings amount groups of ChromiumWebBrowsers
+            //Also this is now the only way to access OnBeforePluginLoad - need to implement IPluginHandler
+            //browser.RequestContext = new RequestContext(new PluginHandler());

-            browser.RequestContext.RegisterSchemeHandlerFactory(CefSharpSchemeHandlerFactory.SchemeName, null, new CefSharpSchemeHandlerFactory());
+            //browser.RequestContext.RegisterSchemeHandlerFactory(CefSharpSchemeHandlerFactory.SchemeName, null, new CefSharpSchemeHandlerFactory());

             browser.LoadError += (sender, args) =>
             {


Now bounding xyz

Now bounding xyz

--- ColorMine/ColorSpaces/Conversions/XyzConverter.cs
+++ ColorMine/ColorSpaces/Conversions/XyzConverter.cs
@@ -32,7 +32,12 @@
             g = g > 0.0031308 ? 1.055*Math.Pow(g, 1/2.4) - 0.055 : 12.92*g;
             b = b > 0.0031308 ? 1.055*Math.Pow(b, 1/2.4) - 0.055 : 12.92*b;

-            return Color.FromArgb(255, (int) (r*255), (int) (g*255), (int) (b*255));
+            return Color.FromArgb(255, ToRgb(r), ToRgb(g), ToRgb(b));
+        }
+
+        private static int ToRgb(double n)
+        {
+            return Math.Min(255, Math.Max(0, (int) (n*255)));
         }

         private static double PivotRgb(double n)


Orchard.Layouts: Fixing potential NRE in ContentPartDisplay (fixes #8110)

--- src/Orchard.Web/Modules/Orchard.Layouts/Services/ContentPartDisplay.cs
+++ src/Orchard.Web/Modules/Orchard.Layouts/Services/ContentPartDisplay.cs
@@ -67,9 +67,8 @@
             return context.Shape;
         }

-        private IEnumerable<IContentPartDriver> GetPartDrivers(string partName) {
-            return _contentPartDrivers.Where(x => GetPartOfDriver(x.GetType().BaseType).Name == partName);
-        }
+        private IEnumerable<IContentPartDriver> GetPartDrivers(string partName) =>
+            _contentPartDrivers.Where(x => GetPartOfDriver(x.GetType()?.BaseType)?.Name == partName);

         private Type GetPartOfDriver(Type type) {
             var baseType = type;


Small change

Small change

--- Core.ApplicationServices/AuthenticationService.cs
+++ Core.ApplicationServices/AuthenticationService.cs
@@ -150,10 +150,10 @@
             }

             //User has access if user created entity
-            if (user.IsLocalAdmin && entity.ObjectOwnerId == user.Id)
-            {
-                return true;
-            }
+            //if (user.IsLocalAdmin && entity.ObjectOwnerId == user.Id)
+            //{
+            //    return true;
+            //}

             //Check if user is allowed to set accessmodifier to public
             var accessModifier = (entity as IHasAccessModifier)?.AccessModifier;


#20644: Working around Azure Websites limitation of not being able to use System.Drawing.Image with .ico files.

WorkItem: 20644

--- src/Orchard.Web/Modules/Orchard.MediaLibrary/Factories/ImageFactory.cs
+++ src/Orchard.Web/Modules/Orchard.MediaLibrary/Factories/ImageFactory.cs
@@ -29,7 +29,7 @@

             if (!String.IsNullOrEmpty(contentType)) {
                 var contentDefinition = _contentDefinitionManager.GetTypeDefinition(contentType);
-                if (contentDefinition == null || contentDefinition.Parts.All(x => x.PartDefinition.Name != typeof (ImagePart).Name)) {
+                if (contentDefinition == null || contentDefinition.Parts.All(x => x.PartDefinition.Name != typeof(ImagePart).Name)) {
                     return null;
                 }
             }
@@ -65,12 +65,36 @@
                 return null;
             }

-            using (var image = Image.FromStream(stream)) {
-                imagePart.Width = image.Width;
-                imagePart.Height = image.Height;
+            try {
+                using (var image = Image.FromStream(stream)) {
+                    imagePart.Width = image.Width;
+                    imagePart.Height = image.Height;
+                }
+            }
+            catch (ArgumentException) {
+                // Still trying to get .ico dimensions when it's blocked in System.Drawing, see: https://orchard.codeplex.com/workitem/20644
+
+                if (mimeType != "image/x-icon" && mimeType != "image/vnd.microsoft.icon") {
+                    throw;
+                }
+
+                TryFillDimensionsForIco(stream, imagePart);
             }

             return part;
         }
+
+        private void TryFillDimensionsForIco(Stream stream, ImagePart imagePart) {
+            stream.Position = 0;
+            using (var binaryReader = new BinaryReader(stream)) {
+                // Reading out the necessary bytes that indicate the image dimensions. For the file format see:
+                // http://en.wikipedia.org/wiki/ICO_%28file_format%29
+                // Reading out leading bytes containing unneded information.
+                binaryReader.ReadBytes(6);
+                // Reading out dimensions. If there are multiple icons bundled in the same file then this is the first image.
+                imagePart.Width = binaryReader.ReadByte();
+                imagePart.Height = binaryReader.ReadByte();
+            }
+        }
     }
 }


Adding a notification message when a recipe is executed successfuly

--HG--
branch : 1.x
extra : rebase_source : e5774fd27fd9af961482a6b6df3cba02344968ef

--- src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs
+++ src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs
@@ -155,6 +155,8 @@
                 Services.Notifier.Error(T("Recipes contains {0} unsupported module installation steps.", recipe.Name));
             }

+            Services.Notifier.Information(T("The recipe {0} was executed successfully.", recipe.Name));
+
             return RedirectToAction("Recipes");

         }


Remove comment.

Remove comment.

--- src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs
+++ src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs
@@ -155,9 +155,6 @@
                 ? localDeclaration.SemicolonToken
                 : default;

-            // Remove elastic trivia between the first two tokens.  The formatting engine uses the
-            // presence of this to override the constraint that tries to keep local functions on
-            // a single line.
             return SyntaxFactory.LocalFunctionStatement(
                 modifiers, returnType, identifier, typeParameterList, parameterList,
                 constraintClauses, body, expressionBody, semicolonToken);


先頭文字の SMP 判定をちゃんと IsHighSurrogate にしぼる

先頭文字の SMP 判定をちゃんと IsHighSurrogate にしぼる

かといって、単独 low surrogate (不正な UTF-16)が来た時の例外処理してないんだけど…

--- Demo/2021/EmojiData/RgiSequenceFinder/RgiTable.cs
+++ Demo/2021/EmojiData/RgiSequenceFinder/RgiTable.cs
@@ -145,7 +145,7 @@
         {
             if (s.Length == 0) return 0;

-            var firstChar = char.IsSurrogate(s[0]) ? 2 : 1;
+            var firstChar = char.IsHighSurrogate(s[0]) ? 2 : 1;

             // variation selector 16 削り。
             // FE0F (variation selector 16)は「絵文字扱いする」という意味なので、
@@ -201,8 +201,7 @@
                 }
             }

-            // ZWJ 付きじゃないときに2度同じ処理してることになるけど、避けようと思うと結構大変なので妥協。
-            // そんなに高頻度で来ないはずなので問題にもならないと思う。
+            // ZWJ 分割後が普通に skin tone も FE0F も付いてない絵文字なことは多々あるので再検索。
             {
                 var i = FindOther(s);

@@ -233,7 +232,7 @@

             if (tones.Length == 1)
             {
-                if (char.IsSurrogate(s[0]))
+                if (char.IsHighSurrogate(s[0]))
                 {
                     skinToneRemoved[0] = s[0];
                     skinToneRemoved[1] = s[1];
@@ -249,7 +248,7 @@
             }
             else if (tones.Length == 2)
             {
-                if (char.IsSurrogate(s[0]))
+                if (char.IsHighSurrogate(s[0]))
                 {
                     skinToneRemoved[0] = s[0];
                     skinToneRemoved[1] = s[1];


#2590 Creating New Project Hangs - Network Drives

Creating a new project has a race condition that is occurring because we enable raising events before we have set our InternalBufferSize. By rearranging this it should prevent this from hanging on project load.

--- Common/Product/SharedProject/CommonProjectNode.cs
+++ Common/Product/SharedProject/CommonProjectNode.cs
@@ -446,8 +446,12 @@
         }

         private FileSystemWatcher CreateFileSystemWatcher(string dir) {
-            var watcher = new FileSystemWatcher(dir);
-            watcher.IncludeSubdirectories = true;
+            var watcher = new FileSystemWatcher(dir) {
+                InternalBufferSize = 1024 * 4,  // 4k is minimum buffer size
+                IncludeSubdirectories = true
+            };
+
+            // Set Event Handlers
             watcher.Created += new FileSystemEventHandler(FileExistanceChanged);
             watcher.Deleted += new FileSystemEventHandler(FileExistanceChanged);
             watcher.Renamed += new RenamedEventHandler(FileNameChanged);
@@ -456,19 +460,27 @@
             watcher.Renamed += FileContentsChanged;
 #endif
             watcher.Error += WatcherError;
+
+            // Delay setting EnableRaisingEvents until everything else is initialized.
             watcher.EnableRaisingEvents = true;
-            watcher.InternalBufferSize = 1024 * 4;  // 4k is minimum buffer size
+
             return watcher;
         }

         private FileSystemWatcher CreateAttributesWatcher(string dir) {
-            var watcher = new FileSystemWatcher(dir);
-            watcher.IncludeSubdirectories = true;
-            watcher.NotifyFilter = NotifyFilters.Attributes;
+            var watcher = new FileSystemWatcher(dir) {
+                IncludeSubdirectories = true,
+                NotifyFilter = NotifyFilters.Attributes,
+                InternalBufferSize = 1024 * 4, // 4k is minimum buffer size
+            };
+
+            // Set Event Handlers
             watcher.Changed += FileAttributesChanged;
             watcher.Error += WatcherError;
+
+            // Delay setting EnableRaisingEvents until everything else is initialized.
             watcher.EnableRaisingEvents = true;
-            watcher.InternalBufferSize = 1024 * 4;  // 4k is minimum buffer size
+
             return watcher;
         }

@@ -1152,7 +1164,7 @@
                         _project.AddAllFilesFile(parent, _path);
                         if (String.Equals(_project.GetStartupFile(), _path, StringComparison.OrdinalIgnoreCase)) {
                             _project.BoldStartupItem();
-                    }
+                        }
                     }

                     parent.ExpandItem(wasExpanded ? EXPANDFLAGS.EXPF_ExpandFolder : EXPANDFLAGS.EXPF_CollapseFolder);


Forenkle intern konstruktørflyt for Invoice for mindre duplisering.

--- Digipost.Api.Client.Domain/SendMessage/Invoice.cs
+++ Digipost.Api.Client.Domain/SendMessage/Invoice.cs
@@ -25,23 +25,17 @@
         public Invoice(string subject, string fileType, string path, decimal amount, string account, DateTime duedate, string kid = null,
            AuthenticationLevel authenticationLevel = AuthenticationLevel.Password,
            SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, SmsNotification smsNotification = null)
-            : base(subject, fileType, path, authenticationLevel, sensitivityLevel, smsNotification)
+            : this(subject,fileType, new byte[]{}, amount, account, duedate, kid, authenticationLevel, sensitivityLevel, smsNotification)
         {
-            Kid = kid;
-            Amount = amount;
-            Account = account;
-            Duedate = duedate;
+
         }

         public Invoice(string subject, string fileType, Stream contentStream, decimal amount, string account, DateTime duedate, string kid = null,
            AuthenticationLevel authenticationLevel = AuthenticationLevel.Password,
            SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, SmsNotification smsNotification = null)
-            : base(subject, fileType, contentStream, authenticationLevel, sensitivityLevel, smsNotification)
+            : this(subject, fileType, new byte[] { }, amount, account, duedate, kid, authenticationLevel, sensitivityLevel, smsNotification)
         {
-            Kid = kid;
-            Amount = amount;
-            Account = account;
-            Duedate = duedate;
+
         }
     }
 }