Implemented StorageNode weight

Implemented StorageNode weight

Implemented the StorageNode weight setting. This closes #2.

--- DatabaseController/ControllerNode.cs
+++ DatabaseController/ControllerNode.cs
@@ -29,9 +29,9 @@
         private readonly List<ChunkDefinition> _chunkList = new List<ChunkDefinition>();

         /// <summary>
-        /// A list of the connected storage nodes.
-        /// </summary>
-        private readonly List<NodeDefinition> _storageNodes = new List<NodeDefinition>();
+        /// A list of the connected storage nodes and their weights.
+        /// </summary>
+        private readonly List<Tuple<NodeDefinition, int>> _storageNodes = new List<Tuple<NodeDefinition, int>>();

         /// <summary>
         /// The current balancing state.
@@ -212,7 +212,7 @@
             {
                 lock (_storageNodes)
                 {
-                    _storageNodes.Remove(node);
+                    _storageNodes.RemoveAll(e => e.Item1.Equals(node));
                 }

                 lock (_chunkList)
@@ -411,7 +411,7 @@
         /// </summary>
         private void BalanceChunks()
         {
-            SortedList<NodeDefinition, int> chunksPerNode = new SortedList<NodeDefinition, int>();
+            SortedList<NodeDefinition, float> chunksPerNode = new SortedList<NodeDefinition, float>();
             lock (_chunkList)
             {
                 if (_chunkList.Count == 0)
@@ -433,7 +433,7 @@
                     }
                     else
                     {
-                        chunksPerNode[item.Node]++;
+                        chunksPerNode[item.Node] += 1;
                     }
                 }

@@ -441,17 +441,20 @@
                 {
                     foreach (var item in _storageNodes)
                     {
-                        if (!chunksPerNode.ContainsKey(item))
-                        {
-                            chunksPerNode.Add(item, 0);
-                        }
-                    }
-                }
-
-                if (chunksPerNode.Max(e => e.Value) - chunksPerNode.Min(e => e.Value) > 2)
-                {
-                    var minNode = chunksPerNode.First(e => e.Value == chunksPerNode.Min(f => f.Value)).Key;
-                    var maxNode = chunksPerNode.First(e => e.Value == chunksPerNode.Max(f => f.Value)).Key;
+                        if (!chunksPerNode.ContainsKey(item.Item1))
+                        {
+                            chunksPerNode.Add(item.Item1, 0);
+                        }
+
+                        chunksPerNode[item.Item1] /= item.Item2;
+                    }
+                }
+
+                var sortedChunks = chunksPerNode.OrderBy(e => e.Value).ToList();
+                if (sortedChunks[sortedChunks.Count - 1].Value - sortedChunks[0].Value > 2)
+                {
+                    var minNode = sortedChunks[0].Key;
+                    var maxNode = sortedChunks[sortedChunks.Count - 1].Key;
                     Random rand = new Random();
                     var possibleChunks = _chunkList.Where(e => Equals(e.Node, maxNode)).ToList();
                     var chunk = possibleChunks[rand.Next(possibleChunks.Count)];
@@ -647,7 +650,7 @@
                         {
                             lock (_storageNodes)
                             {
-                                _storageNodes.Add(nodeDef);
+                                _storageNodes.Add(new Tuple<NodeDefinition, int>(nodeDef, storageJoinSettings.Weight));
                             }

                             SendStorageNodeConnectionMessage();
@@ -815,14 +818,14 @@
                     }
                 }

-                int difference = 0;
+                float difference = 0;
                 if (balance)
                 {
                     lock (_chunkList)
                     {
                         if (_chunkList.Count > 0)
                         {
-                            SortedList<NodeDefinition, int> chunksPerNode = new SortedList<NodeDefinition, int>();
+                            SortedList<NodeDefinition, float> chunksPerNode = new SortedList<NodeDefinition, float>();
                             foreach (var item in _chunkList)
                             {
                                 if (!chunksPerNode.ContainsKey(item.Node))
@@ -831,7 +834,7 @@
                                 }
                                 else
                                 {
-                                    chunksPerNode[item.Node]++;
+                                    chunksPerNode[item.Node] += 1;
                                 }
                             }

@@ -839,14 +842,17 @@
                             {
                                 foreach (var item in _storageNodes)
                                 {
-                                    if (!chunksPerNode.ContainsKey(item))
+                                    if (!chunksPerNode.ContainsKey(item.Item1))
                                     {
-                                        chunksPerNode.Add(item, 0);
+                                        chunksPerNode.Add(item.Item1, 0);
                                     }
+
+                                    chunksPerNode[item.Item1] /= item.Item2;
                                 }
                             }

-                            difference = chunksPerNode.Max(e => e.Value) - chunksPerNode.Min(e => e.Value);
+                            var sortedChunks = chunksPerNode.OrderBy(e => e.Value).ToList();
+                            difference = sortedChunks[sortedChunks.Count - 1].Value - sortedChunks[0].Value;
                         }
                     }
                 }


Previously breaking build corrected

Previously breaking build corrected

