Corrected issues with simultaneous read/writes during a transaction during meta-data exchange.

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

--- Source/Libraries/GSF.TimeSeries/Transport/DataSubscriber.cs
+++ Source/Libraries/GSF.TimeSeries/Transport/DataSubscriber.cs
@@ -2705,7 +2705,7 @@

                         // Determine the active node ID - we cache this since this value won't change for the lifetime of this class
                         if (m_nodeID == Guid.Empty)
-                            m_nodeID = Guid.Parse(command.ExecuteScalar(string.Format("SELECT NodeID FROM IaonInputAdapter WHERE ID = {0}", ID), m_metadataSynchronizationTimeout).ToString());
+                            m_nodeID = Guid.Parse(command.ExecuteScalar(string.Format("SELECT NodeID FROM IaonInputAdapter WHERE ID = {0}", (int)ID), m_metadataSynchronizationTimeout).ToString());

                         // Determine the protocol record auto-inc ID value for the gateway transport protocol (GEP) - this value is also cached since it shouldn't change for the lifetime of this class
                         if (m_gatewayProtocolID == 0)
@@ -2778,7 +2778,7 @@
                             bool interconnectionNameFieldExists = deviceDetailColumns.Contains("InterconnectionName");

                             // Older versions of GEP did not include the AccessID field, so this is treated as optional
-                            object accessID = DBNull.Value;
+                            int accessID = 0;

                             foreach (DataRow row in deviceRows)
                             {
@@ -2791,12 +2791,7 @@
                                 if (!row["IsConcentrator"].ToNonNullString("0").ParseBoolean())
                                 {
                                     if (accessIDFieldExists)
-                                    {
-                                        // Using ConvertNullableField extension since publisher could use SQLite database in which case
-                                        // all integers would arrive in data set as longs and need to be converted back to integers
-                                        int? id = row.ConvertNullableField<int>("accessID");
-                                        accessID = id.HasValue ? (object)id.Value : (object)DBNull.Value;
-                                    }
+                                        accessID = (int)row.Field<long>("AccessID");

                                     // Get longitude and latitude values if they are defined
                                     longitude = 0M;
@@ -2877,21 +2872,17 @@
                                 // Sort unique ID list so that binary search can be used for quick lookups
                                 uniqueIDs.Sort();

-                                // Query all the unique guid-based ID's for all device records associated with the parent device
-                                IDataReader reader = command.ExecuteReader(queryUniqueDeviceIDsSql, m_metadataSynchronizationTimeout, parentID);
+                                DataTable deviceUniqueIDs = command.RetrieveData(database.AdapterType, queryUniqueDeviceIDsSql, m_metadataSynchronizationTimeout, parentID);
                                 Guid uniqueID;

-                                // Walk through each database record and see if the device exists in the provided meta-data
-                                while (reader.Read())
+                                foreach (DataRow deviceRow in deviceUniqueIDs.Rows)
                                 {
-                                    uniqueID = reader.GetGuid(0);
+                                    uniqueID = database.Guid(deviceRow, "UniqueID");

                                     // Remove any devices in the database that are associated with the parent device and do not exist in the meta-data
                                     if (uniqueIDs.BinarySearch(uniqueID) < 0)
-                                        command.ExecuteNonQuery(deleteDeviceSql, m_metadataSynchronizationTimeout, uniqueID);
+                                        command.ExecuteNonQuery(deleteDeviceSql, m_metadataSynchronizationTimeout, uniqueID);
                                 }
-
-                                reader.Close();
                                 UpdateSyncProgress();
                             }
                         }
@@ -3008,13 +2999,13 @@
                                 signalIDs.Sort();

                                 // Query all the guid-based signal ID's for all measurement records associated with the parent device using run-time ID
-                                IDataReader reader = command.ExecuteReader(queryMeasurementSignalIDsSql, m_metadataSynchronizationTimeout, ID);
+                                DataTable measurementSignalIDs = command.RetrieveData(database.AdapterType, queryMeasurementSignalIDsSql, m_metadataSynchronizationTimeout, (int)ID);
                                 Guid signalID;

                                 // Walk through each database record and see if the measurement exists in the provided meta-data
-                                while (reader.Read())
+                                foreach (DataRow measurementRow in measurementSignalIDs.Rows)
                                 {
-                                    signalID = reader.GetGuid(0);
+                                    signalID = database.Guid(measurementRow, "SignalID");

                                     // Remove any measurements in the database that are associated with received devices and do not exist in the meta-data
                                     if (signalIDs.BinarySearch(signalID) < 0)
@@ -3030,7 +3021,6 @@
                                     }
                                 }

-                                reader.Close();
                                 UpdateSyncProgress();
                             }
                         }


GSF.TimeSeries: Fixed code to parse the useLocalClockAsRealTime setting in DataSubscriber.

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

--- Source/Libraries/GSF.TimeSeries/Transport/DataSubscriber.cs
+++ Source/Libraries/GSF.TimeSeries/Transport/DataSubscriber.cs
@@ -1389,7 +1389,7 @@
             if (!settings.TryGetValue("bufferSize", out setting) || !int.TryParse(setting, out bufferSize))
                 bufferSize = ClientBase.DefaultReceiveBufferSize;

-            if (!settings.TryGetValue("useLocalClockAsRealTime", out setting))
+            if (settings.TryGetValue("useLocalClockAsRealTime", out setting))
                 m_useLocalClockAsRealTime = setting.ParseBoolean();

             if (m_autoConnect)


Add equivalency specs to test task

Add equivalency specs to test task

