fix 64-bit debug offset issues

fix 64-bit debug offset issues

--- Nouzuru/WinApi.cs
+++ Nouzuru/WinApi.cs
@@ -594,6 +594,7 @@
             public uint dwThreadId;

 #if WIN64
+            private uint __padding;
             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 164, ArraySubType = UnmanagedType.U1)]
 #else
             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 84, ArraySubType = UnmanagedType.U1)]


Added Check for Nested Private Types

Added Check for Nested Private Types

The compiler was generating a type that was a private nested type, which
was missing the ThreadAgnosticAttribute.  Because it was auto-generated
there was not a way to add it.

--- tests/NLog.UnitTests/Layouts/ThreadAgnosticTests.cs
+++ tests/NLog.UnitTests/Layouts/ThreadAgnosticTests.cs
@@ -49,9 +49,9 @@
             {
                 if (t.Namespace == typeof(WrapperLayoutRendererBase).Namespace)
                 {
-                    if (t.IsAbstract || t.IsEnum)
+                    if (t.IsAbstract || t.IsEnum || t.IsNestedPrivate)
                     {
-                        // skip non-concrete types and enumerations
+                        // skip non-concrete types, enumerations, and private nested types
                         continue;
                     }


The active vessel gets moved as expected except the acceleration is rotten.

--- Principia/Core.cs
+++ Principia/Core.cs
@@ -25,6 +25,7 @@
     private Vector3d activeVesselProperAcceleration;
     private Vector3d activeVesselVelocity;
     private Dictionary<string, Body> bodies;
+    private Vector3d geometricAcceleration;
     private bool lastFrameWasPhysical = false;
     private MapRenderer mapRenderer;
     private bool predictTrajectories = false;
@@ -79,17 +80,6 @@
         newVelocity /= totalMass;
         newVelocity += Krakensbane.GetFrameVelocity();

-        // We compute the geometric acceleration as applied by KSP.
-        CelestialBody primary = activeVessel.orbit.referenceBody;
-        Vector3d vesselPosition = activeVessel.findLocalCenterOfMass();
-        Vector3d vesselVelocity =
-          ((Vector3d)activeVessel.rootPart.rb.GetPointVelocity(vesselPosition))
-          + Krakensbane.GetFrameVelocity();
-        Vector3d geometricAcceleration =
-          FlightGlobals.getGeeForceAtPosition(vesselPosition)
-          + FlightGlobals.getCoriolisAcc(vesselVelocity, primary)
-          + FlightGlobals.getCentrifugalAcc(vesselPosition, primary);
-
         if (lastFrameWasPhysical) {
           // We now extract the proper acceleration computed by Unity.
           activeVesselProperAcceleration = (newVelocity - activeVesselVelocity)
@@ -98,6 +88,16 @@
           lastFrameWasPhysical = true;
           activeVesselProperAcceleration = Vector3d.zero;
         }
+        // We compute the geometric acceleration will be applied by KSP.
+        CelestialBody primary = activeVessel.orbit.referenceBody;
+        Vector3d vesselPosition = activeVessel.findLocalCenterOfMass();
+        Vector3d vesselVelocity =
+          ((Vector3d)activeVessel.rootPart.rb.GetPointVelocity(vesselPosition))
+          + Krakensbane.GetFrameVelocity();
+        geometricAcceleration =
+          FlightGlobals.getGeeForceAtPosition(vesselPosition)
+          + FlightGlobals.getCoriolisAcc(vesselVelocity, primary)
+          + FlightGlobals.getCentrifugalAcc(vesselPosition, primary);
       } else {
         lastFrameWasPhysical = false;
         activeVesselProperAcceleration = Vector3d.zero;
@@ -172,8 +172,12 @@
               // We change the velocity ourselves so that we are sure the change
               // is done *now*, and affects the total momentum correctly without
               // changing the relative velocities.
+              Vector3d frameVelocity =
+                vessel.orbit.referenceBody.inverseRotation ?
+                  vessel.orbit.referenceBody.getRFrmVel(worldPosition) :
+                  Vector3d.zero;
               Vector3d Δv = rotation * relativeVelocity.xzy
-                - vessel.orbit.referenceBody.getRFrmVel(worldPosition)
+                - frameVelocity
                 - activeVesselVelocity;
               foreach (Part part in vessel.parts) {
                 part.rb.velocity += Δv;


WIP on master: a7fc88e Wrapped Socket: replace object orientation hack that used interprocess (remoting) functions unimplemented in mono.

--- ROS_Comm/_Init.cs
+++ ROS_Comm/_Init.cs
@@ -408,8 +408,8 @@
                 printit = false;
 #endif
             }
-            if (printit)
-                EDB.WriteLine(ROSOUT_FMAT, ROSOUT_PREFIX[level], o);
+            /*if (printit)
+                EDB.WriteLine(ROSOUT_FMAT, ROSOUT_PREFIX[level], o);*/
 			RosOutAppender.Instance.Append(o.ToString(), level);
         }


Actually call the new Rhino Render Rhino Render.

--- RenderPipeline.cs
+++ RenderPipeline.cs
@@ -36,7 +36,7 @@

 		public RenderPipeline(RhinoDoc doc, Rhino.Commands.RunMode mode, Rhino.PlugIns.RenderPlugIn plugin, ModalRenderEngine aRC)
 			: base(doc, mode, plugin, RenderSize(doc, true),
-					"Cycles for Rhino", Rhino.Render.RenderWindow.StandardChannels.RGBA, false, false)
+					"Rhino Render", Rhino.Render.RenderWindow.StandardChannels.RGBA, false, false)
 		{
 			cyclesEngine = (ModalRenderEngine)aRC;
 		}


query.ToString() does not work as advertised

--- RequestBuilder.cs
+++ RequestBuilder.cs
@@ -89,7 +89,13 @@
                     query.Add(kvp.Key, kvp.Value);
                 }

-                uri.Query = query.ToString();
+                if (query.HasKeys()) {
+                    var pairs = query.Keys.OfType<string>().Select(x => HttpUtility.UrlEncode(x) + "=" + HttpUtility.UrlEncode(query[x]));
+                    uri.Query = String.Join("&", pairs);
+                } else {
+                    uri.Query = null;
+                }
+
                 ret.RequestUri = new Uri(uri.Uri.PathAndQuery, UriKind.Relative);
                 return ret;
             };


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/HttpListenerPrefixCollection.cs
+++ websocket-sharp/Net/HttpListenerPrefixCollection.cs
@@ -200,17 +200,19 @@
     }

     /// <summary>
-    /// Copies the contents of the collection to the specified <see cref="Array"/>.
+    /// Copies the contents of the collection to the specified array.
     /// </summary>
     /// <param name="array">
-    /// An <see cref="Array"/> that receives the URI prefix strings in the collection.
+    /// An <see cref="Array"/> that receives the URI prefix strings in
+    /// the collection.
     /// </param>
     /// <param name="offset">
-    /// An <see cref="int"/> that represents the zero-based index in <paramref name="array"/>
-    /// at which copying begins.
-    /// </param>
-    /// <exception cref="ObjectDisposedException">
-    /// The <see cref="HttpListener"/> associated with this collection is closed.
+    /// An <see cref="int"/> that specifies the zero-based index in
+    /// the array at which copying begins.
+    /// </param>
+    /// <exception cref="ObjectDisposedException">
+    /// The <see cref="HttpListener"/> instance associated with
+    /// this collection is closed.
     /// </exception>
     public void CopyTo (Array array, int offset)
     {


Fix Framework display name with net5.

Fix Framework display name with net5.

--- Sharpmake/Util.cs
+++ Sharpmake/Util.cs
@@ -2529,7 +2529,7 @@
         private static readonly string s_framework = Assembly.GetEntryAssembly()?.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkName;
         private static readonly string s_frameworkDisplayName = Assembly.GetEntryAssembly()?.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkDisplayName;
         private static readonly bool s_isDotNetCore = s_framework != null && !s_framework.StartsWith(".NETFramework");
-        public static string FrameworkDisplayName() => s_frameworkDisplayName ?? s_framework ?? "Unknown";
+        public static string FrameworkDisplayName() => !string.IsNullOrEmpty(s_frameworkDisplayName) ? s_frameworkDisplayName : !string.IsNullOrEmpty(s_framework) ? s_framework : "Unknown";
         public static bool IsRunningDotNetCore() => s_isDotNetCore;
     }
 }


Unneeded values

Unneeded values

--- Source/DMUtils.cs
+++ Source/DMUtils.cs
@@ -45,11 +45,6 @@
 	{
 		internal static System.Random rand;
 		internal static Dictionary<string, Dictionary<string, DMScienceContainer>> availableScience;
-		internal static float science = 1f;
-		internal static float reward = 1f;
-		internal static float forward = 1f;
-		internal static float penalty = 1f;
-		internal static float deadline = 1f;
 		internal static string version = "v0.9.2";
 		internal static EventData<CelestialBody, String, String> OnAnomalyScience;
 		internal static EventData<String, String> OnAsteroidScience;
@@ -162,9 +157,9 @@
 			for (int j = 0; j < i; j++)
 			{
 				if (source[j] != null)
-					s[j] = source[j].id.ToString() + ",";
-			}
-			return string.Concat(s).TrimEnd(',');
+					s[j] = source[j].id.ToString() + "|";
+			}
+			return string.Concat(s).TrimEnd('|');
 		}

 		internal static string stringConcat(Dictionary<int, List<string>> source)
@@ -325,7 +320,7 @@
 			return false;
 		}

