Fixed possible IOException in RegistryJunk.FindJunkRecursively. Fixes #42

--- UninstallTools/Junk/RegistryJunk.cs
+++ UninstallTools/Junk/RegistryJunk.cs
@@ -1,12 +1,13 @@
-using System;
+using Klocman.Extensions;
+using Klocman.Tools;
+using Microsoft.Win32;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Security;
-using Klocman.Tools;
-using Microsoft.Win32;
 using UninstallTools.Uninstaller;
-using Klocman.Extensions;
+
 namespace UninstallTools.Junk
 {
     public class RegistryJunk : JunkBase
@@ -15,15 +16,14 @@
         /// Keys to step over when scanning
         /// </summary>
         private static readonly IEnumerable<string> KeyBlacklist = new[]
-        {
+                {
             "Microsoft", "Wow6432Node", "Windows", "Classes", "Clients", KeynameRegisteredApps
         };
-
         /// <summary>
         /// Always points to program's directory
         /// </summary>
         private static readonly IEnumerable<string> InstallDirKeyNames = new[]
-        {
+                {
             "InstallDir",
             "Install_Dir",
             "Install Directory",
@@ -34,40 +34,38 @@
             "TARGETDIR",
             "JavaHome"
         };
-
         /// <summary>
         /// Always points to program's main executable
         /// </summary>
         private static readonly IEnumerable<string> ExePathKeyNames = new[]
-        {
+                {
             "exe64"       ,
             "exe32"       ,
             "Executable"  ,
             "PathToExe"   ,
             "ExePath"
         };
-
         /// <summary>
         /// Can point to programs executable or directory
         /// </summary>
         private static readonly IEnumerable<string> ExeOrDirPathKeyNames = new[]
-        {
+                {
             "Path"        ,
             "Path64"      ,
             "pth"         ,
             "PlayerPath"  ,
             "AppPath"
         };
-
         private const string KeynameRegisteredApps = "RegisteredApplications";
         private static readonly string KeyCu = @"HKEY_CURRENT_USER\SOFTWARE";
         private static readonly string KeyCuWow = @"HKEY_CURRENT_USER\SOFTWARE\Wow6432Node";
         private static readonly string KeyLm = @"HKEY_LOCAL_MACHINE\SOFTWARE";
         private static readonly string KeyLmWow = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node";
+        private static readonly string[] SoftwareRegKeys = ProcessTools.Is64BitProcess ? new[] { KeyLm, KeyCu, KeyLmWow, KeyCuWow } : new[] { KeyLm, KeyCu };

         public RegistryJunk(ApplicationUninstallerEntry entry,
-            IEnumerable<ApplicationUninstallerEntry> otherUninstallers)
-            : base(entry, otherUninstallers)
+                    IEnumerable<ApplicationUninstallerEntry> otherUninstallers)
+                    : base(entry, otherUninstallers)
         {
         }

@@ -76,7 +74,7 @@
             var returnList = new List<RegistryJunkNode>();

             // Look for junk
-            foreach (var softwareKeyName in GetSoftwareRegKeys())
+            foreach (var softwareKeyName in SoftwareRegKeys)
             {
                 using (var softwareKey = RegistryTools.OpenRegistryKey(softwareKeyName))
                 {
@@ -96,7 +94,7 @@

                 nodeName = nodeName.Substring(softwareKey.Length + 1);

-                foreach (var keyToTest in GetSoftwareRegKeys().Except(new[] { softwareKey }))
+                foreach (var keyToTest in SoftwareRegKeys.Except(new[] { softwareKey }))
                 {
                     var nodePath = Path.Combine(keyToTest, nodeName);
                     // Check if the same node exists in other root keys
@@ -147,35 +145,97 @@
             return returnList.Cast<JunkNode>();
         }

-        private IEnumerable<RegistryJunkNode> ScanTracing()
-        {
-            const string tracingKey = @"SOFTWARE\Microsoft\Tracing";
-            const string fullTracingKey = @"HKEY_LOCAL_MACHINE\" + tracingKey;
-
-            var results = new List<RegistryJunkNode>();
-            using (var key = Registry.LocalMachine.OpenSubKey(tracingKey))
-            {
-                if (key != null)
-                {
-                    foreach (var subKeyName in key.GetSubKeyNames())
-                    {
-                        var i = subKeyName.LastIndexOf('_');
-                        if (i <= 0)
+        private IEnumerable<RegistryJunkNode> FindJunkRecursively(RegistryKey softwareKey, int level = -1)
+        {
+            var returnList = new List<RegistryJunkNode>();
+
+            try
+            {
+                // Don't try to scan root keys
+                if (level > -1)
+                {
+                    var keyName = Path.GetFileName(softwareKey.Name);
+                    var keyDir = Path.GetDirectoryName(softwareKey.Name);
+                    var confidence = GenerateConfidence(keyName, keyDir, level).ToList();
+
+                    // Check if application's location is explicitly mentioned in any of the values
+                    // TODO Check default value too, but with lower confidence
+                    foreach (var valueName in GetValueNamesSafe(softwareKey))
+                    {
+                        var hit = false;
+
+                        if (InstallDirKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
+                        {
+                            hit = TestPathsEqual(softwareKey.GetValue(valueName) as string);
+                        }
+                        else if (ExePathKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
+                        {
+                            hit = TestPathsEqualExe(softwareKey.GetValue(valueName) as string);
+                        }
+                        else if (ExeOrDirPathKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
+                        {
+                            var path = softwareKey.GetValue(valueName) as string;
+                            hit = File.Exists(path)
+                                ? TestPathsEqualExe(softwareKey.GetValue(valueName) as string)
+                                : TestPathsEqual(softwareKey.GetValue(valueName) as string);
+                        }
+
+                        if (hit)
+                        {
+                            confidence.Add(ConfidencePart.ExplicitConnection);
+                            break;
+                        }
+                    }
+
+                    if (confidence.Any())
+                    {
+                        // TODO Add extra confidence if the key is, or will be empty after junk removal
+                        var newNode = new RegistryJunkNode(keyDir, keyName, Uninstaller.DisplayName);
+                        newNode.Confidence.AddRange(confidence);
+                        returnList.Add(newNode);
+                    }
+                }
+
+                // Limit recursion depth
+                if (level <= 1)
+                {
+                    foreach (var subKeyName in softwareKey.GetSubKeyNames())
+                    {
+                        if (KeyBlacklist.Contains(subKeyName, StringComparison.InvariantCultureIgnoreCase))
                             continue;

-                        var str = subKeyName.Substring(0, i);
-
-                        var conf = GenerateConfidence(str, Path.Combine(fullTracingKey, subKeyName), 0).ToList();
-                        if (conf.Any())
-                        {
-                            var node = new RegistryJunkNode(fullTracingKey, subKeyName, Uninstaller.DisplayName);
-                            node.Confidence.AddRange(conf);
-                            results.Add(node);
-                        }
-                    }
-                }
-            }
-            return results;
+                        using (var subKey = softwareKey.OpenSubKey(subKeyName, false))
+                        {
+                            if (subKey != null)
+                                returnList.AddRange(FindJunkRecursively(subKey, level + 1));
+                        }
+                    }
+                }
+            }
+            // Reg key invalid
+            catch (ArgumentException)
+            {
+            }
+            catch (SecurityException)
+            {
+            }
+            catch (ObjectDisposedException)
+            {
+            }
+
+            return returnList;
+        }
+
+        private static IEnumerable<string> GetValueNamesSafe(RegistryKey key)
+        {
+            try
+            {
+                return key.GetValueNames();
+            }
+            catch (IOException)
+            {
+                return Enumerable.Empty<string>();
+            }
         }

         private IEnumerable<RegistryJunkNode> ScanFirewallRules()
@@ -191,7 +251,7 @@
             {
                 if (key != null)
                 {
-                    foreach (var valueName in key.GetValueNames())
+                    foreach (var valueName in GetValueNamesSafe(key))
                     {
                         var value = key.GetValue(valueName) as string;
                         if (string.IsNullOrEmpty(value)) continue;
@@ -212,100 +272,45 @@
             return results;
         }

-        private static string[] GetSoftwareRegKeys()
-        {
-            return ProcessTools.Is64BitProcess ? new[] { KeyLm, KeyCu, KeyLmWow, KeyCuWow } : new[] { KeyLm, KeyCu };
-        }
-
-        private IEnumerable<RegistryJunkNode> FindJunkRecursively(RegistryKey softwareKey, int level = -1)
-        {
-            var returnList = new List<RegistryJunkNode>();
-
-            try
-            {
-                // Don't try to scan root keys
-                if (level > -1)
-                {
-                    var keyName = Path.GetFileName(softwareKey.Name);
-                    var keyDir = Path.GetDirectoryName(softwareKey.Name);
-                    var confidence = GenerateConfidence(keyName, keyDir, level).ToList();
-
-                    // Check if application's location is explicitly mentioned in any of the values
-                    // TODO Check default value too, but with lower confidence
-                    foreach (var valueName in softwareKey.GetValueNames())
-                    {
-                        var hit = false;
-
-                        if (InstallDirKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
-                        {
-                            hit = TestPathsEqual(softwareKey.GetValue(valueName) as string);
-                        }
-                        else if (ExePathKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
-                        {
-                            hit = TestPathsEqualExe(softwareKey.GetValue(valueName) as string);
-                        }
-                        else if (ExeOrDirPathKeyNames.Contains(valueName, StringComparison.InvariantCultureIgnoreCase))
-                        {
-                            var path = softwareKey.GetValue(valueName) as string;
-                            hit = File.Exists(path)
-                                ? TestPathsEqualExe(softwareKey.GetValue(valueName) as string)
-                                : TestPathsEqual(softwareKey.GetValue(valueName) as string);
-                        }
-
-                        if (hit)
-                        {
-                            confidence.Add(ConfidencePart.ExplicitConnection);
-                            break;
-                        }
-                    }
-
-                    if (confidence.Any())
-                    {
-                        // TODO Add extra confidence if the key is, or will be empty after junk removal
-                        var newNode = new RegistryJunkNode(keyDir, keyName, Uninstaller.DisplayName);
-                        newNode.Confidence.AddRange(confidence);
-                        returnList.Add(newNode);
-                    }
-                }
-
-                // Limit recursion depth
-                if (level <= 1)
-                {
-                    foreach (var subKeyName in softwareKey.GetSubKeyNames())
-                    {
-                        if (KeyBlacklist.Contains(subKeyName, StringComparison.InvariantCultureIgnoreCase))
+        private IEnumerable<RegistryJunkNode> ScanTracing()
+        {
+            const string tracingKey = @"SOFTWARE\Microsoft\Tracing";
+            const string fullTracingKey = @"HKEY_LOCAL_MACHINE\" + tracingKey;
+
+            var results = new List<RegistryJunkNode>();
+            using (var key = Registry.LocalMachine.OpenSubKey(tracingKey))
+            {
+                if (key != null)
+                {
+                    foreach (var subKeyName in key.GetSubKeyNames())
+                    {
+                        var i = subKeyName.LastIndexOf('_');
+                        if (i <= 0)
                             continue;

-                        using (var subKey = softwareKey.OpenSubKey(subKeyName, false))
-                        {
-                            if (subKey != null)
-                                returnList.AddRange(FindJunkRecursively(subKey, level + 1));
-                        }
-                    }
-                }
-            }
-            // Reg key invalid
-            catch (ArgumentException)
-            {
-            }
-            catch (SecurityException)
-            {
-            }
-            catch (ObjectDisposedException)
-            {
-            }
-
-            return returnList;
+                        var str = subKeyName.Substring(0, i);
+
+                        var conf = GenerateConfidence(str, Path.Combine(fullTracingKey, subKeyName), 0).ToList();
+                        if (conf.Any())
+                        {
+                            var node = new RegistryJunkNode(fullTracingKey, subKeyName, Uninstaller.DisplayName);
+                            node.Confidence.AddRange(conf);
+                            results.Add(node);
+                        }
+                    }
+                }
+            }
+            return results;
+        }
+
+        private bool TestPathsEqual(string keyValue)
+        {
+            return PathTools.PathsEqual(Uninstaller.InstallLocation, keyValue);
         }

         private bool TestPathsEqualExe(string keyValue)
         {
             return TestPathsEqual(Path.GetDirectoryName(keyValue));
         }
-
-        private bool TestPathsEqual(string keyValue)
-        {
-            return PathTools.PathsEqual(Uninstaller.InstallLocation, keyValue);
-        }
     }
-}+}


Red: New players see points and position change

based on where they would be had they never played but been in the league all along.

--- UnitTests/ResultChangeStatsTests.cs
+++ UnitTests/ResultChangeStatsTests.cs
@@ -47,8 +47,8 @@

             var game2 = new Game();
             game2.AddResult("Foo", new Points(5));
-            game2.AddResult("Bar", new Points(3));
-            game2.AddResult("Bar2", new Points(1));
+            game2.AddResult("Bar", new Points(1));
+            game2.AddResult("Bar2", new Points(3));

             league.RecordGame(game2);

@@ -58,8 +58,8 @@

             var resultsChangeForFoo = change.Single(x => x.Name == "Bar2");

-            Assert.Equal(0, resultsChangeForFoo.PositionChange);
-            Assert.Equal(0, resultsChangeForFoo.PointsChange);
+            Assert.Equal(1, resultsChangeForFoo.PositionChange);
+            Assert.Equal(3, resultsChangeForFoo.PointsChange);
         }
     }
 }


名前付きパイプが切断されるとEOFになるようなので、正常終了扱いにした。

名前付きパイプが切断されるとEOFになるようなので、正常終了扱いにした。

--- UnityDemo/Lib/PeerToPipe/Program.cs
+++ UnityDemo/Lib/PeerToPipe/Program.cs
@@ -66,7 +66,7 @@
                         while (namedPipePipeToPeer.IsConnected && namedPipePeerToPipe.IsConnected)
                         {
                             int result = namedPipePipeToPeer.ReadByte();
-                            if (result < 0) throw new Exception("end of stream");
+                            if (result < 0) break;
 #if DEBUG
                             Console.WriteLine("read");
 #endif


Update CustomPhraseManager.cs

Update CustomPhraseManager.cs

--- WPMT2/Custom/CustomPhraseManager.cs
+++ WPMT2/Custom/CustomPhraseManager.cs
@@ -93,9 +93,15 @@

         public List<CustomKeySequence> AddSet(string text)
         {
+            if (text.IsEmpty())
+                return null;
+
             text = text.Replace("\r", "");
-            while (text.StartsWith("\n")) text = text.Substring(1);
-            while (text.EndsWith("\n")) text = text.Substring(0, text.Length - 1);
+            while (text.StartsWith("\n")) text = text[1..];
+            while (text.EndsWith("\n")) text = text[..^1];
+
+            if (text.IsEmpty())
+                return null;

             var linesWithNoComments = text
                 .Replace("\r", "")


Strings test passes again

Strings test passes again

--- WasmSExprEmitter/AssemblyEmitter.cs
+++ WasmSExprEmitter/AssemblyEmitter.cs
@@ -54,7 +54,7 @@
         public int GetStringOffset (string str) {
             // HACK
             if (str == null)
-                return 0;
+                str = "";

             StringTableEntry result;
             if (!StringTable.TryGetValue(str, out result)) {


fix #5: finding by runtime id on Windows 8

iterates across all of the potential parents of a runtime_id until it can locate the element. It uses the root element as the last resort.

--- ext/UiaDll/UIA.Helper/Element.cs
+++ ext/UiaDll/UIA.Helper/Element.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Windows.Automation;

@@ -181,13 +182,19 @@
         public static Element ByRuntimeId(int[] runtimeId)
         {
             var condition = new PropertyCondition(AutomationElement.RuntimeIdProperty, runtimeId);
-            return ClosestParentOfId(runtimeId).FindFirst(TreeScope.Subtree, condition);
-        }
-
-        private static Element ClosestParentOfId(IEnumerable<int> runtimeId)
-        {
-            var parentHandle = runtimeId.FirstOrDefault(x => Win32.IsWindow(x.IntPtr())).IntPtr();
-            return IntPtr.Zero != parentHandle ? ByHandle(parentHandle) : new RootElement();
+
+            Element foundElement = null;
+            PotentialParentsOf(runtimeId)
+                .FirstOrDefault(x => null != (foundElement = x.FindFirst(TreeScope.Subtree, condition)));
+
+            return foundElement;
+        }
+
+        private static IEnumerable<Element> PotentialParentsOf(IEnumerable<int> runtimeId)
+        {
+            return runtimeId.Where(x => Win32.IsWindow(x.IntPtr()))
+                     .Select(x => ByHandle(x.IntPtr()))
+                     .Concat(new[] {new RootElement()});
         }

         private static Element[] Find(AutomationElement element, TreeScope scope, Condition condition)


SimpleTextCommand: cleaned up success/failure messages for clarity

--- Applebot/Plugins/SimpleTextCommand/SimpleTextCommand.cs
+++ Applebot/Plugins/SimpleTextCommand/SimpleTextCommand.cs
@@ -197,7 +197,9 @@
             {
                 bool isComplex = (parts[0] == "!autoreply");
                 string syntaxHelp = parts[0];
-                string feedbackHelp = parts[0].Substring(1);
+                string feedbackHelp = isComplex ? "autoreply" : "command";
+                string feedbackPlural = isComplex ? "autoreplies" : "commands";
+                string feedbackCaps = isComplex ? "Autoreply" : "Command";
                 bool elevated = platform.CheckElevatedStatus(message);

                 if (!elevated)
@@ -227,7 +229,7 @@

                     if (cmdlist.Count == 0)
                     {
-                        platform.Send(new SendData("There are no patterns of that type. Try adding one with \"" + syntaxHelp + " add\"?", false, message));
+                        platform.Send(new SendData("There are no " + feedbackPlural + ". Try adding one with \"" + syntaxHelp + " add\"?", false, message));
                     }

                 }
@@ -262,12 +264,12 @@
                     }

                     if (replaced)
-                    {
-                        platform.Send(new SendData("Removed pattern \"" + result + "\".", false, message));
+                    {
+                        platform.Send(new SendData(String.Format("Removed {0} \"{1}\".", feedbackHelp, result), false, message));
                     }
                     else
                     {
-                        platform.Send(new SendData("Pattern \"" + result + "\" doesn't exist. :v", false, message));
+                        platform.Send(new SendData(String.Format("{0} \"{1}\" doesn't exist.", feedbackCaps, result), false, message));
                     }

                     return;
@@ -290,17 +292,17 @@

                         if (replaced)
                         {
-                            platform.Send(new SendData("Replaced pattern \"" + parts[2] + "\".", false, message));
+                            platform.Send(new SendData(String.Format("Replaced {0} \"{1}\".", feedbackHelp, parts[2]), false, message));
                         }
                         else
                         {
-                            platform.Send(new SendData("Added pattern \"" + parts[2] + "\".", false, message));
+                            platform.Send(new SendData(String.Format("Added {0} \"{1}\".", feedbackHelp, parts[2]), false, message));
                         }

                     }
                     catch
                     {
-                        platform.Send(new SendData("Invalid regex?", false, message));
+                        platform.Send(new SendData("Error parsing your autoreply. Make sure your regex is valid!", false, message));
                         return;
                     }


Added method in MathUtilities

Added method in MathUtilities


Improve Forum toplevel module code, do not delete error messages, use UserInfo#Url instead of #UrlPath.

--- src/MitternachtBot/Modules/Forum/Forum.cs
+++ src/MitternachtBot/Modules/Forum/Forum.cs
@@ -1,4 +1,3 @@
-using System;
 using System.Threading.Tasks;
 using Discord;
 using Discord.Commands;
@@ -27,9 +26,7 @@
 		[MitternachtCommand, Usage, Description, Aliases]
 		[RequireContext(ContextType.Guild)]
 		public async Task UserInfoForum(IGuildUser user = null) {
-			user ??= Context.User as IGuildUser;
-			if(user == null)
-				return;
+			user ??= (IGuildUser)Context.User;

 			UserInfo uinfo = null;
 			var forumId = uow.VerifiedUsers.GetVerifiedUser(Context.Guild.Id, user.Id)?.ForumUserId;
@@ -37,22 +34,21 @@
 				try {
 					uinfo = await Service.Forum.GetUserInfo(forumId.Value).ConfigureAwait(false);
 				} catch(UserNotFoundException) {
-					(await ReplyErrorLocalized("forum_user_not_existing", user.ToString()).ConfigureAwait(false)).DeleteAfter(60);
+					await ReplyErrorLocalized("forum_user_not_existing", user.ToString()).ConfigureAwait(false);
 					return;
 				} catch(UserProfileAccessException) {
-					(await ReplyErrorLocalized("forum_user_not_seeable", user.ToString()).ConfigureAwait(false)).DeleteAfter(60);
+					await ReplyErrorLocalized("forum_user_not_seeable", user.ToString()).ConfigureAwait(false);
 					return;
-				} catch(Exception) { /*ignore other exceptions*/ }
+				} catch { }
 			}

-			if(uinfo == null) {
-				(await ReplyErrorLocalized("forum_user_not_accessible", user.ToString()).ConfigureAwait(false)).DeleteAfter(60);
-				return;
+			if(uinfo != null) {
+				var embed = ForumUserInfoBuilder(uinfo).WithTitle(GetText("forumuserinfo_title", user.ToString()));
+
+				await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
+			} else {
+				await ReplyErrorLocalized("forum_user_not_accessible", user.ToString()).ConfigureAwait(false);
 			}
-
-			var embed = ForumUserInfoBuilder(uinfo).WithTitle(GetText("forumuserinfo_title", user.ToString()));
-
-			await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
 		}

 		[MitternachtCommand, Usage, Description, Aliases]
@@ -68,43 +64,41 @@
 			=> await PrivateForumUserInfoHandler(userId: userId).ConfigureAwait(false);

 		private async Task PrivateForumUserInfoHandler(string username = null, long? userId = null) {
-			if(username == null && !userId.HasValue) {
-				(await ReplyErrorLocalized("dev_failed").ConfigureAwait(false)).DeleteAfter(60);
-				return;
+			if(username != null || userId.HasValue) {
+				var      userText = userId != null ? userId.Value.ToString() : username;
+				UserInfo uinfo    = null;
+				try {
+					uinfo = userId.HasValue ? await Service.Forum.GetUserInfo(userId.Value).ConfigureAwait(false) : await Service.Forum.GetUserInfo(username).ConfigureAwait(false);
+				} catch(UserNotFoundException) {
+					await ReplyErrorLocalized("forum_user_not_existing", userText).ConfigureAwait(false);
+					return;
+				} catch(UserProfileAccessException) {
+					await ReplyErrorLocalized("forum_user_not_seeable", userText).ConfigureAwait(false);
+					return;
+				} catch { }
+
+				if(uinfo != null) {
+					var embed = ForumUserInfoBuilder(uinfo);
+					var verifiedUserId = uow.VerifiedUsers.GetVerifiedUser(Context.Guild.Id, uinfo.Id)?.UserId;
+					if(verifiedUserId != null) {
+						var verifiedUser = await Context.Guild.GetUserAsync(verifiedUserId.Value);
+						embed.WithTitle(GetText("forumuserinfo_title", verifiedUser?.ToString() ?? verifiedUserId.ToString()));
+					}
+
+					await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
+				} else {
+					await ReplyErrorLocalized("forum_user_not_accessible", userText).ConfigureAwait(false);
+				}
+			} else {
+				await ReplyErrorLocalized("dev_failed").ConfigureAwait(false);
 			}
-
-			var      userText = userId != null ? userId.Value.ToString() : username;
-			UserInfo uinfo    = null;
-			try {
-				uinfo = userId.HasValue ? await Service.Forum.GetUserInfo(userId.Value).ConfigureAwait(false) : await Service.Forum.GetUserInfo(username).ConfigureAwait(false);
-			} catch(UserNotFoundException) {
-				(await ReplyErrorLocalized("forum_user_not_existing", userText).ConfigureAwait(false)).DeleteAfter(60);
-				return;
-			} catch(UserProfileAccessException) {
-				(await ReplyErrorLocalized("forum_user_not_seeable", userText).ConfigureAwait(false)).DeleteAfter(60);
-				return;
-			} catch(Exception) { /*ignore other exceptions*/ }
-
-			if(uinfo == null) {
-				(await ReplyErrorLocalized("forum_user_not_accessible", userText).ConfigureAwait(false)).DeleteAfter(60);
-				return;
-			}
-
-			var embed = ForumUserInfoBuilder(uinfo);
-			var verifiedUserId = uow.VerifiedUsers.GetVerifiedUser(Context.Guild.Id, uinfo.Id)?.UserId;
-			if(verifiedUserId != null) {
-				var verifiedUser = await Context.Guild.GetUserAsync(verifiedUserId.Value);
-				embed.WithTitle(GetText("forumuserinfo_title", verifiedUser?.ToString() ?? verifiedUserId.ToString()));
-			}
-
-			await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
 		}

 		private EmbedBuilder ForumUserInfoBuilder(UserInfo uinfo) {
 			var embed = new EmbedBuilder()
 						.WithOkColor()
 						.WithThumbnailUrl(uinfo.AvatarUrl)
-						.AddField(GetText("name"), $"[{uinfo.Username}]({uinfo.UrlPath})", true)
+						.AddField(GetText("name"), $"[{uinfo.Username}]({uinfo.Url})", true)
 						.AddField(GetText("id"), uinfo.Id, true)
 						.AddField(GetText("gender"), uinfo.Gender.ToString(), true);

@@ -126,12 +120,13 @@

 		[MitternachtCommand, Usage, Description, Aliases]
 		public async Task ForumInfo() {
-			if(Service.LoggedIn)
+			if(Service.LoggedIn) {
 				await ConfirmLocalized("foruminfo_logged_in", $"[{Service.Forum.SelfUser.Username}]({Service.Forum.SelfUser.UrlPath})").ConfigureAwait(false);
-			else if(Service.HasForumInstance)
+			} else if(Service.HasForumInstance) {
 				await ConfirmLocalized("foruminfo_instance").ConfigureAwait(false);
-			else
+			} else {
 				await ConfirmLocalized("foruminfo_no_instance").ConfigureAwait(false);
+			}
 		}
 	}
 }


Updated Account Controller Tests

Updated Account Controller Tests

git-tfs-id: [https://tfs.caes.ucdavis.edu:8088/tfs]$/Commencement/Trunk/Commencement;C9045

--- Commencement.Tests/Controllers/AccountControllerTest.cs
+++ Commencement.Tests/Controllers/AccountControllerTest.cs
@@ -54,7 +54,9 @@
         /// Tests the not CAES student mapping.
         /// </summary>
         [TestMethod]
+// ReSharper disable InconsistentNaming
         public void TestNotCAESStudentMapping()
+// ReSharper restore InconsistentNaming
         {
             "~/Account/NotCAESStudent".ShouldMapTo<AccountController>(a => a.NotCAESStudent());
         }
@@ -78,10 +80,19 @@
         }
         #endregion Mapping Tests

+
+        [TestMethod]
+        public void TestEmulateStillNeeded()
+        {
+            Assert.Inconclusive("Alan, was emulate student supposed to be removed?");
+        }
+
         #region NotCAESStudent Tests

         [TestMethod]
-        public void TestNotCAESStudentRedirectsToErrorIndex()
+// ReSharper disable InconsistentNaming
+        public void TestNotCAESStudentRedirectsToErrorUnauthorizedAccess()
+// ReSharper restore InconsistentNaming
         {
             #region Arrange

@@ -90,7 +101,7 @@
             #region Act/Assert
             var result = Controller.NotCAESStudent()
                 .AssertActionRedirect()
-                .ToAction<ErrorController>(a => a.Index());
+                .ToAction<ErrorController>(a => a.UnauthorizedAccess());
             #endregion Act/Assert

             #region Assert
@@ -293,7 +304,9 @@
         /// #3
         /// </summary>
         [TestMethod]
+// ReSharper disable InconsistentNaming
         public void TestControllerMethodNotCAESStudentContainsExpectedAttributes()
+// ReSharper restore InconsistentNaming
         {
             #region Arrange
             var controllerClass = _controllerClass;
@@ -323,12 +336,12 @@

             #region Act
             var allAttributes = controllerMethod.GetCustomAttributes(true);
-            var expectedAttribute = controllerMethod.GetCustomAttributes(true).OfType<AnyoneWithRoleAttribute>();
+            var expectedAttribute = controllerMethod.GetCustomAttributes(true).OfType<EmulationUserOnlyAttribute>();
             #endregion Act

             #region Assert
             Assert.AreEqual(1, allAttributes.Count(), "More than expected custom attributes found.");
-            Assert.AreEqual(1, expectedAttribute.Count(), "AnyoneWithRoleAttribute not found.");
+            Assert.AreEqual(1, expectedAttribute.Count(), "EmulationUserOnlyAttribute not found.");
             #endregion Assert
         }


fix for SetTaxonomyFieldDefaultValue not pushing changes to lists

--- Core/OfficeDevPnP.Core/Extensions/TaxonomyExtensions.cs
+++ Core/OfficeDevPnP.Core/Extensions/TaxonomyExtensions.cs
@@ -2023,7 +2023,8 @@
         /// <param name="field">Field to be wired up</param>
         /// <param name="taxonomyItem">Taxonomy TermSet or Term</param>
         /// <param name="defaultValue">default value for the field</param>
-        public static void SetTaxonomyFieldDefaultValue(this Field field, TaxonomyItem taxonomyItem, string defaultValue)
+        /// <param name="pushChangesToLists">push changes to lists</param>
+        public static void SetTaxonomyFieldDefaultValue(this Field field, TaxonomyItem taxonomyItem, string defaultValue, bool pushChangesToLists = false)
         {
             if (string.IsNullOrEmpty(defaultValue))
             {
@@ -2074,7 +2075,14 @@
                 field.Context.ExecuteQueryRetry();

                 taxField.DefaultValue = validateValue.Value;
-                taxField.Update();
+                if (!pushChangesToLists)
+                {
+                    taxField.Update();
+                }
+                else
+                {
+                    taxField.UpdateAndPushChanges(true);
+                }
                 clientContext.ExecuteQueryRetry();
             }
         }


Apparently we can't rely on this folder to remain between calls to PrepareUpdates and ApplyUpdates.

Will probably need to find a better strategy to handle temp and backup folders

--- src/NAppUpdate.Framework/UpdateManager.cs
+++ src/NAppUpdate.Framework/UpdateManager.cs
@@ -357,6 +357,9 @@
                     executeOnAppRestart["ENV:BackupFolder"] = BackupFolder;
                     executeOnAppRestart["ENV:RelaunchApplication"] = relaunchApplication;

+					if (!Directory.Exists(TempFolder))
+						Directory.CreateDirectory(TempFolder);
+
 					// Naming it updater.exe seem to trigger the UAC, and we don't want that
                     var updStarter = new UpdateStarter(Path.Combine(TempFolder, "foo.exe"), executeOnAppRestart, UpdateProcessName);
                     bool createdNew;


Host.apply_edition has an extra parameter. Provide overload for backwards compatibility.

--- XenModel/XenAPI/Overloads.cs
+++ XenModel/XenAPI/Overloads.cs
@@ -45,6 +45,10 @@
         Response<string>
         session_login_with_password(string _uname, string _pwd, string _version);

+        [XmlRpcMethod("host.apply_edition")]
+        Response<string>
+        host_apply_edition(string session, string _host, string _edition);
+
         #endregion

         #region pre-6.1 compatibility
@@ -216,6 +220,17 @@

             return XenRef<Task>.Create(session.proxy.async_host_create_new_blob(session.uuid, (_host != null) ? _host : "", (_name != null) ? _name : "", (_mime_type != null) ? _mime_type : "").parse());
         }
+
+        /// <summary>
+        /// Backward compatibility for Host.apply_edition in XenServer 6.1.
+        /// </summary>
+        public static void apply_edition(Session session, string _host, string _edition)
+        {
+            if (Helper.APIVersionMeets(session, API_Version.API_2_0))
+                System.Diagnostics.Debug.Assert(false, "Cannot use this call on XenServer 6.2 or newer.");
+
+            session.proxy.host_apply_edition(session.uuid, (_host != null) ? _host : "", (_edition != null) ? _edition : "").parse();
+        }
     }

     public partial class Network


HqlFixture.InsertIntoFromSelect_WithSelectClauseParameters() Avoid float equality conversion which might cause accuracy issues and which isn't relevant to the test.

--- src/NHibernate.Test/Hql/Ast/HqlFixture.cs
+++ src/NHibernate.Test/Hql/Ast/HqlFixture.cs
@@ -304,7 +304,7 @@

 					// assert
 					Assert.AreEqual(3, s.CreateCriteria<Animal>().SetProjection(Projections.RowCount())
-					                   	.Add(Restrictions.Eq("bodyWeight", 5.7f)).UniqueResult<int>());
+					                   	.Add(Restrictions.Gt("bodyWeight", 5.5f)).UniqueResult<int>());

 					s.CreateQuery("delete from Animal").ExecuteUpdate();
 					s.Transaction.Commit();


fix import uv animation

fix import uv animation

--- Dev/Editor/EffekseerCore/Utils/ProjectVersionUpdater.cs
+++ Dev/Editor/EffekseerCore/Utils/ProjectVersionUpdater.cs
@@ -275,7 +275,7 @@

 				if (rendererCommon != null)
 				{
-					if (rendererCommon["UVAnimation"] != null)
+					if (rendererCommon["UVAnimation"] != null && rendererCommon["UVAnimation"]["AnimationParams"] == null)
 					{
 						System.Xml.XmlNode uvAnimationParamNode = document.CreateElement("AnimationParams");


Bootstrap script loading order

Bootstrap script loading order

--- Web/Views/Shared/_MainLayout.cshtml
+++ Web/Views/Shared/_MainLayout.cshtml
@@ -166,7 +166,7 @@

-             @Html.Partial("_Version")
+            @Html.Partial("_Version")

@@ -220,9 +220,6 @@

     @RenderSection("Scripts", required: false)

-
-
-

@@ -232,9 +229,24 @@

-
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

     @{
@@ -310,7 +322,7 @@
         }

     </script>
-
+


fix namespace top level statement

fix namespace top level statement

--- src/Services/Basket/Basket.API/Program.cs
+++ src/Services/Basket/Basket.API/Program.cs
@@ -106,6 +106,6 @@

 public class Program {

-    public static string Namespace = typeof(Program).Namespace;
+    public static string Namespace = typeof(Startup).Namespace;
     public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
 }


Hide gender column when Transporter RNG

Hide gender column when Transporter RNG

--- 3DSRNGTool/MainForm.cs
+++ 3DSRNGTool/MainForm.cs
@@ -1240,6 +1240,7 @@
                 return;
             }
             dgv_synced.Visible = Method < 3 && FormPM.Syncable && !IsEvent;
+            dgv_gender.Visible =
             dgv_nature.Visible = !IsTransporter;
             dgv_item.Visible = dgv_Lv.Visible = dgv_slot.Visible = Method == 2 && (Gen7 || Gen6 && gen6timeline || FullInfoHorde);
             dgv_rand.Visible = Gen6 || Gen7 && Method == 3 && !MainRNGEgg.Checked;


Update Disasm6502.cs

Update Disasm6502.cs

Added copyright.

--- 6502.Net/Disasm6502.cs
+++ 6502.Net/Disasm6502.cs
@@ -1,4 +1,26 @@
-using System;
+//-----------------------------------------------------------------------------
+// Copyright (c) 2017 Nate Burnett <informedcitizenry@gmail.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;


Ensure passed list of arguments is > 0 before parsing them.

--- GitWrap/Program.cs
+++ GitWrap/Program.cs
@@ -11,18 +11,18 @@

  	static void Main(string[] args)
         {
-            if (args[0] == "--setWslPath" && args.Length == 2)
-            {
-                Properties.Settings.Default.wslpath = args[1];
-		Properties.Settings.Default.Save();
-                Console.Write("[*] wslPath set to: " + args[1]);
-            } else if (args[0] == "--getWslPath") {
-                Console.Write("[*] Current wslPath: " + Properties.Settings.Default.wslpath);
-            }
-            else
-            {
-                executeGitWithArgs(getWslPath(), args);
-            }
+          if (args.Length > 0 && args[0] == "--setWslPath" && args.Length == 2)
+          {
+              Properties.Settings.Default.wslpath = args[1];
+              Properties.Settings.Default.Save();
+              Console.Write("[*] wslPath set to: " + args[1]);
+          } else if (args.Length > 0 && args[0] == "--getWslPath") {
+              Console.Write("[*] Current wslPath: " + Properties.Settings.Default.wslpath);
+          }
+          else
+          {
+              executeGitWithArgs(getWslPath(), args);
+          }
         }
         static void executeGitWithArgs(String wslPath, string[] args)
         {


PG-1387: Added log entry to not Paratext user name

--- Glyssen/Program.cs
+++ Glyssen/Program.cs
@@ -98,6 +98,7 @@
 					ParatextData.Initialize();
 					sldrIsInitialized = true;
 					userName = RegistrationInfo.UserName;
+					Logger.WriteEvent($"Paratext user name: {userName}");
 					userInfo.Email = RegistrationInfo.EmailAddress;
 					foreach (var errMsgInfo in CompatibleParatextProjectLoadErrors.Where(e => e.Reason == UnsupportedReason.Unspecified))
 					{


Allow delete of a question set if the item has no answers.

--- CRP.Mvc/Controllers/QuestionSetController.cs
+++ CRP.Mvc/Controllers/QuestionSetController.cs
@@ -713,7 +713,12 @@
             // check to make sure there aren't any answers already
             if (Repository.OfType<TransactionAnswer>().Queryable.Where(a => a.QuestionSet == itemQuestionSet.QuestionSet).Any())
             {
-                ModelState.AddModelError("Question Set", "Someone has already entered a response to this question set and it cannot be deleted.");
+                if (Repository.OfType<TransactionAnswer>().Queryable
+                    .Any(a => a.QuestionSet == itemQuestionSet.QuestionSet && a.Transaction.Item.Id == itemId))
+                {
+                    ModelState.AddModelError("Question Set",
+                        "Someone has already entered a response to this question set and it cannot be deleted.");
+                }
             }

             if(ModelState.IsValid)


add broken test-cases

add broken test-cases

--- CSharpMath.Editor.Tests/MathKeyboardTests.cs
+++ CSharpMath.Editor.Tests/MathKeyboardTests.cs
@@ -175,7 +175,11 @@
       T(@"\frac{\square }{3}", K.Slash, K.D3, K.Left, K.Left, K.Backspace, K.Left),
       T(@"1_3", K.D1, K.D2, K.Subscript, K.D3, K.Left, K.Left, K.Backspace),
       T(@"1^2_3", K.D1, K.D4, K.Subscript, K.D3, K.Left, K.Left, K.Power, K.D2, K.Left, K.Left, K.Backspace),
-      T(@"1^3_2", K.D1, K.D4, K.Power, K.D3, K.Left, K.Left, K.Subscript, K.D2, K.Left, K.Left, K.Left, K.Left, K.Backspace)
+      T(@"1^3_2", K.D1, K.D4, K.Power, K.D3, K.Left, K.Left, K.Subscript, K.D2, K.Left, K.Left, K.Left, K.Left, K.Backspace),
+      T(@"■^6", K.Power, K.D6, K.Left, K.Left, K.Left, K.X, K.Left, K.Left, K.Left, K.Backspace),
+      T(@"\sqrt[■]{\square}",K.NthRoot,K.SmallA,K.Backspace),
+      T(@"\sqrt{■}", K.SquareRoot, K.SmallA, K.Backspace),
+      T(@"\frac{1}{■}", K.Slash, K.D6, K.Backspace)
     ]
     public void LeftRightBackspace(string latex, params K[] inputs) => Test(latex, inputs);


Collator: Fix whitespace back to tabs

Collator: Fix whitespace back to tabs

--- source/icu.net/Collation/Collator.cs
+++ source/icu.net/Collation/Collator.cs
@@ -31,7 +31,7 @@
 		public abstract NormalizationMode NormalizationMode{ get; set; }

 		/// <summary>
-		/// Gets or sets the FrenchCollation. Attribute for direction of
+		/// Gets or sets the FrenchCollation. Attribute for directionCollof
 		/// secondary weights - used in Canadian French.
 		/// </summary>
 		public abstract FrenchCollation FrenchCollation{ get; set; }
@@ -192,21 +192,21 @@
 				throw new ArgumentOutOfRangeException("keyDataLength");
 			}

-            CompareOptions options = CompareOptions.None;
+			CompareOptions options = CompareOptions.None;

 #if NETSTANDARD1_6
-            SortKey sortKey = new SortKey(CultureInfo.InvariantCulture.Name, originalString, options, keyData);
+			SortKey sortKey = new SortKey(CultureInfo.InvariantCulture.Name, originalString, options, keyData);
 #else
-            SortKey sortKey = CultureInfo.InvariantCulture.CompareInfo.GetSortKey(string.Empty, options);
-            SetInternalOriginalStringField(sortKey, originalString);
+			SortKey sortKey = CultureInfo.InvariantCulture.CompareInfo.GetSortKey(string.Empty, options);
+			SetInternalOriginalStringField(sortKey, originalString);
 			SetInternalKeyDataField(sortKey, keyData, keyDataLength);
 #endif

-            return sortKey;
+			return sortKey;
 		}

 #if !NETSTANDARD1_6
-        private static void SetInternalKeyDataField(SortKey sortKey, byte[] keyData, int keyDataLength)
+		private static void SetInternalKeyDataField(SortKey sortKey, byte[] keyData, int keyDataLength)
 		{
 			byte[] keyDataCopy = new byte[keyDataLength];
 			Array.Copy(keyData, keyDataCopy, keyDataLength);
@@ -258,17 +258,17 @@

 			fieldInfo.SetValue(instance, value);
 		}
-
+
 		private static bool IsRunningOnMono()
 		{
 			return Type.GetType("Mono.Runtime") != null;
 		}
 #endif

-        /// <summary>
-        /// Simple class to allow passing collation error info back to the caller of CheckRules.
-        /// </summary>
-        public class CollationRuleErrorInfo
+		/// <summary>
+		/// Simple class to allow passing collation error info back to the caller of CheckRules.
+		/// </summary>
+		public class CollationRuleErrorInfo
 		{
 			/// <summary>Line number (1-based) containing the error</summary>
 			public int Line;


Shows notifications on connect, improved SendMessage()

--- Win10Notifications/MainPage.xaml.cs
+++ Win10Notifications/MainPage.xaml.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Linq;
 using Windows.ApplicationModel.Background;
@@ -166,26 +165,7 @@
                         Notifications.RemoveAt(i);
                         i--;

-                        // Get the toast binding, if present
-                        var toastBinding = existingNotif.Notification.Visual.GetBinding(KnownNotificationBindings.ToastGeneric);
-
-                        var titleText = "No title";
-                        var bodyText = "";
-
-                        if (toastBinding != null)
-                        {
-                            // And then get the text elements from the toast binding
-                            var textElements = toastBinding.GetTextElements();
-
-                            // Treat the first text element as the title text
-                            titleText = textElements.FirstOrDefault()?.Text;
-
-                            // We'll treat all subsequent text elements as body text,
-                            // joining them together via newlines.
-                            bodyText = string.Join("\n", textElements.Skip(1).Select(t => t.Text));
-                        }
-
-                        SendMessage("Cleared: " + titleText + ": " + bodyText);
+                        SendMessage("Cleared", existingNotif);
                     }
                 }

@@ -195,25 +175,6 @@
                 for (var i = 0; i < notifsInPlatform.Count; i++)
                 {
                     var platNotif = notifsInPlatform[i];
-
-                    // Get the toast binding, if present
-                    var toastBinding = platNotif.Notification.Visual.GetBinding(KnownNotificationBindings.ToastGeneric);
-
-                    var titleText = "No title";
-                    var bodyText = "";
-
-                    if (toastBinding != null)
-                    {
-                        // And then get the text elements from the toast binding
-                        var textElements = toastBinding.GetTextElements();
-
-                        // Treat the first text element as the title text
-                        titleText = textElements.FirstOrDefault()?.Text;
-
-                        // We'll treat all subsequent text elements as body text,
-                        // joining them together via newlines.
-                        bodyText = string.Join("\n", textElements.Skip(1).Select(t => t.Text));
-                    }

                     var indexOfExisting = FindIndexOfNotification(platNotif.Id);

@@ -226,7 +187,7 @@
                             // Move it to the right position
                             Notifications.Move(indexOfExisting, i);

-                            SendMessage("Reposition: " + titleText + ": " + bodyText);
+                            SendMessage("Reposition", platNotif);
                         }

                         // Otherwise, leave it in its place
@@ -238,7 +199,7 @@
                         // Insert at that position
                         Notifications.Insert(i, platNotif);

-                        SendMessage("New: " + titleText + ": " + bodyText);
+                        SendMessage("New", platNotif);
                     }
                 }
             }
@@ -247,6 +208,14 @@
                 Error = "Error updating notifications: " + ex;
             }

+        }
+
+        private void SendNotificationsOnConnect()
+        {
+            foreach (var notification in Notifications)
+            {
+                SendMessage("New", notification);
+            }
         }

         private int FindIndexOfNotification(uint notifId)
@@ -427,8 +396,29 @@
             rfcommProvider.SdpRawAttributes.Add(Constants.SdpServiceNameAttributeId, sdpWriter.DetachBuffer());
         }

-        private async void SendMessage(string notifMessage)
-        {
+        private async void SendMessage(string type, UserNotification notification)
+        {
+            // Get the toast binding, if present
+            var toastBinding = notification.Notification.Visual.GetBinding(KnownNotificationBindings.ToastGeneric);
+
+            var titleText = "No title";
+            var bodyText = "";
+
+            if (toastBinding != null)
+            {
+                // And then get the text elements from the toast binding
+                var textElements = toastBinding.GetTextElements();
+
+                // Treat the first text element as the title text
+                titleText = textElements.FirstOrDefault()?.Text;
+
+                // We'll treat all subsequent text elements as body text,
+                // joining them together via newlines.
+                bodyText = string.Join("\n", textElements.Skip(1).Select(t => t.Text));
+            }
+
+            var notifMessage = type + ": " + titleText + ": " + bodyText;
+
             // There's no need to send a zero length message
             if (notifMessage.Length != 0)
             {
@@ -527,6 +517,7 @@
             {
                 NotifyUser("Connected to Client: " + remoteDevice.Name, NotifyType.StatusMessage);
                 DisconnectButton.Content = "Disconnect from " + remoteDevice.Name;
+                SendNotificationsOnConnect();
             });

             // Infinite read buffer loop


fix: sense ID did not break to start of next line

--- ZD.Gui/OneResultControl.Analysis.cs
+++ ZD.Gui/OneResultControl.Analysis.cs
@@ -131,19 +131,19 @@
                 // Unpacks Chinese ranges
                 // Domain is localized text for "Classifier:" if, well, this is a classifier sense
                 int startIX = newBlocks.Count;
-                if (!classifier) getBlocks(cm.Domain, true, null, newBlocks, newLinks);
+                if (!classifier) makeBlocks(cm.Domain, true, null, newBlocks, newLinks);
                 else
                 {
                     string strClassifier = tprov.GetString("ResultCtrlClassifier");
                     HybridText htClassifier = new HybridText(strClassifier);
                     int ix = newBlocks.Count;
-                    getBlocks(htClassifier, true, null, newBlocks, newLinks);
+                    makeBlocks(htClassifier, true, null, newBlocks, newLinks);
                     Block xb = newBlocks[ix];
                     xb.NewLine = true;
                     newBlocks[ix] = xb;
                 }
-                getBlocks(cm.Equiv, false, hlArr[senseIdx], newBlocks, newLinks);
-                getBlocks(cm.Note, true, null, newBlocks, newLinks);
+                makeBlocks(cm.Equiv, false, hlArr[senseIdx], newBlocks, newLinks);
+                makeBlocks(cm.Note, true, null, newBlocks, newLinks);
                 // Measure each block
                 for (int i = startIX; i != newBlocks.Count; ++i)
                 {
@@ -167,7 +167,7 @@
         /// <param name="hl">Highlight to show in hybrid text, or null.</param>
         /// <param name="blocks">List of blocks to append to.</param>
         /// <param name="links">List to gather links (appending to list).</param>
-        private void getBlocks(HybridText htxt, bool isMeta, CedictTargetHighlight hl,
+        private void makeBlocks(HybridText htxt, bool isMeta, CedictTargetHighlight hl,
             List<Block> blocks, List<LinkArea> links)
         {
             byte fntIdxLatin = isMeta ? fntMetaLatin : fntSenseLatin;
@@ -417,6 +417,7 @@
                         // Last block breaks onto this line
                         lastPB.LocX = (short)Math.Round(blockX);
                         lastPB.LocY = (short)Math.Round(blockY);
+                        positionedBlocks[i - 1] = lastPB;
                         // We move on by last block's width plus (optional) space
                         blockX += ((float)lastBlock.Width);
                         if (!lastBlock.SenseId && lastBlock.SpaceAfter)


Escape `dotnet-swagger.dll` path in CLI tool

If `dotnet-swagger.dll` is placed in a path with spaces then the assembly location used when respawning `dotnet` is not escaped.

--- src/Swashbuckle.AspNetCore.Cli/Program.cs
+++ src/Swashbuckle.AspNetCore.Cli/Program.cs
@@ -41,7 +41,7 @@
                         "exec --depsfile {0} --runtimeconfig {1} {2} _{3}", // note the underscore
                         EscapePath(depsFile),
                         EscapePath(runtimeConfig),
-                        typeof(Program).GetTypeInfo().Assembly.Location,
+                        EscapePath(typeof(Program).GetTypeInfo().Assembly.Location),
                         string.Join(" ", args)
                     ));


Made `AfterConfigure()` virtual for the database module to allow others to call it.

--- Ceen.Security/Login/DatabaseStorageModule.cs
+++ Ceen.Security/Login/DatabaseStorageModule.cs
@@ -363,7 +363,7 @@
 		/// <summary>
 		/// Configuration method to set up everything
 		/// </summary>
-        public void AfterConfigure()
+        public virtual void AfterConfigure()
         {
             EnsureConnected();
             CreateTables();


Devices now use the base color on initialization instead of just blue.

--- Chromatics/FFXIVInterfaces/FFXIVInterface.cs
+++ Chromatics/FFXIVInterfaces/FFXIVInterface.cs
@@ -96,7 +96,7 @@
             //HoldReader = false;

             //GlobalUpdateState("static", Color.DeepSkyBlue, false);
-            GlobalApplyAllKeyLighting(Color.DeepSkyBlue);
+            GlobalApplyAllKeyLighting(ColorTranslator.FromHtml(ColorMappings.ColorMappingBaseColor));
             //GlobalUpdateState("wave", Color.Magenta, false, Color.MediumSeaGreen, true, 40);

             //Debug.WriteLine("Resetting..");
@@ -324,7 +324,7 @@
                                 }

                                 //GlobalUpdateState("static", Color.DeepSkyBlue, false);
-                                GlobalApplyAllKeyLighting(Color.DeepSkyBlue);
+                                GlobalApplyAllKeyLighting(ColorTranslator.FromHtml(ColorMappings.ColorMappingBaseColor));

                                 WriteConsole(ConsoleTypes.Ffxiv, "Returning to Main Menu..");
                             }


Add flat resolution to the new single clause solver

--- LogicalShift.Reason/Solvers/SimpleSingleClauseSolver.cs
+++ LogicalShift.Reason/Solvers/SimpleSingleClauseSolver.cs
@@ -24,10 +24,17 @@
         /// </summary>
         private readonly ISolver _subclauseSolver;

+        private class AssignmentData
+        {
+            public ILiteral PredicateName { get; set; }
+            public int NumArguments { get; set; }
+            public IAssignmentLiteral[] Assignments { get; set; }
+        }
+
         /// <summary>
         /// The assignments for each predicate in the clause (starting with the 'Implies' predicate)
         /// </summary>
-        private readonly List<List<IAssignmentLiteral>> _clauseAssignments;
+        private readonly List<AssignmentData> _clauseAssignments;

         public SimpleSingleClauseSolver(IClause clause, ISolver subclauseSolver)
         {
@@ -39,7 +46,16 @@

             // Compile each part of the clause to its subclauses
             _clauseAssignments = new[] { clause.Implies }.Concat(clause.If)
-                .Select(predicate => GetAssignmentsFromPredicate(predicate).Assignments.ToList())
+                .Select(predicate =>
+                {
+                    var assignments = GetAssignmentsFromPredicate(predicate);
+                    return new AssignmentData
+                    {
+                        PredicateName = predicate.UnificationKey,
+                        NumArguments = assignments.CountArguments(),
+                        Assignments = assignments.Assignments.ToArray()
+                    };
+                })
                 .ToList();
         }

@@ -77,8 +93,8 @@
             // Unify using the predicate
             try
             {
-                unifier.ProgramUnifier.Bind(_clauseAssignments[0]);
-                unifier.ProgramUnifier.Compile(_clauseAssignments[0]);
+                unifier.ProgramUnifier.Bind(_clauseAssignments[0].Assignments);
+                unifier.ProgramUnifier.Compile(_clauseAssignments[0].Assignments);
             }
             catch (InvalidOperationException)
             {
@@ -89,7 +105,27 @@
             // Call using the clauses
             foreach (var clause in _clauseAssignments.Skip(1))
             {
-                throw new NotImplementedException();
+                try
+                {
+                    // Put the arguments for this clause
+                    unifier.QueryUnifier.Bind(clause.Assignments);
+                    unifier.QueryUnifier.Compile(clause.Assignments);
+                }
+                catch (InvalidOperationException)
+                {
+                    // Failed to unify
+                    return () => false;
+                }
+
+                // Call the clause
+                var result = _subclauseSolver.Call(clause.PredicateName, unifier.GetArgumentVariables(clause.NumArguments))();
+
+                // Stop if the clause doesn't resolve correctly
+                if (!result)
+                {
+                    // Failed to resolve this clause
+                    return () => false;
+                }
             }

             // Success


added a bounded stream to avoid memory copy

--- AppendLog/AppendLog.cs
+++ AppendLog/AppendLog.cs
@@ -36,14 +36,16 @@

         sealed class EventEnumerator : IEventEnumerator
         {
+            StreamedFileLog log;
             FileStream file;
             TransactionId next;
             public TransactionId Transaction { get; internal set; }
             public Stream Stream { get; internal set; }

-            public EventEnumerator(StreamedFileLog log, TransactionId lastEvent)
+            public EventEnumerator(StreamedFileLog slog, TransactionId lastEvent)
             {
                 file = log.Open();
+                log = slog;
                 next = lastEvent;
                 file.Position = next.Id;
             }
@@ -59,14 +61,8 @@
                 //FIXME: I'm assuming that reading/writing an array buffer at a time is atomic across threads and processes.
                 //I open the write stream appropriately for atomic writes, but should test this extensively.
                 await file.ReadAsync(tmp, 0, sizeof(int));
-                //FIXME: replace in-memory buffering with a bounded stream, ie.
-                // new BoundedStream(file, start:next.Id+header, end:next.Id+header+length);
                 var length = tmp[0] | tmp[1] << 8 | tmp[2] << 16 | tmp[3] << 24;
-                var data = new byte[length];
-                var read = 0;
-                do read += await file.ReadAsync(data, 0, length);
-                while (read < length);
-                Stream = new MemoryStream(data, false);
+                Stream = new BoundedStream(log, file.Position, length);
                 Transaction = next;
                 next = new TransactionId { Id = Transaction.Id + length };
                 return true;
@@ -153,10 +149,10 @@
             public override long Seek(long offset, SeekOrigin origin)
             {
                 //FIXME: not sure if I really need this since I open the file in AppendData/Append mode w/ sequential scan
-                var newpos = origin == SeekOrigin.Begin   ? offset:
+                var newpos = origin == SeekOrigin.Begin   ? nextId + offset:
                              origin == SeekOrigin.Current ? Position + offset:
                                                             Length + offset;
-                if (newpos <= nextId + sizeof(int)) throw new ArgumentOutOfRangeException("offset", "Cannot seek before the end of the log.");
+                if (newpos <= nextId + sizeof(int)) throw new ArgumentException("Cannot seek before the end of the log.", "offset");
                 return base.Seek(offset, origin);
             }

@@ -166,7 +162,7 @@
                 set
                 {
                     //FIXME: not sure if I really need this since I open the file in AppendData/Append mode
-                    if (value <= nextId + +sizeof(int)) throw new ArgumentOutOfRangeException("value", "Cannot seek before the end of the log.");
+                    if (value <= nextId + sizeof(int)) throw new ArgumentOutOfRangeException("value", "Cannot seek before the end of the log.");
                     base.Position = value;
                 }
             }
@@ -203,5 +199,61 @@
                 base.Close();
             }
         }
+
+        /// <summary>
+        /// A file stream that's bounded.
+        /// </summary>
+        sealed class BoundedStream : FileStream
+        {
+            long start;
+            long end;
+
+            public BoundedStream(StreamedFileLog log, long start, int length)
+                : base(log.path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
+            {
+                this.start = start;
+                this.end = start + length;
+                base.Position = start;
+            }
+
+            public override long Seek(long offset, SeekOrigin origin)
+            {
+                var newpos = origin == SeekOrigin.Begin   ? start + offset:
+                             origin == SeekOrigin.Current ? Position + offset:
+                                                            Length + offset;
+                if (newpos < start) throw new ArgumentException("Cannot seek before the end of the log.", "offset");
+                if (newpos >= end) throw new ArgumentException("Cannot seek past the end of the log.", "offset");
+                return base.Seek(offset, origin);
+            }
+
+            public override long Position
+            {
+                get { return base.Position; }
+                set
+                {
+                    if (value < start) throw new ArgumentException("Cannot seek before the end of the log.", "offset");
+                    if (value >= end) throw new ArgumentException("Cannot seek past the end of the log.", "offset");
+                    base.Position = value;
+                }
+            }
+
+            public override int Read(byte[] array, int offset, int count)
+            {
+                count = (int)Math.Min(end - Position, count);
+                return base.Read(array, offset, count);
+            }
+
+            public override IAsyncResult BeginRead(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject)
+            {
+                numBytes = (int)Math.Min(end - Position, numBytes);
+                return base.BeginRead(array, offset, numBytes, userCallback, stateObject);
+            }
+
+            public override int ReadByte()
+            {
+                if (Position >= end) throw new ArgumentException("Cannot seek past the end of the log.");
+                return base.ReadByte();
+            }
+        }
     }
 }


So much was broken on the saga test I'm not sure how to fix the test yet but sagas work.

Former-commit-id: 6022fefd9c9fc22bc18952a0352230eb3a586383

--- MassTransit.ServiceBus.Tests/Saga/RegisterUser_Specs.cs
+++ MassTransit.ServiceBus.Tests/Saga/RegisterUser_Specs.cs
@@ -12,8 +12,13 @@
 // specific language governing permissions and limitations under the License.
 namespace MassTransit.ServiceBus.Tests.Saga.RegisterUser
 {
-    using System.Diagnostics;
-    using NUnit.Framework;
+	using System;
+	using System.Diagnostics;
+    using Castle.Core;
+    using Magnum.Common.Repository;
+	using MassTransit.Saga;
+	using Messages;
+	using NUnit.Framework;
     using NUnit.Framework.SyntaxHelpers;

     [TestFixture]
@@ -22,20 +27,18 @@
     {
         protected override void Before_each()
         {
+			// this just shows that you can easily respond to the message
+			RemoteBus.Subscribe<SendUserVerificationEmail>(x => RemoteBus.Publish(new UserVerificationEmailSent(x.Message.CorrelationId, x.Message.Email)));

-        }
-
-        protected override void After_each()
-        {
-
+			RemoteBus.AddComponent<RegisterUserSaga>();
         }

         [Test]
         public void The_user_should_be_pending()
         {
-            var timer = Stopwatch.StartNew();
+			Stopwatch timer = Stopwatch.StartNew();

-            var controller = new RegisterUserController(LocalBus);
+			RegisterUserController controller = new RegisterUserController(LocalBus);

             bool complete = controller.RegisterUser("username", "password", "Display Name", "user@domain.com");


potential issue with saving stats

potential issue with saving stats

--- CompatBot/Database/Providers/StatsStorage.cs
+++ CompatBot/Database/Providers/StatsStorage.cs
@@ -27,6 +27,7 @@
                     using (var db = new BotDb())
                     {
                         db.Stats.RemoveRange(db.Stats);
+                        await db.SaveChangesAsync().ConfigureAwait(false);
                         foreach (var cache in AllCaches)
                         {
                             var category = cache.GetType().Name;
@@ -36,6 +37,10 @@
                         }
                         await db.SaveChangesAsync().ConfigureAwait(false);
                     }
+                }
+                catch(Exception e)
+                {
+                    Config.Log.Error(e, "Failed to save user stats");
                 }
                 finally
                 {


adds FileBuffer#Contains

adds FileBuffer#Contains

--- Archives/FileBuffer.cs
+++ Archives/FileBuffer.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.IO;
+using System.Threading.Tasks;

 namespace McSherry.Zener.Archives
 {
@@ -193,6 +194,32 @@
             }
         }
         /// <summary>
+        /// Determines whether the buffer contains a set of bytes equal to
+        /// the provided sequence of bytes.
+        /// </summary>
+        /// <param name="bytes">The set of bytes to search for.</param>
+        /// <returns>True if the buffer contains a set equal to the provided set.</returns>
+        public bool Contains(IEnumerable<byte> bytes)
+        {
+            bool hasMatch = false;
+            // Doing this in serial would likely be fairly slow, as
+            // a file has to be read on each iteration. Making the
+            // comparisons parallel should help mitigate any
+            // performance hits.
+            Parallel.ForEach(
+                source: this,
+                body: (item, state) =>
+                {
+                    if (bytes.SequenceEqual(item))
+                    {
+                        hasMatch = true;
+                        state.Stop();
+                    }
+                });
+
+            return hasMatch;
+        }
+        /// <summary>
         /// Removes a set of bytes from the buffer. Always throws
         /// a NotSupportedException.
         /// </summary>


Started development on v0.10.0.0

Started development on v0.10.0.0

--- AssemblyInfo.Global.cs
+++ AssemblyInfo.Global.cs
@@ -8,7 +8,7 @@
 [assembly: AssemblyCopyright("Copyright © 2015 1und1 Internet SE")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.9.0.0")]
+[assembly: AssemblyVersion("0.10.0.0")]
 [assembly: ComVisible(false)]

 [assembly: InternalsVisibleTo("Dehydrator.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010065be9ae8ce335904900434943dae20813bffdcda0a7c2a95ca78d64d0b645f2403086e71824a26e62e4a0e45400c45cf24cdba5010ba8476c5af6a6e931622ff924283bed343b0d756c62264840d77d97789c6ad21b24ca180ae878beabd5f21ad835c6c92618d505fed0ffd973b98199b921cab78c69a42b85ac5467d3aefc8")]


can only score when carrying flag

can only score when carrying flag

--- Assets/Scripts/Flag.cs
+++ Assets/Scripts/Flag.cs
@@ -62,7 +62,7 @@

 	public void OnTriggerStay2D(Collider2D coll){
 		ScoreZone zone = coll.GetComponent<ScoreZone>();
-		if (zone) {
+		if (zone && carrier && carrier.team != zone.team) {
 			countdown -= Time.deltaTime;
 		}
 	}


changed accel

changed accel

--- Assets/Scripts/Hero.cs
+++ Assets/Scripts/Hero.cs
@@ -79,7 +79,7 @@

 	void Start ()
 	{
-		this.scalarAccelerationModifier = 0.5f;
+		this.scalarAccelerationModifier = 0.1f;
 		this.HeroController = this.GetComponent<HeroController>();
 		this.GetComponentInChildren<SpriteRenderer>().sprite = this.BodySprites[this.HeroController.PlayerNumber];
 		this.ProjectileSprite = this.ProjectileSprites[this.HeroController.PlayerNumber];


Timo hat Björns änderung verbockt also wieder rückgängig machen!

--- BBT/MainWindow.xaml.cs
+++ BBT/MainWindow.xaml.cs
@@ -24,53 +24,71 @@
     {
         ANode _currentMarkedNode = null;
         Dictionary<ANode, Grid> _nodeRegistry;
+        AMindMap _mindmap;
+
+

         public MainWindow()
         {
             this._nodeRegistry = new Dictionary<ANode, Grid>();
+            this._mindmap = new MindMap();
             InitializeComponent();
         }

         private void handleNodeChanges(object sender, ANode node)
         {
-            Grid nodeElement = node.getGrid();
+            Tuple<Line, Grid> nodeElement = AMindMap.getDisplay(node);
             if (this._nodeRegistry.ContainsKey(node))
             {
                 if (this.MindMapCanvas.Children.Contains(this._nodeRegistry[node]))
                     this.MindMapCanvas.Children.Remove(this._nodeRegistry[node]);
             }
-            this._nodeRegistry[node] = nodeElement;
-            Canvas.SetLeft(nodeElement, node.getRectangle().Left);
-            Canvas.SetTop(nodeElement, node.getRectangle().Top);
-            nodeElement.MouseLeftButtonDown += Node_MouseLeftButtonDown;
-            this.MindMapCanvas.Children.Add(nodeElement);
+            this._nodeRegistry[node] = nodeElement.Item2;
+            //Point realPosition = new Point(Canvas.GetLeft(this._nodeRegistry[this._mindmap.getMainNode()]), Canvas.GetTop(this._nodeRegistry[this._mindmap.getMainNode()]));
+
+            //Canvas.SetLeft(nodeElement.Item2, AMindMap.transformCoords(node.getRectangle().TopLeft, realPosition).X);
+            //Canvas.SetTop(nodeElement.Item2, AMindMap.transformCoords(node.getRectangle().TopLeft, realPosition).Y);
+            Canvas.SetZIndex(nodeElement.Item1, 0);
+            Canvas.SetZIndex(nodeElement.Item2, 1);
+            nodeElement.Item2.MouseLeftButtonDown += Node_MouseLeftButtonDown;
+            this.MindMapCanvas.Children.Add(nodeElement.Item1);
+            this.MindMapCanvas.Children.Add(nodeElement.Item2);
             if (this._currentMarkedNode == null)
                 this._currentMarkedNode = node;
         }

         private void Window_Loaded(object sender, RoutedEventArgs e)
         {
+            this.MindMapCanvas.Clip = null;
+
             ANode node = new Node();
+
+
             node.changeNodeEvent += this.handleNodeChanges;
+
             node.beginUpdate();
             try
             {
-                node.setForm(new Ellipse());
-                node.setRectangle(new Rect(new Point(100, 100), new Point(300, 200)));
+                node.setForm(new Rechteck());
+
+                Point rectStartPoint = new Point(MindMapCanvas.ActualWidth / 2 - 50, this.MindMapCanvas.ActualHeight / 2 - 25);
+                Point rectEndPoint = new Point(MindMapCanvas.ActualWidth / 2 + 50, this.MindMapCanvas.ActualHeight / 2 + 25);
+
+                node.setRectangle(new Rect(rectStartPoint, rectEndPoint));

                 AStyle nodeStyle = new Style();
-
-                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, /*(bool)this.fillCheckBox.IsChecked*/false));
-                nodeStyle.setActivated(true);
+                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, (bool)this.fillCheckBox.IsChecked));
                 node.setStyle(nodeStyle);

                 node.setParent(null);
+                this._mindmap.setMainNode(node);

                 node.setText(this.nodeText.Text);
             }
             finally
             {
                 node.endUpdate();
+                _currentMarkedNode = node;
             }

         }
@@ -128,12 +146,20 @@
                 ToolboxRemove();
             }
         }
-
+        /// <summary>
+        /// Wenn der Wert vom slider sich ändert
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
         {
             this.FontSizeLabel.Content = "Schriftgrösse: " + System.Convert.ToInt32(this.FontSlider.Value).ToString() + "px";
         }
-
+        /// <summary>
+        /// Programm Beenden
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Exit_Click(object sender, RoutedEventArgs e)
         {
             this.Close();
@@ -159,8 +185,30 @@
             myBrush.Color = System.Windows.Media.Color.FromArgb(255, MyDialog.Color.R, MyDialog.Color.G, MyDialog.Color.B);
             //colorRect Farbe ändern
             colorRect.Fill = myBrush;
-        }
-
+
+            //Ausgewählten Knoten updaten
+            _currentMarkedNode.changeNodeEvent += this.handleNodeChanges;
+            _currentMarkedNode.beginUpdate();
+            try
+            {
+                IStyle nodeStyle = _currentMarkedNode.getStyle();
+                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, (bool)this.fillCheckBox.IsChecked));
+                _currentMarkedNode.setStyle((AStyle)nodeStyle);
+
+            }
+            finally
+            {
+                _currentMarkedNode.endUpdate();
+            }
+
+
+        }
+
+        /// <summary>
+        /// Hintergrundfarbe vom Canvas wird geändert
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void ChangeBackgroundColor_Click(object sender, RoutedEventArgs e)
         {
             ColorDialog MyDialog = new ColorDialog();
@@ -183,10 +231,152 @@
                     if (tempKeyValuePair.Value == tempGrid)
                     {
                         this._currentMarkedNode = tempKeyValuePair.Key;
+
+                        this.nodeText.Text = this._currentMarkedNode.getText();
+
+                        var converter = new System.Windows.Media.BrushConverter();
+                        var brush = (Brush)converter.ConvertFromString(this._currentMarkedNode.getStyle().getColor().Item1.ToString());
+
+
+                        this.colorRect.Fill = brush;
+                        this.fillCheckBox.IsChecked = this._currentMarkedNode.getStyle().getColor().Item2;
+                        /*switch (this._currentMarkedNode.getForm())
+                        {
+
+                        }
+
+                        this.ChooseForm.SelectedIndex = this._currentMarkedNode.getForm();
+
+
+                        */
                         break;
                     }
                 }
             }
         }
