Only kill the socket if the async read is aborted by the system.

--- Enyim.Caching/Memcached/AsyncSocketHelper.cs
+++ Enyim.Caching/Memcached/AsyncSocketHelper.cs
@@ -99,7 +99,7 @@
 						// EndREceive will be triggered sooner or later but its timeout
 						// may be higher than our read timeout, so it's not reliable
 						if (!readInProgressEvent.WaitOne(this.socket.socket.ReceiveTimeout))
-							this.AbortReadAndPublishError();
+							this.AbortReadAndTryPublishError(false);

 						return;
 					}
@@ -114,8 +114,11 @@
 					this.BeginReceive();
 			}

-			private void AbortReadAndPublishError()
-			{
+			private void AbortReadAndTryPublishError(bool markAsDead)
+			{
+				if (markAsDead)
+					this.socket.isAlive = false;
+
 				// we've been already aborted, so quit
 				// both the EndReceive and the wait on the event can abort the read
 				// but only one should of them should continue the async call chain
@@ -123,8 +126,6 @@
 					return;

 				this.remainingRead = 0;
-				this.socket.isAlive = false;
-
 				var p = this.pendingArgs;
 #if DEBUG_IO
 				Thread.MemoryBarrier();
@@ -150,7 +151,7 @@
 				if (this.readEvent.SocketError != SocketError.Success
 					|| read == 0)
 				{
-					this.AbortReadAndPublishError();//new IOException("Remote end has been closed"));
+					this.AbortReadAndTryPublishError(true);//new IOException("Remote end has been closed"));

 					return false;
 				}


Weaken type of 'errors' parameter to IEnumerable<JsonErrorInfo>.

--- Eutherion/Shared/Text/Json/RootJsonSyntax.cs
+++ Eutherion/Shared/Text/Json/RootJsonSyntax.cs
@@ -51,11 +51,12 @@
         /// <exception cref="ArgumentNullException">
         /// <paramref name="syntax"/> and/or <paramref name="errors"/> are null.
         /// </exception>
-        public RootJsonSyntax(GreenJsonMultiValueSyntax syntax, List<JsonErrorInfo> errors)
+        public RootJsonSyntax(GreenJsonMultiValueSyntax syntax, IEnumerable<JsonErrorInfo> errors)
         {
             if (syntax == null) throw new ArgumentNullException(nameof(syntax));
+            if (errors == null) throw new ArgumentNullException(nameof(errors));
             Syntax = new JsonMultiValueSyntax(syntax);
-            Errors = errors ?? throw new ArgumentNullException(nameof(errors));
+            Errors = errors is List<JsonErrorInfo> errorList ? errorList : new List<JsonErrorInfo>(errors);
         }
     }
 }


Remove workaround result.

Remove workaround result.

--- Eutherion/Win.MdiAppTemplate/SyntaxEditor.cs
+++ Eutherion/Win.MdiAppTemplate/SyntaxEditor.cs
@@ -956,11 +956,6 @@
                     containsChangesAtSavePoint = CodeFile.ContainsChanges;
                     SetSavePoint();
                 }
-                else
-                {
-                    // Use this value to indicate a camcel action.
-                    return UIActionVisibility.Disabled;
-                }
             }

             return UIActionVisibility.Enabled;


Clean code from AzureTableStorageRoutingDataStore class eliminating no longer used code

--- BotMessageRouting/MessageRouting/DataStore/Azure/AzureTableStorageRoutingDataStore.cs
+++ BotMessageRouting/MessageRouting/DataStore/Azure/AzureTableStorageRoutingDataStore.cs
@@ -204,18 +204,6 @@
         }
         #endregion

-        // PARTIAL METHOD
-        private static void CheckWichConversationReferenceIsNull(ConversationReference conversationOwnerConversationReference, ConversationReference conversationClientConversationReference, out string conversationOwnerAccountID, out string conversationClientAccountID)
-        {
-            if (conversationClientConversationReference.Bot != null)
-                conversationClientAccountID = conversationClientConversationReference.Bot.Id;
-            else conversationClientAccountID = conversationClientConversationReference.User.Id;
-
-            if (conversationOwnerConversationReference.Bot != null)
-                conversationOwnerAccountID = conversationOwnerConversationReference.Bot.Id;
-            else conversationOwnerAccountID = conversationOwnerConversationReference.User.Id;
-        }
-
         /// <summary>
         /// Makes sure the required tables exist.
         /// </summary>
@@ -244,26 +232,6 @@
             }
         }