-		internal static float asteroidSubjectVal(float f, int i)
+		internal static float asteroidSubjectVal(int i)
 		{
 			switch (i)
 			{


Converted formats of Sex and Accessibility fields

--- ToCsvProcessor.cs
+++ ToCsvProcessor.cs
@@ -205,17 +205,16 @@

         static ToCsvProcessor()
         {
+            // Only include codes that make the feature available.
+            // So, leave out TDS_ASL0, TDS_ClosedCap0, TDS_TTS0,
             sAccessibilityCodeMapping = new Dictionary<string, int>();
-            sAccessibilityCodeMapping.Add("TDS_ASL0", 73); // American Sign Language
-            sAccessibilityCodeMapping.Add("TDS_ASL1", 73);
-            sAccessibilityCodeMapping.Add("TDS_ClosedCap0", 75); // Closed Captioning
-            sAccessibilityCodeMapping.Add("TDS_ClosedCap1", 75);
+            sAccessibilityCodeMapping.Add("TDS_ASL1", 73); // American Sign Language
+            sAccessibilityCodeMapping.Add("TDS_ClosedCap1", 75); // Closed Captioning
             sAccessibilityCodeMapping.Add("ENU-Braille", 74); // Braille
             sAccessibilityCodeMapping.Add("TDS_PoD_Stim", 81); // Print on Demand Stimuli
             sAccessibilityCodeMapping.Add("TDS_PoD_Item", 82); // Print on Demand Item
             sAccessibilityCodeMapping.Add("TDS_TS_Accessibility", 86); // Streamline
-            sAccessibilityCodeMapping.Add("TDS_TTS0", 76); // Text to Speech
-            sAccessibilityCodeMapping.Add("TDS_TTS_Item", 76);
+            sAccessibilityCodeMapping.Add("TDS_TTS_Item", 76); // Text to Speech
             sAccessibilityCodeMapping.Add("TDS_TTS_Stim", 76);
             sAccessibilityCodeMapping.Add("TDS_TTS_Stim&TDS_TTS_Item", 76);
             sAccessibilityCodeMapping.Add("NEA_AR", 78); // Non-Embedded Alternate Response Options
@@ -268,7 +267,8 @@
             studentFields[7] = nav.Eval(sXp_FirstName);
             studentFields[8] = nav.Eval(sXp_MiddleName);
             studentFields[9] = nav.Eval(sXp_LastOrSurname);
-            studentFields[10] = nav.Eval(sXp_Sex);
+            string sex = nav.Eval(sXp_Sex);
+            studentFields[10] = (sex.Length > 0 && (sex[0] == 'M' || sex[0] == 'm')) ? "Male" : "Female";
             studentFields[11] = nav.Eval(sXp_Birthdate);
             studentFields[12] = nav.Eval(sXp_GradeLevelWhenAssessed);
             studentFields[13] = nav.Eval(sXp_HispanicOrLatinoEthnicity);
@@ -319,8 +319,8 @@
             ProcessScores(nav, sXp_ClaimScore3, sXp_ClaimScore3StandardError, sXp_ClaimScore3AchievementLevel, studentFields, 65);
             ProcessScores(nav, sXp_ClaimScore4, sXp_ClaimScore4StandardError, sXp_ClaimScore4AchievementLevel, studentFields, 69);

-            // Preload accommodation fields with empty string
-            for (int i = 73; i < sStudentFieldNames.Length; ++i) studentFields[i] = string.Empty;
+            // Preload accommodation fields with "3" (accessibility feature not made available)
+            for (int i = 73; i < sStudentFieldNames.Length; ++i) studentFields[i] = "3";

             // Process accommodations
             {
@@ -332,7 +332,7 @@
                         int fieldIndex;
                         if (sAccessibilityCodeMapping.TryGetValue(code, out fieldIndex))
                         {
-                            studentFields[fieldIndex] = code;
+                            studentFields[fieldIndex] = "6"; // Set code to 6 accessibility feature made available.
                         }
                     }
                 }


strip interface from ipv6 addresses

strip interface from ipv6 addresses

--- Assets/HappyFunTimes/HappyFunTimesCore/HFTIpUtils.cs
+++ Assets/HappyFunTimes/HappyFunTimesCore/HFTIpUtils.cs
@@ -32,7 +32,8 @@
                 {
                     socket.Connect(address, 65530);
                     IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
-                    localIP = endPoint.Address.ToString();
+                    string s = endPoint.Address.ToString();
+                    localIP = System.Text.RegularExpressions.Regex.Replace(s, "%.+", "");
                 }
                 return localIP;
             }


beginning main puzzle implementation

beginning main puzzle implementation

--- Assets/Prototype/Scripts/Undecided/PatternMatcher.cs
+++ Assets/Prototype/Scripts/Undecided/PatternMatcher.cs
@@ -3,9 +3,120 @@
 using System.Linq;
 using System.Text;

-namespace Assets.Prototype.Scripts
+using UnityEngine;
+
+public class PatternUtils
 {
-    class PatternMatcher
+    static Color[] PatternColors = new Color[] {Color.blue, Color.red, Color.green, new Color(1, 0, 1, 1)};
+
+    public static Color GetLeftOf(Color color)
     {
+        if (color == Color.blue)
+        {
+            return new Color(1, 0, 1, 1);
+        }
+        else if (color == Color.red)
+        {
+            return Color.blue;
+        }
+        else if (color == Color.green)
+        {
+            return Color.red;
+        }
+        else if (color == new Color(1, 0, 1, 1))
+        {
+            return Color.green;
+        }
+
+        // this hsouldn't happen
+        return Color.clear;
+    }
+
+    public static Color GetRightOf(Color color)
+    {
+        if (color == Color.blue)
+        {
+            return Color.red;
+        }
+        else if (color == Color.red)
+        {
+            return Color.green;
+        }
+        else if (color == Color.green)
+        {
+            return new Color(1, 0, 1, 1);
+        }
+        else if (color == new Color(1, 0, 1, 1))
+        {
+            return Color.blue;
+        }
+
+        // this hsouldn't happen
+        return Color.clear;
     }
 }
+
+public class PatternRule
+{
+    private Color _target;
+
+    private List<Color> _desiredPattern = new List<Color>();
+
+    public PatternRule(Color target, IEnumerable<Color> pattern)
+    {
+        _target = target;
+        _desiredPattern.AddRange(pattern);
+    }
+
+    public bool SatisfiesPattern(Color target, IEnumerable<Color> pattern)
+    {
+        if (_target != target)
+        {
+            return false;
+        }
+
+        for (int i = 0; i < Mathf.Min(pattern.Count(), _desiredPattern.Count); i += 1)
+        {
+            if (_desiredPattern[i] != pattern.ElementAt(i))
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+}
+
+public class InteractionRule
+{
+    Color _focus;
+
+    Color _leftOf;
+
+    Color _rightOf;
+
+    public InteractionRule(Color focus, Color leftOf, Color rightOf)
+    {
+        _focus = focus;
+        _leftOf = leftOf;
+        _rightOf = rightOf;
+    }
+
+    public void RotateLeft()
+    {
+        _focus = PatternUtils.GetLeftOf(_focus);
+        _leftOf = PatternUtils.GetLeftOf(_leftOf);
+        _rightOf = PatternUtils.GetLeftOf(_rightOf);
+    }
+
+    public void RotateRight()
+    {
+        _focus = PatternUtils.GetRightOf(_focus);
+        _leftOf = PatternUtils.GetRightOf(_leftOf);
+        _rightOf = PatternUtils.GetRightOf(_rightOf);
+    }
+}
+
+public class PatternMatcher : MonoBehaviour
+{
+}


stop moving position by arrow keys in multi-line mode.

--- Assets/uREPL/Scripts/Gui/Window/CommandInputField.cs
+++ Assets/uREPL/Scripts/Gui/Window/CommandInputField.cs
@@ -26,13 +26,12 @@
 			if (e.rawType == EventType.KeyDown) {
 				consumedEvent = true;

-				// Skip because these keys are used for histroy selection in single-line mode.
-				if (!multiLine) {
-					switch (e.keyCode) {
-						case KeyCode.UpArrow:
-						case KeyCode.DownArrow:
-							continue;
-					}
+				// Skip because these keys are used for histroy selection in single-line mode
+				// and for move cursor manually in multi-line mode.
+				switch (e.keyCode) {
+					case KeyCode.UpArrow:
+					case KeyCode.DownArrow:
+						continue;
 				}

 				// Skip if completion view is open.


Fixed garbageChecked changes

Fixed garbageChecked changes

Fixed the changes ChuckleFish did to garbageChecked in the 1.3.20 patch.

--- Automate/Framework/Machines/Tiles/TrashCanMachine.cs
+++ Automate/Framework/Machines/Tiles/TrashCanMachine.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using Microsoft.Xna.Framework;
 using StardewModdingAPI;
 using StardewValley;
@@ -16,7 +17,7 @@
         private readonly Vector2 Tile;

         /// The game's list of trash cans the player has already checked.
-        private readonly bool[] TrashCansChecked;
+        private readonly IList<bool> TrashCansChecked;

         /// The trash can index (or -1 if not a valid trash can).
         private readonly int TrashCanIndex = -1;
@@ -33,8 +34,8 @@
         public TrashCanMachine(Town town, Vector2 tile, int trashCanIndex, IReflectionHelper reflection)
         {
             this.Tile = tile;
-            this.TrashCansChecked = reflection.GetField<bool[]>(town, "garbageChecked").GetValue();
-            if (trashCanIndex >= 0 && trashCanIndex < this.TrashCansChecked.Length)
+            this.TrashCansChecked = reflection.GetField<IList<bool>>(town, "garbageChecked").GetValue();
+            if (trashCanIndex >= 0 && trashCanIndex < this.TrashCansChecked.Count)
                 this.TrashCanIndex = trashCanIndex;
         }


Updated GenID

Updated GenID

fixed overlapping StreamID's

--- BDLib/BDLib/Internal/DataStream/TwoWayDataStreams.cs
+++ BDLib/BDLib/Internal/DataStream/TwoWayDataStreams.cs
@@ -25,11 +25,17 @@

         private static uint GenID()
         {
-            byte[] ID = new byte[4];
-            IDGEN.NextBytes(ID);
-            UInt32 uint_ID = BitConverter.ToUInt32(ID, 0);
+            UInt32 uint_ID = 0;
+            while (true)
+            {
+                byte[] ID = new byte[4];
+                IDGEN.NextBytes(ID);
+                uint_ID = BitConverter.ToUInt32(ID, 0);

-            //TODO :: make sure id doesnt Exist (only have to do StreamID not PointID)
+                SearchID = uint_ID;
+                if (Streams.FindIndex(new Predicate<TwoWayStream>(FindByID)) > 0) break;
+
+            }
             return uint_ID;
         }


Removed unnecessary call to UpdateModel

Removed unnecessary call to UpdateModel

--- BrickPile.UI/Areas/UI/Controllers/PagesController.cs
+++ BrickPile.UI/Areas/UI/Controllers/PagesController.cs
@@ -104,8 +104,6 @@
                 return View("edit", viewModel);
             }

-            UpdateModel(_currentPage, "CurrentModel", collection);
-
             _currentPage.Metadata.Changed = DateTime.Now;
             _currentPage.Metadata.ChangedBy = HttpContext.User.Identity.Name;


wybieranie godziny

wybieranie godziny

--- Clinic/Clinic/Forms/Registrar/RegistrarModifyForm.cs
+++ Clinic/Clinic/Forms/Registrar/RegistrarModifyForm.cs
@@ -26,10 +26,10 @@
             Initialize(idVisit);
             this.idDoctor = -1;
             this.idPatient = -1;
-
+
         }

-        public RegistrarAddModifyForm(int idPatient,int? idReg)
+        public RegistrarAddModifyForm(int idPatient, int? idReg)
         {
             InitializeComponent();
             this.idPatient = idPatient;
@@ -43,7 +43,7 @@

             Patient patient = new Patient();
             patient.id_patient = idPatient;
-            patient= RegistrationFacade.GetPatientByID(patient);
+            patient = RegistrationFacade.GetPatientByID(patient);
             registrarTextBoxPatientName.Text = patient.lname;
             this.idDoctor = -1;
         }
@@ -86,7 +86,7 @@
                 this.dataTimePickerRegDate.Value = visit.registration_date;
                 this.registrarTextBoxPatientName.Text = visit.patientLname;
                 this.registrarTextBoxDoctor.Text = visit.doctorLname;
-
+
                 this.registrarStateComboBox.SelectedIndex = this.registrarStateComboBox.FindStringExact(visit.state);
             }
         }
@@ -94,19 +94,33 @@

         private void registrarApproveButton_Click(object sender, EventArgs e)
         {
-            if (idPatient != -1 && idDoctor!=-1)
+
+            if (idPatient != -1 && idDoctor != -1 && comboBox1.SelectedIndex != -1 && comboBox2.SelectedIndex != -1)
             {

                 Visit visit = new Visit();
                 visit.id_doctor = idDoctor;
                 visit.id_patient = idPatient;
                 visit.id_registration = idReg;
-                visit.state = "REG";
-                visit.registration_date= this.dataTimePickerRegDate.Value;
+                visit.state = "REG";
+                string date = this.dataTimePickerRegDate.Value.ToString("yyyy-MM-dd");
+                date += ' ';
+                date += comboBox1.Text;
+                date += ':';
+                date += comboBox2.Text;
+                DateTime myDate = DateTime.ParseExact(date, "yyyy-MM-dd HH:mm",
+                                       System.Globalization.CultureInfo.InvariantCulture);
+                visit.registration_date = myDate;
                 RegistrationFacade.AddVisit(visit);
+                this.Close();
+            }
+            else
+            {

-             }
-            this.Close();
+                MessageBox.Show("Select Doctor, hour and minute!", "Select Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+
+            }
+
         }

         private void registrarTextBoxPatient_TextChanged(object sender, EventArgs e)
@@ -152,7 +166,7 @@
             this.idDoctor = -1;
             this.idDoctor = registrarSelectDoctor.getID();
             registrarTextBoxDoctor.Text = registrarSelectDoctor.getLname();
-
+

         }
         public void updateVisit(int id)
