Add String.charAt

Add String.charAt

--- Mond/VirtualMachine/Prototypes/StringPrototype.cs
+++ Mond/VirtualMachine/Prototypes/StringPrototype.cs
@@ -13,6 +13,7 @@
             Value = new MondValue(MondValueType.Object);
             Value["prototype"] = ObjectPrototype.Value;

+            Value["charAt"] = new MondInstanceFunction(CharAt);
             Value["contains"] = new MondInstanceFunction(Contains);
             Value["endsWith"] = new MondInstanceFunction(EndsWith);
             Value["indexOf"] = new MondInstanceFunction(IndexOf);
@@ -33,6 +34,22 @@
         }

         /// <summary>
+        /// String charAt(Number index)
+        /// </summary>
+        private static MondValue CharAt(MondState state, MondValue instance, params MondValue[] arguments)
+        {
+            Check("charAt", instance.Type, arguments, MondValueType.Number);
+
+            var instStr = (string)instance;
+            var index = (int)arguments[0];
+
+            if (index < 0 || index > instStr.Length)
+                throw new MondRuntimeException("String.charAt: index out of bounds");
+
+            return new string(instStr[index], 1);
+        }
+
+        /// <summary>
         /// Bool contains(String value)
         /// </summary>
         private static MondValue Contains(MondState state, MondValue instance, params MondValue[] arguments)


fix(SnapDropZone): allow for child colliders to activate drop zone

The Snap Drop Zone policy list check was always done on the game object
for the collider touching the drop zone, however this would mean that
if a collider was a child of the interactable object then the policy
list would disallow the drop as it needed to check the validity of the
interactable object's game object.

This has now been fixed to check the interactable object's game obejct
in the policy list check.

--- Assets/VRTK/Prefabs/Resources/Scripts/VRTK_SnapDropZone.cs
+++ Assets/VRTK/Prefabs/Resources/Scripts/VRTK_SnapDropZone.cs
@@ -280,7 +280,7 @@
         private VRTK_InteractableObject ValidSnapObject(GameObject checkObject, bool grabState)
         {
             var ioCheck = checkObject.GetComponentInParent<VRTK_InteractableObject>();
-            return (ioCheck && ioCheck.IsGrabbed() == grabState && !VRTK_PolicyList.Check(checkObject, validObjectListPolicy) ? ioCheck : null);
+            return (ioCheck != null && ioCheck.IsGrabbed() == grabState && !VRTK_PolicyList.Check(ioCheck.gameObject, validObjectListPolicy) ? ioCheck : null);
         }

         private string ObjectPath(string name)


beta1.0.1

--- NautilusREST/Controllers/estudiantesController.cs
+++ NautilusREST/Controllers/estudiantesController.cs
@@ -95,7 +95,8 @@
             return StatusCode(HttpStatusCode.NoContent);
         }

-
+        [Route("api/estudiantes")]
+        [HttpPost]
         public HttpResponseMessage Postestudiante(estudiante estudiante)
         {
             if (!ModelState.IsValid)


Bug fixed: Azure環境でUTCで日付の範囲が決定される問題を解消。

--- Implem.Pleasanter/Libraries/Settings/DateColumnExtensions.cs
+++ Implem.Pleasanter/Libraries/Settings/DateColumnExtensions.cs
@@ -10,8 +10,9 @@
         public static Dictionary<string, ControlData> DateFilterOptions(this Column column)
         {
             var hash = new Dictionary<string, ControlData>();
-            var min = Min(column);
-            var max = Max(column);
+            var now = DateTime.Now.ToLocal();
+            var min = Min(column, now);
+            var max = Max(column, now);
             var diff = 0;
             switch (column.ColumnName)
             {
@@ -27,7 +28,8 @@
                 {
                     SetFy(
                         hash,
-                        DateTime.Now.AddMonths(m),
+                        now,
+                        now.AddMonths(m),
                         column.RecordedTime,
                         diff);
                 }
@@ -38,7 +40,8 @@
                 {
                     SetHalf(
                         hash,
-                        DateTime.Now.AddMonths(m),
+                        now,
+                        now.AddMonths(m),
                         column.RecordedTime,
                         diff);
                 }
@@ -49,7 +52,8 @@
                 {
                     SetQuarter(
                         hash,
-                        DateTime.Now.AddMonths(m),
+                        now,
+                        now.AddMonths(m),
                         column.RecordedTime,
                         diff);
                 }
@@ -60,7 +64,8 @@
                 {
                     SetMonth(
                         hash,
-                        DateTime.Now.AddMonths(m),
+                        now,
+                        now.AddMonths(m),
                         column.RecordedTime,
                         diff);
                 }
@@ -68,73 +73,87 @@
             return hash;
         }

-        private static int Min(Column column)
+        private static int Min(Column column, DateTime now)
         {
-            return (DateTime.Now.AddYears(column.DateFilterMinSpan.ToInt()) -
-                DateTime.Now).Months();
+            return (now.AddYears(column.DateFilterMinSpan.ToInt()) - now).Months();
         }

-        private static int Max(Column column)
+        private static int Max(Column column, DateTime now)
         {
-            return (DateTime.Now.AddYears(column.DateFilterMaxSpan.ToInt() + 1) -
-                DateTime.Now).Months();
+            return (now.AddYears(column.DateFilterMaxSpan.ToInt() + 1) - now).Months();
         }

         private static void SetMonth(
-            Dictionary<string, ControlData> hash, DateTime current, bool recordedTime, int diff)
+            Dictionary<string, ControlData> hash,
+            DateTime now,
+            DateTime current,
+            bool recordedTime,
+            int diff)
         {
             var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                 Implem.Libraries.Classes.TimePeriod.Types.Month, current, diff);
-            if (!recordedTime || timePeriod.From <= DateTime.Now)
+            if (!recordedTime || timePeriod.From <= now)
             {
                 hash.Add(
                     Period(timePeriod),
                     new ControlData(current.ToString("y", Sessions.CultureInfo()) +
-                        InRange(timePeriod)));
+                        InRange(timePeriod, now)));
             }
         }

         private static void SetQuarter(
-            Dictionary<string, ControlData> hash, DateTime current, bool recordedTime, int diff)
+            Dictionary<string, ControlData> hash,
+            DateTime now,
+            DateTime current,
+            bool recordedTime,
+            int diff)
         {
             var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                 Implem.Libraries.Classes.TimePeriod.Types.Quarter, current, diff);
-            if (!recordedTime || timePeriod.From <= DateTime.Now)
+            if (!recordedTime || timePeriod.From <= now)
             {
                 hash.Add(
                     Period(timePeriod),
                     new ControlData(Displays.Quarter(
                         current.Fy().ToString(), current.Quarter().ToString()) +
-                            InRange(timePeriod)));
+                            InRange(timePeriod, now)));
             }
         }

         private static void SetHalf(
-            Dictionary<string, ControlData> hash, DateTime current, bool recordedTime, int diff)
+            Dictionary<string, ControlData> hash,
+            DateTime now,
+            DateTime current,
+            bool recordedTime,
+            int diff)
         {
             var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                 Implem.Libraries.Classes.TimePeriod.Types.Half, current, diff);
-            if (!recordedTime || timePeriod.From <= DateTime.Now)
+            if (!recordedTime || timePeriod.From <= now)
             {
                 hash.Add(
                     Period(timePeriod),
                     new ControlData((current.Half() == 0
                         ? Displays.Half1(current.Fy().ToString())
                         : Displays.Half2(current.Fy().ToString())) +
-                            InRange(timePeriod)));
+                            InRange(timePeriod, now)));
             }
         }

         private static void SetFy(
-            Dictionary<string, ControlData> hash, DateTime current, bool recordedTime, int diff)
+            Dictionary<string, ControlData> hash,
+            DateTime now,
+            DateTime current,
+            bool recordedTime,
+            int diff)
         {
             var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                 Implem.Libraries.Classes.TimePeriod.Types.Fy, current, diff);
-            if (!recordedTime || timePeriod.From <= DateTime.Now)
+            if (!recordedTime || timePeriod.From <= now)
             {
                 hash.Add(
                     Period(timePeriod),
-                    new ControlData(Displays.Fy(current.Fy().ToString()) + InRange(timePeriod)));
+                    new ControlData(Displays.Fy(current.Fy().ToString()) + InRange(timePeriod, now)));
             }
         }

@@ -145,9 +164,9 @@
                 timePeriod.To.ToString("yyyy/M/d H:m:s.fff");
         }

-        private static string InRange(Implem.Libraries.Classes.TimePeriod timePeriod)
+        private static string InRange(Implem.Libraries.Classes.TimePeriod timePeriod, DateTime now)
         {
-            return timePeriod.InRange(DateTime.Now)
+            return timePeriod.InRange(now)
                 ? " *"
                 : string.Empty;
         }


Test Cases

Test Cases

--- King.Service.Tests/Scalability/QueueSimplifiedScalerTests.cs
+++ King.Service.Tests/Scalability/QueueSimplifiedScalerTests.cs
@@ -1,5 +1,6 @@
 namespace King.Service.Tests.Scalability
 {
+    using System;
     using King.Azure.Data;
     using King.Service.Data;
     using NSubstitute;
@@ -26,11 +27,23 @@
         }

         [Test]
-        public void IsAutoScaler()
+        public void IsQueueAutoScaler()
         {
             var count = Substitute.For<IQueueCount>();
             var creator = Substitute.For<ITaskCreator>();
             Assert.IsNotNull(new MyQScaler(count, creator) as QueueAutoScaler<ITaskCreator>);
         }
+
+        [Test]
+        public void ScaleUnit()
+        {
+            var count = Substitute.For<IQueueCount>();
+            var creator = Substitute.For<ITaskCreator>();
+            creator.Task.Returns((Func<IScalable>)null);
+
+            Assert.IsNotNull(new MyQScaler(count, creator) as QueueAutoScaler<ITaskCreator>);
+
+            creator.Task().Received();
+        }
     }
 }