-        protected virtual void OnPartiesTableCreateIfNotExistsFinished(IAsyncResult result)
-        {
-            if (result == null)
-            {
-                System.Diagnostics.Debug.WriteLine((result.IsCompleted)
-                    ? "Create table operation for parties table completed"
-                    : "Create table operation for parties table did not complete");
-            }
-        }
-
-        protected virtual void OnConnectionsTableCreateIfNotExistsFinished(IAsyncResult result)
-        {
-            if (result == null)
-            {
-                System.Diagnostics.Debug.WriteLine((result.IsCompleted)
-                    ? "Create table operation for connections table completed"
-                    : "Create table operation for connections table did not complete");
-            }
-        }
-
         private List<ConversationReference> GetAllConversationReferencesFromEntities(IList<HandOffEntity> entities)
         {
             List<ConversationReference> conversationReferences = new List<ConversationReference>();


add verbose logs for ProFTPd commands

add verbose logs for ProFTPd commands

--- FluentFTP/Client/FtpClient_ServerSpecific.cs
+++ FluentFTP/Client/FtpClient_ServerSpecific.cs
@@ -344,7 +344,10 @@
 			// Support #378 - Support RMDIR command for ProFTPd
 			if (deleteContents && ServerType == FtpServer.ProFTPD && HasFeature(FtpCapability.SITE_RMDIR)) {
 				if ((reply = Execute("SITE RMDIR " + ftppath)).Success) {
+					this.LogStatus(FtpTraceLevel.Verbose, "Used the server-specific SITE RMDIR command to quickly delete: " + ftppath);
 					return true;
+				} else {
+					this.LogStatus(FtpTraceLevel.Verbose, "Failed to use the server-specific SITE RMDIR command to quickly delete: " + ftppath);
 				}
 			}

@@ -358,7 +361,10 @@
 			// Support #378 - Support RMDIR command for ProFTPd
 			if (deleteContents && ServerType == FtpServer.ProFTPD && HasFeature(FtpCapability.SITE_RMDIR)) {
 				if ((reply = await ExecuteAsync("SITE RMDIR " + ftppath, token)).Success){
+					this.LogStatus(FtpTraceLevel.Verbose, "Used the server-specific SITE RMDIR command to quickly delete: " + ftppath);
 					return true;
+				} else {
+					this.LogStatus(FtpTraceLevel.Verbose, "Failed to use the server-specific SITE RMDIR command to quickly delete: " + ftppath);
 				}
 			}

@@ -377,7 +383,10 @@
 			// Support #378 - Support MKDIR command for ProFTPd
 			if (ServerType == FtpServer.ProFTPD && HasFeature(FtpCapability.SITE_MKDIR)) {
 				if ((reply = Execute("SITE MKDIR " + ftppath)).Success) {
+					this.LogStatus(FtpTraceLevel.Verbose, "Used the server-specific SITE MKDIR command to quickly create: " + ftppath);
 					return true;
+				} else {
+					this.LogStatus(FtpTraceLevel.Verbose, "Failed to use the server-specific SITE MKDIR command to quickly create: " + ftppath);
 				}
 			}

@@ -391,7 +400,10 @@
 			// Support #378 - Support MKDIR command for ProFTPd
 			if (ServerType == FtpServer.ProFTPD && HasFeature(FtpCapability.SITE_MKDIR)) {
 				if ((reply = await ExecuteAsync("SITE MKDIR " + ftppath, token)).Success){
+					this.LogStatus(FtpTraceLevel.Verbose, "Used the server-specific SITE MKDIR command to quickly create: " + ftppath);
 					return true;
+				} else {
+					this.LogStatus(FtpTraceLevel.Verbose, "Failed to use the server-specific SITE MKDIR command to quickly create: " + ftppath);
 				}
 			}


Removed duplicate code, splitted methods into smaller parts

--- Devkoes.VSJenkinsManager/Devkoes.JenkinsManager.APIHandler/Managers/JenkinsManager.cs
+++ Devkoes.VSJenkinsManager/Devkoes.JenkinsManager.APIHandler/Managers/JenkinsManager.cs
@@ -41,119 +41,78 @@
         /// <returns>The list of Jobs</returns>
         public async static Task<JenkinsOverview> GetJenkinsOverview(string jenkinsServerUrl)
         {
-            JenkinsOverview overview = null;
-            JenkinsQueue queue = null;
-
             JenkinsServer server = SettingManager.GetJenkinsServer(jenkinsServerUrl);

-            if (server == null)
-            {
-                return null;
-            }
-
-            using (WebClient wc = new WebClient())
-            {
-                if (!string.IsNullOrWhiteSpace(server.UserName))
-                {
-                    // WebClient.Credentials can not be used, because those credentials will only be send to the server
-                    // when the server responds with a challenge from the server. Jenkins won't send this challenge as documented
-                    // on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients
-
-                    // We should use the "old fashion" way of setting the header manually
-                    string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", server.UserName, server.ApiToken)));
-                    wc.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
-                }
-
-                Uri baseUri = new Uri(jenkinsServerUrl);
-
-                Task<string> jsonRawDataTask = wc.DownloadStringTaskAsync(new Uri(baseUri, "api/json?pretty=true&tree=views[name,url]"));
-                if (await Task.WhenAny(jsonRawDataTask, Task.Delay(3000)) == jsonRawDataTask)
-                {
-                    overview = JsonConvert.DeserializeObject<JenkinsOverview>(jsonRawDataTask.Result) ?? new JenkinsOverview();
-
-                    string jsonQueueData = await wc.DownloadStringTaskAsync(new Uri(baseUri, "queue/api/json?pretty=true&tree=items[why,task[name,url,color]]"));
-                    queue = JsonConvert.DeserializeObject<JenkinsQueue>(jsonQueueData) ?? new JenkinsQueue();
-
-                    queue.Items = queue.Items ?? new List<ScheduledJob>();
-
-                    object allJobLock = new object();
-                    var allJobs = new List<Job>();
-                    foreach (var view in overview.Views.AsParallel())
+            Uri overviewUri = CreateOverviewUri(jenkinsServerUrl);
+            JenkinsOverview overview = await GetFromJSONData<JenkinsOverview>(server, overviewUri);
+
+            Uri queueUri = CreateQueueUri(jenkinsServerUrl);
+            JenkinsQueue queue = await GetFromJSONData<JenkinsQueue>(server, queueUri);
+
+            queue.Items = queue.Items ?? new List<ScheduledJob>();
+
+            List<Job> allJobs = await GetJobsFromViews(server, overview.Views);
+
+            overview.Jobs = ParseJobs(allJobs, queue);
+
+            return overview;
+        }
+
+        private static async Task<List<Job>> GetJobsFromViews(JenkinsServer server, IEnumerable<View> allViews)
+        {
+            object allJobLock = new object();
+            var allJobs = new List<Job>();
+            foreach (var view in allViews.AsParallel())
+            {
+                view.Url = FixViewUrl(view);
+
+                JenkinsView viewData = await GetJenkinsView(server, view.Url);
+
+                if (viewData == null)
+                    continue;
+
+                foreach (var job in viewData.Jobs)
+                {
+                    // A job can exist in multiple views. We want only one Job object per job, use the Job
+                    // object from the allJobs list if it's already there.
+                    lock (allJobLock)
                     {
-                        // Fix JSON problem which contains wrong url for primary view (is always the base url which contains
-                        // all builds, not just the ones for that view).
-                        if (!view.Url.Contains("/view/"))
+                        // TODO: use Equals override to check for equality?
+                        var allJobsJob = allJobs.FirstOrDefault((j) => string.Equals(j.Url, job.Url));
+                        if (allJobsJob != null)
                         {
-                            view.Url = string.Format("{0}/view/{1}/", view.Url, view.Name);
+                            view.Jobs.Add(allJobsJob);
                         }
-
-                        JenkinsView viewData = await GetJenkinsView(jenkinsServerUrl, view.Url);
-
-                        if (viewData == null) continue;
-
-                        foreach (var job in viewData.Jobs)
+                        else
                         {
-                            lock (allJobLock)
-                            {
-                                var allJobsJob = allJobs.FirstOrDefault((j) => string.Equals(j.Url, job.Url));
-                                if (allJobsJob != null)
-                                {
-                                    view.Jobs.Add(allJobsJob);
-                                }
-                                else
-                                {
-                                    view.Jobs.Add(job);
-                                    allJobs.Add(job);
-                                }
-                            }
+                            view.Jobs.Add(job);
+                            allJobs.Add(job);
                         }
                     }
-
-                    overview.Jobs = ParseJobs(allJobs, queue);
-
-                    return overview;
-                }
-            }
-
-            return new JenkinsOverview();
-        }
-
-        private async static Task<JenkinsView> GetJenkinsView(string jenkinsServerUrl, string viewUrl)
-        {
-            JenkinsView view = null;
-
-            JenkinsServer server = SettingManager.GetJenkinsServer(jenkinsServerUrl);
-
-            if (server == null)
-            {
-                return null;
-            }
-
-            using (WebClient wc = new WebClient())
-            {
-
-                if (!string.IsNullOrWhiteSpace(server.UserName))
-                {
-                    // WebClient.Credentials can not be used, because those credentials will only be send to the server
-                    // when the server responds with a challenge from the server. Jenkins won't send this challenge as documented
-                    // on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients
-
-                    // We should use the "old fashion" way of setting the header manually
-                    string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", server.UserName, server.ApiToken)));
-                    wc.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
-                }
-
-                Uri baseUri = new Uri(viewUrl);
-
-                Task<string> jsonRawDataTask = wc.DownloadStringTaskAsync(new Uri(baseUri, "api/json?pretty=true"));
-
-                if (await Task.WhenAny(jsonRawDataTask, Task.Delay(3000)) == jsonRawDataTask)
-                {
-                    view = JsonConvert.DeserializeObject<JenkinsView>(jsonRawDataTask.Result);
-                }
-            }
-
-            return view ?? new JenkinsView();
+                }
+            }
+
+            return allJobs;
+        }
+
+        private static string FixViewUrl(View view)
+        {
+            // Fix JSON problem which contains wrong url for primary view (is always the base url which contains
+            // all builds, not just the ones for that view).
+            if (!view.Url.ToUpperInvariant().Contains("/VIEW/"))
+            {
+                view.Url = string.Format("{0}/view/{1}/", view.Url, view.Name);
+            }
+
+            return view.Url;
+        }
+
+        private async static Task<JenkinsView> GetJenkinsView(JenkinsServer server, string viewUrl)
+        {
+            Uri viewUri = CreateViewUri(viewUrl);
+            JenkinsView jView = await GetFromJSONData<JenkinsView>(server, viewUri);
+
+            return jView;
         }

         private static IEnumerable<Job> ParseJobs(IEnumerable<Job> jobs, JenkinsQueue queue)
@@ -185,36 +144,87 @@
             return jobs;
         }