+
+        private void fillCheckBox_Checked(object sender, RoutedEventArgs e)
+        {
+            //Ausgewählten Knoten updaten
+            _currentMarkedNode.changeNodeEvent += this.handleNodeChanges;
+            _currentMarkedNode.beginUpdate();
+            try
+            {
+                IStyle nodeStyle = _currentMarkedNode.getStyle();
+                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, (bool)this.fillCheckBox.IsChecked));
+                _currentMarkedNode.setStyle((AStyle)nodeStyle);
+
+            }
+            finally
+            {
+                _currentMarkedNode.endUpdate();
+            }
+        }
+
+        private void fillCheckBox_Unchecked(object sender, RoutedEventArgs e)
+        {
+            //Ausgewählten Knoten updaten
+            _currentMarkedNode.changeNodeEvent += this.handleNodeChanges;
+            _currentMarkedNode.beginUpdate();
+            try
+            {
+                IStyle nodeStyle = _currentMarkedNode.getStyle();
+                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, (bool)this.fillCheckBox.IsChecked));
+                _currentMarkedNode.setStyle((AStyle)nodeStyle);
+
+            }
+            finally
+            {
+                _currentMarkedNode.endUpdate();
+            }
+        }
+
+        private void nodeText_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            //Ausgewählten Knoten updaten
+            if (_currentMarkedNode != null)
+            {
+                _currentMarkedNode.changeNodeEvent += this.handleNodeChanges;
+                _currentMarkedNode.beginUpdate();
+                try
+                {
+
+                    _currentMarkedNode.setText(this.nodeText.Text);
+
+                }
+                finally
+                {
+                    _currentMarkedNode.endUpdate();
+                }
+            }
+        }
+
+        private void addNode_Click(object sender, RoutedEventArgs e)
+        {
+            ANode node = new Node();
+
+
+            node.changeNodeEvent += this.handleNodeChanges;
+
+            node.beginUpdate();
+            try
+            {
+                switch (this.ChooseForm.SelectedIndex)
+                {
+                    case 0:
+                        node.setForm(new Rechteck());
+                        break;
+                    case 1:
+                        node.setForm(new Ellipse());
+                        break;
+                    default:
+                        break;
+                }
+
+                node.setRectangle(new Rect(new Point(_currentMarkedNode.getRectangle().TopLeft.X+150, _currentMarkedNode.getRectangle().TopLeft.Y), new Point(_currentMarkedNode.getRectangle().BottomRight.X+150, _currentMarkedNode.getRectangle().BottomRight.Y)));
+
+                AStyle nodeStyle = new Style();
+                nodeStyle.setColor(Tuple.Create((this.colorRect.Fill as SolidColorBrush).Color, (bool)this.fillCheckBox.IsChecked));
+                node.setStyle(nodeStyle);
+
+                node.setParent(_currentMarkedNode);
+                this._mindmap.addNode(node);
+
+                node.setText(this.nodeText.Text);
+            }
+            finally
+            {
+                node.endUpdate();
+                _currentMarkedNode = node;
+            }
+        }
+
+        private void ChooseForm_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (_currentMarkedNode != null)
+            {
+                _currentMarkedNode.changeNodeEvent += this.handleNodeChanges;
+                _currentMarkedNode.beginUpdate();
+                try
+                {
+                    switch (this.ChooseForm.SelectedIndex)
+                    {
+                        case 0:
+                            _currentMarkedNode.setForm(new Rechteck());
+                            break;
+                        case 1:
+                            _currentMarkedNode.setForm(new Ellipse());
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                finally
+                {
+                    _currentMarkedNode.endUpdate();
+                }
+            }
+        }
+
     }
 }