@@ -162,14 +176,14 @@
             {

-                Visit visitToset = new Visit() ;
+                Visit visitToset = new Visit();
                 visitToset.id_doctor = this.idDoctor;
                 visitToset.id_visit = id;
                 visitToset.registration_date = this.dataTimePickerRegDate.Value;
                 visitToset.state = this.registrarStateComboBox.SelectedItem.ToString();
                 if (visitToset.state == "REG")
                 {
-
+
                     visitToset.execution_cancel_datetime = null;
                 }
                 else


Remove dead code

Remove dead code

Universes now provide the raw data enumerator, so they don't need to
provide subscriptions for themselves, which was always awkward. This
does suggest similar edits should be made to the live feed, in that,
a universe instance should provide its own data enumerator, live
universe maybe?

--- Common/Data/UniverseSelection/OptionChainUniverse.cs
+++ Common/Data/UniverseSelection/OptionChainUniverse.cs
@@ -103,21 +103,8 @@
         /// <returns>All subscriptions required by this security</returns>
         protected override IEnumerable<SubscriptionDataConfig> GetSubscriptionConfigurations(Security security)
         {
-            var config = security.SubscriptionDataConfig;
-
-            // canonical also needs underlying price data
-            if (security.Symbol == _option.Symbol)
-            {
-                var underlying = Symbol.Create(config.Symbol.ID.Symbol, SecurityType.Equity, config.Market);
-                var resolution = config.Resolution == Resolution.Tick ? Resolution.Second : config.Resolution;
-                return new[]
-                {
-                    // rewrite the primary to be non-tick and fill forward
-                    new SubscriptionDataConfig(config, resolution: resolution, fillForward: true),
-                    // add underlying trade data
-                    new SubscriptionDataConfig(config, resolution: resolution, fillForward: true, symbol: underlying, objectType: typeof(TradeBar), tickType: TickType.Trade),
-                };
-            }
+            // TODO : If supporting multiple resolutions, may want to emit quotes and trade per security.Subscription
+            var config = security.Subscriptions.First();

             // we want to return both quote and trade subscriptions
             return QuotesAndTrades.Select(x => new SubscriptionDataConfig(config,


Added a null reference check for every call map just prior to performing every method interception

--- Deflector/Deflector/MethodCallInterceptionEmitter.cs
+++ Deflector/Deflector/MethodCallInterceptionEmitter.cs
@@ -241,11 +241,11 @@
             }

-            //AddMethodInterceptionHooks(oldInstruction, il, constructor, module);
             var skipInterception = il.Create(OpCodes.Nop);

             il.Emit(OpCodes.Ldloc, _callMap);
             il.Emit(OpCodes.Brfalse, skipInterception);
+
             il.Emit(OpCodes.Ldloc, _callMap);
             il.PushMethod(constructor, module);
             il.Emit(OpCodes.Callvirt, _containsKey);
@@ -256,7 +256,6 @@
             il.Emit(OpCodes.Ldloc, _hasMethodCall);
             il.Emit(OpCodes.Brfalse, skipInterception);

-            // TODO: Insert the interception code here
             il.Emit(OpCodes.Ldloc, _callMap);

             il.PushMethod(constructor, module);
@@ -325,13 +324,17 @@
             MethodDefinition hostMethod,
             ModuleDefinition module)
         {
+            var skipInterception = il.Create(OpCodes.Nop);
+
+            // Call the original method if there is no matching call map
+            il.Emit(OpCodes.Ldloc, _callMap);
+            il.Emit(OpCodes.Brfalse, skipInterception);
+
             // Grab the method call instance
             il.Emit(OpCodes.Ldloc, _callMap);
             il.PushMethod(targetMethod, module);
             il.Emit(OpCodes.Callvirt, _containsKey);

-
-            var skipInterception = il.Create(OpCodes.Nop);
             il.Emit(OpCodes.Brfalse, skipInterception);


Only declare list of constructible enumerable types once.

--- ValveKeyValue/ValveKeyValue/ObjectCopier.cs
+++ ValveKeyValue/ValveKeyValue/ObjectCopier.cs
@@ -22,12 +22,12 @@
             if (IsArray(keyValueObject, out enumerableValues))
             {
                 object enumerable;
-                if (CreateTypedEnumerable(typeof(TObject), enumerableValues, out enumerable))
+                if (ConstructTypedEnumerable(typeof(TObject), enumerableValues, out enumerable))
                 {
                     return (TObject)enumerable;
                 }
             }
-            else if (IsEnumerableType(typeof(TObject)))
+            else if (IsConstructibleEnumerableType(typeof(TObject)))
             {
                 throw new InvalidOperationException($"Cannot deserialize a non-array value to type \"{typeof(TObject).Namespace}.{typeof(TObject).Name}\".");
             }
@@ -77,7 +77,7 @@
                     {
                         CopyList(obj, property, arrayValues);
                     }
-                    else if (IsEnumerableType(typeof(TObject)))
+                    else if (IsConstructibleEnumerableType(typeof(TObject)))
                     {
                         throw new InvalidOperationException($"Cannot deserialize a non-array value to type \"{typeof(TObject).Namespace}.{typeof(TObject).Name}\".");
                     }
@@ -137,7 +137,16 @@
             return true;
         }

-        static bool CreateTypedEnumerable(Type type, object[] values, out object typedEnumerable)
+        static readonly Dictionary<Type, Func<Type, object[], object>> EnumerableBuilders = new Dictionary<Type, Func<Type, object[], object>>
+        {
+            [typeof(List<>)] = (type, values) => InvokeGeneric(nameof(MakeList), type.GetGenericArguments()[0], new[] { values }),
+            [typeof(IList<>)] = (type, values) => InvokeGeneric(nameof(MakeList), type.GetGenericArguments()[0], new[] { values }),
+            [typeof(Collection<>)] = (type, values) => InvokeGeneric(nameof(MakeCollection), type.GetGenericArguments()[0], new[] { values }),
+            [typeof(ICollection<>)] = (type, values) => InvokeGeneric(nameof(MakeCollection), type.GetGenericArguments()[0], new[] { values }),
+            [typeof(ObservableCollection<>)] = (type, values) => InvokeGeneric(nameof(MakeObservableCollection), type.GetGenericArguments()[0], new[] { values }),
+        };
+
+        static bool ConstructTypedEnumerable(Type type, object[] values, out object typedEnumerable)
         {
             object listObject = null;

@@ -155,17 +164,10 @@
             }
             else if (type.IsGenericType)
             {
-                if (type.GetGenericTypeDefinition() == typeof(List<>) || type.GetGenericTypeDefinition() == typeof(IList<>))
-                {
-                    listObject = InvokeGeneric(nameof(MakeList), type.GetGenericArguments()[0], new[] { values });
-                }
-                else if (type.GetGenericTypeDefinition() == typeof(Collection<>) || type.GetGenericTypeDefinition() == typeof(ICollection<>))
-                {
-                    listObject = InvokeGeneric(nameof(MakeCollection), type.GetGenericArguments()[0], new[] { values });
-                }
-                else if (type.GetGenericTypeDefinition() == typeof(ObservableCollection<>))
-                {
-                    listObject = InvokeGeneric(nameof(MakeObservableCollection), type.GetGenericArguments()[0], new[] { values });
+                Func<Type, object[], object> builder;
+                if (EnumerableBuilders.TryGetValue(type.GetGenericTypeDefinition(), out builder))
+                {
+                    listObject = builder(type, values);
                 }
             }

@@ -173,7 +175,7 @@
             return listObject != null;
         }

-        static bool IsEnumerableType(Type type)
+        static bool IsConstructibleEnumerableType(Type type)
         {
             if (type.IsArray)
             {
@@ -187,11 +189,7 @@

             var gtd = type.GetGenericTypeDefinition();

-            if (gtd == typeof(List<>) ||
-                gtd == typeof(IList<>) ||
-                gtd == typeof(Collection<>) ||
-                gtd == typeof(ICollection<>) ||
-                gtd == typeof(ObservableCollection<>))
+            if (EnumerableBuilders.ContainsKey(gtd))
             {
                 return true;
             }
@@ -202,7 +200,7 @@
         static void CopyList<TObject>(TObject obj, PropertyInfo property, object[] values)
         {
             object list;
-            if (!CreateTypedEnumerable(property.PropertyType, values, out list))
+            if (!ConstructTypedEnumerable(property.PropertyType, values, out list))
             {
                 throw new NotSupportedException();
             }


A more useful VBIB.WriteText

A more useful VBIB.WriteText

--- ValveResourceFormat/Resource/Blocks/VBIB.cs
+++ ValveResourceFormat/Resource/Blocks/VBIB.cs
@@ -226,7 +226,33 @@

         public override void WriteText(IndentedTextWriter writer)
         {
-            writer.WriteLine("{0:X8}", Offset);
+            writer.WriteLine("Vertex buffers:");
+
+            foreach (var vertexBuffer in VertexBuffers)
+            {
+                writer.WriteLine($"Count: {vertexBuffer.Count}");
+                writer.WriteLine($"Size: {vertexBuffer.Size}");
+
+                for (var i = 0; i < vertexBuffer.Attributes.Count; i++)
+                {
+                    var vertexAttribute = vertexBuffer.Attributes[i];
+                    writer.WriteLine($"Attribute[{i}].Name = {vertexAttribute.Name}");
+                    writer.WriteLine($"Attribute[{i}].Offset = {vertexAttribute.Offset}");
+                    writer.WriteLine($"Attribute[{i}].Type = {vertexAttribute.Type}");
+                }
+
+                writer.WriteLine();
+            }
+
+            writer.WriteLine();
+            writer.WriteLine("Index buffers:");
+
+            foreach (var indexBuffer in IndexBuffers)
+            {
+                writer.WriteLine($"Count: {indexBuffer.Count}");
+                writer.WriteLine($"Size: {indexBuffer.Size}");
+                writer.WriteLine();
+            }
         }
     }
 }


Remove unnecessary call to String.Format.

--- Duplicati/Library/Main/Database/LocalListDatabase.cs
+++ Duplicati/Library/Main/Database/LocalListDatabase.cs
@@ -349,7 +349,7 @@
                         dict[m_filesets[i].Key] = i;

                     using(var cmd = m_connection.CreateCommand())
-                    using(var rd = cmd.ExecuteReader(string.Format(@"SELECT DISTINCT ""ID"" FROM ""Fileset"" ORDER BY ""Timestamp"" DESC ")))
+                    using(var rd = cmd.ExecuteReader(@"SELECT DISTINCT ""ID"" FROM ""Fileset"" ORDER BY ""Timestamp"" DESC "))
                         while (rd.Read())
                         {
                             var id = rd.GetInt64(0);


Updated the TEST command to also include data from DeletedBlock

--- Duplicati/Library/Main/Database/LocalTestDatabase.cs
+++ Duplicati/Library/Main/Database/LocalTestDatabase.cs
@@ -357,7 +357,9 @@
             public IEnumerable<KeyValuePair<Duplicati.Library.Interface.TestEntryStatus, string>> Compare()
             {
                 var cmpName = "CmpTable-" + Library.Utility.Utility.ByteArrayAsHexString(Guid.NewGuid().ToByteArray());
-                var create = @"CREATE TEMPORARY TABLE ""{1}"" AS SELECT ""Block"".""Hash"" AS ""Hash"", ""Block"".""Size"" AS ""Size"" FROM ""Remotevolume"", ""Block"" WHERE ""Remotevolume"".""Name"" = ? AND ""Remotevolume"".""ID"" = ""Block"".""VolumeID"" ";
+                var curBlocks = @"SELECT ""Block"".""Hash"" AS ""Hash"", ""Block"".""Size"" AS ""Size"" FROM ""Remotevolume"", ""Block"" WHERE ""Remotevolume"".""Name"" = ? AND ""Remotevolume"".""ID"" = ""Block"".""VolumeID""";
+                var delBlocks = @"SELECT ""DeletedBlock"".""Hash"", ""DeletedBlock"".""Size"" FROM ""DeletedBlock"", ""RemoteVolume"" WHERE ""RemoteVolume"".""Name"" = ? AND ""RemoteVolume"".""ID"" = ""DeletedBlock"".""VolumeID""";
+                var create = @"CREATE TEMPORARY TABLE ""{0}"" AS SELECT DISTINCT ""Hash"", ""Size"" FROM ({1} UNION {2})";
                 var extra = @"SELECT ? AS ""Type"", ""{0}"".""Hash"" AS ""Hash"" FROM ""{0}"" WHERE ""{0}"".""Hash"" NOT IN ( SELECT ""Hash"" FROM ""{1}"" )";
                 var missing = @"SELECT ? AS ""Type"", ""Hash"" AS ""Hash"" FROM ""{1}"" WHERE ""Hash"" NOT IN (SELECT ""Hash"" FROM ""{0}"")";
                 var modified = @"SELECT ? AS ""Type"", ""E"".""Hash"" AS ""Hash"" FROM ""{0}"" E, ""{1}"" D WHERE ""D"".""Hash"" = ""E"".""Hash"" AND (""D"".""Size"" != ""E"".""Size"")  ";
@@ -369,7 +371,7 @@

                     try
                     {
-                        cmd.ExecuteNonQuery(string.Format(create, m_tablename, cmpName), m_volumename);
+                        cmd.ExecuteNonQuery(string.Format(create, cmpName, curBlocks, delBlocks), m_volumename, m_volumename);
                         using(var rd = cmd.ExecuteReader(string.Format(extra + " UNION " + missing + " UNION " + modified, m_tablename, cmpName), (int)Library.Interface.TestEntryStatus.Extra, (int)Library.Interface.TestEntryStatus.Missing, (int)Library.Interface.TestEntryStatus.Modified))
                             while(rd.Read())
                                 yield return new KeyValuePair<Duplicati.Library.Interface.TestEntryStatus, string>((Duplicati.Library.Interface.TestEntryStatus)Convert.ToInt64(rd.GetValue(0)), rd.GetValue(1).ToString() );


now that IdeaMache supports proper method for local images, remove hack to support show edge blended images in IdeaMache

--- Ecologylab.BigSemantics/MetadataNS/Builtins/Image.cs
+++ Ecologylab.BigSemantics/MetadataNS/Builtins/Image.cs
@@ -44,8 +44,9 @@
         {
             get
             {
-                ParsedUri result = null;       // System.Windows.Media.ImageSource || Windows.UI.Xaml.Media.ImageSource
-                return new ParsedUri((this.LocalLocation != null) ? this.LocalLocation.Value.AbsoluteUri : this.Location.Value.AbsoluteUri);
+                //ParsedUri result = null;       // System.Windows.Media.ImageSource || Windows.UI.Xaml.Media.ImageSource
+                //return new ParsedUri((this.LocalLocation != null) ? this.LocalLocation.Value.AbsoluteUri : this.Location.Value.AbsoluteUri);
+                return this.Location.Value;
             }
         }
 	}


drop item change image open plant

drop item change image open plant


Comment out bug code in RandomStringGenerator class; class to be debugged or deleted

--- FonctionsUtiles.Fred.Csharp/RandomStringGenerator.cs
+++ FonctionsUtiles.Fred.Csharp/RandomStringGenerator.cs
@@ -26,7 +26,7 @@
       PatternDriven = false;
       Pattern = "";
       Random = new RNGCryptoServiceProvider();
-      ExistingStrings = new List();
+      ExistingStrings = new List<string>();
     }

     #region character sets managers
@@ -350,19 +350,21 @@
         UseLowerCaseCharacters = true;
       }

-      if (!RepeatCharacters && (CurrentGeneralCharacters.Length 3 chars).
- if (UniqueStrings && ExistingStrings.Contains(result))
-        return GenerateString(length);
-      AddExistingString(result); // Saving history
-      return result;
-    }
+      //if (!RepeatCharacters && (CurrentGeneralCharacters.Length 3 chars).
+      //if (UniqueStrings && ExistingStrings.Contains(result))
+      //       return GenerateString(length);
+      //     AddExistingString(result); // Saving history
+      //     return result;
+      return string.Empty; // while debug needed
+    }
+
     ///
     /// Generate a random string following the pattern
     ///
     private string PatternDrivenAlgo(string Pattern)
     {
       string result = "";
-      List Characters = new List();
+      var Characters = new List<string>();
       foreach (char character in Pattern.ToCharArray())
       {
         char newChar = ' ';
@@ -398,7 +400,8 @@
               throw new Exception("The character '" + character + "' is not supported");
             }
         }
-        Characters.Add(newChar);
+
+        Characters.Add(newChar.ToString());
         result += newChar;
       }
       return result;
@@ -450,25 +453,25 @@
       - MinNumericCharacters - MinSpecialCharacters;
       string result = "";
       // generation character set in order to support unique characters
-      List Characters = new List();
+      var Characters = new List<string>();
       // adding chars to an array
-      for (int i = 0; i < MinUpperCaseCharacters; i++)
-        Characters.Add(GetRandomCharFromArray(UpperCaseCharacters, Characters));
-      for (int i = 0; i < MinLowerCaseCharacters; i++)
-        Characters.Add(GetRandomCharFromArray(LowerCaseCharacters, Characters));
-      for (int i = 0; i < MinNumericCharacters; i++)
-        Characters.Add(GetRandomCharFromArray(NumericCharacters, Characters));
-      for (int i = 0; i < MinSpecialCharacters; i++)
-        Characters.Add(GetRandomCharFromArray(SpecialCharacters, Characters));
-      for (int i = 0; i < AllowedNumberOfGeneralChatacters; i++)
-        Characters.Add(GetRandomCharFromArray(CurrentGeneralCharacters, Characters));
+      //for (int i = 0; i < MinUpperCaseCharacters; i++)
+      //  Characters.Add(GetRandomCharFromArray(UpperCaseCharacters, Characters.ToString()));
+      //for (int i = 0; i < MinLowerCaseCharacters; i++)
+      //  Characters.Add(GetRandomCharFromArray(LowerCaseCharacters.ToString(), Characters));
+      //for (int i = 0; i < MinNumericCharacters; i++)
+      //  Characters.Add(GetRandomCharFromArray(NumericCharacters, Characters));
+      //for (int i = 0; i < MinSpecialCharacters; i++)
+      //  Characters.Add(GetRandomCharFromArray(SpecialCharacters, Characters));
+      //for (int i = 0; i < AllowedNumberOfGeneralChatacters; i++)
+      //  Characters.Add(GetRandomCharFromArray(CurrentGeneralCharacters, Characters));
       // generating result
       for (int i = 0; i < length; i++)
       {
         int position = GetRandomInt() % Characters.Count;
-        char CurrentChar = Characters[position];
+        //char CurrentChar = Characters[position];
         Characters.RemoveAt(position);
-        result += CurrentChar;
+        //result += CurrentChar;
       }
       return result;
     }
