Fixed bug where several folders in content path didnt exist

--- Sherpa.Library/SiteHierarchy/ContentUploadManager.cs
+++ Sherpa.Library/SiteHierarchy/ContentUploadManager.cs
@@ -51,12 +51,13 @@
                 context.Load(web, w => w.ServerRelativeUrl);
                 context.ExecuteQuery();

-                var rootFolderServerRelativeUrl = Url.Combine(web.ServerRelativeUrl, contentFolder.ListUrl);
-                rootFolder = web.GetFolderByServerRelativeUrl(rootFolderServerRelativeUrl);
+                var listUrl = Url.Combine(web.ServerRelativeUrl, contentFolder.ListUrl);
+                rootFolder = web.GetFolderByServerRelativeUrl(listUrl);
                 context.Load(rootFolder);
                 context.ExecuteQuery();

-                uploadTargetFolder = Url.Combine(rootFolderServerRelativeUrl, contentFolder.FolderUrl);
+
+                uploadTargetFolder = Url.Combine(listUrl, contentFolder.FolderUrl);
             } else if (!string.IsNullOrEmpty(contentFolder.ListName))
             {
                 var assetLibrary = web.Lists.GetByTitle(contentFolder.ListName);
@@ -73,21 +74,9 @@

             var configRootFolder = Path.Combine(_contentDirectoryPath, contentFolder.FolderName);

-            if (!web.DoesFolderExists(uploadTargetFolder))
-            {
-                web.Folders.Add(uploadTargetFolder);
-            }
-            context.ExecuteQuery();
-
-            foreach (string folder in Directory.GetDirectories(configRootFolder, "*", SearchOption.AllDirectories))
-            {
-                var folderName = Url.Combine(uploadTargetFolder, folder.Replace(configRootFolder, "").Replace("\\", "/"));
-                if (!web.DoesFolderExists(folderName))
-                {
-                    web.Folders.Add(folderName);
-                }
-            }
-            context.ExecuteQuery();
+            EnsureTargetFolder(context, web, rootFolder.ServerRelativeUrl, contentFolder, uploadTargetFolder);
+
+            EnsureAllContentFolders(context, web, configRootFolder, uploadTargetFolder);

             List<ShFileProperties> filePropertiesCollection = null;
             if (!string.IsNullOrEmpty(contentFolder.PropertiesFile))
@@ -140,6 +129,39 @@
                 LastUpload.Add(contentFolder.FolderName, DateTime.UtcNow);
             }

+        }
+
+        private static void EnsureAllContentFolders(ClientContext context, Web web, string configRootFolder,
+            string uploadTargetFolder)
+        {
+            foreach (string folder in Directory.GetDirectories(configRootFolder, "*", SearchOption.AllDirectories))
+            {
+                var folderName = Url.Combine(uploadTargetFolder, folder.Replace(configRootFolder, "").Replace("\\", "/"));
+                if (!web.DoesFolderExists(folderName))
+                {
+                    web.Folders.Add(folderName);
+                }
+            }
+            context.ExecuteQuery();
+        }
+
+        private void EnsureTargetFolder(ClientContext context, Web web, string listUrl, string contentFolderUrl,
+            string uploadTargetFolder)
+        {
+            if (!web.DoesFolderExists(uploadTargetFolder))
+            {
+                var folderPaths = contentFolderUrl.Split('/');
+                var folderUrl = listUrl;
+                foreach (var folder in folderPaths)
+                {
+                    folderUrl = Url.Combine(folderUrl, folder);
+                    if (!web.DoesFolderExists(folderUrl))
+                    {
+                        web.Folders.Add(folderUrl);
+                        context.ExecuteQuery();
+                    }
+                }
+            }
         }

         private void UploadAndPublishSingleFile(ClientContext context, Web web, string configRootFolder, ShContentFolder contentFolder, string uploadTargetFolder, Folder rootFolder, List<ShFileProperties> filePropertiesCollection, string filePath)


Made lock static

Made lock static