Adding UrlReferrer

Adding UrlReferrer

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@5193 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/Test/IMockRequest.cs
+++ MonoRail/Castle.MonoRail.Framework/Test/IMockRequest.cs
@@ -96,5 +96,10 @@
 		/// </summary>
 		/// <value>The IP address of the remote client.</value>
 		new string UserHostAddress { set; }
+
+		/// <summary>
+		/// Sets the referring URL.
+		/// </summary>
+		new String UrlReferrer { set; }
 	}
 }


Add some debug logs

Add some debug logs

--- NTumbleBit/ClassicTumbler/Client/PaymentStateMachine.cs
+++ NTumbleBit/ClassicTumbler/Client/PaymentStateMachine.cs
@@ -372,6 +372,7 @@
 								{
 									feeRate = GetFeeRate();
 									alice = Runtime.CreateTumblerClient(cycle.Start, Identity.Alice);
+									Logs.Client.LogDebug("Starting the puzzle solver protocol...");
 									var puzzles = SolverClientSession.GeneratePuzzles();
 									var commmitments = alice.SolvePuzzles(SolverClientSession.Id, puzzles);
 									var revelation2 = SolverClientSession.Reveal(commmitments);
@@ -382,6 +383,8 @@
 									var offerSignature = SolverClientSession.SignOffer(offerInformation);

 									var offerRedeem = SolverClientSession.CreateOfferRedeemTransaction(feeRate);
+									Logs.Client.LogDebug("Puzzle solver protocol ended...");
+
 									//May need to find solution in the fulfillment transaction
 									Services.BlockExplorerService.TrackAsync(offerRedeem.PreviousScriptPubKey).GetAwaiter().GetResult();
 									Tracker.AddressCreated(cycle.Start, TransactionType.ClientOfferRedeem, SolverClientSession.GetInternalState().RedeemDestination, correlation);
@@ -392,7 +395,7 @@
 										SolverClientSession.CheckSolutions(solutionKeys);
 										var tumblingSolution = SolverClientSession.GetSolution();
 										var transaction = PromiseClientSession.GetSignedTransaction(tumblingSolution);
-										Logs.Client.LogInformation("Got puzzle solution cooperatively from the tumbler");
+										Logs.Client.LogDebug("Got puzzle solution cooperatively from the tumbler");
 										Status = PaymentStateMachineStatus.PuzzleSolutionObtained;
 										Services.TrustedBroadcastService.Broadcast(cycle.Start, TransactionType.TumblerCashout, correlation, new TrustedBroadcastRequest()
 										{


lots of misnamed things in sceImpose - bad generation script

--- Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/sceImpose.cs
+++ Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/sceImpose.cs
@@ -50,37 +50,39 @@

 		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0x24FD7BCF, "sceRegOpenRegistry" )]
+		[BiosFunction( 0x24FD7BCF, "sceImposeGetLanguageMode" )]
 		// manual add - ptrs to storage for values
 		public int sceImposeGetLanguageMode( int language, int swapButtons ){ return Module.NotImplementedReturn; }

-		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0x36AA6E91, "sceRegOpenRegistry" )]
+		[BiosFunction( 0x36AA6E91, "sceImposeSetLanguageMode" )]
 		// manual add