@@ -509,13 +512,14 @@
     /// Source of symbols
     /// Existing symbols. Can be null if RepeatCharacters flag is false
     /// A random character from the array
-    private char GetRandomCharFromArray(char[] array, List existentItems)
+    private char GetRandomCharFromArray(char[] array, List<string> existentItems)
     {
       char Character = ' ';
       do
       {
         Character = array[GetRandomInt() % array.Length];
-      } while (!RepeatCharacters && existentItems.Contains(Character));
+      } while (!RepeatCharacters && existentItems.Contains(Character.ToString()));
+
       return Character;
     }
     #endregion
@@ -529,7 +533,7 @@
     private char[] CurrentSpecialCharacters;
     private char[] CurrentGeneralCharacters; // All used characters
     private RNGCryptoServiceProvider Random;
-    private List ExistingStrings; // History
+    private List<string> ExistingStrings; // History
     #endregion
   }
 }


Return the error itself when only one error occurred

--- FubarDev.WebDavServer/DefaultHandlers/CopyHandler.cs
+++ FubarDev.WebDavServer/DefaultHandlers/CopyHandler.cs
@@ -127,7 +127,7 @@
             }

             var resultsByStatus = errorResults.GroupBy(x => x.GetGroupableStatus());
-            var responses = new List<Response>();
+            var responses = new List<Tuple<WebDavStatusCodes, Response>>();
             foreach (var statusResult in resultsByStatus)
             {
                 var templateItem = statusResult.First();
@@ -244,14 +244,26 @@
                     response.Responsedescription = string.Join(Environment.NewLine, reasons);
                 }

-                responses.Add(response);
+                responses.Add(Tuple.Create(templateItem.StatusCode, response));
+            }
+
+            if (responses.Count == 1)
+            {
+                var statusCode = responses.Select(x => x.Item1).Single();
+                var errorResponse = responses.Select(x => x.Item2).Single();
+                if (errorResponse.Error != null)
+                    return new WebDavResult<Error>(statusCode, errorResponse.Error);
+
+                var hrefCount = errorResponse.ItemsElementName.Count(x => x == ItemsChoiceType2.Href) + (errorResponse.Href == null ? 0 : 1);
+                if (hrefCount == 1)
+                    throw new WebDavException(statusCode);
             }

             return new WebDavResult<Multistatus>(
                 WebDavStatusCodes.MultiStatus,
                 new Multistatus()
                 {
-                    Response = responses.ToArray()
+                    Response = responses.Select(x => x.Item2).ToArray()
                 });
         }


Fixes

Fixes

--- WWCP_OIOIv4.x_Adapter/CPO/WWCPCPOAdapter.cs
+++ WWCP_OIOIv4.x_Adapter/CPO/WWCPCPOAdapter.cs
@@ -4499,7 +4499,7 @@
                                                                    Id,
                                                                    this,
                                                                    ChargeDetailRecords,
-                                                                   "Enqueued for at least " + FlushChargeDetailRecordsEvery.TotalSeconds + " seconds!",
+                                                                   I18NString.Create(Languages.eng, "Enqueued for at least " + FlushChargeDetailRecordsEvery.TotalSeconds + " seconds!"),
                                                                    //SendCDRsResults.SafeWhere(cdrresult => cdrresult.Result != SendCDRResultTypes.Enqueued),
                                                                    Runtime: Runtime);
                             invokeTimer  = true;
@@ -4602,13 +4602,13 @@

                         Endtime  = DateTime.UtcNow;
                         Runtime  = Endtime - StartTime;
-                        results   = SendCDRsResult.Timeout(DateTime.UtcNow,
-                                                           Id,
-                                                           this,
-                                                           ChargeDetailRecords,
-                                                           "Could not " + (TransmissionType == TransmissionTypes.Enqueue ? "enqueue" : "send") + " charge detail records!",
-                                                           //ChargeDetailRecords.SafeSelect(cdr => new SendCDRResult(cdr, SendCDRResultTypes.Timeout)),
-                                                           Runtime: Runtime);
+                        results  = SendCDRsResult.Timeout(DateTime.UtcNow,
+                                                          Id,
+                                                          this,
+                                                          ChargeDetailRecords,
+                                                          I18NString.Create(Languages.eng, "Could not " + (TransmissionType == TransmissionTypes.Enqueue ? "enqueue" : "send") + " charge detail records!"),
+                                                          //ChargeDetailRecords.SafeSelect(cdr => new SendCDRResult(cdr, SendCDRResultTypes.Timeout)),
+                                                          Runtime: Runtime);

                     }


Move method.

Move method.

--- Gu.Localization.Analyzers/Fixes/RenameResourceFix.cs
+++ Gu.Localization.Analyzers/Fixes/RenameResourceFix.cs
@@ -5,6 +5,7 @@
     using System.Composition;
     using System.IO;
     using System.Linq;
+    using System.Text;
     using System.Text.RegularExpressions;
     using System.Threading;
     using System.Threading.Tasks;
@@ -81,6 +82,26 @@
             return document.Project.Solution;
         }