--- AngleSharp/Extensions/CharExtensions.cs
+++ AngleSharp/Extensions/CharExtensions.cs
@@ -71,20 +71,23 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static Boolean IsNormalQueryCharacter(this Char c)
         {
+            return c.IsInRange(0x21, 0x7e) && c != Symbols.DoubleQuote &&
+                c != Symbols.CurvedQuote && c != Symbols.Num &&
+                c != Symbols.LessThan && c != Symbols.GreaterThan;
+        }
+
+        /// <summary>
+        /// Determines if the given character is allowed as-it-is in paths.
+        /// </summary>
+        /// <param name="c">The character to examine.</param>
+        /// <returns>The result of the test.</returns>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public static Boolean IsNormalPathCharacter(this Char c)
+        {
             return c.IsInRange(0x20, 0x7e) && c != Symbols.DoubleQuote &&
                 c != Symbols.CurvedQuote && c != Symbols.Num &&
-                c != Symbols.LessThan && c != Symbols.GreaterThan;
-        }
-
-        /// <summary>
-        /// Determines if the given character is allowed as-it-is in paths.
-        /// </summary>
-        /// <param name="c">The character to examine.</param>
-        /// <returns>The result of the test.</returns>
-        [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static Boolean IsNormalPathCharacter(this Char c)
-        {
-            return c.IsNormalQueryCharacter() && c != Symbols.Space && c != Symbols.QuestionMark;
+                c != Symbols.LessThan && c != Symbols.GreaterThan &&
+                c != Symbols.Space && c != Symbols.QuestionMark;
         }

         /// <summary>


deleted commented out code in debate.cs

deleted commented out code in debate.cs

--- DebateApp/DebateApp.Domain/Debate.cs
+++ DebateApp/DebateApp.Domain/Debate.cs
@@ -9,11 +9,7 @@
 {
     public abstract class Debate
     {
-        //private List<JObject> jsonObjects = new List<JObject>();
-        //private List<string> DebateStrings = new List<string>();
-        ////private StreamWriter FileOut = new StreamWriter("DebateStrings.txt");
-        //private StreamReader FileIn;
-        //private List<Debate> dList = new List<Debate>();
+

         public int DebateID { get; set; }
         public List<Post> Posts { get; set; }
@@ -29,63 +25,13 @@
         public int NumberOfRounds { get; set; }
         public int Pot { get; set; }

-        /*public Casual GetDebate(int id)
-        {
-            var stringId = id.ToString();
-
-            ConvertDebatesToJsonObj();
-
-            JObject debate = jsonObjects.Values<JObject>()
-                .Where(m => m["DebateId"].Value<string>() == stringId)
-                .FirstOrDefault();
-
-            var debateString = debate.ToString();
-
-            Casual debateObject = JsonConvert.DeserializeObject<Casual>(debateString);
-
-            jsonObjects.Clear();
-
-            return debateObject;
-        }*/
-
-        //public void ConvertDebatesToJsonObj()
-        //{
-        //    string line;
-
-        //    while ((line = FileIn.ReadLine()) != null)
-        //    {
-        //        JObject jo = JObject.Parse(line);
-        //        jsonObjects.Add(jo);
-        //    }
-        //    FileIn.Close();
-        //}
-
-        //public void DeleteDebate(int id)
-        //{
-        //    //read file and store to string list
-        //    //look through string list and delete the one with id
-        //    //
-        //}
-
-        //public void UpdateDebate(int id, List<Post> p)
-        //{
-
-        //    dList = JsonConvert.DeserializeObject<List<Debate>>(FileIn.ReadToEnd());
-
-        //    Debate d2 = dList.Find(d => d.DebateID == id);
-
-        //    d2.Posts = p;
-
-        //    var newInfo = JsonConvert.SerializeObject(dList);
-
-        //    File.WriteAllText("DebateStrings.txt", newInfo);
-        //}
-        public string message;
-        public void AddDebate(Casual d)
+
+
+        public string SaveDebate(Casual d)
         {
             var path = "C:\\Revature\\DebateApp\\DebateApp\\DebateApp.Domain\\DebateStrings.txt";
             string s = File.ReadAllText(path);
-            message = s;
+
             var DebateList = JsonConvert.DeserializeObject<List<Casual>>(s);

             try
@@ -97,9 +43,10 @@
                 DebateList = new List<Casual>();
                 DebateList.Add(d);
             }
-
+
             var NewList = JsonConvert.SerializeObject(DebateList);
             File.WriteAllText(path, NewList);
+            return s;

         }
     }


removed debugging code from console app

removed debugging code from console app

--- AntTools/AntTools.ConsoleApp/Program.cs
+++ AntTools/AntTools.ConsoleApp/Program.cs
@@ -79,7 +79,7 @@
                 PrintUsage();

                 return;
-            }
+            }

             if (!File.Exists(antPath))
             {
@@ -136,18 +136,6 @@

         private static void PrintUsage()
         {
-            //var foo = GetType().Assembly.GetName();
-            var foo = typeof (AntReader).Assembly.GetName();
-            foreach (var baz in typeof (AntReader).Assembly.GetCustomAttributesData())
-            {
-                Console.WriteLine(baz);
-            }
-
-            int bar = 0;
-            //bar.
-
-            Console.WriteLine("...{0} : {1}...", foo, bar);
-
             Console.WriteLine("usage:");
             Console.WriteLine("ant-tools.py antFileName [--validate] [--stats] [--range=RANGE] [--bed=PATH] [--memlimit=LIMIT_IN_MB\n\r");
             Console.WriteLine("antFileName: the fully qualified path to the .ant file.");


secure SystemTime to always fall back to utc

--- DirigoEdge/CustomUtils/SystemTime.cs
+++ DirigoEdge/CustomUtils/SystemTime.cs
@@ -13,12 +13,19 @@
         {
             get
             {
-                if (LocalTimeZoneInfo == null)
+                try
                 {
-                    SetLocalTimeZoneFromConfig();
+                    if (LocalTimeZoneInfo == null)
+                    {
+                        SetLocalTimeZoneFromConfig();
+                    }
+
+                    return LocalTimeZoneInfo.BaseUtcOffset;
                 }
-
-                return LocalTimeZoneInfo.BaseUtcOffset;
+                catch
+                {
+                    return TimeZoneInfo.Utc.BaseUtcOffset;
+                }
             }
         }

@@ -26,12 +33,19 @@
         {
             get
             {
-                if (LocalTimeZoneInfo == null)
+                try
                 {
-                    SetLocalTimeZoneFromConfig();
+                    if (LocalTimeZoneInfo == null)
+                    {
+                        SetLocalTimeZoneFromConfig();
+                    }
+
+                    return LocalTimeZoneInfo;
                 }
-
-                return LocalTimeZoneInfo;
+                catch
+                {
+                    return TimeZoneInfo.Utc;
+                }
             }
         }


should be under folder Properties, delete

--- AssemblyInfo.cs
+++ AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("MassTransit.Automatonymous.UnityIntegration")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("MassTransit.Automatonymous.UnityIntegration")]
-[assembly: AssemblyCopyright("Copyright ©  2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("2edeee00-69e0-4e0b-b241-6cf6a58ead63")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]


fix pop value from getObject

fix pop value from getObject

--- Assets/Plugins/Slua_Managed/LuaState.cs
+++ Assets/Plugins/Slua_Managed/LuaState.cs
@@ -1044,14 +1044,14 @@
 				LuaDLL.lua_getref (L, reference);
 				LuaDLL.lua_rawgeti (L, -1, index);
 				object returnValue = getObject (L, -1);
-				LuaDLL.lua_pop (L, 1);
+				LuaDLL.lua_pop (L, 2);
 				return returnValue;
 			} else {
 				LuaDLL.lua_getref (L, reference);
 				LuaDLL.lua_pushinteger (L, index);
 				LuaDLL.lua_gettable (L, -2);
 				object returnValue = getObject (L, -1);
-				LuaDLL.lua_pop (L, 1);
+				LuaDLL.lua_pop (L, 2);
 				return returnValue;
 			}
 		}


Add documentation for RSA JWK

Add documentation for RSA JWK

--- src/THNETII.Security.JOSE/JsonRsaWebKey.cs
+++ src/THNETII.Security.JOSE/JsonRsaWebKey.cs
@@ -4,6 +4,11 @@

 namespace THNETII.Security.JOSE
 {
+    ///
+    /// A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data
+    /// structure that represents a cryptographic key.
+    ///
+    /// <remarks>The JSON Web Key (JWK) is specified in RFC 7517.</remarks>
     [DataContract]
     public class JsonRsaWebKey : JsonWebKey
     {


recover API  new DynamicFont(name, font)

recover API  new DynamicFont(name, font)

--- Assets/Scripts/Core/Text/DynamicFont.cs
+++ Assets/Scripts/Core/Text/DynamicFont.cs
@@ -29,6 +29,18 @@
             this.shader = ShaderConfig.textShader;
         }

+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="font"></param>
+        /// <returns></returns>
+        public DynamicFont(string name, Font font) : this()
+        {
+            this.name = name;
+            this.nativeFont = font;
+        }
+
         override public void Dispose()
         {
             Font.textureRebuilt -= textureRebuildCallback;


U4-10825 Search member by email in member section

--- src/Umbraco.Core/Services/MemberService.cs
+++ src/Umbraco.Core/Services/MemberService.cs
@@ -695,7 +695,7 @@
                 IQuery<IMember> filterQuery = null;
                 if (filter.IsNullOrWhiteSpace() == false)
                 {
-                    filterQuery = Query<IMember>.Builder.Where(x => x.Name.Contains(filter) || x.Username.Contains(filter));
+                    filterQuery = Query<IMember>.Builder.Where(x => x.Name.Contains(filter) || x.Username.Contains(filter) || x.Email.Contains(filter));
                 }

                 var repository = RepositoryFactory.CreateMemberRepository(uow);


Added saying for physical and mental pain

--- Assets/Scripts/Human/SayRandomThings.cs
+++ Assets/Scripts/Human/SayRandomThings.cs
@@ -10,6 +10,9 @@
     // get dialog manager
     _manager = GameObject.Find("DialogManager").GetComponent<DialogManager>();

+    // get sinner component
+    _sinner = GetComponent<Sinner>();
+
     // say
     StartCoroutine(Say());
   }
@@ -18,13 +21,39 @@
   ///   Says hello or a thing.
   /// </summary>
   private IEnumerator Say() {
+    // get pending pain
+    var pendingMental = _sinner.MentalPain - LastMental;
+    var pendingPhysical = _sinner.PhysicalPain - LastPhysical;
+
+    // reset
+    LastMental = _sinner.MentalPain;
+    LastPhysical = _sinner.PhysicalPain;
+
     // wait
     yield return new WaitForSeconds(Random.Range(MinWait, MaxWait));

     if (enabled) {
-      if (transform.localRotation.eulerAngles.z > 0) {
+      if (pendingPhysical > 0f) {
+        // getting physically hurt
+        _manager.Say(PhysicalOuchSentences[Random.Range(0, PhysicalOuchSentences.Length)],
+                     new Vector2(0, 20f),
+                     2f,
+                     gameObject);
+      }
+      else if (pendingMental > 0f) {
+        // getting mentally hurt
+        _manager.Say(MentalOuchSentences[Random.Range(0, MentalOuchSentences.Length)],
+                     new Vector2(0, 20f),
+                     2f,
+                     gameObject);
+      }
+
+      else if (transform.localRotation.eulerAngles.z > 0) {
         // we are carried, say ouch
-        _manager.Say(OuchSentences[Random.Range(0, OuchSentences.Length)], new Vector2(0, 20f), 2f, gameObject);
+        _manager.Say(CarriedOuchSentences[Random.Range(0, CarriedOuchSentences.Length)],
+                     new Vector2(0, 20f),
+                     2f,
+                     gameObject);
       }
       else if (_saidHello) {
         // say random thing
@@ -42,6 +71,13 @@
   }

   /// <summary>
+  ///   What to say when picked up.
+  /// </summary>
+  public string[] CarriedOuchSentences = {
+    "Ouch!", "Ou!", "That's painful.", "It hurts!", "Put me down...", "Please!"
+  };
+
+  /// <summary>
   ///   What to say as hello.
   /// </summary>
   public string[] HelloSentences = {
@@ -51,6 +87,14 @@
   public float MaxWait = 20f;

   /// <summary>
+  ///   What to say when mentally hurt.
+  /// </summary>
+  public string[] MentalOuchSentences = {
+    "I'm scared!", "I want to go home.", "What is this scary place?", "I think I'm crazy.", "Ou, my brain...",
+    "I... can't... think...", "Please! Let me be!", "This drives me nuts."
+  };
+
+  /// <summary>
   ///   Mental pain waiting to be processed, outside of this component.
   /// </summary>
   public float MentalPainToProcess = 0f;
@@ -58,10 +102,11 @@
   public float MinWait = 5f;

   /// <summary>
-  ///   What to say when picked up.
+  ///   What to say when physically hurt.
   /// </summary>
-  public string[] OuchSentences = {
-    "Ouch!", "Ou!", "That's painful.", "It hurts!", "Put me down...", "Please!"
+  public string[] PhysicalOuchSentences = {
+    "Ouch!", "That really hurts!", "Oooch!", "Too... much... pain...", "Is that my leg?", "Everything hurts!",
+    "Stop it already!!!", "I'm getting wrecked!", "My last sentence...", "No pain, no gain.", "Pain is temporary!"
   };

   /// <summary>
@@ -87,4 +132,12 @@
   /// </summary>
   private bool _saidHello;

+  /// <summary>
+  ///   The sinner component.
+  /// </summary>
+  private Sinner _sinner;
+
+  private float LastMental;
+  private float LastPhysical;
+
 }


Modify progress helper so that activity indicator stops after last call ends

--- src/UserInteraction/Core/ProgressHelper.cs
+++ src/UserInteraction/Core/ProgressHelper.cs
@@ -10,6 +10,7 @@
     public class ProgressHelper
     {
         private readonly IMvxMainThreadDispatcher _dispatcher;
+        private int _progressIndicatorCount;

         public ProgressHelper(IMvxMainThreadDispatcher dispatcher)
         {
@@ -26,13 +27,17 @@
         /// <param name="stopProgressAction">Action that will hide the progress indicator</param>
         public void SetupTask<T>(Task<T> task, Action<Task<T>> onCompletion, Action startProgressAction, Action stopProgressAction)
         {
+            _progressIndicatorCount++;
             _dispatcher.RequestMainThreadAction(startProgressAction);

             task.ContinueWith(x =>
             {
                 onCompletion(task);

-                _dispatcher.RequestMainThreadAction(stopProgressAction);
+                if (--_progressIndicatorCount == 0)
+                {
+                    _dispatcher.RequestMainThreadAction(stopProgressAction);
+                }
             });
         }
     }


Notes which sounds are not yet placed.

Notes which sounds are not yet placed.

--- Assets/Scripts/Managers/SoundManager.cs
+++ Assets/Scripts/Managers/SoundManager.cs
@@ -18,12 +18,12 @@
     ContitionalFailed,
     PickupMachine,
     PlaceDownMachine,
-    StartTheMachine,
-    TestCasesPassed,
-    TestCasesFailed,
-    MachineHasFinished,
-    ClickOnTabletQuad,
-    ToggleBetweenInputs,
+    StartTheMachine, // Not yet placed.
+    TestCasesPassed, // Not yet placed.
+    TestCasesFailed, // Not yet placed.
+    MachineHasFinished, // Not yet placed.
+    ClickOnTabletQuad, // Not yet placed.
+    ToggleBetweenInputs, // Not yet placed.
     MachineDestroyed,
     RotateMover
   }


remove todo comments

remove todo comments

--- Assets/Scripts/RoomNavigationManager.cs
+++ Assets/Scripts/RoomNavigationManager.cs
@@ -19,8 +19,7 @@

         // spawn connectedRoom and save reference
         activeRoomPrefab = Instantiate(GetRoomPrefabById(connectedRoomId));
-
-        // place player near connected door
+
         // find position of connected door
         Vector3 connectedDoorPosition = GetDoorPosition(connectedDoorId);

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

     // assumes that a valid ID is provided, if not bad things will happen
-    // TODO how can this be done safer, or throw an error if no room is found with the given ID?
     GameObject GetRoomPrefabById(int id) {
         // loop through all the room prefabs
         foreach(GameObject room in RoomPrefabs) {
@@ -51,8 +49,6 @@
     }

     // assumes that a valid ID is provided, if not bad things will happen
-    // TODO how can this be done safer, or throw an error if no room is found with the given ID?
-    // TODO perhaps change roomDetail's Door array into an array of DoorDetails rather than GameObjects
     Vector3 GetDoorPosition(int doorId) {
         Vector3 doorPosition = Vector3.zero;


Fix incorrect stage animation number documentation

--- Assets/Scripts/Stage/StageController.cs
+++ Assets/Scripts/Stage/StageController.cs
@@ -56,9 +56,9 @@
 		Idle,		//0	Animation does nothing, camera is disabled
 		Outro,		//1	Part that changes depending on if you win/lose
 		Intro,		//2	Part that introduces the microgame
-		LastBeat,	//4	Starts at the last "beat" before the microgame ends, allowing the scene objects to pop back onscreen before unloading the microgame
-
-		SpeedUp		//5 Interruption between Outro and Intro when the game increases speed, speed is actually changed in Intro
+		LastBeat,	//3	Starts at the last "beat" before the microgame ends, allowing the scene objects to pop back onscreen before unloading the microgame
+
+		SpeedUp		//4 Interruption between Outro and Intro when the game increases speed, speed is actually changed in Intro
 	}

 	//Interruptions happen between Outro and Intro, signaling animations such as speeding up and introducing a boss microgame


Added `FrameStream.AbsolutePosition` to help debug reading bad data.

--- Assets/Scripts/Utilities/FrameStream.cs
+++ Assets/Scripts/Utilities/FrameStream.cs
@@ -45,6 +45,24 @@
             set
             {
                 Seek(value, SeekOrigin.Begin);
+            }
+        }
+
+        public long AbsoluteOffset
+        {
+            get
+            {
+                var frameStream = _baseStream as FrameStream;
+                if (frameStream == null) return _offset;
+                return _offset + frameStream.AbsolutePosition;
+            }
+        }
+
+        public long AbsolutePosition
+        {
+            get
+            {
+                return _position + AbsoluteOffset;
             }
         }


fix(UICanvas): unusable in Unity 5.6

fix(UICanvas): unusable in Unity 5.6

The UI Canvas creates a child game object to enable drag and drop of UI
elements on the canvas. That child object is a UI object so it gets
added a `RectTransform`. A `RectTransform` is inheriting from
`Transform` which means Unity does some stuff to the child object to
switch to that new transform. In Unity 5.6 this switching changed
somehow so the current implementation results in the parent of the
canvas' game object getting disabled.

The fix is to add the `RectTransform` as early as possible and only
adjust the parent and position of the transform afterwards.

--- Assets/VRTK/Scripts/UI/VRTK_UICanvas.cs
+++ Assets/VRTK/Scripts/UI/VRTK_UICanvas.cs
@@ -117,14 +117,14 @@
             if (canvas && !canvas.transform.FindChild(CANVAS_DRAGGABLE_PANEL))
             {
                 var draggablePanel = new GameObject(CANVAS_DRAGGABLE_PANEL);
+                draggablePanel.AddComponent<RectTransform>();
+                draggablePanel.AddComponent<Image>().color = Color.clear;
+                draggablePanel.AddComponent<EventTrigger>();
                 draggablePanel.transform.SetParent(canvas.transform);
                 draggablePanel.transform.localPosition = Vector3.zero;
                 draggablePanel.transform.localRotation = Quaternion.identity;
                 draggablePanel.transform.localScale = Vector3.one;
                 draggablePanel.transform.SetAsFirstSibling();
-                draggablePanel.AddComponent<RectTransform>();
-                draggablePanel.AddComponent<Image>().color = Color.clear;
-                draggablePanel.AddComponent<EventTrigger>();

                 draggablePanel.GetComponent<RectTransform>().sizeDelta = canvasSize;
             }


调整UserController的授权验证模式。 :muscle:

调整UserController的授权验证模式。 :muscle:

--- src/api/Http/Controllers/UserController.cs
+++ src/api/Http/Controllers/UserController.cs
@@ -43,7 +43,7 @@

 namespace Zongsoft.Security.Web.Http.Controllers
 {
-	[Authorization(Roles = "Security")]
+	[Authorization]
 	public class UserController : ApiController
 	{
 		#region 成员字段


Added more robust checking for existing definitions

--- Circuit/Analysis.cs
+++ Circuit/Analysis.cs
@@ -157,7 +157,15 @@
         /// </summary>
         /// <param name="Key"></param>
         /// <param name="Value"></param>
-        public void AddDefinition(Expression Key, Expression Value) { context.Definitions.Add(Key, Value); }
+        public void AddDefinition(Expression Key, Expression Value)
+        {
+            Expression value;
+            if (!context.Definitions.TryGetValue(Key, out value))
+                context.Definitions.Add(Key, Value);
+            else if (!value.Equals(Value))
+                throw new ArgumentException("Redefinition of '" + Key.ToString() + "'.");
+        }
+        public void AddDefinition(Arrow x) { AddDefinition(x.Left, x.Right); }

         /// <summary>
         /// Add equations to the system.


fix value keyword parsing to avoid OutOfMemoryException

--- CobaltAHK/Parser.cs
+++ CobaltAHK/Parser.cs
@@ -595,7 +595,8 @@
 				return GetVariable(id.Text, lexer.Position);

 			} else if (token is ValueKeywordToken) {
-				return new ValueKeywordExpression(lexer.Position, ((ValueKeywordToken)token).Keyword);
+				var value = (ValueKeywordToken)lexer.GetToken();
+				return new ValueKeywordExpression(lexer.Position, value.Keyword);

 			} else if (token is QuotedStringToken) {
 				var str = (QuotedStringToken)lexer.GetToken();


Fixed unit tests

Fixed unit tests

git-svn-id: c5150317060de8552ff1058b2431ffc13c353cb7@659 0d3f3ea6-ac51-0410-a1de-edb5cd2a854a

--- encog-core-cs/ML/Genetic/Population/BasicPopulation.cs
+++ encog-core-cs/ML/Genetic/Population/BasicPopulation.cs
@@ -66,13 +66,7 @@
         /// </summary>
         ///
         private readonly IGenerateID innovationIDGenerate;
-
-        /// <summary>
-        /// The species in this population.
-        /// </summary>
-        ///
-        private readonly IList<ISpecies> species;
-
+
         /// <summary>
         /// Generate species id's.
         /// </summary>
@@ -97,7 +91,7 @@
             innovationIDGenerate = new BasicGenerateID();
             OldAgePenalty = DEFAULT_OLD_AGE_PENALTY;
             OldAgeThreshold = DEFAULT_OLD_AGE_THRESHOLD;
-            species = new List<ISpecies>();
+            Species = new List<ISpecies>();
             speciesIDGenerate = new BasicGenerateID();
             SurvivalRate = DEFAULT_SURVIVAL_RATE;
             youngBonusAgeThreshold = DEFAULT_YOUTH_THRESHOLD;
@@ -117,7 +111,7 @@
             innovationIDGenerate = new BasicGenerateID();
             OldAgePenalty = DEFAULT_OLD_AGE_PENALTY;
             OldAgeThreshold = DEFAULT_OLD_AGE_THRESHOLD;
-            species = new List<ISpecies>();
+            Species = new List<ISpecies>();
             speciesIDGenerate = new BasicGenerateID();
             SurvivalRate = DEFAULT_SURVIVAL_RATE;
             youngBonusAgeThreshold = DEFAULT_YOUTH_THRESHOLD;


Update MailSender.cs

Update MailSender.cs

--- mcLauncher/Core/MailSender.cs
+++ mcLauncher/Core/MailSender.cs
@@ -35,7 +35,7 @@
             client.Timeout = 10000;
             client.DeliveryMethod = SmtpDeliveryMethod.Network;
             client.UseDefaultCredentials = false;
-            client.Credentials = new System.Net.NetworkCredential("blockslife.bugreporter@gmail.com", "7531598426rodionpass");
+            client.Credentials = new System.Net.NetworkCredential("blockslife.bugreporter@gmail.com", "blockslifeerrorreporter");
             return client;
         }


Profiler bug fixes #FIX: Added conditional compile flags to the SaveTextReport to stop them crashing in non-profiled builds.

--- Duality/Utility/Profiling/Profile.cs
+++ Duality/Utility/Profiling/Profile.cs
@@ -206,6 +206,7 @@
 		/// Saves a text report of the current profiling data to the specified file.
 		/// </summary>
 		/// <param name="filePath"></param>
+		[Conditional("PROFILE")]
 		public static void SaveTextReport(string filePath)
 		{
 			using (FileStream str = File.Open(filePath, FileMode.Create))
@@ -217,6 +218,7 @@
 		/// Saves a text report of the current profiling data to the specified stream.
 		/// </summary>
 		/// <param name="filePath"></param>
+		[Conditional("PROFILE")]
 		public static void SaveTextReport(Stream stream)
 		{
 			string report = GetTextReport(counterMap.Values.Where(c => c.HasData),


Correct "home" folder on Windows

Correct "home" folder on Windows

--- Duplicati/Library/Utility/Utility.cs
+++ Duplicati/Library/Utility/Utility.cs
@@ -907,7 +907,7 @@
         /// <summary>
         /// The path to the users home directory
         /// </summary>
-        private static readonly string HOME_PATH = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+        private static readonly string HOME_PATH = Environment.GetFolderPath(IsClientLinux ? Environment.SpecialFolder.Personal : Environment.SpecialFolder.UserProfile);

         /// <summary>
         /// Expands environment variables, including the tilde character


Download exploration data from EDDiscoveryData

--- EDDiscovery/EDDiscoveryController.cs
+++ EDDiscovery/EDDiscoveryController.cs
@@ -85,6 +85,7 @@

         public event Action OnMapsDownloaded;                               // UI
         public event Action<bool> OnExpeditionsDownloaded;                  // UI, true if changed entries
+        public event Action OnExplorationDownloaded;                        // UI

         #endregion

@@ -564,6 +565,9 @@

                     // and Expedition data
                     DownloadExpeditions(() => PendingClose);
+
+                    // and Exploration data
+                    DownloadExploration(() => PendingClose);
                 }

                 // Former CheckSystems, reworked to accomodate new switches..
@@ -915,6 +919,43 @@
             });
         }

+        public void DownloadExploration(Func<bool> cancelRequested)
+        {
+            LogLine("Checking for new Exploration data".Tx(this, "EXPL"));
+
+            Task.Factory.StartNew(() =>
+            {
+                string explorationdir = EDDOptions.Instance.ExploreAppDirectory();
+                string progexploredir = System.IO.Path.Combine(EDDOptions.ExeDirectory(), "Exploration");
+
+                if (System.IO.Directory.Exists(progexploredir))
+                {
+                    foreach (string filename in System.IO.Directory.GetFiles(progexploredir, "*.json"))
+                    {
+                        string destfile = System.IO.Path.Combine(explorationdir, System.IO.Path.GetFileName(filename));
+
+                        if (!System.IO.File.Exists(destfile) || System.IO.File.GetLastWriteTimeUtc(filename) > System.IO.File.GetLastWriteTimeUtc(destfile))
+                        {
+                            System.IO.File.Copy(filename, destfile, true);
+                        }
+                    }
+                }
+
+                BaseUtils.GitHubClass github = new BaseUtils.GitHubClass(EDDiscovery.Properties.Resources.URLGithubDataDownload, LogLine);
+                var files = github.ReadDirectory("Exploration");
+                if (files != null)        // may be empty, unlikely, but
+                {
+                    if (github.DownloadFiles(files, explorationdir))
+                    {
+                        if (!cancelRequested())
+                        {
+                            InvokeAsyncOnUiThread(() => { OnExplorationDownloaded?.Invoke(); });
+                        }
+                    }
+                }
+            });
+        }
+
         #endregion

         #endregion


Fix race in history refresh

Fix race in history refresh

--- EDDiscovery/EDDiscoveryController.cs
+++ EDDiscovery/EDDiscoveryController.cs
@@ -211,22 +211,32 @@
                 return false;
             }

-            if (Interlocked.CompareExchange(ref refreshRequestedFlag, 1, 0) == 0)
-            {
-                InvokeSyncOnUiThread(() =>
-                {
-                    OnRefreshStarting?.Invoke();
-                    journalmonitor.StopMonitor();          // this is called by the foreground.  Ensure background is stopped.  Foreground must restart it.
-                });
-
-                refreshWorkerArgs = new RefreshWorkerArgs
+            bool newrefresh = false;
+
+            RefreshWorkerArgs curargs = refreshWorkerArgs;
+            if (refreshRequestedFlag == 0)
+            {
+                if (curargs == null ||
+                    curargs.CheckEdsm != checkedsm ||
+                    curargs.ForceNetLogReload != forcenetlogreload ||
+                    curargs.ForceJournalReload != forcejournalreload ||
+                    curargs.CurrentCommander != (currentcmdr ?? history.CommanderId) ||
+                    curargs.NetLogPath != netlogpath)
+                {
+                    newrefresh = true;
+                }
+            }
+
+            if (Interlocked.CompareExchange(ref refreshRequestedFlag, 1, 0) == 0 || newrefresh)
+            {
+                refreshWorkerQueue.Enqueue(new RefreshWorkerArgs
                 {
                     NetLogPath = netlogpath,
                     ForceNetLogReload = forcenetlogreload,
                     ForceJournalReload = forcejournalreload,
                     CheckEdsm = checkedsm,
                     CurrentCommander = currentcmdr ?? history.CommanderId
-                };
+                });

                 refreshRequested.Set();
                 return true;
@@ -286,9 +296,10 @@

         private EliteDangerous.EDJournalClass journalmonitor;

-        private RefreshWorkerArgs refreshWorkerArgs = new RefreshWorkerArgs();
+        private ConcurrentQueue<RefreshWorkerArgs> refreshWorkerQueue = new ConcurrentQueue<RefreshWorkerArgs>();
         private SystemClass.SystemsSyncState syncstate = new SystemClass.SystemsSyncState();
         private ConcurrentQueue<StardistRequest> closestsystem_queue = new ConcurrentQueue<StardistRequest>();
+        private RefreshWorkerArgs refreshWorkerArgs = new RefreshWorkerArgs();

         private Thread backgroundWorker;
         private Thread backgroundRefreshWorker;
@@ -297,6 +308,7 @@
         private ManualResetEvent closeRequested = new ManualResetEvent(false);
         private ManualResetEvent readyForInitialLoad = new ManualResetEvent(false);
         private ManualResetEvent readyForUiInvoke = new ManualResetEvent(false);
+        private ManualResetEvent readyForNewRefresh = new ManualResetEvent(false);
         private AutoResetEvent refreshRequested = new AutoResetEvent(false);
         private AutoResetEvent resyncRequestedEvent = new AutoResetEvent(false);
         private AutoResetEvent stardistRequested = new AutoResetEvent(false);
@@ -496,6 +508,7 @@
             HistoryList hist = null;
             try
             {
+                refreshWorkerArgs = args;
                 hist = HistoryList.LoadHistory(journalmonitor, () => PendingClose, (p, s) => ReportProgress(p, $"Processing log file {s}"), args.NetLogPath, args.ForceJournalReload, args.ForceJournalReload, args.CheckEdsm, args.CurrentCommander);
             }
             catch (Exception ex)
@@ -539,6 +552,7 @@
                 OnRefreshComplete?.Invoke();

                 refreshRequestedFlag = 0;
+                readyForNewRefresh.Set();
             }
         }

@@ -611,9 +625,12 @@

         private void BackgroundRefreshWorkerThread()
         {
+            WaitHandle.WaitAny(new WaitHandle[] { closeRequested, readyForNewRefresh }); // Wait to be ready for new refresh after initial refresh
             while (!PendingClose)
             {
                 int wh = WaitHandle.WaitAny(new WaitHandle[] { closeRequested, refreshRequested });
+                RefreshWorkerArgs argstemp = null;
+                RefreshWorkerArgs args = null;

                 if (PendingClose) break;

@@ -622,7 +639,24 @@
                     case 0:  // Close Requested
                         break;
                     case 1:  // Refresh Requested
-                        DoRefreshHistory(refreshWorkerArgs);
+                        InvokeSyncOnUiThread(() =>
+                        {
+                            OnRefreshStarting?.Invoke();
+                            journalmonitor.StopMonitor();          // this is called by the foreground.  Ensure background is stopped.  Foreground must restart it.
+                        });
+
+
+                        while (refreshWorkerQueue.TryDequeue(out argstemp)) // Get the most recent refresh
+                        {
+                            args = argstemp;
+                        }
+
+                        if (args != null)
+                        {
+                            readyForNewRefresh.Reset();
+                            DoRefreshHistory(args);
+                            WaitHandle.WaitAny(new WaitHandle[] { closeRequested, readyForNewRefresh }); // Wait to be ready for new refresh
+                        }
                         break;
                 }
             }


fixed coroutine singleton behaviour

fixed coroutine singleton behaviour

--- CoroutineManager.cs
+++ CoroutineManager.cs
@@ -7,29 +7,38 @@
     public static class CoroutineManager
     {
         private class _coroutineBehaviour : MonoBehaviour { };
+
         private static _coroutineBehaviour _monoBehaviour;

+        private static _coroutineBehaviour coroutineBehaviour
+        {
+            get
+            {
+                if (_monoBehaviour == null)
+                {
+                    GameObject gameObject = new GameObject(typeof(TweenManager).Name);
+                    gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector | HideFlags.DontSave;
+                    Object.DontDestroyOnLoad(gameObject);
+                    _monoBehaviour = gameObject.AddComponent<_coroutineBehaviour>();
+                }
+
+                return _monoBehaviour;
+            }
+        }
+
         public static Coroutine Start(IEnumerator p_enumerator)
         {
-            if (_monoBehaviour == null)
-            {
-                GameObject gameObject = new GameObject(typeof(CoroutineManager).Name);
-                gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector | HideFlags.DontSave;
-                Object.DontDestroyOnLoad(gameObject);
-                _monoBehaviour = gameObject.AddComponent<_coroutineBehaviour>();
-            }
-
-            return _monoBehaviour.StartCoroutine(p_enumerator);
+            return coroutineBehaviour.StartCoroutine(p_enumerator);
         }

         public static void Kill(Coroutine p_coroutine)
         {
-            _monoBehaviour.StopCoroutine(p_coroutine);
+            coroutineBehaviour.StopCoroutine(p_coroutine);
         }

         public static void KillAll()
         {
-            _monoBehaviour.StopAllCoroutines();
+            coroutineBehaviour.StopAllCoroutines();
         }
     }
-}+}


Refactored the RegistryHelper class

Refactored the RegistryHelper class

--- Espera/Espera.View/RegistryHelper.cs
+++ Espera/Espera.View/RegistryHelper.cs
@@ -12,49 +12,26 @@

         private static bool IsApplicationInstalled(string applicationName)
         {
-            string displayName;
-
-            // Search in: CurrentUser
-            RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
-
-            foreach (RegistryKey subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))
+            using (RegistryKey currentUser = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
             {
-                displayName = subkey.GetValue("DisplayName") as string;
-
-                if (displayName != null && displayName.Contains(applicationName))
+                using (RegistryKey localMachine32 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
                 {
-                    return true;
+                    using (RegistryKey localMachine64 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"))
+                    {
+                        return IsApplicationInKey(currentUser, applicationName) ||
+                               IsApplicationInKey(localMachine32, applicationName) ||
+                               IsApplicationInKey(localMachine64, applicationName);
+                    }
                 }
             }
+        }

-            // Search in: LocalMachine_32
-            key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
-
-            foreach (RegistryKey subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))
-            {
-                displayName = subkey.GetValue("DisplayName") as string;
-
-                if (displayName != null && displayName.Contains(applicationName))
-                {
-                    return true;
-                }
-            }
-
-            // Search in: LocalMachine_64
-            key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall");
-
-            foreach (RegistryKey subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))
-            {
-                displayName = subkey.GetValue("DisplayName") as string;
-
-                if (displayName != null && displayName.Contains(applicationName))
-                {
-                    return true;
-                }
-            }
-
-            // Not found
-            return false;
+        private static bool IsApplicationInKey(RegistryKey key, string applicationName)
+        {
+            return key.GetSubKeyNames()
+                .Select(key.OpenSubKey)
+                .Select(subkey => subkey.GetValue("DisplayName") as string)
+                .Any(displayName => displayName != null && displayName.Contains(applicationName));
         }
     }
 }


