Added missing SQLite driver implementation for Count operation.

--- ZeroG.Database.SQLite/Object/SQLiteObjectIndexProvider.cs
+++ ZeroG.Database.SQLite/Object/SQLiteObjectIndexProvider.cs
@@ -54,7 +54,8 @@

         public static readonly string RowsExist = @"SELECT 1 FROM [{0}] WHERE {1}";

-        public static readonly string RowsCount = @"SELECT COUNT(1) FROM [{0}] WHERE {1}";
+        public static readonly string RowsCount = @"SELECT COUNT(1) FROM `{0}`
+{1}{2}{3}";

         public static readonly string RowsCountDistinctObjects = @"SELECT COUNT(DISTINCT {0}) FROM [{1}]";

@@ -154,125 +155,145 @@
             return orderBySql;
         }

-        public override bool ObjectExists(string objectFullName)
-        {
-            bool returnValue = false;
-
-            using (var db = OpenSchema())
-            {
-                var tableName = _CreateTableName(db, objectFullName);
-
-                returnValue = 0 != db.ExecuteScalar<int>(string.Format(SQLStatements.TableExists, tableName), 0);
-            }
-
-            return returnValue;
-        }
-
-        public override bool Exists(string objectFullName, string constraint, ObjectIndexMetadata[] indexes)
-        {
-            using (var db = OpenData())
-            {
-                var sqlConstraint = CreateSQLConstraint(db, indexes, constraint);
-                var tableName = _CreateTableName(db, objectFullName);
-                return 1 == db.ExecuteScalar<int>(string.Format(SQLStatements.RowsExist, tableName, sqlConstraint.SQL), 0, sqlConstraint.Parameters.ToArray());
-            }
-        }
-
-        public override int Count(string objectFullName, ObjectFindOptions options, ObjectIndex[] indexes)
-        {
-            throw new NotImplementedException();
-        }
-
-        public override int Count(string objectFullName, string constraint, ObjectIndexMetadata[] indexes)
-        {
-            using (var db = OpenData())
-            {
-                var sqlConstraint = CreateSQLConstraint(db, indexes, constraint);
-                var tableName = _CreateTableName(db, objectFullName);
-                return db.ExecuteScalar<int>(string.Format(SQLStatements.RowsCount, tableName, sqlConstraint.SQL), 0, sqlConstraint.Parameters.ToArray());
-            }
-        }
-
-        public override int CountObjects(string objectFullName)
-        {
-            using (var db = OpenData())
-            {
-                var tableName = _CreateTableName(db, objectFullName);
-                return db.ExecuteScalar<int>(string.Format(SQLStatements.RowsCountDistinctObjects, db.MakeQuotedName(IDColumn), tableName), 0);
-            }
-        }
-
-        public override int[] Find(string objectFullName, ObjectFindOptions options, params ObjectIndex[] indexes)
-        {
-            int[] returnValue = null;
+        private static string _CreateSQLFromFindOptions(IDatabaseService db,
+            string objectFullName,
+            ObjectFindOptions options,
+            ObjectIndex[] indexes,
+            string templateSql,
+            IList<IDataParameter> parameters)
+        {
             var logic = options.Logic;
             var oper = options.Operator;
             var limit = options.Limit;

             bool useOr = ObjectFindLogic.Or == logic;
             bool useLike = ObjectFindOperator.Like == oper;
-            bool useIsNull = ObjectFindOperator.IsNull == oper;
+            bool isNull = ObjectFindOperator.IsNull == oper;

             var limitSql = (0 == limit) ? SQLStatements.NoLimit : string.Format(SQLStatements.Limit, limit);

-            using (var db = OpenData())
-            {
-                var tableName = _CreateTableName(db, objectFullName);
-
-                var parameters = new List<IDbDataParameter>();
-                var sqlConstraint = new StringBuilder();
-                if (null != indexes && 0 < indexes.Length)
-                {
-                    // initialize the where clause
-                    sqlConstraint.Append("WHERE ");
-
-                    for (int i = 0; indexes.Length > i; i++)
-                    {
-                        var idx = indexes[i];
-
-                        // skip over null objects
-                        if (null == idx)
+            var tableName = _CreateTableName(db, objectFullName);
+
+            var sqlConstraint = new StringBuilder();
+            if (null != indexes && 0 < indexes.Length)
+            {
+                // initialize the where clause
+                sqlConstraint.Append("WHERE ");
+                for (int i = 0; indexes.Length > i; i++)
+                {
+                    var idx = indexes[i];
+
+                    // skip over null objects
+                    if (null == idx)
+                    {
+                        continue;
+                    }
+
+                    if (0 < i)
+                    {
+                        if (useOr)
                         {
-                            continue;
-                        }
-
-                        if (0 < i)
-                        {
-                            if (useOr)
-                            {
-                                sqlConstraint.Append(" OR ");
-                            }
-                            else
-                            {
-                                sqlConstraint.Append(" AND ");
-                            }
-                        }
-
-                        var paramName = "p" + i + idx.Name;
-                        var value = idx.GetObjectValue();
-                        sqlConstraint.Append(db.MakeQuotedName(idx.Name));
-
-                        if (useIsNull)
-                        {
-                            sqlConstraint.Append(" IS NULL");
-                        }
-                        else if (useLike)
-                        {
-                            sqlConstraint.Append(' ');
-                            sqlConstraint.Append(db.MakeLikeParamReference(paramName));
-                            parameters.Add(ObjectIndexProvider.MakeLikeParameter(db, paramName, value));
+                            sqlConstraint.Append(" OR ");
                         }
                         else
                         {
-                            sqlConstraint.Append(" = ");
-                            sqlConstraint.Append(db.MakeParamReference(paramName));
-                            parameters.Add(db.MakeParam(paramName, value));
+                            sqlConstraint.Append(" AND ");
                         }
                     }
-                }
-                var orderBySql = _CreateOrderBySQL(db, options.Order);
-
-                returnValue = db.GetValues<int>(string.Format(SQLStatements.Find, tableName, sqlConstraint.ToString(), orderBySql, limitSql), parameters.ToArray());
+
+                    var paramName = "p" + i + idx.Name;
+                    var value = idx.GetObjectValue();
+                    sqlConstraint.Append(db.MakeQuotedName(idx.Name));
+
+                    if (useLike)
+                    {
+                        sqlConstraint.Append(' ');
+                        sqlConstraint.Append(db.MakeLikeParamReference(paramName));
+                        parameters.Add(ObjectIndexProvider.MakeLikeParameter(db, paramName, value));
+                    }
+                    else if (isNull)
+                    {
+                        sqlConstraint.Append(" IS NULL");
+                    }
+                    else
+                    {
+                        sqlConstraint.Append(" = ");
+                        sqlConstraint.Append(db.MakeParamReference(paramName));
+                        parameters.Add(db.MakeParam(paramName, value));
+                    }
+                }
+            }
+            var orderBySql = _CreateOrderBySQL(db, options.Order);
+            return string.Format(templateSql, tableName, sqlConstraint.ToString(), orderBySql, limitSql);
+        }
+
+        public override bool ObjectExists(string objectFullName)
+        {
+            bool returnValue = false;
+
+            using (var db = OpenSchema())
+            {
+                var tableName = _CreateTableName(db, objectFullName);
+
+                returnValue = 0 != db.ExecuteScalar<int>(string.Format(SQLStatements.TableExists, tableName), 0);
+            }
+
+            return returnValue;
+        }
+
+        public override bool Exists(string objectFullName, string constraint, ObjectIndexMetadata[] indexes)
+        {
+            using (var db = OpenData())
+            {
+                var sqlConstraint = CreateSQLConstraint(db, indexes, constraint);
+                var tableName = _CreateTableName(db, objectFullName);
+                return 1 == db.ExecuteScalar<int>(string.Format(SQLStatements.RowsExist, tableName, sqlConstraint.SQL), 0, sqlConstraint.Parameters.ToArray());
+            }
+        }
+
+        public override int Count(string objectFullName, ObjectFindOptions options, ObjectIndex[] indexes)
+        {
+            using (var db = OpenData())
+            {
+                var parameters = new List<IDataParameter>();
+                var sql = _CreateSQLFromFindOptions(db, objectFullName, options, indexes, SQLStatements.RowsCount, parameters);
+                return db.ExecuteScalar<int>(sql, 0, parameters.ToArray());
+            }
+        }
+
+        public override int Count(string objectFullName, string constraint, ObjectIndexMetadata[] indexes)
+        {
+            using (var db = OpenData())
+            {
+                var compiledConstraint = CreateSQLConstraint(db, indexes, constraint);
+                var sqlConstraint = compiledConstraint.SQL;
+                if (!string.IsNullOrEmpty(sqlConstraint))
+                {
+                    sqlConstraint = "WHERE " + sqlConstraint;
+                }
+                var tableName = _CreateTableName(db, objectFullName);
+                return db.ExecuteScalar<int>(string.Format(SQLStatements.RowsCount, tableName, sqlConstraint, SQLStatements.NoOrder, SQLStatements.NoLimit), 0, compiledConstraint.Parameters.ToArray());
+            }
+        }
+
+        public override int CountObjects(string objectFullName)
+        {
+            using (var db = OpenData())
+            {
+                var tableName = _CreateTableName(db, objectFullName);
+                return db.ExecuteScalar<int>(string.Format(SQLStatements.RowsCountDistinctObjects, db.MakeQuotedName(IDColumn), tableName), 0);
+            }
+        }
+
+        public override int[] Find(string objectFullName, ObjectFindOptions options, params ObjectIndex[] indexes)
+        {
+            int[] returnValue = null;
+
+            using (var db = OpenData())
+            {
+                var parameters = new List<IDataParameter>();
+                var sql = _CreateSQLFromFindOptions(db, objectFullName, options, indexes, SQLStatements.Find, parameters);
+                returnValue = db.GetValues<int>(sql, parameters.ToArray());
             }

             return returnValue;


#2740 PythonAnalyzer.GetCached may recurse and crash Handles recursion in GetCached by replacing null return values with None or object, as appropriate.

--- Python/Product/Analysis/PythonAnalyzer.cs
+++ Python/Product/Analysis/PythonAnalyzer.cs
@@ -657,6 +657,14 @@
             }
         }

+        /// <summary>
+        /// Returns the cached value for the provided key, creating it with
+        /// <paramref name="maker"/> if necessary. If <paramref name="maker"/>
+        /// attempts to get the same value, returns <c>null</c>.
+        /// </summary>
+        /// <param name="key">The identifier for the cached value.</param>
+        /// <param name="maker">Function to create the value.</param>
+        /// <returns>The cached value or <c>null</c>.</returns>
         internal AnalysisValue GetCached(object key, Func<AnalysisValue> maker) {
             AnalysisValue result;
             if (!_itemCache.TryGetValue(key, out result)) {
@@ -678,7 +686,7 @@
         internal BuiltinClassInfo GetBuiltinType(IPythonType type) {
             return (BuiltinClassInfo)GetCached(type,
                 () => MakeBuiltinType(type)
-            );
+            ) ?? ClassInfos[BuiltinTypeId.Object];
         }

         private BuiltinClassInfo MakeBuiltinType(IPythonType type) {
@@ -722,7 +730,7 @@
                 return GetBuiltinType((IPythonType)attr);
             } else if (attr is IPythonFunction) {
                 var bf = (IPythonFunction)attr;
-                return GetCached(attr, () => new BuiltinFunctionInfo(bf, this));
+                return GetCached(attr, () => new BuiltinFunctionInfo(bf, this)) ?? _noneInst;
             } else if (attr is IPythonMethodDescriptor) {
                 return GetCached(attr, () => {
                     var md = (IPythonMethodDescriptor)attr;
@@ -731,13 +739,13 @@
                     } else {
                         return new BuiltinMethodInfo(md, this);
                     }
-                });
+                }) ?? _noneInst;
             } else if (attr is IBuiltinProperty) {
-                return GetCached(attr, () => new BuiltinPropertyInfo((IBuiltinProperty)attr, this));
+                return GetCached(attr, () => new BuiltinPropertyInfo((IBuiltinProperty)attr, this)) ?? _noneInst;
             } else if (attr is IPythonModule) {
                 return _modules.GetBuiltinModule((IPythonModule)attr);
             } else if (attr is IPythonEvent) {
-                return GetCached(attr, () => new BuiltinEventInfo((IPythonEvent)attr, this));
+                return GetCached(attr, () => new BuiltinEventInfo((IPythonEvent)attr, this)) ?? _noneInst;
             } else if (attr is IPythonConstant) {
                 return GetConstant((IPythonConstant)attr).First();
             } else if (attrType == typeof(bool) || attrType == typeof(int) || attrType == typeof(Complex) ||
@@ -751,7 +759,7 @@
                 var members = multMembers.Members;
                 return GetCached(attr, () =>
                     MultipleMemberInfo.Create(members.Select(GetAnalysisValueFromObjects)).FirstOrDefault() ??
-                        GetBuiltinType(Types[BuiltinTypeId.NoneType]).Instance
+                        ClassInfos[BuiltinTypeId.NoneType].Instance
                 );
             } else {
                 var pyAttrType = GetTypeFromObject(attr);
@@ -780,12 +788,12 @@

         internal IAnalysisSet GetConstant(IPythonConstant value) {
             object key = value ?? _nullKey;
-            return GetCached(key, () => new ConstantInfo(value, this)).SelfSet;
+            return GetCached(key, () => new ConstantInfo(value, this)) ?? _noneInst;
         }

         internal IAnalysisSet GetConstant(object value) {
             object key = value ?? _nullKey;
-            return GetCached(key, () => new ConstantInfo(value, this)).SelfSet;
+            return GetCached(key, () => new ConstantInfo(value, this)) ?? _noneInst;
         }

         private static void Update<K, V>(IDictionary<K, V> dict, IDictionary<K, V> newValues) {


I made EffectCollection inherit from IList for mono support.

--- Ragnarok.Extra/Effect/EffectCollection.cs
+++ Ragnarok.Extra/Effect/EffectCollection.cs
@@ -10,7 +10,7 @@
     /// </summary>
     public class EffectCollection :
         IList<EffectObject>, ICollection<EffectObject>, IEnumerable<EffectObject>,
-        /*IList, ICollection,*/ IEnumerable
+        IList, ICollection, IEnumerable
     {
         private readonly List<EffectObject> implList = new List<EffectObject>();
         private readonly EffectObject parent;
@@ -73,6 +73,12 @@
             set { this.implList[index] = value; }
         }

+        object IList.this[int index]
+        {
+            get { return this.implList[index]; }
+            set { this.implList[index] = (EffectObject)value; }
+        }
+
         /// <summary>
         /// すべての要素を削除します。
         /// </summary>
@@ -90,6 +96,11 @@
         public bool Contains(EffectObject element)
         {
             return this.implList.Contains(element);
+        }
+
+        bool IList.Contains(object element)
+        {
+            return Contains((EffectObject)element);
         }

         /// <summary>
@@ -135,12 +146,22 @@
             return this.implList.IndexOf(element);
         }

+        int IList.IndexOf(object element)
+        {
+            return IndexOf((EffectObject)element);
+        }
+
         /// <summary>
         /// 指定されたインデックス位置に要素を挿入します。
         /// </summary>
         public void Insert(int index, EffectObject element)
         {
             this.implList.Insert(index, element);
+        }
+
+        void IList.Insert(int index, object element)
+        {
+            Insert(index, (EffectObject)element);
         }

         /// <summary>
@@ -159,6 +180,11 @@
             return false;
         }