Reduce array resizing in GasTileOverlay (#7479)

--- Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs
+++ Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs
@@ -187,11 +187,17 @@
         /// <returns></returns>
         private List<GasOverlayChunk> GetChunksInRange(EntityUid entity)
         {
-            var inRange = new List<GasOverlayChunk>();
-
             // This is the max in any direction that we can get a chunk (e.g. max 2 chunks away of data).
             var (maxXDiff, maxYDiff) = ((int) (_updateRange.X / ChunkSize) + 1, (int) (_updateRange.Y / ChunkSize) + 1);

+            // Setting initial list size based on the theoretical max number of chunks from a single grid. For default
+            // parameters, this is currently 6^2 = 36. Unless a player is near more than one grid, this is will
+            // generally slightly over-estimate the actual list size, which will be either 25, 30, or 36 (assuming the
+            // player is not near the edge of a grid).
+            var initialListSize = (1 + (int) MathF.Ceiling(2 * _updateRange.X / ChunkSize)) * (1 + (int) MathF.Ceiling(2 * _updateRange.Y / ChunkSize));
+
+            var inRange = new List<GasOverlayChunk>(initialListSize);
+
             var xform = Transform(entity);
             var worldPos = xform.MapPosition;

@@ -219,8 +225,8 @@
                         // (e.g. if we're on the very edge of a chunk we may need more chunks).

                         var (xDiff, yDiff) = (chunkIndices.X - entityTile.X, chunkIndices.Y - entityTile.Y);
-                        if (xDiff > 0 && xDiff > _updateRange.X ||
-                            yDiff > 0 && yDiff > _updateRange.Y ||
+                        if (xDiff > _updateRange.X ||
+                            yDiff > _updateRange.Y ||
                             xDiff < 0 && Math.Abs(xDiff + ChunkSize) > _updateRange.X ||
                             yDiff < 0 && Math.Abs(yDiff + ChunkSize) > _updateRange.Y) continue;


Disabled the message boxes that pop up if a fatal error occurs.

--- GW2PAO/App.xaml.cs
+++ GW2PAO/App.xaml.cs
@@ -57,6 +57,9 @@
             if (!GW2PAO.Properties.Settings.Default.IsLoggingEnabled)
                 LogManager.GlobalThreshold = NLog.LogLevel.Fatal;
 #endif
+
+            // Disable the debug assert windows that pop-up from NLog
+            System.Diagnostics.Trace.Listeners.OfType<System.Diagnostics.DefaultTraceListener>().First().AssertUiEnabled = false;

             // Log application information
             var executingAssembly = System.Reflection.Assembly.GetExecutingAssembly();


Changed text "Clickthrough" to "Click-Through"

--- GW2PAO/App.xaml.cs
+++ GW2PAO/App.xaml.cs
@@ -132,7 +132,7 @@

                 TrayIconVm.MenuItems.Add(null); // Null is treated as a seperator

-                TrayIconVm.MenuItems.Add(new MenuItemViewModel("Clickthrough Windows", null, true,
+                TrayIconVm.MenuItems.Add(new MenuItemViewModel("Click-Through Windows", null, true,
                     () => { return GW2PAO.Properties.Settings.Default.IsClickthroughEnabled; },
                     (enabled) => {
                                     GW2PAO.Properties.Settings.Default.IsClickthroughEnabled = enabled;


(IResource.GetDefaultExtension): new method.

--- GameRes/GameRes.cs
+++ GameRes/GameRes.cs
@@ -95,8 +95,17 @@

         protected IResource ()
         {
-            Extensions = new string[] { Tag.ToLowerInvariant() };
+            Extensions = new string[] { GetDefaultExtension() };
             Signatures = new uint[] { this.Signature };
+        }
+
+        protected string GetDefaultExtension ()
+        {
+            var ext = Tag.ToLowerInvariant();
+            int slash = ext.IndexOf ('/');
+            if (slash != -1)
+                ext = ext.Substring (0, slash);
+            return ext;
         }

         public virtual ResourceOptions GetDefaultOptions ()


Bring better error reporting to AVFoundation, for those doing disposes when they should not be making them

--- src/avfoundation.cs
+++ src/avfoundation.cs
@@ -263,7 +263,7 @@
 	[BaseType (typeof (NSObject))]
 	[Model]
 	interface AVAudioPlayerDelegate {
-		[Export ("audioPlayerDidFinishPlaying:successfully:")]
+		[Export ("audioPlayerDidFinishPlaying:successfully:"), CheckDisposed]
 		void FinishedPlaying (AVAudioPlayer player, bool flag);

 		[Export ("audioPlayerDecodeErrorDidOccur:error:")]
@@ -337,7 +337,7 @@
 	[BaseType (typeof (NSObject))]
 	[Model]
 	interface AVAudioRecorderDelegate {
-		[Export ("audioRecorderDidFinishRecording:successfully:")]
+		[Export ("audioRecorderDidFinishRecording:successfully:"), CheckDisposed]
 		void FinishedRecording (AVAudioRecorder recorder, bool flag);

 		[Export ("audioRecorderEncodeErrorDidOccur:error:")]
@@ -1542,7 +1542,7 @@
 		[Export ("captureOutput:didStartRecordingToOutputFileAtURL:fromConnections:")]
 		void DidStartRecording (AVCaptureFileOutput captureOutput, NSUrl outputFileUrl, NSObject [] connections);

-		[Export ("captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:")]
+		[Export ("captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:"), CheckDisposed]
 		void FinishedRecording (AVCaptureFileOutput captureOutput, NSUrl outputFileUrl, NSObject [] connections, NSError error);
 	}


Catching exceptions when loading types from assemblies

--- Addons/Entitas.CodeGenerator/Entitas.CodeGenerator/DependencyResolver.cs
+++ Addons/Entitas.CodeGenerator/Entitas.CodeGenerator/DependencyResolver.cs
@@ -62,9 +62,16 @@
         }

         public Type[] GetTypes() {
-            return _assemblies
-                .SelectMany(assembly => assembly.GetTypes())
-                .ToArray();
+            var types = new List<Type>();
+            foreach(var assembly in _assemblies) {
+                try {
+                    types.AddRange(assembly.GetTypes());
+                } catch(ReflectionTypeLoadException ex) {
+                    types.AddRange(ex.Types.Where(type => type != null));
+                }
+            }
+
+            return types.ToArray();
         }
     }
 }


Fix bug in filter.

Fix bug in filter.

Fix bug in filter.

--- DevelopmentInProgress.WPFControls/FilterTree/FilterTree.cs
+++ DevelopmentInProgress.WPFControls/FilterTree/FilterTree.cs
@@ -7,6 +7,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -48,21 +49,24 @@
                 var properties = item.GetType().GetProperties();
                 foreach (var property in properties)
                 {
-                    var interfaces = property.PropertyType.GetInterfaces();
-                    foreach (var interfaceType in interfaces)
+                    if (
+                        property.PropertyType.GetInterfaces()
+                            .Any(
+                                i =>
+                                    i.IsGenericType &&
+                                    i.GetGenericTypeDefinition().Name.Equals(typeof (IEnumerable<>).Name)))
                     {
-                        if (interfaceType.IsGenericType &&
-                            interfaceType.GetGenericTypeDefinition().Name.Equals(typeof(IEnumerable<>).Name))
+                        foreach (var itemType in property.PropertyType.GetGenericArguments())
                         {
-                            var itemTypes = property.PropertyType.GetGenericArguments();
-                            foreach (var itemType in itemTypes)
+                            var textPropertyInfo = itemType.GetProperty("Text");
+                            var visiblePropertyInfo = itemType.GetProperty("IsVisible");
+
+                            if (textPropertyInfo != null
+                                && visiblePropertyInfo != null)
                             {
-                                var textPropertyInfo = itemType.GetProperty("Text");
-                                var visiblePropertyInfo = itemType.GetProperty("IsVisible");
-                                if (textPropertyInfo != null
-                                    && visiblePropertyInfo != null)
+                                if (Contains((IEnumerable) property.GetValue(item, null), text, level))
                                 {
-                                    innerResult = Contains((IEnumerable)property.GetValue(item, null), text);
+                                    innerResult = true;
                                 }
                             }
                         }
@@ -86,7 +90,7 @@
             if (textPropertyInfo != null
                 && visiblePropertyInfo != null)
             {
-                if (String.IsNullOrEmpty(text)
+                if (string.IsNullOrEmpty(text)
                     || hasVisibleChild)
                 {
                     visiblePropertyInfo.SetValue(t, true, null);


WIP #258 - Fix code smell/bug

WIP #258 - Fix code smell/bug

--- DocumentProviders/ZptSharp.HtmlAgilityPack/HapAttribute.cs
+++ DocumentProviders/ZptSharp.HtmlAgilityPack/HapAttribute.cs
@@ -82,7 +82,7 @@

         (string, string) GetAttributeName(string name)
         {
-            var val = name?.Split(new[] { PrefixSeparator }, 2);
+            var val = name.Split(new[] { PrefixSeparator }, 2);
             if (val.Length == 1) return (null, val[0]);
             return (val[0], (val.Length > 1) ? val[1] : null);
         }


blacky movement at spawning handled

blacky movement at spawning handled

--- Documents/Unity3D/Catcheep/Assets/Scripts/SheepMovement.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/SheepMovement.cs
@@ -75,6 +75,7 @@
             case "blacky":
                 slideSpeed = Random.Range(0, 2) * 2 - 1;
                 destination = new Vector2(slideSpeed, -1f);
+                GetComponent<Animator>().SetInteger("slideSpeedAnimation", (int)slideSpeed);
                 break;
         }
     }


Inverted an if, converted an if+return to return statement.

--- AspNetCore.Identity.LiteDB/AspNetCore.Identity.LiteDB/LiteDbUserStore.cs
+++ AspNetCore.Identity.LiteDB/AspNetCore.Identity.LiteDB/LiteDbUserStore.cs
@@ -468,22 +468,18 @@
          var mergedCodes =
             await GetTokenAsync(user, AuthenticatorStoreLoginProvider, RecoveryCodeTokenName, cancellationToken) ?? "";
          var splitCodes = mergedCodes.Split(';');
-         if (splitCodes.Contains(code))
-         {
-            var updatedCodes = new List<string>(splitCodes.Where(s => s != code));
-            await ReplaceCodesAsync(user, updatedCodes, cancellationToken);
-            return true;
-         }
-
-         return false;
+         if (!splitCodes.Contains(code)) return false;
+         var updatedCodes = new List<string>(splitCodes.Where(s => s != code));
+         await ReplaceCodesAsync(user, updatedCodes, cancellationToken);
+         return true;
+
       }

       public async Task<int> CountCodesAsync(TUser user, CancellationToken cancellationToken)
       {
          var mergedCodes =
             await GetTokenAsync(user, AuthenticatorStoreLoginProvider, RecoveryCodeTokenName, cancellationToken) ?? "";
-         if (mergedCodes.Length > 0) return mergedCodes.Split(';').Length;
-         return 0;
+         return mergedCodes.Length > 0 ? mergedCodes.Split(';').Length : 0;
       }

       #endregion


Ensure that failed put operations throw exception.

The FlushBackend method uses Task.WhenAny to await the first completion
of the uploader task or the flush request.  Since the uploader was
setting the status of the flush request in the finally block, the flush
request would complete first when an exception was thrown, causing the
uploader's exception to be unobserved.  To resolve this,  we check that
the uploader's status is not faulted before setting the flush request
status.

This addresses issue #3673.

--- Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
+++ Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
@@ -166,11 +166,12 @@
                         }
                         else if (req is FlushRequest flush)
                         {
+                            Task finishedTask = null;
                             try
                             {
                                 while (workers.Any())
                                 {
-                                    var finishedTask = await Task.WhenAny(workers.Select(w => w.Task)).ConfigureAwait(false);
+                                    finishedTask = await Task.WhenAny(workers.Select(w => w.Task)).ConfigureAwait(false);
                                     if (finishedTask.IsFaulted)
                                         ExceptionDispatchInfo.Capture(finishedTask.Exception).Throw();
                                     workers.RemoveAll(w => w.Task == finishedTask);
@@ -179,7 +180,10 @@
                             }
                             finally
                             {
-                                flush.SetFlushed(lastSize);
+                                if (finishedTask != null && !finishedTask.IsFaulted)
+                                {
+                                    flush.SetFlushed(lastSize);
+                                }
                             }
                             break;
                         }


Limit junk bounce audio pan

Limit junk bounce audio pan

--- Assets/Resources/Microgames/_Bosses/PaperThief/Scripts/PaperThiefJunk.cs
+++ Assets/Resources/Microgames/_Bosses/PaperThief/Scripts/PaperThiefJunk.cs
@@ -56,6 +56,6 @@
                 enabled = false;
         }
         _audioSource.pitch = Time.timeScale;
-        _audioSource.panStereo = AudioHelper.getAudioPan(transform.position.x);
+        _audioSource.panStereo = AudioHelper.getAudioPan(transform.position.x) * .5f;
 	}
 }


Changed OutputWindow Logging Level on Debug build

--- CopaceticSoftware.CodeGenerator.StarterKit/Logging/Log4NetInitializer.cs
+++ CopaceticSoftware.CodeGenerator.StarterKit/Logging/Log4NetInitializer.cs
@@ -1,4 +1,4 @@
-//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
 // <copyright file="Log4NetInitializer.cs" company="Copacetic Software">
 // Copyright (c) Copacetic Software.
 // <author>Philip Pittle</author>
@@ -55,7 +55,12 @@
                     new LevelAndLoggerFilter
                     {
                         LevelMax = Level.Fatal,
-                        LevelMin = Level.Warn,
+                        LevelMin =
+                        #if DEBUG
+                        Level.All
+                        #else
+                        Level.Warn,
+                        #endif
                         LoggerToMatch = typeof(IPipelineStep<>).Namespace
                     });


Fixed error.

Fixed error.

- A pool contains references which point to same objects.

--- EOptimization/Math/Optimization/MultiObjOptimization/MOFWOptimization.cs
+++ EOptimization/Math/Optimization/MultiObjOptimization/MOFWOptimization.cs
@@ -20,9 +20,11 @@
     /// </summary>
     public class MOFWOptimizer : BaseFW<IEnumerable<double>, IMOOptProblem>, IMOOptimizer<FWParams>
     {
+        private PointND _idealPoint, _nadirPoint;
+
         private Ndsort<double> _nds;

-        private void EvalFunction(Func<IReadOnlyList<double>, IEnumerable<double>> Function)
+        private void EvalFunctionForCharges(Func<IReadOnlyList<double>, IEnumerable<double>> Function)
         {
             for (int i = 0; i < _parameters.NP; i++)
             {
@@ -30,7 +32,7 @@
             }
         }

-        private void EvalFunctionForCharges(Func<IReadOnlyList<double>, IEnumerable<double>> Function)
+        private void EvalFunctionForDebris(Func<IReadOnlyList<double>, IEnumerable<double>> Function)
         {
             for (int i = 0; i < _debris.Length; i++)
             {
@@ -44,15 +46,27 @@
         /// <summary>
         /// Find amount debris for each point of charge.
         /// </summary>
-        private void FindAmountDebris(int[] ChargeFronts)
-        {
-            double s = 0.0;
+        private void FindAmountDebris()
+        {
+            double s = 0;
+
+            double denumerator = 0;

             int dimObjs = _chargePoints[0].Objs.Count;

             for (int i = 0; i < _parameters.NP; i++)
             {
-                s = _parameters.M * Math.Pow(Math.E, -0.1 * ChargeFronts[i]);
+                denumerator += PointND.Distance(_nadirPoint, _chargePoints[i].Objs);
+            }
+
+            if (denumerator < Constants.VALUE_AVOID_DIV_BY_ZERO)
+            {
+                denumerator += Constants.VALUE_AVOID_DIV_BY_ZERO;
+            }
+
+            for (int i = 0; i < _parameters.NP; i++)
+            {
+                s = _parameters.M * (PointND.Distance(_nadirPoint, _chargePoints[i].Objs) + Constants.VALUE_AVOID_DIV_BY_ZERO) / denumerator;

                 base.FindAmountDebrisForCharge(s, i, dimObjs);
             }
@@ -65,14 +79,26 @@
         /// <param name="LowerBounds"> </param>
         /// <param name="UpperBounds"> </param>
         /// <param name="Function">    </param>
-        private void GenerateDebris(int[] ChargeFronts, IReadOnlyList<double> LowerBounds, IReadOnlyList<double> UpperBounds, Func<IReadOnlyList<double>, IEnumerable<double>> Function)
-        {
-            double amplitude = 0;
+        private void GenerateDebris(IReadOnlyList<double> LowerBounds, IReadOnlyList<double> UpperBounds, Func<IReadOnlyList<double>, IEnumerable<double>> Function)
+        {
+            double denumerator = 0;
+
+            for (int j = 0; j < _parameters.NP; j++)
+            {
+                denumerator += PointND.Distance(_chargePoints[j].Objs, _idealPoint);
+            }
+
+            if (denumerator < Constants.VALUE_AVOID_DIV_BY_ZERO)
+            {
+                denumerator += Constants.VALUE_AVOID_DIV_BY_ZERO;
+            }

             for (int i = 0; i < _parameters.NP; i++)
             {
+                double amplitude = 0;
+
                 // Amplitude of explosion.
-                amplitude = _parameters.Amax * Math.Tanh(0.1 * (ChargeFronts[i] + 1));
+                amplitude = _parameters.Amax * (PointND.Distance(_chargePoints[i].Objs, _idealPoint) + Constants.VALUE_AVOID_DIV_BY_ZERO) / denumerator;

                 base.GenerateDebrisForCharge(LowerBounds, UpperBounds, amplitude, i);
             }
@@ -81,143 +107,171 @@
         /// <summary>
         /// Generate current population.
         /// </summary>
-        private void GenerateNextAgents(int[] ChargeAndDebrisFronts, IEnumerable<Agent> FirstFront)
-        {
-            int firstFrontCount = ChargeAndDebrisFronts.Count(front => front == 0);
-
-            // The total count minus non-dominated solutions.
-            int actualSizeMatrix = _chargePoints.Count - firstFrontCount;
-
-            for (int k = 0; k < _debris.Length; k++)
-            {
-                actualSizeMatrix += _debris[k].Count;
-            }
-
-            base.ResetMatrixAndTrimWeights(actualSizeMatrix);
-
-            {
+        private void GenerateNextAgents(IEnumerable<KeyValuePair<int, Agent>> ChargesAndDebris)
+        {
+            int firstFrontCount = ChargesAndDebris.Count(kvalue => kvalue.Key == 0);
+
+            int actualSizeMatrix = 0;
+
+            if (firstFrontCount > _parameters.NP)
+            {
+                actualSizeMatrix = firstFrontCount;
+
+                base.ResetMatrixAndTrimWeights(actualSizeMatrix);
+
                 int index = 0;
-                int total = 0;
-
-                for (int i = 0; i < _chargePoints.Count; i++)
-                {
-                    // Skip non-dominated solutions.
-                    if (ChargeAndDebrisFronts[total] != 0)
+
+                foreach (var agent in ChargesAndDebris.Where(kvalue => kvalue.Key == 0).Select(kvalue => kvalue.Value))
+                {
+                    _weightedAgents[index++].Agent.SetAt(agent);
+                }
+            }
+            else
+            {
+                // The total count minus non-dominated solutions.
+                actualSizeMatrix = _parameters.NP - firstFrontCount;
+
+                for (int k = 0; k < _debris.Length; k++)
+                {
+                    actualSizeMatrix += _debris[k].Count;
+                }
+
+                base.ResetMatrixAndTrimWeights(actualSizeMatrix);
+
+                int index = 0;
+
+                foreach (var frontAgent in ChargesAndDebris)
+                {
+                    // Solutions from all fronts except zero front are taken.
+                    if (frontAgent.Key != 0)
                     {
-                        _weightedAgents[index].Agent.SetAt(_chargePoints[i]);
-                        index++;
+                        _weightedAgents[index++].Agent.SetAt(frontAgent.Value);
                     }
-                    total++;
-                }
-
-                for (int i = 0; i < _debris.Length; i++)
-                {
-                    foreach (Agent splinter in _debris[i])
+                }
+            }
+
+
+            base.CalculateDistances();
+
+
+            int startIndex = 0;
+
+            int totalToTake = 0;
+
+            if (firstFrontCount > _parameters.NP)
+            {
+                totalToTake = _parameters.NP;
+            }
+            else
+            {
+                foreach (var agent in ChargesAndDebris.Where(kvalue => kvalue.Key == 0).Select(kvalue => kvalue.Value))
+                {
+                    _chargePoints[startIndex++].SetAt(agent);
+                }
+
+                totalToTake = _parameters.NP - firstFrontCount;
+            }
+
+
+            if (totalToTake > 0)
+            {
+                base.TakeAgents(actualSizeMatrix, totalToTake);
+            }
+
+            for (int i = 0; i < _weightedAgents.Count; i++)
+            {
+                if (_weightedAgents[i].IsTake)
+                {
+                    _chargePoints[startIndex++].SetAt(_weightedAgents[i].Agent);
+                }
+            }
+        }
+
+        protected override void Clear()
+        {
+
+        }
+
+        protected override void FirstStep(IMOOptProblem Problem)
+        {
+            if (Problem == null)
+            {
+                throw new ArgumentNullException(nameof(Problem));
+            }
+
+            InitAgents(Problem.LowerBounds, Problem.UpperBounds, Problem.CountObjs);
+
+            EvalFunctionForCharges(Problem.TargetFunction);
+        }
+
+        protected override void NextStep(IMOOptProblem Problem)
+        {
+            FindIdealAndNadirPoint();
+
+            FindAmountDebris();
+
+            GenerateDebris(Problem.LowerBounds, Problem.UpperBounds, Problem.TargetFunction);
+
+            EvalFunctionForDebris(Problem.TargetFunction);
+
+            var allAgents = _chargePoints.Concat(_debris.SelectMany(coll => coll.Select(agent => agent)));
+
+            int[] allFronts = _nds.NonDominSort(allAgents, item => item.Objs);
+
+            GenerateNextAgents(allAgents.Zip(allFronts, (agent, front) => new KeyValuePair<int, Agent>(front, agent)));
+
+            EvalFunctionForCharges(Problem.TargetFunction);
+        }
+
+        protected override void Init(FWParams Parameters, int Dim, int DimObjs)
+        {
+            base.Init(Parameters, Dim, DimObjs);
+
+            if(_idealPoint == null)
+            {
+                _idealPoint = new PointND(0.0, DimObjs);
+            }
+            else if(_idealPoint.Count != DimObjs)
+            {
+                _idealPoint = new PointND(0.0, DimObjs);
+            }
+
+            if (_nadirPoint == null)
+            {
+                _nadirPoint = new PointND(0.0, DimObjs);
+            }
+            else if (_nadirPoint.Count != DimObjs)
+            {
+                _nadirPoint = new PointND(0.0, DimObjs);
+            }
+        }
+
+        private void FindIdealAndNadirPoint()
+        {
+            _idealPoint.SetAt(_chargePoints[0].Objs);
+            _nadirPoint.SetAt(_chargePoints[0].Objs);
+
+            for (int i = 1; i < _parameters.NP; i++)
+            {
+                for (int j = 0; j < _chargePoints[i].Objs.Count; j++)
+                {
+                    if(_chargePoints[i].Objs[j] < _idealPoint[j])
                     {
-                        if (ChargeAndDebrisFronts[total] != 0)
-                        {
-                            _weightedAgents[index].Agent.SetAt(splinter);
-                            index++;
-                        }
-
-                        total++;
+                        _idealPoint[j] = _chargePoints[i].Objs[j];
                     }
-                }
-            }
-
-            base.CalculateDistances();
-
-            int startIndex = 0;
-
-            foreach (var item in FirstFront)
-            {
-                if (startIndex < _parameters.NP)
-                {
-                    _chargePoints[startIndex++].SetAt(item);
-                }
-            }
-
-            int totalToTake = _parameters.NP - firstFrontCount;
-
-            if (totalToTake > 0)
-            {
-                base.TakeAgents(actualSizeMatrix, totalToTake);
-            }
-
-            for (int i = 0; i < actualSizeMatrix && totalToTake > 0; i++)
-            {
-                if (_weightedAgents[i].IsTake)
-                {
-                    _chargePoints[startIndex].SetAt(_weightedAgents[i].Agent);
-                    startIndex++;
-                    totalToTake--;
-                }
-            }
-        }
-
-        protected override void Clear()
-        {
-
-        }
-
-        protected override void FirstStep(IMOOptProblem Problem)
-        {
-            if (Problem == null)
-            {
-                throw new ArgumentNullException(nameof(Problem));
-            }
-
-            InitAgents(Problem.LowerBounds, Problem.UpperBounds, Problem.CountObjs);
-
-            EvalFunction(Problem.TargetFunction);
-
-            int[] chargeFronts = _nds.NonDominSort(_chargePoints, item => item.Objs);
-
-            FindAmountDebris(chargeFronts);
-
-            GenerateDebris(chargeFronts, Problem.LowerBounds, Problem.UpperBounds, Problem.TargetFunction);
-
-            EvalFunctionForCharges(Problem.TargetFunction);
-        }
-
-        protected override void NextStep(IMOOptProblem Problem)
-        {
-            var allAgents = _chargePoints.Concat(_debris[0]);
-
-            for (int i = 1; i < _debris.Length; i++)
-            {
-                allAgents = allAgents.Concat(_debris[i]);
-            }
-
-            int[] allFronts = _nds.NonDominSort(allAgents, item => item.Objs);
-
-            LinkedList<Agent> firstFront = new LinkedList<Agent>();
-
-            int index = 0;
-
-            foreach (var item in allAgents)
-            {
-                if (allFronts[index] == 0)
-                {
-                    firstFront.AddLast(item);
-                }
-                index++;
-            }
-
-            GenerateNextAgents(allFronts, firstFront);
-
-            EvalFunction(Problem.TargetFunction);
-
-            int[] chargeFronts = _nds.NonDominSort(_chargePoints, item => item.Objs);
-
-            FindAmountDebris(chargeFronts);
-
-            GenerateDebris(chargeFronts, Problem.LowerBounds, Problem.UpperBounds, Problem.TargetFunction);
-
-            EvalFunctionForCharges(Problem.TargetFunction);
-        }
-
-        public IEnumerable<Agent> ParetoFront => _chargePoints;
+                    else if (_chargePoints[i].Objs[j] > _nadirPoint[j])
+                    {
+                        _nadirPoint[j] = _chargePoints[i].Objs[j];
+                    }
+                }
+            }
+        }
+
+        public IEnumerable<Agent> ParetoFront
+        {
+            get => _nds.NonDominSort(_chargePoints, ag => ag.Objs).Zip(_chargePoints, (front, agent) => new KeyValuePair<int, Agent>(front, agent)).Where(kv => kv.Key == 0).Select(kv => kv.Value);
+
+        }

         /// <summary>
         /// Create object which uses default implementation for random generators.


Assume type isn't IsCollectible, given LESSTHAN_NET35

--- Framework.Core/System/Linq/Expressions/Compiler/DelegateHelpers.cache.cs
+++ Framework.Core/System/Linq/Expressions/Compiler/DelegateHelpers.cache.cs
@@ -3,7 +3,6 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
-
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Runtime.CompilerServices;
@@ -75,10 +74,7 @@
             if (!curTypeInfo.TypeChain.TryGetValue(lookingUp, out var nextTypeInfo))
             {
                 nextTypeInfo = new TypeInfo();
-                /*if (!lookingUp.IsCollectible)
-                {
-                    curTypeInfo.TypeChain[lookingUp] = nextTypeInfo;
-                }*/
+                curTypeInfo.TypeChain[lookingUp] = nextTypeInfo;
             }

             return nextTypeInfo;


MediaElementRenderer.cs -> Remove If IsPlaying

Hi, I think it would be better to remove the if IsPlaying condition in order to be able to get the position even when the media is paused. Or maybe do something like if IsPaused or IsPlaying. Right now, when the media is paused we get 0 no matter where we are in the media because of the if.

--- InTheHand.Forms/InTheHand.Forms.Platform.Android/MediaElementRenderer.cs
+++ InTheHand.Forms/InTheHand.Forms.Platform.Android/MediaElementRenderer.cs
@@ -60,12 +60,7 @@
         {
             get
             {
-                if (_view.IsPlaying)
-                {
-                    return TimeSpan.FromMilliseconds(_view.CurrentPosition);
-                }
-
-                return TimeSpan.Zero;
+                return TimeSpan.FromMilliseconds(_view.CurrentPosition);
             }
         }

@@ -296,4 +291,4 @@
             mp.Looping = Element.IsLooping;
         }
     }
-}+}


refactoring

refactoring

--- HCsbLib/HCsbLib/HTLib2.Mathematica/Mathematica.ToString.cs
+++ HCsbLib/HCsbLib/HTLib2.Mathematica/Mathematica.ToString.cs
@@ -13,7 +13,7 @@
 		public static string ToString(params object[] objs)
 		{
             if(objs.Length == 1)
-                return _ToString(objs[0]);
+                return __ToString(objs[0], null);
 			return _ToString((IEnumerable<object>)objs);
 		}
 		public static string ToString_Nearest<T, U>(IEnumerable<KeyValuePair<T,U>> objs, bool ignore_null)
@@ -50,7 +50,7 @@
 		}
         public static string ToString(object obj)
 		{
-			return _ToString(obj);
+			return __ToString(obj, null);
 		}
         public static string ToString<T>(T[] objs)
         {
@@ -74,7 +74,7 @@
 				{
 					if(addcomma) text.Append(", ");
 					else addcomma = true;
-					text.Append(_ToString(obj));
+					text.Append(__ToString(obj, null));
 				}
 			text.Append("}");
 			return text.ToString();
@@ -94,7 +94,7 @@
 				for(int j=0; j<objs.GetLength(1); j++)
 				{
 					if(j != 0) text.Append(", ");
-					text.Append(_ToString(objs[i, j]));
+					text.Append(__ToString(objs[i, j], null));
 				}
 				text.Append("}");
 			}
@@ -116,7 +116,7 @@
 					for(int k=0; k<objs.GetLength(2); k++)
 					{
 						if(k != 0) text.Append(", ");
-						text.Append(_ToString(objs[i, j, k]));
+						text.Append(__ToString(objs[i, j, k], null));
 					}
 					text.Append("}");
 				}
@@ -149,13 +149,13 @@
 			HDebug.Assert(delims.Length == 3);
 			StringBuilder text = new StringBuilder();
 			text.Append(delims[0]);
-			text.Append(_ToString(obj.Key));
+			text.Append(__ToString(obj.Key, null));
 			text.Append(delims[1]);
-			text.Append(_ToString(obj.Value));
+			text.Append(__ToString(obj.Value, null));
 			text.Append(delims[2]);
 			return text.ToString();
 		}
-		protected static string _ToString(object obj)
+		protected static string __ToString(object obj, string format)
 		{
 		try{
 			if(obj == null)


Pair<> -> Tuple<>

Pair<> -> Tuple<>

--- HCsbLib/HCsbLib/HTLib2.Mathematica/Mathematica.ToString.cs
+++ HCsbLib/HCsbLib/HTLib2.Mathematica/Mathematica.ToString.cs
@@ -89,7 +89,7 @@
             text.Append("}");
             return text.ToString();
         }
-        protected static string _ToString<T, U>(string format, Pair<T, U> obj)
+        protected static string _ToString<T, U>(string format, Tuple<T, U> obj)
         {
             return _ToString(format, obj.Item1, obj.Item2);
         }
@@ -172,20 +172,20 @@
                 return "";
             string name = obj.GetType().FullName;

-          //if(name==typeof(Pair<DoubleVector3,Pair<double,DoubleVector3>[]>     ).FullName) return _ToString                           (format, (Pair<DoubleVector3,Pair<double,DoubleVector3>[]>     )obj);
-          //if(name==typeof(Pair<double,DoubleVector3>[]                         ).FullName) return _ToString                           (format, (Pair<double,DoubleVector3>[]                         )obj);
-          //if(name==typeof(Pair<double,DoubleVector3>                           ).FullName) return _ToString                           (format, (Pair<double,DoubleVector3>                           )obj);
-          //if(name==typeof(Pair<DoubleVector3,Pair<DoubleVector3,DoubleVector3>>).FullName) return _ToString                           (format, (Pair<DoubleVector3,Pair<DoubleVector3,DoubleVector3>>)obj);
-          //if(name==typeof(Pair<DoubleVector3,DoubleVector3>                    ).FullName) return _ToString                           (format, (Pair<DoubleVector3,DoubleVector3>                    )obj);
-            if(name==typeof(Pair<double[],double[]>                              ).FullName) return _ToString                           (format, (Pair<double[],double[]>                              )obj);
-            if(name==typeof(Pair<double,double>                                  ).FullName) return _ToString                           (format, (Pair<double,double>                                  )obj);
-            if(name==typeof(Pair<double,int>                                     ).FullName) return _ToString                           (format, (Pair<double,int>                                     )obj);
-            if(name==typeof(Pair<int,double>                                     ).FullName) return _ToString                           (format, (Pair<int,double>                                     )obj);
-            if(name==typeof(Pair<double,Vector>                                  ).FullName) return _ToString                           (format, (Pair<double,Vector>                                  )obj);
-            if(name==typeof(Pair<Vector,Vector>                                  ).FullName) return _ToString                           (format, (Pair<Vector,Vector>                                  )obj);
-            if(name==typeof(List<Pair<double,int>>                               ).FullName) return _ToString                           (format, (List<Pair<double,int>>                               )obj);
-            if(name==typeof(List<Pair<int,double>>                               ).FullName) return _ToString                           (format, (List<Pair<int,double>>                               )obj);
-            if(name==typeof(List<Pair<double,double>>                            ).FullName) return _ToString                           (format, (List<Pair<double,double>>                            )obj);
+          //if(name==typeof(Tuple<DoubleVector3,Tuple<double,DoubleVector3>[]>     ).FullName) return _ToString                           (format, (Tuple<DoubleVector3,Tuple<double,DoubleVector3>[]>     )obj);
+          //if(name==typeof(Tuple<double,DoubleVector3>[]                          ).FullName) return _ToString                           (format, (Tuple<double,DoubleVector3>[]                          )obj);
+          //if(name==typeof(Tuple<double,DoubleVector3>                            ).FullName) return _ToString                           (format, (Tuple<double,DoubleVector3>                            )obj);
+          //if(name==typeof(Tuple<DoubleVector3,Tuple<DoubleVector3,DoubleVector3>>).FullName) return _ToString                           (format, (Tuple<DoubleVector3,Tuple<DoubleVector3,DoubleVector3>>)obj);
+          //if(name==typeof(Tuple<DoubleVector3,DoubleVector3>                     ).FullName) return _ToString                           (format, (Tuple<DoubleVector3,DoubleVector3>                     )obj);
+            if(name==typeof(Tuple<double[],double[]>                             ).FullName) return _ToString                           (format, (Tuple<double[],double[]>                             )obj);
+            if(name==typeof(Tuple<double,double>                                 ).FullName) return _ToString                           (format, (Tuple<double,double>                                 )obj);
+            if(name==typeof(Tuple<double,int>                                    ).FullName) return _ToString                           (format, (Tuple<double,int>                                    )obj);
+            if(name==typeof(Tuple<int,double>                                    ).FullName) return _ToString                           (format, (Tuple<int,double>                                    )obj);
+            if(name==typeof(Tuple<double,Vector>                                 ).FullName) return _ToString                           (format, (Tuple<double,Vector>                                 )obj);
+            if(name==typeof(Tuple<Vector,Vector>                                 ).FullName) return _ToString                           (format, (Tuple<Vector,Vector>                                 )obj);
+            if(name==typeof(List<Tuple<double,int>>                              ).FullName) return _ToString                           (format, (List<Tuple<double,int>>                              )obj);
+            if(name==typeof(List<Tuple<int,double>>                              ).FullName) return _ToString                           (format, (List<Tuple<int,double>>                              )obj);
+            if(name==typeof(List<Tuple<double,double>>                           ).FullName) return _ToString                           (format, (List<Tuple<double,double>>                           )obj);
             if(name==typeof(List<double>                                         ).FullName) return _ToString                           (format, (List<double>                                         )obj);
             if(name==typeof(List<Vector>                                         ).FullName) return _ToString                           (format, (List<Vector>                                         )obj);
           //if(name==typeof(List<DoubleVector3>                                  ).FullName) return _ToString                           (format, (List<DoubleVector3>                                  )obj);
@@ -215,7 +215,7 @@
             if(name==typeof(KeyValuePair<double,Vector[]>                        ).FullName) return _ToString<double,Vector[]>          (format, (KeyValuePair<double,Vector[]>                        )obj);
             if(name==typeof(KeyValuePair<double,double[]>                        ).FullName) return _ToString<double,double[]>          (format, (KeyValuePair<double,double[]>                        )obj);
             if(name==typeof(KeyValuePair<double,string>                          ).FullName) return _ToString<double,string>            (format, (KeyValuePair<double,string>                          )obj);
-            if(name==typeof(KeyValuePair<int, Pair<Vector, Vector>>              ).FullName) return _ToString<int, Pair<Vector, Vector>>(format, (KeyValuePair<int, Pair<Vector, Vector>>              )obj);
+            if(name==typeof(KeyValuePair<int, Tuple<Vector, Vector>>             ).FullName) return _ToString<int, Tuple<Vector,Vector>>(format, (KeyValuePair<int, Tuple<Vector, Vector>>             )obj);
             if(name==typeof(Dictionary<double,double[]>                          ).FullName) return _ToString<double,double[]>          (format, (Dictionary<double,double[]>                          )obj);

             if(name==typeof(Tuple<int   , int           >).FullName) { var val=(Tuple<int   , int           >)obj; return _ToString(format, val.Item1, val.Item2); }
@@ -302,17 +302,17 @@
             }
             HDebug.Exception("should not reach here");
             Type objtype = obj.GetType();
-            //if(objtype.FullName == typeof(Pair<DoubleVector3, Pair<double, DoubleVector3>[]>).FullName)
-            //{
-            //    Pair<DoubleVector3, Pair<double, DoubleVector3>[]> data = (Pair<DoubleVector3, Pair<double, DoubleVector3>[]>)obj;
+            //if(objtype.FullName == typeof(Tuple<DoubleVector3, Tuple<double, DoubleVector3>[]>).FullName)
+            //{
+            //    Tuple<DoubleVector3, Tuple<double, DoubleVector3>[]> data = (Tuple<DoubleVector3, Tuple<double, DoubleVector3>[]>)obj;
             //    return ToString(data);
             //}
-            //if(objtype.FullName == typeof(Pair<double, DoubleVector3>[]).FullName)
-            //{
-            //}
-            //if(objtype.FullName == typeof(Pair<double, DoubleVector3>).FullName)
-            //{
-            //    Pair<double, DoubleVector3> data = (Pair<double, DoubleVector3>)obj;
+            //if(objtype.FullName == typeof(Tuple<double, DoubleVector3>[]).FullName)
+            //{
+            //}
+            //if(objtype.FullName == typeof(Tuple<double, DoubleVector3>).FullName)
+            //{
+            //    Tuple<double, DoubleVector3> data = (Tuple<double, DoubleVector3>)obj;
             //    StringBuilder text = new StringBuilder();
             //    //data.first;
             //}
@@ -382,7 +382,7 @@
         //    text.Append("}");
         //    return text.ToString();
         //}
-        //protected static string ToString(Pair<OFF.Vertex, double>[] map, Trans3 trans,
+        //protected static string ToString(Tuple<OFF.Vertex, double>[] map, Trans3 trans,
         //                                        int skip/*=5*/,
         //                                        string format/*="0.00000000"*/)
         //{
@@ -405,7 +405,7 @@
         //    text.Append("}");
         //    return text.ToString();
         //}
-        //protected static string ToString(Pair<DoubleVector3, double>[] map, Trans3 trans,
+        //protected static string ToString(Tuple<DoubleVector3, double>[] map, Trans3 trans,
         //                                        int skip/*=5*/,
         //                                        string format/*="0.00000000"*/)
         //{
@@ -442,7 +442,7 @@
             return text.ToString();
             //plots.Add("ListSurfacePlot3D[modelmesh,Mesh->None,MaxPlotPoints->50,PlotStyle -> Directive[Opacity[0.5]], PerformanceGoal -> \"Speed\",Axes -> False, Boxed -> False]");
         }
-        //public static void ToString_Graphics3DPolygon(System.IO.StreamWriter writer, OFF.Mesh mesh, Pair<OFF.Vertex, double>[] values, string name_prefix, Trans3 trans, string format/*=0.00000000*/)
+        //public static void ToString_Graphics3DPolygon(System.IO.StreamWriter writer, OFF.Mesh mesh, Tuple<OFF.Vertex, double>[] values, string name_prefix, Trans3 trans, string format/*=0.00000000*/)
         //{
         //    string name_verts  = name_prefix + "verts";
         //    string name_faces  = name_prefix + "faces";


expose scale functions

expose scale functions

--- IPTables.Net/Iptables/Modules/HashLimit/HashLimitModule.cs
+++ IPTables.Net/Iptables/Modules/HashLimit/HashLimitModule.cs
@@ -205,9 +205,8 @@
             return 0;
         }

-        private ulong RoundByte(ulong bytes)
-        {
-            var mult = GetMultiplyScale();
+        public static ulong RoundByte(ulong bytes, UInt32 mult)
+        {
             bytes *= mult;
             UInt32 r32 = (UInt32)(bytes >> ByteShift);
             UInt64 cost = UInt32.MaxValue / (r32 + 1);
@@ -216,8 +215,13 @@
             r /= mult;
             return r;
         }
-
-        private UInt32 GetMultiplyScale()
+        private ulong RoundByte(ulong bytes)
+        {
+            var mult = GetMultiplyScale();
+            return RoundByte(mult);
+        }
+
+        public UInt32 GetMultiplyScale()
         {
             switch (_scale)
             {


Fix crash during live share session caused by passing a null key to a dictionary's TryGetValue.

--- Python/Product/PythonTools/PythonTools/Intellisense/WorkspaceAnalysis.cs
+++ Python/Product/PythonTools/PythonTools/Intellisense/WorkspaceAnalysis.cs
@@ -54,7 +54,12 @@
         public VsProjectAnalyzer TryGetWorkspaceAnalyzer() {
             _site.MustBeCalledFromUIThread();

-            if (_analyzers.TryGetValue(_pythonWorkspaceService.Workspace, out WorkspaceAnalyzer analyzer)) {
+            var workspace = _pythonWorkspaceService.Workspace;
+            if (workspace == null) {
+                return null;
+            }
+
+            if (_analyzers.TryGetValue(workspace, out WorkspaceAnalyzer analyzer)) {
                 return analyzer.Analyzer;
             }


Fix broken build

Fix broken build

--- Source/Classic/Libs/ManagedIrbis/Source/Reports/Drivers/DatasetDriver.cs
+++ Source/Classic/Libs/ManagedIrbis/Source/Reports/Drivers/DatasetDriver.cs
@@ -6,6 +6,8 @@
  * -------------------------------------------------------
  * Status: poor
  */
+
+#if CLASSIC

 #region Using directives

@@ -131,3 +133,5 @@
         #endregion
     }
 }
+
+#endif


Failing test for InterceptorPool immutability

--- Source/Tests/TrackableEntities.EF.5.Tests/StateChangeInterceptorTests.cs
+++ Source/Tests/TrackableEntities.EF.5.Tests/StateChangeInterceptorTests.cs
@@ -23,6 +23,25 @@

         #region No Relationship (Product)

+        [Fact]
+        public void WithStateChangeInterceptor_Should_Not_Mutate_Pool()
+        {
+            // Arrange
+            var context = TestsHelper.CreateNorthwindDbContext(CreateNorthwindDbOptions);
+            var product = new Product();
+
+            bool calledX = false, calledY = false;
+            var poolX = context.WithStateChangeInterceptor<Product>((e, r) => { calledX = true; return null; });
+            var poolXY = poolX.WithStateChangeInterceptor<Product>((e, r) => { calledY = true; return null; });
+
+            // Act
+            poolX.ApplyChanges(product);
+
+            // Assert
+            Assert.True(calledX);
+            Assert.False(calledY);
+        }
+
         [Theory]
         [InlineData(true)]
         [InlineData(false)]


Solve relationship related issue

Solve relationship related issue

--- Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
+++ Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
@@ -43,10 +43,14 @@
         /// </summary>
         /// <param name="singleMultipleAnswerQuestion"></param>
         /// <param name="singleMultipleAnswerQuestionOption"></param>
-        public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
+        public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption)
         {
             _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
-            _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption);
+            foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption)
+            {
+                singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id;
+                _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement);
+            }
             _dbContext.SaveChanges();
         }
         /// <summary>


code cleanup

code cleanup

--- MimeKit/Cryptography/X509CertificateDatabase.cs
+++ MimeKit/Cryptography/X509CertificateDatabase.cs
@@ -190,10 +190,7 @@

 		byte[] EncodePrivateKey (AsymmetricKeyParameter key)
 		{
-			if (key == null)
-				return null;
-
-			return EncryptAsymmetricKeyParameter (key);
+			return key != null ? EncryptAsymmetricKeyParameter (key) : null;
 		}

 		static EncryptionAlgorithm[] DecodeEncryptionAlgorithms (SqliteDataReader reader, int column)
@@ -204,7 +201,7 @@
 			var algorithms = new List<EncryptionAlgorithm> ();
 			var values = reader.GetString (column);

-			foreach (var token in values.Split (new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) {
+			foreach (var token in values.Split (new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)) {
 				EncryptionAlgorithm algorithm;

 				if (Enum.TryParse (token.Trim (), out algorithm))
@@ -509,7 +506,7 @@
 		static string[] GetColumnNames (X509CrlRecordFields fields)
 		{
 			if (fields == X509CrlRecordFields.All)
-				return new string[] { "*" };
+				return new [] { "*" };

 			var columns = new List<string> ();


Fixes Error from Enum.Parse(..)

Fixes Error from Enum.Parse(..)

--- src/CAPNet/XmlParser.cs
+++ src/CAPNet/XmlParser.cs
@@ -170,7 +170,7 @@

             var responseTypeQuery = from responseTypeNode in infoElement.Elements(capNamespace + "responseType")
                                     where responseTypeNode != null
-                                    select (ResponseType)Enum.Parse(typeof(ResponseType), responseTypeNode.Value);
+                                    select (ResponseType)Enum.Parse(typeof(ResponseType), responseTypeNode.Value,true);

             foreach (var responseType in responseTypeQuery)
             {


Fix crash when the timeline wants to access items that do not exist

--- OpenKh.Tools.LayoutEditor/Controls/MySequencer.cs
+++ OpenKh.Tools.LayoutEditor/Controls/MySequencer.cs
@@ -103,7 +103,7 @@
         public bool IsVisible(int index) => _debugSequenceRenderer.IsAnimationVisible(index);
         public void SetVisibility(int index, bool isVisible) => _debugSequenceRenderer.ShowAnimation(index, isVisible);

-        public int GetCustomHeight(int index) => _animationList[index].Height;
+        public int GetCustomHeight(int index) => _animationList.Skip(index).FirstOrDefault()?.Height ?? 0;

         public MySequencer(Sequence sequence, DebugSequenceRenderer debugSequenceRenderer)
         {


Change FloatPrecision value

Change FloatPrecision value

--- GlobalConstants.cs
+++ GlobalConstants.cs
@@ -2,7 +2,7 @@

     public static class GlobalConstants {

-        public const float FloatPrecision = 0.001f;
+        public const float FloatPrecision = 0.0001f;

     }


Cleanup code in login.aspx.cs

Cleanup code in login.aspx.cs

--- login.aspx.cs
+++ login.aspx.cs
@@ -11,25 +11,25 @@

       Dim aTable As moderatorsDataTable

-
+

       aTable = aAdapter.GetDataByCredentials(Login1.UserName, Login1.Password)

-
+

       If aTable.Rows.Count = 1 Then

-
+

         Dim intPK As Integer = Convert.ToInt32((aTable.Rows(0).Item("mod_id_pk")))
         Dim strFirstName As String = aTable.Rows(0).Item("mod_first").ToString
         Dim strLastName As String = aTable.Rows(0).Item("mod_last").ToString

-
+

         Dim VisitorInfo As New Hashtable

-
+

         With VisitorInfo
           .Add("mod_id_pk", intPK)
@@ -37,17 +37,17 @@
           .Add("mod_last", strLastName)
         End With

-
+

         Session.Add("Visitor", VisitorInfo)

         If Request.QueryString("ReturnURL") <> String.Empty Then
-
+

           FormsAuthentication.RedirectFromLoginPage(strFirstName, False)
         Else
-
+
           FormsAuthentication.SetAuthCookie(strFirstName, False)
           Response.Redirect("profile.aspx")
         End If


Store Roles When Pulling UserRoles

Store Roles When Pulling UserRoles

--- Portal.CMS.Services/Authentication/RoleService.cs
+++ Portal.CMS.Services/Authentication/RoleService.cs
@@ -1,6 +1,7 @@
 using Portal.CMS.Entities;
 using Portal.CMS.Entities.Entities.Authentication;
 using System.Collections.Generic;
+using System.Data.Entity;
 using System.Linq;

 namespace Portal.CMS.Services.Authentication
@@ -37,7 +38,7 @@

         public List<UserRole> Get(int userId)
         {
-            var results = _context.UserRoles.Where(x => x.UserId == userId).ToList();
+            var results = _context.UserRoles.Include(x => x.Role).Where(x => x.UserId == userId).ToList();

             return results;
         }


Fixed a bug where personal work addresses did not take employment dates into account.

--- Presentation.Web/Controllers/AddressController.cs
+++ Presentation.Web/Controllers/AddressController.cs
@@ -166,7 +166,12 @@
             // Add personal addresses to addresses.
             addresses.AddRange(_personalAddressRepo.AsQueryable().Where(elem => (elem.PersonId.Equals(personId))));

-            var employments = _employmentRepo.AsQueryable().Where(x => x.PersonId.Equals(personId)).ToList();
+
+            var currentTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
+            var employments = _employmentRepo.AsQueryable().Where(x => x.PersonId.Equals(personId)
+                                                                            && x.StartDateTimestamp < currentTimestamp
+                                                                            && (x.EndDateTimestamp > currentTimestamp ||x.EndDateTimestamp == 0))
+                                                                  .ToList();
             // Add the workAddress of each of the user's employments.
             foreach (var empl in employments)
             {


Added ordering for ReleasePaths on config page

--- RMDashboard/Controllers/ReleasePathsController.cs
+++ RMDashboard/Controllers/ReleasePathsController.cs
@@ -42,7 +42,7 @@
                     return releasePath;
                 });

-                return result;
+                return result.OrderBy(r => r.name);
             }
             catch (Exception ex)
             {


Fixes toolbar xam mac API changes

Fixes toolbar xam mac API changes

--- MonoDevelop.Inspector.Mac/MacToolbarViewItem.cs
+++ MonoDevelop.Inspector.Mac/MacToolbarViewItem.cs
@@ -3,6 +3,7 @@
 using AppKit;
 using CoreGraphics;
 using Foundation;
+using ObjCRuntime;

 namespace MonoDevelop.Inspector.Mac
 {
@@ -82,15 +83,17 @@
             set;
         }

-        public MacInspectorToolbarCollectionViewItem(IntPtr handle) : base(handle)
-        {
-
+        public MacInspectorToolbarCollectionViewItem(NativeHandle handle) : base(handle)
+        {
+
         }
     }
-
-    [Register("MacInspectorToolbarHeaderCollectionViewItem")]
+
+    [Register(RegisterIdentifier)]
     class MacInspectorToolbarHeaderCollectionViewItem : NSCollectionViewItem
     {
+        internal const string RegisterIdentifier = "MacInspectorToolbarHeaderCollectionViewItem";
+
         public static NSColor HeaderCellBackgroundSelectedColor = NSColor.FromRgb(0.29f, green: 0.29f, blue: 0.29f);// NSColor.ControlBackground;
         public static NSColor HeaderCellBackgroundColor = HeaderCellBackgroundSelectedColor;

@@ -112,11 +115,10 @@
                 isCollapsed = value;
                 ExpandButton.Image = value ? CollapsedImage : ExpandedImage;
             }
-        }
-
-        ContentCollectionViewItem contentCollectionView;
-        public override void LoadView()
-        {
+        }
+
+        public override void LoadView()
+        {
             View = contentCollectionView = new ContentCollectionViewItem(Name);
             contentCollectionView.BackgroundColor = HeaderCellBackgroundSelectedColor;
             contentCollectionView.BackgroundSelectedColor = HeaderCellBackgroundColor;
@@ -148,12 +150,13 @@

             stackView.AddArrangedSubview(ExpandButton);

-            View.WantsLayer = true;
-        }
-
-        public MacInspectorToolbarHeaderCollectionViewItem(IntPtr handle) : base(handle)
-        {
-
+            View.WantsLayer = true;
+        }
+
+        ContentCollectionViewItem contentCollectionView;
+        public MacInspectorToolbarHeaderCollectionViewItem(NativeHandle handle) : base(handle)
+        {
+
         }
     }

@@ -198,8 +201,9 @@
             }
         }

-        ContentCollectionViewItem contentCollectionView;
-        public override void LoadView()
+        ContentCollectionViewItem contentCollectionView;
+
+        public override void LoadView()
         {
             View = contentCollectionView = new ContentCollectionViewItem(Name);

@@ -214,11 +218,10 @@
             ImageView.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, margin).Active = true;
             ImageView.RightAnchor.ConstraintEqualTo(View.RightAnchor, -margin).Active = true;
             ImageView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor, -margin).Active = true;
-        }
-
-        public MacInspectorToolbarImageCollectionViewItem(IntPtr handle) : base(handle)
-        {
-
+        }
+        public MacInspectorToolbarImageCollectionViewItem(NativeHandle handle) : base(handle)
+        {
+
         }
     }