#100 Small fixes - unused property removed. List equip set names when an equip set not found.

--- ExampleScripts/UOErebor/EquipSet.csx
+++ ExampleScripts/UOErebor/EquipSet.csx
@@ -2,6 +2,7 @@
 #load "equip.csx"
 #load "warehouse.csx"

+using System;
 using System.Linq;
 using System.Collections.Generic;

@@ -64,8 +65,6 @@
         = new Dictionary<string, EquipSet>();

     public StoredEquipment[] Equips { get; set;}
-
-    public ObjectId[] ItemIds => Equips.Select(x => x.Id).ToArray();

     public void Dress()
     {
@@ -151,6 +150,7 @@
         if (!EquipmentSets.TryGetValue(name, out var equip))
         {
             UO.ClientPrint($"Unknown equip set '{name}'.");
+            ListEquipSets();
             return null;
         }

@@ -221,4 +221,4 @@
 UO.RegisterCommand("equip-undress", EquipSet.UndressEquipSet);
 UO.RegisterCommand("equip-undress-to", EquipSet.UndressEquipSetTo);
 UO.RegisterCommand("equip-list", EquipSet.ListEquipSets);
-UO.RegisterCommand("equip-remove", EquipSet.RemoveEquipSet);+UO.RegisterCommand("equip-remove", EquipSet.RemoveEquipSet);


Fixed RibbonTabsContainer measure.

Fixed RibbonTabsContainer measure.

--- Fluent/Fluent/RibbonTabsContainer.cs
+++ Fluent/Fluent/RibbonTabsContainer.cs
@@ -78,15 +78,17 @@
             // of all the tabs until the minimum padding required for displaying
             // the tab selection and hover states is reached (regular tabs)
             double overflowWidth = desiredSize.Width - availableSize.Width;
-            double whitespace = (Children[0] as RibbonTabItem).Indent;
-            RibbonTabItem[] contextualTabs = Children.Cast<RibbonTabItem>().Where(x => x.IsContextual).ToArray();
-            IEnumerable<RibbonTabItem> reversedChildren = Children.Cast<RibbonTabItem>().Reverse();
+            double whitespace = (InternalChildren[0] as RibbonTabItem).Indent;
+            RibbonTabItem[] contextualTabs = InternalChildren.Cast<RibbonTabItem>().Where(x => (x.IsContextual) && (x.Visibility != Visibility.Collapsed)).ToArray();
             double contextualTabsCount = contextualTabs.Length;
-            double regularTabsCount = Children.Count - contextualTabsCount;
+            var regularTabs =
+                InternalChildren.Cast<RibbonTabItem>().Where(x => (!x.IsContextual) && (x.Visibility != Visibility.Collapsed));
+            double regularTabsCount = regularTabs.Count();//InternalChildren.Count - contextualTabsCount;
+            double childrenCount = contextualTabsCount + regularTabsCount;
             if (overflowWidth < regularTabsCount * whitespace * 2)
             {
                 double decreaseValue = overflowWidth / (double)regularTabsCount;
-                foreach (RibbonTabItem tab in Children) if (!tab.IsContextual) tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - decreaseValue), tab.DesiredSize.Height));// tab.Width = Math.Max(0, tab.ActualWidth - decreaseValue);
+                foreach (RibbonTabItem tab in regularTabs) tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - decreaseValue), tab.DesiredSize.Height));// tab.Width = Math.Max(0, tab.ActualWidth - decreaseValue);
                 desiredSize = GetChildrenDesiredSize();
                 if (desiredSize.Width > availableSize.Width) desiredSize.Width = availableSize.Width;