-        public async static Task ScheduleJob(string jobUrl, string jenkinsServerUri)
-        {
-            JenkinsServer server = SettingManager.GetJenkinsServer(jenkinsServerUri);
-
-            if (server == null)
-            {
-                return;
-            }
-
-            using (WebClient client = new WebClient())
-            {
-                if (!string.IsNullOrWhiteSpace(server.UserName))
-                {
-                    // WebClient.Credentials can not be used, because those credentials will only be send to the server
-                    // when the server responds with a challenge from the server. Jenkins won't send this challenge as documented
-                    // on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients
-
-                    // We should use the "old fashion" way of setting the header manually
-                    string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", server.UserName, server.ApiToken)));
-                    client.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
-                }
-
-                var jobUri = new Uri(jobUrl);
-                var requestUri = new Uri(jobUri, "build");
-                byte[] response = await client.UploadValuesTaskAsync(requestUri, new NameValueCollection()
+        public async static Task ScheduleJob(string jobUrl, string jenkinsServerUrl)
+        {
+            using (WebClient client = CreateJenkinsWebClient(jenkinsServerUrl))
+            {
+                Uri buildUri = CreateBuildUri(jobUrl);
+                byte[] response = await client.UploadValuesTaskAsync(buildUri, new NameValueCollection()
                    {
                        { "delay", "0sec" }
                    }
                 );
             }
         }
+
+        private static WebClient CreateJenkinsWebClient(string jenkinsServerUrl)
+        {
+            JenkinsServer server = SettingManager.GetJenkinsServer(jenkinsServerUrl);
+
+            return CreateJenkinsWebClient(server);
+        }
+
+        private static WebClient CreateJenkinsWebClient(JenkinsServer server)
+        {
+            WebClient client = new WebClient();
+            if (server != null && !string.IsNullOrWhiteSpace(server.UserName))
+            {
+                // WebClient.Credentials can not be used, because those credentials will only be send to the server
+                // when the server responds with a challenge from the server. Jenkins won't send this challenge as documented
+                // on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients
+
+                // We should use the "old fashion" way of setting the header manually
+                string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", server.UserName, server.ApiToken)));
+                client.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
+            }
+
+            return client;
+        }
+
+        private async static Task<T> GetFromJSONData<T>(string jenkinsServerUrl, Uri jsonDataUri) where T : class
+        {
+            return await GetFromJSONData<T>(SettingManager.GetJenkinsServer(jenkinsServerUrl), jsonDataUri);
+        }
+
+        private async static Task<T> GetFromJSONData<T>(JenkinsServer server, Uri jsonDataUri) where T : class
+        {
+            T deserialisedJsonObject = null;
+
+            using (WebClient wc = CreateJenkinsWebClient(server))
+            {
+                Task<string> jsonRawDataTask = wc.DownloadStringTaskAsync(jsonDataUri);
+
+                if (await Task.WhenAny(jsonRawDataTask, Task.Delay(3000)) == jsonRawDataTask)
+                {
+                    deserialisedJsonObject = JsonConvert.DeserializeObject<T>(jsonRawDataTask.Result);
+                }
+            }
+
+            return deserialisedJsonObject;
+        }
+
+        private static Uri CreateBuildUri(string jobUrl)
+        {
+            var jobUri = new Uri(jobUrl);
+            return new Uri(jobUri, "build");
+        }
+
+        private static Uri CreateOverviewUri(string jenkinsServerUrl)
+        {
+            Uri baseUri = new Uri(jenkinsServerUrl);
+            return new Uri(baseUri, "api/json?pretty=true&tree=views[name,url]");
+        }
+
+        private static Uri CreateQueueUri(string jenkinsServerUrl)
+        {
+            Uri baseUri = new Uri(jenkinsServerUrl);
+            return new Uri(baseUri, "queue/api/json?pretty=true&tree=items[why,task[name,url,color]]");
+        }
+
+        private static Uri CreateViewUri(string jenkinsViewUrl)
+        {
+            Uri viewUri = new Uri(jenkinsViewUrl);
+            return new Uri(viewUri, "api/json?pretty=true");
+        }
     }
 }


Fix file diff of whole file

Fix file diff of whole file

--- GitMind/Utils/Git/Private/GitDiffService2.cs
+++ GitMind/Utils/Git/Private/GitDiffService2.cs
@@ -53,7 +53,7 @@
 		public async Task<R<string>> GetCommitDiffRangeAsync(string sha1, string sha2, CancellationToken ct)
 		{
 			R<CmdResult2> result = await gitCmdService.RunAsync(
-				$"diff --patch  {sha1} {sha2}", ct);
+				$"diff --patch {sha1} {sha2}", ct);

 			if (result.IsFaulted)
 			{
@@ -68,7 +68,7 @@
 		public async Task<R<string>> GetFileDiffAsync(string sha, string path, CancellationToken ct)
 		{
 			R<CmdResult2> result = await gitCmdService.RunAsync(
-				$"show --patch --root  {sha} -- \"{path}\" ", ct);
+				$"show --patch --root --find-renames --unified=100000  {sha} -- \"{path}\" ", ct);

 			if (result.IsFaulted)
 			{
@@ -131,7 +131,7 @@
 			}

 			R<CmdResult2> diffResult = await gitCmdService.RunAsync(
-				$"diff --find-renames --cached -- \"{path}\"", ct);
+				$"diff --find-renames --cached --unified=100000 -- \"{path}\"", ct);
 			if (diffResult.IsFaulted)
 			{
 				return Error.From("Failed to get uncommitted diff", diffResult);


Removed unnecessary, brittle verification checks from unit tests (caused by the static FormatChapterAnnouncement being set in another test).

--- GlyssenEngineTests/Quote/QuoteParserTests.cs
+++ GlyssenEngineTests/Quote/QuoteParserTests.cs
@@ -6645,7 +6645,6 @@
 			Assert.AreEqual("MRK", results[0].BookCode);
 			Assert.AreEqual(1, results[0].ChapterNumber);
 			Assert.AreEqual(0, results[0].InitialStartVerseNumber);
-			Assert.AreEqual("1", results[0].GetText(true));

 			Assert.AreEqual("p", results[1].StyleTag);
 			Assert.AreEqual(1, results[1].ChapterNumber);
@@ -6699,7 +6698,6 @@
 			Assert.AreEqual("MRK", results[0].BookCode);
 			Assert.AreEqual(1, results[0].ChapterNumber);
 			Assert.AreEqual(0, results[0].InitialStartVerseNumber);
-			Assert.AreEqual("1", results[0].GetText(true));

 			Assert.AreEqual("q", results[1].StyleTag);
 			Assert.AreEqual(1, results[1].ChapterNumber);
@@ -6771,7 +6769,6 @@
 			Assert.AreEqual("MRK", results[0].BookCode);
 			Assert.AreEqual(1, results[0].ChapterNumber);
 			Assert.AreEqual(0, results[0].InitialStartVerseNumber);
-			Assert.AreEqual("1", results[0].GetText(true));

 			Assert.AreEqual("p", results[1].StyleTag);
 			Assert.AreEqual(1, results[1].ChapterNumber);
@@ -6826,7 +6823,7 @@
 			Assert.AreEqual("c", results[0].StyleTag);
 			Assert.IsTrue(results[0].IsChapterAnnouncement);
 			Assert.AreEqual("MAT", results[0].BookCode);
-			Assert.AreEqual("9", results[0].GetText(true));
+			Assert.AreEqual(9, results[0].ChapterNumber);

 			Assert.AreEqual("p", results[1].StyleTag);
 			Assert.AreEqual(9, results[1].ChapterNumber);
@@ -6869,7 +6866,7 @@
 			Assert.AreEqual("c", results[0].StyleTag);
 			Assert.IsTrue(results[0].IsChapterAnnouncement);
 			Assert.AreEqual("HEB", results[0].BookCode);
-			Assert.AreEqual("4", results[0].GetText(true));
+			Assert.AreEqual(4, results[0].ChapterNumber);

 			Assert.AreEqual("p", results[1].StyleTag);
 			Assert.AreEqual(4, results[1].ChapterNumber);


Part 2 to fixing closing agents when a region closes.

--- OpenSim/Services/MessagingService/MessagingModules/AgentProcessing/AgentProcessing.cs
+++ OpenSim/Services/MessagingService/MessagingModules/AgentProcessing/AgentProcessing.cs
@@ -251,10 +251,10 @@
             IRegionCapsService fullregionCaps = m_registry.RequestModuleInterface<ICapsService>().GetCapsForRegion(requestingRegion);
             if (fullregionCaps != null)
             {
+                //Now kill the region in the caps Service, DO THIS FIRST, otherwise you get an infinite loop later in the IClientCapsService when it tries to remove itself from the IRegionCapsService
+                m_registry.RequestModuleInterface<ICapsService>().RemoveCapsForRegion(requestingRegion);
                 //Close all regions and remove them from the region
                 fullregionCaps.Close();
-                //Now kill the region in the caps Service
-                m_registry.RequestModuleInterface<ICapsService>().RemoveCapsForRegion(requestingRegion);
             }
         }


AppendQuotedEscaped

AppendQuotedEscaped

--- Gu.Roslyn.Asserts/Ast/SyntaxFactoryWriter.cs
+++ Gu.Roslyn.Asserts/Ast/SyntaxFactoryWriter.cs
@@ -197,7 +197,10 @@

                     if (new System.Xml.Linq.XText(token.ValueText).ToString() == token.Text)
                     {
-                        return this.Append($"SyntaxFactory.XmlTextLiteral(\"{token.Text}\")");
+                        this.writer.Append($"SyntaxFactory.XmlTextLiteral(")
+                            .AppendQuotedEscaped(token.Text)
+                            .Append(")");
+                        return this;
                     }

                     return this.AppendLine("SyntaxFactory.XmlTextLiteral(")
@@ -508,29 +511,10 @@
         private SyntaxFactoryWriter WriteArgument(string parameter, string text, bool closeArgumentList = false)
         {
             _ = this.writer
-                    .WriteArgumentStart(parameter)
-                    .Append("\"");
-            foreach (var c in text)
-            {
-                switch (c)
-                {
-                    case '\r':
-                        this.writer.Append("\\r");
-                        continue;
-                    case '\n':
-                        this.writer.Append("\\n");
-                        continue;
-                    case '\\':
-                    case '"':
-                        this.writer.Append('\\');
-                        break;
-                }
-
-                this.writer.Append(c);
-            }
-
-            return this.Append("\"")
-                      .WriteArgumentEnd(closeArgumentList);
+                       .WriteArgumentStart(parameter)
+                       .AppendQuotedEscaped(text)
+                       .WriteArgumentEnd(closeArgumentList);
+            return this;
         }

         private SyntaxFactoryWriter WriteArgument(string parameter, bool value, bool closeArgumentList = false)
@@ -598,8 +582,40 @@
                     this.builder.Append(this.indentation);
                 }