-		public int sceImposeSetLanguageMode( int language, int swapButtons ){ return Module.NotImplementedReturn; }
+		public int sceImposeSetLanguageMode( int language, int swapButtons )
+		{
+			return 0;
+		}

 		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0x381BD9E7, "sceRegOpenRegistry" )]
+		[BiosFunction( 0x381BD9E7, "sceImposeHomeButton" )]
 		// manual add
 		public int sceImposeHomeButton(){ return Module.NotImplementedReturn; }

 		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0x72189C48, "sceRegOpenRegistry" )]
+		[BiosFunction( 0x72189C48, "sceImposeSetUMDPopup" )]
 		// manual add
 		public int sceImposeSetUMDPopup( int enable ){ return Module.NotImplementedReturn; }

 		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0x8C943191, "sceRegOpenRegistry" )]
+		[BiosFunction( 0x8C943191, "sceImposeGetBatteryIconStatus" )]
 		// manual add
 		public int sceImposeGetBatteryIconStatus( int status0, int status1 ){ return Module.NotImplementedReturn; }

 		[NotImplemented]
 		[Stateless]
-		[BiosFunction( 0xE0887BC8, "sceRegOpenRegistry" )]
+		[BiosFunction( 0xE0887BC8, "sceImposeGetUMDPopup" )]
 		// manual add
 		public int sceImposeGetUMDPopup(){ return Module.NotImplementedReturn; }
 	}