@@ -100,22 +102,22 @@
             // Step 3. Gradually and uniformly remove the padding from both sides
             // of all the tabs until the minimum padding required for displaying
             // the tab selection and hover states is reached (contextual tabs)
-            if (overflowWidth < Children.Count * whitespace * 2)
+            if (overflowWidth < childrenCount * whitespace * 2)
             {
                 double regularTabsWhitespace = (double)regularTabsCount * whitespace * 2.0;
                 double decreaseValue = (overflowWidth - regularTabsWhitespace) / (double)contextualTabsCount;
-                foreach (RibbonTabItem tab in Children)
+                foreach (RibbonTabItem tab in regularTabs)
                 {
-                    if (!tab.IsContextual)
+                    //if (!tab.IsContextual)
                     {
                         double widthBeforeMeasure = tab.DesiredSize.Width;
                         tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - whitespace*2.0), tab.DesiredSize.Height));
                         overflowWidth -= widthBeforeMeasure - tab.DesiredSize.Width;
                     }
                 }
-                foreach (RibbonTabItem tab in reversedChildren)
+                foreach (RibbonTabItem tab in contextualTabs.Reverse())
                 {
-                    if (tab.IsContextual)
+                    //if (tab.IsContextual)
                     {
                         double widthBeforeMeasure = tab.DesiredSize.Width;
                         tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - decreaseValue), tab.DesiredSize.Height));
