Fix BeforeLast,TryBeforeLast,AfterLast,Befor and After

--- Signum.Utilities/Extensions/StringExtensions.cs
+++ Signum.Utilities/Extensions/StringExtensions.cs
@@ -155,97 +155,94 @@
             if (index == -1)
                 return null;

+            return str.Substring(index + separator.Length);
+        }
+
+
+        public static string BeforeLast(this string str, char separator)
+        {
+            int index = str.LastIndexOf(separator);
+            if (index == -1)
+                throw NotFound(str, separator);
+
+            return str.Substring(0, index);
+        }
+
+        public static string BeforeLast(this string str, string separator)
+        {
+            int index = str.LastIndexOf(separator);
+            if (index == -1)
+                throw NotFound(str, separator);
+
+            return str.Substring(0, index);
+        }
+
+        public static string AfterLast(this string str, char separator)
+        {
+            int index = str.LastIndexOf(separator);
+            if (index == -1)
+                throw NotFound(str, separator);
+
             return str.Substring(index + 1);
         }

-
-        public static string BeforeLast(this string str, char separator)
+        public static string AfterLast(this string str, string separator)
         {
             int index = str.LastIndexOf(separator);
             if (index == -1)
                 throw NotFound(str, separator);

+            return str.Substring(index + separator.Length);
+        }
+
+        public static string TryBeforeLast(this string str, char separator)
+        {
+            if (str == null)
+                return null;
+
+            int index = str.LastIndexOf(separator);
+            if (index == -1)
+                return null;
+
             return str.Substring(0, index);
         }

-        public static string BeforeLast(this string str, string separator)
-        {
+        public static string TryBeforeLast(this string str, string separator)
+        {
+            if (str == null)
+                return null;
+
             int index = str.LastIndexOf(separator);
             if (index == -1)
-                throw NotFound(str, separator);
+                return null;

             return str.Substring(0, index);
         }

-        public static string AfterLast(this string str, char separator)
-        {
+        public static string TryAfterLast(this string str, char separator)
+        {
+            if (str == null)
+                return null;
+
             int index = str.LastIndexOf(separator);
             if (index == -1)
-                throw NotFound(str, separator);
+                return null;

             return str.Substring(index + 1);
         }

-        public static string AfterLast(this string str, string separator)
-        {
+        public static string TryAfterLast(this string str, string separator)
+        {
+            if (str == null)
+                return null;
+
             int index = str.LastIndexOf(separator);
             if (index == -1)
-                throw NotFound(str, separator);
-
-            return str.Substring(index + 1);
-        }
-
-        public static string TryBeforeLast(this string str, char separator)
-        {
-            if (str == null)
-                return null;
-
-            int index = str.LastIndexOf(separator);
-            if (index == -1)
-                return null;
-
-            return str.Substring(0, index);
-        }
-
-        public static string TryBeforeLast(this string str, string separator)
-        {
-            if (str == null)
-                return null;
-
-            int index = str.LastIndexOf(separator);
-            if (index == -1)
-                return null;
-
-            return str.Substring(0, index);
-        }
-
-        public static string TryAfterLast(this string str, char separator)
-        {
-            if (str == null)
-                return null;
-
-            int index = str.LastIndexOf(separator);
-            if (index == -1)
-                return null;
-
-            return str.Substring(index + 1);
-        }
-
-        public static string TryAfterLast(this string str, string separator)
-        {
-            if (str == null)
-                return null;
-
-            int index = str.LastIndexOf(separator);
-            if (index == -1)
-                return null;
-
-            return str.Substring(index + 1);
-        }
-
-
-
-
+                return null;
+
+            return str.Substring(index + separator.Length);
+        }
+
         public static string Between(this string str, string firstSeparator, string secondSeparator = null)
         {
             if (secondSeparator == null)
@@ -408,8 +405,7 @@

             return result;
         }
-
-
+
         public static string PadChopRight(this string str, int length)
         {
             str = str ?? "";
@@ -563,8 +559,7 @@

             return result;
         }
-
-
+
         public static string FirstUpper(this string str)
         {
             if (str.HasText() && char.IsLower(str[0]))


removing unreachable windows from list on update

--- SimpleWindowsManager/WindowSwitcher/Switcher.cs
+++ SimpleWindowsManager/WindowSwitcher/Switcher.cs
@@ -100,9 +100,22 @@
                 var searchable = new List<ICanBeSearchedFor>();
                 var windows = WindowLister.GetOpenWindows();
                 searchable.AddRange(windows);
-                searchable.Where(element => _windowTitles.Values.All(window => window.Id != element.Id)).ToList().ForEach(_windowTitles.Values.Add);
-                _windowTitles.Values.ToList().RemoveAll(window => searchable.All(element => element.Id != window.Id));
+                AddNewWindowsToList(searchable);
+                RemoveUnreachableWindows(searchable);
             });
+        }
+
+        private void AddNewWindowsToList(IEnumerable<ICanBeSearchedFor> currentlyAvailableWindows)
+        {
+            currentlyAvailableWindows.Where(element => _windowTitles.Values.All(window => window.Id != element.Id))
+                .ToList()
+                .ForEach(_windowTitles.Values.Add);
+        }
+
+        private void RemoveUnreachableWindows(IEnumerable<ICanBeSearchedFor> currentlyAvailableWindows)
+        {
+            _windowTitles.Values.ToList()
+                .RemoveAll(window => currentlyAvailableWindows.All(element => element.Id != window.Id || element.Id == 0));
         }

         private void ShowSwitcher()


C# bindings: Add a Context() constructor to create the default context

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>

--- bindings/csharp/Context.cs
+++ bindings/csharp/Context.cs
@@ -29,6 +29,9 @@
         private static extern IntPtr iio_create_network_context(
             [In()][MarshalAs(UnmanagedType.LPStr)] string hostname
         );
+
+        [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
+        private static extern IntPtr iio_create_default_context();

         [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
         private static extern void iio_context_destroy(IntPtr ctx);
@@ -67,9 +70,13 @@
         public readonly Version library_version, backend_version;
         public readonly List<Device> devices;

-        public Context(string hostname)
+        public Context(string hostname) : this(iio_create_network_context(hostname)) {}
+        public Context() : this(iio_create_default_context()) {}
+
+        private Context(IntPtr ctx)
         {
-            ctx = iio_create_network_context(hostname);
+            this.ctx = ctx;
+
             if (ctx == IntPtr.Zero)
                 throw new Exception("Unable to create IIO context");


Fixed following button

Fixed following button

--- AnimeDownloader/MultiSelect.Designer.cs
+++ AnimeDownloader/MultiSelect.Designer.cs
@@ -101,6 +101,7 @@
             //
             this.butOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.tableLayoutPanel3.SetColumnSpan(this.butOk, 2);
+            this.butOk.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.butOk.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.butOk.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(255)))));
             this.butOk.Location = new System.Drawing.Point(273, 67);


Prevent unhandled exceptions when indexing into OemProfiles

 - Return null on caught exceptions
 - Issue MatterHackers/MatterControl#1285

--- SlicerConfiguration/Settings/PrinterSettings.cs
+++ SlicerConfiguration/Settings/PrinterSettings.cs
@@ -298,18 +298,22 @@

 		public static PrinterSettings RestoreFromOemProfile(PrinterInfo profile)
 		{
-			string publicProfileDeviceToken = OemSettings.Instance.OemProfiles[profile.Make][profile.Model];
-			string publicProfileToLoad = Path.Combine(ApplicationDataStorage.ApplicationUserDataPath, "data", "temp", "cache", "profiles", publicProfileDeviceToken + ProfileManager.ProfileExtension);
-
-			var oemProfile = JsonConvert.DeserializeObject<PrinterSettings>(File.ReadAllText(publicProfileToLoad));
-			oemProfile.ID = profile.ID;
-			oemProfile.SetValue(SettingsKey.printer_name, profile.Name);
-			oemProfile.DocumentVersion = PrinterSettings.LatestVersion;
-
-			oemProfile.Helpers.SetComPort(profile.ComPort);
-			oemProfile.Save();
-
-			//WarnAboutRevert(profile);
+			PrinterSettings oemProfile = null;
+
+			try
+			{
+				string publicProfileDeviceToken = OemSettings.Instance.OemProfiles[profile.Make][profile.Model];
+				string publicProfileToLoad = Path.Combine(ApplicationDataStorage.ApplicationUserDataPath, "data", "temp", "cache", "profiles", publicProfileDeviceToken + ProfileManager.ProfileExtension);
+
+				oemProfile = JsonConvert.DeserializeObject<PrinterSettings>(File.ReadAllText(publicProfileToLoad));
+				oemProfile.ID = profile.ID;
+				oemProfile.SetValue(SettingsKey.printer_name, profile.Name);
+				oemProfile.DocumentVersion = PrinterSettings.LatestVersion;
+
+				oemProfile.Helpers.SetComPort(profile.ComPort);
+				oemProfile.Save();
+			}
+			catch { }

 			return oemProfile;
 		}


Cleaned away the clutter in OnStartup

Cleaned away the clutter in OnStartup

--- SpotifyHotkeys/App.xaml.cs
+++ SpotifyHotkeys/App.xaml.cs
@@ -28,33 +28,42 @@

             try
             {
-
-                var spotifWebHelper = SpotifyWebHelperApi.Create();
-
-                var assembly = typeof(App).Assembly;
-
-                var description = assembly.GetCustomAttribute<AssemblyDescriptionAttribute>();
-                var author = assembly.GetCustomAttribute<AssemblyAuthorAttribute>();
-                var link = assembly.GetCustomAttribute<AssemblyLinkAttribute>();
-
-                var aboutFactory = new AboutWindowAdapter(author.Author, description.Description,
-                    assembly.GetName().Version.ToString(), link.Link);
-
                 AddHotkeys();
-                _spotifyActionService = new UnmanagedSpotifyActionService();
-
-                _taskbarIcon = FindResource("NotifyIcon") as TaskbarIcon;
-                _notifyIconViewModel = new NotifyIconViewModel(aboutFactory,
-                    new SettingsWindowAdapter(_spotifyActionService, _hotkeyManager), spotifWebHelper, "SpotifyHotkeys");
-                _taskbarIcon.DataContext = _notifyIconViewModel;
+                var aboutWindow = AssembleAboutWindow();
+                AssembleTaskbarIcon(aboutWindow);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(string.Format("Failed to start SpotifyHotkeys. Please make sure that Spotify is up and running!\n\n" +
-                              "If Spotify is up and running, please report the following stack trace here: " +
-                              "https://github.com/joakimskoog/SpotifyHotkeys/issues \n\nStack trace: {0}", ex.StackTrace),"Error");
+                              "If Spotify is up and running, please report the following error here: " +
+                              "https://github.com/joakimskoog/SpotifyHotkeys/issues \n\nError: {0}", ex.Message), "Error");
                 Current.Shutdown();
             }