+                this.newLine = false;
                 this.builder.Append(text);
+                return this;
+            }
+
+            public Writer AppendQuotedEscaped(string text)
+            {
+                if (this.newLine)
+                {
+                    this.builder.Append(this.indentation);
+                }
+
                 this.newLine = false;
+                this.builder.Append("\"");
+                foreach (var c in text)
+                {
+                    switch (c)
+                    {
+                        case '\r':
+                            this.builder.Append("\\r");
+                            continue;
+                        case '\n':
+                            this.builder.Append("\\n");
+                            continue;
+                        case '\\':
+                        case '"':
+                            this.builder.Append('\\');
+                            break;
+                    }
+
+                    this.builder.Append(c);
+                }
+
+                this.builder.Append("\"");
                 return this;
             }


Remove unused.

Remove unused.

--- Gu.Roslyn.Asserts/Internals/IdAndPosition.cs
+++ Gu.Roslyn.Asserts/Internals/IdAndPosition.cs
@@ -1,102 +0,0 @@
-namespace Gu.Roslyn.Asserts.Internals
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Linq;
-    using Microsoft.CodeAnalysis;
-
-    /// <summary>
-    /// Metadata about a diagnostic
-    /// </summary>
-    [DebuggerDisplay("{this.Id} {this.Span}")]
-    [Obsolete("Use ExpectedDiagnostic")]
-    internal struct IdAndPosition : IEquatable<IdAndPosition>
-    {
-        private IdAndPosition(string id, FileLinePositionSpan span)
-        {
-            this.Id = id;
-            this.Span = span;
-        }
-
-        /// <summary>
-        /// Gets the id of the diagnostic.
-        /// </summary>
-        public string Id { get; }
-
-        /// <summary>
-        /// Gets the position of the diagnostic.
-        /// </summary>
-        public FileLinePositionSpan Span { get; }
-
-        public static bool operator ==(IdAndPosition left, IdAndPosition right)
-        {
-            return left.Equals(right);
-        }
-
-        public static bool operator !=(IdAndPosition left, IdAndPosition right)
-        {
-            return !left.Equals(right);
-        }
-
-        /// <summary>
-        /// Create an instance of <see cref="IdAndPosition"/>
-        /// </summary>
-        /// <returns>An instance of <see cref="IdAndPosition"/></returns>
-        public static IdAndPosition Create(Diagnostic diagnostic)
-        {
-            return new IdAndPosition(diagnostic.Id, diagnostic.Location.GetMappedLineSpan());
-        }
-
-        /// <summary>
-        /// Create an instance of <see cref="IdAndPosition"/>
-        /// </summary>
-        /// <returns>An instance of <see cref="IdAndPosition"/></returns>
-        public static IdAndPosition Create(ExpectedDiagnostic x)
-        {
-            return new IdAndPosition(x.Id, x.Span);
-        }
-
-        /// <inheritdoc />
-        public bool Equals(IdAndPosition other)
-        {
-            bool EndPositionsEquals(FileLinePositionSpan x, FileLinePositionSpan y)
-            {
-                if (x.StartLinePosition == x.EndLinePosition ||
-                    y.StartLinePosition == y.EndLinePosition)
-                {
-                    return true;
-                }
-
-                return x.EndLinePosition == y.EndLinePosition;
-            }
-
-            return string.Equals(this.Id, other.Id) &&
-                   string.Equals(this.Span.Path, other.Span.Path) &&
-                   this.Span.StartLinePosition == other.Span.StartLinePosition &&
-                   EndPositionsEquals(this.Span, other.Span);
-        }
-
-        /// <inheritdoc />
-        public override bool Equals(object obj)
-        {
-            if (ReferenceEquals(null, obj))
-            {
-                return false;
-            }
-
-            return obj is IdAndPosition position && this.Equals(position);
-        }
-
-        /// <inheritdoc />
-        public override int GetHashCode()
-        {
-            unchecked
-            {
-                return (this.Id.GetHashCode() * 397) ^
-                       this.Span.Path.GetHashCode() ^
-                       this.Span.StartLinePosition.GetHashCode();
-            }
-        }
-    }
-}