@@ -140,18 +142,18 @@
             // truncating the text label. Continue reducing the width of the largest
             // tab (or tabs in the case of ties) until all tabs are the same width.
             // (Regular tabs)
-            foreach (RibbonTabItem tab in Children)
-            {
-                if (!tab.IsContextual)
+            foreach (RibbonTabItem tab in regularTabs)
+            {
+                //if (!tab.IsContextual)
                 {
                     double widthBeforeMeasure = tab.DesiredSize.Width;
                     tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - whitespace * 2.0), tab.DesiredSize.Height));
                     overflowWidth -= widthBeforeMeasure - tab.DesiredSize.Width;
                 }
             }
-            foreach (RibbonTabItem tab in reversedChildren)
-            {
-                if (tab.IsContextual)
+            foreach (RibbonTabItem tab in contextualTabs.Reverse())
+            {
+                //if (tab.IsContextual)
                 {
                     double widthBeforeMeasure = tab.DesiredSize.Width;
                     tab.Measure(new Size(Math.Max(0, tab.DesiredSize.Width - whitespace * 2.0), tab.DesiredSize.Height));
@@ -173,8 +175,7 @@
             }

             // Sort regular tabs by descending
-            RibbonTabItem[] sortedRegularTabItems = Children.Cast<RibbonTabItem>()
-                .Where(x => !x.IsContextual)
+            RibbonTabItem[] sortedRegularTabItems = regularTabs
                 .OrderByDescending(x => x.DesiredSize.Width)
                 .ToArray();

@@ -219,12 +220,12 @@
             if (overflowWidth < regularTabsWidth - minimumRegularTabsWidth)
             {
                 double settedWidth = (regularTabsWidth - overflowWidth) / (double)regularTabsCount;
-                for (int i = 0; i < reduceCount; i++)
+                for (int i = 0; i < regularTabsCount; i++)
                 {
                     sortedRegularTabItems[i].Measure(new Size(settedWidth, availableSize.Height));
                 }
                 desiredSize = GetChildrenDesiredSize();
-                if (desiredSize.Width > availableSize.Width) desiredSize.Width = availableSize.Width;
+                //if (desiredSize.Width > availableSize.Width) desiredSize.Width = availableSize.Width;

                 // Add separator lines between
                 // tabs to assist readability
@@ -237,7 +238,7 @@
             // truncating the text label. Continue reducing the width of the largest
             // tab (or tabs in the case of ties) until all tabs are the same width.
             // (Contextual tabs)
-            for (int i = 0; i < reduceCount; i++)
+            for (int i = 0; i < regularTabsCount; i++)
             {
                 sortedRegularTabItems[i].Measure(new Size(30, availableSize.Height));
             }


Corrections

Corrections

--- EnigmaReferencer.cs
+++ EnigmaReferencer.cs
@@ -59,6 +59,10 @@
             enigmas.Add(new Enigma(new TapeTaupeEnigmaPanel(), "Tape-taupe"));
             enigmas.Add(new Enigma(new TrouverEnigmaPanel(), "Trouver Cristiano"));
             enigmas.Add(new Enigma(new ZombieInvasionEnigmaPanel(), "ZombieInvasion"));
+            enigmas.Add(new Enigma(new CodeBarreEnigmaPanel(), "Le code barre"));
+            enigmas.Add(new Enigma(new CombienDeSEnigmaPanel(), "Combien de s ?"));
+            enigmas.Add(new Enigma(new CoucheCouleurEnigmaPanel(), "Couche Couleur"));
+            enigmas.Add(new Enigma(new CrypteDeLaFoulqueDesTenebresEnigmaPanel(), "Foulque des Ténèbres"));

             // Énigmes avec prérequis


logging bug

logging bug

--- Debugger/Log.cs
+++ Debugger/Log.cs
@@ -13,7 +13,7 @@
         }
         public static void Warning(string s)
         {
-            DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Error, s);
+            DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Warning, s);
         }
     }
 }


Config reloading on open.

Config reloading on open.

--- Fusion/Core/Development/LaunchBox.cs
+++ Fusion/Core/Development/LaunchBox.cs
@@ -34,16 +34,26 @@

 		string configPath;
+		string configName;

 		private LaunchBox ( Game game, string config )
 		{
 			this.game	=	game;
+			configName	=	config;
 			configPath	=	game.UserStorage.GetFullPath(config);

 			InitializeComponent();

 			this.Text	=	game.GameTitle;
+
+			UpdateControls();
+		}
+
+
+
+		void UpdateControls ()
+		{

 			//	version :
 			versionLabel.Text	=	game.GetReleaseInfo();
@@ -65,6 +75,8 @@
 			//	use debug device :
 			debugDevice.Checked	=	game.RenderSystem.Config.UseDebugDevice;
 		}
+
+

 		private void button1_Click ( object sender, EventArgs e )
 		{
@@ -92,29 +104,42 @@
 			this.Close();
 		}

+
+
 		private void button3_Click ( object sender, EventArgs e )
 		{
 			this.Close();
 		}

-		void ShellExecute ( string path )
+
+		void ShellExecute ( string path, bool wait = false )
 		{
 			ProcessStartInfo psi = new ProcessStartInfo(path);
 			psi.UseShellExecute = true;
-			Process.Start(psi);
+			var proc = Process.Start(psi);
+			if (wait) {
+				proc.WaitForExit();
+			}
 		}
+

 		private void openConfig_Click ( object sender, EventArgs e )
 		{
-			ShellExecute( configPath );
+			ShellExecute( configPath, true );
+			game.LoadConfiguration(configName);
+			UpdateControls();
 		}
+
+

 		private void button2_Click ( object sender, EventArgs e )
 		{
 			ShellExecute( Path.GetDirectoryName(configPath) );
 		}
+
+

 		private void openContent_Click ( object sender, EventArgs e )
 		{
@@ -122,16 +147,22 @@
 			ShellExecute(file);
 		}

+
+
 		private void button4_Click ( object sender, EventArgs e )
 		{
 			var file = (string)game.Invoker.PushAndExecute("contentFile");
 			ShellExecute(Path.GetDirectoryName(file));
 		}

