Use `OsuStorage` in realm tests to allow for migration

Also changes the realm filename to use `client` to match the ignore
rules in `OsuStorage`. Without doing this, migration will fail in an
indefinite mutex wait when attempting to delete the realm `.note` file.

--- osu.Game.Tests/Database/RealmTest.cs
+++ osu.Game.Tests/Database/RealmTest.cs
@@ -10,6 +10,7 @@
 using osu.Framework.Platform;
 using osu.Framework.Testing;
 using osu.Game.Database;
+using osu.Game.IO;
 using osu.Game.Models;

 #nullable enable
@@ -27,15 +28,16 @@
             storage.DeleteDirectory(string.Empty);
         }

-        protected void RunTestWithRealm(Action<RealmContextFactory, Storage> testAction, [CallerMemberName] string caller = "")
+        protected void RunTestWithRealm(Action<RealmContextFactory, OsuStorage> testAction, [CallerMemberName] string caller = "")
         {
             using (HeadlessGameHost host = new CleanRunHeadlessGameHost(caller))
             {
                 host.Run(new RealmTestGame(() =>
                 {
-                    var testStorage = storage.GetStorageForDirectory(caller);
+                    // ReSharper disable once AccessToDisposedClosure
+                    var testStorage = new OsuStorage(host, storage.GetStorageForDirectory(caller));

-                    using (var realmFactory = new RealmContextFactory(testStorage, caller))
+                    using (var realmFactory = new RealmContextFactory(testStorage, "client"))
                     {
                         Logger.Log($"Running test using realm file {testStorage.GetFullPath(realmFactory.Filename)}");
                         testAction(realmFactory, testStorage);
@@ -58,7 +60,7 @@
                 {
                     var testStorage = storage.GetStorageForDirectory(caller);

-                    using (var realmFactory = new RealmContextFactory(testStorage, caller))
+                    using (var realmFactory = new RealmContextFactory(testStorage, "client"))
                     {
                         Logger.Log($"Running test using realm file {testStorage.GetFullPath(realmFactory.Filename)}");
                         await testAction(realmFactory, testStorage);


Add xmldoc for extension methods

Add xmldoc for extension methods

--- osu.Game/Database/RealmExtensions.cs
+++ osu.Game/Database/RealmExtensions.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
 using System.Collections.Generic;
 using AutoMapper;
 using osu.Game.Beatmaps;
@@ -40,6 +41,12 @@
             c.CreateMap<RulesetInfo, RulesetInfo>();
         }).CreateMapper();

+        /// <summary>
+        /// Create a detached copy of the each item in the list.
+        /// </summary>
+        /// <param name="items">A list of managed <see cref="RealmObject"/>s to detach.</param>
+        /// <typeparam name="T">The type of object.</typeparam>
+        /// <returns>A list containing non-managed copies of provided items.</returns>
         public static List<T> Detach<T>(this List<T> items) where T : RealmObject
         {
             var list = new List<T>();
@@ -50,22 +57,44 @@
             return list;
         }

-        public static T Detach<T>(this T obj) where T : RealmObject
+        /// <summary>
+        /// Create a detached copy of the each item in the list.
+        /// </summary>
+        /// <param name="item">The managed <see cref="RealmObject"/> to detach.</param>
+        /// <typeparam name="T">The type of object.</typeparam>
+        /// <returns>A non-managed copy of provided item. Will return the provided item if already detached.</returns>
+        public static T Detach<T>(this T item) where T : RealmObject
         {
-            if (!obj.IsManaged)
-                return obj;
+            if (!item.IsManaged)
+                return item;

-            var detached = mapper.Map<T>(obj);
-
-            //typeof(RealmObject).GetField("_realm", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.SetValue(detached, null);
-
-            return detached;
+            return mapper.Map<T>(item);
         }

-        public static Live<T> Wrap<T>(this T obj, IRealmFactory contextFactory)
-            where T : RealmObject, IHasGuidPrimaryKey => new Live<T>(obj, contextFactory);
+        /// <summary>
+        /// Wrap a managed instance of a realm object in a <see cref="Live{T}"/>.
+        /// </summary>
+        /// <param name="item">The item to wrap.</param>
+        /// <param name="contextFactory">A factory to retrieve realm contexts from.</param>
+        /// <typeparam name="T">The type of object.</typeparam>
+        /// <returns>A wrapped instance of the provided item.</returns>
+        public static Live<T> Wrap<T>(this T item, IRealmFactory contextFactory)
+            where T : RealmObject, IHasGuidPrimaryKey => new Live<T>(item, contextFactory);

-        public static Live<T> WrapAsUnmanaged<T>(this T obj)
-            where T : RealmObject, IHasGuidPrimaryKey => new Live<T>(obj, null);
+        /// <summary>
+        /// Wrap an unmanaged instance of a realm object in a <see cref="Live{T}"/>.
+        /// </summary>
+        /// <param name="item">The item to wrap.</param>
+        /// <typeparam name="T">The type of object.</typeparam>
+        /// <returns>A wrapped instance of the provided item.</returns>
+        /// <exception cref="ArgumentException">Throws if the provided item is managed.</exception>
+        public static Live<T> WrapAsUnmanaged<T>(this T item)
+            where T : RealmObject, IHasGuidPrimaryKey
+        {
+            if (item.IsManaged)
+                throw new ArgumentException("Provided item must not be managed", nameof(item));
+
+            return new Live<T>(item, null);
+        }
     }
 }


Only disallow changing the current track, not pausing or seeking it

--- osu.Game/Overlays/MusicController.cs
+++ osu.Game/Overlays/MusicController.cs
@@ -225,11 +225,8 @@
             canChangeBeatmap = newScreen?.CanChangeBeatmap ?? true;

             prevButton.Enabled = canChangeBeatmap;
-            playButton.Enabled = canChangeBeatmap;
             nextButton.Enabled = canChangeBeatmap;
             playlistButton.Enabled = canChangeBeatmap;
-
-            progressBar.IsEnabled = canChangeBeatmap;
         }

         protected override void UpdateAfterChildren()
@@ -249,7 +246,7 @@
                 progressBar.UpdatePosition(track.Length == 0 ? 0 : (float)(track.CurrentTime / track.Length));
                 playButton.Icon = track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;

-                if (track.HasCompleted && !track.Looping) next();
+                if (track.HasCompleted && !track.Looping && canChangeBeatmap) next();
             }
             else
                 playButton.Icon = FontAwesome.fa_play_circle_o;
@@ -273,16 +270,12 @@

         private void prev()
         {
-            if(!canChangeBeatmap) return;
-
             queuedDirection = TransformDirection.Prev;
             playlist.PlayPrevious();
         }

         private void next()
         {
-            if (!canChangeBeatmap) return;
-
             queuedDirection = TransformDirection.Next;
             playlist.PlayNext();
         }


Fix broken WikiHeader

Fix broken WikiHeader

--- osu.Game/Overlays/Wiki/WikiHeader.cs
+++ osu.Game/Overlays/Wiki/WikiHeader.cs
@@ -5,6 +5,7 @@
 using System.Linq;
 using osu.Framework.Bindables;
 using osu.Framework.Graphics;
+using osu.Framework.Localisation;
 using osu.Game.Online.API.Requests.Responses;

 namespace osu.Game.Overlays.Wiki
@@ -34,7 +35,7 @@
                 return;

             TabControl.Clear();
-            Current.Value = null;
+            Current.Value = string.Empty;

             TabControl.AddItem(index_page_string);

@@ -51,7 +52,7 @@
             Current.Value = e.NewValue.Title;
         }

-        private void onCurrentChange(ValueChangedEvent<string> e)
+        private void onCurrentChange(ValueChangedEvent<LocalisableString> e)
         {
             if (e.NewValue == TabControl.Items.LastOrDefault())
                 return;


Remove stray call to LoadTrack that was forgotten

--- osu.Game/Screens/Menu/IntroScreen.cs
+++ osu.Game/Screens/Menu/IntroScreen.cs
@@ -12,7 +12,6 @@
 using osu.Game.Beatmaps;
 using osu.Game.Configuration;
 using osu.Game.IO.Archives;
-using osu.Game.Overlays;
 using osu.Game.Screens.Backgrounds;
 using osu.Game.Skinning;
 using osuTK;
@@ -60,9 +59,6 @@

         [Resolved]
         private AudioManager audio { get; set; }
-
-        [Resolved]
-        private MusicController musicController { get; set; }

         /// <summary>
         /// Whether the <see cref="Track"/> is provided by osu! resources, rather than a user beatmap.
@@ -168,8 +164,8 @@
             if (!resuming)
             {
                 beatmap.Value = initialBeatmap;
-                Track = musicController.CurrentTrack;
-                UsingThemedIntro = !initialBeatmap.LoadTrack().IsDummyDevice;
+                Track = initialBeatmap.Track;
+                UsingThemedIntro = !initialBeatmap.Track.IsDummyDevice;

                 logo.MoveTo(new Vector2(0.5f));
                 logo.ScaleTo(Vector2.One);


Fix flaky tests not running at all with environment variable set

--- osu.Game/Tests/FlakyTestAttribute.cs
+++ osu.Game/Tests/FlakyTestAttribute.cs
@@ -18,7 +18,7 @@
         }

         public FlakyTestAttribute(int tryCount)
-            : base(Environment.GetEnvironmentVariable("OSU_TESTS_FAIL_FLAKY") == "1" ? 0 : tryCount)
+            : base(Environment.GetEnvironmentVariable("OSU_TESTS_FAIL_FLAKY") == "1" ? 1 : tryCount)
         {
         }
     }


Key update

Key update

--- startupconnector/Keys.cs
+++ startupconnector/Keys.cs
@@ -7,6 +7,6 @@
 {
     public class Keys
     {
-        public static string OutlookWebHookURL = "https%3A%2F%2Foutlook.office365.com%2Fwebhook%2F23d06b50-5bc3-4daa-931c-0ff8c420c4c3%4072f988bf-86f1-41af-91ab-2d7cd011db47%2F2542bd93-dcb7-4ee7-9217-36c72c9be005%2F112854ba9e9e4f2b95fa95d494761b2c%2F5489225f-82de-4816-8201-c602bca98174";
+        public static string OutlookWebHookURL = "";
     }
 }


Extend the return value of GetRequestsByUrl (#2091)

--- src/neo/SmartContract/Native/Oracle/OracleContract.cs
+++ src/neo/SmartContract/Native/Oracle/OracleContract.cs
@@ -117,12 +117,12 @@
             return snapshot.Storages.Find(new KeyBuilder(Id, Prefix_Request).ToArray()).Select(p => (BitConverter.ToUInt64(p.Key.Key, 1), p.Value.GetInteroperable<OracleRequest>()));
         }

-        public IEnumerable<OracleRequest> GetRequestsByUrl(StoreView snapshot, string url)
+        public IEnumerable<(ulong, OracleRequest)> GetRequestsByUrl(StoreView snapshot, string url)
         {
             IdList list = snapshot.Storages.TryGet(CreateStorageKey(Prefix_IdList).Add(GetUrlHash(url)))?.GetInteroperable<IdList>();
             if (list is null) yield break;
             foreach (ulong id in list)
-                yield return snapshot.Storages[CreateStorageKey(Prefix_Request).Add(id)].GetInteroperable<OracleRequest>();
+                yield return (id, snapshot.Storages[CreateStorageKey(Prefix_Request).Add(id)].GetInteroperable<OracleRequest>());
         }

         private static byte[] GetUrlHash(string url)


Updated to current API

Updated to current API

--- src/tests/plug-ins/DemoApplication/DemoApplication.cs
+++ src/tests/plug-ins/DemoApplication/DemoApplication.cs
@@ -34,8 +34,8 @@
         /// <param name="mainWindow">Currently used main window</param>
         public void OnPostInitializeMainWindow(IMainWindow mainWindow) {
             mainWindow.WindowTitle = "Motoi - Demo Application";
-            mainWindow.WindowWidth = 800;
-            mainWindow.WindowHeight = 600;
+            mainWindow.Width = 800;
+            mainWindow.Height = 600;
         }

         /// <summary>


Fix hanging when start ad.

Fix hanging when start ad.

--- src/unity/Runtime/Core/Internal/PlatformImplNative.cs
+++ src/unity/Runtime/Core/Internal/PlatformImplNative.cs
@@ -156,10 +156,10 @@
         }

         public async Task<bool> TestConnection(string hostName, float timeOut) {
-            return await Task.WhenAny(((Func<Task<bool>>) (async () => {
+            return (await Task.WhenAny(((Func<Task<bool>>) (async () => {
                 await Task.Delay((int) (timeOut * 1000));
                 return false;
-            }))(), TestConnectionImpl(hostName, timeOut)).Result;
+            }))(), TestConnectionImpl(hostName, timeOut))).Result;
         }

         private async Task<bool> TestConnectionImpl(string hostName, float timeOut) {


2進数、8進数、16進数に対するテストを追加

2進数、8進数、16進数に対するテストを追加

--- test/Unittest/LexerTest.cs
+++ test/Unittest/LexerTest.cs
@@ -21,6 +21,22 @@
         {
             Assert.That("0", IsTokenized.Under(DECIMAL_INTEGER).And.Append(IsSeparated.Into("0")));
             Assert.That("1", IsTokenized.Under(DECIMAL_INTEGER).And.Append(IsSeparated.Into("1")));
+
+            Assert.That("0b0", IsTokenized.Under(BIN_INTEGER).And.Append(IsSeparated.Into("0b0")));
+            Assert.That("0b1", IsTokenized.Under(BIN_INTEGER).And.Append(IsSeparated.Into("0b1")));
+            Assert.That("0B0", IsTokenized.Under(BIN_INTEGER).And.Append(IsSeparated.Into("0B0")));
+            Assert.That("0B1", IsTokenized.Under(BIN_INTEGER).And.Append(IsSeparated.Into("0B1")));
+
+            Assert.That("0o0", IsTokenized.Under(OCT_INTEGER).And.Append(IsSeparated.Into("0o0")));
+            Assert.That("0o7", IsTokenized.Under(OCT_INTEGER).And.Append(IsSeparated.Into("0o7")));
+            Assert.That("0O0", IsTokenized.Under(OCT_INTEGER).And.Append(IsSeparated.Into("0O0")));
+            Assert.That("0O7", IsTokenized.Under(OCT_INTEGER).And.Append(IsSeparated.Into("0O7")));
+
+            Assert.That("0x0", IsTokenized.Under(HEX_INTEGER).And.Append(IsSeparated.Into("0x0")));
+            Assert.That("0xf", IsTokenized.Under(HEX_INTEGER).And.Append(IsSeparated.Into("0xf")));
+            Assert.That("0X0", IsTokenized.Under(HEX_INTEGER).And.Append(IsSeparated.Into("0X0")));
+            Assert.That("0Xf", IsTokenized.Under(HEX_INTEGER).And.Append(IsSeparated.Into("0Xf")));
+            Assert.That("0XF", IsTokenized.Under(HEX_INTEGER).And.Append(IsSeparated.Into("0XF")));
         }
     }
 }