+        private static void UpdateResx(FileInfo resx, IPropertySymbol property, string newName)
+        {
+            var xDocument = XDocument.Load(resx.FullName);
+            if (xDocument.Root is XElement root)
+            {
+                foreach (var candidate in root.Elements("data"))
+                {
+                    if (candidate.Attribute("name") is XAttribute attribute &&
+                        attribute.Value == property.Name)
+                    {
+                        attribute.Value = newName;
+                        using (var stream = File.OpenWrite(resx.FullName))
+                        {
+                            xDocument.Save(stream);
+                        }
+                    }
+                }
+            }
+        }
+
         private static void UpdateXaml(Project project, IPropertySymbol property, string newName)
         {
             if (project.MetadataReferences.TryFirst(x => x.Display.EndsWith("System.Xaml.dll"), out _))
@@ -127,26 +148,6 @@
             }
         }

-        private static void UpdateResx(FileInfo resx, IPropertySymbol property, string newName)
-        {
-            var xDocument = XDocument.Load(resx.FullName);
-            if (xDocument.Root is XElement root)
-            {
-                foreach (var candidate in root.Elements("data"))
-                {
-                    if (candidate.Attribute("name") is XAttribute attribute &&
-                        attribute.Value == property.Name)
-                    {
-                        attribute.Value = newName;
-                        using (var stream = File.OpenWrite(resx.FullName))
-                        {
-                            xDocument.Save(stream);
-                        }
-                    }
-                }
-            }
-        }
-
         private class Property : CSharpSyntaxRewriter
         {
             private readonly string newValue;


Attempt to make `ExpirationTestsAsync` more robust wrt CI.

--- WalletWasabi.Tests/UnitTests/MemoryTests.cs
+++ WalletWasabi.Tests/UnitTests/MemoryTests.cs
@@ -1,6 +1,7 @@
 using Microsoft.Extensions.Caching.Memory;
 using Microsoft.Extensions.Primitives;
 using System;
+using System.Diagnostics;
 using System.Threading;
 using System.Threading.Tasks;
 using Xunit;
@@ -139,26 +140,46 @@
 		[Fact]
 		public async Task ExpirationTestsAsync()
 		{
-			using var cache = new MemoryCache(new MemoryCacheOptions());
-
-			var result0 = await cache.AtomicGetOrCreateAsync(
-				"key1",
-				new MemoryCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMilliseconds(1) },
-				() => Task.FromResult("This will be expired"));
-
-			await Task.Delay(1);
-
-			var result1 = await cache.AtomicGetOrCreateAsync(
-				"key1",
+			const string Key = "key";
+
+			const string Value1 = "This will be expired";
+			const string Value2 = "Foo";
+			const string Value3 = "Should not change to this";
+
+			using var cache = new MemoryCache(new MemoryCacheOptions());
+
+			// First value should expire in 20 ms.
+			string result0 = await cache.AtomicGetOrCreateAsync(
+				Key,
+				new MemoryCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMilliseconds(20) },
+				() => Task.FromResult(Value1));
+
+			Stopwatch stopwatch = Stopwatch.StartNew();
+
+			// Wait 30 ms to let first value expire.
+			await Task.Delay(30);
+
+			// Measure how long we have waited.
+			long elapsedMilliseconds = stopwatch.ElapsedMilliseconds;
+
+			// Set Value2 to be in the cache.
+			string result1 = await cache.AtomicGetOrCreateAsync(
+				Key,
 				new MemoryCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(60) },
-				() => Task.FromResult("Foo"));
-
-			var result2 = await cache.AtomicGetOrCreateAsync(
-				"key1",
+				() => Task.FromResult(Value2));
+
+			// Value3 is not supposed to be used as Value2 could not expire.
+			string result2 = await cache.AtomicGetOrCreateAsync(
+				Key,
 				new MemoryCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(60) },
-				() => Task.FromResult("Should not change to this"));
-
-			Assert.Equal("Foo", result2);
+				() => Task.FromResult(Value3));
+
+			if (result2 != Value2)
+			{
+				Assert.False(true, $"{nameof(result2)} value is '{result2}' instead of '{Value2}'. " +
+					$"Debug info: Wait time was: {elapsedMilliseconds} ms. " +
+					$"Previous values: {nameof(result0)}='{result0}', {nameof(result1)}='{result1}'");
+			}
 		}

 		[Fact]


update customer in controller

update customer in controller

--- HiLaarIsch.WebApp/Controllers/CustomersController.cs
+++ HiLaarIsch.WebApp/Controllers/CustomersController.cs
@@ -16,13 +16,16 @@
     {
         private readonly IQueryProcessor queryProcessor;
         private readonly ICommandHandler<CreateModelCommand<CustomerModel>> createHandler;
+        private readonly ICommandHandler<UpdateModelCommand<CustomerModel>> updateHandler;

         public CustomersController(
             IQueryProcessor queryProcessor,
-            ICommandHandler<CreateModelCommand<CustomerModel>> createHandler)
+            ICommandHandler<CreateModelCommand<CustomerModel>> createHandler,
+            ICommandHandler<UpdateModelCommand<CustomerModel>> updateHandler)
         {
             this.queryProcessor = queryProcessor;
             this.createHandler = createHandler;
+            this.updateHandler = updateHandler;
         }

         [Route("~/")]
@@ -57,7 +60,7 @@
         [HttpPost, Route("edit")]
         public ActionResult Edit(CustomerModel model)
         {
-            //TODO: edit command handler
+            this.updateHandler.Handle(new UpdateModelCommand<CustomerModel>(model, model.Id));
             return this.Redirect("/"); //TODO: clean redirect
         }
     }


Added constructor overload to InvalidCredentialsExceptio

--- Infra.Authentications/InvalidCredentialsException.cs
+++ Infra.Authentications/InvalidCredentialsException.cs
@@ -8,5 +8,14 @@
 {
     public class InvalidCredentialsException : Exception
     {
+        public InvalidCredentialsException()
+            : base()
+        {
+        }
+
+        public InvalidCredentialsException(string message)
+            : base(message)
+        {
+        }
     }
 }


Added registration of entity states.

Added registration of entity states.

--- Jarvis.Framework.Kernel/Support/MongoRegistration.cs
+++ Jarvis.Framework.Kernel/Support/MongoRegistration.cs
@@ -189,6 +189,14 @@
 			).ToArray();

 			RegisterTypes(allAggregateStatesObjects);
+
+			var allEntityStatesObjects = assembly.GetTypes().Where(x =>
+				x.IsClass
+				&& !x.IsAbstract
+				&& typeof(JarvisEntityState).IsAssignableFrom(x)
+			).ToArray();
+
+			RegisterTypes(allEntityStatesObjects);
 		}
 #pragma warning restore S125 // Sections of code should not be "commented out"


Comment finance output

Comment finance output

--- Joinrpg/Views/Comments/_CommentFinancePartial.cshtml
+++ Joinrpg/Views/Comments/_CommentFinancePartial.cshtml
@@ -12,13 +12,13 @@
         break;
     case FinanceOperationType.Submit:
     case FinanceOperationType.Online:
-
Внесение денег: @Model.FinanceOperation.MoneyAmount ₽

+
Оплата взноса: @Model.FinanceOperation.MoneyAmount ₽

         break;
     case FinanceOperationType.Refund:
-
Возврат денег: @Model.FinanceOperation.MoneyAmount ₽

+
Возврат денег игроку: @Model.FinanceOperation.MoneyAmount ₽

         break;
     case FinanceOperationType.TransferTo:
-
Передача денег на другую заявку: @Model.FinanceOperation.MoneyAmount ₽

+
Перевод денег на другую заявку: @Model.FinanceOperation.MoneyAmount ₽

Получатель: @if (Model.ShowLinkToClaimIfTransfer)
                                 {
                                     @Html.ActionLink(Model.FinanceOperation.LinkedClaim.Name, "Edit", "Claim", new { projectId = Model.FinanceOperation.LinkedClaim.ProjectId, claimId = Model.FinanceOperation.LinkedClaimId }, new { target = "_blank" })
@@ -30,7 +30,7 @@

         break;
     case FinanceOperationType.TransferFrom:
-
Получение денег от другой заявки: @Model.FinanceOperation.MoneyAmount ₽

+
Перевод денег от другой заявки: @Model.FinanceOperation.MoneyAmount ₽

Источник: @if (Model.ShowLinkToClaimIfTransfer)
                               {
                                   @Html.ActionLink(Model.FinanceOperation.LinkedClaim.Name, "Edit", "Claim", new { projectId = Model.FinanceOperation.LinkedClaim.ProjectId, claimId = Model.FinanceOperation.LinkedClaimId }, new { target = "_blank" })
@@ -67,7 +67,7 @@
                     }
                     else
                     {
-                        Запрос в обработке
+                        Ожидание одобрения мастером
                     }
                     break;
                 case FinanceOperationState.Declined:
@@ -89,11 +89,11 @@
                     }
                     else
                     {
-                        Ожидание подтверждения
+                        Ожидание подтверждения мастером
                     }
                     break;
                 case FinanceOperationState.Declined:
-                    Получение не подтверждено
+                    Платеж не подтвержден мастером
                     break;
             }
             break;


New way of doing sub-query expressions means there is no longer an intermediate expression sometimes - so that changes some of the statement counts.

--- LINQToTTree/LINQToTTreeLib.Tests/QueryVisitorTest.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/QueryVisitorTest.cs
@@ -885,7 +885,6 @@
             Assert.AreEqual(2, query.QueryCode().First().Statements.Count(), "# of statements");
         }

-
         [TestMethod]
         public void TestFirstCombine()
         {
@@ -900,7 +899,7 @@
             query.DumpCodeToConsole();

             Assert.AreEqual(1, query.QueryCode().Count(), "# of query blocks");
-            Assert.AreEqual(3, query.QueryCode().First().Statements.Count(), "# of statements");
+            Assert.AreEqual(2, query.QueryCode().First().Statements.Count(), "# of statements");
         }

         [TestMethod]


Fixed a bug in the BuyController

Fixed a bug in the BuyController

--- LandsSystem/LandsSystem/Controllers/BuyController.cs
+++ LandsSystem/LandsSystem/Controllers/BuyController.cs
@@ -67,6 +67,7 @@
                 .OrderByDescending(a => a.Id)
                 .Select(l => new LandBuyModel
                 {
+                    Id = l.Id,
                     LandImageUrl = l.ImageUrl,
                     LandAddress = l.Address,
                     LandPrice = l.Price,
@@ -139,22 +140,9 @@
                 })
                 .FirstOrDefault();

-            var apartmentAdvertise = apartment.ApartmentAdvertises
-                .Where(a => a.Id == id)
-                .Select(a => new LandAdvertise
-                {
-                    IsDeleted = a.IsDeleted
-                })
-                .FirstOrDefault();
-
             if (apartment == null)
             {
                 return HttpNotFound();
-            }
-
-            if (apartmentAdvertise.IsDeleted)
-            {
-                ViewBag.IsDeleted = true;
             }

             return View(apartment);
@@ -179,23 +167,10 @@
                     LandAdvertises = l.LandAdvertises
                 })
                 .FirstOrDefault();
-
-            var landAdvertise = land.LandAdvertises
-                .Where(l => l.Id == id)
-                .Select(l => new LandAdvertise
-                {
-                    IsDeleted = l.IsDeleted
-                })
-                .FirstOrDefault();
-
+
             if (land == null)
             {
                 return HttpNotFound();
-            }
-
-            if (landAdvertise.IsDeleted)
-            {
-                ViewBag.IsDeleted = true;
             }

             return View(land);


[Xwt.Gtk] Add workaround for bug #10904 in SpinButtonBackend

--- Xwt.Gtk/Xwt.GtkBackend/SpinButtonBackend.cs
+++ Xwt.Gtk/Xwt.GtkBackend/SpinButtonBackend.cs
@@ -45,7 +45,17 @@
 			Widget = (Gtk.SpinButton) CreateWidget ();
 			Widget.Numeric = true;
 			Widget.Alignment = 1.0f;
+			Widget.ExposeEvent += HandleExposeEvent;
 			Widget.Show ();
