Parse errors and warnings in rustc task.

--- VisualRust.Build/Rustc.cs
+++ VisualRust.Build/Rustc.cs
@@ -6,12 +6,15 @@
 using System.Text;
 using System.IO;
 using System.Threading.Tasks;
+using System.Text.RegularExpressions;

 namespace VisualRust.Build
 {
-    // TODO: Properly log errors and warnings
     public class Rustc : Microsoft.Build.Utilities.Task
     {
+        private static readonly Regex defectRegex = new Regex(@"^([^:^]+):(\d+):(\d+):\s+(\d+):(\d+)\s+(.*)$", RegexOptions.Multiline | RegexOptions.CultureInvariant);
+        private static readonly Regex errorCodeRegex = new Regex(@"\[[A-Z]\d\d\d\d\]$", RegexOptions.CultureInvariant);
+
         private string[] libPaths = new string[0];
         /// <summary>
         /// Sets -L option.
@@ -157,7 +160,7 @@
             }
             catch (Exception ex)
             {
-                this.Log.LogErrorFromException(ex, true, true, null);
+                this.Log.LogErrorFromException(ex, true);
                 return false;
             }
         }
@@ -206,27 +209,66 @@
                 UseShellExecute = false,
                 WorkingDirectory = WorkingDirectory,
                 Arguments = sb.ToString(),
-                RedirectStandardError = true,
-                RedirectStandardOutput = true
+                RedirectStandardError = true
             };
             try
             {
                 Process process = Process.Start(psi);
                 process.WaitForExit();
-                string output = process.StandardOutput.ReadToEnd();
-                this.Log.LogMessagesFromStream(process.StandardOutput, MessageImportance.Normal);
-                this.Log.LogError(process.StandardError.ReadToEnd());
-                if (process.ExitCode != 0)
+                string errorOutput = process.StandardError.ReadToEnd();
+                MatchCollection errorMatches = defectRegex.Matches(errorOutput);
+                // We found some warning or errors in the output, print them out
+                foreach(Match match in errorMatches)
                 {
-                    this.Log.LogError(process.StandardError.ReadToEnd());
+                    LogParsedDefect(match);
+                }
+                // rustc failed but we couldn't sniff anything from stderr, probabaly internal error
+                if (process.ExitCode != 0 && errorMatches.Count == 0)
+                {
+                    this.Log.LogError(errorOutput);
                     return false;
                 }
-                return true;
+                return process.ExitCode == 0;
             }
             catch(Exception ex)
             {
-                Log.LogErrorFromException(ex);
+                Log.LogErrorFromException(ex, true);
                 return false;
+            }
+        }
+
+        private void LogParsedDefect(Match match)
+        {
+            Match errorMatch = errorCodeRegex.Match(match.Groups[6].Value);
+            string errorCode = errorMatch.Success ? errorMatch.Groups[0].Value : null;
+            if (match.Groups[6].Value.StartsWith("warning: "))
+            {
+                string msg = match.Groups[6].Value.Substring(9, match.Groups[6].Value.Length - 9 - (errorCode != null ? 8 : 0));
+                this.Log.LogWarning(
+                    null,
+                    errorCode,
+                    null,
+                    match.Groups[1].Value,
+                    Int32.Parse(match.Groups[2].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[3].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[4].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[5].Value, System.Globalization.NumberStyles.None),
+                    msg);
+            }
+            else
+            {
+                bool startsWithError = match.Groups[6].Value.StartsWith("error: ");
+                string msg = match.Groups[6].Value.Substring((startsWithError ? 7 : 0), match.Groups[6].Value.Length - (startsWithError ? 7 : 0) - (errorCode != null ? 8 : 0));
+                this.Log.LogError(
+                    null,
+                    errorCode,
+                    null,
+                    match.Groups[1].Value,
+                    Int32.Parse(match.Groups[2].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[3].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[4].Value, System.Globalization.NumberStyles.None),
+                    Int32.Parse(match.Groups[5].Value, System.Globalization.NumberStyles.None),
+                    msg);
             }
         }
     }


Fix difficulty preset for custom

Fix difficulty preset for custom