--- Build/Build.cs
+++ Build/Build.cs
@@ -115,13 +115,18 @@
         .DependsOn(Compile)
         .Executes(() =>
         {
+            Project[] projects = new[]
+            {
+                Solution.Specs.FluentAssertions_Specs,
+                Solution.Specs.FluentAssertions_Equivalency_Specs
+            };
+
             if (EnvironmentInfo.IsWin)
             {
                 Xunit2(s =>
                 {
-                    IReadOnlyCollection<string> testAssemblies = GlobFiles(
-                        Solution.Specs.FluentAssertions_Specs.Directory,
-                        "bin/Debug/net47/*.Specs.dll");
+                    IEnumerable<string> testAssemblies = projects
+                        .SelectMany(project => GlobFiles(project.Directory, "bin/Debug/net47/*.Specs.dll"));

                     Assert.NotEmpty(testAssemblies.ToList());

@@ -132,14 +137,20 @@
             }

             DotNetTest(s => s
-                .SetProjectFile(Solution.Specs.FluentAssertions_Specs)
                 .SetConfiguration("Debug")
                 .EnableNoBuild()
                 .SetDataCollector("XPlat Code Coverage")
                 .SetResultsDirectory(RootDirectory / "TestResults")
                 .CombineWith(
-                    Solution.Specs.FluentAssertions_Specs.GetTargetFrameworks().Except(new[] { "net47" }),
-                    (_, v) => _.SetFramework(v)));
+                    projects,
+                    (_, project) => _
+                        .SetProjectFile(project)
+                        .CombineWith(
+                            project.GetTargetFrameworks().Except(new[] { "net47" }),
+                            (_, framework) => _.SetFramework(framework)
+                        )
+                )
+            );

             ReportGenerator(s => s
                 .SetProcessToolPath(ToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net5.0"))


perf: minor

perf: minor

--- src/MR.Augmenter/IAugmenter.Default.cs
+++ src/MR.Augmenter/IAugmenter.Default.cs
@@ -64,7 +64,9 @@
 								// The nested object is an array. This means we should apply the
 								// wrapper's configuration to all items in the array.

-								var nestedList = new List<object>();
+								var nestedList = (nestedObject as IList) != null ?
+									new List<object>((nestedObject as IList).Count) :
+									new List<object>();
 								AugmentArray(nestedObject, property, nestedList, state,
 									BuildList(property.TypeConfiguration, wrapper.TypeConfiguration));
 								root[property.PropertyInfo.Name] = nestedList;


added FLOP formula to the NumCIL n-body

added FLOP formula to the NumCIL n-body

--- benchmark/CIL/Csharp/nbody/nbody.cs
+++ benchmark/CIL/Csharp/nbody/nbody.cs
@@ -425,7 +425,7 @@
 			b.t0.Mul(dt, b.t0);
 			b.vz.Add(b.t0, b.vz);
 		}
-
+		//FLOP count: i*(s*s*3+s*s*29) where s is #bodies and i is iterations
 		private static void Move(Galaxy galaxy)
 		{
 			CalcForce(galaxy);


Implement hat support + sane limitations

--- osu.Framework/Input/Handlers/Joystick/OpenTKJoystickHandler.cs
+++ osu.Framework/Input/Handlers/Joystick/OpenTKJoystickHandler.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using osu.Framework.Input.Bindings;
 using osu.Framework.Logging;
 using osu.Framework.MathUtils;
 using osu.Framework.Platform;
@@ -89,19 +90,56 @@

         private class OpenTKJoystickState : JoystickState
         {
+            /// <summary>
+            /// Arbitrary amount of axes supported by the osu!framework.
+            /// We can raise this to 64 (max supported by OpenTK) with appropriate implementation in <see cref="InputKey"/> if needed.
+            /// </summary>
+            private const int max_axes = 10;
+
+            /// <summary>
+            /// Arbitrary amount of buttons supported by the osu!framework.
+            /// We can raise this to 64 (max supported by OpenTK) with appropriate implementation in <see cref="InputKey"/> if needed.
+            /// </summary>
+            private const int max_buttons = 20;
+
+            /// <summary>
+            /// OpenTK only supports 4 hats.
+            /// </summary>
+            private const int max_hats = 4;
+
             private const float dead_zone = 0.1f;

             public OpenTKJoystickState(JoystickDevice device)
             {
-                Axes = Enumerable.Range(0, device.Capabilities.AxisCount).Select(i => device.State.GetAxis(i)).ToList();
-                Buttons = Enumerable.Range(0, device.Capabilities.ButtonCount).Where(i => device.State.GetButton(i) == ButtonState.Pressed).Select(i => (JoystickButton)i)
-                                    .Concat(Axes.Where(a => !Precision.AlmostEquals(a, 0, dead_zone)).Select((axisValue, index) =>
-                                    {
-                                        if (axisValue < 0)
-                                            return JoystickButton.FirstAxisNegativeButton + index;
-                                        return JoystickButton.FirstAxisPositiveButton + index;
-                                    })).ToList();
+                Axes = Enumerable.Range(0, max_axes).Select(i => device.State.GetAxis(i))
+                                 // To not break compatibility if more axes are added in the future, pad axes to 64 elements
+                                 .Concat(Enumerable.Repeat(0f, 64 - max_axes))
+                                 // Convert each hat to a pair of axes
+                                 .Concat(Enumerable.Range(0, max_hats).Select(i => device.State.GetHat(JoystickHat.Hat0 + i)).SelectMany(hatToAxes))
+                                 .ToList();

+                Buttons = Enumerable.Range(0, max_buttons).Where(i => device.State.GetButton(i) == ButtonState.Pressed).Select(i => (JoystickButton)i)
+                                    // Convert each axis to a button state
+                                    .Concat(Axes.Where(a => !Precision.AlmostEquals(a, 0, dead_zone))
+                                                .Select((axisValue, index) => (axisValue < 0 ? JoystickButton.AxisNegative1 : JoystickButton.AxisPositive1) + index))
+                                    .ToList();
+            }
+
+            private float[] hatToAxes(JoystickHatState hatState)
+            {
+                float xAxis = 0;
+                float yAxis = 0;
+
+                if (hatState.IsLeft)
+                    xAxis = -1;
+                else if (hatState.IsRight)
+                    xAxis = 1;
+                if (hatState.IsDown)
+                    yAxis = -1;
+                else if (hatState.IsUp)
+                    yAxis = 1;
+
+                return new[] { xAxis, yAxis };
             }
         }


Fixed bug #1672045 - "DTSTART" property MUST be represented in local in timezones

git-svn-id: 95472bb50cfb75dbf91fed26dc933cae36d5c45c@48 1ca100b6-b014-4248-a4f8-5dbb9f49130a

--- DDay.iCal/Components/Timezone/TimeZoneInfo.cs
+++ DDay.iCal/Components/Timezone/TimeZoneInfo.cs
@@ -72,6 +72,34 @@
             }

             /// <summary>
+            /// Force the DTSTART into a local date-time value.
+            ///
+            /// From RFC 2445:
+            /// The mandatory "DTSTART" property gives the effective onset date and
+            /// local time for the time zone sub-component definition. "DTSTART" in
+            /// this usage MUST be specified as a local DATE-TIME value.
+            ///
+            /// Also from RFC 2445:
+            /// The date with local time form is simply a date-time value that does
+            /// not contain the UTC designator nor does it reference a time zone. For
+            /// example, the following represents Janurary 18, 1998, at 11 PM:
+            ///
+            /// DTSTART:19980118T230000
+            /// </summary>
+            [Serialized, DefaultValueType("DATE-TIME"), DisallowedTypes("DATE", "DATE-TIME")]
+            public override Date_Time DTStart
+            {
+                get
+                {
+                    return base.DTStart;
+                }
+                set
+                {
+                    base.DTStart = value;
+                }
+            }
+
+            /// <summary>
             /// Returns a typed copy of the TimeZoneInfo object.
             /// </summary>
             /// <returns>A typed copy of the TimeZoneInfo object.</returns>


Update Source/Libraries/openXDA.Configuration/DataPusherSection.cs

Co-authored-by: Stephen C. Wills <6e690a6576e01cdb9a9715cfd3e6df766c93f1c7@gridprotectionalliance.org>

--- Source/Libraries/openXDA.Configuration/DataPusherSection.cs
+++ Source/Libraries/openXDA.Configuration/DataPusherSection.cs
@@ -1,5 +1,5 @@
 //******************************************************************************************************
-//  FilePrunerSection.cs - Gbtc
+//  DataPusherSection.cs - Gbtc
 //
 //  Copyright © 2021, Grid Protection Alliance.  All Rights Reserved.
 //


Use explicit primitive type specification

--- osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
+++ osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
@@ -114,7 +114,7 @@
             if (selectionPerformed)
             {
                 // only unmodified right click should show context menu
-                var shouldShowContextMenu = e.Button == MouseButton.Right && !e.ShiftPressed && !e.AltPressed && !e.SuperPressed;
+                bool shouldShowContextMenu = e.Button == MouseButton.Right && !e.ShiftPressed && !e.AltPressed && !e.SuperPressed;

                 // stop propagation if not showing context menu
                 return !shouldShowContextMenu;


Update incorrect reference

Update incorrect reference

--- osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
+++ osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
@@ -231,7 +231,7 @@

         private void onDragRequested(SelectionBlueprint blueprint, DragEvent dragEvent)
         {
-            HitObject draggedObject = blueprint.HitObject.HitObject;
+            HitObject draggedObject = blueprint.DrawableObject.HitObject;

             Vector2 movePosition = blueprint.ScreenSpaceMovementStartPosition + dragEvent.ScreenSpaceMousePosition - dragEvent.ScreenSpaceMouseDownPosition;
             Vector2 snappedPosition = composer.GetSnappedPosition(ToLocalSpace(movePosition));


Show tooltips for beatmap set panels

Show tooltips for beatmap set panels

--- osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs
+++ osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs
@@ -190,7 +190,7 @@
             private readonly BindableBool filtered = new BindableBool();

             public FilterableDifficultyIcon(CarouselBeatmap item)
-                : base(item.Beatmap)
+                : base(item.Beatmap, shouldShowTooltip: true)
             {
                 filtered.BindTo(item.Filtered);
                 filtered.ValueChanged += isFiltered => Schedule(() => this.FadeTo(isFiltered.NewValue ? 0.1f : 1, 100));


Fixed reference in code comment

Fixed reference in code comment

--- pMixins.CodeGenerator/Pipelines/CodeGenerationPipelineState.cs
+++ pMixins.CodeGenerator/Pipelines/CodeGenerationPipelineState.cs
@@ -20,6 +20,7 @@
 using CopaceticSoftware.CodeGenerator.StarterKit;
 using CopaceticSoftware.CodeGenerator.StarterKit.Infrastructure;
 using CopaceticSoftware.Common.Infrastructure;
+using CopaceticSoftware.pMixins.Attributes;
 using CopaceticSoftware.pMixins.CodeGenerator.Infrastructure;
 using CopaceticSoftware.pMixins.CodeGenerator.Pipelines.GenerateCode;
 using CopaceticSoftware.pMixins.CodeGenerator.Pipelines.ResolveAttributes;
@@ -64,7 +65,7 @@

         /// <summary>
         /// Dictionary of <see cref="pMixinAttributeResolvedResultBase"/> representing
-        /// the <see cref="IpMixinAttribute"/>s parsed in the source, and mapped to each
+        /// the <see cref="IPMixinAttribute"/>s parsed in the source, and mapped to each
         /// parsed class.
         /// </summary>
         public Dictionary<TypeDeclaration, IList<pMixinAttributeResolvedResultBase>> PartialClassLevelResolvedpMixinAttributes { get; private set; }


Remove unnecessary analyzer extensions

Remove unnecessary analyzer extensions

--- StyleCop.Analyzers/StyleCop.Analyzers/AnalyzerExtensions.cs
+++ StyleCop.Analyzers/StyleCop.Analyzers/AnalyzerExtensions.cs
@@ -37,10 +37,11 @@
         /// <remarks>This method honors exclusions.</remarks>
         /// <param name="context">The analysis context.</param>
         /// <param name="action">Action to be executed at completion of parsing of a document.</param>
-        public static void RegisterSyntaxTreeActionHonorExclusions(this CompilationStartAnalysisContext context, Action<SyntaxTreeAnalysisContext> action)
+        public static void RegisterSyntaxTreeActionHonorExclusions(this CompilationStartAnalysisContext context, Action<SyntaxTreeAnalysisContext, StyleCopSettings> action)
         {
             Compilation compilation = context.Compilation;
             ConcurrentDictionary<SyntaxTree, bool> cache = GetOrCreateGeneratedDocumentCache(compilation);
+            StrongBox<StyleCopSettings> settingsCache = GetOrCreateStyleCopSettingsCache(compilation);

             context.RegisterSyntaxTreeAction(
                 c =>
@@ -54,27 +55,184 @@
                     // MSBuild metadata, if analyzers have access to it.
                     //// TODO: code here

+                    StyleCopSettings settings = settingsCache.Value;
+                    if (settings == null)
+                    {
+                        StyleCopSettings updatedSettings = SettingsHelper.GetStyleCopSettings(c.Options, c.CancellationToken);
+                        StyleCopSettings previous = Interlocked.CompareExchange(ref settingsCache.Value, updatedSettings, null);
+                        settings = previous ?? updatedSettings;
+                    }
+
+                    action(c, settings);
+                });
+        }
+
+        /// <summary>
+        /// Gets or creates a cache which can be used with <see cref="GeneratedCodeAnalysisExtensions"/> methods to
+        /// efficiently determine whether or not a source file is considered generated.
+        /// </summary>
+        /// <param name="compilation">The compilation which the cache applies to.</param>
+        /// <returns>A cache which tracks the syntax trees in a compilation which are considered generated.</returns>
+        public static ConcurrentDictionary<SyntaxTree, bool> GetOrCreateGeneratedDocumentCache(this Compilation compilation)
+        {
+            var headerCache = generatedHeaderCache;
+
+            Compilation cachedCompilation;
+            if (!headerCache.Item1.TryGetTarget(out cachedCompilation) || cachedCompilation != compilation)
+            {
+                var replacementCache = Tuple.Create(new WeakReference<Compilation>(compilation), new ConcurrentDictionary<SyntaxTree, bool>());
+                while (true)
+                {
+                    var prior = Interlocked.CompareExchange(ref generatedHeaderCache, replacementCache, headerCache);
+                    if (prior == headerCache)
+                    {
+                        headerCache = replacementCache;
+                        break;
+                    }
+
+                    headerCache = prior;
+                    if (headerCache.Item1.TryGetTarget(out cachedCompilation) && cachedCompilation == compilation)
+                    {
+                        break;
+                    }
+                }
+            }
+
+            return headerCache.Item2;
+        }
+
+        /// <summary>
+        /// Gets a <see cref="StrongBox{T}"/> which can store a <see cref="StyleCopSettings"/> instance to improve
+        /// efficiency across multiple analyzers which examine settings.
+        /// </summary>
+        /// <param name="compilation">The compilation which the cache applies to.</param>
+        /// <returns>A <see cref="StrongBox{T}"/> which can store a <see cref="StyleCopSettings"/> instance.</returns>
+        public static StrongBox<StyleCopSettings> GetOrCreateStyleCopSettingsCache(this Compilation compilation)
+        {
+            var currentSettingsCache = settingsCache;
+
+            Compilation cachedCompilation;
+            if (!currentSettingsCache.Item1.TryGetTarget(out cachedCompilation) || cachedCompilation != compilation)
+            {
+                var replacementCache = Tuple.Create(new WeakReference<Compilation>(compilation), new StrongBox<StyleCopSettings>(null));
+                while (true)
+                {
+                    var prior = Interlocked.CompareExchange(ref settingsCache, replacementCache, currentSettingsCache);
+                    if (prior == currentSettingsCache)
+                    {
+                        currentSettingsCache = replacementCache;
+                        break;
+                    }
+
+                    currentSettingsCache = prior;
+                    if (currentSettingsCache.Item1.TryGetTarget(out cachedCompilation) && cachedCompilation == compilation)
+                    {
+                        break;
+                    }
+                }
+            }
+
+            return currentSettingsCache.Item2;
+        }
+
+        /// <summary>
+        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
+        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
+        /// collect state information to be used by other syntax node actions or code block end actions.
+        /// </summary>
+        /// <remarks>This method honors exclusions.</remarks>
+        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches
+        /// <paramref name="syntaxKind"/>.</param>
+        /// <param name="action">Action to be executed at completion of semantic analysis of a
+        /// <see cref="SyntaxNode"/>.</param>
+        /// <param name="syntaxKind">The kind of syntax that should be analyzed.</param>
+        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
+        /// the action applies.</typeparam>
+        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext> action, TLanguageKindEnum syntaxKind)
+            where TLanguageKindEnum : struct
+        {
+            context.RegisterSyntaxNodeActionHonorExclusions(action, LanguageKindArrays<TLanguageKindEnum>.GetOrCreateArray(syntaxKind));
+        }
+
+        /// <summary>
+        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
+        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
+        /// collect state information to be used by other syntax node actions or code block end actions.
+        /// </summary>
+        /// <remarks>This method honors exclusions.</remarks>
+        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches
+        /// <paramref name="syntaxKind"/>.</param>
+        /// <param name="action">Action to be executed at completion of semantic analysis of a
+        /// <see cref="SyntaxNode"/>.</param>
+        /// <param name="syntaxKind">The kind of syntax that should be analyzed.</param>
+        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
+        /// the action applies.</typeparam>
+        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext, StyleCopSettings> action, TLanguageKindEnum syntaxKind)
+            where TLanguageKindEnum : struct
+        {
+            context.RegisterSyntaxNodeActionHonorExclusions(action, LanguageKindArrays<TLanguageKindEnum>.GetOrCreateArray(syntaxKind));
+        }
+
+        /// <summary>
+        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
+        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
+        /// collect state information to be used by other syntax node actions or code block end actions.
+        /// </summary>
+        /// <remarks>This method honors exclusions.</remarks>
+        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches one of
+        /// the <paramref name="syntaxKinds"/> values.</param>
+        /// <param name="action">Action to be executed at completion of semantic analysis of a
+        /// <see cref="SyntaxNode"/>.</param>
+        /// <param name="syntaxKinds">The kinds of syntax that should be analyzed.</param>
+        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
+        /// the action applies.</typeparam>
+        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds)
+            where TLanguageKindEnum : struct
+        {
+            Compilation compilation = context.Compilation;
+            ConcurrentDictionary<SyntaxTree, bool> cache = GetOrCreateGeneratedDocumentCache(compilation);
+
+            context.RegisterSyntaxNodeAction(
+                c =>
+                {
+                    if (c.IsGenerated(cache))
+                    {
+                        return;
+                    }
+
+                    // Honor the containing document item's ExcludeFromStylecop=True
+                    // MSBuild metadata, if analyzers have access to it.
+                    //// TODO: code here
+
                     action(c);
-                });
-        }
-
-        /// <summary>
-        /// Register an action to be executed at completion of parsing of a code document. A syntax tree action reports
-        /// diagnostics about the <see cref="SyntaxTree"/> of a document.
-        /// </summary>
-        /// <remarks>This method honors exclusions.</remarks>
-        /// <param name="context">The analysis context.</param>
-        /// <param name="action">Action to be executed at completion of parsing of a document.</param>
-        public static void RegisterSyntaxTreeActionHonorExclusions(this CompilationStartAnalysisContext context, Action<SyntaxTreeAnalysisContext, StyleCopSettings> action)
+                },
+                syntaxKinds);
+        }
+
+        /// <summary>
+        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
+        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
+        /// collect state information to be used by other syntax node actions or code block end actions.
+        /// </summary>
+        /// <remarks>This method honors exclusions.</remarks>
+        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches one of
+        /// the <paramref name="syntaxKinds"/> values.</param>
+        /// <param name="action">Action to be executed at completion of semantic analysis of a
+        /// <see cref="SyntaxNode"/>.</param>
+        /// <param name="syntaxKinds">The kinds of syntax that should be analyzed.</param>
+        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
+        /// the action applies.</typeparam>
+        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext, StyleCopSettings> action, ImmutableArray<TLanguageKindEnum> syntaxKinds)
+            where TLanguageKindEnum : struct
         {
             Compilation compilation = context.Compilation;
             ConcurrentDictionary<SyntaxTree, bool> cache = GetOrCreateGeneratedDocumentCache(compilation);
             StrongBox<StyleCopSettings> settingsCache = GetOrCreateStyleCopSettingsCache(compilation);

-            context.RegisterSyntaxTreeAction(
+            context.RegisterSyntaxNodeAction(
                 c =>
                 {
-                    if (c.IsGeneratedDocument(cache))
+                    if (c.IsGenerated(cache))
                     {
                         return;
                     }
@@ -92,196 +250,10 @@
                     }

                     action(c, settings);
-                });
-        }
-
-        /// <summary>
-        /// Gets or creates a cache which can be used with <see cref="GeneratedCodeAnalysisExtensions"/> methods to
-        /// efficiently determine whether or not a source file is considered generated.
-        /// </summary>
-        /// <param name="compilation">The compilation which the cache applies to.</param>
-        /// <returns>A cache which tracks the syntax trees in a compilation which are considered generated.</returns>
-        public static ConcurrentDictionary<SyntaxTree, bool> GetOrCreateGeneratedDocumentCache(this Compilation compilation)
-        {
-            var headerCache = generatedHeaderCache;
-
-            Compilation cachedCompilation;
-            if (!headerCache.Item1.TryGetTarget(out cachedCompilation) || cachedCompilation != compilation)
-            {
-                var replacementCache = Tuple.Create(new WeakReference<Compilation>(compilation), new ConcurrentDictionary<SyntaxTree, bool>());
-                while (true)
-                {
-                    var prior = Interlocked.CompareExchange(ref generatedHeaderCache, replacementCache, headerCache);
-                    if (prior == headerCache)
-                    {
-                        headerCache = replacementCache;
-                        break;
-                    }
-
-                    headerCache = prior;
-                    if (headerCache.Item1.TryGetTarget(out cachedCompilation) && cachedCompilation == compilation)
-                    {
-                        break;
-                    }
-                }
-            }
-
-            return headerCache.Item2;
-        }
-
-        /// <summary>
-        /// Gets a <see cref="StrongBox{T}"/> which can store a <see cref="StyleCopSettings"/> instance to improve
-        /// efficiency across multiple analyzers which examine settings.
-        /// </summary>
-        /// <param name="compilation">The compilation which the cache applies to.</param>
-        /// <returns>A <see cref="StrongBox{T}"/> which can store a <see cref="StyleCopSettings"/> instance.</returns>
-        public static StrongBox<StyleCopSettings> GetOrCreateStyleCopSettingsCache(this Compilation compilation)
-        {
-            var currentSettingsCache = settingsCache;
-
-            Compilation cachedCompilation;
-            if (!currentSettingsCache.Item1.TryGetTarget(out cachedCompilation) || cachedCompilation != compilation)
-            {
-                var replacementCache = Tuple.Create(new WeakReference<Compilation>(compilation), new StrongBox<StyleCopSettings>(null));
-                while (true)
-                {
-                    var prior = Interlocked.CompareExchange(ref settingsCache, replacementCache, currentSettingsCache);
-                    if (prior == currentSettingsCache)
-                    {
-                        currentSettingsCache = replacementCache;
-                        break;
-                    }
-
-                    currentSettingsCache = prior;
-                    if (currentSettingsCache.Item1.TryGetTarget(out cachedCompilation) && cachedCompilation == compilation)
-                    {
-                        break;
-                    }
-                }
-            }
-
-            return currentSettingsCache.Item2;
-        }
-
-        /// <summary>
-        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
-        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
-        /// collect state information to be used by other syntax node actions or code block end actions.
-        /// </summary>
-        /// <remarks>This method honors exclusions.</remarks>
-        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches
-        /// <paramref name="syntaxKind"/>.</param>
-        /// <param name="action">Action to be executed at completion of semantic analysis of a
-        /// <see cref="SyntaxNode"/>.</param>
-        /// <param name="syntaxKind">The kind of syntax that should be analyzed.</param>
-        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
-        /// the action applies.</typeparam>
-        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext> action, TLanguageKindEnum syntaxKind)
-            where TLanguageKindEnum : struct
-        {
-            context.RegisterSyntaxNodeActionHonorExclusions(action, LanguageKindArrays<TLanguageKindEnum>.GetOrCreateArray(syntaxKind));
-        }
-
-        /// <summary>
-        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
-        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
-        /// collect state information to be used by other syntax node actions or code block end actions.
-        /// </summary>
-        /// <remarks>This method honors exclusions.</remarks>
-        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches
-        /// <paramref name="syntaxKind"/>.</param>
-        /// <param name="action">Action to be executed at completion of semantic analysis of a
-        /// <see cref="SyntaxNode"/>.</param>
-        /// <param name="syntaxKind">The kind of syntax that should be analyzed.</param>
-        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
-        /// the action applies.</typeparam>
-        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext, StyleCopSettings> action, TLanguageKindEnum syntaxKind)
-            where TLanguageKindEnum : struct
-        {
-            context.RegisterSyntaxNodeActionHonorExclusions(action, LanguageKindArrays<TLanguageKindEnum>.GetOrCreateArray(syntaxKind));
-        }
-
-        /// <summary>
-        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
-        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
-        /// collect state information to be used by other syntax node actions or code block end actions.
-        /// </summary>
-        /// <remarks>This method honors exclusions.</remarks>
-        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches one of
-        /// the <paramref name="syntaxKinds"/> values.</param>
-        /// <param name="action">Action to be executed at completion of semantic analysis of a
-        /// <see cref="SyntaxNode"/>.</param>
-        /// <param name="syntaxKinds">The kinds of syntax that should be analyzed.</param>
-        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
-        /// the action applies.</typeparam>
-        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds)
-            where TLanguageKindEnum : struct
-        {
-            Compilation compilation = context.Compilation;
-            ConcurrentDictionary<SyntaxTree, bool> cache = GetOrCreateGeneratedDocumentCache(compilation);
-
-            context.RegisterSyntaxNodeAction(
-                c =>
-                {
-                    if (c.IsGenerated(cache))
-                    {
-                        return;
-                    }
-
-                    // Honor the containing document item's ExcludeFromStylecop=True
-                    // MSBuild metadata, if analyzers have access to it.
-                    //// TODO: code here
-
-                    action(c);
                 },
                 syntaxKinds);
         }