Fix watchdog test

Fix watchdog test

--- tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
+++ tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs
@@ -221,6 +221,8 @@
 				},
 				cancellationToken);

+			versionToInstall = versionToInstall.Semver();
+
 			var initialStatus = await instanceClient.DreamDaemon.Read(cancellationToken);

 			var startJob = await instanceClient.DreamDaemon.Start(cancellationToken).ConfigureAwait(false);
@@ -243,7 +245,7 @@
 			Assert.AreEqual(initialStatus.ActiveCompileJob.Id, daemonStatus.ActiveCompileJob.Id);
 			var newerCompileJob = daemonStatus.StagedCompileJob;
 			Assert.AreNotEqual(daemonStatus.ActiveCompileJob.ByondVersion, newerCompileJob.ByondVersion);
-			Assert.AreEqual(versionToInstall.Semver(), newerCompileJob.ByondVersion);
+			Assert.AreEqual(versionToInstall, newerCompileJob.ByondVersion);

 			Assert.AreEqual(true, daemonStatus.SoftRestart);


Housekeeping - move NTFS unit tests to an in-memory formatted NTFS volume, rather than using a template VHD.

--- unittests/LibraryTests/DiscFileSystemDirectoryTest.cs
+++ unittests/LibraryTests/DiscFileSystemDirectoryTest.cs
@@ -313,11 +313,8 @@

     public class FileSystemSource
     {
-        private Stream ntfsBaseStream;
-
         public FileSystemSource()
         {
-            ntfsBaseStream = new FileStream(@"c:\temp\ntfsblank.vhd", FileMode.Open, FileAccess.Read);
         }

         public IEnumerable<TestCaseData> ReadWriteFileSystems
@@ -341,7 +338,6 @@
                 yield return new TestCaseData(
                     new DelayLoadFileSystem(FatFileSystem)).SetName("FAT");

-                // TODO: When format code complete, format a vanilla partition rather than relying on file on disk
                 yield return new TestCaseData(
                     new DelayLoadFileSystem(NtfsFileSystem)).SetName("NTFS");
             }
@@ -357,19 +353,11 @@

         public DiscFileSystem DiagnosticNtfsFileSystem()
         {
-            DiskImageFile parent = new DiskImageFile(
-                ntfsBaseStream,
-                Ownership.None);
-            Stream diffStream = new SparseMemoryStream();
-            Disk disk = Disk.InitializeDifferencing(
-                diffStream,
-                Ownership.Dispose,
-                parent,
-                Ownership.Dispose,
-                @"C:\temp\ntfsblank.vhd",
-                @".\ntfsblank.vhd",
-                File.GetLastWriteTimeUtc(@"C:\temp\ntfsblank.vhd"));
-            var discFs = new DiscUtils.Diagnostics.ValidatingFileSystem<Ntfs.NtfsFileSystem, Ntfs.NtfsFileSystemChecker>(disk.Partitions[0].Open());
+            SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096);
+            SparseMemoryStream ms = new SparseMemoryStream();
+            Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024);
+            Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectors);
+            var discFs = new DiscUtils.Diagnostics.ValidatingFileSystem<Ntfs.NtfsFileSystem, Ntfs.NtfsFileSystemChecker>(ms);
             discFs.CheckpointInterval = 1;
             discFs.GlobalIOTraceCapturesStackTraces = false;
             return discFs;
@@ -377,19 +365,10 @@

         public Ntfs.NtfsFileSystem NtfsFileSystem()
         {
-            DiskImageFile parent = new DiskImageFile(
-                ntfsBaseStream,
-                Ownership.None);
-            Stream diffStream = new SparseMemoryStream();
-            Disk disk = Disk.InitializeDifferencing(
-                diffStream,
-                Ownership.Dispose,
-                parent,
-                Ownership.Dispose,
-                @"C:\temp\ntfsblank.vhd",
-                @".\ntfsblank.vhd",
-                File.GetLastWriteTimeUtc(@"C:\temp\ntfsblank.vhd"));
-            return new Ntfs.NtfsFileSystem(disk.Partitions[0].Open());
+            SparseMemoryBuffer buffer = new SparseMemoryBuffer(4096);
+            SparseMemoryStream ms = new SparseMemoryStream();
+            Geometry diskGeometry = Geometry.FromCapacity(30 * 1024 * 1024);
+            return Ntfs.NtfsFileSystem.Format(ms, "", diskGeometry, 0, diskGeometry.TotalSectors);
         }

         private delegate DiscFileSystem FileSystemLoaderDelegate();


fix error in syntax

fix error in syntax

--- 100-basic-encoding/encode-blob-multiIn-overlay/run.csx
+++ 100-basic-encoding/encode-blob-multiIn-overlay/run.csx
@@ -65,9 +65,6 @@

     // No need to do any Retry strategy in this function, By default, the SDK calls a function up to 5 times for a
     // given blob. If the fifth try fails, the SDK adds a message to a queue named webjobs-blobtrigger-poison.
-
-
-    */

     log.Info($"C# Blob trigger  function processed: {fileName}.json");


Bindings.

Bindings.

