Fix debug level used for compiling validation tests (#2492)

--- src/Stratis.SmartContracts.Core.Validation.Tests/SmartContractDeterminismValidatorTests.cs
+++ src/Stratis.SmartContracts.Core.Validation.Tests/SmartContractDeterminismValidatorTests.cs
@@ -1,5 +1,6 @@
 using System.IO;
 using System.Linq;
+using Microsoft.CodeAnalysis;
 using Stratis.ModuleValidation.Net;
 using Stratis.ModuleValidation.Net.Format;
 using Stratis.SmartContracts.Core.Validation.Validators;
@@ -14,7 +15,7 @@
     {
         public IContractModuleDefinition CompileFileToModuleDef(FileInfo file)
         {
-            ContractCompilationResult compilationResult = ContractCompiler.CompileFile(file.FullName);
+            ContractCompilationResult compilationResult = ContractCompiler.CompileFile(file.FullName, OptimizationLevel.Debug);
             Assert.True(compilationResult.Success);

             byte[] assemblyBytes = compilationResult.Compilation;
@@ -24,7 +25,7 @@

         public IContractModuleDefinition CompileToModuleDef(string source)
         {
-            ContractCompilationResult compilationResult = ContractCompiler.Compile(source);
+            ContractCompilationResult compilationResult = ContractCompiler.Compile(source, OptimizationLevel.Debug);
             Assert.True(compilationResult.Success);

             byte[] assemblyBytes = compilationResult.Compilation;


Fix .NET Native reflection invoke stepping by adding a debugger attribute on MethodInvoker.Invoke

Add [DebuggerGuidedStepThrough] attribute on MethodInvoker.Invoke - with this change I finally see the .NET Native reflection invoke step-in test pass.

[tfs-changeset: 1651618]

--- src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/MethodInvoker.cs
+++ src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/MethodInvoker.cs
@@ -18,10 +18,13 @@
     {
         protected MethodInvoker() { }

+        [DebuggerGuidedStepThrough]
         public Object Invoke(Object thisObject, Object[] arguments, Binder binder, BindingFlags invokeAttr, CultureInfo cultureInfo)
         {
             BinderBundle binderBundle = binder.ToBinderBundle(invokeAttr, cultureInfo);
-            return Invoke(thisObject, arguments, binderBundle);
+            Object result = Invoke(thisObject, arguments, binderBundle);
+            System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
+            return result;
         }
         public abstract Object Invoke(Object thisObject, Object[] arguments, BinderBundle binderBundle);
         public abstract Delegate CreateDelegate(RuntimeTypeHandle delegateType, Object target, bool isStatic, bool isVirtual, bool isOpen);


samplechart: fix price step for ES

samplechart: fix price step for ES

--- Samples/Chart/SampleChart/MainWindow.xaml.cs
+++ Samples/Chart/SampleChart/MainWindow.xaml.cs
@@ -160,7 +160,9 @@
 			_security = new Security
 			{
 				Id = id.ToStringId(),
-				PriceStep = id.SecurityCode.StartsWith("RI", StringComparison.InvariantCultureIgnoreCase) ? 10 : 0.01m,
+				PriceStep = id.SecurityCode.StartsWith("RI", StringComparison.InvariantCultureIgnoreCase) ? 10 :
+							id.SecurityCode.Contains("ES") ? 0.25m :
+							0.01m,
 				Board = ExchangeBoard.Associated
 			};


Remove some redundant code and use pattern matching on memberSymbol too

--- src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
+++ src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
@@ -1857,23 +1857,14 @@
                     return;
                 }

-                var ancestor = returnStatement.AncestorsAndSelf().FirstOrDefault(e => e is ParenthesizedLambdaExpressionSyntax || e is SimpleLambdaExpressionSyntax ||
-                    e is AnonymousMethodExpressionSyntax || e is LocalFunctionStatementSyntax);
-
-                // If we're in a lambda, then use the return type of the lambda to figure out what to
-                // infer.  i.e.   Func<int,string> f = i => { return Goo(); }
-                if (ancestor is ParenthesizedLambdaExpressionSyntax lambda)
-                {
-                    types = InferTypeInLambdaExpression(lambda);
-                    isAsync = lambda.AsyncKeyword.Kind() != SyntaxKind.None;
-
-                    return;
-
-                }
-                else if (ancestor is SimpleLambdaExpressionSyntax simpleLambda)
-                {
-                    types = InferTypeInLambdaExpression(simpleLambda);
-
+                var ancestor = returnStatement.AncestorsAndSelf().FirstOrDefault(e => e is AnonymousFunctionExpressionSyntax || e is LocalFunctionStatementSyntax);
+
+                if (ancestor is LambdaExpressionSyntax lambdaExpression)
+                {
+                    // If we're in a lambda, then use the return type of the lambda to figure out what to
+                    // infer.  i.e.   Func<int,string> f = i => { return Goo(); }
+                    types = InferTypeInLambdaExpression(lambdaExpression);
+                    isAsync = lambdaExpression.AsyncKeyword.Kind() != SyntaxKind.None;
                     return;
                 }
                 else if (ancestor is AnonymousMethodExpressionSyntax delegateExpression)
@@ -1902,23 +1893,18 @@

                 var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(SemanticModel, returnStatement.GetAncestorOrThis<MemberDeclarationSyntax>());

-                if (memberSymbol.IsKind(SymbolKind.Method))
-                {
-                    var method = memberSymbol as IMethodSymbol;
-
-                    isAsync = method.IsAsync;
-                    types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(method.ReturnType));
-                    return;
-                }
-                else if (memberSymbol.IsKind(SymbolKind.Property))
-                {
-                    types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo((memberSymbol as IPropertySymbol).Type));
-                    return;
-                }
-                else if (memberSymbol.IsKind(SymbolKind.Field))
-                {
-                    types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo((memberSymbol as IFieldSymbol).Type));
-                    return;
+                switch (memberSymbol)
+                {
+                    case IMethodSymbol method:
+                        isAsync = method.IsAsync;
+                        types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(method.ReturnType));
+                        return;
+                    case IPropertySymbol property:
+                        types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(property.Type));
+                        return;
+                    case IFieldSymbol field:
+                        types = SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(field.Type));
+                        return;
                 }
             }


Fix: la composizione ora occupa la squadra che è visibile come già impegnata

--- src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/UpdateConfermaPartenzeExt.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/UpdateConfermaPartenzeExt.cs
@@ -59,15 +59,18 @@
             var conferma = new ConfermaPartenze();

             _updateRichiesta.UpDate(command.ConfermaPartenze.richiesta);
+
+            var codiceSede = command.ConfermaPartenze.CodiceSede.Split(",", StringSplitOptions.RemoveEmptyEntries)[0];
+
             foreach (var partenza in command.ConfermaPartenze.Partenze)
             {
                 var dataMovintazione = DateTime.UtcNow;

-                _setStatoOperativoMezzo.Set(partenza.Mezzo.Distaccamento.Codice, partenza.Mezzo.Codice, partenza.Mezzo.Stato, command.ConfermaPartenze.richiesta.Codice);
+                _setStatoOperativoMezzo.Set(codiceSede, partenza.Mezzo.Codice, partenza.Mezzo.Stato, command.ConfermaPartenze.richiesta.Codice);

                 foreach (var squadra in partenza.Squadre)
                 {
-                    _setStatoSquadra.SetStato(squadra.Codice, command.ConfermaPartenze.IdRichiesta, partenza.Mezzo.Stato, squadra.Distaccamento.Codice, partenza.Mezzo.Codice);
+                    _setStatoSquadra.SetStato(squadra.Codice, command.ConfermaPartenze.IdRichiesta, partenza.Mezzo.Stato, codiceSede, partenza.Mezzo.Codice);
                 }
             }


Fix stato squadra dopo riassegnazione

Fix stato squadra dopo riassegnazione

--- src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/UpdateConfermaPartenzeExt.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/UpdateConfermaPartenzeExt.cs
@@ -192,7 +192,7 @@
                     #endregion

                     if (partenza.Mezzo.Distaccamento.Codice != null)
-                        _setStatoSquadra.SetStato(squadra.Codice, $"{squadra.Codice}_{squadra.Turno}", command.ConfermaPartenze.IdRichiesta, partenza.Mezzo.Stato, squadra.Distaccamento.Codice, partenza.Mezzo.Codice, turnoAttuale, squadra.Turno);
+                        _setStatoSquadra.SetStato(squadra.Codice, $"{squadra.Codice}_{squadra.Turno}", command.ConfermaPartenze.IdRichiesta, partenza.Mezzo.Stato, partenza.Mezzo.Distaccamento.Codice, partenza.Mezzo.Codice, turnoAttuale, squadra.Turno);
                     else if (partenza.Mezzo.Appartenenza != null)
                         _setStatoSquadra.SetStato(squadra.Codice, $"{squadra.Codice}_{partenza.Turno.Substring(0, 1)}", command.ConfermaPartenze.IdRichiesta, partenza.Mezzo.Stato, partenza.Mezzo.Appartenenza, partenza.Mezzo.Codice, turnoAttuale, partenza.Turno.Substring(0, 1));
                 });


Fix of ProjectReference

Fix of ProjectReference

--- src/dotnetplugins/Bari.Plugins.VsCore/cs/VisualStudio/ProjectSections/ReferencesSection.cs
+++ src/dotnetplugins/Bari.Plugins.VsCore/cs/VisualStudio/ProjectSections/ReferencesSection.cs
@@ -68,7 +68,8 @@
                                 Suite.SuiteRoot.GetRelativePathFrom(
                                     project.RootDirectory.GetChildDirectory(
                                         project.RootDirectory.ChildDirectories.First()), projectPath));
-                            writer.WriteElementString("Project", projectGuidManagement.GetGuid(project).ToString("B"));
+                            writer.WriteElementString("Project", projectGuidManagement.GetGuid(referredProject).ToString("B"));
+                            writer.WriteElementString("Name", referredProject.Name);
                             writer.WriteEndElement();
                         }
                         else


added the viewport meta tag

added the viewport meta tag

--- Server/Server.WebApi/Views/Home/Index.cshtml
+++ Server/Server.WebApi/Views/Home/Index.cshtml
@@ -3,6 +3,7 @@
 <html lang="en">
 <head>
     <title>Project Quiz</title>
+    <meta name="viewport" content="initial-scale=1">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
     <!-- build:css styles/style.min.css-->
     <!-- include: "type": "css", "files": "<%= dev.css %>"-->


ElapsedToString

ElapsedToString