Also go for apples if they're around

Also go for apples if they're around

--- mSugarAnts.cs
+++ mSugarAnts.cs
@@ -99,6 +99,10 @@
 		/// <param name="obst">Das nchstgelegene Obststck.</param>
 		public override void Sieht(Obst obst)
 		{
+            if (BrauchtNochTrger(obst))
+            {
+                GeheZuZiel(obst);
+            }
 		}

 		/// <summary>
@@ -120,6 +124,12 @@
 		/// <param name="obst">Das Obstck.</param>
 		public override void ZielErreicht(Obst obst)
 		{
+            if (BrauchtNochTrger(obst))
+            {
+                SprheMarkierung(2, 2000);
+                Nimm(obst);
+                GeheZuBau();
+            }
 		}

 		#endregion


Services: fix calling them!! (regression from msg generation overhaul)

--- ROS_Comm/ServiceServerLink.cs
+++ ROS_Comm/ServiceServerLink.cs
@@ -192,7 +192,7 @@
                 {
                     request = current_call.req;
                 }
-                request.Serialize();
+                request.Serialized = request.Serialize();
                 connection.write(request.Serialized, (uint) request.Serialized.Length, onRequestWritten);
             }
         }


Adding try/catch around headers to ignore errors.

--- Rally.RestApi/RallyRestApi.cs
+++ Rally.RestApi/RallyRestApi.cs
@@ -1230,17 +1230,25 @@
 		internal Dictionary<string, string> GetProcessedHeaders()
 		{
 			var result = new Dictionary<string, string>();
-			foreach (HeaderType headerType in Headers.Keys)
-			{
-				string output = null;
-				string value = Headers[headerType];
-				FieldInfo fieldInfo = headerType.GetType().GetField(headerType.ToString());
-				StringValue[] attrs = fieldInfo.GetCustomAttributes(typeof(StringValue), false) as StringValue[];
-				if (attrs.Length > 0)
-					output = attrs[0].Value;
-
-				result.Add(output, value);
-			}
+			try
+			{
+				foreach (HeaderType headerType in Headers.Keys)
+				{
+					string output = null;
+					string value = Headers[headerType];
+					FieldInfo fieldInfo = headerType.GetType().GetField(headerType.ToString());
+					StringValue[] attrs = fieldInfo.GetCustomAttributes(typeof(StringValue), false) as StringValue[];
+					if (attrs.Length > 0)
+						output = attrs[0].Value;
+
+					result.Add(output, value);
+				}
+			}
+			catch
+			{
+				// Swallow exception for headers.
+			}
+
 			return result;
 		}
 		#endregion


