Fix logging in with a two-factor code

Fix logging in with a two-factor code

--- SteamAuth/UserLogin.cs
+++ SteamAuth/UserLogin.cs
@@ -85,12 +85,12 @@
             postData.Add("username", this.Username);
             postData.Add("password", encryptedPassword);

-            postData.Add("twofactorcode", this.Requires2FA ? this.TwoFactorCode : "");
+            postData.Add("twofactorcode", this.TwoFactorCode ?? "");

             postData.Add("captchagid", this.RequiresCaptcha ? this.CaptchaGID : "-1");
             postData.Add("captcha_text", this.RequiresCaptcha ? this.CaptchaText : "");

-            postData.Add("emailsteamid", this.RequiresEmail ? this.SteamID.ToString() : "");
+            postData.Add("emailsteamid", (this.Requires2FA || this.RequiresEmail) ? this.SteamID.ToString() : "");
             postData.Add("emailauth", this.RequiresEmail ? this.EmailCode : "");

             postData.Add("rsatimestamp", rsaResponse.Timestamp);
@@ -116,7 +116,7 @@
                 return LoginResult.NeedEmail;
             }

-            if (loginResponse.TwoFactorNeeded)
+            if (loginResponse.TwoFactorNeeded && !loginResponse.Success)
             {
                 this.Requires2FA = true;
                 return LoginResult.Need2FA;
@@ -153,6 +153,9 @@

         private class LoginResponse
         {
+            [JsonProperty("success")]
+            public bool Success { get; set; }
+
             [JsonProperty("login_complete")]
             public bool LoginComplete { get; set; }


small performance improvement

small performance improvement

--- src/NLog/Targets/ConsoleWordHighlightingRule.cs
+++ src/NLog/Targets/ConsoleWordHighlightingRule.cs
@@ -177,7 +177,7 @@
         /// <returns></returns>
         private string MatchEvaluator(Match m)
         {
-            StringBuilder result = new StringBuilder();
+            StringBuilder result = new StringBuilder(m.Value.Length + 5);

             result.Append('\a');
             result.Append((char)((int)this.ForegroundColor + 'A'));


Added Type method to MultiMatchQueryDescriptor

--- src/Nest/DSL/Query/MultiMatchQueryDescriptor.cs
+++ src/Nest/DSL/Query/MultiMatchQueryDescriptor.cs
@@ -13,7 +13,7 @@
 	public class MultiMatchQueryDescriptor<T> : IQuery where T : class
 	{
 		[JsonProperty(PropertyName = "type")]
-		internal virtual string _Type { get { return null; } }
+		internal virtual string _Type { get; set; }

 		[JsonProperty(PropertyName = "query")]
 		internal string _Query { get; set; }
@@ -150,5 +150,11 @@
 			this._TieBreaker = tieBreaker;
 			return this;
 		}
+
+		public MultiMatchQueryDescriptor<T> Type(TextQueryType type)
+		{
+			this._Type = type.ToString().ToLower();
+			return this;
+		}
 	}
 }


added copmments

added copmments

--- src/OpenInApp.Common/Helpers/KeyToExecutable.cs
+++ src/OpenInApp.Common/Helpers/KeyToExecutable.cs
@@ -24,7 +24,7 @@
         public const string VS2017Enterprise = "devenv.exeVS2017Enterprise";
         public const string VS2017Professional = "devenv.exeVS2017Professional";
         public const string XamarinStudio = "XamarinStudio.exe";
-        public const string XMLSpy = "XMLSpy.exe";
+        public const string XMLSpy = "XMLSpy.exe";//gregt rename AltovaXmlSpy
     }

     public enum KeyToExecutableEnum
@@ -81,6 +81,6 @@
         XamarinStudio,

         [Description("XMLSpy.exe")]
-        XMLSpy,
+        XMLSpy,//gregt rename AltovaXmlSpy
     }
 }


Handle function mappings (read.csv -> read.table)

--- src/R/Support/Impl/Help/Packages/PackageInfo.cs
+++ src/R/Support/Impl/Help/Packages/PackageInfo.cs
@@ -9,23 +9,24 @@
 using Microsoft.R.Support.Help.Definitions;
 using Microsoft.R.Support.Help.Functions;