+
+
 		private void buildContent_Click ( object sender, EventArgs e )
 		{
 			game.Invoker.PushAndExecute("contentBuild");
 		}
+
+

 		private void rebuildContent_Click ( object sender, EventArgs e )
 		{


Reset time when setting an animation

Reset time when setting an animation

--- GUI/Types/Renderer/ModelSceneNode.cs
+++ GUI/Types/Renderer/ModelSceneNode.cs
@@ -259,6 +259,7 @@

         public void SetAnimation(string animationName)
         {
+            time = 0f;
             activeAnimation = animations.FirstOrDefault(a => a.Name == animationName);
             if (activeAnimation != default)
             {


Made HourlyRate nullable

Made HourlyRate nullable

Made HourlyRate nullable to fix #71

--- Harvest.Net/Models/TaskAssignment.cs
+++ Harvest.Net/Models/TaskAssignment.cs
@@ -47,7 +47,7 @@
         /// <summary>
         /// Hourly rate for the task assignment.
         /// </summary>
-        public decimal HourlyRate { get; set; }
+        public decimal? HourlyRate { get; set; }

         /// <summary>
         /// Total budget given for the task assignment.


Redundant async/await removed

Redundant async/await removed

--- ITCC.WPF/Loggers/ObservableLogger.cs
+++ ITCC.WPF/Loggers/ObservableLogger.cs
@@ -30,7 +30,7 @@
                 await FlushAsync();
         }

-        public async Task FlushAsync()
+        public Task FlushAsync()
         {
             Action flushAction = () =>
             {
@@ -41,7 +41,7 @@
                 }
             };

-            await _asyncUiThreadRunner.Invoke(flushAction);
+            return _asyncUiThreadRunner.Invoke(flushAction);
         }

         #endregion


Global wildcard tests

Global wildcard tests

--- IgnoreSharp.Tests/IgnoreRuleTests.cs
+++ IgnoreSharp.Tests/IgnoreRuleTests.cs
@@ -112,12 +112,25 @@
         }

         [Test]
-        public void BASIC_WILDCARD()
+        public void Match_Global_Wildcards()
         {
             var rule = new IgnoreRule("*.txt");
+            Assert.IsTrue(rule.IsMatch("/test.txt", false));
+            Assert.IsTrue(rule.IsMatch("/sub1/test.txt", false));
+            Assert.IsTrue(rule.IsMatch("/sub1/sub2/test.txt", false));
+            // Should match directory as well
             Assert.IsTrue(rule.IsMatch("/test.txt", true));
-            //Assert.IsTrue(rule.IsMatch("/sub1/test.txt", true));
-            //Assert.IsTrue(rule.IsMatch("/sub1/sub2/test.txt", true));
+        }
+
+        [Test]
+        public void Negated_Match_Global_Wildcards()
+        {
+            var rule = new IgnoreRule("!*.txt");
+            Assert.IsFalse(rule.IsMatch("/test.txt", false));
+            Assert.IsFalse(rule.IsMatch("/sub1/test.txt", false));
+            Assert.IsFalse(rule.IsMatch("/sub1/sub2/test.txt", false));
+            // Should match directory as well
+            Assert.IsFalse(rule.IsMatch("/test.txt", true));
         }

         [TearDown]


Move collection change event binding to LoadComplete

--- osu.Game/Graphics/Containers/OsuRearrangeableListContainer.cs
+++ osu.Game/Graphics/Containers/OsuRearrangeableListContainer.cs
@@ -33,8 +33,10 @@

         protected abstract OsuRearrangeableListItem<TModel> CreateOsuDrawable(TModel item);