--- Signum.Utilities/Profiler.cs
+++ Signum.Utilities/Profiler.cs
@@ -327,11 +327,11 @@
                         {
                             Query = gr.Key,
                             Count = gr.Count(),
-                            Sum = new TimeSpan(gr.Sum(a => a.Elapsed.Ticks)),
-                            Avg = new TimeSpan((long)gr.Average((a => a.Elapsed.Ticks))),
-                            Min = new TimeSpan(gr.Min((a => a.Elapsed.Ticks))),
-                            Max = new TimeSpan(gr.Max((a => a.Elapsed.Ticks))),
-                            References = gr.Select(a => new SqlProfileReference { FullKey = a.FullIndex(), Elapsed = a.Elapsed }).ToList(),
+                            Sum = TimeSpan.FromMilliseconds(gr.Sum(a => a.ElapsedMilliseconds)),
+                            Avg = TimeSpan.FromMilliseconds((long)gr.Average((a => a.ElapsedMilliseconds))),
+                            Min = TimeSpan.FromMilliseconds(gr.Min((a => a.ElapsedMilliseconds))),
+                            Max = TimeSpan.FromMilliseconds(gr.Max((a => a.ElapsedMilliseconds))),
+                            References = gr.Select(a => new SqlProfileReference { FullKey = a.FullIndex(), ElapsedToString = a.ElapsedToString() }).ToList(),
                         }).OrderByDescending(a => a.Sum);
             return statistics;
         }
@@ -400,6 +400,16 @@
             {
                 return TimeSpan.FromMilliseconds(ElapsedMilliseconds);
             }
+        }
+
+        public string ElapsedToString()
+        {
+            var ms = ElapsedMilliseconds;
+
+            if (ms < 10)
+                return ms.ToString("0.0000") + "ms";
+
+            return TimeSpan.FromMilliseconds(ms).NiceToString();
         }

         public double ElapsedMilliseconds
@@ -553,6 +563,6 @@
     public class SqlProfileReference
     {
         public string FullKey;
-        public TimeSpan Elapsed;
+        public string ElapsedToString;
     }
 }


Modified detail to return DynamicEnumerable

--- Simple.Data/DynamicRecord.cs
+++ Simple.Data/DynamicRecord.cs
@@ -59,7 +59,7 @@
                 }
                 else
                 {
-                    result = relatedRows.Select(dict => new DynamicRecord(dict, binder.Name, _database));
+                    result = new DynamicEnumerable(relatedRows.Select(dict => new DynamicRecord(dict, binder.Name, _database)));
                 }
                 return true;
             }


探索数を表示するように変更

探索数を表示するように変更

--- PetDetectiveSolver/PDSolver.cs
+++ PetDetectiveSolver/PDSolver.cs
@@ -21,8 +21,13 @@

         public Option<Traceable<PDNode>> Solve()
         {
-            return BestFirstSearch.Search(new PDNode(PDPoint.Start(), pets.ToDictionary(pet => pet , _ => PDPetStatus.BeforeCarry)),
-                Nexts, IsGoal, Comparer<Traceable<PDNode>>.Create(Comparer));
+            long searchNodes = 0;
+            var ret =  BestFirstSearch.Search(new PDNode(PDPoint.Start(), pets.ToDictionary(pet => pet , _ => PDPetStatus.BeforeCarry)),
+                Nexts, IsGoal, Comparer<Traceable<PDNode>>.Create(Comparer),
+                _ => searchNodes++);
+
+            Console.WriteLine(searchNodes);
+            return ret;
         }

         private IEnumerable<PDNode> Nexts(PDNode current)


Ensure database is set up on live

Ensure database is set up on live

--- src/startup.cs
+++ src/startup.cs
@@ -133,8 +133,8 @@
             app.UseCors("CorsPolicy");
             app.UseMvc();

-            if (env.IsDevelopment())
-            {
+            //if (env.IsDevelopment())
+            //{
                 // seed the database using an extension method
                 using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
                 {
@@ -142,7 +142,7 @@
                     //context.Database.Migrate();
                     context.EnsureSeedData();
                 }
-            }
+            //}
         }
         #endregion
     }


updated see method

updated see method

--- WhenItsDone/Lib/WhenItsDone.Data/Migrations/Configuration.cs
+++ WhenItsDone/Lib/WhenItsDone.Data/Migrations/Configuration.cs
@@ -45,6 +45,24 @@
                 context.ProfilePictures.Add(defaultProfilePicture);
                 context.SaveChanges();
             }
+
+            if (!context.VideoItems.Any())
+            {
+                var mozart = new VideoItem();
+                mozart.Url = "Rb0UmrCXxVA";
+                mozart.Rating = 100;
+                context.VideoItems.Add(mozart);
+
+                var minimal = new VideoItem();
+                minimal.Url = "_3P4j6iIVew";
+                minimal.Rating = 100;
+                context.VideoItems.Add(minimal);
+
+                var metallica = new VideoItem();
+                metallica.Url = "md3B3I7Nmvw";
+                metallica.Rating = 100;
+                context.VideoItems.Add(metallica);
+            }
         }
     }
 }


Add missing comments to one event handler method

--- SlackUI/Forms/WrapperForm.cs
+++ SlackUI/Forms/WrapperForm.cs
@@ -109,7 +109,11 @@
             Program.Settings.Save();
         }

+        /*
+         * Wrapper form activated event handler.
+         */
         private void WrapperForm_Activated(object sender, System.EventArgs e) {
+            // Make sure the chromium control is focused
             chromium.SetFocus(true);
         }


Added Process command line to Listing

Added Process command line to Listing

--- ProcessInvestigator/Program.cs
+++ ProcessInvestigator/Program.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Management;
 using System.Text;
 using System.Threading.Tasks;
 using Microsoft.Diagnostics.Runtime;
@@ -43,7 +44,7 @@
                         case "help":
                             {
                                 Console.WriteLine("Commands:");
-                                Console.WriteLine("List - list running processes");
+                                Console.WriteLine("List <optional true/false to include command line> - list running processes");
                                 Console.WriteLine("Stack <Pid|ProcessName> <optional search phase> - prints CLR stack traces");
                                 Console.WriteLine("Heap <Pid|ProcessName> <optional search phase> - prints heap allocations");
                                 Console.WriteLine("ThreadPool <Pid|ProcessName> - prints ThreadPool information");
@@ -54,9 +55,23 @@
                         case "list":
                             {
                                 Console.WriteLine("Processes:");
+                                bool listCommand = "true".Equals(secondPartCommand, StringComparison.OrdinalIgnoreCase);
+
                                 foreach (var p in Process.GetProcesses().OrderBy(p => p.ProcessName))
                                 {
-                                    Console.WriteLine("{0}\t{1}\t{2} {3}", p.Id, p.ProcessName, p.StartInfo.FileName, p.StartInfo.Arguments);
+                                    string commandLine = "";
+                                    if (listCommand)
+                                    {
+                                        using (var searcher = new ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + p.Id))
+                                        {
+                                            foreach (ManagementObject @object in searcher.Get())
+                                            {
+                                                commandLine = commandLine + @object["CommandLine"] + " ";
+                                            }
+                                        }
+                                    }
+
+                                    Console.WriteLine("{0}\t{1}\t{2}", p.Id, p.ProcessName, commandLine);
                                 }
                                 Console.WriteLine();
                                 break;
@@ -71,6 +86,7 @@
                                 string searchPhase = commandSplit.Length > 2 ? string.Join(" ", commandSplit.Skip(2)): null;
                                 using (DataTarget dt = DataTarget.AttachToProcess(currentPid, 5000, AttachFlag.NonInvasive))
                                 {
+                                    dt.DebuggerInterface.SetProcessOptions(DEBUG_PROCESS.DETACH_ON_EXIT);
                                     if (dt.ClrVersions.Count == 0)
                                     {
                                         Console.WriteLine("Process is probably not running in the CLR");
@@ -105,6 +121,7 @@

                                         Console.WriteLine();
                                     }
+                                    dt.DebuggerInterface.DetachProcesses();
                                 }
                                 break;
                             }
@@ -118,6 +135,7 @@
                                 string searchPhase = commandSplit.Length > 2 ? string.Join(" ", commandSplit.Skip(2)) : null;
                                 using (DataTarget dt = DataTarget.AttachToProcess(currentPid, 5000, AttachFlag.NonInvasive))
                                 {
+                                    dt.DebuggerInterface.SetProcessOptions(DEBUG_PROCESS.DETACH_ON_EXIT);
                                     if (dt.ClrVersions.Count == 0)
                                     {
                                         Console.WriteLine("Process is probably not running in the CLR");
@@ -152,7 +170,7 @@
                                     }

-
+                                    dt.DebuggerInterface.DetachProcesses();
                                 }
                                 break;
                             }


add license

add license

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


RESET ball state

RESET ball state


Unset move command on stun.

Unset move command on stun.

--- Assets/Scripts/GenericFootballer.cs
+++ Assets/Scripts/GenericFootballer.cs
@@ -373,6 +373,9 @@
 				_throw_charge_ct = 0;
 			}

+			// reset previous command
+			_has_command_move_to_point = false;
+
 			// ai event
 			GetComponent<BotBase>().Msg_Stunned();
 		}


Fix bug introduced in previous commit

Fix bug introduced in previous commit

