Issue #AR-1_serialization: fix tests that were failing due to changes in line-end encodings.

--- app/Umbraco/Archetype.Tests/Serialization/JsonTestStrings.cs
+++ app/Umbraco/Archetype.Tests/Serialization/JsonTestStrings.cs
@@ -2,432 +2,432 @@
 {
     public class JsonTestStrings
     {
-        public const string _MERGER_DETAILS_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""mergerDetails"",
-      ""properties"": [
-        {
-          ""alias"": ""MergerDate"",
-          ""value"": ""07/06/2014 08:09:10""
-        }
-      ]
-    }
-  ]
-}";
-
-        public const string _ANNUAL_STATEMENT_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""annualStatement"",
-      ""properties"": [
-        {
-          ""alias"": ""FiscalYearStart"",
-          ""value"": ""01/09/2013 00:00:00""
-        },
-        {
-          ""alias"": ""FiscalYearEnd"",
-          ""value"": ""31/08/2014 00:00:00""
-        },
-        {
-          ""alias"": ""DividendPaymentDate"",
-          ""value"": """"
-        },
-        {
-          ""alias"": ""TotalShares"",
-          ""value"": ""345678""
-        },
-        {
-          ""alias"": ""Sales"",
-          ""value"": ""123456700.89""
-        },
-        {
-          ""alias"": ""Profit"",
-          ""value"": ""1123456.78""
-        }
-      ]
-    }
-  ]
-}";
-
-        public const string _CONTACT_DETAILS_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""contactDetails"",
-      ""properties"": [
-        {
-          ""alias"": ""name"",
-          ""value"": ""Test""
-        },
-        {
-          ""alias"": ""address"",
-          ""value"": ""Test Address""
-        },
-        {
-          ""alias"": ""telephone"",
-          ""value"": ""111""
-        },
-        {
-          ""alias"": ""mobile"",
-          ""value"": ""000""
-        },
-        {
-          ""alias"": ""fax"",
-          ""value"": ""000""
-        },
-        {
-          ""alias"": ""email"",
-          ""value"": ""test@test.com""
-        },
-        {
-          ""alias"": ""webSite"",
-          ""value"": {
-            ""fieldsets"": [
-              {
-                ""alias"": ""urlPicker"",
-                ""properties"": [
-                  {
-                    ""alias"": ""title"",
-                    ""value"": ""The Test Company""
-                  },
-                  {
-                    ""alias"": ""url"",
-                    ""value"": ""http://test.com""
-                  },
-                  {
-                    ""alias"": ""content"",
-                    ""value"": """"
-                  },
-                  {
-                    ""alias"": ""media"",
-                    ""value"": """"
-                  },
-                  {
-                    ""alias"": ""openInNewWindow"",
-                    ""value"": ""1""
-                  }
-                ]
-              }
-            ]
-          }
-        }
-      ]
-    }
-  ]
-}";
-
-        public const string _COMPANY_DETAILS_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""companyDetails"",
-      ""properties"": [
-        {
-          ""alias"": ""region"",
-          ""value"": ""Test Region""
-        },
-        {
-          ""alias"": ""contactDetails"",
-          ""value"": {
-            ""fieldsets"": [
-              {
-                ""alias"": ""contactDetails"",
-                ""properties"": [
-                  {
-                    ""alias"": ""name"",
-                    ""value"": ""Test""
-                  },
-                  {
-                    ""alias"": ""address"",
-                    ""value"": ""Test Address""
-                  },
-                  {
-                    ""alias"": ""telephone"",
-                    ""value"": ""111""
-                  },
-                  {
-                    ""alias"": ""mobile"",
-                    ""value"": ""000""
-                  },
-                  {
-                    ""alias"": ""fax"",
-                    ""value"": ""000""
-                  },
-                  {
-                    ""alias"": ""email"",
-                    ""value"": ""test@test.com""
-                  },
-                  {
-                    ""alias"": ""webSite"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""urlPicker"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""title"",
-                              ""value"": ""The Test Company""
-                            },
-                            {
-                              ""alias"": ""url"",
-                              ""value"": ""http://test.com""
-                            },
-                            {
-                              ""alias"": ""content"",
-                              ""value"": """"
-                            },
-                            {
-                              ""alias"": ""media"",
-                              ""value"": """"
-                            },
-                            {
-                              ""alias"": ""openInNewWindow"",
-                              ""value"": ""1""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  }
-                ]
-              }
-            ]
-          }
-        }
-      ]
-    }
-  ]
-}";
-
-        public const string _PAGE_DETAILS_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""pages"",
-      ""properties"": [
-        {
-          ""alias"": ""pages"",
-          ""value"": ""2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453""
-        }
-      ]
-    },
-    {
-      ""alias"": ""captions"",
-      ""properties"": [
-        {
-          ""alias"": ""captions"",
-          ""value"": {
-            ""fieldsets"": [
-              {
-                ""alias"": ""textstringArray"",
-                ""properties"": [
-                  {
-                    ""alias"": ""textstring"",
-                    ""value"": ""First Page""
-                  }
-                ]
-              },
-              {
-                ""alias"": ""textstringArray"",
-                ""properties"": [
-                  {
-                    ""alias"": ""textstring"",
-                    ""value"": ""Second Page""
-                  }
-                ]
-              },
-              {
-                ""alias"": ""textstringArray"",
-                ""properties"": [
-                  {
-                    ""alias"": ""textstring"",
-                    ""value"": ""Third Page""
-                  }
-                ]
-              },
-              {
-                ""alias"": ""textstringArray"",
-                ""properties"": [
-                  {
-                    ""alias"": ""textstring"",
-                    ""value"": ""Fourth Page""
-                  }
-                ]
-              }
-            ]
-          }
-        }
-      ]
-    }
-  ]
-}";
-
-        public const string _PAGES_JSON =
-            @"{
-  ""fieldsets"": [
-    {
-      ""alias"": ""Pages"",
-      ""properties"": [
-        {
-          ""alias"": ""Pages"",
-          ""value"": {
-            ""fieldsets"": [
-              {
-                ""alias"": ""TextPage"",
-                ""properties"": [
-                  {
-                    ""alias"": ""Media"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""slideShow"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""Slides"",
-                              ""value"": ""1,2,3,4,5,6,7,8""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""Seo"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""seo"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""MetaTitle"",
-                              ""value"": ""Test Meta Title""
-                            },
-                            {
-                              ""alias"": ""MetaDescription"",
-                              ""value"": ""Test Meta Description""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""PageTitle"",
-                    ""value"": ""Home Page""
-                  },
-                  {
-                    ""alias"": ""BodyText"",
-                    ""value"": ""Home Page Body""
-                  }
-                ]
-              },
-              {
-                ""alias"": ""TextPage"",
-                ""properties"": [
-                  {
-                    ""alias"": ""Media"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""slideShow"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""Slides"",
-                              ""value"": ""1,2,3,4,5,6,7,8""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""Seo"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""seo"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""MetaTitle"",
-                              ""value"": ""Test Meta Title""
-                            },
-                            {
-                              ""alias"": ""MetaDescription"",
-                              ""value"": ""Test Meta Description""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""PageTitle"",
-                    ""value"": ""About us Page""
-                  },
-                  {
-                    ""alias"": ""BodyText"",
-                    ""value"": ""About us Page Body""
-                  }
-                ]
-              },
-              {
-                ""alias"": ""TextPage"",
-                ""properties"": [
-                  {
-                    ""alias"": ""Media"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""slideShow"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""Slides"",
-                              ""value"": ""1,2,3,4,5,6,7,8""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""Seo"",
-                    ""value"": {
-                      ""fieldsets"": [
-                        {
-                          ""alias"": ""seo"",
-                          ""properties"": [
-                            {
-                              ""alias"": ""MetaTitle"",
-                              ""value"": ""Test Meta Title""
-                            },
-                            {
-                              ""alias"": ""MetaDescription"",
-                              ""value"": ""Test Meta Description""
-                            }
-                          ]
-                        }
-                      ]
-                    }
-                  },
-                  {
-                    ""alias"": ""PageTitle"",
-                    ""value"": ""Contact us Page""
-                  },
-                  {
-                    ""alias"": ""BodyText"",
-                    ""value"": ""Contact us Page Body""
-                  }
-                ]
-              }
-            ]
-          }
-        }
-      ]
-    }
-  ]
+        public const string _MERGER_DETAILS_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""mergerDetails"",
+      ""properties"": [
+        {
+          ""alias"": ""MergerDate"",
+          ""value"": ""07/06/2014 08:09:10""
+        }
+      ]
+    }
+  ]
+}";
+
+        public const string _ANNUAL_STATEMENT_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""annualStatement"",
+      ""properties"": [
+        {
+          ""alias"": ""FiscalYearStart"",
+          ""value"": ""01/09/2013 00:00:00""
+        },
+        {
+          ""alias"": ""FiscalYearEnd"",
+          ""value"": ""31/08/2014 00:00:00""
+        },
+        {
+          ""alias"": ""DividendPaymentDate"",
+          ""value"": """"
+        },
+        {
+          ""alias"": ""TotalShares"",
+          ""value"": ""345678""
+        },
+        {
+          ""alias"": ""Sales"",
+          ""value"": ""123456700.89""
+        },
+        {
+          ""alias"": ""Profit"",
+          ""value"": ""1123456.78""
+        }
+      ]
+    }
+  ]
+}";
+
+        public const string _CONTACT_DETAILS_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""contactDetails"",
+      ""properties"": [
+        {
+          ""alias"": ""name"",
+          ""value"": ""Test""
+        },
+        {
+          ""alias"": ""address"",
+          ""value"": ""Test Address""
+        },
+        {
+          ""alias"": ""telephone"",
+          ""value"": ""111""
+        },
+        {
+          ""alias"": ""mobile"",
+          ""value"": ""000""
+        },
+        {
+          ""alias"": ""fax"",
+          ""value"": ""000""
+        },
+        {
+          ""alias"": ""email"",
+          ""value"": ""test@test.com""
+        },
+        {
+          ""alias"": ""webSite"",
+          ""value"": {
+            ""fieldsets"": [
+              {
+                ""alias"": ""urlPicker"",
+                ""properties"": [
+                  {
+                    ""alias"": ""title"",
+                    ""value"": ""The Test Company""
+                  },
+                  {
+                    ""alias"": ""url"",
+                    ""value"": ""http://test.com""
+                  },
+                  {
+                    ""alias"": ""content"",
+                    ""value"": """"
+                  },
+                  {
+                    ""alias"": ""media"",
+                    ""value"": """"
+                  },
+                  {
+                    ""alias"": ""openInNewWindow"",
+                    ""value"": ""1""
+                  }
+                ]
+              }
+            ]
+          }
+        }
+      ]
+    }
+  ]
+}";
+
+        public const string _COMPANY_DETAILS_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""companyDetails"",
+      ""properties"": [
+        {
+          ""alias"": ""region"",
+          ""value"": ""Test Region""
+        },
+        {
+          ""alias"": ""contactDetails"",
+          ""value"": {
+            ""fieldsets"": [
+              {
+                ""alias"": ""contactDetails"",
+                ""properties"": [
+                  {
+                    ""alias"": ""name"",
+                    ""value"": ""Test""
+                  },
+                  {
+                    ""alias"": ""address"",
+                    ""value"": ""Test Address""
+                  },
+                  {
+                    ""alias"": ""telephone"",
+                    ""value"": ""111""
+                  },
+                  {
+                    ""alias"": ""mobile"",
+                    ""value"": ""000""
+                  },
+                  {
+                    ""alias"": ""fax"",
+                    ""value"": ""000""
+                  },
+                  {
+                    ""alias"": ""email"",
+                    ""value"": ""test@test.com""
+                  },
+                  {
+                    ""alias"": ""webSite"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""urlPicker"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""title"",
+                              ""value"": ""The Test Company""
+                            },
+                            {
+                              ""alias"": ""url"",
+                              ""value"": ""http://test.com""
+                            },
+                            {
+                              ""alias"": ""content"",
+                              ""value"": """"
+                            },
+                            {
+                              ""alias"": ""media"",
+                              ""value"": """"
+                            },
+                            {
+                              ""alias"": ""openInNewWindow"",
+                              ""value"": ""1""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  }
+                ]
+              }
+            ]
+          }
+        }
+      ]
+    }
+  ]
+}";
+
+        public const string _PAGE_DETAILS_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""pages"",
+      ""properties"": [
+        {
+          ""alias"": ""pages"",
+          ""value"": ""2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453""
+        }
+      ]
+    },
+    {
+      ""alias"": ""captions"",
+      ""properties"": [
+        {
+          ""alias"": ""captions"",
+          ""value"": {
+            ""fieldsets"": [
+              {
+                ""alias"": ""textstringArray"",
+                ""properties"": [
+                  {
+                    ""alias"": ""textstring"",
+                    ""value"": ""First Page""
+                  }
+                ]
+              },
+              {
+                ""alias"": ""textstringArray"",
+                ""properties"": [
+                  {
+                    ""alias"": ""textstring"",
+                    ""value"": ""Second Page""
+                  }
+                ]
+              },
+              {
+                ""alias"": ""textstringArray"",
+                ""properties"": [
+                  {
+                    ""alias"": ""textstring"",
+                    ""value"": ""Third Page""
+                  }
+                ]
+              },
+              {
+                ""alias"": ""textstringArray"",
+                ""properties"": [
+                  {
+                    ""alias"": ""textstring"",
+                    ""value"": ""Fourth Page""
+                  }
+                ]
+              }
+            ]
+          }
+        }
+      ]
+    }
+  ]
+}";
+
+        public const string _PAGES_JSON =
+            @"{
+  ""fieldsets"": [
+    {
+      ""alias"": ""Pages"",
+      ""properties"": [
+        {
+          ""alias"": ""Pages"",
+          ""value"": {
+            ""fieldsets"": [
+              {
+                ""alias"": ""TextPage"",
+                ""properties"": [
+                  {
+                    ""alias"": ""Media"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""slideShow"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""Slides"",
+                              ""value"": ""1,2,3,4,5,6,7,8""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""Seo"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""seo"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""MetaTitle"",
+                              ""value"": ""Test Meta Title""
+                            },
+                            {
+                              ""alias"": ""MetaDescription"",
+                              ""value"": ""Test Meta Description""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""PageTitle"",
+                    ""value"": ""Home Page""
+                  },
+                  {
+                    ""alias"": ""BodyText"",
+                    ""value"": ""Home Page Body""
+                  }
+                ]
+              },
+              {
+                ""alias"": ""TextPage"",
+                ""properties"": [
+                  {
+                    ""alias"": ""Media"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""slideShow"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""Slides"",
+                              ""value"": ""1,2,3,4,5,6,7,8""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""Seo"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""seo"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""MetaTitle"",
+                              ""value"": ""Test Meta Title""
+                            },
+                            {
+                              ""alias"": ""MetaDescription"",
+                              ""value"": ""Test Meta Description""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""PageTitle"",
+                    ""value"": ""About us Page""
+                  },
+                  {
+                    ""alias"": ""BodyText"",
+                    ""value"": ""About us Page Body""
+                  }
+                ]
+              },
+              {
+                ""alias"": ""TextPage"",
+                ""properties"": [
+                  {
+                    ""alias"": ""Media"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""slideShow"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""Slides"",
+                              ""value"": ""1,2,3,4,5,6,7,8""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""Seo"",
+                    ""value"": {
+                      ""fieldsets"": [
+                        {
+                          ""alias"": ""seo"",
+                          ""properties"": [
+                            {
+                              ""alias"": ""MetaTitle"",
+                              ""value"": ""Test Meta Title""
+                            },
+                            {
+                              ""alias"": ""MetaDescription"",
+                              ""value"": ""Test Meta Description""
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  },
+                  {
+                    ""alias"": ""PageTitle"",
+                    ""value"": ""Contact us Page""
+                  },
+                  {
+                    ""alias"": ""BodyText"",
+                    ""value"": ""Contact us Page Body""
+                  }
+                ]
+              }
+            ]
+          }
+        }
+      ]
+    }
+  ]
 }";

         public const string _NULL_VALUES_JSON = @"{""fieldsets"":[{""alias"":""contactDetails"",""properties"":[{""alias"":""name"",""value"":""""},{""alias"":""address"",""value"":""""},{""alias"":""telephone"",""value"":""""},{""alias"":""mobile"",""value"":""""},{""alias"":""fax"",""value"":""""},{""alias"":""email"",""value"":""""},{""alias"":""webSite"",""value"":""""}]}]}";


Allowing for BgToolsCode to be null since it only appears to come through when diagnostic information is in the payload.

--- src/Mandrill.net/Model/WebHook/MandrillMessageEventInfo.cs
+++ src/Mandrill.net/Model/WebHook/MandrillMessageEventInfo.cs
@@ -66,6 +66,6 @@
         public string BounceDescription { get; set; }

         [JsonProperty("bgtools_code")]
-        public int BgToolsCode { get; set; }
+        public int? BgToolsCode { get; set; }
     }
 }


Correct function instance output blob.

Correct function instance output blob.

--- src/Microsoft.Azure.Jobs.Host/Loggers/FunctionOutputLog.cs
+++ src/Microsoft.Azure.Jobs.Host/Loggers/FunctionOutputLog.cs
@@ -28,7 +28,7 @@
         // Get a default instance of
         public static FunctionOutputLog GetLogStream(FunctionInvokeRequest f, string accountConnectionString, string containerName)
         {
-            string name = f.ToString() + ".txt";
+            string name = f.Id.ToString("N") + ".txt";

             var c = BlobClient.GetContainer(accountConnectionString, containerName);
             if (c.CreateIfNotExists())


Convert comma to underline in enum names, closes https://github.com/RSuter/NSwag/issues/2009

--- src/NJsonSchema.CodeGeneration/DefaultEnumNameGenerator.cs
+++ src/NJsonSchema.CodeGeneration/DefaultEnumNameGenerator.cs
@@ -27,6 +27,7 @@
             return ConversionUtilities.ConvertToUpperCamelCase(name
                 .Replace(":", "-").Replace(@"""", @""), true)
                 .Replace(".", "_")
+                .Replace(",", "_")
                 .Replace("#", "_")
                 .Replace("-", "_")
                 .Replace("\\", "_");


Add benchmarks for Instant/unix time conversions (#573)

--- src/NodaTime.Benchmarks/NodaTimeTests/InstantBenchmarks.cs
+++ src/NodaTime.Benchmarks/NodaTimeTests/InstantBenchmarks.cs
@@ -10,6 +10,9 @@
     public class InstantBenchmarks
     {
         private static readonly Instant Sample = Instant.FromUtc(2011, 8, 24, 12, 29, 30);
+        private static readonly long SampleUnixTimeSeconds = Sample.ToUnixTimeSeconds();
+        private static readonly long SampleUnixTimeMilliseconds = Sample.ToUnixTimeMilliseconds();
+        private static readonly long SampleUnixTimeTicks = Sample.ToUnixTimeTicks();
         private static readonly Offset SmallOffset = Offset.FromHours(1);
         private static readonly Offset LargePositiveOffset = Offset.FromHours(12);
         private static readonly Offset LargeNegativeOffset = Offset.FromHours(-13);
@@ -27,6 +30,26 @@
         [Benchmark]
         public ZonedDateTime InZoneLondon() => Sample.InZone(London);

+#if !V1
+        [Benchmark]
+        public Instant FromUnixTimeSeconds() => Instant.FromUnixTimeSeconds(SampleUnixTimeSeconds);
+
+        [Benchmark]
+        public Instant FromUnixTimeMilliseconds() => Instant.FromUnixTimeMilliseconds(SampleUnixTimeMilliseconds);
+
+        [Benchmark]
+        public Instant FromUnixTimeTicks() => Instant.FromUnixTimeTicks(SampleUnixTimeTicks);
+
+        [Benchmark]
+        public long ToUnixTimeSeconds() => Sample.ToUnixTimeSeconds();
+
+        [Benchmark]
+        public long ToUnixTimeMilliseconds() => Sample.ToUnixTimeMilliseconds();
+
+        [Benchmark]
+        public long ToUnixTimeTicks() => Sample.ToUnixTimeTicks();
+#endif
+
 #if !V1_0 && !V1_1
         [Benchmark]
         public OffsetDateTime WithOffset_SameUtcDay() => Sample.WithOffset(SmallOffset);


Remove unused import.

Remove unused import.

--- src/Renci.SshNet/Messages/Authentication/RequestMessage.cs
+++ src/Renci.SshNet/Messages/Authentication/RequestMessage.cs
@@ -1,5 +1,4 @@
 using System;
-using Renci.SshNet.Common;

 namespace Renci.SshNet.Messages.Authentication
 {


[CON-4562] Add appropriate tag styling

[CON-4562] Add appropriate tag styling

--- src/SFA.DAS.EAS.Support.Web/Views/Account/SubHeader.cshtml
+++ src/SFA.DAS.EAS.Support.Web/Views/Account/SubHeader.cshtml
@@ -18,7 +18,11 @@
             {
                  Account ID @(Model?.PublicHashedAccountId), created @Model.DateRegistered.ToString("dd/MM/yyyy")
             }
-             Levy Status  @Model.ApprenticeshipEmployerType
+
+                Levy Status
+                    @Model.ApprenticeshipEmployerType
+
+


Eliminate Segment allocations and access by reference

--- src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs
+++ src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs
@@ -26,8 +26,10 @@
         {
             uint charAsInt = (uint)codePoint;

-            foreach (Segment seg in this.Segments)
+            for (int i = 0; i < this.Segments.Length; i++)
             {
+                ref Segment seg = ref this.Segments[i];
+
                 if (seg.End >= charAsInt && seg.Start <= charAsInt)
                 {
                     if (seg.Offset == 0)
@@ -91,16 +93,8 @@
             }
         }

-        internal class Segment
+        internal readonly struct Segment
         {
-            public short Delta { get; }
-
-            public ushort End { get; }
-
-            public ushort Offset { get; }
-
-            public ushort Start { get; }
-
             public Segment(ushort index, ushort end, ushort start, short delta, ushort offset)
             {
                 this.Index = index;
@@ -111,6 +105,14 @@
             }

             public ushort Index { get; }
+
+            public short Delta { get; }
+
+            public ushort End { get; }
+
+            public ushort Offset { get; }
+
+            public ushort Start { get; }

             public static Segment[] Create(ushort[] endCounts, ushort[] startCode, short[] idDelta, ushort[] idRangeOffset)
             {


Fix for IO Exception (#4073) (#4076)

Fix for IO Exception (#4073) (#4076)

--- src/Stratis.Bitcoin.Features.BlockStore/BlockRepository.cs
+++ src/Stratis.Bitcoin.Features.BlockStore/BlockRepository.cs
@@ -397,7 +397,7 @@
             // however we need to find how byte arrays are sorted in DBreeze.
             using (DBreeze.Transactions.Transaction transaction = this.DBreeze.GetTransaction())
             {
-                transaction.SynchronizeTables(BlockTableName, TransactionTableName);
+                transaction.SynchronizeTables(BlockTableName, TransactionTableName, CommonTableName);
                 this.OnInsertBlocks(transaction, blocks);

                 // Commit additions


Use decimal instead of float for coordinates

--- src/Umbraco.Web.Common/ImageProcessors/CropWebProcessor.cs
+++ src/Umbraco.Web.Common/ImageProcessors/CropWebProcessor.cs
@@ -58,8 +58,8 @@

         private static ImageCropperCropCoordinates GetCropCoordinates(IDictionary<string, string> commands, CommandParser parser, CultureInfo culture)
         {
-            float[] crops = parser.ParseValue<float[]>(commands.GetValueOrDefault(Crop), culture);
-
+            decimal[] crops = parser.ParseValue<decimal[]>(commands.GetValueOrDefault(Crop), culture);
+
             if (crops.Length != 4)
             {
                 return null;


Fixes PublishedContent.cs when the property index doesn't contain the alias index (due to adding a new property type and the json not matchin)

--- src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs
+++ src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs
@@ -258,7 +258,12 @@
         public override IPublishedProperty GetProperty(string alias)
         {
             var index = _contentNode.ContentType.GetPropertyIndex(alias);
-            var property = index < 0 ? null : PropertiesArray[index];
+            if (index < 0) return null;
+            //TODO: Should we log here? I think this can happen when property types are added/removed from the doc type and the json serialized properties
+            // no longer match the list of property types since that is how the PropertiesArray is populated.
+            //TODO: Does the PropertiesArray get repopulated on content save?
+            if (index > PropertiesArray.Length) return null;
+            var property = PropertiesArray[index];
             return property;
         }


Reorder the buttons

Reorder the buttons

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs
@@ -153,8 +153,8 @@
             {
                 EditorGUI.BeginChangeCheck();
                 {
+                    activeTab = TabButton(SubTab.Changes, ChangesTitle, activeTab);
                     activeTab = TabButton(SubTab.History, HistoryTitle, activeTab);
-                    activeTab = TabButton(SubTab.Changes, ChangesTitle, activeTab);
                     activeTab = TabButton(SubTab.Branches, BranchesTitle, activeTab);
                     activeTab = TabButton(SubTab.Settings, SettingsTitle, activeTab);
                 }


Use separate queue/topic for every service type Display ServiceBus connection data after creating demo queue/topic

--- TestClient/Program.cs
+++ TestClient/Program.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Threading;
 using Microsoft.Azure;
 using Microsoft.ServiceBus;
 using Microsoft.ServiceBus.Messaging;
@@ -11,33 +12,20 @@
 	internal class Program
 	{
 		private static readonly string ConnectionStringForManaging;
-		private static readonly string QueueName = "TestQueue";
-		private static readonly string TopicName = "TestTopic";
-		private static readonly string SubscriptionName = "TestSubscription";
+
+		private static readonly string QueueNameStateless = "TestQueueStateless";
+		private static readonly string TopicNameStateless = "TestTopicStateless";
+		private static readonly string SubscriptionNameStateless = "TestSubscriptionStateless";
+
+		private static readonly string QueueNameStateful = "TestQueueStateful";
+		private static readonly string TopicNameStateful = "TestTopicStateful";
+		private static readonly string SubscriptionNameStateful = "TestSubscriptionStateful";

 		static Program()
 		{
 			//Get a Service Bus connection string that has rights to manage the Service Bus namespace, to be able to create queues and topics.
 			//this is not needed in production situations, unless you want to create them on the fly using your own code.
 			ConnectionStringForManaging = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString.Manage");
-
-			string queueName = CloudConfigurationManager.GetSetting("QueueName");
-			if (!string.IsNullOrWhiteSpace(queueName))
-			{
-				QueueName = queueName;
-			}
-
-			string topicName = CloudConfigurationManager.GetSetting("TopicName");
-			if (!string.IsNullOrWhiteSpace(topicName))
-			{
-				TopicName = topicName;
-			}
-
-			string subscriptionName = CloudConfigurationManager.GetSetting("SubscriptionName");
-			if (!string.IsNullOrWhiteSpace(subscriptionName))
-			{
-				SubscriptionName = subscriptionName;
-			}
 		}

 		// ReSharper disable once UnusedParameter.Local
@@ -60,13 +48,24 @@
 			while (true)
 			{
 				Console.WriteLine("Choose an option:");
-				Console.WriteLine("1: Create a service bus queue");
-				Console.WriteLine("2: Send a message to the queue created with option 2.");
-
-				Console.WriteLine("3: Create a service bus topic");
-				Console.WriteLine("4: Create a subscription for the topic created with option 3");
-				Console.WriteLine("5: Send a message to the topic created with option 3.");
-
+
+				Console.ForegroundColor = ConsoleColor.Yellow;
+				Console.WriteLine("Manage Azure Service Bus namespace:");
+				Console.WriteLine("1: Create the demo service bus queues");
+				Console.WriteLine("2: Create the demo service bus topics");
+				Console.WriteLine("3: Create subscriptions for the topics created with option 2");
+
+				Console.ResetColor();
+				Console.WriteLine();
+				Console.WriteLine("Send Messages to Reliable Services:");
+
+				Console.WriteLine("4: Send a message to SampleQueueListeningStatefulService");
+				Console.WriteLine("5: Send a message to SampleQueueListeningStatelessService");
+
+				Console.WriteLine("6: Send a message to SampleSubscriptionListeningStatefulService.");
+				Console.WriteLine("7: Send a message to SampleSubscriptionListeningStatelessService.");
+
+				Console.WriteLine();
 				Console.WriteLine("Other: exit");

@@ -75,126 +74,186 @@
 				{
 					case ConsoleKey.D1:
 					case ConsoleKey.NumPad1:
-						CreateServiceBusQueue();
+						CreateServiceBusQueue(QueueNameStateless);
+						CreateServiceBusQueue(QueueNameStateful);
 						break;

 					case ConsoleKey.D2:
 					case ConsoleKey.NumPad2:
-						SendTestMessageToQueue();
+						CreateServiceBusTopic(TopicNameStateless);
+						CreateServiceBusTopic(TopicNameStateful);
 						break;

 					case ConsoleKey.D3:
 					case ConsoleKey.NumPad3:
-						CreateServiceBusTopic();
-						break;
+						CreateTopicSubscription(TopicNameStateless, SubscriptionNameStateless);
+						CreateTopicSubscription(TopicNameStateful, SubscriptionNameStateful);
+						break;
+
 					case ConsoleKey.D4:
 					case ConsoleKey.NumPad4:
-						CreateTopicSubscription();
+						SendTestMessageToQueue(new Uri("fabric:/MyServiceFabricApp/SampleQueueListeningStatefulService"), QueueNameStateful, true);
 						break;

 					case ConsoleKey.D5:
 					case ConsoleKey.NumPad5:
-						SendTestMessageToTopic();
-						break;
-
+						SendTestMessageToQueue(new Uri("fabric:/MyServiceFabricApp/SampleQueueListeningStatelessService"), QueueNameStateless, false);
+						break;
+
+					case ConsoleKey.D6:
+					case ConsoleKey.NumPad6:
+						SendTestMessageToTopic(new Uri("fabric:/MyServiceFabricApp/SampleSubscriptionListeningStatefulService"), TopicNameStateful, true);
+						break;
+
+					case ConsoleKey.D7:
+					case ConsoleKey.NumPad7:
+						SendTestMessageToTopic(new Uri("fabric:/MyServiceFabricApp/SampleSubscriptionListeningStatelessService"), TopicNameStateless, false);
+						break;
+
 					default:
 						return;
 				}
-			}
-		}
-
-		private static void CreateServiceBusTopic()
+
+				Thread.Sleep(200);
+				Console.Clear();
+			}
+		}
+
+		private static void CreateServiceBusTopic(string topicName)
 		{
 			var namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionStringForManaging);

-			if (namespaceManager.TopicExists(TopicName))
-			{
-				Console.WriteLine($"Topic '{TopicName}' exists.");
+			if (namespaceManager.TopicExists(topicName))
+			{
+				Console.WriteLine($"Topic '{topicName}' exists.");
 				return;
 			}

-			var td = new TopicDescription(TopicName);
-			td.Authorization.Add(new SharedAccessAuthorizationRule("SendKey", SharedAccessAuthorizationRule.GenerateRandomKey(), new[] { AccessRights.Send }));
+			var td = new TopicDescription(topicName);
+			var sendKey = SharedAccessAuthorizationRule.GenerateRandomKey();
+			var receiveKey = SharedAccessAuthorizationRule.GenerateRandomKey();
+
+			td.Authorization.Add(new SharedAccessAuthorizationRule("SendKey", sendKey, new[] { AccessRights.Send }));
+			td.Authorization.Add(new SharedAccessAuthorizationRule("ReceiveKey", receiveKey, new[] { AccessRights.Listen }));

 			namespaceManager.CreateTopic(td);
-			Console.WriteLine($"Created Topic '{TopicName}'.");
-		}
-
-		private static void CreateTopicSubscription()
+			Console.WriteLine($"Created Topic '{topicName}'.");
+
+			Console.WriteLine($"Now manually update the App.config in the Subscription Listening-Service with the Send and Receive connection strings for this Topic:'{topicName}'.");
+			Console.WriteLine( "Send Key - SharedAccessKeyName:'SendKey'");
+			Console.WriteLine($"Send Key - SharedAccessKey:'{sendKey}'");
+			Console.WriteLine();
+
+			Console.WriteLine($"Receive Key - SharedAccessKeyName:'ReceiveKey'");
+			Console.WriteLine($"Receive Key - SharedAccessKey:'{receiveKey}'");
+
+			Console.WriteLine("Hit any key to continue...");
+			Console.ReadKey(true);
+		}
+
+		private static void CreateTopicSubscription(string topicName, string subscriptionName)
 		{
 			var namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionStringForManaging);
-			if (namespaceManager.SubscriptionExists(TopicName, SubscriptionName))
-			{
-				Console.WriteLine($"Subscription '{SubscriptionName}' for Topic '{TopicName}' exists.");
+			if (namespaceManager.SubscriptionExists(topicName, subscriptionName))
+			{
+				Console.WriteLine($"Subscription '{subscriptionName}' for Topic '{topicName}' exists.");
 				return;
 			}
-			namespaceManager.CreateSubscription(TopicName, SubscriptionName);
-			Console.WriteLine($"Created Subscription '{SubscriptionName}' for Topic '{TopicName}'.");
-		}
-
-		private static void CreateServiceBusQueue()
+			namespaceManager.CreateSubscription(topicName, subscriptionName);
+			Console.WriteLine($"Created Subscription '{subscriptionName}' for Topic '{topicName}'.");
+		}
+
+		private static void CreateServiceBusQueue(string queueName)
 		{
 			var namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionStringForManaging);

-			if (namespaceManager.QueueExists(QueueName))
-			{
-				Console.WriteLine($"Queue '{QueueName}' exists.");
+			if (namespaceManager.QueueExists(queueName))
+			{
+				Console.WriteLine($"Queue '{queueName}' exists.");
 				return;
 			}

-			var qd = new QueueDescription(QueueName);
-			qd.Authorization.Add(new SharedAccessAuthorizationRule("SendKey", SharedAccessAuthorizationRule.GenerateRandomKey(), new[] { AccessRights.Send }));
+			var qd = new QueueDescription(queueName);
+			var sendKey = SharedAccessAuthorizationRule.GenerateRandomKey();
+			var receiveKey = SharedAccessAuthorizationRule.GenerateRandomKey();
+			qd.Authorization.Add(new SharedAccessAuthorizationRule("SendKey", sendKey, new[] { AccessRights.Send }));
+			qd.Authorization.Add(new SharedAccessAuthorizationRule("ReceiveKey", receiveKey, new[] { AccessRights.Listen }));

 			namespaceManager.CreateQueue(qd);
-			Console.WriteLine($"Created queue '{QueueName}'.");
-		}
-
-		private static void SendTestMessageToTopic()
+			Console.WriteLine($"Created queue '{queueName}'.");
+
+			Console.WriteLine($"Now manually update the App.config in the Queue Listening-Service with the Send and Receive connection strings for this Queue:'{queueName}'.");
+			Console.WriteLine("Send Key - SharedAccessKeyName:'SendKey'");
+			Console.WriteLine($"Send Key - SharedAccessKey:'{sendKey}'");
+			Console.WriteLine();
+
+			Console.WriteLine($"Receive Key - SharedAccessKeyName:'ReceiveKey'");
+			Console.WriteLine($"Receive Key - SharedAccessKey:'{receiveKey}'");
+
+			Console.WriteLine("Hit any key to continue...");
+			Console.ReadKey(true);
+		}
+
+
+		private static void SendTestMessageToTopic(Uri uri, string topicName, bool serviceSupportsPartitions)
 		{
 			//the name of your application and the name of the Service, the default partition resolver and the topic name
 			//to create a communication client factory:
-			var uri = new Uri("fabric:/MyServiceFabricApp/SampleSubscriptionListeningStatefulService");
-			var resolver = ServicePartitionResolver.GetDefault();
-			var factory = new ServiceBusTopicCommunicationClientFactory(resolver, TopicName);
-
-			//determine the partition and create a communication proxy
-			long partitionKey = 0L;
-			var servicePartitionClient = new ServicePartitionClient<ServiceBusTopicCommunicationClient>(factory, uri, partitionKey);
-
+			var factory = new ServiceBusTopicCommunicationClientFactory(ServicePartitionResolver.GetDefault(), topicName);
+
+			ServicePartitionClient<ServiceBusTopicCommunicationClient> servicePartitionClient;
+
+			if (serviceSupportsPartitions)
+			{
+				//determine the partition and create a communication proxy
+				long partitionKey = 0L;
+				servicePartitionClient = new ServicePartitionClient<ServiceBusTopicCommunicationClient>(factory, uri, partitionKey);
+			}
+			else
+			{
+				servicePartitionClient = new ServicePartitionClient<ServiceBusTopicCommunicationClient>(factory, uri);
+			}
+
 			//use the proxy to send a message to the Service
-			servicePartitionClient.InvokeWithRetry(c => c.SendMessage(new BrokeredMessage()
+			servicePartitionClient.InvokeWithRetry(c => c.SendMessage(CreateMessage()));
+
+			Console.WriteLine("Message sent to topic");
+		}
+
+		private static void SendTestMessageToQueue(Uri uri, string queueName, bool serviceSupportsPartitions)
+		{
+			//the name of your application and the name of the Service, the default partition resolver and the topic name
+			//to create a communication client factory:
+			var factory = new ServiceBusQueueCommunicationClientFactory(ServicePartitionResolver.GetDefault(), queueName);
+
+			ServicePartitionClient<ServiceBusQueueCommunicationClient> servicePartitionClient;
+
+			if (serviceSupportsPartitions)
+			{
+				//determine the partition and create a communication proxy
+				long partitionKey = 0L;
+				servicePartitionClient = new ServicePartitionClient<ServiceBusQueueCommunicationClient>(factory, uri, partitionKey);
+			}
+			else
+			{
+				servicePartitionClient = new ServicePartitionClient<ServiceBusQueueCommunicationClient>(factory, uri);
+			}
+
+			//use the proxy to send a message to the Service
+			servicePartitionClient.InvokeWithRetry(c => c.SendMessage(CreateMessage()));
+
+			Console.WriteLine("Message sent to queue");
+		}
+
+		private static BrokeredMessage CreateMessage()
+		{
+			return new BrokeredMessage()
 			{
 				Properties =
 				{
 					{ "TestKey", "TestValue" }
 				}
-			}));
-
-			Console.WriteLine("Message sent to topic");
-		}
-
-		private static void SendTestMessageToQueue()
-		{
-			//the name of your application and the name of the Service, the default partition resolver and the topic name
-			//to create a communication client factory:
-			var uri = new Uri("fabric:/MyServiceFabricApp/SampleQueueListeningStatefulService");
-			var resolver = ServicePartitionResolver.GetDefault();
-			var factory = new ServiceBusQueueCommunicationClientFactory(resolver, QueueName);
-
-			//determine the partition and create a communication proxy
-			long partitionKey = 0L;
-			var servicePartitionClient = new ServicePartitionClient<ServiceBusQueueCommunicationClient>(factory, uri, partitionKey);
-
-			//use the proxy to send a message to the Service
-			servicePartitionClient.InvokeWithRetry(c => c.SendMessage(new BrokeredMessage()
-			{
-				Properties =
-				{
-					{ "TestKey", "TestValue" }
-				}
-			}));
-
-			Console.WriteLine("Message sent to queue");
+			};
 		}
 	}
 }


Added populateChildJob to workWish

Added populateChildJob to workWish

--- sims3RandomizerGenerator/workWishPopulation.cs
+++ sims3RandomizerGenerator/workWishPopulation.cs
@@ -111,5 +111,12 @@

         }

+        private void populateChildJob()
+        {
+            this.simJob.Items.Clear();
+            this.simJob.Items.Add("None");
+        }
+
+
     }
 }


テストを更新

テストを更新

--- Tests/FileInfoTest.cs
+++ Tests/FileInfoTest.cs
@@ -50,6 +50,16 @@
         #region Properties

         [Test]
+        public void Exists_Dummy_IsFalse()
+        {
+            var dummy = new FileInfo("dummy-filename");
+            Assert.That(
+                dummy.Exists,
+                Is.False
+            );
+        }
+
+        [Test]
         public void Exists_Assembly_IsTrue()
         {
             Assert.That(


escape channel descriptions

escape channel descriptions

--- slimCat/Commands/Channel/DescriptionCommand.cs
+++ slimCat/Commands/Channel/DescriptionCommand.cs
@@ -31,6 +31,7 @@

 namespace slimCat.Services
 {
+    using System.Net;
     using Models;
     using System;
     using System.Collections.Generic;
@@ -55,7 +56,7 @@
             if (string.Equals(channel.Description, description, StringComparison.Ordinal))
                 return;

-            channel.Description = description;
+            channel.Description = WebUtility.HtmlDecode(WebUtility.HtmlDecode(description));

             if (isInitializer)
                 return;


Patch Import Excel

Patch Import Excel

--- TranslationService.cs
+++ TranslationService.cs
@@ -163,7 +163,9 @@

                 if (result != null && result.Tables.Count == 1)
                 {
-                    List<AspectizeTranslation> translations = dm.GetEntities<AspectizeTranslation>();
+                    //List<AspectizeTranslation> translations = dm.GetEntities<AspectizeTranslation>();
+                    List<AspectizeTranslation> translations = dm.GetEntitiesFields<AspectizeTranslation>(EntityLoadOption.AllFields, new QueryCriteria(AspectizeTranslation.Fields.Ignore, ComparisonOperator.Equal, false));
+

                     DataTable dt = result.Tables[0];


Fix: LookupService needs to be thread-safe.

--- source/LogImporter/GeoIp/GeoIpLookupService.cs
+++ source/LogImporter/GeoIp/GeoIpLookupService.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
@@ -13,7 +14,7 @@

         private bool disposed;

-        private readonly IDictionary<string, Country> cache;
+        private readonly ConcurrentDictionary<string, Country> cache;

         public GeoIpLookupService()
         {
@@ -23,17 +24,12 @@

             this.service = new LookupService(this.geoIpDatePath, LookupService.GeoipMemoryCache);

-            this.cache = new Dictionary<string, Country>();
+            this.cache = new ConcurrentDictionary<string, Country>();
         }

         public Country GetCountry(string ipAddress)
         {
-            if (!this.cache.ContainsKey(ipAddress))
-            {
-                this.cache[ipAddress] = this.service.GetCountry(ipAddress);
-            }
-
-            return this.cache[ipAddress];
+            return this.cache.GetOrAdd(ipAddress, a => this.service.GetCountry(a));
         }

         public void Dispose()


りしゃーぱーせんせいのおつげ

りしゃーぱーせんせいのおつげ

--- UstdCsv2Ju/Program.cs
+++ UstdCsv2Ju/Program.cs
@@ -9,7 +9,7 @@
 	class Program
 	{
 		private static readonly ProductInfo productInfo = new ProductInfo();
-		private static bool _isExistDummy = false;
+		private static bool _isExistDummy;
 		static int Main(string[] args)
 		{
 			var options = new HashSet<string> { "--input-csv", "--threshold", "--output-xml", "--help", "--version" };
@@ -79,6 +79,7 @@
 			var resultWriter = new ResultXmlWriter(inputCsv, threshold, outputXml);
 			resultWriter.WriteResultFile();

+			// delete temp file if exists.
 			if (_isExistDummy)
 			{
 				File.Delete(inputCsv);


Update test for other platforms

Update test for other platforms

--- tests/NLog.UnitTests/Targets/TargetTests.cs
+++ tests/NLog.UnitTests/Targets/TargetTests.cs
@@ -64,7 +64,7 @@
             int neededCheckCount = targetTypes.Count;
             int checkCount = 0;
             Target fileTarget = new FileTarget();
-            Target databaseTarget = new DatabaseTarget();
+            Target memoryTarget = new MemoryTarget();

             foreach (Type targetType in targetTypes)
             {
@@ -135,7 +135,7 @@
                         neededCheckCount++;

                         //multiple targets
-                        var args = new List<object> { fileTarget, databaseTarget };
+                        var args = new List<object> { fileTarget, memoryTarget };

                         //specials cases

@@ -144,7 +144,7 @@
                         var defaultConstructedTarget = (CompoundTargetBase)Activator.CreateInstance(targetType);
                         defaultConstructedTarget.Name = name;
                         defaultConstructedTarget.Targets.Add(fileTarget);
-                        defaultConstructedTarget.Targets.Add(databaseTarget);
+                        defaultConstructedTarget.Targets.Add(memoryTarget);

                         //ctor: target
                         var targetConstructedTarget = (CompoundTargetBase)Activator.CreateInstance(targetType, args.ToArray());


fix: MIT headers

fix: MIT headers

--- tests/Yaapii.Atoms.Tests/Map/GroupedTest.cs
+++ tests/Yaapii.Atoms.Tests/Map/GroupedTest.cs
@@ -1,12 +1,29 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+// MIT License
+//
+// Copyright(c) 2017 ICARUS Consulting GmbH
+//
+// 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 Xunit;
-using Yaapii.Atoms.Enumerable;
 using Yaapii.Atoms.Func;
 using Yaapii.Atoms.IO;
 using Yaapii.Atoms.List;
-using Yaapii.Atoms.Map;
 using Yaapii.Atoms.Number;

 namespace Yaapii.Atoms.Map.Tests


cosmetic

cosmetic

--- src/AutoMapper/Execution/TypeMapPlanBuilder.cs
+++ src/AutoMapper/Execution/TypeMapPlanBuilder.cs
@@ -184,7 +184,7 @@
             var nullChecks = new List<Expression>();
             while(expression != null)
             {
-                var setter = ExpressionFactory.GetSetter(expression);
+                var setter = GetSetter(expression);
                 if(setter != null)
                 {
                     var nullCeck =


Make _isOpen non-nullable since the only two values that were used were true and null.

--- src/Avalonia.Visuals/Media/PathMarkupParser.cs
+++ src/Avalonia.Visuals/Media/PathMarkupParser.cs
@@ -33,7 +33,7 @@
         private IGeometryContext _geometryContext;
         private Point _currentPoint;
         private Point? _previousControlPoint;
-        private bool? _isOpen;
+        private bool _isOpen;
         private bool _isDisposed;

         /// <summary>
@@ -162,7 +162,7 @@
                 }
             }

-            if (_isOpen != null)
+            if (_isOpen)
             {
                 _geometryContext.EndFigure(false);
             }
@@ -170,7 +170,7 @@

         private void CreateFigure()
         {
-            if (_isOpen != null)
+            if (_isOpen)
             {
                 _geometryContext.EndFigure(false);
             }
@@ -189,14 +189,14 @@

         private void CloseFigure()
         {
-            if (_isOpen == true)
+            if (_isOpen)
             {
                 _geometryContext.EndFigure(true);
             }

             _previousControlPoint = null;

-            _isOpen = null;
+            _isOpen = false;
         }

         private void AddMove(CommandToken commandToken)
@@ -227,7 +227,7 @@
                                 ? commandToken.ReadRelativePoint(_currentPoint)
                                 : commandToken.ReadPoint();

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -241,7 +241,7 @@
                                 ? new Point(_currentPoint.X + commandToken.ReadDouble(), _currentPoint.Y)
                                 : _currentPoint.WithX(commandToken.ReadDouble());

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -255,7 +255,7 @@
                                 ? new Point(_currentPoint.X, _currentPoint.Y + commandToken.ReadDouble())
                                 : _currentPoint.WithY(commandToken.ReadDouble());

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -279,7 +279,7 @@
                              ? commandToken.ReadRelativePoint(_currentPoint)
                              : commandToken.ReadPoint();

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -301,7 +301,7 @@
                           ? commandToken.ReadRelativePoint(_currentPoint)
                           : commandToken.ReadPoint();

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -326,7 +326,7 @@
                 _previousControlPoint = MirrorControlPoint((Point)_previousControlPoint, _currentPoint);
             }

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -349,7 +349,7 @@
                 _previousControlPoint = MirrorControlPoint((Point)_previousControlPoint, _currentPoint);
             }

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }
@@ -373,7 +373,7 @@
                           ? commandToken.ReadRelativePoint(_currentPoint)
                           : commandToken.ReadPoint();

-            if (_isOpen == null)
+            if (!_isOpen)
             {
                 CreateFigure();
             }


Formatting.

Formatting.

--- src/Compilers/Core/Portable/CodeGen/DebugId.cs
+++ src/Compilers/Core/Portable/CodeGen/DebugId.cs
@@ -58,4 +58,4 @@
             return (Generation > 0) ? $"{Ordinal}#{Generation}" : Ordinal.ToString();
         }
     }
-}
+}


Fixed by array return value

Fixed by array return value

--- src/HQ.API.SDK/Client/HQAPIClient_generated.cs
+++ src/HQ.API.SDK/Client/HQAPIClient_generated.cs
@@ -6055,7 +6055,7 @@
         /// Returns the real binary data of the pdf file
         /// <returns>OK</returns>
         /// <exception cref="SwaggerException">A server side error occurred.</exception>
-        public Task<ODataResponseOfListOfByte> InvoicesV1_GetValueFromInvoicesDocumentFileByIdAsync(int id)
+        public Task<byte[]> InvoicesV1_GetValueFromInvoicesDocumentFileByIdAsync(int id)
         {
             return InvoicesV1_GetValueFromInvoicesDocumentFileByIdAsync(CancellationToken.None, id);
         }
@@ -6064,7 +6064,7 @@
         /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
         /// <returns>OK</returns>
         /// <exception cref="SwaggerException">A server side error occurred.</exception>
-        public async Task<ODataResponseOfListOfByte> InvoicesV1_GetValueFromInvoicesDocumentFileByIdAsync(CancellationToken cancellationToken, int id)
+        public async Task<byte[]> InvoicesV1_GetValueFromInvoicesDocumentFileByIdAsync(CancellationToken cancellationToken, int id)
         {
             var url_ = string.Format("{0}/{1}", BaseUrl, "v1/Invoices({Id})/DocumentFile/$value");

@@ -6082,33 +6082,16 @@

             var responseData_ = await response_.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
             var status_ = ((int)response_.StatusCode).ToString();
-            var value = string.Empty;
-            if (responseData_.Length > 0)
-            {
-                value = Encoding.UTF8.GetString(responseData_, 0, responseData_.Length);
-            }

             if (status_ == "200")
             {
-                var result_ = default(ODataResponseOfListOfByte);
-                try
-                {
-                    if (responseData_.Length > 0)
-                    {
-                        result_ = JsonConvert.DeserializeObject<ODataResponseOfListOfByte>(value);
-                    }
-                    return result_;
-                }
-                catch (Exception exception)
-                {
-                    throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, exception);
-                }
+                return responseData_;
             }
             else
             if (status_ != "200" && status_ != "204")
                 throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, null);

-            return default(ODataResponseOfListOfByte);
+            return null;
         }

         /// Returns all quotations
@@ -16771,28 +16754,6 @@

     [JsonObject(MemberSerialization.OptIn)]
     [GeneratedCode("NJsonSchema", "6.0.6305.38127")]
-    public partial class ODataResponseOfListOfByte
-    {
-
-        [JsonProperty("@odata.context", Required = Required.Default, NullValueHandling = NullValueHandling.Ignore)]
-        public string ODataContext { get; set; }
-
-        [JsonProperty("value", Required = Required.Default, NullValueHandling = NullValueHandling.Ignore)]
-        public ObservableCollection<int> Value { get; set; }
-
-        public string ToJson()
-        {
-            return JsonConvert.SerializeObject(this);
-        }
-
-        public static ODataResponseOfListOfByte FromJson(string data)
-        {
-            return JsonConvert.DeserializeObject<ODataResponseOfListOfByte>(data);
-        }
-    }
-
-    [JsonObject(MemberSerialization.OptIn)]
-    [GeneratedCode("NJsonSchema", "6.0.6305.38127")]
     public partial class ODataResponseOfListOfQuotation
     {


Continuing improving

Continuing improving

--- plugins/extras/p5.io.authorization/helpers/AuthorizationHelper.cs
+++ plugins/extras/p5.io.authorization/helpers/AuthorizationHelper.cs
@@ -220,9 +220,9 @@
                      * Looping through any remaining access rights, to see if that modifies our return value.
                      */
                     foreach (var idxAccess in access) {
-                        if (idxAccess [0].Name == "p5.io.allow-read")
+                        if (idxAccess [0].Name == "p5.io.allow-" + operation)
                             hasAccess = true;
-                        else if (idxAccess [0].Name == "p5.io.deny-read")
+                        else if (idxAccess [0].Name == "p5.io.deny-" + operation)
                             hasAccess = false;
                     }
                 }


Dont divide-by-zero when normalizing a zero vector

--- Utilities/Vector2r.cs
+++ Utilities/Vector2r.cs
@@ -43,6 +43,10 @@

         public void Normalize() {
             Real length = Length();
+            if (length == 0) {
+                return;
+            }
+
             X /= length;
             Z /= length;
         }


Changing 'ContentLengthLexer' to derive from 'RepetitionLexer'

--- src/Http.Grammar/Rfc7230/ContentLengthLexer.cs
+++ src/Http.Grammar/Rfc7230/ContentLengthLexer.cs
@@ -5,7 +5,7 @@
     using SLANG;
     using SLANG.Core;

-    public class ContentLengthLexer : Lexer<ContentLength>
+    public class ContentLengthLexer : RepetitionLexer<ContentLength, Digit>
     {
         private readonly ILexer<Digit> digitLexer;

@@ -15,36 +15,20 @@
         }

         public ContentLengthLexer(ILexer<Digit> digitLexer)
-            : base("Content-Length")
+            : base("Content-Length", 1, int.MaxValue)
         {
             Contract.Requires(digitLexer != null);
             this.digitLexer = digitLexer;
         }

-        public override bool TryRead(ITextScanner scanner, out ContentLength element)
+        protected override ContentLength CreateInstance(IList<Digit> elements, int lowerBound, int upperBound, ITextContext context)
         {
-            if (scanner.EndOfInput)
-            {
-                element = default(ContentLength);
-                return false;
-            }
+            return new ContentLength(elements, context);
+        }

-            var context = scanner.GetContext();
-            var elements = new List<Digit>();
-            Digit digit;
-            while (this.digitLexer.TryRead(scanner, out digit))
-            {
-                elements.Add(digit);
-            }
-
-            if (elements.Count == 0)
-            {
-                element = default(ContentLength);
-                return false;
-            }
-
-            element = new ContentLength(elements, context);
-            return true;
+        protected override bool TryRead(ITextScanner scanner, out Digit element)
+        {
+            return this.digitLexer.TryRead(scanner, out element);
         }

         [ContractInvariantMethod]


Fix: Secfunction in FinTS message

Fix: Secfunction in FinTS message


Use broadcast variables in the right way in SparkContextSample

--- csharp/Samples/Microsoft.Spark.CSharp/SparkContextSamples.cs
+++ csharp/Samples/Microsoft.Spark.CSharp/SparkContextSamples.cs
@@ -17,15 +17,15 @@
         [Serializable]
         internal class BroadcastHelper<T>
         {
-            private readonly T[] value;
-            internal BroadcastHelper(T[] value)
+            private readonly Broadcast<T[]> broadcastVar;
+            internal BroadcastHelper(Broadcast<T[]> broadcastVar)
             {
-                this.value = value;
+                this.broadcastVar = broadcastVar;
             }

             internal IEnumerable<T> Execute(int i)
             {
-                return value;
+                return broadcastVar.Value;
             }
         }

@@ -34,14 +34,16 @@
         {
             var b = SparkCLRSamples.SparkContext.Broadcast<int[]>(Enumerable.Range(1, 5).ToArray());
             foreach (var value in b.Value)
+            {
                 Console.Write(value + " ");
+            }
             Console.WriteLine();

-            b.Unpersist();
-
-            var r = SparkCLRSamples.SparkContext.Parallelize(new[] { 0, 0 }, 1).FlatMap(new BroadcastHelper<int>(b.Value).Execute).Collect();
+            var r = SparkCLRSamples.SparkContext.Parallelize(new[] { 0, 0 }, 1).FlatMap(new BroadcastHelper<int>(b).Execute).Collect();
             foreach (var value in r)
+            {
                 Console.Write(value + " ");
+            }
             Console.WriteLine();
         }


plugin: only reload on file change if developer options enabled

--- plugin/CactbotEventSource/CactbotEventSourceConfig.cs
+++ plugin/CactbotEventSource/CactbotEventSourceConfig.cs
@@ -93,11 +93,22 @@
         var general = options["general"];
         if (general == null)
           return false;
-        var dir = general["ReloadOnFileChange"];
-        if (dir == null)
+
+        var developer = general["ShowDeveloperOptions"];
+        if (developer == null)
           return false;
         try {
-          return dir.ToObject<bool>();
+          if (!developer.ToObject<bool>())
+            return false;
+        } catch {
+          return false;
+        }
+
+        var reload = general["ReloadOnFileChange"];
+        if (reload == null)
+          return false;
+        try {
+          return reload.ToObject<bool>();
         } catch {
           return false;
         }


Skip custom fields that are empty, null, or default

"Default" includes custom int fields with the value 0. If the user
really meant to set them to 0, then that's the value they will end up
with anyway since it's the default value for int, so this is safe.

--- src/LfMerge/FieldWorks/CustomFieldConverter.cs
+++ src/LfMerge/FieldWorks/CustomFieldConverter.cs
@@ -30,7 +30,7 @@
 		///
 		/// Returns value of custom fields for this CmObject.
 		///
-		/// <returns>A BsonDocument with the following structure:

+		/// <returns>Either null, or a BsonDocument with the following structure:

 		/// {

 		///     "customFields": { fieldName: fieldValue, fieldName2: fieldValue2, etc. }

 		///     "customFieldGuids": { fieldName: "Guid-as-string", fieldName2: "Guid2-as-string", etc. }

@@ -43,6 +43,12 @@
 		/// The format of the fieldName keys will be "customField_FOO_field_name_with_underscores",
 		/// where FOO is one of "entry", "senses", or "examples".

 		/// Some fields have no need for a GUID (e.g., a custom number field), so not all fieldNames will appear in customFieldGuids.
+		/// Only custom fields with actual data will be returned: empty lists and strings will be suppressed, and integer
+		/// fields whose value is 0 will be suppressed. (They will get the default int value, 0, when read from Mongo, so this
+		/// allows us to save space in the Mongo DB). If a custom field's value is suppressed, it will not appear in the output,
+		/// and will not have a corresponding value in customFieldGuids.
+		/// If ALL custom fields are suppressed because of having null, default or empty values, then this function will return
+		/// null instead of returning a useless-but-not-actually-empty BsonDocument.
 		/// </returns>
 		/// <param name="cmObj">Cm object.</param>
 		/// <param name="objectType">Either "entry", "senses", or "examples"</param>
@@ -121,6 +127,8 @@

 			case CellarPropertyType.Integer:
 				fieldValue = new BsonInt32(data.get_IntProp(hvo, flid));
+				if (fieldValue.AsInt32 == default(Int32))
+					fieldValue = null; // Suppress int fields with 0 in them, to save Mongo DB space
 				break;

 			case CellarPropertyType.OwningAtomic:
@@ -141,8 +149,13 @@
 			case CellarPropertyType.ReferenceSequence:
 				int[] listHvos = data.VecProp(hvo, flid);
 				var innerValues = new BsonArray(listHvos.Select(listHvo => GetCustomReferencedObject(listHvo, flid, ref dataGuids)).Where(x => x != null));
-				fieldValue = new BsonDocument("values", innerValues);
-				fieldGuid = new BsonArray(dataGuids.Select(guid => guid.ToString()));
+				if (innerValues.Count == 0)
+					fieldValue = null;
+				else
+				{
+					fieldValue = new BsonDocument("values", innerValues);
+					fieldGuid = new BsonArray(dataGuids.Select(guid => guid.ToString()));
+				}
 				break;

 			case CellarPropertyType.String:
@@ -158,18 +171,23 @@
 				break;
 				// TODO: Maybe issue a proper warning (or error) log message for "field type not recognized"?
 			}
-			var result = new BsonDocument();
-			result.Add("value", fieldValue ?? BsonNull.Value); // BsonValues aren't allowed to have C# nulls; they have their own null representation
-			if (fieldGuid is BsonArray)
-				result.Add("guid", fieldGuid, ((BsonArray)fieldGuid).Count > 0);
+			if (fieldValue == null)
+				return null;
 			else
-				result.Add("guid", fieldGuid, fieldGuid != null);
-			return result;
+			{
+				var result = new BsonDocument();
+				result.Add("value", fieldValue ?? BsonNull.Value); // BsonValues aren't allowed to have C# nulls; they have their own null representation
+				if (fieldGuid is BsonArray)
+					result.Add("guid", fieldGuid, ((BsonArray)fieldGuid).Count > 0);
+				else
+					result.Add("guid", fieldGuid, fieldGuid != null);
+				return result;
+			}
 		}

 		private BsonValue GetCustomStTextValues(IStText obj, int flid)
 		{
-			if (obj == null) return null;
+			if (obj == null || obj.ParagraphsOS == null || obj.ParagraphsOS.Count == 0) return null;
 			List<ITsString> paras = obj.ParagraphsOS.OfType<IStTxtPara>().Select(para => para.Contents).ToList();
 			List<string> htmlParas = paras.Where(para => para != null).Select(para => String.Format("
{0}
", para.Text)).ToList();
 			WritingSystemManager wsManager = cache.ServiceLocator.WritingSystemManager;
@@ -477,7 +495,8 @@
 				if (fieldGuidOrGuids.BsonType == BsonType.String && fieldGuidOrGuids.AsString == "00000000-0000-0000-0000-000000000000")
 					fieldGuidOrGuids = BsonNull.Value;
 				remainingFieldNames.Remove(fieldName);
-				Console.WriteLine("Setting custom field {0} with data {1} and GUID(s) {2}", fieldName, fieldValue.ToJson(), fieldGuidOrGuids.ToJson());
+				if (fieldValue != BsonNull.Value)
+					Console.WriteLine("Setting custom field {0} with data {1} and GUID(s) {2}", fieldName, fieldValue.ToJson(), fieldGuidOrGuids.ToJson());
 				// TODO: Detect when fieldValue is null and don't bother calling SetCustomFieldData
 				SetCustomFieldData(cmObj.Hvo, flid, fieldValue, fieldGuidOrGuids);
 				customFieldValues.Remove(fieldName);


No delete intermediate folder after dotnet compile --native

Currently we elide all intermediate .rsp and .obj from the this run.
This is because we shared the intermediate folder name with the prior step.
The fix is to append "native" same as output folder.

--- src/Microsoft.DotNet.Tools.Compiler/Program.cs
+++ src/Microsoft.DotNet.Tools.Compiler/Program.cs
@@ -63,9 +63,9 @@
             var nativeOutputPath = Path.Combine(outputPath, "native");
             var intermediateOutputPath =
                 context.GetIntermediateOutputPath(args.ConfigValue, args.IntermediateValue, outputPath);
-
+            var nativeIntermediateOutputPath = Path.Combine(intermediateOutputPath, "native");
             Directory.CreateDirectory(nativeOutputPath);
-            Directory.CreateDirectory(intermediateOutputPath);
+            Directory.CreateDirectory(nativeIntermediateOutputPath);

             var compilationOptions = context.ProjectFile.GetCompilerOptions(context.TargetFramework, args.ConfigValue);
             var managedOutput =
@@ -133,14 +133,14 @@

             // Intermediate Path
             nativeArgs.Add("--temp-output");
-            nativeArgs.Add($"{intermediateOutputPath}");
+            nativeArgs.Add($"{nativeIntermediateOutputPath}");

             // Output Path
             nativeArgs.Add("--output");
             nativeArgs.Add($"{nativeOutputPath}");

             // Write Response File
-            var rsp = Path.Combine(intermediateOutputPath, $"dotnet-compile-native.{context.ProjectFile.Name}.rsp");
+            var rsp = Path.Combine(nativeIntermediateOutputPath, $"dotnet-compile-native.{context.ProjectFile.Name}.rsp");
             File.WriteAllLines(rsp, nativeArgs);

             // TODO Add -r assembly.dll for all Nuget References


Fixed issue with model being incorrectly attached to redirect on document view

--- src/MvcDocs/Controllers/DocumentsController.cs
+++ src/MvcDocs/Controllers/DocumentsController.cs
@@ -44,7 +44,7 @@

 	        var homeDoc = _settings.GetHomeDocuments().FirstOrDefault(doc => _browser.DocumentExists(root, doc));
 	        if (homeDoc == null) return View(new IndexModel(root, _browser.ListDocumentNames(root)));
-	        return RedirectToAction("View", new { model, url = homeDoc } );
+	        return RedirectToAction("View", new { url = homeDoc } );
         }

 		[HttpGet]


Add parentheses to LogicalExpression.ToString.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@2376

--- src/NHibernate/Expression/LogicalExpression.cs
+++ src/NHibernate/Expression/LogicalExpression.cs
@@ -98,7 +98,7 @@
 		/// </remarks>
 		public override string ToString()
 		{
-			return _lhs.ToString() + ' ' + Op + ' ' + _rhs.ToString();
+			return '(' + _lhs.ToString() + ' ' + Op + ' ' + _rhs.ToString() + ')';
 		}
 	}
 }


Made ObjectDisposedException message give the closed generic type of this RoundRobin<T>.

--- src/Nimbus/ConcurrentCollections/RoundRobin.cs
+++ src/Nimbus/ConcurrentCollections/RoundRobin.cs
@@ -34,7 +34,7 @@

         public T GetNext()
         {
-            if (_isDisposed) throw new ObjectDisposedException("This RoundRobin has already been disposed.");
+            if (_isDisposed) throw new ObjectDisposedException($"This {nameof(RoundRobin<T>)} has already been disposed.");

             while (true)
             {
@@ -86,8 +86,7 @@
                                         .Range(0, numItemsRequired)
                                         .AsParallel()
                                         .Select(i => _createItem())
-                                        .ToArray()
-                                        ;
+                                        .ToArray();

                                     lock (_itemsMutex)
                                     {


fixed API generator references

fixed API generator references

--- src/Nirvana.Web/Generation/CqrsApiGenerator.cs
+++ src/Nirvana.Web/Generation/CqrsApiGenerator.cs
@@ -31,9 +31,9 @@
             {
                 "System.Net.Http",
                 "System.Web.Http",
-                "TechFu.Nirvana",
-                "TechFu.Nirvana.WebApi",
-                "TechFu.Nirvana.WebApi.Controllers"
+                "Nirvana",
+                "Nirvana.WebApi",
+                "Nirvana.WebApi.Controllers"
             };
             //Commands and Queries
             foreach (var root in NirvanaSetup.RootNames)


Align the code

Align the code

--- src/NppXmlTreeviewPlugin.Parsers/NppXmlNode.cs
+++ src/NppXmlTreeviewPlugin.Parsers/NppXmlNode.cs
@@ -9,79 +9,109 @@
 namespace NppXmlTreeviewPlugin.Parsers
 {
     /// <summary>
-    /// Represents a Notepadd++ Xml Node.
+    ///     Represents a Notepadd++ Xml Node.
     /// </summary>
     public class NppXmlNode
     {
         private static int nodeId = 1;
+
+        /// <summary>
+        ///     The start position of the node.
+        /// </summary>
+        public NppXmlNodePosition StartPosition { get; }
+
+        /// <summary>
+        ///     The end position of the node.
+        /// </summary>
+        public NppXmlNodePosition EndPosition { get; private set; }
+
+        /// <summary>
+        ///     The name of the node.
+        /// </summary>
+        public string Name { get; private set; }
+
+        /// <summary>
+        ///     Internal id for the node.
+        /// </summary>
+        public int Id { get; }
+
+        /// <summary>
+        ///     The childrens of the node.
+        /// </summary>
+        public IReadOnlyCollection<NppXmlNode> ChildNodes => _childNodes;
+
+        /// <summary>
+        ///     The parent of the node.
+        /// </summary>
+        public NppXmlNode Parent { get; }
+
+        /// <summary>
+        ///     Flag to indicate if the node has child nodes.
+        /// </summary>
+        public bool HasChildNodes => ChildNodes.Any();
+
         private readonly List<NppXmlNode> _childNodes;

         /// <summary>
-        /// The default constructor for the class.
+        ///     The default constructor for the class.
         /// </summary>
         /// <param name="name">The node name.</param>
         /// <param name="startPosition">The node start position.</param>
         private NppXmlNode(string name, NppXmlNodePosition startPosition)
         {
-            this.Name = name;
-            this.StartPosition = startPosition;
-            this.Id = nodeId;
+            Name = name;
+            StartPosition = startPosition;
+            Id = nodeId;
             _childNodes = new List<NppXmlNode>();

             nodeId++;
         }

         /// <summary>
-        /// The default constructor for the class.
+        ///     The default constructor for the class.
         /// </summary>
         /// <param name="name">The node name.</param>
         /// <param name="startPosition">The node start position.</param>
         /// <param name="parent">The parent node.</param>
         private NppXmlNode(string name, NppXmlNodePosition startPosition, NppXmlNode parent)
         {
-            this.Name = name;
-            this.StartPosition = startPosition;
-            this.Parent = parent;
-            this.Id = nodeId;
+            Name = name;
+            StartPosition = startPosition;
+            Parent = parent;
+            Id = nodeId;
             _childNodes = new List<NppXmlNode>();

             nodeId++;
         }

         /// <summary>
-        /// Returns the first NppXmlNode for the line number.
+        ///     Returns the first NppXmlNode for the line number.
         /// </summary>
         /// <param name="lineNumber">The line number.</param>
         /// <param name="positionInLine">The position in line.</param>
         /// <returns>The first NppXmlNode in the line.</returns>
         public NppXmlNode FindNppXmlNodeByLine(int lineNumber, int positionInLine)
         {
-            if (this.StartPosition.LineNumber.Equals(lineNumber)
-                && this.StartPosition.LinePosition <= positionInLine
-                && this.EndPosition.LinePosition >= positionInLine)
-            {
+            if(StartPosition.LineNumber.Equals(lineNumber)
+               && StartPosition.LinePosition <= positionInLine
+               && EndPosition.LinePosition >= positionInLine)
                 return this;
-            }
-
-            if (!this.HasChildNodes)
-            {
+
+            if(!HasChildNodes)
                 return null;
-            }
-
-            foreach (var nppXmlNode in this.ChildNodes)
+
+            foreach(var nppXmlNode in ChildNodes)
             {
                 var node = nppXmlNode.FindNppXmlNodeByLine(lineNumber, positionInLine);
-                if (null != node)
-                {
+                if(null != node)
                     return node;
-                }
             }

             return null;
         }

         /// <summary>
-        /// Method to try parse the XML.
+        ///     Method to try parse the XML.
         /// </summary>
         /// <param name="xml">The XMl as string.</param>
         /// <param name="logger">The logger.</param>
@@ -93,10 +123,13 @@
         }

         /// <summary>
-        /// Method to try parse the XML.
+        ///     Method to try parse the XML.
         /// </summary>
         /// <param name="xml">The XMl as string.</param>
-        /// <param name="nodeNameAttribute">The attribute, that will be used as node name. If no one of that attribute, tag name will be used</param>
+        /// <param name="nodeNameAttribute">
+        ///     The attribute, that will be used as node name. If no one of that attribute, tag name
+        ///     will be used
+        /// </param>
         /// <param name="logger">The logger.</param>
         /// <param name="nppXmlNode">The Notepad++ XmlNode.</param>
         /// <returns>True if parse successfully, false otherwise.</returns>
@@ -107,25 +140,22 @@

             try
             {
-                using (var stringReader = new StringReader(xml))
+                using(var stringReader = new StringReader(xml))
                 {
-                    using (var xmlTextReader = new XmlTextReader(stringReader))
+                    using(var xmlTextReader = new XmlTextReader(stringReader))
                     {
-                        while (xmlTextReader.Read())
+                        while(xmlTextReader.Read())
                         {
-                            if (xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
-                            {
+                            if(xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
                                 continue;
-                            }

                             nppXmlNode = new NppXmlNode(xmlTextReader.Name, new NppXmlNodePosition(xmlTextReader));

                             ReadChildOrSibling(xmlTextReader, xmlTextReader.Depth, nppXmlNode, nodeNameAttribute);
                         }
-                        if (null == nppXmlNode)
-                        {
+
+                        if(null == nppXmlNode)
                             throw new ArgumentException("nppXmlNode");
-                        }

                         nppXmlNode.EndPosition = new NppXmlNodePosition(xmlTextReader, true);

@@ -142,35 +172,38 @@
         }

         /// <summary>
-        /// Method to read a child or a sibling of the node.
+        ///     Method to read a child or a sibling of the node.
         /// </summary>
         /// <param name="xmlTextReader">The XML text reader.</param>
         /// <param name="currentDepth">The current depth on the XML tree.</param>
         /// <param name="node">The XML node.</param>
         /// <param name="nodeNameAttribute">The node attribute name.</param>
-        private static void ReadChildOrSibling(XmlTextReader xmlTextReader, int currentDepth, NppXmlNode node, string nodeNameAttribute)
+        private static void ReadChildOrSibling(XmlTextReader xmlTextReader,
+                                               int currentDepth,
+                                               NppXmlNode node,
+                                               string nodeNameAttribute)
         {
             var nodeName = xmlTextReader.Name;
-            if (!string.IsNullOrEmpty(nodeNameAttribute))
+            if(!string.IsNullOrEmpty(nodeNameAttribute))
             {
                 var attr = xmlTextReader.GetAttribute(nodeNameAttribute);
-                if (attr != null)
+                if(attr != null)
                     nodeName = attr;
             }

             node.Name = nodeName;

-            while (xmlTextReader.Read())
+            while(xmlTextReader.Read())
             {
                 // It's a sibling.
-                if (currentDepth == xmlTextReader.Depth)
+                if(currentDepth == xmlTextReader.Depth)
                 {
-                    if (xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
-                    {
+                    if(xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
                         return;
-                    }
-
-                    var sibling = new NppXmlNode(xmlTextReader.Name, new NppXmlNodePosition(xmlTextReader), node.Parent);
+
+                    var sibling = new NppXmlNode(xmlTextReader.Name,
+                        new NppXmlNodePosition(xmlTextReader),
+                        node.Parent);
                     node.Parent.AddNode(sibling);

                     // Can be a single node.
@@ -183,10 +216,8 @@
                     return;
                 }

-                if (xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
-                {
+                if(xmlTextReader.NodeType != XmlNodeType.Element || !xmlTextReader.IsStartElement())
                     continue;
-                }

                 // It's a child.
                 var child = new NppXmlNode(xmlTextReader.Name, new NppXmlNodePosition(xmlTextReader), node);
@@ -201,44 +232,9 @@
             }
         }

-        /// <summary>
-        /// The start position of the node.
-        /// </summary>
-        public NppXmlNodePosition StartPosition { get; }
-
-        /// <summary>
-        /// The end position of the node.
-        /// </summary>
-        public NppXmlNodePosition EndPosition { get; private set; }
-
-        /// <summary>
-        /// The name of the node.
-        /// </summary>
-        public string Name { get; private set; }
-
-        /// <summary>
-        /// Internal id for the node.
-        /// </summary>
-        public int Id { get; }
-
-        /// <summary>
-        /// The childrens of the node.
-        /// </summary>
-        public IReadOnlyCollection<NppXmlNode> ChildNodes => _childNodes;
-
-        /// <summary>
-        /// The parent of the node.
-        /// </summary>
-        public NppXmlNode Parent { get; }
-
-        /// <summary>
-        /// Flag to indicate if the node has child nodes.
-        /// </summary>
-        public bool HasChildNodes => this.ChildNodes.Any();
-
         private void AddNode(NppXmlNode node)
         {
             _childNodes.Add(node);
         }
     }
-}
+}


Fix integer comparison in particle shader

--- src/OpenSage.Game/Graphics/Shaders/Particle.cs
+++ src/OpenSage.Game/Graphics/Shaders/Particle.cs
@@ -72,19 +72,19 @@
             var vertexUVPos = Vector4.Zero;
             switch (quadVertexID)
             {
-                case 0:
+                case 0u:
                     vertexUVPos = new Vector4(0, 1, -1, -1);
                     break;

-                case 1:
+                case 1u:
                     vertexUVPos = new Vector4(0, 0, -1, 1);
                     break;

-                case 2:
+                case 2u:
                     vertexUVPos = new Vector4(1, 1, 1, -1);
                     break;

-                case 3:
+                case 3u:
                     vertexUVPos = new Vector4(1, 0, 1, 1);
                     break;
             }


User arg align p1

User arg align p1

--- src/R/Editor/Impl/SmartIndent/SmartIndenter.cs
+++ src/R/Editor/Impl/SmartIndent/SmartIndenter.cs
@@ -138,7 +138,28 @@
                         // We only want to indent here if position is in arguments
                         // and not in the function scope.
                         if (line.Start >= fc.OpenBrace.End && !(fc.CloseBrace != null && line.Start >= fc.CloseBrace.End)) {
-                            return GetFirstArgumentIndent(textBuffer.CurrentSnapshot, fc);
+                            // Check if previous line first non-whitespace is in the function arguments.
+                            // If so, use block indent so caret will be where previous set of arguments begins.
+                            // Examples:
+                            //
+                            //  x <- function(a, b, c<ENTER>
+                            //                |
+                            //  x <- function(a, b,
+                            //           c, d<ENTER>
+                            //           |
+                            //
+                            if (line.Length > 0) {
+                                // Autoformat case. Pure smart indent has length of 0 since it is a new line.
+                                // In autoformat we respect user indentation.
+                                return line.Length - line.GetText().TrimStart().Length;
+                            } else {
+                                var fcPrevLine = ast.GetNodeOfTypeFromPosition<IFunction>(prevLine.Start);
+                                if (fcPrevLine == fc && fc.OpenBrace.End < prevLine.Start) {
+                                    return GetBlockIndent(line);
+                                } else {
+                                    return GetFirstArgumentIndent(textBuffer.CurrentSnapshot, fc);
+                                }
+                            }
                         }
                     }
                 }


More renaming, I'll get the hang of this eventually

--- src/S203.NewRelic.NeuronEsb.Plugin/EsbAgent.cs
+++ src/S203.NewRelic.NeuronEsb.Plugin/EsbAgent.cs
@@ -63,20 +63,20 @@
             Logger.Debug("Response received:\n" + data);

             Logger.Debug("Sending Summary Metrics to New Relic");
-            ReportMetric("Summary/Heartbeat", "check", data.Sum(d => d.Heartbeats));
-            ReportMetric("Summary/Error", "message", data.Sum(d => d.Errors));
-            ReportMetric("Summary/Warning", "message", data.Sum(d => d.Warnings));
-            ReportMetric("Summary/MessageRate", "message", (float)data.Sum(d => d.MessageRate));
-            ReportMetric("Summary/MessagesProcessed", "message", data.Sum(d => d.MessagesProcessed));
+            ReportMetric("Summary/Heartbeat", "checks", data.Sum(d => d.Heartbeats));
+            ReportMetric("Summary/Error", "messages", data.Sum(d => d.Errors));
+            ReportMetric("Summary/Warning", "messages", data.Sum(d => d.Warnings));
+            ReportMetric("Summary/MessageRate", "messages", (float)data.Sum(d => d.MessageRate));
+            ReportMetric("Summary/MessagesProcessed", "messages", data.Sum(d => d.MessagesProcessed));

             Logger.Debug("Sending Individual Metrics to New Relic");
             foreach (var endpoint in data)
             {
-                ReportMetric("Heartbeat/" + endpoint.Name, "check", endpoint.Heartbeats);
-                ReportMetric("Error/" + endpoint.Name, "message", endpoint.Errors);
-                ReportMetric("Warning/" + endpoint.Name, "message", endpoint.Warnings);
-                ReportMetric("MessageRate/" + endpoint.Name, "message", endpoint.Heartbeats);
-                ReportMetric("MessagesProcessed/" + endpoint.Name, "message", endpoint.Heartbeats);
+                ReportMetric("Heartbeat/" + endpoint.Name, "checks", endpoint.Heartbeats);
+                ReportMetric("Error/" + endpoint.Name, "messages", endpoint.Errors);
+                ReportMetric("Warning/" + endpoint.Name, "messages", endpoint.Warnings);
+                ReportMetric("MessageRate/" + endpoint.Name, "messages", endpoint.Heartbeats);
+                ReportMetric("MessagesProcessed/" + endpoint.Name, "messages", endpoint.Heartbeats);
             }
         }
     }


David/Raj #1000 - Added website updates to list of emails when you update a group

--- src/StockportWebapp/Utils/GroupEmailBuilder.cs
+++ src/StockportWebapp/Utils/GroupEmailBuilder.cs
@@ -187,7 +187,7 @@
             return _emailClient.SendEmailToService(new EmailMessage(messageSubject, GenerateEmailBodyFromHtml(emailBody),
                 _fromEmail,
                 _configuration.GetGroupSubmissionEmail(_businessId.ToString()).ToString(),
-                model.GroupAdministratorItem.Email,
+                model.GroupAdministratorItem.Email + ";  website.updates@stockport.gov.uk",
                 attachments));
         }


added complex analyzer package test

added complex analyzer package test

--- tests/OmniSharp.MSBuild.Tests/ProjectWithAnalyzersTests.cs
+++ tests/OmniSharp.MSBuild.Tests/ProjectWithAnalyzersTests.cs
@@ -36,6 +36,23 @@

                 Assert.NotEmpty(diagnostics.QuickFixes);
                 Assert.Contains(diagnostics.QuickFixes, x => x.ToString().Contains("IDE0060")); // Unused args.
+            }
+        }
+
+        [Fact]
+        public async Task CanLoadComplexAnalyzers()
+        {
+            using (var testProject = await TestAssets.Instance.GetTestProjectAsync("ProjectWithComplexAnalyzers"))
+            using (var host = CreateMSBuildTestHost(testProject.Directory, configurationData: TestHelpers.GetConfigurationDataWithAnalyzerConfig(roslynAnalyzersEnabled: true)))
+            {
+                await host.RestoreProject(testProject);
+
+                var diagnostics = await host.RequestCodeCheckAsync(Path.Combine(testProject.Directory, "Program.cs"));
+
+                Assert.NotEmpty(diagnostics.QuickFixes);
+                Assert.Contains(diagnostics.QuickFixes, x => x.ToString().Contains("CA1303"));
+                // warning CA1303: Method 'void Program.Main(string[] args)' passes a literal string as parameter 'value' of a call to 'void Console.WriteLine(string value)'. Retrieve the following string(s) from
+                // a resource table instead: "Hello World!"
             }
         }


[CUY-47] Fixed GetHostUrl method for Mono/Apache.

git-svn-id: aabac5b226a8774109fc1147efb783654096008f@340 cb474c29-17db-0310-ba2e-db2fec5ab780

--- Web/Util/UrlHelper.cs
+++ Web/Util/UrlHelper.cs
@@ -170,8 +170,8 @@

 		private static string GetHostUrl()
 		{
-			string https = HttpContext.Current.Request.ServerVariables["HTTPS"];
-			string protocol = https == "off" ? "http" : "https";
+			string securePort = HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"];
+			string protocol = securePort == null || securePort == "0" ? "http" : "https";
 			string serverPort = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
 			string port = serverPort == "80" ? string.Empty : ":" + serverPort;
 			string serverName = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];


Cache the Rank in Array.GetUpperBound/LowerBound (#1282)

--- src/System.Private.CoreLib/src/System/Array.cs
+++ src/System.Private.CoreLib/src/System/Array.cs
@@ -2196,7 +2196,8 @@
 #if REAL_MULTIDIM_ARRAYS
             if (!IsSzArray)
             {
-                if ((dimension >= Rank) || (dimension < 0))
+                int rank = Rank;
+                if ((uint)dimension >= rank)
                     throw new IndexOutOfRangeException();

                 unsafe
@@ -2204,7 +2205,7 @@
                     fixed (int* pNumComponents = &_numComponents)
                     {
                         // Lower bounds follow after upper bounds.
-                        return *(pNumComponents + 1 + PADDING + Rank + dimension);
+                        return *(pNumComponents + 1 + PADDING + rank + dimension);
                     }
                 }
             }
@@ -2231,7 +2232,8 @@
 #if REAL_MULTIDIM_ARRAYS
             if (!IsSzArray)
             {
-                if ((dimension >= Rank) || (dimension < 0))
+                int rank = Rank;
+                if ((uint)dimension >= rank)
                     throw new IndexOutOfRangeException();

                 unsafe
@@ -2240,7 +2242,7 @@
                     {
                         // Upper bounds follow after _numComponents.
                         int hiBound = *(pNumComponents + 1 + PADDING + dimension);
-                        int loBound = *(pNumComponents + 1 + PADDING + Rank + dimension);
+                        int loBound = *(pNumComponents + 1 + PADDING + rank + dimension);
                         return hiBound + loBound - 1;
                     }
                 }