+        void IList.Remove(object element)
+        {
+            Remove((EffectObject)element);
+        }
+
         /// <summary>
         /// コレクションから要素の範囲を削除します。
         /// </summary>
@@ -184,6 +210,12 @@
             element.ParentAdded(this.parent);
         }

+        int IList.Add(object element)
+        {
+            Add((EffectObject)element);
+            return (Count - 1);
+        }
+
         /// <summary>
         /// 指定したインデックス位置にある要素を削除します。
         /// </summary>


Fixed guild test, Guild no longer existed.

--- tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/GuildApiTests.cs
+++ tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/GuildApiTests.cs
@@ -25,7 +25,7 @@
         public async Task GetGuildAchievementsAsync_Gets_GuildAchievements()
         {
             IGuildApi warcraftClient = ClientFactory.BuildClient();
-            RequestResult<GuildAchievements> result = await warcraftClient.GetGuildAchievementsAsync("deathwing", "enigma", "profile-us");
+            RequestResult<GuildAchievements> result = await warcraftClient.GetGuildAchievementsAsync("arygos", "enigma", "profile-us");
             Assert.NotNull(result.Value);
         }


fix: avoid using deprecated AndroidJNI API in Unity 2019

--- src/BugsnagUnity/Native/Android/NativeInterface.cs
+++ src/BugsnagUnity/Native/Android/NativeInterface.cs
@@ -509,11 +509,22 @@
       try {
         var CharsetClass = new AndroidJavaClass("java.nio.charset.Charset");
         // The default encoding on Android is UTF-8
-        var charset = CharsetClass.CallStatic<AndroidJavaObject>("defaultCharset");
-        return new AndroidJavaObject("java.lang.String", Encoding.UTF8.GetBytes(input), charset);
+        var Charset = CharsetClass.CallStatic<AndroidJavaObject>("defaultCharset");
+        byte[] Bytes = Encoding.UTF8.GetBytes(input);
+        return ConstructJavaString(Bytes, Charset);
       } catch (EncoderFallbackException _) {
         // The input string could not be encoded as UTF-8
         return new AndroidJavaObject("java.lang.String");
+      }
+    }
+
+    private AndroidJavaObject ConstructJavaString(byte[] Bytes, AndroidJavaObject Charset) {
+      try { // should succeed on Unity 2019.1 and above
+        sbyte[] SBytes = new sbyte[Bytes.Length];
+        Buffer.BlockCopy(Bytes, 0, SBytes, 0, Bytes.Length);
+        return new AndroidJavaObject("java.lang.String", SBytes, Charset);
+      } catch (System.Exception _) { // use legacy API on older versions
+        return new AndroidJavaObject("java.lang.String", Bytes, Charset);
       }
     }


Increase totalRequestsToMake

Increase totalRequestsToMake

--- src/CIAPI.IntegrationTests/Rpc/ThreadingFixture.cs
+++ src/CIAPI.IntegrationTests/Rpc/ThreadingFixture.cs
@@ -27,7 +27,7 @@
             var gate = new ManualResetEvent(false);
             var successfulResponses = 0;

-            var totalRequestsToMake = 10;
+            var totalRequestsToMake = 500;
             for (var i = 0; i < totalRequestsToMake; i++)
             {

@@ -56,7 +56,7 @@
                                });
             }

-            gate.WaitOne(TimeSpan.FromSeconds(totalRequestsToMake));
+            gate.WaitOne(TimeSpan.FromSeconds(totalRequestsToMake*2));

             Assert.AreEqual(totalRequestsToMake, successfulResponses,"One of the requests failed");


Show correct file type, when have save exception.

--- RdlGtkViewer/RdlGtkViewer/ReportViewer.cs
+++ RdlGtkViewer/RdlGtkViewer/ReportViewer.cs
@@ -661,7 +661,7 @@
                 {
                     Gtk.MessageDialog m = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Info,
                                Gtk.ButtonsType.Ok, false,
-                               "Error Saving Copy of PDF." + System.Environment.NewLine + ex.Message);
+                               $"Error Saving Copy of {fc.Filter?.Name}." + System.Environment.NewLine + ex.Message);

                     m.Run();
                     m.Destroy();


Name compress integer threshold values

Name compress integer threshold values

--- src/Compilers/Core/Portable/PEWriter/BlobWriter.cs
+++ src/Compilers/Core/Portable/PEWriter/BlobWriter.cs
@@ -591,6 +591,10 @@
             }
         }

+        private const int SingleByteCompressedIntegerMaxValue = 0x7f;
+        private const int TwoByteCompressedIntegerMaxValue = 0x3fff;
+        private const int MaxCompressedIntegerValue = 0x1fffffff;
+
         /// <summary>
         /// Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
         /// </summary>
@@ -605,21 +609,21 @@
         /// </remarks>
         internal void WriteCompressedUInt(uint val)
         {
+            Debug.Assert(val <= MaxCompressedIntegerValue);
+
             unchecked
             {
-                if (val <= 0x7f)
+                if (val <= SingleByteCompressedIntegerMaxValue)
                 {
                     WriteByte((byte)val);
                 }
-                else if (val <= 0x3fff)
+                else if (val <= TwoByteCompressedIntegerMaxValue)
                 {
                     WriteByte((byte)(0x80 | (val >> 8)));
                     WriteByte((byte)val);
                 }
                 else
                 {
-                    Debug.Assert(val <= 0x1fffffff);
-
                     WriteByte((byte)(0xc0 | (val >> 24)));
                     WriteByte((byte)(val >> 16));
                     WriteByte((byte)(val >> 8));
@@ -630,14 +634,14 @@

         internal static int GetCompressedIntegerSize(int value)
         {
-            Debug.Assert(value <= 0x1fffffff);
-
-            if (value <= 0x7f)
+            Debug.Assert(value <= MaxCompressedIntegerValue);
+
+            if (value <= SingleByteCompressedIntegerMaxValue)
             {
                 return 1;
             }

-            if (value <= 0x3fff)
+            if (value <= TwoByteCompressedIntegerMaxValue)
             {
                 return 2;
             }


Create simple file not found error

Create simple file not found error

--- Admo/classes/WebServer.cs
+++ Admo/classes/WebServer.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Net;
+using System.Text;
 using System.Threading;
 using NLog;

@@ -73,7 +74,9 @@

             if (myRequest.Contains("favicon.ico"))
             {
-                return;
+              //  FileNotFound(context);
+
+                return;
             }
             //First try find it in the overide folder
             var myPath = Path.Combine(_overridePath, myRequest);
@@ -93,12 +96,12 @@
             }

             var mimeExtension = GetMimeType(myPath);
-            //TODO: handle files not found, 404
             var response = context.Response;

             //try again
             if (!File.Exists(myPath))
             {
+                FileNotFound(context);

                 Logger.Debug("unable to load file file does not exist " + myPath + " ");
                 return;
@@ -159,7 +162,21 @@

         }

-
+        private void FileNotFound( HttpListenerContext context)
+        {
+            context.Response.StatusCode = 404;
+            string html = "<b>File not found Error 404!</b>";
+            byte[] data = Encoding.UTF8.GetBytes(html);
+
+            context.Response.ContentType = "text/html";
+            context.Response.ContentLength64 = data.Length;
+
+            using (Stream output = context.Response.OutputStream)
+            {
+                output.Write(data, 0, data.Length);
+            }
+        }
+

         public void Close()
         {


Trivial - fix compile warning due to unused field

--- Agiil.Auth/LoginResult.cs
+++ Agiil.Auth/LoginResult.cs
@@ -50,7 +50,7 @@

     #region singletons & static factories

-    static readonly LoginResult loginFailed, loginThrottled;
+    static readonly LoginResult loginFailed;

     public static LoginResult LoginFailed => loginFailed;


reverse change on mistankes

reverse change on mistankes

--- src/Couchbase.Lite.Shared/Sync/WebSocketWrapper.cs
+++ src/Couchbase.Lite.Shared/Sync/WebSocketWrapper.cs
@@ -210,6 +210,7 @@
                         if (proxy != null) {
                             webproxy = proxy.CreateProxy(new Uri("ws://" + _logic.ProxyRequestUrl));
                             if (webproxy != null) {
+                                _logic.hasProxy = true;
                                 connectProxyAsync(_logic.ProxyRequestUrl?.Host, _logic.ProxyRequestUrl.Port, "proxyUer", "proxyPassword");
                             }
                         }


Allow >1 PR detail in the history list.

Allow >1 PR detail in the history list.

Previously, only a single PR detail could be added to the history list,
as `CreateView` tried to recycle the any previous PR detail controller
which is not correct because that PR detail could belong to a different
PR. Now, `CreateView` does not add entries to the `reusableControllers`
collection (previously called simply `controllers`), only
`CreateOrReuseView` does so.

--- src/GitHub.App/Controllers/NavigationController.cs
+++ src/GitHub.App/Controllers/NavigationController.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Reactive.Disposables;
 using GitHub.Models;
 using GitHub.Primitives;
@@ -14,7 +15,7 @@
     public class NavigationController : NotificationAwareObject, IDisposable, IHasBusy
     {
         readonly List<IUIController> history = new List<IUIController>();
-        readonly Dictionary<UIControllerFlow, IUIController> controllers = new Dictionary<UIControllerFlow, IUIController>();
+        readonly Dictionary<UIControllerFlow, IUIController> reusableControllers = new Dictionary<UIControllerFlow, IUIController>();
         readonly IUIProvider uiProvider;

         int current = -1;
@@ -104,27 +105,19 @@
         {
             IsBusy = true;

+            var controller = CreateController(connection, data, onViewLoad);
+            Push(controller);
+        }
+
+        void CreateOrReuseView(IConnection connection, ViewWithData data, Action<IView> onViewLoad)
+        {
             IUIController controller;
-            var exists = controllers.TryGetValue(data.MainFlow, out controller);
-
-            if (exists)
-            {
-                controller.Stop();
-            }
-
-            controller = CreateController(connection, data, onViewLoad);
-            Push(controller);
-        }
-
-        void CreateOrReuseView(IConnection connection, ViewWithData data, Action<IView> onViewLoad)
-        {
-            IsBusy = true;
-
-            IUIController controller;
-            var exists = controllers.TryGetValue(data.MainFlow, out controller);
+            var exists = reusableControllers.TryGetValue(data.MainFlow, out controller);

             if (!exists)
             {
+                IsBusy = true;
+
                 Action<IView> handler = view =>
                 {
                     disposablesForCurrentView?.Clear();
@@ -141,6 +134,7 @@
                 };

                 controller = CreateController(connection, data, handler);
+                reusableControllers.Add(data.MainFlow, controller);
             }

             Push(controller);
@@ -188,7 +182,6 @@
                     Pop(controller);
                     Reload();
                 });
-            controllers.Add(data.MainFlow, controller);
             controller.Start();
             return controller;
         }
@@ -215,7 +208,7 @@
                     count--;
                 }
             }
-            controllers.Remove(controller.SelectedFlow);
+            reusableControllers.Remove(controller.SelectedFlow);
             controller.Stop();
             Pointer = c;
         }