--- SignalR.RabbitMQ/UniqueMessageIdentifierGenerator.cs
+++ SignalR.RabbitMQ/UniqueMessageIdentifierGenerator.cs
@@ -30,9 +30,9 @@
     internal class UniqueMessageIdentifierGenerator
     {
         private static ulong _lastSeenMessageIdentifier;
+        private static readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();
         private readonly TraceSource _trace;
-        private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();
-
+
         public UniqueMessageIdentifierGenerator(IDependencyResolver resolver)
         {
             var traceManager = resolver.Resolve<ITraceManager>();
@@ -74,7 +74,6 @@
                 if (toReturn <= _lastSeenMessageIdentifier)
                 {
                     var latest = _lastSeenMessageIdentifier++;
-                    _lastSeenMessageIdentifier = latest;
                     _trace.TraceEvent(TraceEventType.Information, 0, string.Format("Returning incremented {0}.", latest));
                     return latest;
                 }


GetDashboard by Owner

GetDashboard by Owner

--- Signum.Engine.Extensions/Dashboard/DashboardLogic.cs
+++ Signum.Engine.Extensions/Dashboard/DashboardLogic.cs
@@ -186,12 +186,24 @@

             var result = Dashboards.Value.Values
                 .Where(d =>
-                    d.ForNavbar == forNavbar
+                d.Owner != null && d.Owner.RefersTo(UserEntity.Current)
+                  && d.ForNavbar == forNavbar
                      && (!key.HasText() || d.Key == key)
                     && d.EntityType == null && d.DashboardPriority.HasValue && isAllowed(d))
                 .OrderByDescending(a => a.DashboardPriority)
                 .FirstOrDefault();

+
+
+            if (result == null)
+                result = Dashboards.Value.Values
+                   .Where(d =>
+                       d.ForNavbar == forNavbar
+                        && (!key.HasText() || d.Key == key)
+                       && d.EntityType == null && d.DashboardPriority.HasValue && isAllowed(d))
+                   .OrderByDescending(a => a.DashboardPriority)
+                   .FirstOrDefault();
+
             return result;
         }


Gate the access to _tokenSource

Gate the access to _tokenSource

--- src/VisualStudio/Core/Def/Packaging/PackageInstallerServiceFactory.cs
+++ src/VisualStudio/Core/Def/Packaging/PackageInstallerServiceFactory.cs
@@ -127,7 +127,14 @@

         private async Task<ImmutableArray<PackageSource>?> GetPackageSourcesImplAsync()
         {
-            var cancellationToken = _tokenSource.Token;
+            CancellationToken cancellationToken;
+            lock (_gate)
+            {
+                // Read the current cancellation token within the gate to ensure the token source is not disposed at the
+                // time of the read.
+                cancellationToken = _tokenSource.Token;
+            }
+
             try
             {
                 await ThreadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);


Modified local function

Modified local function

--- Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
+++ Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
@@ -15,7 +15,7 @@

         static void SelectNumbers(List<int> numbers, Func<int, bool> filterCriteria)
         {
-            foreach(var number in numbers)
+            foreach (var number in numbers)
             {
                 var output = filterCriteria(number);
                 WriteLine($"{number} = {output} ");
@@ -67,14 +67,17 @@
         static void Main(string[] args)
         {
             var numbers = new List<int> { 3, 8, 4, 6, 1, 7, 5, 2, 9, 10 };
-
+
             ForegroundColor = ConsoleColor.Yellow;

             // Local functions
             void printAction(int data) => WriteLine(data);
             void printAction1(string data) => WriteLine(data);

-            void printActionGeneric<T>(T data) => WriteLine(data);
+            void printActionGeneric<T>(T data)
+            {
+                WriteLine(data);
+            }

             PrintData(printActionGeneric, "Shiva Sai");
             PrintData(printActionGeneric, 125);
@@ -87,19 +90,23 @@
             PrintData(printAction, 125);
             PrintData(printAction1, "Shiva Sai");

-            PrintData(data => {
+            PrintData(data =>
+            {
                 WriteLine(data);
             }, 123.56f);

-            PrintData(data => {
+            PrintData(data =>
+            {
                 WriteLine(data);
             }, true);

-            PrintData(data => {
+            PrintData(data =>
+            {
                 WriteLine(data);
             }, 'A');

-            PrintData(data => {
+            PrintData(data =>
+            {
                 WriteLine(data);
             }, DateTime.Now);

@@ -147,7 +154,7 @@
             int outNumber = 0;
             object[] parametersArray = new object[] { "12", null };
             var output = ((MethodInfo)tryParseMethod[0]).Invoke(dataType, parametersArray);
-            if((bool)output)
+            if ((bool)output)
             {
                 WriteLine($"Parsed Number: {parametersArray[1]}");
             }
@@ -199,7 +206,7 @@
             person = null;
             WriteLine($"Name [Null-Condition and null coalescing]: {person?.Name ?? "No Name"}");

-            SelectNumbers(numbers, x => (x%2 == 0));
+            SelectNumbers(numbers, x => (x % 2 == 0));

             WriteLine($"Selecting number which are divided by 2");
             SelectValues(numbers, e => e % 2 == 0);
@@ -207,7 +214,7 @@
             WriteLine($"Selecting number which are divided by 3");
             SelectValues(numbers, e => e % 3 == 0);

-
+

             WriteLine("\n\nPress any key ...");
             Read();


ScadaWeb: dev

ScadaWeb: dev

--- ScadaWeb/ScadaWebCommon5Beta/Shell/UserContent.cs
+++ ScadaWeb/ScadaWebCommon5Beta/Shell/UserContent.cs
@@ -228,9 +228,44 @@
         }

         /// <summary>
+        /// Получить элемент отчёта, имеющий спецификацию заданного типа, по идентификатору
+        /// </summary>
+        public ReportItem GetReportItem(int reportID, Type specType, bool throwOnFail = false)
+        {
+            ReportItem reportItem = GetReportItem(reportID);
+
+            if (reportItem == null)
+            {
+                if (throwOnFail)
+                    throw new ScadaException("!!!");
+                else
+                    return null;
+            }
+            else if (reportItem.ReportSpec == null || reportItem.ReportSpec.GetType() != specType)
+            {
+                if (throwOnFail)
+                    throw new ScadaException("!!!");
+                else
+                    return null;
+            }
+            else
+            {
+                return reportItem;
+            }
+        }
+
+        /// <summary>
         /// Получить элемент окна данных по идентификатору
         /// </summary>
         public DataWndItem GetDataWndItem(int dataWndID)
+        {
+            throw new NotImplementedException();
+        }
+
+        /// <summary>
+        /// Получить элемент окна данных, имеющий спецификацию заданного типа, по идентификатору
+        /// </summary>
+        public DataWndItem GetDataWndItem(int dataWndID, bool throwOnFail = false)
         {
             throw new NotImplementedException();
         }


(maint) Fixing CodeAnalysis errors

(maint) Fixing CodeAnalysis errors

--- Source/ChocolateyGui/ViewModels/SettingsViewModel.cs
+++ Source/ChocolateyGui/ViewModels/SettingsViewModel.cs
@@ -156,7 +156,7 @@
             {
                 await _packageService.SetFeature(feature);
             }
-            catch (UnauthorizedAccessException ex)
+            catch (UnauthorizedAccessException)
             {
                 // TODO: Needs to be put in resource section
                 await _progressService.ShowMessageAsync(
@@ -207,7 +207,7 @@
                 _originalId = SelectedSource?.Id;
                 await _eventAggregator.PublishOnUIThreadAsync(new SourcesUpdatedMessage());
             }
-            catch (UnauthorizedAccessException ex)
+            catch (UnauthorizedAccessException)
             {
                 // TODO: Needs to be put in resource section
                 await _progressService.ShowMessageAsync(
@@ -230,7 +230,7 @@
                 SelectedSource = null;
                 await _eventAggregator.PublishOnUIThreadAsync(new SourcesUpdatedMessage());
             }
-            catch (UnauthorizedAccessException ex)
+            catch (UnauthorizedAccessException)
             {
                 // TODO: Needs to be put in resource section
                 await _progressService.ShowMessageAsync(


[Toolkit.Graphics] Fix image.Dispose for DDS loading

--- Source/Toolkit/SharpDX.Toolkit.Graphics/DDSHelper.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/DDSHelper.cs
@@ -1172,7 +1172,12 @@
             }

             // Return the imageDst or the original image
-            return isCopyNeeded ? imageDst : image;
+            if (isCopyNeeded)
+            {
+                image.Dispose();
+                image = imageDst;
+            }
+            return image;
         }


spinlock in completion registry is slightly faster

--- src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
+++ src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
@@ -19,7 +19,9 @@
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Runtime.InteropServices;
+using System.Threading;
 using Grpc.Core.Logging;
 using Grpc.Core.Utils;

@@ -35,7 +37,7 @@

         readonly GrpcEnvironment environment;
         readonly Dictionary<IntPtr, IOpCompletionCallback> dict = new Dictionary<IntPtr, IOpCompletionCallback>(new IntPtrComparer());
-        readonly object myLock = new object();
+        SpinLock spinLock = new SpinLock(Debugger.IsAttached);
         IntPtr lastRegisteredKey;  // only for testing

         public CompletionRegistry(GrpcEnvironment environment)
@@ -46,10 +48,18 @@
         public void Register(IntPtr key, IOpCompletionCallback callback)
         {
             environment.DebugStats.PendingBatchCompletions.Increment();
-            lock (myLock)
+
+            bool lockTaken = false;
+            try
             {
+                spinLock.Enter(ref lockTaken);
+
                 dict.Add(key, callback);
                 this.lastRegisteredKey = key;
+            }
+            finally
+            {
+                if (lockTaken) spinLock.Exit();
             }
         }

@@ -68,10 +78,17 @@
         public IOpCompletionCallback Extract(IntPtr key)
         {
             IOpCompletionCallback value = null;
-            lock (myLock)
+            bool lockTaken = false;
+            try
             {
+                spinLock.Enter(ref lockTaken);
+
                 value = dict[key];
                 dict.Remove(key);
+            }
+            finally
+            {
+                if (lockTaken) spinLock.Exit();
             }
             environment.DebugStats.PendingBatchCompletions.Decrement();
             return value;


Updated test count.

Updated test count.

--- Sensus.Tests.AppCenter.Shared/UnitTestsFixture.cs
+++ Sensus.Tests.AppCenter.Shared/UnitTestsFixture.cs
@@ -60,9 +60,9 @@

             int totalTests;
 #if __IOS__
-            totalTests = 156;
+            totalTests = 138;
 #elif __ANDROID__
-            totalTests = 157;
+            totalTests = 139;
 #endif

             Assert.AreEqual(testsPassed, totalTests);


Update the ProtectError documentation to reflect the changes from d277a7b (memory store protection enabled).

--- StackExchange.Exceptional/Stores/MemoryErrorStore.cs
+++ StackExchange.Exceptional/Stores/MemoryErrorStore.cs
@@ -53,10 +53,10 @@
         public override string Name { get { return "Memory Error Store"; } }

         /// <summary>
-        /// Does nothing, always returns False - in-memory errors are currently not protectable (as it's a volatile cache anyway)
+        /// Protects an error from deletion, by setting IsProtected = true
         /// </summary>
-        /// <param name="guid">IGNORED: The guid of the error to protect</param>
-        /// <returns>False, always false</returns>
+        /// <param name="guid">The guid of the error to protect</param>
+        /// <returns>True if the error was found and protected, false otherwise</returns>
         protected override bool ProtectError(Guid guid)
         {
             lock (_lock)
@@ -68,7 +68,7 @@
                     return true;
                 }
             }
-            return false; // NO QUARTER FOR THE WICKED - no seriously, it's not sane to do this for a volatile memory store.
+            return false;
         }

         /// <summary>


detailed explanation of the puller's functionality

--- Stratis.Bitcoin/BlockPulling/LookaheadBlockPuller.cs
+++ Stratis.Bitcoin/BlockPulling/LookaheadBlockPuller.cs
@@ -10,6 +10,9 @@

 namespace Stratis.Bitcoin.BlockPulling
 {
+    ///
+    /// Block puller used for fast sync during initial block download (IBD).
+    ///
     public interface ILookaheadBlockPuller
     {
         ///
@@ -26,7 +29,7 @@
         void SetLocation(ChainedBlock location);

         ///
-        /// Waits for a next block to be available (downloaded).
+        /// Waits for a next block to be available (downloaded) and returns it to the consumer.
         ///
         /// <param name="cancellationToken">Cancellation token to allow the caller to cancel waiting for the next block.</param>
         /// <returns>Next block or null if a reorganization happened on the chain.</returns>
@@ -40,8 +43,46 @@
     }

     ///
-    /// Puller with ability to  lookahead calculates the next blocks to download
+    /// Puller that is used for fast sync during initial block download (IBD). It implements a strategy of downloading
+    /// multiple blocks from multiple peers at once, so that IBD is fast enough, but does not consume too many resources.
     ///
+    /// <remarks>
+    /// The node is aware of the longest chain of block headers, which is stored in this.Chain. This is the chain the puller
+    /// needs to download. Here is a visualization of the block chain and how the puller sees it:
+    /// <para>
+    /// -------A------B-------------C-----------D---------E--------
+    /// </para>
+    /// <para>
+    /// Each '-' represents a block and letters 'A' to 'E' represent blocks with important positions in the chain from
+    /// the puller's perspective. The puller can be understood as a producer of the blocks (by requesting them from the peers
+    /// and downloading them) for the component that uses the puller that consumes the blocks (e.g. validating them).
+    /// </para>
+    /// <para>
+    /// A is a position of a block that we call location. Blocks in front of A were already downloaded and consumed.
+    /// </para>
+    /// <para>
+    /// B is a position of a block A + MinimumLookahead, and E is a position of block A + MaximumLookahead.
+    /// Blocks between B and E are the blocks that the puller is currently interested in. Blocks after E are currently
+    /// not considered and will only be interesting later. The lower boundary B prevents the IBD to be too slow,
+    /// while the upper boundary E prevents the puller from using too many resources.
+    /// </para>
+    /// <para>
+    /// Blocks between A and B are blocks that have been downloaded already, but the consumer did not consume them yet.
+    /// </para>
+    /// <para>
+    /// C is a position of a block A + locationLookahead. Blocks between B and C are currently being requested by the puller,
+    /// some of them could be already being downloaded.
+    /// </para>
+    /// <para>
+    /// D is a position of a block A + ActualLookahead. ActualLookahead is a number of blocks that the puller wants
+    /// to be downloading simultaneously. If there is a gap between C and D it means that the puller wants to start
+    /// downloading these blocks.
+    /// </para>
+    /// <para>
+    /// Blocks between D and E are currently those that the puller does not want to be downloading right now,
+    /// but should the ActualLookahead be adjusted, they can be requested in the near future.
+    /// </para>
+    /// </remarks>
     public class LookaheadBlockPuller : BlockPuller, ILookaheadBlockPuller
     {
         /// Maximal size of a block in bytes.
@@ -60,21 +101,23 @@
             this.MaximumLookahead = 2000;
         }

+        /// Lower limit for ActualLookahead.
         public int MinimumLookahead
         {
             get;
             set;
         }

+        /// Upper limit for ActualLookahead.
         public int MaximumLookahead
         {
             get;
             set;
         }

-        /// Number of blocks the puller wants to download in the nearest future.
+        /// Number of blocks the puller wants to be downloading at once.
         private int actualLookahead;
-        /// Number of blocks the puller wants to download in the nearest future.
+        /// Number of blocks the puller wants to be downloading at once.
         public int ActualLookahead
         {
             get
@@ -97,12 +140,12 @@
         /// Current number of bytes that unconsumed blocks are occupying.
         private long currentSize;

-        /// Maintains the statistics of number of downloaded blocks between two requests to get the next block.
+        /// Maintains the statistics of number of downloaded blocks. This is used for calculating new actualLookahead value.
         private List<int> downloadedCounts = new List<int>();

-        /// Points to a block header that identifies the current position of the puller in the chain.
+        /// Points to a block that was consumed last time. The next block returned by the puller to the consumer will be at location + 1.
         private ChainedBlock location;
-        /// Points to a block header that identifies the current position of the puller in the chain.
+        /// Points to a block that was consumed last time. The next block returned by the puller to the consumer will be at location + 1.
         public ChainedBlock Location
         {
             get { return this.location; }
@@ -113,7 +156,9 @@
         /// Event that signals when a new block is pushed to the list of downloaded blocks.
         private AutoResetEvent pushed = new AutoResetEvent(false);

+        /// Identifies the last block that is currently being requested/downloaded.
         private ChainedBlock lookaheadLocation;
+        /// Identifies the last block that is currently being requested/downloaded.
         public ChainedBlock LookaheadLocation
         {
             get
@@ -122,7 +167,8 @@
             }
         }

-        /// ?????????????????
+        /// Median of a list of past downloadedCounts values. This is used just for logging purposes.
+        /// <remarks>TODO: There is a race condition that could cause GetMedian method to be called with empty downloadCounts list and throw exception.</remarks>
         public decimal MedianDownloadCount
         {
             get
@@ -176,7 +222,11 @@
             this.downloadedCounts.Add(this.DownloadedBlocks.Count);
             if (this.lookaheadLocation == null)
             {
-                // TODO: Comment missing here, is this intentional?
+                // Calling twice is intentional here.
+                // lookaheadLocation is null only during initialization
+                // or when reorganisation happens. Calling this twice will
+                // make sure the initial work of the puller is away from
+                // the lower boundary.
                 AskBlocks();
                 AskBlocks();
             }
@@ -215,9 +265,6 @@
             return median;
         }

-        // If blocks ActualLookahead is 8:
-        // If the number of downloaded block reach 2 or below, then ActualLookahead will be multiplied by 1.1.
-        // If it reach 14 or above, it will be divided by 1.1.
         ///
         /// Calculates a new value for this.ActualLookahead to keep it within reasonable range.
         /// <para>This ensures that the puller is requesting enough new blocks quickly enough to


according to google oracle does not need @ in the param-name

--- SimpleReport.Model/DbExecutor/DbOracleExecutor.cs
+++ SimpleReport.Model/DbExecutor/DbOracleExecutor.cs
@@ -27,7 +27,7 @@

         public DbParameter CreateStringParameter(string name, int length)
         {
-            return new OracleParameter("@" + name, OracleDbType.NVarchar2, 100); //TODO: How does oracle work:P check @ and datatype
+            return new OracleParameter(name, OracleDbType.NVarchar2, 100);
         }

         public DbParameter CreateParameter(string key, object value)


Move SliceSettings mode into overflow menu

--- SlicerConfiguration/SliceSettingsDetailControl.cs
+++ SlicerConfiguration/SliceSettingsDetailControl.cs
@@ -47,35 +47,9 @@
 		public SliceSettingsDetailControl(SliceSettingsWidget sliceSettingsWidget)
 		{
 			this.sliceSettingsWidget = sliceSettingsWidget;
+			this.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;

-			var settingsDetailSelector = new DropDownList("Basic", maxHeight: 200)
-			{
-				Name = "User Level Dropdown",
-				VAnchor = VAnchor.ParentCenter,
-				Margin = new BorderDouble(5, 3),
-				BorderColor = new RGBA_Bytes(ActiveTheme.Instance.SecondaryTextColor, 100)
-			};
-
-			settingsDetailSelector.AddItem("Basic".Localize(), "Simple");
-			settingsDetailSelector.AddItem("Standard".Localize(), "Intermediate");
-			settingsDetailSelector.AddItem("Advanced".Localize(), "Advanced");
-
-			// set to advanced
-			settingsDetailSelector.SelectedValue = sliceSettingsWidget.UserLevel;
-
-			settingsDetailSelector.SelectionChanged += (s, e) =>
-			{
-				UserSettings.Instance.set(UserSettingsKey.SliceSettingsLevel, settingsDetailSelector.SelectedValue);
-				sliceSettingsWidget.RebuildSliceSettingsTabs();
-			};
-
-			{
-				// only add these in the default view
-				this.AddChild(settingsDetailSelector);
-				this.AddChild(CreateOverflowMenu());
-			}
-
-			VAnchor = VAnchor.ParentCenter;
+			this.AddChild(CreateOverflowMenu());
 		}

 		private GuiWidget CreateOverflowMenu()
@@ -164,9 +138,45 @@
 			};
 			popupContainer.AddChild(menuItem);

+			popupContainer.AddChild(overflowDropdown.CreateHorizontalLine());
+
+			popupContainer.AddChild(new TextWidget("Mode")
+			{
+				Margin = new BorderDouble(35, 2, 8, 8),
+				TextColor = RGBA_Bytes.Gray
+			});
+
+			var modeSelector = new SettingsModeSelector()
+			{
+				SelectedValue = sliceSettingsWidget.UserLevel,
+				Name = "User Level Dropdown",
+				Margin = new BorderDouble(35, 15, 35, 5),
+				BorderColor = new RGBA_Bytes(ActiveTheme.Instance.SecondaryTextColor, 100)
+			};
+			modeSelector.SelectionChanged += (s, e) =>
+			{
+				UserSettings.Instance.set(UserSettingsKey.SliceSettingsLevel, modeSelector.SelectedValue);
+				sliceSettingsWidget.RebuildSliceSettingsTabs();
+			};
+
+			popupContainer.AddChild(modeSelector);
+
 			overflowDropdown.PopupContent = popupContainer;

 			return overflowDropdown;
 		}
 	}
+
+	public class SettingsModeSelector : DropDownList, IIgnoredPopupChild
+	{
+		public SettingsModeSelector()
+			: base("Basic")
+		{
+			this.TextColor = RGBA_Bytes.Black;
+
+			this.AddItem("Basic".Localize(), "Simple");
+			this.AddItem("Standard".Localize(), "Intermediate");
+			this.AddItem("Advanced".Localize(), "Advanced");
+		}
+	}
 }


Refactor: introduce constants for Func & Action.

--- Solink.AddIn.Helpers/RestartableAddInGenerator.cs
+++ Solink.AddIn.Helpers/RestartableAddInGenerator.cs
@@ -10,6 +10,9 @@
 {
     public class RestartableAddInGenerator
     {
+        internal const string BaseActionMethodName = "Action";
+        internal const string BaseFuncMethodName = "Func";
+
         private static readonly string RestartableAddInTypeName = typeof (RestartableAddIn<>).FullName;

         internal static CodeCompileUnit CreateCompileUnit()
@@ -135,7 +138,7 @@
             var methodExpression =
                 new CodeMethodInvokeExpression(
                     new CodeBaseReferenceExpression(),
-                    isFunction ? "Func" : "Action",
+                    isFunction ? BaseFuncMethodName : BaseActionMethodName,
                     lambdaExpression
             );
             CodeStatement methodStatement;
@@ -206,7 +209,7 @@
             var getStatements = new CodeMethodReturnStatement(
                 new CodeMethodInvokeExpression(
                     new CodeBaseReferenceExpression(),
-                    "Func",
+                    BaseFuncMethodName,
                     lambdaGetExpression
                 )
             );
@@ -217,7 +220,7 @@
                 var lambdaSetExpression = GenerateLambdaPropertySetExpression(propertyName);
                 var setStatements = new CodeMethodInvokeExpression(
                     new CodeBaseReferenceExpression(),
-                    "Action",
+                    BaseActionMethodName,
                     lambdaSetExpression
                 );
                 result.SetStatements.Add(setStatements);


Fix Standardnoteplugin returning gzipped json

-> references #14

--- Source/AlephNote.Common/Network/SimpleJsonRest.cs
+++ Source/AlephNote.Common/Network/SimpleJsonRest.cs
@@ -26,11 +26,18 @@
 		{
 			if (proxy != null)
 			{
-				_client = new HttpClient(new HttpClientHandler {Proxy = proxy});
+				_client = new HttpClient(new HttpClientHandler
+				{
+					Proxy = proxy,
+					AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
+				});
 			}
 			else
 			{
-				_client = new HttpClient();
+				_client = new HttpClient(new HttpClientHandler
+				{
+					AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
+				});
 			}

 			_headers["User-Agent"] = "AlephNote/Common";


Added escape to query

Added escape to query

--- Source/Libraries/GSF.Web/Model/ModelController.cs
+++ Source/Libraries/GSF.Web/Model/ModelController.cs
@@ -524,8 +524,10 @@
                     things = things.Select(t => $"'{t}'").ToList();
                     search.SearchText = $"({string.Join(",", things)})";
                 }
-
-                return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText}";
+                string escape = "ESCAPE '$'";
+                if(search.Operator != "LIKE")
+                    escape = "";
+                return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText} {escape}";
             }));

             if (searches.Any())


No need to call .Clone() of Card instances as they are read-only. Performance improved by removing .Clone() calls from PlayerTurnContext.Clone()

--- Source/Santase.Logic/Players/PlayerTurnContext.cs
+++ Source/Santase.Logic/Players/PlayerTurnContext.cs
@@ -32,10 +32,11 @@
         {
             var newPlayerTurnContext = new PlayerTurnContext(this.State, this.TrumpCard, this.CardsLeftInDeck)
                                            {
-                                               FirstPlayedCard = this.FirstPlayedCard?.Clone() as Card,
-                                               SecondPlayedCard = this.SecondPlayedCard?.Clone() as Card,
+                                               FirstPlayedCard = this.FirstPlayedCard,
+                                               SecondPlayedCard = this.SecondPlayedCard,
                                                FirstPlayerAnnounce = this.FirstPlayerAnnounce
                                            };
+
             return newPlayerTurnContext;
         }
     }


Enumeration models have 0xFFFFFFFF values stripped (usually these values just force the native enumeration to the appropriate bit width, and are not actually useful).

--- Source/Tools/Generator/ObjectModel/SourceModel.cs
+++ Source/Tools/Generator/ObjectModel/SourceModel.cs
@@ -296,8 +296,11 @@
 				var nativeName = itemData.Attribute("Name").Value;
 				var managedName = nameService.Apply(nativeName, NameCasingStyle.Pascal).RemovePrefix(element.ManagedName);
 				var value = itemData.Attribute("Value").Value;
-
-				element.AddItem(new EnumerationItemElement(nativeName, managedName, value, metadataService.FindTypeMetadata(element.NativeName)));
+
+				// The 0xFFFFFFFF values are used to force the native enumeration to be a particular bit width;
+				// they should not appear in the managed layer.
+				if (value != "0xffffffff")
+					element.AddItem(new EnumerationItemElement(nativeName, managedName, value, metadataService.FindTypeMetadata(element.NativeName)));
 			}
 		}

@@ -329,22 +332,24 @@
 		/// <returns>The type name.</returns>
 		VariableElement ExtractVariable(XElement parameterData)
 		{
-			try {
-			var parameterTypeData = parameterData.Element("Type");
-			var parameterTypeName = ExtractTypeName(parameterTypeData);
-			var parameterType = FindTypeByName(parameterTypeName);
-			var indirectionLevel = parameterTypeData.Descendants("Pointers").Count();
-			var usageData = parameterData.Element("ParamQualifier");
-			var usage = ExtractUsage(usageData);
-			var name = parameterData.Element("Var").Attribute("Name").Value;
-
-			// void* parameters should be passed as IntPtr
-			if (parameterType.ManagedName == "void")
-				parameterType = FindTypeByName("void*");
-
-			return new VariableElement(name, nameService.Apply(name, NameCasingStyle.Camel), new Metadata(), parameterType, indirectionLevel, usage);
-			}
-			catch {
+			try
+			{
+				var parameterTypeData = parameterData.Element("Type");
+				var parameterTypeName = ExtractTypeName(parameterTypeData);
+				var parameterType = FindTypeByName(parameterTypeName);
+				var indirectionLevel = parameterTypeData.Descendants("Pointers").Count();
+				var usageData = parameterData.Element("ParamQualifier");
+				var usage = ExtractUsage(usageData);
+				var name = parameterData.Element("Var").Attribute("Name").Value;
+
+				// void* parameters should be passed as IntPtr
+				if (parameterType.ManagedName == "void")
+					parameterType = FindTypeByName("void*");
+
+				return new VariableElement(name, nameService.Apply(name, NameCasingStyle.Camel), new Metadata(), parameterType, indirectionLevel, usage);
+			}
+			catch
+			{
 				Console.Write(parameterData.ToString());
 				throw;
 			}


Added event for ox wandering off, reduces total possible mileage while the player looks for it.

--- Src/TrailSimulation/Event/Animal/OxWanderedOff.cs
+++ Src/TrailSimulation/Event/Animal/OxWanderedOff.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Diagnostics;
 using TrailSimulation.Entity;
 using TrailSimulation.Game;

@@ -27,7 +28,12 @@
         /// </param>
         public override void Execute(IEntity sourceEntity)
         {
-            throw new NotImplementedException();
+            // Cast the source entity as vehicle.
+            var vehicle = sourceEntity as Vehicle;
+            Debug.Assert(vehicle != null, "vehicle != null");
+
+            // Reduce the total possible mileage of the vehicle this turn.
+            vehicle.RemoveMileage(17);
         }

         /// <summary>


unity: fix barriers clipped by tile rect

--- unity/library/UtyMap.Unity/Maps/Data/MapTileAdapter.cs
+++ unity/library/UtyMap.Unity/Maps/Data/MapTileAdapter.cs
@@ -104,7 +104,9 @@
                     unityUvs3 = new Vector2[worldPoints.Length];
                 }

-                _tile.Register(id);
+                // TODO this is not scalable: think about better solution for elements clipped by tile rect.
+                if (!name.StartsWith("barrier"))
+                    _tile.Register(id);
             }

             if (worldPoints.Length >= 65000)


TSI-3091 : fix

TSI-3091 : fix

--- webapp-net/TridionDocs/Controllers/TridionDocsApiController.cs
+++ webapp-net/TridionDocs/Controllers/TridionDocsApiController.cs
@@ -45,16 +45,16 @@
             return ServerError(new TridionDocsApiException($"Page not found: [{publicationId}] {pageId}/index.html"), 400);
         }

-        [Route("~/api/page/{publicationId:int}/{pageId:int}/{*conditions}")]
+        [Route("~/api/page/{publicationId:int}/{pageId:int}/{*content}")]
         [HttpPost]
-        public virtual ActionResult Page(int publicationId, int pageId, string conditions)
-        {
-            try
-            {
-                string c = Request.QueryString["conditions"];
-                if (!string.IsNullOrEmpty(c))
-                {
-                    AmbientDataContext.CurrentClaimStore.Put(UserConditionsUri, c);
+        public virtual ActionResult Page(int publicationId, int pageId, string content)
+        {
+            try
+            {
+                string conditions = Request.QueryString["conditions"];
+                if (!string.IsNullOrEmpty(conditions))
+                {
+                    AmbientDataContext.CurrentClaimStore.Put(UserConditionsUri, conditions);
                 }
                 PageModel model = TridionDocsContentProvider.GetPageModel(pageId, SetupLocalization(publicationId));
                 WebRequestContext.PageModel = model;
@@ -114,7 +114,12 @@
         {
             try
             {
-                return JsonResult(new ConditionProvider().GetConditions(publicationId));
+                return new ContentResult
+                {
+                    ContentType = "application/json",
+                    Content = new ConditionProvider().GetConditions(publicationId),
+                    ContentEncoding = Encoding.UTF8
+                };
             }
             catch (Exception ex)
             {


remove empty lines

remove empty lines

--- UnitTestUsefullFunctions/UnitTestStringExtensions.cs
+++ UnitTestUsefullFunctions/UnitTestStringExtensions.cs
@@ -1,6 +1,4 @@
-using System;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
-using StringFunc = FonctionsUtiles.Fred.Csharp.FunctionsString;
 using dllFuncs = FonctionsUtiles.Fred.Csharp;

 namespace UnitTestUsefullFunctions
@@ -85,6 +83,5 @@
     //}
     #endregion ToCodeSummary

-
   }
 }


extracted refund method

extracted refund method

--- VendingMachine/VendingMachine.Core/VendingMachine.cs
+++ VendingMachine/VendingMachine.Core/VendingMachine.cs
@@ -44,15 +44,7 @@

                 _coins.Clear();

-                if (currentTotal > priceInCents)
-                {
-                    var refund = currentTotal - priceInCents;
-                    while (refund > 0)
-                    {
-                        _returnTray.Add(Coin.Nickel);
-                        refund -= 5;
-                    }
-                }
+                Refund(currentTotal, priceInCents);
             }
         }

@@ -79,5 +71,18 @@

             return text;
         }
+
+        private void Refund(int currentTotal, int? priceInCents)
+        {
+            if (currentTotal > priceInCents)
+            {
+                var refund = currentTotal - priceInCents;
+                while (refund > 0)
+                {
+                    _returnTray.Add(Coin.Nickel);
+                    refund -= 5;
+                }
+            }
+        }
     }
 }


Revert change in TxoRef class

Revert change in TxoRef class

--- WalletWasabi/Blockchain/TransactionOutputs/TxoRef.cs
+++ WalletWasabi/Blockchain/TransactionOutputs/TxoRef.cs
@@ -13,6 +13,14 @@
 	[JsonObject(MemberSerialization.OptIn)]
 	public class TxoRef : IEquatable<TxoRef>, IEquatable<OutPoint>
 	{
+		[Required]
+		[JsonProperty(Order = 1)]
+		[JsonConverter(typeof(Uint256JsonConverter))]
+		public uint256 TransactionId { get; }
+
+		[JsonProperty(Order = 2)]
+		public uint Index { get; }
+
 		[JsonConstructor]
 		public TxoRef(uint256 transactionId, uint index)
 		{
@@ -26,14 +34,6 @@
 			TransactionId = outPoint.Hash;
 			Index = outPoint.N;
 		}
-
-		[Required]
-		[JsonProperty(Order = 1)]
-		[JsonConverter(typeof(Uint256JsonConverter))]
-		public uint256 TransactionId { get; }
-
-		[JsonProperty(Order = 2)]
-		public uint Index { get; }

 		public OutPoint ToOutPoint() => new OutPoint(TransactionId, Index);


ClickableContainers are disabled until they have an action assigned

--- osu.Framework/Graphics/Containers/ClickableContainer.cs
+++ osu.Framework/Graphics/Containers/ClickableContainer.cs
@@ -9,8 +9,23 @@
 {
     public class ClickableContainer : Container
     {
-        public Action Action;
-        public readonly BindableBool Enabled = new BindableBool(true);
+        private Action action;
+
+        public Action Action
+        {
+            get
+            {
+                return action;
+            }
+
+            set
+            {
+                action = value;
+                Enabled.Value = action != null;
+            }
+        }
+
+        public readonly BindableBool Enabled = new BindableBool();

         protected override bool OnClick(InputState state)
         {


Fix test text

Fix test text

--- osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs
+++ osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs
@@ -238,7 +238,7 @@
         }

         private void assertHeadJudgement(HitResult result)
-            => AddAssert($"head judged as{result}", () => judgementResults[0].Type == result);
+            => AddAssert($"head judged as {result}", () => judgementResults[0].Type == result);

         private void assertTailJudgement(HitResult result)
             => AddAssert($"tail judged as {result}", () => judgementResults[^2].Type == result);


Fix incorrect passing logic

Fix incorrect passing logic

--- osu.Game.Rulesets.Taiko/Skinning/LegacyTaikoScroller.cs
+++ osu.Game.Rulesets.Taiko/Skinning/LegacyTaikoScroller.cs
@@ -39,7 +39,11 @@
             {
                 var r = result.NewValue;

-                passing = r == null || (r.Judgement.AffectsCombo && r.Type > HitResult.Miss);
+                // always ignore hitobjects that don't affect combo (drumroll ticks etc.)
+                if (r?.Judgement.AffectsCombo == false)
+                    return;
+
+                passing = r == null || r.Type > HitResult.Miss;

                 foreach (var sprite in InternalChildren.OfType<ScrollerSprite>())
                     sprite.Passing = passing;


Don't return low res and too low res at the same time

--- osu.Game/Rulesets/Edit/Checks/CheckBackgroundQuality.cs
+++ osu.Game/Rulesets/Edit/Checks/CheckBackgroundQuality.cs
@@ -44,8 +44,7 @@

             if (texture.Width < min_width || texture.Height < min_height)
                 yield return new IssueTemplateTooLowResolution(this).Create(texture.Width, texture.Height);
-
-            if (texture.Width < low_width || texture.Height < low_height)
+            else if (texture.Width < low_width || texture.Height < low_height)
                 yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);

             string storagePath = workingBeatmap.BeatmapInfo.BeatmapSet.GetPathForFile(workingBeatmap.Metadata.BackgroundFile);


Fix accessibility of `areConcurrent`

Fix accessibility of `areConcurrent`

--- osu.Game/Rulesets/Edit/Checks/CheckConcurrentObjects.cs
+++ osu.Game/Rulesets/Edit/Checks/CheckConcurrentObjects.cs
@@ -50,7 +50,7 @@
             }
         }

-        protected bool areConcurrent(HitObject hitobject, HitObject nextHitobject) => nextHitobject.StartTime <= hitobject.GetEndTime() + ms_leniency;
+        private bool areConcurrent(HitObject hitobject, HitObject nextHitobject) => nextHitobject.StartTime <= hitobject.GetEndTime() + ms_leniency;

         public abstract class IssueTemplateConcurrent : IssueTemplate
         {


Update the Layout

Update the Layout

--- ACStalkMarket/ACStalkMarket/Views/Shared/_Layout.cshtml
+++ ACStalkMarket/ACStalkMarket/Views/Shared/_Layout.cshtml
@@ -23,8 +23,8 @@

@Html.ActionLink("Inicio", "Index", "Home")

+
@Html.ActionLink("Semanas", "Index", "Weeks")

@Html.ActionLink("Acerca de", "About", "Home")

-
@Html.ActionLink("Contacto", "Contact", "Home")

                 @Html.Partial("_LoginPartial")


added Speed in GM

added Speed in GM

--- AdvancedNetToolsSolution/AntWeb/Infrastructure/Utils.cs
+++ AdvancedNetToolsSolution/AntWeb/Infrastructure/Utils.cs
@@ -354,14 +354,17 @@

                 string timeAvg = string.Empty;
                 string distance = string.Empty;
+                string speed = string.Empty;
                 if (i % 2 == 0)
                 {
-                    timeAvg = @"TIME AVG: " + Math.Round(pingSummaries[i / 2].AvgRtt.GetValueOrDefault(), digits: 0).ToString() + "ms.
";
-                    distance = @"DISTANCE: " + distanceKm.ToString() + "km./" + distanceMiles +"mi.
";
+                    var time = Math.Round(pingSummaries[i / 2].AvgRtt.GetValueOrDefault(), digits: 0);
+                    timeAvg = @"TIME AVG: " + time.ToString() + "ms.
";
+                    distance = @"DISTANCE: " + distanceKm.ToString() + "km. | " + distanceMiles +"mi.
";
+                    speed = @"SPEED: " + ((int)(distanceKm / time)).ToString() + "km./ms. | " + ((int) (distanceMiles / time)).ToString() + "mi./ms.
";
                 }

                 var sbMarkerWindowHtml = new StringBuilder();
-                sbMarkerWindowHtml.Append($@"IP:  {ips.ElementAt(i)}
{timeAvg}{distance}CITY:  {locations[i].CityName.Replace(oldValue: "'", newValue: """)}
COUNTRY:  {locations[i].CountryName.Replace(oldValue: "'", newValue: """)}");
+                sbMarkerWindowHtml.Append($@"IP:  {ips.ElementAt(i)}
{timeAvg}{distance}{speed}CITY:  {locations[i].CityName.Replace(oldValue: "'", newValue: """)}
COUNTRY:  {locations[i].CountryName.Replace(oldValue: "'", newValue: """)}");

                 string markerWindowHtml = sbMarkerWindowHtml.ToString(); ;


Serialize razor speed and set to 180

Serialize razor speed and set to 180

--- Assets/Microgames/KagerouCut/Scripts/RazorController.cs
+++ Assets/Microgames/KagerouCut/Scripts/RazorController.cs
@@ -4,7 +4,7 @@

 public class RazorController : MonoBehaviour {
     [SerializeField]
-    private float speed = 120f;
+    private float speed = 180f;
     private bool has_moved = false;
     // Use this for initialization
     void Start () {


* IMPROVEMENT OLTW

* IMPROVEMENT OLTW

--- AudioAlign/AudioAlign.Audio/Matching/Dixon2005/OLTW2.cs
+++ AudioAlign/AudioAlign.Audio/Matching/Dixon2005/OLTW2.cs
@@ -13,6 +13,8 @@
     public class OLTW2 : DTW {

         private const int MAX_RUN_COUNT = 3; // MaxRunCount
+        private const int DIAG_COST_FACTOR = 1;
+        private const int DIAG_LENGTH_FACTOR = 2;

         private enum GetIncResult {
             None = 0,
@@ -86,7 +88,7 @@
             // init square matrix
             for (int x = 0; x < c; x++) {
                 for (int y = 0; y < c; y++) {
-                    int cellCost = CalculateCost(s1Frames[x], s2Frames[y]);
+                    double cellCost = CalculateCost(s1Frames[x], s2Frames[y]);
                     if (x == 0 && y == 0) {
                         totalCostMatrix[x, y] = cellCost;
                     }
@@ -100,9 +102,9 @@
                         totalCostMatrix[x, y] = Min(
                                 totalCostMatrix[x, y - 1] + cellCost,
                                 totalCostMatrix[x - 1, y] + cellCost,
-                                totalCostMatrix[x - 1, y - 1] + 2 * cellCost);
-                    }
-                    cellCostMatrix[x, y] = (byte)cellCost;
+                                totalCostMatrix[x - 1, y - 1] + DIAG_COST_FACTOR * cellCost);
+                    }
+                    cellCostMatrix[x, y] = cellCost;
                 }
             }

@@ -118,10 +120,10 @@

             // init path lengths
             for (int x = 0; x < c; x++) {
-                pathLengthRow[x] = OptimalWarpingPath(totalCostMatrix, x, j).Count;
+                pathLengthRow[x] = GetPathLength(x, j); //OptimalWarpingPath(totalCostMatrix, x, j).Count;
             }
             for (int y = 0; y < c; y++) {
-                pathLengthCol[y] = OptimalWarpingPath(totalCostMatrix, i, y).Count;
+                pathLengthCol[y] = GetPathLength(i, y); //OptimalWarpingPath(totalCostMatrix, i, y).Count;
             }

             IProgressReporter progressReporter = progressMonitor.BeginTask("OLTW", true);
@@ -205,7 +207,7 @@
                     j++;
                     int start = i - c + 1;
                     for (int x = start; x <= i; x++) {
-                        int cellCost = CalculateCost(s1Frames[x], s2Frames[j]);
+                        double cellCost = CalculateCost(s1Frames[x], s2Frames[j]);
                         if (x == 0) {
                             totalCostMatrix[x, j] = totalCostMatrix[x, j - 1] + cellCost;
                             pathLengthRow[x % pathLengthRow.Length] = pathLengthRowPrev[x % pathLengthRowPrev.Length] + 1;
@@ -220,7 +222,7 @@
                                     totalCostMatrix[x - 1, j],
                                     totalCostMatrix[x, j - 1],
                                     out direction);
-                            totalCostMatrix[x, j] += (direction == GetIncResult.Both) ? 1 * cellCost : cellCost;
+                            totalCostMatrix[x, j] += (direction == GetIncResult.Both) ? DIAG_COST_FACTOR * cellCost : cellCost;
                             if (direction == GetIncResult.Row) pathLengthRow[x % pathLengthRow.Length] = pathLengthRow[(x - 1) % pathLengthRow.Length] + 1;
                             else if (direction == GetIncResult.Column) pathLengthRow[x % pathLengthRow.Length] = pathLengthRowPrev[x % pathLengthRowPrev.Length] + 1;
                             else if (direction == GetIncResult.Both) pathLengthRow[x % pathLengthRow.Length] = pathLengthRowPrev[(x - 1) % pathLengthRowPrev.Length] + 2;
@@ -232,7 +234,7 @@
                             //    Debug.WriteLine("AAAH");
                             //}
                         }
-                        cellCostMatrix[x, j] = (byte)cellCost;
+                        cellCostMatrix[x, j] = cellCost;
                         //pathLengthRow[x % pathLengthRow.Length] = GetPathLength(x, j);
                     }
                     pathLengthCol[j % pathLengthCol.Length] = pathLengthRow[i % pathLengthRow.Length];
@@ -247,7 +249,7 @@
                     i++;
                     int start = j - c + 1;
                     for (int y = start; y <= j; y++) {
-                        int cellCost = CalculateCost(s1Frames[i], s2Frames[y]);
+                        double cellCost = CalculateCost(s1Frames[i], s2Frames[y]);
                         if (y == 0) {
                             totalCostMatrix[i, y] = totalCostMatrix[i - 1, y] + cellCost;
                             //pathLengthCol[y % pathLengthCol.Length] = pathLengthColPrev[y % pathLengthColPrev.Length] + 1;
@@ -259,12 +261,12 @@
                                     totalCostMatrix[i - 1, y],
                                     totalCostMatrix[i, y - 1],
                                     out direction);
-                            totalCostMatrix[i, y] += (direction == GetIncResult.Both) ? 1 * cellCost : cellCost;
+                            totalCostMatrix[i, y] += (direction == GetIncResult.Both) ? DIAG_COST_FACTOR * cellCost : cellCost;
                             if (direction == GetIncResult.Column) pathLengthCol[y % pathLengthCol.Length] = pathLengthCol[(y - 1) % pathLengthCol.Length] + 1;
                             else if (direction == GetIncResult.Row) pathLengthCol[y % pathLengthCol.Length] = pathLengthColPrev[y % pathLengthColPrev.Length] + 1;
                             else if (direction == GetIncResult.Both) pathLengthCol[y % pathLengthCol.Length] = pathLengthColPrev[(y - 1) % pathLengthColPrev.Length] + 2;
                         }
-                        cellCostMatrix[i, y] = (byte)cellCost;
+                        cellCostMatrix[i, y] = cellCost;
                         //pathLengthCol[y % pathLengthCol.Length] = GetPathLength(i, y);
                     }
                     pathLengthRow[i % pathLengthRow.Length] = pathLengthCol[j % pathLengthCol.Length];
@@ -317,7 +319,9 @@
             //return OptimalWarpingPath(matrix, t1, t2).Count;

             int length = 1;
+            bool diagonal;
             while (i > 0 || j > 0) {
+                diagonal = false;
                 if (i == 0) {
                     j--;
                 }
@@ -329,6 +333,7 @@
                     if (min == totalCostMatrix[i - 1, j - 1]) {
                         i--;
                         j--;
+                        diagonal = true;
                     }
                     else if (totalCostMatrix[i - 1, j] == min) {
                         i--;
@@ -337,7 +342,8 @@
                         j--;
                     }
                 }
-                length++;
+                if (diagonal) length += DIAG_LENGTH_FACTOR;
+                else length++;
             }
             return length;
         }
@@ -444,7 +450,7 @@
             }
         }

-        protected int CalculateCost(float[] frame1, float[] frame2) {
+        protected double CalculateCost(float[] frame1, float[] frame2) {
             // taken from MATCH 0.9.2 at.ofai.music.match.PerformanceMatcher:804
             // NOTE sum of ABS values is the same as the square root of the squared values, BUT FASTER
             double result = 0;
@@ -452,10 +458,7 @@
                 result += Math.Abs(frame1[i] - frame2[i]);
             }
             result = result * 0.001d; // default scaling factor 90
-            if (result > 255) { // MATCH 0.9.2 at.ofai.music.match.PerformanceMatcher:721
-                result = 255;
-            }
-            return (int)result;
+            return result;
         }

         protected static double Min(double val1, double val2, double val3) {


Fixed the new send packet method to work with networkmessage class. Cleanup the code.

--- tibiaapi/Packets/Packet.cs
+++ tibiaapi/Packets/Packet.cs
@@ -75,7 +75,8 @@
             }
             catch (DllNotFoundException)
             {
-                throw new Exceptions.PacketDllNotFoundException();
+                //send packet with the new method ;)
+                return SendPacketByMemory(client, packet);
             }
             catch (AccessViolationException)
             {
@@ -97,39 +98,26 @@
             if (client.LoggedIn)
             {
                 if (!client.IsSendCodeWritten)
-                    if (!client.WriteSocketSendCode()) return false;
+                    if (!client.WriteSocketSendCode())
+                        return false;

-
-                byte[] packet_=new byte[packet.Length+2];
-                Array.Copy(BitConverter.GetBytes(packet.Length), packet_, 2);
-                Array.Copy(packet, 0, packet_, 2, packet.Length);
-
-                byte[] encPacket = XTEA.Encrypt(packet_, client.XteaKey.ToByteArray(), true);
-                uint pSize=(uint)(encPacket.Length + 4);
-                byte[] readyPacket = new byte[pSize];
-                Array.Copy(BitConverter.GetBytes(encPacket.Length), readyPacket, 4);
-                Array.Copy(encPacket, 0, readyPacket, 4, encPacket.Length);
-
-
-                /*
                 NetworkMessage msg = new NetworkMessage(client);
                 msg.AddBytes(packet);
                 msg.PrepareToSend();

-                byte[] readyPacket = msg.Packet;
-                uint bufferSize=(uint)(4+readyPacket.Length);
-                byte[] buffer = new byte[bufferSize];
-                Array.Copy(BitConverter.GetBytes(bufferSize), buffer, 4);
-                Array.Copy(readyPacket, 0, buffer, 4, readyPacket.Length);*/
+                uint bufferSize = (uint)(4 + msg.Length);
+                byte[] readyPacket = new byte[bufferSize];
+                Array.Copy(BitConverter.GetBytes(msg.Length), readyPacket, 4);
+                Array.Copy(msg.GetBuffer(), 0, readyPacket, 4, msg.Length);

                 IntPtr pRemote = Tibia.Util.WinApi.VirtualAllocEx(client.ProcessHandle, IntPtr.Zero, /*bufferSize*/
-                                            pSize,
+                                            bufferSize,
                                             Tibia.Util.WinApi.MEM_COMMIT | Tibia.Util.WinApi.MEM_RESERVE,
                                             Tibia.Util.WinApi.PAGE_EXECUTE_READWRITE);

                 if (pRemote != IntPtr.Zero)
                 {
-                    if (client.WriteBytes(pRemote.ToInt64(), readyPacket, pSize))
+                    if (client.WriteBytes(pRemote.ToInt64(), readyPacket, bufferSize))
                     {
                         IntPtr threadHandle = Tibia.Util.WinApi.CreateRemoteThread(client.ProcessHandle, IntPtr.Zero, 0,
                             client.SenderAddress, pRemote, 0, IntPtr.Zero);
@@ -153,246 +141,4 @@
             return false;
         }
     }
-
-    public static class XTEA
-    {
-        public static byte[] AddAdlerChecksum(byte[] packet)
-        {
-            byte[] packet_WithCRC = new byte[packet.Length + 4];
-            byte[] packet_WithoutHeader = new byte[packet.Length - 2];
-            AdlerChecksum acs = new AdlerChecksum();
-            Array.Copy(packet, 2, packet_WithoutHeader, 0, packet_WithoutHeader.Length);
-            packet_WithCRC[0] = BitConverter.GetBytes((ushort)(packet.Length + 2))[0];
-            packet_WithCRC[1] = BitConverter.GetBytes((ushort)(packet.Length + 2))[1];
-            if (acs.MakeForBuff(packet_WithoutHeader))
-            {
-                Array.Copy(BitConverter.GetBytes(acs.ChecksumValue), 0, packet_WithCRC, 2, 4);
-                Array.Copy(packet_WithoutHeader, 0, packet_WithCRC, 6, packet_WithoutHeader.Length);
-                return packet_WithCRC;
-            }
-            else
-                return null;
-        }
-
-        /// <summary>
-        /// Encrypt a packet using XTEA.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="key"></param>
-        public static byte[] Encrypt(byte[] packet, byte[] key, bool addAdler)
-        {
-            if (packet.Length == 0)
-                return packet;
-
-            uint[] keyprep = key.ToUintArray();
-
-            // Pad the packet with extra bytes for encryption
-            int pad = packet.Length % 8;
-
-            byte[] packetprep;
-
-            if (pad == 0)
-                packetprep = new byte[packet.Length];
-            else
-                packetprep = new byte[packet.Length + (8 - pad)];
-
-            Array.Copy(packet, packetprep, packet.Length);
-
-            uint[] payloadprep = packetprep.ToUintArray();
-
-            for (int i = 0; i < payloadprep.Length; i += 2)
-            {
-                Encode(payloadprep, i, keyprep);
-            }
-
-            byte[] encrypted = new byte[packetprep.Length + 2];
-
-            Array.Copy(payloadprep.ToByteArray(), 0, encrypted, 2, packetprep.Length);
-
-            Array.Copy(BitConverter.GetBytes((short)packetprep.Length), 0, encrypted, 0, 2);
-
-            if (addAdler)
-            {
-
-                byte[] encrypted_ready = new byte[encrypted.Length + 4];
-                Array.Copy(AddAdlerChecksum(encrypted), 0, encrypted_ready, 0, encrypted_ready.Length);
-                return encrypted_ready;
-            }
-            else
-                return encrypted;
-        }
-
-        private static void Encode(uint[] v, int index, uint[] k)
-        {
-            uint y = v[index];
-            uint z = v[index + 1];
-            uint sum = 0;
-            uint delta = 0x9e3779b9;
-            uint n = 32;
-
-            while (n-- > 0)
-            {
-                y += (z << 4 ^ z >> 5) + z ^ sum + k[sum & 3];
-                sum += delta;
-                z += (y << 4 ^ y >> 5) + y ^ sum + k[sum >> 11 & 3];
-            }
-
-            v[index] = y;
-            v[index + 1] = z;
-        }
-
-        private static uint[] ToUintArray(this byte[] bytes)
-        {
-            uint[] uints = new uint[bytes.Length / 4];
-
-            for (int i = 0; i < uints.Length; i++)
-            {
-                uints[i] = BitConverter.ToUInt32(bytes, i * 4);
-            }
-
-            return uints;
-        }
-
-        private static byte[] ToByteArray(this uint[] uints)
-        {
-            byte[] bytes = new byte[uints.Length * 4];
-
-            for (int i = 0; i < uints.Length; i++)
-            {
-                Array.Copy(BitConverter.GetBytes(uints[i]), 0, bytes, i * 4, 4);
-            }
-
-            return bytes;
-        }
-    }
-
-    public class AdlerChecksum
-    {
-        // parameters
-        #region
-        /// <summary>
-        /// AdlerBase is Adler-32 checksum algorithm parameter.
-        /// </summary>
-        public const uint AdlerBase = 0xFFF1;
-        /// <summary>
-        /// AdlerStart is Adler-32 checksum algorithm parameter.
-        /// </summary>
-        public const uint AdlerStart = 0x0001;
-        /// <summary>
-        /// AdlerBuff is Adler-32 checksum algorithm parameter.
-        /// </summary>
-        public const uint AdlerBuff = 0x0400;
-        /// Adler-32 checksum value
-        private uint m_unChecksumValue = 0;
-        #endregion
-        /// <value>
-        /// ChecksumValue is property which enables the user
-        /// to get Adler-32 checksum value for the last calculation
-        /// </value>
-        public uint ChecksumValue
-        {
-            get
-            {
-                return m_unChecksumValue;
-            }
-        }
-        /// <summary>
-        /// Calculate Adler-32 checksum for buffer
-        /// </summary>
-        /// <param name="bytesBuff">Bites array for checksum calculation</param>
-        /// <param name="unAdlerCheckSum">Checksum start value (default=1)</param>
-        /// <returns>Returns true if the checksum values is successflly calculated</returns>
-        public bool MakeForBuff(byte[] bytesBuff, uint unAdlerCheckSum)
-        {
-            if (Object.Equals(bytesBuff, null))
-            {
-                m_unChecksumValue = 0;
-                return false;
-            }
-            int nSize = bytesBuff.GetLength(0);
-            if (nSize == 0)
-            {
-                m_unChecksumValue = 0;
-                return false;
-            }
-            uint unSum1 = unAdlerCheckSum & 0xFFFF;
-            uint unSum2 = (unAdlerCheckSum >> 16) & 0xFFFF;
-            for (int i = 0; i < nSize; i++)
-            {
-                unSum1 = (unSum1 + bytesBuff[i]) % AdlerBase;
-                unSum2 = (unSum1 + unSum2) % AdlerBase;
-            }
-            m_unChecksumValue = (unSum2 << 16) + unSum1;
-            return true;
-        }
-        /// <summary>
-        /// Calculate Adler-32 checksum for buffer
-        /// </summary>
-        /// <param name="bytesBuff">Bites array for checksum calculation</param>
-        /// <returns>Returns true if the checksum values is successflly calculated</returns>
-        public bool MakeForBuff(byte[] bytesBuff)
-        {
-            return MakeForBuff(bytesBuff, AdlerStart);
-        }
-        /// Equals determines whether two files (buffers)
-        /// have the same checksum value (identical).
-        /// </summary>
-        /// <param name="obj">A AdlerChecksum object for comparison</param>
-        /// <returns>Returns true if the value of checksum is the same
-        /// as this instance; otherwise, false
-        /// </returns>
-        public override bool Equals(object obj)
-        {
-            if (obj == null)
-                return false;
-            if (this.GetType() != obj.GetType())
-                return false;
-            AdlerChecksum other = (AdlerChecksum)obj;
-            return (this.ChecksumValue == other.ChecksumValue);
-        }
-        /// <summary>
-        /// operator== determines whether AdlerChecksum objects are equal.
-        /// </summary>
-        /// <param name="objA">A AdlerChecksum object for comparison</param>
-        /// <param name="objB">A AdlerChecksum object for comparison</param>
-        /// <returns>Returns true if the values of its operands are equal</returns>
-        public static bool operator ==(AdlerChecksum objA, AdlerChecksum objB)
-        {
-            if (Object.Equals(objA, null) && Object.Equals(objB, null)) return true;
-            if (Object.Equals(objA, null) || Object.Equals(objB, null)) return false;
-            return objA.Equals(objB);
-        }
-        /// <summary>
-        /// operator!= determines whether AdlerChecksum objects are not equal.
-        /// </summary>
-        /// <param name="objA">A AdlerChecksum object for comparison</param>
-        /// <param name="objB">A AdlerChecksum object for comparison</param>
-        /// <returns>Returns true if the values of its operands are not equal</returns>
-        public static bool operator !=(AdlerChecksum objA, AdlerChecksum objB)
-        {
-            return !(objA == objB);
-        }
-        /// <summary>
-        /// GetHashCode returns hash code for this instance.
-        /// </summary>
-        /// <returns>hash code of AdlerChecksum</returns>
-        public override int GetHashCode()
-        {
-            return ChecksumValue.GetHashCode();
-        }
-        /// <summary>
-        /// ToString is a method for current AdlerChecksum object
-        /// representation in textual form.
-        /// </summary>
-        /// <returns>Returns current checksum or
-        /// or "Unknown" if checksum value is unavailable
-        /// </returns>
-        public override string ToString()
-        {
-            if (ChecksumValue != 0)
-                return ChecksumValue.ToString();
-            return "Unknown";
-        }
-
-    }
 }


Fixed broken sample

Fixed broken sample

--- Contrib.SignalR.SignalRMessageBus/Chat1/Hubs/ChatHub.cs
+++ Contrib.SignalR.SignalRMessageBus/Chat1/Hubs/ChatHub.cs
@@ -18,9 +18,12 @@
 			return new[] { "SignalR", "ASP.Net MVC" };
 		}

-		public void JoinGroup(string group)
+		public void JoinGroups(string[] groups)
 		{
-			Groups.Add(Context.ConnectionId, group);
+			foreach (var group in groups)
+			{
+				Groups.Add(Context.ConnectionId, group);
+			}
 		}

 		public void MessageGroup(string group, string message)
@@ -29,9 +32,12 @@
 														   group + "/"));
 		}