+        }
+
+        private IWindow AssembleAboutWindow()
+        {
+            var assembly = typeof(App).Assembly;
+
+            var description = assembly.GetCustomAttribute<AssemblyDescriptionAttribute>();
+            var author = assembly.GetCustomAttribute<AssemblyAuthorAttribute>();
+            var link = assembly.GetCustomAttribute<AssemblyLinkAttribute>();
+
+            var aboutWindow = new AboutWindowAdapter(author.Author, description.Description,
+                assembly.GetName().Version.ToString(), link.Link);
+
+            return aboutWindow;
+        }
+
+        private void AssembleTaskbarIcon(IWindow aboutWindow)
+        {
+            var spotifWebHelper = SpotifyWebHelperApi.Create();
+            _spotifyActionService = new UnmanagedSpotifyActionService();
+
+            _notifyIconViewModel = new NotifyIconViewModel(aboutWindow,
+                new SettingsWindowAdapter(_spotifyActionService, _hotkeyManager), spotifWebHelper, "SpotifyHotkeys");
+            _taskbarIcon = FindResource("NotifyIcon") as TaskbarIcon;
+            _taskbarIcon.DataContext = _notifyIconViewModel;
         }

         private void AddHotkeys()


REPL updated

REPL updated

--- Src/RSharp.Repl/Program.cs
+++ Src/RSharp.Repl/Program.cs
@@ -27,8 +27,8 @@
                 if (value is Vector)
                     foreach (var line in ((Vector)value).ToLines())
                         Console.WriteLine(line);
-                else
-                    Console.WriteLine(expr.Evaluate(context).ToString());
+                else if (value != null)
+                    Console.WriteLine(value.ToString());

                 Console.Out.Flush();
             }


Add unit test

Add unit test

--- Source/Examples/ExampleLibrary/Issues/Issues.cs
+++ Source/Examples/ExampleLibrary/Issues/Issues.cs
@@ -1,4 +1,4 @@
-// --------------------------------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------------------------------
 // <copyright file="Issues.cs" company="OxyPlot">
 //   Copyright (c) 2014 OxyPlot contributors
 // </copyright>