--- Assets/Scripts/Model/ModelLoader.cs
+++ Assets/Scripts/Model/ModelLoader.cs
@@ -519,7 +519,7 @@
 				switch(b.Type)
 				{
 					case 0: //rotate
-						if(isAITD2)
+						if(!isAITD2)
 						{
 							b.Rotate = new Vector3(-boneTransform.x * 360 / 1024.0f, -boneTransform.y * 360 / 1024.0f, -boneTransform.z * 360 / 1024.0f);
 						}


Use prepared commands in hidden system processing

--- EDDiscovery/DB/SystemClass.cs
+++ EDDiscovery/DB/SystemClass.cs
@@ -1405,49 +1405,61 @@
             {
                 using (DbTransaction txn = cn2.BeginTransaction())
                 {
-                    while (jr.Read())
-                    {
-                        if (jr.TokenType == JsonToken.StartObject)
-                        {
-                            JObject jo = JObject.Load(jr);
-
-                            long edsmid = (long)jo["id"];
-                            string name = (string)jo["system"];
-                            string action = (string)jo["action"];
-                            long mergedto = 0;
-
-                            if (jo["mergedTo"] != null)
-                            {
-                                mergedto = (long)jo["mergedTo"];
-                            }
-
-                            Console.Write("Remove " + edsmid);
-                            using (DbCommand cmd = cn2.CreateCommand("DELETE FROM EdsmSystems WHERE EdsmId=@EdsmId", txn))
-                            {
-                                cmd.AddParameterWithValue("@EdsmId", edsmid);
-                                cmd.ExecuteNonQuery();
-                            }
-
-                            if (mergedto > 0)
-                            {
-                                using (DbCommand cmd = cn2.CreateCommand("INSERT OR IGNORE INTO SystemNames (Name, EdsmId) VALUES (@Name, @EdsmId)", txn))
+                    DbCommand infoinscmd = null;
+                    DbCommand infodelcmd = null;
+                    DbCommand namedelcmd = null;
+
+                    try
+                    {
+                        infoinscmd = cn2.CreateCommand("INSERT OR IGNORE INTO SystemAliases (name, id_edsm, id_edsm_mergedto) VALUES (@name, @id_edsm, @id_edsm_mergedto)", txn);
+                        infoinscmd.AddParameter("@name", DbType.String);
+                        infoinscmd.AddParameter("@id_edsm", DbType.Int64);
+                        infoinscmd.AddParameter("@id_edsm_mergedto", DbType.Int64);
+                        infodelcmd = cn2.CreateCommand("DELETE FROM EdsmSystems WHERE EdsmId=@EdsmId", txn);
+                        infodelcmd.AddParameter("@EdsmId", DbType.Int64);
+                        namedelcmd = cn2.CreateCommand("DELETE FROM SystemNames WHERE EdsmId=@EdsmId", txn);
+                        namedelcmd.AddParameter("@EdsmId", DbType.Int64);
+
+                        while (jr.Read())
+                        {
+                            if (jr.TokenType == JsonToken.StartObject)
+                            {
+                                JObject jo = JObject.Load(jr);
+
+                                long edsmid = (long)jo["id"];
+                                string name = (string)jo["system"];
+                                string action = (string)jo["action"];
+                                long mergedto = 0;
+
+                                if (jo["mergedTo"] != null)
                                 {
-                                    cmd.AddParameterWithValue("@Name", name);
-                                    cmd.AddParameterWithValue("@EdsmId", edsmid);
-                                    cmd.ExecuteNonQuery();
+                                    mergedto = (long)jo["mergedTo"];
                                 }
-                                using (DbCommand cmd = cn2.CreateCommand("INSERT OR IGNORE INTO SystemAliases (name, id_edsm, id_edsm_mergedto) VALUES (@name, @id_edsm, @id_edsm_mergedto)", txn))
+
+                                Console.Write("Remove " + edsmid);
+                                infodelcmd.Parameters["@EdsmId"].Value = edsmid;
+                                infodelcmd.ExecuteNonQuery();
+                                namedelcmd.Parameters["@EdsmId"].Value = edsmid;
+                                namedelcmd.ExecuteNonQuery();
+
+                                if (mergedto > 0)
                                 {
-                                    cmd.AddParameterWithValue("@name", name);
-                                    cmd.AddParameterWithValue("@id_edsm", edsmid);
-                                    cmd.AddParameterWithValue("@id_edsm_mergedto", mergedto);
-                                    cmd.ExecuteNonQuery();
+                                    infoinscmd.Parameters["@name"].Value = name;
+                                    infoinscmd.Parameters["@id_edsm"].Value = edsmid;
+                                    infoinscmd.Parameters["@id_edsm_mergedto"].Value = mergedto;
+                                    infoinscmd.ExecuteNonQuery();
                                 }
                             }
                         }
-                    }
-
-                    txn.Commit();
+
+                        txn.Commit();
+                    }
+                    finally
+                    {
+                        if (infoinscmd != null) infoinscmd.Dispose();
+                        if (infodelcmd != null) infodelcmd.Dispose();
+                        if (namedelcmd != null) namedelcmd.Dispose();
+                    }
                 }
             }
         }


Add param to method and use it also in other place

--- Editor/AnimatorParamDrawer.cs
+++ Editor/AnimatorParamDrawer.cs
@@ -94,17 +94,7 @@
             // Draw 'param' field.
             EditorGUIUtility.labelWidth = 50;

-            // todo replace with DrawParamField. Add no param.
-            EditorGUI.PropertyField(
-                new Rect(
-                    pos.x,
-                    pos.y + 40,
-                    pos.width * 0.5f,
-                    16),
-                param,
-                new GUIContent(
-                    "Param",
-                    "Animator parameter name to update."));
+            DrawParamField(pos, param, 2);

             // Draw 'trigger' field.
             EditorGUIUtility.labelWidth = 50;
@@ -132,7 +122,7 @@

             EditorGUIUtility.labelWidth = 50;

-            DrawParamField(pos, param);
+            DrawParamField(pos, param, 1);

             EditorGUIUtility.labelWidth = 50;

@@ -237,11 +227,15 @@
                     "If the animator param. is a trigger."));
         }