-        protected OsuRearrangeableListContainer()
+        protected override void LoadComplete()
         {
+            base.LoadComplete();
+
             Items.CollectionChanged += (_, args) =>
             {
                 if (args.Action == NotifyCollectionChangedAction.Move)


Fix initial hitobject states not being recomputed correctly

--- osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs
+++ osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs
@@ -77,6 +77,9 @@

             if (!initialStateCache.IsValid)
             {
+                foreach (var cached in hitObjectInitialStateCache.Values)
+                    cached.Invalidate();
+
                 switch (direction.Value)
                 {
                     case ScrollingDirection.Up:


Fix comments.

Fix comments.

--- Libraries/Settings/SettingsFolder.cs
+++ Libraries/Settings/SettingsFolder.cs
@@ -102,11 +102,6 @@
         /// <param name="company">会社名</param>
         /// <param name="product">製品名</param>
         ///
-        /// <remarks>
-        /// SettingsFolder は HKCU\Software\(company)\(product) の
-        /// レジストリ・サブキー下から各種設定を読み込みます。
-        /// </remarks>
-        ///
         /* ----------------------------------------------------------------- */
         public SettingsFolder(Assembly assembly, string company, string product)
         {
@@ -334,8 +329,7 @@
         /// Load
         ///
         /// <summary>
-        /// アプリケーション設定、およびユーザ設定をレジストリから
-        /// 読み込みます。
+        /// ユーザ設定をレジストリから読み込みます。
         /// </summary>
         ///
         /* ----------------------------------------------------------------- */
@@ -348,6 +342,9 @@
         /// <summary>
         /// ユーザ設定を読み込みます。
         /// </summary>
+        ///
+        /// <param name="type">データ形式</param>
+        /// <param name="src">読み込み先パス</param>
         ///
         /* ----------------------------------------------------------------- */
         public void Load(SettingsType type, string src) => OnLoaded(
@@ -372,6 +369,9 @@
         /// <summary>
         /// ユーザ設定を保存します。
         /// </summary>
+        ///
+        /// <param name="type">保存形式</param>
+        /// <param name="dest">保存先パス</param>
         ///
         /* ----------------------------------------------------------------- */
         public void Save(SettingsType type, string dest)


Remove redundant Invalidate

Remove redundant Invalidate

--- Library/Widgets/ListView/ListView.cs
+++ Library/Widgets/ListView/ListView.cs
@@ -215,7 +215,6 @@
 			if (firstItem != null)
 			{
 				firstItem.ViewWidget.LoadItemThumbnail().ConfigureAwait(false);
-				firstItem.ViewWidget.Invalidate();
 			}
 		}

@@ -271,7 +270,7 @@
 			if (bigRender != null)
 			{
 				try
-			{
+				{
 					var thumbnail = LibraryProviderHelpers.ResizeImage(bigRender, width, height);

 					// Cache at requested size
@@ -279,8 +278,8 @@
 						ApplicationController.Instance.ThumbnailCachePath(listViewItem.Model, width, height),
 						thumbnail);

-				return thumbnail;
-			}
+					return thumbnail;
+				}
 				catch { } // suppress and return null on errors
 			}


BeginInvoke with default priority

BeginInvoke with default priority

--- MahApps.Metro/Controls/Extensions.cs
+++ MahApps.Metro/Controls/Extensions.cs
@@ -50,10 +50,9 @@
         ///   Executes the specified action asynchronously with the DispatcherPriority.Background on the thread that the Dispatcher was created on.
         /// </summary>
         /// <param name="dispatcherObject">The dispatcher object where the action runs.</param>
-        /// <param name="invokeAction">
-        ///     An action that takes no parameters.
-        /// </param>
-        public static void BeginInvoke([NotNull] this DispatcherObject dispatcherObject, [NotNull] Action invokeAction)
+        /// <param name="invokeAction">An action that takes no parameters.</param>
+        /// <param name="priority">The dispatcher priority.</param>
+        public static void BeginInvoke([NotNull] this DispatcherObject dispatcherObject, [NotNull] Action invokeAction, DispatcherPriority priority = DispatcherPriority.Background)
         {
             if (dispatcherObject == null)
             {
@@ -63,7 +62,7 @@
             {
                 throw new ArgumentNullException(nameof(invokeAction));
             }
-            dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.Background, invokeAction);
+            dispatcherObject.Dispatcher.BeginInvoke(priority, invokeAction);
         }
     }
 }


ReSharping MapRenderer and removing #if SILVERLIGHT and WINDOWS_PHONE code

--- Mapsui.Rendering.Xaml/MapRenderer.cs
+++ Mapsui.Rendering.Xaml/MapRenderer.cs
@@ -13,8 +13,6 @@
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Shapes;
-using System.Globalization;
-using XamlMedia = System.Windows.Media;
 #else
 using Windows.UI.Xaml.Controls;
 using Windows.Foundation;
@@ -28,15 +26,9 @@
     public class MapRenderer : IRenderer
     {
         private readonly Canvas _target;
-#if !NETFX_CORE
-        private static int _mainThreadId;
-#endif

         static MapRenderer()
         {
-#if !NETFX_CORE
-            _mainThreadId = Thread.CurrentThread.ManagedThreadId;
-#endif
             DefaultRendererFactory.Create = () => new MapRenderer();
         }

@@ -56,16 +48,13 @@

         public static void Render(Canvas target, IViewport viewport, IEnumerable<ILayer> layers, bool rasterizing)
         {
-#if !SILVERLIGHT &&  !NETFX_CORE
+#if !NETFX_CORE
             target.BeginInit();
 #endif
             target.Visibility = Visibility.Collapsed;
             foreach (var child in target.Children)
             {
-                if (child is Canvas)
-                {
-                    (child as Canvas).Children.Clear();
-                }
+                (child as Canvas)?.Children.Clear();
             }
             target.Children.Clear();

@@ -80,56 +69,46 @@
             }
             target.Arrange(new Rect(0, 0, viewport.Width, viewport.Height));
             target.Visibility = Visibility.Visible;
-
+
             //DrawDebugInfo(target, layers);

-#if !SILVERLIGHT &&  !NETFX_CORE
+#if !NETFX_CORE
             target.EndInit();
 #endif
         }

-#if !SILVERLIGHT &&  !NETFX_CORE && !WINDOWS_PHONE
-        private static void DrawDebugInfo(Canvas canvas, IEnumerable<ILayer> layers)
-        {
-            var lineCounter = 1;
-            const float tabWidth = 40f;
-            const float lineHeight = 40f;
-
-            foreach (var layer in layers)
-            {
-                var textBox = AddTextBox(layer.ToString(), tabWidth, lineHeight*(lineCounter++));
-                canvas.Children.Add(textBox);
-
-                if (layer is ITileLayer)
-                {
-                    var text = "Tiles in memory: " + (layer as ITileLayer).MemoryCache.TileCount.ToString(CultureInfo.InvariantCulture);
-                    canvas.Children.Add(AddTextBox(text, tabWidth, lineHeight*(lineCounter++)));
-                }
-            }
-        }
-
-        private static TextBox AddTextBox(string text, float x, float y)
-        {
-            var textBox = new TextBox {Text = text};
-            Canvas.SetLeft(textBox, x);
-            Canvas.SetTop(textBox, y);
-            return textBox;
-        }
+#if !NETFX_CORE
+        //private static void DrawDebugInfo(Canvas canvas, IEnumerable<ILayer> layers)
+        //{
+        //    var lineCounter = 1;
+        //    const float tabWidth = 40f;
+        //    const float lineHeight = 40f;
+
+        //    foreach (var layer in layers)
+        //    {
+        //        var textBox = AddTextBox(layer.ToString(), tabWidth, lineHeight*(lineCounter++));
+        //        canvas.Children.Add(textBox);
+
+        //        if (layer is ITileLayer)
+        //        {
+        //            var text = "Tiles in memory: " + (layer as ITileLayer).MemoryCache.TileCount.ToString(CultureInfo.InvariantCulture);
+        //            canvas.Children.Add(AddTextBox(text, tabWidth, lineHeight*lineCounter++));
+        //        }
+        //    }
+        //}
+
+        //private static TextBox AddTextBox(string text, float x, float y)
+        //{
+        //    var textBox = new TextBox {Text = text};
+        //    Canvas.SetLeft(textBox, x);
+        //    Canvas.SetTop(textBox, y);
+        //    return textBox;
+        //}
 #endif
         public MemoryStream RenderToBitmapStream(IViewport viewport, IEnumerable<ILayer> layers)
         {
 #if WINDOWS_PHONE || NETFX_CORE
             throw new NotImplementedException();
-#elif SILVERLIGHT
-            MemoryStream bitmapStream = null;
-            var waitHandle = new AutoResetEvent(false);
-            RunOnUIThread(() =>
-            {
-                bitmapStream = RenderToBitmapStreamStatic(viewport, layers);
-                waitHandle.Set();
-            });
-            waitHandle.WaitOne(60000);
-            return bitmapStream;
 #else
             MemoryStream bitmapStream = null;
             RunMethodOnStaThread(() => bitmapStream = RenderToBitmapStreamStatic(viewport, layers));
@@ -137,7 +116,7 @@
 #endif
         }

-#if !WINDOWS_PHONE && !NETFX_CORE
+#if !NETFX_CORE
         private static MemoryStream RenderToBitmapStreamStatic(IViewport viewport, IEnumerable<ILayer> layers)
         {
             var canvas = new Canvas();
@@ -149,14 +128,7 @@
         }
 #endif

-#if SILVERLIGHT && !WINDOWS_PHONE
-        private void RunOnUIThread(Action method)
-        {
-            Deployment.Current.Dispatcher.BeginInvoke(method);
-        }
-#endif
-
-#if !SILVERLIGHT && !WINDOWS_PHONE && !NETFX_CORE
+#if !NETFX_CORE
         private static void RunMethodOnStaThread(ThreadStart operation)
         {
             var thread = new Thread(operation);
@@ -228,7 +200,7 @@

                 return canvas;
             }
-            catch (Exception e)
+            catch (Exception)
             {
                 return new Canvas { IsHitTestVisible = false };
             }


Remove outdated comment

Remove outdated comment

--- MaxMind.MinFraud/WebServiceClient.cs
+++ MaxMind.MinFraud/WebServiceClient.cs
@@ -45,7 +45,7 @@
         /// <param name="locales">A list of locale codes to use for name property.</param>
         /// <param name="host">The host to use when connecting to the web service.</param>
         /// <param name="timeout">The timeout to use for the request.</param>
-        /// <param name="httpMessageHandler">Handler to use in request. For unit testing only.</param>
+        /// <param name="httpMessageHandler">Handler to use in request.</param>
         public WebServiceClient(
             int accountId,
             string licenseKey,


Add logging for activate other instance

Add logging for activate other instance

--- GitMind/App.xaml.cs
+++ GitMind/App.xaml.cs
@@ -1,8 +1,6 @@
 using System;
-using System.Collections.ObjectModel;
 using System.Diagnostics;
 using System.IO;
-using System.Linq;
 using System.Reflection;
 using System.Threading;
 using System.Windows;
@@ -129,9 +127,9 @@
 			applicationMutex = new Mutex(true, Installer.ProductGuid);

 			MainWindow = mainWindow.Value;
-
+
 			themeService.SetThemeWpfColors();
-
+

 			MainWindow.Show();

@@ -157,6 +155,7 @@
 		{
 			try
 			{
+				Log.Debug("Try ActivatedOtherInstance");
 				Track.Event("ActivatedOtherInstance");
 				string id = MainWindowIpcService.GetId(workingFolder);
 				using (IpcRemotingService ipcRemotingService = new IpcRemotingService())


Format error message.

Format error message.

--- Gu.Inject/Kernel.cs
+++ Gu.Inject/Kernel.cs
@@ -257,7 +257,7 @@

                 var message = "There was already an instance created.\r\n" +
                                     "This can happen by doing:\r\n" +
-                                    "1. Bind<I>(() => new C())" +
+                                    "1. Bind<I>(() => new C())\r\n" +
                                     "2. Get<C>() this creates an instance of C using the constructor.\r\n" +
                                     "3. Get<I>() this creates an instance of C using the func and then detects there is already an instance.\r\n" +
                                     "Solution:\r\n" +
@@ -286,7 +286,7 @@

                 var message = "There was already an instance created.\r\n" +
                                     "This can happen by doing:\r\n" +
-                                    "1. Bind<I>(x => new C())" +
+                                    "1. Bind<I>(x => new C())\r\n" +
                                     "2. Get<C>() this creates an instance of C using the constructor.\r\n" +
                                     "3. Get<I>() this creates an instance of C using the func and then detects there is already an instance.\r\n" +
                                     "Solution:\r\n" +


Fix anchoring of license control

Fix anchoring of license control

--- MultiMiner.Win/AboutForm.Designer.cs
+++ MultiMiner.Win/AboutForm.Designer.cs
@@ -46,7 +46,7 @@
             //
             this.multiMinerLabel.AutoSize = true;
             this.multiMinerLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.multiMinerLabel.Location = new System.Drawing.Point(91, 12);
+            this.multiMinerLabel.Location = new System.Drawing.Point(106, 14);
             this.multiMinerLabel.Name = "multiMinerLabel";
             this.multiMinerLabel.Size = new System.Drawing.Size(114, 16);
             this.multiMinerLabel.TabIndex = 1;
@@ -56,18 +56,18 @@
             //
             this.bfgminerLabel.AutoSize = true;
             this.bfgminerLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.bfgminerLabel.Location = new System.Drawing.Point(91, 63);
+            this.bfgminerLabel.Location = new System.Drawing.Point(106, 73);
             this.bfgminerLabel.Name = "bfgminerLabel";
-            this.bfgminerLabel.Size = new System.Drawing.Size(111, 13);
+            this.bfgminerLabel.Size = new System.Drawing.Size(124, 15);
             this.bfgminerLabel.TabIndex = 3;
             this.bfgminerLabel.Text = "xgminer 1.1.1 installed";
             //
             // multiMinerLink
             //
             this.multiMinerLink.AutoSize = true;
-            this.multiMinerLink.Location = new System.Drawing.Point(91, 28);
+            this.multiMinerLink.Location = new System.Drawing.Point(106, 32);
             this.multiMinerLink.Name = "multiMinerLink";
-            this.multiMinerLink.Size = new System.Drawing.Size(94, 13);
+            this.multiMinerLink.Size = new System.Drawing.Size(113, 15);
             this.multiMinerLink.TabIndex = 5;
             this.multiMinerLink.TabStop = true;
             this.multiMinerLink.Text = "multiminerapp.com";
@@ -78,18 +78,18 @@
             this.panel1.BackColor = System.Drawing.SystemColors.Control;
             this.panel1.Controls.Add(this.saveButton);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panel1.Location = new System.Drawing.Point(0, 356);
+            this.panel1.Location = new System.Drawing.Point(0, 411);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(469, 47);
+            this.panel1.Size = new System.Drawing.Size(547, 54);
             this.panel1.TabIndex = 6;
             //
             // saveButton
             //
             this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK;
-            this.saveButton.Location = new System.Drawing.Point(382, 12);
+            this.saveButton.Location = new System.Drawing.Point(446, 14);
             this.saveButton.Name = "saveButton";
-            this.saveButton.Size = new System.Drawing.Size(75, 23);
+            this.saveButton.Size = new System.Drawing.Size(87, 27);
             this.saveButton.TabIndex = 0;
             this.saveButton.Text = "OK";
             this.saveButton.UseVisualStyleBackColor = true;
@@ -101,33 +101,32 @@
             //
             // textBox1
             //
-            this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+            this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.textBox1.Location = new System.Drawing.Point(12, 88);
+            this.textBox1.Location = new System.Drawing.Point(14, 102);
             this.textBox1.Multiline = true;
             this.textBox1.Name = "textBox1";
             this.textBox1.ReadOnly = true;
             this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
-            this.textBox1.Size = new System.Drawing.Size(443, 255);
+            this.textBox1.Size = new System.Drawing.Size(516, 294);
             this.textBox1.TabIndex = 8;
             this.textBox1.Text = resources.GetString("textBox1.Text");
             //
             // pictureBox1
             //
             this.pictureBox1.Image = global::MultiMiner.Win.Properties.Resources.window_sel;
-            this.pictureBox1.Location = new System.Drawing.Point(12, 12);
+            this.pictureBox1.Location = new System.Drawing.Point(14, 14);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(64, 64);
+            this.pictureBox1.Size = new System.Drawing.Size(75, 74);
             this.pictureBox1.TabIndex = 0;
             this.pictureBox1.TabStop = false;
             //
             // AboutForm
             //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.ControlLightLight;
-            this.ClientSize = new System.Drawing.Size(469, 403);
+            this.ClientSize = new System.Drawing.Size(547, 465);
             this.Controls.Add(this.textBox1);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.multiMinerLink);


'b' in "Bearer" needs to be capitalized for auth to go through, activities response members need to be public to get deserialized.

--- FitbitClient.cs
+++ FitbitClient.cs
@@ -101,7 +101,7 @@

         public void SetBearerAuthorizationHeader(string bearerToken)
         {
-            Client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", bearerToken);
+            Client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", bearerToken);
         }
     }


Removed code that should not be in use yet.

--- GCodePlanner.cs
+++ GCodePlanner.cs
@@ -459,31 +459,9 @@
 				else
 				{
 					// This is test code to remove double drawn small perimeter lines.
-					if (false
-							|| (
-							path.config.lineWidth_um > 0
-						&& path.points.Count > 2 // If the count is not greater than 2 there is no way it can ovelap itself.
-						&& gcodeExport.GetPosition() == path.points[path.points.Count - 1]))
-					{
-						List<List<Point3>> pathsWithOverlapsRemoved = GetPathsWithOverlapsRemoved(path.points, path.config.lineWidth_um / 2);
-						if (pathsWithOverlapsRemoved.Count > 0)
-						{
-							for (int polygonIndex = 0; polygonIndex < pathsWithOverlapsRemoved.Count; polygonIndex++)
-							{
-								int startIndex = 0;
-								List<Point3> polygon = pathsWithOverlapsRemoved[polygonIndex];
-								if (polygonIndex > 0)
-								{
-									gcodeExport.WriteMove(polygon[0], travelConfig.speed, 0);
-									startIndex = 1; // We skip the first point in the next extrusion, because we just moved to it.
-								}
-
-								for (int pointIndex = startIndex; pointIndex < polygon.Count; pointIndex++)
-								{
-									gcodeExport.WriteMove(polygon[pointIndex], speed, path.config.lineWidth_um);
-								}
-							}
-						}
+					if (RemoveDoubleDrawPerimeterLines(path, speed))
+					{
+						return;
 					}
 					else
 					{
@@ -498,6 +476,35 @@
 			}

 			gcodeExport.UpdateTotalPrintTime();
+		}
+
+		private bool RemoveDoubleDrawPerimeterLines(GCodePath path, double speed)
+		{
+			return false;
+			if (path.config.lineWidth_um > 0
+				&& path.points.Count > 2 // If the count is not greater than 2 there is no way it can ovelap itself.
+				&& gcodeExport.GetPosition() == path.points[path.points.Count - 1])
+			{
+				List<List<Point3>> pathsWithOverlapsRemoved = GetPathsWithOverlapsRemoved(path.points, path.config.lineWidth_um / 2);
+				if (pathsWithOverlapsRemoved.Count > 0)
+				{
+					for (int polygonIndex = 0; polygonIndex < pathsWithOverlapsRemoved.Count; polygonIndex++)
+					{
+						int startIndex = 0;
+						List<Point3> polygon = pathsWithOverlapsRemoved[polygonIndex];
+						if (polygonIndex > 0)
+						{
+							gcodeExport.WriteMove(polygon[0], travelConfig.speed, 0);
+							startIndex = 1; // We skip the first point in the next extrusion, because we just moved to it.
+						}
+
+						for (int pointIndex = startIndex; pointIndex < polygon.Count; pointIndex++)
+						{
+							gcodeExport.WriteMove(polygon[pointIndex], speed, path.config.lineWidth_um);
+						}
+					}
+				}
+			}
 		}

 		public void QueuePolygon(Polygon polygon, int startIndex, GCodePathConfig config)


Utilities API

Utilities API

--- Gigas/Arrayx.cs
+++ Gigas/Arrayx.cs
@@ -13,37 +13,65 @@
     public int Size = 8;
     public int Length = 0;

-    public static Arrayx<T> Add(Arrayx<T> arrx, T component)
+    // @todo Those functions below need a performance test
+
+    public void Add(T component)
     {
-        arrx.Elements[arrx.Length++] = component;
+        Elements[Length++] = component;

-        if (arrx.Length >= arrx.Size)
+        if (Length >= Size)
         {
-            arrx.Size *= 2;
-            Array.Resize(ref arrx.Elements, arrx.Size);
+            Size *= 2;
+            Array.Resize(ref Elements, Size);
         }
-
-        return arrx;
     }

-    public static Arrayx<T> RemoveAt(Arrayx<T> arrx, int indexToRemove)
+    public void RemoveAt(int index)
     {
         Array.Copy(
-            arrx.Elements, indexToRemove + 1,
-            arrx.Elements, indexToRemove,
-            arrx.Length - indexToRemove - 1);
-        arrx.Length--;
-
-        return arrx;
+            Elements, index + 1,
+            Elements, index,
+            Length - index - 1);
+        Length--;
     }

-    public static Arrayx<T> ToArrayx(T[] arr)
+    public void Append(T[] array)
     {
-        var arrx = new Arrayx<T>();
+        for (int i = 0; i < array.Length; i++)
+        {
+            Elements[Length++] = array[i];

-        for (int i = 0; i < arr.Length; i++)
-            arrx = Arrayx<T>.Add(arrx, arr[i]);
+            if (Length >= Size)
+            {
+                Size *= 2;
+                Array.Resize(ref Elements, Size);
+            }
+        }
+    }

-        return arrx;
-    }
+    // @todo Are those below better that the self referenced way up ^ there?
+
+    // public static Arrayx<T> Add(Arrayx<T> arrx, T component)
+    // {
+    //     arrx.Elements[arrx.Length++] = component;
+
+    //     if (arrx.Length >= arrx.Size)
+    //     {
+    //         arrx.Size *= 2;
+    //         Array.Resize(ref arrx.Elements, arrx.Size);
+    //     }
+
+    //     return arrx;
+    // }
+
+    // public static Arrayx<T> RemoveAt(Arrayx<T> arrx, int indexToRemove)
+    // {
+    //     Array.Copy(
+    //         arrx.Elements, indexToRemove + 1,
+    //         arrx.Elements, indexToRemove,
+    //         arrx.Length - indexToRemove - 1);
+    //     arrx.Length--;
+
+    //     return arrx;
+    // }
 }


Updated GetUniqueID

Updated GetUniqueID

checks everything with an ID now

--- CCTagIntermediateCompiler/Extensions.cs
+++ CCTagIntermediateCompiler/Extensions.cs
@@ -1,5 +1,6 @@
 namespace CCTagIntermediateCompiler
 {
+    using System.Collections.Generic;
     using System.Linq;
     using VMFParser;

@@ -8,7 +9,7 @@
         /// <summary>Gets a unique entity identifier.</summary>
         /// This is a terrible implementaion, we are Parsing those ids so many times if we dont find the right id right away.
         /// Should create something like this in the VMFParser
-        public static int GetUniqueEntityID(this VMF vmf)
+        public static int GetUniqueID(this VMF vmf)
         {
             int id = 0;
             var last = vmf.Body.LastOrDefault(entry => entry.Name == "entity") as VBlock;
@@ -20,15 +21,17 @@
                 if (int.TryParse(idProperty.Value, out id))
                 {
                     //make sure this is not already used
-                    while (vmf.Body.Where(entry =>
-                        entry.GetType() == typeof(VBlock) &&
-                        entry.Name == "entity" &&
-                        ((VBlock)entry).Body.Where(property =>
-                            property.Name == "id" &&
-                            property.GetType() == typeof(VProperty) &&
-                            ((VProperty)property).Value == id.ToString())
-                            .Count() > 0)
-                        .Count() > 0)
+                    //while (vmf.Body.Where(entry =>
+                    //    entry.GetType() == typeof(VBlock) &&
+                    //    entry.Name == "entity" &&
+                    //    ((VBlock)entry).Body.Where(property =>
+                    //        property.Name == "id" &&
+                    //        property.GetType() == typeof(VProperty) &&
+                    //        ((VProperty)property).Value == id.ToString())
+                    //        .Count() > 0)
+                    //    .Count() > 0)
+                    //    id++;
+                    while (ContainsID(vmf.Body, id.ToString()))
                         id++;
                 }
                 else
@@ -38,12 +41,23 @@
             return id;
         }

+        private static bool ContainsID(IList<IVNode> nodes, string id)
+        {
+            foreach(var node in nodes)
+            {
+                if ((node.GetType() == typeof(VBlock) && ContainsID((node as VBlock).Body, id)) ||
+                    (node.GetType() == typeof(VProperty) && node.Name == "id" && (node as VProperty).Value == id))
+                    return true;
+            }
+            return false;
+        }
+
         /// <summary>Performs a deep clone of this block. </summary>
         /// DeepClone should be added to the IVNode interface, and these methods moved into that library
         public static VBlock DeepClone(this VBlock vBlock)
         {
-            return new VBlock(vBlock.Name, vBlock.Body ==null? null:
-                vBlock.Body.Select(node=> node.GetType()==typeof(VBlock)? ((VBlock)node).DeepClone(): (IVNode)((VProperty)node).DeepClone()).ToList());
+            return new VBlock(vBlock.Name, vBlock.Body == null ? null :
+                vBlock.Body.Select(node => node.GetType() == typeof(VBlock) ? ((VBlock)node).DeepClone() : (IVNode)((VProperty)node).DeepClone()).ToList());
         }

         public static VProperty DeepClone(this VProperty vProperty)


WinForms - Update xml doc `Dock = DockStyle.Fill` is the default

Make it clear we are setting the default to DockStyle.Fill, this may not be expected
by some. It has been that way for 5+ years, so changing the default would be difficult
and unexpected, instead we make it clearer this is the case.

Resolves #3019

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -416,10 +416,12 @@

         /// <summary>
         /// Initializes a new instance of the <see cref="ChromiumWebBrowser"/> class.
+        /// **Important** - When using this constructor the <see cref="Control.Dock"/> property
+        /// will default to <see cref="DockStyle.Fill"/>.
         /// </summary>
         /// <param name="html">html string to be initially loaded in the browser.</param>
-        /// <param name="requestContext">Request context that will be used for this browser instance,
-        /// if null the Global Request Context will be used</param>
+        /// <param name="requestContext">(Optional) Request context that will be used for this browser instance, if null the Global
+        /// Request Context will be used.</param>
         public ChromiumWebBrowser(HtmlString html, IRequestContext requestContext = null) : this(html.ToDataUriString(), requestContext)
         {

@@ -427,10 +429,12 @@

         /// <summary>
         /// Initializes a new instance of the <see cref="ChromiumWebBrowser"/> class.
+        /// **Important** - When using this constructor the <see cref="Control.Dock"/> property
+        /// will default to <see cref="DockStyle.Fill"/>.
         /// </summary>
         /// <param name="address">The address.</param>
-        /// <param name="requestContext">Request context that will be used for this browser instance,
-        /// if null the Global Request Context will be used</param>
+        /// <param name="requestContext">(Optional) Request context that will be used for this browser instance, if null the Global
+        /// Request Context will be used.</param>
         public ChromiumWebBrowser(string address, IRequestContext requestContext = null)
         {
             Dock = DockStyle.Fill;


Re-add call to Cef.RemoveDisposable

Re-add call to Cef.RemoveDisposable

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -354,6 +354,11 @@
         protected override void Dispose(bool disposing)
         {
             IsBrowserInitialized = false;
+
+            if(!designMode)
+            {
+                RemoveFromListOfCefBrowsers();
+            }

             //The unmanaged resources should never be created in design mode, so only dispose when
             //at runtime