@@ -20,6 +20,17 @@
     [Examples("Z1 Issues")]
     public class Issues
     {
+        [Example("#1303 Problem with infinity size polyline")]
+        public static PlotModel InfinitySizePolyline()
+        {
+            var model = new PlotModel();
+            var series = new OxyPlot.Series.LineSeries();
+            series.Points.Add(new DataPoint(0, 0));
+            series.Points.Add(new DataPoint(1, -1e40));
+            model.Series.Add(series);
+            return model;
+        }
+
         [Example("#977 RectangleAnnotation Axis Clipping not configurable")]
         public static PlotModel RectangleAnnotationAxisClipping()
         {


Config path.

Config path.

--- GuiTest/AttFormTest.cs
+++ GuiTest/AttFormTest.cs
@@ -32,7 +32,7 @@
         public void SetUp()
         {
             PTL.ATT.Configuration.Initialize(Path.Combine("Config", "att_config.xml"), true);
-            PTL.ATT.GUI.Configuration.Initialize("Config/gui_config.xml");
+            PTL.ATT.GUI.Configuration.Initialize(Path.Combine("Config", "gui_config.xml"));
         }

         [Test]


hitting esc now closes the tooltip.

hitting esc now closes the tooltip.

--- StackSplitX/StackSplitX.cs
+++ StackSplitX/StackSplitX.cs
@@ -118,12 +118,19 @@
         private void OnKeyPressed(object sender, EventArgsKeyPressed e)
         {
             // Intercept keyboard input while the tooltip is active so numbers don't change the actively equipped item etc.
-            // TODO: handle esc to close.
             // TODO: remove null checks if these events are only called subscribed when it's valid
             if (this.CurrentMenuHandler != null &&
                 this.CurrentMenuHandler.HandleKeyboardInput(e.KeyPressed) == EInputHandled.Handled)
             {
-                Game1.oldKBState = Keyboard.GetState();
+                // Obey unless we're hitting 'cancel' keys.
+                if (e.KeyPressed != Keys.Escape)
+                {
+                    Game1.oldKBState = Keyboard.GetState();
+                }
+                else
+                {
+                    this.CurrentMenuHandler.CloseSplitMenu();
+                }
             }
         }


BREAKING CHANGE: Refactoring StatManager to no longer be an abstract class, made the constructor arguments optional, and changed the LocalMessenger On/Un wrappers to use the Action callback without args. - Changed StatManager to no longer be abstract because there was no reason to block using StatManager directly. SpecificRecalulate is optional, so changed it to a virtual method that can be overwritten if needed. - The constructor args shouldn't be required so that StatManager can be instantiated without already having the StatProviders. Added methods to add/remove the TransientStatProviders. - StatManager probably won't send args when Firing the LocalMessenger, so the On/Un wrappers changed to Action callback without args. LocalMessenger is mostly for listening for when Recalculate is done, and then other components can query StatManager directly.

--- StatManager/StatManager.cs
+++ StatManager/StatManager.cs
@@ -2,29 +2,41 @@
 using System.Collections.Generic;
 using UnityEngine;

-public abstract class StatManager {
+/**
+ * StatManager handles adding up and tracking a collection of Stats.
+ *
+ * PersistentStats are Stats that can't be removed and can be used as base stats. (May remove in the future.)
+ * TransientStatProviders are StatProviders that have their stats updated every Recalculate. They can also be removed.
+ *      Examples are items or temporary buffs.
+ */
+public class StatManager {
     #region LocalMessenger
     public const string AFTER_RECALCULATE = "StatManager.AFTER_RECALCULATE";
     LocalMessenger LocalMessenger = new LocalMessenger();
     #endregion

-    private Dictionary<string, double> Stats = new Dictionary<string, double>();
+    private Dictionary<string, double> CalculatedStats = new Dictionary<string, double>();
     private Dictionary<string, Stat> PersistentStats = new Dictionary<string, Stat>();
     private List<StatProvider> TransientStatProviders = new List<StatProvider>();

-    public StatManager(List<StatProvider> persistentStatBonusProviders, List<StatProvider> transientStatBonusProviders) {
-        TransientStatProviders = transientStatBonusProviders;
+    public StatManager(List<StatProvider> persistentStatProviders = null, List<StatProvider> transientStatProviders = null) {
+        //TransientStatProviders = transientStatBonusProviders;

-        foreach (var provider in TransientStatProviders) {
-            provider.ConnectReference(this);
+        if (transientStatProviders.IsNotEmpty()) {
+            foreach (var provider in transientStatProviders) {
+                AddTransientStatProvider(provider);
+                //provider.ConnectReference(this);
+            }
         }

-        // Preload PersistentStatBonuses
-        foreach (var provider in persistentStatBonusProviders) {
-            var bonuses = provider.GetStats();
-            foreach (var statBonus in bonuses) {
-                AddPersistent(statBonus);
+        // Preload PersistentStats.
+        if (persistentStatProviders.IsNotEmpty()) {
+            foreach (var provider in persistentStatProviders) {
+                var bonuses = provider.GetStats();
+                foreach (var statBonus in bonuses) {
+                    AddPersistent(statBonus);
+                }
             }
         }

@@ -32,9 +44,9 @@
     }

     public void Recalculate(object[] args = null) {
-        Stats.Clear();
+        CalculatedStats.Clear();

-        // Preloading all of the PersistentStatBonuses into the stats
+        // Preloading all of the PersistentStats into the stats.
         foreach (var statBonusPair in PersistentStats) {
             var statBonus = statBonusPair.Value;
             Add(statBonus.Name, statBonus.Value);
@@ -52,20 +64,33 @@
         LocalMessenger.Fire(AFTER_RECALCULATE);
     }

-    protected abstract void SpecificRecalulate();
+    protected virtual void SpecificRecalulate() {
+        // Do nothing.
+    }
+
+    public void AddTransientStatProvider(StatProvider transientStatProvider) {
+        TransientStatProviders.Add(transientStatProvider);
+        transientStatProvider.ConnectReference(this);
+    }
+
+    public void RemoveTransientStatProvider(StatProvider transientStatProvider) {
+        TransientStatProviders.Remove(transientStatProvider);
+        transientStatProvider.ConnectReference(null);
+    }
+

     #region Stat Methods
     public double Get(string name) {
-        return Stats.Get(name, 0);
+        return CalculatedStats.Get(name, 0);
     }

     public void Set(string name, double value) {
-        Stats.Set(name, value);
+        CalculatedStats.Set(name, value);
     }

     public void Add(string name, double value) {
         var currentValue = Get(name);
-        Stats.Set(name, currentValue + value);
+        CalculatedStats.Set(name, currentValue + value);
     }
     #endregion

@@ -83,11 +108,11 @@
     #endregion

     #region LocalMessenger Methods
-    public void On(string message, System.Action<object[]> callback) {
+    public void On(string message, System.Action callback) {
         LocalMessenger.On(message, callback);
     }

-    public void Un(string message, System.Action<object[]> callback) {
+    public void Un(string message, System.Action callback) {
         LocalMessenger.Un(message, callback);
     }
     #endregion
@@ -111,7 +136,7 @@
         set {
             var previousValue = _Value;
             _Value = value;
-            LocalMessenger.Fire(CHANGED, new object[] { Name, _Value, _Value - previousValue });
+            LocalMessenger.Fire(CHANGED, new object[] { Name, _Value, _Value - previousValue });
             //Debug.Log("{0}: {1}".FormatWith(Name, _Value));
         }
     }


Replaced gridSquare.PossCount with List<int> of remaining possibilities for faster access in certain situations.

--- SudokuSolver/SudokuGrid.cs
+++ SudokuSolver/SudokuGrid.cs
@@ -126,13 +126,13 @@
 			//possibilities[n] represents if it is possible for the square at x,y to be the number n(1-9)
 			private bool[] possibilities;

-			//number of possibilites remaining
-			int possCount;
-
 			//set whenever possibilities at x,y are changed, cleared whenever x,y is checked. TODO: use for future optimizations? (or remove)
 			bool recheck;

-			//set of possible combinations
+			//set of all individual possibilities
+			List<int> possList;
+
+			//set of all possible combinations
 			PossibilitySet setList;

 			public SudokuGrid.SolveType solveType { get; set; }
@@ -144,10 +144,11 @@

 				knownValue = 0;

+				//Storing information about possibilities in different ways to speed up different kinds of access.
 				possibilities = new bool[9 + 1];//possibilities[0] is not used, possibilities[1->9] is possible values (true/false)
 				for (int i = 1; i <= 9; ++i)
 					possibilities[i] = true;
-				possCount = 9;
+				possList = new List<int>{1,2,3,4,5,6,7,8,9};

 				initSetList();

@@ -175,7 +176,7 @@
 				this.knownValue = toCopy.knownValue;
 				for (int i = 1; i <= 9; ++i)
 					this.possibilities[i] = toCopy.possibilities[i];
-				this.possCount = toCopy.possCount;
+				this.possList = new List<int>(toCopy.possList);

 				this.recheck = toCopy.recheck;
 				this.solveType = toCopy.solveType;
@@ -188,7 +189,7 @@

 				for (int i = 1; i <= 9; ++i)
 					possibilities[i] = true;
-				possCount = 9;
+				possList = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

 				initSetList();

@@ -245,10 +246,10 @@
 				{
 					if (possibilities[i]) //it was listed as possible before
 					{
-						--possCount;
+						possList.Remove(i);
 						recheck = true;
 						possibilities[i] = false;
-						if (possCount == 0)
+						if (PossibilityCount == 0)
 							solveType = SolveType.Invalid;
 						else
 							setList.removeAllContaining(i);
@@ -261,7 +262,7 @@

 			public int PossibilityCount
 			{
-				get { return possCount; }
+				get { return possList.Count; }
 			}

 			public string PossibilityString
@@ -269,20 +270,36 @@
 				get
 				{
 					string ret = "";
-					for (int i = 1; i < 10; i++)
-						if (isPossible(i))
-							ret += " " + i;
+					for (int i = 0; i < possList.Count; i++)
+						ret += " " + possList[i];
 					return ret;

 				}
 			}

-			public PossibilitySet SetList
+			internal PossibilitySet SetList
 			{
 				get
 				{
 					return setList; //TODO? refactor to not provide full access to member? This helper class is private to SudokuGrid class...
 				}
+			}
+
+			internal List<int> PossibilityList
+			{
+				get
+				{
+					return possList; //TODO? refactor to not provide full access to member? This helper class is private to SudokuGrid class...
+				}
+			}
+
+			public bool isBuddy(gridSquare g)
+			{
+				if (X == g.X || Y == g.Y)
+					return true;
+				if (Y / 3 == g.Y / 3 && X / 3 == g.X / 3)
+					return true;
+				return false;
 			}
 		}

@@ -540,17 +557,9 @@
 						//check if possibility elimination applies
 						if (solveGrid[i, j].KnownValue == 0 && solveGrid[i, j].PossibilityCount == 1)
 						{
-							//find and save the remaining possibility
-							for (int n = 1; n <= 9; n++)
-							{
-								if (solveGrid[i, j].isPossible(n))
-								{
-									//solveGrid[i, j].KnownValue = n;
-									setKnownValue(i, j, n);
-									solveGrid[i, j].solveType = SolveType.PossibilityElimination;
-									break;
-								}
-							}
+							//save the remaining possibility
+							setKnownValue(i, j, solveGrid[i,j].PossibilityList[0]);
+							solveGrid[i, j].solveType = SolveType.PossibilityElimination;
 							madeIterationChanges = true;
 						}


Removed HexTileMaterial because it wasn't used any more

--- Assets/Code/HexTiles/HexTileMaterial.cs
+++ Assets/Code/HexTiles/HexTileMaterial.cs
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using UnityEngine;
-
-namespace HexTiles
-{
-    public class HexTileMaterial : ScriptableObject
-    {
-    }
-}


Auto remove UTF-8 BOM. IOS Lua cannot support

--- Assets/Plugins/Slua_Managed/LuaState.cs
+++ Assets/Plugins/Slua_Managed/LuaState.cs
@@ -913,8 +913,22 @@
 		}

 		public bool doBuffer(byte[] bytes, string fn, out object ret)
-		{
-			ret = null;
+        {
+            // ensure no utf-8 bom, LuaJIT can read BOM, but Lua cannot!
+            if (bytes.Length > 3)
+            {
+                if (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
+                {
+                    var oldBytes = bytes;
+                    bytes = new byte[bytes.Length - 3];
+                    for (var i = 0; i < bytes.Length; i++)
+                    {
+                        bytes[i] = oldBytes[i + 3];
+                    }
+                }
+            }
+
+            ret = null;
 			int errfunc = LuaObject.pushTry(L);
 			if (LuaDLL.luaL_loadbuffer(L, bytes, bytes.Length, fn) == 0)
 			{


control croco fix

control croco fix

--- Assets/Src/Controller/GameController.cs
+++ Assets/Src/Controller/GameController.cs
@@ -54,6 +54,7 @@
     public void LoadServerGame()
     {
         controlMan = false;
+        controlCroco = true;
         Debug.Log("Loading server game... " + controlMan);
         NetworkView.RPC("LoadClientGame", RPCMode.Others, !controlMan);
         StartLevel("TestLevel");


Clear error when restarting process.

Clear error when restarting process.

--- AvaloniaVS/Services/PreviewerProcess.cs
+++ AvaloniaVS/Services/PreviewerProcess.cs
@@ -120,6 +120,7 @@
             }

             _executablePath = executablePath;
+            Error = null;

             var port = FreeTcpPort();
             var tcs = new TaskCompletionSource<object>();


Fixed incorrect looping logic

Fixed incorrect looping logic

--- PracticeSharpApp/Core/PracticeSharpLogic.cs
+++ PracticeSharpApp/Core/PracticeSharpLogic.cs
@@ -684,9 +684,9 @@
                     loop = this.Loop;
                     if (loop)
                     {
+                        m_soundTouchSharp.Clear();
+                        m_waveChannel.Flush();
                         m_waveChannel.CurrentTime = this.StartMarker;
-                        m_soundTouchSharp.Flush();
-                        m_waveChannel.Flush();
                         isWaitForCue = (Cue.TotalSeconds > 0);
                         continue;
                     }


4.6.4.9

--- Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs
+++ Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // 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("4.6.4.8")]
-[assembly: AssemblyFileVersion("4.6.4.8")]
+[assembly: AssemblyVersion("4.6.4.9")]
+[assembly: AssemblyFileVersion("4.6.4.9")]


fixed some of the errors

fixed some of the errors

--- Src/Pc/CompilerCore/Backend/PrtCodeGenerator.cs
+++ Src/Pc/CompilerCore/Backend/PrtCodeGenerator.cs
@@ -208,6 +208,12 @@
                     return;
                 case Function function:
                     string functionImplName = context.Names.GetNameForFunctionImpl(function);
+
+                    context.WriteLine(output, $"PRT_VALUE* {functionImplName}(PRT_MACHINEINST* context, PRT_VALUE*** argRefs)");
+                    context.WriteLine(output, "{");
+                    WriteFunctionBody(context, function, output);
+                    context.WriteLine(output, "}");
+                    context.WriteLine(output);
                     context.WriteLine(output, $"PRT_FUNDECL {declName} =");
                     context.WriteLine(output, "{");
                     context.WriteLine(output, $"\"{function.Name}\","); // name of function in original program
@@ -215,10 +221,6 @@
                     context.WriteLine(output, "NULL"); // payload type for anonymous functions: always NULL.
                     context.WriteLine(output, "};");
                     context.WriteLine(output);
-                    context.WriteLine(output, $"PRT_VALUE* {functionImplName}(PRT_MACHINEINST* context, PRT_VALUE*** argRefs)");
-                    context.WriteLine(output, "{");
-                    WriteFunctionBody(context, function, output);
-                    context.WriteLine(output, "}");
                     break;
                 case Implementation _:
                     // does not produce a struct definition - aside from ProgramDecl
@@ -301,6 +303,10 @@
                 case NamedEventSet namedEventSet:
                     string innerSetName = context.Names.GetTemporaryName(namedEventSet.Name + "_INNER");
                     var eventDeclNames = namedEventSet.Events.Select(x => "&" + GetPrtNameForDecl(context, x)).ToList();
+                    if (eventDeclNames.Count == 0)
+                    {
+                        eventDeclNames.Add("NULL");
+                    }
                     context.WriteLine(output, $"PRT_EVENTDECL* {innerSetName}[] = {{ {string.Join(", ", eventDeclNames)} }};");
                     context.WriteLine(output, $"PRT_EVENTSETDECL {declName} =");
                     context.WriteLine(output, "{");
@@ -353,29 +359,41 @@
                     var transArrName = context.Names.GetTemporaryName("TRANS");
                     context.WriteLine(output, $"PRT_TRANSDECL {transArrName}[] =");
                     context.WriteLine(output, "{");
-                    for (var i = 0; i < stateData.Trans.Count; i++)
-                    {
-                        (PEvent triggerEvent, int destIndex, string transFunRef) = stateData.Trans[i];
-                        string triggerName = GetPrtNameForDecl(context, triggerEvent);
-                        var comma = i == stateData.Trans.Count - 1 ? "" : ",";
-                        context.WriteLine(output, $"{{ {stateIndex}, &{triggerName}, {destIndex}, {transFunRef} }}{comma}");
-                    }
-
+                    if(stateData.Trans.Count == 0)
+                    {
+                        context.WriteLine(output, "NULL");
+                    }
+                    else
+                    {
+                        for (var i = 0; i < stateData.Trans.Count; i++)
+                        {
+                            (PEvent triggerEvent, int destIndex, string transFunRef) = stateData.Trans[i];
+                            string triggerName = GetPrtNameForDecl(context, triggerEvent);
+                            var comma = i == stateData.Trans.Count - 1 ? "" : ",";
+                            context.WriteLine(output, $"{{ {stateIndex}, &{triggerName}, {destIndex}, {transFunRef} }}{comma}");
+                        }
+                    }
                     context.WriteLine(output, "};");
                     context.WriteLine(output);

                     var dosArrName = context.Names.GetTemporaryName("DOS");
                     context.WriteLine(output, $"PRT_DODECL {dosArrName}[] =");
                     context.WriteLine(output, "{");
-                    for (var i = 0; i < stateData.Dos.Count; i++)
-                    {
-                        (PEvent triggerEvent, Function transFun) = stateData.Dos[i];
-                        string triggerName = GetPrtNameForDecl(context, triggerEvent);
-                        var comma = i == stateData.Trans.Count - 1 ? "" : ",";
-                        var funName = transFun != null ? GetPrtNameForDecl(context, transFun) : "_P_NO_OP";
-                        context.WriteLine(output, $"{{ {stateIndex}, &{triggerName}, &{funName} }}{comma}");
-                    }
-
+                    if (stateData.Dos.Count == 0)
+                    {
+                        context.WriteLine(output, "NULL");
+                    }
+                    else
+                    {
+                        for (var i = 0; i < stateData.Dos.Count; i++)
+                        {
+                            (PEvent triggerEvent, Function transFun) = stateData.Dos[i];
+                            string triggerName = GetPrtNameForDecl(context, triggerEvent);
+                            var comma = i == stateData.Trans.Count - 1 ? "" : ",";
+                            var funName = transFun != null ? GetPrtNameForDecl(context, transFun) : "_P_NO_OP";
+                            context.WriteLine(output, $"{{ {stateIndex}, &{triggerName}, &{funName} }}{comma}");
+                        }
+                    }
                     context.WriteLine(output, "};");
                     context.WriteLine(output);


Travel line state progression adjusted slightly

starts in last value(IE do not draw, do not update) now.

--- Pulsar4X/Pulsar4X.Lib/Entities/TaskGroup.cs
+++ Pulsar4X/Pulsar4X.Lib/Entities/TaskGroup.cs
@@ -214,7 +214,7 @@
             Contact.LastYSystem = Contact.YSystem;
             Contact.CurrentSystem = StartingSystem;
             StartingSystem.AddContact(Contact);
-            DrawTravelLine = 2;
+            DrawTravelLine = 3;

             m_dMass = 0.0;


(V1.0.0) Code cleanups;

(V1.0.0) Code cleanups;

--- RDFSharp/Store/Engines/RDFSQLServerStore.cs
+++ RDFSharp/Store/Engines/RDFSQLServerStore.cs
@@ -45,19 +45,19 @@
                                  String sqlServerDatabase,
                                  String sqlServerUserName,
                                  String sqlServerUserPwd) {
-            if(sqlServerInstance            != null) {
-                if(sqlServerDatabase        != null) {
-                    if(sqlServerUserName    != null) {
-                        if(sqlServerUserPwd != null) {
+            if (sqlServerInstance            != null) {
+                if (sqlServerDatabase        != null) {
+                    if (sqlServerUserName    != null) {
+                        if (sqlServerUserPwd != null) {

                             //Initialize store structures
-                            this.StoreType   = "SQLSERVER";
-                            this.Connection  = new SqlConnection(@"Server="    + sqlServerInstance +
-                                                                  ";Database=" + sqlServerDatabase +
-                                                                  ";User Id="  + sqlServerUserName +
-                                                                  ";Password=" + sqlServerUserPwd  +
-                                                                  ";Persist Security Info=false;");
-                            this.StoreID     = RDFModelUtilities.CreateHash(this.ToString());
+                            this.StoreType    = "SQLSERVER";
+                            this.Connection   = new SqlConnection(@"Server="    + sqlServerInstance +
+                                                                   ";Database=" + sqlServerDatabase +
+                                                                   ";User Id="  + sqlServerUserName +
+                                                                   ";Password=" + sqlServerUserPwd  +
+                                                                   ";Persist Security Info=false;");
+                            this.StoreID      = RDFModelUtilities.CreateHash(this.ToString());

                             //Perform initial diagnostics
                             this.PrepareStore();
@@ -85,15 +85,15 @@
         /// </summary>
         public RDFSQLServerStore(String sqlServerInstance,
                                  String sqlServerDatabase) {
-            if(sqlServerInstance     != null) {
-                if(sqlServerDatabase != null) {
+            if (sqlServerInstance     != null) {
+                if (sqlServerDatabase != null) {

                     //Initialize store structures
-                    this.StoreType    = "SQLSERVER";
-                    this.Connection   = new SqlConnection(@"Server="    + sqlServerInstance +
-                                                           ";Database=" + sqlServerDatabase +
-                                                           ";Integrated Security=true;Persist Security Info=false;");
-                    this.StoreID      = RDFModelUtilities.CreateHash(this.ToString());
+                    this.StoreType     = "SQLSERVER";
+                    this.Connection    = new SqlConnection(@"Server="    + sqlServerInstance +
+                                                            ";Database=" + sqlServerDatabase +
+                                                            ";Integrated Security=true;Persist Security Info=false;");
+                    this.StoreID       = RDFModelUtilities.CreateHash(this.ToString());

                     //Perform initial diagnostics
                     this.PrepareStore();
@@ -138,7 +138,7 @@
                 command.Parameters.Add(new SqlParameter("SUBJID", SqlDbType.BigInt));
                 command.Parameters.Add(new SqlParameter("PRED",   SqlDbType.VarChar, 1000));
                 command.Parameters.Add(new SqlParameter("PREDID", SqlDbType.BigInt));
-                command.Parameters.Add(new SqlParameter("OBJ",    SqlDbType.VarChar, 5000));
+                command.Parameters.Add(new SqlParameter("OBJ",    SqlDbType.VarChar, 1000));
                 command.Parameters.Add(new SqlParameter("OBJID",  SqlDbType.BigInt));

                 try {
@@ -213,7 +213,7 @@
                 command.Parameters.Add(new SqlParameter("SUBJID", SqlDbType.BigInt));
                 command.Parameters.Add(new SqlParameter("PRED",   SqlDbType.VarChar, 1000));
                 command.Parameters.Add(new SqlParameter("PREDID", SqlDbType.BigInt));
-                command.Parameters.Add(new SqlParameter("OBJ",    SqlDbType.VarChar, 5000));
+                command.Parameters.Add(new SqlParameter("OBJ",    SqlDbType.VarChar, 1000));
                 command.Parameters.Add(new SqlParameter("OBJID",  SqlDbType.BigInt));

                 //Valorize parameters
@@ -824,7 +824,7 @@
                             else {
                                 //C->S->->
                                 command = new SqlCommand("SELECT [TripleFlavor], [Context], [Subject], [Predicate], [Object] FROM [dbo].[Quadruples] WHERE [ContextID] = @CTXID AND [SubjectID] = @SUBJID", this.Connection);
-                                command.Parameters.Add(new SqlParameter("CTXID", SqlDbType.BigInt));
+                                command.Parameters.Add(new SqlParameter("CTXID",  SqlDbType.BigInt));
                                 command.Parameters.Add(new SqlParameter("SUBJID", SqlDbType.BigInt));
                                 command.Parameters["CTXID"].Value  = ctx.PatternMemberID;
                                 command.Parameters["SUBJID"].Value = subj.PatternMemberID;
@@ -942,7 +942,7 @@
                     else {
                         if (obj     != null) {
                             //->S->->O
-                            command = new SqlCommand("SELECT [TripleFlavor], [Context], [Subject], [Predicate], [Object] FROM [dbo].[Quadruples] WHERE [SubjectID] = @SUBJID AND [ObjectID] = @OBJID AND [TripleFlavor] = @TFV", this.Connection);
+                            command  = new SqlCommand("SELECT [TripleFlavor], [Context], [Subject], [Predicate], [Object] FROM [dbo].[Quadruples] WHERE [SubjectID] = @SUBJID AND [ObjectID] = @OBJID AND [TripleFlavor] = @TFV", this.Connection);
                             command.Parameters.Add(new SqlParameter("TFV",    SqlDbType.Int));
                             command.Parameters.Add(new SqlParameter("SUBJID", SqlDbType.BigInt));
                             command.Parameters.Add(new SqlParameter("OBJID",  SqlDbType.BigInt));
@@ -1038,8 +1038,8 @@
                 command.Prepare();

                 //Execute command
-                using (var quadruples = command.ExecuteReader()) {
-                    if(quadruples.HasRows) {
+                using  (var quadruples = command.ExecuteReader()) {
+                    if (quadruples.HasRows) {
                         while(quadruples.Read()) {
                             result.AddQuadruple(RDFStoreUtilities.ParseQuadruple(quadruples));
                         }


Completed work on Google Translator

Completed work on Google Translator

--- ResXManager.Translators/GoogleTranslator.cs
+++ ResXManager.Translators/GoogleTranslator.cs
@@ -1,26 +1,168 @@
 namespace tomenglertde.ResXManager.Translators
 {
-    using System;
-    using System.Collections.Generic;
+	using System;
+	using System.Collections.Generic;
+	using System.ComponentModel.Composition;
+	using System.Diagnostics;
+	using System.Diagnostics.Contracts;
+	using System.Globalization;
+	using System.IO;
+	using System.Linq;
+	using System.Net;
+	using System.Net.Http;
+	using System.Runtime.Serialization;
+	using System.Text;
+	using System.Text.RegularExpressions;
+	using System.Threading.Tasks;

-    using JetBrains.Annotations;
+	using JetBrains.Annotations;

-    using tomenglertde.ResXManager.Infrastructure;
+	using Newtonsoft.Json;

-    public class GoogleTranslator : TranslatorBase
-    {
-        [NotNull]
-        private static readonly Uri _uri = new Uri("Todo");
-        [NotNull, ItemNotNull]
-        private static readonly IList<ICredentialItem> _credentialItems = new ICredentialItem[] { new CredentialItem("APIKey", "API Key") };
+	using tomenglertde.ResXManager.Infrastructure;

-        public GoogleTranslator()
-            : base("Google", "Google", _uri, _credentialItems)
-        {
-        }
+	using TomsToolbox.Core;
+	using TomsToolbox.Desktop;

-        public override void Translate(ITranslationSession translationSession)
-        {
-        }
-    }
+	[Export(typeof(ITranslator))]
+	public class GoogleTranslator : TranslatorBase
+	{
+		[NotNull]
+		private static readonly Uri _uri = new Uri("https://developers.google.com/translate/");
+		[NotNull, ItemNotNull]
+		private static readonly IList<ICredentialItem> _credentialItems = new ICredentialItem[] { new CredentialItem("APIKey", "API Key") };
+
+		public GoogleTranslator()
+			: base("Google", "Google", _uri, _credentialItems)
+		{
+		}
+
+		private string APIKey => Credentials[0].Value;
+
+		public override void Translate(ITranslationSession translationSession)
+		{
+			if (string.IsNullOrEmpty(APIKey))
+			{
+				translationSession.AddMessage("Google Translator requires API Key.");
+				return;
+			}
+
+			var replRegex = new Regex(@"&(?=[\w\d])", RegexOptions.Compiled);
+			foreach (var languageGroup in translationSession.Items.GroupBy(item => item.TargetCulture))
+			{
+				if (translationSession.IsCanceled)
+					break;
+
+				Contract.Assume(languageGroup != null);
+
+				var targetCulture = languageGroup.Key.Culture ?? translationSession.NeutralResourcesLanguage;
+				if (!targetCulture.IsNeutralCulture) targetCulture = targetCulture.Parent;
+
+				using (var itemsEnumerator = languageGroup.GetEnumerator())
+				{
+					var loop = true;
+					while (loop)
+					{
+						var sourceItems = itemsEnumerator.Take(10);
+						if (translationSession.IsCanceled || !sourceItems.Any())
+							break;
+
+						// Build out list of parameters
+						var parameters = new List<string>(30);
+						foreach (var item in sourceItems)
+							parameters.AddRange(new[] { "q", replRegex.Replace(item.Source, string.Empty) });
+						parameters.AddRange(new[] {
+							"target", targetCulture.TwoLetterISOLanguageName,
+							"format", "text",
+							"source", translationSession.SourceLanguage.TwoLetterISOLanguageName,
+							"model", "base",
+							"key", APIKey });
+
+						// Call the Google API
+						var responseTask = GetHttpResponse("https://translation.googleapis.com/language/translate/v2", null, parameters, JsonConverter<TranslationRootObject>);
+
+						// Handle successful run
+						responseTask.ContinueWith(t =>
+						{
+							translationSession.Dispatcher.BeginInvoke(() =>
+							{
+								foreach (var tuple in sourceItems.Zip(t.Result.data.translations,
+									(a, b) => new Tuple<ITranslationItem, string>(a, b.translatedText)))
+								{
+									Contract.Assume(tuple != null);
+									Contract.Assume(tuple.Item1 != null);
+									Contract.Assume(tuple.Item2 != null);
+									tuple.Item1.Results.Add(new TranslationMatch(this, tuple.Item2, 1.0));
+								}
+							});
+						}, TaskContinuationOptions.OnlyOnRanToCompletion);
+
+						// Handle exception in run
+						responseTask.ContinueWith(t => { translationSession.AddMessage(DisplayName + ": " + t.Exception?.InnerException?.Message); loop = false; }, TaskContinuationOptions.OnlyOnFaulted);
+					}
+				}
+			}
+		}
+
+		private static async Task<T> GetHttpResponse<T>(string baseUrl, string authHeader, ICollection<string> parameters, Func<Stream, T> conv)
+		{
+			var url = BuildUrl(baseUrl, parameters);
+			using (var c = new HttpClient())
+			{
+				if (!string.IsNullOrWhiteSpace(authHeader))
+					c.DefaultRequestHeaders.Add("Authorization", authHeader);
+				Debug.WriteLine("Google URL: " + url);
+				using (var stream = await c.GetStreamAsync(url))
+					return conv(stream);
+			}
+		}
+
+		private static T JsonConverter<T>(Stream stream)
+		{
+			using (var reader = new StreamReader(stream, Encoding.UTF8))
+				return JsonConvert.DeserializeObject<T>(reader.ReadToEnd());
+		}
+
+		[DataContract]
+		private class TranslationRootObject
+		{
+			[DataMember]
+			public Data data { get; set; }
+
+			[DataContract]
+			public class Data
+			{
+				[DataMember]
+				public List<Translation> translations { get; set; }
+
+				[DataContract]
+				public class Translation
+				{
+					[DataMember]
+					public string translatedText { get; set; }
+				}
+			}
+		}
+
+		/// <summary>Builds the URL from a base, method name, and name/value paired parameters. All parameters are encoded.</summary>
+		/// <param name="url">The base URL.</param>
+		/// <param name="pairs">The name/value paired parameters.</param>
+		/// <returns>Resulting URL.</returns>
+		/// <exception cref="System.ArgumentException">There must be an even number of strings supplied for parameters.</exception>
+		private static string BuildUrl(string url, ICollection<string> pairs)
+		{
+			if (pairs.Count % 2 != 0)
+				throw new ArgumentException("There must be an even number of strings supplied for parameters.");
+
+			var sb = new StringBuilder(url);
+			if (pairs.Count > 0)
+			{
+				sb.Append("?");
+				sb.Append(string.Join("&", pairs.Where((s, i) => i % 2 == 0).Zip(pairs.Where((s, i) => i % 2 == 1), Enc)));
+			}
+			return sb.ToString();
+
+			string Enc(string a, string b) => string.Concat(System.Web.HttpUtility.UrlEncode(a), "=", System.Web.HttpUtility.UrlEncode(b));
+		}
+	}
 }


# Ejemplos DirectX

# Ejemplos DirectX

--- TgcViewer/Examples/DirectX/EjemploGetZBuffer.cs
+++ TgcViewer/Examples/DirectX/EjemploGetZBuffer.cs
@@ -132,6 +132,7 @@

             //Cargar textura de zBuffer al shader
             effect.SetValue("texZBuffer", zBufferTexture);
+            effect.SetValue("screenDimensions", new float[]{d3dDevice.Viewport.Width, d3dDevice.Viewport.Height});

             //Render de cada mesh
             foreach (TgcMesh mesh in meshes)


SharpFileSystem.Tests: fixed a number of grouped tests

--- SharpFileSystem.Tests/FileSystemPathTest.cs
+++ SharpFileSystem.Tests/FileSystemPathTest.cs
@@ -307,9 +307,8 @@
         [TestMethod()]
         public void ChangeExtensionTest()
         {
-            _paths
-                .Where(p => p.IsFile)
-                .All(p => p.ChangeExtension(".exe").GetExtension() == ".exe");
+            foreach(var p in _paths.Where(p => p.IsFile))
+                Assert.IsTrue( p.ChangeExtension(".exe").GetExtension() == ".exe");
             EAssert.Throws<ArgumentException>(() => directoryA.ChangeExtension(".exe"));
         }

@@ -319,14 +318,18 @@
         [TestMethod()]
         public void AppendPathTest()
         {
-            Directories.All(p => p.AppendPath(root) == p);
-            Directories.All(p => p.AppendPath("") == p);
+            Assert.IsTrue(Directories.All(p => p.AppendPath(root) == p));
+            Assert.IsTrue(Directories.All(p => p.AppendPath("") == p));

             var subpath = FileSystemPath.Parse("/dir/file");
             var subpathstr = "dir/file";
-            Directories.All(p => p.AppendPath(subpath).ParentPath.ParentPath == p);
-            Directories.All(p => p.AppendPath(subpathstr).ParentPath.ParentPath == p);
-            Directories.All(pa => _paths.All(pb => pa.AppendPath(pb).IsChildOf(pa)));
+            foreach(var p in Directories)
+                Assert.IsTrue(p.AppendPath(subpath).ParentPath.ParentPath == p);
+            foreach(var p in Directories)
+                Assert.IsTrue(p.AppendPath(subpathstr).ParentPath.ParentPath == p);
+            foreach(var pa in Directories)
+            foreach (var pb in _paths.Where(pb => !pb.IsRoot))
+                Assert.IsTrue(pa.AppendPath(pb).IsChildOf(pa));
             EAssert.Throws<InvalidOperationException>(() => fileA.AppendPath(subpath));
             EAssert.Throws<InvalidOperationException>(() => fileA.AppendPath(subpathstr));
             EAssert.Throws<ArgumentException>(() => directoryA.AppendPath("/rootedpath/"));
@@ -338,9 +341,12 @@
         [TestMethod()]
         public void AppendFileTest()
         {
-            Directories.All(d => d.AppendFile("file").IsFile);
-            Directories.All(d => d.AppendFile("file").EntityName == "file");
-            Directories.All(d => d.AppendFile("file").ParentPath == d);
+            foreach(var d in Directories)
+                Assert.IsTrue(d.AppendFile("file").IsFile);
+            foreach (var d in Directories)
+                Assert.IsTrue(d.AppendFile("file").EntityName == "file");
+            foreach(var d in Directories)
+                Assert.IsTrue(d.AppendFile("file").ParentPath == d);
             EAssert.Throws<InvalidOperationException>(() => fileA.AppendFile("file"));
             EAssert.Throws<ArgumentException>(() => directoryA.AppendFile("dir/file"));
         }
@@ -351,9 +357,12 @@
         [TestMethod()]
         public void AppendDirectoryTest()
         {
-            Directories.All(d => d.AppendDirectory("dir").IsDirectory);
-            Directories.All(d => d.AppendDirectory("dir").EntityName == "dir");
-            Directories.All(d => d.AppendDirectory("dir").ParentPath == d);
+            foreach(var d in Directories)
+                Assert.IsTrue(d.AppendDirectory("dir").IsDirectory);
+            foreach(var d in Directories)
+                Assert.IsTrue(d.AppendDirectory("dir").EntityName == "dir");
+            foreach (var d in Directories)
+                Assert.IsTrue(d.AppendDirectory("dir").ParentPath == d);
             EAssert.Throws<InvalidOperationException>(() => fileA.AppendDirectory("dir"));
             EAssert.Throws<ArgumentException>(() => root.AppendDirectory("dir/dir"));
         }


Remove unnecessary Id property, get from base ShopifyObject instead

--- ShopifySharp/Entities/GiftCardAdjustment.cs
+++ ShopifySharp/Entities/GiftCardAdjustment.cs
@@ -1,18 +1,10 @@
 using Newtonsoft.Json;
 using System;
-using System.Collections.Generic;
-using System.Text;

 namespace ShopifySharp
 {
     public class GiftCardAdjustment : ShopifyObject
     {
-        /// <summary>
-        /// A unique numeric identifier for the adjustment.
-        /// </summary>
-        [JsonProperty("id")]
-        public long? Id{ get; set; }
-
         /// <summary>
         /// A unique numeric identifier for gift card the adjustment is applied onto.
         /// </summary>


select all en los buscadores

select all en los buscadores

(TFS CS 5988)

--- Signum.Web.Extensions.Sample/Global.asax.cs
+++ Signum.Web.Extensions.Sample/Global.asax.cs
@@ -80,7 +80,7 @@
                 Settings = new Dictionary<Enum, OperationSettings>()
             });

-            QueriesClient.Start();
+            UserQueriesClient.Start();

             MusicClient.Start();


Revert fix for #522

Revert fix for #522

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -57,8 +57,6 @@

             //Redraw on Resize so Cef is notified and updates accordingly
             SetStyle(ControlStyles.ResizeRedraw, true);
-            //Fix for #522 - Enable DoubleBuffering
-            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

             Dock = DockStyle.Fill;
         }


Untabify JavascriptBindingExtensions

Untabify JavascriptBindingExtensions

--- CefSharp/JavascriptBindingExtensions.cs
+++ CefSharp/JavascriptBindingExtensions.cs
@@ -10,36 +10,36 @@

 namespace CefSharp
 {
-	public static class JavascriptBindingExtensions
-	{
-		public static Task<IList<string>> EnsureObjectBoundAsync(this IWebBrowser browser, params string[] names)
-		{
-			var objBoundTasks = new TaskCompletionSource<IList<string>>();
+    public static class JavascriptBindingExtensions
+    {
+        public static Task<IList<string>> EnsureObjectBoundAsync(this IWebBrowser browser, params string[] names)
+        {
+            var objBoundTasks = new TaskCompletionSource<IList<string>>();

-			EventHandler<JavascriptBindingMultipleCompleteEventArgs> handler = null;
-			handler = (sender, args) =>
-			{
-				//Remove handler
-				browser.JavascriptObjectRepository.ObjectsBoundInJavascript -= handler;
+            EventHandler<JavascriptBindingMultipleCompleteEventArgs> handler = null;
+            handler = (sender, args) =>
+            {
+                //Remove handler
+                browser.JavascriptObjectRepository.ObjectsBoundInJavascript -= handler;

-				var allObjectsBound = names.ToList().SequenceEqual(args.ObjectNames);
-				if (allObjectsBound)
-				{
-					objBoundTasks.SetResult(args.ObjectNames);
-				}
-				else
-				{
-					objBoundTasks.SetException(new Exception("Not all objects were bound successfully, bound objects were " + string.Join(",", args.ObjectNames)));
-				}
-			};
+                var allObjectsBound = names.ToList().SequenceEqual(args.ObjectNames);
+                if (allObjectsBound)
+                {
+                    objBoundTasks.SetResult(args.ObjectNames);
+                }
+                else
+                {
+                    objBoundTasks.SetException(new Exception("Not all objects were bound successfully, bound objects were " + string.Join(",", args.ObjectNames)));
+                }
+            };

-			browser.JavascriptObjectRepository.ObjectsBoundInJavascript += handler;
+            browser.JavascriptObjectRepository.ObjectsBoundInJavascript += handler;

-			var bindCommand = "(async function() { CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: false }, '" + string.Join("', '", names) + "'); })();";
+            var bindCommand = "(async function() { CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: false }, '" + string.Join("', '", names) + "'); })();";

-			browser.ExecuteScriptAsync(bindCommand);
+            browser.ExecuteScriptAsync(bindCommand);

-			return objBoundTasks.Task;
-		}
-	}
+            return objBoundTasks.Task;
+        }
+    }
 }


Updated FullNote

Updated FullNote

FullNote now implements IComparable, and Shift is now correct.

--- Chordious.Core/Common/Music/FullNote.cs
+++ Chordious.Core/Common/Music/FullNote.cs
@@ -28,7 +28,7 @@

 namespace com.jonthysell.Chordious.Core
 {
-    public class FullNote
+    public class FullNote : IComparable
     {
         public Note Note { get; set; }

@@ -65,11 +65,58 @@

         public FullNote Shift(int steps, InternalNoteStringStyle style)
         {
-            InternalNote note = NoteUtils.Shift(InternalNote, steps);
+            if (steps == 0)
+            {
+                return new FullNote(NoteUtils.ToNote(InternalNote, style), Octave);
+            }

-            int octave = Octave + (steps / 12);
+            int direction = Math.Sign(steps);
+
+            InternalNote note = InternalNote;
+            int octave = Octave;
+
+            for (int i = 0; i < steps; i++)
+            {
+                int noteIndex = (int)note + direction;
+                if (noteIndex < 0)
+                {
+                    noteIndex += 12;
+                }
+
+                note = (InternalNote)(noteIndex % 12);
+
+                if (direction > 0 && note == InternalNote.C)
+                {
+                    octave++;
+                }
+                else if (direction < 0 && note == InternalNote.B)
+                {
+                    octave--;
+                }
+            }

             return new FullNote(NoteUtils.ToNote(note, style), octave);
+        }
+
+        public int CompareTo(object obj)
+        {
+            if (null == obj)
+            {
+                throw new ArgumentNullException("obj");
+            }
+
+            FullNote fullNote = obj as FullNote;
+            if (null == fullNote)
+            {
+                throw new ArgumentException();
+            }
+
+            if (Octave == fullNote.Octave)
+            {
+                return InternalNote.CompareTo(fullNote.InternalNote);
+            }
+
+            return Octave.CompareTo(fullNote.Octave);
         }

         public override string ToString()


Ignore Command Case

Ignore Command Case

--- Chraft/Commands/ClientCommandHandler.cs
+++ Chraft/Commands/ClientCommandHandler.cs
@@ -24,12 +24,9 @@
         /// <returns>A command with the given name.</returns>
         public ICommand Find(string Command)
         {
-            foreach (IClientCommand cmd in commands)
+            foreach (IClientCommand cmd in commands.Where(cmd => cmd.Name.ToLower() == Command.ToLower()))
             {
-                if (cmd.Name == Command)
-                {
-                    return cmd;
-                }
+                return cmd;
             }
             IClientCommand Cmd;
             try
@@ -52,7 +49,7 @@
         {
             foreach (IClientCommand cmd in commands)
             {
-                if (cmd.Shortcut == Shortcut)
+                if (cmd.Shortcut.ToLower() == Shortcut.ToLower())
                 {
                     return cmd;
                 }


Tweaked logging message

Tweaked logging message

--- Circuit/Simulation/TransientSolution.cs
+++ Circuit/Simulation/TransientSolution.cs
@@ -153,7 +153,7 @@

                 List<LinearCombination> newton = J.Select(i => new LinearCombination(y, i.ToExpression())).ToList();
                 solutions.Add(new NewtonRhapsonIteration(solved, newton, y));
-                LogExpressions(Log, "Non-linear Newton update equations:", newton.Select(i => Equal.New(i.ToExpression(), Constant.Zero)));
+                LogExpressions(Log, "Non-linear Newton update:", newton.Select(i => Equal.New(i.ToExpression(), Constant.Zero)));
                 LogExpressions(Log, "Linear Newton update:", solved);
             }


Protect Storage in ClearUnmanagedInventory (#3862)

* Protect Storage in ClearUnmanagedInventory

* Update Container.cs

--- Source/ACE.Server/WorldObjects/Container.cs
+++ Source/ACE.Server/WorldObjects/Container.cs
@@ -609,6 +609,9 @@
         /// <returns>TRUE if all unmanaged items were removed successfully</returns>
         public bool ClearUnmanagedInventory(bool forceSave = false)
         {
+            if (this is Storage || WeenieClassId == (uint)ACE.Entity.Enum.WeenieClassName.W_STORAGE_CLASS)
+                return false; // Do not clear storage, ever.
+
             var success = true;
             var itemGuids = Inventory.Where(i => i.Value.GeneratorId == null).Select(i => i.Key).ToList();
             foreach (var itemGuid in itemGuids)


Fixed crashing bug with the histograù

Fixed crashing bug with the histograù

Former-commit-id: ac84f1be1ed7d7d9c2052162066e7754324e2a79 [formerly e68a5f6e53dd4d86b47cb1f6408b5d77b535aa48]
Former-commit-id: b516d2b652390762b058e551e722dd8c5ca09d4b [formerly 4c70eaec66d4cd7c4de8c54fc99fba8b9e888983]
Former-commit-id: dd1c01469e6c358ec82a6378dee2cccaa3b4d275
Former-commit-id: 12bf877e05f33e6687f851c527ab96818ca73d3a

--- Source/RawParser/View/UIHelper/Histogram.cs
+++ Source/RawParser/View/UIHelper/Histogram.cs
@@ -21,10 +21,10 @@
             for (int i = 0; i < value.Length; i++)
             {
                 Line line = null;
-                int widthstep = (int)(value.Length / histogramCanvas.ActualWidth);
                 await CoreApplication.MainView.CoreWindow.Dispatcher
                      .RunAsync(CoreDispatcherPriority.Normal, () =>
                      {
+                         int widthstep = (int)(value.Length / histogramCanvas.ActualWidth);
                          value[i] = (int)(value[i] / ((height * width) / (256 * 10)));
                          line = new Line();
                          line.Stroke = new SolidColorBrush(Colors.Black);


Reverted the added "new Thread(...)" from RegistryHandler.cs

--- Client/Core/Commands/RegistryHandler.cs
+++ Client/Core/Commands/RegistryHandler.cs
@@ -28,99 +28,87 @@

         public static void HandleGetRegistryKey(xClient.Core.Packets.ServerPackets.DoLoadRegistryKey packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetRegistryKeysResponse responsePacket = new Packets.ClientPackets.GetRegistryKeysResponse();
-                try
-                {
-                    RegistrySeeker seeker = new RegistrySeeker();
-                    seeker.BeginSeeking(packet.RootKeyName);
-
-                    responsePacket.Matches = seeker.Matches;
-                    responsePacket.IsError = false;
-                }
-                catch (Exception e)
-                {
-                    responsePacket.IsError = true;
-                    responsePacket.ErrorMsg = e.Message;
-                }
-                responsePacket.RootKey = packet.RootKeyName;
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetRegistryKeysResponse responsePacket = new Packets.ClientPackets.GetRegistryKeysResponse();
+            try
+            {
+                RegistrySeeker seeker = new RegistrySeeker();
+                seeker.BeginSeeking(packet.RootKeyName);
+
+                responsePacket.Matches = seeker.Matches;
+                responsePacket.IsError = false;
+            }
+            catch (Exception e)
+            {
+                responsePacket.IsError = true;
+                responsePacket.ErrorMsg = e.Message;
+            }
+            responsePacket.RootKey = packet.RootKeyName;
+            responsePacket.Execute(client);
         }

         #region Registry Key Edit

         public static void HandleCreateRegistryKey(xClient.Core.Packets.ServerPackets.DoCreateRegistryKey packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryKeyResponse();
-                string errorMsg = "";
-                string newKeyName = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.CreateRegistryKey(packet.ParentPath, out newKeyName, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-
-                responsePacket.Match = new RegSeekerMatch(newKeyName, null, 0);
-                responsePacket.ParentPath = packet.ParentPath;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryKeyResponse();
+            string errorMsg = "";
+            string newKeyName = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.CreateRegistryKey(packet.ParentPath, out newKeyName, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+
+            responsePacket.Match = new RegSeekerMatch(newKeyName, null, 0);
+            responsePacket.ParentPath = packet.ParentPath;
+
+            responsePacket.Execute(client);
         }

         public static void HandleDeleteRegistryKey(xClient.Core.Packets.ServerPackets.DoDeleteRegistryKey packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetDeleteRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetDeleteRegistryKeyResponse();
-                string errorMsg = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.DeleteRegistryKey(packet.KeyName, packet.ParentPath, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.ParentPath = packet.ParentPath;
-                responsePacket.KeyName = packet.KeyName;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetDeleteRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetDeleteRegistryKeyResponse();
+            string errorMsg = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.DeleteRegistryKey(packet.KeyName, packet.ParentPath, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.ParentPath = packet.ParentPath;
+            responsePacket.KeyName = packet.KeyName;
+
+            responsePacket.Execute(client);
         }

         public static void HandleRenameRegistryKey(xClient.Core.Packets.ServerPackets.DoRenameRegistryKey packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetRenameRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetRenameRegistryKeyResponse();
-                string errorMsg = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.RenameRegistryKey(packet.OldKeyName, packet.NewKeyName, packet.ParentPath, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.ParentPath = packet.ParentPath;
-                responsePacket.OldKeyName = packet.OldKeyName;
-                responsePacket.NewKeyName = packet.NewKeyName;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetRenameRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetRenameRegistryKeyResponse();
+            string errorMsg = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.RenameRegistryKey(packet.OldKeyName, packet.NewKeyName, packet.ParentPath, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.ParentPath = packet.ParentPath;
+            responsePacket.OldKeyName = packet.OldKeyName;
+            responsePacket.NewKeyName = packet.NewKeyName;
+
+            responsePacket.Execute(client);
         }

         #endregion
@@ -129,96 +117,84 @@

         public static void HandleCreateRegistryValue(xClient.Core.Packets.ServerPackets.DoCreateRegistryValue packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetCreateRegistryValueResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryValueResponse();
-                string errorMsg = "";
-                string newKeyName = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.CreateRegistryValue(packet.KeyPath, packet.Kind, out newKeyName, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.Value = new RegValueData(newKeyName, packet.Kind, packet.Kind.GetDefault());
-                responsePacket.KeyPath = packet.KeyPath;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetCreateRegistryValueResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryValueResponse();
+            string errorMsg = "";
+            string newKeyName = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.CreateRegistryValue(packet.KeyPath, packet.Kind, out newKeyName, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.Value = new RegValueData(newKeyName, packet.Kind, packet.Kind.GetDefault());
+            responsePacket.KeyPath = packet.KeyPath;
+
+            responsePacket.Execute(client);
         }

         public static void HandleDeleteRegistryValue(xClient.Core.Packets.ServerPackets.DoDeleteRegistryValue packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetDeleteRegistryValueResponse responsePacket = new Packets.ClientPackets.GetDeleteRegistryValueResponse();
-                string errorMsg = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.DeleteRegistryValue(packet.KeyPath, packet.ValueName, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.ValueName = packet.ValueName;
-                responsePacket.KeyPath = packet.KeyPath;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetDeleteRegistryValueResponse responsePacket = new Packets.ClientPackets.GetDeleteRegistryValueResponse();
+            string errorMsg = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.DeleteRegistryValue(packet.KeyPath, packet.ValueName, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.ValueName = packet.ValueName;
+            responsePacket.KeyPath = packet.KeyPath;
+
+            responsePacket.Execute(client);
         }

         public static void HandleRenameRegistryValue(xClient.Core.Packets.ServerPackets.DoRenameRegistryValue packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetRenameRegistryValueResponse responsePacket = new Packets.ClientPackets.GetRenameRegistryValueResponse();
-                string errorMsg = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.RenameRegistryValue(packet.OldValueName, packet.NewValueName, packet.KeyPath, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.KeyPath = packet.KeyPath;
-                responsePacket.OldValueName = packet.OldValueName;
-                responsePacket.NewValueName = packet.NewValueName;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetRenameRegistryValueResponse responsePacket = new Packets.ClientPackets.GetRenameRegistryValueResponse();
+            string errorMsg = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.RenameRegistryValue(packet.OldValueName, packet.NewValueName, packet.KeyPath, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.KeyPath = packet.KeyPath;
+            responsePacket.OldValueName = packet.OldValueName;
+            responsePacket.NewValueName = packet.NewValueName;
+
+            responsePacket.Execute(client);
         }

         public static void HandleChangeRegistryValue(xClient.Core.Packets.ServerPackets.DoChangeRegistryValue packet, Client client)
         {
-            new Thread(() =>
-            {
-                xClient.Core.Packets.ClientPackets.GetChangeRegistryValueResponse responsePacket = new Packets.ClientPackets.GetChangeRegistryValueResponse();
-                string errorMsg = "";
-                try
-                {
-                    responsePacket.IsError = !(RegistryEditor.ChangeRegistryValue(packet.Value, packet.KeyPath, out errorMsg));
-                }
-                catch (Exception ex)
-                {
-                    responsePacket.IsError = true;
-                    errorMsg = ex.Message;
-                }
-                responsePacket.ErrorMsg = errorMsg;
-                responsePacket.KeyPath = packet.KeyPath;
-                responsePacket.Value = packet.Value;
-
-                responsePacket.Execute(client);
-            }).Start();
+            xClient.Core.Packets.ClientPackets.GetChangeRegistryValueResponse responsePacket = new Packets.ClientPackets.GetChangeRegistryValueResponse();
+            string errorMsg = "";
+            try
+            {
+                responsePacket.IsError = !(RegistryEditor.ChangeRegistryValue(packet.Value, packet.KeyPath, out errorMsg));
+            }
+            catch (Exception ex)
+            {
+                responsePacket.IsError = true;
+                errorMsg = ex.Message;
+            }
+            responsePacket.ErrorMsg = errorMsg;
+            responsePacket.KeyPath = packet.KeyPath;
+            responsePacket.Value = packet.Value;
+
+            responsePacket.Execute(client);
         }

         #endregion


Added more sync locks

Added more sync locks

--- Client/VesselStore/VesselProtoUpdate.cs
+++ Client/VesselStore/VesselProtoUpdate.cs
@@ -60,11 +60,14 @@

         public VesselProtoUpdate(byte[] vesselData, int numBytes, Guid vesselId)
         {
-            if (vesselId == Guid.Empty)
-                throw new Exception("Cannot create a VesselProtoUpdate with an empty vesselId.");
+            lock (_vesselDataSyncLock)
+            {
+                if (vesselId == Guid.Empty)
+                    throw new Exception("Cannot create a VesselProtoUpdate with an empty vesselId.");

-            VesselId = vesselId;
-            CopyVesselBytes(vesselData, numBytes);
+                VesselId = vesselId;
+                CopyVesselBytes(vesselData, numBytes);
+            }
         }

         /// <summary>
@@ -72,16 +75,19 @@
         /// </summary>
         public void Update(byte[] vesselData, int numBytes, Guid vesselId)
         {
-            if (VesselId != vesselId)
+            lock (_vesselDataSyncLock)
             {
-                LunaLog.LogError("Cannot update a VesselProtoUpdate with a different vesselId");
-                return;
+                if (VesselId != vesselId)
+                {
+                    LunaLog.LogError("Cannot update a VesselProtoUpdate with a different vesselId");
+                    return;
+                }
+
+                CopyVesselBytes(vesselData, numBytes);
+
+                _needToDeserializeData = true;
+                VesselHasUpdate = true;
             }
-
-            CopyVesselBytes(vesselData, numBytes);
-
-            _needToDeserializeData = true;
-            VesselHasUpdate = true;
         }

         /// <summary>
@@ -89,14 +95,11 @@
         /// </summary>
         private void CopyVesselBytes(byte[] vesselData, int numBytes)
         {
-            lock (_vesselDataSyncLock)
-            {
-                _numBytes = numBytes;
+            _numBytes = numBytes;

-                if (_vesselData.Length < _numBytes)
-                    Array.Resize(ref _vesselData, _numBytes);
-                Array.Copy(vesselData, _vesselData, _numBytes);
-            }
+            if (_vesselData.Length < _numBytes)
+                Array.Resize(ref _vesselData, _numBytes);
+            Array.Copy(vesselData, _vesselData, _numBytes);
         }

         /// <summary>


Add missing change

Add missing change

--- Core/ProtoCore/Parser/AssociativeAST.cs
+++ Core/ProtoCore/Parser/AssociativeAST.cs
@@ -508,18 +508,21 @@
         public FunctionCallNode DotCall { get; set; }
         public FunctionCallNode FunctionCall { get; set; }
         public FunctionCallNode NameMangledCall { get; set; }
+        public bool isLastSSAIdentListFactor { get; set; }
         public string lhsName { get; set; }

         public FunctionDotCallNode(FunctionCallNode callNode)
         {
             DotCall = new FunctionCallNode();
             FunctionCall = callNode;
+            isLastSSAIdentListFactor = false;
         }

         public FunctionDotCallNode(string lhsName, FunctionCallNode callNode)
         {
             this.lhsName = lhsName;
             FunctionCall = callNode;
+            isLastSSAIdentListFactor = false;
         }

         public FunctionDotCallNode(FunctionDotCallNode rhs): base(rhs)
@@ -527,6 +530,7 @@
             DotCall = new FunctionCallNode(rhs.DotCall);
             FunctionCall = new FunctionCallNode(rhs.FunctionCall);
             lhsName = rhs.lhsName;
+            isLastSSAIdentListFactor = rhs.isLastSSAIdentListFactor;
         }

         public IdentifierListNode GetIdentList()


New GIF command help.

New GIF command help.

--- Coremero/Coremero.Plugin.Classic/Gif.cs
+++ Coremero/Coremero.Plugin.Classic/Gif.cs
@@ -44,7 +44,7 @@
         }
         */

-        [Command("gif")]
+        [Command("gif", Help = ".gif <query> Get a random GIF from Riffy.")]
         public async Task<IMessage> Riffsy(IInvocationContext context, IMessage message)
         {
             using (HttpClient client = new HttpClient())
@@ -79,7 +79,7 @@

         }

-        [Command("giphy")]
+        [Command("giphy", Help = ".giphy <query> Get a random GIF from Giphy.")]
         public async Task<IMessage> Giphy(IInvocationContext context, IMessage message)
         {
             using (HttpClient client = new HttpClient())
@@ -96,7 +96,7 @@
             }
         }

-        [Command("howitsmade")]
+        [Command("howitsmade", Help = "Get a random How It's Made GIF.")]
         public async Task<IMessage> RandomHowItsMade(IInvocationContext context, IMessage message)
         {
             return await Giphy(context, Message.Create("hows its made"));


Fix an issue that StorkeWatcher is not thread safe.

--- CreviceLib/Core.Stroke.StrokeWatcher.cs
+++ CreviceLib/Core.Stroke.StrokeWatcher.cs
@@ -21,6 +21,8 @@
         internal readonly List<Stroke> strokes = new List<Stroke>();
         internal readonly List<Point> buffer = new List<Point>();
         internal readonly Task task;
+
+        private readonly object _lockObject = new object();

         public StrokeWatcher(
             IStrokeCallbackManager callbacks,
@@ -54,37 +56,40 @@
                 {
                     foreach (var point in queue.GetConsumingEnumerable())
                     {
-                        buffer.Add(point);
-                        if (buffer.Count < 2)
+                        lock (_lockObject)
                         {
-                            continue;
-                        }
-                        if (strokes.Count == 0)
-                        {
-                            if (Stroke.CanCreate(initialStrokeThreshold, buffer.First(), buffer.Last()))
+                            buffer.Add(point);
+                            if (buffer.Count < 2)
                             {
-                                var stroke = new Stroke(strokeDirectionChangeThreshold, strokeExtensionThreshold, buffer);
-                                strokes.Add(stroke);
-                                buffer.Clear();
-                                Callbacks.OnStrokeUpdated(CallbackArgument);
+                                continue;
                             }
-                        }
-                        else
-                        {
-                            var stroke = strokes.Last();
-                            var _strokePointsCount = stroke.Points.Count;
+                            if (strokes.Count == 0)
+                            {
+                                if (Stroke.CanCreate(initialStrokeThreshold, buffer.First(), buffer.Last()))
+                                {
+                                    var stroke = new Stroke(strokeDirectionChangeThreshold, strokeExtensionThreshold, buffer);
+                                    strokes.Add(stroke);
+                                    buffer.Clear();
+                                    Callbacks.OnStrokeUpdated(GetStrokesDeepClone());
+                                }
+                            }
+                            else
+                            {
+                                var stroke = strokes.Last();
+                                var _strokePointsCount = stroke.Points.Count;

-                            var res = stroke.Input(buffer);
-                            if (stroke != res)
-                            {
-                                strokes.Add(res);
-                                buffer.Clear();
-                                Callbacks.OnStrokeUpdated(CallbackArgument);
-                            }
-                            else if (_strokePointsCount != stroke.Points.Count)
-                            {
-                                buffer.Clear();
-                                Callbacks.OnStrokeUpdated(CallbackArgument);
+                                var res = stroke.Input(buffer);
+                                if (stroke != res)
+                                {
+                                    strokes.Add(res);
+                                    buffer.Clear();
+                                    Callbacks.OnStrokeUpdated(GetStrokesDeepClone());
+                                }
+                                else if (_strokePointsCount != stroke.Points.Count)
+                                {
+                                    buffer.Clear();
+                                    Callbacks.OnStrokeUpdated(GetStrokesDeepClone());
+                                }
                             }
                         }
                     }
@@ -93,13 +98,29 @@
             });
         }

-        private IReadOnlyList<Stroke> CallbackArgument => strokes.Select(s => s.Freeze()).ToList();
+        private IReadOnlyList<Stroke> GetStrokesDeepClone()
+        {
+            lock(_lockObject)
+            {
+                return strokes.Select(s => s.Freeze()).ToList();
+            }
+        }

         public IReadOnlyList<Stroke> GetStorkes()
-            => strokes.ToList();
+        {
+            lock (_lockObject)
+            {
+                return strokes.ToList();
+            }
+        }

         public StrokeSequence GetStrokeSequence()
-            => new StrokeSequence(strokes.Select(x => x.Direction));
+        {
+            lock (_lockObject)
+            {
+                return new StrokeSequence(strokes.Select(x => x.Direction));
+            }
+        }

         internal bool _disposed { get; private set; } = false;


Attempt to fix a unit test

Attempt to fix a unit test

--- Source/Tests/Pipeline/EventPipelineTests.cs
+++ Source/Tests/Pipeline/EventPipelineTests.cs
@@ -460,10 +460,8 @@
                 ev.ProjectId = TestConstants.ProjectId;
                 ev.OrganizationId = TestConstants.OrganizationId;
             }
-
-            await _client.RefreshAsync();
+
             var contexts = await pipeline.RunAsync(events);
-
             Assert.True(contexts.All(c => c.IsProcessed));
             Assert.True(contexts.All(c => !c.IsCancelled));
             Assert.True(contexts.All(c => !c.HasError));


Fixup

Fixup

--- Test/AnalysisEngineTest.cs
+++ Test/AnalysisEngineTest.cs
@@ -61,8 +61,8 @@
             IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMsDataFile = new TestDataFile(new List<PeptideWithSetModifications> { value.First(), value2.First(), value3.First() });

             var searchModes = new List<SearchMode> { new SinglePpmAroundZeroSearchMode(5) };
-            Action<List<ProteinGroup>, string> action3 = null;
-            Action<List<NewPsmWithFdr>, string> action2 = (List<NewPsmWithFdr> l, string s) => {; };
+            Action<List<ProteinGroup>, string, List<string>> action3 = null;
+            Action<List<NewPsmWithFdr>, string, List<string>> action2 = (List<NewPsmWithFdr> l, string s, List<string> sdf) => {; };
             bool doParsimony = false;
             bool noOneHitWonders = false;
             bool modPepsAreUnique = false;


Added editor stub methods for arc shape

Added editor stub methods for arc shape

--- Test/Core/Editor/Editor.cs
+++ Test/Core/Editor/Editor.cs
@@ -243,43 +243,41 @@
             double sy = SnapToGrid ? Snap(y, SnapY) : y;
             switch (CurrentTool)
             {
-                // None
                 case Tool.None:
                     {
                         NoneLeft(sx, sy);
                     }
                     break;
-                // Line
                 case Tool.Line:
                     {
                         LineLeft(sx, sy);
                     }
                     break;
-                // Rectangle
                 case Tool.Rectangle:
                     {
                         RectangleLeft(sx, sy);
                     }
                     break;
-                // Ellipse
                 case Tool.Ellipse:
                     {
                         EllipseLeft(sx, sy);
                     }
                     break;
-                // Bezier
+                case Tool.Arc:
+                    {
+                        ArcLeft(sx, sy);
+                    }
+                    break;
                 case Tool.Bezier:
                     {
                         BezierLeft(sx, sy);
                     }
                     break;
-                // QBezier
                 case Tool.QBezier:
                     {
                         QBezierLeft(sx, sy);
                     }
                     break;
-                // Text
                 case Tool.Text:
                     {
                         TextLeft(sx, sy);
@@ -294,43 +292,41 @@
             double sy = SnapToGrid ? Snap(y, SnapY) : y;
             switch (CurrentTool)
             {
-                // None
                 case Tool.None:
                     {
                         NoneRight(sx, sy);
                     }
                     break;
-                // Line
                 case Tool.Line:
                     {
                         LineRight(sx, sy);
                     }
                     break;
-                // Rectangle
                 case Tool.Rectangle:
                     {
                         RectangleRight(sx, sy);
                     }
                     break;
-                // Ellipse
                 case Tool.Ellipse:
                     {
                         EllipseRight(sx, sy);
                     }
                     break;
-                // Bezier
+                case Tool.Arc:
+                    {
+                        ArcRight(sx, sy);
+                    }
+                    break;
                 case Tool.Bezier:
                     {
                         BezierRight(sx, sy);
                     }
                     break;
-                // QBezier
                 case Tool.QBezier:
                     {
                         QBezierRight(sx, sy);
                     }
                     break;
-                // Text
                 case Tool.Text:
                     {
                         TextRight(sx, sy);
@@ -345,43 +341,41 @@
             double sy = SnapToGrid ? Snap(y, SnapY) : y;
             switch (CurrentTool)
             {
-                // None
                 case Tool.None:
                     {
                         NoneMove(sx, sy);
                     }
                     break;
-                // Line
                 case Tool.Line:
                     {
                         LineMove(sx, sy);
                     }
                     break;
-                // Rectangle
                 case Tool.Rectangle:
                     {
                         RectangleMove(sx, sy);
                     }
                     break;
-                // Ellipse
                 case Tool.Ellipse:
                     {
                         EllipseMove(sx, sy);
                     }
                     break;
-                // Bezier
+                case Tool.Arc:
+                    {
+                        ArcMove(sx, sy);
+                    }
+                    break;
                 case Tool.Bezier:
                     {
                         BezierMove(sx, sy);
                     }
                     break;
-                // QBezier
                 case Tool.QBezier:
                     {
                         QBezierMove(sx, sy);
                     }
                     break;
-                // Text
                 case Tool.Text:
                     {
                         TextMove(sx, sy);
@@ -482,7 +476,12 @@
                     break;
             }
         }
-
+
+        private void ArcLeft(double sx, double sy)
+        {
+            throw new NotImplementedException();
+        }
+
         private void BezierLeft(double sx, double sy)
         {
             switch (CurrentState)
@@ -667,6 +666,11 @@
             }
         }

+        private void ArcRight(double sx, double sy)
+        {
+            throw new NotImplementedException();
+        }
+
         private void BezierRight(double sx, double sy)
         {
             switch (CurrentState)
@@ -783,6 +787,11 @@
                     }
                     break;
             }
+        }
+
+        private void ArcMove(double sx, double sy)
+        {
+            throw new NotImplementedException();
         }

         private void BezierMove(double sx, double sy)


Add test coverage of only showing on first run

--- osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs
+++ osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs
@@ -10,6 +10,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Screens;
 using osu.Framework.Testing;
+using osu.Game.Configuration;
 using osu.Game.Overlays;
 using osu.Game.Overlays.FirstRunSetup;
 using osu.Game.Overlays.Notifications;
@@ -29,9 +30,12 @@

         private Notification lastNotification;

+        protected OsuConfigManager LocalConfig;
+
         [BackgroundDependencyLoader]
         private void load()
         {
+            Dependencies.Cache(LocalConfig = new OsuConfigManager(LocalStorage));
             Dependencies.CacheAs(performer.Object);
             Dependencies.CacheAs(notificationOverlay.Object);
         }
@@ -58,6 +62,29 @@
                     State = { Value = Visibility.Visible }
                 };
             });
+        }
+
+        [Test]
+        public void TestDoesntOpenOnSecondRun()
+        {
+            AddStep("set first run", () => LocalConfig.SetValue(OsuSetting.ShowFirstRunSetup, true));
+
+            AddUntilStep("step through", () =>
+            {
+                if (overlay.CurrentScreen?.IsLoaded != false) overlay.NextButton.TriggerClick();
+                return overlay.State.Value == Visibility.Hidden;
+            });
+
+            AddAssert("first run false", () => !LocalConfig.Get<bool>(OsuSetting.ShowFirstRunSetup));
+
+            AddStep("add overlay", () =>
+            {
+                Child = overlay = new FirstRunSetupOverlay();
+            });
+
+            AddWaitStep("wait some", 5);
+
+            AddAssert("overlay didn't show", () => overlay.State.Value == Visibility.Hidden);
         }

         [TestCase(false)]


updated RowOfBlocksMinusOne()

updated RowOfBlocksMinusOne()

--- Tetris/Controllers/Game.cs
+++ Tetris/Controllers/Game.cs
@@ -22,7 +22,7 @@
         }

         //Create a row of points leaving one space
-        public void RowOfBlocksMinusOne()
+        public List<Point> RowOfBlocksMinusOne()
         {
             List<Point> Blocks = new List<Point>();
             int randomY = rand.Next(0, 10);
@@ -37,6 +37,7 @@
                     Blocks.Add(p);
                 }
             }
+            return Blocks;
         }

         //Move all rows of Tetromino up one


Improve logging test result for TeamCity #9 - remove hardcoded exception

--- Src/MvcPages/BrowserCamera/BrowserCamera.cs
+++ Src/MvcPages/BrowserCamera/BrowserCamera.cs
@@ -25,7 +25,6 @@
         {
             try
             {
-                throw new Exception();
                 driver.Blur();
                 var currentActiveElement = driver.GetActiveElement();
                 MoveMouseOffTheScreen();