OpenCover fix.

OpenCover fix.

--- Heleonix.Build.Tests/Tasks/OpenCoverTests.cs
+++ Heleonix.Build.Tests/Tasks/OpenCoverTests.cs
@@ -103,24 +103,24 @@
             {
                 targetType = nameof(NUnit);

-                And("target exe is not specified", () =>
+                And("PDB search dirs are specified", () =>
                 {
-                    targetExe = "HX_NO_TARGET";
+                    pdbSearchDirs = simulatorHelper.TestPublishDirs
+                        .Select(dir => new TaskItem(dir)).ToArray();

-                    Should("fail", () =>
+                    And("target exe is invalid", () =>
                     {
-                        Assert.That(succeeded, Is.False);
+                        targetExe = "HX_NO_TARGET";
+
+                        Should("fail", () =>
+                        {
+                            Assert.That(succeeded, Is.False);
+                        });
                     });
-                });

-                And("target exe is specified", () =>
-                {
-                    targetExe = PathHelper.NUnitConsoleExe;
-
-                    And("PDB search dirs are specified", () =>
+                    And("target exe is specified", () =>
                     {
-                        pdbSearchDirs = simulatorHelper.TestPublishDirs
-                            .Select(dir => new TaskItem(dir)).ToArray();
+                        targetExe = PathHelper.NUnitConsoleExe;

                         And("source code should pass coverage threshold", () =>
                         {


Special case for the processing of rating's date was handled

--- HiP-DataStore/Core/WriteModel/RatingIndex.cs
+++ HiP-DataStore/Core/WriteModel/RatingIndex.cs
@@ -126,12 +126,11 @@
         /// <returns>The last month rating</returns>
         public double CalculateLastMonthAverageRating()
         {
-            var nowDate = DateTimeOffset.Now;
             double lastMonthTotalRating = 0, lastMonthAverage = 0;
             int counter = 0;
             foreach (var rateStruct in _allRates)
             {
-                if (rateStruct.Value.RateDate.Month == (nowDate.Month - 1) && rateStruct.Value.RateDate.Year == nowDate.Year)
+                if (CheckIfRatingIsLastMonthRating(rateStruct.Value.RateDate))
                 {
                     counter++;
                     lastMonthTotalRating += rateStruct.Value.Rate;
@@ -140,6 +139,17 @@
             if (counter > 0)
                 lastMonthAverage = lastMonthTotalRating / counter;
             return lastMonthAverage;
+        }
+
+        private bool CheckIfRatingIsLastMonthRating(DateTimeOffset ratingDate)
+        {
+            var nowDate = DateTimeOffset.Now;
+            if (nowDate.Month == 1 && ratingDate.Month == 12 && ratingDate.Year == (nowDate.Year - 1))
+                return true;
+            else if (ratingDate.Month == (nowDate.Month - 1) && ratingDate.Year == nowDate.Year)
+                return true;
+            else
+                return false;
         }

         bool CalculateAverageRating(int? oldRate, int newRate)


Use Closed event

Use Closed event

--- KinectSample/DepthMonitor/MainWindow.xaml.cs
+++ KinectSample/DepthMonitor/MainWindow.xaml.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Linq;
 using System.Reactive.Linq;
 using System.Text;
@@ -43,7 +42,7 @@
             InitializeComponent();

             Loaded += MainWindow_Loaded;
-            Closing += MainWindow_Closing;
+            Closed += MainWindow_Closed;
         }

         void MainWindow_Loaded(object sender, RoutedEventArgs e)
@@ -68,7 +67,7 @@
                 .Subscribe(d => depthBitmap.WritePixels(bitmapRect, d, bitmapStride, 0));
         }

-        void MainWindow_Closing(object sender, CancelEventArgs e)
+        void MainWindow_Closed(object sender, EventArgs e)
         {
             if (framesInterval != null) framesInterval.Dispose();
             if (sensor != null) sensor.Stop();


Changed TryChangeValue and TrySetValue behavior, added silent error logging

--- LeftosCommonLibrary/LCL.GenericExtensions.cs
+++ LeftosCommonLibrary/LCL.GenericExtensions.cs
@@ -22,6 +22,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Diagnostics;
 using System.IO;
 using System.Reflection;
 using System.Runtime.Serialization;
@@ -50,7 +51,11 @@
             }
             catch (InvalidCastException)
             {
-                variable = default(T);
+                Trace.WriteLine(string.Format("{2}: InvalidCastException for key {0} with value {1}", key, dict[key], DateTime.Now));
+            }
+            catch (FormatException)
+            {
+                Trace.WriteLine(string.Format("{2}: FormatException for key {0} with value {1}", key, dict[key], DateTime.Now));
             }
             catch (KeyNotFoundException)
             {
@@ -135,7 +140,7 @@
         /// <returns>The value that the variable should be set to if the operation succeeds.
         /// If the cast is invalid, it returns the default value of the type.
         /// If the key isn't found, it returns the original value of the variable.</returns>
-        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key)
+        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key, bool onErrorRemain = false)
         {
             try
             {
@@ -150,7 +155,15 @@
             }
             catch (InvalidCastException)
             {
-                return default(T);
+                Trace.WriteLine(string.Format("{2}: InvalidCastException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
+            }
+            catch (FormatException)
+            {
+                Trace.WriteLine(string.Format("{2}: FormatException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
             }
             catch (KeyNotFoundException)
             {
@@ -169,7 +182,7 @@
         /// <returns>The value that the variable should be set to if the operation succeeds.
         /// If the cast is invalid, it returns the default value of the type.
         /// If the key isn't found, it returns the original value of the variable.</returns>
-        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key, Type type)
+        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key, Type type, bool onErrorRemain = false)
         {
             try
             {
@@ -178,7 +191,15 @@
             }
             catch (InvalidCastException)
             {
-                return default(T);
+                Trace.WriteLine(string.Format("{2}: InvalidCastException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
+            }
+            catch (FormatException)
+            {
+                Trace.WriteLine(string.Format("{2}: FormatException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
             }
             catch (KeyNotFoundException)
             {
@@ -199,7 +220,7 @@
         /// <returns>The value that the variable should be set to if the operation succeeds.
         /// If the cast is invalid, it returns the default value of the type.
         /// If the key isn't found, it returns the original value of the variable.</returns>
-        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key, Type type, string splitCharacter)
+        public static T TrySetValue<T>(this T variable, Dictionary<string, string> dict, string key, Type type, string splitCharacter, bool onErrorRemain = false)
         {
             try
             {
@@ -213,7 +234,15 @@
             }
             catch (InvalidCastException)
             {
-                return default(T);
+                Trace.WriteLine(string.Format("{2}: InvalidCastException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
+            }
+            catch (FormatException)
+            {
+                Trace.WriteLine(string.Format("{2}: FormatException for key {0} with value '{1}'", key, dict[key], DateTime.Now));
+                if (onErrorRemain) return variable;
+                else return default(T);
             }
             catch (KeyNotFoundException)
             {


Delete SequenceOfCommands_broken.cs

Delete SequenceOfCommands_broken.cs


Double check in recovery #682

Double check in recovery #682

--- LiteDB/Engine/Services/TransactionService.cs
+++ LiteDB/Engine/Services/TransactionService.cs
@@ -104,6 +104,11 @@

             using (_locker.Write())
             {
+                // double check in header need recovery (could be already recover from another thread)
+                var header = BasePage.ReadPage(_disk.ReadPage(0)) as HeaderPage;
+
+                if (header.Recovery == false) return;
+
                 // read all journal pages
                 foreach (var buffer in _disk.ReadJournal(lastPageID))
                 {


Wrote test for undo

Wrote test for undo

--- SafetyCheckingTests/MarkovDecisionProcess/LtmdpContinuationDistributionMapperTests.cs
+++ SafetyCheckingTests/MarkovDecisionProcess/LtmdpContinuationDistributionMapperTests.cs
@@ -166,5 +166,74 @@
 			existingDistributions.ShouldContainKey(0);
 			existingDistributions.ShouldContainKey(1);
 		}
+
+		[Fact(Skip = "Not implemented, yet")]
+		public void TwoDistributionWithFiveContinuationsAfterTwoSplitsWithRemove()
+		{
+			_mapper.AddInitialDistributionAndContinuation();
+			_mapper.ProbabilisticSplit(0, 1, 3);
+			_mapper.NonDeterministicSplit(1, 4, 5);
+
+			// simulate undo of probabilistic split (2 and 3 should not be executed anymore)
+			_mapper.RemoveCidInDistributions(2);
+			_mapper.RemoveCidInDistributions(3);
+
+
+			var existingDistributions = new Dictionary<int, bool>();
+			var entries = CountEntriesAndAddDistributionsToMap(0, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(1, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(2, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(3, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(4, existingDistributions);
+			entries.ShouldBe(1);
+
+			entries = CountEntriesAndAddDistributionsToMap(5, existingDistributions);
+			entries.ShouldBe(1);
+
+			existingDistributions.Count.ShouldBe(2);
+			existingDistributions.ShouldContainKey(0);
+			existingDistributions.ShouldContainKey(1);
+		}
+
+		[Fact(Skip = "Not implemented, yet")]
+		public void TwoDistributionWithFiveContinuationsAfterTwoSplitsWithRemove2()
+		{
+			_mapper.AddInitialDistributionAndContinuation();
+			_mapper.ProbabilisticSplit(0, 1, 3);
+			_mapper.NonDeterministicSplit(1, 4, 5);
+
+			// simulate undo of nondeterministic split (5 should not be executed anymore)
+			_mapper.RemoveDistributionsWithCid(5);
+
+			var existingDistributions = new Dictionary<int, bool>();
+			var entries = CountEntriesAndAddDistributionsToMap(0, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(1, existingDistributions);
+			entries.ShouldBe(0);
+
+			entries = CountEntriesAndAddDistributionsToMap(2, existingDistributions);
+			entries.ShouldBe(1);
+
+			entries = CountEntriesAndAddDistributionsToMap(3, existingDistributions);
+			entries.ShouldBe(1);
+
+			entries = CountEntriesAndAddDistributionsToMap(4, existingDistributions);
+			entries.ShouldBe(1);
+
+			entries = CountEntriesAndAddDistributionsToMap(5, existingDistributions);
+			entries.ShouldBe(0);
+
+			existingDistributions.Count.ShouldBe(1);
+			existingDistributions.ShouldContainKey(0);
+		}
 	}
 }


Assembly Info Updated

Assembly Info Updated

--- MailChimp.Api.Net/Properties/AssemblyInfo.cs
+++ MailChimp.Api.Net/Properties/AssemblyInfo.cs
@@ -6,11 +6,11 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("MailChimp.Api.Net")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("Building the .Net wrapper for Mailchimp version 3.0 ")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Shahriar Hossain")]
 [assembly: AssemblyProduct("MailChimp.Api.Net")]
-[assembly: AssemblyCopyright("Copyright ©  2015")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Amended layout

Amended layout

--- MainApp/DailyHours/frmDailyHours.Designer.cs
+++ MainApp/DailyHours/frmDailyHours.Designer.cs
@@ -120,7 +120,7 @@
             this.dGridLogs.Name = "dGridLogs";
             this.dGridLogs.RowTemplate.ReadOnly = true;
             this.dGridLogs.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.dGridLogs.Size = new System.Drawing.Size(917, 406);
+            this.dGridLogs.Size = new System.Drawing.Size(1126, 469);
             this.dGridLogs.TabIndex = 41;
             this.dGridLogs.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGridLogs_CellDoubleClick);
             this.dGridLogs.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dGridLogs_DataBindingComplete);
@@ -128,7 +128,6 @@
             //
             // btnManuaTrackerEntry
             //
-            this.btnManuaTrackerEntry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.btnManuaTrackerEntry.Location = new System.Drawing.Point(31, 132);
             this.btnManuaTrackerEntry.Name = "btnManuaTrackerEntry";
             this.btnManuaTrackerEntry.Size = new System.Drawing.Size(151, 30);
@@ -171,7 +170,7 @@
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(990, 633);
+            this.ClientSize = new System.Drawing.Size(1169, 649);
             this.Controls.Add(this.btnDecrementDayByOne);
             this.Controls.Add(this.txtHoursRecorded);
             this.Controls.Add(this.label2);


Update ResilientHandle model adapter to pass in credential while deleting file

--- TestSuites/FileServer/src/SMB2Model/Adapter/ResilientHandle/ResilientHandleAdapter.cs
+++ TestSuites/FileServer/src/SMB2Model/Adapter/ResilientHandle/ResilientHandleAdapter.cs
@@ -46,7 +46,13 @@
             }

             // delete created file
-            File.Delete(string.Format("\\\\{0}\\{1}\\{2}", testConfig.SutComputerName, testConfig.BasicFileShare, fileName));
+            try
+            {
+                sutProtocolController.DeleteFile(string.Format("\\\\{0}\\{1}", testConfig.SutComputerName, testConfig.BasicFileShare), fileName);
+            }
+            catch
+            {
+            }

             base.Reset();
         }


Fixed link to options on minigame page.

Fixed link to options on minigame page.

--- WebApp/ToTheRescueWebApplication/ToTheRescueWebApplication/Views/Play/MiniGame.cshtml
+++ WebApp/ToTheRescueWebApplication/ToTheRescueWebApplication/Views/Play/MiniGame.cshtml
@@ -51,7 +51,7 @@

                 @if (User.Identity.IsAuthenticated)
                 {
-
+

                 }


Changed Artist and Album to be containers

Changed Artist and Album to be containers instead of Items, having them
as Items was definitely incorrect. Hopefully this will improve behaviour
in Xbox360 Music App and VLC, WPM was fine beforehand.

--- MediaBrowser.Plugins.Dlna/Model/ModelBase.cs
+++ MediaBrowser.Plugins.Dlna/Model/ModelBase.cs
@@ -717,12 +717,17 @@
         {
             get { return this.MediaItem; }
         }
-        internal Platinum.MediaItem MediaItem
-        {
-            get
-            {
-                var result = MediaItemHelper.GetMediaItem(this.MBItem);
-                result.ParentID = this.ParentId;
+        internal Platinum.MediaContainer MediaItem
+        {
+            get
+            {
+                var result = new Platinum.MediaContainer();
+                result.ObjectID = this.Id;
+                result.ParentID = this.ParentId;
+                result.Class = new Platinum.ObjectClass("object.container.person.musicArtist", "");
+                result.Title = this.MBItem.Name;
+                result.Description.DescriptionText = this.MBItem.Name;
+                result.Description.LongDescriptionText = this.MBItem.Name;
                 return result;
             }
         }
@@ -759,12 +764,17 @@
         {
             get { return this.MediaItem; }
         }
-        internal Platinum.MediaItem MediaItem
-        {
-            get
-            {
-                var result = MediaItemHelper.GetMediaItem(this.MBItem);
-                result.ParentID = this.ParentId;
+        internal Platinum.MediaContainer MediaItem
+        {
+            get
+            {
+                var result = new Platinum.MediaContainer();
+                result.ObjectID = this.Id;
+                result.ParentID = this.ParentId;
+                result.Class = new Platinum.ObjectClass("object.container.album.musicAlbum", "");
+                result.Title = this.MBItem.Name;
+                result.Description.DescriptionText = this.MBItem.Name;
+                result.Description.LongDescriptionText = this.MBItem.Name;
                 return result;
             }
         }


Fix not firing MouseUpExt event after doubleclick

--- MouseKeyHook/Implementation/MouseListener.cs
+++ MouseKeyHook/Implementation/MouseListener.cs
@@ -135,6 +135,7 @@
             {
                 e = e.ToDoubleClickEventArgs();
                 OnUp(e);
+                OnUpExt(e);
                 OnDoubleClick(e);
                 m_DoubleDown.Remove(e.Button);
             }


Test changes.

Test changes.

--- MvcCodeRouting.Tests/Routing/RoutingFacts.cs
+++ MvcCodeRouting.Tests/Routing/RoutingFacts.cs
@@ -145,7 +145,7 @@
       }

       [TestMethod]
-      public void ConstraintForOptionalParameterShouldMatchAnEmptyString() {
+      public void ConstraintForOptionalParameterShouldMatchAnEmptyStringIfDefaultValueIsEmptyString() {

          routes.Clear();
          routes.MapRoute(null, "{a}", new { a = "" }, new { a = "b" });
@@ -157,8 +157,21 @@

          Assert.IsNull(routes.GetRouteData(httpContextMock.Object));

+         //--------------------------------------
+
          routes.Clear();
          routes.MapRoute(null, "{a}", new { a = "" }, new { a = "(b)?" });
+
+         Assert.AreEqual(Url.RouteUrl(new { a = "" }), "/");
+
+         httpContextMock.Setup(c => c.Request.AppRelativeCurrentExecutionFilePath).Returns("~/");
+
+         Assert.IsNotNull(routes.GetRouteData(httpContextMock.Object));
+
+         //--------------------------------------
+
+         routes.Clear();
+         routes.MapRoute(null, "{a}", new { a = "b" }, new { a = "b" });

          Assert.AreEqual(Url.RouteUrl(new { a = "" }), "/");


version upped

version upped

--- NadekoBot.Core/Services/Impl/StatsService.cs
+++ NadekoBot.Core/Services/Impl/StatsService.cs
@@ -21,7 +21,7 @@
         private readonly IBotCredentials _creds;
         private readonly DateTime _started;

-        public const string BotVersion = "2.1.4";
+        public const string BotVersion = "2.2.0";

         public string Author => "Kwoth#2560";
         public string Library => "Discord.Net";


Correct AddToLists test

Correct AddToLists test

--- NameParser/NameParserTest/NameParserTests.cs
+++ NameParser/NameParserTest/NameParserTests.cs
@@ -356,7 +356,7 @@

             HumanName.Suffixes.Add("2nd");
-            var with_2nd = new HumanName("Mr. John Smith the 2nd");
+            var with_2nd = new HumanName("Mr. John Smith 2nd");
             Assert.AreEqual("Mr.", with_2nd.Title);
             Assert.AreEqual("John", with_2nd.First);
             Assert.AreEqual("Smith", with_2nd.Last);


make sure IPoolable is implemented

make sure IPoolable is implemented

--- Nez-PCL/Utils/Coroutines/CoroutineManager.cs
+++ Nez-PCL/Utils/Coroutines/CoroutineManager.cs
@@ -40,7 +40,7 @@
 			}

-			internal void reset()
+			void IPoolable.reset()
 			{
 				isDone = true;
 				waitTimer = 0;


Don't write to console by default.

Don't write to console by default.

--- Nito.BrowserBoss/Nito.BrowserBoss/Session.cs
+++ Nito.BrowserBoss/Nito.BrowserBoss/Session.cs
@@ -28,7 +28,6 @@
             Browser = browser;
             Finders = FindExtensions.DefaultFinders().ToList();
             Timeout = TimeSpan.FromSeconds(30);
-            Logger = new ConsoleLogger();
         }

         /// <summary>


Update der Physik ausgelagert

Update der Physik ausgelagert

--- OctoAwesome/OctoAwesome.Runtime/ActorHost.cs
+++ OctoAwesome/OctoAwesome.Runtime/ActorHost.cs
@@ -48,65 +48,22 @@
             });
         }

+
+
         public void Update(GameTime frameTime)
         {
-            if (!Player.FlyMode)
-            {
-                Player.ExternalForce = new Vector3(0, 0, -20f) * Player.Mass;
-            }
-            else
-            {
-                Player.ExternalForce = Vector3.Zero;
-            }
-
             #region Inputverarbeitung
-
-            Vector3 externalPower = ((Player.ExternalForce * Player.ExternalForce) / (2 * Player.Mass)) * (float)frameTime.ElapsedGameTime.TotalSeconds;
-            externalPower *= new Vector3(Math.Sign(Player.ExternalForce.X), Math.Sign(Player.ExternalForce.Y), Math.Sign(Player.ExternalForce.Z));

             // Input verarbeiten
             Player.Angle += (float)frameTime.ElapsedGameTime.TotalSeconds * Head.X;
             Player.Tilt += (float)frameTime.ElapsedGameTime.TotalSeconds * Head.Y;
             Player.Tilt = Math.Min(1.5f, Math.Max(-1.5f, Player.Tilt));

-            float lookX = (float)Math.Cos(Player.Angle);
-            float lookY = -(float)Math.Sin(Player.Angle);
-            var VelocityDirection = new Vector3(lookX, lookY, 0) * Move.Y;
-
-            float stafeX = (float)Math.Cos(Player.Angle + MathHelper.PiOver2);
-            float stafeY = -(float)Math.Sin(Player.Angle + MathHelper.PiOver2);
-            VelocityDirection += new Vector3(stafeX, stafeY, 0) * Move.X;
-
-            Vector3 Friction = new Vector3(1, 1, 0.1f) * Player.FRICTION;
-            Vector3 powerdirection = new Vector3();
-
-            if (Player.FlyMode)
-            {
-                VelocityDirection += new Vector3(0, 0, (float)Math.Sin(Player.Tilt) * Move.Y);
-                Friction = Vector3.One * Player.FRICTION;
-            }
-
-            powerdirection += externalPower;
-            powerdirection += (Player.POWER * VelocityDirection);
-            // if (OnGround && input.JumpTrigger)
-            if (lastJump)
-            {
-                lastJump = false;
-                Vector3 jumpDirection = new Vector3(lookX, lookY, 0f) * Move.Y * 0.1f;
-                jumpDirection.Z = 1f;
-                jumpDirection.Normalize();
-                powerdirection += jumpDirection * Player.JUMPPOWER;
-            }
-
-
-
-            Vector3 VelocityChange = (2.0f / Player.Mass * (powerdirection - Friction * Player.Velocity)) *
-                (float)frameTime.ElapsedGameTime.TotalSeconds;
-
-            Player.Velocity += new Vector3(
-                (float)(VelocityChange.X < 0 ? -Math.Sqrt(-VelocityChange.X) : Math.Sqrt(VelocityChange.X)),
-                (float)(VelocityChange.Y < 0 ? -Math.Sqrt(-VelocityChange.Y) : Math.Sqrt(VelocityChange.Y)),
-                (float)(VelocityChange.Z < 0 ? -Math.Sqrt(-VelocityChange.Z) : Math.Sqrt(VelocityChange.Z)));
+            #endregion
+
+            #region Physik
+
+            PhysicalUpdate(frameTime.ElapsedGameTime, !Player.FlyMode);

             #endregion

@@ -308,6 +265,62 @@
             #endregion
         }

+        public void PhysicalUpdate(TimeSpan elapsedtime,bool gravity)
+        {
+            Vector3 exforce = Player.ExternalForce;
+
+            if (gravity)
+            {
+                exforce += new Vector3(0, 0, -20f) * Player.Mass;
+            }
+
+
+
+            Vector3 externalPower = ((exforce * exforce) / (2 * Player.Mass)) * (float)elapsedtime.TotalSeconds;
+            externalPower *= new Vector3(Math.Sign(Player.ExternalForce.X), Math.Sign(Player.ExternalForce.Y), Math.Sign(Player.ExternalForce.Z));
+
+
+            float lookX = (float)Math.Cos(Player.Angle);
+            float lookY = -(float)Math.Sin(Player.Angle);
+            var VelocityDirection = new Vector3(lookX, lookY, 0) * Move.Y;
+
+            float stafeX = (float)Math.Cos(Player.Angle + MathHelper.PiOver2);
+            float stafeY = -(float)Math.Sin(Player.Angle + MathHelper.PiOver2);
+            VelocityDirection += new Vector3(stafeX, stafeY, 0) * Move.X;
+
+            Vector3 Friction = new Vector3(1, 1, 0.1f) * Player.FRICTION;
+            Vector3 powerdirection = new Vector3();
+
+            if (Player.FlyMode)
+            {
+                VelocityDirection += new Vector3(0, 0, (float)Math.Sin(Player.Tilt) * Move.Y);
+                Friction = Vector3.One * Player.FRICTION;
+            }
+
+            powerdirection += externalPower;
+            powerdirection += (Player.POWER * VelocityDirection);
+            // if (OnGround && input.JumpTrigger)
+            if (lastJump)
+            {
+                lastJump = false;
+                Vector3 jumpDirection = new Vector3(lookX, lookY, 0f) * Move.Y * 0.1f;
+                jumpDirection.Z = 1f;
+                jumpDirection.Normalize();
+                powerdirection += jumpDirection * Player.JUMPPOWER;
+            }
+
+
+
+            Vector3 VelocityChange = (2.0f / Player.Mass * (powerdirection - Friction * Player.Velocity)) *
+                (float)elapsedtime.TotalSeconds;
+
+            Player.Velocity += new Vector3(
+                (float)(VelocityChange.X < 0 ? -Math.Sqrt(-VelocityChange.X) : Math.Sqrt(VelocityChange.X)),
+                (float)(VelocityChange.Y < 0 ? -Math.Sqrt(-VelocityChange.Y) : Math.Sqrt(VelocityChange.Y)),
+                (float)(VelocityChange.Z < 0 ? -Math.Sqrt(-VelocityChange.Z) : Math.Sqrt(VelocityChange.Z)));
+
+        }
+
         internal void Unload()
         {
             localChunkCache.Flush();


fixed error in unit test

fixed error in unit test

--- Octokit.Tests/Clients/ReleasesClientTests.cs
+++ Octokit.Tests/Clients/ReleasesClientTests.cs
@@ -214,7 +214,7 @@
             }

             [Fact]
-            public async Task EnsuresArgumentsNotNull()
+            public async Task EnsuresNonNullArguments()
             {
                 var releasesClient = new ReleasesClient(Substitute.For<IApiConnection>());
                 Assert.Throws<ArgumentNullException>(() => new NewRelease(null));