-        private void DrawParamField(Rect pos, SerializedProperty param) {
-            EditorGUI.PropertyField(
-                new Rect(
-                    pos.x,
-                    pos.y + 1 * (PropHeight + PropMargin),
+        private void DrawParamField(
+            Rect pos,
+            SerializedProperty param,
+            int row) {
+
+            EditorGUI.PropertyField(
+                new Rect(
+                    pos.x,
+                    pos.y + row * (PropHeight + PropMargin),
                     pos.width * 0.5f,
                     16),
                 param,


Avoid editor window updates when application is playing

--- Editor/BaseUpdateablePanel.cs
+++ Editor/BaseUpdateablePanel.cs
@@ -19,6 +19,9 @@

 		private void OnInspectorUpdate()
 		{
+			if (EditorApplication.isPlaying)
+				return;
+
 			// Fixed Update
 			_deltaBetweenUpdates += 0.1f;
 			if (_deltaBetweenUpdates >= UpdatePoint) {
@@ -102,4 +105,3 @@
 		#endregion
 	}
 }
-


More appropriate colors

More appropriate colors

--- Editor/DeepPrefabInspector.cs
+++ Editor/DeepPrefabInspector.cs
@@ -36,7 +36,7 @@
 				selectedBoxStyle.margin = new RectOffset(0, 0, 0, 0);
 				selectedBoxStyle.border = new RectOffset(0, 0, 0, 0);
 				selectedBoxStyle.normal.background = new Texture2D(1, 1, TextureFormat.ARGB32, false);
-				selectedBoxStyle.normal.background.SetPixel(0, 0, new Color(62f / 255f, 95f / 255f, 150f / 255f));
+				selectedBoxStyle.normal.background.SetPixel(0, 0, new Color(72f / 255f, 72f / 255f, 72f / 255f));
 				selectedBoxStyle.normal.background.Apply();
 				// Default styles - remove blue on select text
 				defaultFoldoutStyle = new GUIStyle(EditorStyles.foldout);


Add tests for permissions + syncing (#1111)

--- Shared/Tests.Sync.Shared/PermissionsTests.cs
+++ Shared/Tests.Sync.Shared/PermissionsTests.cs
@@ -17,7 +17,9 @@
 ////////////////////////////////////////////////////////////////////////////

 using System;
+using System.Linq;
 using System.Threading.Tasks;
+using IntegrationTests;
 using Nito.AsyncEx;
 using NUnit.Framework;
 using Realms;
@@ -68,7 +70,7 @@
             Assert.That(RealmSchema.Default.Find(nameof(PermissionOfferResponse)), Is.Null);
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionChange_IsProcessedByServer()
         {
             AsyncContext.Run(async () =>
@@ -79,7 +81,7 @@
             });
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionOffer_WhenValid_TokenIsSet()
         {
             AsyncContext.Run(async () =>
@@ -91,7 +93,7 @@
             });
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionOffer_WhenExpired_ShouldGetError()
         {
             AsyncContext.Run(async () =>
@@ -105,18 +107,18 @@
             });
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionResponse_WhenOfferExpired_ShouldGetError()
         {
             AsyncContext.Run(async () =>
             {
                 var user = await GetUser();
-                var permissionOffer = await CreateOffer(user, expiresAt: DateTimeOffset.UtcNow.AddSeconds(5));
+                var permissionOffer = await CreateOffer(user, expiresAt: DateTimeOffset.UtcNow.AddSeconds(2));

                 Assert.That(permissionOffer.Status, Is.EqualTo(ManagementObjectStatus.Success));
                 Assert.That(permissionOffer.Token, Is.Not.Null);

-                await Task.Delay(5000);
+                await Task.Delay(2500);
                 var permissionResponse = await CreateResponse(user, permissionOffer.Token);
                 Assert.That(permissionResponse.Status, Is.EqualTo(ManagementObjectStatus.Error));
                 Assert.That(permissionResponse.ErrorCode, Is.EqualTo(ErrorCode.ExpiredPermissionOffer));
@@ -124,7 +126,7 @@
             });
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionResponse_WhenTokenIsInvalid_ShouldGetError()
         {
             AsyncContext.Run(async () =>
@@ -137,26 +139,18 @@
             });
         }

-        [Test, Explicit("Update Constants.Credentials with values that work on your setup.")]
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
         public void PermissionResponse_WhenOfferIsValid_ShouldSetRealmUrl()
         {
             AsyncContext.Run(async () =>
             {
-                var user = await GetUser();
+                var alice = await GetUser();
+                var bob = await GetUser();

                 // Opening a synced realm with just read permission fails.
                 // OS issue: https://github.com/realm/realm-object-store/issues/312
-                var permissionOffer = await CreateOffer(user, mayWrite: true);
-
-                Assert.That(permissionOffer.Status, Is.EqualTo(ManagementObjectStatus.Success));
-                Assert.That(permissionOffer.Token, Is.Not.Null);
-
-                var receiver = await GetUser();
-                var permissionResponse = await CreateResponse(receiver, permissionOffer.Token);
-                Assert.That(permissionResponse.Status, Is.EqualTo(ManagementObjectStatus.Success));
-                Assert.That(permissionResponse.RealmUrl, Is.Not.Null);
-
-                var syncConfig = new SyncConfiguration(receiver, new Uri(permissionResponse.RealmUrl));
+                var realmUrl = await GrantPermissions(alice, bob);
+                var syncConfig = new SyncConfiguration(bob, new Uri(realmUrl));

                 Realm realm = null;
                 Assert.That(() => realm = Realm.GetInstance(syncConfig), Throws.Nothing);
@@ -166,8 +160,41 @@
                     Assert.Fail("Opening the realm should not cause an error.", e.Exception);
                 };

-                await Task.Delay(5000);
+                await Task.Delay(2000);
                 realm.Dispose();
+            });
+        }
+
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
+        public void Permission_ValidateWrite()
+        {
+            AsyncContext.Run(async () =>
+            {
+                var alice = await GetUser();
+                var bob = await GetUser();
+
+                var realmUrl = await GrantPermissions(alice, bob);
+
+                await ValidateWriteAndSync(realmUrl, alice, bob, 1, 2);
+            });
+        }
+
+        [Test, Explicit("Update Constants.ServerUrl with values that work on your setup.")]
+        public void Permission_ValidateManage()
+        {
+            AsyncContext.Run(async () =>
+            {
+                var alice = await GetUser();
+                var bob = await GetUser();
+                var charlie = await GetUser();
+
+                var alicesUrl = await GrantPermissions(alice, bob, mayManage: true);
+
+                await GrantPermissions(bob, charlie, realmUrl: alicesUrl);
+
+                await ValidateWriteAndSync(alicesUrl, alice, charlie, 1, 2);
+
+                await ValidateWriteAndSync(alicesUrl, bob, charlie, 3, 4);
             });
         }

@@ -177,12 +204,72 @@
             return User.LoginAsync(credentials, new Uri($"http://{Constants.ServerUrl}"));
         }

-        private static Task<PermissionOffer> CreateOffer(User user, bool mayRead = true, bool mayWrite = false, bool mayManage = false, DateTimeOffset? expiresAt = null)
-        {
-            return CreatePermissionObject(user, realmUrl =>
-            {
-                return new PermissionOffer(realmUrl, mayRead, mayWrite, mayManage, expiresAt);
-            });
+        private static async Task<string> GrantPermissions(User granter, User receiver, bool mayRead = true, bool mayWrite = true, bool mayManage = false, string realmUrl = null)
+        {
+            var permissionOffer = await CreateOffer(granter, mayRead, mayWrite, mayManage, realmUrl: realmUrl);
+
+            Assert.That(permissionOffer.Status, Is.EqualTo(ManagementObjectStatus.Success));
+            Assert.That(permissionOffer.Token, Is.Not.Null);
+
+            var permissionResponse = await CreateResponse(receiver, permissionOffer.Token);
+            Assert.That(permissionResponse.Status, Is.EqualTo(ManagementObjectStatus.Success));
+            Assert.That(permissionResponse.RealmUrl, Is.Not.Null);
+
+            return permissionResponse.RealmUrl;
+        }
+
+        private static async Task ValidateWriteAndSync(string realmUrl, User first, User second, long firstObjectId, long secondObjectId)
+        {
+            await Task.Delay(500);
+
+            var firstRealm = Realm.GetInstance(new SyncConfiguration(first, new Uri(realmUrl)));
+            var secondRealm = Realm.GetInstance(new SyncConfiguration(second, new Uri(realmUrl)));
+
+            var firstObjects = firstRealm.All<PrimaryKeyInt64Object>();
+            var secondObjects = secondRealm.All<PrimaryKeyInt64Object>();
+
+            await Task.Delay(1000);
+
+            Assert.That(firstObjects.Count(), Is.EqualTo(secondObjects.Count()));
+
+            // Assert that second's realm doesn't contain object with Id = firstObjectId
+            Assert.That(secondRealm.Find<PrimaryKeyInt64Object>(firstObjectId), Is.Null);
+
+            // first adds an object
+            firstRealm.Write(() => firstRealm.Add(new PrimaryKeyInt64Object
+            {
+                Int64Property = firstObjectId
+            }));
+
+            await Task.Delay(1000);
+
+            Assert.That(firstObjects.Count(), Is.EqualTo(secondObjects.Count()));
+            Assert.That(secondRealm.Find<PrimaryKeyInt64Object>(firstObjectId), Is.Not.Null);
+
+            // Assert that first's realm doesn't contain object with Id = secondObjectId
+            Assert.That(firstRealm.Find<PrimaryKeyInt64Object>(secondObjectId), Is.Null);
+
+            // second adds an object
+            secondRealm.Write(() => secondRealm.Add(new PrimaryKeyInt64Object
+            {
+                Int64Property = secondObjectId
+            }));
+
+            await Task.Delay(1000);
+
+            Assert.That(firstObjects.Count(), Is.EqualTo(secondObjects.Count()));
+            Assert.That(firstRealm.Find<PrimaryKeyInt64Object>(secondObjectId), Is.Not.Null);
+
+            firstRealm.Dispose();
+            secondRealm.Dispose();
+        }
+
+        private static Task<PermissionOffer> CreateOffer(User user, bool mayRead = true, bool mayWrite = false, bool mayManage = false, DateTimeOffset? expiresAt = null, string realmUrl = null)
+        {
+            return CreatePermissionObject(user, url =>
+            {
+                return new PermissionOffer(url, mayRead, mayWrite, mayManage, expiresAt);
+            }, realmUrl);
         }

         private static Task<PermissionOfferResponse> CreateResponse(User user, string token)
@@ -190,9 +277,9 @@
             return CreatePermissionObject(user, _ => new PermissionOfferResponse(token));
         }

-        private static async Task<T> CreatePermissionObject<T>(User user, Func<string, T> itemFactory) where T : RealmObject, IPermissionObject
-        {
-            var realmUrl = $"realm://{Constants.ServerUrl}/{user.Identity}/offer";
+        private static async Task<T> CreatePermissionObject<T>(User user, Func<string, T> itemFactory, string realmUrl = null) where T : RealmObject, IPermissionObject
+        {
+            realmUrl = realmUrl ?? $"realm://{Constants.ServerUrl}/{user.Identity}/offer";
             EnsureRealmExists(user, realmUrl);

             var managementRealm = user.GetManagementRealm();
@@ -208,7 +295,7 @@
                 }
             };

-            var completedProcessingTask = await Task.WhenAny(tcs.Task, Task.Delay(10000));
+            var completedProcessingTask = await Task.WhenAny(tcs.Task, Task.Delay(5000));

             Assert.That(completedProcessingTask, Is.EqualTo(tcs.Task));


fix CacheLogic.StartSqlDependencyAndEnableBrocker when no enabled AND not default schema

--- Signum.Engine.Extensions/Cache/CacheLogic.cs
+++ Signum.Engine.Extensions/Cache/CacheLogic.cs
@@ -227,27 +227,20 @@

                     try
                     {
-                        SqlDependency.Start(sub.ConnectionString);
-                    }
-                    catch (InvalidOperationException ex)
-                    {
-                        string databaseName = database.TryToString() ?? Connector.Current.DatabaseName();
-
                         try
                         {
+                            SqlDependency.Start(sub.ConnectionString);
+                        }
+                        catch (InvalidOperationException ex)
+                        {
+                            string databaseName = database.TryToString() ?? Connector.Current.DatabaseName();
+
                             if (ex.Message.Contains("SQL Server Service Broker"))
                             {
                                 EnableOrCreateBrocker(databaseName);

                                 SqlDependency.Start(sub.ConnectionString);
                             }
-                        }
-                        catch (Exception e)
-                        {
-                            throw new InvalidOperationException(@"CacheLogic requires SQL Server Service Broker to be activated. Execute:
-ALTER DATABASE {0} SET ENABLE_BROKER
-If you have problems, try first:
-ALTER DATABASE {0} SET NEW_BROKER".FormatWith(database), e);
                         }
                     }
                     catch (SqlException e)


Eitthvad fkn rugl skilruh

Eitthvad fkn rugl skilruh

--- Skermstafir/Controllers/RequestController.cs
+++ Skermstafir/Controllers/RequestController.cs
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 using Skermstafir.Models;
 using Skermstafir.Repositories;
 using System;
@@ -25,30 +24,4 @@
             return View();
         }
 	}
-=======
-using Skermstafir.Models;
-using Skermstafir.Repositories;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-
-namespace Skermstafir.Controllers
-{
-    public class RequestController : Controller
-    {
-        //
-        // GET: /Request/
-		public ActionResult ShowRequest(int? requestID)
-		{
-			return View();
-		}
-		// Adds a new request.
-        public ActionResult AddRequest()
-        {
-            return View();
-        }
-	}
->>>>>>> 4be52bc1ef7c2d7fdb466599853d340e2f213a40
 }


Add tests: check if we floor fromUtc to seconds we set inclusive = false

--- tests/Cronos.Tests/CronExpressionFacts.cs
+++ tests/Cronos.Tests/CronExpressionFacts.cs
@@ -1141,7 +1141,7 @@
         [InlineData("30 0 L  * *", "2017-03-30 23:59:59.9000000 +02:00", "2017-03-31 01:00:00 +03:00", false)]

         [InlineData("30 0 L  * *", "2017-03-31 01:00:00.0000001 +02:00", "2017-04-30 00:30:00 +03:00", true)]
-        public void GetNextOccurrence_HandleDST_WhenTheClockJumpsForward_And_FromIsAroundDST(string cronExpression, string fromString, string expectedString, bool inclusive)
+        public void GetNextOccurrence_HandleDST_WhenTheClockJumpsForwardAndFromIsAroundDST(string cronExpression, string fromString, string expectedString, bool inclusive)
         {
             var expression = CronExpression.Parse(cronExpression);

@@ -1149,6 +1149,25 @@
             var expectedInstant = GetInstant(expectedString);

             var executed = expression.GetNextOccurrence(fromInstant, JordanTimeZone, inclusive);
+
+            Assert.Equal(expectedInstant, executed);
+            Assert.Equal(expectedInstant.Offset, executed?.Offset);
+        }
+
+        [Theory]
+        [InlineData("0  7 * * *", "2020-05-20 07:00:00.0000001 -04:00", "2020-05-21 07:00:00 -04:00", true)]
+        [InlineData("0  7 * * *", "2020-05-20 07:00:00.0000001 -04:00", "2020-05-21 07:00:00 -04:00", false)]
+
+        [InlineData("0  7 * * *", "2023-08-12 07:00:00.9999999 -04:00", "2023-08-13 07:00:00 -04:00", true)]
+        [InlineData("0  7 * * *", "2023-08-12 07:00:00.9999999 -04:00", "2023-08-13 07:00:00 -04:00", false)]
+        public void GetNextOccurrence_ReturnsCorrectDate_WhenFromIsNotRoundAndZoneIsSpecified(string cronExpression, string fromString, string expectedString, bool inclusive)
+        {
+            var expression = CronExpression.Parse(cronExpression);
+
+            var fromInstant = GetInstant(fromString);
+            var expectedInstant = GetInstant(expectedString);
+
+            var executed = expression.GetNextOccurrence(fromInstant, EasternTimeZone, inclusive);

             Assert.Equal(expectedInstant, executed);
             Assert.Equal(expectedInstant.Offset, executed?.Offset);


Closes #3644 - unit tests voor GroepenService gefixt.

--- Solution/TestProjecten/Chiro.Gap.Services.Test/GroepenServiceTest.cs
+++ Solution/TestProjecten/Chiro.Gap.Services.Test/GroepenServiceTest.cs
@@ -46,57 +46,19 @@
     [TestClass]
     public class GroepenServiceTest
     {
-        public GroepenServiceTest()
-        {
-        }
-
-
-        #region Additional test attributes
-
-        //
-        // You can use the following additional attributes as you write your tests:
-        //
-        // Use ClassInitialize to run code before running the first test in the class
-        // [ClassInitialize]
-        // public static void MyClassInitialize(TestContext testContext) { }
-        //
-        // Use ClassCleanup to run code after all tests in a class have run
-        // [ClassCleanup()]
-        // public static void MyClassCleanup() { }
-        //
-        // Use TestInitialize to run code before running each test
-        // [TestInitialize]
-        // public void MyTestInitialize() { }
-        //
-        // Use TestCleanup to run code after each test has run
-        // [TestCleanup()]
-        // public void MyTestCleanup() { }
-        //
-
-        #endregion
-
-
-
-        [ClassInitialize]
-        public static void InitialiseerTests(TestContext tc)
-        {
-            Factory.ContainerInit();
-        }
-
-        [ClassCleanup]
-        public static void AfsluitenTests()
-        {
-        }
-
-
         /// <summary>
         /// Deze functie zorgt ervoor dat de PrincipalPermissionAttributes op de service methods
         /// geen excepties genereren, door te doen alsof de service aangeroepen is met de goede
-        /// security
+        /// security.
+        ///
+        /// Bovendien herinitialiseren we iedere keer de IOC-container, want daar wordt in
+        /// verschillende tests deftig mee geprutst.
         /// </summary>
         [TestInitialize]
         public void VoorElkeTest()
         {
+            Factory.ContainerInit();
+
             var identity = new GenericIdentity(Properties.Settings.Default.TestUser);
             var roles = new[] {Properties.Settings.Default.TestSecurityGroep};
             var principal = new GenericPrincipal(identity, roles);


Refactor tests

Refactor tests

--- Sonneville.Fidelity.WebDriver.Test/Logging/PatientWebElementTests.cs
+++ Sonneville.Fidelity.WebDriver.Test/Logging/PatientWebElementTests.cs
@@ -153,9 +153,11 @@
             IWebElement outer,
             Mock<IWebElement> inner,
             Action<IWebElement> trigger,
-            Expression<Action<IWebElement>> expectedInteraction, int callCount = 1)
+            Expression<Action<IWebElement>> expectedInteraction,
+            int expectedCallCount = 1
+        )
         {
-            var validationsCompleted = false;
+            var completedValidations = 0;
             _seleniumWaiterMock.Setup(waiter =>
                     waiter.WaitUntil(It.IsAny<Func<IWebDriver, bool>>(), It.IsAny<TimeSpan>(), It.IsAny<IWebDriver>()))
                 .Callback<Func<IWebDriver, bool>, TimeSpan, IWebDriver>(
@@ -167,7 +169,7 @@
                             "WaitUntil condition does not check if IWebElement is Displayed!");
                         Assert.AreEqual(_timeSpan, timeSpan, "WaitUntil called with wrong timespan!");
                         Assert.AreEqual(_webDriverMock.Object, webDriver);
-                        validationsCompleted = true;
+                        completedValidations++;
                     }
                 );
             inner.SetupGet(webElement => webElement.Displayed).Returns(() => _isDisplayed);
@@ -175,13 +177,13 @@
                 .Callback(() => _seleniumWaiterMock.Verify(waiter =>
                         waiter.WaitUntil(It.IsAny<Func<IWebDriver, bool>>(), It.IsAny<TimeSpan>(),
                             It.IsAny<IWebDriver>()),
-                    Times.Exactly(callCount),
+                    Times.Exactly(expectedCallCount),
                     "Invoked wrapped IWebElement without waiting until it was displayed!"));
             using (var task = Task.Run(() => trigger(outer)))
             {
                 task.Wait(1000);
                 Assert.IsTrue(task.IsCompleted);
-                if (callCount > 1) Assert.IsTrue(validationsCompleted);
+                Assert.AreEqual(expectedCallCount, completedValidations);
                 inner.Verify(expectedInteraction, Times.Once());
             }
         }


Update view for Home/Index

Update view for Home/Index

- Updated to handle ReCaptchaParameters.

--- SourceCodes/02_Apps/ReCaptcha.Wrapper.WebApp/Views/Home/Index.cshtml
+++ SourceCodes/02_Apps/ReCaptcha.Wrapper.WebApp/Views/Home/Index.cshtml
@@ -12,7 +12,7 @@
         @Html.LabelFor(m => m.Name)
         @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}})
     </div>