-namespace Microsoft.R.Support.Help.Packages
-{
-    public sealed class PackageInfo : NamedItemInfo, IPackageInfo
-    {
+namespace Microsoft.R.Support.Help.Packages {
+    /// <summary>
+    /// Represents R package installed on user machine
+    /// </summary>
+    public sealed class PackageInfo : NamedItemInfo, IPackageInfo {
         private string _description;

         public PackageInfo(string name, string installPath) :
-            base(name, NamedItemType.Package)
-        {
+            base(name, NamedItemType.Package) {
             InstallPath = installPath;
         }

+        /// <summary>
+        /// Package description
+        /// </summary>
         #region NamedItemInfo
-        public override string Description
-        {
-            get
-            {
+        public override string Description {
+            get {
                 if (_description == null)
                     _description = GetDescription();

@@ -43,13 +44,10 @@
         /// <summary>
         /// Collection of functions in the package
         /// </summary>
-        public IReadOnlyCollection<INamedItemInfo> Functions
-        {
-            get
-            {
+        public IReadOnlyCollection<INamedItemInfo> Functions {
+            get {
                 IReadOnlyCollection<INamedItemInfo> functions = FunctionIndex.GetPackageFunctions(this.Name);
-                if (functions == null || functions.Count == 0)
-                {
+                if (functions == null || functions.Count == 0) {
                     functions = LoadFunctionInfoFromPackageHelpIndex();
                 }

@@ -61,13 +59,11 @@
         /// <summary>
         /// Extract package description from the DESCRITION file on disk
         /// </summary>
-        private string GetDescription()
-        {
+        private string GetDescription() {
             StringBuilder sb = new StringBuilder();
             bool found = false;

-            try
-            {
+            try {
                 // DESCRIPTION uses a simple file format called DCF, the Debian control format.
                 // Each line consists of a field name and a value, separated by a colon.
                 // When values span multiple lines, they need to be indented:
@@ -78,39 +74,30 @@

                 string descriptionFilePath = Path.Combine(this.InstallPath, this.Name, "DESCRIPTION");

-                using (StreamReader sr = new StreamReader(descriptionFilePath, Encoding.UTF8))
-                {
-                    while (!found)
-                    {
+                using (StreamReader sr = new StreamReader(descriptionFilePath, Encoding.UTF8)) {
+                    while (!found) {
                         string line = sr.ReadLine();
-                        if (line == null)
-                        {
+                        if (line == null) {
                             break;
                         }

-                        if (line.StartsWith("Description:", StringComparison.OrdinalIgnoreCase))
-                        {
+                        if (line.StartsWith("Description:", StringComparison.OrdinalIgnoreCase)) {
                             line = line.Substring(12).Trim();
                             sb.Append(line.Trim());
                             sb.Append(' ');

-                            while (!found)
-                            {
+                            while (!found) {
                                 line = sr.ReadLine();
-                                if (line == null)
-                                {
+                                if (line == null) {
                                     break;
                                 }

-                                if (line.Length > 0 && char.IsWhiteSpace(line[0]))
-                                {
+                                if (line.Length > 0 && char.IsWhiteSpace(line[0])) {
                                     line.Trim();

                                     sb.Append(line.Trim());
                                     sb.Append(' ');
-                                }
-                                else
-                                {
+                                } else {
                                     found = true;
                                     break;
                                 }
@@ -118,32 +105,25 @@
                         }
                     }
                 }
-            }
-            catch (IOException) { }
+            } catch (IOException) { }

             return sb.ToString().Trim();
         }

-        internal IReadOnlyList<INamedItemInfo> LoadFunctionInfoFromPackageHelpIndex()
-        {
+        internal IReadOnlyList<INamedItemInfo> LoadFunctionInfoFromPackageHelpIndex() {
             List<INamedItemInfo> functions = new List<INamedItemInfo>();
             string content = null;

-            try
-            {
+            try {
                 string htmlFile = Path.Combine(this.InstallPath, this.Name, "html", "00index.html");
-                if (File.Exists(htmlFile))
-                {
-                    using (StreamReader sr = new StreamReader(htmlFile, Encoding.UTF8))
-                    {
+                if (File.Exists(htmlFile)) {
+                    using (StreamReader sr = new StreamReader(htmlFile, Encoding.UTF8)) {
                         content = sr.ReadToEnd();
                     }
                 }
-            }
-            catch (IOException) { }
-
-            if (!string.IsNullOrEmpty(content))
-            {
+            } catch (IOException) { }
+
+            if (!string.IsNullOrEmpty(content)) {
                 HtmlTree tree = new HtmlTree(new Microsoft.Web.Core.Text.TextStream(content));
                 tree.Build();

@@ -151,40 +131,76 @@
                 tree.Accept(functionSearch, null);
             }

+            Dictionary<string, INamedItemInfo> functionIndex = new Dictionary<string, INamedItemInfo>();
+            foreach (INamedItemInfo ni in functions) {
+                functionIndex[ni.Name] = ni;
+            }
+
+            IReadOnlyDictionary<string, string> mappedNames = GetMappedNames();
+            foreach (string mappedName in mappedNames.Keys) {
+                INamedItemInfo ni;
+                string actualName = mappedNames[mappedName];
+                if (functionIndex.TryGetValue(actualName, out ni)) {
+                    INamedItemInfo niAlias = new NamedItemInfo() {
+                        Name = mappedName,
+                        Description = ni.Description,
+                        ItemType = ni.ItemType
+                    };
+                    functions.Add(niAlias);
+                }
+            }
+
             return functions;
         }

-        private class FunctionSearch : IHtmlTreeVisitor
-        {
+        private IReadOnlyDictionary<string, string> GetMappedNames() {
+            Dictionary<string, string> dict = new Dictionary<string, string>();
+
+            try {
+                string indexFile = Path.Combine(this.InstallPath, this.Name, "help", "AnIndex");
+                if (File.Exists(indexFile)) {
+                    using (StreamReader sr = new StreamReader(indexFile, Encoding.UTF8)) {
+                        string line;
+                        char[] splitChars = new char[] { ' ', '\t' };
+                        while ((line = sr.ReadLine()) != null) {
+                            string[] parts = line.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
+                            if (parts.Length == 2) {
+                                string mappedName = parts[0];
+                                string actualName = parts[1];
+                                if (mappedName != actualName) {
+                                    dict[mappedName] = actualName;
+                                }
+                            }
+                        }
+                    }
+                }
+            } catch (IOException) { }
+
+            return dict;
+        }
+
+        private class FunctionSearch : IHtmlTreeVisitor {
             private List<INamedItemInfo> _functions;

-            public FunctionSearch(List<INamedItemInfo> functions)
-            {
+            public FunctionSearch(List<INamedItemInfo> functions) {
                 _functions = functions;
             }

-            public bool Visit(ElementNode element, object parameter)
-            {
-                if (element.Name.Equals("tr", StringComparison.OrdinalIgnoreCase) && element.Children.Count == 2)
-                {
+            public bool Visit(ElementNode element, object parameter) {
+                if (element.Name.Equals("tr", StringComparison.OrdinalIgnoreCase) && element.Children.Count == 2) {
                     ElementNode tdNode1 = element.Children[0];
                     ElementNode tdNode2 = element.Children[1];

-                    if (tdNode1.Children.Count == 1 && tdNode1.Children[0].Name.Equals("a", StringComparison.OrdinalIgnoreCase))
-                    {
+                    if (tdNode1.Children.Count == 1 && tdNode1.Children[0].Name.Equals("a", StringComparison.OrdinalIgnoreCase)) {
                         string functionName = element.Root.TextProvider.GetText(tdNode1.Children[0].InnerRange);
-                        if (functionName.IndexOf('&') >= 0)
-                        {
+                        if (functionName.IndexOf('&') >= 0) {
                             functionName = WebUtility.HtmlDecode(functionName);
-                        }
-                        else if (!IsValidName(functionName))
-                        {
+                        } else if (!IsValidName(functionName)) {
                             return true;
                         }

                         NamedItemType itemType = GetItemType(functionName, tdNode1);
-                        if (itemType != NamedItemType.None)
-                        {
+                        if (itemType != NamedItemType.None) {
                             string functionDescription = element.Root.TextProvider.GetText(tdNode2.InnerRange) ?? string.Empty;
                             _functions.Add(new NamedItemInfo(functionName, functionDescription, itemType));
                         }
@@ -194,26 +210,19 @@
                 return true;
             }

-            private static NamedItemType GetItemType(string name, ElementNode td)
-            {
-                if (Constants.IsConstant(name) || Logicals.IsLogical(name) || name.StartsWith("R_", StringComparison.OrdinalIgnoreCase))
-                {
+            private static NamedItemType GetItemType(string name, ElementNode td) {
+                if (Constants.IsConstant(name) || Logicals.IsLogical(name) || name.StartsWith("R_", StringComparison.OrdinalIgnoreCase)) {
                     return NamedItemType.Constant;
                 }

-                if (td.Children.Count == 1)
-                {
+                if (td.Children.Count == 1) {
                     ElementNode a = td.Children[0];
                     AttributeNode href = a.GetAttribute("href");

-                    if (href != null && href.Value != null)
-                    {
-                        if (href.Value.IndexOf("constant", StringComparison.OrdinalIgnoreCase) >= 0)
-                        {
+                    if (href != null && href.Value != null) {
+                        if (href.Value.IndexOf("constant", StringComparison.OrdinalIgnoreCase) >= 0) {
                             return NamedItemType.Constant;
-                        }
-                        else if (href.Value.IndexOf("-package", StringComparison.OrdinalIgnoreCase) >= 0)
-                        {
+                        } else if (href.Value.IndexOf("-package", StringComparison.OrdinalIgnoreCase) >= 0) {
                             return NamedItemType.None;
                         }
                     }
@@ -222,19 +231,15 @@
                 return NamedItemType.Function;
             }

-            private bool IsValidName(string name)
-            {
+            private bool IsValidName(string name) {
                 bool hasCharacters = false;

-                if (name == null || name.Length == 0)
-                {
+                if (name == null || name.Length == 0) {
                     return false;
                 }

-                for (int i = 0; i < name.Length; i++)
-                {
-                    if (char.IsLetterOrDigit(name[i]))
-                    {
+                for (int i = 0; i < name.Length; i++) {
+                    if (char.IsLetterOrDigit(name[i])) {
                         hasCharacters = true;
                         break;
                     }


Ошибка в информации об исключении

Ошибка в информации об исключении

--- src/ScriptEngine/Compiler/CompilerExceptions.cs
+++ src/ScriptEngine/Compiler/CompilerExceptions.cs
@@ -23,7 +23,7 @@
         internal static CompilerException AppendCodeInfo(CompilerException exc, CodePositionInfo codePosInfo)
         {
             exc.LineNumber = codePosInfo.LineNumber;
-            exc.ColumnNumber = codePosInfo.LineNumber;
+            exc.ColumnNumber = codePosInfo.ColumnNumber;
             exc.Code = codePosInfo.Code;
             exc.ModuleName = codePosInfo.ModuleName;


Fail the deserialization tests if there are any incomplete ActorStates or Frames

--- RocketLeagueReplayParser.Tests/DeserializeTests.cs
+++ RocketLeagueReplayParser.Tests/DeserializeTests.cs
@@ -29,6 +29,10 @@
             //replay.ToObj();
             Console.WriteLine(replay.ToDebugString());
             //Console.WriteLine(replay.ToPositionJson());
+
+            Assert.IsFalse(replay.Frames.Any(x => !x.Complete));
+            Assert.IsFalse(replay.Frames.Any(x => x.ActorStates.Any(s=>!s.Complete)));
+            Assert.IsFalse(replay.Frames.Any(x => x.ActorStates.Any(s => s.ForcedComplete)));
         }

         [TestCaseSource("ReplayFiles")]


Ready for build test

Ready for build test

--- SENECA/Assets/Scripts/HARTO/HARTO_UI/RadialMenu.cs
+++ SENECA/Assets/Scripts/HARTO/HARTO_UI/RadialMenu.cs
@@ -46,6 +46,10 @@

 	public void Init(Player player, RadialMenuSpawner thisMenu)
 	{
+        if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
+        {
+            rotationSpeed = 50.0f;
+        }
         menuSpawner = thisMenu;
         iconSelected = false;
         _anim = GetComponent<Animator>();


KeywordModelData.Description/Key are now forced null on CM-side if not specified; ensure KeywordModel.Description/Key stays an empty string in that case.

--- Sdl.Web.Tridion/R2Mapping/DefaultModelBuilderR2.cs
+++ Sdl.Web.Tridion/R2Mapping/DefaultModelBuilderR2.cs
@@ -492,8 +492,8 @@

                 result.Id = keywordModelData.Id;
                 result.Title = keywordModelData.Title;
-                result.Description = keywordModelData.Description;
-                result.Key = keywordModelData.Key;
+                result.Description = keywordModelData.Description ?? string.Empty;
+                result.Key = keywordModelData.Key ?? string.Empty;
                 result.TaxonomyId = keywordModelData.TaxonomyId;

                 return result;


Fixed bug in GZip again...

Fixed bug in GZip again...

--- SharpZipLibCompressor/SharpZipLibGzipCompressor.cs
+++ SharpZipLibCompressor/SharpZipLibGzipCompressor.cs
@@ -66,7 +66,17 @@
             using (GZipOutputStream gzStream = new GZipOutputStream(outStream))
             {
                 gzStream.IsStreamOwner = false;
-                inStream.CopyTo(gzStream);
+                byte[] buffer = new byte[4096];
+
+                while (true)
+                {
+                    int readCount = inStream.Read(buffer, 0, buffer.Length);
+
+                    if (readCount == 0)
+                        break;
+
+                    gzStream.Write(buffer, 0, readCount);
+                }
             }

             writtenBytes = outStream.Position;
@@ -76,7 +86,21 @@
         public override void ReverseProcessDataStream(Stream inStream, Stream outStream, Dictionary<string, string> options, out long writtenBytes)
         {
             using (GZipInputStream zip = new GZipInputStream(inStream))
-                zip.CopyTo(outStream);
+            {
+                zip.IsStreamOwner = false;
+                byte[] buffer = new byte[4096];
+
+                while (true)
+                {
+                    var readCount = zip.Read(buffer, 0, buffer.Length);
+
+
+                    if (readCount == 0)
+                        break;
+
+                    outStream.Write(buffer, 0, readCount);
+                }
+            }

             writtenBytes = outStream.Position;
         }


add IgnoreAttribute to EntityJsonConverter

--- Signum.React/JsonConverters/EntityJsonConverter.cs
+++ Signum.React/JsonConverters/EntityJsonConverter.cs
@@ -341,13 +341,16 @@
                     {
                         if (!markedAsModified && parentRoute.RootType.IsEntity())
                         {
-                            try
+                            if (!pi.HasAttribute<IgnoreAttribute>())
                             {
-                                //Call attention of developer
-                                throw new InvalidOperationException($"'modified' is not set but '{pi.Name}' is modified");
-                            }
-                            catch (Exception)
-                            {
+                                try
+                                {
+                                    //Call attention of developer
+                                    throw new InvalidOperationException($"'modified' is not set but '{pi.Name}' is modified");
+                                }
+                                catch (Exception)
+                                {
+                                }
                             }

                         }


fix CSharpRenderer for generic nested types

--- Signum.Utilities/ExpressionTrees/CSharpRenderer.cs
+++ Signum.Utilities/ExpressionTrees/CSharpRenderer.cs
@@ -115,11 +115,27 @@

         public static string TypeName(this Type type)
         {
+            List<Type> arguments = type.IsGenericType ? type.GetGenericArguments().ToList() : null;
+
+            StringBuilder sb = new StringBuilder();
+            foreach (var item in type.Follow(a => a.IsNested ? a.DeclaringType : null).Reverse())
+            {
+                if (sb.Length > 0)
+                    sb.Append(".");
+
+                sb.Append(TypeNameSimple(item, arguments));
+            }
+
+            return sb.ToString();
+        }
+
+        static string TypeNameSimple(Type type, List<Type> globalGenericArguments)
+        {
             if (type == typeof(object))
                 return "object";

             if (type.IsEnum)
-                return type.Name;
+                return type.Name;

             string result = basicTypes.TryGetC(Type.GetTypeCode(type));
             if (result != null)
@@ -132,13 +148,13 @@
             if (ut != null)
                 return "{0}?".FormatWith(ut.TypeName());

-            if (type.IsGenericType)
-            {
-                if (type.IsGenericTypeDefinition)
-                    return "{0}<{1}>".FormatWith(type.Name.Split('`')[0], type.GetGenericArguments().ToString(_ => "", ","));
-
-                return "{0}<{1}>".FormatWith(type.Name.Split('`')[0], type.GetGenericArguments().ToString(t => TypeName(t), ","));
-
+            if (type.IsGenericType && globalGenericArguments.Count > 0)
+            {
+                var args = globalGenericArguments.Take(type.GetGenericArguments().Length).ToList();
+
+                globalGenericArguments.RemoveRange(0, args.Count);
+
+                return "{0}<{1}>".FormatWith(type.Name.Before('`'), args.ToString(t => TypeName(t), ","));
             }

             return type.Name;


(TFS CS 4686)

(TFS CS 4686)

--- Signum.Web.Extensions/Help/WikiParserExtensions.cs
+++ Signum.Web.Extensions/Help/WikiParserExtensions.cs
@@ -21,7 +21,7 @@
     {
         public static string WikiUrl = "http://192.168.0.5:8085/";
         public static string ImagesFolder = "HelpImagenes/";
-
+
         public class WikiLink
         {
             public string Text { get; set; }
@@ -126,7 +126,7 @@
                         Type type = HelpLogic.GetNameToType(parts[0], false);
                         //TODO: NiceToString de la propiedad
                         result = new WikiLink(type != null ? HelpLogic.EntityUrl(type) + "#" + "p-" + parts[1] : link,
-                            text.HasText() ? text : parts[1],
+                            text.HasText() ? text.NiceName() : parts[1],
                             type != null ? "" : "unavailable");
                         break;

@@ -174,6 +174,11 @@

         public static string WikiParse(this HtmlHelper html, string content)
         {
+            return WikiParse(html, content, w => w.ToHtmlString(), true);
+        }
+
+        public static string WikiParse(this HtmlHelper html, string content, Func<WikiLink, string> linkParser, bool processFormat)
+        {
             StringBuilder sb = new StringBuilder();
             int firstIndex = 0;

@@ -191,30 +196,30 @@
                 {
                     case WikiFormat.EntityLink:
                         Type t = HelpLogic.GetNameToType(link, false);
-                        result = new WikiLink(t != null ? HelpLogic.EntityUrl(t) : link,
+                        result = linkParser(new WikiLink(t != null ? HelpLogic.EntityUrl(t) : link,
                             text.HasText() ? text : t != null ? t.NiceName() : link,
-                            t != null ? "" : "unavailable").ToHtmlString();
+                            t != null ? "" : "unavailable"));
                         break;

                     case WikiFormat.HyperLink:
-                        result = new WikiLink(link, text).ToHtmlString();
+                        result = linkParser(new WikiLink(link, text));
                         break;

                     case WikiFormat.OperationLink:
                         Enum operation = EnumLogic<OperationDN>.TryToEnum(link);
-                        result = new WikiLink(operation != null ?
+                        result = linkParser(new WikiLink(operation != null ?
                             HelpLogic.EntityUrl(OperationLogic.FindType(operation)) + "#" + "o-" + OperationDN.UniqueKey(operation).Replace('.', '_') : link,
                             text.HasText() ? text : (operation != null ? operation.NiceToString() : link),
-                            operation != null ? "" : "unavailable").ToHtmlString();
+                            operation != null ? "" : "unavailable"));
                         break;

                     case WikiFormat.PropertyLink:
                         string[] parts = link.Split('.');
                         Type type = HelpLogic.GetNameToType(parts[0], false);
                         //TODO: NiceToString de la propiedad
-                        result = new WikiLink(type != null ? HelpLogic.EntityUrl(type) + "#" + "p-" + parts[1] : link,
+                        result = linkParser(new WikiLink(type != null ? HelpLogic.EntityUrl(type) + "#" + "p-" + parts[1] : link,
                             text.HasText() ? text : parts[1],
-                            type != null ? "" : "unavailable").ToHtmlString();
+                            type != null ? "" : "unavailable"));
                         break;

                     case WikiFormat.QueryLink:
@@ -222,33 +227,33 @@
                         if (o as Enum != null)
                         {
                             Enum query = (Enum)o;
-                            result = new WikiLink(
+                            result = linkParser(new WikiLink(
                                 query != null ? (HelpLogic.EntityUrl(DynamicQueryManager.Current[query].EntityColumn().DefaultEntityType()) + "#" + "q-" + QueryUtils.GetQueryName(query).ToString().Replace(".", "_")) : link,
                                 text.HasText() ? text : (query != null ? QueryUtils.GetNiceQueryName(query) : link),
-                                query != null ? "" : "unavailable").ToHtmlString();
+                                query != null ? "" : "unavailable"));
                         }
                         else
                         {
                             Type query = (Type)o;
-                            result = new WikiLink(
+                            result = linkParser(new WikiLink(
                                 query != null ? (HelpLogic.EntityUrl(query) + "#" + "q-" + query.FullName.Replace(".", "_")) : link,
                                 text.HasText() ? text : (query != null ? QueryUtils.GetNiceQueryName(query) : link),
-                                query != null ? "" : "unavailable").ToHtmlString();
+                                query != null ? "" : "unavailable"));

                             //Treat as entity
                         }
                         break;

                     case WikiFormat.WikiLink:
-                        result = new WikiLink(WikiUrl + link, text.HasText() ? text : "Enlace a wiki").ToHtmlString();
+                        result = linkParser(new WikiLink(WikiUrl + link, text.HasText() ? text : "Enlace a wiki"));
                         break;

                     case WikiFormat.NameSpaceLink:
                         NamespaceHelp nameSpace = HelpLogic.GetNamespace(link);
-                        result = new WikiLink(
+                        result = linkParser(new WikiLink(
                             HelpLogic.BaseUrl + "/Namespace/" + link,
                             text.HasText() ? text : link,
-                            nameSpace != null ? "" : "unavailable").ToHtmlString();
+                            nameSpace != null ? "" : "unavailable"));
                         break;
                 }

@@ -260,57 +265,57 @@
             sb.Append(content.Substring(firstIndex, content.Length - firstIndex));

             string postLinks = sb.ToString();
-            postLinks = ProcessImages(postLinks);
+            if (processFormat) postLinks = ProcessImages(postLinks);

             // Replacing both
             postLinks = Regex.Replace(postLinks,
             "(?<begin>'''''{1})(?<content>.+?)(?<end>'''''{1})",
-            "${content}",
+            processFormat ? "${content}" : "${content}",
             RegexOptions.Compiled);

             // Replacing bolds
             postLinks = Regex.Replace(postLinks,
             "(?<begin>'''{1})(?<content>.+?)(?<end>'''{1})",
-            "${content}",
+            processFormat ? "${content}" : "${content}",
             RegexOptions.Compiled);

             // Replacing italics
             postLinks = Regex.Replace(postLinks,
             "(?<begin>''{1})(?<content>.+?)(?<end>''{1})",
-            "${content}",
+            processFormat ? "${content}" : "${content}",
             RegexOptions.Compiled);

             // Replacing underlined
             postLinks = Regex.Replace(postLinks,
             "(?<begin>__{1})(?<content>.+?)(?<end>__{1})",
-            "${content}",
+            processFormat ? "${content}" : "${content}",
             RegexOptions.Compiled);

             // Replacing strike
             postLinks = Regex.Replace(postLinks,
             "(?<begin>\\-\\-{1})(?<content>.+?)(?<end>\\-\\-{1})",
-            "<s>${content}</s>",
+            processFormat ? "<s>${content}</s>" : "${content}",
             RegexOptions.Compiled);

             // Replacing lists
             postLinks = Regex.Replace(postLinks,
      "(?<begin>\\*{1}[ ]{1})(?<content>.+)(?<end>[^*]?)[\\n]*",
-     "
${content}
",
+     processFormat ? "
${content}
" : "${content}",
      RegexOptions.Compiled);

             postLinks = Regex.Replace(postLinks,
      "(?<begin>\\#{1}[ ]{1})(?<content>.+)(?<end>[^#]?)[\\n]*",
-     "<oli>${content}</oli>",
+     processFormat ? "<oli>${content}</oli>" : "${content}",
      RegexOptions.Compiled);

             postLinks = Regex.Replace(postLinks,
             "(?<content>\\
{1}.+\\<\\/li\\>)",
-            "
${content}
",
+            processFormat ? "
${content}
" : "${content}",
             RegexOptions.Compiled);

             postLinks = Regex.Replace(postLinks,
        "(?<content>\\<oli\\>{1}.+\\<\\/oli\\>)",
-       "
${content}
",
+        processFormat ? "
${content}
" : "${content}",
        RegexOptions.Compiled);

             postLinks = Regex.Replace(postLinks,
@@ -323,15 +328,22 @@

             // Replacing titles
-            postLinks = Regex.Replace(postLinks,
-            "(?<begin>={2,})(?<content>[^\\n]+?)(?<end>={2,})[\\n]*",
-            meTitle,
-            RegexOptions.Compiled);
-
-            //Remove multiple breakline
-            postLinks = Regex.Replace(postLinks,
-           "(?<content>\n{2,})", "\n",
-           RegexOptions.Compiled);
+            if (processFormat)
+                postLinks = Regex.Replace(postLinks,
+                "(?<begin>={2,})(?<content>[^\\n]+?)(?<end>={2,})[\\n]*",
+                meTitle,
+                RegexOptions.Compiled);
+            else
+                postLinks = Regex.Replace(postLinks,
+                "(?<begin>={2,})(?<content>[^\\n]+?)(?<end>={2,})[\\n]*",
+                "${content}",
+                RegexOptions.Compiled);
+
+
+            //Remove multiple breakline
+                postLinks = Regex.Replace(postLinks,
+               "(?<content>\n{2,})", "\n",
+               RegexOptions.Compiled);

             /*     postLinks = Regex.Replace(postLinks,
                  "(?<begin>\\*{1}[ ]{1})(?<content>.+)(?<end>[^*])",


Added AdapterCreated event to adapter loader in order to set ServiceMonitor.PersistSettings to true.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openXDA/Main;C85945

--- Source/Applications/openFLE/openFLE/ServiceHost.cs
+++ Source/Applications/openFLE/openFLE/ServiceHost.cs
@@ -118,6 +118,7 @@

             // Set up adapter loader to load service monitors
             m_serviceMonitors = new AdapterLoader<IServiceMonitor>();
+            m_serviceMonitors.AdapterCreated += ServiceMonitors_AdapterCreated;
             m_serviceMonitors.AdapterLoaded += ServiceMonitors_AdapterLoaded;
             m_serviceMonitors.AdapterUnloaded += ServiceMonitors_AdapterUnloaded;
             m_serviceMonitors.Initialize();
@@ -217,6 +218,12 @@
         }

         #region [ Service Monitor Handlers ]
+
+        // Ensure that service monitors save their settings to the configuration file
+        private void ServiceMonitors_AdapterCreated(object sender, EventArgs<IServiceMonitor> e)
+        {
+            e.Argument.PersistSettings = true;
+        }

         // Display a message when service monitors are loaded
         private void ServiceMonitors_AdapterLoaded(object sender, EventArgs<IServiceMonitor> e)


(GH-661) Add setting of IsPrerelease property

To correctly identify a package as being pre-release or not.

--- Source/ChocolateyGui/Services/ChocolateyService.cs
+++ Source/ChocolateyGui/Services/ChocolateyService.cs
@@ -497,6 +497,8 @@
                 mappedPackage.IsInstalled = !string.IsNullOrWhiteSpace(package.InstallLocation) || forceInstalled;
                 mappedPackage.IsSideBySide = packageInfo.IsSideBySide;

+                mappedPackage.IsPrerelease = !string.IsNullOrWhiteSpace(mappedPackage.Version.SpecialVersion);
+
                 // Add a sanity check here for pre-release packages
                 // By default, pre-release packages are marked as IsLatestVersion = false, however, IsLatestVersion is
                 // what is used to show/hide the Out of Date message in the UI.  In these cases, if it is a pre-release


使用双下划线替代减号作为目录分隔符。

使用双下划线替代减号作为目录分隔符。

--- TexturePackerCaller.cs
+++ TexturePackerCaller.cs
@@ -346,7 +346,7 @@

 				foreach (DirectoryInfo subDir in srcDir.GetDirectories())
 				{
-					ScanDirSingleLevelOutput(subDir, dstDir, (0 == relativePath.Length) ? subDir.Name : (relativePath + "-" + subDir.Name));
+					ScanDirSingleLevelOutput(subDir, dstDir, (0 == relativePath.Length) ? subDir.Name : (relativePath + "__" + subDir.Name));
 				}
 			}
 		}
@@ -434,7 +434,7 @@
 										{
 											if ("key" == frameSubNode.Name)
 											{
-												frameSubNode.InnerText = prefix + "-" + frameSubNode.InnerText;
+												frameSubNode.InnerText = prefix + "__" + frameSubNode.InnerText;
 											}
 										}
 									}


fix: bags are using Convert still can be improved from performance point of view

--- TheWheel.Domain/Bag.cs
+++ TheWheel.Domain/Bag.cs
@@ -230,36 +230,51 @@

         internal static ulong Hash(TKey key)
         {
-            var stringKey = key as string;
-            if (stringKey != null)
-            {
-                var hash = hashOffset;
-                var tmp = new byte[(stringKey.Length + 1) * 2];
-                unsafe
-                {
-                    fixed (void* ptr = stringKey)
-                    {
-                        Marshal.Copy(new IntPtr(ptr), tmp, 0, tmp.Length);
-                    }
-                }
-
-                //FNV-1 hash
-                for (var i = 0; i < tmp.Length; i++)
-                {
-                    hash *= hashPrime;
-                    hash ^= tmp[i];
-                }
-
-
-
-                return hash;
-                //var hashText = new SHA256CryptoServiceProvider().ComputeHash(bytes);
-                //uint hashCodeStart = BitConverter.ToUInt32(hashText, 0);
-                //uint hashCodeMedium = BitConverter.ToUInt32(hashText, 8);
-                //uint hashCodeEnd = BitConverter.ToUInt32(hashText, 24);
-                //return hashCodeStart ^ hashCodeMedium ^ hashCodeEnd;
-            }
-            return Convert.ToUInt64(key.GetHashCode());
+            switch (Convert.GetTypeCode(key))
+            {
+                case TypeCode.String:
+                    var stringKey = key as string;
+
+                    if (stringKey != null)
+                    {
+                        var hash = hashOffset;
+                        var tmp = new byte[(stringKey.Length + 1) * 2];
+                        unsafe
+                        {
+                            fixed (void* ptr = stringKey)
+                            {
+                                Marshal.Copy(new IntPtr(ptr), tmp, 0, tmp.Length);
+                            }
+                        }
+
+                        //FNV-1 hash
+                        for (var i = 0; i < tmp.Length; i++)
+                        {
+                            hash *= hashPrime;
+                            hash ^= tmp[i];
+                        }
+
+
+
+                        return hash;
+                        //var hashText = new SHA256CryptoServiceProvider().ComputeHash(bytes);
+                        //uint hashCodeStart = BitConverter.ToUInt32(hashText, 0);
+                        //uint hashCodeMedium = BitConverter.ToUInt32(hashText, 8);
+                        //uint hashCodeEnd = BitConverter.ToUInt32(hashText, 24);
+                        //return hashCodeStart ^ hashCodeMedium ^ hashCodeEnd;
+                    }
+                    return Convert.ToUInt64(key.GetHashCode());
+                case TypeCode.UInt16:
+                case TypeCode.UInt32:
+                case TypeCode.UInt64:
+                case TypeCode.Int16:
+                case TypeCode.Int32:
+                    return Convert.ToUInt64(key);
+                case TypeCode.Int64:
+                    return Convert.ToUInt64(key);
+                default:
+                    return Convert.ToUInt64(key.GetHashCode());
+            }
         }

         private ulong GetPreferredIndex(TKey key)


S-57908: Compatibility Template Provider needs to be exposed.

--- source/TemplateProvider.cs
+++ source/TemplateProvider.cs
@@ -13,7 +13,7 @@
 		ITemplateSet Load(string culture);
 	}

-	internal class CompatibilityTemplateProvider : ITemplateProvider
+	public class CompatibilityTemplateProvider : ITemplateProvider
 	{
 		private readonly ITemplateSetLoader _loader;
 		private readonly string _setname;


implement Finally().

implement Finally().

--- System.Reactive/System.Reactive.Linq/Observable.cs
+++ System.Reactive/System.Reactive.Linq/Observable.cs
@@ -534,7 +534,9 @@
 		}

 		public static IObservable<TSource> Finally<TSource> (this IObservable<TSource> source, Action finallyAction)
-		{ throw new NotImplementedException (); }
+		{
+			return source.Do (v => {}, ex => finallyAction (), () => finallyAction ());
+		}

 		public static Func<IObservable<Unit>> FromAsyncPattern(
 			Func<AsyncCallback, Object, IAsyncResult> begin,


update

update

--- sdk/eventhub/Microsoft.Azure.EventHubs/tests/Client/WebSocketTests.cs
+++ sdk/eventhub/Microsoft.Azure.EventHubs/tests/Client/WebSocketTests.cs
@@ -132,20 +132,28 @@
             // Send call should fail.
             await Assert.ThrowsAsync<WebSocketException>(async () =>
             {
-                var ehClient = EventHubClient.CreateFromConnectionString(webSocketConnString);
+                await using (var scope = await EventHubScope.CreateAsync(2))
+                {
+                var connectionString = TestUtility.BuildEventHubsConnectionString(scope.EventHubName);
+                var ehClient = EventHubClient.CreateFromConnectionString(GetWebSocketConnectionString(connectionString));
                 ehClient.WebProxy = new WebProxy("http://1.2.3.4:9999");
                 var edToFail = new EventData(Encoding.UTF8.GetBytes("This is a sample event."));
                 await ehClient.SendAsync(edToFail);
+                }
             });

             // Receive call should fail.
             await Assert.ThrowsAsync<WebSocketException>(async () =>
-            {
-                var ehClient = EventHubClient.CreateFromConnectionString(webSocketConnString);
+            {
+                await using (var scope = await EventHubScope.CreateAsync(2))
+                {
+                var connectionString = TestUtility.BuildEventHubsConnectionString(scope.EventHubName);
+                var ehClient = EventHubClient.CreateFromConnectionString(GetWebSocketConnectionString(connectionString));
                 ehClient.WebProxy = new WebProxy("http://1.2.3.4:9999");
                 await ehClient.CreateReceiver(PartitionReceiver.DefaultConsumerGroupName, "0", EventPosition.FromStart()).ReceiveAsync(1);
+                }
             });

@@ -153,16 +161,24 @@
             // Management link call should fail.
             await Assert.ThrowsAsync<WebSocketException>(async () =>
             {
-                var ehClient = EventHubClient.CreateFromConnectionString(webSocketConnString);
+                await using (var scope = await EventHubScope.CreateAsync(2))
+                {
+                var connectionString = TestUtility.BuildEventHubsConnectionString(scope.EventHubName);
+                var ehClient = EventHubClient.CreateFromConnectionString(GetWebSocketConnectionString(connectionString));
                 ehClient.WebProxy = new WebProxy("http://1.2.3.4:9999");
                 await ehClient.GetRuntimeInformationAsync();
+                }
             });

             // Send/receive should work fine w/o proxy.
-            var ehNoProxyClient = EventHubClient.CreateFromConnectionString(webSocketConnString);
-            var eventData = new EventData(Encoding.UTF8.GetBytes("This is a sample event."));
+              await using (var scope = await EventHubScope.CreateAsync(2))
+             {
+                var connectionString = TestUtility.BuildEventHubsConnectionString(scope.EventHubName);
+                var ehNoProxyClient = EventHubClient.CreateFromConnectionString(GetWebSocketConnectionString(connectionString));
+                var eventData = new EventData(Encoding.UTF8.GetBytes("This is a sample event."));
+            }
         }
 #endif
     }


Fixed DataLake bug where query parameters were logged as headers (#9221)


Add Youtube Search

Add Youtube Search

--- TubeTalk/MainDialog.cs
+++ TubeTalk/MainDialog.cs
@@ -7,12 +7,17 @@
 using Microsoft.Bot.Connector;
 using System.Text.RegularExpressions;
 using System.Net.Http;
+using Google.Apis.YouTube.v3;
+using Google.Apis.Services;
+using System.Web.Configuration;
+using System.Configuration;

 namespace TubeTalk
 {
     [Serializable]
     public class MainDialog : IDialog<object>
     {
+
         static HttpClient client = new HttpClient();
         public async Task StartAsync(IDialogContext context)
         {
@@ -23,8 +28,8 @@
         {
             var message = await argument;
             // Put correct regex here
-            //var regex = new Regex("http(?:s?):\\/\\/(?:www\\.)?youtu(?:be\\.com\\/watch\\?v=|\\.be\\/)([\\w\\-\\_]*)(&(amp;)?[\\w\\?=]*)?");
             var regex = new Regex("^http");
+            //var regex = new Regex(@"http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?");
             if (regex.Match(message.Text).Success)
             {
                 try
@@ -41,9 +46,22 @@
             }
             else
             {
+                Activity replyToConversation = context.MakeMessage() as Activity;
+                replyToConversation.Attachments = new List<Attachment>();
+
                 // Non link - query Youtube here
-                GetYoutubeVideos(message.Text);
-                await context.PostAsync("Please paste a URL for the Youtube content you desire.");
+
+                var herocards = await GetYoutubeVideos(message.Text);
+
+                foreach(var heroCard in herocards)
+                {
+                    Attachment plAttachment = heroCard.ToAttachment();
+                    replyToConversation.Attachments.Add(plAttachment);
+                }
+
+                await context.PostAsync(replyToConversation);
+
+                //await context.PostAsync("Please paste a URL for the Youtube content you desire.");
                 context.Wait(MessageReceivedAsync);
             }
         }
@@ -80,33 +98,59 @@
         /// Hero Cards will appear in a carosel and look pretty
         /// </summary>
         /// <param name="text"></param>
-        private List<HeroCard> GetYoutubeVideos(string text)
+        private async Task<List<HeroCard>> GetYoutubeVideos(string text)
         {
             List<HeroCard> vidcards = new List<HeroCard>();

+
+            string youtubePrefix = "https://www.youtube.com/watch?v=";
+
             // query youtube api
+            var youtubeService = new YouTubeService(new BaseClientService.Initializer()
+
+            {
+
+                ApiKey = WebConfigurationManager.AppSettings["YoutubeKey"],
+
+                ApplicationName = "Searchler"
+
+            });
+
+
+
+            var searchListRequest = youtubeService.Search.List("snippet");
+
+            searchListRequest.MaxResults = 3;

             // get back title of the video, thumbnail, desctiption, url
-

-            foreach (Object x in YoutubePostResult)
+            searchListRequest.Q = text;
+
+            var searchListResponse = await searchListRequest.ExecuteAsync();
+
+
+            foreach (var searchResult in searchListResponse.Items)
             {
-
+
+                var downloadURL = await CallYoutubeExtractorFunction(youtubePrefix + searchResult.Id.VideoId);
+
+                downloadURL = downloadURL.Remove(0,13);
+
                 HeroCard vidHeroCard = new HeroCard()
                 {
-                    Title = videoname,
-                    Subtitle = videodescription,
+                    Title = searchResult.Snippet.Title,
+                    Subtitle = searchResult.Snippet.Description,
                     Images = new List<CardImage>()
                         {
-                            new CardImage() { Url = videoThumbnail }
+                            new CardImage() { Url = searchResult.Snippet.Thumbnails.Medium.Url }
                         },
                     Buttons = new List<CardAction>()
                         {
                             new CardAction()
                             {
-                                Title = "More details",
-                                Type = ActionTypes.OpenUrl,
-                                Value = videourl
+                                Title = "Open Download Link",
+                                Type = ActionTypes.DownloadFile,
+                                Value = downloadURL
                             }
                         }
                 };


Refactored ScannerState

Refactored ScannerState

--- src/ScannerState.cs
+++ src/ScannerState.cs
@@ -1,16 +1,69 @@
 using System;
+using IronRuby.Builtins;

 namespace IronRuby.Libraries.Hpricot {
+    public class ScannerState {
+        #region fields

-    // TODO: I am starting off with this, it will be refactored later.
+        private Object _doc;
+        private Object _focus;
+        private Object _last;
+        private Object _EC;
+        private bool _xml;
+        private bool _strict;
+        private bool _fixup;

-    public class ScannerState {
-        public Object doc;
-        public Object focus;
-        public Object last;
-        public Object EC;
-        public bool xml;
-        public bool strict;
-        public bool fixup;
+        #endregion
+
+        #region constructors
+
+        public ScannerState() {
+            _xml = false;
+            _strict = false;
+            _fixup = false;
+        }
+
+        #endregion
+
+        #region properties
+
+        public Object Doc {
+            get { return _doc; }
+            set { _doc = value; }
+        }
+
+        public Object Focus {
+            get { return _focus; }
+            set { _focus = value; }
+        }
+
+        public Object Last {
+            get { return _last; }
+            set { _last = value; }
+        }
+
+        public Object EC {
+            get { return _EC; }
+            set { _EC = value; }
+        }
+
+        public bool Xml {
+            get { return _xml; }
+            set { _xml = value; }
+        }
+
+        public bool Strict {
+            get { return _strict; }
+
+            //TODO: setting Strict to true should set Fixup to true automatically.
+            set { _strict = value; }
+        }
+
+        public bool Fixup {
+            get { return _fixup; }
+            set { _fixup = value; }
+        }
+
+        #endregion
     }
 }


Disable MulticastInterface_Set_AnyInterface_Succeeds test on Fedora (#24010)

All Fedora runs hang because of this.

--- src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
+++ src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
@@ -6,6 +6,7 @@
 using System.Net.Test.Common;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;

 using Xunit;
@@ -86,6 +87,11 @@
         [Fact]
         public async Task MulticastInterface_Set_AnyInterface_Succeeds()
         {
+            if (PlatformDetection.IsFedora)
+            {
+                return; // [ActiveIssue(24008)]
+            }
+
             // On all platforms, index 0 means "any interface"
             await MulticastInterface_Set_Helper(0);
         }
@@ -129,6 +135,10 @@
                 {
                     sendSocket.SendTo(Encoding.UTF8.GetBytes(message), new IPEndPoint(multicastAddress, port));
                 }
+
+                var cts = new CancellationTokenSource();
+                Assert.True(await Task.WhenAny(receiveTask, Task.Delay(20_000, cts.Token)) == receiveTask, "Waiting for received data timed out");
+                cts.Cancel();

                 int bytesReceived = await receiveTask;
                 string receivedMessage = Encoding.UTF8.GetString(receiveBuffer, 0, bytesReceived);


[DOCS] Changed certgen to certutil (#3012)

--- src/Tests/ClientConcepts/Certificates/WorkingWithCertificates.doc.cs
+++ src/Tests/ClientConcepts/Certificates/WorkingWithCertificates.doc.cs
@@ -110,7 +110,7 @@
 		 * If your client application has access to the public CA certificate locally, Elasticsearch.NET and NEST ship with some handy helpers
 		 * that can assert that a certificate the server presents is one that came from the local CA.
 		 *
-		 * If you use X-Pack's `certgen` tool to {xpack_current}/ssl-tls.html[generate SSL certificates], the generated node certificate
+		 * If you use X-Pack's {ref_current}/certutil.html[`certutil` tool] to generate SSL certificates, the generated node certificate
 		 * does not include the CA in the certificate chain, in order to cut down on SSL handshake size. In those case you can use
 		 * `CertificateValidations.AuthorityIsRoot` and pass it your local copy of the CA public key to assert that
 		 * the certificate the server presented was generated using it
@@ -176,16 +176,16 @@
 		 * ==== Client Certificates
 		 *
 		 * X-Pack also allows you to configure a {xpack_current}/pki-realm.html[PKI realm] to enable user authentication
-		 * through client certificates. The `certgen` tool included with X-Pack allows you to
-		 * {ref_current}/certgen.html[generate client certificates as well] and assign the distinguished name (DN) of the
+		 * through client certificates. The {ref_current}/certutil.html[`certutil` tool] included with X-Pack allows you to
+		 * generate client certificates as well and assign the distinguished name (DN) of the
 		 * certificate to a user with a certain role.
 		 *
-		 * certgen by default only generates a public certificate (`.cer`) and a private key `.key`. To authenticate with client certificates, you need to present both
+		 * By default, the `certutil` tool only generates a public certificate (`.cer`) and a private key `.key`. To authenticate with client certificates, you need to present both
 		 * as one certificate. The easiest way to do this is to generate a `pfx` or `p12` file from the `.cer` and `.key`
 		 * and attach these to requests using `new X509Certificate(pathToPfx)`.
 		 *
 		 * If you do not have a way to run `openssl` or `Pvk2Pfx` to do this as part of your deployments the clients ships with a handy helper to generate one
-		 * on the fly by passing the paths to the `.cer`  and `.key` files that `certgen` outputs. Sadly, this functonality is not available on .NET Core because
+		 * on the fly by passing the paths to the `.cer`  and `.key` files that `certutil` outputs. Sadly, this functonality is not available on .NET Core because
 		 * the `PublicKey` property cannot be set on the crypto service provider that is used to generate the `pfx` file at runtime.
 		 *
 		 * You can set Client Certificates to use on all connections on `ConnectionSettings`


Fix failing tests.

Fix failing tests.

Filter now gets set on initialize.

--- src/UnitTests/GitHub.App/ViewModels/PullRequestListViewModelTests.cs
+++ src/UnitTests/GitHub.App/ViewModels/PullRequestListViewModelTests.cs
@@ -23,10 +23,10 @@
             var prViewModel = new PullRequestListViewModel(repositoryHost, repository, settings);

             prViewModel.Initialize(null);
-            prViewModel.PullRequests.DidNotReceive().Filter = AnyFilter;
+            prViewModel.PullRequests.Received(1).Filter = AnyFilter;

             prViewModel.SelectedAssignee = prViewModel.PullRequests[0].Assignee;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;
         }

         [Fact]
@@ -38,16 +38,16 @@
             var prViewModel = new PullRequestListViewModel(repositoryHost, repository, settings);

             prViewModel.Initialize(null);
-            prViewModel.PullRequests.DidNotReceive().Filter = AnyFilter;
+            prViewModel.PullRequests.Received(1).Filter = AnyFilter;

             prViewModel.SelectedAssignee = prViewModel.PullRequests[0].Assignee;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;

             // Setting the Assignee filter to [None] should not trigger a filter:
             // doing this will remove the [None] entry from Assignees, which will cause
             // the selection in the view to be set to null which will reset the filter.
             prViewModel.SelectedAssignee = prViewModel.EmptyUser;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;
         }

         [Fact]
@@ -59,10 +59,10 @@
             var prViewModel = new PullRequestListViewModel(repositoryHost, repository, settings);

             prViewModel.Initialize(null);
-            prViewModel.PullRequests.DidNotReceive().Filter = AnyFilter;
+            prViewModel.PullRequests.Received(1).Filter = AnyFilter;

             prViewModel.SelectedAuthor = prViewModel.PullRequests[0].Author;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;
         }

         [Fact]
@@ -74,16 +74,16 @@
             var prViewModel = new PullRequestListViewModel(repositoryHost, repository, settings);

             prViewModel.Initialize(null);
-            prViewModel.PullRequests.DidNotReceive().Filter = AnyFilter;
+            prViewModel.PullRequests.Received(1).Filter = AnyFilter;

             prViewModel.SelectedAuthor = prViewModel.PullRequests[0].Author;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;

             // Setting the Author filter to [None] should not trigger a filter:
             // doing this will remove the [None] entry from Authors, which will cause
             // the selection in the view to be set to null which will reset the filter.
             prViewModel.SelectedAuthor = prViewModel.EmptyUser;
-            prViewModel.PullRequests.Received(1).Filter = AnyFilter;
+            prViewModel.PullRequests.Received(2).Filter = AnyFilter;
         }

         Func<IPullRequestModel, int, IList<IPullRequestModel>, bool> AnyFilter =>


Remove silly prefix of test names

Remove silly prefix of test names

--- src/Workspaces/CoreTest/SolutionTests/ProjectDependencyGraphTests.cs
+++ src/Workspaces/CoreTest/SolutionTests/ProjectDependencyGraphTests.cs
@@ -18,7 +18,7 @@
         #region GetTopologicallySortedProjects

         [Fact, Trait(Traits.Feature, Traits.Features.Workspace)]
-        public void ProjectDependencyGraph_GetTopologicallySortedProjects()
+        public void TestGetTopologicallySortedProjects()
         {
             VerifyTopologicalSort("A", "A");
             VerifyTopologicalSort("A B", "AB", "BA");
@@ -42,7 +42,7 @@

         [Fact, Trait(Traits.Feature, Traits.Features.Workspace)]
         [WorkItem(542438, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542438")]
-        public void ProjectDependencyGraph_GetDependencySets()
+        public void TestGetDependencySets()
         {
             VerifyDependencySets("A B:A C:A D E:D F:D", "ABC DEF");
             VerifyDependencySets("A B:A,C C", "ABC");
@@ -68,7 +68,7 @@
         #region GetProjectsThatThisProjectTransitivelyDependsOn

         [Fact, Trait(Traits.Feature, Traits.Features.Workspace)]
-        public void ProjectDependencyGraph_GetProjectsThatThisProjectTransitivelyDependsOn()
+        public void TestGetProjectsThatThisProjectTransitivelyDependsOn()
         {
             VerifyTransitiveReferences(CreateSolutionFromReferenceMap("A"), "A", new string[] { });
             VerifyTransitiveReferences(CreateSolutionFromReferenceMap("B:A A"), "B", new string[] { "A" });
@@ -94,7 +94,7 @@
         #region GetProjectsThatTransitivelyDependOnThisProject

         [Fact, Trait(Traits.Feature, Traits.Features.Workspace)]
-        public void ProjectDependencyGraph_GetProjectsThatTransitivelyDependOnThisProject()
+        public void TestGetProjectsThatTransitivelyDependOnThisProject()
         {
             VerifyReverseTransitiveReferences(CreateSolutionFromReferenceMap("A"), "A", new string[] { });
             VerifyReverseTransitiveReferences(CreateSolutionFromReferenceMap("B:A A"), "A", new string[] { "B" });


Proper lucene tests, creating logs, searching it and delete it

--- Tests/CK.Glouton.Tests.NetFramework/LuceneTests.cs
+++ Tests/CK.Glouton.Tests.NetFramework/LuceneTests.cs
@@ -1,6 +1,11 @@
 using CK.Core;
 using NUnit.Framework;
+using FluentAssertions;
 using System.Threading;
+using CK.Glouton.Lucene;
+using System.Reflection;
+using System;
+using System.IO;

 namespace CK.Glouton.Tests
 {
@@ -11,10 +16,12 @@
         public void SetUp()
         {
             TestHelper.Setup();
+            var logDir = Assembly.GetExecutingAssembly().FullName.Split(',')[0];
+            Array.ForEach(Directory.GetFiles(LuceneConstant.GetPath(logDir)), File.Delete);
         }

         [Test]
-        public void log_can_be_indexed()
+        public void log_can_be_indexed_and_searched()
         {
             using( var server = TestHelper.DefaultGloutonServer() )
             {
@@ -29,6 +36,14 @@
                 Thread.Sleep(500);
                 g.Dispose();
             }
+            var logDir = Assembly.GetExecutingAssembly().FullName.Split(',')[0];
+
+            LuceneSearcher searcher = new LuceneSearcher(LuceneConstant.GetPath(logDir), new[] { "LogLevel", "Text" });
+            var topdoc = searcher.Search("Hello world");
+            Assert.That(topdoc != null);
+            topdoc = null;
+            topdoc = searcher.Search("CriticalError");
+            Assert.That(topdoc != null);
         }
     }
 }


Code clean-up

Code clean-up

--- Tests/Engine/DataFeeds/IEXDataQueueHandlerTests.cs
+++ Tests/Engine/DataFeeds/IEXDataQueueHandlerTests.cs
@@ -219,37 +219,6 @@

         #region History provider tests

-        public TestCaseData[] TestParameters
-        {
-            get
-            {
-                return new[]
-                {
-                    // valid parameters
-                    new TestCaseData(Symbols.SPY, Resolution.Daily, TimeSpan.FromDays(15), true),
-                    new TestCaseData(Symbols.SPY, Resolution.Minute, TimeSpan.FromDays(3), true),
-
-                    // invalid resolution == empty result.
-                    new TestCaseData(Symbols.SPY, Resolution.Tick, TimeSpan.FromSeconds(15), false),
-                    new TestCaseData(Symbols.SPY, Resolution.Second, Time.OneMinute, false),
-                    new TestCaseData(Symbols.SPY, Resolution.Hour, Time.OneDay, false),
-
-                    // invalid period == empty result
-                    new TestCaseData(Symbols.SPY, Resolution.Minute, TimeSpan.FromDays(45), false), // beyond 30 days
-                    new TestCaseData(Symbols.SPY, Resolution.Daily, TimeSpan.FromDays(-15), false), // date in future
-                    new TestCaseData(Symbols.SPY, Resolution.Daily, TimeSpan.FromDays(365*5.5), false), // beyond 5 years
-
-                    // invalid symbol: XYZ
-                    new TestCaseData(Symbol.Create("XYZ", SecurityType.Equity, Market.FXCM), Resolution.Daily, TimeSpan.FromDays(15), false)
-                        .Throws("System.Net.WebException"),
-
-                    // invalid security type, throws "System.ArgumentException : Invalid security type: Forex"
-                    new TestCaseData(Symbols.EURUSD, Resolution.Daily, TimeSpan.FromDays(15), false)
-                        .Throws("System.Net.WebException")
-                };
-            }
-        }
-
         [Test, TestCaseSource("TestParameters")]
         public void IEXCouldGetHistory(Symbol symbol, Resolution resolution, TimeSpan period, bool received)
         {


Prevent Module List spam in Chat

Prevent Module List spam in Chat

--- TwitchPlaysAssembly/Src/Commands/GlobalCommands.cs
+++ TwitchPlaysAssembly/Src/Commands/GlobalCommands.cs
@@ -230,7 +230,7 @@
 					goto case 1;
 				}

-				IRCConnection.SendMessage($"Sorry, there is more than one module matching your search term. They are: {modules.Select(x => $"“{x.moduleDisplayName}” ({x.moduleID})").Join(", ")}", user, !isWhisper);
+				IRCConnection.SendMessage($"Sorry, there is more than one module matching your search term. They are: {modules.Take(5).Select(x => $"“{x.moduleDisplayName}” ({x.moduleID})").Join(", ")}", user, !isWhisper);
 				break;
 		}
 	}
@@ -395,7 +395,7 @@
 					goto case 1;
 				}

-				IRCConnection.SendMessage($"Sorry, there is more than one module matching your search term. They are: {modules.Select(x => $"“{x.moduleDisplayName}” ({x.moduleID})").Join(", ")}", user, !isWhisper);
+				IRCConnection.SendMessage($"Sorry, there is more than one module matching your search term. They are: {modules.Take(5).Select(x => $"“{x.moduleDisplayName}” ({x.moduleID})").Join(", ")}", user, !isWhisper);
 				break;
 		}
 	}


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
@@ -339,6 +339,15 @@
       Assert.AreEqual(result, expected);
     }

+    [TestMethod]
+    public void TestMethod_NTLM_h()
+    {
+      const string source = "h";
+      string expected = "0A9195A4BF04D808D098CF44A165186E";
+      string result = CryptoFunc.Ntlm(source);
+      Assert.AreEqual(result, expected);
+    }
+
     #endregion

   }


smalljump now works while playing

smalljump now works while playing

--- WpfApplication2/UI/Window1_KeyboardRelatedItems.cs
+++ WpfApplication2/UI/Window1_KeyboardRelatedItems.cs
@@ -650,19 +650,33 @@

         private void CSmallJumpRight(object sender, ExecutedRoutedEventArgs e)
         {
+            var ply = Playing;
+            if (ply)
+                CommandPlayPause.Execute(null, null);
+
             var newtime = waveform1.CaretPosition + waveform1.SmallJump;
             SetCaretPosition(newtime);
             SelectTextBetweenTimeOffsets(waveform1.CaretPosition);
+
+            if (ply)
+                CommandPlayPause.Execute(null, null);
         }

         private void CSmallJumpLeft(object sender, ExecutedRoutedEventArgs e)
         {
+            var ply = Playing;
+            if (ply)
+                CommandPlayPause.Execute(null, null);
+
             var newtime = waveform1.CaretPosition - waveform1.SmallJump;
             if (newtime < TimeSpan.Zero)
                 newtime = TimeSpan.Zero;

             SetCaretPosition(newtime);
             SelectTextBetweenTimeOffsets(waveform1.CaretPosition);
+
+            if (ply)
+                CommandPlayPause.Execute(null, null);
         }

         private void CMaximizeMinimize(object sender, ExecutedRoutedEventArgs e)


fix localutils test

fix localutils test

--- ZKWeb/ZKWebStandard/Tests/Utils/LocaleUtilsTest.cs
+++ ZKWeb/ZKWebStandard/Tests/Utils/LocaleUtilsTest.cs
@@ -76,19 +76,19 @@
 			context.RemoveCookie(LocaleUtils.TimeZoneKey);
 			LocaleUtils.SetThreadTimezoneAutomatic("China Standard Time");
 			var timezone = context.GetData<TimeZoneInfo>(LocaleUtils.TimeZoneKey);
-			Assert.Equals(timezone.StandardName, "China Standard Time");
+			Assert.Equals(timezone, LocaleUtils.GetTimezoneInfo("China Standard Time"));
 			LocaleUtils.SetThreadTimezoneAutomatic("GMT Standard Time");
 			timezone = context.GetData<TimeZoneInfo>(LocaleUtils.TimeZoneKey);
-			Assert.Equals(timezone.StandardName, "GMT Standard Time");
+			Assert.Equals(timezone, LocaleUtils.GetTimezoneInfo("GMT Standard Time"));
 			// No cookies, no default timezone
 			Assert.IsTrue(!LocaleUtils.SetThreadTimezoneAutomatic(null));
 			timezone = context.GetData<TimeZoneInfo>(LocaleUtils.TimeZoneKey);
-			Assert.Equals(timezone.StandardName, "GMT Standard Time");
+			Assert.Equals(timezone, LocaleUtils.GetTimezoneInfo("GMT Standard Time"));
 			// Have cookies, no default timezone
 			context.PutCookie(LocaleUtils.TimeZoneKey, "China Standard Time", new HttpCookieOptions());
 			Assert.IsTrue(LocaleUtils.SetThreadTimezoneAutomatic(null));
 			timezone = context.GetData<TimeZoneInfo>(LocaleUtils.TimeZoneKey);
-			Assert.Equals(timezone.StandardName, "China Standard Time");
+			Assert.Equals(timezone, LocaleUtils.GetTimezoneInfo("China Standard Time"));
 		}
 	}
 }


Fix broken whitespace.

Fix broken whitespace.

--- misc/templates/reference/part-members.cshtml
+++ misc/templates/reference/part-members.cshtml
@@ -33,9 +33,9 @@
           }
           @it.Comment.FullText
           @if (!String.IsNullOrEmpty(it.Details.FormatCompiledName))
-		  {
-			  @:
CompiledName: @it.Details.FormatCompiledName

-		  }
+          {
+              @:
CompiledName: @it.Details.FormatCompiledName

+          }

     }


Check booleans are captured

Check booleans are captured


Working towards finishing the WebToIrc interface.

--- UrlTitling/WebToIrc.cs
+++ UrlTitling/WebToIrc.cs
@@ -58,7 +58,24 @@
             {
                 return TitlingResult.Failure(uriString, ex);
             }
-            return WebInfo( new TitlingRequest(uri) );
+            return WebInfo(uri);
+        }
+
+
+        public TitlingResult WebInfo(Uri uri)
+        {
+            if (uri == null)
+                throw new ArgumentNullException("uri");
+            else if (!uri.IsAbsoluteUri)
+                throw new ArgumentException("Uri must be absolute: " + uri);
+
+            if (TitlingRequest.IsSchemeSupported(uri))
+                return WebInfo( new TitlingRequest(uri) );
+            else
+            {
+                var ex = new NotSupportedException("Unsupported scheme: " + uri.Scheme);
+                return TitlingResult.Failure(uri.OriginalString, ex);
+            }
         }

@@ -66,6 +83,14 @@
         {
             if (request == null)
                 throw new ArgumentNullException("request");
+            // TitlingRequest ensures that what we get passed is an absolute URI with a scheme we support. Most
+            // importantly this relieves the individual handlers of checking for those conditions.
+
+
+            // If FTP jump immediately to binary handler
+            if (request.Uri.Scheme == Uri.UriSchemeFtp)
+                return BinaryHandler.BinaryToIrc(request);
+

             // Danbooru handling.
             if (request.Url.Contains("donmai.us/posts/", StringComparison.OrdinalIgnoreCase))
@@ -79,7 +104,7 @@
                 return Gelbo.PostToIrc(request);
             }
             // Foolz and 4chan handling.
-            else if (ChanTools.IsAddressSupported(request.Url))
+            else if (ChanHandler.Supports(request))
             {
                 return Chan.ThreadTopicToIrc(request);
             }


Fixed race condition in status operations

--- VersionrCore/Status.cs
+++ VersionrCore/Status.cs
@@ -320,21 +320,24 @@
                                     parentName = parentName.Substring(0, parentName.Length - 1);
                                 parentName = parentName.Substring(0, parentName.LastIndexOf('/') + 1);
                                 bool ignoredInParentList = false;
-                                if (parentIgnoredList.TryGetValue(parentName, out ignoredInParentList))
+                                lock (parentIgnoredList)
                                 {
-                                    if (ignoredInParentList)
-                                        resolved = true;
-                                    break;
-                                }
-                                else
-                                {
-                                    Entry parentObjectEntry = null;
-                                    snapshotData.TryGetValue(parentName, out parentObjectEntry);
-                                    if (parentObjectEntry != null && parentObjectEntry.Ignored == true)
+                                    if (parentIgnoredList.TryGetValue(parentName, out ignoredInParentList))
                                     {
-                                        parentIgnoredList[parentName] = true;
-                                        resolved = true;
+                                        if (ignoredInParentList)
+                                            resolved = true;
                                         break;
+                                    }
+                                    else
+                                    {
+                                        Entry parentObjectEntry = null;
+                                        snapshotData.TryGetValue(parentName, out parentObjectEntry);
+                                        if (parentObjectEntry != null && parentObjectEntry.Ignored == true)
+                                        {
+                                            parentIgnoredList[parentName] = true;
+                                            resolved = true;
+                                            break;
+                                        }
                                     }
                                 }
                             }


Added version PowerShell 4 case.

Added version PowerShell 4 case.


openPDC.UI: Fixed bug in Devices.cs GetLookupList method.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C76165


update assembly info

update assembly info


Encode PSBT using base64 instead of base16

--- WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
+++ WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
@@ -93,7 +93,7 @@

 			var request = new HttpRequestMessage(HttpMethod.Post, endpoint)
 			{
-				Content = new StringContent(cloned.ToHex(), Encoding.UTF8, "text/plain")
+				Content = new StringContent(cloned.ToBase64(), Encoding.UTF8, "text/plain")
 			};

 			HttpResponseMessage bpuResponse = await TorHttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);


Fix codescene

Fix codescene

--- WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
+++ WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
@@ -22,6 +22,7 @@
 			PaymentUrl = Guard.NotNull(nameof(paymentUrl), paymentUrl);
 			TorHttpClient = new TorHttpClient(PaymentUrl, TorSocks5EndPoint);
 		}
+
 		public PayjoinClient(Uri paymentUrl, HttpClient httpClient)
 		{
 			PaymentUrl = Guard.NotNull(nameof(paymentUrl), paymentUrl);
@@ -79,19 +80,17 @@
 			{
 				Content = new StringContent(cloned.ToHex(), Encoding.UTF8, "text/plain")
 			};
-			HttpResponseMessage bpuResponse = null;
-			if (TorHttpClient is null && ClearnetHttpClient != null)
-			{
-				bpuResponse = await ClearnetHttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
-			}
-			else if(TorHttpClient != null)
-			{
-				bpuResponse = await TorHttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
-			}else
+
+			if (TorHttpClient is null && ClearnetHttpClient is null)
 			{
 				throw new NullReferenceException(
 					"A Tor HttpClient OR a clearnet HttpClient needs to be provided to the Payjoin client");
 			}
+
+			HttpResponseMessage bpuResponse = TorHttpClient is { } ?
+				await TorHttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false) :
+				await ClearnetHttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
+
 			if (!bpuResponse.IsSuccessStatusCode)
 			{
 				var errorStr = await bpuResponse.Content.ReadAsStringAsync().ConfigureAwait(false);


Require digit when looking for playlist index in regex


add IT tests

add IT tests

--- test/InvisibleCollectorIt.cs
+++ test/InvisibleCollectorIt.cs
@@ -294,5 +294,29 @@
                 async ic => await ic.SetNewPayment(sentModel),
                 expectedJson);
         }
+
+        [Test]
+        public void GetPaymentAsync_correct()
+        {
+            var reply = ModelBuilder.BuildReplyPaymentBuilder();
+            AssertingModelRequest("GET", $"payments/{TestId}", reply,
+                async ic => await ic.GetPaymentAsync(TestId));
+        }
+
+        [Test]
+        public void CancelPaymentAsync_correct()
+        {
+            var reply = ModelBuilder.BuildReplyPaymentBuilder();
+            AssertingModelRequest("PUT", $"payments/{TestId}/cancel", reply,
+                async ic => await ic.CancelPaymentAsync(TestId));
+        }
+
+        [Test]
+        public void DeletePaymentAsync_correct()
+        {
+            var reply = ModelBuilder.BuildReplyPaymentBuilder();
+            AssertingModelRequest("DELETE", $"payments/{TestId}", reply,
+                async ic => await ic.DeletePaymentAsync(TestId));
+        }
     }
 }


Updated WikiPage to use default network credentials when import a wiki from the web so that intranet scenarios using Windows authentication are supported.

--- samples/WikiPad/MainForm.cs
+++ samples/WikiPad/MainForm.cs
@@ -431,7 +431,11 @@
             try
             {
                 using (CurrentCursorScope.EnterWait())
-                    text = new WebClient().DownloadString(url);
+                {
+                    WebClient webClient = new WebClient();
+                    webClient.Credentials = CredentialCache.DefaultCredentials;
+                    text = webClient.DownloadString(url);
+                }
             }
             catch (WebException e)
             {


Add required IFileSystem interface members

--- src/AppHarbor/IFileSystem.cs
+++ src/AppHarbor/IFileSystem.cs
@@ -1,6 +1,11 @@
-namespace AppHarbor
+using System.IO;
+
+namespace AppHarbor
 {
 	public interface IFileSystem
 	{
+		void Delete(string path);
+		Stream OpenRead(string path);
+		Stream OpenWrite(string path);
 	}
 }


LOG4NET-354 fix build errors for MONO since MONO does not implement the System.Web.Mail.MailMessage.SubjectEncoding property

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@1496053 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/SmtpAppender.cs
+++ src/Appender/SmtpAppender.cs
@@ -519,7 +519,9 @@
                     mailMessage.Bcc = m_bcc;
                 }
 				mailMessage.Subject = m_subject;
+#if !MONO
 				mailMessage.SubjectEncoding = m_subjectEncoding;
+#endif
 				mailMessage.Priority = m_mailPriority;

 #if NET_1_1


AMBARI-5601 - Ambari-SCOM build is failing (Ivan Malamen via tbeerbower)

--- contrib/ambari-scom/msi/src/ServiceHost/WmiSchema.cs
+++ contrib/ambari-scom/msi/src/ServiceHost/WmiSchema.cs
@@ -74,4 +74,3 @@
         void StopService();
     }
 }
--


fix rect.

fix rect.

--- src/Avalonia.Visuals/Rect.cs
+++ src/Avalonia.Visuals/Rect.cs
@@ -121,11 +121,7 @@
         /// <summary>
         /// Gets the size of the rectangle.
         /// </summary>
-        public Size Size => new Size(_width, _height);
-
-        public double Left => _x;
-
-        public double Top => _y;
+        public Size Size => new Size(_width, _height);

         /// <summary>
         /// Gets the right position of the rectangle.


Implemented Matches report command

Implemented Matches report command

--- ATPTennisStat/ATPTennisStat.ConsoleClient/Core/Commands/ReporterCommands/CreateMatchesPdf.cs
+++ ATPTennisStat/ATPTennisStat.ConsoleClient/Core/Commands/ReporterCommands/CreateMatchesPdf.cs
@@ -1,24 +1,52 @@
-using ATPTennisStat.ConsoleClient.Core.Contracts;
+using System;
+using System.Collections.Generic;
+using ATPTennisStat.ConsoleClient.Core.Contracts;
 using ATPTennisStat.SQLServerData;
-using System;
-using System.Collections.Generic;
+using ATPTennisStat.ReportGenerators;
+using ATPTennisStat.ReportGenerators.Enums;
+using ATPTennisStat.ReportGenerators.Contracts;

 namespace ATPTennisStat.ConsoleClient.Core.Commands.ReporterCommands
 {
     class CreateMatchesPdf : ICommand
     {
-        private SqlServerDataProvider dp;
+        private const string Success = "Successfully created matches report";
+        private IReportGenerator reporter;
         private IWriter writer;
+        private ILogger logger;

-        public CreateMatchesPdf(SqlServerDataProvider sqlDP, IWriter writer)
+        public CreateMatchesPdf(IReportGenerator reporter, ILogger logger, IWriter writer)
         {
-            this.dp = sqlDP;
+            if (reporter == null)
+            {
+                throw new ArgumentNullException("PdfReportGenerator");
+            }
+
+            if (writer == null)
+            {
+                throw new ArgumentNullException("writer");
+            }
+
+            if (logger == null)
+            {
+                throw new ArgumentNullException("logger");
+            }
+
+            this.reporter = reporter;
             this.writer = writer;
+            this.logger = logger;
         }

         public string Execute(IList<string> parameters)
         {
-            throw new NotImplementedException();
+            if (parameters == null)
+            {
+                throw new ArgumentNullException("Execute parameters");
+            }
+
+            this.reporter.GenerateReport(PdfReportType.Matches);
+            this.logger.Log(Success);
+            return Success;
         }
     }
-}
+}


fixes

fixes

- FIX: ENG => GER in SynchronizedObservableCollection<T> class

--- MarcelJoachimKloubert.Blog.Net35/Collections/ObjectModel/SynchronizedObservableCollection.cs
+++ MarcelJoachimKloubert.Blog.Net35/Collections/ObjectModel/SynchronizedObservableCollection.cs
@@ -85,7 +85,8 @@
         #region Properties (1)

         /// <summary>
-        /// Gets the object for thread safe operations.
+        /// Gibt das Objekt zurück, das für Thread-sichere Operationen
+        /// verwendet werden soll.
         /// </summary>
         public object SyncRoot
         {


Fix typo / use string interpolation

Fix typo / use string interpolation

--- src/EntityFramework.DynamicFilters/DynamicFilterQueryVisitorCSpace.cs
+++ src/EntityFramework.DynamicFilters/DynamicFilterQueryVisitorCSpace.cs
@@ -213,7 +213,7 @@
                             //  these relations!!) to try to map that information back to CSpace to figure out the correct properties of the FK conditions.
                             //  or...the models just need to contain the necessary "ID" properties for the FK relations so that they are available here
                             //  (in CSpace) for us to generate the necessary join conditions.
-                            throw new ApplicationException(string.Format("FK Constriant not found for association '{0}' - must directly specify foreign keys on model to be able to apply this filter", associationType.FullName));
+                            throw new ApplicationException($"FK constraint not found for association '{associationType.FullName}' - must directly specify foreign keys on model to be able to apply this filter");
                         }

                         //  Figure out if the "baseResults" are the from side or to side of the constraint so we can create the properties correctly


Use ReferenceEquals method to compare references to UTC zone

It's the same, but R# doesn't warn us

--- src/Cronos/CronExpression.cs
+++ src/Cronos/CronExpression.cs
@@ -150,7 +150,7 @@
         {
             if (fromUtc.Kind != DateTimeKind.Utc) ThrowWrongDateTimeKindException(nameof(fromUtc));

-            if (zone == UtcTimeZone)
+            if (ReferenceEquals(zone, UtcTimeZone))
             {
                 var found = FindOccurence(fromUtc.Ticks, inclusive);
                 if (found == NotFound) return null;
@@ -169,7 +169,7 @@
         /// </summary>
         public DateTimeOffset? GetNextOccurrence(DateTimeOffset from, TimeZoneInfo zone, bool inclusive = false)
         {
-            if (zone == UtcTimeZone)
+            if (ReferenceEquals(zone, UtcTimeZone))
             {
                 var found = FindOccurence(from.UtcTicks, inclusive);
                 if (found == NotFound) return null;


parse everything in lower case

parse everything in lower case

--- src/server/Adaptive.ReactiveTrader.Server.Launcher/ArgumentParser.cs
+++ src/server/Adaptive.ReactiveTrader.Server.Launcher/ArgumentParser.cs
@@ -16,7 +16,7 @@
                 arguments.Select(ServiceTypeHelper.GetServiceTypeFromString)
                     .Where(type => type != ServiceType.Unknown)
                     .ToList();
-
+
             var config = new LauncherConfig
             {
                 Help = !arguments.Any() || arguments.Any(a => a.IsIn("--help", "/?", "-h", "-help")),
@@ -49,12 +49,14 @@

             foreach (var a in args)
             {
-                if (a == "dev")
+                var argument = a.ToLower();
+
+                if (argument == "dev")
                     ret.AddRange(devArgs);
-                if (a == "all")
+                if (argument == "all")
                     ret.AddRange(allArgs);
                 else
-                    ret.Add(a);
+                    ret.Add(argument);
             }
             return ret;
         }


增加Sha1算法,从编码名称直接签名 Signed-off-by: virtual <1185513330@qq.com>

增加Sha1算法,从编码名称直接签名
Signed-off-by: virtual <89ab707496410b11c2fba8f5ec0112cf133af8fd@qq.com>

--- src/DotCommon/Alg/SHA1Alg.cs
+++ src/DotCommon/Alg/SHA1Alg.cs
@@ -36,6 +36,15 @@
             var bytes = encode.GetBytes(str);
             return GetSha1Hash(bytes);
         }
+
+        /// <summary> 获取字符的Hash值
+        /// </summary>
+        public static string GetStringSha1(string str, string encode = "utf-8")
+        {
+            var encoding = Encoding.GetEncoding(encode);
+            var bytes = encoding.GetBytes(str);
+            return GetSha1Hash(bytes);
+        }
         #endregion

         #region +将数据源计算出来的哈希值 存储为一个十六进制的字符串


Make code input options for eval mutually exclusive

--- src/Dotnet.Script/Program.cs
+++ src/Dotnet.Script/Program.cs
@@ -96,6 +96,11 @@
                             return 0;
                         }
                     }
+                    else if (Console.IsInputRedirected)
+                    {
+                        Console.Error.WriteLine("Code to evaluate must be supplied as an argument or over the standard input stream, but not both.");
+                        return 1;
+                    }

                     var logFactory = CreateLogFactory(verbosity.Value(), debugMode.HasValue());
                     var options = new ExecuteCodeCommandOptions(source, cwd.Value(), app.RemainingArguments.Concat(argsAfterDoubleHyphen).ToArray(),configuration.ValueEquals("release", StringComparison.OrdinalIgnoreCase) ? OptimizationLevel.Release : OptimizationLevel.Debug, nocache.HasValue(),packageSources.Values?.ToArray());


fix example

fix example

--- example/CrossExamples/CrossRemoveBlacklistExample.cs
+++ example/CrossExamples/CrossRemoveBlacklistExample.cs
@@ -23,7 +23,10 @@

             List<string> usernames = new List<string> { "jmessage123" };

-            client.crossRemoveBlacklist("6be9204c30b9473e87bad4dc", "19749893", usernames);
+            client.crossAddSingleNodisturb("6be9204c30b9473e87bad4dc", "xiaohuihui", usernames);
+            client.crossRemoveSingleNodisturb("6be9204c30b9473e87bad4dc", "xiaohuihui", usernames);
+            client.crossAddSingleNodisturb("6be9204c30b9473e87bad4dc", "xiaohuihui", usernames);
+            client.crossAddSingleNodisturb("6be9204c30b9473e87bad4dc", "xiaohuihui", usernames);
         }
     }
 }


Seal CreateFilter method in CombinedChain.

Avoids confusion. Although maybe it's better to deprecate BuildChain,
and add an extension method for chaining RenderChains / Filters.

--- src/Framework/RenderChain.cs
+++ src/Framework/RenderChain.cs
@@ -99,7 +99,7 @@
     {
         protected abstract void BuildChain(FilterChain chain);

-        public override IFilter CreateFilter(IResizeableFilter sourceFilter)
+        public sealed override IFilter CreateFilter(IResizeableFilter sourceFilter)
         {
             var chain = new FilterChain(sourceFilter);
             BuildChain(chain);


check content==null when Unpop

check content==null when Unpop

--- src/GraphicObjects/Popper.cs
+++ src/GraphicObjects/Popper.cs
@@ -189,7 +189,8 @@
 		{
 			if (Interface.CurrentInterface == null)
 				return;
-			Content.Visible = false;
+			if (Content != null)
+				Content.Visible = false;
 			Unpop.Raise (this, e);
 		}
 	}


Relative path fix in C# part 2

Relative path fix in C# part 2

--- csharp/CsSearch/CsSearch/FileUtil.cs
+++ csharp/CsSearch/CsSearch/FileUtil.cs
@@ -82,9 +82,7 @@
 				}
 				else if (NormalizePath(startpath) == parentPath)
 				{
-// ReSharper disable PossibleNullReferenceException
-					var parentDirectory = new DirectoryInfo(startpath).FullName;
-// ReSharper restore PossibleNullReferenceException
+					var parentDirectory = NormalizePath(new DirectoryInfo(startpath).FullName);
 					filePath = filePath.Replace(parentDirectory, "..");
 				}
 			}


修改 WordsHelper

修改 WordsHelper

--- csharp/ToolGood.Words/WordsHelper.cs
+++ csharp/ToolGood.Words/WordsHelper.cs
@@ -11,6 +11,17 @@
     {
         #region 拼音 操作
         /// <summary>
+        /// 获取所有拼音,中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
+        /// </summary>
+        /// <param name="c">原文本</param>
+        /// <param name="tone">是否带声调</param>
+        /// <returns></returns>
+        public static List<string> GetAllPinYin(char c, bool tone = false)
+        {
+            return PinYinDict.GetAllPinYin(c, tone ? 1 : 0);
+        }
+
+        /// <summary>
         /// 获取首字母，中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
         /// </summary>
         /// <param name="text">原文本</param>
@@ -52,6 +63,19 @@
         /// 获取拼音全拼,支持多音,中文字符集为[0x4E00,0x9FD5]
         /// </summary>
         /// <param name="text">原文本</param>
+        /// <param name="splitSpan">分隔符</param>
+        /// <param name="tone">是否带声调</param>
+        /// <returns></returns>
+        public static string GetPinYin(string text,string splitSpan, bool tone = false)
+        {
+            return string.Join(splitSpan, PinYinDict.GetPinYinList(text, tone ? 1 : 0));
+        }
+
+
+        /// <summary>
+        /// 获取拼音全拼,支持多音,中文字符集为[0x4E00,0x9FD5]
+        /// </summary>
+        /// <param name="text">原文本</param>
         /// <param name="tone">是否带声调</param>
         /// <returns></returns>
         public static string[] GetPinYinList(string text, bool tone = false)
@@ -59,16 +83,7 @@
             return PinYinDict.GetPinYinList(text, tone ? 1 : 0);
         }

-        /// <summary>
-        /// 获取所有拼音,中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
-        /// </summary>
-        /// <param name="c">原文本</param>
-        /// <param name="tone">是否带声调</param>
-        /// <returns></returns>
-        public static List<string> GetAllPinYin(char c, bool tone = false)
-        {
-            return PinYinDict.GetAllPinYin(c, tone ? 1 : 0);
-        }
+

         /// <summary>
         /// 获取姓名拼音,中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
@@ -85,6 +100,18 @@
         /// 获取姓名拼音,中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
         /// </summary>
         /// <param name="name">姓名</param>
+        /// <param name="splitSpan">分隔符</param>
+        /// <param name="tone">是否带声调</param>
+        /// <returns></returns>
+        public static string GetPinYinForName(string name, string splitSpan, bool tone = false)
+        {
+            return string.Join(splitSpan, PinYinDict.GetPinYinForName(name, tone ? 1 : 0));
+        }
+
+        /// <summary>
+        /// 获取姓名拼音,中文字符集为[0x3400,0x9FD5]，注：偏僻汉字很多未验证
+        /// </summary>
+        /// <param name="name">姓名</param>
         /// <param name="tone">是否带声调</param>
         /// <returns></returns>
         public static List<string> GetPinYinListForName(string name, bool tone = false)
@@ -93,65 +120,6 @@
         }

         #endregion
-
-        //#region 字符串 转成 脏词检测字符串
-        ///// <summary>
-        ///// 转成 侦测字符串
-        ///// 1、转小写;2、全角转半角; 3、相似文字修改；4、繁体转简体
-        ///// </summary>
-        ///// <param name="s"></param>
-        ///// <returns></returns>
-        //public static string ToSenseIllegalWords(string s)
-        //{
-        //    StringBuilder ts = new StringBuilder(s);
-        //    for (int i = 0; i < s.Length; i++) {
-        //        var c = s[i];
-        //        if (c < 'A') { } else if (c <= 'Z') {
-        //            ts[i] = (char)(c | 0x20);
-        //        } else if (c < 9450) { } else if (c <= 12840) {//处理数字
-        //            var index = Dict.nums1.IndexOf(c);
-        //            if (index > -1) { ts[i] = Dict.nums2[index]; }
-        //        } else if (c == 12288) {
-        //            ts[i] = ' ';
-        //        } else if (c < 0x4e00) { } else if (c <= 0x9fa5) {
-        //            var k = Dict.Simplified[c - 0x4e00];
-        //            if (k != c) {
-        //                ts[i] = k;
-        //            }
-        //        } else if (c < 65280) { } else if (c < 65375) {
-        //            var k = (c - 65248);
-        //            if ('A' <= k && k <= 'Z') { k = k | 0x20; }
-        //            ts[i] = (char)k;
-        //        }
-        //    }
-        //    return ts.ToString();
-        //}
-
-        //internal static string RemoveNontext(string text)
-        //{
-        //    StringBuilder sb = new StringBuilder(text);
-        //    for (int i = 0; i < text.Length; i++) {
-        //        var c = text[i];
-        //        bool remove = true;
-
-        //        if (c == ' ') {
-        //            remove = false;
-        //        } else if (c < 2) {
-        //            remove = false;
-        //        } else if (c < '0') { } else if (c <= '9') {
-        //            remove = false;
-        //        } else if (c < 'a') { } else if (c <= 'z') {
-        //            remove = false;
-        //        } else if (c < 0x4e00) { } else if (c <= 0x9fa5) {
-        //            remove = false;
-        //        }
-        //        if (remove) {
-        //            sb[i] = (char)1;
-        //        }
-        //    }
-        //    return sb.ToString();
-        //}
-        //#endregion

         #region 判断输入是否为中文
         /// <summary>


:sake: :dancer:  支持 PageSize 为零或负数时，不进行分页的特性。 :package:

--- src/MySql/MySqlDataAccess.cs
+++ src/MySql/MySqlDataAccess.cs
@@ -71,7 +71,7 @@
 			if(!string.IsNullOrEmpty(parameter.Orderby))
 				sql += " " + parameter.Orderby;

-			if(parameter.Paging != null)
+			if(parameter.Paging != null && parameter.Paging.PageSize > 0)
 			{
 				if(parameter.Paging.PageIndex < 1)
 					parameter.Paging.PageIndex = 1;


Make NCryptIsKeyHandle public

Make NCryptIsKeyHandle public

There is no reason to keep this method private (not sure why it was in the first place) and we have a request to make it public.

--- src/NCrypt.Desktop/NCrypt.cs
+++ src/NCrypt.Desktop/NCrypt.cs
@@ -35,6 +35,6 @@
         /// <returns>Returns a nonzero value if the handle is a key handle or zero otherwise.</returns>
         [DllImport(nameof(NCrypt))]
         [return: MarshalAs(UnmanagedType.Bool)]
-        private static extern bool NCryptIsKeyHandle(IntPtr hKey);
+        public static extern bool NCryptIsKeyHandle(IntPtr hKey);
     }
 }


Save ApiException information to Exception.Data

--- src/RestEase/ApiException.cs
+++ src/RestEase/ApiException.cs
@@ -92,9 +92,17 @@
             : base($"{requestMethod} \"{requestUri}\" failed because response status code does not indicate success: {(int)statusCode} ({reasonPhrase}).")
         {
             this.RequestMethod = requestMethod;
+            this.Data[nameof(this.RequestMethod)] = requestMethod.Method;
+
             this.RequestUri = requestUri;
+            this.Data[nameof(this.RequestUri)] = requestUri;
+
             this.StatusCode = statusCode;
+            this.Data[nameof(this.StatusCode)] = statusCode;
+
             this.ReasonPhrase = reasonPhrase;
+            this.Data[nameof(this.ReasonPhrase)] = reasonPhrase;
+
             this.Headers = headers;
             this.ContentHeaders = contentHeaders;
             this.Content = contentString;


More self-contained test setup for OracleErrorLog.Name, using a test provider instead of relying on system behavior

--- tests/OracleErrorLogTests.cs
+++ tests/OracleErrorLogTests.cs
@@ -31,9 +31,13 @@
         [Fact]
         public void NameReflectsDbProviderName()
         {
-            var dbProvider = DbProviderFactories.GetFactory("System.Data.OracleClient");
+            var dbProvider = new TestDbProviderFactory();
             var log = new OracleErrorLog("...", dbProvider);
-            Assert.Equal("Oracle Error Log (System.Data.OracleClient)", log.Name);
+            Assert.Equal("Oracle Error Log (Elmah.Tests)", log.Name);
+        }
+
+        sealed class TestDbProviderFactory : DbProviderFactory
+        {
         }
     }
 }


Remove username data from PrivateMessageNotification

--- osu.Game/Online/Chat/MessageNotifier.cs
+++ osu.Game/Online/Chat/MessageNotifier.cs
@@ -137,12 +137,9 @@
             public PrivateMessageNotification(string username, Channel channel)
             {
                 Icon = FontAwesome.Solid.Envelope;
-                this.username = username;
+                Text = $"You received a private message from '{username}'. Click to read it!";
                 this.channel = channel;
-                Text = $"You received a private message from '{this.username}'. Click to read it!";
             }
-
-            private readonly string username;

             private readonly Channel channel;


Remove dead code in UnsafeAsciiBytesToString

--- src/Sodium.Core/Utilities.cs
+++ src/Sodium.Core/Utilities.cs
@@ -239,17 +239,6 @@

         internal static string UnsafeAsciiBytesToString(byte[] buffer)
         {
-#if NETSTANDARD1_6
-            var handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
-            try
-            {
-                return Marshal.PtrToStringAnsi(handle.AddrOfPinnedObject());
-            }
-            finally
-            {
-                handle.Free();
-            }
-#else
             unsafe
             {
                 fixed (byte* ascii = buffer)
@@ -257,7 +246,6 @@
                     return new string((sbyte*)ascii, 0, buffer.Length);
                 }
             }
-#endif
         }
     }
 }


StopwatchTicksToTimeSpanTicks resulted in DivByZero when the Frequency is lower than 10M (this was not discovered at first because my machine reports a frequency of 14M and I assumed it was a typical value)

--- src/TC.Profiling/Profiler.cs
+++ src/TC.Profiling/Profiler.cs
@@ -168,7 +168,7 @@

         private long StopwatchTicksToTimeSpanTicks(long stopwatchTicks)
         {
-            return stopwatchTicks / (Stopwatch.Frequency / (10 * 1000 * 1000));
+            return stopwatchTicks * (10 * 1000 * 1000) / Stopwatch.Frequency;
         }

         private RawNode EnsureRawNodesForPath(IEnumerable<string> labelStack)


Remove debug code.

Remove debug code.

--- garbage_calendar/Utils/CalendarUtils.cs
+++ garbage_calendar/Utils/CalendarUtils.cs
@@ -50,8 +50,6 @@
                 dateTime = dateTime.AddMonths(-1);
                 var lastDay = GetCountOfDays(dateTime.Year, dateTime.Month);

-                Debug.WriteLine("{0}/{1}/{2}", dateTime.Year, dateTime.Month, lastDay - prevMonthDays + idx);
-
                 return new DateTime(dateTime.Year, dateTime.Month, lastDay - prevMonthDays + idx);
             }
             else
@@ -66,8 +64,6 @@
                 var dateTime = new DateTime(year, month, 1);
                 dateTime = dateTime.AddMonths(1);

-                Debug.WriteLine("{0}/{1}/{2}", dateTime.Year, dateTime.Month, idx - lastDay - prevMonthDays);
-
                 return new DateTime(dateTime.Year, dateTime.Month, idx - lastDay - prevMonthDays);
             }
         }