--- LmpClient/Systems/SettingsSys/SettingsMessageHandler.cs
+++ LmpClient/Systems/SettingsSys/SettingsMessageHandler.cs
@@ -45,6 +45,7 @@
             {
                 SettingsSystem.ServerSettings.ServerParameters = new GameParameters
                 {
+                    preset = GameParameters.Preset.Custom,
                     Difficulty =
                     {
                         AllowOtherLaunchSites = msgData.AllowOtherLaunchSites,


Just need to reset the trail so that further subclauses can be evaluated correctly (which means the solver should now be working, although its performance is likely to be lacking)

--- LogicalShift.Reason/Solvers/SimpleSingleClauseSolver.cs
+++ LogicalShift.Reason/Solvers/SimpleSingleClauseSolver.cs
@@ -88,6 +88,8 @@
             {
                 if (solvedOnce)
                 {
+                    // Reset the unifier to its original state and give up
+                    unifier.ResetTrail();
                     return false;
                 }
                 else


Fixed documentation errors regarding Controller exceptions.

--- MathExpressionSolver/MathExpressionSolver/Controller.cs
+++ MathExpressionSolver/MathExpressionSolver/Controller.cs
@@ -55,7 +55,8 @@
         /// </summary>
         /// <param name="expression">Expression whose result is wanted.</param>
         /// <exception cref="InvalidOperationException">Some object has not been properly inicialized.</exception>
-        /// <exception cref="ControllerException">Expression can't be properly tokenized.</exception>
+        /// <exception cref="ControllerException">Expression is empty.</exception>
+        /// <exception cref="TokenizerException">Expression can't be properly tokenized.</exception>
         /// <exception cref="ExpTreeBuilderException">Expression tree can't be build.</exception>
         /// <returns>Result of specified expression.</returns>
         public T ReturnResult(string expression)
@@ -71,7 +72,7 @@
         /// <param name="variableName">Custom variable name.</param>
         /// <param name="expression">An expression whose result is to be set as a value of the variable.</param>
         /// <exception cref="InvalidOperationException">Some object has not been properly inicialized.</exception>
-        /// <exception cref="ControllerException">Expression can't be properly tokenized.</exception>
+        /// <exception cref="TokenizerException">Expression can't be properly tokenized.</exception>
         /// <exception cref="ExpTreeBuilderException">Expression tree can't be build.</exception>
         /// <returns>String in a form of "variableName = variableValue".</returns>
         public T SaveVariable(string variableName, string expression)
@@ -91,7 +92,7 @@
         /// <param name="expression">An expression describing what the function will do.</param>
         /// <param name="argumentsNames">An array of argument descriptors (names).</param>
         /// <exception cref="InvalidOperationException">Some object has not been properly inicialized.</exception>
-        /// <exception cref="ControllerException">Expression can't be properly tokenized.</exception>
+        /// <exception cref="TokenizerException">Expression can't be properly tokenized.</exception>
         /// <exception cref="ExpTreeBuilderException">Expression tree can't be build.</exception>
         public void SaveFunction(string funcName, string expression, string[] argumentsNames)
         {
@@ -117,8 +118,9 @@
         /// </summary>
         /// <param name="expression">An expression to be executed.</param>
         /// <exception cref="InvalidOperationException">Some object has not been properly inicialized.</exception>
-        /// <exception cref="ControllerException">Expression can't be properly tokenized.</exception>
-        /// <exception cref="ExpTreeBuilderException">Expression tree can't be build.</exception>
+        /// <exception cref="TokenizerException">Expression can't be properly tokenized.</exception>
+        /// <exception cref="ExpTreeBuilderException">Expression tree can't be build.</exception>
+        /// <exception cref="ControllerException">Invalid expression.</exception>
         /// <returns>String with information about expression result.</returns>
         public string ExecuteExpression(string expression)
         {


Stub IgnoreExceptions/EnableExceptions.

Stub IgnoreExceptions/EnableExceptions.

--- Microsoft.DirectX/Microsoft.DirectX/DirectXException.cs
+++ Microsoft.DirectX/Microsoft.DirectX/DirectXException.cs
@@ -85,12 +85,12 @@

 		public static void IgnoreExceptions ()
 		{
-			throw new NotImplementedException ();
+			IsExceptionIgnored = true;
 		}

 		public static void EnableExceptions ()
 		{
-			throw new NotImplementedException ();
+			IsExceptionIgnored = false;
 		}

 		public static string GetDirectXErrorString (int errorCode)


Removed redudent code & converted use of `OnDrag to `OnMouseMove`

--- osu.Game.Rulesets.Catch/UI/CatchTouchInputMapper.cs
+++ osu.Game.Rulesets.Catch/UI/CatchTouchInputMapper.cs
@@ -13,6 +13,7 @@
 using osuTK.Graphics;
 using osuTK;
 using System.Collections.Generic;
+using osuTK.Input;

 namespace osu.Game.Rulesets.Catch.UI
 {
@@ -119,45 +120,29 @@

         protected override bool OnMouseDown(MouseDownEvent e)
         {
-            if (getTouchCatchActionFromInput(e.ScreenSpaceMousePosition) == TouchCatchAction.None)
-                return false;
-
-            handleDown(e.Button, e.ScreenSpaceMousePosition);
-            return true;
+            return handleDown(e.Button, e.ScreenSpaceMousePosition);
         }

         protected override void OnMouseUp(MouseUpEvent e)
         {
-            if (getTouchCatchActionFromInput(e.ScreenSpaceMousePosition) == TouchCatchAction.None)
-                return;
-
             handleUp(e.Button);
             base.OnMouseUp(e);
         }

-        protected override bool OnDragStart(DragStartEvent e)
-        {
+        protected override bool OnMouseMove(MouseMoveEvent e)
+        {
+            TouchCatchAction touchCatchAction = getTouchCatchActionFromInput(e.ScreenSpaceMousePosition);
+
+            // Loop through the buttons to avoid keeping a button pressed if both mouse buttons are pressed.
+            foreach (MouseButton i in e.PressedButtons)
+                trackedActions[i] = touchCatchAction;
+
+            calculateActiveKeys();
             return true;
         }

-        protected override void OnDrag(DragEvent e)
-        {
-            // I'm not sure if this is posible but let's be safe
-            if (!trackedActions.ContainsKey(e.Button))
-                trackedActions.Add(e.Button, TouchCatchAction.None);
-
-            trackedActions[e.Button] = getTouchCatchActionFromInput(e.ScreenSpaceMousePosition);
-            calculateActiveKeys();
-
-            base.OnDrag(e);
-        }
-
         protected override void OnTouchMove(TouchMoveEvent e)
         {
-            // I'm not sure if this is posible but let's be safe
-            if (!trackedActions.ContainsKey(e.Touch.Source))
-                trackedActions.Add(e.Touch.Source, TouchCatchAction.None);
-
             trackedActions[e.Touch.Source] = getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position);
             calculateActiveKeys();

@@ -194,18 +179,20 @@
                 keyBindingContainer.TriggerReleased(CatchAction.Dash);
         }

-        private void handleDown(object source, Vector2 position)
-        {
+        private bool handleDown(object source, Vector2 position)
+        {
+            TouchCatchAction catchAction = getTouchCatchActionFromInput(position);
+
+            if (catchAction == TouchCatchAction.None)
+                return false;
+
             Show();

-            TouchCatchAction catchAction = getTouchCatchActionFromInput(position);
-
-            // Not too sure how this can happen, but let's avoid throwing.
-            if (trackedActions.ContainsKey(source))
-                return;
-
-            trackedActions.Add(source, catchAction);
+            trackedActions[source] = catchAction;
+
             calculateActiveKeys();
+
+            return true;
         }

         private void handleUp(object source)


Revert "Fix out of bounds exception during indexing"

This reverts commit 88d80016aa72499ec90e1d85ced314a9ad805cfe.

--- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs
+++ osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs
@@ -122,14 +122,8 @@
                     return list[pivot];
             }

-            if (l > 0)
-            {
-                // l will be the first control point with Time > time, but we want the one before it
-                return list[l - 1];
-            }
-
-            // If the binary search failed, l will be unaffected
-            return list[l];
+            // l will be the first control point with Time > time, but we want the one before it
+            return list[l - 1];
         }
     }
 }


Display last user name in logon screen fix config-GUI

--- pGina/src/Configuration/ConfigurationUI.Designer.cs
+++ pGina/src/Configuration/ConfigurationUI.Designer.cs
@@ -163,6 +163,7 @@
             this.help = new System.Windows.Forms.Button();
             this.m_tabs.SuspendLayout();
             this.m_generalConfigTab.SuspendLayout();
+            this.groupLogon.SuspendLayout();
             this.groupBox18.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox14.SuspendLayout();
@@ -1613,6 +1614,8 @@
             this.Load += new System.EventHandler(this.Form_Load);
             this.m_tabs.ResumeLayout(false);
             this.m_generalConfigTab.ResumeLayout(false);
+            this.groupLogon.ResumeLayout(false);
+            this.groupLogon.PerformLayout();
             this.groupBox18.ResumeLayout(false);
             this.groupBox18.PerformLayout();
             this.groupBox4.ResumeLayout(false);


Fixes ubuntu issue

Fixes ubuntu issue

--- query/Services/SchemaService.cs
+++ query/Services/SchemaService.cs
@@ -15,14 +15,16 @@

         public SchemaService()
         {
+            // todo figure out something better
             _tempFolder = Environment.GetEnvironmentVariable("TEMP");
+            if (string.IsNullOrEmpty(_tempFolder))
+            {
+                _tempFolder = "/tmp";
+            }
         }

         public SchemaResult GetSchemaSource(string connectionString, DatabaseProviderType type, string assemblyNamespace, bool withUsings = true)
         {
-            Console.WriteLine("connectionString {0}", connectionString);
-            Console.WriteLine("databaseProviderType {0}", type);
-
             // todo code is identical
             if (type == DatabaseProviderType.SqlServer)
             {
@@ -33,6 +35,7 @@
                 return GetNpgSqlSchemaSource(connectionString, assemblyNamespace, withUsings);
             }
         }
+
         SchemaResult GetNpgSqlSchemaSource(string connectionString, string assemblyNamespace, bool withUsings = true)
         {
             var loggerFactory = new LoggerFactory().AddConsole();
@@ -83,10 +86,7 @@
             var output = new StringBuilder();
             var resFiles = rGen.GenerateAsync(conf);
             resFiles.Wait();
-            Console.WriteLine("_tempFolder: {0}", _tempFolder);
-            Console.WriteLine("resFiles.Result.ContextFile {0}", resFiles.Result.ContextFile);
             var zz = fs.RetrieveFileContents(System.IO.Path.GetDirectoryName(resFiles.Result.ContextFile), System.IO.Path.GetFileName(resFiles.Result.ContextFile));
-            Console.WriteLine("fsContents: {0}", zz);
             var dbCtx = CreateContext(fs.RetrieveFileContents(_tempFolder, programName + ".cs"), isLibrary: withUsings);

             var ctx = dbCtx.Item1;


Crash when adding new item into the library and some items with null names are present

--- source/Playnite/Database/Collections/ItemCollection.cs
+++ source/Playnite/Database/Collections/ItemCollection.cs
@@ -318,7 +318,7 @@

         public virtual TItem Add(string itemName)
         {
-            return Add(itemName, (existingItem, newName) => existingItem.Name.Equals(newName, StringComparison.InvariantCultureIgnoreCase));
+            return Add(itemName, (existingItem, newName) => existingItem.Name?.Equals(newName, StringComparison.InvariantCultureIgnoreCase) == true);
         }

         public virtual IEnumerable<TItem> Add(List<string> itemsToAdd, Func<TItem, string, bool> existingComparer)
@@ -347,7 +347,7 @@

         public virtual IEnumerable<TItem> Add(List<string> itemsToAdd)
         {
-            return Add(itemsToAdd, (existingItem, newName) => existingItem.Name.Equals(newName, StringComparison.InvariantCultureIgnoreCase));
+            return Add(itemsToAdd, (existingItem, newName) => existingItem.Name?.Equals(newName, StringComparison.InvariantCultureIgnoreCase) == true);
         }

         public virtual void Add(TItem itemToAdd)


Don't reset the position all the time.

Don't reset the position all the time.

--- PlatformWin32/win32/SystemWindowCreator_WindowsForms.cs
+++ PlatformWin32/win32/SystemWindowCreator_WindowsForms.cs
@@ -9,7 +9,7 @@
 {
     public class SystemWindowCreator_WindowsForms : SystemWindowCreatorPlugin
     {
-        bool SetInitialDesktopPosition = false;
+        bool pendingSetInitialDesktopPosition = false;
         Point2D InitialDesktopPosition = new Point2D();

         public override void ShowSystemWindow(SystemWindow systemWindow)
@@ -38,8 +38,9 @@
             windowsFormsTopWindow.AddChild(systemWindow);
             windowsFormsTopWindow.MinimumSize = systemWindow.MinimumSize;

-            if (SetInitialDesktopPosition)
+            if (pendingSetInitialDesktopPosition)
             {
+                pendingSetInitialDesktopPosition = false;
                 systemWindow.DesktopPosition = InitialDesktopPosition;
             }

@@ -85,7 +86,7 @@
             }
             else
             {
-                SetInitialDesktopPosition = true;
+                pendingSetInitialDesktopPosition = true;
                 InitialDesktopPosition = position;
             }
         }


Introduced ClearDatabaseSchemaAlways and ClearDatabaseSchemaIfModelChanges EF database initializers which function similar to DropCreateDatabaseAlways and DropCreateDatabaseIfModelChanges but rather than dropping the entire database they only delete all resources from a given database schema. This enables them to run in a deployed service as they stay within the default permissions that have been given to a given application (which only can access the associated schema).

Updated QuickStarts and project templates to use these database initializers instead as they make deployment work much simpler when changing/developing the data models for an app.

--- Quickstart/ZUMOAPPNAMEService/App_Start/WebApiConfig.cs
+++ Quickstart/ZUMOAPPNAMEService/App_Start/WebApiConfig.cs
@@ -25,7 +25,7 @@
         }
     }

-    public class ZUMOAPPNAMEInitializer : DropCreateDatabaseIfModelChanges<ZUMOAPPNAMEContext>
+    public class ZUMOAPPNAMEInitializer : ClearDatabaseSchemaIfModelChanges<ZUMOAPPNAMEContext>
     {
         protected override void Seed(ZUMOAPPNAMEContext context)
         {


Continue development on skos:ConceptScheme

--- RDFSharp.Semantics/Extensions/SKOS/SKOSConceptScheme.cs
+++ RDFSharp.Semantics/Extensions/SKOS/SKOSConceptScheme.cs
@@ -169,13 +169,21 @@
             if (!Collections.ContainsKey(skosCollection.PatternMemberID))
                 Collections.Add(skosCollection.PatternMemberID, skosCollection);

-            //Add knowledge to the A-BOX
+            //Add knowledge to the A-BOX (collection)
             Ontology.Data.DeclareIndividual(skosCollection);
             Ontology.Data.DeclareIndividualType(skosCollection, RDFVocabulary.SKOS.COLLECTION);
             Ontology.Data.DeclareObjectAssertion(skosCollection, RDFVocabulary.SKOS.IN_SCHEME, this);
-            skosConcepts.ForEach(skosConcept => {
+
+            //Add knowledge to the A-BOX (concepts)
+            skosConcepts.ForEach(skosConcept =>
+            {
+                //Declare concept to the concept scheme
+                if (!Concepts.ContainsKey(skosConcept.PatternMemberID))
+                    Concepts.Add(skosConcept.PatternMemberID, skosConcept);
                 Ontology.Data.DeclareIndividual(skosConcept);
                 Ontology.Data.DeclareIndividualType(skosConcept, RDFVocabulary.SKOS.CONCEPT);
+
+                //Declare concept membership with given collection
                 Ontology.Data.DeclareObjectAssertion(skosCollection, RDFVocabulary.SKOS.MEMBER, skosConcept);
             });

@@ -198,19 +206,26 @@
             if (!OrderedCollections.ContainsKey(skosOrderedCollection.PatternMemberID))
                 OrderedCollections.Add(skosOrderedCollection.PatternMemberID, skosOrderedCollection);

-            //Add knowledge to the A-BOX
+            //Add knowledge to the A-BOX (ordered collection)
             Ontology.Data.DeclareIndividual(skosOrderedCollection);
             Ontology.Data.DeclareIndividualType(skosOrderedCollection, RDFVocabulary.SKOS.ORDERED_COLLECTION);
             Ontology.Data.DeclareObjectAssertion(skosOrderedCollection, RDFVocabulary.SKOS.IN_SCHEME, this);
-            RDFCollection rdfOrderedCollection = new RDFCollection(RDFModelEnums.RDFItemTypes.Resource);
+
+            //Add knowledge to the A-BOX (concepts)
+            RDFCollection rdfCollection = new RDFCollection(RDFModelEnums.RDFItemTypes.Resource);
             skosConcepts.ForEach(skosConcept =>
             {
+                //Declare concept to the concept scheme
+                if (!Concepts.ContainsKey(skosConcept.PatternMemberID))
+                    Concepts.Add(skosConcept.PatternMemberID, skosConcept);
                 Ontology.Data.DeclareIndividual(skosConcept);
                 Ontology.Data.DeclareIndividualType(skosConcept, RDFVocabulary.SKOS.CONCEPT);
-                rdfOrderedCollection.AddItem(skosConcept);
+
+                //Prepare concept membership with given ordered collection
+                rdfCollection.AddItem(skosConcept);
             });
-            Ontology.Data.ABoxGraph.AddCollection(rdfOrderedCollection);
-            Ontology.Data.DeclareObjectAssertion(skosOrderedCollection, RDFVocabulary.SKOS.MEMBER_LIST, rdfOrderedCollection.ReificationSubject);
+            Ontology.Data.ABoxGraph.AddCollection(rdfCollection);
+            Ontology.Data.DeclareObjectAssertion(skosOrderedCollection, RDFVocabulary.SKOS.MEMBER_LIST, rdfCollection.ReificationSubject);

             return this;
         }


Revert "The code for this change.... Hit the wrong save button..."

This reverts commit 0a427f002c6f3a8612986178146279626df3d51e.

--- RelhaxModpack/RelhaxModpack/Windows/VersionInfo.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/VersionInfo.xaml.cs
@@ -47,11 +47,6 @@
             Close();
         }

-        private void OnChangelogButtonClick(object sender, RoutedEventArgs e)
-        {
-            NewsViewer newsViewer = new NewsViewer();
-            newsViewer.Show();
-        }
         private void OnNoButtonClick(object sender, RoutedEventArgs e)
         {
             ConfirmUpdate = false;
@@ -96,10 +91,5 @@
         {
             Utils.OpenInGoogleTranslate(ApplicationUpdateNotes.Text);
         }
-
-        //private void ApplicationUpdateNotes_TextChanged(object sender, TextChangedEventArgs e)
-        //{
-//
-        //}
     }
 }


fix WithExpressionFrom

fix WithExpressionFrom

--- Signum.Engine/DynamicQuery/DynamicQueryFluentInclude.cs
+++ Signum.Engine/DynamicQuery/DynamicQueryFluentInclude.cs
@@ -44,14 +44,14 @@
         /// <summary>
         /// Uses typeof(T) NiceName as niceName
         /// </summary>
-        public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, Expression<Func<F, T>> lambdaToMethodOrProperty)
+        public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, Expression<Func<F, T?>> lambdaToMethodOrProperty)
             where T : Entity
         {
             QueryLogic.Expressions.Register(lambdaToMethodOrProperty, () => typeof(T).NiceName());
             return fi;
         }

-        public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, Expression<Func<F, T>> lambdaToMethodOrProperty, Func<string> niceName)
+        public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, Expression<Func<F, T?>> lambdaToMethodOrProperty, Func<string> niceName)
             where T : Entity
         {
             QueryLogic.Expressions.Register(lambdaToMethodOrProperty, niceName);


AttachObjectGraph lukte niet bij een een-een-relatie waarbij rechterkant TeVerwijderen is.

git-svn-id: 0ffdc289f568b1e7493e560395a00d06174c8a92@505 99b415e2-69d1-4072-8d93-0ed3a15484ab

--- Solution/Cg2.EfWrapper/Entity/ObjectContextExtension.cs
+++ Solution/Cg2.EfWrapper/Entity/ObjectContextExtension.cs
@@ -415,20 +415,38 @@

 					// Recursively navigate through new value (unless it's null):
 					IBasisEntiteit attachedinstance;
-					if (related == null)
-						attachedinstance = null;
-					else
-					{
+                    if (related == null)
+                    {
+                        attachedinstance = null;
+
+                        // Origineel werd hier ook 'property.PropertyInfo.SetValue' aangeroepen,
+                        // zodat het onbrekende 'related' verwijderd zou worden.  Zo doen wij
+                        // het niet; bij ons moet 'TeVerwijderen' gezet zijn.
+                    }
+                    else
+                    {
                         Debug.Assert(related is IBasisEntiteit);

-						attachedinstance = context.AddOrAttachInstance(related as IBasisEntiteit, !property.NoUpdate);
+                        attachedinstance = context.AddOrAttachInstance(related as IBasisEntiteit, !property.NoUpdate);

                         // recursieve aanroep voor eventuele children van property
-						NavigatePropertySet(context, childnode, related as IBasisEntiteit, attachedinstance);
-					}
-
-					// Synchronise value:
-					property.PropertyInfo.SetValue(attachedowner, attachedinstance, null);
+                        NavigatePropertySet(context, childnode, related as IBasisEntiteit, attachedinstance);
+
+                        // bookmark
+
+                        // dit stond daarnet een niveau lager.  AttachedOwner is nu 'related', maar
+                        // dan geattacht.  Koppel nu aan.
+
+                        property.PropertyInfo.SetValue(attachedowner, attachedinstance, null);
+
+                        // Als related te verwijderen was, doe dat dan ook.
+                        if ((related as IBasisEntiteit).TeVerwijderen)
+                        {
+                            context.DeleteObject(attachedinstance);
+                        }
+                    }
+
+                    // (hier stond het)
 				}
 			}
 		}


RenderStep ID #ADD: Added an ID property to RenderStep.

--- Source/Core/Duality/Resources/RenderSetup/RenderStep.cs
+++ Source/Core/Duality/Resources/RenderSetup/RenderStep.cs
@@ -14,6 +14,7 @@
 	/// </summary>
 	public class RenderStep
 	{
+		private string                   id             = null;
 		private ColorRgba                clearColor     = ColorRgba.TransparentBlack;
 		private float                    clearDepth     = 1.0f;
 		private ClearFlag                clearFlags     = ClearFlag.All;
@@ -22,6 +23,16 @@
 		private BatchInfo                input          = null;
 		private ContentRef<RenderTarget> output         = null;

+		/// <summary>
+		/// [GET / SET] An optional ID value that can be used to refer to a <see cref="RenderStep"/>
+		/// in an abstract way, i.e. identifying it by its role for rendering, rather than as a
+		/// concrete instance.
+		/// </summary>
+		public string Id
+		{
+			get { return this.id; }
+			set { this.id = value; }
+		}
 		/// <summary>
 		/// The input to use for rendering. This can for example be a <see cref="Duality.Resources.Texture"/> that
 		/// has been rendered to before and is now bound to perform a postprocessing step. If this is null, the current


Extend character set of function names (including ".")

--- Source/ExcelDna.IntelliSense/UIMonitor/FormulaParser.cs
+++ Source/ExcelDna.IntelliSense/UIMonitor/FormulaParser.cs
@@ -22,7 +22,7 @@

             if (lastOpeningParenthesis > -1)
             {
-                var match = Regex.Match(formulaPrefix.Substring(0, lastOpeningParenthesis), @"[^\w](?<functionName>\w*)$");
+                var match = Regex.Match(formulaPrefix.Substring(0, lastOpeningParenthesis), @"[^\w.](?<functionName>[\w.]*)$");
                 if (match.Success)
                 {
                     functionName = match.Groups["functionName"].Value;


updated assembly version

updated assembly version

--- Source/Glass.Sitecore.Mapper/Properties/AssemblyInfo.cs
+++ Source/Glass.Sitecore.Mapper/Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.4.0")]
-[assembly: AssemblyFileVersion("2.0.4.0")]
+[assembly: AssemblyVersion("2.0.5.0")]
+[assembly: AssemblyFileVersion("2.0.5.0")]
 [assembly: InternalsVisibleTo("Glass.Sitecore.Mapper.Tests")]


Exception now marked as serialization. Deserialization constructor added.

--- Source/Lokad.Cloud.Framework/TriggerRestartException.cs
+++ Source/Lokad.Cloud.Framework/TriggerRestartException.cs
@@ -4,6 +4,7 @@
 #endregion

 using System;
+using System.Runtime.Serialization;

 // IDEA: the message of the exception could be logged in to the cloud logs.
 // (issue: how to avoid N identical messages to be logged through all workers)
@@ -11,6 +12,7 @@
 namespace Lokad.Cloud.Framework
 {
 	///Throw this exception in order to force a worker restart.
+	[Serializable]
 	public class TriggerRestartException : ApplicationException
 	{
 		/// Empty constructor.
@@ -27,5 +29,10 @@
 		public TriggerRestartException(string message, Exception inner) : base(message, inner)
 		{
 		}
+
+		/// Deserialization constructor.
+		public TriggerRestartException(SerializationInfo info, StreamingContext context) : base(info, context)
+		{
+		}
 	}
 }


Docummented the Random extention methods

--- Source/MoreDotNet/Extentions/Common/RandomExtentions.cs
+++ Source/MoreDotNet/Extentions/Common/RandomExtentions.cs
@@ -53,11 +53,22 @@
             return random.NextDouble() <= probability;
         }

+        /// <summary>
+        /// Gets a random alphanumeric character.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <returns>An alphanumeric character.</returns>
         public static char NextChar(this Random random)
         {
             return random.NextChar(CharType.AlphanumericAny);
         }

+        /// <summary>
+        /// Gets a random character depending on a <see cref="CharType"/>.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="mode">The type of random character.</param>
+        /// <returns>A random character.</returns>
         public static char NextChar(this Random random, CharType mode)
         {
             switch (mode)
@@ -81,16 +92,35 @@
             }
         }

+        /// <summary>
+        /// Gets a random <see cref="DateTime"/> value.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <returns>A <see cref="DateTime"/> value.</returns>
+        public static DateTime NextDateTime(this Random random)
+        {
+            return random.NextDateTime(DateTime.MinValue, DateTime.MaxValue);
+        }
+
+        /// <summary>
+        /// Gets a random <see cref="DateTime"/> value in a given range.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="minValue">The start of the range.</param>
+        /// <param name="maxValue">The end of the range.</param>
+        /// <returns>A random <see cref="DateTime"/> value.</returns>
         public static DateTime NextDateTime(this Random random, DateTime minValue, DateTime maxValue)
         {
             return DateTime.FromOADate(random.NextDouble(minValue.ToOADate(), maxValue.ToOADate()));
         }

-        public static DateTime NextDateTime(this Random random)
-        {
-            return random.NextDateTime(DateTime.MinValue, DateTime.MaxValue);
-        }
-
+        /// <summary>
+        /// A random <see cref="double"/> value in a given range.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="minValue">The start of the range.</param>
+        /// <param name="maxValue">The end of the range.</param>
+        /// <returns>A random <see cref="double"/> value.</returns>
         public static double NextDouble(this Random random, double minValue, double maxValue)
         {
             if (maxValue < minValue)
@@ -105,7 +135,7 @@
             }

             // to avoid evaluating to Double.Infinity, we split the range into two halves:
-            double halfDifference = (maxValue * 0.5) - (minValue * 0.5);
+            var halfDifference = (maxValue * 0.5) - (minValue * 0.5);

             // 50/50 chance of returning a value from the first or second half of the range
             if (random.NextBool())
@@ -116,6 +146,24 @@
             return (minValue + halfDifference) + (random.NextDouble() * halfDifference);
         }

+        /// <summary>
+        /// Gets a random alphanumeric <see cref="string"/> value.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="numChars">The number of characters in the string.</param>
+        /// <returns>A random string.</returns>
+        public static string NextString(this Random random, int numChars)
+        {
+            return random.NextString(numChars, CharType.AlphanumericAny);
+        }
+
+        /// <summary>
+        /// Gets a random <see cref="string"/> value consisting of specific characters.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="numChars">The number of characters in the string.</param>
+        /// <param name="mode">The type of characters for the string.</param>
+        /// <returns>A random string.</returns>
         public static string NextString(this Random random, int numChars, CharType mode)
         {
             char[] chars = new char[numChars];
@@ -128,19 +176,26 @@
             return new string(chars);
         }

-        public static string NextString(this Random random, int numChars)
-        {
-            return random.NextString(numChars, CharType.AlphanumericAny);
-        }
-
+        /// <summary>
+        /// Gets a random <see cref="TimeSpan"/> value.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <returns>A random <see cref="TimeSpan"/> value.</returns>
+        public static TimeSpan NextTimeSpan(this Random random)
+        {
+            return random.NextTimeSpan(TimeSpan.MinValue, TimeSpan.MaxValue);
+        }
+
+        /// <summary>
+        /// Gets a random <see cref="TimeSpan"/> value in a given range.
+        /// </summary>
+        /// <param name="random">The <see cref="Random"/> instance on which the extension method is called.</param>
+        /// <param name="minValue">The start of the range.</param>
+        /// <param name="maxValue">The end of the range.</param>
+        /// <returns>A random <see cref="TimeSpan"/> value.</returns>
         public static TimeSpan NextTimeSpan(this Random random, TimeSpan minValue, TimeSpan maxValue)
         {
             return TimeSpan.FromMilliseconds(random.NextDouble(minValue.TotalMilliseconds, maxValue.TotalMilliseconds));
-        }
-
-        public static TimeSpan NextTimeSpan(this Random random)
-        {
-            return random.NextTimeSpan(TimeSpan.MinValue, TimeSpan.MaxValue);
         }

         private static char NextAlphanumericChar(this Random random, bool uppercase)


removed unused using statement

removed unused using statement

--- Engine/Path.cs
+++ Engine/Path.cs
@@ -3,7 +3,6 @@
 using System.Reflection;
 using System.Collections;
 using System.Collections.Generic;
-using Microsoft.DotNet.Cli.Utils;

 namespace DotNetCoreKoans.Engine
 {


Update DapperExpressionVisitor.cs

Update DapperExpressionVisitor.cs

Removed the unused method and unnecessary comments

--- src/Abp.Dapper/Dapper/Expressions/DapperExpressionVisitor.cs
+++ src/Abp.Dapper/Dapper/Expressions/DapperExpressionVisitor.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
@@ -48,51 +48,6 @@
             return _pg.Predicates.Count == 1 ? _pg.Predicates[0] : _pg;
         }

-        private static PredicateGroup GetLastPredicateGroup(PredicateGroup grp)
-        {
-            IList<IPredicate> groups = grp.Predicates;
-
-            if (!groups.Any())
-            {
-                return grp;
-            }
-
-            IPredicate last = groups.Last();
-
-            if (last is PredicateGroup)
-            {
-                return GetLastPredicateGroup(last as PredicateGroup);
-            }
-
-            return grp;
-        }
-
-        private IFieldPredicate GetLastField()
-        {
-            PredicateGroup lastGrp = GetLastPredicateGroup(_pg);
-
-            IPredicate last = lastGrp.Predicates.Last();
-
-            return last as IFieldPredicate;
-        }
-
-        private IFieldPredicate GetCurrentField()
-        {
-            //IPredicate last =_currentGroup.Predicates.Last();
-
-            //return last as IFieldPredicate;
-
-            return GetCurrentField(_currentGroup);
-        }
-        private IFieldPredicate GetCurrentField(IPredicateGroup group)
-        {
-            IPredicate last = group.Predicates.Last();
-            if (last is IPredicateGroup)
-            {
-                return GetCurrentField(last as IPredicateGroup);
-            }
-            return last as IFieldPredicate;
-        }
         private static Operator DetermineOperator(Expression binaryExpression)
         {
             switch (binaryExpression.NodeType)
@@ -112,6 +67,21 @@
             }
         }

+        private IFieldPredicate GetCurrentField()
+        {
+            return GetCurrentField(_currentGroup);
+        }
+
+        private IFieldPredicate GetCurrentField(IPredicateGroup group)
+        {
+            IPredicate last = group.Predicates.Last();
+            if (last is IPredicateGroup)
+            {
+                return GetCurrentField(last as IPredicateGroup);
+            }
+            return last as IFieldPredicate;
+        }
+
         private void AddField(MemberExpression exp, Operator op = Operator.Eq, object value = null, bool not = false)
         {
             PredicateGroup pg = _currentGroup;
@@ -123,6 +93,8 @@
             pg.Predicates.Add(field);
         }

+
+        #region The visit methods override
         protected override Expression VisitBinary(BinaryExpression node)
         {
             Expressions.Add(node);
@@ -240,5 +212,6 @@

             return base.VisitUnary(node); // returning base because we want to continue further processing - ie subsequent call to VisitMethodCall
         }
+        #endregion
     }
 }


Resolved warnings in StoryboardTable sample

--- StoryboardTable/StoryboardTable/MasterViewController.cs
+++ StoryboardTable/StoryboardTable/MasterViewController.cs
@@ -51,8 +51,7 @@

 		public void SaveTask (Chore chore)
 		{
-			var oldTask = chores.Find(t => t.Id == chore.Id);
-			oldTask = chore;
+			//var oldTask = chores.Find(t => t.Id == chore.Id);
 			NavigationController.PopViewController(true);
 		}


Reduce indentation, use static lambda.

Reduce indentation, use static lambda.

--- src/AsmResolver.DotNet/Builder/Discovery/MemberDiscoverer.cs
+++ src/AsmResolver.DotNet/Builder/Discovery/MemberDiscoverer.cs
@@ -25,6 +25,40 @@

         private const FieldAttributes FieldPlaceHolderAttributes = FieldAttributes.Public;

+        private readonly ModuleDefinition _module;
+        private readonly MemberDiscoveryFlags _flags;
+        private readonly MemberDiscoveryResult _result = new();
+
+        private readonly List<MethodDefinition> _allPlaceHolderMethods = new();
+        private int _placeHolderParameterCounter;
+
+        private readonly TypeReference _eventHandlerTypeRef;
+        private readonly TypeSignature _eventHandlerTypeSig;
+
+        private readonly IDictionary<TableIndex, IList<uint>> _freeRids= new Dictionary<TableIndex, IList<uint>>
+        {
+            [TableIndex.TypeDef] = new List<uint>(),
+            [TableIndex.Field] = new List<uint>(),
+            [TableIndex.Method] = new List<uint>(),
+            [TableIndex.Param] = new List<uint>(),
+            [TableIndex.Property] = new List<uint>(),
+            [TableIndex.Event] = new List<uint>(),
+        };
+
+        private MemberDiscoverer(ModuleDefinition module, MemberDiscoveryFlags flags)
+        {
+            _module = module ?? throw new ArgumentNullException(nameof(module));
+            _flags = flags;
+
+            _eventHandlerTypeRef = new TypeReference(
+                module,
+                module.CorLibTypeFactory.CorLibScope,
+                "System",
+                nameof(EventHandler));
+
+            _eventHandlerTypeSig = new TypeDefOrRefSignature(_eventHandlerTypeRef, false);
+        }
+
         /// <summary>
         /// Performs a traversal on the provided module and collects all member defined in it.
         /// </summary>
@@ -56,40 +90,6 @@
                 context.StuffFreeMemberSlots();

             return context._result;
-        }
-
-        private readonly ModuleDefinition _module;
-        private readonly MemberDiscoveryFlags _flags;
-        private readonly MemberDiscoveryResult _result = new MemberDiscoveryResult();
-
-        private readonly IList<MethodDefinition> _allPlaceHolderMethods = new List<MethodDefinition>();
-        private int _placeHolderParameterCounter;
-
-        private readonly TypeReference _eventHandlerTypeRef;
-        private readonly TypeSignature _eventHandlerTypeSig;
-
-        private readonly IDictionary<TableIndex, IList<uint>> _freeRids= new Dictionary<TableIndex, IList<uint>>
-        {
-            [TableIndex.TypeDef] = new List<uint>(),
-            [TableIndex.Field] = new List<uint>(),
-            [TableIndex.Method] = new List<uint>(),
-            [TableIndex.Param] = new List<uint>(),
-            [TableIndex.Property] = new List<uint>(),
-            [TableIndex.Event] = new List<uint>(),
-        };
-
-        private MemberDiscoverer(ModuleDefinition module, MemberDiscoveryFlags flags)
-        {
-            _module = module ?? throw new ArgumentNullException(nameof(module));
-            _flags = flags;
-
-            _eventHandlerTypeRef = new TypeReference(
-                module,
-                module.CorLibTypeFactory.CorLibScope,
-                "System",
-                nameof(EventHandler));
-
-            _eventHandlerTypeSig = new TypeDefOrRefSignature(_eventHandlerTypeRef, false);
         }

         private IList<TMember> GetResultList<TMember>(TableIndex tableIndex)
@@ -193,54 +193,53 @@
             var memberType = member.MetadataToken.Table;
             var memberList = GetResultList<TMember>(memberType);

-            if (IsNewMember(memberList, member))
-            {
-                var freeRids = _freeRids[memberType];
-
-                var mask = member.MetadataToken.Table switch
+            if (!IsNewMember(memberList, member))
+                return;
+
+            var freeRids = _freeRids[memberType];
+            var mask = member.MetadataToken.Table switch
+            {
+                TableIndex.TypeDef => MemberDiscoveryFlags.PreserveTypeOrder,
+                TableIndex.Field => MemberDiscoveryFlags.PreserveFieldOrder,
+                TableIndex.Method => MemberDiscoveryFlags.PreserveMethodOrder,
+                TableIndex.Param => MemberDiscoveryFlags.PreserveParameterOrder,
+                TableIndex.Property => MemberDiscoveryFlags.PreservePropertyOrder,
+                TableIndex.Event => MemberDiscoveryFlags.PreserveEventOrder,
+                _ => throw new ArgumentOutOfRangeException(nameof(member))
+            };
+
+            if (member.MetadataToken.Rid != 0 && (_flags & mask) == mask)
+            {
+                // Member is a new member but assigned a RID.
+                // Ensure enough rows are allocated, so that we can insert it in the right place.
+                while (memberList.Count < member.MetadataToken.Rid)
                 {
-                    TableIndex.TypeDef => MemberDiscoveryFlags.PreserveTypeOrder,
-                    TableIndex.Field => MemberDiscoveryFlags.PreserveFieldOrder,
-                    TableIndex.Method => MemberDiscoveryFlags.PreserveMethodOrder,
-                    TableIndex.Param => MemberDiscoveryFlags.PreserveParameterOrder,
-                    TableIndex.Property => MemberDiscoveryFlags.PreservePropertyOrder,
-                    TableIndex.Event => MemberDiscoveryFlags.PreserveEventOrder,
-                    _ => throw new ArgumentOutOfRangeException(nameof(member))
-                };
-                if (member.MetadataToken.Rid != 0 && (_flags & mask) == mask)
+                    memberList.Add(null);
+                    freeRids.Add((uint) memberList.Count);
+                }
+
+                // Check if the slot is available.
+                if (memberList[(int) member.MetadataToken.Rid - 1] is { } slot)
                 {
-                    // Member is a new member but assigned a RID.
-                    // Ensure enough rows are allocated, so that we can insert it in the right place.
-                    while (memberList.Count < member.MetadataToken.Rid)
-                    {
-                        memberList.Add(null);
-                        freeRids.Add((uint) memberList.Count);
-                    }
-
-                    // Check if the slot is available.
-                    var slot = memberList[(int) member.MetadataToken.Rid - 1];
-                    if (slot is {})
-                    {
-                        throw new ArgumentException(
-                            $"{slot} and {member} are assigned the same RID {member.MetadataToken.Rid}.");
-                    }
-
-                    memberList[(int) member.MetadataToken.Rid - 1] = member;
-                    freeRids.Remove(member.MetadataToken.Rid);
-
+                    throw new ArgumentException(
+                        $"{slot.SafeToString()} and {member.SafeToString()} are assigned the same RID {member.MetadataToken.Rid}.");
                 }
-                else if (freeRids.Count > 0)
-                {
-                    // Use any free RID if it is available.
-                    uint nextFreeRid = freeRids[0];
-                    freeRids.RemoveAt(0);
-                    memberList[(int) (nextFreeRid - 1)] = member;
-                }
-                else
-                {
-                    // Fallback method: Just append to the end of the table.
-                    memberList.Add(member);
-                }
+
+                memberList[(int) member.MetadataToken.Rid - 1] = member;
+                freeRids.Remove(member.MetadataToken.Rid);
+
+            }
+            else if (freeRids.Count > 0)
+            {
+                // Use any free RID if it is available.
+                uint nextFreeRid = freeRids[0];
+                freeRids.RemoveAt(0);
+                memberList[(int) (nextFreeRid - 1)] = member;
+            }
+            else
+            {
+                // Fallback method: Just append to the end of the table.
+                memberList.Add(member);
             }
         }

@@ -255,7 +254,7 @@
         private void StuffFreeMemberSlots()
         {
             // Check if we need to do this at all.
-            if (_freeRids.Values.All(q => q.Count == 0))
+            if (_freeRids.Values.All(static q => q.Count == 0))
                 return;

             // Create a new randomly generated namespace.


Unit test fix

Unit test fix

--- src/Catel.Test/Catel.Test.NET40/Caching/CacheStorageFacts.cs
+++ src/Catel.Test/Catel.Test.NET40/Caching/CacheStorageFacts.cs
@@ -360,7 +360,8 @@

                 for (int i = 0; i < 5; i++)
                 {
-                    var value = cache.GetFromCacheOrFetch("key", () => i, expiration: new TimeSpan(0, 0, 1));
+                    int innerI = i;
+                    var value = cache.GetFromCacheOrFetch("key", () => innerI, expiration: new TimeSpan(0, 0, 1));

                     Assert.AreEqual(i, value);


Fix test

Fix test

--- src/EditorFeatures/CSharpTest/Formatting/CodeCleanupTests.cs
+++ src/EditorFeatures/CSharpTest/Formatting/CodeCleanupTests.cs
@@ -563,8 +563,8 @@
             var expectedNumberOfUnsupportedDiagnosticIds =
                 language switch
                 {
-                    LanguageNames.CSharp => 37,
-                    LanguageNames.VisualBasic => 74,
+                    LanguageNames.CSharp => 38,
+                    LanguageNames.VisualBasic => 75,
                     _ => throw ExceptionUtilities.UnexpectedValue(language),
                 };


AppVeyorListenerTests properly disposes HttpClient instances.

--- src/Fixie.Tests/Execution/Listeners/AppVeyorListenerTests.cs
+++ src/Fixie.Tests/Execution/Listeners/AppVeyorListenerTests.cs
@@ -8,9 +8,9 @@
     using System.Threading;
     using System.Threading.Tasks;
     using System.Web.Script.Serialization;
+    using Assertions;
     using Fixie.Execution;
     using Fixie.Execution.Listeners;
-    using Assertions;

     public class AppVeyorListenerTests : MessagingTests
     {
@@ -18,33 +18,23 @@
         {
             var results = new List<AppVeyorListener.TestResult>();

-            var httpClient = new HttpClient(new FakeHandler(request =>
+            using (var httpClient = FakeHttpClient(results))
             {
-                request.ShouldNotBeNull();
-                request.RequestUri.AbsoluteUri.ShouldEqual("http://localhost:4567/api/tests");
-                request.Headers.Accept.ShouldContain(new MediaTypeWithQualityHeaderValue("application/json"));
-                request.Content.Headers.ContentType.ToString().ShouldEqual("application/json; charset=utf-8");
+                var listener = new AppVeyorListener("http://localhost:4567", httpClient);

-                var requestContent = request.Content.ReadAsStringAsync().Result;
-                results.Add(new JavaScriptSerializer().Deserialize<AppVeyorListener.TestResult>(requestContent));
+                using (var console = new RedirectedConsole())
+                {
+                    Run(listener);

-                return new HttpResponseMessage { StatusCode = HttpStatusCode.Accepted };
-            }));
-
-            var listener = new AppVeyorListener("http://localhost:4567", httpClient);
-
-            using (var console = new RedirectedConsole())
-            {
-                Run(listener);
-
-                console.Lines()
-                    .ShouldEqual(
-                        "Console.Out: Fail",
-                        "Console.Error: Fail",
-                        "Console.Out: FailByAssertion",
-                        "Console.Error: FailByAssertion",
-                        "Console.Out: Pass",
-                        "Console.Error: Pass");
+                    console.Lines()
+                        .ShouldEqual(
+                            "Console.Out: Fail",
+                            "Console.Error: Fail",
+                            "Console.Out: FailByAssertion",
+                            "Console.Error: FailByAssertion",
+                            "Console.Out: Pass",
+                            "Console.Error: Pass");
+                }
             }

             results.Count.ShouldEqual(5);
@@ -82,9 +72,7 @@
             fail.ErrorStackTrace
                 .CleanStackTraceLineNumbers()
                 .Lines()
-                .ShouldEqual(
-                        "Fixie.Tests.FailureException",
-                        At("Fail()"));
+                .ShouldEqual("Fixie.Tests.FailureException", At("Fail()"));
             fail.StdOut.Lines().ShouldEqual("Console.Out: Fail", "Console.Error: Fail");

             failByAssertion.testName.ShouldEqual(TestClass + ".FailByAssertion");
@@ -96,7 +84,6 @@
                 "Actual:   1");
             failByAssertion.ErrorStackTrace
                 .CleanStackTraceLineNumbers()
-                .Lines()
                 .ShouldEqual(At("FailByAssertion()"));
             failByAssertion.StdOut.Lines().ShouldEqual("Console.Out: FailByAssertion", "Console.Error: FailByAssertion");

@@ -106,6 +93,22 @@
             pass.ErrorMessage.ShouldBeNull();
             pass.ErrorStackTrace.ShouldBeNull();
             pass.StdOut.Lines().ShouldEqual("Console.Out: Pass", "Console.Error: Pass");
+        }
+
+        static HttpClient FakeHttpClient(List<AppVeyorListener.TestResult> results)
+        {
+            return new HttpClient(new FakeHandler(request =>
+            {
+                request.ShouldNotBeNull();
+                request.RequestUri.AbsoluteUri.ShouldEqual("http://localhost:4567/api/tests");
+                request.Headers.Accept.ShouldContain(new MediaTypeWithQualityHeaderValue("application/json"));
+                request.Content.Headers.ContentType.ToString().ShouldEqual("application/json; charset=utf-8");
+
+                var requestContent = request.Content.ReadAsStringAsync().Result;
+                results.Add(new JavaScriptSerializer().Deserialize<AppVeyorListener.TestResult>(requestContent));
+
+                return new HttpResponseMessage { StatusCode = HttpStatusCode.Accepted };
+            }));
         }

         class FakeHandler : DelegatingHandler


CanSilentlyFail passing

CanSilentlyFail passing

Signed-off-by: Sean Chambers <6faeaf825c9ff3088564a34fbd99f71f04ead1f5@gmail.com>

--- src/FluentMigrator.Tests/Integration/MigrationRunnerTests.cs
+++ src/FluentMigrator.Tests/Integration/MigrationRunnerTests.cs
@@ -5,6 +5,7 @@
 using FluentMigrator.Runner.Generators;
 using FluentMigrator.Runner.Processors.Sqlite;
 using FluentMigrator.Runner.Processors.SqlServer;
+using Moq;
 using NUnit.Framework;
 using NUnit.Should;

@@ -30,21 +31,23 @@
 				});
 		}

-		[Test, Ignore("failing becacase of assertion on line 45")]
+		[Test]
 		public void CanSilentlyFail()
 		{
-			ExecuteWithSupportedProcessors(processor =>
-				{
-					var conventions = new MigrationConventions();
-
-					var runner = new MigrationRunner(conventions, processor) { SilentlyFail = true };

-					runner.Up(new TestForeignKeySilentFailure());
-					runner.CaughtExceptions.Count.ShouldBeGreaterThan(0);
+			var processor = new Mock<IMigrationProcessor>();
+			processor.Setup(x => x.Process(It.IsAny<CreateForeignKeyExpression>())).Throws(new Exception("Error"));
+			processor.Setup(x => x.Process(It.IsAny<DeleteForeignKeyExpression>())).Throws(new Exception("Error"));

-					runner.Down(new TestForeignKeySilentFailure());
-					runner.CaughtExceptions.Count.ShouldBeGreaterThan(0);
-				});
+			var conventions = new MigrationConventions();
+
+			var runner = new MigrationRunner(conventions, processor.Object) { SilentlyFail = true };
+
+			runner.Up(new TestForeignKeySilentFailure());
+			runner.CaughtExceptions.Count.ShouldBeGreaterThan(0);
+
+			runner.Down(new TestForeignKeySilentFailure());
+			runner.CaughtExceptions.Count.ShouldBeGreaterThan(0);
 		}
 	}


Suppress sporadic exceptions from JumpList creation code (#9928)

--- src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
+++ src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
@@ -200,7 +200,19 @@
                 // The JumpList does persist as long as the filepath of the executable does not change but there
                 // could be disruptions to it like e.g. the bi-annual Windows update, we decided to
                 // not over-optimize this and always create the JumpList as a non-blocking background task instead.
-                Task.Run(() => TaskbarJumpList.CreateElevatedEntry(ConsoleHostStrings.RunAsAdministrator));
+                Task.Run(() =>
+                {
+                    try
+                    {
+                        TaskbarJumpList.CreateElevatedEntry(ConsoleHostStrings.RunAsAdministrator);
+                    }
+                    catch
+                    {
+                        // Sporadic failures have been observed in some environments. Since the JumpList persists once it
+                        // has been registered, there is no harm suppressing the occasional failure.
+                    }
+                }
+                );
 #endif

                 // First check for and handle PowerShell running in a server mode.


Modified default name pattern - it should always start from a letter

--- src/NoiseLab.PolyGen.Core/FluentConfiguration/BuilderBase.cs
+++ src/NoiseLab.PolyGen.Core/FluentConfiguration/BuilderBase.cs
@@ -4,7 +4,6 @@
 {
     public abstract class BuilderBase
     {
-        // TODO: Most likely, name cannot start from number.
-        protected static readonly Regex DefaultNamePattern = new Regex(@"^[a-zA-Z0-9_]*$");
+        protected static readonly Regex DefaultNamePattern = new Regex(@"^[a-zA-Z]{1}[a-zA-Z0-9_]*$");
     }
 }


Added private geter and public setter.

Added private geter and public setter.

--- CS/cslanguage.cs
+++ CS/cslanguage.cs
@@ -525,6 +525,9 @@

                 // Having a public getter, but an internal to class only setter
                 public int Y { get; internal set; }
+
+                // Having a private getter, and a public setter
+                public int Z { private get; set;}
             }


magic consts in global code

magic consts in global code

- __METHOD__ in global fix
- code cleanup

--- src/Peachpie.CodeAnalysis/FlowAnalysis/ExpressionAnalysis.cs
+++ src/Peachpie.CodeAnalysis/FlowAnalysis/ExpressionAnalysis.cs
@@ -1747,46 +1747,50 @@

                 case PseudoConstUse.Types.Class:
                 case PseudoConstUse.Types.Trait:
-                    var containingtype = ((LangElement)Routine.Syntax).ContainingType;
-                    if (containingtype != null)
-                    {
-                        var intrait = containingtype.MemberAttributes.IsTrait();
-
-                        value = containingtype.QualifiedName.ToString();
-
-                        if (intrait && x.Type == PseudoConstUse.Types.Class)
-                        {
-                            // __CLASS__ inside trait resolved in runtime
-                            x.TypeRefMask = TypeCtx.GetStringTypeMask();
-                            return;
-                        }
-
-                        if (!intrait && x.Type == PseudoConstUse.Types.Trait)
-                        {
-                            // __TRAIT__ inside class is empty string
+                    {
+                        var containingtype = x.PhpSyntax.ContainingType;
+                        if (containingtype != null)
+                        {
+                            var intrait = containingtype.MemberAttributes.IsTrait();
+
+                            value = containingtype.QualifiedName.ToString();
+
+                            if (intrait && x.Type == PseudoConstUse.Types.Class)
+                            {
+                                // __CLASS__ inside trait resolved in runtime
+                                x.TypeRefMask = TypeCtx.GetStringTypeMask();
+                                return;
+                            }
+
+                            if (!intrait && x.Type == PseudoConstUse.Types.Trait)
+                            {
+                                // __TRAIT__ inside class is empty string
+                                value = string.Empty;
+                            }
+                        }
+                        else
+                        {
                             value = string.Empty;
                         }
                     }
-                    else
+                    break;
+
+                case PseudoConstUse.Types.Method:
+                    if (Routine == null)
                     {
                         value = string.Empty;
                     }
-                    break;
-
-                case PseudoConstUse.Types.Method:
-
-                    if (Routine is SourceLambdaSymbol)
+                    else if (Routine is SourceLambdaSymbol)
                     {
                         // value = __CLASS__::"{closure}"; // PHP 5
                         value = "{closure}";    // PHP 7+
                     }
                     else
                     {
-                        value = Routine != null
-                            ? TypeCtx.SelfType is IPhpTypeSymbol
-                                ? ((IPhpTypeSymbol)TypeCtx.SelfType).FullName.ToString(new Name(Routine.Name), false)
-                                : Routine.Name
-                            : string.Empty;
+                        var containingtype = x.PhpSyntax.ContainingType;
+                        value = containingtype != null
+                            ? containingtype.QualifiedName.ToString(new Name(Routine.RoutineName), false)
+                            : Routine.RoutineName;
                     }
                     break;

@@ -1797,7 +1801,9 @@
                     }
                     else
                     {
-                        value = Routine != null ? Routine.RoutineName : string.Empty;
+                        value = Routine != null
+                            ? Routine.RoutineName
+                            : string.Empty;
                     }
                     break;


Removed BringToFron

Removed BringToFron

--- src/PushAndMerge/Dialogs/PushAndMergeDialog.SelectProject.cs
+++ src/PushAndMerge/Dialogs/PushAndMergeDialog.SelectProject.cs
@@ -55,7 +55,6 @@
                 return PushAndMergeHandler.ExecuteAsync(DialogOwner, _sourceProject, targetProjectShell.Project, _pushAndMergeOptions, null);
             });

-            targetProjectShell.PrimaryMainForm.BringToFrontEx();
             Close();
         }


fixed class name

fixed class name

--- source/nuPickers-FlickrPickers/DataSources/PhotoSet.cs
+++ source/nuPickers-FlickrPickers/DataSources/PhotoSet.cs
@@ -5,7 +5,7 @@
     using System.Collections.Generic;
     using System.Linq;

-    public class PhotosInGallery : IDotNetDataSource
+    public class PhotoSet : IDotNetDataSource
     {
         [DotNetDataSource(Title = "Flickr API Key", Description = "(required)")]
         public string ApiKey { get; set; }


Add unit test

Add unit test


[CON-4047] Employer accounts Vacancy DTO requires new status' added as part of "Collaborate" journey in order to map the response from the API.

--- src/SFA.DAS.EmployerAccounts/Models/Recruit/VacancyStatus.cs
+++ src/SFA.DAS.EmployerAccounts/Models/Recruit/VacancyStatus.cs
@@ -3,8 +3,10 @@
     public enum VacancyStatus
     {
         Draft,
+        Review,
+        Rejected, // Rejected by employer during "Collaborate"
         Submitted,
-        Referred, // rejected
+        Referred, // Rejected by QA
         Live,
         Closed,
         Approved


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestNumberOfOccurrences.cs
+++ UnitTestUsefullFunctions/UnitTestNumberOfOccurrences.cs
@@ -175,5 +175,15 @@
       int result = StringFunc.NumberOfOccurrences(source1, source2);
       Assert.AreEqual(result, expected);
     }
+
+    [TestMethod]
+    public void TestMethod_NumberOfOccurrences_brown_fox_d_1()
+    {
+      const string source1 = "d";
+      const string source2 = "The quick brown fox jumps over the lazy dog";
+      const int expected = 1;
+      int result = StringFunc.NumberOfOccurrences(source1, source2);
+      Assert.AreEqual(result, expected);
+    }
   }
 }


entitymanager: fixed DestroyAllEntities()-Method

--- Unity/Assets/GameFramework/Modules/ECS/EntityManager.cs
+++ Unity/Assets/GameFramework/Modules/ECS/EntityManager.cs
@@ -193,9 +193,9 @@
         /// Destroy all entities
         /// </summary>
         public void DestroyAllEntities() {
-            foreach (var e in _entities.Keys) {
-                var entity = e;
-                DestroyEntity(ref entity);
+            while (_entities.Count > 0) {
+                var entity = _entities.ElementAt(0).Key;
+                DestroyEntity(ref entity );
             }
         }


Add test for GetAssemblyName including Culture=neutral

--- src/Tasks.UnitTests/AssemblyDependency/SuggestedRedirects.cs
+++ src/Tasks.UnitTests/AssemblyDependency/SuggestedRedirects.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Reflection;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Shared;
 using Microsoft.Build.Tasks;
@@ -445,5 +446,22 @@
             Assert.Equal(0, t.SuggestedRedirects.Length);
             Assert.Equal(0, e.Warnings); // "Should only be no warning about suggested redirects."
         }
+
+        // It is hard to write a test that will fail with the root cause of https://github.com/Microsoft/msbuild/issues/4002
+        // because it requires reading real files from disk and we mock GetAssemblyName in RAR tests.
+        //
+        // So to add some coverage, simply check that we get a Culture=neutral when enumerating references of this test
+        // assembly.
+        [Fact]
+        public void RealGetAssemblyNameIncludesCulture()
+        {
+            using (var info = new AssemblyInformation(Assembly.GetExecutingAssembly().Location))
+            {
+                foreach (var dependency in info.Dependencies)
+                {
+                    Assert.Contains("Culture=neutral", dependency.ToString());
+                }
+            }
+        }
     }
 }


Unity zapper controller framecounts to 1

--- Unity/zapper-shooter/Assets/Scripts/ZapperController.cs
+++ Unity/zapper-shooter/Assets/Scripts/ZapperController.cs
@@ -24,8 +24,8 @@

     private int getFrameCountForState(DisplayState state) {
         switch(state) {
-        case DisplayState.BLANK_FRAME: return 2;
-        case DisplayState.TARGET: return 2;
+        case DisplayState.BLANK_FRAME: return 1;
+        case DisplayState.TARGET: return 1;
         default: return -1;
         }
     }


recommitting, the build server just died for some reason

--- src/Umbraco.Tests/Services/PropertyValidationServiceTests.cs
+++ src/Umbraco.Tests/Services/PropertyValidationServiceTests.cs
@@ -124,7 +124,7 @@
             p3.SetValue("Hello", "en-US"); //ignored since this is variant
             var p4 = new Property(new PropertyType(dataType, "test4") { Mandatory = true, Variations = ContentVariation.Nothing });
             p4.SetValue(null, null); //invalid
-
+
             var content = Mock.Of<IContent>(
                 x => x.Properties == new PropertyCollection(new[] { p1, p2, p3, p4 }));


Fix the tests.

Fix the tests.

--- WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
+++ WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
@@ -73,7 +73,7 @@
 		public Height Height
 		{
 			get => _height;
-			private set
+			set
 			{
 				if (RaiseAndSetIfChanged(ref _height, value))
 				{
@@ -88,7 +88,7 @@
 		public SmartLabel Label
 		{
 			get => _label;
-			private set => RaiseAndSetIfChanged(ref _label, value);
+			set => RaiseAndSetIfChanged(ref _label, value);
 		}

 		public TxoRef[] SpentOutputs
@@ -112,7 +112,7 @@
 		public uint256 SpenderTransactionId
 		{
 			get => _spenderTransactionId;
-			private set
+			set
 			{
 				if (RaiseAndSetIfChanged(ref _spenderTransactionId, value))
 				{
@@ -124,7 +124,7 @@
 		public bool CoinJoinInProgress
 		{
 			get => _coinJoinInProgress;
-			private set
+			set
 			{
 				if (RaiseAndSetIfChanged(ref _coinJoinInProgress, value))
 				{
@@ -136,7 +136,7 @@
 		public DateTimeOffset? BannedUntilUtc
 		{
 			get => _bannedUntilUtc;
-			private set
+			set
 			{
 				// ToDo: IsBanned does not get notified when it gets unbanned.
 				if (RaiseAndSetIfChanged(ref _bannedUntilUtc, value))
@@ -152,7 +152,7 @@
 		public bool SpentAccordingToBackend
 		{
 			get => _spentAccordingToBackend;
-			private set
+			set
 			{
 				if (RaiseAndSetIfChanged(ref _spentAccordingToBackend, value))
 				{
@@ -176,13 +176,13 @@
 		public ISecret Secret
 		{
 			get => _secret;
-			private set => RaiseAndSetIfChanged(ref _secret, value);
+			set => RaiseAndSetIfChanged(ref _secret, value);
 		}

 		public Cluster Clusters
 		{
 			get => _clusters;
-			private set => RaiseAndSetIfChanged(ref _clusters, value);
+			set => RaiseAndSetIfChanged(ref _clusters, value);
 		}

 		#region DependentProperties


Support edge case: first object, next an array. (#643)

--- src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs
+++ src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs
@@ -152,13 +152,17 @@
                     {
                         string propertyName = schemaProperty.Key;
                         var openApiSchema = schemaProperty.Value;
-                        if (openApiSchema.GetSchemaType() == SchemaType.Object)
+                        if (openApiSchema.GetSchemaType() == SchemaType.Object || openApiSchema.GetSchemaType() == SchemaType.Array)
                         {
                             var mapped = MapSchemaToObject(schemaProperty.Value, schemaProperty.Key);
                             if (mapped is JProperty jp)
                             {
                                 propertyAsJObject.Add(jp);
                             }
+                            else
+                            {
+                                propertyAsJObject.Add(new JProperty(schemaProperty.Key, mapped));
+                            }
                         }
                         else
                         {


Return error if item not found (for debuging angular error)

--- Web/Areas/EarlyWarning/Controllers/RequestController.cs
+++ Web/Areas/EarlyWarning/Controllers/RequestController.cs
@@ -755,6 +755,10 @@
                     target.Beneficiaries = regionalRequestDetail.Beneficiaries;
                     _regionalRequestDetailService.EditRegionalRequestDetail(target);
                 }
+                else
+                {
+                    return View();
+                }
             }

             return Json(new[] { regionalRequestDetail }.ToDataSourceResult(request, ModelState));


Document non-null return values

Document non-null return values

--- src/Workspaces/Core/Portable/Storage/SQLite/NativeMethods.cs
+++ src/Workspaces/Core/Portable/Storage/SQLite/NativeMethods.cs
@@ -24,6 +24,8 @@

             try
             {
+                // Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
+                // will be true when the handle is not usable, but the handle instance can be disposed either way.
                 return new SafeSqliteHandle(wrapper);
             }
             catch
@@ -45,6 +47,8 @@

             try
             {
+                // Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
+                // will be true when the handle is not usable, but the handle instance can be disposed either way.
                 return new SafeSqliteStatementHandle(db, wrapper);
             }
             catch
@@ -66,6 +70,8 @@

             try
             {
+                // Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
+                // will be true when the handle is not usable, but the handle instance can be disposed either way.
                 return new SafeSqliteBlobHandle(db, wrapper);
             }
             catch


Removed unused namespaces

Removed unused namespaces

--- src/base/common/providers/data/IConnectionProviderFactory.cs
+++ src/base/common/providers/data/IConnectionProviderFactory.cs
@@ -1,8 +1,5 @@
 using System;
-using System.Collections;
 using System.Collections.Generic;
-using System.Data;
-using Nohros.Configuration;

 namespace Nohros.Data.Providers
 {


Added Test for non default overide behavior

--- Wyam.Modules.Metadata.Tests/DirectoryMetadataFixture.cs
+++ Wyam.Modules.Metadata.Tests/DirectoryMetadataFixture.cs
@@ -152,7 +152,7 @@
                         documentsIndex[documents[SUB_LOCAL]],
                         documentsIndex[documents[SUB_INHIRED]],
                         documentsIndex[documents[INHIRED]]
-                    )],$"Metadata should be the one of the {SUB_SITE}.");
+                    )], $"Metadata should be the one of the {SUB_SITE}.");

             // if File metadata is Missinge it must be from sub_local
             Assert.AreEqual(documentsIndex[documents[SUB_LOCAL]],
@@ -171,6 +171,54 @@
                         documentsIndex[documents[INHIRED]]
                     )], $"Metadata should be the one of the {SUB_INHIRED}.");
         }
+
+        [Test]
+        public void TestOverrideBehaviorWithOverideEnabled()
+        {
+            // Given
+
+            IExecutionContext context;
+            IDictionary<string, IDocument> documents;
+            IDictionary<IDocument, int> documentsIndex;
+            Dictionary<IDocument, IDictionary<string, object>> cloneDictionary;
+            Setup(out context, out documents, out documentsIndex, out cloneDictionary);
+
+            DirectoryMetadata directoryMetadata = new DirectoryMetadata().WithOverride();
+
+            // When
+            var returnedDocuments = directoryMetadata.Execute(new List<IDocument>(documents.Values), context).ToList();  // Make sure to materialize the result list
+
+            // Then
+
+            // if Metadata is in all take from sub_Local
+            Assert.AreEqual(documentsIndex[documents[SUB_LOCAL]],
+                cloneDictionary[documents[SUB_SITE]]
+                    [ListAllMetadata(6,
+                        documentsIndex[documents[SUB_SITE]],
+                        documentsIndex[documents[SUB_LOCAL]],
+                        documentsIndex[documents[SUB_INHIRED]],
+                        documentsIndex[documents[INHIRED]]
+                    )], $"Metadata should be the one of the {SUB_LOCAL}.");
+
+
+            // if sub_local is missing it is from sub_inhired
+            Assert.AreEqual(documentsIndex[documents[SUB_INHIRED]],
+                cloneDictionary[documents[SUB_SITE]]
+                    [ListAllMetadata(6,
+                        documentsIndex[documents[SUB_SITE]],
+                        documentsIndex[documents[SUB_INHIRED]],
+                        documentsIndex[documents[INHIRED]]
+                    )], $"Metadata should be the one of the {SUB_INHIRED}.");
+
+            // if sub_inhired is missing it is from inhired
+            Assert.AreEqual(documentsIndex[documents[INHIRED]],
+                cloneDictionary[documents[SUB_SITE]]
+                    [ListAllMetadata(6,
+                        documentsIndex[documents[SUB_SITE]],
+                        documentsIndex[documents[INHIRED]]
+                    )], $"Metadata should be the one of the {INHIRED}.");
+        }
+

         #region TestHelper


fix double experience messaging from scripts

--- hybrasyl/Scripting/HybrasylUser.cs
+++ hybrasyl/Scripting/HybrasylUser.cs
@@ -618,7 +618,6 @@
         /// <returns>true</returns>
         public bool GiveExperience(int exp)
         {
-            SystemMessage($"{exp} experience!");
             User.GiveExperience((uint)exp);
             return true;
         }


Now showing correct pass number in output

--- ConverterForm.cs
+++ ConverterForm.cs
@@ -129,7 +129,7 @@
                 currentPass++;
                 if (currentPass < passes && !_cancelMultipass)
                 {
-                    textBoxOutput.AppendText(string.Format("\n--- ENTERING PASS {0} ---", currentPass));
+                    textBoxOutput.AppendText(string.Format("\n--- ENTERING PASS {0} ---", currentPass + 1));

                     MultiPass(arguments, ffmpeg); //Sort of recursion going on here, be careful with stack overflows and shit
                     return;


Reduce flicker/disappearance of activePrintLabel control

--- ActionBar/PrintStatusRow.cs
+++ ActionBar/PrintStatusRow.cs
@@ -261,6 +261,9 @@

 		private void UpdatePrintStatus()
 		{
+			string printLabel = "Next Print".Localize() + ":";
+			string printerStatus = activePrintStatus.Text;
+
 			if (PrinterConnectionAndCommunication.Instance.ActivePrintItem != null)
 			{
 				int totalSecondsInPrint = PrinterConnectionAndCommunication.Instance.TotalSecondsInPrint;
@@ -296,52 +299,53 @@
 					}
 				}

-				activePrintLabel.Text = "Next Print".Localize() + ":";
-
 				switch (PrinterConnectionAndCommunication.Instance.CommunicationState)
 				{
 					case PrinterConnectionAndCommunication.CommunicationStates.PreparingToPrint:
-						activePrintLabel.Text = "Preparing To Print".Localize() + ":";
+						printLabel = "Preparing To Print".Localize() + ":";
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.Printing:
-						activePrintLabel.Text = PrinterConnectionAndCommunication.Instance.PrintingStateString;
-						activePrintStatus.Text = totalPrintTimeText;
+						printLabel = PrinterConnectionAndCommunication.Instance.PrintingStateString;
+						printerStatus = totalPrintTimeText;
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.Paused:
-						activePrintLabel.Text = "Printing Paused".Localize() + ":";
-						activePrintStatus.Text = totalPrintTimeText;
+						printLabel = "Printing Paused".Localize() + ":";
+						printerStatus = totalPrintTimeText;
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.FinishedPrint:
-						activePrintLabel.Text = "Done Printing".Localize() + ":";
-						activePrintStatus.Text = totalPrintTimeText;
+						printLabel = "Done Printing".Localize() + ":";
+						printerStatus = totalPrintTimeText;
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.Disconnected:
-						activePrintStatus.Text = "Not connected. Press 'Connect' to enable printing.".Localize();
+						printerStatus = "Not connected. Press 'Connect' to enable printing.".Localize();
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.AttemptingToConnect:
-						activePrintStatus.Text = "Attempting to Connect".Localize() + "...";
+						printerStatus = "Attempting to Connect".Localize() + "...";
 						break;

 					case PrinterConnectionAndCommunication.CommunicationStates.ConnectionLost:
 					case PrinterConnectionAndCommunication.CommunicationStates.FailedToConnect:
-						activePrintStatus.Text = "Connection Failed".Localize() + ": " + PrinterConnectionAndCommunication.Instance.ConnectionFailureMessage;
+						printerStatus = "Connection Failed".Localize() + ": " + PrinterConnectionAndCommunication.Instance.ConnectionFailureMessage;
 						break;

 					default:
-						activePrintStatus.Text = ActiveSliceSettings.Instance.PrinterSelected ? "" : "Select a Printer.".Localize();
+						printerStatus = ActiveSliceSettings.Instance.PrinterSelected ? "" : "Select a Printer.".Localize();
 						break;
 				}
 			}
 			else
 			{
-				activePrintLabel.Text = "Next Print".Localize() + ":";
-				activePrintStatus.Text = "Press 'Add' to choose an item to print".Localize();
-			}
+				printLabel = "Next Print".Localize() + ":";
+				printerStatus = "Press 'Add' to choose an item to print".Localize();
+			}
+
+			activePrintLabel.Text = printLabel;
+			activePrintStatus.Text = printerStatus;
 		}
 	}
 }


bugfix

bugfix

--- AppMetrics/LogEvent.ashx.cs
+++ AppMetrics/LogEvent.ashx.cs
@@ -72,7 +72,7 @@
 			}
 			catch (Exception exc)
 			{
-				Report(exc);
+				ReportLog(exc);
 #if DEBUG
 				context.Response.Write(exc);
 #endif
@@ -127,17 +127,17 @@
 			{
 				var count = Interlocked.Exchange(ref _requestCounter, 0);
 				if (count != 0)
-					Report(string.Format("Requests per second: {0}", count), Priority.Low);
+					ReportLog(string.Format("Requests per second: {0}", count), Priority.Low);
 			}
 			catch (Exception exc)
 			{
-				Report(exc);
+				ReportLog(exc);
 			}
 		}

 		enum Priority { Low, High }

-		static void Report(object val, Priority priority = Priority.High)
+		static void ReportLog(object val, Priority priority = Priority.High)
 		{
 			try
 			{
@@ -148,7 +148,7 @@

 				if (_logFile != null)
 				{
-					var time = DateTime.Now;
+					var time = DateTime.UtcNow;
 					bool multiLineData = text.Contains('\n');
 					if (multiLineData)
 					{


Fix RandomNext behaviour (#2212)

Fix RandomNext behaviour (#2212)

--- ArchiSteamFarm/Utilities.cs
+++ ArchiSteamFarm/Utilities.cs
@@ -208,7 +208,7 @@
 				case < 0:
 					throw new ArgumentOutOfRangeException(nameof(maxValue));
 				case <= 1:
-					return maxValue;
+					return 0;
 				default:
 					lock (Random) {
 						return Random.Next(maxValue);


chipStick comes back if you drop or throw it


Moved mode checkboxes into a single Game Mode selector.

--- Assets/Scripts/FaceCards.cs
+++ Assets/Scripts/FaceCards.cs
@@ -11,21 +11,30 @@
 	const float btnWidth = 64;
 	const float btnHSpacing = 4;
 	const float btnWidthSpaced = (btnWidth + btnHSpacing);
+	const float comboSpacing = 100 + btnHSpacing * 2;
+	const float xStartComboBoxes = 128;

 	public ColorPicker bgColorPicker;	// Background color picker

 	List<string> roles;
 	int iDeptFilter = 0;    // 0 = all departments included. > 0 means a single department roles[iDeptFilter-1] is included.

+	int iGameMode = 0;
+
 	float score;

+	// Departments
 	GUIContent[] comboBoxList;
 	private ComboBox comboBoxControl;// = new ComboBox();
 	private GUIStyle listStyle = new GUIStyle();

-
+	// Guess Name
 	GUIContent[] comboBoxListName;
 	private ComboBox comboBoxControlName;// = new ComboBox();
+
+	// Game Mode
+	GUIContent[] comboBoxListMode;
+	private ComboBox comboBoxControlMode;// = new ComboBox();

 	public int debugMaxCards = 0;	// greater than 0 the set limit on number of cards.
 	public GameObject faceCardPrefab;
@@ -173,6 +182,8 @@

 	void SetupRolesComboBox()
 	{
+		float xComboBox = xStartComboBoxes;
+
 		comboBoxList = new GUIContent[roles.Count+1];
 		comboBoxList[0] = new GUIContent("All Depts");
 		for (int i = 0; i < roles.Count; i++)
@@ -188,16 +199,25 @@
 		listStyle.padding.top =
 		listStyle.padding.bottom = 4;

-		comboBoxControl = new ComboBox(new Rect(btnWidthSpaced + btnHSpacing*2, Screen.height - btnHeightSpaced, 100, btnHeight), comboBoxList[0], comboBoxList, "button", "box", listStyle);
-
-
+		comboBoxControl = new ComboBox(new Rect(xComboBox, Screen.height - btnHeightSpaced, 100, btnHeight), comboBoxList[0], comboBoxList, "button", "box", listStyle);
+
+		xComboBox += comboSpacing;
+
 		// What part of name they need to enter
 		comboBoxListName = new GUIContent[4];
 		comboBoxListName[0] = new GUIContent("First & Last");
 		comboBoxListName[1] = new GUIContent("First Name");
 		comboBoxListName[2] = new GUIContent("Last Name");
 		comboBoxListName[3] = new GUIContent("Department");
-		comboBoxControlName = new ComboBox(new Rect(btnWidthSpaced + btnHSpacing * 2 + 100 + btnHSpacing * 2, Screen.height - btnHeightSpaced, 100, btnHeight), comboBoxListName[0], comboBoxListName, "button", "box", listStyle);
+		comboBoxControlName = new ComboBox(new Rect(xComboBox, Screen.height - btnHeightSpaced, 100, btnHeight), comboBoxListName[0], comboBoxListName, "button", "box", listStyle);
+
+		xComboBox += comboSpacing;
+
+		comboBoxListMode = new GUIContent[3];
+		comboBoxListMode[0] = new GUIContent("Typing Game");
+		comboBoxListMode[1] = new GUIContent("Flash Cards");
+		comboBoxListMode[2] = new GUIContent("Yearbook");
+		comboBoxControlMode = new ComboBox(new Rect(xComboBox, Screen.height - btnHeightSpaced, 100, btnHeight), comboBoxListMode[0], comboBoxListMode, "button", "box", listStyle);

 	}

@@ -226,9 +246,12 @@

 		if (comboBoxControl != null)
 		{
-			const int xCombo = 128;
+			float xCombo = xStartComboBoxes;
+			comboBoxControlMode.Reposition(new Rect(xCombo, Screen.height - btnHeightSpaced, 100, btnHeight));
+			xCombo += comboSpacing;
 			comboBoxControl.Reposition(new Rect(xCombo, Screen.height - btnHeightSpaced, 100, btnHeight));
-			comboBoxControlName.Reposition(new Rect(xCombo + 100 + btnHSpacing * 2, Screen.height - btnHeightSpaced, 100, btnHeight));
+			xCombo += comboSpacing;
+			comboBoxControlName.Reposition(new Rect(xCombo, Screen.height - btnHeightSpaced, 100, btnHeight));
 		}

 #if false
@@ -963,6 +986,10 @@
 				}
 			}

+			bool showAllFacesBefore = showAllFaces;
+			bool isYearBookModeBefore = isYearBookMode;
+			iGameMode = comboBoxControlMode.Show();
+
 			rectText = guiTextName.GetScreenRect(Camera.main);
 			if (guiTextName.text.Length == 0)
 			{
@@ -986,13 +1013,13 @@
 			const float caseBtnWidth = 110;
 			caseSensitive = GUI.Toggle(new Rect(btnHSpacing, Screen.height - btnHeightSpaced * 1, caseBtnWidth, btnHeight), caseSensitive, "Case-sensitive");

-			bool yearBookModeNew = GUI.Toggle(new Rect(btnHSpacing, Screen.height - btnHeightSpaced * 2, caseBtnWidth, btnHeight), isYearBookMode, "Yearbook");
-			if (yearBookModeNew != isYearBookMode)
-				ChangeYearBookMode(yearBookModeNew);
-
-
-			bool showAllFacesBefore = showAllFaces;
-			showAllFaces = GUI.Toggle(new Rect(btnHSpacing, Screen.height - btnHeightSpaced*3, 80, btnHeight), showAllFaces, "Show All");
+			isYearBookMode = (iGameMode == 2);//GUI.Toggle(new Rect(btnHSpacing, Screen.height - btnHeightSpaced * 2, caseBtnWidth, btnHeight), isYearBookMode, "Yearbook");
+			showAllFaces = (iGameMode == 1);//GUI.Toggle(new Rect(btnHSpacing, Screen.height - btnHeightSpaced*3, 80, btnHeight), showAllFaces, "Show All");
+
+			if (isYearBookMode != isYearBookModeBefore)
+				ChangeYearBookMode(isYearBookMode);
+
+
 			if (showAllFaces != showAllFacesBefore)
 			{
 				if (showAllFaces)
@@ -1006,7 +1033,8 @@
 				}
 				else
 				{
-					RestartGame();
+					if (iGameMode == 0)
+						RestartGame();
 #if false
 					guiTextName.text = "";
 					guiTextRole.text = "";


Timer View: Supports multiple animators.

--- Assets/Scripts/TimerView.cs
+++ Assets/Scripts/TimerView.cs
@@ -1,14 +1,14 @@
+using System.Collections.Generic;
 using UnityEngine;

 namespace Finegamedesign.Utils
 {
-	[RequireComponent(typeof(Animator))]
 	public sealed class TimerView : MonoBehaviour
 	{
 		public Timer model;
 		public string state = "begin";

-		private Animator animator;
+		public List<Animator> animators;

 		public static TimerView[] Binds(Timer model, TimerView[] timers)
 		{
@@ -25,12 +25,20 @@

 		private void Start()
 		{
-			animator = GetComponent<Animator>();
+			if (animators == null || animators.Count == 0)
+			{
+				animators = new List<Animator>();
+				animators.Add(GetComponent<Animator>());
+			}
 		}

 		private void Update()
 		{
-			animator.Play(state, -1, model.normal);
+			for (int index = 0, end = animators.Count; index < end; ++index)
+			{
+				Animator animator = animators[index];
+				animator.Play(state, -1, model.normal);
+			}
 		}
 	}
 }


Update code to have documentation

Update code to have documentation

--- Assets/src/RotatingHints.cs
+++ Assets/src/RotatingHints.cs
@@ -30,7 +30,7 @@
 using System.Collections;

 /**
- * A rotating hints behaviour script
+ * A rotating hints behaviour class
  *
  * This takes a list of hint strings, and slowly updates a UnityEngine.UI.Text
  * field and replaces the content prefixed with the string "Hint: ".  The
@@ -40,15 +40,40 @@
  * @author	Gerwin van de Steeg
  * @see		UnityEngine.UI
  *
- */
+  */
 public class RotatingHints : MonoBehaviour {
+	/**
+	 * The hints to display
+	 */
 	public string[] hints;
+	/**
+	 * The time interval in seconds before changing the displayed
+	 * hint to the next value.
+	 */
 	public float timeInterval = 15;
+	/**
+	 * The time the hint was last changed since the start of the
+	 * GameObject creation.
+	 */
 	private float lastUpdate;
+	/**
+	 * index counter into the hints list
+	 */
 	private int index = 0;
+	/**
+	 * The UnityEngine.UI.Text object we will be manipulating
+	 */
 	private Text textField;

-	// Use this for initialization
+	/**
+	 * Start method called upon when the GameObject this script
+	 * is attached to becomes Active for the first time
+	 *
+	 * This method initialises the private variables we care about
+	 * and does a couple of Assertions to ensure we are configured
+	 * correctly.
+	 *
+	 */
 	void Start () {
 		// initialise the last updated timestamp
 		lastUpdate = Time.time;
@@ -56,23 +81,22 @@
 		textField = gameObject.GetComponent<Text> ();
 		Assert.IsNotNull (textField, "No text field component");
 		Assert.IsTrue (hints.Length > 0,  "No hints configured");
+		Assert.IsNull (hints.Length >= index, "Initial index too large");
 	}

-	// Update is called once per frame
+	/**
+	 * Every fixed framerate frame we check whether or not we need
+	 * to update the Hint being displayed.
+	 *
+	 */
 	void FixedUpdate () {
-		// disable hints if no hints exist
-		if (hints.Length > 0) {
-			gameObject.SetActive (true);
-			float now = Time.time;
-			float diff = now - lastUpdate;
-			if (diff > timeInterval) {
-				lastUpdate = now;
-				// use modulo to ensure we stay inside the hints length
-				textField.text = "Hint: " + hints [index % hints.Length].ToString ();
-				index++;
-			}
-		} else {
-			gameObject.SetActive (false);
+		float now = Time.time;
+		float diff = now - lastUpdate;
+		if (diff > timeInterval) {
+			lastUpdate = now;
+			// use modulo to ensure we stay inside the hints length
+			textField.text = "Hint: " + hints [index % hints.Length].ToString ();
+			index++;
 		}
 	}
 }


#640 Fix item inspect sroll size.

#640 Fix item inspect sroll size.

--- unity/Assets/Scripts/Quest/InventoryWindowMoM.cs
+++ unity/Assets/Scripts/Quest/InventoryWindowMoM.cs
@@ -53,7 +53,7 @@

             xOffset += 9;
         }
-        scrollArea.SetScrollSize(xOffset - UIScaler.GetHCenter(-16));
+        scrollArea.SetScrollSize(xOffset);

         ui = new UIElement();
         ui.SetLocation(UIScaler.GetHCenter(-4f), 24.5f, 8, 2);


feat(manager)

feat(manager)

add players searching for game

--- src/csharp-steamgaug-es-api-core/Manager/SteamgaugManager.cs
+++ src/csharp-steamgaug-es-api-core/Manager/SteamgaugManager.cs
@@ -226,6 +226,33 @@
             }
         }

+        public int GetPlayersSearching(Game game)
+        {
+            updateResponseModel();
+            int? playersSearching = null;
+            if (game == Game.TeamFortress)
+            {
+                throw new GameNotSupportedException();
+            }
+            else if (game == Game.CounterStrikeGlobalOffensive)
+            {
+                playersSearching = _steamgaugResponseModel.SteamGameCoordinator["570"].Stats.SpyScore;
+            }
+            else if (game == Game.DotaTwo)
+            {
+                playersSearching = _steamgaugResponseModel.SteamGameCoordinator["730"].Stats.SpyScore;
+            }
+
+            if (playersSearching == null)
+            {
+                throw new SteamgaugOfflineException();
+            }
+            else
+            {
+                return playersSearching.Value;
+            }
+        }
+
         public int GetEngineScore(Game game)
         {
             if (game != Game.TeamFortress)


Fix #31 : Remove() implementation.

Fix #31 : Remove() implementation.

--- sources/HDocument/HQuery/ElementExtensions.cs
+++ sources/HDocument/HQuery/ElementExtensions.cs
@@ -351,5 +351,25 @@

         #endregion

+        #region Remove()
+
+        /// <summary>
+        /// Remove the set of elements
+        /// </summary>
+        public IEnumerable<HNode> Remove(this IEnumerable<HNode> nodes)
+        {
+            if (nodes != null)
+            {
+                foreach (var node in nodes)
+                {
+                    if (node != null)
+                        node.Remove();
+                }
+            }
+            return nodes;
+        }
+
+        #endregion
+
     }
 }


add height validation to blockchain constructor

--- BitSharp.Data/Blockchain.cs
+++ BitSharp.Data/Blockchain.cs
@@ -21,6 +21,8 @@

         public Blockchain(ImmutableList<ChainedBlock> blockList, ImmutableHashSet<UInt256> blockListHashes, ImmutableHashSet<TxOutputKey> utxo)
         {
+            Debug.Assert(blockList.Last().Height == blockList.Count - 1);
+
             this._blockList = blockList;
             this._blockListHashes = blockListHashes;
             this._utxo = utxo;


Fix a typo.

Fix a typo.

--- src/BibleBot.Backend/Controllers/CommandsController.cs
+++ src/BibleBot.Backend/Controllers/CommandsController.cs
@@ -31,7 +31,7 @@

             _commandGroups = new List<ICommandGroup>
             {
-                new CommandGroups.Settings.VersionsGroup(_userService, _guildService)
+                new CommandGroups.Settings.VersionGroup(_userService, _guildService)
             };
         }