-    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } })
+    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" } }, new ReCaptchaParameters() { SiteKey = Model.SiteKey })
     <input class="btn btn-default" type="submit" name="Submit" />
 }


Parsed XML for text - now must use it in the installer

--- Startup-Folder-Installer/Startup-Folder-Installer/MainWindow.xaml.cs
+++ Startup-Folder-Installer/Startup-Folder-Installer/MainWindow.xaml.cs
@@ -97,7 +97,7 @@
                                 {
                                     if (nodeChild.ChildNodes.Item(i).Name == "name")
                                     {
-                                        newBox.Content = nodeChild.ChildNodes;
+                                        newBox.Content = nodeChild.ChildNodes.Item(i).InnerText;
                                     }
                                 }


extended period

extended period

--- TIKSN.UnitTests.Shared/Finance/ForeignExchange/BankOfEnglandTests.cs
+++ TIKSN.UnitTests.Shared/Finance/ForeignExchange/BankOfEnglandTests.cs
@@ -300,7 +300,7 @@
             // In case or failure, check currency pair information from BOE website and set deadline
             // up to 3 month.

-            System.DateTimeOffset Deadline = new DateTime(2018, 10, 15);
+            System.DateTimeOffset Deadline = new DateTime(2018, 12, 25);

             if (System.DateTimeOffset.Now > Deadline)
                 throw new Exception("Source is out of date. Please update.");


Category Api Created For Adding And Editing

--- Trappist/src/Promact.Trappist.Core/Controllers/CategoryController.cs
+++ Trappist/src/Promact.Trappist.Core/Controllers/CategoryController.cs
@@ -21,6 +21,53 @@
         {
             var categoryList = _categoryRepository.GetAllCategories();
             return Ok(categoryList);
+        }
+        #region post Method
+        [HttpPost]
+        /// <summary>
+        /// Post Method
+        /// Will Add a Catagory Name in Category Model
+        ///</summary>
+        /// <param name="category">Object of  class Category</param>
+        /// <returns>object of the class </returns>
+        public IActionResult CatagoryAdd([FromBody] Category category)
+        {
+            if (!ModelState.IsValid)
+            {
+                return BadRequest(ModelState);
+            }
+            _categoryRepository.AddCategory(category);
+            return Ok(category);
+        }
+        #endregion
+
+        #region PutMethod
+        /// <summary>
+        /// Put Method
+        /// Will Edit a Existing Category from Category Table
+        /// </summary>
+        /// <param name="Id">Id is the primary key of Category Model</param>
+        /// <param name="catagory">Object of  class Category</param>
+        /// <returns>object of the class if key found or else it will return Bad request</returns>
+        [HttpPut("{id}")]
+        public IActionResult CategoryEdit(int Id, [FromBody] Category category)
+        {
+            if (!ModelState.IsValid)
+            {
+                return BadRequest(ModelState);
+            }
+            var promise = _categoryRepository.Getcategory(Id);
+            if (promise == null)
+            {
+                return BadRequest();
+            }
+            else
+            {
+                promise.CategoryName = category.CategoryName;
+                _categoryRepository.CategoryEdit(promise);
+                return Ok(category);
+            }
+            #endregion
         }

         #region post Method


optimize named pipe manager

optimize named pipe manager

--- TwitchLeecher/TwitchLeecher.Shared/Communication/NamedPipeManager.cs
+++ TwitchLeecher/TwitchLeecher.Shared/Communication/NamedPipeManager.cs
@@ -2,6 +2,7 @@
 using System.IO;
 using System.IO.Pipes;
 using System.Threading;
+using System.Threading.Tasks;

 namespace TwitchLeecher.Shared.Communication
 {
@@ -17,9 +18,11 @@

         private readonly string _pipeName;

-        private bool _isRunning;
+        private bool _started;

-        private Thread _worker;
+        private Task _worker;
+
+        private CancellationTokenSource _cancellationTokenSource;

         #endregion Fields

@@ -47,46 +50,64 @@

         public void StartServer()
         {
-            _worker = new Thread((pipeName) =>
+            if (!_started)
             {
-                _isRunning = true;
+                _started = true;

-                while (true)
+                _cancellationTokenSource = new CancellationTokenSource();
+
+                CancellationToken cancellationToken = _cancellationTokenSource.Token;
+
+                _worker = Task.Run(() =>
                 {
-                    string text;
+                    while (true)
+                    {
+                        string text;

-                    using (NamedPipeServerStream server = new NamedPipeServerStream(pipeName as string))
-                    {
-                        server.WaitForConnection();
+                        using (NamedPipeServerStream server = new NamedPipeServerStream(_pipeName))
+                        {
+                            server.WaitForConnection();

-                        using (StreamReader reader = new StreamReader(server))
+                            using (StreamReader reader = new StreamReader(server))
+                            {
+                                text = reader.ReadToEnd();
+                            }
+                        }
+
+                        if (text == SHUTDOWN_MESSAGE)
                         {
-                            text = reader.ReadToEnd();
+                            break;
+                        }
+
+                        OnMessage?.Invoke(text);
+
+                        if (cancellationToken.IsCancellationRequested)
+                        {
+                            break;
                         }
                     }
-
-                    if (text == SHUTDOWN_MESSAGE)
-                    {
-                        break;
-                    }
-
-                    OnMessage?.Invoke(text);
-
-                    if (_isRunning == false)
-                    {
-                        break;
-                    }
-                }
-            });
-
-            _worker.Start(_pipeName);
+                }, cancellationToken);
+            }
         }

         public void StopServer()
         {
-            _isRunning = false;
-            Write(SHUTDOWN_MESSAGE);
-            Thread.Sleep(100);
+            if (_started)
+            {
+                _started = false;
+
+                if (_cancellationTokenSource != null)
+                {
+                    _cancellationTokenSource.Cancel();
+                }
+
+                Write(SHUTDOWN_MESSAGE);
+
+                if (_worker != null)
+                {
+                    _worker.Wait();
+                }
+            }
         }

         public bool Write(string text, int connectTimeout = 300)


Adding attributed text for profile percentage.