+		}
+
+		// This is a workaround for bug https://bugzilla.xamarin.com/show_bug.cgi?id=10904
+		void HandleExposeEvent (object o, ExposeEventArgs args)
+		{
+			if (!string.IsNullOrEmpty (indeterminateMessage)) {
+				Widget.Numeric = false;
+				Widget.Text = indeterminateMessage;
+			}
 		}

 		protected virtual Gtk.Widget CreateWidget ()


taskbar item try

taskbar item try

--- MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs
+++ MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs
@@ -226,10 +226,39 @@
                 var showInTaskbar = AssociatedObject.ShowInTaskbar;
                 if (showInTaskbar && AssociatedObject.WindowState == WindowState.Minimized)
                 {
-                    AssociatedObject.ShowInTaskbar = false;
-                    AssociatedObject.ShowInTaskbar = showInTaskbar;
-                }
-            }
+                    //AssociatedObject.ShowInTaskbar = false;
+                    //AssociatedObject.ShowInTaskbar = showInTaskbar;
+                    ShowTaskBarButton(showInTaskbar);
+                }
+            }
+        }
+
+        private void ShowTaskBarButton(bool bVisible)
+        {
+            //NativeMethods.ShowWindow(handle, SW.HIDE);
+            if (bVisible)
+                ModifyExStyle(0, Standard.WS_EX.APPWINDOW);
+            else
+                ModifyExStyle(Standard.WS_EX.APPWINDOW, 0);
+            //NativeMethods.ShowWindow(handle, SW.SHOW);
+        }
+
+        /// <summary>Add and remove a native WindowStyle from the HWND.</summary>
+        /// <param name="removeStyle">The styles to be removed.  These can be bitwise combined.</param>
+        /// <param name="addStyle">The styles to be added.  These can be bitwise combined.</param>
+        /// <returns>Whether the styles of the HWND were modified as a result of this call.</returns>
+        private bool ModifyExStyle(Standard.WS_EX removeStyle, Standard.WS_EX addStyle)
+        {
+            Standard.Assert.IsNotDefault(handle);
+            var dwStyle = (Standard.WS_EX)Standard.NativeMethods.GetWindowLongPtr(handle, Standard.GWL.EXSTYLE).ToInt32();
+            var dwNewStyle = (dwStyle & ~removeStyle) | addStyle;
+            if (dwStyle == dwNewStyle)
+            {
+                return false;
+            }
+
+            Standard.NativeMethods.SetWindowLongPtr(handle, Standard.GWL.EXSTYLE, new IntPtr((int)dwNewStyle));
+            return true;
         }

         private void AssociatedObject_Deactivated(object sender, EventArgs e)


AbstractFlow improved

AbstractFlow improved

--- Models/HemodialysisMachine/Utilities/AbstractFlow.cs
+++ Models/HemodialysisMachine/Utilities/AbstractFlow.cs
@@ -1,11 +1,40 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;

 namespace HemodialysisMachine.Utilities
 {
+	using System.Linq;
+
+	// - The updates must be called in topological sorted order starting at the source.
+	// - Source elements use their Lambda-Function to generate the outgoing value
+	// - Flow elements get their incomingValue through a connection (which they retrieve by calling FlowUnitBefore)
+	// - Flow elements set their outgoingValue by setting FlowUnitAfterwards using their lambda function.
+	// - Sink elements get their incomingValue through a connection (which they retrieve by calling FlowUnitBefore)
+	// Example:
+	//   We have
+	//      - a Source source
+	//      - a DirectFlow directFlow
+	//      - a Sink sink
+	//   They are connected
+	//      - directFlow.FlowUnitBefore = source.FlowUnitAfterwards (ConnectOutWithIn)
+	//      - sink.FlowUnitBefore = directFlow.FlowUnitAfterwards (ConnectOutWithIn)
+	//      - directFlow.FlowUnitAfterwards = directFlow.FlowUnitBefore (Behavior of DirectFlow)
+	//   Scenario
+	//		- source.Update () is called
+	//			- source.SourceLambdaFunc is called
+	//			- source.ValueOfCurrentCylce is set
+	//		- directFlow.Update () is called
+	//			- directFlow.FlowUnitBefore() is called
+	//			- source.FlowUnitAfterwards() is called
+	//			- directFlow.FlowLambdaFunc() is called
+	//			- directFlow.ValueOfCurrentCylce is set
+	//		- sink.Update () is called
+	//			- sink.FlowUnitBefore() is called
+	//			- sink.SinkLambdaFunc is called
+	//			- sink.ValueOfCurrentCylce is set
+
+
+	// Comment: Modelica solves our problems by equations.
+
 	public interface IFlowIn<TUnit>
 	{
 		Func<TUnit> FlowUnitBefore { get; set; }
@@ -16,42 +45,133 @@
 		Func<TUnit> FlowUnitAfterwards { get; set; }
 	}

-	public class FlowConnection<TUnit>
+	public class FlowConnectors
 	{
-
-		public static void ConnectInWithIn(IFlowIn<TUnit> @from, IFlowIn<TUnit> to)
+		static TUnit[] SplitEqual<TUnit>(TUnit source, int splitsTotal)
 		{
-
+			return System.Linq.Enumerable.Repeat<TUnit>(source, splitsTotal).ToArray();
 		}

-		public static void ConnectOutWithIn(IFlowOut<TUnit> @from, IFlowIn<TUnit> to)
+		static TUnit MergeAny<TUnit>(TUnit[] sources)
+		{
+			return sources[0];
+		}
+	}
+
+	public abstract class FlowConnector<TUnit>
+	{
+		protected abstract TUnit Merger(TUnit[] sources);
+
+		protected abstract TUnit[] Splitter(TUnit source,int splits);
+
+		public void ConnectInWithIn(IFlowIn<TUnit> @from, IFlowIn<TUnit> to)
+		{
+			if (to!=null)
+				throw new Exception("to is already connected");
+			to.FlowUnitBefore = from.FlowUnitBefore;
+		}
+
+		public void ConnectOutWithIn(IFlowOut<TUnit> @from, IFlowIn<TUnit> to)
 		{
 			// The FlowUnit the from-component returns is the FlowUnit the to-component receives.
+			if (to != null)
+				throw new Exception("to is already connected");
 			to.FlowUnitBefore = from.FlowUnitAfterwards;
 		}

-		public static void ConnectOutWithOut(IFlowOut<TUnit> @from, IFlowOut<TUnit> to)
+		public void ConnectOutWithIn(IFlowOut<TUnit>[] fromOuts, IFlowIn<TUnit> to)
 		{
-			// The FlowUnit the from-component returns is the FlowUnit the to-component receives.
+			if (to != null)
+				throw new Exception("to is already connected");
+			var fromOutValues = fromOuts.Select(fromOut => fromOut.FlowUnitAfterwards());
+			to.FlowUnitBefore = () => Merger(fromOutValues.ToArray());
+		}
+
+		public void ConnectOutWithIn(IFlowOut<TUnit> @from, params IFlowIn<TUnit>[] to)
+		{
+			if (to != null)
+				throw new Exception("to is already connected");
+			var fromOutValue = @from.FlowUnitAfterwards();
+			var toInValues = Splitter(fromOutValue, to.Length);
+			for (int i = 0; i < to.Length; i++)
+			{
+				to[i].FlowUnitBefore = () => toInValues[i];
+			}
+		}
+
+		public void ConnectOutWithOut(IFlowOut<TUnit> @from, IFlowOut<TUnit> to)
+		{
+			if (to != null)
+				throw new Exception("to is already connected");
 			to.FlowUnitAfterwards = from.FlowUnitAfterwards;
 		}
 	}

-	public abstract class DirectFlow<TUnit> : IFlowIn<TUnit>, IFlowOut<TUnit>
+	public class Flow<TUnit> : IFlowIn<TUnit>, IFlowOut<TUnit>
 	{
 		public Func<TUnit> FlowUnitBefore { get; set; }
-
 		public Func<TUnit> FlowUnitAfterwards { get; set; }

-		protected DirectFlow()
+		private Func<TUnit,TUnit> FlowLambdaFunc { get; }
+		protected TUnit ValueOfCurrentCylce { get; private set; }
+
+		public Flow(Func<TUnit, TUnit> flowLambdaFunc)
 		{
-			FlowUnitAfterwards = FlowUnitAfterwardsStandard;
+			FlowLambdaFunc = flowLambdaFunc;
+			FlowUnitAfterwards = () => ValueOfCurrentCylce;
 		}

-		private TUnit FlowUnitAfterwardsStandard()
+		public void Update()
 		{
 			var incomingValue = FlowUnitBefore();
-			return incomingValue;  //Forward InRead to InRead without changing anything
+			ValueOfCurrentCylce = FlowLambdaFunc(incomingValue);
+		}
+	}
+
+	public class FlowSource<TUnit> : IFlowOut<TUnit>
+	{
+		public Func<TUnit> FlowUnitAfterwards { get; set; }
+
+		private Func<TUnit> SourceLambdaFunc { get; }
+		protected TUnit ValueOfCurrentCylce { get; private set; }
+
+		public FlowSource(Func<TUnit> sourceLambdaFunc)
+		{
+			SourceLambdaFunc = sourceLambdaFunc;
+			FlowUnitAfterwards = () => ValueOfCurrentCylce;
+		}
+
+		public void Update()
+		{
+			ValueOfCurrentCylce = SourceLambdaFunc();
+		}
+	}
+
+	public class FlowSink<TUnit> : IFlowIn<TUnit>
+	{
+		private Action<TUnit> SinkLambdaFunc { get; }
+
+		public Func<TUnit> FlowUnitBefore { get; set; }
+		protected TUnit ValueOfCurrentCylce { get; private set; }
+
+		public FlowSink(Action<TUnit> sinkLambdaFunc)
+		{
+			SinkLambdaFunc = sinkLambdaFunc;
+		}
+
+		public void Update()
+		{
+			var incomingValue = FlowUnitBefore();
+			SinkLambdaFunc(incomingValue);
+			ValueOfCurrentCylce = incomingValue;
+		}
+	}
+
+	public class DirectFlow<TUnit> : Flow<TUnit>, IFlowIn<TUnit>, IFlowOut<TUnit>
+	{
+		public DirectFlow()
+			: base( inValue => inValue)
+		{
 		}
 	}
 }


correct keypath value

correct keypath value

--- NBXplorer.Client/NBXplorerNetworkProvider.Althash.cs
+++ NBXplorer.Client/NBXplorerNetworkProvider.Althash.cs
@@ -12,7 +12,7 @@
 			Add(new NBXplorerNetwork(NBitcoin.Altcoins.Althash.Instance, networkType)
 			{
 				MinRPCVersion = 169900,
-				CoinType = networkType == ChainName.Mainnet ? new KeyPath("88'") : new KeyPath("0'")
+				CoinType = networkType == ChainName.Mainnet ? new KeyPath("172'") : new KeyPath("1'")
 			});
 		}


Assign Surface to Eye.

Assign Surface to Eye.

--- OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs
+++ OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs
@@ -140,6 +140,7 @@
                 surface.Camera.enabled = false; //@todo do we want this disabled?
                 surfaceGameObject.transform.parent = eyes[eyeIndex].transform; //child of Eye
                 surfaceGameObject.transform.localPosition = Vector3.zero;
+                eyes[eyeIndex].Surface = surface;
             }

             //determines if distortion will be used, and what type of distortion will be used


Fixed total stall of outbound queues if latency was high (intentional on neighbor regions)

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1077,6 +1077,7 @@
         private Int32 m_LastQueueFill = 0;
         private Int32 m_maxUpdates = 0;
         private bool m_lastSentFull = false;
+        private Int32 m_prevOutboundQueueSize = 0;

         private void EmptyQueueProcessUpdates(ThrottleOutPacketTypeFlags categories)
         {
@@ -1093,13 +1094,15 @@
                         evt.Set();
                     }