-        /// <summary>
-        /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an
-        /// appropriate kind. A syntax node action can report diagnostics about a <see cref="SyntaxNode"/>, and can also
-        /// collect state information to be used by other syntax node actions or code block end actions.
-        /// </summary>
-        /// <remarks>This method honors exclusions.</remarks>
-        /// <param name="context">Action will be executed only if the kind of a <see cref="SyntaxNode"/> matches one of
-        /// the <paramref name="syntaxKinds"/> values.</param>
-        /// <param name="action">Action to be executed at completion of semantic analysis of a
-        /// <see cref="SyntaxNode"/>.</param>
-        /// <param name="syntaxKinds">The kinds of syntax that should be analyzed.</param>
-        /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which
-        /// the action applies.</typeparam>
-        public static void RegisterSyntaxNodeActionHonorExclusions<TLanguageKindEnum>(this CompilationStartAnalysisContext context, Action<SyntaxNodeAnalysisContext, StyleCopSettings> action, ImmutableArray<TLanguageKindEnum> syntaxKinds)
-            where TLanguageKindEnum : struct
-        {
-            Compilation compilation = context.Compilation;
-            ConcurrentDictionary<SyntaxTree, bool> cache = GetOrCreateGeneratedDocumentCache(compilation);
-            StrongBox<StyleCopSettings> settingsCache = GetOrCreateStyleCopSettingsCache(compilation);
-
-            context.RegisterSyntaxNodeAction(
-                c =>
-                {
-                    if (c.IsGenerated(cache))
-                    {
-                        return;
-                    }
-
-                    // Honor the containing document item's ExcludeFromStylecop=True
-                    // MSBuild metadata, if analyzers have access to it.
-                    //// TODO: code here
-
-                    StyleCopSettings settings = settingsCache.Value;
-                    if (settings == null)
-                    {
-                        StyleCopSettings updatedSettings = SettingsHelper.GetStyleCopSettings(c.Options, c.CancellationToken);
-                        StyleCopSettings previous = Interlocked.CompareExchange(ref settingsCache.Value, updatedSettings, null);
-                        settings = previous ?? updatedSettings;
-                    }
-
-                    action(c, settings);
-                },
-                syntaxKinds);
-        }
-
         private static class LanguageKindArrays<TLanguageKindEnum>
             where TLanguageKindEnum : struct
         {


Knoten löschen foreach in for schleife

Knoten löschen foreach in for schleife

--- BBT/MindMap.cs
+++ BBT/MindMap.cs
@@ -66,9 +66,10 @@

                 if (recursive)
                 {
-                    foreach (TreeElement child in knoten.children)
+                    for (int count = knoten.children.Count-1; count >= 0; count-- )
                     {
-                        this._mindmap.removeNode(child.node);
+                        TreeElement child = knoten.children[count];
+                        this._mindmap.removeNode(child.node, true);
                     }
                 }
                 this.children.Remove(knoten);
@@ -143,7 +144,7 @@
             if (element == null)
                 throw new ENodeIsNull("der übergebene Knoten ist null!");
             TreeElement knoten = this._nodeRegistry.getAnyChild(element);
-            if (knoten == null)
+            if ((knoten == null) || (this._nodeRegistry.node == element))
                 throw new ENodeNotExist("Den Knoten, den du löschen wolltes, gibt es nicht oder ist der Hauptknoten.");

             TreeElement parent = knoten.parent;


Viewer: Added explicit z-indexes to xaml rendering

--- src/Mzinga.Viewer/XamlBoardRenderer.cs
+++ src/Mzinga.Viewer/XamlBoardRenderer.cs
@@ -166,6 +166,8 @@
             CanvasOffsetX = 0.0;
             CanvasOffsetX = 0.0;

+            int z = BoardCanvas.ZIndex;
+
             if (null != board)
             {
                 Point minPoint = new Point(double.MaxValue, double.MaxValue);
@@ -198,6 +200,7 @@
                 HexOrientation hexOrientation = MainViewModel.ViewerConfig.HexOrientation;

                 // Draw the pieces in play
+                z++;
                 for (int stack = 0; stack <= maxStack; stack++)
                 {
                     if (piecesInPlay.ContainsKey(stack))
@@ -217,17 +220,19 @@
                             HexType hexType = (Enums.GetColor(pieceName) == PlayerColor.White) ? HexType.WhitePiece : HexType.BlackPiece;

                             Shape hex = GetHex(center, size, hexType, hexOrientation);
+                            hex.ZIndex = z;
                             BoardCanvas.Children.Add(hex);

                             bool disabled = MainViewModel.ViewerConfig.DisablePiecesInPlayWithNoMoves && !(null != validMoves && validMoves.Any(m => m.PieceName == pieceName));

                             var hexText = MainViewModel.ViewerConfig.PieceStyle == PieceStyle.Text ? GetPieceText(center, size, pieceName, disabled) : GetPieceGraphics(center, size, pieceName, disabled);
-
+                            hexText.ZIndex = z + 1;
                             BoardCanvas.Children.Add(hexText);

                             minPoint = Min(center, size, minPoint);
                             maxPoint = Max(center, size, maxPoint);
                         }
+                        z += 2;
                     }
                 }