--- XamarinApp/MyTrips/MyTrips.iOS/Screens/ProfileTableViewController.cs
+++ XamarinApp/MyTrips/MyTrips.iOS/Screens/ProfileTableViewController.cs
@@ -9,5 +9,32 @@
         public ProfileTableViewController (IntPtr handle) : base (handle)
         {
         }
+
+		public override void ViewDidLoad()
+		{
+			base.ViewDidLoad();
+
+			//UpdateHeader(64);
+		}
+
+		void UpdateHeader(int percentage)
+		{
+			lblPercentage.Text = $"{percentage}%";
+			lblBetterThan.Text = $"Better driver than {percentage} of Americans";
+
+			var defaultAttributes = new UIStringAttributes {
+				ForegroundColor = lblBetterThan.TextColor,
+			};
+
+			var hitAttributes = new UIStringAttributes {
+				ForegroundColor = Colors.PRIMARY,
+			};
+
+			var attributedString = new NSMutableAttributedString (lblBetterThan.Text);
+			attributedString.SetAttributes(defaultAttributes.Dictionary, new NSRange(0, lblBetterThan.Text.Length));
+			attributedString.SetAttributes(hitAttributes.Dictionary, new NSRange(15, lblBetterThan.Text.Length));
+
+			lblBetterThan.AttributedText = attributedString;
+		}
     }
 }


Flag was reversed

Flag was reversed

--- relmah/src/RElmah/Middleware/Bootstrapping/Bootstrapper.cs
+++ relmah/src/RElmah/Middleware/Bootstrapping/Bootstrapper.cs
@@ -41,7 +41,7 @@

             var bqf = new Queries.Backend.QueriesFactory(fei, ebl, dh, dh, ben,
                 () => new ErrorsBusQuery(),
-                () => new ConfigurationBusQuery(settings.Side == Side.Backend));
+                () => new ConfigurationBusQuery(settings.Side == Side.Frontend));

             //Infrastructure
             registry.Register(typeof(IErrorsBacklog),          () => ebl);


Don't create git branch when renamed branch!

--- GitTfs/Commands/InitBranch.cs
+++ GitTfs/Commands/InitBranch.cs
@@ -123,7 +123,7 @@
                 tfsRemote = CreateBranch(defaultRemote, cbd.TfsRepositoryPath, cbd.Sha1RootCommit, cbd.GitBranchNameExpected);
                 RemoteCreated = tfsRemote;
                 if (rootBranch.IsRenamedBranch || !NoFetch)
-                    fetchResult = FetchRemote(tfsRemote, false, !DontCreateGitBranch);
+                    fetchResult = FetchRemote(tfsRemote, false, !DontCreateGitBranch && !rootBranch.IsRenamedBranch);
                 else
                     Trace.WriteLine("Not fetching changesets, --no-fetch option specified");
             }
@@ -316,7 +316,7 @@
                 var fetchResult = tfsRemote.Fetch(stopOnFailMergeCommit);
                 Trace.WriteLine("Changesets fetched!");

-                if (createBranch && fetchResult.IsSuccess && tfsRemote.Id != GitTfsConstants.DefaultRepositoryId)
+                if (fetchResult.IsSuccess && createBranch && tfsRemote.Id != GitTfsConstants.DefaultRepositoryId)
                 {
                     Trace.WriteLine("Try creating the local branch...");
                     if (!_globals.Repository.CreateBranch("refs/heads/" + tfsRemote.Id, tfsRemote.MaxCommitHash))


Fix for working with CellTemplateColumn and Selected.CellItem

--- Gu.Wpf.DataGrid2D/Selected.cs
+++ Gu.Wpf.DataGrid2D/Selected.cs
@@ -271,7 +271,11 @@
             var binding = (column as DataGridBoundColumn)?.Binding as Binding;
             if (binding == null)
             {
-                return null;
+                binding = (column as CellTemplateColumn)?.Binding as Binding;
+                if (binding == null)
+                {
+                    return null;
+                }
             }

             descriptor = TypeDescriptor.GetProperties(item)


Make save changes button more prominent

Make save changes button more prominent

--- osu.Game.Tournament/TournamentGameBase.cs
+++ osu.Game.Tournament/TournamentGameBase.cs
@@ -22,6 +22,7 @@
 using osu.Game.Tournament.IPC;
 using osu.Game.Tournament.Models;
 using osu.Game.Users;
+using osuTK;
 using osuTK.Graphics;
 using osuTK.Input;

@@ -74,16 +75,40 @@

             AddRange(new[]
             {
-                new TourneyButton
-                {
-                    Text = "Save Changes",
-                    Width = 140,
-                    Height = 50,
+                new Container
+                {
+                    CornerRadius = 10,
                     Depth = float.MinValue,
+                    Position = new Vector2(5),
+                    Masking = true,
+                    AutoSizeAxes = Axes.Both,
                     Anchor = Anchor.BottomRight,
                     Origin = Anchor.BottomRight,
-                    Padding = new MarginPadding(10),
-                    Action = SaveChanges,
+                    Children = new Drawable[]
+                    {
+                        new Box
+                        {
+                            Colour = OsuColour.Gray(0.2f),
+                            RelativeSizeAxes = Axes.Both,
+                        },
+                        new TourneyButton
+                        {
+                            Text = "Save Changes",
+                            Width = 140,
+                            Height = 50,
+                            Padding = new MarginPadding
+                            {
+                                Top = 10,
+                                Left = 10,
+                            },
+                            Margin = new MarginPadding
+                            {
+                                Right = 10,
+                                Bottom = 10,
+                            },
+                            Action = SaveChanges,
+                        },
+                    }
                 },
                 heightWarning = new Container
                 {


fix bug

fix bug

--- RapidBase/RapidBaseListener.cs
+++ RapidBase/RapidBaseListener.cs
@@ -271,7 +271,12 @@
                     _Indexer.IndexOrderedBalance(tx);
                     RunTask("New transaction", () =>
                     {
-                        _Indexer.Index(OrderedBalanceChange.ExtractWalletBalances(txId, tx, null, null, int.MaxValue, _Wallets));
+                        var balances =
+                            OrderedBalanceChange
+                            .ExtractWalletBalances(txId, tx, null, null, int.MaxValue, _Wallets)
+                            .GroupBy(b=>b.PartitionKey);
+                        foreach(var b in balances)
+                            _Indexer.Index(b);
                     }, true);
                 }, false);
             }


android/profile: removed try/catch used for debugging

--- Solitude.Droid/Activities/ProfileActivity.cs
+++ Solitude.Droid/Activities/ProfileActivity.cs
@@ -98,55 +98,45 @@
 		private void SetupUI()
 		{
             // add profile to activity
-            try
-            {
-                var profile = LayoutInflater.Inflate(Resource.Layout.Profile, null);
-                Content.AddView(profile);
-
-                var picture = profile.FindViewById<ImageView>(Resource.Id.Image);
-                var name = profile.FindViewById<TextView>(Resource.Id.Name);
-                var address = profile.FindViewById<TextView>(Resource.Id.Address);
-                var age = profile.FindViewById<TextView>(Resource.Id.Age);
-                var layout = profile.FindViewById<LinearLayout>(Resource.Id.Layout);
-
-                var edit = profile.FindViewById<FloatingActionButton>(Resource.Id.fab_edit_profile);
-
-                cardFood = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
-                cardInterest = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
-                cardLanguage = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
-
-                profileContent = profile.FindViewById<LinearLayout>(Resource.Id.profile_content);
-
-                //var adapter = new InfoAdapter(this, Info);
-                //var tilemenu = new InfoList(this, adapter);
-
-                //layout.AddView(tilemenu);
-
-                name.SetTypeface(null, TypefaceStyle.Bold);
-                name.TextSize = 20;
-                name.Text = User.Name;
-
-                address.Text = User.Address;
-                DateTime today = DateTime.Today;
-                int iAge = today.Year - User.Birthdate.Year;
-                if (User.Birthdate > today.AddYears(-iAge))
-                    iAge--;
-                age.Text = iAge + Resources.GetString(Resource.String.year_old);
-
-                edit.Click += EditProfile;
-
-                ProfileCreateCard(InfoType.Language, cardLanguage, "Speaks");
-                ProfileCreateCard(InfoType.Interest, cardInterest, "Likes");
-                ProfileCreateCard(InfoType.FoodHabit, cardFood, "Prefers");
-
-            }
-            catch (System.Exception e)
-            {
-                string s = e.StackTrace;
-                System.Console.WriteLine(s);
-                e.ToString();
-            }
-		}
+            var profile = LayoutInflater.Inflate(Resource.Layout.Profile, null);
+            Content.AddView(profile);
+
+            var picture = profile.FindViewById<ImageView>(Resource.Id.Image);
+            var name = profile.FindViewById<TextView>(Resource.Id.Name);
+            var address = profile.FindViewById<TextView>(Resource.Id.Address);
+            var age = profile.FindViewById<TextView>(Resource.Id.Age);
+            var layout = profile.FindViewById<LinearLayout>(Resource.Id.Layout);
+
+            var edit = profile.FindViewById<FloatingActionButton>(Resource.Id.fab_edit_profile);
+
+            cardFood = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
+            cardInterest = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
+            cardLanguage = LayoutInflater.Inflate(Resource.Layout.ProfileInformationCard, null);
+
+            profileContent = profile.FindViewById<LinearLayout>(Resource.Id.profile_content);
+
+            //var adapter = new InfoAdapter(this, Info);
+            //var tilemenu = new InfoList(this, adapter);
+
+            //layout.AddView(tilemenu);
+
+            name.SetTypeface(null, TypefaceStyle.Bold);
+            name.TextSize = 20;
+            name.Text = User.Name;
+
+            address.Text = User.Address;
+            DateTime today = DateTime.Today;
+            int iAge = today.Year - User.Birthdate.Year;
+            if (User.Birthdate > today.AddYears(-iAge))
+                iAge--;
+            age.Text = iAge + Resources.GetString(Resource.String.year_old);
+
+            edit.Click += EditProfile;
+
+            ProfileCreateCard(InfoType.Language, cardLanguage, "Speaks");
+            ProfileCreateCard(InfoType.Interest, cardInterest, "Likes");
+            ProfileCreateCard(InfoType.FoodHabit, cardFood, "Prefers");
+        }

         private void ProfileCreateCard(InfoType type, View card, string subtitle)
         {
@@ -171,7 +161,7 @@

                 foreach (var item in input)
                 {
-                    if (compares.Contains(item.ToLower())) // Smart way to see if array contains an item
+                    if (compares.Contains(item.ToLower()))
                     {
                         AddCardEntry(content, item);
                     }
@@ -238,7 +228,7 @@

                 var content = item.FindViewById<LinearLayout>(Resource.Id.profile_card_entry);
                 var childCount = content.ChildCount;
-
+
                 for (int i = 0; i < childCount; i++)
                 {
                     var entry = content.GetChildAt(i);


proper sorting of updates

proper sorting of updates

--- Solutionizer/Infrastructure/UpdateManager.cs
+++ Solutionizer/Infrastructure/UpdateManager.cs
@@ -29,6 +29,7 @@
             _reader = new GithubReleaseProvider(settings);

             _releases = LoadReleases();
+            _releases.Sort((r1, r2) => r2.Version.CompareTo(r1.Version));
             _releases.ForEach(r => r.IsNew = r.Version > _currentVersion);
         }

@@ -48,6 +49,7 @@
             }

             _releases.AddRange(newReleases);
+            _releases.Sort((r1, r2) => r2.Version.CompareTo(r1.Version));
             _releases.ForEach(r => r.IsNew = r.Version > _currentVersion);
             SaveReleases();
             if (_releases.Any(r => r.IsNew)) {


also simplify solution tree

also simplify solution tree

--- Solutionizer/ViewModels/SolutionViewModel.cs
+++ Solutionizer/ViewModels/SolutionViewModel.cs
@@ -1,11 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Specialized;
-using System.IO;
 using System.Linq;
 using System.Windows.Input;
 using GalaSoft.MvvmLight;
-using Solutionizer.Helper;
 using Solutionizer.Infrastructure;
 using Solutionizer.Models;
 using Solutionizer.VisualStudio;
@@ -119,8 +117,7 @@
                     continue;
                 }

-                var relPath = GetRelativeFolder(referencedProject);
-                var folder = GetSolutionFolder(relPath);
+                var folder = GetSolutionFolder(referencedProject);
                 if (!folder.ContainsProject(referencedProject)) {
                     folder.AddProject(referencedProject);

@@ -131,14 +128,17 @@
             }
         }

-        private string GetRelativeFolder(Project project) {
-            return FileSystem.GetRelativePath(_rootPath, Path.GetDirectoryName(project.Filepath));
-        }
+        private SolutionFolder GetSolutionFolder(Project project) {
+            // get chain of folders from root to project
+            var folderNames = new List<string>();
+            var projectFolder = project.Parent;
+            while (projectFolder.Parent != null) {
+                folderNames.Add(projectFolder.Name);
+                projectFolder = projectFolder.Parent;
+            }
+            folderNames.Reverse();

-        private SolutionFolder GetSolutionFolder(string path) {
             var folder = GetOrCreateReferenceFolder();
-            var folderNames = path.Split('\\');
-            folderNames = folderNames.Take(folderNames.Length - 1).ToArray();
             foreach (var folderName in folderNames) {
                 folder = folder.GetOrCreateSubfolder(folderName);
             }


[ci skip] Updating ServerBuildInfo_Dynamic.cs

1.25.3943.20210610213308-master-c7dc408

--- Source/ACE.Server/ServerBuildInfo_Dynamic.cs
+++ Source/ACE.Server/ServerBuildInfo_Dynamic.cs
@@ -4,17 +4,17 @@
     public static partial class ServerBuildInfo
     {
         public static string Branch = "master";
-        public static string Commit = "79cf7dffe658c3e19865854d18b2ace72d3b9c98";
+        public static string Commit = "c7dc4081d1c9de6dc421626f4ce51e6264344cb9";

         public static string Version = "1.25";
-        public static string Build   = "3942";
+        public static string Build   = "3943";

         public static int BuildYear   = 2021;
         public static int BuildMonth  = 06;
         public static int BuildDay    = 10;
         public static int BuildHour   = 21;
-        public static int BuildMinute = 21;
-        public static int BuildSecond = 30;
+        public static int BuildMinute = 33;
+        public static int BuildSecond = 08;
     }
 }


[ci skip] Updating ServerBuildInfo_Dynamic.cs

1.37.4169.20220210053858-master-9183510

--- Source/ACE.Server/ServerBuildInfo_Dynamic.cs
+++ Source/ACE.Server/ServerBuildInfo_Dynamic.cs
@@ -4,17 +4,17 @@
     public static partial class ServerBuildInfo
     {
         public static string Branch = "master";
-        public static string Commit = "9dad7c222c4337acfa311261ca52c8b1feb9ac47";
+        public static string Commit = "918351082df4dd216780eae4abcb8cb336760c66";

         public static string Version = "1.37";
-        public static string Build   = "4168";
+        public static string Build   = "4169";

         public static int BuildYear   = 2022;
         public static int BuildMonth  = 02;
-        public static int BuildDay    = 08;
+        public static int BuildDay    = 10;
         public static int BuildHour   = 05;
-        public static int BuildMinute = 03;
-        public static int BuildSecond = 56;
+        public static int BuildMinute = 38;
+        public static int BuildSecond = 58;
     }
 }


[ci skip] Updating ServerBuildInfo_Dynamic.cs

1.10.3547.20200827000134-master-7f29993

--- Source/ACE.Server/ServerBuildInfo_Dynamic.cs
+++ Source/ACE.Server/ServerBuildInfo_Dynamic.cs
@@ -4,17 +4,17 @@
     public static partial class ServerBuildInfo
     {
         public static string Branch = "master";
-        public static string Commit = "cd1de318f2d935b57c64c6a5a0243ac34a598f38";
+        public static string Commit = "7f29993162468676b0c733dba1dffe1e7f3a6cc4";

         public static string Version = "1.10";
-        public static string Build   = "3546";
+        public static string Build   = "3547";

         public static int BuildYear   = 2020;
         public static int BuildMonth  = 08;
-        public static int BuildDay    = 26;
-        public static int BuildHour   = 23;
-        public static int BuildMinute = 51;
-        public static int BuildSecond = 15;
+        public static int BuildDay    = 27;
+        public static int BuildHour   = 00;
+        public static int BuildMinute = 01;
+        public static int BuildSecond = 34;
     }
 }