--- ExRam.Gremlinq.Core/ExecutionPipelines/GremlinQuerySerializer.cs
+++ ExRam.Gremlinq.Core/ExecutionPipelines/GremlinQuerySerializer.cs
@@ -13,50 +13,6 @@
     {
         private sealed class GremlinQuerySerializerImpl : IGremlinQuerySerializer
         {
-            private sealed class Recurse
-            {
-                private static readonly AtomSerializer<object> Constant = (atom, baseSerializer, recurse) => atom;
-
-                private readonly Func<object, object> _recurse;
-                private readonly ConcurrentDictionary<Type, AtomSerializer<object>?> _dict;
-
-                public Recurse(ConcurrentDictionary<Type, AtomSerializer<object>?> dict)
-                {
-                    _dict = dict;
-                    _recurse = RecurseImpl;
-                }
-
-                public object RecurseImpl(object o)
-                {
-                    var action = GetSerializer(o.GetType()) ?? Constant;
-
-                    return action(o, _ => throw new NotImplementedException(), _recurse);
-                }
-
-                private AtomSerializer<object>? GetSerializer(Type type)
-                {
-                    return _dict
-                        .GetOrAdd(
-                            type,
-                            closureType =>
-                            {
-                                foreach (var implementedInterface in closureType.GetInterfaces())
-                                {
-                                    if (GetSerializer(implementedInterface) is AtomSerializer<object> interfaceSerializer)
-                                        return interfaceSerializer;
-                                }
-
-                                if (closureType.BaseType is Type baseType)
-                                {
-                                    if (GetSerializer(baseType) is AtomSerializer<object> baseSerializer)
-                                        return baseSerializer;
-                                }
-
-                                return null;
-                            });
-                }
-            }
-
             private readonly IImmutableDictionary<Type, AtomSerializer<object>> _dict;
             private readonly Lazy<ConcurrentDictionary<Type, AtomSerializer<object>?>> _lazyFastDict;

@@ -70,8 +26,55 @@

             public object Serialize(IGremlinQuery query)
             {
-                return new Recurse(_lazyFastDict.Value)
-                    .RecurseImpl(query);
+                var _bindings = new Dictionary<object, Binding>();
+                var _stepLabelNames = new Dictionary<StepLabel, string>();
+
+                object Constant<TAtom>(TAtom atom, Func<TAtom, object> baseSerializer, Func<object, object> recurse)
+                {
+                    if (atom is StepLabel stepLabel)
+                    {
+                        if (!_stepLabelNames.TryGetValue(stepLabel, out var stepLabelMapping))
+                        {
+                            stepLabelMapping = "l" + (_stepLabelNames.Count + 1);
+                            _stepLabelNames.Add(stepLabel, stepLabelMapping);
+                        }
+
+                        // ReSharper disable once TailRecursiveCall
+                        return recurse(stepLabelMapping);
+                    }
+
+                    if (atom is IOptional optional)
+                        return optional.MatchUntyped(recurse, () => "none");
+
+                    if (_bindings.TryGetValue(atom, out var binding))
+                        return binding;
+
+                    var bindingKey = string.Empty;
+                    var next = _bindings.Count;
+
+                    do
+                    {
+                        bindingKey = (char)('a' + next % 26) + bindingKey;
+                        next = next / 26;
+                    }
+                    while (next > 0);
+
+                    bindingKey = "_" + bindingKey;
+                    binding = new Binding(bindingKey, atom);
+
+                    _bindings.Add(atom, binding);
+
+                    return binding;
+                };
+
+                object RecurseImpl(object o)
+                {
+                    var action = GetSerializer(o.GetType()) ?? Constant;
+
+                    return action(o, _ => throw new NotImplementedException(), RecurseImpl);
+                }
+
+                return RecurseImpl(query);
             }

             public IGremlinQuerySerializer OverrideAtomSerializer<TAtom>(AtomSerializer<TAtom> atomSerializer)
@@ -82,6 +85,29 @@
                         .Match(
                             existingAtomSerializer => _dict.SetItem(typeof(TAtom), (atom, baseSerializer, recurse) => atomSerializer((TAtom)atom, _ => existingAtomSerializer(_, baseSerializer, recurse), recurse)),
                             () => _dict.SetItem(typeof(TAtom), (atom, baseSerializer, recurse) => atomSerializer((TAtom)atom, _ => throw new NotImplementedException(), recurse))));
+            }
+
+            private AtomSerializer<object>? GetSerializer(Type type)
+            {
+                return _lazyFastDict.Value
+                    .GetOrAdd(
+                        type,
+                        closureType =>
+                        {
+                            foreach (var implementedInterface in closureType.GetInterfaces())
+                            {
+                                if (GetSerializer(implementedInterface) is AtomSerializer<object> interfaceSerializer)
+                                    return interfaceSerializer;
+                            }
+
+                            if (closureType.BaseType is Type baseType)
+                            {
+                                if (GetSerializer(baseType) is AtomSerializer<object> baseSerializer)
+                                    return baseSerializer;
+                            }
+
+                            return null;
+                        });
             }
         }


GameScreen Player is now ExposedInDerived.


changes

changes

--- FluentQuery.Core/Infrastructure/Reflection/ReflectionInstance.cs
+++ FluentQuery.Core/Infrastructure/Reflection/ReflectionInstance.cs
@@ -87,7 +87,7 @@
             }

             typeModel.Columns = new List<ReflectionColumnTypeModel>();
-            foreach (var property in properties.Where(prop => IsSimpleType(prop.PropertyType)))
+            foreach (var property in properties.Where(WhereColumnsCondtions))
             {
                 typeModel.Columns.Add(property.ConvertPropertyToReflectionColumn(typeModel.TableFromItem));
             }
@@ -102,6 +102,21 @@

                         return right.IsPrimaryKey() ? 1 : string.Compare(left.ColumnProperty.Name, right.ColumnProperty.Name, StringComparison.Ordinal);
                     });
+        }
+
+        private static bool WhereColumnsCondtions(PropertyInfo prop)
+        {
+            return IsSimpleType(prop.PropertyType) && !IsNotMapped(prop);
+        }
+
+        private static bool IsNotMapped(MemberInfo prop)
+        {
+            var attributes = prop.GetAllAttributesByMember();
+
+            var notMappedAttr = (NotMappedAttribute)attributes?.FirstOrDefault(t => t is NotMappedAttribute);
+
+            return notMappedAttr != null;
+
         }

         /// <summary>


add naming strategy option to JsonSerializer

--- Libraries/src/Amazon.Lambda.Serialization.Json/JsonSerializer.cs
+++ Libraries/src/Amazon.Lambda.Serialization.Json/JsonSerializer.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using Amazon.Lambda.Core;
 using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;

 namespace Amazon.Lambda.Serialization.Json
 {
@@ -26,14 +27,18 @@
         /// customize the serializer settings.
         /// </summary>
         /// <param name="customizeSerializerSettings">A callback to customize the serializer settings.</param>
-        public JsonSerializer(Action<JsonSerializerSettings> customizeSerializerSettings)
+        /// <param name="namingStrategy">The naming strategy to use. This parameter makes it possible to change the naming strategy to camel case for example. When not provided, it uses the default Newtonsoft.Json DefaultNamingStrategy.</param>
+        public JsonSerializer(Action<JsonSerializerSettings> customizeSerializerSettings, NamingStrategy namingStrategy = null)
         {
             JsonSerializerSettings settings = new JsonSerializerSettings();
             customizeSerializerSettings(settings);

             // Set the contract resolver *after* the custom callback has been
             // invoked. This makes sure that we always use the good resolver.
-            settings.ContractResolver = new AwsResolver();
+            settings.ContractResolver = new AwsResolver
+            {
+                NamingStrategy = namingStrategy,
+            };

             serializer = Newtonsoft.Json.JsonSerializer.Create(settings);


fixpix

fixpix

--- MasDev.Common/MasDev.Common.Portable/Source/Utils/StringUtils.cs
+++ MasDev.Common/MasDev.Common.Portable/Source/Utils/StringUtils.cs
@@ -68,7 +68,7 @@

 		public static bool ContainsSomethingReadable (string s)
 		{
-			return string.IsNullOrEmpty (s) || s.ContainsOnlyWhiteSpaces ();
+			return !(string.IsNullOrEmpty (s) || s.ContainsOnlyWhiteSpaces ());
 		}
 	}
 }


PLayerVsBot: updated application-version

--- OpenQuoridorFramework/OQF.Resources/OpenQuoridorFrameworkInfo.cs
+++ OpenQuoridorFramework/OQF.Resources/OpenQuoridorFrameworkInfo.cs
@@ -42,7 +42,7 @@
 			public static class PlayerVsBot
 			{
 				private const string Name               = "Player vs. Bot";
-				private const string ApplicationVersion = "1.1";
+				private const string ApplicationVersion = "1.2";

 				public static readonly ApplicationInfo Info = new ApplicationInfo(Name,
 																				  ApplicationVersion,


Prevent hammering the grid services with llRequestAgentData requests. Cache the user information permanently, and the online status for 20 seconds. Also cache negatives.

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -68,6 +68,14 @@

 namespace OpenSim.Region.ScriptEngine.Shared.Api
 {
+    // MUST be a ref type
+    public class UserInfoCacheEntry
+    {
+        public int time;
+        public UserAccount account;
+        public PresenceInfo pinfo;
+    }
+
     /// <summary>
     /// Contains all LSL ll-functions. This class will be in Default AppDomain.
     /// </summary>
@@ -92,6 +100,8 @@
         protected int m_scriptConsoleChannel = 0;
         protected bool m_scriptConsoleChannelEnabled = false;
         protected IUrlModule m_UrlModule = null;
+        protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache =
+                new Dictionary<UUID, UserInfoCacheEntry>();

         public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
         {
@@ -3908,16 +3918,47 @@
             m_host.AddScriptLPS(1);

             UUID uuid = (UUID)id;
-
-            UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
-            if (account == null)
-                return UUID.Zero.ToString();
-
-
             PresenceInfo pinfo = null;
-            PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
-            if (pinfos != null && pinfos.Length > 0)
-                pinfo = pinfos[0];
+            UserAccount account;
+
+            UserInfoCacheEntry ce;
+            if (!m_userInfoCache.TryGetValue(uuid, out ce))
+            {
+                account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
+                if (account == null)
+                {
+                    m_userInfoCache[uuid] = null; // Cache negative
+                    return UUID.Zero.ToString();
+                }
+
+
+                PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
+                if (pinfos != null && pinfos.Length > 0)
+                    pinfo = pinfos[0];
+
+                ce = new UserInfoCacheEntry();
+                ce.time = Util.EnvironmentTickCount();
+                ce.account = account;
+                ce.pinfo = pinfo;
+            }
+            else
+            {
+                if (ce == null)
+                    return UUID.Zero.ToString();
+
+                account = ce.account;
+                pinfo = ce.pinfo;
+            }
+
+            if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000)
+            {
+                PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
+                if (pinfos != null && pinfos.Length > 0)
+                    pinfo = pinfos[0];
+
+                ce.time = Util.EnvironmentTickCount();
+                ce.pinfo = pinfo;
+            }

             string reply = String.Empty;


Use Solution instead of SolutionFile

Use Solution instead of SolutionFile

--- source/Nuke.GlobalTool/templates/Build.cs
+++ source/Nuke.GlobalTool/templates/Build.cs
@@ -51,10 +51,10 @@
         .Executes(() =>
         {
             MSBuild(s => s                                                                      // MSBUILD
-                .SetTargetPath(SolutionFile)                                                    // MSBUILD
+                .SetTargetPath(Solution)                                                        // MSBUILD
                 .SetTargets("Restore"));                                                        // MSBUILD
             DotNetRestore(s => s                                                                // DOTNET
-                .SetProjectFile(SolutionFile));                                                 // DOTNET
+                .SetProjectFile(Solution));                                                     // DOTNET
         });

     Target Compile => _ => _
@@ -62,7 +62,7 @@
         .Executes(() =>
         {
             MSBuild(s => s                                                                      // MSBUILD
-                .SetTargetPath(SolutionFile)                                                    // MSBUILD
+                .SetTargetPath(Solution)                                                        // MSBUILD
                 .SetTargets("Rebuild")                                                          // MSBUILD
                 .SetConfiguration(Configuration)                                                // MSBUILD
                 .SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion())                  // MSBUILD && GITVERSION
@@ -71,7 +71,7 @@
                 .SetMaxCpuCount(Environment.ProcessorCount)                                     // MSBUILD
                 .SetNodeReuse(IsLocalBuild));                                                   // MSBUILD
             DotNetBuild(s => s                                                                  // DOTNET
-                .SetProjectFile(SolutionFile)                                                   // DOTNET
+                .SetProjectFile(Solution)                                                       // DOTNET
                 .SetConfiguration(Configuration)                                                // DOTNET
                 .SetAssemblyVersion(GitVersion.GetNormalizedAssemblyVersion())                  // DOTNET && GITVERSION
                 .SetFileVersion(GitVersion.GetNormalizedFileVersion())                          // DOTNET && GITVERSION
@@ -84,7 +84,7 @@
         .Executes(() =>
         {
             MSBuild(s => s                                                                      // MSBUILD
-                .SetTargetPath(SolutionFile)                                                    // MSBUILD
+                .SetTargetPath(Solution)                                                        // MSBUILD
                 .SetTargets("Restore", "Pack")                                                  // MSBUILD
                 .SetPackageVersion(GitVersion.NuGetVersionV2)                                   // MSBUILD && GITVERSION
                 .SetPackageOutputPath(ArtifactsDirectory)                                       // MSBUILD && ARTIFACTS_DIR
@@ -92,7 +92,7 @@
                 .SetConfiguration(Configuration)                                                // MSBUILD
                 .EnableIncludeSymbols());                                                       // MSBUILD
             DotNetPack(s => s                                                                   // DOTNET
-                .SetProject(SolutionFile)                                                       // DOTNET
+                .SetProject(Solution)                                                           // DOTNET
                 .SetVersion(GitVersion.NuGetVersionV2)                                          // DOTNET && GITVERSION
                 .SetOutputDirectory(ArtifactsDirectory)                                         // DOTNET && ARTIFACTS_DIR
                 .SetOutputDirectory(OutputDirectory)                                            // DOTNET && OUTPUT_DIR


Fixed parameter name in throw statement

Fixed parameter name in throw statement

--- OpenXmlExtensions/OpenXmlExtensions/Transforms/ListExtensions.cs
+++ OpenXmlExtensions/OpenXmlExtensions/Transforms/ListExtensions.cs
@@ -49,7 +49,7 @@
                 else if (itemOrCollection is IEnumerable<T>)
                     list.AddRange((IEnumerable<T>)itemOrCollection);
                 else
-                    throw new ArgumentException("Illegal item type: " + itemOrCollection.GetType(), "item");
+                    throw new ArgumentException("Illegal item type: " + itemOrCollection.GetType(), "itemOrCollection");
             }
             return list;
         }
@@ -67,7 +67,7 @@
                     foreach (T item in (IEnumerable<T>)itemOrCollection)
                         set.Add(item);
                 else
-                    throw new ArgumentException("Illegal item type: " + itemOrCollection.GetType(), "item");
+                    throw new ArgumentException("Illegal item type: " + itemOrCollection.GetType(), "itemOrCollection");
             }
             return set;
         }


added shading for normalized histograms

added shading for normalized histograms

Added shading for normalized histograms based on the count of values.

--- PanoramicDataWin8/view/vis/render/PlotRendererContentProvider.cs
+++ PanoramicDataWin8/view/vis/render/PlotRendererContentProvider.cs
@@ -1247,7 +1247,7 @@
                     DataToScreenY((double) (yValue - yMarginAbsolute)) - DataToScreenY((double) (yValue + yMarginAbsolute)));

                 createBinPrimitives(bin, binPrimitiveCollection, brush, estimationRect, marginRect, marginPercentage,
-                    xFrom, xTo, yFrom, yTo, baseColorFromBrush(brush), unNormalizedvalue, dataValue.Value);
+                    xFrom, xTo, yFrom, yTo, normalization.Axis == BczNormalization.axis.X ? baseColorFromBrush(brush, 0.8*binBrushMaxAxis/_yScale + 0.2): baseColorFromBrush(brush), unNormalizedvalue, dataValue.Value);
             }
         }

