basic lgpe support

basic lgpe support

--- AutoLegality/PKSMAutoLegality.cs
+++ AutoLegality/PKSMAutoLegality.cs
@@ -53,12 +53,13 @@

             int[] eventList = new int[] { 719, 649, 720, 385, 647, 648, 721, 801, 802, 807 };

-            int[] GameVersionList = new int[] { (int)GameVersion.UM, (int)GameVersion.US, (int)GameVersion.MN, (int)GameVersion.SN, (int)GameVersion.AS,
-                                                (int)GameVersion.OR, (int)GameVersion.X, (int)GameVersion.Y, (int)GameVersion.B, (int)GameVersion.B2,
-                                                (int)GameVersion.W, (int)GameVersion.W2, (int)GameVersion.D, (int)GameVersion.P, (int)GameVersion.Pt,
-                                                (int)GameVersion.HG, (int)GameVersion.SS, (int)GameVersion.R, (int)GameVersion.S, (int)GameVersion.E,
-                                                (int)GameVersion.FR, (int)GameVersion.LG, (int)GameVersion.CXD, (int)GameVersion.RD, (int)GameVersion.GN,
-                                                (int)GameVersion.BU, (int)GameVersion.YW, (int)GameVersion.GD, (int)GameVersion.SV, (int)GameVersion.C };
+            int[] GameVersionList = new int[] { (int)GameVersion.GP, (int)GameVersion.GE, (int)GameVersion.UM, (int)GameVersion.US, (int)GameVersion.MN,
+                                                (int)GameVersion.SN, (int)GameVersion.AS, (int)GameVersion.OR, (int)GameVersion.X, (int)GameVersion.Y,
+                                                (int)GameVersion.B, (int)GameVersion.B2, (int)GameVersion.W, (int)GameVersion.W2, (int)GameVersion.D,
+                                                (int)GameVersion.P, (int)GameVersion.Pt, (int)GameVersion.HG, (int)GameVersion.SS, (int)GameVersion.R,
+                                                (int)GameVersion.S, (int)GameVersion.E, (int)GameVersion.FR, (int)GameVersion.LG, (int)GameVersion.CXD,
+                                                (int)GameVersion.RD, (int)GameVersion.GN, (int)GameVersion.BU, (int)GameVersion.YW, (int)GameVersion.GD,
+                                                (int)GameVersion.SV, (int)GameVersion.C, (int)GameVersion.GO};

             foreach (int mon in legendaryList)
             {
@@ -164,6 +165,17 @@
                 {
                     if (Set.DebutGeneration > ((GameVersion)GameVersionList[i]).GetGeneration()) continue;
                     if (Set.Met_Level == 100) Set.Met_Level = 0;
+                    if (Set is PB7)
+                    {
+                        PKM set2 = Set;
+                        Set = Set as PB7;
+                        if (Set == null) Set = set2;
+                        else
+                        {
+                            ((PB7)Set).ResetCalculatedValues();
+                            ((PB7)Set).Stat_CP = ((PB7)Set).CalcCP;
+                        }
+                    }
                     Set.WasEgg = false;
                     Set.EggMetDate = null;
                     Set.Egg_Location = 0;
@@ -248,15 +260,19 @@
                             setHappiness(Set);
                             PKM returnval = Set;
                             if (shiny && Set.IsShiny) return Set;
-                            if (shiny && !Set.IsShiny)
-                            {
-                                Set.SetShinySID();
-                                if (new LegalityAnalysis(Set).Valid) return Set;
-                                Set = returnval;
-                                Set.SetShiny();
-                                if (new LegalityAnalysis(Set).Valid) return Set;
-                            }
-                            else return returnval;
+                            if (!requestedShiny || Set.IsShiny)
+                                return returnval;
+
+                            Set.SetShinySID();
+                            if (new LegalityAnalysis(Set).Valid)
+                                return Set;
+
+                            Set = returnval;
+                            Set.SetShiny();
+
+                            if (new LegalityAnalysis(Set).Valid)
+                                return Set;
+
                         }
                         else
                         {
@@ -285,7 +301,7 @@

             if (!new LegalityAnalysis(Set).Valid)
             {
-                string fpath = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\mgdb";
+                string fpath = Path.Combine(Directory.GetCurrentDirectory(), "mgdb");
                 List<string> fileList = new List<string>();
                 string[] PKMNList = Util.GetSpeciesList("en");
                 List<string> chain = new List<string>();
@@ -303,11 +319,11 @@
                     }
                 }
                 if (chain.Count == 0 && Set.Species != 0) chain.Add(PKMNList[Set.Species]);
-                foreach (string file in System.IO.Directory.GetFiles(fpath, "*.*", System.IO.SearchOption.AllDirectories))
+                foreach (string file in Directory.GetFiles(fpath, "*.*", SearchOption.AllDirectories))
                 {
                     foreach (string mon in chain)
                     {
-                        if (file.ToLower().Contains(mon.ToLower()) || Path.GetExtension(file) == ".pl6")
+                        if (file.IndexOf(mon, StringComparison.OrdinalIgnoreCase) >= 0 || Path.GetExtension(file) == ".pl6")
                         {
                             fileList.Add(file);
                             Console.WriteLine(file);
@@ -323,9 +339,9 @@
                     int AbilityType = -1;
                     uint fixedPID = 0;
                     int form = Set.AltForm;
-                    if (System.IO.Path.GetExtension(file) == ".wc7" || System.IO.Path.GetExtension(file) == ".wc7full")
-                    {
-                        var mg = (WC7)MysteryGift.GetMysteryGift(System.IO.File.ReadAllBytes(file), System.IO.Path.GetExtension(file));
+                    if (Path.GetExtension(file) == ".wc7" || Path.GetExtension(file) == ".wc7full")
+                    {
+                        var mg = (WC7)MysteryGift.GetMysteryGift(File.ReadAllBytes(file), Path.GetExtension(file));
                         PIDType = (int)mg.PIDType;
                         AbilityType = mg.AbilityType;
                         Generation = 7;
@@ -334,9 +350,9 @@
                         var temp = mg.ConvertToPKM(SAV);
                         eventpk = PKMConverter.ConvertToType(temp, SAV.PKMType, out string c);
                     }
-                    else if (System.IO.Path.GetExtension(file) == ".wc6" || System.IO.Path.GetExtension(file) == ".wc6full")
-                    {
-                        var mg = (WC6)MysteryGift.GetMysteryGift(System.IO.File.ReadAllBytes(file), System.IO.Path.GetExtension(file));
+                    else if (Path.GetExtension(file) == ".wc6" || Path.GetExtension(file) == ".wc6full")
+                    {
+                        var mg = (WC6)MysteryGift.GetMysteryGift(File.ReadAllBytes(file), Path.GetExtension(file));
                         PIDType = (int)mg.PIDType;
                         AbilityType = mg.AbilityType;
                         Generation = 6;
@@ -345,7 +361,7 @@
                         var temp = mg.ConvertToPKM(SAV);
                         eventpk = PKMConverter.ConvertToType(temp, SAV.PKMType, out string c);
                     }
-                    else if (System.IO.Path.GetExtension(file) == ".pl6") // Pokemon Link
+                    else if (Path.GetExtension(file) == ".pl6") // Pokemon Link
                     {
                         PL6_PKM[] LinkPokemon = new PL6(File.ReadAllBytes(file)).Pokes;
                         bool ExistsEligible = false;
@@ -353,22 +369,19 @@
                         foreach (PL6_PKM i in LinkPokemon)
                         {
                             if (i.Species != Set.Species) continue;
-                            else
-                            {
-                                Eligible = i;
-                                ExistsEligible = true;
-                                PIDType = i.PIDType;
-                                AbilityType = i.AbilityType;
-                                Generation = 6;
-                                fixedPID = i.PID;
-                                break;
-                            }
+                            Eligible = i;
+                            ExistsEligible = true;
+                            PIDType = i.PIDType;
+                            AbilityType = i.AbilityType;
+                            Generation = 6;
+                            fixedPID = i.PID;
+                            break;
                         }
                         if (ExistsEligible) eventpk = PKMConverter.ConvertToType(ConvertPL6ToPKM(Eligible), SAV.PKMType, out string c);
                     }
-                    else if (System.IO.Path.GetExtension(file) == ".pgf")
-                    {
-                        var mg = (PGF)MysteryGift.GetMysteryGift(System.IO.File.ReadAllBytes(file), System.IO.Path.GetExtension(file));
+                    else if (Path.GetExtension(file) == ".pgf")
+                    {
+                        var mg = (PGF)MysteryGift.GetMysteryGift(File.ReadAllBytes(file), Path.GetExtension(file));
                         PIDType = mg.PIDType;
                         AbilityType = mg.AbilityType;
                         Generation = 5;
@@ -831,6 +844,17 @@
                 report = UpdateReport(pk);
             }

+            if (report.Contains(LNickMatchLanguageFail))
+            {
+                pk.Nickname = PKX.GetSpeciesNameGeneration(pk.Species, pk.Language, SAV.Generation); // failsafe to reset nick
+                report = UpdateReport(pk);
+            }
+            if (report.Contains(LStatIncorrectCP))
+            {
+                ((PB7)pk).ResetCP();
+                report = UpdateReport(pk);
+            }
+
             if (report.Contains(LAbilityMismatch)) //V223 = Ability mismatch for encounter.
             {
                 pk.RefreshAbility(pk.AbilityNumber < 6 ? pk.AbilityNumber >> 1 : 0);
@@ -889,14 +913,7 @@
             }
             if (report.Contains(LPIDGenderMismatch)) //V251 = PID-Gender mismatch.
             {
-                if (pk.Gender == 0)
-                {
-                    pk.Gender = 1;
-                }
-                else
-                {
-                    pk.Gender = 0;
-                }
+                pk.Gender = pk.Gender == 0 ? 1 : 0;
                 report = UpdateReport(pk);
             }
             if (report.Contains(LG3OTGender) || report.Contains(LG1OTGender)) //V407 = OT from Colosseum/XD cannot be female. V408 = Female OT from Generation 1 / 2 is invalid.
@@ -1050,14 +1067,7 @@
                 }
                 else if (report.Contains(LPIDGenderMismatch)) // V251 = PID-Gender mismatch.
                 {
-                    if (pk.Gender == 0)
-                    {
-                        pk.Gender = 1;
-                    }
-                    else
-                    {
-                        pk.Gender = 0;
-                    }
+                    pk.Gender = pk.Gender == 0 ? 1 : 0;
                     report = UpdateReport(pk);
                     if (new LegalityAnalysis(pk).Valid)
                     {
@@ -1190,14 +1200,7 @@
                 updatedReport = recheckLA.Report(false);
                 if (updatedReport.Contains("PID-Gender mismatch."))
                 {
-                    if (pk.Gender == 0)
-                    {
-                        pk.Gender = 1;
-                    }
-                    else
-                    {
-                        pk.Gender = 0;
-                    }
+                    pk.Gender = pk.Gender == 0 ? 1 : 0;
                     LegalityAnalysis recheckLA2 = new LegalityAnalysis(pk);
                     updatedReport = recheckLA2.Report(false);
                 }
@@ -1256,14 +1259,7 @@
             string updatedReport = recheckLA.Report(false);
             if (updatedReport.Contains("PID-Gender mismatch"))
             {
-                if (pk.Gender == 0)
-                {
-                    pk.Gender = 1;
-                }
-                else
-                {
-                    pk.Gender = 0;
-                }
+                pk.Gender = pk.Gender == 0 ? 1 : 0;
                 LegalityAnalysis recheckLA2 = new LegalityAnalysis(pk);
                 updatedReport = recheckLA2.Report(false);
             }
@@ -1297,14 +1293,7 @@
             string updatedReport = recheckLA.Report(false);
             if (updatedReport.Contains("PID-Gender mismatch"))
             {
-                if (pk.Gender == 0)
-                {
-                    pk.Gender = 1;
-                }
-                else
-                {
-                    pk.Gender = 0;
-                }
+                pk.Gender = pk.Gender == 0 ? 1 : 0;
                 LegalityAnalysis recheckLA2 = new LegalityAnalysis(pk);
                 updatedReport = recheckLA2.Report(false);
             }


move user token deletion to delete method

--- src/Abp.ZeroCore/Authorization/Users/AbpUserStore.cs
+++ src/Abp.ZeroCore/Authorization/Users/AbpUserStore.cs
@@ -1320,13 +1320,10 @@
             Check.NotNull(user, nameof(user));

             await UserRepository.EnsureCollectionLoadedAsync(user, u => u.Tokens, cancellationToken);
-            var isValidityKeyValid = user.Tokens.Any(t => t.LoginProvider == TokenValidityKeyProvider &&
-                                               t.Name == tokenValidityKey &&
-                                               t.ExpireDate > DateTime.UtcNow);
-
-            user.Tokens.RemoveAll(t => t.LoginProvider == TokenValidityKeyProvider && t.ExpireDate <= DateTime.UtcNow);
-
-            return isValidityKeyValid;
+
+            return user.Tokens.Any(t => t.LoginProvider == TokenValidityKeyProvider &&
+                                        t.Name == tokenValidityKey &&
+                                        t.ExpireDate > DateTime.UtcNow);
         }

         public virtual async Task RemoveTokenValidityKeyAsync([NotNull] TUser user, string tokenValidityKey, CancellationToken cancellationToken = default(CancellationToken))
@@ -1337,8 +1334,7 @@

             await UserRepository.EnsureCollectionLoadedAsync(user, u => u.Tokens, cancellationToken);

-            user.Tokens.Remove(user.Tokens.FirstOrDefault(t =>
-                t.LoginProvider == TokenValidityKeyProvider && t.Name == tokenValidityKey));
+            user.Tokens.RemoveAll(t => t.LoginProvider == TokenValidityKeyProvider && t.Name == tokenValidityKey);
         }

         protected virtual string NormalizeKey(string key)


Account for changed naming in mgdb file names

Some of the wc files use Ho-oh instead of Ho-Oh so a direct species name contain is not enough. Better implementation is to compare lowercase strings to avoid such edge cases

--- AutoLegality/PKSMAutoLegality.cs
+++ AutoLegality/PKSMAutoLegality.cs
@@ -291,7 +291,7 @@
                 {
                     foreach (string mon in chain)
                     {
-                        if (file.Contains(mon) || Path.GetExtension(file) == ".pl6")
+                        if (file.ToLower().Contains(mon.ToLower()) || Path.GetExtension(file) == ".pl6")
                         {
                             fileList.Add(file);
                             Console.WriteLine(file);


Allow viewing unpublished posts if you know the url

--- Somedave/Controllers/BlogController.cs
+++ Somedave/Controllers/BlogController.cs
@@ -24,9 +24,9 @@
                         .OrderByDescending(x => x.Key));
             }

-            // Make sure this post is actually published
+            // Uncomment the publish check below to return a 404 if the post isn't published yet
             BlogPost post = RazorDb.Get<BlogPost>().FirstOrDefault(x => x.GetViewName() == viewName);
-            if (post == null || !post.IsPublished())
+            if (post == null /* || !post.IsPublished() */)
             {
                 return HttpNotFound();
             }


cancel tcs with canceltoken cancel

cancel tcs with canceltoken cancel

--- src/Acr.UserDialogs.Interface/AbstractUserDialogs.cs
+++ src/Acr.UserDialogs.Interface/AbstractUserDialogs.cs
@@ -42,7 +42,7 @@
                 cfg.Add(btn, () => tcs.TrySetResult(btn));

             var disp = this.ActionSheet(cfg);
-            using (cancelToken?.Register(disp.Dispose))
+            using (cancelToken?.Register(() => Cancel(disp, tcs)))
             {
                 return await tcs.Task;
             }
@@ -129,9 +129,9 @@
             using (cancelToken?.Register(() => Cancel(disp, tcs)))
             {
                 await tcs.Task;
-            }
-        }
-
+            }
+        }
+
         public virtual Task AlertAsync(string message, string title, string okText, CancellationToken? cancelToken = null)
         {
             return this.AlertAsync(new AlertConfig
@@ -294,7 +294,7 @@
         }

-        private static void Cancel<TResult>(IDisposable disp, TaskCompletionSource<TResult> tcs)
+        static void Cancel<TResult>(IDisposable disp, TaskCompletionSource<TResult> tcs)
         {
             disp.Dispose();
             tcs.TrySetCanceled();


[SONARMSBRU-177] Fixed SonarLint PR code analysis issues

--- SonarRunner.Shim/RoslynV1SarifFixer.cs
+++ SonarRunner.Shim/RoslynV1SarifFixer.cs
@@ -5,15 +5,11 @@
 // </copyright>
 //-----------------------------------------------------------------------

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using System.Diagnostics;
+using SonarQube.Common;
+using System;
 using System.IO;
-using SonarQube.Common;

 namespace SonarRunner.Shim
 {
@@ -29,7 +25,7 @@
         /// <summary>
         /// Returns true if the given SARIF came from the VS 2015 RTM Roslyn, which does not provide correct output.
         /// </summary>
-        private bool IsSarifFromRoslynV1(string input)
+        private static bool IsSarifFromRoslynV1(string input)
         {
             // low risk of false positives / false negatives
             return (input.Contains(@"""toolName"": ""Microsoft (R) Visual C# Compiler""")
@@ -39,7 +35,7 @@
         /// <summary>
         /// Returns true if the input is parseable JSON. No checks are made for conformation to the SARIF specification.
         /// </summary>
-        private bool IsValidJson(string input)
+        private static bool IsValidJson(string input)
         {
             try
             {
@@ -55,7 +51,7 @@
         /// <summary>
         /// The low-level implementation of the the fix - applying escaping to backslashes and quotes.
         /// </summary>
-        private string ApplyFixToSarif(string unfixedSarif)
+        private static string ApplyFixToSarif(string unfixedSarif)
         {
             string[] inputLines = unfixedSarif.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

@@ -100,24 +96,24 @@

         #region IRoslynV1SarifFixer

-        public string LoadAndFixFile(string sarifPath, ILogger logger)
+        public string LoadAndFixFile(string sarifFilePath, ILogger logger)
         {
-            if (!File.Exists(sarifPath))
+            if (!File.Exists(sarifFilePath))
             {
                 // file cannot be found -> inherently unfixable
-                logger.LogInfo(Resources.MSG_SarifFileNotFound, sarifPath);
+                logger.LogInfo(Resources.MSG_SarifFileNotFound, sarifFilePath);
                 return null;
             }

-            string inputSarifFileString = File.ReadAllText(sarifPath);
+            string inputSarifFileString = File.ReadAllText(sarifFilePath);

             if (IsValidJson(inputSarifFileString))
             {
                 // valid input -> no fix required
-                logger.LogDebug(Resources.MSG_SarifFileIsValid, sarifPath);
-                return sarifPath;
+                logger.LogDebug(Resources.MSG_SarifFileIsValid, sarifFilePath);
+                return sarifFilePath;
             }
-            logger.LogDebug(Resources.MSG_SarifFileIsInvalid, sarifPath);
+            logger.LogDebug(Resources.MSG_SarifFileIsInvalid, sarifFilePath);

             if (!IsSarifFromRoslynV1(inputSarifFileString))
             {
@@ -137,15 +133,15 @@
             else
             {
                 //output valid -> write to new file and return new path
-                string writeDir = Path.GetDirectoryName(sarifPath);
+                string writeDir = Path.GetDirectoryName(sarifFilePath);
                 string newSarifFileName =
-                    Path.GetFileNameWithoutExtension(sarifPath) + FixedFileSuffix + Path.GetExtension(sarifPath);
-                string newSarifPath = Path.Combine(writeDir, newSarifFileName);
+                    Path.GetFileNameWithoutExtension(sarifFilePath) + FixedFileSuffix + Path.GetExtension(sarifFilePath);
+                string newSarifFilePath = Path.Combine(writeDir, newSarifFileName);

-                File.WriteAllText(newSarifPath, changedSarif);
+                File.WriteAllText(newSarifFilePath, changedSarif);

-                logger.LogInfo(Resources.MSG_SarifFixSuccess, newSarifPath);
-                return newSarifPath;
+                logger.LogInfo(Resources.MSG_SarifFixSuccess, newSarifFilePath);
+                return newSarifFilePath;
             }
         }


Update patcher to support custom database names (#3514)

--- Source/ACE.Server/Program_DbUpdates.cs
+++ Source/ACE.Server/Program_DbUpdates.cs
@@ -208,6 +208,7 @@
                         Console.Write($"Found {file.FullName} .... ");
                         var sqlDBFile = File.ReadAllText(file.FullName);
                         var sqlConnect = new MySql.Data.MySqlClient.MySqlConnection($"server={ConfigManager.Config.MySql.World.Host};port={ConfigManager.Config.MySql.World.Port};user={ConfigManager.Config.MySql.World.Username};password={ConfigManager.Config.MySql.World.Password};database={ConfigManager.Config.MySql.World.Database};DefaultCommandTimeout=120");
+                        sqlDBFile = sqlDBFile.Replace("ace_world", ConfigManager.Config.MySql.World.Database);
                         var script = new MySql.Data.MySqlClient.MySqlScript(sqlConnect, sqlDBFile);

                         Console.Write($"Importing into World database on SQL server at {ConfigManager.Config.MySql.World.Host}:{ConfigManager.Config.MySql.World.Port} .... ");
@@ -265,6 +266,18 @@
                 Console.Write($"Found {file.Name} .... ");
                 var sqlDBFile = File.ReadAllText(file.FullName);
                 var sqlConnect = new MySql.Data.MySqlClient.MySqlConnection($"server={host};port={port};user={username};password={password};database={database};DefaultCommandTimeout=120");
+                switch (dbType)
+                {
+                    case "Authentication":
+                        sqlDBFile = sqlDBFile.Replace("ace_auth", database);
+                        break;
+                    case "Shard":
+                        sqlDBFile = sqlDBFile.Replace("ace_shard", database);
+                        break;
+                    case "World":
+                        sqlDBFile = sqlDBFile.Replace("ace_world", database);
+                        break;
+                }
                 var script = new MySql.Data.MySqlClient.MySqlScript(sqlConnect, sqlDBFile);

                 Console.Write($"Importing into {database} database on SQL server at {host}:{port} .... ");


Fixed #3: Implemented syntax for parallel INI-file servers

Fully backwards compatible with prior syntax, and following the order of operations defined in the IEnumerable ctor - which also matched the order given in the issue report fix notes I wrote.

--- Source/Chattel/ChattelConfiguration.cs
+++ Source/Chattel/ChattelConfiguration.cs
@@ -87,7 +87,7 @@
 						}
 					}

-					if (parallelServerConnectors.Count > 0) {
+					if (parallelServerConnectors.Any()) {
 						serialParallelAssetServers.Add(parallelServerConnectors);
 					}
 				}
@@ -133,44 +133,61 @@
 			SerialParallelAssetServers = serialParallelAssetServers;

 			// Read in a config list that lists the priority order of servers and their settings.
-			var sources = assetConfig?.GetString("Servers", string.Empty).Split(',').Where(source => !string.IsNullOrWhiteSpace(source)).Select(source => source.Trim());
-
-			if (sources != null && sources.Any()) {
-				foreach (var source in sources) {
-					var sourceConfig = configSource.Configs[source];
-					IAssetServer serverConnector = null;
-					var type = sourceConfig?.GetString("Type", string.Empty).ToLower();
-					try {
-						switch (type) {
-							case "whip":
-								serverConnector = new AssetServerWHIP(
-									source,
-									sourceConfig.GetString("Host", string.Empty),
-									sourceConfig.GetInt("Port", 32700),
-									sourceConfig.GetString("Password", "changeme") // Yes, that's the default password for WHIP.
-								);
-								break;
-							case "cf":
-								serverConnector = new AssetServerCF(
-									source,
-									sourceConfig.GetString("Username", string.Empty),
-									sourceConfig.GetString("APIKey", string.Empty),
-									sourceConfig.GetString("DefaultRegion", string.Empty),
-									sourceConfig.GetBoolean("UseInternalURL", true),
-									sourceConfig.GetString("ContainerPrefix", string.Empty)
-								);
-								break;
-							default:
-								LOG.Warn($"[ASSET_CONFIG] Unknown asset server type in section [{source}].");
-								break;
-						}
-					}
-					catch (SocketException e) {
-						LOG.Error($"[ASSET_CONFIG] Asset server of type '{type}' defined in section [{source}] failed setup. Skipping server.", e);
-					}
-
-					if (serverConnector != null) {
-						serialParallelAssetServers.Add(new List<IAssetServer> { serverConnector });
+			var serialParallelServerSources = assetConfig?
+				.GetString("Servers", string.Empty)
+				.Split(',')
+				.Where(parallelSources => !string.IsNullOrWhiteSpace(parallelSources))
+				.Select(parallelSources => parallelSources
+					.Split('&')
+					.Where(source => !string.IsNullOrWhiteSpace(source))
+					.Select(source => source.Trim())
+				)
+				.Where(parallelSources => parallelSources.Any())
+			;
+
+			if (serialParallelServerSources != null && serialParallelServerSources.Any()) {
+				foreach (var parallelSources in serialParallelServerSources) {
+					var parallelServerConnectors = new List<IAssetServer>();
+					foreach (var source in parallelSources) {
+						var sourceConfig = configSource.Configs[source];
+						IAssetServer serverConnector = null;
+						var type = sourceConfig?.GetString("Type", string.Empty).ToLower();
+						try {
+							switch (type) {
+								case "whip":
+									serverConnector = new AssetServerWHIP(
+										source,
+										sourceConfig.GetString("Host", string.Empty),
+										sourceConfig.GetInt("Port", 32700),
+										sourceConfig.GetString("Password", "changeme") // Yes, that's the default password for WHIP.
+									);
+									break;
+								case "cf":
+									serverConnector = new AssetServerCF(
+										source,
+										sourceConfig.GetString("Username", string.Empty),
+										sourceConfig.GetString("APIKey", string.Empty),
+										sourceConfig.GetString("DefaultRegion", string.Empty),
+										sourceConfig.GetBoolean("UseInternalURL", true),
+										sourceConfig.GetString("ContainerPrefix", string.Empty)
+									);
+									break;
+								default:
+									LOG.Warn($"[ASSET_CONFIG] Unknown asset server type in section [{source}].");
+									break;
+							}
+						}
+						catch (SocketException e) {
+							LOG.Error($"[ASSET_CONFIG] Asset server of type '{type}' defined in section [{source}] failed setup. Skipping server.", e);
+						}
+
+						if (serverConnector != null) {
+							parallelServerConnectors.Add(serverConnector);
+						}
+					}
+
+					if (parallelServerConnectors.Any()) {
+						serialParallelAssetServers.Add(parallelServerConnectors);
 					}
 				}
 			}


Update IndexModule.cs

Update IndexModule.cs

--- src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
+++ src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
@@ -12,7 +12,7 @@
             {
                 var model = new IndexViewModel
                 {
-                    HelloName = "Leeds#",
+                    HelloName = "AppVeyor",
                     ServerName = ConfigurationManager.AppSettings["Server_Name"]
                 };


Fix #194, prevent null Verse.Text from creating NullReferenceException.

--- src/BibleBot.Backend/Controllers/VersesController.cs
+++ src/BibleBot.Backend/Controllers/VersesController.cs
@@ -107,6 +107,11 @@
                             case "bg":
                                 Verse result = await _bgProvider.GetVerse(reference, titlesEnabled, verseNumbersEnabled);

+                                if (result.Text == null)
+                                {
+                                    break;
+                                }
+
                                 if (displayStyle == "embed" && result.Text.Length > 2048)
                                 {
                                     result.Text = $"{String.Join("", result.Text.SkipLast(result.Text.Length - 2044))}...";


Fix: Only one of the four ANN output signals was being read. This effectively completely broke the prey capture domain.

--- SharpNeatV2/src/SharpNeatDomains/PreyCapture/PreyCaptureWorld.cs
+++ SharpNeatV2/src/SharpNeatDomains/PreyCapture/PreyCaptureWorld.cs
@@ -241,7 +241,7 @@
             {
                 if(agent.OutputSignalArray[i] > maxSig)
                 {
-                    maxSig = agent.OutputSignalArray[1];
+                    maxSig = agent.OutputSignalArray[i];
                     maxSigIdx = i;
                 }
                 else if(agent.OutputSignalArray[i] == maxSig)
@@ -327,7 +327,6 @@

         #endregion

-
         #region Private Methods

 		private double MovePrey_T(double distance)
@@ -352,6 +351,5 @@
         }

         #endregion
-
     }
 }


put up supporting works2

put up supporting works2

--- Badges/Views/Public/Badge.cshtml
+++ Badges/Views/Public/Badge.cshtml
@@ -6,8 +6,9 @@

-
-        Viewing the badge: @Model.BadgeSubmission.Badge.Name awarded to @Model.CreatorProfile.DisplayName on @string.Format("{0:d}", Model.BadgeSubmission.AwardedOn)
+
+            Viewing the badge: @Model.BadgeSubmission.Badge.Name awarded to @Model.CreatorProfile.DisplayName on @string.Format("{0:d}", Model.BadgeSubmission.AwardedOn)
+

@@ -35,7 +36,7 @@

         @foreach (var exp in Model.Experiences)
         {
-
 Here is the supporting work from " @exp.Name"

+
 Here is the supporting work from " @exp.Name"

             if (exp.SupportingWorks == null)
             {

 No work to display!


Return 403 instead of 401

Return 403 instead of 401

--- src/CVaS.Web/Filters/HttpExceptionFilterAttribute.cs
+++ src/CVaS.Web/Filters/HttpExceptionFilterAttribute.cs
@@ -31,7 +31,7 @@
                     break;

                 case UnauthorizedAccessException _:
-                    context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
+                    context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
                     context.ExceptionHandled = true;
                     break;
             }


Link to ToS and Privacy Policy from /User/Register

--- src/ChessVariantsTraining/Views/User/Register.cshtml
+++ src/ChessVariantsTraining/Views/User/Register.cshtml
@@ -13,3 +13,4 @@

Email: <input type="text" placeholder="Email" name="email">

 <input type="submit" value="Sign up">
 @{ Html.EndForm(); }
+
By signing up you agree with our @Html.ActionLink("Terms of Service", "TermsOfService", "Misc") and @Html.ActionLink("Privacy Policy", "PrivacyPolicy", "Misc").


added sharks teeth promo

added sharks teeth promo

--- src/CollectionsOnline.WebSite/Views/HomeIndex.cshtml
+++ src/CollectionsOnline.WebSite/Views/HomeIndex.cshtml
@@ -11,6 +11,75 @@
                 Search
             </button>
         </form>
+

+

+

+

+
Colossal Shark Feast Find

+
Discover evidence of a shark twice the size of a Great White that stalked Australia's ancient waters

+

+
+
+
+
+
+
+
+                            article
+
+
+                    Shark Tooth Assemblage
+
+
+

+

+
+
+
+
+
+
+
+                            specimen
+
+
+                    P 253864.8
+                    Carcharocles angustidens (Agassiz, 1843)
+
+
+

+

+
+
+
+
+
+
+
+                            specimen
+
+
+                    P 253864.32
+                    Carcharocles angustidens (Agassiz, 1843)
+
+
+

+

+
+
+
+
+
+
+
+                            specimen
+
+
+                    P 253894.4
+                    Hexanchus agassiz
+
+
+


changing last push

changing last push

--- src/ConveyorBelt.Tooling/ElasticserachBatchPusher.cs
+++ src/ConveyorBelt.Tooling/ElasticserachBatchPusher.cs
@@ -30,6 +30,8 @@
         private IIndexNamer _indexNamer;
         private object _lock = new object();
         private Func<IInterval> _intervalGen;
+        private DateTimeOffset _lastPush = DateTimeOffset.Now;
+        private readonly TimeSpan _maxWait = TimeSpan.FromSeconds(30);

         public ElasticsearchBatchPusher(IHttpClient httpClient, IConfigurationValueProvider configurationValueProvider, string esUrl, IIndexNamer indexNamer, int batchSize = 500)
         {
@@ -148,7 +150,7 @@

             _batch.AddDoc(JsonConvert.SerializeObject(op).Replace("\r\n", " "), doc.ToString().Replace("\r\n", " "));

-            if (_batch.Count >= _batchSize)
+            if (_batch.Count >= _batchSize ||  DateTimeOffset.Now.Subtract(_lastPush) > _maxWait)
             {
                 Batch batch = null;
                 lock (_lock)
@@ -156,6 +158,7 @@
                     if (_batch.Count >= _batchSize)
                     {
                         batch = _batch.CloneAndClear();
+                        _lastPush = DateTimeOffset.Now;
                     }
                 }


rename arg

rename arg

--- src/CorvusAlba.MyLittleLispy.Hosting/ScriptEngine.cs
+++ src/CorvusAlba.MyLittleLispy.Hosting/ScriptEngine.cs
@@ -23,20 +23,20 @@
 	    return _parser.Parse(line).Eval(_context);
 	}

-	public Value Execute(Stream stream, bool useGlobalScope = false)
+	public Value Execute(Stream stream, bool useGlobalFrame = false)
 	{
 	    using(var sr = new StreamReader(stream))
 	    {
-		return Execute(sr.ReadToEnd(), useGlobalScope);
+		return Execute(sr.ReadToEnd(), useGlobalFrame);
 	    }
 	}

-	public Value Execute(string script, bool useGlobalScope = false)
+	public Value Execute(string script, bool useGlobalFrame = false)
 	{
 	    Value result = Null.Value;
 	    var count = 0;

-	    if (!useGlobalScope)
+	    if (!useGlobalFrame)
 	    {
 		_context.BeginFrame();
 	    }
@@ -61,7 +61,7 @@
 		}
 	    }

-	    if (!useGlobalScope)
+	    if (!useGlobalFrame)
 	    {
 		_context.EndFrame();
 	    }


BugFix: Sometimes encoding is enclosed in additional quotes.

--- CRR/Util/HttpDownloader.cs
+++ CRR/Util/HttpDownloader.cs
@@ -95,7 +95,7 @@
       {
         try
         {
-          Encoding = Encoding.GetEncoding(charset);
+          Encoding = Encoding.GetEncoding(charset.Replace("\"", string.Empty )); // Sometimes encoding is enclosed in additional quotes.
         }
         catch (ArgumentException)
         {


Implemented flight time credit handling for deleting a delivery case

--- src/FLS.Server.Service/Accounting/DeliveryService.cs
+++ src/FLS.Server.Service/Accounting/DeliveryService.cs
@@ -1238,6 +1238,21 @@
                     flight.EntityNotNull("Flight", flightId);
                     flight.DeletedDeliveryForFlight(); //reset process state to locked

+                    //handle person flight time credit
+                    var flightTimeCredit = context.PersonFlightTimeCredits
+                        .FirstOrDefault(x => x.PersonId == delivery.RecipientPersonId
+                            && x.BalanceDateTime == flight.DeliveryCreatedOn.Value);
+
+                    if (flightTimeCredit != null)
+                    {
+                        var flighttimeCreditEntry = new PersonFlightTimeCredit(flightTimeCredit);
+                        flighttimeCreditEntry.BalanceDateTime = DateTime.UtcNow;
+                        flighttimeCreditEntry.CurrentFlightTimeBalanceInSeconds -= (long)flight.FlightDurationZeroBased.TotalSeconds;
+
+                        //add it to the db context
+                        context.PersonFlightTimeCredits.Add(flighttimeCreditEntry);
+                    }
+
                     if (flight.TowFlightId.HasValue)
                     {
                         flightId = flight.TowFlightId.Value;


Distributions - added XML comments, converted tabs to spaces, used 'this' where necessary.

--- src/FireworksNet/Distributions/NormalDistribution.cs
+++ src/FireworksNet/Distributions/NormalDistribution.cs
@@ -10,21 +10,21 @@

         public NormalDistribution(double mean, double stddev)
         {
-            internalNormal = new Normal(mean, stddev);
+            this.internalNormal = new Normal(mean, stddev);
         }

         public double Sample()
         {
-            Debug.Assert(internalNormal != null, "Internal distribution implementation is null");
+            Debug.Assert(this.internalNormal != null, "Internal distribution implementation is null");

-            return internalNormal.Sample();
+            return this.internalNormal.Sample();
         }

         public IEnumerable<double> Samples()
         {
-            Debug.Assert(internalNormal != null, "Internal distribution implementation is null");
+            Debug.Assert(this.internalNormal != null, "Internal distribution implementation is null");

-            return internalNormal.Samples();
+            return this.internalNormal.Samples();
         }
     }
 }


fix xmldoc warning

fix xmldoc warning

--- Source/LinqToDB/Data/DataConnection.cs
+++ Source/LinqToDB/Data/DataConnection.cs
@@ -944,7 +944,7 @@
 		public event Action<DataConnection, IDbConnection> OnConnectionOpened;

 		/// <summary>
-		/// Event, triggered right after connection opened using <see cref="DbConnection.OpenAsync"/> methods.
+		/// Event, triggered right after connection opened using <see cref="DbConnection.OpenAsync()"/> methods.
 		/// </summary>
 		public event Func<DataConnection, IDbConnection, CancellationToken, Task> OnConnectionOpenedAsync;


Fixing benchmarks

Fixing benchmarks

--- src/GeneticSharp.Benchmarks/TerminationsBenchmark.cs
+++ src/GeneticSharp.Benchmarks/TerminationsBenchmark.cs
@@ -1,11 +1,6 @@
 using System;
-using System.Collections.Generic;
 using BenchmarkDotNet.Attributes;
-using BenchmarkDotNet.Order;
 using GeneticSharp.Domain;
-using GeneticSharp.Domain.Chromosomes;
-using GeneticSharp.Domain.Populations;
-using GeneticSharp.Domain.Reinsertions;
 using GeneticSharp.Domain.Terminations;
 using GeneticSharp.Extensions.Tsp;
 using NSubstitute;
@@ -15,16 +10,6 @@
     [Config(typeof(DefaultConfig))]
     public class TerminationsBenchmark
     {
-        private static readonly int _numberOfCities = 10;
-        private IPopulation _population = new Population(10, 10, new TspChromosome(_numberOfCities));
-        private IList<IChromosome> _parents = new IChromosome[]
-        {
-            new TspChromosome(_numberOfCities),
-            new TspChromosome(_numberOfCities),
-            new TspChromosome(_numberOfCities),
-            new TspChromosome(_numberOfCities),
-            new TspChromosome(_numberOfCities)
-        };
         private ITermination _trueTermination = Substitute.For<ITermination>();
         private ITermination _falseTermination = Substitute.For<ITermination>();

@@ -47,7 +32,7 @@
         {
             var target = new FitnessStagnationTermination(2);
             var ga = Substitute.For<IGeneticAlgorithm>();
-            ga.BestChromosome.Returns(new TspChromosome(1));
+            ga.BestChromosome.Returns(new TspChromosome(10) { Fitness = 1 });
             target.HasReached(ga);
             target.HasReached(ga);

@@ -59,7 +44,7 @@
         {
             var target = new FitnessThresholdTermination(1d);
             var ga = Substitute.For<IGeneticAlgorithm>();
-            ga.BestChromosome.Returns(new TspChromosome(1) { Fitness = 1d });
+            ga.BestChromosome.Returns(new TspChromosome(10) { Fitness = 1d });
             target.HasReached(ga);

             return target;


Updating arguments to work in windows as well

--- src/GitHub.Api/Application/ApplicationManagerBase.cs
+++ src/GitHub.Api/Application/ApplicationManagerBase.cs
@@ -80,7 +80,9 @@
             var targetPath = NPath.CurrentDirectory;

             var unityYamlMergeExec = Environment.UnityApplication.Parent.Combine("Tools", "UnityYAMLMerge");
-            var yamlMergeCommand = $@"'{unityYamlMergeExec}' merge -p '$BASE' '$REMOTE' '$LOCAL' '$MERGED'";
+            var yamlMergeCommand = Environment.IsWindows
+                ? $@"'{unityYamlMergeExec}' merge -p ""$BASE"" ""$REMOTE"" ""$LOCAL"" ""$MERGED"""
+                : $@"'{unityYamlMergeExec}' merge -p '$BASE' '$REMOTE' '$LOCAL' '$MERGED'";

             var gitignore = targetPath.Combine(".gitignore");
             var gitAttrs = targetPath.Combine(".gitattributes");


- Fixed reading of generic parameters from Metadata

--- Source/Runtime/Vm/DefaultTypeSystem.cs
+++ Source/Runtime/Vm/DefaultTypeSystem.cs
@@ -878,7 +878,7 @@
 			switch (owner & TokenTypes.TableMask)
 			{
 				case TokenTypes.TypeDef:
-					_types[typeOffset + (int)(TokenTypes.RowIndexMask & owner) - 1].SetGenericParameter(gprs);
+					_types[typeOffset + (int)(TokenTypes.RowIndexMask & owner)].SetGenericParameter(gprs);
 					break;

 				case TokenTypes.MethodDef:


FIX: Now also registers the WIC result descriptor provider when the Direct2D1 module is initialized.

--- Source/SharpDX.Direct2D1/ModuleInit.cs
+++ Source/SharpDX.Direct2D1/ModuleInit.cs
@@ -36,6 +36,7 @@
         {
             // Register automatically Resultcode
             ResultDescriptor.RegisterProvider(typeof(ResultCode));
+            ResultDescriptor.RegisterProvider(typeof(WIC.ResultCode));
         }
     }
 }


Remove commented tests (#38399)

Remove commented tests (#38399)

--- src/Identity/test/Identity.Test/SignInManagerTest.cs
+++ src/Identity/test/Identity.Test/SignInManagerTest.cs
@@ -20,52 +20,6 @@

 public class SignInManagerTest
 {
-    //[Theory]
-    //[InlineData(true)]
-    //[InlineData(false)]
-    //public async Task VerifyAccountControllerSignInFunctional(bool isPersistent)
-    //{
-    //    var app = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider());
-    //    app.UseCookieAuthentication(new CookieAuthenticationOptions
-    //    {
-    //        AuthenticationScheme = ClaimsIdentityOptions.DefaultAuthenticationScheme
-    //    });
-
-    // TODO: how to functionally test context?
-    //    var context = new DefaultHttpContext(new FeatureCollection());
-    //    var contextAccessor = new Mock<IHttpContextAccessor>();
-    //    contextAccessor.Setup(a => a.Value).Returns(context);
-    //    app.UseServices(services =>
-    //    {
-    //        services.AddSingleton(contextAccessor.Object);
-    //        services.AddSingleton<Ilogger>(new Nulllogger());
-    //        services.AddIdentity<ApplicationUser, IdentityRole>(s =>
-    //        {
-    //            s.AddUserStore(() => new InMemoryUserStore<ApplicationUser>());
-    //            s.AddUserManager<ApplicationUserManager>();
-    //            s.AddRoleStore(() => new InMemoryRoleStore<IdentityRole>());
-    //            s.AddRoleManager<ApplicationRoleManager>();
-    //        });
-    //        services.AddTransient<ApplicationHttpSignInManager>();
-    //    });
-
-    //    // Act
-    //    var user = new ApplicationUser
-    //    {
-    //        UserName = "Yolo"
-    //    };
-    //    const string password = "[PLACEHOLDER]-1a";
-    //    var userManager = app.ApplicationServices.GetRequiredService<ApplicationUserManager>();
-    //    var HttpSignInManager = app.ApplicationServices.GetRequiredService<ApplicationHttpSignInManager>();
-
-    //    IdentityResultAssert.IsSuccess(await userManager.CreateAsync(user, password));
-    //    var result = await HttpSignInManager.PasswordSignInAsync(user.UserName, password, isPersistent, false);
-
-    //    // Assert
-    //    Assert.Equal(SignInStatus.Success, result);
-    //    contextAccessor.Verify();
-    //}
-
     [Fact]
     public void ConstructorNullChecks()
     {
@@ -77,34 +31,6 @@
         contextAccessor.Setup(a => a.HttpContext).Returns(context.Object);
         Assert.Throws<ArgumentNullException>("claimsFactory", () => new SignInManager<PocoUser>(userManager, contextAccessor.Object, null, null, null, null, null));
     }
-
-    //[Fact]
-    //public async Task EnsureClaimsPrincipalFactoryCreateIdentityCalled()
-    //{
-    //    // Setup
-    //    var user = new TestUser { UserName = "Foo" };
-    //    var userManager = MockHelpers.TestUserManager<TestUser>();
-    //    var identityFactory = new Mock<IUserClaimsPrincipalFactory<TestUser>>();
-    //    const string authType = "Test";
-    //    var testIdentity = new ClaimsPrincipal();
-    //    identityFactory.Setup(s => s.CreateAsync(user)).ReturnsAsync(testIdentity).Verifiable();
-    //    var context = new Mock<HttpContext>();
-    //    var response = new Mock<HttpResponse>();
-    //    context.Setup(c => c.Response).Returns(response.Object).Verifiable();
-    //    response.Setup(r => r.SignIn(testIdentity, It.IsAny<AuthenticationProperties>())).Verifiable();
-    //    var contextAccessor = new Mock<IHttpContextAccessor>();
-    //    contextAccessor.Setup(a => a.Value).Returns(context.Object);
-    //    var helper = new HttpAuthenticationManager(contextAccessor.Object);
-
-    //    // Act
-    //    helper.SignIn(user, false);
-
-    //    // Assert
-    //    identityFactory.Verify();
-    //    context.Verify();
-    //    contextAccessor.Verify();
-    //    response.Verify();
-    //}

     [Fact]
     public async Task PasswordSignInReturnsLockedOutWhenLockedOut()


Force initialization of Views before ActiveViews

--- Source/Wpf/Prism.Wpf/Regions/Region.cs
+++ Source/Wpf/Prism.Wpf/Regions/Region.cs
@@ -122,6 +122,12 @@
         {
             get
             {
+                if (this.views == null)
+                {
+                    this.views = new ViewsCollection(ItemMetadataCollection, x => true);
+                    this.views.SortComparison = this.sort;
+                }
+
                 if (this.activeViews == null)
                 {
                     this.activeViews = new ViewsCollection(ItemMetadataCollection, x => x.IsActive);


Extending tests to null

Extending tests to null

--- SpaydParserLibTests/SindParserTests.cs
+++ SpaydParserLibTests/SindParserTests.cs
@@ -24,10 +24,10 @@
         }

         [Test]
-        public void TryGetId_WhenEmpty()
-        {
-            // Arrange
-            SindParser parser = new SindParser(CreateTestCase("ID", ""));
+        public void TryGetId_WhenNullOrEmpty([Values(null, "")] string value)
+        {
+            // Arrange
+            SindParser parser = new SindParser(CreateTestCase("ID", value));

             // Act
             var id = parser.TryGetId();
@@ -64,10 +64,10 @@
         }

         [Test]
-        public void TryGetIssuedDate_WhenEmpty()
-        {
-            // Arrange
-            SindParser parser = new SindParser(CreateTestCase("DD", ""));
+        public void TryGetIssuedDate_WhenNullOrEmpty([Values(null, "")] string value)
+        {
+            // Arrange
+            SindParser parser = new SindParser(CreateTestCase("DD", value));

             // Act
             var result = parser.TryGetIssuedDate();


Fix account button text always displaying username

--- SteamAccountSwitcher/AccountHandler.cs
+++ SteamAccountSwitcher/AccountHandler.cs
@@ -156,9 +156,9 @@

         private static string GetAccountDisplayName(Account account)
         {
-            return string.IsNullOrWhiteSpace(account.Username)
-                ? account.DisplayName
-                : account.Username;
+            return string.IsNullOrWhiteSpace(account.DisplayName)
+                ? account.Username
+                : account.DisplayName;
         }
     }
 }


Fix issue where DisplayDictionary output may be too long for IRC.

--- SteamIrcBot/Utils/DisplayDictionary.cs
+++ SteamIrcBot/Utils/DisplayDictionary.cs
@@ -10,7 +10,7 @@
         int maxValueLen;

-        public DisplayDictionary( int maxLen = 200 )
+        public DisplayDictionary( int maxLen = 100 )
         {
             maxValueLen = maxLen;
         }


Rename GetServiceName to GetServiceNameOrDefault

Change-Id: Ic0c1f9f46205968ddbed97303428a19b930a2edd

--- Criteo.Profiling.Tracing/Tracers/Zipkin/ThriftSpanSerializer.cs
+++ Criteo.Profiling.Tracing/Tracers/Zipkin/ThriftSpanSerializer.cs
@@ -65,7 +65,7 @@

             // Use default value if no information were recorded
             var spanEndpoint = span.Endpoint ?? DefaultEndPoint;
-            var spanServiceName = GetServiceName(span);
+            var spanServiceName = GetServiceNameOrDefault(span);
             spanServiceName = spanServiceName.Replace(" ", "_"); // whitespaces cause issues with the query and ui

             var host = new Endpoint
@@ -95,7 +95,7 @@
             return thriftSpan;
         }

-        private static string GetServiceName(Span span)
+        private static string GetServiceNameOrDefault(Span span)
         {
             if (string.IsNullOrWhiteSpace(span.ServiceName))
             {


making controlls easier

making controlls easier

--- Documents/Unity3D/Catcheep/Assets/Scripts/ObstacleController.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/ObstacleController.cs
@@ -8,6 +8,8 @@
     private GameObject obstacle;

     private Vector2 edgeOfScreen;
+
+    [Range(0, 10)] public int speed;

 	// Use this for initialization
 	void Start ()
@@ -22,7 +24,7 @@
 	    if (obstacle != null) //this is an ensurance policy, do not touch it
 	    {
             //making the obstacle go...
-	        obstacle.transform.position += Time.deltaTime * new Vector3(1f,0f,0f);
+	        obstacle.transform.position += Time.deltaTime * new Vector3(speed,0f,0f);
             //destroying it when it reaches far end of screen...
 	        if (obstacle.transform.position.x >= edgeOfScreen.x +
 	            obstacle.GetComponent<SpriteRenderer>().sprite.bounds.size.x)


Deleted some code

Deleted some code

Some code in firelemon.cs was creating NREs when lemons were primed, so I deleted it.

--- UnityProject/Assets/Scripts/Weapons/FireLemon.cs
+++ UnityProject/Assets/Scripts/Weapons/FireLemon.cs
@@ -34,8 +34,6 @@

 	[Tooltip("SpriteHandler used for blinking animation")]
 	public SpriteHandler spriteHandler;
-	[Tooltip("Used for inventory animation")]
-	public Pickupable pickupable;

 	// Zero and one sprites reserved for left and right hands
 	private const int LOCKED_SPRITE = 2;
@@ -133,20 +131,6 @@
 		spriteHandler?.ChangeSprite(sprite);
 	}

-	/// <summary>
-	/// This coroutines make sure that sprite in hands is animated
-	/// TODO: replace this with more general aproach for animated icons
-	/// </summary>
-	/// <returns></returns>
-	private IEnumerator AnimateSpriteInHands()
-	{
-		while (timerRunning && !hasExploded)
-		{
-			pickupable.RefreshUISlotImage();
-			yield return null;
-		}
-	}
-
 	public void Explode()
 	{
 		if (hasExploded)
@@ -215,8 +199,6 @@
 		{
 			// Start playing arm animation
 			UpdateSprite(ARMED_SPRITE);
-			// Update grenade icon in hands
-			StartCoroutine(AnimateSpriteInHands());
 		}
 		else
 		{


Remove using

Remove using

--- WalletWasabi.Fluent/ViewModels/AboutViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/AboutViewModel.cs
@@ -3,7 +3,6 @@
 using System.Reactive;
 using System.Reactive.Linq;
 using System.Reactive.Threading.Tasks;
-using System.Threading.Tasks;
 using System.Windows.Input;
 using ReactiveUI;
 using WalletWasabi.Fluent.ViewModels.Dialogs;


Fix bug in IEnumerableExtensions.ToComma...()

It would fail for empty lists 🤦

--- Zermelo.App.UWP/Helpers/IEnumerableExtensions.cs
+++ Zermelo.App.UWP/Helpers/IEnumerableExtensions.cs
@@ -10,6 +10,8 @@
     {
         public static string ToCommaSpaceSeperatedString<T>(this IEnumerable<T> list)
         {
+            if (list.Count() < 1) return "";
+
             StringBuilder s = new StringBuilder();

             foreach (T t in list)


Add Bruce Wayne to contact page.

Add Bruce Wayne to contact page.

--- ZirMed.TrainingSandbox/Views/Home/Contact.cshtml
+++ ZirMed.TrainingSandbox/Views/Home/Contact.cshtml
@@ -21,4 +21,5 @@
     Travis: travis.elkins@zirmed.com
     Travis2: travis.elkins@zirmed.com
     Stephanie: stephanie.craig@zirmed.com
+    Bruce Wayne:
 </address>


modify

modify

--- Tools/ClearDotNetCoreBadFiles/ClearDotNetCoreBadFiles/Program.cs
+++ Tools/ClearDotNetCoreBadFiles/ClearDotNetCoreBadFiles/Program.cs
@@ -20,7 +20,7 @@
             Console.WriteLine("清理开始……");

             CleanDir("../src/");
-
+
             Console.WriteLine("清理完毕，点击任意键退出");
             Console.ReadKey();
         }


First bit of progress, can now get click events out of editor events.

--- UnityProject/Assets/Scripts/Editor/Inspector/DoorSwitchEditor.cs
+++ UnityProject/Assets/Scripts/Editor/Inspector/DoorSwitchEditor.cs
@@ -1,15 +1,26 @@
 using System.Linq;
 using UnityEngine;
 using UnityEditor;
+using UnityEditorInternal;

 [CustomEditor(typeof(DoorSwitch))]
 public class DoorSwitchEditor : Editor
 {
 	private DoorSwitch doorSwitch;
 	private bool isSelecting;
+	private bool isLeftMouseButtonDown;

-	void OnEnable() { EditorApplication.update += Update; }
-	void OnDisable() { EditorApplication.update -= Update; }
+	void OnEnable()
+	{
+		EditorApplication.update += Update;
+		SceneView.duringSceneGui += OnScene;
+	}
+
+	void OnDisable()
+	{
+		EditorApplication.update -= Update;
+		SceneView.duringSceneGui -= OnScene;
+	}

 	void Update()
 	{
@@ -19,7 +30,7 @@

 		//was a new object was selected?
 		GameObject newSelectedObject = (GameObject)Selection.activeObject;
-		if (newSelectedObject != doorSwitch.gameObject)
+		if (newSelectedObject != null && newSelectedObject != doorSwitch.gameObject)
 		{
 			//remove DoorController if found, add if not
 			var doorController = newSelectedObject.GetComponent<DoorController>();
@@ -38,9 +49,27 @@
 					doorSwitch.doorControllers = list.ToArray();
 				}
 			}
+		}

-			//return selection to switch
-			Selection.activeGameObject = doorSwitch.gameObject;
+		//return selection to switch
+		Selection.activeGameObject = doorSwitch.gameObject;
+	}
+
+	void OnScene(SceneView scene)
+	{
+		//skip if not selecting
+		if (!isSelecting || doorSwitch == null)
+			return;
+
+		Event e = Event.current;
+
+		if (HasPressedLeftClick(e))
+		{
+			var point = GUIUtility.GUIToScreenPoint(e.mousePosition);
+
+			// get gameobjects at point
+
+			Debug.Log("Left click was pressed at: " + point.ToString());
 		}
 	}

@@ -78,4 +107,9 @@
 		Event e = Event.current;
 		return e.type == EventType.KeyDown && e.keyCode == KeyCode.Escape;
 	}
+
+	bool HasPressedLeftClick(Event e)
+	{
+		return e.type == EventType.MouseDown && e.button == 0;
+	}
 }


Change MatrixInfo from struct to class

Change MatrixInfo from struct to class

MatrixInfo is a struct. A struct with 20+ fields. A struct that is copied in a lot of functions. This really should not be a struct.
Changing this to a class prevents copying all the fields. This is a significant time savings (around 30% for small functions) for anything that uses MatrixInfo.

--- UnityProject/Assets/Scripts/Managers/MatrixManager/MatrixInfo.cs
+++ UnityProject/Assets/Scripts/Managers/MatrixManager/MatrixInfo.cs
@@ -5,7 +5,7 @@
 using TileManagement;

 /// Struct that helps identify matrices
-public struct MatrixInfo
+public class MatrixInfo
 {
 	public string Name => Matrix.gameObject.name;
 	public int Id;


Reorder methods in script

Reorder methods in script

--- UnityProject/Assets/Scripts/Tilemaps/Behaviours/TilemapDamage.cs
+++ UnityProject/Assets/Scripts/Tilemaps/Behaviours/TilemapDamage.cs
@@ -86,54 +86,6 @@
 		});
 	}

-	private float GetReducedDamage(Vector3Int cellPos, float dmgAmt, AttackType attackType)
-	{
-
-		var layerTile = metaTileMap.GetTile(cellPos, Layer.LayerType);
-		if (layerTile is BasicTile tile)
-		{
-			return tile.Armor.GetDamage(dmgAmt, attackType);
-		}
-
-		return dmgAmt;
-	}
-
-	private float CalculateAbsorbDamaged(Vector3Int cellPos, AttackType attackType, MetaDataNode data, BasicTile tile = null)
-	{
-		if (tile == null)
-		{
-			tile= metaTileMap.GetTile(cellPos, Layer.LayerType) as BasicTile;
-		}
-
-		float currentDamage = data.Damage;
-		if (tile.MaxHealth < data.Damage)
-		{
-			currentDamage = tile.MaxHealth;
-			data.ResetDamage();
-		}
-
-		if (tile.Armor.GetRatingValue(attackType) > 0 && (currentDamage - data.GetPreviousDamage()) > 0)
-		{
-			return ((currentDamage - data.GetPreviousDamage() ) / tile.Armor.GetRatingValue(attackType));
-		}
-		else
-		{
-			return (0);
-		}
-
-	}
-
-	private float GetMaxDamage(Vector3Int cellPos)
-	{
-		var layerTile = metaTileMap.GetTile(cellPos, Layer.LayerType);
-		if (layerTile is BasicTile tile)
-		{
-			return tile.MaxHealth;
-		}
-
-		return 0;
-	}
-
 	//Server Only:
 	public void OnCollisionEnter2D(Collision2D coll)
 	{
@@ -428,6 +380,54 @@
 		return CalculateAbsorbDamaged(cellPos, attackType,data,tile);
 	}

+	private float GetReducedDamage(Vector3Int cellPos, float dmgAmt, AttackType attackType)
+	{
+
+		var layerTile = metaTileMap.GetTile(cellPos, Layer.LayerType);
+		if (layerTile is BasicTile tile)
+		{
+			return tile.Armor.GetDamage(dmgAmt, attackType);
+		}
+
+		return dmgAmt;
+	}
+
+	private float GetMaxDamage(Vector3Int cellPos)
+	{
+		var layerTile = metaTileMap.GetTile(cellPos, Layer.LayerType);
+		if (layerTile is BasicTile tile)
+		{
+			return tile.MaxHealth;
+		}
+
+		return 0;
+	}
+
+	private float CalculateAbsorbDamaged(Vector3Int cellPos, AttackType attackType, MetaDataNode data, BasicTile tile = null)
+	{
+		if (tile == null)
+		{
+			tile= metaTileMap.GetTile(cellPos, Layer.LayerType) as BasicTile;
+		}
+
+		float currentDamage = data.Damage;
+		if (tile.MaxHealth < data.Damage)
+		{
+			currentDamage = tile.MaxHealth;
+			data.ResetDamage();
+		}
+
+		if (tile.Armor.GetRatingValue(attackType) > 0 && (currentDamage - data.GetPreviousDamage()) > 0)
+		{
+			return ((currentDamage - data.GetPreviousDamage() ) / tile.Armor.GetRatingValue(attackType));
+		}
+		else
+		{
+			return (0);
+		}
+
+	}
+
 	public void RepairWindow(Vector3Int cellPos)
 	{
 		var data = metaDataLayer.Get(cellPos);


remove unnecessary check.

remove unnecessary check.

--- WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -884,13 +884,10 @@
 				return;
 			}

-			if (!string.IsNullOrWhiteSpace(CustomChangeAddress))
-			{
-				if (Address == CustomChangeAddress)
-				{
-					errors.Add(ErrorSeverity.Error, "The active address and the change address cannot be the same.");
-				}
-			}
+			if (Address == CustomChangeAddress)
+			{
+				errors.Add(ErrorSeverity.Error, "The active address and the change address cannot be the same.");
+			}

 			if (AddressStringParser.TryParseBitcoinAddress(Address, Global.Network, out _))
 			{


Make Max Amount consistent

Make Max Amount consistent

--- WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -153,7 +153,7 @@
 				var amount = AmountText;
 				if (IsMax)
 				{
-					SetAmountIfMax();
+					SetFeesAndTexts();
 				}
 				else
 				{
@@ -212,7 +212,7 @@
 				{
 					if (IsMax)
 					{
-						SetAmountIfMax();
+						SetFeesAndTexts();

 						LabelToolTip = "Spending whole coins does not generate change, thus labeling is unnecessary.";
 					}


evh attach add defensive remove before adding.

--- YetAnotherChartComponent/YetAnotherChartComponent/Chart/Chart.cs
+++ YetAnotherChartComponent/YetAnotherChartComponent/Chart/Chart.cs
@@ -426,6 +426,7 @@
 						// force this dirty so it refreshes
 						ds.IsDirty = true;
 					}
+					ds.RefreshRequest -= DataSource_RefreshRequest;
 					ds.RefreshRequest += DataSource_RefreshRequest;
 					ds.DataContext = DataContext;
 				}
@@ -451,6 +452,7 @@
 			if (nccea.NewItems != null) {
 				foreach (ChartComponent cc in nccea.NewItems) {
 					_trace.Verbose($"enter '{cc.Name}' {cc}");
+					cc.RefreshRequest -= ChartComponent_RefreshRequest;
 					cc.RefreshRequest += ChartComponent_RefreshRequest;
 					cc.DataContext = DataContext;
 					if(Surface != null)  {
@@ -779,6 +781,7 @@
 			}
 			if(cc is IProvideLegendDynamic ipld) {
 				// attach the event
+				ipld.LegendChanged -= Ipld_LegendChanged;
 				ipld.LegendChanged += Ipld_LegendChanged;
 			}
 			// axis and DSRP are mutually-exclusive


Prepare release 4.5.1 - increase DBSchemaInfo version. Work Item #1907

--- trunk/Solutions/DBSchemaInfo/Properties/AssemblyInfo.cs
+++ trunk/Solutions/DBSchemaInfo/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 //
 // You can specify all the values or you can default the Revision and Build Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.1.0")]
+[assembly: AssemblyFileVersion("1.1.1.0")]


Bug fix.

Bug fix.

--- unity/Assets/Scripts/UI/Screens/ClassSelectionScreen.cs
+++ unity/Assets/Scripts/UI/Screens/ClassSelectionScreen.cs
@@ -40,6 +40,8 @@
             float xOffset = UIScaler.GetHCenter(-18);
             if (heroCount < 4) xOffset += 4.5f;
             if (heroCount < 3) xOffset += 4.5f;
+
+            TextButton tb = null;

             for (int i = 0; i < heroCount; i++)
             {
@@ -101,7 +103,6 @@
                         }
                     }

-                    TextButton tb = null;
                     if (available)
                     {
                         int tmp = i;
@@ -136,16 +137,15 @@
                 xOffset += 9f;
             }
             // Add a finished button to start the quest
-            TextButton endSelection = new TextButton(
+            tb = new TextButton(
                 new Vector2(UIScaler.GetRight(-8.5f),
                 UIScaler.GetBottom(-2.5f)),
                 new Vector2(8, 2),
                 CommonStringKeys.FINISHED,
                 delegate { Finished(); },
                 Color.green);
-            db.textObj.GetComponent<UnityEngine.UI.Text>().fontSize = UIScaler.GetLargeFont();
-            db.SetFont(game.gameType.GetHeaderFont());
-            db.ApplyTag("heroselect");
+            tb.SetFont(game.gameType.GetHeaderFont());
+            tb.ApplyTag("heroselect");

             TextButton cancelSelection = new TextButton(new Vector2(0.5f, UIScaler.GetBottom(-2.5f)), new Vector2(8, 2), CommonStringKeys.BACK, delegate { Destroyer.QuestSelect(); }, Color.red);
             cancelSelection.SetFont(game.gameType.GetHeaderFont());


Added show excluded symbol if not contains

--- SimpleCiphers/Models/Checker.cs
+++ SimpleCiphers/Models/Checker.cs
@@ -15,11 +15,9 @@

         public static void KeyContain(string key, string abc)
         {
-            var check = string.Join("", abc.Union(key));
-            if (check != abc)
-            {
-                throw new CipherException("Ключ содержит символы не из алфавита.");
-            }
+            var exclude = string.Join("", key.Except(abc));
+            if (exclude == string.Empty) return;
+            throw new CipherException($"Ключ содержит символы не из алфавита:\n{exclude}.");
         }

         public static void TextNull(string text)
@@ -32,11 +30,9 @@

         public static void TextContain(string text, string abc)
         {
-            var check = string.Join("", abc.Union(text));
-            if (check != abc)
-            {
-                throw new CipherException("Текст содержит символы не из алфавита.");
-            }
+            var exclude = string.Join("", text.Except(abc));
+            if (exclude == string.Empty) return;
+            throw new CipherException($"Текст содержит символы не из алфавита:\n{exclude}");
         }

         public static int GetKeyInt(string key)


[ClrPhTester] Simplify loops since now SxsEntry is copiable

--- ClrPhTester/SxsManifest.cs
+++ ClrPhTester/SxsManifest.cs
@@ -210,13 +210,10 @@
             //</ assembly >
             foreach (XElement SxsAssembly in XmlManifest.Descendants(Namespace + "assembly"))
             {
-                foreach (XElement SxsFileEntry in SxsAssembly.Elements(Namespace + "file"))
-                {
-                    string SxsDllName = SxsFileEntry.Attribute("name").Value.ToString();
-                    string SxsDllPath = Path.Combine(Folder, SxsDllName);
-                    AdditionnalDependencies.Add(new SxsEntry(SxsDllName, SxsDllPath));
-                }
-            }
+                AdditionnalDependencies.AddRange(SxsEntries.FromSxsAssembly(SxsAssembly, Namespace, Folder));
+            }
+
+

             // Find any dependencies :
             // <dependency>
@@ -237,10 +234,7 @@
             )
             {
                 // find target PE
-                foreach (var SxsTarget in ExtractDependenciesFromSxsElement(SxsAssembly, Folder, Wow64Pe))
-                {
-                    AdditionnalDependencies.Add(SxsTarget);
-                }
+                AdditionnalDependencies.AddRange(ExtractDependenciesFromSxsElement(SxsAssembly, Folder, Wow64Pe));
             }

             return AdditionnalDependencies;


done for editting

done for editting

--- TeamJosephHeller/Game/NinjaWarsMain.cs
+++ TeamJosephHeller/Game/NinjaWarsMain.cs
@@ -10,10 +10,7 @@
     {
         static void Main()
         {
-            Console.WriteLine("Commited by dnmitev changed");
-            Console.WriteLine("Commit by Angel Raev");
-            Console.WriteLine(123);
-            Console.WriteLine("something more");
+
         }
     }
 }


Added some comments.

Added some comments.

--- TestBot/Handlers/FogBugzCaseHandler.cs
+++ TestBot/Handlers/FogBugzCaseHandler.cs
@@ -11,11 +11,20 @@

 namespace TestBot.Handlers
 {
+	/// <summary>
+	/// Listens for "Case x" in chat and provides links and some details about the FogBugz case.
+	/// </summary>
 	class FogBugzCaseHandler : Handler
 	{
 		readonly Uri url;
 		readonly string token;

+		/// <summary>
+		/// Creates a SimpleSlackBot handler that listens for "Case x" in chat and provides links and some details
+		/// about the FogBugz case.
+		/// </summary>
+		/// <param name="url">The base url of the FogBugz installation (eg. https://yourname.fogbugz.com/).</param>
+		/// <param name="token">The API token to use when connectingto FogBugz.</param>
 		public FogBugzCaseHandler(Uri url, string token)
 		{
 			this.url = url;
@@ -24,21 +33,26 @@

 		public async override Task OnMessage(Channel channel, User user, string text)
 		{
-			var match = Regex.Match(text, @"case (\d+)", RegexOptions.IgnoreCase);
+			// Check the message for a case reference.
+			var match = Regex.Match(text, @"(?:fogbugz|fb|case|bug|feature|issue) (\d+)", RegexOptions.IgnoreCase);

+			// Extract the case number.
 			int caseNumber;
 			if (!match.Success || !int.TryParse(match.Groups[1].Captures[0].Value, out caseNumber))
 				return;

+			// Attempt to fetch the case from the FogBugz API.
 			var c = GetCase(caseNumber);
 			if (c == null)
 				return;

-			var message = FormatMessage(c);
-
-			await SendMessage(channel, message);
+			// Send a nicely-formatted message back to the channel.
+			await SendMessage(channel, FormatMessage(c));
 		}

+		/// <summary>
+		/// Fetch case information from the FogBugz API.
+		/// </summary>
 		Case GetCase(int caseNumber)
 		{
 			var http = new HttpClient();
@@ -66,11 +80,16 @@
 			};
 		}

+		/// <summary>
+		/// Creates a nicely-formatted message for the provided FogBugz case info.
+		/// </summary>
 		string FormatMessage(Case c)
 		{
 			var message = new StringBuilder();
+
 			message.AppendLine($"*<{Escape(c.Url)}|{c.CaseNumber}: {Escape(c.Title)}>*");
 			message.AppendLine($"_{Escape(c.Category)}_ | _{Escape(c.Project)}_ | _{Escape(c.Area)}_");
+
 			message.Append($"*Status:* {Escape(c.Status)} | ");
 			if (!string.Equals(c.AssignedTo, "closed", StringComparison.OrdinalIgnoreCase)) // TODO: Use ixAssignedTo
 				message.Append($"*Assigned:* {Escape(c.AssignedTo)} | ");
@@ -78,6 +97,7 @@

 			if (c.ParentBug != null)
 				message.AppendLine($"*Parent:* Case {Escape(c.ParentBug)}");
+
 			message.AppendLine(Escape(c.LatestText));

 			return message.ToString();


main seems to be missing from MergeAndSort

--- TestCases/MergeAndSort/MergeAndSort.cs
+++ TestCases/MergeAndSort/MergeAndSort.cs
@@ -71,9 +71,8 @@
             // I have therefore added a Monitor.Enter call in Network.Go to a static lock object called _netObject.
             // This seems to have fixed the problem.

-            //for (int i = 0; i <50; i++)
-            new MergeAndSort().Go();
-            new MergeAndSort().Go();
+            for (int i = 0; i <10; i++)
+                new MergeAndSort().Go();
             //Console.Read();
         }


Add Mac support

Add Mac support

--- TrueCraft.Client/Program.cs
+++ TrueCraft.Client/Program.cs
@@ -34,7 +34,11 @@
                 var fileInfo = new FileInfo("MonoGame.Framework.Windows.dll");
                 return Assembly.LoadFile(fileInfo.FullName);
             }
-            // TODO: OSX support
+            if (RuntimeInfo.IsMacOSX)
+            {
+                var fileInfo = new FileInfo("MonoGame.Framework.MacOS.dll");
+                return Assembly.LoadFile(fileInfo.FullName);
+            }
             return null;
         }


Remove unneccesery usings

Remove unneccesery usings

--- UCRS.Web/Controllers/HomeController.cs
+++ UCRS.Web/Controllers/HomeController.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
 using System.Web.Mvc;

@@ -52,6 +51,6 @@
             };

             return View(viewModel);
+        }
     }
-}
 }


add method updated with mapping using new model

--- UsersMVC/Controllers/HomeController.cs
+++ UsersMVC/Controllers/HomeController.cs
@@ -35,7 +35,7 @@
         }

         [HttpPost]
-        public void AddUsers(User user)
+        public void AddUsers(AddUserViewModel user)
         {
             // dbContext.User.Add(user);
             // dbContext.SaveChanges();
@@ -43,7 +43,14 @@
             dbContext1.User.Add(user);
             dbContext1.SaveChanges();
             */
-             dbContext.Create(user);
+
+            Mapper.Initialize(cfg => cfg.CreateMap<AddUserViewModel, User>());
+                 /*  .ForMember("Name", opt => opt.MapFrom(c => c.FirstName + " " + c.LastName))
+                   .ForMember("Email", opt => opt.MapFrom(src => src.Login)));*/
+            // Выполняем сопоставление
+            User user1 = Mapper.Map<AddUserViewModel, User>(user);
+
+            dbContext.Create(user1);
              dbContext.Save();
         }


If we already noticed it's confirmed, then don't rebroadcast.

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -231,7 +231,7 @@
 						string jsonString = File.ReadAllText(TransactionsFilePath, Encoding.UTF8);
 						var serializedTransactions = JsonConvert.DeserializeObject<IEnumerable<SmartTransaction>>(jsonString);

-						foreach (SmartTransaction tx in serializedTransactions.Where(x => !x.Confirmed).OrderBy(x => x.FirstSeenIfMemPoolTime))
+						foreach (SmartTransaction tx in serializedTransactions.Where(x => !x.Confirmed && !TransactionCache.Contains(x)).OrderBy(x => x.FirstSeenIfMemPoolTime))
 						{
 							try
 							{


Move some common code

Move some common code

--- CSharp/Core.PostreSQL/Command.cs
+++ CSharp/Core.PostreSQL/Command.cs
@@ -27,21 +27,22 @@
 		}

 		public IReader ExecuteReader() {
-			PostgreSQLCommand.Connection = PostgreSQLConnection;
-			foreach (var parameter in Parameters) {
-				PostgreSQLCommand.Parameters.Add(new NpgsqlParameter(parameter.Name, parameter.Value));
-			}
+			MakeReady();
 			PostgreSQLReader = PostgreSQLCommand.ExecuteReader();
 			Reader = new Reader() { PostgreSQLReader = PostgreSQLReader };
 			return Reader;
 		}

 		public object ExecuteScalar() {
+			MakeReady();
+			return PostgreSQLCommand.ExecuteScalar();
+		}
+
+		private void MakeReady() {
 			PostgreSQLCommand.Connection = PostgreSQLConnection;
 			foreach (var parameter in Parameters) {
 				PostgreSQLCommand.Parameters.Add(new NpgsqlParameter(parameter.Name, parameter.Value));
 			}
-			return PostgreSQLCommand.ExecuteScalar();
 		}
 	}
 }


Go back to timer implementation.

Go back to timer implementation.

--- Sketchball/Controls/GameView.cs
+++ Sketchball/Controls/GameView.cs
@@ -24,14 +24,14 @@
         /// <summary>
         /// The absolute maximum of FPS at any point in time.
         /// </summary>
-        private const int MAX_FPS = 80;
+        private const int MAX_FPS = 40;

-        public Camera Camera{get; private set;}
+        public Camera Camera { get; private set; }
         private GameHUD HUD;
         private GameWorld gameWorld;

         public Game Game;
-        private BackgroundWorker updateWorker;
+        private System.Windows.Forms.Timer timer;

         /// <summary>
         /// Creates a new PinballGameControl based on a machine template.
@@ -53,17 +53,19 @@
             Camera.Size = new Size(Width, Height);

             // Optimize control for performance
-           // this.Effect = new System.Windows.Media.Effects.BlurEffect();
-            updateWorker = new BackgroundWorker();
-            updateWorker.DoWork += DrawCycle;
+            // this.Effect = new System.Windows.Media.Effects.BlurEffect();
+            timer = new System.Windows.Forms.Timer();
+            timer.Interval = 1000 / MAX_FPS;
+            timer.Tick += OnDraw;
+            timer.Start();

             PreviewKeyDown += HandleKeyDown;
-
+
             SizeChanged += ResizeCamera;

             SetValue(RenderOptions.BitmapScalingModeProperty, BitmapScalingMode.HighQuality);
+            SetValue(RenderOptions.CachingHintProperty, CachingHint.Cache);

-            updateWorker.RunWorkerAsync();
         }

         private void ResizeCamera(object sender, System.Windows.SizeChangedEventArgs e)
@@ -85,7 +87,7 @@
                         Game.Start();
                     }
                     break;
-
+
                 case Key.Enter:
                     if (Game.Status == GameStatus.Playing)
                     {
@@ -98,50 +100,29 @@
                     break;

                 case Key.Add:
-                   // this.Camera.zoom(1+this.zoomfactor);
-
+                    // this.Camera.zoom(1+this.zoomfactor);
+
                     break;

                 case Key.OemMinus:
                 case Key.Subtract:
-                   // this.Camera.zoom(1-this.zoomfactor);
+                    // this.Camera.zoom(1-this.zoomfactor);
                     break;

-            }
+            }

         }

-        /// <summary>
-        /// Method that repeatedly draws and updates the scene.
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void DrawCycle(object sender, DoWorkEventArgs e)
+        private void OnDraw(object sender, EventArgs e)
         {
-            int msPerFrame = 1000 / MAX_FPS;
-            Stopwatch watch = new Stopwatch();
-
-            try
-            {
-                while (!isCancelled)
-                {
-                    watch.Restart();
-
-                    Dispatcher.Invoke(() =>
-                    {
-                        InvalidateVisual();
-                    }, System.Windows.Threading.DispatcherPriority.Render);
-
-                    Thread.Sleep(Math.Max(10, msPerFrame - (int)watch.ElapsedMilliseconds));
-                }
-            }
-            catch (TaskCanceledException) { }
-
-
+            if (isCancelled)
+                timer.Dispose();
+            else
+                InvalidateVisual();
         }
         protected override void OnDispose()
         {
-            updateWorker.Dispose();
+            timer.Dispose();
             Game = null;
             gameWorld = null;
             HUD = null;
@@ -163,7 +144,7 @@
             {
                 DrawOverlay(g, Colors.DarkBlue, "PAUSED", "Press [ENTER] to resume.");
             }
-
+
         }

         private void DrawOverlay(DrawingContext g, Color color, string title, string msg)
@@ -179,7 +160,7 @@

             g.DrawRectangle(brush, null, new Rect(0, 0, Width, Height));
-            g.DrawText(caption, new Point( x, (Height - caption.Height) / 2 ));
+            g.DrawText(caption, new Point(x, (Height - caption.Height) / 2));
             g.DrawText(text, new Point(x, (Height + caption.Height) / 2));
         }


Save Slack team domain as lowercase

Save Slack team domain as lowercase

--- SlackUI/Forms/TeamPickerForm.cs
+++ SlackUI/Forms/TeamPickerForm.cs
@@ -57,7 +57,7 @@
         private void continueButton_Click(object sender, EventArgs e) {
             // Save team domain if valid otherwise show team not found information dialog
             if(IsTeamDomainValid()) {
-                SlackTeamDomain = teamDomainTextBox.Text;
+                SlackTeamDomain = teamDomainTextBox.Text.ToLowerInvariant();
                 DialogResult = DialogResult.OK;
                 Close();
             } else {


pawns 2 places black

pawns 2 places black

--- ChessGame/ClassLibrary1/Rules.cs
+++ ChessGame/ClassLibrary1/Rules.cs
@@ -94,7 +94,7 @@
                 }
                 if (finalIndex - initialIndex == -16)//two steps forward
                 {
-                    if (initialPosition[1].Equals("7") == false)
+                    if (initialPosition[1].ToString().Equals("7") == false)
                     {
                         return false;
                     }


Surrender logic fix.

Surrender logic fix.

--- Client/Model/SimulationResult.cs
+++ Client/Model/SimulationResult.cs
@@ -56,7 +56,7 @@

         public int AttackerFleetsBack
         {
-            get { return Type == MoveType.Attack ? FleetCount - AttackerLosses : 0; }
+			get { return Type == MoveType.Attack && !TargetOwnerChanged ? FleetCount - AttackerLosses : 0; }
         }

         public enum MoveType


Complete support for URL identification in text content

--- Clipboarder/TextForm.Designer.cs
+++ Clipboarder/TextForm.Designer.cs
@@ -39,14 +39,14 @@
             this.textBox.Multiline = true;
             this.textBox.Name = "textBox";
             this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.textBox.Size = new System.Drawing.Size(495, 102);
+            this.textBox.Size = new System.Drawing.Size(514, 102);
             this.textBox.TabIndex = 0;
             this.textBox.TextChanged += new System.EventHandler(this.textBox_TextChanged);
             //
             // okButton
             //
             this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.okButton.Location = new System.Drawing.Point(326, 113);
+            this.okButton.Location = new System.Drawing.Point(345, 113);
             this.okButton.Name = "okButton";
             this.okButton.Size = new System.Drawing.Size(75, 23);
             this.okButton.TabIndex = 3;
@@ -58,7 +58,7 @@
             //
             this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.closeButton.Location = new System.Drawing.Point(407, 113);
+            this.closeButton.Location = new System.Drawing.Point(426, 113);
             this.closeButton.Name = "closeButton";
             this.closeButton.Size = new System.Drawing.Size(75, 23);
             this.closeButton.TabIndex = 5;
@@ -71,11 +71,11 @@
             this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.label1.AutoSize = true;
             this.label1.Enabled = false;
-            this.label1.Location = new System.Drawing.Point(69, 118);
+            this.label1.Location = new System.Drawing.Point(24, 118);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(251, 13);
+            this.label1.Size = new System.Drawing.Size(315, 13);
             this.label1.TabIndex = 6;
-            this.label1.Text = "regex should be standard regex for C# with @ string";
+            this.label1.Text = "Clipboarder accepts C# compatible regex stored in verbatim string";
             //
             // TextForm
             //
@@ -83,13 +83,13 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.CancelButton = this.closeButton;
-            this.ClientSize = new System.Drawing.Size(495, 147);
+            this.ClientSize = new System.Drawing.Size(514, 147);
             this.ControlBox = false;
             this.Controls.Add(this.label1);
             this.Controls.Add(this.okButton);
             this.Controls.Add(this.closeButton);
             this.Controls.Add(this.textBox);
-            this.MinimumSize = new System.Drawing.Size(471, 147);
+            this.MinimumSize = new System.Drawing.Size(530, 186);
             this.Name = "TextForm";
             this.ShowInTaskbar = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;


Fix for debug mode request counter

Fix for debug mode request counter

--- Commands/Provider/SPOProvider.cs
+++ Commands/Provider/SPOProvider.cs
@@ -694,7 +694,8 @@
         {
             ctx.ExecutingWebRequest += (sender, args) =>
             {
-                var counter = (int)SessionState.PSVariable.Get("WebRequestCounter").Value;
+                var psVariable = SessionState.PSVariable.Get("WebRequestCounter");
+                var counter = (psVariable != null && psVariable.Value != null) ? (int)psVariable.Value : 0;
                 counter++;
                 SessionState.PSVariable.Set("WebRequestCounter", counter);
             };


Clean up rambling LNode documentation

Clean up rambling LNode documentation

--- Core/Loyc.Syntax/LNodes/LNode.cs
+++ Core/Loyc.Syntax/LNodes/LNode.cs
@@ -22,183 +22,18 @@
 	///
A <see cref="CallNode"/> encompasses all other kinds of nodes, such as
 	/// normal function calls like <c>f(x)</c>, generic specifications like <c>f<x></c>
 	/// (represented as <c>@'of(f, x)</c>), braced blocks of statements (represented as
-	/// <c>@`{}`(stmt1, stmt2, ...)</c>), and so on. Also, parenthesized expressions
-	/// are represented as a call with one argument and <c>null</c> as the <see cref="Target"/>.

+	/// <c>@`'{}`(stmt1, stmt2, ...)</c>), and so on.

 	///

+	/// See http://loyc.net/loyc-trees to learn more about the Loyc tree concept.
+	/// <para/>
 	/// This class provides access to all properties of all three types of nodes,
 	/// in order to make this class easier to access from plain C#, and to avoid
-	/// unnecessary downcasting in some cases.
+	/// unnecessary downcasting in some cases. In fact, you never need to use the
+	/// derived classes; you can think of them simply as a way of optimizing the
+	/// implementation.
 	/// <para/>
-	/// Loyc nodes are always immutable, except for the 8-bit <see cref="Style"/>
-	/// property which normally affects printing only.
-	/// <para/>
-	///
Background information

-	/// <para/>
-	/// EC# (enhanced C#) is intended to be the starting point of the Loyc
-	/// (Language of your choice) project, which will be a family of programming
-	/// languages that will share a common representation for the syntax tree and
-	/// other compiler-related data structures.
-	/// <para/>
-	/// Just as LLVM assembly has emerged as a nearly universal standard
-	/// intermediate representation for back-ends, Loyc nodes are intended to be a
-	/// universal intermediate representation for syntax trees, and Loyc will
-	/// (eventually) include a generic set of tools for semantic analysis so that
-	/// it provides a generic representation for front-ends.
-	/// <para/>
-	/// EC#, then, will be the first language to use the Loyc syntax tree
-	/// representation, known as the "Loyc tree" for short. Most syntax trees are
-	/// very strongly typed, with separate data types for, say, variable
-	/// declarations, binary operators, method calls, method declarations, unary
-	/// operators, and so forth. Loyc, however, defines only three types of Nodes,
-	/// and this one class provides access to all the parts of a node. There are
-	/// several reasons for this design:
-	///

-	///
Simplicity. Many compilers have thousands of lines of code dedicated
-	///   to the AST (abstract syntax tree) data structure itself, because each
-	///   kind of AST node has its own class.

-	///
Serializability. Loyc nodes can always be serialized to a plain text
-	///   "prefix tree" and deserialized back to objects, even by programs that
-	///   are not designed to handle the language that the tree represents*. This
-	///   makes it easy to visualize syntax trees or exchange them between
-	///   programs.

-	///
Extensibility. Loyc nodes can represent any language imaginable, and
-	///   they are suitable for embedded DSLs (domain-specific languages). Since
-	///   nodes do not enforce a particular structure, they can be used in
-	///   different ways than originally envisioned. For example, most languages
-	///   only have "+" as a binary operator, that is, with two arguments. If
-	///   Loyc had a separate class for each AST, there would probably be a
-	///   PlusOperator class derived from BinaryOperator, or something, with
-	///   properties "Left" and "Right". But since there is only one node class,
-	///   a "+" operator with three arguments is always possible; this is denoted
-	///   by #+(a, b, c) in EC# source code.

-	///

-	///   * Currently, the only supported languages for plain-text Loyc trees are
-	///     LES and EC# (either normal EC# or prefix-tree notation).
-	/// <para/>
-	/// Loyc trees are comparable to LISP trees, except that "attributes" and
-	/// position information are added to the tree, and the concept of a "list"
-	/// is replaced with the concept of a "call", which I feel is a more
-	/// intuitive notion in most programming languages that are not LISP.
-	/// <para/>
-	/// Loyc's representation is both an blessing and a curse. The advantage is
-	/// that Loyc nodes can be used for almost any purpose, perhaps even
-	/// representing data instead of code in some cases. However, there is no
-	/// guarantee that a given AST follows the structure prescribed by a particular
-	/// programming language, unless a special validation step is performed after
-	/// parsing. In this way, Loyc trees are similar to XML trees, only simpler.
-	/// <para/>
-	/// Another major disadvantage is that it is more difficult to interpret a
-	/// syntax tree correctly: you have to remember that a method definition has
-	/// the structure <c>#fn(return_type, name, args, body)</c>, so if "node" is
-	/// a method definition then <c>node.Args[2]</c> represents the argument
-	/// list, for example. In contrast, most compilers have an AST class called
-	/// <c>MethodDefinition</c> or something, that provides properties such as
-	/// Name and ReturnType. If EC# is ever done, however, aliases could help
-	/// avoid this problem by providing a more friendly veneer over the raw nodes.
-	/// <para/>
-	/// For optimization purposes, the node class is a class hierarchy, but most
-	/// users should only use this class.
-	/// <para/>
-	/// <see cref="LNode"/>s are "persistent" in the comp-sci sense, which
-	/// means that they are immutable, that a subtree can be shared among
-	/// multiple syntax trees, and that nodes do not know their own parents,
-	/// which allows a single node to exist at multiple locations in a syntax tree.
-	/// This makes manipulation of trees convenient, as there is no need to
-	/// "detach" a node from one place, or duplicate it, before it can be inserted
-	/// in another place.
+	/// Loyc nodes are always immutable.
 	///
-	///
The reimplementation

-	///
-	/// This implementation has been redesigned (in Subversion, the last version
-	/// based on the old design is revision 289.) The core concept is the same as
-	/// described in my blog at
-	/// http://loyc-etc.blogspot.ca/2013/04/the-loyc-tree-and-prefix-notation-in-ec.html
-	/// except that the concept of a "Head" has mostly been eliminated, although
-	/// you might see it occasionally because it still has a meaning. The "head"
-	/// of a node refers either to the Name of a symbol, the Value of a literal,
-	/// or the Target of a call (i.e. the name of the method being called, which
-	/// could be an arbitrarily complex node). In the original implementation, it
-	/// was also possible to have a complex head (a head that is itself a node)
-	/// even when the node was not a call; this situation was used to represent
-	/// an expression in parenthesis.
-	/// <para/>
-	/// This didn't quite feel right, so I changed it. Now, only calls can be
-	/// "complex", and the head of a call (the method being called) is called
-	/// the Target.
-	/// <para/>
-	/// In the new version, there are explicitly three types of nodes: symbols,
-	/// literals, and calls. There is no longer a Head property, instead there
-	/// are three separate properties for the three kinds of heads, <see
-	/// cref="Name"/> (a Symbol), <see cref="Value"/> (an Object), and <see
-	/// cref="Target"/> (an LNode). Only call nodes have a Target, and only
-	/// literal nodes have a Value. Identifier nodes have a Name, but I thought
-	/// it would be useful for some call nodes to also have a Name, which is
-	/// defined as the name of the Target if the Target is an identifier (if
-	/// the Target is not a symbol, the call has no name.)
-	/// <para/>
-	/// An expression in parenthesis is now represented by a call with the
-	/// %inParens attribute; use <see cref="LNodeExt.IsParenthesizedExpr"/> to
-	/// detect the parentheses.
-	/// <para/>
-	/// The problems that motivated a redesign are described at
-	/// http://loyc-etc.blogspot.ca/2013/05/redesigning-loyc-tree-code.html
-	/// <para/>
-	/// One very common use of mutable nodes is building lists of statements, e.g.
-	/// you might create an empty braced block or an empty loop and then add
-	/// statements to the body of the block or loop. To do this without mutable
-	/// nodes, create a mutable <see cref="WList{LNode}"/> instead and add
-	/// statements there; once the list is finished, create the braced block or
-	/// loop afterward. The new design stores arguments and attributes in
-	/// <see cref="VList{LNode}"/> objects; you can instantly convert your WList
-	/// to a VList by calling <see cref="WListBase{LNode}.ToVList()"/>.
-	/// <para/>
-	/// During the redesign I've decided on some small changes to the representation
-	/// of certain expressions in EC#.
-	///

-	///
The '.' operator is now treated more like a normal binary operator;
-	///     <c>a.b.c</c> is now represented <c>@.(@.(a, b), c)</c> rather than
-	///     <c>@.(a, b, c)</c> mainly because it's easier that way, and because the
-	///     second representation doesn't buy anything significant other than a
-	///     need for special-casing.

-	///
<c>int x = 0</c> will now be represented <c>#var(int, x = 0)</c>
-	///     rather than <c>#var(int, x(0))</c>. I chose the latter representation
-	///     initially because it is slightly more convenient, because you can
-	///     always learn the name of the declared variable by calling
-	///     <c>var.Args[1].Name</c>. However, I decided that it was more important
-	///     for the syntax tree to be predictable, with obvious connections between
-	///     normal and prefix notations. Since I decided that <c>alias X = Y;</c>
-	///     was to be represented <c>#alias(X = Y, #())</c>, it made sense for the
-	///     syntax tree of a variable declaration to also resemble its C# syntax.
-	///     There's another small reason: C++ has both styles <c>Foo x(y)</c> and
-	///     <c>Foo x = y</c>; if Loyc were to ever support C++, it would make sense
-	///     to use <c>#var(Foo, x(y))</c> and <c>#var(Foo, x = y)</c> for these two
-	///     cases, and I believe C#'s variable declarations are semantically closer
-	///     to the latter. (Note: another possibility was #var(int, x) = 0, but I
-	///     decided this wasn't an improvement, it would just shift the pain around.)

-	///
A constructor argument list is required on all types using the 'new
-	///     operator, e.g. <c>new int[] { x }</c> must have an empty set of arguments
-	///     on int[], i.e. <c>@'new(@'of(@`'[]`,int)(), x)</c>; this rule makes the
-	///     different kinds of new expressions easier to interpret by making them
-	///     consistent with each other.

-	///
A missing syntax element is now represented by the empty identifier
-	///     instead of the identifier #missing.

-	///
I've decided to adopt the "in-expression" generics syntax from Nemerle
-	///     and the binary ! from D as unambiguous alternatives to angle brackets:
-	///     List.[int] and List!int mean List<int> and the printer will use
-	///     one of these in cases where angle brackets are ambiguous.

-	///
By popular demand, constructors will be written this(...) instead
-	///     of new(...), since both D and Nemerle use the latter notation.

-	///
The \ and $ characters have been changed; @@S now denotes a symbol S,
-	///     $S now denotes a substitution, and \S doesn't mean anything.
-	///     Originally EC# was designed just as an extension of C#, so \ made
-	///     sense as a substitution operator for string interpolation because it
-	///     doesn't hurt backward compatibility: "Loaded '\(filename)' successfully".
-	///     But now that my focus has shifted to multi-language interoperability,
-	///     $ makes more sense, as it is used for string interpolation in at least
-	///     five other languages and it makes sense to use the same character for
-	///     both string substitution and code substitution.

-	///

-	///
 	///
Important properties

 	///
 	/// The main properties of a node are
@@ -220,38 +55,7 @@
 	///    distinguish it from decimal literals such as 16. Custom display styles
 	///    that do not fit in the Style property can be expressed with attributes.

 	///

-	/// <para/>
-	/// The argument and attribute lists cannot be null, since they have type
-	/// <see cref="VList{Node}"/> which is a struct.
-	/// <para/>
-	/// <c>LNode</c> implements <see cref="INegListSource{T}"/>, so you can loop
-	/// through all children of the node like this:
-	///
-	/// for (int i = node.Min; i <= node.Max; i++) {
-	///     LNode child = node[i];
-	/// }
-	///
-	/// You can also use <c>foreach</c>. The children are numbered like this:
-	///

-	///
if i is less than -1, node[i] refers to an attribute. Specifically, node[i]
-	/// means node.Attrs[i + node.Attrs.Count + 1] in that case.

-	///
node[-1] refers to <c>Target</c> (but throws if there is no target)

-	///
Non-negative values are indexes of Args, e.g. node[i] means node.Args[i].

-	///

-	/// LNode also provides <c>Select(child => result)</c> and <c>ReplaceRecursive(child => result)</c>
-	/// methods which allows you to transform all children (Atrrs, Target and Args).
-	/// Currently there is no <c>Where(child => bool)</c> method because it is not
-	/// possible to remove the <see cref="Target"/> of an LNode (you can still use
-	/// standard LINQ Where(), of course, but the result is not an LNode).
-	///
-	///
Note

-	///
-	/// The argument and attribute lists should never contain null nodes. Any code
-	/// that puts nulls in <see cref="Args"/> or <see cref="Attrs"/> is buggy.
-	/// However, we can't ensure nulls are not placed into <see cref="VList{T}"/>
-	/// since it's a general-purpose data type, not specialized for LNode. There is
-	/// code to ensure nulls are not placed in Args and Attrs (<see cref="NoNulls"/>),
-	/// but only in debug builds, since null-checking is fairly expensive.
+	/// To learn more about working with LNode, see http://loyc.net/loyc-trees/dotnet.html
 	/// </remarks>
 	public abstract class LNode : ILNode, ICloneable<LNode>, IEquatable<LNode>, IHasLocation, IHasValue<object>, INegListSource<LNode>
 	{


Allow reading certificates from local files

--- proj/SecurityServer/proj/Common/SecurityHelper.cs
+++ proj/SecurityServer/proj/Common/SecurityHelper.cs
@@ -10,8 +10,10 @@
     {
         public static X509SigningCredentials CreateSignupCredentialsFromConfig()
         {
-            return new X509SigningCredentials(new X509Certificate2(X509Certificate.CreateFromCertFile(
-                    Path.Combine(HostingEnvironment.ApplicationPhysicalPath, ConfigurationManager.AppSettings["SigningCertificateName"]))));
+            var certificateFilePath = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, ConfigurationManager.AppSettings["SigningCertificateName"]);
+            var data = File.ReadAllBytes(certificateFilePath);
+            var certificate = new X509Certificate2(data, string.Empty, X509KeyStorageFlags.MachineKeySet);
+            return new X509SigningCredentials(certificate);
         }
     }
 }