DateTime::createFromFormat, date_create_from_format stubs
- needs to be implemented

git-tfs-id: [http://falcon:8080/tfs/Projects]$/Phalanger/Main;C3677

--- Source/ClassLibrary/DateTime.CLR/DateTime.cs
+++ Source/ClassLibrary/DateTime.CLR/DateTime.cs
@@ -266,6 +266,83 @@
             stack.RemoveFrame();

             return ((__PHP__DateTime)instance).modify(stack.Context, modify);
+        }
+
+        [ImplementsMethod]
+        public static object createFromFormat(ScriptContext/*!*/context, object format, object time, [Optional]object timezone)
+        {
+            // arguments
+            var tz = (timezone is DateTimeZone) ? ((DateTimeZone)timezone).timezone : PhpTimeZone.CurrentTimeZone;
+            string formatstr = PhpVariable.AsString(format);
+            string timestr = PhpVariable.AsString(time);
+
+            if (formatstr == null)
+            {
+                PhpException.InvalidArgument("format");
+                return false;
+            }
+
+            if (timestr == null)
+            {
+                PhpException.InvalidArgument("time");
+                return false;
+            }
+
+            // create DateTime from format+time
+            int i = 0;  // position in <timestr>
+            foreach (var c in formatstr)
+            {
+                switch (c)
+                {
+                    //case 'd':
+                    //case 'j':
+                    //    var day = PHP.Library.StrToTime.DateInfo.ParseUnsignedInt(timestr, ref i, 2);
+                    //    // ... use day
+                    //    break;
+                    //case 'F':
+                    //case 'M':
+                    //    // parse  ...
+                    //    break;
+                    default:
+                        if (i < timestr.Length && timestr[i] == c)
+                        {
+                            // match
+                            i++;
+                        }
+                        else
+                        {
+                            // not match
+                            PhpException.InvalidArgument("time");   // time not matching format
+                            return false;
+                        }
+                        break;
+                }
+            }
+
+            if (i < timestr.Length)
+            {
+                PhpException.InvalidArgument("time");   // time not matching format
+                return false;
+            }
+
+            ////
+            //return new __PHP__DateTime(context, true)
+            //{
+            //     //Time = new DateTime(year, month, day, hour, minute, second, millisecond),
+            //     TimeZone = tz,
+            //};
+
+            throw new NotImplementedException();
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static object createFromFormat(object instance, PhpStack stack)
+        {
+            var format = stack.PeekValue(1);
+            var time = stack.PeekValue(2);
+            var timezone = stack.PeekValueOptional(3);
+            stack.RemoveFrame();
+            return createFromFormat(stack.Context, format, time, timezone);
         }

         #endregion
@@ -368,6 +445,33 @@
             var dt = new __PHP__DateTime(context, true);
             dt.__construct(context, time, timezone);
             return dt;
+        }
+
+        /// <summary>
+        /// Returns new DateTime object formatted according to the specified format.
+        /// </summary>
+        /// <param name="format">The format that the passed in string should be in.</param>
+        /// <param name="time">String representing the time.</param>
+        /// <returns></returns>
+        [ImplementsFunction("date_create_from_format")]
+        [return: CastToFalse]
+        public static __PHP__DateTime DateCreateFromFormat(ScriptContext/*!*/context, string format, string time)
+        {
+            return __PHP__DateTime.createFromFormat(context, format, time, Arg.Default) as __PHP__DateTime;
+        }
+
+        /// <summary>
+        /// Returns new DateTime object formatted according to the specified format.
+        /// </summary>
+        /// <param name="format">The format that the passed in string should be in.</param>
+        /// <param name="time">String representing the time.</param>
+        /// <param name="timezone">A DateTimeZone object representing the desired time zone.</param>
+        /// <returns></returns>
+        [ImplementsFunction("date_create_from_format")]
+        [return:CastToFalse]
+        public static __PHP__DateTime DateCreateFromFormat(ScriptContext/*!*/context, string format, string time, DateTimeZone timezone)
+        {
+            return __PHP__DateTime.createFromFormat(context, format, time, timezone) as __PHP__DateTime;
         }

         /// <summary>


Update AccumulativeInsightFrameworkAlgorithm stats

--- Algorithm.CSharp/AccumulativeInsightFrameworkAlgorithm.cs
+++ Algorithm.CSharp/AccumulativeInsightFrameworkAlgorithm.cs
@@ -77,21 +77,21 @@
             {"Total Trades", "199"},
             {"Average Win", "0.00%"},
             {"Average Loss", "0.00%"},
-            {"Compounding Annual Return", "-11.359%"},
+            {"Compounding Annual Return", "-12.485%"},
             {"Drawdown", "0.200%"},
-            {"Expectancy", "-0.562"},
-            {"Net Profit", "-0.154%"},
-            {"Sharpe Ratio", "-9.104"},
+            {"Expectancy", "-0.586"},
+            {"Net Profit", "-0.170%"},
+            {"Sharpe Ratio", "-10.106"},
             {"Loss Rate", "79%"},
             {"Win Rate", "21%"},