client improvements

client improvements

pass MovieInfoBase in api methods, fix GetMovieList

--- src/YifySharp/Client.cs
+++ src/YifySharp/Client.cs
@@ -1,4 +1,5 @@
-using RestSharp;
+using System;
+using RestSharp;
 using YifySharp.Models;
 using YifySharp.Extensions;

@@ -8,7 +9,7 @@
     {
         private readonly string urlFormat = "https://yts.re/api/v2/{0}.json";

-        public MovieList GetMovieList(int limit = 20, int page = 1, MovieQuality quality = MovieQuality.All, int? minimumRating = 0, string queryTerm = "0",
+        public MovieList GetMovieList(string queryTerm = null, int limit = 20, int page = 1, MovieQuality quality = MovieQuality.All, int minimumRating = 0,
             string genre = "All", MovieSortOption sortBy = MovieSortOption.DateAdded, MovieOrderOption orderBy = MovieOrderOption.Descending)
         {
             var request = new RestRequest(Method.GET);
@@ -17,7 +18,7 @@
             request.AddParameter("page", page);
             request.AddParameter("quality", quality.GetDescription());
             request.AddParameter("minimum_rating", minimumRating);
-            request.AddParameter("query_term", queryTerm);
+            request.AddParameter("query_term", queryTerm ?? "0");
             request.AddParameter("genre", genre);
             request.AddParameter("sort_by", sortBy.GetDescription());
             request.AddParameter("order_by", orderBy.GetDescription());
@@ -30,10 +31,17 @@
             var request = new RestRequest(Method.GET);

             request.AddParameter("movie_id", movieId);
-            request.AddParameter("with_images", withImages.ToString());
-            request.AddParameter("with_cast", "false");
+            if (withImages)
+                request.AddParameter("with_images", "true");
+            if(withCast)
+                request.AddParameter("with_cast", "true");

             return Execute<MovieDetails>(request, "movie_details").Data;
+        }
+
+        public MovieDetails GetMovieDetails(MovieInfoBase movie, bool withImages = false, bool withCast = false)
+        {
+            return GetMovieDetails(movie.Id);
         }

         public SuggestionList GetMovieSuggestions(int movieId)
@@ -45,6 +53,11 @@
             return Execute<SuggestionList>(request, "movie_suggestions").Data;
         }

+        public SuggestionList GetMovieSuggestions(MovieInfoBase movie)
+        {
+            return GetMovieSuggestions(movie.Id);
+        }
+
         public MovieComments GetMovieComments(int movieId)
         {
             var request = new RestRequest(Method.GET);
@@ -52,6 +65,11 @@
             request.AddParameter("movie_id", movieId);

             return Execute<MovieComments>(request, "movie_comments").Data;
+        }
+
+        public MovieComments GetMovieComments(MovieInfoBase movie)
+        {
+            return GetMovieComments(movie.Id);
         }

         public MovieReviews GetReviews(int movieId)
@@ -63,6 +81,11 @@
             return Execute<MovieReviews>(request, "movie_reviews").Data;
         }