Revert "Send kill updates if an avatar moves outside the view distance."

This reverts commit 2506f5ba4dd7f26395d17130762bc3e29e5bd95b.

--- OpenSim/Region/CoreModules/Agent/SceneView/SceneView.cs
+++ OpenSim/Region/CoreModules/Agent/SceneView/SceneView.cs
@@ -249,16 +249,6 @@
                                 presence.SceneView.CheckWhetherAttachmentsHaveChanged(m_presence);
                         }
                     }
-                    else
-                    {
-                        //Send a kill update for that avatar then
-                        if (m_presencesInView.Contains(presence.UUID))
-                        {
-                            m_presencesInView.Remove(presence.UUID);
-                            m_presence.ControllingClient.SendNonPermanentKillObject(m_presence.Scene.RegionInfo.RegionHandle,
-                                presence.LocalId);
-                        }
-                    }
                 }
             }
         }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/EndPointListener.cs
+++ websocket-sharp/Net/EndPointListener.cs
@@ -61,16 +61,16 @@
   {
     #region Private Fields

-    private List<HttpListenerPrefix>   _all; // host == '+'
+    private List<HttpListenerPrefix>                   _all; // host == '+'
     private Dictionary<HttpConnection, HttpConnection> _connections;
-    private object                     _connectionsSync;
-    private static readonly string     _defaultCertFolderPath;
-    private IPEndPoint                 _endpoint;
-    private List<HttpListenerPrefix>   _prefixes;
-    private bool                       _secure;
-    private Socket                     _socket;
-    private ServerSslConfiguration     _sslConfig;
-    private List<HttpListenerPrefix>   _unhandled; // host == '*'
+    private object                                     _connectionsSync;
+    private static readonly string                     _defaultCertFolderPath;
+    private IPEndPoint                                 _endpoint;
+    private List<HttpListenerPrefix>                   _prefixes;
+    private bool                                       _secure;
+    private Socket                                     _socket;
+    private ServerSslConfiguration                     _sslConfig;
+    private List<HttpListenerPrefix>                   _unhandled; // host == '*'

     #endregion


Fix sample code

Fix sample code

--- PureLayoutSample/PureLayoutSample/RootViewController.cs
+++ PureLayoutSample/PureLayoutSample/RootViewController.cs
@@ -80,38 +80,6 @@
             View.Add(_tableView);
             View.Add(_clearHistoryButton);

-            var edgeInsets = new UIEdgeInsets(top: 16, left: 16f, bottom: 16f, right: 16f);
-            var view = new UIView();
-            var otherView = new UIView();
-
-            view.AutoPinEdgesToSuperviewEdges();
-            view.AutoPinEdgesToSuperviewEdges(insets: edgeInsets);
-            view.AutoPinEdgesToSuperviewEdgesExcludingEdge(excludingEdge: ALEdge.Bottom);
-            view.AutoPinEdgesToSuperviewEdgesExcludingEdge(insets: edgeInsets, excludingEdge: ALEdge.Bottom);
-
-            view.AutoPinEdgesToSuperviewMargins();
-            view.AutoPinEdgesToSuperviewMarginsExcludingEdge(edge: ALEdge.Bottom);
-            view.AutoPinEdgesToSuperviewMarginsExcludingEdge(insets: edgeInsets, edge: ALEdge.Bottom);
-
-            view.AutoPinEdgeToSuperviewEdge(edge: ALEdge.Top);
-            view.AutoPinEdgeToSuperviewEdge(edge: ALEdge.Top, inset: 16f);
-            view.AutoPinEdgeToSuperviewEdge(edge: ALEdge.Top, inset: 16f, relation: NSLayoutRelation.LessThanOrEqual);
-
-            view.AutoPinEdgeToSuperviewMargin(edge: ALEdge.Left);
-            view.AutoPinEdgeToSuperviewMargin(edge: ALEdge.Left, relation: NSLayoutRelation.GreaterThanOrEqual);
-
-            view.AutoPinEdge(edge: ALEdge.Right, toEdge: ALEdge.Left, otherView: otherView);
-            view.AutoPinEdge(edge: ALEdge.Right, toEdge: ALEdge.Left, otherView: otherView, offset: 16f);
-            view.AutoPinEdge(edge: ALEdge.Right, toEdge: ALEdge.Left, otherView: otherView, offset: 16f, relation: NSLayoutRelation.GreaterThanOrEqual);
-
-            view.AutoPinToTopLayoutGuideOfViewController(viewController: this);
-            view.AutoPinToTopLayoutGuideOfViewController(viewController: this, inset: 16f);
-            view.AutoPinToTopLayoutGuideOfViewController(viewController: this, inset: 16f, relation: NSLayoutRelation.Equal);
-
-            view.AutoPinToBottomLayoutGuideOfViewController(viewController: this);
-            view.AutoPinToBottomLayoutGuideOfViewController(viewController: this, inset: 16f);
-            view.AutoPinToBottomLayoutGuideOfViewController(viewController: this, inset: 16f, relation: NSLayoutRelation.Equal);
-
 			_amount.AutoPinEdgeToSuperviewEdge(ALEdge.Top, Constants.WideMargin);
 			_amount.AutoPinEdgeToSuperviewEdge(ALEdge.Left, Constants.DefaultMargin);
             _tipPercentage.AutoPinEdge(ALEdge.Leading, ALEdge.Trailing, _amount, Constants.DefaultMargin);


More comments

More comments

--- RDFSharp/Semantics/OWL/Ontology/Data/RDFOntologyData.cs
+++ RDFSharp/Semantics/OWL/Ontology/Data/RDFOntologyData.cs
@@ -391,6 +391,8 @@
                             {
                                 RDFOntologyTaxonomyEntry taxonomyEntry = new RDFOntologyTaxonomyEntry(aFact, objectProperty, bFact);
                                 this.Relations.Assertions.AddEntry(taxonomyEntry);
+
+                                //Link owl:Axiom annotation
                                 this.AddAxiomAnnotation(taxonomyEntry, axiomAnnotation);
                             }
                         }