@@ -1278,7 +1278,7 @@
                     4.0);

                 createBinPrimitives(bin, binPrimitiveCollection, brush, Rect.Empty, marginRect, marginPercentage,
-                    xFrom, xTo, yFrom, yTo, baseColorFromBrush(brush), unNormalizedvalue, dataValue.Value);
+                    xFrom, xTo, yFrom, yTo, normalization.Axis == BczNormalization.axis.Y ? baseColorFromBrush(brush, 0.8 * binBrushMaxAxis / _xScale + 0.2) : baseColorFromBrush(brush), unNormalizedvalue, dataValue.Value);
             }
         }

@@ -1474,7 +1474,7 @@
             return normalization;
         }

-        Color baseColorFromBrush(Brush brush)
+        Color baseColorFromBrush(Brush brush, double opacity = 1)
         {
             Color baseColor;
             if (brush.BrushIndex == _histogramResult.RestBrushIndex())
@@ -1501,7 +1501,8 @@
                 }
             }

-            return baseColor;
+            //return Windows.UI.Color.FromArgb(255, (byte)(opacity * baseColor.R), (byte)(opacity * baseColor.G), (byte)(opacity * baseColor.B));
+            return Windows.UI.Color.FromArgb((byte)(opacity * 255), baseColor.R, baseColor.G, baseColor.B);
         }


updated sortings to go away when switching to a HeatMap

--- PanoramicDataWin8/view/vis/render/PlotRendererContentProvider.cs
+++ PanoramicDataWin8/view/vis/render/PlotRendererContentProvider.cs
@@ -63,12 +63,12 @@
             _filterModels = filterModels;
         }

-        public void RemoveBczBinMapModels(List<BczBinMapModel> binMapModels)
+        void removeBczBinMapModels(List<BczBinMapModel> binMapModels)
         {
             foreach (var mapItem in binMapModels)
                 _bczBinMapModels.Remove(mapItem);
         }
-        public void UpdateBczBinMapModels(List<BczBinMapModel> binMapModels)
+        void addBczBinMapModels(List<BczBinMapModel> binMapModels)
         {
             var newbinMaps = new List<BczBinMapModel>();
             foreach (var fm in binMapModels)
@@ -95,16 +95,16 @@
         {
             if (bczhits.Any(h => _bczBinMapModels.Contains(h)))
             {
-                RemoveBczBinMapModels(bczhits);
+                removeBczBinMapModels(bczhits);
                 if (!bczhits.First().SortUp)
                 {
                     bczhits.First().SortUp = true;
-                    UpdateBczBinMapModels(bczhits);
+                    addBczBinMapModels(bczhits);
                 }
             }
             else
             {
-                UpdateBczBinMapModels(bczhits);
+                addBczBinMapModels(bczhits);
             }
         }

@@ -127,6 +127,8 @@

         public override void Draw(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl canvas, Microsoft.Graphics.Canvas.UI.Xaml.CanvasDrawEventArgs canvasArgs)
         {
+            if (_helper != null && _helper.ChartType == ChartType.HeatMap && _bczBinMapModels.Count > 0)
+                _bczBinMapModels.Clear();
             var mat = Matrix3x2.CreateScale(CommonExtensions.ToVector2(CompositionScaleX, CompositionScaleY));
             canvasArgs.DrawingSession.Transform = mat;


Cleanup usings

Cleanup usings

--- RDFSharp/Semantics/SKOS/Abstractions/RDFSKOSConceptSchemeLens.cs
+++ RDFSharp/Semantics/SKOS/Abstractions/RDFSKOSConceptSchemeLens.cs
@@ -14,10 +14,7 @@
    limitations under the License.
 */

-using RDFSharp.Model;
 using RDFSharp.Semantics.OWL;
-using System;
-using System.Collections;
 using System.Collections.Generic;
 using System.Linq;


fixed the timer not applying the color change for checkbox and radiobutton

--- RelhaxModpack/RelhaxModpack/Windows/PackageSelectionList.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/PackageSelectionList.xaml.cs
@@ -859,7 +859,9 @@
                             HorizontalAlignment = HorizontalAlignment.Left,
                             HorizontalContentAlignment = HorizontalAlignment.Left,
                             VerticalContentAlignment = VerticalAlignment.Center,
-                            Content = package.NameDisplay,
+                            //don't set a style so that it will use the default, which means it won't override applying the dark theme
+                            //we don't want to do that because we want to use the checkBox's/radioButton's Foreground property
+                            Content = new TextBlock() { Text = package.NameDisplay, Style = null },
                             IsEnabled = package.IsStructureEnabled,
                             IsChecked = false
                         };
@@ -879,7 +881,9 @@
                             HorizontalAlignment = HorizontalAlignment.Left,
                             HorizontalContentAlignment = HorizontalAlignment.Left,
                             VerticalContentAlignment = VerticalAlignment.Center,
-                            Content = package.NameDisplay,
+                            //don't set a style so that it will use the default, which means it won't override applying the dark theme
+                            //we don't want to do that because we want to use the checkBox's/radioButton's Foreground property
+                            Content = new TextBlock() { Text = package.NameDisplay, Style = null },
                             IsEnabled = package.IsStructureEnabled,
                             IsChecked = false
                         };


comments and cleanup in filesys handler

comments and cleanup in filesys handler