+        public MovieReviews GetReviews(MovieInfoBase movie)
+        {
+            return GetReviews(movie.Id);
+        }
+
         public ParentalGuideInfo GetParentalGuides(int movieId)
         {
             var request = new RestRequest(Method.GET);
@@ -70,6 +93,11 @@
             request.AddParameter("movie_id", movieId);

             return Execute<ParentalGuideInfo>(request, "movie_parental_guides").Data;
+        }
+
+        public ParentalGuideInfo GetParentalGuides(MovieInfoBase movie)
+        {
+            return GetParentalGuides(movie.Id);
         }

         public UpcomingList GetUpcomingList()


databaseVersionString will now be written in any case to the "installedRelhaxFiles.log"

--- RelicModManager/MainWindow.cs
+++ RelicModManager/MainWindow.cs
@@ -772,7 +772,7 @@
                 Utils.appendToLog(string.Format("Version selected: {0}  OnlineFolder: {1}", tanksVersion, Settings.tanksOnlineFolderVersion));
             }
             //if the user wants to, check if the database has actually changed
-            if (Settings.NotifyIfSameDatabase && SameDatabaseVersions())
+            if (SameDatabaseVersions() && Settings.NotifyIfSameDatabase)        // the get the string databaseVersionString filles in any case, the function must be performed first!
             {
                 if (MessageBox.Show(Translations.getTranslatedString("DatabaseVersionsSameBody"), Translations.getTranslatedString("DatabaseVersionsSameHeader"), MessageBoxButtons.YesNo) == DialogResult.No)
                 {


Make sure we re-allocate gl data if it has been deleted due to a context closing.

--- RenderOpenGl/ImageGlPlugin.cs
+++ RenderOpenGl/ImageGlPlugin.cs
@@ -53,11 +53,11 @@
     {
         private static ConditionalWeakTable<Byte[], ImageGlPlugin> imagesWithCacheData = new ConditionalWeakTable<Byte[], ImageGlPlugin>();

-        internal struct glAllocatedData
+        internal class glAllocatedData
         {
             internal int glTextureHandle;
             internal int refreshCountCreatedOn;
-            internal int glContentId;
+            internal int glContextId;
             public float[] textureUVs;
             public float[] positions;

@@ -70,7 +70,7 @@

         private static List<glAllocatedData> glDataNeedingToBeDeleted = new List<glAllocatedData>();

-        private glAllocatedData glData;
+        private glAllocatedData glData = new glAllocatedData();
         private int imageUpdateCount;
         private bool createdWithMipMaps;

@@ -102,7 +102,7 @@
 				{
 					int textureToDelete = glDataNeedingToBeDeleted[i].glTextureHandle;
 					if (textureToDelete != -1
-                        && glDataNeedingToBeDeleted[i].glContentId == contextId
+                        && glDataNeedingToBeDeleted[i].glContextId == contextId
                         && glDataNeedingToBeDeleted[i].refreshCountCreatedOn == currentGlobalRefreshCount) // this is to leak on purpose on android for some gl that kills textures
 					{
 						GL.DeleteTextures(1, ref textureToDelete);
@@ -115,14 +115,15 @@
 #if ON_IMAGE_CHANGED_ALWAYS_CREATE_IMAGE
 			if (plugin != null
 				&& (imageToGetDisplayListFor.ChangedCount != plugin.imageUpdateCount
-				|| plugin.glData.refreshCountCreatedOn != currentGlobalRefreshCount))
+				|| plugin.glData.refreshCountCreatedOn != currentGlobalRefreshCount
+                || plugin.glData.glTextureHandle == -1))
 			{
 				int textureToDelete = plugin.GLTextureHandle;
 				if (plugin.glData.refreshCountCreatedOn == currentGlobalRefreshCount)
 				{
 					GL.DeleteTextures(1, ref textureToDelete);
 				}
-				plugin.glData.glTextureHandle = 0;
+				plugin.glData.glTextureHandle = -1;
 				imagesWithCacheData.Remove(imageToGetDisplayListFor.GetBuffer());
 				plugin = null;
 			}
@@ -132,7 +133,7 @@
 				ImageGlPlugin newPlugin = new ImageGlPlugin();
 				imagesWithCacheData.Add(imageToGetDisplayListFor.GetBuffer(), newPlugin);
 				newPlugin.createdWithMipMaps = createAndUseMipMaps;
-                newPlugin.glData.glContentId = contextId;
+                newPlugin.glData.glContextId = contextId;
                 newPlugin.CreateGlDataForImage(imageToGetDisplayListFor, TextureMagFilterLinear);
 				newPlugin.imageUpdateCount = imageToGetDisplayListFor.ChangedCount;
 				newPlugin.glData.refreshCountCreatedOn = currentGlobalRefreshCount;


Properly parses Null Times in Urn Splits now

They are stored as "0.00000" instead of a proper null.

--- LiveSplit/LiveSplit.Core/Model/RunFactories/UrnRunFactory.cs
+++ LiveSplit/LiveSplit.Core/Model/RunFactories/UrnRunFactory.cs
@@ -15,6 +15,19 @@
         public UrnRunFactory(Stream stream = null)
         {
             Stream = stream;
+        }
+
+        private Time parseTime(string time)
+        {
+            var parsedTime = new Time();
+
+            parsedTime.RealTime = TimeSpanParser.ParseNullable(time);
+
+            //Null is stored as a zero time in Urn Splits
+            if (parsedTime.RealTime == TimeSpan.Zero)
+                parsedTime.RealTime = null;
+
+            return parsedTime;
         }

         public IRun Create(IComparisonGeneratorsFactory factory)
@@ -38,17 +51,13 @@
             foreach (var segment in segments)
             {
                 var segmentName = segment.title as string;
-
-                var pbSplitTime = new Time();
-                pbSplitTime.RealTime = TimeSpanParser.ParseNullable(segment.time as string);
-
-                var bestSegment = new Time();
-                bestSegment.RealTime = TimeSpanParser.ParseNullable(segment.best_segment as string);
+                var pbSplitTime = parseTime(segment.time as string);
+                var bestSegment = parseTime(segment.best_segment as string);

                 var parsedSegment = new Segment(segmentName, pbSplitTime, bestSegment);

-                var bestSplitTime = TimeSpanParser.ParseNullable(segment.best_time as string);
-                if (bestSplitTime != null)
+                var bestSplitTime = parseTime(segment.best_time as string);
+                if (bestSplitTime.RealTime != null)
                 {
                     --runHistoryIndex;
                     run.RunHistory.Add(new IndexedTime(default(Time), runHistoryIndex));
@@ -59,7 +68,7 @@
                         alreadyInsertedSegment.SegmentHistory.Add(new IndexedTime(default(Time), runHistoryIndex));
                     }

-                    parsedSegment.SegmentHistory.Add(new IndexedTime(new Time(bestSplitTime), runHistoryIndex));
+                    parsedSegment.SegmentHistory.Add(new IndexedTime(bestSplitTime, runHistoryIndex));
                 }

                 run.Add(parsedSegment);


removing the replies bit

removing the replies bit

--- MassTransit.ServiceBus.Tests/MessageContext_Should_Help.cs
+++ MassTransit.ServiceBus.Tests/MessageContext_Should_Help.cs
@@ -29,22 +29,6 @@
             mockBus = null;
             mockBusEndpoint = null;
             mockEndpoint = null;
-        }
-
-        [Test, Ignore]
-        public void With_Replies()
-        {
-            MessageContext<PingMessage> cxt = new MessageContext<PingMessage>(mockBus, requestMessage);
-
-            using (Record())
-            {
-                Expect.Call(mockBus.Endpoint).Return(mockBusEndpoint);
-            }
-
-            using (Playback())
-            {
-                cxt.Reply(replyMessage);
-            }
         }

         [Test]


Fixing xaml hyperlink renderer for OnRender implementation

--- Mapsui.Rendering.Xaml/XamlWidgets/HyperlinkWidgetRenderer.cs
+++ Mapsui.Rendering.Xaml/XamlWidgets/HyperlinkWidgetRenderer.cs
@@ -1,8 +1,8 @@
 using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
 using System.Windows.Media;
 using Mapsui.Widgets;
+using TextBox = Mapsui.Widgets.TextBox;

 namespace Mapsui.Rendering.Xaml.XamlWidgets
 {
@@ -12,73 +12,45 @@
         {
             var hyperlink = (Hyperlink) widget;
             if (string.IsNullOrEmpty(hyperlink.Text)) return;
-            var border = CreateBorder(hyperlink);
-
-            canvas.Children.Add(border);
-            border.UpdateLayout(); // to calculate the boundingbox
-
-            // Get position in x direction
-            double posX = 0;
-            switch(hyperlink.HorizontalAlignment)
-            {
-                case Widgets.HorizontalAlignment.Left:
-                    posX = hyperlink.MarginX;
-                    break;
-                case Widgets.HorizontalAlignment.Center:
-                    posX = (canvas.Width - border.ActualWidth) * 0.5;
-                    break;
-                case Widgets.HorizontalAlignment.Right:
-                    posX = (canvas.Width - border.ActualWidth - hyperlink.MarginX);
-                    break;
-            }
-
-            // Get position in x direction
-            double posY = 0;
-            switch (hyperlink.VerticalAlignment)
-            {
-                case Widgets.VerticalAlignment.Top:
-                    posY = hyperlink.MarginY;
-                    break;
-                case Widgets.VerticalAlignment.Center:
-                    posY = (canvas.Height - border.ActualHeight) * 0.5;
-                    break;
-                case Widgets.VerticalAlignment.Bottom:
-                    posY = canvas.Height - border.ActualHeight - hyperlink.MarginY;
-                    break;
-                //case Widgets.VerticalAlignment.Position:
-                //    posY = hyperlink.PositionY;
-                //    break;
-            }
-
-            Canvas.SetLeft(border, posX);
-            Canvas.SetTop(border, posY);
-
-            hyperlink.Envelope = BoundsRelativeTo(border, canvas).ToMapsui();
-            hyperlink.Envelope.Offset(posX, posY);
+            var border = ToBorder(hyperlink);
+            canvas.Children.Add(WrapInGrid(canvas.Width, canvas.Height, border));
         }

-        private static Rect BoundsRelativeTo(FrameworkElement element,
-            Visual relativeTo)
+        private static Grid WrapInGrid(double width, double height, Border border)
         {
-            return
-                element.TransformToVisual(relativeTo)
-                    .TransformBounds(LayoutInformation.GetLayoutSlot(element));
+            // Relative positioning is used in for the border. For this a Canvas won't
+            // work so we use a Grid here. It needs to have the size of the Canvas.
+            var grid = new Grid()
+            {
+                Width = width,
+                Height = height,
+                Background = null
+            };
+            grid.Children.Add(border);
+            return grid;
         }

-        private static Border CreateBorder(Widgets.TextBox textBox)
+        private static Border ToBorder(TextBox textBox)
         {
+
             return new Border
             {
                 Padding = new Thickness(textBox.PaddingX, textBox.PaddingY, textBox.PaddingX, textBox.PaddingY),
+                Margin = new Thickness(textBox.MarginX, textBox.MarginY, textBox.MarginX, textBox.MarginY),
+                Background = new SolidColorBrush(textBox.BackColor.ToXaml()),
                 HorizontalAlignment = textBox.HorizontalAlignment.ToXaml(),
                 VerticalAlignment = textBox.VerticalAlignment.ToXaml(),
-                Background = new SolidColorBrush(textBox.BackColor.ToXaml()),
                 CornerRadius = new CornerRadius(textBox.CornerRadius),
-                Child = new TextBlock
-                {
-                    Text = textBox.Text,
-                    Foreground = new SolidColorBrush(textBox.TextColor.ToXaml())
-                }
+                Child = ToTextBlock(textBox)
+            };
+        }
+
+        private static TextBlock ToTextBlock(TextBox textBox)
+        {
+            return new TextBlock
+            {
+                Text = textBox.Text,
+                Foreground = new SolidColorBrush(textBox.TextColor.ToXaml())
             };
         }
     }


Update the access token ExpiresOn comparison logic

--- OfficeDevPnP.Core/OfficeDevPnP.Core/AuthenticationManager.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/AuthenticationManager.cs
@@ -123,7 +123,7 @@
                 {
                     Cookie fedAuthCookie = fedAuth.GetCookies(new Uri(siteUrl))["FedAuth"];
                     // If cookie is expired a new fedAuth cookie needs to be requested
-                    if (fedAuthCookie == null || fedAuthCookie.Expires < DateTime.UtcNow)
+                    if (fedAuthCookie == null || fedAuthCookie.Expires < DateTime.Now)
                     {
                         fedAuth = new UsernameMixed().GetFedAuthCookie(siteUrl, String.Format("{0}\\{1}", domain, user), password, new Uri(String.Format("https://{0}/adfs/services/trust/13/usernamemixed", sts)), idpId, logonTokenCacheExpirationWindow);
                     }
@@ -186,7 +186,7 @@
                             try
                             {
                                 Log.Debug(Constants.LOGGING_SOURCE, "Lease expiration date: {0}", response.ExpiresOn);
-                                var lease = response.ExpiresOn - DateTime.UtcNow;
+                                var lease = GetLeaseTimeSpan(response.ExpiresOn);
                                 lease =
                                     TimeSpan.FromSeconds(
                                         Math.Min(lease.TotalSeconds - TimeSpan.FromMinutes(5).TotalSeconds,
@@ -205,5 +205,19 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Get the access token lease time span.
+        /// </summary>
+        /// <param name="expiresOn">The access token ExpiresOn time</param>
+        /// <returns>Returns a TimeSpan represents the time interval within which the current access token is valid thru.</returns>
+        private TimeSpan GetLeaseTimeSpan(DateTime expiresOn)
+        {
+            DateTime now = DateTime.UtcNow;
+            if (expiresOn.Kind == DateTimeKind.Utc)
+                return expiresOn - now;
+            else if (expiresOn.Kind == DateTimeKind.Local)
+                TimeZoneInfo.ConvertTimeToUtc(expiresOn) - now;
+        }
     }
 }


Aligning parameter name for setting alert text in W3C protocol mode

--- dotnet/src/webdriver/Remote/RemoteAlert.cs
+++ dotnet/src/webdriver/Remote/RemoteAlert.cs
@@ -79,7 +79,7 @@
             Dictionary<string, object> parameters = new Dictionary<string, object>();
             if (this.driver.IsSpecificationCompliant)
             {
-                parameters.Add("text", keysToSend.ToCharArray());
+                parameters.Add("value", keysToSend.ToCharArray());
             }
             else
             {


Removed unused includes

Removed unused includes

--- PART/Source/CprBroker/DBR.Tests/Comparison/ComparisonTest.cs
+++ PART/Source/CprBroker/DBR.Tests/Comparison/ComparisonTest.cs
@@ -1,16 +1,8 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using System.Configuration;
-using CprBroker.Utilities.Config;
-using CprBroker.Providers.DPR;
 using NUnit.Framework;
-using CprBroker.Providers.CPRDirect;
-using CprBroker.DBR;
 using System.Reflection;
 using CprBroker.Utilities;
-using CprBroker.PartInterface;
 using System.Text.RegularExpressions;

 namespace CprBroker.Tests.DBR.Comparison


Fix incorrect `DummyNativeTexture` implementation

--- osu.Framework/Graphics/Rendering/Dummy/DummyNativeTexture.cs
+++ osu.Framework/Graphics/Rendering/Dummy/DummyNativeTexture.cs
@@ -20,12 +20,7 @@
         public bool BypassTextureUploadQueueing { get; set; }
         public bool UploadComplete => true;
         public bool IsQueuedForUpload { get; set; }
-
-        ulong INativeTexture.TotalBindCount
-        {
-            get => 0;
-            set => throw new System.NotImplementedException();
-        }
+        ulong INativeTexture.TotalBindCount { get; set; }

         public DummyNativeTexture(IRenderer renderer)
         {


Fix weird english in old comment

Fix weird english in old comment

--- osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
+++ osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
@@ -267,7 +267,7 @@
                     comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
             }

-            // We're clamping misscount because since its derived from combo it can be higher than total hits and that breaks some calculations
+            // Clamp misscount since it's derived from combo and can be higher than total hits and that breaks some calculations
             comboBasedMissCount = Math.Min(comboBasedMissCount, totalHits);

             return Math.Max(countMiss, (int)Math.Floor(comboBasedMissCount));