.Core: XmlHelper: Add initial field / property caching

--- FEZ.Mod.mm/FezGame/Mod/XmlHelper.cs
+++ FEZ.Mod.mm/FezGame/Mod/XmlHelper.cs
@@ -27,21 +27,25 @@
 using System.Threading;

 namespace FezGame.Mod {
-    public struct CacheKey_Type_Member {
-        public Type Type;
-        public object Member;
-    }
     public struct CacheKey_Type_NodeName {
         public Type Type;
         public string NodeName;
     }
+    public struct CacheKey_NodeName_AttribName {
+        public string NodeName;
+        public string AttribName;
+    }

     public static class XmlHelper {

         private readonly static Dictionary<string, Type> CacheTypes = new Dictionary<string, Type>();
         private readonly static Dictionary<CacheKey_Type_NodeName, Type> CacheTypesSpecial = new Dictionary<CacheKey_Type_NodeName, Type>();
-        private readonly static Dictionary<CacheKey_Type_Member, FieldInfo> CacheFields = new Dictionary<CacheKey_Type_Member, FieldInfo>();
-        private readonly static Dictionary<CacheKey_Type_Member, MethodInfo> CacheMethods = new Dictionary<CacheKey_Type_Member, MethodInfo>();
+        private readonly static Dictionary<Type, FieldInfo[]> CacheTypesFields = new Dictionary<Type, FieldInfo[]>();
+        private readonly static Dictionary<Type, PropertyInfo[]> CacheTypesProperties = new Dictionary<Type, PropertyInfo[]>();
+        private readonly static Dictionary<CacheKey_Type_NodeName, FieldInfo> CacheFields = new Dictionary<CacheKey_Type_NodeName, FieldInfo>();
+        private readonly static Dictionary<CacheKey_Type_NodeName, PropertyInfo> CacheProperties = new Dictionary<CacheKey_Type_NodeName, PropertyInfo>();
+        private readonly static Dictionary<CacheKey_NodeName_AttribName, FieldInfo> CacheAttribFields = new Dictionary<CacheKey_NodeName_AttribName, FieldInfo>();
+        private readonly static Dictionary<CacheKey_NodeName_AttribName, PropertyInfo> CacheAttribProperties = new Dictionary<CacheKey_NodeName_AttribName, PropertyInfo>();
         private readonly static Dictionary<CacheKey_Type_NodeName, ConstructorInfo> CacheConstructors = new Dictionary<CacheKey_Type_NodeName, ConstructorInfo>();
         private readonly static Dictionary<ConstructorInfo, ParameterInfo[]> CacheConstructorsParameters = new Dictionary<ConstructorInfo, ParameterInfo[]>();

@@ -58,6 +62,8 @@
             typeof(ArtObject) //Thanks for basically everything requiring to be specially parsed...
         };

+        private static CacheKey_Type_NodeName deserialize_key;
+        private static CacheKey_NodeName_AttribName deserialize_key_attrib;
         public static object Deserialize(this XmlNode node, Type parent = null, ContentManager cm = null, bool descend = true) {
             if (FEZMod.OverrideCulturueManualyBecauseMonoIsA_____) {
                 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
@@ -72,7 +78,6 @@
             }

             if (node is XmlDeclaration) {
-                //ModLogger.Log("FEZMod", "XmlHelper found XmlDeclaration; skipping...");
                 return node.NextSibling.Deserialize(parent, cm, descend);
             }

@@ -85,16 +90,32 @@
             Type type = null;

             if (type == null && parent != null) {
-                FieldInfo[] fields = parent.GetFields();
-                foreach (FieldInfo field in fields) {
-                    if (field.Name.ToLower() == node.Name.ToLower()) {
-                        type = field.FieldType;
-                        foreach (XmlNode child in node.ChildNodes) {
-                            if (child.Name.ToLower() == type.Name.ToLower()) {
-                                return child.Deserialize(parent, cm, descend);
-                            }
-                        }
-                        break;
+                FieldInfo field_;
+                deserialize_key.Type = parent;
+                deserialize_key.NodeName = node.Name.ToLower();
+                if (CacheFields.TryGetValue(deserialize_key, out field_)) {
+                    type = field_.FieldType;
+                }
+                if (type == null) {
+                    FieldInfo[] fields;
+                    if (!CacheTypesFields.TryGetValue(parent, out fields)) {
+                        CacheTypesFields[parent] = fields = parent.GetFields();
+                    }
+                    string nodeName = node.Name.ToLower();
+                    foreach (FieldInfo field in fields) {
+                        if (field.Name.ToLower() == nodeName) {
+                            CacheFields[deserialize_key] = field;
+                            type = field.FieldType;
+                            break;
+                        }
+                    }
+                }
+                if (type != null) {
+                    string typeName = type.Name.ToLower();
+                    foreach (XmlNode child in node.ChildNodes) {
+                        if (child.Name.ToLower() == typeName) {
+                            return child.Deserialize(parent, cm, descend);
+                        }
                     }
                 }
             }
@@ -104,16 +125,32 @@
             }

             if (type == null && parent != null) {
-                PropertyInfo[] properties = parent.GetProperties();
-                foreach (PropertyInfo property in properties) {
-                    if (property.Name.ToLower() == node.Name.ToLower()) {
-                        type = property.PropertyType;
-                        foreach (XmlNode child in node.ChildNodes) {
-                            if (child.Name.ToLower() == type.Name.ToLower()) {
-                                return child.Deserialize(parent, cm, descend);
-                            }
-                        }
-                        break;
+                PropertyInfo property_;
+                deserialize_key.Type = parent;
+                deserialize_key.NodeName = node.Name.ToLower();
+                if (CacheProperties.TryGetValue(deserialize_key, out property_)) {
+                    type = property_.PropertyType;
+                }
+                if (type == null) {
+                    PropertyInfo[] properties;
+                    if (!CacheTypesProperties.TryGetValue(parent, out properties)) {
+                        CacheTypesProperties[parent] = properties = parent.GetProperties();
+                    }
+                    string nodeName = node.Name.ToLower();
+                    foreach (PropertyInfo property in properties) {
+                        if (property.Name.ToLower() == node.Name.ToLower()) {
+                            CacheProperties[deserialize_key] = property;
+                            type = property.PropertyType;
+                            break;
+                        }
+                    }
+                }
+                if (type != null) {
+                    string typeName = type.Name.ToLower();
+                    foreach (XmlNode child in node.ChildNodes) {
+                        if (child.Name.ToLower() == typeName) {
+                            return child.Deserialize(parent, cm, descend);
+                        }
                     }
                 }
             }
@@ -138,7 +175,6 @@
                 }
                 return node.InnerText;
             } else {
-                //ModLogger.Log("FEZMod", "elem: " + elem.Name + "; type: " + type.FullName);
                 type = Nullable.GetUnderlyingType(type) ?? type;
             }

@@ -165,10 +201,28 @@
             XmlAttributeCollection attribs = node.Attributes;

             foreach (XmlAttribute attrib in attribs) {
-                FieldInfo[] fields = type.GetFields();
+                deserialize_key_attrib.NodeName = node.Name;
+                deserialize_key_attrib.AttribName = attrib.Name.ToLower();
+
+                FieldInfo field_;
+                if (CacheAttribFields.TryGetValue(deserialize_key_attrib, out field_)) {
+                    field_.SetValue(obj, field_.FieldType.Parse(attrib.InnerText));
+                    continue;
+                }
+
+                PropertyInfo property_;
+                if (CacheAttribProperties.TryGetValue(deserialize_key_attrib, out property_)) {
+                    property_.SetValue(obj, property_.PropertyType.Parse(attrib.InnerText), null);
+                    continue;
+                }
+
+                FieldInfo[] fields;
+                if (!CacheTypesFields.TryGetValue(type, out fields)) {
+                    CacheTypesFields[type] = fields = type.GetFields();
+                }
                 foreach (FieldInfo field in fields) {
-                    if (field.Name.ToLower() == attrib.Name.ToLower()) {
-                        //ModLogger.Log("FEZMod", "field: " + field.Name + "; type: " + field.FieldType.FullName + "; in: " + type.FullName + "; attrib: " + attrib.Name+ "; content: " + attrib.InnerText + "; elem: " + elem.Name);
+                    if (field.Name.ToLower() == deserialize_key_attrib.AttribName) {
+                        CacheAttribFields[deserialize_key_attrib] = field;
                         field.SetValue(obj, field.FieldType.Parse(attrib.InnerText));
                         fields = null;
                         break;
@@ -178,23 +232,18 @@
                     continue;
                 }

-                PropertyInfo[] properties = type.GetProperties();
+                PropertyInfo[] properties;
+                if (!CacheTypesProperties.TryGetValue(type, out properties)) {
+                    CacheTypesProperties[type] = properties = type.GetProperties();
+                }
                 foreach (PropertyInfo property in properties) {
                     if (property.Name.ToLower() == attrib.Name.ToLower()) {
-                        MethodInfo setter = property.GetSetMethod();
-                        if (setter == null) {
+                        if (!property.CanWrite) {
                             ModLogger.Log("FEZMod", "XmlHelper found no setter for Property " + attrib.Name + " in " + type.FullName);
                             continue;
                         }
-                        //ModLogger.Log("FEZMod", "property: " + property.Name + "; type: " + property.PropertyType.FullName + "; in: " + type.FullName + "; attrib: " + attrib.Name+ "; content: " + attrib.InnerText + "; elem: " + elem.Name);
-                        object obj_ = property.PropertyType.Parse(attrib.InnerText);
-                        try {
-                            setter.Invoke(obj, new object[] { obj_ });
-                        } catch (Exception e) {
-                            ModLogger.Log("FEZMod", "XmlHelper failed to set property Property " + property.Name + " in " + type.FullName);
-                            ModLogger.Log("FEZMod", e.Message);
-                            ModLogger.Log("FEZMod", obj_.GetType().FullName);
-                        }
+                        CacheAttribProperties[deserialize_key_attrib] = property;
+                        property.SetValue(obj, property.PropertyType.Parse(attrib.InnerText), null);
                         properties = null;
                         break;
                     }
@@ -304,7 +353,10 @@

                         Type childType = child.Name.FindSpecialType(type);

-                        FieldInfo[] fields = type.GetFields();
+                        FieldInfo[] fields;
+                        if (!CacheTypesFields.TryGetValue(type, out fields)) {
+                            CacheTypesFields[type] = fields = type.GetFields();
+                        }
                         foreach (FieldInfo field in fields) {
                             if (field.Name.ToLower() == child.Name.ToLower() || field.FieldType.IsAssignableFrom(childType)) {
                                 field.SetValue(obj, child.Deserialize(type, cm));
@@ -867,7 +919,10 @@
                 }
             }

-            FieldInfo[] fields = type.GetFields();
+            FieldInfo[] fields;
+            if (!CacheTypesFields.TryGetValue(type, out fields)) {
+                CacheTypesFields[type] = fields = type.GetFields();
+            }
             for (int i = 0; i < fields.Length; i++) {
                 FieldInfo field = fields[i];
                 if (field.IsInitOnly ||


Fix 32856 (cherry picked from commit 0316c671a56ac3a1bf323579f051ee44ee493d1e)

--- Languages/IronPython/IronPython/Compiler/Tokenizer.cs
+++ Languages/IronPython/IronPython/Compiler/Tokenizer.cs
@@ -1494,8 +1494,8 @@
         }

         internal static bool TryGetEncoding(Encoding defaultEncoding, string line, ref Encoding enc, out string encName) {
-            // encoding is "# coding: <encoding name>
-            // minimum length is 18
+            // PEP 0263 defines the following regex for the encoding line
+            // coding[:=]\s*([-\w.]+)
             encName = null;
             if (line.Length < 10) return false;
             if (line[0] != '#') return false;
@@ -1504,6 +1504,7 @@
             int codingIndex;
             if ((codingIndex = line.IndexOf("coding")) == -1) return false;
             if (line.Length <= (codingIndex + 6)) return false;
+            // [:=]
             if (line[codingIndex + 6] != ':' && line[codingIndex + 6] != '=') return false;

             // it contains coding: or coding=
@@ -1518,8 +1519,9 @@
             if (encodingStart == line.Length) return false;

             int encodingEnd = encodingStart;
+            // ([-\w.]+)
             while (encodingEnd < line.Length) {
-                if (Char.IsWhiteSpace(line[encodingEnd])) break;
+                if (line[encodingEnd] != '-' && line[encodingEnd] != '.' && !Char.IsLetterOrDigit(line[encodingEnd])) break;

                 encodingEnd++;
             }


Removed unneeded 'ref' declarations

Removed unneeded 'ref' declarations

--- Libraries/Farmhand/API/Locations/LocationUtilities.cs
+++ Libraries/Farmhand/API/Locations/LocationUtilities.cs
@@ -78,13 +78,13 @@
                 Map mergedMap = new Map(baseMap.Id);

                 // Merge the tilsheets
-                MergeTileSheets(ref mergedMap, baseMap, injectedMaps);
+                MergeTileSheets(mergedMap, baseMap, injectedMaps);

                 // Merge the layers
-                MergeLayers(ref mergedMap, baseMap, injectedMaps);
+                MergeLayers(mergedMap, baseMap, injectedMaps);

                 // Merge map properties from the base
-                MergeMapProperties(ref mergedMap, baseMap, injectedMaps);
+                MergeMapProperties(mergedMap, baseMap, injectedMaps);

                 // Return the finished, merged map
                 return mergedMap;
@@ -97,7 +97,7 @@
         }

         // Merge the tilesheets from a baseMap and an array of injectedMaps into a mergedMap
-        private static void MergeTileSheets(ref Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
+        private static void MergeTileSheets(Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
         {
             foreach (TileSheet baseSheet in baseMap.TileSheets)
             {
@@ -153,7 +153,7 @@
         }

         // Merge the layers from a baseMap and several injectedMaps into a mergedMap
-        private static void MergeLayers(ref Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
+        private static void MergeLayers(Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
         {
             // Find the largest layer size among all injecting maps, and use that value
             xTile.Dimensions.Size largestLayerSize = GetLargestLayerSize(baseMap, injectedMaps);
@@ -336,7 +336,7 @@
         }

         // Merge the map properties from a baseMap and an array of injectedMaps into a mergedMap
-        private static void MergeMapProperties(ref Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
+        private static void MergeMapProperties(Map mergedMap, Map baseMap, MapInformation[] injectedMaps)
         {
             List<IPropertyCollection> propertyInjectingMaps = new List<IPropertyCollection>();
             foreach (var map in injectedMaps)


.Droid: Further polish movement controls

--- FEZ.Mod.mm/FezGame/Droid/FezDroidComponent.cs
+++ FEZ.Mod.mm/FezGame/Droid/FezDroidComponent.cs
@@ -195,10 +195,16 @@

                 if (dragTouchId == tl.Id) {
                     Drag = (tl.Position - TouchOrigins[tl.Id]);
-                    Drag.Y = -Drag.Y; //Y == 0 is top, not bottom
                     Drag.X *= 2f / FezDroid.TouchWidth;
                     Drag.Y *= 2f / FezDroid.TouchHeight;
                     if (DragMode == DragMode.Move) {
+                        Drag.Y = -Drag.Y; //Movement logic!
+
+                        //Fake "deadzone"
+                        Drag.X = Math.Sign(Drag.X) * Math.Abs(Drag.X - 0.13f);
+                        Drag.Y = Math.Sign(Drag.Y) * Math.Abs(Drag.Y - 0.13f);
+
+                        //The player shouldn't drag across the whole screen just to move Gomez...
                         Drag *= 4f;
                     }
                 } else {
@@ -219,10 +225,10 @@
                 } else if (Drag.X >= 1f) {
                     CodeInputAll.Right.Press();
                 }
-                if (Drag.Y <= -1f) {
+                if (Drag.Y <= -0.78f) {
+                    CodeInputAll.Down.Press();
+                } else if (Drag.Y >= 1f) {
                     CodeInputAll.Up.Press();
-                } else if (Drag.Y >= 1f) {
-                    CodeInputAll.Down.Press();
                 }
             }
         }


bug fix

bug fix

--- Libraries/TestingServices/Engines/BugFindingEngine.cs
+++ Libraries/TestingServices/Engines/BugFindingEngine.cs
@@ -511,41 +511,36 @@
                     report.AppendLine();
                 }

-                if (base.TestReport.MinExploredFairSteps >= 0 ||
-                    base.TestReport.MinExploredFairSteps >= 0 ||
-                    base.TestReport.MaxExploredFairSteps >= 0)
+                if (base.TestReport.NumOfExploredFairSchedules > 0)
                 {
                     report.AppendFormat("{0} Statistics from fair terminating schedules:",
                         prefix);
                     report.AppendLine();
-                }
-
-                if (base.TestReport.MinExploredFairSteps >= 0)
-                {
-                    int averageExploredSteps = base.TestReport.TotalExploredFairSteps /
+
+                    int averageExploredFairSteps = base.TestReport.TotalExploredFairSteps /
                         base.TestReport.NumOfExploredFairSchedules;
                     report.AppendFormat("{0} Instrumented {1} scheduling point{2} (on average).",
                         prefix.Equals("...") ? "....." : prefix,
-                        averageExploredSteps, averageExploredSteps == 1 ? "" : "s");
+                        averageExploredFairSteps, averageExploredFairSteps == 1 ? "" : "s");
                     report.AppendLine();
-                }
-
-                if (base.TestReport.MinExploredFairSteps >= 0)
-                {
-                    report.AppendFormat("{0} Instrumented {1} scheduling point{2} (min).",
-                        prefix.Equals("...") ? "....." : prefix,
-                        base.TestReport.MinExploredFairSteps < 0 ? 0 : base.TestReport.MinExploredFairSteps,
-                        base.TestReport.MinExploredFairSteps == 1 ? "" : "s");
-                    report.AppendLine();
-                }
-
-                if (base.TestReport.MaxExploredFairSteps >= 0)
-                {
-                    report.AppendFormat("{0} Instrumented {1} scheduling point{2} (max).",
-                        prefix.Equals("...") ? "....." : prefix,
-                        base.TestReport.MaxExploredFairSteps,
-                        base.TestReport.MaxExploredFairSteps == 1 ? "" : "s");
-                    report.AppendLine();
+
+                    if (base.TestReport.MinExploredFairSteps >= 0)
+                    {
+                        report.AppendFormat("{0} Instrumented {1} scheduling point{2} (min).",
+                            prefix.Equals("...") ? "....." : prefix,
+                            base.TestReport.MinExploredFairSteps < 0 ? 0 : base.TestReport.MinExploredFairSteps,
+                            base.TestReport.MinExploredFairSteps == 1 ? "" : "s");
+                        report.AppendLine();
+                    }
+
+                    if (base.TestReport.MaxExploredFairSteps >= 0)
+                    {
+                        report.AppendFormat("{0} Instrumented {1} scheduling point{2} (max).",
+                            prefix.Equals("...") ? "....." : prefix,
+                            base.TestReport.MaxExploredFairSteps,
+                            base.TestReport.MaxExploredFairSteps == 1 ? "" : "s");
+                        report.AppendLine();
+                    }
                 }
             }


Corrected parameter to use correct keyword

--- GoogleMapsApi/Entities/Places/Request/PlacesRequest.cs
+++ GoogleMapsApi/Entities/Places/Request/PlacesRequest.cs
@@ -99,7 +99,7 @@
 			if (Radius.HasValue)
 				parameters.Add("radius", Radius.Value.ToString(CultureInfo.InvariantCulture));
 			if (!string.IsNullOrWhiteSpace(Keyword))
-				parameters.Add("radius", Keyword);
+                parameters.Add("keyword", Keyword);
 			if (!string.IsNullOrWhiteSpace(Language))
 				parameters.Add("language", Language);
 			if (!string.IsNullOrWhiteSpace(Types))


Update src/Features/Lsif/Generator/Program.cs

Co-authored-by: Jason Malinowski <68c46a606457643eab92053c1c05574abb26f861@jason-m.com>

--- src/Features/Lsif/Generator/Program.cs
+++ src/Features/Lsif/Generator/Program.cs
@@ -135,7 +135,7 @@

             var solution = await openAsync(msbuildWorkspace);

-            await logFile.WriteLineAsync($"Load of the solution completed in {solutionLoadStopwatch.Elapsed.ToDisplayString()}.");
+            await logFile.WriteLineAsync($"Load completed in {solutionLoadStopwatch.Elapsed.ToDisplayString()}.");
             var lsifGenerator = new Generator(lsifWriter);

             var totalTimeInGenerationAndCompilationFetchStopwatch = Stopwatch.StartNew();


Refactored: 改行の調整。

Refactored: 改行の調整。

--- Implem.Pleasanter/Libraries/HtmlParts/HtmlTemplates.cs
+++ Implem.Pleasanter/Libraries/HtmlParts/HtmlTemplates.cs
@@ -140,10 +140,7 @@
         }

         private static HtmlBuilder Title(
-            this HtmlBuilder hb,
-            Permissions.Types pt,
-            long siteId,
-            string text)
+            this HtmlBuilder hb, Permissions.Types pt, long siteId, string text)
         {
             if (text != string.Empty)
             {


DeepPointer: make DerefOffsets public & output final address directly

--- LiveSplit/LiveSplit.Core/ComponentUtil/DeepPointer.cs
+++ LiveSplit/LiveSplit.Core/ComponentUtil/DeepPointer.cs
@@ -42,10 +42,9 @@

         public bool Deref<T>(Process process, out T value) where T : struct
         {
-            OffsetT offset = _offsets[_offsets.Count - 1];
             IntPtr ptr;
             if (!DerefOffsets(process, out ptr)
-                || !process.ReadValue(ptr + offset, out value))
+                || !process.ReadValue(ptr, out value))
             {
                 value = default(T);
                 return false;
@@ -64,10 +63,9 @@

         public bool DerefBytes(Process process, int count, out byte[] value)
         {
-            OffsetT offset = _offsets[_offsets.Count - 1];
             IntPtr ptr;
             if (!DerefOffsets(process, out ptr)
-                || !process.ReadBytes(ptr + offset, count, out value))
+                || !process.ReadBytes(ptr, count, out value))
             {
                 value = null;
                 return false;
@@ -116,17 +114,16 @@

         public bool DerefString(Process process, ReadStringType type, StringBuilder sb)
         {
-            OffsetT offset = _offsets[_offsets.Count - 1];
             IntPtr ptr;
             if (!DerefOffsets(process, out ptr)
-                || !process.ReadString(ptr + offset, type, sb))
-            {
-                return false;
-            }
-            return true;
-        }
-
-        bool DerefOffsets(Process process, out IntPtr ptr)
+                || !process.ReadString(ptr, type, sb))
+            {
+                return false;
+            }
+            return true;
+        }
+
+        public bool DerefOffsets(Process process, out IntPtr ptr)
         {
             bool is64Bit = process.Is64Bit();

@@ -157,6 +154,7 @@
                 }
             }

+            ptr += _offsets[_offsets.Count - 1];
             return true;
         }
     }


Refactor string and character literal display for readability.

--- src/Fixie/Internal/ObjectExtensions.cs
+++ src/Fixie/Internal/ObjectExtensions.cs
@@ -12,33 +12,33 @@
                 return "null";

             if (parameter is char)
-            {
-                var ch = (char)parameter;
-                return "'" + ch.Escape(Literal.Character) + "'";
-            }
+                return CharacterLiteral((char)parameter);

             var s = parameter as string;
             if (s != null)
-            {
-                const int trimLength = 15;
-
-                if (s.Length > trimLength)
-                    return "\"" + s.Substring(0, trimLength).Escape() + "...\"";
-
-                return "\"" + s.Escape() + "\"";
-            }
+                return ShortStringLiteral(s);

             return Convert.ToString(parameter, CultureInfo.InvariantCulture);
         }

-        static string Escape(this string s)
+        static string CharacterLiteral(char ch)
         {
+            return "'" + ch.Escape(Literal.Character) + "'";
+        }
+
+        static string ShortStringLiteral(string s)
+        {
+            const int trimLength = 15;
+
+            if (s.Length > trimLength)
+                s = s.Substring(0, trimLength) + "...";
+
             var sb = new StringBuilder();

             foreach (var ch in s)
                 sb.Append(ch.Escape(Literal.String));

-            return sb.ToString();
+            return "\"" + sb + "\"";
         }

         static string Escape(this char ch, Literal literal)


Line endings fix

Line endings fix

--- src/FluentMigrator.NAnt/MigrateTask.cs
+++ src/FluentMigrator.NAnt/MigrateTask.cs
@@ -1,140 +1,140 @@
-#region License
-
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#endregion
-
-using System;
-using System.IO;
-using FluentMigrator.Runner;
-using FluentMigrator.Runner.Announcers;
-using FluentMigrator.Runner.Extensions;
-using FluentMigrator.Runner.Initialization;
-using NAnt.Core;
-using NAnt.Core.Attributes;
-
-namespace FluentMigrator.NAnt
-{
-    [TaskName("migrate")]
-    public class MigrateTask : Task
-    {
-        [TaskAttribute("context")]
-        public string ApplicationContext { get; set; }
-
-        [TaskAttribute("database")]
-        public string Database { get; set; }
-
-        [TaskAttribute("connection")]
-        public string Connection { get; set; }
-
-        [TaskAttribute("target")]
-        public string Target { get; set; }
-
-        [TaskAttribute("namespace")]
-        public string Namespace { get; set; }
-
-        [TaskAttribute("task")]
-        public string Task { get; set; }
-
-        [TaskAttribute("to")]
-        public long Version { get; set; }
-
-        [TaskAttribute("steps")]
-        public int Steps { get; set; }
-
-        [TaskAttribute("workingdirectory")]
-        public string WorkingDirectory { get; set; }
-
-        [TaskAttribute("profile")]
-        public string Profile { get; set; }
-
-        [TaskAttribute("tags")]
-        public string Tags { get; set; }
-
-        [TaskAttribute("timeout")]
-        public int Timeout { get; set; }
-
-        [TaskAttribute("output")]
-        public bool Output { get; set; }
-
-        [TaskAttribute("outputfilename")]
-        public string OutputFilename { get; set; }
-
-        [TaskAttribute("preview")]
-        public bool Preview { get; set; }
-
-        protected override void ExecuteTask()
-        {
-            IAnnouncer announcer = new ConsoleAnnouncer
-                                {
-                                    ShowElapsedTime = Verbose,
-                                    ShowSql = Verbose
-                                };
-
-            StreamWriter outputWriter = null;
-            if (Output)
-            {
-                if (string.IsNullOrEmpty(OutputFilename))
-                    OutputFilename = Path.GetFileName(Target) + ".sql";
-
-                outputWriter = new StreamWriter(OutputFilename);
-                var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
-                {
-                    ShowElapsedTime = false,
-                    ShowSql = true
-                };
-
-                announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
-            }
-
-            var runnerContext = new RunnerContext(announcer)
-                                    {
-                                        ApplicationContext = ApplicationContext,
-                                        Database = Database,
-                                        Connection = Connection,
-                                        Target = Target,
-                                        PreviewOnly = Preview,
-                                        Namespace = Namespace,
-                                        Task = Task,
-                                        Version = Version,
-                                        Steps = Steps,
-                                        WorkingDirectory = WorkingDirectory,
-                                        Profile = Profile,
-                                        Tags = Tags.ToTags(),
-                                        Timeout = Timeout
-                                    };
-
-            try
-            {
-                new TaskExecutor(runnerContext).Execute();
-            }
-            catch (ProcessorFactoryNotFoundException ex)
-            {
+#region License
+
+// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.IO;
+using FluentMigrator.Runner;
+using FluentMigrator.Runner.Announcers;
+using FluentMigrator.Runner.Extensions;
+using FluentMigrator.Runner.Initialization;
+using NAnt.Core;
+using NAnt.Core.Attributes;
+
+namespace FluentMigrator.NAnt
+{
+    [TaskName("migrate")]
+    public class MigrateTask : Task
+    {
+        [TaskAttribute("context")]
+        public string ApplicationContext { get; set; }
+
+        [TaskAttribute("database")]
+        public string Database { get; set; }
+
+        [TaskAttribute("connection")]
+        public string Connection { get; set; }
+
+        [TaskAttribute("target")]
+        public string Target { get; set; }
+
+        [TaskAttribute("namespace")]
+        public string Namespace { get; set; }
+
+        [TaskAttribute("task")]
+        public string Task { get; set; }
+
+        [TaskAttribute("to")]
+        public long Version { get; set; }
+
+        [TaskAttribute("steps")]
+        public int Steps { get; set; }
+
+        [TaskAttribute("workingdirectory")]
+        public string WorkingDirectory { get; set; }
+
+        [TaskAttribute("profile")]
+        public string Profile { get; set; }
+
+        [TaskAttribute("tags")]
+        public string Tags { get; set; }
+
+        [TaskAttribute("timeout")]
+        public int Timeout { get; set; }
+
+        [TaskAttribute("output")]
+        public bool Output { get; set; }
+
+        [TaskAttribute("outputfilename")]
+        public string OutputFilename { get; set; }
+
+        [TaskAttribute("preview")]
+        public bool Preview { get; set; }
+
+        protected override void ExecuteTask()
+        {
+            IAnnouncer announcer = new ConsoleAnnouncer
+                                {
+                                    ShowElapsedTime = Verbose,
+                                    ShowSql = Verbose
+                                };
+
+            StreamWriter outputWriter = null;
+            if (Output)
+            {
+                if (string.IsNullOrEmpty(OutputFilename))
+                    OutputFilename = Path.GetFileName(Target) + ".sql";
+
+                outputWriter = new StreamWriter(OutputFilename);
+                var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
+                {
+                    ShowElapsedTime = false,
+                    ShowSql = true
+                };
+
+                announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
+            }
+
+            var runnerContext = new RunnerContext(announcer)
+                                    {
+                                        ApplicationContext = ApplicationContext,
+                                        Database = Database,
+                                        Connection = Connection,
+                                        Target = Target,
+                                        PreviewOnly = Preview,
+                                        Namespace = Namespace,
+                                        Task = Task,
+                                        Version = Version,
+                                        Steps = Steps,
+                                        WorkingDirectory = WorkingDirectory,
+                                        Profile = Profile,
+                                        Tags = Tags.ToTags(),
+                                        Timeout = Timeout
+                                    };
+
+            try
+            {
+                new TaskExecutor(runnerContext).Execute();
+            }
+            catch (ProcessorFactoryNotFoundException ex)
+            {
                 announcer.Error("While executing migrations the following error was encountered: {0}", ex.Message);
             	throw;
-            }
-            catch (Exception e)
-            {
+            }
+            catch (Exception e)
+            {
                 announcer.Error("While executing migrations the following error was encountered: {0}, {1}", e.Message, e.StackTrace);
             	throw;
-            }
-            finally
-            {
-                if (outputWriter != null)
-                    outputWriter.Dispose();
-            }
-        }
-    }
-}
+            }
+            finally
+            {
+                if (outputWriter != null)
+                    outputWriter.Dispose();
+            }
+        }
+    }
+}


Model updated

Model updated

--- MailChimp.Api.Net/Domain/Campaigns/ContentTemplate.cs
+++ MailChimp.Api.Net/Domain/Campaigns/ContentTemplate.cs
@@ -8,7 +8,7 @@
 {
     public class ContentTemplate
     {
-        public string id { get; set; }
+        public int id { get; set; }
         //One more property needs to be added , chk documentation for details
     }


Add support for Unmarried/Never married death date

--- FTAnalyser/SharedAssemblyVersion.cs
+++ FTAnalyser/SharedAssemblyVersion.cs
@@ -8,7 +8,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------

-[assembly: System.Reflection.AssemblyInformationalVersion("1.2.0.f8952b97")]
+[assembly: System.Reflection.AssemblyInformationalVersion("1.2.0.eabc2527")]
 [assembly: System.Reflection.AssemblyVersion("1.2.0")]
 [assembly: System.Reflection.AssemblyFileVersion("1.2.0")]


Reverted modification in SystemAccessibleObject.Visible (due to incompatibility with Google Chrome)
- now 'Visible' only check state INVISIBLE (as it was before rev.142)
- new method 'IsState()' can be used to check any state (e.g. OFFSCREEN) e.g. for tabs in Firefox Quantum v.57
- catch NullReferenceException in 'State' (e.g. sometimes caused by IBM Notes)

git-svn-id: fa3a2bdc379e73ecdff7fca48ca7db9c12a32dab@143 fd7b8004-de1b-0410-9a54-a0c85bd34932

--- ManagedWinapi/Accessibility/SystemAccessibleObject.cs
+++ ManagedWinapi/Accessibility/SystemAccessibleObject.cs
@@ -327,6 +327,10 @@
                 {
                     return 0;
                 }
+                catch (NullReferenceException)
+                {
+                    return 0;
+                }
             }
         }

@@ -348,9 +352,16 @@
         {
             get
             {
-                return (State & (int)AccStates.STATE_SYSTEM_INVISIBLE) == 0
-                    && (State & (int)AccStates.STATE_SYSTEM_OFFSCREEN) == 0;
-            }
+                return (State & (int)AccStates.STATE_SYSTEM_INVISIBLE) == 0;
+            }
+        }
+
+        /// <summary>
+        /// Whether this accessibile state is set.
+        /// </summary>
+        public bool IsState(AccStates state)
+        {
+            return (State & (int)state) > 0;
         }

         /// <summary>


Switch to using File URI for screenshots from PhantomJS

--- FluentAutomation.PhantomJS/CommandProvider.cs
+++ FluentAutomation.PhantomJS/CommandProvider.cs
@@ -239,7 +239,7 @@
             this.phantomConnection.Send(JsonConvert.SerializeObject(new { Action = "TakeScreenshot", FileName = screenshotName }));
             this.waitForPhantomReady();

-            this.fileStoreProvider.SaveScreenshot(Convert.FromBase64String(this.phantomStringResult), screenshotName);
+            this.fileStoreProvider.SaveScreenshot(File.ReadAllBytes(this.phantomStringResult), screenshotName);
         }

         public void UploadFile(Func<IElement> element, int x, int y, string fileName)


Fixes robinrodricks/FluentFTP#861 For Windows Server IIS, the space at the beginning of the file name is excluded

--- FluentFTP/Helpers/Parsers/FtpWindowsParser.cs
+++ FluentFTP/Helpers/Parsers/FtpWindowsParser.cs
@@ -108,7 +108,7 @@
 				//03-24-22  09:50AM       <DIR>          TestSubDirectory01
 				//03-24-22  09:50AM                   31 TextFileA.txt
 				//---------------------------------------
-				name = isDir ? record.Substring(pos + 10) : record.Substring(pos + 1);
+				name = isDir ? record.Substring(pos + OffsetLengthDirectory) : record.Substring(pos + OffsetLengthFile);
 			}
 			else {
 				client.LogStatus(FtpTraceLevel.Error, "Failed to retrieve name: " + record);
@@ -156,6 +156,8 @@
 		private static string DirectoryMarker = "<DIR>";
 		private static int MinFieldCount = 4;
 		private static string[] DateTimeFormats = {"MM'-'dd'-'yy hh':'mmtt", "MM'-'dd'-'yy HH':'mm", "MM'-'dd'-'yyyy hh':'mmtt"};
+		private static int OffsetLengthDirectory = 10;
+		private static int OffsetLengthFile = 1;

 		#endregion
 	}


updated the property container

updated the property container

--- Fallen-8/Model/PropertyContainer.cs
+++ Fallen-8/Model/PropertyContainer.cs
@@ -41,7 +41,7 @@
         /// <value>
         /// The property identifier.
         /// </value>
-        public Int64 PropertyId { get; private set; }
+        public Int32 PropertyId { get; private set; }

         /// <summary>
         /// Gets or sets the value.
@@ -64,7 +64,7 @@
         /// <param name='value'>
         /// Value.
         /// </param>
-        public PropertyContainer (Int64 id, Object value)
+        public PropertyContainer (Int32 id, Object value)
         {
             PropertyId = id;
             Value = value;


Added some brackets after ifs

Added some brackets after ifs

--- MediaManager/Platforms/Apple/AppleMediaManagerBase.cs
+++ MediaManager/Platforms/Apple/AppleMediaManagerBase.cs
@@ -39,7 +39,9 @@
             get
             {
                 if (_mediaExtractor == null)
+                {
                     _mediaExtractor = new AppleMediaExtractor();
+                }
                 return _mediaExtractor;
             }
             set
@@ -56,7 +58,9 @@
             get
             {
                 if (NativeMediaPlayer.Player.CurrentItem == null)
+                {
                     return TimeSpan.Zero;
+                }
                 return TimeSpan.FromSeconds(NativeMediaPlayer.Player.CurrentItem.CurrentTime.Seconds);
             }
         }
@@ -66,9 +70,13 @@
             get
             {
                 if (NativeMediaPlayer.Player.CurrentItem == null)
+                {
                     return TimeSpan.Zero;
+                }
                 if (double.IsNaN(NativeMediaPlayer.Player.CurrentItem.Duration.Seconds))
+                {
                     return TimeSpan.Zero;
+                }
                 return TimeSpan.FromSeconds(NativeMediaPlayer.Player.CurrentItem.Duration.Seconds);
             }
         }
@@ -79,10 +87,12 @@
             {
                 var buffered = TimeSpan.Zero;
                 if (NativeMediaPlayer.Player.CurrentItem != null)
+                {
                     buffered =
                         TimeSpan.FromSeconds(
                             NativeMediaPlayer.Player.CurrentItem.LoadedTimeRanges.Select(
                                 tr => tr.CMTimeRangeValue.Start.Seconds + tr.CMTimeRangeValue.Duration.Seconds).Max());
+                }

                 return buffered;
             }


refactor tests

refactor tests

--- Medidata.ZipkinTracerModule.Test/ZipkinClientTests.cs
+++ Medidata.ZipkinTracerModule.Test/ZipkinClientTests.cs
@@ -31,7 +31,7 @@
         public void CTOR_WithNullZipkinPort()
         {
             var zipkinConfigStub = MockRepository.GenerateStub<IZipkinConfig>();
-            zipkinConfigStub.Expect(x => x.ZipkinServerName()).Return("hi");
+            zipkinConfigStub.Expect(x => x.ZipkinServerName()).Return(fixture.Create<string>());
             zipkinConfigStub.Expect(x => x.ZipkinServerPort()).Return(null);

             var zipkinClient = new ZipkinClient(zipkinConfigStub);
@@ -42,8 +42,8 @@
         public void CTOR_WithNonIntegerZipkinPort()
         {
             var zipkinConfigStub = MockRepository.GenerateStub<IZipkinConfig>();
-            zipkinConfigStub.Expect(x => x.ZipkinServerName()).Return("hi");
-            zipkinConfigStub.Expect(x => x.ZipkinServerPort()).Return("abc");
+            zipkinConfigStub.Expect(x => x.ZipkinServerName()).Return(fixture.Create<string>());
+            zipkinConfigStub.Expect(x => x.ZipkinServerPort()).Return(fixture.Create<string>());

             var zipkinClient = new ZipkinClient(zipkinConfigStub);
         }


updated MainPage.xaml.cs

updated MainPage.xaml.cs

--- MainPage.xaml.cs
+++ MainPage.xaml.cs
@@ -31,23 +31,6 @@
     public sealed partial class MainPage : Page
     {
         #region Private Fields and Constants
-
-        ////
-        //// The Client ID is used by the application to uniquely identify itself to Azure AD.
-        //// The Authority is the sign-in URL of the tenant.
-        ////
-        //static readonly string authority = "https://login.windows.net/Common/";
-        //static readonly string clientId = App.Current.Resources["ida:ClientID"].ToString();
-
-        //static readonly Uri discoveryServiceEndpointUri = new Uri("https://api.office.com/discovery/v1.0/me/");
-        //static readonly string discoveryServiceResourceId = "https://api.office.com/discovery/";
-
-        //static readonly string capabilityMail = "Mail";
-        //static readonly string capabilityCalendar = "Calendar";
-        //static readonly string capabilityContacts = "Contacts";
-        //static readonly string capabilityMyFiles = "MyFiles";
-
-        //static DiscoveryClient discoveryClient;

         static AuthenticationContext authContext = null;


output always has .csv file extension

output always has .csv file extension

--- arcobjects-net/explore-fgdbs-and-generate-csv/Program.cs
+++ arcobjects-net/explore-fgdbs-and-generate-csv/Program.cs
@@ -36,6 +36,7 @@
                 string option = args[0];
                 string rootPath = args[1]; // Target path is the first argument of the console application
                 string outfile = args[2]; // Output CSV file is the second argument
+                outfile = toCSVPath(outfile);

                 switch (option)
                 {
@@ -57,6 +58,16 @@
                 System.Environment.Exit(0);
             }
         }
+
+        // If there is no '.csv' file extension, then append '.csv' to the end of the path.
+        // Otherwise, return the original string
+        private static string toCSVPath(string path)
+        {
+            string fileExt = Path.GetExtension(path); // Get this folder's file extension
+            if (fileExt != ".csv") return path + ".csv";
+            else return path;
+        }
+
         private static void testFGDBPath(string path)
         {
             string fileExt = Path.GetExtension(path); // Get this folder's file extension


Update OwinHttpHandler.cs

Update OwinHttpHandler.cs

--- src/Hprose.RPC.Owin/OwinHttpHandler.cs
+++ src/Hprose.RPC.Owin/OwinHttpHandler.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  OwinHttpHandler class for C#.                           |
 |                                                          |
-|  LastModified: Feb 12, 2019                              |
+|  LastModified: Mar 20, 2019                              |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -33,7 +33,6 @@
         private readonly string lastModified;
         private readonly string etag;
         private readonly Dictionary<string, bool> origins = new Dictionary<string, bool>();
-        public Action<Exception> OnError { get; set; } = null;
         public Service Service { get; private set; }
         public OwinHttpHandler(Service service) {
             Service = service;


Update MvxFormsPagePresenter.cs

Update MvxFormsPagePresenter.cs

--- FormsPresenters/Core/MvxFormsPagePresenter.cs
+++ FormsPresenters/Core/MvxFormsPagePresenter.cs
@@ -3,7 +3,7 @@
 // Cheesebaron.MvxPlugins.FormsPresenters is licensed using Microsoft Public License (Ms-PL)
 // Contributions and inspirations noted in readme.md and license.txt
 //
-// Project Lead - Tomasz Cielecii, @cheesebaron, mvxplugins@ostebaronen.dk
+// Project Lead - Tomasz Cielecki, @cheesebaron, mvxplugins@ostebaronen.dk

 using Cirrious.CrossCore;
 using Cirrious.MvvmCross.ViewModels;


Change Decoder ctor sig

Change Decoder ctor sig

--- Iced/Intel/Decoder.cs
+++ Iced/Intel/Decoder.cs
@@ -167,12 +167,12 @@
 #endif
 		}

-		Decoder(CodeReader reader, DecoderOptions options, OpSize defaultOpSize) {
+		Decoder(CodeReader reader, DecoderOptions options, int bitness) {
 			this.reader = reader ?? throw new ArgumentNullException(nameof(reader));
 			this.options = options;
 			invalidCheckMask = (options & DecoderOptions.NoInvalidCheck) == 0 ? uint.MaxValue : 0;
 			memRegs16 = s_memRegs16;
-			if (defaultOpSize == OpSize.Size64) {
+			if (bitness == 64) {
 				is64Mode = true;
 				Bitness = 64;
 				defaultCodeSize = CodeSize.Code64;
@@ -182,24 +182,24 @@
 				defaultInvertedAddressSize = OpSize.Size32;
 				prefixes = prefixes64;
 			}
-			else if (defaultOpSize == OpSize.Size32) {
+			else if (bitness == 32) {
 				is64Mode = false;
 				Bitness = 32;
 				defaultCodeSize = CodeSize.Code32;
-				defaultOperandSize = defaultOpSize;
+				defaultOperandSize = OpSize.Size32;
 				defaultInvertedOperandSize = OpSize.Size16;
-				defaultAddressSize = defaultOpSize;
+				defaultAddressSize = OpSize.Size32;
 				defaultInvertedAddressSize = OpSize.Size16;
 				prefixes = prefixes1632;
 			}
 			else {
-				Debug.Assert(defaultOpSize == OpSize.Size16);
+				Debug.Assert(bitness == 16);
 				is64Mode = false;
 				Bitness = 16;
 				defaultCodeSize = CodeSize.Code16;
-				defaultOperandSize = defaultOpSize;
+				defaultOperandSize = OpSize.Size16;
 				defaultInvertedOperandSize = OpSize.Size32;
-				defaultAddressSize = defaultOpSize;
+				defaultAddressSize = OpSize.Size16;
 				defaultInvertedAddressSize = OpSize.Size32;
 				prefixes = prefixes1632;
 			}
@@ -226,9 +226,9 @@
 		/// <returns></returns>
 		public static Decoder Create(int bitness, CodeReader reader, DecoderOptions options = DecoderOptions.None) {
 			switch (bitness) {
-			case 16: return new Decoder(reader, options, OpSize.Size16);
-			case 32: return new Decoder(reader, options, OpSize.Size32);
-			case 64: return new Decoder(reader, options, OpSize.Size64);
+			case 16:
+			case 32:
+			case 64: return new Decoder(reader, options, bitness);
 			default: throw new ArgumentOutOfRangeException(nameof(bitness));
 			}
 		}


Fixing previous commit which breaks nested command termination.

What an untestable mess have I created? Very nice adept for refactoring - I would like to have more integrated tests, how unit tests can help here? Better composition?

--- Infusion/Commands/CommandInvocator.cs
+++ Infusion/Commands/CommandInvocator.cs
@@ -72,8 +72,11 @@
                     cancellationTokenSource);
                 var commandAdded = AddCommandInvocation(command, invocation);

-                if (cancellationTokenSource != null)
-                    commandHandler.OnCancellationTokenCreated(cancellationTokenSource.Token);
+                if (command.Terminable)
+                {
+                    if (cancellationTokenSource != null)
+                        commandHandler.OnCancellationTokenCreated(cancellationTokenSource.Token);
+                }
                 else
                     commandHandler.OnCancellationTokenCreated(CancellationToken.None);


Added ability to link to a directory by creating an extensionless file with the linked directory's path inside it


Fixed CP#34651: Fix encodings.idna.

Fixed CP#34651: Fix encodings.idna.

Add a dummy ucd_3_2_0 object to unicodedata to make encodings.idna happy.

--- Languages/IronPython/IronPython/Modules/unicodedata.cs
+++ Languages/IronPython/IronPython/Modules/unicodedata.cs
@@ -24,373 +24,383 @@
 using System.Runtime.CompilerServices;
 using System.Text;
 using System.Text.RegularExpressions;
+using System.Threading;
 using IronPython.Runtime;
 using IronPython.Runtime.Operations;

 [assembly: PythonModule("unicodedata", typeof(IronPython.Modules.unicodedata))]

-namespace IronPython.Modules
-{
-    public static class unicodedata
-    {
-        private const string UnicodedataResourceName = "IronPython.Modules.unicodedata.IPyUnicodeData.txt.gz";
-        private const string OtherNotAssigned = "Cn";
-
-        private static Dictionary<int, CharInfo> database;
-        private static List<RangeInfo> ranges;
-        private static Dictionary<string, int> nameLookup;
+namespace IronPython.Modules {
+    public static class unicodedata {
+        private static UCD ucd_5_2_0 = null;
+
+        // This is supposed to by the Unicode 3.2 database, but since .NET doesn't provide it
+        // just use the 5.2 one instead.
+        public static UCD ucd_3_2_0 {
+            get {
+                if (_ucd_3_2_0 == null) {
+                    Interlocked.CompareExchange(ref _ucd_3_2_0, new UCD("3.2.0"), null);
+                }
+
+                return _ucd_3_2_0;
+            }
+        }
+        private static UCD _ucd_3_2_0 = null;
+
+        public static string unidata_version { get { return ucd_5_2_0.unidata_version; } }

         [SpecialName]
-        public static void PerformModuleReload(PythonContext/*!*/ context, IDictionary/*!*/ dict)
-        {
-            EnsureLoaded();
-        }
-
-        public static string lookup(string name)
-        {
-            EnsureLoaded();
-
-            return Convert.ToChar(nameLookup[name]).ToString();
-        }
-
-        public static string name(char unichr, string @default = null)
-        {
-            try
-            {
-                return GetInfo(unichr).Name;
-            }
-            catch(KeyNotFoundException)
-            {
-                if(@default != null)
-                    return @default;
-                else
-                    throw;
-            }
-        }
-
-        public static int @decimal(char unichr, int @default)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Decimal;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch (KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static int @decimal(char unichr)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Decimal;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
+        public static void PerformModuleReload(PythonContext/*!*/ context, IDictionary/*!*/ dict) {
+            if (ucd_5_2_0 == null) {
+                Interlocked.CompareExchange(ref ucd_5_2_0, new UCD("5.2.0"), null);
+            }
+        }
+
+        public static string lookup(string name) {
+            return ucd_5_2_0.lookup(name);
+        }
+
+        public static string name(char unichr, string @default = null) {
+            return ucd_5_2_0.name(unichr, @default);
+        }
+
+        public static int @decimal(char unichr, int @default) {
+            return ucd_5_2_0.@decimal(unichr, @default);
+        }
+
+        public static int @decimal(char unichr) {
+            return ucd_5_2_0.@decimal(unichr);
+        }
+
+        public static object @decimal(char unichr, object @default) {
+            return ucd_5_2_0.@decimal(unichr, @default);
+        }
+
+        public static int digit(char unichr, int @default) {
+            return ucd_5_2_0.digit(unichr, @default);
+        }
+
+        public static object digit(char unichr, object @default) {
+            return ucd_5_2_0.digit(unichr, @default);
+        }
+
+        public static int digit(char unichr) {
+            return ucd_5_2_0.digit(unichr);
+        }
+
+        public static double numeric(char unichr, double @default) {
+            return ucd_5_2_0.numeric(unichr, @default);
+        }
+
+        public static double numeric(char unichr) {
+            return ucd_5_2_0.numeric(unichr);
+        }
+
+        public static object numeric(char unichr, object @default) {
+            return ucd_5_2_0.numeric(unichr, @default);
+        }
+
+        public static string category(char unichr) {
+            return ucd_5_2_0.category(unichr);
+        }
+
+        public static string bidirectional(char unichr) {
+            return ucd_5_2_0.bidirectional(unichr);
+        }
+
+        public static int combining(char unichr) {
+            return ucd_5_2_0.combining(unichr);
+        }
+
+        public static string east_asian_width(char unichr) {
+            return ucd_5_2_0.east_asian_width(unichr);
+        }
+
+        public static int mirrored(char unichr) {
+            return ucd_5_2_0.mirrored(unichr);
+        }
+
+        public static string decomposition(char unichr) {
+            return ucd_5_2_0.decomposition(unichr);
+        }
+
+        public static string normalize(string form, string unistr) {
+            return ucd_5_2_0.normalize(form, unistr);
+        }
+
+        [PythonType("unicodedata.UCD")]
+        public class UCD {
+            private const string UnicodedataResourceName = "IronPython.Modules.unicodedata.IPyUnicodeData.txt.gz";
+            private const string OtherNotAssigned = "Cn";
+
+            private Dictionary<int, CharInfo> database;
+            private List<RangeInfo> ranges;
+            private Dictionary<string, int> nameLookup;
+
+            public UCD(string version) {
+                unidata_version = version;
+                EnsureLoaded();
+            }
+
+            // This is a lie. The version of Unicode depends on the .NET version as well as the OS. The
+            // version of the database stored internally is 5.2, so just day that.
+            public string unidata_version { get; private set; }
+
+            public string lookup(string name) {
+                return Convert.ToChar(nameLookup[name]).ToString();
+            }
+
+            public string name(char unichr, string @default = null) {
+                try {
+                    return GetInfo(unichr).Name;
+                } catch (KeyNotFoundException) {
+                    if (@default != null)
+                        return @default;
+                    else
+                        throw;
+                }
+            }
+
+            public int @decimal(char unichr, int @default) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Decimal;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public int @decimal(char unichr) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Decimal;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        throw PythonOps.ValueError("not a decimal");
+                    }
+                } catch (KeyNotFoundException) {
                     throw PythonOps.ValueError("not a decimal");
                 }
-            }
-            catch (KeyNotFoundException)
-            {
-                throw PythonOps.ValueError("not a decimal");
-            }
-        }
-
-        public static object @decimal(char unichr, object @default)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Decimal;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch (KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static int digit(char unichr, int @default)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Digit;
-                if(d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch(KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static object digit(char unichr, object @default)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Digit;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch (KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static int digit(char unichr)
-        {
-            try
-            {
-                int? d = GetInfo(unichr).Numeric_Value_Digit;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
+            }
+
+            public object @decimal(char unichr, object @default) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Decimal;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public int digit(char unichr, int @default) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Digit;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public object digit(char unichr, object @default) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Digit;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public int digit(char unichr) {
+                try {
+                    int? d = GetInfo(unichr).Numeric_Value_Digit;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        throw PythonOps.ValueError("not a digit");
+                    }
+                } catch (KeyNotFoundException) {
                     throw PythonOps.ValueError("not a digit");
                 }
-            }
-            catch (KeyNotFoundException)
-            {
-                throw PythonOps.ValueError("not a digit");
-            }
-        }
-
-        public static double numeric(char unichr, double @default)
-        {
-            try
-            {
-                double? d = GetInfo(unichr).Numeric_Value_Numeric;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch (KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static double numeric(char unichr)
-        {
-            try
-            {
-                double? d = GetInfo(unichr).Numeric_Value_Numeric;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
+            }
+
+            public double numeric(char unichr, double @default) {
+                try {
+                    double? d = GetInfo(unichr).Numeric_Value_Numeric;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public double numeric(char unichr) {
+                try {
+                    double? d = GetInfo(unichr).Numeric_Value_Numeric;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        throw PythonOps.ValueError("not a numeric character");
+                    }
+                } catch (KeyNotFoundException) {
                     throw PythonOps.ValueError("not a numeric character");
                 }
-            }
-            catch (KeyNotFoundException)
-            {
-                throw PythonOps.ValueError("not a numeric character");
-            }
-        }
-
-        public static object numeric(char unichr, object @default)
-        {
-            try
-            {
-                double? d = GetInfo(unichr).Numeric_Value_Numeric;
-                if (d.HasValue)
-                {
-                    return d.Value;
-                }
-                else
-                {
-                    return @default;
-                }
-            }
-            catch (KeyNotFoundException)
-            {
-                return @default;
-            }
-        }
-
-        public static string category(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return OtherNotAssigned;
-            return GetInfo(unichr).General_Category;
-        }
-
-        public static string bidirectional(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return string.Empty;
-            return GetInfo(unichr).Bidi_Class;
-        }
-
-        public static int combining(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return 0;
-            return GetInfo(unichr).Canonical_Combining_Class;
-        }
-
-        public static string east_asian_width(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return string.Empty;
-            return GetInfo(unichr).East_Asian_Width;
-        }
-
-        public static int mirrored(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return 0;
-            return GetInfo(unichr).Bidi_Mirrored;
-        }
-
-        public static string decomposition(char unichr)
-        {
-            if (!database.ContainsKey(unichr))
-                return string.Empty;
-            return GetInfo(unichr).Decomposition_Type;
-        }
-
-        public static string normalize(string form, string unistr)
-        {
-            NormalizationForm nf;
-            switch(form)
-            {
-                case "NFC":
-                    nf = NormalizationForm.FormC;
-                    break;
-
-                case "NFD":
-                    nf = NormalizationForm.FormD;
-                    break;
-
-                case "NFKC":
-                    nf = NormalizationForm.FormKC;
-                    break;
-
-                case "NFKD":
-                    nf = NormalizationForm.FormKD;
-                    break;
-
-                default:
-                    throw new ArgumentException("Invalid normalization form " + form, "form");
-            }
-
-            return unistr.Normalize(nf);
-        }
-
-        static void BuildDatabase(StreamReader data)
-        {
-            var sep = new char[] { ';' };
-
-            database = new Dictionary<int, CharInfo>();
-            ranges = new List<RangeInfo>();
-
-            foreach(string raw_line in data.ReadLines())
-            {
-                int n = raw_line.IndexOf('#');
-                string line = n == -1 ? raw_line : raw_line.Substring(raw_line.Length - n).Trim();
-
-                if(string.IsNullOrEmpty(line))
-                    continue;
-
-                var info = line.Split(sep, 2);
-                var m = Regex.Match(info[0], @"([0-9a-fA-F]{4})\.\.([0-9a-fA-F]{4})");
-                if(m.Success)
-                {
-                    // this is a character range
-                    int first = Convert.ToInt32(m.Groups[1].Value, 16);
-                    int last = Convert.ToInt32(m.Groups[2].Value, 16);
-
-                    ranges.Add(new RangeInfo(first, last, info[1].Split(sep)));
-                }
-                else
-                {
-                    // this is a single character
-                    database[Convert.ToInt32(info[0], 16)] = new CharInfo(info[1].Split(sep));
-                }
-            }
-        }
-
-        static void BuildNameLookup()
-        {
-            nameLookup = database.Where(c => !c.Value.Name.StartsWith("<")).ToDictionary(c => c.Value.Name, c => c.Key);
-        }
-
-        private static CharInfo GetInfo(char unichr)
-        {
-            EnsureLoaded();
-
-            return database[(int)unichr];
-        }
-
-        private static void EnsureLoaded()
-        {
-            if(database == null || nameLookup == null)
-            {
-                var rsrc = typeof(unicodedata).Assembly.GetManifestResourceStream(UnicodedataResourceName);
-                var gzip = new GZipStream(rsrc, CompressionMode.Decompress);
-                var data = new StreamReader(gzip, Encoding.UTF8);
-
-                BuildDatabase(data);
-                BuildNameLookup();
+            }
+
+            public object numeric(char unichr, object @default) {
+                try {
+                    double? d = GetInfo(unichr).Numeric_Value_Numeric;
+                    if (d.HasValue) {
+                        return d.Value;
+                    } else {
+                        return @default;
+                    }
+                } catch (KeyNotFoundException) {
+                    return @default;
+                }
+            }
+
+            public string category(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return OtherNotAssigned;
+                return GetInfo(unichr).General_Category;
+            }
+
+            public string bidirectional(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return string.Empty;
+                return GetInfo(unichr).Bidi_Class;
+            }
+
+            public int combining(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return 0;
+                return GetInfo(unichr).Canonical_Combining_Class;
+            }
+
+            public string east_asian_width(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return string.Empty;
+                return GetInfo(unichr).East_Asian_Width;
+            }
+
+            public int mirrored(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return 0;
+                return GetInfo(unichr).Bidi_Mirrored;
+            }
+
+            public string decomposition(char unichr) {
+                if (!database.ContainsKey(unichr))
+                    return string.Empty;
+                return GetInfo(unichr).Decomposition_Type;
+            }
+
+            public string normalize(string form, string unistr) {
+                NormalizationForm nf;
+                switch (form) {
+                    case "NFC":
+                        nf = NormalizationForm.FormC;
+                        break;
+
+                    case "NFD":
+                        nf = NormalizationForm.FormD;
+                        break;
+
+                    case "NFKC":
+                        nf = NormalizationForm.FormKC;
+                        break;
+
+                    case "NFKD":
+                        nf = NormalizationForm.FormKD;
+                        break;
+
+                    default:
+                        throw new ArgumentException("Invalid normalization form " + form, "form");
+                }
+
+                return unistr.Normalize(nf);
+            }
+
+            void BuildDatabase(StreamReader data) {
+                var sep = new char[] { ';' };
+
+                database = new Dictionary<int, CharInfo>();
+                ranges = new List<RangeInfo>();
+
+                foreach (string raw_line in data.ReadLines()) {
+                    int n = raw_line.IndexOf('#');
+                    string line = n == -1 ? raw_line : raw_line.Substring(raw_line.Length - n).Trim();
+
+                    if (string.IsNullOrEmpty(line))
+                        continue;
+
+                    var info = line.Split(sep, 2);
+                    var m = Regex.Match(info[0], @"([0-9a-fA-F]{4})\.\.([0-9a-fA-F]{4})");
+                    if (m.Success) {
+                        // this is a character range
+                        int first = Convert.ToInt32(m.Groups[1].Value, 16);
+                        int last = Convert.ToInt32(m.Groups[2].Value, 16);
+
+                        ranges.Add(new RangeInfo(first, last, info[1].Split(sep)));
+                    } else {
+                        // this is a single character
+                        database[Convert.ToInt32(info[0], 16)] = new CharInfo(info[1].Split(sep));
+                    }
+                }
+            }
+
+            void BuildNameLookup() {
+                nameLookup = database.Where(c => !c.Value.Name.StartsWith("<")).ToDictionary(c => c.Value.Name, c => c.Key);
+            }
+
+            private CharInfo GetInfo(char unichr) {
+                EnsureLoaded();
+
+                return database[(int)unichr];
+            }
+
+            private void EnsureLoaded() {
+                if (database == null || nameLookup == null) {
+                    var rsrc = typeof(unicodedata).Assembly.GetManifestResourceStream(UnicodedataResourceName);
+                    var gzip = new GZipStream(rsrc, CompressionMode.Decompress);
+                    var data = new StreamReader(gzip, Encoding.UTF8);
+
+                    BuildDatabase(data);
+                    BuildNameLookup();
+                }
             }
         }
     }

-    internal static class StreamReaderExtensions
-    {
-        public static IEnumerable<string> ReadLines(this StreamReader reader)
-        {
+    internal static class StreamReaderExtensions {
+        public static IEnumerable<string> ReadLines(this StreamReader reader) {
             string line;
-            while((line = reader.ReadLine()) != null)
+            while ((line = reader.ReadLine()) != null)
                 yield return line;
         }
     }

-    class CharInfo
-    {
-        internal CharInfo(string[] info)
-        {
+    class CharInfo {
+        internal CharInfo(string[] info) {
             this.Name = info[PropertyIndex.Name].ToUpperInvariant();
             this.General_Category = info[PropertyIndex.General_Category];
             this.Canonical_Combining_Class = int.Parse(info[PropertyIndex.Canonical_Combining_Class]);
@@ -404,20 +414,16 @@
             this.Numeric_Value_Digit = nvdis != "" ? (int?)int.Parse(nvdis) : null;

             string nvns = info[PropertyIndex.Numeric_Value_Numeric];
-            if(nvns != "")
-            {
+            if (nvns != "") {
                 string[] nvna = nvns.Split(new char[] { '/' });
                 double num = double.Parse(nvna[0]);
-                if(nvna.Length > 1)
-                {
+                if (nvna.Length > 1) {
                     double den = double.Parse(nvna[1]);
                     num /= den;
                 }

                 this.Numeric_Value_Numeric = num;
-            }
-            else
-            {
+            } else {
                 this.Numeric_Value_Numeric = null;
             }

@@ -436,8 +442,7 @@
         internal readonly int Bidi_Mirrored;
         internal readonly string East_Asian_Width;

-        static class PropertyIndex
-        {
+        static class PropertyIndex {
             internal const int Name = 0;
             internal const int General_Category = 1;
             internal const int Canonical_Combining_Class = 2;
@@ -451,10 +456,9 @@
         }
     }

-    class RangeInfo : CharInfo
-    {
-        internal RangeInfo(int first, int last, string[] info) : base(info)
-        {
+    class RangeInfo : CharInfo {
+        internal RangeInfo(int first, int last, string[] info)
+            : base(info) {
             this.First = first;
             this.Last = last;
         }


correct misleading "fcache status" text - deep scans are not performed when this command is invoked.

--- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -765,7 +765,7 @@

                             foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac"))
                             {
-                                m_log.Info("[FLOTSAM ASSET CACHE]: Deep Scans were performed on the following regions:");
+                                m_log.Info("[FLOTSAM ASSET CACHE]: Deep scans have previously been performed on the following regions:");

                                 string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac","");
                                 DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s);


Remove NPC debug spam

Remove NPC debug spam

--- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -124,9 +124,9 @@
             NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene);
             npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);

-            m_log.DebugFormat(
-                "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
-                firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
+//            m_log.DebugFormat(
+//                "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
+//                firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);

             AgentCircuitData acd = new AgentCircuitData();
             acd.AgentID = npcAvatar.AgentId;
@@ -157,7 +157,7 @@
                     {
                         sp.CompleteMovement(npcAvatar, false);
                         m_avatars.Add(npcAvatar.AgentId, npcAvatar);
-                        m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
+//                        m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
                     }
                 }
                 ev.Set();
@@ -179,9 +179,9 @@
                     ScenePresence sp;
                     if (scene.TryGetScenePresence(agentID, out sp))
                     {
-                        m_log.DebugFormat(
-                            "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
-                            sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
+//                        m_log.DebugFormat(
+//                            "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
+//                            sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);

                         sp.MoveToTarget(pos, noFly, landAtTarget);
                         sp.SetAlwaysRun = running;


balls! not working yet

balls! not working yet

--- Game/Game/Components/BallMovementComponent.cs
+++ Game/Game/Components/BallMovementComponent.cs
@@ -35,19 +35,37 @@
             this.transform = new ComponentLookup<TransformComponent>(this.ParentEntity);
             this.ball = new ComponentLookup<BallComponent>(this.ParentEntity);

-            this.Angle = (float)(90 * (Math.PI / 180));
-            this.Speed = 40f;
+            this.Angle = (float)(45 * (Math.PI / 180));
+            this.Speed = 400f;
         }

         public override void Update()
         {
-            if (transform.Component.Position.Y < 0 || transform.Component.Position.Y + this.ball.Component.Size > GameEngine.Instance.Window.Size.Y
-                || transform.Component.Position.X < 0 || transform.Component.Position.X + this.ball.Component.Size > GameEngine.Instance.Window.Size.X)
+            if (transform.Component.Position.Y <= 0 || transform.Component.Position.Y + this.ball.Component.Size >= GameEngine.Instance.Window.Size.Y)
             {
                 this.Angle = -this.Angle;
             }

-            this.transform.Component.AddPosition((float)(GameEngine.Instance.Delta * this.Speed * Math.Cos(this.Angle)), (float)(GameEngine.Instance.Delta * this.Speed * Math.Sin(this.Angle)));
+            if (transform.Component.Position.X <= 0 || transform.Component.Position.X + this.ball.Component.Size >= GameEngine.Instance.Window.Size.X)
+            {
+                this.Angle = -this.Angle;
+            }
+
+            Vector2f position = this.transform.Component.Position;
+            position.X += (float)(GameEngine.Instance.Delta * this.Speed * Math.Cos(this.Angle));
+            position.Y += (float)(GameEngine.Instance.Delta * this.Speed * Math.Sin(this.Angle));
+
+            if (position.Y < 0)
+                position.Y = 0;
+            else if (position.Y + this.ball.Component.Size > GameEngine.Instance.Window.Size.Y)
+                position.Y = GameEngine.Instance.Window.Size.Y - this.ball.Component.Size;
+
+            if (position.X < 0)
+                position.X = 0;
+            else if (position.X + this.ball.Component.Size > GameEngine.Instance.Window.Size.X)
+                position.X = GameEngine.Instance.Window.Size.X - this.ball.Component.Size;
+
+            this.transform.Component.Position = position;
         }
     }
 }


Added AppBase.InitializePrerequisites to be called before app manager initialization, which configure ambient services, the logger and the appcontext.

--- src/Kephas.Core/Application/AppBase.cs
+++ src/Kephas.Core/Application/AppBase.cs
@@ -75,6 +75,8 @@
             string[] rawAppArgs = null,
             CancellationToken cancellationToken = default)
         {
+            this.Log(LogLevel.Info, null, Strings.App_BootstrapAsync_Bootstrapping_Message);
+
             this.InitializePrerequisites(rawAppArgs);

             await this.InitializeAppManagerAsync(this.AppContext, cancellationToken).PreserveThreadContext();
@@ -116,20 +118,22 @@
         }

         /// <summary>
-        /// Initializes the application prerequisites: the ambient services, the application context registration, the logger, other.
+        /// Initializes the application prerequisites: the ambient services, the application context
+        /// registration, the logger, other.
         /// </summary>
         /// <param name="rawAppArgs">The application arguments.</param>
-        protected virtual void InitializePrerequisites(string[] rawAppArgs)
+        /// <returns>
+        /// True if the initialization was performed, false if it was ignored because of subsequent calls.
+        /// </returns>
+        protected virtual bool InitializePrerequisites(string[] rawAppArgs)
         {
             if (this.prerequisitesInitialized)
             {
-                return;
+                return false;
             }

             try
             {
-                this.Log(LogLevel.Info, null, Strings.App_BootstrapAsync_Bootstrapping_Message);
-
                 this.Log(LogLevel.Info, null, Strings.App_BootstrapAsync_ConfiguringAmbientServices_Message);

                 // require the AppContext to be computed each time, so that if it is called
@@ -143,7 +147,9 @@

                 this.Logger = this.Logger ?? this.AmbientServices.GetLogger(this.GetType());

-                // it is important to create the app context before initializing the application manager.
+                // it is important to create the app context before initializing the application manager
+                // and after configuring the ambient services and the logger, as it may
+                // use registered services.
                 this.AppContext = this.CreateAppContext(this.AmbientServices);
             }
             catch (Exception ex)
@@ -156,7 +162,7 @@
                 throw;
             }

-            this.prerequisitesInitialized = true;
+            return this.prerequisitesInitialized = true;
         }

         /// <summary>


arcgis provider async

arcgis provider async

--- Mapsui.ArcGIS/DynamicProvider/ArcGISDynamicProvider.cs
+++ Mapsui.ArcGIS/DynamicProvider/ArcGISDynamicProvider.cs
@@ -6,6 +6,7 @@
 using System.Net;
 using System.Net.Http;
 using System.Text;
+using System.Threading.Tasks;
 using Mapsui.Extensions;
 using Mapsui.Layers;
 using Mapsui.Logging;
@@ -14,7 +15,7 @@

 namespace Mapsui.ArcGIS.DynamicProvider
 {
-    public class ArcGISDynamicProvider : IProjectingProvider
+    public class ArcGISDynamicProvider : AsyncProviderBase<IFeature>, IProjectingProvider
     {
         private int _timeOut;
         private string _url = default!;
@@ -89,21 +90,21 @@
             set => _crs = value;
         }

-        public IEnumerable<IFeature> GetFeatures(FetchInfo fetchInfo)
+        public override async IAsyncEnumerable<IFeature> GetFeaturesAsync(FetchInfo fetchInfo)
         {
             //If there are no layers (probably not initialised) return nothing
             if (ArcGisDynamicCapabilities.layers == null)
-                return new List<IFeature>();
-
-            var features = new List<RasterFeature>();
-
-            IViewport? viewport = fetchInfo.ToViewport();
-            if (viewport != null && TryGetMap(viewport, out var raster))
-                features.Add(new RasterFeature(raster));
-            return features;
-        }
-
-        public MRect? GetExtent()
+                yield break;
+
+            IViewport viewport = fetchInfo.ToViewport();
+            var (success, raster) = await TryGetMapAsync(viewport);
+            if (success)
+            {
+                yield return new RasterFeature(raster);
+            }
+        }
+
+        public override MRect? GetExtent()
         {
             if (ArcGisDynamicCapabilities.initialExtent == null)
                 return null;
@@ -128,7 +129,7 @@
         /// <summary>
         /// Retrieves the bitmap from ArcGIS Dynamic service
         /// </summary>
-        public bool TryGetMap(IViewport viewport, [NotNullWhen(true)] out MRaster? raster)
+        public async Task<(bool Success, MRaster? Raster)> TryGetMapAsync(IViewport viewport)
         {
             int width;
             int height;
@@ -140,9 +141,8 @@
             }
             catch (OverflowException ex)
             {
-                Logger.Log(LogLevel.Error, "Error: Could not conver double to int (ExportMap size)", ex);
-                raster = null;
-                return false;
+                Logger.Log(LogLevel.Error, "Error: Could not convert double to int (ExportMap size)", ex);
+                return (false, null);
             }

             var uri = new Uri(GetRequestUrl(viewport.Extent, width, height));
@@ -151,24 +151,22 @@

             try
             {
-                using var response = client.GetAsync(uri).Result;
-                using var readAsStreamAsync = response.Content.ReadAsStreamAsync();
-                var bytes = BruTile.Utilities.ReadFully(readAsStreamAsync.Result);
+                using var response = await client.GetAsync(uri);
+                using var readAsStreamAsync = await response.Content.ReadAsStreamAsync();
+                var bytes = BruTile.Utilities.ReadFully(readAsStreamAsync);
                 if (viewport.Extent != null)
                 {
-                    raster = new MRaster(bytes, viewport.Extent);
+                    var raster = new MRaster(bytes, viewport.Extent);
                     response.Dispose();
-                    return true;
+                    return (true, raster);
                 }
-
-                raster = null;
-                return false;
+
+                return (false, null);
             }
             catch (Exception ex)
             {
                 Logger.Log(LogLevel.Error, ex.Message, ex);
-                raster = null;
-                return false;
+                return (false, null);
             }
         }


Send reports asynchronously

Send reports asynchronously

--- ModStatistics.cs
+++ ModStatistics.cs
@@ -168,18 +168,34 @@
             {
                 client.Headers.Add(HttpRequestHeader.UserAgent, String.Format("ModStatistics/{0} ({1})", getInformationalVersion(Assembly.GetExecutingAssembly()), version));
                 client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
-                foreach (var file in files)
-                {
-                    try
-                    {
-                        client.UploadString(@"http://stats.majiir.net/submit_report", File.ReadAllText(file));
+
+                client.UploadStringCompleted += (s, e) =>
+                {
+                    var file = (string)e.UserState;
+                    if (e.Cancelled)
+                    {
+                        Debug.LogWarning(String.Format("[ModStatistics] Upload operation for {0} was cancelled", Path.GetFileName(file)));
+                    }
+                    else if (e.Error != null)
+                    {
+                        Debug.LogError(String.Format("[ModStatistics] Could not upload {0}:\n{1}", Path.GetFileName(file), e.Error));
+                    }
+                    else
+                    {
                         Debug.Log("[ModStatistics] " + Path.GetFileName(file) + " sent successfully");
                         File.Delete(file);
                     }
-                    catch (WebException e)
-                    {
-                        Debug.LogError(String.Format("[ModStatistics] Could not upload {0}:\n{1}", Path.GetFileName(file), e));
-                        return;
+                };
+
+                foreach (var file in files)
+                {
+                    try
+                    {
+                        client.UploadStringAsync(new Uri(@"http://stats.majiir.net/submit_report"), null, File.ReadAllText(file), file);
+                    }
+                    catch (Exception e)
+                    {
+                        Debug.LogWarning(String.Format("[ModStatistics] Error initiating {0) upload:\n{1}", Path.GetFileName(file), e));
                     }
                 }
             }


Lucene.Net.Core.Store.Directory refactor: renamed fields camelCase

--- src/Lucene.Net.Core/Store/Directory.cs
+++ src/Lucene.Net.Core/Store/Directory.cs
@@ -241,17 +241,17 @@

         private class IndexInputSlicerAnonymousInnerClassHelper : IndexInputSlicer
         {
-            private readonly Directory OuterInstance;
-
-            private string Name;
-            private IOContext Context;
+            private readonly Directory outerInstance;
+
+            private string name;
+            private IOContext context;

             public IndexInputSlicerAnonymousInnerClassHelper(Directory outerInstance, string name, IOContext context)
                 : base(outerInstance)
             {
-                this.OuterInstance = outerInstance;
-                this.Name = name;
-                this.Context = context;
+                this.outerInstance = outerInstance;
+                this.name = name;
+                this.context = context;
                 @base = outerInstance.OpenInput(name, context);
             }

@@ -287,11 +287,11 @@
         /// </summary>
         public abstract class IndexInputSlicer : IDisposable
         {
-            private readonly Directory OuterInstance;
+            private readonly Directory outerInstance;

             public IndexInputSlicer(Directory outerInstance)
             {
-                this.OuterInstance = outerInstance;
+                this.outerInstance = outerInstance;
             }

             /// <summary>
@@ -323,8 +323,8 @@
         private sealed class SlicedIndexInput : BufferedIndexInput
         {
             private IndexInput @base;
-            private long FileOffset;
-            private long Length_Renamed;
+            private long fileOffset;
+            private long length;

             internal SlicedIndexInput(string sliceDescription, IndexInput @base, long fileOffset, long length)
                 : this(sliceDescription, @base, fileOffset, length, BufferedIndexInput.BUFFER_SIZE)
@@ -335,16 +335,16 @@
                 : base("SlicedIndexInput(" + sliceDescription + " in " + @base + " slice=" + fileOffset + ":" + (fileOffset + length) + ")", readBufferSize)
             {
                 this.@base = (IndexInput)@base.Clone();
-                this.FileOffset = fileOffset;
-                this.Length_Renamed = length;
+                this.fileOffset = fileOffset;
+                this.length = length;
             }

             public override object Clone()
             {
                 SlicedIndexInput clone = (SlicedIndexInput)base.Clone();
                 clone.@base = (IndexInput)@base.Clone();
-                clone.FileOffset = FileOffset;
-                clone.Length_Renamed = Length_Renamed;
+                clone.fileOffset = fileOffset;
+                clone.length = length;
                 return clone;
             }

@@ -357,11 +357,11 @@
             protected override void ReadInternal(byte[] b, int offset, int len)
             {
                 long start = FilePointer;
-                if (start + len > Length_Renamed)
+                if (start + len > length)
                 {
                     throw new Exception("read past EOF: " + this);
                 }
-                @base.Seek(FileOffset + start);
+                @base.Seek(fileOffset + start);
                 @base.ReadBytes(b, offset, len, false);
             }

@@ -380,7 +380,7 @@

             public override long Length()
             {
-                return Length_Renamed;
+                return length;
             }
         }
     }


always do clean up on process exit (#490)

Fix bug https://devdiv.visualstudio.com/DevDiv/VS%20Diag%20IntelliTrace/_workItems/index?_a=edit&id=287836&triage=true

Debugger depends on this process exit event to clean up the waiting operations.
Before the change, if a readline failed first the StreamTransport._bQuit will
be set to true and the process exit event won't be sent. Some waiting operations
won't be cleaned up and cause UI hang.

--- src/MICore/Transports/PipeTransport.cs
+++ src/MICore/Transports/PipeTransport.cs
@@ -287,30 +287,27 @@
             // our pipe.
             _allReadersDone.WaitOne(100);

-            if (!this.IsClosed)
-            {
-                // We are sometimes seeing m_process throw InvalidOperationExceptions by the time we get here.
-                // Attempt to get the real exit code, if we can't, still log the message with unknown exit code.
-                string exitCode = null;
-                try
-                {
-                    exitCode = string.Format(CultureInfo.InvariantCulture, "{0} (0x{0:X})", _process.ExitCode);
-                }
-                catch (InvalidOperationException)
-                {
-                }
-                this.Callback.AppendToInitializationLog(string.Format(CultureInfo.InvariantCulture, "\"{0}\" exited with code {1}.", _process.StartInfo.FileName, exitCode ?? "???"));
-
-
-                try
-                {
-                    this.Callback.OnDebuggerProcessExit(exitCode);
-                }
-                catch
-                {
-                    // We have no exception back stop here, and we are trying to report failures. But if something goes wrong,
-                    // lets not crash VS
-                }
+            // We are sometimes seeing m_process throw InvalidOperationExceptions by the time we get here.
+            // Attempt to get the real exit code, if we can't, still log the message with unknown exit code.
+            string exitCode = null;
+            try
+            {
+                exitCode = string.Format(CultureInfo.InvariantCulture, "{0} (0x{0:X})", _process.ExitCode);
+            }
+            catch (InvalidOperationException)
+            {
+            }
+
+            this.Callback.AppendToInitializationLog(string.Format(CultureInfo.InvariantCulture, "\"{0}\" exited with code {1}.", _process.StartInfo.FileName, exitCode ?? "???"));
+
+            try
+            {
+                this.Callback.OnDebuggerProcessExit(exitCode);
+            }
+            catch
+            {
+                // We have no exception back stop here, and we are trying to report failures. But if something goes wrong,
+                // lets not crash VS
             }
         }