-		public void LeaveGroup(string group)
+		public void LeaveGroups(string[] groups)
 		{
-			Groups.Remove(Context.ConnectionId, group);
+			foreach (var group in groups)
+			{
+				Groups.Remove(Context.ConnectionId, group);
+			}
 		}
 	}
 }


updating version to 1.6.1

updating version to 1.6.1

--- DocuSign.Integrations.Client/Properties/AssemblyInfo.cs
+++ DocuSign.Integrations.Client/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.1.0")]
-[assembly: AssemblyFileVersion("1.5.1.0")]
+[assembly: AssemblyVersion("1.6.1.0")]
+[assembly: AssemblyFileVersion("1.6.1.0")]


Remove duplicate data check

Remove duplicate data check

This duplicate data check does NOT belong here. If we need to implement
a filter to screen out duplicate data then it should be done somewhere
more specific to live custom data instead of the generic frontier aware
enumerator.

The concern that this was attempting to address was repeating data for
remote files. This is handled by preventing duplicate time stamps from
being emitted following a refresh of the remote file

--- Engine/DataFeeds/Enumerators/FrontierAwareEnumerator.cs
+++ Engine/DataFeeds/Enumerators/FrontierAwareEnumerator.cs
@@ -1,11 +1,11 @@
 /*
  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ *
+ * 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.
@@ -94,20 +94,9 @@

             if (underlyingCurrent != null && underlyingCurrent.EndTime <= localFrontier)
             {
-                // only emit if new data available (skip custom data if same time/value)
-                if (_lastEmittedValue != null &&
-                    _lastEmittedValue.DataType == MarketDataType.Base &&
-                    _lastEmittedValue.EndTime == underlyingCurrent.EndTime &&
-                    _lastEmittedValue.Value == underlyingCurrent.Value)
-                {
-                    _current = null;
-                }
-                else
-                {
-                    _needsMoveNext = true;
-                    _current = underlyingCurrent;
-                    _lastEmittedValue = _current;
-                }
+                _needsMoveNext = true;
+                _current = underlyingCurrent;
+                _lastEmittedValue = _current;
             }
             else
             {


Refactored test.

Refactored test.

--- FidelityWebDriver.Tests/Positions/PositionsPageTests.cs
+++ FidelityWebDriver.Tests/Positions/PositionsPageTests.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using Moq;
 using NUnit.Framework;
@@ -16,33 +17,49 @@
         private PositionsPage _positionsPage;
         private Mock<IWebDriver> _webDriverMock;
         private Mock<IPageFactory> _pageFactoryMock;
-        private List<IWebElement> _accountDivs;
-        private List<Dictionary<string, string>> _startingValues;
-
-        private readonly IDictionary<string, AccountType> _accountTypeStrings = new Dictionary<string, AccountType>
-        {
-            {"IA", AccountType.InvestmentAccount},
-            {"RA", AccountType.RetirementAccount},
-            {"HS", AccountType.HealthSavingsAccount},
-            {"OA", AccountType.Other},
-            {"CC", AccountType.CreditCard},
-        };
-
-        private readonly Dictionary<string, string> _valueAttributeNames = new Dictionary<string, string>
-        {
-            {"IA", "data-most-recent-value"},
-            {"RA", "data-most-recent-value"},
-            {"HS", "data-most-recent-value"},
-            {"OA", "data-most-recent-value"},
-            {"CC", "data-acct-balance"}
-        };
-
-        private IDictionary<string, Mock<IWebElement>> _groupDivMocks;
+        private List<Dictionary<string, string>> _expectedAccountDetails;

         [SetUp]
         public void Setup()
         {
-            _startingValues = new List<Dictionary<string, string>>
+            _webDriverMock = new Mock<IWebDriver>();
+            _webDriverMock.Setup(driver => driver.FindElements(By.ClassName("account-selector--group-container")))
+                .Returns(SetupAccountDivs());
+
+            _pageFactoryMock = new Mock<IPageFactory>();
+
+            _positionsPage = new PositionsPage(_webDriverMock.Object, _pageFactoryMock.Object);
+        }
+
+        [Test]
+        public void ShouldReturnOneAccountPerAccountOnPage()
+        {
+            var accountTypeStrings = new Dictionary<string, AccountType>
+            {
+                {"IA", AccountType.InvestmentAccount},
+                {"RA", AccountType.RetirementAccount},
+                {"HS", AccountType.HealthSavingsAccount},
+                {"OA", AccountType.Other},
+                {"CC", AccountType.CreditCard},
+            };
+
+            var accounts = _positionsPage.BuildAccounts().ToList();
+
+            Assert.AreEqual(_expectedAccountDetails.Count(), accounts.Count());
+            foreach (var account in accounts)
+            {
+                var matchingValues =
+                    _expectedAccountDetails.Single(values => values["accountNumber"] == account.AccountNumber);
+
+                Assert.AreEqual(matchingValues["accountName"], account.Name);
+                Assert.AreEqual(accountTypeStrings[matchingValues["accountType"]], account.AccountType);
+                Assert.AreEqual(double.Parse(matchingValues["accountValue"]), account.MostRecentValue);
+            }
+        }
+
+        private ReadOnlyCollection<IWebElement> SetupAccountDivs()
+        {
+            _expectedAccountDetails = new List<Dictionary<string, string>>
             {
                 CreateAccountValues("abc1234", "IA", "my taxable investment account", "123.45678"),
                 CreateAccountValues("bl54321", "RA", "my BrokerageLink account", "98765.43211"),
@@ -52,36 +69,11 @@
                 CreateAccountValues("credit2", "CC", "my second credit card", "12.34"),
             };

-            _groupDivMocks = new Dictionary<string, Mock<IWebElement>>();
-
-            _accountDivs = _startingValues
+            return _expectedAccountDetails
                 .GroupBy(d => d["accountType"])
-                .Select(CreateAccountGroupDivMock)
-                .ToList();
-
-            _webDriverMock = new Mock<IWebDriver>();
-            _webDriverMock.Setup(driver => driver.FindElements(By.ClassName("account-selector--group-container")))
-                .Returns(_accountDivs.AsReadOnly());
-
-            _pageFactoryMock = new Mock<IPageFactory>();
-
-            _positionsPage = new PositionsPage(_webDriverMock.Object, _pageFactoryMock.Object);
-        }
-
-        [Test]
-        public void ShouldReturnOneAccountPerAccountOnPage()
-        {
-            var accounts = _positionsPage.BuildAccounts().ToList();
-
-            Assert.AreEqual(_startingValues.Count(), accounts.Count());
-            foreach (var account in accounts)
-            {
-                var matchingValues = _startingValues.Single(values => values["accountNumber"] == account.AccountNumber);
-
-                Assert.AreEqual(matchingValues["accountName"], account.Name);
-                Assert.AreEqual(_accountTypeStrings[matchingValues["accountType"]], account.AccountType);
-                Assert.AreEqual(double.Parse(matchingValues["accountValue"]), account.MostRecentValue);
-            }
+                .Select(CreateAccountGroupDivs)
+                .ToList()
+                .AsReadOnly();
         }

         private Dictionary<string, string> CreateAccountValues(string accountNumber, string accountType,
@@ -96,40 +88,44 @@
             };
         }

-        private IWebElement CreateAccountGroupDivMock(
+        private IWebElement CreateAccountGroupDivs(
             IGrouping<string, IReadOnlyDictionary<string, string>> accountValuesByAccountType)
         {
-            var accountTypeString = accountValuesByAccountType.Key;
-
-            var accountGroupDiv = GetOrCreateAccountGroupDiv(accountTypeString);
-            accountGroupDiv.Setup(div => div.GetAttribute("data-group-id")).Returns(accountTypeString);
-            var accountDivs = CreateAccountDivs(accountValuesByAccountType, accountTypeString);
-            accountGroupDiv.Setup(div => div.FindElements(By.ClassName("js-account")))
-                .Returns(accountDivs.ToList().AsReadOnly());
-            return accountGroupDiv.Object;
+            var accountGroupDivMock = new Mock<IWebElement>();
+            accountGroupDivMock.Setup(div => div.GetAttribute("data-group-id")).Returns(accountValuesByAccountType.Key);
+            accountGroupDivMock.Setup(div => div.FindElements(By.ClassName("js-account")))
+                .Returns(CreateAccountDivs(accountValuesByAccountType));
+            return accountGroupDivMock.Object;
         }

-        private IEnumerable<IWebElement> CreateAccountDivs(
-            IEnumerable<IReadOnlyDictionary<string, string>> accountValues, string accountTypeString)
+        private ReadOnlyCollection<IWebElement> CreateAccountDivs(
+            IGrouping<string, IReadOnlyDictionary<string, string>> accountValuesByAccountType)
         {
-            return accountValues.Select(values =>
-            {
-                var accountDivMock = new Mock<IWebElement>();
-                accountDivMock.Setup(div => div.GetAttribute("data-acct-number"))
-                    .Returns(values["accountNumber"]);
-                accountDivMock.Setup(div => div.GetAttribute("data-acct-name"))
-                    .Returns(values["accountName"]);
-                accountDivMock.Setup(div => div.GetAttribute(_valueAttributeNames[accountTypeString]))
-                    .Returns(values["accountValue"]);
-                return accountDivMock.Object;
-            });
+            return accountValuesByAccountType
+                .Select(values => CreateWebElementForAccountValues(accountValuesByAccountType.Key, values))
+                .ToList()
+                .AsReadOnly();
         }

-        private Mock<IWebElement> GetOrCreateAccountGroupDiv(string accountTypeString)
+        private static IWebElement CreateWebElementForAccountValues(string accountType,
+            IReadOnlyDictionary<string, string> values)
         {
-            return _groupDivMocks.ContainsKey(accountTypeString)
-                ? _groupDivMocks[accountTypeString]
-                : new Mock<IWebElement>();
+            var valueAttributeNames = new Dictionary<string, string>
+            {
+                {"IA", "data-most-recent-value"},
+                {"RA", "data-most-recent-value"},
+                {"HS", "data-most-recent-value"},
+                {"OA", "data-most-recent-value"},
+                {"CC", "data-acct-balance"}
+            };
+            var accountDivMock = new Mock<IWebElement>();
+            accountDivMock.Setup(div => div.GetAttribute("data-acct-number"))
+                .Returns(values["accountNumber"]);
+            accountDivMock.Setup(div => div.GetAttribute("data-acct-name"))
+                .Returns(values["accountName"]);
+            accountDivMock.Setup(div => div.GetAttribute(valueAttributeNames[accountType]))
+                .Returns(values["accountValue"]);
+            return accountDivMock.Object;
         }
     }
 }


refactoring

refactoring

--- HCsbLib/HCsbLib/HTLib2/HDataStruc.Tree/LinkedAvlTree.cs
+++ HCsbLib/HCsbLib/HTLib2/HDataStruc.Tree/LinkedAvlTree.cs
@@ -14,15 +14,16 @@
         static int _debug = 0;
 #pragma warning restore 414

-        public class Node
+        // Linked-List Node
+        public class LLNode
         {
             public T    value;
-            public Node prev { get { return _prev; } }
-            public Node next { get { return _next; } }
-
-            internal Node _prev;
-            internal Node _next;
-            internal Node(T value, Node prev, Node next)
+            public LLNode prev { get { return _prev; } }
+            public LLNode next { get { return _next; } }
+
+            internal LLNode _prev;
+            internal LLNode _next;
+            internal LLNode(T value, LLNode prev, LLNode next)
             {
                 this.value = value;
                 this._prev = prev ;
@@ -35,28 +36,28 @@
             }
         }

-        Node head;
-        Node tail;
-        BTree.AvlTree<Node> avl;
+        LLNode head;
+        LLNode tail;
+        BTree.AvlTree<LLNode> avl;
         Comparison<T> comp;
-        int nodecomp(Node x, Node y) { return comp(x.value, y.value); }
+        int nodecomp(LLNode x, LLNode y) { return comp(x.value, y.value); }

         public LinkedAvlTree(Comparison<T> comp)
         {
             this.head = null;
             this.tail = null;
             this.comp = comp;
-            this.avl  = BTree.AvlTree<Node>.NewAvlTree(nodecomp);
+            this.avl  = BTree.AvlTree<LLNode>.NewAvlTree(nodecomp);
         }
         public static LinkedAvlTree<T> New(Comparison<T> comp)
         {
             return new LinkedAvlTree<T>(comp);
         }
-        public Node GetHead()
+        public LLNode GetHead()
         {
             return head;
         }
-        public Node GetTail()
+        public LLNode GetTail()
         {
             return tail;
         }
@@ -79,9 +80,9 @@
         {
             return (Search(query) != null);
         }
-        public Node Search(T query)
-        {
-            var nodequery = new Node(query, null, null);
+        public LLNode Search(T query)
+        {
+            var nodequery = new LLNode(query, null, null);

             var value = avl.Search(nodequery);

@@ -89,28 +90,28 @@
                 return null;
             return value.Value.value;
         }
-        public (Node value, Node parent_value) SearchWithParent(T query)
-        {
-            var nodequery = new Node(query, null, null);
+        public (LLNode value, LLNode parent_value) SearchWithParent(T query)
+        {
+            var nodequery = new LLNode(query, null, null);

             var (val, parent_val) = avl.SearchWithParent(nodequery);

-            Node value        = null; if(val        != null) value        = val       .Value.value;
-            Node parent_value = null; if(parent_val != null) parent_value = parent_val.Value.value;
+            LLNode value        = null; if(val        != null) value        = val       .Value.value;
+            LLNode parent_value = null; if(parent_val != null) parent_value = parent_val.Value.value;

             return (value, parent_value);
         }
-        public (Node value, (Node left_value, Node right_value)) SearchRange(T query, bool doassert=true)
-        {
-            var nodequery = new Node(query, null, null); ;
+        public (LLNode value, (LLNode left_value, LLNode right_value)) SearchRange(T query, bool doassert=true)
+        {
+            var nodequery = new LLNode(query, null, null); ;

             var (val, parent_val) = avl.SearchWithParent(nodequery);

-            Node value, left_value, right_value;
+            LLNode value, left_value, right_value;
             if(val == null)
             {
                 HDebug.Assert(parent_val != null);
-                Node parent_value = parent_val.Value.value;
+                LLNode parent_value = parent_val.Value.value;
                 int cmp = comp(query, parent_value.value);
                 HDebug.Assert(cmp != 0);
                 if(cmp < 0)
@@ -147,9 +148,9 @@
             }
             return (value, (left_value, right_value));
         }
-        public Node Insert(T value)
-        {
-            Node node = new Node(value, null, null);
+        public LLNode Insert(T value)
+        {
+            LLNode node = new LLNode(value, null, null);

             if(avl.IsEmpty() == true)
             {
@@ -185,8 +186,8 @@
                 }
                 else
                 {
-                    Node node_next = avlnode_successor.value.value;
-                    Node node_prev = node_next.prev;
+                    LLNode node_next = avlnode_successor.value.value;
+                    LLNode node_prev = node_next.prev;
                     HDebug.Assert(node_prev.next == node_next);
                     HDebug.Assert(node_next.prev == node_prev);
                     HDebug.Assert(nodecomp(node_prev, node_next) < 0);
@@ -200,33 +201,33 @@
             }
             return node;
         }
-        public List<Node> InsertRange(params T[] values)
+        public List<LLNode> InsertRange(params T[] values)
         {
             return InsertRange(values as IEnumerable<T>);
         }
-        public List<Node> InsertRange(IEnumerable<T> values)
-        {
-            List<Node> nodes = new List<Node>();
+        public List<LLNode> InsertRange(IEnumerable<T> values)
+        {
+            List<LLNode> nodes = new List<LLNode>();
             foreach(var value in values)
             {
-                Node node = Insert(value);
+                LLNode node = Insert(value);
                 nodes.Add(node);
             }
             return nodes;
         }
-        public Node Delete(T query)
-        {
-            var nodequery = new Node(query, null, null);
-
-            BTree.AvlTree<Node>.RetT? del = avl.Delete(nodequery);
+        public LLNode Delete(T query)
+        {
+            var nodequery = new LLNode(query, null, null);
+
+            BTree.AvlTree<LLNode>.RetT? del = avl.Delete(nodequery);
             if(del == null)
                 return null;

-            Node node = del.Value.value;
+            LLNode node = del.Value.value;

             return Delete_UpdateHeadTail(node);
         }
-        internal Node Delete_UpdateHeadTail(Node node)
+        internal LLNode Delete_UpdateHeadTail(LLNode node)
         {
             if(avl.IsEmpty())
             {
@@ -248,8 +249,8 @@
             }
             else
             {
-                Node node_prev = node.prev;
-                Node node_next = node.next;
+                LLNode node_prev = node.prev;
+                LLNode node_next = node.next;
                 node_prev._next = node_next;
                 node_next._prev = node_prev;
                 node._next = null;
@@ -271,16 +272,16 @@
         }
         public bool Validate(Comparison<T> comp_validate)
         {
-            int nodecomp_validate(Node x, Node y) { return comp_validate(x.value, y.value); }
+            int nodecomp_validate(LLNode x, LLNode y) { return comp_validate(x.value, y.value); }

             // check AVL validate
             if(avl.Validate(nodecomp_validate) == false) return false;

             // check linked-list validate
-            Node n = head;
+            LLNode n = head;
             while(n != null)
             {
-                Node n_next = n.next;
+                LLNode n_next = n.next;
                 if(n_next != null && (nodecomp_validate(n, n_next) <= 0) == false)
                     return false;
                 n = n_next;


Blah

Blah

svn path=/trunk/banshee/; revision=3511

--- Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -210,15 +210,6 @@
             // Render the background to the primary canvas.
             Theme.DrawListBackground (cairo_context, canvas_alloc, true);

-            for (int ci = 0; ci < column_cache.Length; ci++) {
-                ColumnHeaderCellText cell = column_cache[ci].Column.HeaderCell as ColumnHeaderCellText;
-                if (cell != null && cell.HasSort) {
-                    cairo_context.Rectangle (column_cache[ci].X1, list_rendering_alloc.Y, column_cache[ci].Width, list_rendering_alloc.Height);
-                    cairo_context.Color = new Cairo.Color (0, 0, 0, 0.2);
-                    cairo_context.Fill ();
-                }
-            }
-
             int first_row = top;
             int last_row = bottom;
             int first_row_y = 0;
@@ -280,6 +271,16 @@
             int selection_height = 0;
             int selection_y = 0;
             List<int> selected_rows = new List<int> ();
+
+            /* FIXME: Render the background under the sorted column
+            for (int ci = 0; ci < column_cache.Length; ci++) {
+                ColumnHeaderCellText cell = column_cache[ci].Column.HeaderCell as ColumnHeaderCellText;
+                if (cell != null && cell.HasSort) {
+                    cairo_context.Rectangle (column_cache[ci].X1, list_rendering_alloc.Y, column_cache[ci].Width, list_rendering_alloc.Height);
+                    cairo_context.Color = new Cairo.Color (0, 0, 0, 0.2);
+                    cairo_context.Fill ();
+                }
+            }*/

             for (int ri = first_row; ri < last_row; ri++) {
                 if (Selection.Contains (ri)) {


remove some comments for notifications

remove some comments for notifications

--- Permissions/Plugin.Permissions.Abstractions/PermissionEnums.cs
+++ Permissions/Plugin.Permissions.Abstractions/PermissionEnums.cs
@@ -58,16 +58,6 @@
         /// </summary>
         Microphone,
         /// <summary>
-        /// Android: Nothing
-        /// iOS: Notifications (local)
-        /// </summary>
-        //NotificationsLocal,
-        /// <summary>
-        /// Android: Nothing
-        /// iOS: Notifications (remote)
-        /// </summary>
-        //NotificationsRemote,
-        /// <summary>
         /// Android: Phone
         /// iOS: Nothing
         /// </summary>


changed the search for vendors

changed the search for vendors

--- Purchasing.Web/Views/Workgroup/_ExistingWorkgroupVendor.cshtml
+++ Purchasing.Web/Views/Workgroup/_ExistingWorkgroupVendor.cshtml
@@ -21,7 +21,11 @@

@Html.LabelFor(a => a.WorkgroupVendor.VendorId)

-                        @this.Select("WorkgroupVendor.VendorId").Options(Model.Vendors, x => x.Id, x => x.Name).FirstOption("--Select Vendor--").Selected(Model.WorkgroupVendor.VendorId)
+                        @*@this.Select("WorkgroupVendor.VendorId").Options(Model.Vendors, x => x.Id, x => x.Name).FirstOption("--Select Vendor--").Selected(Model.WorkgroupVendor.VendorId)*@
+
+                        <input type="text" id="VendorSearch"/>
+                        @Html.Hidden("WorkgroupVendor.VendorId")
+
                         @Html.ValidationMessageFor(a => a.WorkgroupVendor.VendorId)

@@ -29,7 +33,7 @@

@Html.LabelFor(a => a.WorkgroupVendor.VendorAddressTypeCode)

-                        @this.Select("WorkgroupVendor.VendorAddressTypeCode").FirstOption("--Select Address--").Options(Model.VendorAddresses).Selected(Model.WorkgroupVendor.VendorAddressTypeCode)
+                        @this.Select("WorkgroupVendor.VendorAddressTypeCode").FirstOption("--Select Address--").Options(Model.VendorAddresses).Selected(Model.WorkgroupVendor.VendorAddressTypeCode).Disabled(true)
                         @Html.ValidationMessageFor(a => a.WorkgroupVendor.VendorAddressTypeCode)

@@ -54,4 +58,75 @@

-}+}
+
+
+
+