+                    m_LastQueueFill = 0;
                     return;
                 }

                 int lastLatency = 0;
                 if (m_maxUpdates == 0 || m_LastQueueFill == 0)
                 {
-                    m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
+                    if (m_maxUpdates == 0)
+                        m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
                 }
                 else
                 {
@@ -1149,7 +1152,11 @@
                 m_lastSentFull = sentAllTerse || sentAllFull;

                 //if (lastLatency > 35)
-               //     m_log.DebugFormat("[LLCV]: Last latency {0}, Max Updates {1}, Queue Size: {2}", lastLatency, m_maxUpdates, m_udpClient.OutboundQueueSize);
+                if ((m_udpClient.OutboundQueueSize > 0) && (m_udpClient.OutboundQueueSize != m_prevOutboundQueueSize))
+                {
+                    // m_log.DebugFormat("[LLCV]: Last latency {0}, Max Updates {1}, Queue Size: {2}", lastLatency, m_maxUpdates, m_udpClient.OutboundQueueSize);
+                    m_prevOutboundQueueSize = m_udpClient.OutboundQueueSize;
+                }
             }
         }

@@ -3564,6 +3571,7 @@
                         (ushort)(Scene.TimeDilation * ushort.MaxValue);

                 int max = Math.Min(m_primFullUpdates.Count, updatesToSend);
+                // m_log.DebugFormat("[ProcessPrimFullUpdates]: m_primFullUpdates={0} updatesToSend={1} max={2}", m_primFullUpdates.Count, updatesToSend, max);

                 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[max];

@@ -5769,6 +5777,11 @@
         /// <param name="throttles"></param>
         public void SetChildAgentThrottle(byte[] throttles)
         {
+            float total = 0;
+            foreach (float throttle in throttles)
+                total += throttle;
+            m_log.DebugFormat("[LLCV]: SetChildAgentThrottle: [0]={0} total={1}", throttles[0], total);
+
             if (m_udpClient.SetThrottles(throttles)) //if throttle changed reset updates
             {
                 m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;


Fix god level.

Fix god level.

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2482,9 +2482,11 @@

             adb.AgentID = AgentId;
             adb.SessionID = SessionId; // More security
-            gdb.GodLevel = (byte)AdminLevel;
-            gdb.Token = Token;
-            OutPacket(respondPacket, ThrottleOutPacketType.AvatarInfo);
+            gdb.GodLevel = (byte)AdminLevel;
+            gdb.Token = Token;
+            respondPacket.AgentData = adb;
+            respondPacket.GrantData = gdb;
+            OutPacket(respondPacket, ThrottleOutPacketType.Immediate);
         }

         public void SendGroupMembership(GroupMembershipData[] GroupMembership)


* Stop the crash to bash of the entire region server when a client thread fails by catching the exception in AuthUser() instead of letting it propogate out of the thread

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -688,34 +688,48 @@
             m_scene.AddNewClient(this, true);
         }

+        /// <summary>
+        /// Authorize an incoming user session.  This method lies at the base of the entire client thread.
+        /// </summary>
         protected virtual void AuthUser()
         {
-            // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code);
-            AuthenticateResponse sessionInfo =
-                m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId,
-                                                                  m_circuitCode);
-            if (!sessionInfo.Authorised)
-            {
-                //session/circuit not authorised
-                m_log.Info("[CLIENT]: New user request denied to " + m_userEndPoint.ToString());
-                m_packetQueue.Close();
-                m_clientThread.Abort();
-            }
-            else
-            {
-                m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString());
-                //session is authorised
-                m_firstName = sessionInfo.LoginInfo.First;
-                m_lastName = sessionInfo.LoginInfo.Last;
-
-                if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
-                {
-                    m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
-                }
-                // This sets up all the timers
-                InitNewClient();
-
-                ClientLoop();
+            try
+            {
+                // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code);
+                AuthenticateResponse sessionInfo =
+                    m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId,
+                                                                      m_circuitCode);
+                if (!sessionInfo.Authorised)
+                {
+                    //session/circuit not authorised
+                    m_log.Info("[CLIENT]: New user request denied to " + m_userEndPoint.ToString());
+                    m_packetQueue.Close();
+                    m_clientThread.Abort();
+                }
+                else
+                {
+                    m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString());
+                    //session is authorised
+                    m_firstName = sessionInfo.LoginInfo.First;
+                    m_lastName = sessionInfo.LoginInfo.Last;
+
+                    if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
+                    {
+                        m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
+                    }
+                    // This sets up all the timers
+                    InitNewClient();
+
+                    ClientLoop();
+                }
+            }
+            catch (Exception e)
+            {
+                // Don't let a failure in an individual client thread crash the whole sim.
+                // FIXME: possibly more sophisticated cleanup since leaving client resources around will
+                // probably cause long term instability.  I think this is still better than bring down the whole
+                // region
+                m_log.ErrorFormat("[CLIENT]: Client thread for {0} {1} crashed.  Exception {2}", Name, AgentId, e);
             }
         }


* Added static mutex to terrain load-tile to prevent file IO locking issues.

--- OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -51,6 +51,8 @@

     public class TerrainEngine
     {
+        public static System.Threading.Mutex fileIOLock = new System.Threading.Mutex();
+
         /// <summary>
         /// Plugin library for scripts
         /// </summary>
@@ -731,36 +733,45 @@
         /// <param name="lowerboundY">Where do the region coords start for this terrain?</param>
         public void LoadFromFileF32(string filename, int dimensionX, int dimensionY, int lowerboundX, int lowerboundY)
         {
-            int sectionToLoadX = ((this.offsetX - lowerboundX) * this.w);
-            int sectionToLoadY = ((this.offsetY - lowerboundY) * this.h);
-
-            double[,] tempMap = new double[dimensionX, dimensionY];
-
-            FileInfo file = new FileInfo(filename);
-            FileStream s = file.Open(FileMode.Open, FileAccess.Read);
-            BinaryReader bs = new BinaryReader(s);
-
-            int x, y;
-            for (x = 0; x < dimensionX; x++)
-            {
-                for (y = 0; y < dimensionY; y++)
-                {
-                    tempMap[x,y] = (double)bs.ReadSingle();
-                }
-            }
-
-            for (y = 0; y < h; y++)
-            {
-                for (x = 0; x < w; x++)
-                {
-                    heightmap.Set(x, y, tempMap[x + sectionToLoadX, y + sectionToLoadY]);
-                }
-            }
-
-            bs.Close();
-            s.Close();
-
-            tainted++;
+            fileIOLock.WaitOne();
+            try
+            {
+
+                int sectionToLoadX = ((this.offsetX - lowerboundX) * this.w);
+                int sectionToLoadY = ((this.offsetY - lowerboundY) * this.h);
+
+                double[,] tempMap = new double[dimensionX, dimensionY];
+
+                FileInfo file = new FileInfo(filename);
+                FileStream s = file.Open(FileMode.Open, FileAccess.Read);
+                BinaryReader bs = new BinaryReader(s);
+
+                int x, y;
+                for (x = 0; x < dimensionX; x++)
+                {
+                    for (y = 0; y < dimensionY; y++)
+                    {
+                        tempMap[x, y] = (double)bs.ReadSingle();
+                    }
+                }
+
+                for (y = 0; y < h; y++)
+                {
+                    for (x = 0; x < w; x++)
+                    {
+                        heightmap.Set(x, y, tempMap[x + sectionToLoadX, y + sectionToLoadY]);
+                    }
+                }
+
+                bs.Close();
+                s.Close();
+
+                tainted++;
+            }
+            finally
+            {
+                fileIOLock.ReleaseMutex();
+            }
         }

         /// <summary>


Implement support for qualified restriction in GetMembersOfRestriction

--- RDFSharp/Semantics/OWL/Ontology/RDFOntologyHelper.cs
+++ RDFSharp/Semantics/OWL/Ontology/RDFOntologyHelper.cs
@@ -827,122 +827,190 @@
             var result = new RDFOntologyData();

             //Enlist the properties which are compatible with the restriction's "OnProperty"
-            var compProps = ontology.Model.PropertyModel.GetSubPropertiesOf(ontRestriction.OnProperty)
-                                                        .UnionWith(ontology.Model.PropertyModel.GetEquivalentPropertiesOf(ontRestriction.OnProperty))
-                                                        .AddProperty(ontRestriction.OnProperty);
+            var restrictionProperties = ontology.Model.PropertyModel.GetSubPropertiesOf(ontRestriction.OnProperty)
+                                                                    .UnionWith(ontology.Model.PropertyModel.GetEquivalentPropertiesOf(ontRestriction.OnProperty))
+                                                                    .AddProperty(ontRestriction.OnProperty);

             //Filter assertions made with enlisted compatible properties
-            var fTaxonomy = new RDFOntologyTaxonomy(RDFSemanticsEnums.RDFOntologyTaxonomyCategory.Data);
-            foreach (var p in compProps)
-                fTaxonomy = fTaxonomy.UnionWith(ontology.Data.Relations.Assertions.SelectEntriesByPredicate(p));
+            var restrictionAssertions = new RDFOntologyTaxonomy(RDFSemanticsEnums.RDFOntologyTaxonomyCategory.Data);
+            foreach (var property in restrictionProperties)
+                restrictionAssertions = restrictionAssertions.UnionWith(ontology.Data.Relations.Assertions.SelectEntriesByPredicate(property));

             #region Cardinality
             if (ontRestriction is RDFOntologyCardinalityRestriction cardinalityRestriction) {

                 //Item2 is a counter for occurrences of the restricted property within the subject fact
-                var fCount = new Dictionary<Int64, Tuple<RDFOntologyFact, Int64>>();
+                var cardinalityRestrictionRegistry = new Dictionary<Int64, Tuple<RDFOntologyFact, Int64>>();

                 //Iterate the compatible assertions
-                foreach (var tEntry in fTaxonomy) {
-                    if (!fCount.ContainsKey(tEntry.TaxonomySubject.PatternMemberID)) {
-                         fCount.Add(tEntry.TaxonomySubject.PatternMemberID, new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)tEntry.TaxonomySubject, 1));
+                foreach (var assertion in restrictionAssertions) {
+                    if (!cardinalityRestrictionRegistry.ContainsKey(assertion.TaxonomySubject.PatternMemberID)) {
+                         cardinalityRestrictionRegistry.Add(assertion.TaxonomySubject.PatternMemberID, new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)assertion.TaxonomySubject, 1));
                     }
                     else {
-                         var occurrencyCounter = fCount[tEntry.TaxonomySubject.PatternMemberID].Item2;
-                         fCount[tEntry.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)tEntry.TaxonomySubject, occurrencyCounter + 1);
+                         var occurrencyCounter = cardinalityRestrictionRegistry[assertion.TaxonomySubject.PatternMemberID].Item2;
+                         cardinalityRestrictionRegistry[assertion.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)assertion.TaxonomySubject, occurrencyCounter + 1);
                     }
                 }

                 //Apply the cardinality restriction on the tracked facts