@@ -438,6 +440,8 @@
                             RDFOntologyTaxonomyEntry taxonomyEntry = new RDFOntologyTaxonomyEntry(ontologyFact, datatypeProperty, ontologyLiteral);
                             this.Relations.Assertions.AddEntry(taxonomyEntry);
                             this.AddLiteral(ontologyLiteral);
+
+                            //Link owl:Axiom annotation
                             this.AddAxiomAnnotation(taxonomyEntry, axiomAnnotation);
                         }
                         else
@@ -577,11 +581,15 @@
                 foreach (RDFOntologyTaxonomyEntry taxonomyEntry in this.Relations.Assertions.SelectEntriesBySubject(ontologyFact))
                 {
                     this.Relations.Assertions.RemoveEntry(taxonomyEntry);
+
+                    //Unlink owl:Axiom annotation
                     this.RemoveAxiomAnnotation(taxonomyEntry);
                 }
                 foreach (RDFOntologyTaxonomyEntry taxonomyEntry in this.Relations.Assertions.SelectEntriesByObject(ontologyFact))
                 {
                     this.Relations.Assertions.RemoveEntry(taxonomyEntry);
+
+                    //Unlink owl:Axiom annotation
                     this.RemoveAxiomAnnotation(taxonomyEntry);
                 }