SB-210 fix for owner history not being saved

--- Server/src/SchoolBusAPI/Services.Impl/SchoolBusOwnerService.cs
+++ Server/src/SchoolBusAPI/Services.Impl/SchoolBusOwnerService.cs
@@ -282,7 +282,9 @@
                 // force add
                 item.Id = 0;
                 schoolBusOwner.History.Add(item);
+
                 _context.SchoolBusOwners.Update(schoolBusOwner);
+                _context.SaveChanges();
             }

             result.HistoryText = item.HistoryText;


Support `[.]` syntax for lists (easier to insert on phones)

--- Source/AlephNote.App/WPF/ScintillaUtil/ScintillaHighlighter.cs
+++ Source/AlephNote.App/WPF/ScintillaUtil/ScintillaHighlighter.cs
@@ -99,6 +99,7 @@
 		{
 			Tuple.Create(' ', ListHighlightValue.FALSE),
 			Tuple.Create('_', ListHighlightValue.FALSE),
+			Tuple.Create('.', ListHighlightValue.FALSE),

 			Tuple.Create('x', ListHighlightValue.TRUE),
 			Tuple.Create('X', ListHighlightValue.TRUE),


Fix for AoE targeting

Fix for AoE targeting

The AoE targeting algorithm does not account for subclasses of the
target class, so it will fail if the ability is cast on them. This fixes
the error.

--- Source/AllModdingComponents/CompAbilityUser/Verb_UseAbility.cs
+++ Source/AllModdingComponents/CompAbilityUser/Verb_UseAbility.cs
@@ -73,11 +73,11 @@
                 //Handle friendly fire targets.
                 if (!this.UseAbilityProps.TargetAoEProperties.friendlyFire)
                 {
-                    targets = this.caster.Map.listerThings.AllThings.Where(x => (x.Position.InHorDistOf(aoeStartPosition, this.UseAbilityProps.TargetAoEProperties.range)) && (x.GetType() == this.UseAbilityProps.TargetAoEProperties.targetClass) && !x.Faction.HostileTo(Faction.OfPlayer)).ToList<Thing>();
+                    targets = this.caster.Map.listerThings.AllThings.Where(x => (x.Position.InHorDistOf(aoeStartPosition, this.UseAbilityProps.TargetAoEProperties.range)) && (this.UseAbilityProps.TargetAoEProperties.targetClass.IsAssignableFrom(x.GetType())) && !x.Faction.HostileTo(Faction.OfPlayer)).ToList<Thing>();
                 }
                 else if ((this.UseAbilityProps.TargetAoEProperties.targetClass == typeof(Plant)) || (this.UseAbilityProps.TargetAoEProperties.targetClass == typeof(Building)))
                 {
-                    targets = this.caster.Map.listerThings.AllThings.Where(x => (x.Position.InHorDistOf(aoeStartPosition, this.UseAbilityProps.TargetAoEProperties.range)) && (x.GetType() == this.UseAbilityProps.TargetAoEProperties.targetClass)).ToList<Thing>();
+                    targets = this.caster.Map.listerThings.AllThings.Where(x => (x.Position.InHorDistOf(aoeStartPosition, this.UseAbilityProps.TargetAoEProperties.range)) && (this.UseAbilityProps.TargetAoEProperties.targetClass.IsAssignableFrom(x.GetType()))).ToList<Thing>();
                     foreach (Thing targ in targets)
                     {
                         LocalTargetInfo tinfo = new LocalTargetInfo(targ);
@@ -91,7 +91,7 @@
                     targets.Clear();
                     targets = this.caster.Map.listerThings.AllThings.Where(x =>
                         (x.Position.InHorDistOf(aoeStartPosition, this.UseAbilityProps.TargetAoEProperties.range)) &&
-                        (x.GetType() == this.UseAbilityProps.TargetAoEProperties.targetClass) &&
+                        (this.UseAbilityProps.TargetAoEProperties.targetClass.IsAssignableFrom(x.GetType())) &&
                         (x.HostileTo(Faction.OfPlayer) || this.UseAbilityProps.TargetAoEProperties.friendlyFire)).ToList<Thing>();
                 }