-                var fCountEnum = fCount.Values.GetEnumerator();
-                while (fCountEnum.MoveNext()) {
+                var cardinalityRestrictionRegistryEnumerator = cardinalityRestrictionRegistry.Values.GetEnumerator();
+                while (cardinalityRestrictionRegistryEnumerator.MoveNext()) {
                     var passesMinCardinality = true;
                     var passesMaxCardinality = true;

                     //MinCardinality: signal tracked facts having "#occurrences < MinCardinality"
                     if (cardinalityRestriction.MinCardinality > 0) {
-                        if (fCountEnum.Current.Item2 < cardinalityRestriction.MinCardinality) {
+                        if (cardinalityRestrictionRegistryEnumerator.Current.Item2 < cardinalityRestriction.MinCardinality) {
                             passesMinCardinality = false;
                         }
                     }

                     //MaxCardinality: signal tracked facts having "#occurrences > MaxCardinality"
                     if (cardinalityRestriction.MaxCardinality > 0) {
-                        if (fCountEnum.Current.Item2 > cardinalityRestriction.MaxCardinality) {
+                        if (cardinalityRestrictionRegistryEnumerator.Current.Item2 > cardinalityRestriction.MaxCardinality) {
                             passesMaxCardinality = false;
                         }
                     }

-                    //Save the candidate fact if it passes cardinality restrictions
+                    //Save the candidate fact if it passes cardinality restriction
                     if (passesMinCardinality    && passesMaxCardinality) {
-                        result.AddFact(fCountEnum.Current.Item1);
-                    }
-                }
-
-            }
-            #endregion
-
-            #region AllValuesFrom/SomeValuesFrom
-            else if (ontRestriction is RDFOntologyAllValuesFromRestriction || ontRestriction is RDFOntologySomeValuesFromRestriction) {
-
-                //Item2 is a counter for occurrences of the restricted property with a range member of the restricted "FromClass"
-                //Item3 is a counter for occurrences of the restricted property with a range member not of the restricted "FromClass"
-                var fCount = new Dictionary<Int64, Tuple<RDFOntologyFact, Int64, Int64>>();
-
-                //Enlist the classes which are compatible with the restricted "FromClass"
-                var compClasses = ontRestriction is RDFOntologyAllValuesFromRestriction
-                                    ? ontology.Model.ClassModel.GetSubClassesOf(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass)
-                                                               .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass))
-                                                               .AddClass(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass)
-                                    : ontology.Model.ClassModel.GetSubClassesOf(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass)
-                                                               .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass))
-                                                               .AddClass(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass);
+                        result.AddFact(cardinalityRestrictionRegistryEnumerator.Current.Item1);
+                    }
+                }
+
+            }
+            #endregion
+
+            #region QualifiedCardinality [OWL2]
+            else if (ontRestriction is RDFOntologyQualifiedCardinalityRestriction qualifiedCardinalityRestriction) {
+
+                //Item2 is a counter for occurrences of the restricted property within the subject fact
+                var qualifiedCardinalityRestrictionRegistry = new Dictionary<Int64, Tuple<RDFOntologyFact, Int64>>();
+
+                //Enlist the classes which are compatible with the restricted "OnClass"
+                var compClasses = ontology.Model.ClassModel.GetSubClassesOf(qualifiedCardinalityRestriction.OnClass)
+                                                           .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf(qualifiedCardinalityRestriction.OnClass))
+                                                           .AddClass(qualifiedCardinalityRestriction.OnClass);

                 //Iterate the compatible assertions
-                foreach (var tEntry in fTaxonomy) {
-
-                    //Initialize the occurrence counters of the subject fact
-                    if (!fCount.ContainsKey(tEntry.TaxonomySubject.PatternMemberID))
-                         fCount.Add(tEntry.TaxonomySubject.PatternMemberID, new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)tEntry.TaxonomySubject, 0, 0));
-
-                    //Iterate the class types of the object fact, checking presence of the restricted "FromClass"
-                    var fromClassFound = false;
-                    var objFactClassTypes = ontology.Data.Relations.ClassType.SelectEntriesBySubject(tEntry.TaxonomyObject);
+                foreach (var assertion in restrictionAssertions) {
+
+                    //Iterate the class types of the object fact, checking presence of the restricted "OnClass"
+                    var onClassFound = false;
+                    var objFactClassTypes = ontology.Data.Relations.ClassType.SelectEntriesBySubject(assertion.TaxonomyObject);
                     foreach (var objFactClassType in objFactClassTypes) {
                         var compObjFactClassTypes = ontology.Model.ClassModel.GetSuperClassesOf((RDFOntologyClass)objFactClassType.TaxonomyObject)
                                                                              .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf((RDFOntologyClass)objFactClassType.TaxonomyObject))
                                                                              .AddClass((RDFOntologyClass)objFactClassType.TaxonomyObject);
                         if (compObjFactClassTypes.IntersectWith(compClasses).ClassesCount > 0) {
+                            onClassFound = true;
+                            break;
+                        }
+                    }
+
+                    //If classtype is compatible, proceed with qualified counters
+                    if (onClassFound) {
+                        if (!qualifiedCardinalityRestrictionRegistry.ContainsKey(assertion.TaxonomySubject.PatternMemberID)) {
+                            qualifiedCardinalityRestrictionRegistry.Add(assertion.TaxonomySubject.PatternMemberID, new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)assertion.TaxonomySubject, 1));
+                        }
+                        else {
+                            var occurrencyCounter = qualifiedCardinalityRestrictionRegistry[assertion.TaxonomySubject.PatternMemberID].Item2;
+                            qualifiedCardinalityRestrictionRegistry[assertion.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64>((RDFOntologyFact)assertion.TaxonomySubject, occurrencyCounter + 1);
+                        }
+                    }
+                }
+
+                //Apply the qualified cardinality restriction on the tracked facts
+                var qualifiedCardinalityRestrictionRegistryEnumerator = qualifiedCardinalityRestrictionRegistry.Values.GetEnumerator();
+                while (qualifiedCardinalityRestrictionRegistryEnumerator.MoveNext()) {
+                    var passesMinQualifiedCardinality = true;
+                    var passesMaxQualifiedCardinality = true;
+
+                    //MinQualifiedCardinality: signal tracked facts having "#occurrences < MinQualifiedCardinality"
+                    if (qualifiedCardinalityRestriction.MinQualifiedCardinality > 0){
+                        if (qualifiedCardinalityRestrictionRegistryEnumerator.Current.Item2 < qualifiedCardinalityRestriction.MinQualifiedCardinality) {
+                            passesMinQualifiedCardinality = false;
+                        }
+                    }
+
+                    //MaxQualifiedCardinality: signal tracked facts having "#occurrences > MaxQualifiedCardinality"
+                    if (qualifiedCardinalityRestriction.MaxQualifiedCardinality > 0) {
+                        if (qualifiedCardinalityRestrictionRegistryEnumerator.Current.Item2 > qualifiedCardinalityRestriction.MaxQualifiedCardinality) {
+                            passesMaxQualifiedCardinality = false;
+                        }
+                    }
+
+                    //Save the candidate fact if it passes qualified cardinality restriction
+                    if (passesMinQualifiedCardinality && passesMaxQualifiedCardinality) {
+                        result.AddFact(qualifiedCardinalityRestrictionRegistryEnumerator.Current.Item1);
+                    }
+                }
+
+            }
+            #endregion
+
+            #region AllValuesFrom/SomeValuesFrom
+            else if (ontRestriction is RDFOntologyAllValuesFromRestriction || ontRestriction is RDFOntologySomeValuesFromRestriction) {
+
+                //Item2 is a counter for occurrences of the restricted property with a range member of the restricted "FromClass"
+                //Item3 is a counter for occurrences of the restricted property with a range member not of the restricted "FromClass"
+                var valuesFromRegistry = new Dictionary<Int64, Tuple<RDFOntologyFact, Int64, Int64>>();
+
+                //Enlist the classes which are compatible with the restricted "FromClass"
+                var classes = ontRestriction is RDFOntologyAllValuesFromRestriction
+                                ? ontology.Model.ClassModel.GetSubClassesOf(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass)
+                                                            .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass))
+                                                            .AddClass(((RDFOntologyAllValuesFromRestriction)ontRestriction).FromClass)
+                                : ontology.Model.ClassModel.GetSubClassesOf(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass)
+                                                            .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass))
+                                                            .AddClass(((RDFOntologySomeValuesFromRestriction)ontRestriction).FromClass);
+
+                //Iterate the compatible assertions
+                foreach (var assertion in restrictionAssertions) {
+
+                    //Initialize the occurrence counters of the subject fact
+                    if (!valuesFromRegistry.ContainsKey(assertion.TaxonomySubject.PatternMemberID))
+                         valuesFromRegistry.Add(assertion.TaxonomySubject.PatternMemberID, new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)assertion.TaxonomySubject, 0, 0));
+
+                    //Iterate the class types of the object fact, checking presence of the restricted "FromClass"
+                    var fromClassFound = false;
+                    var objectClassTypes = ontology.Data.Relations.ClassType.SelectEntriesBySubject(assertion.TaxonomyObject);
+                    foreach (var objectClassType in objectClassTypes) {
+                        var classTypes = ontology.Model.ClassModel.GetSuperClassesOf((RDFOntologyClass)objectClassType.TaxonomyObject)
+                                                                  .UnionWith(ontology.Model.ClassModel.GetEquivalentClassesOf((RDFOntologyClass)objectClassType.TaxonomyObject))
+                                                                  .AddClass((RDFOntologyClass)objectClassType.TaxonomyObject);
+                        if (classTypes.IntersectWith(classes).ClassesCount > 0) {
                             fromClassFound = true;
                             break;
                         }
                     }

                     //Update the occurrence counters of the subject fact
-                    var equalityCounter = fCount[tEntry.TaxonomySubject.PatternMemberID].Item2;
-                    var differenceCounter = fCount[tEntry.TaxonomySubject.PatternMemberID].Item3;
+                    var equalityCounter = valuesFromRegistry[assertion.TaxonomySubject.PatternMemberID].Item2;
+                    var differenceCounter = valuesFromRegistry[assertion.TaxonomySubject.PatternMemberID].Item3;
                     if (fromClassFound) {
-                        fCount[tEntry.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)tEntry.TaxonomySubject, equalityCounter + 1, differenceCounter);
+                        valuesFromRegistry[assertion.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)assertion.TaxonomySubject, equalityCounter + 1, differenceCounter);
                     }
                     else {
-                        fCount[tEntry.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)tEntry.TaxonomySubject, equalityCounter, differenceCounter + 1);
+                        valuesFromRegistry[assertion.TaxonomySubject.PatternMemberID] = new Tuple<RDFOntologyFact, Int64, Int64>((RDFOntologyFact)assertion.TaxonomySubject, equalityCounter, differenceCounter + 1);
                     }

                 }

                 //Apply the restriction on the subject facts
-                var fCountEnum = fCount.Values.GetEnumerator();
-                while  (fCountEnum.MoveNext()) {
+                var valuesFromRegistryEnumerator = valuesFromRegistry.Values.GetEnumerator();
+                while  (valuesFromRegistryEnumerator.MoveNext()) {
                     //AllValuesFrom
                     if (ontRestriction is RDFOntologyAllValuesFromRestriction) {
-                        if (fCountEnum.Current.Item2 >= 1 && fCountEnum.Current.Item3 == 0) {
-                            result.AddFact(fCountEnum.Current.Item1);
+                        if (valuesFromRegistryEnumerator.Current.Item2 >= 1 && valuesFromRegistryEnumerator.Current.Item3 == 0) {
+                            result.AddFact(valuesFromRegistryEnumerator.Current.Item1);
                         }
                     }
                     //SomeValuesFrom
                     else {
-                        if (fCountEnum.Current.Item2 >= 1) {
-                            result.AddFact(fCountEnum.Current.Item1);
+                        if (valuesFromRegistryEnumerator.Current.Item2 >= 1) {
+                            result.AddFact(valuesFromRegistryEnumerator.Current.Item1);
                         }
                     }
                 }
@@ -959,7 +1027,7 @@
                                                         .AddFact((RDFOntologyFact)hasValueRestriction.RequiredValue);

                     //Iterate the compatible assertions
-                    foreach (var tEntry in fTaxonomy) {
+                    foreach (var tEntry in restrictionAssertions) {
                         if (tEntry.TaxonomyObject.IsFact()) {
                             if (compFacts.SelectFact(tEntry.TaxonomyObject.ToString()) != null) {
                                 result.AddFact((RDFOntologyFact)tEntry.TaxonomySubject);
@@ -971,7 +1039,7 @@
                 else if (hasValueRestriction.RequiredValue.IsLiteral()) {

                     //Iterate the compatible assertions and track the occurrence informations
-                    foreach (var tEntry in fTaxonomy) {
+                    foreach (var tEntry in restrictionAssertions) {
                         if (tEntry.TaxonomyObject.IsLiteral()) {
                             try {
                                 var semanticLiteralsCompare  = RDFQueryUtilities.CompareRDFPatternMembers(hasValueRestriction.RequiredValue.Value, tEntry.TaxonomyObject.Value);