@@ -280,12 +285,14 @@
                 // Highlight last move played
                 if (MainViewModel.AppVM.ViewerConfig.HighlightLastMovePlayed)
                 {
+                    z++;
                     // Highlight the lastMove start position
                     if (lastMoveStart.HasValue)
                     {
                         Point center = GetPoint(lastMoveStart.Value, size, hexOrientation, true);

                         Shape hex = GetHex(center, size, HexType.LastMove, hexOrientation);
+                        hex.ZIndex = z;
                         BoardCanvas.Children.Add(hex);

                         minPoint = Min(center, size, minPoint);
@@ -298,6 +305,7 @@
                         Point center = GetPoint(lastMoveEnd.Value, size, hexOrientation, true);

                         Shape hex = GetHex(center, size, HexType.LastMove, hexOrientation);
+                        hex.ZIndex = z;
                         BoardCanvas.Children.Add(hex);

                         minPoint = Min(center, size, minPoint);
@@ -308,6 +316,7 @@
                 // Highlight the selected piece
                 if (MainViewModel.AppVM.ViewerConfig.HighlightTargetMove)
                 {
+                    z++;
                     if (selectedPieceName != PieceName.INVALID)
                     {
                         Position selectedPiecePosition = board.GetPosition(selectedPieceName);
@@ -317,6 +326,7 @@
                             Point center = GetPoint(selectedPiecePosition, size, hexOrientation, true);

                             Shape hex = GetHex(center, size, HexType.SelectedPiece, hexOrientation);
+                            hex.ZIndex = z;
                             BoardCanvas.Children.Add(hex);

                             minPoint = Min(center, size, minPoint);
@@ -328,6 +338,7 @@
                 // Draw the valid moves for that piece
                 if (MainViewModel.AppVM.ViewerConfig.HighlightValidMoves)
                 {
+                    z++;
                     if (selectedPieceName != PieceName.INVALID && null != validMoves)
                     {
                         foreach (Move validMove in validMoves)
@@ -337,6 +348,7 @@
                                 Point center = GetPoint(validMove.Destination, size, hexOrientation);

                                 Shape hex = GetHex(center, size, HexType.ValidMove, hexOrientation);
+                                hex.ZIndex = z;
                                 BoardCanvas.Children.Add(hex);

                                 minPoint = Min(center, size, minPoint);
@@ -349,11 +361,13 @@
                 // Highlight the target position
                 if (MainViewModel.AppVM.ViewerConfig.HighlightTargetMove)
                 {
+                    z++;
                     if (targetPosition.HasValue)
                     {
                         Point center = GetPoint(targetPosition.Value, size, hexOrientation, true);

                         Shape hex = GetHex(center, size, HexType.SelectedMove, hexOrientation);
+                        hex.ZIndex = z;
                         BoardCanvas.Children.Add(hex);

                         minPoint = Min(center, size, minPoint);
@@ -384,15 +398,16 @@

                     foreach (var child in BoardCanvas.Children)
                     {
-                        if (child is Border hexLabel) // Hex labels
-                        {
-                            Canvas.SetLeft(hexLabel, Canvas.GetLeft(hexLabel) + offsetX);
-                            Canvas.SetTop(hexLabel, Canvas.GetTop(hexLabel) + offsetY);
-                        }
-                        else if (child is Shape hex) // Hexes
-                        {
-                            hex.RenderTransform = translate;
-                        }
+                        child.RenderTransform = translate;
+                        //if (child is Border hexLabel) // Hex labels
+                        //{
+                        //    Canvas.SetLeft(hexLabel, Canvas.GetLeft(hexLabel) + offsetX);
+                        //    Canvas.SetTop(hexLabel, Canvas.GetTop(hexLabel) + offsetY);
+                        //}
+                        //else if (child is Shape hex) // Hexes
+                        //{
+                        //    hex.RenderTransform = translate;
+                        //}
                     }

                     CanvasOffsetX = offsetX;


Read & use individual issue severity if present

--- src/NVika/Parsers/InspectCodeParser.cs
+++ src/NVika/Parsers/InspectCodeParser.cs
@@ -44,7 +44,7 @@
                         Line = lineNumber,
                         Message = issue.Attribute("Message").Value,
                         Name = issue.Attribute("TypeId").Value,
-                        Severity = GetSeverity(issueType.Attribute("Severity")),
+                        Severity = GetSeverity(issue.Attribute("Severity"), issueType.Attribute("Severity")),
                         Offset = GetOffset(offsetAttribute, sourceFilePath, lineNumber),
                         Source = Name,
                     };
@@ -84,9 +84,14 @@
             };
         }

-        private static IssueSeverity GetSeverity(XAttribute severityAttribute)
+        private static IssueSeverity GetSeverity(XAttribute issueSeverity, XAttribute issueTypeSeverity)
         {
-            switch (severityAttribute.Value)
+            // The severity type is always present on the issue type element,
+            // but it is also overridden by an individual issue's severity, if one is present.
+            // See: https://www.jetbrains.com/help/resharper/InspectCode.html#understanding-output
+            var finalSeverity = issueSeverity?.Value ?? issueTypeSeverity.Value;
+
+            switch (finalSeverity)
             {
                 case "HINT": return IssueSeverity.Hint;


License in source

License in source

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


Accidentally loading the textures twice, which could cause it to fail with an invalid path.

--- OpenGLTutorial16/OpenGLTutorial16/ObjLoader.cs
+++ OpenGLTutorial16/OpenGLTutorial16/ObjLoader.cs
@@ -79,14 +79,14 @@
                         if (!materials.ContainsKey(material.Name)) materials.Add(material.Name, material);
                         lines.Clear();
                     }
-                    else if (line[0] == 'm')
+
+                    if (line[0] == 'm')
                     {
                         // try to fix up filenames of texture maps
                         string[] split = line.Split(' ');
                         lines.Add(string.Format("{0} {1}", split[0], CreateFixedPath(filename, split[1])));
                     }
-
-                    if (line[0] != '#') lines.Add(line);    // ignore comments
+                    else if (line[0] != '#') lines.Add(line);    // ignore comments
                 }
             }
         }
@@ -189,8 +189,6 @@
                     case "illum": this.Illumination = (IlluminationMode)int.Parse(split[1]);
                         break;
                     case "map_Kd": if (File.Exists(split[1])) this.DiffuseMap = new Texture(split[1]);
-                        else if (File.Exists(split[1].Substring(split[1].LastIndexOf('\\')))) new Texture(split[1].Substring(split[1].LastIndexOf('\\')));
-                        else throw new FileNotFoundException("Could not find the file " + split[1] + " to be used as a diffuse map.");
                         break;
                 }
             }


Move origin to a more convenient location

--- OpenKh.Tools.LayoutEditor/AppSequenceEditor.cs
+++ OpenKh.Tools.LayoutEditor/AppSequenceEditor.cs
@@ -201,8 +201,8 @@
                 const float Infinite = 65536f;
                 var width = ImGui.GetWindowContentRegionWidth();
                 var height = ImGui.GetWindowHeight();
-                var originX = width / 2.0f;
-                var originY = height / 2.0f;
+                var originX = width / 4.0f;
+                var originY = height / 4.0f;
                 var backgroundColorInverse = new ColorF(
                     1f - _settings.EditorBackground.R,
                     1f - _settings.EditorBackground.G,


Correct some issues with the last commit

--- OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -205,7 +205,8 @@
             foreach (FieldInfo fi in m_Fields.Values)
             {
                 names.Add(fi.Name);
-                values.Add(fi.GetValue(row).ToString());
+                values.Add("?" + fi.Name);
+                cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
             }

             if (m_DataField != null)


revert accidental change to MemoryWatchdog stat calculation in previous b1b4687

--- OpenSim/Framework/Monitoring/MemoryWatchdog.cs
+++ OpenSim/Framework/Monitoring/MemoryWatchdog.cs
@@ -72,7 +72,7 @@
         /// </summary>
         public static double LastMemoryChurn
         {
-            get { if (m_samples.Count > 0) return m_samples.First(); else return 0; }
+            get { if (m_samples.Count > 0) return m_samples.Last(); else return 0; }
         }

         /// <summary>


Changed the "not in scene" check in the prioritizier to just a warning. There appears to be a race condition on slow logins that attempts to prioritize before the scene presence is fully initialized.

--- OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -166,8 +166,9 @@
             ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
             if (presence == null)
             {
-                m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
-                throw new InvalidOperationException("Prioritization agent not defined");
+                m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId);
+                // throw new InvalidOperationException("Prioritization agent not defined");
+                return Int32.MaxValue;
             }

             // Use group position for child prims, since we are putting child prims in


One should not lock null objects.

One should not lock null objects.

--- OpenSim/Region/Framework/Scenes/SceneViewer.cs
+++ OpenSim/Region/Framework/Scenes/SceneViewer.cs
@@ -67,14 +67,14 @@

         public void SendPrimUpdates()
         {
-            lock(m_pendingObjects)
-            {
-                if (m_pendingObjects == null)
-                {
-                    if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor))
+            if (m_pendingObjects == null)
+            {
+                if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor))
+                {
+                    m_pendingObjects = new Queue<SceneObjectGroup>();
+
+                    lock(m_pendingObjects)
                     {
-                        m_pendingObjects = new Queue<SceneObjectGroup>();
-
                         foreach (EntityBase e in m_presence.Scene.Entities)
                         {
                             if (e != null && e is SceneObjectGroup)
@@ -82,7 +82,10 @@
                         }
                     }
                 }
-
+            }
+
+            lock(m_pendingObjects)
+            {
                 while (m_pendingObjects != null && m_pendingObjects.Count > 0)
                 {
                     SceneObjectGroup g = m_pendingObjects.Dequeue();


Actually remove PhysicsActor.SOPDescription this time

--- OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -160,8 +160,10 @@

         public abstract bool Selected { set; }

+        /// <summary>
+        /// This is being used by ODE joint code.
+        /// </summary>
         public string SOPName;
-        public string SOPDescription;

         public abstract void CrossingFailure();


In XEngine, enqueue a script rez to the compile queue after setting m_CompileDict to avoid a rare but not impossible race condition.

--- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1020,11 +1020,12 @@
             }
             else
             {
+                lock (m_CompileDict)
+                    m_CompileDict[itemID] = 0;
+
+                // This must occur after the m_CompileDict so that an existing compile thread cannot hit the check
+                // in DoOnRezScript() before m_CompileDict has been updated.
                 m_CompileQueue.Enqueue(parms);
-                lock (m_CompileDict)
-                {
-                    m_CompileDict[itemID] = 0;
-                }

 //                m_log.DebugFormat("[XEngine]: Added script {0} to compile queue", itemID);


Fix #25: Deleting with resource leave files in place

--- R7.Documents/components/DocumentsController.cs
+++ R7.Documents/components/DocumentsController.cs
@@ -114,10 +114,10 @@
         public int DeleteDocumentResource (DocumentInfo document, int portalId)
         {
             // count resource references
-            var count = GetObjects<DocumentInfo> ("WHERE [Url]=@0", document.Url).Count ();
-
-            // delete if it's the only reference
-            if (count == 1)
+            var count = GetObjects<DocumentInfo> ("WHERE [ItemID] <> @0 AND [Url] = @1", document.ItemId, document.Url).Count ();
+
+            // if no other document references it
+            if (count == 0)
             {
                 switch (Globals.GetURLType (document.Url))
                 {


Ferdig med bruker blir varslet dersom nevnt i kommentar med @

--- kode/SysUt14Gr03/SysUt14Gr03/Prosjektleder/VisOppgave.aspx.cs
+++ kode/SysUt14Gr03/SysUt14Gr03/Prosjektleder/VisOppgave.aspx.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text.RegularExpressions;
 using System.Web;
 using System.Web.UI;
 using System.Web.UI.WebControls;
@@ -134,6 +135,27 @@
                     lblKommentarer.Text += "
 " + kommentarListe[i].Bruker.IM + "";
                     lblKommentarer.Text += "
" + kommentarListe[i].Opprettet.ToString();
                     lblKommentarer.Text += "
" + kommentarListe[i].Tekst;
+                    if (kommentarListe[i].Tekst.Contains("@"))
+                    {
+                        MatchCollection match = Regex.Matches(kommentarListe[i].Tekst, @"(?<!\w)@\w+");
+                        foreach (Match ord in match)
+                        {
+                            string[] navn = Regex.Split(ord.Value, @"^@");
+                            using (var context = new Context())
+                            {
+                                foreach (string userName in navn)
+                                {
+                                    if (userName != String.Empty)
+                                    {
+                                        Bruker bruker = context.Brukere.Where(b => b.Brukernavn == userName).First();
+                                        string fornavn = Queries.GetBruker(bruker_id).ToString();
+                                        Varsel.SendVarsel(bruker.Bruker_id, Varsel.KOMMENTARVARSEL, "Kommentar", fornavn + " har nevnt deg i en kommentar", oppgave.Oppgave_id);
+                                    }
+                                }
+                            }
+                        }
+
+                    }
                 }
                 lblKommentarer.Visible = true;
             }


FIX groupby ctor

FIX groupby ctor

--- RDFSharp/Query/Modifiers/RDFGroupByModifier.cs
+++ RDFSharp/Query/Modifiers/RDFGroupByModifier.cs
@@ -47,6 +47,7 @@
         {
             if (partitionVariables != null && partitionVariables.Any())
             {
+                this.PartitionVariables = new List<RDFVariable>();
                 partitionVariables.ForEach(pv1 => {
                     if (!this.PartitionVariables.Any(pv2 => pv2.Equals(pv1)))
                     {


solution

solution

--- leetcode/C_sharp/online_judge/leetcode/explore/RecursionII.cs
+++ leetcode/C_sharp/online_judge/leetcode/explore/RecursionII.cs
@@ -18,10 +18,10 @@
             if (root == null) return true;

-            return Validate(root, int.MinValue, int.MaxValue);
+            return Validate(root, null, null);
         }

-        private bool Validate(TreeNode node, int lower, int higher)
+        private bool Validate(TreeNode node, int? lower, int? higher)
         {
             if (node == null) return true;


patch designer and editor need command line settings

--- RelhaxModpack/RelhaxModpack/MainWindow.xaml.cs
+++ RelhaxModpack/RelhaxModpack/MainWindow.xaml.cs
@@ -3009,7 +3009,7 @@
                 Logging.DisposeLogging(Logfiles.Application);

             CommandLineSettings.ApplicationMode = ApplicationMode.PatchDesigner;
-            PatchDesigner designer = new PatchDesigner(this.ModpackSettings) { LaunchedFromMainWindow = true };
+            PatchDesigner designer = new PatchDesigner(this.ModpackSettings) { LaunchedFromMainWindow = true, CommandLineSettings = CommandLineSettings };

             //start updater logging system
             if (!Logging.Init(Logfiles.PatchDesigner, ModpackSettings.VerboseLogging))
@@ -3053,7 +3053,7 @@
                 Logging.DisposeLogging(Logfiles.Application);

             CommandLineSettings.ApplicationMode = ApplicationMode.Editor;
-            DatabaseEditor editor = new DatabaseEditor(this.ModpackSettings) { LaunchedFromMainWindow = true };
+            DatabaseEditor editor = new DatabaseEditor(this.ModpackSettings) { LaunchedFromMainWindow = true, CommandLineSettings = CommandLineSettings };

             //start updater logging system
             if (!Logging.Init(Logfiles.Editor, ModpackSettings.VerboseLogging))


Confirm IL for attributes on accessors

Confirm IL for attributes on accessors

--- src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs
+++ src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs
@@ -10547,6 +10547,8 @@
 }";
             verifier.VerifyIL("C.E.add", il);
             verifier.VerifyIL("C.E.remove", il);
+            verifier.VerifyIL("C.E2.add", il);
+            verifier.VerifyIL("C.E2.remove", il.Replace(".locals", ".locals init"));
         }

         #endregion


Rename refactoring.

Rename refactoring.

--- src/Cuemon.Extensions.AspNetCore.Authentication/ApplicationBuilderExtensions.cs
+++ src/Cuemon.Extensions.AspNetCore.Authentication/ApplicationBuilderExtensions.cs
@@ -1,5 +1,7 @@
 using System;
-using Cuemon.AspNetCore.Authentication;
+using Cuemon.AspNetCore.Authentication.Basic;
+using Cuemon.AspNetCore.Authentication.Digest;
+using Cuemon.AspNetCore.Authentication.Hmac;
 using Cuemon.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;

@@ -25,11 +27,11 @@
         /// Adds a HTTP Digest Authentication scheme to the <see cref="IApplicationBuilder"/> request execution pipeline.
         /// </summary>
         /// <param name="builder">The type that provides the mechanisms to configure an application’s request pipeline.</param>
-        /// <param name="setup">The HTTP <see cref="DigestAccessAuthenticationMiddleware"/> middleware which may be configured.</param>
+        /// <param name="setup">The HTTP <see cref="DigestAuthenticationMiddleware"/> middleware which may be configured.</param>
         /// <returns>A reference to <paramref name="builder"/> after the operation has completed.</returns>
-        public static IApplicationBuilder UseDigestAccessAuthentication(this IApplicationBuilder builder, Action<DigestAccessAuthenticationOptions> setup = null)
+        public static IApplicationBuilder UseDigestAccessAuthentication(this IApplicationBuilder builder, Action<DigestAuthenticationOptions> setup = null)
         {
-            return MiddlewareBuilderFactory.UseConfigurableMiddleware<DigestAccessAuthenticationMiddleware, DigestAccessAuthenticationOptions>(builder, setup);
+            return MiddlewareBuilderFactory.UseConfigurableMiddleware<DigestAuthenticationMiddleware, DigestAuthenticationOptions>(builder, setup);
         }

         /// <summary>


Priority can now be specified through rest-api

--- Resonance.Api/Controllers/PublishController.cs
+++ Resonance.Api/Controllers/PublishController.cs
@@ -25,7 +25,7 @@
         [HttpPost("{name}/{functionalKey?}")]
         [ProducesResponseType(typeof(TopicEvent), 200)]
         public async Task<IActionResult> Publish([FromRoute]string name, [FromRoute]string functionalKey = null,
-            [FromQuery]DateTime? publicationDateUtc = null, [FromQuery]DateTime? expirationDateUtc = null, [FromQuery]string payload = null)
+            [FromQuery]DateTime? publicationDateUtc = null, [FromQuery]DateTime? expirationDateUtc = null, [FromQuery] int priority = 0, [FromQuery]string payload = null)
         {
             if (String.IsNullOrWhiteSpace(name))
                 return BadRequest("No topicname specified");
@@ -42,7 +42,13 @@
                     payload = await new StreamReader(Request.Body).ReadToEndAsync();

                 // Now publish
-                var te = await _publisher.PublishAsync(topicName: name, publicationDateUtc: publicationDateUtc, expirationDateUtc: expirationDateUtc, functionalKey: functionalKey, headers: headers, payload: payload);
+                var te = await _publisher.PublishAsync(topicName: name,
+                    publicationDateUtc: publicationDateUtc,
+                    expirationDateUtc: expirationDateUtc,
+                    functionalKey: functionalKey,
+                    priority: priority,
+                    headers: headers,
+                    payload: payload);
                 return Ok(te);
             }
             catch (ArgumentException argEx)