@@ -229,8 +222,8 @@
                 {
                     disposed = true;
                     disposablesForCurrentView.Dispose();
-                    controllers.Values.ForEach(c => uiProvider.StopUI(c));
-                    controllers.Clear();
+                    reusableControllers.Values.ForEach(c => uiProvider.StopUI(c));
+                    reusableControllers.Clear();
                     history.Clear();
                 }
             }


Lucene.Net.Index.TestIndexReaderClose::TestCloseUnderException(): Removed unused allocation from test loop

--- src/Lucene.Net.Tests/Index/TestIndexReaderClose.cs
+++ src/Lucene.Net.Tests/Index/TestIndexReaderClose.cs
@@ -47,7 +47,7 @@
                 bool throwOnClose = !Rarely();
                 AtomicReader wrap = SlowCompositeReaderWrapper.Wrap(open);
                 FilterAtomicReader reader = new FilterAtomicReaderAnonymousClass(this, wrap, throwOnClose);
-                IList<IndexReader.IReaderClosedListener> listeners = new JCG.List<IndexReader.IReaderClosedListener>();
+                //IList<IndexReader.IReaderClosedListener> listeners = new JCG.List<IndexReader.IReaderClosedListener>(); // LUCENENET: This list is unused (and was unused in Java)
                 int listenerCount = Random.Next(20);
                 AtomicInt32 count = new AtomicInt32();
                 bool faultySet = false;


incorporate cr feedback from gregg that gdb can return bound bps without addresses so the bkptno case must be preserved. This is done by adding the bkptno case as well and then removing duplicate objects. Note that I simplified this a bit by checking for addr being 0 in the address case

--- src/MIDebugEngine/Engine.Impl/BreakpointManager.cs
+++ src/MIDebugEngine/Engine.Impl/BreakpointManager.cs
@@ -4,6 +4,7 @@
 using System;
 using Microsoft.VisualStudio.Debugger.Interop;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 using System.Diagnostics;
 using MICore;
@@ -141,18 +142,30 @@
             return pending;
         }

-        // Return all bound breakpoints bound to an address regardless of bptno
-        AD7BoundBreakpoint[] FindBoundBreakpointsAtAddress(ulong addr)
-        {
-            lock (_pendingBreakpoints)
-            {
+        // Return all bound breakpoints bound to an address including the one withe matching bptno.
+        // Note that there are still cases where gdb won't return the address for a breakpoint
+        // (breakpoint that binds to multiple locations) in which case the bktpno is the best match
+        // the engine can do
+        AD7BoundBreakpoint[] FindBoundBreakpointsAtAddress(string bkptno, ulong addr, /*OPTIONAL*/ TupleValue frame)
+        {
+            lock (_pendingBreakpoints)
+            {
+                // Add all bound bps whose address match
                 List<AD7BoundBreakpoint> matchingBoundBreakpoints = new List<AD7BoundBreakpoint>();
                 foreach (AD7PendingBreakpoint currPending in _pendingBreakpoints)
                 {
-                    matchingBoundBreakpoints.AddRange(Array.FindAll(currPending.EnumBoundBreakpoints(), (b) => b.Addr == addr));
-                }
-
-                return matchingBoundBreakpoints.ToArray();
+                    matchingBoundBreakpoints.AddRange(Array.FindAll(currPending.EnumBoundBreakpoints(), (b) => b.Addr != 0 && b.Addr == addr));
+                }
+
+                // Include the bp whose bkptno matches
+                AD7BoundBreakpoint bbp;
+                BindToAddress(bkptno, addr, frame, out bbp);
+                if (bbp != null)
+                {
+                    matchingBoundBreakpoints.Add(bbp);
+                }
+
+                return matchingBoundBreakpoints.Distinct().ToArray();
             }
         }

@@ -163,24 +176,13 @@
             List<AD7BoundBreakpoint> hitBoundBreakpoints = new List<AD7BoundBreakpoint>();
             lock (_pendingBreakpoints)
             {
-                AD7BoundBreakpoint[] hitBps;
-
-                // For the case where an address is provided for the breakpoint, match based on address.
-                // This will cause the engine to send a breakpoint event accounting for all breakpoints
+                // match based on address and bkptno since there are many
+                // cases where gdb doesn't provide the breakpoint address (multple binds to the same location)
+                // This will cause the engine to send a breakpoint event accounting for all known breakpoints
                 // that are hit.
-                // However, clrdbg does not support addresses on its breakpoints, so the bkptno code path is
-                // preserved.
-                if (addr != 0)
-                {
-                    hitBps = FindBoundBreakpointsAtAddress(addr);
-                }
-                else
-                {
-                    AD7BoundBreakpoint bbp;
-                    BindToAddress(bkptno, addr, frame, out bbp);
-                    hitBps = new AD7BoundBreakpoint[1];
-                    hitBps[0] = bbp;
-                }
+                // Clrdbg does not support addresses on its breakpoints, so the bkptno code path is the only
+                // supported path in that case
+                AD7BoundBreakpoint[] hitBps = FindBoundBreakpointsAtAddress(bkptno, addr, frame);

                 foreach (AD7BoundBreakpoint currBoundBp in hitBps)
                 {


test to reproduce GH-705, but it didn't fail so there's not fix

--- src/Marten.Testing/Events/fetching_stream_state.cs
+++ src/Marten.Testing/Events/fetching_stream_state.cs
@@ -1,11 +1,44 @@
 using System;
 using System.Threading.Tasks;
 using Marten.Services;
+using Marten.Testing.Events.Projections;
 using Shouldly;
 using Xunit;

 namespace Marten.Testing.Events
 {
+    public class fetching_stream_state_before_aggregator_is_registered : IntegratedFixture
+    {
+        [Fact]
+        public async Task bug_705_order_of_operation()
+        {
+            var streamId = Guid.NewGuid();
+
+            using (var session = theStore.OpenSession())
+            {
+                var joined = new MembersJoined { Members = new string[] { "Rand", "Matt", "Perrin", "Thom" } };
+                var departed = new MembersDeparted { Members = new[] { "Thom" } };
+
+                session.Events.StartStream<QuestParty>(streamId, joined, departed);
+                session.SaveChanges();
+            }
+
+            using (var query = theStore.OpenSession())
+            {
+                var state = await query.Events.FetchStreamStateAsync(streamId);
+                var aggregate = await query.Events.AggregateStreamAsync<QuestParty>(streamId);
+
+
+
+                state.ShouldNotBeNull();
+                aggregate.ShouldNotBeNull();
+            }
+
+
+        }
+    }
+
+
     // SAMPLE: fetching_stream_state
     public class fetching_stream_state : DocumentSessionFixture<NulloIdentityMap>
     {
@@ -19,6 +52,8 @@
             theStreamId = theSession.Events.StartStream<Quest>(joined, departed);
             theSession.SaveChanges();
         }
+
+

         [Fact]
         public void can_fetch_the_stream_version_and_aggregate_type()


S-64245 Use Assert.AreEqual

S-64245 Use Assert.AreEqual


Removed CORS setup

Removed CORS setup

--- App_Start/WebApiConfig.cs
+++ App_Start/WebApiConfig.cs
@@ -28,8 +28,6 @@
             ConfigOptions options = new ConfigOptions();

             HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));
-
-            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));

             // Now add any missing connection strings and app settings from the environment.
             // Any envrionment variables found with names that match existing connection


Step number input issue adressed with buttons


Resolved #98. AI ship movement

Resolved #98. AI ship movement

--- Assets/Script/StrongAI.cs
+++ Assets/Script/StrongAI.cs
@@ -116,6 +116,7 @@
 						bestPlanet = docked.adjacentPlanet [0];

 					LaunchShip (docked, bestPlanet, docked.adjacentPaths, s);
+					action++;
 				}
 			}
 		}


Space our connection retryies a bit. #245

--- AtlasSSH/SSHConnection.cs
+++ AtlasSSH/SSHConnection.cs
@@ -161,7 +161,7 @@
             Policy
                 .Handle<SshOperationTimeoutException>()
                 .Or<SshConnectionException>()
-                .WaitAndRetry(new[] { TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(1000), TimeSpan.FromMilliseconds(10000) }, (exception, timespan, count, ctx) => Trace.WriteLine($"Failed to connect to {c.ConnectionInfo.Host} ({exception.Message}) - retry count {count}"))
+                .WaitAndRetry(new[] { TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60) }, (exception, timespan, count, ctx) => Trace.WriteLine($"Failed to connect to {c.ConnectionInfo.Host} ({exception.Message}) - retry count {count}"))
                 .Execute(() => c.Connect());
         }


Adds xmldocs to the DeleteExtraneousFiles.

--- Bud.Building/FileUtils.cs
+++ Bud.Building/FileUtils.cs
@@ -32,6 +32,16 @@
       return Path.Combine(baseDir ?? Directory.GetCurrentDirectory(), dir);
     }