@@ -732,7 +740,10 @@
                 foreach (RDFOntologyTaxonomyEntry taxonomyEntry in this.Relations.Assertions.SelectEntriesByObject(ontologyLiteral))
                 {
                     this.Relations.Assertions.RemoveEntry(taxonomyEntry);
+
+                    //Unlink owl:Axiom annotation
                     this.RemoveAxiomAnnotation(taxonomyEntry);
+
                     this.AddAssertionRelation((RDFOntologyFact)taxonomyEntry.TaxonomySubject, (RDFOntologyDatatypeProperty)taxonomyEntry.TaxonomyPredicate, newOntologyLiteral);
                 }

@@ -944,6 +955,8 @@
                 {
                     RDFOntologyTaxonomyEntry taxonomyEntry = new RDFOntologyTaxonomyEntry(aFact, objectProperty, bFact);
                     this.Relations.Assertions.RemoveEntry(taxonomyEntry);
+
+                    //Unlink owl:Axiom annotation
                     this.RemoveAxiomAnnotation(taxonomyEntry);
                 }
             }
@@ -961,6 +974,8 @@
             {
                 RDFOntologyTaxonomyEntry taxonomyEntry = new RDFOntologyTaxonomyEntry(ontologyFact, datatypeProperty, ontologyLiteral);
                 this.Relations.Assertions.RemoveEntry(taxonomyEntry);
+
+                //Unlink owl:Axiom annotation
                 this.RemoveAxiomAnnotation(taxonomyEntry);
             }
             return this;