--- lib/DefaultFileSystemHandler.cs
+++ lib/DefaultFileSystemHandler.cs
@@ -6,25 +6,22 @@
 {
     public class DefaultFileSystemHandler : IFileSystemHandler
     {
-        enum OS { WinNT, WinCE, Unix };
-
+        // list of supported operating systems
+        private enum OS { WinNT, WinCE, Unix };
+
+        // currently used operating system
+        private OS os;
+        // current path as TVFS or unix-like
         private string currentPath;
-        private OS os;

         public DefaultFileSystemHandler(DirectoryInfo startDir)
         {
             if (Environment.OSVersion.Platform == PlatformID.Win32NT)
-            {
               os = OS.WinNT;
-            }
             else if (Environment.OSVersion.Platform == PlatformID.WinCE)
-            {
               os = OS.WinCE;
-            }
             else // probably UNIX
-            {
               os = OS.Unix;
-            }

             this.currentPath = EncodePath(startDir.FullName);
         }


fixed execute_js bug for Pariveda

fixed execute_js bug for Pariveda

--- platform/wp7/RhoRubyLib/common/RhodesApp.cs
+++ platform/wp7/RhoRubyLib/common/RhodesApp.cs
@@ -261,18 +261,32 @@

         public void processInvokeScript(String strScript, int index)
         {
+            String[] arr = strScript.Split('(');
+            String[] arrParams = null;
+            if (arr.Length > 1)
+            {
+                arrParams = arr[1].Split(',');
+                if (arrParams.Length == 1)
+                {
+                    arrParams[0] = arrParams[0].Replace('"', ' ');
+                    arrParams[0] = arrParams[0].Replace(')', ' ');
+                    arrParams[0] = arrParams[0].Replace(';', ' ');
+                    arrParams[0] = arrParams[0].Trim();
+                }
+            }
+
             m_webBrowser.Dispatcher.BeginInvoke(() =>
             {
                 if (index > 0)
                 {
                     if (m_tabControl != null && m_tabControl.Items.Count > 0)
                     {
-                        ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.InvokeScript(strScript);
+                        ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.InvokeScript(arr[0], arrParams);
                     }
                 }
                 else
                 {
-                    m_webBrowser.InvokeScript(strScript);
+                    m_webBrowser.InvokeScript(arr[0], arrParams);
                 }
             });
         }


Refs #1250,#705 - irrelevante test verwijderd

De naam van de test was: 'UitstappenInHuidigWerkjaar'.
De test bewaarde een nieuwe uitstap.
Er was niet gedocumenteerd wat hij zou moeten testen.

Ik heb hem dan maar verwijderd.

--- Solution/TestProjecten/Chiro.Gap.Workers.Test/UitstapAanmaken.cs
+++ Solution/TestProjecten/Chiro.Gap.Workers.Test/UitstapAanmaken.cs
@@ -1,68 +0,0 @@
-/*
- * Copyright 2008-2013 the GAP developers. See the NOTICE file at the
- * top-level directory of this distribution, and at
- * https://develop.chiro.be/gap/wiki/copyright
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-using System;
-using Chiro.Gap.Domain;
-using Chiro.Gap.Dummies;
-using Chiro.Gap.Poco.Model;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Chiro.Cdf.Ioc;
-
-namespace Chiro.Gap.Workers.Test
-{
-	[TestClass]
-	public class UitstappenAanmaken
-	{
-		#region Additional test attributes
-		[ClassInitialize]
-		static public void InitialiseerTests(TestContext tc)
-		{
-			Factory.ContainerInit();
-		}
-
-		[ClassCleanup]
-		static public void AfsluitenTests()
-		{
-
-		}
-		#endregion
-
-		/// <summary>
-		/// TODO zou een non-dummy test moeten worden, zodat complexer gedrag getest kan worden
-		/// </summary>
-		[TestMethod]
-		public void UitstappenInHuidigWerkjaar()
-		{
-            //var testData = new DummyData();
-
-            //var um = Factory.Maak<UitstappenManager>();
-
-            //var uitstap = new Uitstap();
-            //uitstap.IsBivak = true;
-            //uitstap.Naam = "Testbivak";
-            //uitstap.DatumVan = DateTime.Today.AddDays(1);
-            //uitstap.DatumTot = DateTime.Today.AddDays(1);
-
-            //var dummygwj = new GroepsWerkJaar();
-            //dummygwj.WerkJaar = DateTime.Today.Year;
-            //uitstap.GroepsWerkJaar = dummygwj;
-
-            //um.Bewaren(uitstap, UitstapExtras.Geen, false);
-            throw new NotImplementedException(NIEUWEBACKEND.Info);
-		}
-	}
-}


Syncrhophasor: updated multi-protocol frame parser to implement an improved file data source read to enhance the quality of simulated data inputs, particularly when there is more than one file data source. Implementors should set the "useHighResolutionInputTimer" connection string parameter to true for the best results.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C65963

--- Source/Libraries/TVA.PhasorProtocols/MultiProtocolFrameParser.cs
+++ Source/Libraries/TVA.PhasorProtocols/MultiProtocolFrameParser.cs
@@ -1747,6 +1747,7 @@
                         fileClient.FileOpenMode = FileMode.Open;
                         fileClient.FileAccessMode = FileAccess.Read;
                         fileClient.FileShareMode = FileShare.Read;
+                        fileClient.ReceiveOnDemand = true;
                         fileClient.AutoRepeat = m_autoRepeatCapturedPlayback;
                     }
                     break;
@@ -2346,6 +2347,10 @@
             // Only handle client connection from data channel when command channel is undefined
             if (!(m_commandChannel != null && m_commandChannel.CurrentState == ClientState.Connected))
                 ClientConnectedHandler();
+
+            // Start reading file data
+            if (m_transportProtocol == TransportProtocol.File)
+                ThreadPool.QueueUserWorkItem(ReadFileData);
         }

         private void m_dataChannel_ConnectionAttempt(object sender, EventArgs e)
@@ -2582,6 +2587,35 @@
             OnParsingException(ex);
         }

+        private void ReadFileData(object state)
+        {
+            try
+            {
+                FileClient fileClient = m_dataChannel as FileClient;
+
+                if (fileClient != null)
+                {
+                    // Start receiving file data continuously.
+                    while (true)
+                    {
+                        // Time to exit if file client disconnects...
+                        if (fileClient.CurrentState != ClientState.Connected)
+                            break;
+
+                        fileClient.ReceiveData();
+                    }
+                }
+            }
+            catch (ThreadAbortException)
+            {
+                throw;
+            }
+            catch
+            {
+                // For any other exception, we exit gracefully
+            }
+        }
+
         #endregion

         #endregion


openPDC Manager: Improvements and bug fixes for input wizard.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C73079

--- Source/Libraries/openPDC.UI.WPF/ViewModels/InputWizardDevices.cs
+++ Source/Libraries/openPDC.UI.WPF/ViewModels/InputWizardDevices.cs
@@ -638,7 +638,7 @@
             m_companyLookupList = Company.GetLookupList(null, true);
             m_historianLookupList = Historian.GetLookupList(null, true, false);
             m_interconnectionLookupList = Interconnection.GetLookupList(null, true);
-            m_protocolLookupList = Protocol.GetLookupList(null, true);
+            m_protocolLookupList = Protocol.GetLookupList(null, false);
             m_vendorDeviceLookupList = VendorDevice.GetLookupList(null, true);
             m_protocolList = Protocol.Load(null);

@@ -1029,7 +1029,7 @@
                     connectionString += "accessid=" + AccessID + ";";

                     if (!connectionString.ToLower().Contains("phasorprotocol"))
-                        connectionString += "phasorprotocol=" + ProtocolAcronym + ";";
+                        connectionString += "phasorprotocol=" + m_protocolList.FirstOrDefault(p => p.ID == ProtocolID).Acronym + ";";

                     windowsServiceClient.Helper.SendRequest(string.Format("invoke 0 requestdeviceconfiguration \"{0}\"", connectionString));

@@ -1037,7 +1037,9 @@
                     {
                         if (m_requestConfigurationAttachment is ConfigurationErrorFrame)
                         {
-                            throw new ApplicationException("Received configuration error frame." + Environment.NewLine + m_requestConfigurationError);
+                            Thread.Sleep(3000);
+                            m_requestConfigurationError = "Received configuration error frame." + Environment.NewLine + m_requestConfigurationError;
+                            throw new ApplicationException(m_requestConfigurationError);
                         }
                         else if (m_requestConfigurationAttachment is IConfigurationFrame)
                         {
@@ -1108,7 +1110,9 @@
         private void Helper_ReceivedServiceUpdate(object sender, EventArgs<UpdateType, string> e)
         {
             if (e.Argument2.StartsWith("[PHASOR!SERVICES]") && !e.Argument2.Contains("*"))
+            {
                 m_requestConfigurationError += e.Argument2.Replace("[PHASOR!SERVICES]", "").Replace("\r\n\r\n", "\r\n");
+            }
         }

         /// <summary>
@@ -1151,7 +1155,6 @@
                     device.HistorianID = HistorianID == 0 ? (int?)null : HistorianID;
                     device.ProtocolID = ProtocolID == 0 ? (int?)null : ProtocolID;
                     device.InterconnectionID = InterconnectionID == 0 ? (int?)null : InterconnectionID;
-                    device.AccessID = AccessID;
                     device.SkipDisableRealTimeData = SkipDisableRealTimeData;
                     device.ConnectionString = GenerateConnectionString();
                     device.Enabled = true;


- almost completed MethodTableBuilderStage

--- Source/Mosa.Runtime/CompilerFramework/MethodTableBuilderStage.cs
+++ Source/Mosa.Runtime/CompilerFramework/MethodTableBuilderStage.cs
@@ -70,15 +70,32 @@

 			var size = 3 * table.Count * this.typeLayout.NativePointerSize;
 			var offsetPointer = 0;
+			var offsets = new Dictionary<LinkerSymbol, long>();

 			using (var stream = this.linker.Allocate("methodTableStart", SectionKind.Text, size, this.typeLayout.NativePointerAlignment))
 			{
+				var position = stream.Position;
 				foreach (var entry in table)
 				{
-					var ptr = this.linker.Link(LinkType.AbsoluteAddress | LinkType.I4, "methodTableStart", offsetPointer, 0, entry.Name, IntPtr.Zero);
-					stream.Write(BitConverter.GetBytes(0xFFFFFFFF), 0, 4);
+					offsets[entry] = offsetPointer;
+					this.linker.Link(LinkType.AbsoluteAddress | LinkType.I4, "methodTableStart", offsetPointer, 0, entry.Name, IntPtr.Zero);
+					this.linker.Link(LinkType.AbsoluteAddress | LinkType.I4, "methodTableStart", offsetPointer + 8, 0, entry.Name + "$methodDescriptionEntry", IntPtr.Zero);
+					offsetPointer += 3 * this.typeLayout.NativePointerSize;
+				}
+
+				stream.Position = position;
+				foreach (var entry in table)
+				{
+					stream.Seek(offsets[entry] + 4, System.IO.SeekOrigin.Begin);
 					stream.Write(BitConverter.GetBytes(entry.Length), 0, 4);
-					offsetPointer += 3 * this.typeLayout.NativePointerSize;
+				}
+			}
+
+			foreach (var entry in table)
+			{
+				using (var stream = this.linker.Allocate(entry.Name + "$methodDescriptionEntry", SectionKind.Text, 4, this.typeLayout.NativePointerAlignment))
+				{
+					stream.Write(BitConverter.GetBytes(0xFFEEDDCC), 0, 4);
 				}
 			}
 		}


added default warrior config file if not found

--- TCC.Core/Windows/ClassSpecificBars/Managers/WarriorBarManager.cs
+++ TCC.Core/Windows/ClassSpecificBars/Managers/WarriorBarManager.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -43,7 +44,7 @@
         {
             _dispatcher = Dispatcher.CurrentDispatcher;
             _expire = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(8000) };
-            _expire.Tick += (s ,ev) => Edge = 0;
+            _expire.Tick += (s, ev) => Edge = 0;
         }
     }
     public class IntTracker : TSPropertyChanged
@@ -52,12 +53,13 @@
         public int Val
         {
             get { return val; }
-            set {
+            set
+            {
                 if (val == value) return;
                 val = value;

                 NotifyPropertyChanged("Val");
-            }
+            }
         }
         public IntTracker()
         {
@@ -89,24 +91,55 @@
         void LoadSkills()
         {
             //User defined skills
+            if (!File.Exists("resources/config/warrior-skills.xml"))
+            {
+                //create default warrior file
+                XElement skills = new XElement("Skills",
+                    new XElement("Skill", new XAttribute("id", 181100), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 41100), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 110800), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 280730), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 290730), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 160700), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 171100), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 191000), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 300100), new XAttribute("row", 1)),
+                    new XElement("Skill", new XAttribute("id", 100700), new XAttribute("row", 2)),
+                    new XElement("Skill", new XAttribute("id", 220200), new XAttribute("row", 2)),
+                    new XElement("Skill", new XAttribute("id", 120800), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 230200), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 210200), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 270800), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 310900), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 30900), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 50900), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 240900), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 330900), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 340100), new XAttribute("row", 0)),
+                    new XElement("Skill", new XAttribute("id", 350100), new XAttribute("row", 0))
+                    );
+                skills.Save("resources/config/warrior-skills.xml");
+            }
+
             XDocument skillsDoc = XDocument.Load("resources/config/warrior-skills.xml");
-            foreach (XElement skillElement in skillsDoc.Descendants("Skill"))
-            {
-                uint skillId = Convert.ToUInt32(skillElement.Attribute("id").Value);
-                int row = Convert.ToInt32(skillElement.Attribute("row").Value);
-
-                if (SkillsDatabase.TryGetSkill(skillId, Class.Warrior, out Skill sk))
-                {
-                    if (row == 1)
+                foreach (XElement skillElement in skillsDoc.Descendants("Skill"))
+                {
+                    uint skillId = Convert.ToUInt32(skillElement.Attribute("id").Value);
+                    int row = Convert.ToInt32(skillElement.Attribute("row").Value);
+
+                    if (SkillsDatabase.TryGetSkill(skillId, Class.Warrior, out Skill sk))
                     {
-                        MainSkills.Add(new FixedSkillCooldown(sk, CooldownType.Skill, Dispatcher));
+                        if (row == 1)
+                        {
+                            MainSkills.Add(new FixedSkillCooldown(sk, CooldownType.Skill, Dispatcher));
+                        }
+                        else if (row == 2)
+                        {
+                            SecondarySkills.Add(new FixedSkillCooldown(sk, CooldownType.Skill, Dispatcher));
+                        }
                     }
-                    else if (row == 2)
-                    {
-                        SecondarySkills.Add(new FixedSkillCooldown(sk, CooldownType.Skill, Dispatcher));
-                    }
-                }
-            }
+                }
+

             //Deadly gamble
             SkillsDatabase.TryGetSkill(200200, Class.Warrior, out Skill dg);


Experimental space prediction fix (needs a MP test)

--- UnityProject/Assets/Scripts/Messages/Server/PlayerMoveMessage.cs
+++ UnityProject/Assets/Scripts/Messages/Server/PlayerMoveMessage.cs
@@ -27,6 +27,7 @@
 			if (State.ResetClientQueue)
 			{
 				playerSync.ClearQueueClient();
+				playerSync.RollbackPrediction();
 			}
 			if ( State.MoveNumber == 0 ) {
 	//			Logger.Log( "Zero step rollback" );


Revert matrix.cs

Revert matrix.cs

--- UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/Matrix.cs
+++ UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/Matrix.cs
@@ -109,10 +109,5 @@
             }
             return false;
         }
-
-        public IEnumerable<IElectricityIO> GetElectrictyConnections(Vector3Int position)
-        {
-            return objects.Get(position).Select(x => x.GetComponent<IElectricityIO>()).Where(x => x != null);
-        }
     }
 }


Fixed CNT server lerp after optimizations

--- UnityProject/Assets/Scripts/Transform/CustomNetTransform.Move.cs
+++ UnityProject/Assets/Scripts/Transform/CustomNetTransform.Move.cs
@@ -317,7 +317,7 @@
 		}
 		bool isRecursive = goal != TransformState.HiddenPos;

-		Vector3 worldPosition = ServerPosition;
+		Vector3 worldPosition = serverState.WorldPosition;
 		Vector3 moveDelta;

 		if ( !isRecursive ) {//Normal delta if not recursive


# UI Improvement for Logistics: - Transporter Payment Request (Transporters having active order list) View

--- Web/Areas/Logistics/Views/TransporterPaymentRequest/Index.cshtml
+++ Web/Areas/Logistics/Views/TransporterPaymentRequest/Index.cshtml
@@ -6,12 +6,31 @@

 @{
     ViewBag.Title = "Index";
-    Layout = "~/Views/Shared/_MainLayout.cshtml";
+    //Layout = "~/Views/Shared/_MainLayout.cshtml";
+    Layout = "~/Views/Shared/NewTheme _MainLayout.cshtml";
+    ViewBag.PageTitle = Html.Translate("Transporters Having Active Order");
+    ViewBag.PageTitleDescription = "";
 }

-
@Html.Translate("Having Active Order")

+

+

+

+
+             @Html.Translate("Transporters having active order")
+
+

+        @*

+
+
+
*@
+

+
+

+

+

+

-@(Html.Kendo().Grid<TransporterViewModel>()
+            @(Html.Kendo().Grid<TransporterViewModel>()
     .Name("grid")
     .Columns(columns =>
     {
@@ -21,14 +40,21 @@
         columns.Bound(p => p.BidContract).Title(Html.Translate("Bid Number"));
         //columns.Command(command => command.Custom("SignContract").Click("OnSignContract"));
     })
-    //.Editable(editable => editable.Mode(GridEditMode.InCell))
+                    //.Editable(editable => editable.Mode(GridEditMode.InCell))
     .Scrollable()
     .Sortable()
-    .Filterable()
+            .Filterable()
+            .TableHtmlAttributes(new { @class = "table table-condensed " })
     .DataSource(dataSource => dataSource
             .Ajax()
-            //.PageSize(8)
-            //.Model(model => model.Id(p => p.WoredaHubID))
+        //.PageSize(8)
+        //.Model(model => model.Id(p => p.WoredaHubID))
             .Read(read => read.Action("BidWinningTransporters_read", "TransporterPaymentRequest"))
     )
-)
+            )
+

+

+

+


C#: Fix PR review findings in NamespaceDeclaration

--- csharp/extractor/Semmle.Extraction.CSharp/Entities/NamespaceDeclaration.cs
+++ csharp/extractor/Semmle.Extraction.CSharp/Entities/NamespaceDeclaration.cs
@@ -8,7 +8,7 @@

 namespace Semmle.Extraction.CSharp.Entities
 {
-    class NamespaceDeclaration : CachedEntity<NamespaceDeclarationSyntax>
+    internal class NamespaceDeclaration : CachedEntity<NamespaceDeclarationSyntax>
     {
         private readonly NamespaceDeclaration parent;
         private readonly NamespaceDeclarationSyntax node;
@@ -49,10 +49,10 @@
         public static NamespaceDeclaration Create(Context cx, NamespaceDeclarationSyntax decl, NamespaceDeclaration parent)
         {
             var init = (decl, parent);
-            return NamespaceDeclarationFactory.Instance.CreateEntity(cx, init, init);
+            return NamespaceDeclarationFactory.Instance.CreateEntity(cx, decl, init);
         }

-        class NamespaceDeclarationFactory : ICachedEntityFactory<(NamespaceDeclarationSyntax decl, NamespaceDeclaration parent), NamespaceDeclaration>
+        private class NamespaceDeclarationFactory : ICachedEntityFactory<(NamespaceDeclarationSyntax decl, NamespaceDeclaration parent), NamespaceDeclaration>
         {
             public static readonly NamespaceDeclarationFactory Instance = new NamespaceDeclarationFactory();


fixed named pipes interpretation

fixed named pipes interpretation

--- bin/projects/dbatools/dbatools/Parameter/DbaInstanceParameter.cs
+++ bin/projects/dbatools/dbatools/Parameter/DbaInstanceParameter.cs
@@ -268,6 +268,8 @@
                 {
                     throw new ArgumentException(String.Format("Failed to interpret named pipe path notation: {0} | {1}", InputObject, e.Message), e);
                 }
+
+                return;
             }

             // Connection String interpretation


Added another catch.

Added another catch.

--- bin/projects/dbatools/dbatools/Parameter/DbaInstanceParameter.cs
+++ bin/projects/dbatools/dbatools/Parameter/DbaInstanceParameter.cs
@@ -310,6 +310,7 @@
                     throw;
                 }
             }
+            catch { }

             // Handle and clear protocols. Otherwise it'd make port detection unneccessarily messy
             if (Regex.IsMatch(tempString, "^TCP:", RegexOptions.IgnoreCase)) //TODO: Use case insinsitive String.BeginsWith()


Renamed the string parsing function of LLUUID to StringToBytes()

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

--- libsecondlife-cs/Types.cs
+++ libsecondlife-cs/Types.cs
@@ -78,12 +78,11 @@
         /// <summary>
         /// Parse the bytes for a LLUUID from a string
         /// </summary>
-        /// <param name="val">String containing 32 (or 36 with hyphon) character UUID</param>
-        /// <returns></returns>
-        protected static byte[] ParseByteArray(string val)
+        /// <param name="val">String containing 32 (or 36 with hyphens) character UUID</param>
+        /// <returns></returns>
+        protected static byte[] StringToBytes(string val)
         {
             if (val.Length == 36) val = val.Replace("-", "");
-
             if (val.Length != 32) throw new Exception("Malformed LLUUID: " + val);

             byte[] parseData = new byte[16];
@@ -104,7 +103,7 @@
         /// <example>LLUUID.Parse("11f8aa9c-b071-4242-836b-13b7abe0d489")</example>
         public static LLUUID Parse(string val)
         {
-            return new LLUUID(ParseByteArray(val), 0);
+            return new LLUUID(StringToBytes(val), 0);
         }

         /// <summary>
@@ -112,6 +111,9 @@
         /// </summary>
         /// <param name="val">A string representation of a UUID, case
         /// insensitive and can either be hyphenated or non-hyphenated</param>
+        /// <param name="result">Will contain the parsed UUID if successful,
+        /// otherwise null</param>
+        /// <returns>True if the string was successfully parse, otherwise false</returns>
         /// <example>LLUUID.TryParse("11f8aa9c-b071-4242-836b-13b7abe0d489", result)</example>
         public static bool TryParse(string val, out LLUUID result)
         {
@@ -126,7 +128,6 @@
                 return false;
             }
         }
-

         /// <summary>
         /// Returns the raw bytes for this UUID


Merging during rebase + fixing UI logic flow

--- AllReadyApp/Web-App/AllReady/Views/Manage/Index.cshtml
+++ AllReadyApp/Web-App/AllReady/Views/Manage/Index.cshtml
@@ -96,7 +96,7 @@
                         {
                             Add
                         }
-                        @if (!Model.IsPhoneNumberConfirmed)
+                        @if (!Model.IsPhoneNumberConfirmed && Model.PhoneNumber != null)
                         {

@@ -104,7 +104,7 @@

                                 allReady cannot send you SMS notifications until your phone number has been confirmed.

-                                Check your messages for your confirmation code.
+                                Please check your messages for your confirmation code.

                         }


Update ITest.cs

Update ITest.cs

--- ArchesFramework/Arches.BusinessLogic/Abstract/ITest.cs
+++ ArchesFramework/Arches.BusinessLogic/Abstract/ITest.cs
@@ -9,7 +9,7 @@
 {
     public interface ITest
     {
-		Test Find(Test test);
+	Test Find(Test test);
         List<Test> FindAll();
         void Insert(Test test);
         void Update(Test test);


Fix unwanted character in language deserialization

--- Assets/Scripts/Localization/SerializedNestedStrings.cs
+++ Assets/Scripts/Localization/SerializedNestedStrings.cs
@@ -103,6 +103,8 @@

 	public static SerializedNestedStrings deserialize(string serializedData)
 	{
+		serializedData = serializedData.Replace(((char)13).ToString(), "");	//Remove any instances of carriage return
+
 		List<string> lines = new List<string>(serializedData.Split('\n'));
 		SerializedNestedStrings newData = new SerializedNestedStrings();


Warnings

Warnings

--- Automatron/Assets/Automatron/Editor/Automations/WWW.cs
+++ Automatron/Assets/Automatron/Editor/Automations/WWW.cs
@@ -5,6 +5,7 @@
 using System;

 namespace TNRD.Automatron.Automations {
+#pragma warning disable 0649

     [Automation( "WWW/Audio Clip" )]
     public class WWWAudioClip : Automation {
@@ -103,4 +104,6 @@
             yield break;
         }
     }
-}+
+#pragma warning restore 0649
+}


Fix few locales were not working

Fix few locales were not working

--- AzureFunctions/Controllers/AzureFunctionsController.cs
+++ AzureFunctions/Controllers/AzureFunctionsController.cs
@@ -25,7 +25,10 @@
         {
             { "ja", "ja-JP"},
             { "ko", "ko-KR"},
-            { "sv", "sv-SE"}
+            { "sv", "sv-SE"},
+            { "cs", "cs-CZ"},
+            { "zh-hans", "zh-TW"},
+            { "zh-hant", "zh-CN"}
         };

         public AzureFunctionsController(ITemplatesManager templatesManager, ISettings settings)
@@ -56,22 +59,15 @@
             runtime = getClearRuntime(runtime);
             string portalFolder = "";
             string sdkFolder = "";
+            string languageFolder = name;
+
             if (name != "en")
             {
-                if (name.Length == 2)
-                {
-                    if (!_languageMap.TryGetValue(name, out portalFolder)) {
-                        portalFolder = name + "-" + name;
-                        sdkFolder = name + "-" + name;
-                    } else {
-                        sdkFolder = portalFolder;
-                    }
-                    portalFolder = Path.Combine(portalFolder, "AzureFunctions\\ResourcesPortal");
-                    sdkFolder = Path.Combine(sdkFolder, "Resources");
-                } else
-                {
-                    portalFolder = name;
-                }
+                if (!_languageMap.TryGetValue(name, out languageFolder)) {
+                    languageFolder = name + "-" + name;
+                }
+                portalFolder = Path.Combine(languageFolder, "AzureFunctions\\ResourcesPortal");
+                sdkFolder = Path.Combine(languageFolder, "Resources");
             }

             List<string> resxFiles = new List<string>();


Specify HintPath for all referenced assemblies (for mono support)

--- BenchmarkDotNet/Toolchains/Classic/ClassicGenerator.cs
+++ BenchmarkDotNet/Toolchains/Classic/ClassicGenerator.cs
@@ -95,12 +95,6 @@

         private string GetHintPath(Assembly loadedReferencedAssembly)
         {
-            if (loadedReferencedAssembly.GlobalAssemblyCache)
-            {
-                // there is no need to specify path if assembly was loaded from GAC
-                return string.Empty;
-            }
-
             // the assembly is loaded so we just give the absolute path
             return $"<HintPath>{loadedReferencedAssembly.Location}</HintPath>";
         }


Added feerate for the tumbler client transactions

--- Breeze/src/Breeze.TumbleBit.Client/ExternalServices.cs
+++ Breeze/src/Breeze.TumbleBit.Client/ExternalServices.cs
@@ -3,6 +3,7 @@
 using System.Text;
 using NBitcoin;
 using NTumbleBit;
+using Stratis.Bitcoin.MemoryPool;

 namespace Breeze.TumbleBit.Client
 {
@@ -33,7 +34,20 @@

         public FeeRate GetFeeRate()
         {
-            return null;
+            decimal relayFee = MempoolValidator.MinRelayTxFee.FeePerK.ToUnit(MoneyUnit.BTC);
+            var minimumRate = new FeeRate(Money.Coins(relayFee * 2), 1000); //0.00002000 BTC/kB
+            var fallbackFeeRate = new FeeRate(Money.Satoshis(50), 1);       //0.00050000 BTC/kB
+
+            // TODO add real fee estimation
+            //var rate = _RPCClient.TryEstimateFeeRate(1) ??
+            //           _RPCClient.TryEstimateFeeRate(2) ??
+            //           _RPCClient.TryEstimateFeeRate(3) ??
+            //           FallBackFeeRate;
+
+            //if (rate < MinimumFeeRate)
+            //    rate = MinimumFeeRa
+
+            return fallbackFeeRate;
         }
     }
 }


Added tests to detect parameter flaws

Added tests to detect parameter flaws

--- src/Mages.Core.Tests/InvalidInputTests.cs
+++ src/Mages.Core.Tests/InvalidInputTests.cs
@@ -171,6 +171,46 @@
         }

         [Test]
+        public void ListOfParameterNamesCanBeRetrievedIfAssignmentIsBroken()
+        {
+            var expr = "(x = , y = 3) => x".ToExpression();
+            Assert.IsInstanceOf<FunctionExpression>(expr);
+            var parameters = ((FunctionExpression)expr).Parameters;
+            CollectionAssert.AreEquivalent(new[] { "x", "y" }, parameters.Names);
+            IsInvalid(expr);
+        }
+
+        [Test]
+        public void ListOfParameterNamesCanBeRetrievedIfBodyIsMissing()
+        {
+            var expr = "(x,y,z) => {".ToExpression();
+            Assert.IsInstanceOf<FunctionExpression>(expr);
+            var parameters = ((FunctionExpression)expr).Parameters;
+            CollectionAssert.AreEquivalent(new[] { "x", "y", "z" }, parameters.Names);
+            IsInvalid(expr);
+        }
+
+        [Test]
+        public void ListOfParameterNamesCanBeRetrievedIfInvalidArgumentSpecified()
+        {
+            var expr = "(x,0,z) => {}".ToExpression();
+            Assert.IsInstanceOf<FunctionExpression>(expr);
+            var parameters = ((FunctionExpression)expr).Parameters;
+            CollectionAssert.AreEquivalent(new[] { "x", null, "z" }, parameters.Names);
+            IsInvalid(expr);
+        }
+
+        [Test]
+        public void ListOfParameterNamesCanBeRetrievedIfArgumentIsMissing()
+        {
+            var expr = "(x,,z) => {}".ToExpression();
+            Assert.IsInstanceOf<FunctionExpression>(expr);
+            var parameters = ((FunctionExpression)expr).Parameters;
+            CollectionAssert.AreEquivalent(new[] { "x", null, "z" }, parameters.Names);
+            IsInvalid(expr);
+        }
+
+        [Test]
         public void PatternMatchingWithMissingReferenceShouldFail()
         {
             var stmt = "match() { }".ToStatement();


fixed media config type

fixed media config type

--- src/MediaServer/Configuration/Settings.cs
+++ src/MediaServer/Configuration/Settings.cs
@@ -144,7 +144,7 @@
 		{
 			Network = new NetworkConfiguration();
 			Icons = new IconConfiguration();
-			Media = new List<Directory>();
+			Media = new List<NamedPathMediaElememnt>();
 		}

 		public NetworkConfiguration Network { get; private set; }
@@ -155,7 +155,7 @@
 			XmlElement(typeof(iTunes), ElementName="iTunes"),
 			XmlElement(typeof(iPhoto), ElementName="iPhoto")
 		]
-		public List<Directory> Media { get; private set; }
+		public List<NamedPathMediaElememnt> Media { get; private set; }
 	}

 	sealed class Settings


#9

#9

task extension methods defined.

--- Dot.Net.DevFast/Dot.Net.DevFast/Extensions/TaskExts.cs
+++ Dot.Net.DevFast/Dot.Net.DevFast/Extensions/TaskExts.cs
@@ -11,172 +11,129 @@
     /// </summary>
     public static class TaskExts
     {
-        ///// <summary>
-        ///// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="actions"/> while respecting the
-        ///// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, this loop will span more tasks
-        ///// then specified by <paramref name="maxConcurrency"/>).
-        ///// </summary>
-        ///// <param name="actions">collection of actions to execute and await on</param>
-        ///// <param name="maxConcurrency">max number of tasks to span at a given time.</param>
-        ///// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="actions"/></param>
-        ///// <returns></returns>
-        //public static Task RepeatNAwaitAllTask(this IEnumerable<Action<CancellationToken>> actions,
-        //    int maxConcurrency, CancellationToken token = default(CancellationToken))
-        //{
-        //    return Task.Run(async () => await actions.RepeatNAwaitAllAsync(maxConcurrency, token).ConfigureAwait(false),
-        //        token);
-        //}
-
-        ///// <summary>
-        ///// Creates and awaits on tasks generated during enumeration on <paramref name="actions"/> while respecting the
-        ///// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, this loop will span more tasks
-        ///// then specified by <paramref name="maxConcurrency"/>).
-        ///// </summary>
-        ///// <param name="actions">collection of actions to execute and await on</param>
-        ///// <param name="maxConcurrency">max number of tasks to span.</param>
-        ///// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="actions"/></param>
-        ///// <returns></returns>
-        //public static async Task RepeatNAwaitAllAsync(this IEnumerable<Action<CancellationToken>> actions,
-        //    int maxConcurrency, CancellationToken token = default(CancellationToken))
-        //{
-        //    using (var etor = actions.GetEnumerator())
-        //    {
-        //        await etor.CreateLoop(new object()).RepeatNAwaitAllAsync(maxConcurrency, token)
-        //            .ConfigureAwait(false);
-        //    }
-        //}
-
-        ///// <summary>
-        ///// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="funcs"/> while respecting the
-        ///// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, this loop will span more tasks
-        ///// then specified by <paramref name="maxConcurrency"/>).
-        ///// </summary>
-        ///// <param name="funcs">collection of functions to execute and await on</param>
-        ///// <param name="maxConcurrency">max number of tasks to span at a given time.</param>
-        ///// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="funcs"/></param>
-        ///// <returns></returns>
-        //public static Task RepeatNAwaitAllTask(this IEnumerable<Func<CancellationToken, Task>> funcs,
-        //    int maxConcurrency, CancellationToken token = default(CancellationToken))
-        //{
-        //    return Task.Run(async () => await funcs.RepeatNAwaitAllAsync(maxConcurrency, token).ConfigureAwait(false),
-        //        token);
-        //}
-
-        ///// <summary>
-        ///// Creates and awaits on tasks generated during enumeration on <paramref name="funcs"/> while respecting the
-        ///// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, this loop will span more tasks
-        ///// then specified by <paramref name="maxConcurrency"/>).
-        ///// </summary>
-        ///// <param name="funcs">collection of functions to execute and await on</param>
-        ///// <param name="maxConcurrency">max number of tasks to span.</param>
-        ///// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="funcs"/></param>
-        ///// <returns></returns>
-        //public static async Task RepeatNAwaitAllAsync(this IEnumerable<Func<CancellationToken, Task>> funcs,
-        //    int maxConcurrency, CancellationToken token = default(CancellationToken))
-        //{
-        //    using (var etor = funcs.GetEnumerator())
-        //    {
-        //        await etor.CreateLoop(new object()).RepeatNAwaitAllAsync(maxConcurrency, token, false)
-        //            .ConfigureAwait(false);
-        //    }
-        //}
-
         /// <summary>
-        /// Creates and awaits on all the repeatated tasks (as specified by <paramref name="count"/>)
+        /// Creates and returns a wrapped task that awaits on all concurrent tasks created by repeatatively (as specified by <paramref name="count"/>)
         /// executing the given <paramref name="action"/>.
         /// </summary>
-        /// <param name="action">action to repeat</param>
-        /// <param name="count">number of times <paramref name="action"/> needs to be repeated</param>
-        /// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="action"/></param>
-        public static async Task RepeatNAwaitAllAsync(this Action<int, CancellationToken> action, int count,
+        /// <param name="action">action to repeat. The first <seealso cref="int"/> argument is the ith value (starting with 0) of the repeatation</param>
+        /// <param name="count">number of times <paramref name="action"/> needs to be repeated (possible min value: 1)</param>
+        /// <param name="token">Cancellation token, if any. This cancellation token is passed to <paramref name="action"/></param>
+        public static Task WhenAll(this Action<int, CancellationToken> action, int count,
             CancellationToken token = default(CancellationToken))
         {
-            await action.RepeatNAwaitAllTask(count, token).ConfigureAwait(false);
+            return action.ToAsync(false).WhenAll(count, token);
         }

         /// <summary>
-        /// Creates and returns a wrapped task that awaits on all the repeatated tasks (as specified by <paramref name="count"/>)
-        /// executing the given <paramref name="action"/>.
+        /// Creates and returns a wrapped task that awaits on all consurrent tasks created by repeatatively (as specified by <paramref name="count"/>)
+        /// executing the given <paramref name="func"/>.
         /// </summary>
-        /// <param name="action">action to repeat</param>
-        /// <param name="count">number of times <paramref name="action"/> needs to be repeated</param>
-        /// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="action"/></param>
-        public static Task RepeatNAwaitAllTask(this Action<int, CancellationToken> action, int count,
+        /// <param name="func">function to repeat. The first <seealso cref="int"/> argument is the ith value (starting with 0) of the repeatation</param>
+        /// <param name="count">number of times <paramref name="func"/> needs to be repeated (possible min value: 1)</param>
+        /// <param name="token">Cancellation token, if any. This cancellation token is passed to <paramref name="func"/></param>
+        public static Task WhenAll(this Func<int, CancellationToken, Task> func, int count,
             CancellationToken token = default(CancellationToken))
         {
-            return action.ToAsync(true).RepeatNAwaitAllTask(count, token, false);
+            return func.Repeat(count.ThrowIfLess(1, "repeatation count value is less than 1"))
+                .WhenAll(count, token);
         }

         /// <summary>
-        /// Creates and awaits on repeatated tasks (as specified by <paramref name="count"/>) executing the given
-        /// <paramref name="func"/>.
+        /// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="actions"/> while respecting the
+        /// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, enumeration will span more tasks
+        /// then specified by <paramref name="maxConcurrency"/>).
         /// </summary>
-        /// <param name="func">function to repeat</param>
-        /// <param name="count">number of times <paramref name="func"/> needs to be repeated</param>
-        /// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="func"/></param>
-        /// <param name="asyncFunc">When true, each instance of <paramref name="func"/> will run in a dedicated task.</param>
-        public static async Task RepeatNAwaitAllAsync(this Func<int, CancellationToken, Task> func, int count,
-            CancellationToken token = default(CancellationToken), bool asyncFunc = true)
+        /// <param name="actions">collection of actions to execute and await on</param>
+        /// <param name="maxConcurrency">maximum number of task to span (possible min value: 1)</param>
+        /// <param name="token">Cancellation token, if any. This cancellation token is passed to <paramref name="actions"/></param>
+        public static Task WhenAll(this IEnumerable<Action<CancellationToken>> actions,
+            int maxConcurrency, CancellationToken token = default(CancellationToken))
         {
-            await func.RepeatNAwaitAllTask(count, token, asyncFunc).ConfigureAwait(false);
+            return actions.Select(x => x.ToAsync(false)).WhenAll(maxConcurrency, token);
         }

         /// <summary>
-        /// Creates and returns a wrapped task that awaits on all the repeatated tasks (as specified by <paramref name="count"/>)
-        /// executing the given <paramref name="func"/>.
+        /// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="funcs"/> while respecting the
+        /// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, enumeration will span more tasks
+        /// then specified by <paramref name="maxConcurrency"/>).
         /// </summary>
-        /// <param name="func">function to repeat</param>
-        /// <param name="count">number of times <paramref name="func"/> needs to be repeated</param>
-        /// <param name="token">Cancellation token, if any. This cancellation token is also passed to <paramref name="func"/></param>
-        /// <param name="asyncFunc">When true, each instance of <paramref name="func"/> will run in a dedicated task.</param>
-        public static Task RepeatNAwaitAllTask(this Func<int, CancellationToken, Task> func, int count,
-            CancellationToken token = default(CancellationToken), bool asyncFunc = true)
+        /// <param name="funcs">collection of functions to execute and await on</param>
+        /// <param name="maxConcurrency">maximum number of task to span (possible min value: 1)</param>
+        /// <param name="token">Cancellation token, if any. This cancellation token is passed to <paramref name="funcs"/></param>
+        public static Task WhenAll(this IEnumerable<Func<CancellationToken, Task>> funcs,
+            int maxConcurrency, CancellationToken token = default(CancellationToken))
         {
-            var tasks = new Task[count.ThrowIfLess(1, "repeatation count cannot be less than 1")];
+            return funcs.Select(x => new Func<Task>(() => x(token))).WhenAll(maxConcurrency);
+        }
+
+        /// <summary>
+        /// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="actions"/> while respecting the
+        /// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, enumeration will span more tasks
+        /// then specified by <paramref name="maxConcurrency"/>).
+        /// </summary>
+        /// <param name="actions">collection of actions to execute and await on</param>
+        /// <param name="maxConcurrency">maximum number of task to span (possible min value: 1)</param>
+        public static Task WhenAll(this IEnumerable<Action> actions, int maxConcurrency)
+        {
+            return actions.Select(x => x.ToAsync(false)).WhenAll(maxConcurrency);
+        }
+
+        /// <summary>
+        /// Creates and returns a wrapped task that awaits on tasks generated during enumeration on <paramref name="funcs"/> while respecting the
+        /// concurrency as specified by <paramref name="maxConcurrency"/> (i.e. at no time, enumeration will span more tasks
+        /// then specified by <paramref name="maxConcurrency"/>).
+        /// </summary>
+        /// <param name="funcs">collection of functions to execute and await on</param>
+        /// <param name="maxConcurrency">maximum number of task to span (possible min value: 1)</param>
+        public static Task WhenAll(this IEnumerable<Func<Task>> funcs, int maxConcurrency)
+        {
+            maxConcurrency.ThrowIfLess(1, "concurrency value is less than 1");
+            var etor = funcs.GetEnumerator();
+            return etor.Loop(new object()).RepeatNWhenAll(maxConcurrency).WithDispose(etor);
+        }
+
+        private static IEnumerable<Func<CancellationToken, Task>> Repeat(this Func<int, CancellationToken, Task> func,
+            int count)
+        {
             for (var i = 0; i < count; i++)
             {
-                tasks[i] = asyncFunc ? func.WrappedTask(i, token) : func(i, token).StartIfNeeded();
+                yield return func.InnerFunc(i);
             }
-            return Task.WhenAll(tasks);
         }

-        private static Task WrappedTask(this Func<int, CancellationToken, Task> func, int i,
-            CancellationToken token)
+        private static Func<CancellationToken, Task> InnerFunc(this Func<int, CancellationToken, Task> func, int i)
         {
-            return Task.Run(() => func(i, token), CancellationToken.None);
+            return t => func(i, t);
         }

-        private static Func<CancellationToken, Task> CreateLoop(
-            this IEnumerator<Func<int, CancellationToken, Task>> funcs, object syncRoot, int i)
+        private static Func<Task> Loop(this IEnumerator<Func<Task>> funcs, object syncRoot)
         {
-            return t => Task.Run(async () =>
+            return () => Task.Run(async () =>
             {
                 while (funcs.TryGetNext(syncRoot, out var next))
                 {
-                    await next(i, t).StartIfNeeded().ConfigureAwait(false);
+                    await next().StartIfNeeded().ConfigureAwait(false);
                 }
-            }, t);
+            });
         }

-        private static Action<CancellationToken> CreateLoop(
-            this IEnumerator<Action<int, CancellationToken>> actions, object syncRoot, int i)
+        private static Task RepeatNWhenAll(this Func<Task> func, int count)
         {
-            return t =>
+            var tasks = new Task[count];
+            for (var i = 0; i < count; i++)
             {
-                while (actions.TryGetNext(syncRoot, out var next))
-                {
-                    next(i, t);
-                }
-            };
+                tasks[i] = func();
+            }
+            return Task.WhenAll(tasks);
         }

-        private static bool TryGetNext<T>(this IEnumerator<T> funcs, object syncRoot, out T obj)
+        private static bool TryGetNext<T>(this IEnumerator<T> enumerator, object syncRoot, out T obj)
         {
             lock (syncRoot)
             {
-                if (funcs.MoveNext())
+                if (enumerator.MoveNext())
                 {
-                    obj = funcs.Current;
+                    obj = enumerator.Current;
                     return true;
                 }
                 obj = default(T);
@@ -189,5 +146,15 @@
             if (task.Status == TaskStatus.Created) task.Start();
             return task;
         }
+
+        private static Task WithDispose(this Task parent, IDisposable disposeIt)
+        {
+            return parent.ContinueWith(t =>
+            {
+                using (disposeIt)
+                {
+                }
+            });
+        }
     }
 }


Simplify ReadNextRequest.

Simplify ReadNextRequest.

--- src/Package/Impl/Repl/Session/RSession.cs
+++ src/Package/Impl/Repl/Session/RSession.cs
@@ -148,10 +148,8 @@
             TaskCompletionSource<string> requestTcs = new TaskCompletionSource<string>();
             _currentRequestSources.Push(requestSource);
             requestSource.Request(prompt, len, requestTcs);
-
-            // Cancel immediately if ct is canceled, even if request is not handled yet.
-            // Disconnected handler will run next and take care of cleaning the queue.
-            await Task.WhenAny(requestTcs.Task, Task.Delay(Timeout.Infinite, ct)).Unwrap();
+            ct.Register(delegate { requestTcs.TrySetCanceled(); });
+
             string response = await requestTcs.Task;

             Debug.Assert(response.Length < len); // len includes null terminator


impl conv string -> array key

impl conv string -> array key

- has to convert string with number to numeric key

--- src/Peachpie.Runtime/OrderedDictionary.cs
+++ src/Peachpie.Runtime/OrderedDictionary.cs
@@ -79,7 +79,7 @@

         public static implicit operator IntStringKey(int value) => new IntStringKey(value);

-        public static implicit operator IntStringKey(string value) => new IntStringKey(value ?? throw new ArgumentNullException());
+        public static implicit operator IntStringKey(string value) => value != null ? Convert.StringToArrayKey(value) : EmptyStringKey;

         public static implicit operator IntStringKey(PhpString value) => new IntStringKey(value.ToString());


prevent data loss.

prevent data loss.

--- src/Sanderling/Sanderling.Exe/App.xaml.cs
+++ src/Sanderling/Sanderling.Exe/App.xaml.cs
@@ -212,6 +212,8 @@
 			}

 			Bib3.FCL.GBS.Extension.MessageBoxException(e.Exception);
+
+			e.Handled = true;
 		}
 	}
 }


Pull common code into separate method

Pull common code into separate method

--- src/Scrutor/ImplementationTypeSelector.cs
+++ src/Scrutor/ImplementationTypeSelector.cs
@@ -84,11 +84,7 @@

         public IServiceTypeSelector AddClasses(bool publicOnly)
         {
-            var selector = new ServiceTypeSelector(this, GetNonAbstractClasses(publicOnly));
-
-            Selectors.Add(selector);
-
-            return selector;
+            return AddSelector(GetNonAbstractClasses(publicOnly));
         }

         public IServiceTypeSelector AddClasses(Action<IImplementationTypeFilter> action)
@@ -107,11 +103,7 @@

             action(filter);

-            var selector = new ServiceTypeSelector(this, filter.Types);
-
-            Selectors.Add(selector);
-
-            return selector;
+            return AddSelector(filter.Types);
         }

         void ISelector.Populate(IServiceCollection services)
@@ -127,6 +119,15 @@
             }
         }

+        private IServiceTypeSelector AddSelector(IEnumerable<Type> types)
+        {
+            var selector = new ServiceTypeSelector(this, types);
+
+            Selectors.Add(selector);
+
+            return selector;
+        }
+
         private IEnumerable<Type> GetNonAbstractClasses(bool publicOnly)
         {
             return Types.Where(t => t.IsNonAbstractClass(publicOnly));