+    /// <summary>
+    /// Deletes files in the directory with the given file extension that are not in the list of
+    /// <paramref name="allowedFiles"/>.
+    /// </summary>
+    /// <param name="dir">the directory from which to delete files.</param>
+    /// <param name="allowedFiles">the list of only allowed files in the directory. The paths in this collection
+    /// should be absolute. This method uses the <see cref="ICollection{T}.Contains"/> method to check whether
+    /// a path is allowed.</param>
+    /// <param name="fileExtension">the extension the files to delete should match. Other files will not be
+    /// touched.</param>
     public static void DeleteExtraneousFiles(string dir, ICollection<string> allowedFiles, string fileExtension = "") {
       foreach (var outputFile in FindFiles(dir, fileExtension)) {
         if (!allowedFiles.Contains(outputFile)) {


Value: Don't try to marshal if type has no StructLayout

If the StructLayout is not set, StructureToPtr will throw an exception.
In these cases the type is probably wrapped using a handle and thus
needs no update.

--- glib/Value.cs
+++ glib/Value.cs
@@ -576,6 +576,10 @@
 			if (GType.Is (type, GType.Boxed) && !(val is IWrapper)) {
 				MethodInfo mi = val.GetType ().GetMethod ("Update", BindingFlags.NonPublic | BindingFlags.Instance);
 				IntPtr boxed_ptr = g_value_get_boxed (ref this);
+
+				if (mi == null && !val.GetType ().IsDefined (typeof(StructLayoutAttribute), false))
+					return;
+
 				if (mi == null)
 					Marshal.StructureToPtr (val, boxed_ptr, false);
 				else


Update KoreanCVCPhonemizer(combine finalConsonant)


Modified registration of preview diagrams to allow Autofac to create a factory function automatically.


ResourceManager and ResourceContentManager cannot be relied upon because WinRT offers no support for ResourceManager.GetObject semantics


removed verbose output

removed verbose output

--- src/NStore.Persistence.Tests/PersistenceFixture.cs
+++ src/NStore.Persistence.Tests/PersistenceFixture.cs
@@ -401,11 +401,11 @@

             poller.Stop();

-            Console.WriteLine("Dumping recorder");
-            recorder.Replay((storeIndex, partitionId, index, payload) =>
-            {
-                Console.WriteLine($"{storeIndex:D5} - {partitionId.PadRight(20)} - {index:D5}");
-            });
+            //Console.WriteLine("Dumping recorder");
+            //recorder.Replay((storeIndex, partitionId, index, payload) =>
+            //{
+            //    Console.WriteLine($"{storeIndex:D5} - {partitionId.PadRight(20)} - {index:D5}");
+            //});

             Assert.Equal(range, poller.Position);
             Assert.Equal(range, recorder.Length);


Tests for BCL compatibility.

Tests for BCL compatibility.

--- src/NodaTime.Test/Calendars/IslamicCalendarTest.cs
+++ src/NodaTime.Test/Calendars/IslamicCalendarTest.cs
@@ -15,8 +15,10 @@
 // limitations under the License.
 #endregion

+using System.Globalization;
 using NUnit.Framework;
 using NodaTime.Calendars;
+using System;

 namespace NodaTime.Test.Calendars
 {
@@ -239,7 +241,6 @@
         public void ThursdayEpoch()
         {
             CalendarSystem thursdayEpochCalendar = CalendarSystem.GetIslamicCalendar(IslamicLeapYearPattern.Base16, IslamicEpoch.Astronomical);
-
             CalendarSystem julianCalendar = CalendarSystem.GetJulianCalendar(4);

             LocalDate thursdayEpoch = new LocalDate(1, 1, 1, thursdayEpochCalendar);
@@ -251,12 +252,61 @@
         public void FridayEpoch()
         {
             CalendarSystem fridayEpochCalendar = CalendarSystem.GetIslamicCalendar(IslamicLeapYearPattern.Base16, IslamicEpoch.Civil);
-
             CalendarSystem julianCalendar = CalendarSystem.GetJulianCalendar(4);

             LocalDate fridayEpoch = new LocalDate(1, 1, 1, fridayEpochCalendar);
             LocalDate fridayEpochJulian = new LocalDate(622, 7, 16, julianCalendar);
             Assert.AreEqual(fridayEpochJulian, fridayEpoch.WithCalendar(julianCalendar));
         }
+
+        [Test]
+        public void BclUsesAstronomicalEpoch()
+        {
+            Calendar hijri = new HijriCalendar();
+            DateTime bclDirect = new DateTime(1, 1, 1, 0, 0, 0, 0, hijri, DateTimeKind.Unspecified);
+
+            CalendarSystem julianCalendar = CalendarSystem.GetJulianCalendar(4);
+            LocalDate julianIslamicEpoch = new LocalDate(622, 7, 15, julianCalendar);
+            LocalDate isoIslamicEpoch = julianIslamicEpoch.WithCalendar(CalendarSystem.Iso);
+            DateTime bclFromNoda = isoIslamicEpoch.LocalDateTime.ToDateTimeUnspecified();
+            Assert.AreEqual(bclDirect, bclFromNoda);
+        }
+
+        [Test]
+        public void SampleDateBclCompatibility()
+        {
+            Calendar hijri = new HijriCalendar();
+            DateTime bclDirect = new DateTime(1302, 10, 15, 0, 0, 0, 0, hijri, DateTimeKind.Unspecified);
+
+            CalendarSystem islamicCalendar = CalendarSystem.GetIslamicCalendar(IslamicLeapYearPattern.Base16, IslamicEpoch.Astronomical);
+            LocalDate iso = new LocalDate(1302, 10, 15, islamicCalendar);
+            DateTime bclFromNoda = iso.LocalDateTime.ToDateTimeUnspecified();
+            Assert.AreEqual(bclDirect, bclFromNoda);
+        }
+
+        /// <summary>
+        /// This tests every day for 9000 (ISO) years, to check that it always matches the year, month and day.
+        /// </summary>
+        [Test, Ignore("Takes a long time")]
+        public void BclThroughHistory()
+        {
+            Calendar hijri = new HijriCalendar();
+            DateTime bclDirect = new DateTime(1, 1, 1, 0, 0, 0, 0, hijri, DateTimeKind.Unspecified);
+
+            CalendarSystem islamicCalendar = CalendarSystem.GetIslamicCalendar(IslamicLeapYearPattern.Base16, IslamicEpoch.Astronomical);
+            CalendarSystem julianCalendar = CalendarSystem.GetJulianCalendar(4);
+            LocalDate julianIslamicEpoch = new LocalDate(622, 7, 15, julianCalendar);
+            LocalDate islamicDate = julianIslamicEpoch.WithCalendar(islamicCalendar);
+
+            for (int i = 0; i < 9000 * 365; i++)
+            {
+                Assert.AreEqual(bclDirect, islamicDate.LocalDateTime.ToDateTimeUnspecified());
+                Assert.AreEqual(hijri.GetYear(bclDirect), islamicDate.Year, i.ToString());
+                Assert.AreEqual(hijri.GetMonth(bclDirect), islamicDate.MonthOfYear);
+                Assert.AreEqual(hijri.GetDayOfMonth(bclDirect), islamicDate.DayOfMonth);
+                bclDirect = hijri.AddDays(bclDirect, 1);
+                islamicDate = islamicDate.PlusDays(1);
+            }
+        }
     }
 }


Re-enable all time zones for Mono tests

Re-enable all time zones for Mono tests

There are 14 broken tests on Mono for Linux; skipping
category BrokenOnMonoLinux will skip these. (They are
all due to bugs in Mono, as far as we can tell.) This
also skips tests for time zones which use Feb 29th in
any TimeZoneInfo rules due to another bug in Mono.

This helps narrow down #97.

--- src/NodaTime.Test/TimeZones/BclDateTimeZoneTest.cs
+++ src/NodaTime.Test/TimeZones/BclDateTimeZoneTest.cs
@@ -7,6 +7,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Linq;
 using NUnit.Framework;
 using NodaTime.TimeZones;

@@ -14,19 +15,36 @@
 {
     public class BclDateTimeZoneTest
     {
-        // This test is effectively disabled on Mono as its time zone support is broken in the current
-        // stable release - see https://github.com/nodatime/nodatime/issues/97
-        private static readonly ReadOnlyCollection<TimeZoneInfo> BclZonesOrJustNullOnMono = TestHelper.IsRunningOnMono
-            ? new List<TimeZoneInfo> { null }.AsReadOnly() : TimeZoneInfo.GetSystemTimeZones();
-
-        [Test]
-        [TestCaseSource(nameof(BclZonesOrJustNullOnMono))]
+        private static readonly ReadOnlyCollection<TimeZoneInfo> BclZones =
+            TestHelper.IsRunningOnMono ? GetSafeSystemTimeZones() : TimeZoneInfo.GetSystemTimeZones();
+
+        private static ReadOnlyCollection<TimeZoneInfo> GetSafeSystemTimeZones() =>
+             TimeZoneInfo.GetSystemTimeZones()
+                // Filter time zones that have a rule involving Feb 29th, to avoid https://bugzilla.xamarin.com/show_bug.cgi?id=54468
+                .Where(ZoneRulesDontReferToLeapDays)
+                // Recreate all time zones from their rules, to avoid https://bugzilla.xamarin.com/show_bug.cgi?id=54480
+                // Arguably this is invalid, but it means we're testing that Noda Time can do as well as it can feasibly
+                // do based on the rules.
+                .Select(RecreateZone)
+                .ToList()
+                .AsReadOnly();
+
+        private static bool ZoneRulesDontReferToLeapDays(TimeZoneInfo zone) =>
+            !zone.GetAdjustmentRules().Any(rule => TransitionRefersToLeapDay(rule.DaylightTransitionStart) ||
+                                                   TransitionRefersToLeapDay(rule.DaylightTransitionEnd));
+
+        private static bool TransitionRefersToLeapDay(TimeZoneInfo.TransitionTime transition) =>
+            transition.IsFixedDateRule && transition.Month == 2 && transition.Day == 29;
+
+        private static TimeZoneInfo RecreateZone(TimeZoneInfo zone) =>
+            TimeZoneInfo.CreateCustomTimeZone(zone.Id, zone.BaseUtcOffset, zone.DisplayName, zone.StandardName,
+                zone.DisplayName, zone.GetAdjustmentRules());
+
+        [Test]
+        [TestCaseSource(nameof(BclZones))]
+        [Category("BrokenOnMonoLinux")]
         public void AllZoneTransitions(TimeZoneInfo windowsZone)
         {
-            if (windowsZone == null)
-            {
-                Assert.Ignore("Test skipped on Mono");
-            }
             var nodaZone = BclDateTimeZone.FromTimeZoneInfo(windowsZone);

             Instant instant = Instant.FromUtc(1800, 1, 1, 0, 0);
@@ -49,13 +67,10 @@
         /// slow test, mostly because TimeZoneInfo is slow.
         /// </summary>
         [Test]
-        [TestCaseSource(nameof(BclZonesOrJustNullOnMono))]
+        [TestCaseSource(nameof(BclZones))]
+        [Category("BrokenOnMonoLinux")]
         public void AllZonesEveryWeek(TimeZoneInfo windowsZone)
         {
-            if (windowsZone == null)
-            {
-                Assert.Ignore("Test skipped on Mono");
-            }
             ValidateZoneEveryWeek(windowsZone);
         }

@@ -76,13 +91,9 @@
         }

         [Test]
-        [TestCaseSource(nameof(BclZonesOrJustNullOnMono))]
+        [TestCaseSource(nameof(BclZones))]
         public void AllZonesStartAndEndOfTime(TimeZoneInfo windowsZone)
         {
-            if (windowsZone == null)
-            {
-                Assert.Ignore("Test skipped on Mono");
-            }
             var nodaZone = BclDateTimeZone.FromTimeZoneInfo(windowsZone);
             var firstInterval = nodaZone.GetZoneInterval(Instant.MinValue);
             Assert.IsFalse(firstInterval.HasStart);


#129 cleaned up ValidationState references for FQN

--- src/Rocks/Builders/Create/PointerArgTypeBuilder.cs
+++ src/Rocks/Builders/Create/PointerArgTypeBuilder.cs
@@ -32,13 +32,13 @@
 		writer.WriteLine($"private readonly {typeName} value;");
 		writer.WriteLine($"private readonly global::Rocks.ValidationState validation;");
 		writer.WriteLine();
-		writer.WriteLine($"internal {argName}() => this.validation = ValidationState.None;");
+		writer.WriteLine($"internal {argName}() => this.validation = global::Rocks.ValidationState.None;");
 		writer.WriteLine();
 		writer.WriteLine($"internal {argName}({typeName} value)");
 		writer.WriteLine("{");
 		writer.Indent++;
 		writer.WriteLine("this.value = value;");
-		writer.WriteLine("this.validation = ValidationState.Value;");
+		writer.WriteLine("this.validation = global::Rocks.ValidationState.Value;");
 		writer.Indent--;
 		writer.WriteLine("}");
 		writer.WriteLine();
@@ -46,7 +46,7 @@
 		writer.WriteLine("{");
 		writer.Indent++;
 		writer.WriteLine("this.evaluation = evaluation;");
-		writer.WriteLine("this.validation = ValidationState.Evaluation;");
+		writer.WriteLine("this.validation = global::Rocks.ValidationState.Evaluation;");
 		writer.Indent--;
 		writer.WriteLine("}");
 		writer.WriteLine();
@@ -63,22 +63,22 @@
 		writer.WriteLine("this.validation switch");
 		writer.WriteLine("{");
 		writer.Indent++;
-		writer.WriteLine("ValidationState.None => true,");
+		writer.WriteLine("global::Rocks.ValidationState.None => true,");

 		if (type.Kind == SymbolKind.FunctionPointerType)
 		{
 			writer.WriteLine("#pragma warning disable CS8909");
 		}

-		writer.WriteLine("ValidationState.Value => value == this.value,");
+		writer.WriteLine("global::Rocks.ValidationState.Value => value == this.value,");

 		if (type.Kind == SymbolKind.FunctionPointerType)
 		{
 			writer.WriteLine("#pragma warning restore CS8909");
 		}

-		writer.WriteLine("ValidationState.Evaluation => this.evaluation!(value),");
-		writer.WriteLine("ValidationState.DefaultValue => throw new global::System.NotSupportedException(\"Cannot validate an argument value in the ValidationState.DefaultValue state.\"),");
+		writer.WriteLine("global::Rocks.ValidationState.Evaluation => this.evaluation!(value),");
+		writer.WriteLine("global::Rocks.ValidationState.DefaultValue => throw new global::System.NotSupportedException(\"Cannot validate an argument value in the ValidationState.DefaultValue state.\"),");
 		writer.WriteLine("_ => throw new global::System.ComponentModel.InvalidEnumArgumentException($\"Invalid value for validation: {{this.validation}}\")");
 		writer.Indent--;
 		writer.WriteLine("};");


Using Account Shipping Info instead of Contact Shipping Info

--- src/SageLiveAccess/Services/PullInvoicesService.cs
+++ src/SageLiveAccess/Services/PullInvoicesService.cs
@@ -38,7 +38,7 @@
 			var invoiceTypeId = invoiceType.Value.Id;

 			// get raw invoices
-			var rawInvoices = await this._paginationManager.GetAll< s2cor__Sage_INV_Trade_Document__c >( SoqlQuery.Builder().Select( "Id", "Name", "s2cor__UID__c", "s2cor__Company__c", "s2cor__Date__c", "s2cor__Currency__c", "s2cor__Status__c", "SkuVault_Sage__Fulfilled_By__c", "s2cor__Is_Paid__c", "s2cor__Contact__c", "s2cor__Total_Amount__c", "LastModifiedDate", "s2cor__Document_Number_Tag__c", "s2cor__Document_Number__c" ).From( "s2cor__Sage_INV_Trade_Document__c" ).Where( "LastModifiedDate" ).IsGreaterThan( dateFrom ).And( "LastModifiedDate" ).IsLessThan( dateTo ).And( "s2cor__Trade_Document_Type__c" ).IsEqualTo( invoiceTypeId ), mark, ct /*"SELECT Id, Name, s2cor__UID__c, s2cor__Company__c, s2cor__Date__c, s2cor__Currency__c, s2cor__Status__c, SkuVault_Sage__Fulfilled_By__c, s2cor__Is_Paid__c, s2cor__Contact__c, s2cor__Total_Amount__c, LastModifiedDate FROM s2cor__Sage_INV_Trade_Document__c WHERE LastModifiedDate > {0} AND LastModifiedDate < {1} AND s2cor__Trade_Document_Type__c = '{2}'".FormatWith( this.FormatDate( dateFrom ), this.FormatDate( dateTo ), invoiceTypeId )*/ );
+			var rawInvoices = await this._paginationManager.GetAll< s2cor__Sage_INV_Trade_Document__c >( SoqlQuery.Builder().Select( "Id", "Name", "s2cor__UID__c", "s2cor__Account__c", "s2cor__Date__c", "s2cor__Currency__c", "s2cor__Status__c", "SkuVault_Sage__Fulfilled_By__c", "s2cor__Is_Paid__c", "s2cor__Contact__c", "s2cor__Total_Amount__c", "LastModifiedDate", "s2cor__Document_Number_Tag__c", "s2cor__Document_Number__c" ).From( "s2cor__Sage_INV_Trade_Document__c" ).Where( "LastModifiedDate" ).IsGreaterThan( dateFrom ).And( "LastModifiedDate" ).IsLessThan( dateTo ).And( "s2cor__Trade_Document_Type__c" ).IsEqualTo( invoiceTypeId ), mark, ct /*"SELECT Id, Name, s2cor__UID__c, s2cor__Company__c, s2cor__Date__c, s2cor__Currency__c, s2cor__Status__c, SkuVault_Sage__Fulfilled_By__c, s2cor__Is_Paid__c, s2cor__Contact__c, s2cor__Total_Amount__c, LastModifiedDate FROM s2cor__Sage_INV_Trade_Document__c WHERE LastModifiedDate > {0} AND LastModifiedDate < {1} AND s2cor__Trade_Document_Type__c = '{2}'".FormatWith( this.FormatDate( dateFrom ), this.FormatDate( dateTo ), invoiceTypeId )*/ );

 			var invoices = rawInvoices.Select( async rawInvoice =>
 			{
@@ -70,7 +70,7 @@

 		public async Task< ContactAndAddressInfo > GetContactAndAddressInfo( s2cor__Sage_INV_Trade_Document__c saleInvoice, Mark mark, CancellationToken ct )
 		{
-			var account = ( await this._asyncQueryManager.QueryOneAsync< Account >( SoqlQuery.Builder().Select( "Name" ).From( "Account" ).Where( "Id" ).IsEqualTo( saleInvoice.s2cor__Account__c ), mark, ct ) ).GetValue( () => new Account() );
+			var account = ( await this._asyncQueryManager.QueryOneAsync< Account >( SoqlQuery.Builder().Select( "Name", "ShippingAddress" ).From( "Account" ).Where( "Id" ).IsEqualTo( saleInvoice.s2cor__Account__c ), mark, ct ) ).GetValue( () => new Account() );
 			var contact = ( await this._asyncQueryManager.QueryOneAsync< Contact >( SoqlQuery.Builder().Select( "Name", "MailingAddress", "FirstName", "LastName", "MailingCity", "MailingState", "MailingStreet", "MailingPostalCode" ).From( "Contact" ).Where( "Id" ).IsEqualTo( saleInvoice.s2cor__Contact__c ), mark, ct ) ).GetValue( () => new Contact() );

 			var contactInfo = new ContactInfo
@@ -79,13 +79,29 @@
 				LastName = contact.LastName ?? "N/A",
 				Company = account.Name ?? "N/A"
 			};
-			var addressInfo = new AddressInfo
-			{
-				City = contact.MailingCity ?? "N/A",
-				State = contact.MailingState ?? "N/A",
-				Street = contact.MailingStreet ?? "N/A",
-				Zip = contact.MailingPostalCode ?? "N/A"
-			};
+
+			var accountShippingAddress = account.ShippingAddress;
+			var accountWithShippingAddress = accountShippingAddress != null &&
+			                                 ( !string.IsNullOrEmpty( accountShippingAddress.city ) ||
+			                                   !string.IsNullOrEmpty( accountShippingAddress.state ) ||
+			                                   !string.IsNullOrEmpty( accountShippingAddress.street ) ||
+			                                   !string.IsNullOrEmpty( accountShippingAddress.postalCode ) );
+
+			var addressInfo = accountWithShippingAddress
+				? new AddressInfo
+				{
+					City = accountShippingAddress.city ?? "N/A",
+					State = accountShippingAddress.state ?? "N/A",
+					Street = accountShippingAddress.street ?? "N/A",
+					Zip = accountShippingAddress.postalCode ?? "N/A"
+				}
+				: new AddressInfo
+				{
+					City = contact.MailingCity ?? "N/A",
+					State = contact.MailingState ?? "N/A",
+					Street = contact.MailingStreet ?? "N/A",
+					Zip = contact.MailingPostalCode ?? "N/A"
+				};

 			return new ContactAndAddressInfo
 			{


Clear all tests from synchronizertest.cs

--- src/Tests.Daterpillar/UnitTest/SynchronizerTest.cs
+++ src/Tests.Daterpillar/UnitTest/SynchronizerTest.cs
@@ -1,12 +1,6 @@
-using ApprovalTests;
-using ApprovalTests.Namers;
+using ApprovalTests.Namers;
 using ApprovalTests.Reporters;
-using Gigobyte.Daterpillar;
-using Gigobyte.Daterpillar.Migration;
-using Gigobyte.Daterpillar.TextTransformation;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Text;
-using Telerik.JustMock.Helpers;

 namespace Tests.Daterpillar.UnitTest
 {
@@ -20,214 +14,5 @@
         {
             ApprovalTests.Maintenance.ApprovalMaintenance.CleanUpAbandonedFiles();
         }
-
-        [TestMethod]
-        [Owner(Test.Dev.Ackara)]
-        public void GenerateScript_should_return_an_empty_byte_array_when_both_schemas_are_equal()
-        {
-            // Arrange
-            var source = new Schema();
-            source.Tables.AddRange(new Table[]
-            {
-                SampleData.CreateTable("a"),
-                SampleData.CreateTable("b"),
-                SampleData.CreateTable("c")
-            });
-
-            var target = new Schema();
-            target.Tables.AddRange(new Table[]
-            {
-                SampleData.CreateTable("a"),
-                SampleData.CreateTable("b"),
-                SampleData.CreateTable("c")
-            });
-            target.Tables.Reverse();
-
-            var sut = new Synchronizer(new FakeScriptBuilder());
-
-            // Act
-            var results = sut.GenerateScript(source, target);
-
-            // Assert
-            Assert.IsTrue(string.IsNullOrWhiteSpace(results));
-        }
-
-        [TestMethod]
-        [Owner(Test.Dev.Ackara)]
-        public void GenerateScript_should_return_a_update_script_when_the_schemas_passed_tables_are_not_equal()
-        {
-            var source = new Schema();
-            source.Tables.AddRange(new Table[]
-            {
-                SampleData.CreateTable("a"),
-                SampleData.CreateTable("b"),
-                SampleData.CreateTable("d"),
-                SampleData.CreateTable("e"),
-            });
-
-            var target = new Schema();
-            target.Tables.AddRange(new Table[]
-            {
-                SampleData.CreateTable("a"),
-                SampleData.CreateTable("b"),
-                SampleData.CreateTable("c"),
-            });
-
-            var sut = new Synchronizer(new FakeScriptBuilder());
-
-            // Act
-            var results = sut.GenerateScript(source, target);
-
-            // Assert
-            Approvals.Verify(results);
-            source.Assert();
-            target.Assert();
-        }
-
-        [TestMethod]
-        [Owner(Test.Dev.Ackara)]
-        public void GenerateScript_should_return_the_bytes_of_a_truncate_script_when_no_tables_from_the_source_match_the_target()
-        {
-            // Arrange
-            var source = new Schema();
-            source.Tables.Add(SampleData.CreateTable("a"));
-
-            var target = new Schema();
-            target.Tables.Add(SampleData.CreateTable("b"));
-            target.Tables.Add(SampleData.CreateTable("c"));
-
-            var sut = new Synchronizer(new FakeScriptBuilder());
-
-            // Act
-            var results = sut.GenerateScript(source, target);
-
-            // Assert
-            Approvals.Verify(results);
-        }
-
-        [TestMethod]
-        [Owner(Test.Dev.Ackara)]
-        public void GenerateScript_should_return_a_update_script_when_the_schemas_passed_columns_are_not_equal()
-        {
-            // Arrange
-            string tableName = "a";
-
-            var source = new Schema();
-
-            var target = new Schema();
-
-
-            var sut = new Synchronizer(new FakeScriptBuilder());
-
-            // Act
-            var result = sut.GenerateScript(source, target);
-
-            // Assert
-            Approvals.Verify(result);
-        }
-
-        [TestMethod]
-        [Owner(Test.Dev.Ackara)]
-        public void GenerateScript_should_return_the_bytes_of_a_truncate_script_when_no_columns_from_the_source_match_the_target()
-        {
-            // Arrange
-            string tableName = "a";
-
-            var source = new Schema();
-
-            var target = new Schema();
-
-            var sut = new Synchronizer(new FakeScriptBuilder());
-
-            // Act
-            var results = sut.GenerateScript(source, target);
-
-            // Assert
-            Approvals.Verify(results);
-        }
-
-        #region Fakes
-
-        private class FakeScriptBuilder : IScriptBuilder
-        {
-            internal StringBuilder _text = new StringBuilder();
-
-            public void AlterTable(Table tableA, Table tableB)
-            {
-                _text.AppendLine($"alter {tableA.Name} to {tableB.Name}");
-            }
-
-            public void Append(string text)
-            {
-                _text.Append(text);
-            }
-
-            public void AppendLine(string text)
-            {
-                _text.AppendLine(text);
-            }
-
-            public void Create(Table table)
-            {
-                _text.AppendLine($"create table [{table.Name}]");
-            }
-
-            public void Drop(Table table)
-            {
-                _text.AppendLine($"drop table [{table.Name}]");
-            }
-
-            public string GetContent()
-            {
-                return _text.ToString();
-            }
-
-            public void Create(Column column)
-            {
-                _text.AppendLine($"add column [{column.Name}] to [{column.TableRef}]");
-            }
-
-            public void Drop(Column column)
-            {
-                _text.AppendLine($"drop [{column.Name}] column from [{column.TableRef}] table");
-            }
-
-            public void AlterTable(Column oldColumn, Column newColumn)
-            {
-                _text.AppendLine($"alter [{oldColumn.TableRef}] table [{oldColumn.Name}] column");
-            }
-
-            public void Create(Index index)
-            {
-                _text.AppendLine($"create index [{index.Name}]");
-            }
-
-            public void Create(ForeignKey foreignKey)
-            {
-                _text.AppendLine($"create foreignkey {foreignKey.Name}");
-            }
-
-            public void Drop(Index index)
-            {
-                _text.AppendLine($"drop index [{index.Name}]");
-            }
-
-            public void Drop(ForeignKey foreignKey)
-            {
-                _text.AppendLine($"drop foreignkey {foreignKey.Name}");
-            }
-
-            public void Drop(Schema schema)
-            {
-                _text.Append($"drop {schema.Name} schema");
-            }
-
-            public void Create(Schema schema)
-            {
-                _text.AppendLine($"create schema [{schema.Name}]");
-            }
-        }
-
-        #endregion Fakes
     }
 }


Changes UmbracoApiControllerBase to lazily create properties which helps with unit testing

--- src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
+++ src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
@@ -24,12 +24,11 @@
         {
             if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
             UmbracoContext = umbracoContext;
-            InstanceId = Guid.NewGuid();
-            Umbraco = new UmbracoHelper(umbracoContext);
-            _membershipHelper = new MembershipHelper(UmbracoContext);
+            InstanceId = Guid.NewGuid();
         }

-        private readonly MembershipHelper _membershipHelper;
+        private MembershipHelper _membershipHelper;
+        private UmbracoHelper _umbraco;

         /// <summary>
         /// Tries to retrieve the current HttpContext if one exists.
@@ -92,7 +91,10 @@
         /// <summary>
         /// Returns an UmbracoHelper object
         /// </summary>
-        public UmbracoHelper Umbraco { get; private set; }
+        public UmbracoHelper Umbraco
+        {
+            get { return _umbraco ?? (_umbraco = new UmbracoHelper(UmbracoContext)); }
+        }

         /// <summary>
         /// Returns the current UmbracoContext
@@ -112,7 +114,7 @@
         /// </summary>
         public MembershipHelper Members
         {
-            get { return _membershipHelper; }
+            get { return _membershipHelper ?? (_membershipHelper = new MembershipHelper(UmbracoContext)); }
         }

         /// <summary>


Fix Lerp documentation and implement RangeLerp

(cherry picked from commit ee95a1cb2834d3116e65dc5e28f9fad24455e525)

--- modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
+++ modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
@@ -271,10 +271,14 @@
         /// Returns a normalized value considering the given range.
         /// This is the opposite of <see cref="Lerp(real_t, real_t, real_t)"/>.
         /// </summary>
-        /// <param name="from">The interpolated value.</param>
+        /// <param name="from">The start value for interpolation.</param>
         /// <param name="to">The destination value for interpolation.</param>
-        /// <param name="weight">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param>
-        /// <returns>The resulting value of the inverse interpolation.</returns>
+        /// <param name="weight">The interpolated value.</param>
+        /// <returns>
+        /// The resulting value of the inverse interpolation.
+        /// The returned value will be between 0.0 and 1.0 if <paramref name="weight"/> is
+        /// between <paramref name="from"/> and <paramref name="to"/> (inclusive).
+        /// </returns>
         public static real_t InverseLerp(real_t from, real_t to, real_t weight)
         {
             return (weight - from) / (to - from);
@@ -522,6 +526,21 @@
         public static real_t Rad2Deg(real_t rad)
         {
             return rad * _rad2DegConst;
+        }
+
+        /// <summary>
+        /// Maps a <paramref name="value"/> from [<paramref name="inFrom"/>, <paramref name="inTo"/>]
+        /// to [<paramref name="outFrom"/>, <paramref name="outTo"/>].
+        /// </summary>
+        /// <param name="value">The value to map.</param>
+        /// <param name="inFrom">The start value for the input interpolation.</param>
+        /// <param name="inTo">The destination value for the input interpolation.</param>
+        /// <param name="outFrom">The start value for the output interpolation.</param>
+        /// <param name="outTo">The destination value for the output interpolation.</param>
+        /// <returns>The resulting mapped value mapped.</returns>
+        public static real_t RangeLerp(real_t value, real_t inFrom, real_t inTo, real_t outFrom, real_t outTo)
+        {
+            return Lerp(outFrom, outTo, InverseLerp(inFrom, inTo, value));
         }

         /// <summary>


fix bug with the PS console doesn't use the same language as VS. Work items: 2446

--- src/VsConsole/Console/Console/ConsoleDispatcher.cs
+++ src/VsConsole/Console/Console/ConsoleDispatcher.cs
@@ -7,6 +7,7 @@
 using System.Windows.Media;
 using Microsoft.VisualStudio.Text;
 using NuGet;
+using System.Globalization;

 namespace NuGetConsole.Implementation.Console
 {
@@ -165,9 +166,21 @@
                         _dispatcher = new SyncHostConsoleDispatcher(this);
                     }

+                    // capture the cultures to assign to the worker thread below
+                    CultureInfo currentCulture = CultureInfo.CurrentCulture;
+                    CultureInfo currentUICulture = CultureInfo.CurrentUICulture;
+
                     Task.Factory.StartNew(
                         // gives the host a chance to do initialization works before the console starts accepting user inputs
-                        () => host.Initialize(WpfConsole)
+                        () =>
+                            {
+                                // apply the culture of the main thread to this thread so that the PowerShell engine
+                                // will have the same culture as Visual Studio.
+                                System.Threading.Thread.CurrentThread.CurrentCulture = currentCulture;
+                                System.Threading.Thread.CurrentThread.CurrentUICulture = currentUICulture;
+
+                                host.Initialize(WpfConsole);
+                            }
                     ).ContinueWith(
                         task =>
                         {


Code Review feedback for RunspaceDispatcher.

--- src/VsConsole/PowerShellHost/RunspaceDispatcher.cs
+++ src/VsConsole/PowerShellHost/RunspaceDispatcher.cs
@@ -222,10 +222,10 @@
             }
             else
             {
-                IHaveTheLock = true;
                 _dispatcherLock.Wait();
                 try
                 {
+                    IHaveTheLock = true;
                     act();
                 }
                 finally
@@ -287,10 +287,10 @@
             }
             else
             {
-                IHaveTheLock = true;
                 _dispatcherLock.Wait();
                 try
                 {
+                    IHaveTheLock = true;
                     pipeline.InvokeAsync();
                 }
                 catch


Use friendly name

Use friendly name

--- SeeGitApp/Extensions/LibGit2Extensions.cs
+++ SeeGitApp/Extensions/LibGit2Extensions.cs
@@ -6,7 +6,7 @@
         {
             return new BranchReference
             {
-                Name = branch.CanonicalName,
+                Name = branch.FriendlyName,
                 IsRemote = branch.IsRemote,
                 IsHead = branch.IsCurrentRepositoryHead
             };


Recompute corner and rotate handle localScale whenever target transform changes.

--- Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/BoundingBox/BoundingBox.cs
+++ Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/BoundingBox/BoundingBox.cs
@@ -1695,6 +1695,18 @@

                 // Compute the local scale that produces the desired world space dimensions
                 Vector3 linkDimensions = Vector3.Scale(GetLinkDimensions(), invRootScale);
+                Vector3 cornerDimensions = Vector3.Scale(scaleHandleSize * Vector3.one, invRootScale);
+                Vector3 ballDimenions = Vector3.Scale(rotationHandleDiameter * Vector3.one, invRootScale);
+
+                for (int i = 0; i < corners.Count; i++)
+                {
+                    corners[i].localScale = cornerDimensions;
+                }
+
+                for (int i = 0; i < balls.Count; i++)
+                {
+                    balls[i].localScale = ballDimenions;
+                }

                 for (int i = 0; i < edgeCenters.Length; ++i)
                 {


Fix up build script

Fix up build script

--- CI/build.cake
+++ CI/build.cake
@@ -102,7 +102,8 @@
 	PackageComponent ("./../Component/", xamCompSettings);
 });

-Task ("Default").IsDependentOn("Component")
+//Build the component, which build samples, nugets, and libraries
+Task ("Default").IsDependentOn("Component");

 Task ("Clean").Does (() =>


add TODO for network change listener events

--- tools/OutlineService/OutlineService/OutlineService.cs
+++ tools/OutlineService/OutlineService/OutlineService.cs
@@ -918,6 +918,12 @@
             }
             catch (Exception e)
             {
+                // TODO: This isn't quite right: because we successfully updated
+                //       the route to the proxy, the client *is* connected; it's
+                //       just not "fully" connected, in the way we like. We
+                //       should distinguish between "cannot reconnect right now,
+                //       because no internet" and "cannot reconnect because
+                //       netsh commands are failing".
                 eventLog.WriteEntry($"could not update LAN bypass routes: {e.Message}");
                 return;
             }


potencial null ref

potencial null ref

--- OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -261,64 +261,60 @@
         {
             InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);

+            if (item == null)
+            {
+                m_log.ErrorFormat(
+                    "[INVENTORY ACCESS MODULE]: Could not find item {0} for caps inventory update", itemID);
+                return UUID.Zero;
+            }
+
             if (item.Owner != remoteClient.AgentId)
                 return UUID.Zero;

-            if (item != null)
-            {
-                if ((InventoryType)item.InvType == InventoryType.Notecard)
-                {
-                    if (!m_Scene.Permissions.CanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
-                    {
-                        remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
-                        return UUID.Zero;
-                    }
-
-                    remoteClient.SendAlertMessage("Notecard saved");
-                }
-                else if ((InventoryType)item.InvType == InventoryType.LSL)
-                {
-                    if (!m_Scene.Permissions.CanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
-                    {
-                        remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
-                        return UUID.Zero;
-                    }
-
-                    remoteClient.SendAlertMessage("Script saved");
-                }
-                else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet)
-                {
-                    AnimationSet animSet = new AnimationSet(data);
-                    if (!animSet.Validate(x => {
+            if ((InventoryType)item.InvType == InventoryType.Notecard)
+            {
+                if (!m_Scene.Permissions.CanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
+                {
+                    remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
+                    return UUID.Zero;
+                }
+
+               remoteClient.SendAlertMessage("Notecard saved");
+            }
+            else if ((InventoryType)item.InvType == InventoryType.LSL)
+            {
+                if (!m_Scene.Permissions.CanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
+                {
+                    remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
+                    return UUID.Zero;
+                }
+
+                remoteClient.SendAlertMessage("Script saved");
+            }
+            else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet)
+            {
+                AnimationSet animSet = new AnimationSet(data);
+                if (!animSet.Validate(x => {
                         int perms = m_Scene.InventoryService.GetAssetPermissions(remoteClient.AgentId, x);
                         int required = (int)(PermissionMask.Transfer | PermissionMask.Copy);
                         if ((perms & required) != required)
                             return false;
                         return true;
                     }))
-                    {
-                        data = animSet.ToBytes();
-                    }
-                }
-
-                AssetBase asset =
-                    CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data, remoteClient.AgentId.ToString());
-                item.AssetID = asset.FullID;
-                m_Scene.AssetService.Store(asset);
-
-                m_Scene.InventoryService.UpdateItem(item);
-
-                // remoteClient.SendInventoryItemCreateUpdate(item);
-                return (asset.FullID);
-            }
-            else
-            {
-                m_log.ErrorFormat(
-                    "[INVENTORY ACCESS MODULE]: Could not find item {0} for caps inventory update",
-                    itemID);
-            }
-
-            return UUID.Zero;
+                {
+                    data = animSet.ToBytes();
+                }
+            }
+
+            AssetBase asset =
+                CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data, remoteClient.AgentId.ToString());
+            item.AssetID = asset.FullID;
+            m_Scene.AssetService.Store(asset);
+
+            m_Scene.InventoryService.UpdateItem(item);
+
+            // remoteClient.SendInventoryItemCreateUpdate(item);
+            return (asset.FullID);
         }

         public virtual bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset)


Speed improvement mostly when sensing objects especially noticeable in a sim with many objects.

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -73,6 +73,28 @@
             public SceneObjectPart host;
         }

+        //
+        // Sensed entity
+        //
+        private class SensedEntity : IComparable
+        {
+            public SensedEntity(double detectedDistance, UUID detectedID)
+            {
+                distance = detectedDistance;
+                itemID = detectedID;
+            }
+            public int CompareTo(object obj)
+            {
+                if (!(obj is SensedEntity)) throw new InvalidOperationException();
+                SensedEntity ent = (SensedEntity)obj;
+                if (ent == null || ent.distance < distance) return 1;
+                if (ent.distance > distance) return -1;
+                return 0;
+            }
+            public UUID itemID;
+            public double distance;
+        }
+
         private List<SenseRepeatClass> SenseRepeaters = new List<SenseRepeatClass>();
         private object SenseRepeatListLock = new object();

@@ -175,23 +197,23 @@
                 return;
             }

-            LSL_Types.list SensedObjects = new LSL_Types.list();
+            List<SensedEntity> sensedEntities = new List<SensedEntity>();

             // Is the sensor type is AGENT and not SCRIPTED then include agents
             if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0)
             {
-                doAgentSensor(ts, SensedObjects);
+               sensedEntities.AddRange(doAgentSensor(ts));
             }

             // If SCRIPTED or PASSIVE or ACTIVE check objects
             if ((ts.type & SCRIPTED) != 0 || (ts.type & PASSIVE) != 0 || (ts.type & ACTIVE) != 0)
             {
-                doObjectSensor(ts, SensedObjects);
+                sensedEntities.AddRange(doObjectSensor(ts));
             }

             lock (SenseLock)
             {
-                if (SensedObjects.Length == 0)
+                if (sensedEntities.Count == 0)
                 {
                     // send a "no_sensor"
                     // Add it to queue
@@ -201,9 +223,9 @@
                 }
                 else
                 {
-                    // the sort is stride = 2 and ascending to get everything ordered by distance
-                    SensedObjects = SensedObjects.Sort(2, 1);
-                    int count = SensedObjects.Length;
+                    // Sort the list to get everything ordered by distance
+                    sensedEntities.Sort();
+                    int count = sensedEntities.Count;
                     int idx;
                     List<DetectParams> detected = new List<DetectParams>();
                     for (idx = 0; idx < count; idx++)
@@ -211,7 +233,7 @@
                         try
                         {
                             DetectParams detect = new DetectParams();
-                            detect.Key = (UUID)(SensedObjects.Data[(idx * 2) + 1]);
+                            detect.Key = sensedEntities[idx].itemID;
                             detect.Populate(m_CmdManager.m_ScriptEngine.World);
                             detected.Add(detect);
                         }
@@ -244,9 +266,10 @@
             }
         }

-        private void doObjectSensor(SenseRepeatClass ts, LSL_Types.list SensedObjects)
+        private List<SensedEntity> doObjectSensor(SenseRepeatClass ts)
         {
             List<EntityBase> Entities;
+            List<SensedEntity> sensedEntities = new List<SensedEntity>();

             // If this is an object sense by key try to get it directly
             // rather than getting a list to scan through
@@ -255,7 +278,7 @@
                 EntityBase e = null;
                 m_CmdManager.m_ScriptEngine.World.Entities.TryGetValue(ts.keyID, out e);
                 if (e == null)
-                    return;
+                    return sensedEntities;
                 Entities = new List<EntityBase>();
                 Entities.Add(e);
             }
@@ -266,7 +289,16 @@
             SceneObjectPart SensePoint = ts.host;

             Vector3 fromRegionPos = SensePoint.AbsolutePosition;
+
+            // pre define some things to avoid repeated definitions in the loop body
             Vector3 toRegionPos;
+            double dis;
+            int objtype;
+            SceneObjectPart part;
+            float dx;
+            float dy;
+            float dz;
+
             Quaternion q = SensePoint.RotationOffset;
             LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
             LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
@@ -289,13 +321,26 @@
                 if (!(ent is SceneObjectGroup)) // dont bother if it is a pesky avatar
                     continue;
                 toRegionPos = ent.AbsolutePosition;
-                double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos));
+
+                // Calculation is in line for speed
+                dx = toRegionPos.X - fromRegionPos.X;
+                dy = toRegionPos.Y - fromRegionPos.Y;
+                dz = toRegionPos.Z - fromRegionPos.Z;
+
+                // Weed out those that will not fit in a cube the size of the range
+                // no point calculating if they are within a sphere the size of the range
+                // if they arent even in the cube
+                if (Math.Abs(dx) > ts.range || Math.Abs(dy) > ts.range || Math.Abs(dz) > ts.range)
+                    dis = ts.range + 1.0;
+                else
+                    dis = Math.Sqrt(dx * dx + dy * dy + dz * dz);
+
                 if (keep && dis <= ts.range && ts.host.UUID != ent.UUID)
                 {
                     // In Range and not the object containing the script, is it the right Type ?
-                    int objtype = 0;
-
-                    SceneObjectPart part = ((SceneObjectGroup)ent).RootPart;
+                    objtype = 0;
+
+                    part = ((SceneObjectGroup)ent).RootPart;
                     if (part.AttachmentPoint != 0) // Attached so ignore
                         continue;

@@ -347,17 +392,18 @@
                         if (keep == true)
                         {
                             // add distance for sorting purposes later
-                            SensedObjects.Add(new LSL_Types.LSLFloat(dis));
-                            SensedObjects.Add(ent.UUID);
-                        }
-                    }
-                }
-            }
-        }
-
-        private void doAgentSensor(SenseRepeatClass ts, LSL_Types.list SensedObjects)
+                            sensedEntities.Add(new SensedEntity(dis, ent.UUID));
+                        }
+                    }
+                }
+            }
+            return sensedEntities;
+        }
+
+        private List<SensedEntity> doAgentSensor(SenseRepeatClass ts)
         {
             List<ScenePresence> Presences;
+            List<SensedEntity> sensedEntities = new List<SensedEntity>();

             // If this is an avatar sense by key try to get them directly
             // rather than getting a list to scan through
@@ -365,7 +411,7 @@
             {
                 ScenePresence p = m_CmdManager.m_ScriptEngine.World.GetScenePresence(ts.keyID);
                 if (p == null)
-                    return;
+                    return sensedEntities;
                 Presences = new List<ScenePresence>();
                 Presences.Add(p);
             }
@@ -376,7 +422,7 @@

             // If nobody about quit fast
             if (Presences.Count == 0)
-                return;
+                return sensedEntities;

             SceneObjectPart SensePoint = ts.host;

@@ -390,6 +436,7 @@
             bool attached = (SensePoint.AttachmentPoint != 0);
             bool nameSearch = (ts.name != null && ts.name != "");
             Vector3 toRegionPos;
+            double dis;

             foreach (ScenePresence presence in Presences)
             {
@@ -402,7 +449,7 @@
                     keep = false;
                 toRegionPos = presence.AbsolutePosition;

-                double dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos));
+                dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos));

                 // are they in range
                 if (keep && dis <= ts.range)