Added AutoFitModes property

Added AutoFitModes property

--- src/Wpf.Controls.PanAndZoom/ZoomBorder.cs
+++ src/Wpf.Controls.PanAndZoom/ZoomBorder.cs
@@ -14,6 +14,13 @@
     /// </summary>
     public class ZoomBorder : Border
     {
+        private static AutoFitMode[] _autoFitModes = (AutoFitMode[])Enum.GetValues(typeof(AutoFitMode));
+
+        /// <summary>
+        ///
+        /// </summary>
+        public static AutoFitMode[] AutoFitModes => _autoFitModes;
+
         private UIElement _element;
         private Point _pan;
         private Point _previous;


Make parsing cleaner in PredefinedFormulas

--- src/WpfMath/TexPredefinedFormulaParser.cs
+++ src/WpfMath/TexPredefinedFormulaParser.cs
@@ -172,7 +172,7 @@
                     formula = new TexFormula();
                 }

-                this.TempFormulas[name] = formula;
+                this.TempFormulas.Add(name, formula);
             }
         }

@@ -195,6 +195,7 @@
                 var result = this.TempFormulas[name];
                 Debug.Assert(result != null);
                 this.Result = result;
+                this.TempFormulas.Clear();
             }
         }


Default Clone() implementation for custom document types now using object.MemberwiseClone(), re #183

--- src/Wyam.Core/Documents/CustomDocument.cs
+++ src/Wyam.Core/Documents/CustomDocument.cs
@@ -20,10 +20,11 @@
         ///
         /// Clones this instance of the document. You must return a new instance of your
         /// custom document type, even if nothing will change, otherwise the document factory
-        /// will throw an exception.
+        /// will throw an exception. The default implementation of this method performs a
+        /// object.MemberwiseClone().
         ///
         /// <returns>A new custom document instance with the same values as the current instance.</returns>
-        protected internal abstract CustomDocument Clone();
+        protected internal virtual CustomDocument Clone() => (CustomDocument)MemberwiseClone();

         public IEnumerator<KeyValuePair<string, object>> GetEnumerator() =>
             Document.GetEnumerator();


modified DNode class constructor to initialize Next and Previous as null

--- DoublyLinkedLists/DoublyLinkedLists/DNode.cs
+++ DoublyLinkedLists/DoublyLinkedLists/DNode.cs
@@ -13,6 +13,8 @@
         public DNode(int data)
         {
             Data = data;
+            Next = null;
+            Previous = null;
         }
     }
 }


Regex adjustment

Regex adjustment

--- DragonSpark.Presentation/Text/MarkDownify.cs
+++ DragonSpark.Presentation/Text/MarkDownify.cs
@@ -11,7 +11,7 @@
 	readonly string _replace;
 	public static MarkDownify Default { get; } = new();

-	MarkDownify() : this(new Regex(@"\w\n\w"), "
") {}
+	MarkDownify() : this(new Regex(@"[^\s]\r?\n\b"), "
") {}

 	public MarkDownify(Regex expression, string replace)
 	{