-            {"Profit-Loss Ratio", "1.07"},
-            {"Alpha", "-0.112"},
+            {"Profit-Loss Ratio", "0.95"},
+            {"Alpha", "-0.12"},
             {"Beta", "0.037"},
             {"Annual Standard Deviation", "0.008"},
             {"Annual Variance", "0"},
-            {"Information Ratio", "-5.353"},
+            {"Information Ratio", "-5.392"},
             {"Tracking Error", "0.212"},
-            {"Treynor Ratio", "-2.003"},
+            {"Treynor Ratio", "-2.224"},
             {"Total Fees", "$199.00"},
             {"Total Insights Generated", "100"},
             {"Total Insights Closed", "99"},
@@ -99,13 +99,13 @@
             {"Long Insight Count", "100"},
             {"Short Insight Count", "0"},
             {"Long/Short Ratio", "100%"},
-            {"Estimated Monthly Alpha Value", "$158418.3850"},
-            {"Total Accumulated Estimated Alpha Value", "$25522.9620"},
-            {"Mean Population Estimated Insight Value", "$257.8077"},
-            {"Mean Population Direction", "54.5455%"},
-            {"Mean Population Magnitude", "54.5455%"},
-            {"Rolling Averaged Population Direction", "59.8056%"},
-            {"Rolling Averaged Population Magnitude", "59.8056%"}
+            {"Estimated Monthly Alpha Value", "$246137.8427"},
+            {"Total Accumulated Estimated Alpha Value", "$39655.5413"},
+            {"Mean Population Estimated Insight Value", "$400.561"},
+            {"Mean Population Direction", "53.5354%"},
+            {"Mean Population Magnitude", "53.5354%"},
+            {"Rolling Averaged Population Direction", "59.0771%"},
+            {"Rolling Averaged Population Magnitude", "59.0771%"}
         };
     }
 }


Increased timeout to wait for test

Increased timeout to wait for test

--- GridDomain.Domain.Tests/MessageWaiting/Local/AkkaWaiter_messages_test_A_and_B_or_C_and_D.cs
+++ GridDomain.Domain.Tests/MessageWaiting/Local/AkkaWaiter_messages_test_A_and_B_or_C_and_D.cs
@@ -19,7 +19,7 @@
                          .And<Message>(m => m.Id == _messageB.Id)
                          .Or<Message>(m => m.Id == _messageC.Id)
                          .And<Message>(m => m.Id == _messageD.Id)
-                         .Create(TimeSpan.FromMilliseconds(100));
+                         .Create(TimeSpan.FromMilliseconds(200));
         }

         [Test]


Added skip rows parameter to CSV input adapter.

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

--- Source/OldCode/TimeSeriesFramework/Source/Libraries/Adapters/CsvAdapters/CsvInputAdapter.cs
+++ Source/OldCode/TimeSeriesFramework/Source/Libraries/Adapters/CsvAdapters/CsvInputAdapter.cs
@@ -53,6 +53,7 @@
         private readonly Dictionary<int, IMeasurement> m_columnMappings;
         private double m_inputInterval;
         private int m_measurementsPerInterval;
+        private int m_skipRows;
         private bool m_simulateTimestamp;
         private bool m_transverse;
         private bool m_autoRepeat;
@@ -138,6 +139,24 @@
         }

         /// <summary>
+        /// Gets or sets number of lines to skip in the source file before the header line is encountered.
+        /// </summary>
+        [ConnectionStringParameter,
+        Description("Define the number of lines to skip in the source file before the header line is encountered."),
+        DefaultValue(0)]
+        public int SkipRows
+        {
+            get
+            {
+                return m_skipRows;
+            }
+            set
+            {
+                m_skipRows = value;
+            }
+        }
+
+        /// <summary>
         /// Gets or sets flag that determines if a high-resolution precision timer should be used for CSV file based input.
         /// </summary>
         /// <remarks>
@@ -268,6 +287,9 @@
                 status.AppendLine();
                 status.AppendFormat("     Precision input timer: {0}", UseHighResolutionInputTimer ? "Enabled" : "Offline");
                 status.AppendLine();
+                status.AppendFormat("             Lines to skip: {0}", m_skipRows);
+                status.AppendLine();
+
                 if (m_precisionTimer != null)
                 {
                     status.AppendFormat("  Timer resynchronizations: {0}", m_precisionTimer.Resynchronizations);
@@ -366,6 +388,12 @@
             if (settings.TryGetValue("autoRepeat", out setting))
                 m_autoRepeat = setting.ParseBoolean();

+            if (settings.TryGetValue("skipRows", out setting))
+                int.TryParse(setting, out m_skipRows);
+
+            if (m_skipRows < 0)
+                m_skipRows = 0;
+
             settings.TryGetValue("useHighResolutionInputTimer", out setting);

             if (string.IsNullOrEmpty(setting))
@@ -475,6 +503,12 @@
         {
             m_inStream = new StreamReader(m_fileName);

+            // Skip specified number of header lines that exist before column heading definitions
+            for (int i = 0; i < m_skipRows; i++)
+            {
+                m_inStream.ReadLine();
+            }
+
             m_header = m_inStream.ReadLine();

             string[] headings = m_header.ToNonNullString().Split(',');


Update TestHelpers to support running under NCrunch

--- test/Glob.Tests/TestHelpers.cs
+++ test/Glob.Tests/TestHelpers.cs
@@ -7,8 +7,16 @@
 {
     public static class TestHelpers
     {
-        public static readonly string SourceRoot = Environment.GetEnvironmentVariable("APPVEYOR_BUILD_FOLDER") ?? Path.Combine("..", "..", "..", "..", "..");
+        private static readonly string NCrunchSourceRoot = Environment.GetEnvironmentVariable("NCrunch") == "1"
+            ? Path.GetDirectoryName(Environment.GetEnvironmentVariable("NCrunch.OriginalSolutionPath"))
+            : null;
+
+        public static readonly string SourceRoot = Environment.GetEnvironmentVariable("APPVEYOR_BUILD_FOLDER")
+                                                   ?? NCrunchSourceRoot
+                                                   ?? Path.Combine("..", "..", "..", "..", "..");
+
         public static readonly string FileSystemRoot =
             RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows ? "c:\\" : "/";
+
     }
 }


Change Azure.Identity tracing namespace to Microsoft.AAD (#11857)


Update BaseGalleryViewModel.cs

Update BaseGalleryViewModel.cs

--- samples/XCT.Sample/ViewModels/Base/BaseGalleryViewModel.cs
+++ samples/XCT.Sample/ViewModels/Base/BaseGalleryViewModel.cs
@@ -13,8 +13,6 @@
 			Filter();
 			FilterCommand = CommandFactory.Create(Filter);
 		}
-
-		public ICommand FilterCommand => filterCommand ??= new Command(Filter);

 		public IReadOnlyList<SectionModel> Items { get; }


Disable Browser Click Sound

Disable Browser Click Sound

* Also, reset Browser location on RefreshBrowser only if AppliesStyleSheet is enabled


modifying the driver a little

modifying the driver a little


Adding changes to make some of the tests pass.

--- eFormCore/Infrastructure/Data/Entities/PnBase.cs
+++ eFormCore/Infrastructure/Data/Entities/PnBase.cs
@@ -1,5 +1,7 @@
 using System;
+using System.Linq;
 using System.Reflection;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;

 namespace Microting.eForm.Infrastructure.Data.Entities
@@ -13,14 +15,14 @@
             Version = 1;
             WorkflowState = Constants.Constants.WorkflowStates.Created;

-            await dbContext.AddAsync(this);
-            await dbContext.SaveChangesAsync();
+            await dbContext.AddAsync(this).ConfigureAwait(false);
+            await dbContext.SaveChangesAsync().ConfigureAwait(false);

             var res = MapVersion(this);
             if (res != null)
             {
-                await dbContext.AddAsync(res);
-                await dbContext.SaveChangesAsync();
+                await dbContext.AddAsync(res).ConfigureAwait(false);
+                await dbContext.SaveChangesAsync().ConfigureAwait(false);
             }
         }

@@ -51,8 +53,8 @@
                 var res = MapVersion(this);
                 if (res != null)
                 {
-                    await dbContext.AddAsync(res);
-                    await dbContext.SaveChangesAsync();
+                    await dbContext.AddAsync(res).ConfigureAwait(false);
+                    await dbContext.SaveChangesAsync().ConfigureAwait(false);
                 }
             }
         }
@@ -61,7 +63,7 @@
         {
             Type type = obj.GetType().UnderlyingSystemType;
             String className = type.Name;
-            var name = obj.GetType().FullName + "Version";
+            var name = obj.GetType().FullName.Remove(obj.GetType().FullName.Length - 1) + "_versions";
             var resultType = Assembly.GetExecutingAssembly().GetType(name);
             if (resultType == null)
                 return null;
@@ -86,7 +88,7 @@
                         } else {
                             var propValue = prop.GetValue(obj);
                             Type targetType = returnObj.GetType();
-                            PropertyInfo targetProp = targetType.GetProperty($"{className}Id");
+                            PropertyInfo targetProp = targetType.GetProperty($"{FirstCharToUpper(className.Remove(className.Length - 1))}Id");

                             targetProp.SetValue(returnObj, propValue, null);
                         }
@@ -100,5 +102,18 @@

             return returnObj;
         }
+
+        private static string FirstCharToUpper(string input)
+        {
+            string pattern = @"_.";
+            Regex rg = new Regex(pattern);
+            MatchCollection matches = rg.Matches(input);
+            if (matches.Any())
+            {
+                input = input.Replace(matches.First().Value, matches.First().Value.Replace("_", "").ToUpper());
+            }
+
+            return input.First().ToString().ToUpper() + input.Substring(1);
+        }
     }
 }


Applies patch #146 from mcortez, fixes asset encoding for notecards.

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1647 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/AssetTypes.cs
+++ libsecondlife/AssetTypes.cs
@@ -67,16 +67,25 @@

         public AssetNotecard() { }

-        public AssetNotecard(byte[] assetData) : base(assetData) { }
+        public AssetNotecard(byte[] assetData) : base(assetData)
+        {
+            Decode();
+        }

         public AssetNotecard(string text)
         {
             Text = text;
+            Encode();
         }

         public override void Encode()
         {
-            AssetData = Helpers.StringToField(Text);
+
+            string temp = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length ";
+            temp += Text.Length + "\n";
+            temp += Text;
+            temp += "}";
+            AssetData = Helpers.StringToField(temp);
         }

         public override bool Decode()