@@ -452,14 +499,14 @@

                 if (keep) // add to list with distance
                 {
-                    SensedObjects.Add(new LSL_Types.LSLFloat(dis));
-                    SensedObjects.Add(presence.UUID);
+                    sensedEntities.Add(new SensedEntity(dis, presence.UUID));
                 }

                 // If this is a search by name and we have just found it then no more to do
                 if (nameSearch && ts.name == presence.Name)
-                    return;
-            }
+                    return sensedEntities;
+            }
+            return sensedEntities;
         }

         public Object[] GetSerializationData(UUID itemID)


添加4群快捷加群按钮

添加4群快捷加群按钮

--- Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Shared/_Layout.cshtml
+++ Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Shared/_Layout.cshtml
@@ -50,8 +50,12 @@
                     Senparc.Weixin.MP.MvcExtension.dll版本：v@(TempData["ExtensionVersion"])

-                    技术交流QQ群：1群：300313885（已满） 2群：293958349（已满）  3群：342319110（已满） 4群：372212092（已满）

-                     5群：377815480
+                    技术交流QQ群：
+                    1群：300313885（已满）
+                    2群：293958349（已满）
+                    3群：342319110（已满）

+                    4群：37221209 （将满）2

+                    5群：377815480

                 @RenderSection("Featured", false)
                 @if (!IsSectionDefined("Featured"))


Exclude Xamarin.Interactive when inspecting assemblies

--- Shared/Realm.Shared/Schema/RealmSchema.cs
+++ Shared/Realm.Shared/Schema/RealmSchema.cs
@@ -136,6 +136,7 @@
                                               #endif
                                               // exclude the Realm assembly
                                               .Where(a => a != typeof(Realm).Assembly)
+                                              .Where(a => !a.GetName().Name.StartsWith("Xamarin.Interactive"))
                                               .SelectMany(a => a.GetTypes())
                                               .Where(t => t.IsSubclassOf(typeof(RealmObject)))
                                               .Where(t => t.GetCustomAttributes(typeof(ExplicitAttribute), false).Length == 0);


Rearranged calls to string.Replace when generating files from templates in ProjectGenerator.cs.

--- Source/Applications/openECA/openECAClient/Template/CSharp/ProjectGenerator.cs
+++ Source/Applications/openECA/openECAClient/Template/CSharp/ProjectGenerator.cs
@@ -285,8 +285,8 @@

             // Write the content of the mapper class file to the target location
             File.WriteAllText(mapperPath, GetTextFromResource("openECAClient.Template.CSharp.MapperTemplate.txt")
-                .Replace("{MappingCode}", builder.ToString().Trim())
-                .Replace("{ProjectName}", m_projectName));
+                .Replace("{ProjectName}", m_projectName)
+                .Replace("{MappingCode}", builder.ToString().Trim()));
         }

         // Writes the file that contains the user's algorithm to the given path.
@@ -307,10 +307,10 @@

             // Write the contents of the user's algorithm class to the class file
             File.WriteAllText(algorithmPath, GetTextFromResource("openECAClient.Template.CSharp.AlgorithmTemplate.txt")
-                .Replace("{OutputType}", outputType.Identifier)
+                .Replace("{Usings}", usings)
+                .Replace("{ProjectName}", m_projectName)
                 .Replace("{InputType}", inputType.Identifier)
-                .Replace("{ProjectName}", m_projectName)
-                .Replace("{Usings}", usings));
+                .Replace("{OutputType}", outputType.Identifier));
         }

         // Writes lines of code to the given string builder for populating the input type.


Fix field name

--- ShopifySharp/Entities/FulfillmentOrder.cs
+++ ShopifySharp/Entities/FulfillmentOrder.cs
@@ -53,7 +53,7 @@
         /// <summary>
         /// A historical record of each item in the fulfillment.
         /// </summary>
-        [JsonProperty("destination")]
+        [JsonProperty("line_items")]
         public IEnumerable<LineItem> LineItems { get; set; }

         /// <summary>


Only perform conversion if type isn't assignable.

--- SignalR.Client/Hubs/HubProxyExtensions.cs
+++ SignalR.Client/Hubs/HubProxyExtensions.cs
@@ -139,7 +139,7 @@
                 return default(T);
             }

-            if (typeof(T) == typeof(string) && obj is string)
+            if (typeof(T).IsAssignableFrom(obj.GetType()))
             {
                 return (T)obj;
             }


파판 서버에서 유효한 패킷이 도착하기만 하면 오버레이 status를 true로 바꿈

--- App/Network.Analyser.cs
+++ App/Network.Analyser.cs
@@ -127,6 +127,9 @@
                     // type == 0x0000 이였던 메시지는 여기서 걸러짐
                     return;
                 }
+
+                mainForm.overlayForm.SetStatus(true);
+
                 var opcode = BitConverter.ToUInt16(message, 18);
                 var data = message.Skip(32).ToArray();

@@ -166,11 +169,7 @@
                 {
                     var type = data[0];

-                    if (type == 0x18)
-                    {
-                        mainForm.overlayForm.SetStatus(true);
-                    }
-                    else if (type == 0x9B)
+                    if (type == 0x9B)
                     {
                         var code = BitConverter.ToUInt16(data, 4);
                         var progress = data[8];


Switch to item wrappers.

Switch to item wrappers.

--- YetAnotherChartComponent/YetAnotherChartComponent/Series/CandlestickSeries.cs
+++ YetAnotherChartComponent/YetAnotherChartComponent/Series/CandlestickSeries.cs
@@ -216,7 +216,7 @@
 		/// <summary>
 		/// Provide item values.
 		/// </summary>
-		public IEnumerable<ISeriesItem> SeriesItemValues => UnwrapItemState(ItemState.AsReadOnly());
+		public IEnumerable<ISeriesItem> SeriesItemValues => WrapItemState(ItemState.AsReadOnly());
 		/// <summary>
 		/// The layer for components.
 		/// </summary>
@@ -306,22 +306,22 @@
 		Legend Legend() {
 			return new Legend() { Title = Title, Fill = PathStyle.Find<Brush>(Path.FillProperty), Stroke = PathStyle.Find<Brush>(Path.StrokeProperty) };
 		}
-		IEnumerable<ISeriesItem> UnwrapItemState(IEnumerable<ItemState<Path>> siss) {
+		IEnumerable<ISeriesItem> WrapItemState(IEnumerable<ItemState<Path>> siss) {
 			foreach (var state in siss) {
 				if(state is SeriesItemState sis) {
 					var sis2 = new ISeriesItemValue[sis.Elements.Length];
 					for (int idx = 0; idx < sis.Elements.Length; idx++) {
-						sis2[idx] = new ItemState<PathFigure>(sis.Index, sis.XValue, sis.XOffset, sis.Elements[idx].Item1, sis.Elements[idx].Item2, idx);
+						sis2[idx] = new ItemStateValueWrapper(sis, sis.Elements[idx].Item1, idx);
 					}
-					var sivc = new ItemStateMultiChannelCore(sis.Index, sis.XValue, sis.XOffset, sis2);
+					var sivc = new ItemStateMultiChannelWrapper(sis, sis2);
 					yield return sivc;
 				}
 				else if(state is SeriesItemState_Custom sisc) {
 					var sis2 = new ISeriesItemValue[sisc.Elements.Length];
 					for (int idx = 0; idx < sisc.Elements.Length; idx++) {
-						sis2[idx] = new ItemStateCustom<PathFigure>(sisc.Index, sisc.XValue, sisc.XOffset, sisc.Elements[idx].Item1, sisc.CustomValue, sisc.Elements[idx].Item2, idx);
+						sis2[idx] = new ItemStateValueCustomWrapper(sisc, sisc.Elements[idx].Item1, sisc.CustomValue, idx);
 					}
-					var sivc = new ItemStateMultiChannelCore(sisc.Index, sisc.XValue, sisc.XOffset, sis2);
+					var sivc = new ItemStateMultiChannelWrapper(sisc, sis2);
 					yield return sivc;
 				}
 			}


Added lock to overflow

Added lock to overflow

--- Applebot/Client/Core.cs
+++ Applebot/Client/Core.cs
@@ -24,16 +24,19 @@

         private void MessageRecievedEventHandler(object sender, Message message)
         {
-            IEnumerable<Command> commands = GetCommandsForPlatform(sender as Platform);
-            Dictionary<Type, DateTime> platformOverflows = _platforms.Find(x => x.Item1 == sender as Platform).Item2;
-            foreach (Command command in commands)
-            {
-                // TODO: Support for elevated user override
-                if (platformOverflows.ContainsKey(command.GetType()) && !(platformOverflows[command.GetType()] < DateTime.UtcNow - command.Overflow))
-                    continue;
-
-                CalculateLeastDerivedMessageHandle(message.GetType(), sender.GetType(), command.GetType()).Invoke(command, new object[] { message, sender });
-                platformOverflows[command.GetType()] = DateTime.UtcNow;
+            lock(_pluginLock)
+            {
+                IEnumerable<Command> commands = GetCommandsForPlatform(sender as Platform);
+                Dictionary<Type, DateTime> platformOverflows = _platforms.Find(x => x.Item1 == sender as Platform).Item2;
+                foreach (Command command in commands)
+                {
+                    // TODO: Support for elevated user override
+                    if (platformOverflows.ContainsKey(command.GetType()) && !(platformOverflows[command.GetType()] < DateTime.UtcNow - command.Overflow))
+                        continue;
+
+                    CalculateLeastDerivedMessageHandle(message.GetType(), sender.GetType(), command.GetType()).Invoke(command, new object[] { message, sender });
+                    platformOverflows[command.GetType()] = DateTime.UtcNow;
+                }
             }
         }


fix deception self 7, salvaging self 7 scrolls (#1950)


whatever, erik

whatever, erik

--- src/csharp/emit-events.cs
+++ src/csharp/emit-events.cs
@@ -12,21 +12,15 @@
 public class Startup
 {
   public Task<object> BindToVideoChannelChanges(Func<object, Task<object>> callback) {
-    System.Console.WriteLine("emit-events:BindToVideoChannelChanges");
-
     var conversation = LyncClient.GetClient().ConversationManager.Conversations.FirstOrDefault();
     var videoChannel = ((AVModality)conversation.Modalities[ModalityTypes.AudioVideo]).VideoChannel;

     videoChannel.ActionAvailabilityChanged += (sender, e) => {
-      System.Console.WriteLine("emit-events:videoChannel:ActionAvailabilityChanged");
       callback(new KeyValuePair<String, Object>("VideoChannel:ActionAvailabilityChanged", e));
-      System.Console.WriteLine("emit-events:videoChannel:ActionAvailabilityChanged after callback");
     };

     videoChannel.StateChanged += (sender, e) => {
-      System.Console.WriteLine("emit-events:videoChannel:StateChanged");
       callback(new KeyValuePair<String, Object>("VideoChannel:StateChanged", e));
-      System.Console.WriteLine("emit-events:videoChannel:StateChanged after callback");
     };

     return null;
@@ -40,10 +34,7 @@
     var videoChannelBound = false;

     avModality.ActionAvailabilityChanged += (sender, e) => {
-      System.Console.WriteLine("emit-events:avModality:ActionAvailabilityChanged");
       callback(new KeyValuePair<String, Object>("AvModality:ActionAvailabilityChanged:", e));
-      System.Console.WriteLine("emit-events:avModality:ActionAvailabilityChanged after callback");
-
       if ( !videoChannelBound && ((AVModality)sender).CanInvoke(ModalityAction.Connect) ) {
         videoChannelBound = true;
         BindToVideoChannelChanges(callback);
@@ -51,9 +42,7 @@
     };

     avModality.ModalityStateChanged += (sender, e) => {
-      System.Console.WriteLine("emit-events:avModality:ModalityStateChanged");
       callback(new KeyValuePair<String, Object>("AvModality:ModalityStateChanged:", e));
-      System.Console.WriteLine("emit-events:avModality:ModalityStateChanged after callback");
     };

     return null;
@@ -65,9 +54,7 @@
     var conversation = LyncClient.GetClient().ConversationManager.Conversations.FirstOrDefault();

     conversation.StateChanged += (sender, e) => {
-      System.Console.WriteLine("emit-events:conversation:StateChanged");
-      callback(new KeyValuePair<String, Object>("Conversation:StateChanged", e));
-      System.Console.WriteLine("emit-events:conversation:StateChanged after callback");
+      callback(new KeyValuePair<String, Object>("Conversation:StateChanged", null));
     };

     return null;
@@ -79,18 +66,13 @@
     var ConversationManager = LyncClient.GetClient().ConversationManager;

     ConversationManager.ConversationAdded += (sender, e) => {
-      System.Console.WriteLine("emit-events:ConversationAdded");
-      callback(new KeyValuePair<String, Object>("ConversationManager:ConversationAdded", e));
-      System.Console.WriteLine("emit-events:ConversationAdded after callback");
-
+      callback(new KeyValuePair<String, Object>("ConversationManager:ConversationAdded", null));
       BindToConversationChanges(callback);
       BindToAvModalityChanges(callback);
     };

     ConversationManager.ConversationRemoved += (sender, e) => {
-      System.Console.WriteLine("emit-events:ConversationRemoved");
-      callback(new KeyValuePair<String, Object>("ConversationManager:ConversationRemoved", e));
-      System.Console.WriteLine("emit-events:ConversationRemoved after callback");
+      callback(new KeyValuePair<String, Object>("ConversationManager:ConversationRemoved", null));
     };

     return null;


SpreadItem fix

SpreadItem fix

--- Source/Devsense.PHP.Parser/Ast/ArrayEx.cs
+++ Source/Devsense.PHP.Parser/Ast/ArrayEx.cs
@@ -221,6 +221,7 @@
         public SpreadItem(Expression expression)
             : base(null)
         {
+            this.Expression = expression;
         }

         public override bool IsByRef => false;