BUG: Lucene.Net.Util.OfflineSorter: Added line to delete the output file (that existed in Lucene).

--- src/Lucene.Net/Util/OfflineSorter.cs
+++ src/Lucene.Net/Util/OfflineSorter.cs
@@ -251,9 +251,7 @@
         {
             sortInfo = new SortInfo(this) { TotalTime = Environment.TickCount };

-            // LUCENENET NOTE: Can't do this because another thread could recreate the file before we are done here.
-            // and cause this to bomb. We use the existence of the file as an indicator that we are done using it.
-            //output.Delete(); // LUCENENET TODO: BUG: Put this back in (we now have thread-safe file creation, so this should be like the original).
+            output.Delete();

             var merges = new List<FileInfo>();
             bool success2 = false;


Restore parallelism for content processing

--- src/Lunet.Core/Core/ContentPlugin.cs
+++ src/Lunet.Core/Core/ContentPlugin.cs
@@ -249,6 +249,7 @@

                     using (var stream = outputFile.Open(FileMode.Create, FileAccess.Write))
                     {
+                        stream.WriteStringOptimized(fromFile.Content, Encoding.Default);
                         stream.Flush();

                         // Update statistics
@@ -529,7 +530,7 @@
     {
         // Uncomment to dispatch on multithread
         //const int MaxDegreeOfParallelism = DataflowBlockOptions.Unbounded;
-        const int MaxDegreeOfParallelism = 1;
+        //const int MaxDegreeOfParallelism = 1;

         // Run script content asynchronously
         var contentRunnerBlock = new ActionBlock<ContentObject>(


2012-08-25  Maurits Rijk  <maurits.rijk@gmail.com>

	* lib/GradientSegment.cs: removed unused parameters.

--- lib/GradientSegment.cs
+++ lib/GradientSegment.cs
@@ -1,5 +1,5 @@
 // GIMP# - A C# wrapper around the GIMP Library
-// Copyright (C) 2004-2011 Maurits Rijk
+// Copyright (C) 2004-2012 Maurits Rijk
 //
 // GradientSegment.cs
 //
@@ -37,7 +37,7 @@
       _gradient.SegmentSetLeftColor(_segment, color, opacity);
     }

-    public RGB GetLeftColor(RGB color, out double opacity)
+    public RGB GetLeftColor(out double opacity)
     {
       return _gradient.SegmentGetLeftColor(_segment, out opacity);
     }
@@ -47,7 +47,7 @@
       _gradient.SegmentSetRightColor(_segment, color, opacity);
     }

-    public RGB GetRightColor(RGB color, out double opacity)
+    public RGB GetRightColor(out double opacity)
     {
       return _gradient.SegmentGetRightColor(_segment, out opacity);
     }


Whitespace

Whitespace

--- Localization/StringDump.cs
+++ Localization/StringDump.cs
@@ -17,11 +17,11 @@
         private string _currentForm;

         private static readonly List<string> MicrosoftTokens = new List<string>
-                                                {
-                                                    BitConverter.ToString(new byte[] {0xb7, 0x7a, 0x5c, 0x56, 0x19, 0x34, 0xe0, 0x89}),
-                                                    BitConverter.ToString(new byte[] {0x31, 0xbf, 0x38, 0x56, 0xad, 0x36, 0x4e, 0x35}),
-                                                    BitConverter.ToString(new byte[] {0xb0, 0x3f, 0x5f, 0x7f, 0x11, 0xd5, 0x0a, 0x3a})
-                                                };
+            {
+                BitConverter.ToString(new byte[] {0xb7, 0x7a, 0x5c, 0x56, 0x19, 0x34, 0xe0, 0x89}),
+                BitConverter.ToString(new byte[] {0x31, 0xbf, 0x38, 0x56, 0xad, 0x36, 0x4e, 0x35}),
+                BitConverter.ToString(new byte[] {0xb0, 0x3f, 0x5f, 0x7f, 0x11, 0xd5, 0x0a, 0x3a})
+            };

         public IEnumerable<string> FailedControls
         {
@@ -44,12 +44,12 @@

         private Control CreateControlWithoutConstructor(Type asmType)
         {
+            //Huge hack coming through: we'll create an object without initializing it, then load the constructor from the base type (form) and call it on the derived type
+            //Then we'll manually call InitializeComponent... if it exists :)
+
             try
             {
                 Control control = (Form) FormatterServices.GetUninitializedObject(asmType);
-
-                //Huge hack coming through: we'll load the constructor from the base type (form), then call it on the derived type
-                //Then we'll manually call InitializeComponent... if it exists :)

                 var ctor = typeof (Form).GetConstructor(new Type[] {});
                 Debug.Assert(ctor != null);
@@ -57,7 +57,7 @@
                 ctor.Invoke(control, new object[] {});

                 var initComponent = asmType.GetMethod(@"InitializeComponent",
-                                                      BindingFlags.Public | BindingFlags.Instance | BindingFlags.Default | BindingFlags.NonPublic);
+                    BindingFlags.Public | BindingFlags.Instance | BindingFlags.Default | BindingFlags.NonPublic);
                 if (initComponent == null)
                     return null;


[add]: add comments

[add]: add comments

--- block-program/Communication/Robot/StraightCommand.cs
+++ block-program/Communication/Robot/StraightCommand.cs
@@ -11,7 +11,13 @@
     /// </summary>
     class StraightCommand : MoveCommand
     {
+        /// <summary>
+        /// 速さを表すパラメータ。1.0で最大
+        /// </summary>
         public float Velocity { get; set; }
+        /// <summary>
+        /// 回転数を表すパラメータ。1で1ブロック分進むかも
+        /// </summary>
         public float Time { get; set; }
         public StraightCommand()
         {


Add empty iterator test

Add empty iterator test

--- source/Handlebars.Test/IntegrationTests.cs
+++ source/Handlebars.Test/IntegrationTests.cs
@@ -67,6 +67,18 @@
             var result = template(data);
             Assert.AreEqual("Hello,\n- Erik\n- Helen", result);
         }
+
+        [Test]
+        public void BasicEmptyIterator()
+        {
+            var source = "Hello,{{each people}}\n- {{name}}{{else}} (no one listed){{/each}}";
+            var template = Handlebars.Compile(source);
+            var data = new {
+                people = new object[]{}
+            };
+            var result = template(data);
+            Assert.AreEqual("Hello, (no one listed)", result);
+        }
     }
 }


dynamic static call invokes __callStatic if __call is not defined

in case we have $this reference

--- src/Peachpie.Runtime/Dynamic/CallBinder.cs
+++ src/Peachpie.Runtime/Dynamic/CallBinder.cs
@@ -358,7 +358,14 @@
                 type = bound.CurrentTargetInstance.GetPhpTypeInfo();
             }

-            var call = BinderHelpers.FindMagicMethod(type, (bound.TargetInstance == null) ? TypeMethods.MagicMethods.__callstatic : TypeMethods.MagicMethods.__call);
+            // try to find __call() first if we have $this
+            var call = (bound.TargetInstance != null) ? BinderHelpers.FindMagicMethod(type, TypeMethods.MagicMethods.__call) : null;
+            if (call == null)
+            {
+                // look for __callStatic()
+                call = BinderHelpers.FindMagicMethod(type, TypeMethods.MagicMethods.__callstatic);
+            }
+
             if (call != null)
             {
                 Expression[] call_args;


fixed bug in min/max extra tiles logic.

fixed bug in min/max extra tiles logic.

--- Mapsui/Layers/TileLayer.cs
+++ Mapsui/Layers/TileLayer.cs
@@ -166,9 +166,9 @@
             if (_minExtraTiles >= 0 && _maxExtraTiles >= 0 &&
                 _numberTilesNeeded != _tileFetcher.NumberTilesNeeded)
             {
+                _numberTilesNeeded = _tileFetcher.NumberTilesNeeded;
                 _memoryCache.MinTiles = _numberTilesNeeded + _minExtraTiles;
                 _memoryCache.MaxTiles = _numberTilesNeeded + _maxExtraTiles;
-                _numberTilesNeeded = _tileFetcher.NumberTilesNeeded;
             }
         }


Adding try catch around TileLayer initializer

--- Mapsui/Layers/TileLayer.cs
+++ Mapsui/Layers/TileLayer.cs
@@ -27,6 +27,7 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
+using Mapsui.Logging;

 namespace Mapsui.Layers
 {
@@ -44,7 +45,17 @@

         public TileLayer(Func<ITileSource> tileSourceInitializer) : this()
         {
-            Task.Run(() => SetTileSource(tileSourceInitializer()));
+            Task.Run(() =>
+            {
+                try
+                {
+                    SetTileSource(tileSourceInitializer());
+                }
+                catch (Exception e)
+                {
+                    Logger.Log(LogLevel.Debug, $"Initialization of layer {Name} failed: {e.Message}");
+                }
+            });
         }

         public TileLayer(ITileSource source = null, int minTiles = 200, int maxTiles = 300, int maxRetries = TileFetcher.DefaultMaxAttempts, IFetchStrategy fetchStrategy = null,


expose internals to Mono.Cecil.Pdb and Mono.Cecil.Mdb


Fix wrong device changed via Coin context menu - use binding not index

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -1769,7 +1769,7 @@

             foreach (ListViewItem selectedItem in deviceListView.SelectedItems)
             {
-                DeviceViewModel deviceViewModel = viewModelToView.Devices[selectedItem.Index];
+                DeviceViewModel deviceViewModel = (DeviceViewModel)selectedItem.Tag;
                 devices.Add(deviceViewModel);
             }


Add error handling for UDP broadcast with no network connection on Linux

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -2826,7 +2826,16 @@
             Remoting.Server.Data.Transfer.Machine machine = new Remoting.Server.Data.Transfer.Machine();
             machine.TotalScryptHashrate = GetTotalHashrate(CoinAlgorithm.Scrypt);
             machine.TotalSha256Hashrate = GetTotalHashrate(CoinAlgorithm.SHA256);
-            Remoting.Server.Broadcast.Broadcaster.Broadcast(machine);
+
+            try
+            {
+                Remoting.Server.Broadcast.Broadcaster.Broadcast(machine);
+            }
+            catch (SocketException ex)
+            {
+                //e.g. no network connection on Linux
+                ShowMultiMinerRemotingError(ex);
+            }
         }

         private void DisableRemoting()
@@ -3250,15 +3259,33 @@
             discoveryListener.InstanceOnline += HandleInstanceOnline;
             discoveryListener.InstanceOffline += HandleInstanceOffline;
             discoveryListener.Listen(fingerprint);
-            Broadcaster.Broadcast(Verbs.Online, fingerprint);
+
+            try
+            {
+                Broadcaster.Broadcast(Verbs.Online, fingerprint);
+            }
+            catch (SocketException ex)
+            {
+                //e.g. no network connection on Linux
+                ShowMultiMinerRemotingError(ex);
+            }
         }

         private void StopDiscovery()
         {
             if (discoveryListener != null)
                 discoveryListener.Stop();
+
             //broadcast after so we aren't needless processing our own message
-            Broadcaster.Broadcast(Verbs.Offline, fingerprint);
+            try
+            {
+                Broadcaster.Broadcast(Verbs.Offline, fingerprint);
+            }
+            catch (SocketException ex)
+            {
+                //e.g. no network connection on Linux
+                ShowMultiMinerRemotingError(ex);
+            }
         }

         private void HandleInstanceOnline(object sender, InstanceChangedArgs ea)


Refactoring

Refactoring

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -176,6 +176,11 @@

         private void stopButton_Click(object sender, EventArgs e)
         {
+            StopMining();
+        }
+
+        private void StopMining()
+        {
             miningEngine.StopMining();
             statsTimer.Enabled = false;

@@ -184,6 +189,11 @@
         }

         private void startButton_Click(object sender, EventArgs e)
+        {
+            StartMining();
+        }
+
+        private void StartMining()
         {
             miningEngine.StartMining(engineConfiguration);
             statsTimer.Enabled = true;


Added OpenFile to NTFSParser

Added OpenFile to NTFSParser

--- NTFSLib/NTFS/NTFSParser.cs
+++ NTFSLib/NTFS/NTFSParser.cs
@@ -9,6 +9,7 @@
 using NTFSLib.Objects.Attributes;
 using NTFSLib.Objects.Enums;
 using NTFSLib.Objects.Specials;
+using NTFSLib.Provider;
 using Attribute = NTFSLib.Objects.Attributes.Attribute;

 namespace NTFSLib.NTFS
@@ -63,6 +64,7 @@
             BytesPrFileRecord = _boot.MFTRecordSizeBytes;
             _sectorsPrRecord = _boot.MFTRecordSizeBytes / _boot.BytesPrSector;
         }
+
         private void InitiateMFT()
         {
             // Read first FileRecord
@@ -88,6 +90,7 @@
             CurrentMftRecordNumber = 0;
             FileRecordCount = (uint)(_mftStream.Length / BytesPrFileRecord);
         }
+
         public void InitiateRecordBitarray()
         {
             if (_usedRecords != null)
@@ -163,5 +166,32 @@
                 yield return record;
             }
         }
+
+        public Stream OpenFileDataStream(Stream diskStream, FileRecord record, string dataStream = "")
+        {
+            Debug.Assert(record != null);
+
+            // Get all DATA attributes
+            List<AttributeData> dataAttribs = record.Attributes.OfType<AttributeData>().Where(s => s.AttributeName == dataStream).ToList();
+
+            if (!dataAttribs.Any())
+            {
+                return new MemoryStream();
+            }
+
+            if (dataAttribs.Count == 1 && dataAttribs[0].NonResidentFlag == ResidentFlag.Resident)
+            {
+                return new MemoryStream(dataAttribs[0].DataBytes);
+            }
+
+            Debug.Assert(dataAttribs.All(s => s.NonResidentFlag == ResidentFlag.NonResident));
+
+            DataFragment[] fragments = dataAttribs.SelectMany(s => s.DataFragments).OrderBy(s => s.StartingVCN).ToArray();
+
+            ushort compressionUnitSize = dataAttribs[0].NonResidentHeader.CompressionUnitSize;
+            ushort compressionClusterCount = (ushort)(compressionUnitSize == 0 ? 0 : Math.Pow(2, compressionUnitSize));
+
+            return new NtfsDiskStream(diskStream, true, fragments, BytesPrCluster, compressionClusterCount, (long)dataAttribs[0].NonResidentHeader.ContentSize);
+        }
     }
 }


expand supported escape chars in NameValueHttpHeader


Added method to resize a message buffer.

--- NtApiDotNet/AlpcMessage.cs
+++ NtApiDotNet/AlpcMessage.cs
@@ -96,6 +96,9 @@
     public class AlpcMessage
     {
         #region Private Members
+
+        static readonly int _header_size = Marshal.SizeOf(typeof(AlpcPortMessage));
+
         private byte[] _data;
         private NtAlpc _port;
         #endregion
@@ -149,10 +152,46 @@
             FromSafeBuffer(buffer, port);
         }

+        #endregion
+
+        #region Private Members
+
         private void UpdateHeaderLength()
         {
-            Header.u1.TotalLength = (short)(Marshal.SizeOf(typeof(AlpcPortMessage)) + _data.Length);
+            Header.u1.TotalLength = (short)(_header_size + _data.Length);
             Header.u1.DataLength = (short)_data.Length;
+        }
+
+        #endregion
+
+        #region Public Properties
+
+        /// <summary>
+        /// Resize the buffer to a new size.
+        /// </summary>
+        /// <param name="new_size">The new size of the buffer including the header.</param>
+        /// <param name="update_header">True to update the header length fields.</param>
+        public void Resize(int new_size, bool update_header)
+        {
+            if (new_size < _header_size)
+            {
+                throw new ArgumentException("Size must include header size", nameof(new_size));
+            }
+
+            Array.Resize(ref _data, new_size - _header_size);
+            if (update_header)
+            {
+                UpdateHeaderLength();
+            }
+        }
+
+        /// <summary>
+        /// Resize the buffer to a new size and update header.
+        /// </summary>
+        /// <param name="new_size">The new size of the buffer including the header.</param>
+        public void Resize(int new_size)
+        {
+            Resize(new_size, true);
         }

         #endregion


Extracted method emitInitialBlackSideToMoveEllipsis().

--- Sandra.UI.WF.Chess/MovesTextBox.cs
+++ Sandra.UI.WF.Chess/MovesTextBox.cs
@@ -148,6 +148,17 @@
             SelectionFont = newFont;
         }

+        private IEnumerable<TextElement> emitInitialBlackSideToMoveEllipsis(int plyCount)
+        {
+            if (plyCount % 2 == 1)
+            {
+                // Add an ellipsis for the previous white move.
+                yield return new TextElement.MoveCounter(plyCount / 2 + 1);
+                yield return new TextElement.InitialBlackSideToMoveEllipsis();
+                yield return new TextElement.Space();
+            }
+        }
+
         private IEnumerable<TextElement> emitMoveTree(Chess.Game game)
         {
             Chess.MoveTree current = game.MoveTree;
@@ -155,13 +166,7 @@
             {
                 if (current.MainLine.MoveIndex == 0)
                 {
-                    if (current.PlyCount % 2 == 1)
-                    {
-                        // Add an ellipsis for the previous white move.
-                        yield return new TextElement.MoveCounter(current.PlyCount / 2 + 1);
-                        yield return new TextElement.InitialBlackSideToMoveEllipsis();
-                        yield return new TextElement.Space();
-                    }
+                    foreach (var element in emitInitialBlackSideToMoveEllipsis(current.PlyCount)) yield return element;
                 }
                 else
                 {


Added BackColor and ForeColor properties to TextElementStyle.

--- Sandra.UI.WF.Chess/MovesTextBox.cs
+++ Sandra.UI.WF.Chess/MovesTextBox.cs
@@ -32,6 +32,12 @@
     {
         private sealed class TextElementStyle
         {
+            public bool HasBackColor { get; set; }
+            public Color BackColor { get; set; }
+
+            public bool HasForeColor { get; set; }
+            public Color ForeColor { get; set; }
+
             public bool HasFont => Font != null;
             public Font Font { get; set; }
         }


Shortcut legacy if-test if argument is a lone identifier.

https://github.com/polyethene/IronAHK/issues#issue/30

--- Scripting/Parser/Construct/Flow.cs
+++ Scripting/Parser/Construct/Flow.cs
@@ -353,14 +353,7 @@

             while (i < code.Length && IsSpace(code[i])) i++;

-            if (i == code.Length)
-            {
-                buf.Append(Not);
-                buf.Append(Equal);
-                buf.Append(StringBound);
-                buf.Append(StringBound);
-            }
-            else
+            if (i != code.Length) // if test argument is not a lone identifier then it is an expression
             {
                 var op = new[] { Equal, Not, Greater, Less };


Added back NUnit tests to test the object graphs for each scene.  Also cleaned up some installers some more

--- Scripts/Binders/ReferenceBinder.cs
+++ Scripts/Binders/ReferenceBinder.cs
@@ -163,9 +163,10 @@
         // Creates a new game object and adds the given type as a new component on it
         public BindingConditionSetter ToSingleGameObject<TConcrete>(string name) where TConcrete : MonoBehaviour, TContract
         {
-            if (!_contractType.IsSubclassOf(typeof(MonoBehaviour)))
+            if (!typeof(TConcrete).DerivesFrom(typeof(MonoBehaviour)))
             {
-                throw new ZenjectBindException("Expected MonoBehaviour derived type when binding type '{0}'".With(_contractType.Name()));
+                throw new ZenjectBindException(
+                    "Expected MonoBehaviour derived type when binding type '{0}'".With(typeof(TConcrete).Name()));
             }

             return ToProvider(new GameObjectSingletonProvider<TConcrete>(_container, name));


namespace correction

namespace correction

--- Scripts/Utilities/IndexWrapping.cs
+++ Scripts/Utilities/IndexWrapping.cs
@@ -25,7 +25,7 @@
 using System;
 using senritsu.UnityGridTools.Scripts.IntVectors;

-namespace Assets.UnityGridTools.Scripts.Utilities
+namespace senritsu.UnityGridTools.Scripts.Utilities
 {
     public static class IndexWrapping
     {


Lock when setting exception from potentially multiple threads

--- src/Moya/Runners/StressTestRunner.cs
+++ src/Moya/Runners/StressTestRunner.cs
@@ -15,6 +15,11 @@
     /// </summary>
     internal class StressTestRunner : IStressTestRunner
     {
+        /// <summary>
+        /// Lock used when setting exception from potentially many threads.
+        /// </summary>
+        private readonly object _lock = new object();
+
         /// <summary>
         /// A list of threads, each running the same method, potentially multiple times.
         /// The amount of threads will equal the value of the <see cref="Users"/> property.
@@ -126,7 +131,7 @@
         /// </summary>
         /// <param name="action"></param>
         /// <param name="exception"></param>
-        private static void SafeExecute(Action action, out Exception exception)
+        private void SafeExecute(Action action, out Exception exception)
         {
             exception = null;

@@ -136,7 +141,10 @@
             }
             catch (Exception ex)
             {
-                exception = ex;
+                lock (_lock)
+                {
+                    exception = ex;
+                }
             }
         }
     }


Handle NoBackslashEscapes for binay parameter values.

See mysql-net/MySqlConnector#999

Signed-off-by: kpreisser <20fde4e3a1b5b6f3832b469f4108f89305784c94@users.noreply.github.com>

--- src/MySqlConnector/MySqlParameter.cs
+++ src/MySqlConnector/MySqlParameter.cs
@@ -305,7 +305,7 @@
 				var length = inputSpan.Length + BinaryBytes.Length + 1;
 				foreach (var by in inputSpan)
 				{
-					if (by is 0x27 or 0x5C)
+					if (by is 0x27 || by is 0x5C && !noBackslashEscapes)
 						length++;
 				}

@@ -314,8 +314,8 @@
 				var index = BinaryBytes.Length;
 				foreach (var by in inputSpan)
 				{
-					if (by is 0x27 or 0x5C)
-						outputSpan[index++] = 0x5C;
+					if (by is 0x27 || by is 0x5C && !noBackslashEscapes)
+						outputSpan[index++] = by;
 					outputSpan[index++] = by;
 				}
 				outputSpan[index++] = 0x27;


- v11.0.3

- v11.0.3

--- Shuttle.Core.Data/DataRowMapper.cs
+++ Shuttle.Core.Data/DataRowMapper.cs
@@ -84,7 +84,16 @@
                         continue;
                     }

-                    pi.SetValue(result, value, null);
+                    if (value == DBNull.Value)
+                    {
+                        value = null;
+                    }
+
+                    if (value != null ||
+                        Nullable.GetUnderlyingType(pi.PropertyType) != null)
+                    {
+                        pi.SetValue(result, value, null);
+                    }
                 }
                 catch
                 {


LA: Matrix.ClearSubMatrix should nop-return instead of fail on empty/negative selection

--- src/Numerics/LinearAlgebra/Matrix.cs
+++ src/Numerics/LinearAlgebra/Matrix.cs
@@ -177,14 +177,10 @@
         /// </summary>
         public void ClearSubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount)
         {
-            if (rowCount < 1)
-            {
-                throw new ArgumentOutOfRangeException("rowCount", Resources.ArgumentMustBePositive);
-            }
-
-            if (columnCount < 1)
-            {
-                throw new ArgumentOutOfRangeException("columnCount", Resources.ArgumentMustBePositive);
+            if (rowCount < 1 || columnCount < 1)
+            {
+                // nothing to do (but no need to fail either)
+                return;
             }

             if (rowIndex + rowCount > RowCount || rowIndex < 0)


sdk: versioning composer deps notes

sdk: versioning composer deps notes

--- src/Peachpie.NET.Sdk/ComposerTask.cs
+++ src/Peachpie.NET.Sdk/ComposerTask.cs
@@ -260,7 +260,7 @@
                 yield return new TaskItem("PackageDependency", new Dictionary<string, string>()
                 {
                     { "Name", IdToNuGetId(r.Key) },
-                    { "Version", VersionRangeToNuGetVersion(r.Value.Value) },
+                    { "Version", VersionRangeToPackageVersion(r.Value.Value) },
                 });
             }
         }
@@ -275,9 +275,12 @@
             return value.Replace('/', '.');
         }

-        string VersionRangeToNuGetVersion(string value)
-        {
-            // TODO see https://getcomposer.org/doc/articles/versions.md
+        string VersionRangeToPackageVersion(string value)
+        {
+            // https://getcomposer.org/doc/articles/versions.md
+            // https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#floating-versions
+
+            // convert composer version constraint to a floating version:

             //*
             //>= 1.0


try to fix signalR

try to fix signalR

--- CarModsHeaven/CarModsHeaven/CarModsHeaven.Web/Views/Discussions/Index.cshtml
+++ CarModsHeaven/CarModsHeaven/CarModsHeaven.Web/Views/Discussions/Index.cshtml
@@ -16,15 +16,16 @@

 }


improved server state collecting for AppDomainAppServer

--- SocketEngine/AppDomainAppServer.cs
+++ SocketEngine/AppDomainAppServer.cs
@@ -209,25 +209,48 @@
             get
             {
                 if (m_AppServer == null)
-                    return null;
+                {
+                    return GetStoppedState();
+                }

                 return m_AppServer.State;
             }
         }

+        private ServerState m_PrevState;
+        private ServerState m_StoppedState;
+
+        private ServerState GetStoppedState()
+        {
+            if (m_StoppedState != null)
+            {
+                m_StoppedState = new ServerState
+                {
+                    Name = Name,
+                    IsRunning = false
+                };
+
+                if (m_PrevState != null)
+                {
+                    m_StoppedState.Listeners = m_PrevState.Listeners;
+                }
+            }
+
+            return m_StoppedState;
+        }
+
         ServerState IServerStateSource.CollectServerState(GlobalPerformanceData globalPerfData)
         {
             if (m_AppServer == null)
             {
-                return new ServerState
-                {
-                    Name = Name,
-                    IsRunning = false,
-                    CollectedTime = DateTime.Now
-                };
-            }
-
-            return m_AppServer.CollectServerState(globalPerfData);
+                var stoppedState = GetStoppedState();
+                stoppedState.CollectedTime = DateTime.Now;
+                return stoppedState;
+            }
+
+            var currentState = m_AppServer.CollectServerState(globalPerfData);
+            m_PrevState = currentState;
+            return currentState;
         }
     }
 }


IIS7AppPool.cs: Adding RetryCount for Start from thpert


Implemented the show-reports option (Issue 9: http://code.google.com/p/mb-unit/issues/detail?id=9)

--- src/Runners/MbUnit.Echo/MainClass.cs
+++ src/Runners/MbUnit.Echo/MainClass.cs
@@ -14,6 +14,7 @@
 // limitations under the License.

 using System;
+using System.Diagnostics;
 using System.Reflection;
 using Castle.Core.Logging;
 using MbUnit.Core.Reporting;
@@ -109,6 +110,7 @@

                 int result = testRunnerHelper.Run();
                 DisplayResultSummary(testRunnerHelper, result);
+                OpenReports(testRunnerHelper);

                 return result;
             }
@@ -126,6 +128,18 @@
                     break;
             }
             Console.WriteLine("\n" + testRunnerHelper.ResultSummary + "\n");
+        }
+
+        private void OpenReports(TestRunnerHelper testRunnerHelper)
+        {
+            if (arguments.ShowReports)
+            {
+                Console.WriteLine("Opening reports.");
+                foreach (string reportType in arguments.ReportTypes)
+                {
+                    Process.Start(testRunnerHelper.GetReportFilename(reportType));
+                }
+            }
         }

         private void SetUpLogger()


Removed default connection URL from the library

--- src/Sancho.Client.Core/Connection.cs
+++ src/Sancho.Client.Core/Connection.cs
@@ -9,7 +9,7 @@
 {
     public class Connection : IConnection
     {
-        public static string ProtocolUrl { get; } = "http://sanchoprotocol-dev.azurewebsites.net/";
+        public static string ProtocolUrl { get; set; }

         public string ApiKey { get; }
         public string DeviceId { get; private set; }


Wake does not wait additional time after last machine is woken.

--- Source/MagiWol/WakeProgressForm.cs
+++ Source/MagiWol/WakeProgressForm.cs
@@ -42,14 +42,16 @@
                         return;
                     }

-                    int percent = (i * Settings.WolCount + j) * 100 / (this._addresses.Count * Settings.WolCount);
-                    worker.ReportProgress(percent, "Waking " + iAddress.Title + "...");
                     if (j != 0) {
                         System.Threading.Thread.Sleep(Settings.WolSleepInterval);
                     }
                     Magic.SendMagicPacket(iAddress);
+
+                    int percent = (i * Settings.WolCount + j + 1) * 100 / (this._addresses.Count * Settings.WolCount);
+                    worker.ReportProgress(percent, "Waking " + iAddress.Title + "...");
                 }
-                if (this.PauseInSeconds > 0) {
+
+                if ((this.PauseInSeconds > 0) && (i < this._addresses.Count - 1)) {
                     swPause.Reset();
                     swPause.Start();
                     int lastSecondsRemaining = -1;


Addressed issues with regex encapsulation

--- src/Searchlight.MongoDB/MongoDbExecutor.cs
+++ src/Searchlight.MongoDB/MongoDbExecutor.cs
@@ -152,13 +152,13 @@
                             return Builders<T>.Filter.Lte(criteria.Column.FieldName, rawValue);
                         case OperationType.Contains:
                             return Builders<T>.Filter.Regex(criteria.Column.FieldName,
-                                new BsonRegularExpression($"/{rawValue}/", "i"));
+                                new BsonRegularExpression((string)rawValue, "i"));
                         case OperationType.StartsWith:
                             return Builders<T>.Filter.Regex(criteria.Column.FieldName,
-                                new BsonRegularExpression($"/^{rawValue}/", "i"));
+                                new BsonRegularExpression((string)rawValue, "i"));
                         case OperationType.EndsWith:
                             return Builders<T>.Filter.Regex(criteria.Column.FieldName,
-                                new BsonRegularExpression($"/{rawValue}$/", "i"));
+                                new BsonRegularExpression((string)rawValue, "i"));
                         default:
                             throw new NotImplementedException();
                     }


Added support for multiple authentications schemes in HttpServer (#10)

--- Source/Platibus/Http/HttpServer.cs
+++ Source/Platibus/Http/HttpServer.cs
@@ -38,28 +38,26 @@
         private readonly HttpListener _httpListener;
         private readonly IHttpResourceRouter _router;

-        public HttpServer(string sectionName = null)
+        public HttpServer(string sectionName = null, AuthenticationSchemes authenticationSchemes = AuthenticationSchemes.Anonymous)
         {
             var bus = Bootstrapper.InitBus(sectionName).ConfigureAwait(false).GetAwaiter().GetResult();
             Shutdown += (source, e) => bus.Dispose();

             _router = InitDefaultRouter(bus);
             _baseUri = bus.BaseUri;
-            _httpListener = InitHttpListener();
-            _httpListener.Prefixes.Add(_baseUri.ToString());
-        }
-
-        public HttpServer(Bus bus)
+            _httpListener = InitHttpListener(_baseUri, authenticationSchemes);
+        }
+
+        public HttpServer(Bus bus, AuthenticationSchemes authenticationSchemes = AuthenticationSchemes.Anonymous)
         {
             if (bus == null) throw new ArgumentNullException("bus");

             _router = InitDefaultRouter(bus);
             _baseUri = bus.BaseUri;
-            _httpListener = InitHttpListener();
-            _httpListener.Prefixes.Add(_baseUri.ToString());
-        }
-
-        public HttpServer(Uri baseUri, IHttpResourceRouter router)
+            _httpListener = InitHttpListener(_baseUri, authenticationSchemes);
+        }
+
+        public HttpServer(Uri baseUri, IHttpResourceRouter router, AuthenticationSchemes authenticationSchemes = AuthenticationSchemes.Anonymous)
         {
             if (router == null) throw new ArgumentNullException("router");
             if (baseUri == null)
@@ -69,8 +67,7 @@

             _router = router;
             _baseUri = baseUri;
-            _httpListener = InitHttpListener();
-            _httpListener.Prefixes.Add(baseUri.ToString());
+            _httpListener = InitHttpListener(_baseUri, authenticationSchemes);
         }

         public Uri BaseUri
@@ -89,9 +86,13 @@
             };
         }

-        private static HttpListener InitHttpListener()
-        {
-            var httpListener = new HttpListener();
+        private static HttpListener InitHttpListener(Uri baseUri, AuthenticationSchemes authenticationSchemes)
+        {
+            var httpListener = new HttpListener
+            {
+                AuthenticationSchemes = authenticationSchemes
+            };
+            httpListener.Prefixes.Add(baseUri.ToString());
             return httpListener;
         }


Fixes very strange issue of FirstOrDefault not actually returning 'null' when it is actually null, never seen anything like it and PropertyType is not a value type so should be null. real strange.

--- src/Umbraco.Core/PublishedContentHelper.cs
+++ src/Umbraco.Core/PublishedContentHelper.cs
@@ -77,6 +77,10 @@
                 {
                     var result = applicationContext.Services.ContentTypeService.GetContentType(docTypeAlias);
                     if (result == null) return Guid.Empty;
+                    if (!result.PropertyTypes.Any(x => x.Alias.InvariantEquals(propertyAlias)))
+                    {
+                        return Guid.Empty;
+                    }
                     var property = result.PropertyTypes.FirstOrDefault(x => x.Alias.InvariantEquals(propertyAlias));
                     if (property == null) return Guid.Empty;
                     return property.DataTypeId;


added legacy setting imports from old modpack settings file: SuperExtraction, InstantExtraction. added default bool parse for BetaApplication and BetaDatabase to be false

--- RelhaxModpack/RelhaxModpack/Settings/ModpackSettings.cs
+++ RelhaxModpack/RelhaxModpack/Settings/ModpackSettings.cs
@@ -380,7 +380,6 @@
                 switch (setting.Name)
                 {
                     //put legacy names here to direct name change
-                    //TODO: super extraction and instant extraction?
                     case "backupModFolder":
                         BackupModFolder = bool.Parse(setting.InnerText);
                         break;
@@ -427,10 +426,30 @@
                         ModSelectionView = (SelectionView)int.Parse(setting.InnerText);
                         break;
                     case "BetaApplication":
-                        ApplicationDistroVersion = ApplicationVersions.Beta;
+                        if(Utils.ParseBool(setting.InnerText, false))
+                        {
+                            ApplicationDistroVersion = ApplicationVersions.Beta;
+                        }
+                        else
+                        {
+                            ApplicationDistroVersion = ApplicationVersions.Stable;
+                        }
                         break;
                     case "BetaDatabase":
-                        DatabaseDistroVersion = DatabaseVersions.Beta;
+                        if (Utils.ParseBool(setting.InnerText, false))
+                        {
+                            DatabaseDistroVersion = DatabaseVersions.Beta;
+                        }
+                        else
+                        {
+                            DatabaseDistroVersion = DatabaseVersions.Stable;
+                        }
+                        break;
+                    case "SuperExtraction":
+                        MulticoreExtraction = Utils.ParseBool(setting.InnerText, false);
+                        break;
+                    case "InstantExtraction":
+                        InstallWhileDownloading = Utils.ParseBool(setting.InnerText, false);
                         break;
                 }
             }


Added overloads to Cl.SetKernelArg that take concrete types, not just object.

git-svn-id: aa0dec00e72321ac8e48a41989fe02417ee50ad2@87248 81e6e737-5a20-4d0f-a97c-cb01297b46e0

--- OpenCL.Net/Cl.Overloads.cs
+++ OpenCL.Net/Cl.Overloads.cs
@@ -169,6 +169,26 @@
             return GetInfo(GetKernelWorkGroupInfo, kernel, device, paramName, out error);
         }

+        public static ErrorCode SetKernelArg(Kernel kernel, uint argIndex, Mem value)
+        {
+            return SetKernelArg(kernel, argIndex, (IntPtr)IntPtr.Size, value);
+        }
+
+        public static ErrorCode SetKernelArg(Kernel kernel, uint argIndex, float value)
+        {
+            return SetKernelArg(kernel, argIndex, (IntPtr)sizeof(float), value);
+        }
+
+        public static ErrorCode SetKernelArg(Kernel kernel, uint argIndex, int value)
+        {
+            return SetKernelArg(kernel, argIndex, (IntPtr)sizeof(int), value);
+        }
+
+        public static ErrorCode SetKernelArg(Kernel kernel, uint argIndex, bool value)
+        {
+            return SetKernelArg(kernel, argIndex, (IntPtr)sizeof(bool), value);
+        }
+
         #endregion

         #region Event object API


Add prototype information

Add prototype information

--- src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs
+++ src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs
@@ -1477,6 +1477,7 @@
             // only user-defined locals should be named during lowering:
             Debug.Assert((local.Name == null) == (localKind != SynthesizedLocalKind.UserDefined));

+            // PROTOTYPE: Generating debug names for instrumentation payload should be allowed pending https://github.com/dotnet/roslyn/issues/11024.
             // Skip naming locals generated by instrumentation as they might not have a local syntax offset.
             // Locals generated by instrumentation might exist in methods which do not contain a body (auto property initializers).
             if (!localKind.IsLongLived() || localKind == SynthesizedLocalKind.InstrumentationPayload)


[Preconditions] Add Builder-friendly constructor to RatelimitAttribute

--- src/Discord.Addons.Preconditions/RatelimitAttribute.cs
+++ src/Discord.Addons.Preconditions/RatelimitAttribute.cs
@@ -36,6 +36,15 @@
                     _invokeLimitPeriod = TimeSpan.FromMinutes(period);
                     break;
             }
+        }
+
+        /// <summary> Sets how often a user is allowed to use this command. </summary>
+        /// <param name="times">The number of times a user may use the command within a certain period.</param>
+        /// <param name="period">The amount of time since first invoke a user has until the limit is lifted.</param>
+        public RatelimitAttribute(uint times, TimeSpan period)
+        {
+            _invokeLimit = times;
+            _invokeLimitPeriod = period;
         }

         /// <inheritdoc />


Fixed users not being updated on PRESENCE_UPDATEs

--- src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs
+++ src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs
@@ -40,6 +40,7 @@
         internal virtual void Update(ClientState state, PresenceModel model)
         {
             Presence = SocketPresence.Create(model);
+            Update(state, model.User);
         }

         public Task<RestDMChannel> CreateDMChannelAsync(RequestOptions options = null)


Fix some tests.

Fix some tests.

--- src/EditorFeatures/Test/Workspaces/TextFactoryTests.cs
+++ src/EditorFeatures/Test/Workspaces/TextFactoryTests.cs
@@ -109,7 +109,11 @@
                 {
                     var text = reader.ReadToEnd();

-                    var mockSnapshot = new Mock<ITextSnapshot>();
+                    var mockImage = new Mock<ITextImage>();
+                    mockImage.Setup(i => i.GetText(It.IsAny<Span>())).Returns(text);
+
+                    var mockSnapshot = new Mock<ITextSnapshot2>();
+                    mockSnapshot.Setup(s => s.TextImage).Returns(mockImage.Object);
                     mockSnapshot.Setup(s => s.GetText()).Returns(text);

                     var mockTextBuffer = new Mock<ITextBuffer>();


Delete AppSettings.cs

Delete AppSettings.cs

--- src/Equinox.Services.API/Configurations/AppSettings.cs
+++ src/Equinox.Services.API/Configurations/AppSettings.cs
@@ -1,10 +0,0 @@
-namespace Equinox.Services.Api.Configurations
-{
-    public class AppSettings
-    {
-        public string Secret { get; set; }
-        public int Expiration { get; set; }
-        public string Issuer { get; set; }
-        public string ValidAt { get; set; }
-    }
-}


Fix NormalVerbosityLog sealed.

Fix NormalVerbosityLog sealed.

--- src/Giacomelli.JumpStart/Logging/NormalVerbosityLog.cs
+++ src/Giacomelli.JumpStart/Logging/NormalVerbosityLog.cs
@@ -15,7 +15,7 @@
 		/// </summary>
 		/// <param name="message">Message.</param>
 		/// <param name="args">Arguments.</param>
-		public virtual void Debug(string message, params object[] args)
+		public void Debug(string message, params object[] args)
 		{
 		}

@@ -24,7 +24,7 @@
 		/// </summary>
 		/// <param name="message">Message.</param>
 		/// <param name="args">Arguments.</param>
-		public virtual void Info(string message, params object[] args)
+		public void Info(string message, params object[] args)
 		{
 		}

@@ -33,7 +33,7 @@
 		/// </summary>
 		/// <param name="message">Message.</param>
 		/// <param name="args">Arguments.</param>
-		public virtual void Warn(string message, params object[] args)
+		public void Warn(string message, params object[] args)
 		{
 			Console.WriteLine(message, args);
 		}
@@ -43,7 +43,7 @@
 		/// </summary>
 		/// <param name="message">Message.</param>
 		/// <param name="args">Arguments.</param>
-		public virtual void Error(string message, params object[] args)
+		public void Error(string message, params object[] args)
 		{
 			Console.WriteLine(message, args);
 		}


Explicitly open repository when clone completes

Explicitly open repository on Visual Studio 2015 and 2017. Although
this sometimes happens automatically on Visual Studio 2017, it doesn't
happen consistently.

--- src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
+++ src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
@@ -37,7 +37,7 @@
         [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2017")]
         readonly Lazy<IStatusBarNotificationService> statusBar;
         [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2015")]
-        readonly Lazy<IVSServices> vsServices;
+        readonly Lazy<ITeamExplorerServices> teamExplorerServices;

         /// <summary>
         /// This MEF export requires specific versions of TeamFoundation. IGitExt is declared here so
@@ -50,11 +50,11 @@
         [ImportingConstructor]
         public VSGitServices(IGitHubServiceProvider serviceProvider,
             Lazy<IStatusBarNotificationService> statusBar,
-            Lazy<IVSServices> vsServices)
+            Lazy<ITeamExplorerServices> teamExplorerServices)
         {
             this.serviceProvider = serviceProvider;
             this.statusBar = statusBar;
-            this.vsServices = vsServices;
+            this.teamExplorerServices = teamExplorerServices;
         }

         // The Default Repository Path that VS uses is hidden in an internal
@@ -90,7 +90,6 @@
             await StartClonenOnConnectPageAsync(teamExplorer, cloneUrl, clonePath, recurseSubmodules);
             NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
             await WaitForCloneOnHomePageAsync(teamExplorer);
-            vsServices.Value.TryOpenRepository(clonePath); // Show the repository on Team Explorer - Home
 #else
             var gitExt = serviceProvider.GetService<IGitActionsExt>();
             var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();
@@ -100,6 +99,8 @@
             NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
             await cloneTask;
 #endif
+            // Change Team Explorer context to the newly cloned repository
+            teamExplorerServices.Value.OpenRepository(clonePath);
         }

         static async Task StartClonenOnConnectPageAsync(


Fixes #3

Fixes #3

--- src/Glimpse.Server.Web/GlimpseServerWebOptionsSetup.cs
+++ src/Glimpse.Server.Web/GlimpseServerWebOptionsSetup.cs
@@ -6,7 +6,6 @@
     {
         public GlimpseServerWebOptionsSetup() : base(ConfigureGlimpseServerWebOptions)
         {
-            Order = -1000;
         }

         public static void ConfigureGlimpseServerWebOptions(GlimpseServerWebOptions options)


Change ToWords culture recognition

Change ToWords culture recognition

--- DataGen.Extensions/DataGen.Extensions.Shared/Extensions/IntegerExtensions.cs
+++ DataGen.Extensions/DataGen.Extensions.Shared/Extensions/IntegerExtensions.cs
@@ -35,7 +35,7 @@

 		public static string ToWords(this long number, string culture)
 		{
-			if (culture == "pl-PL")
+			if (culture.StartsWith("pl"))
 			{
 				return IntegerExtensions.ToWords_pl_PL(number);
 			}


Fixes stripping of + is css editor (#792)

--- Extensions/Settings/Dnn.PersonaBar.CssEditor/Services/CssEditorController.cs
+++ Extensions/Settings/Dnn.PersonaBar.CssEditor/Services/CssEditorController.cs
@@ -115,7 +115,7 @@
                     //write CSS file
                     using (var writer = File.CreateText(strUploadDirectory + "portal.css"))
                     {
-                        writer.WriteLine(HttpUtility.UrlDecode(request.StyleSheetContent));
+                        writer.WriteLine(request.StyleSheetContent);
                     }

                     //Clear client resource cache


avoid telling a work job to cancel itself

--- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -871,12 +871,13 @@
             }
             else
             {
+                Exception e = null;
+
                 if (Engine.World.PipeEventsForScript(LocalID) ||
                     data.EventName == "control") // Don't freeze avies!
                 {
                     //                        m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}",
                     //                                PrimName, ScriptName, data.EventName, State);
-

                     try
                     {
@@ -892,6 +893,7 @@
                         {
                             m_InEvent = false;
                             m_CurrentEvent = String.Empty;
+                            m_CurrentWorkItem = null; // no longer in a event that can be canceled
                         }

                         if (m_SaveState)
@@ -904,7 +906,12 @@
                             m_SaveState = false;
                         }
                     }
-                    catch (Exception e)
+                    catch (Exception exx)
+                    {
+                        e = exx;
+                    }
+
+                    if(e != null)
                     {
                         //                            m_log.DebugFormat(
                         //                                "[SCRIPT] Exception in script {0} {1}: {2}{3}",


Removed obsolete parameter from getgetfactor function.

--- OsmSharp.Routing/Router.cs
+++ OsmSharp.Routing/Router.cs
@@ -150,7 +150,7 @@
             }

             // get the get factor function.
-            var getFactor = this.GetGetFactor(_db.EdgeProfiles, profile);
+            var getFactor = this.GetGetFactor(profile);

             // build and run dykstra search.
             var dykstra = new Dykstra(_db.Network.GeometricGraph.Graph, getFactor,
@@ -178,7 +178,7 @@
             }

             // get the get factor function.
-            var getFactor = this.GetGetFactor(_db.EdgeProfiles, profile);
+            var getFactor = this.GetGetFactor(profile);

             List<uint> path;
             OsmSharp.Routing.Graphs.Directed.DirectedMetaGraph contracted;
@@ -280,7 +280,7 @@
             }

             // get the get factor function.
-            var getFactor = this.GetGetFactor(_db.EdgeProfiles, profile);
+            var getFactor = this.GetGetFactor(profile);

             float[][] weights = null;
             OsmSharp.Routing.Graphs.Directed.DirectedMetaGraph contracted;
@@ -401,7 +401,7 @@
         /// <summary>
         /// Gets the get factor function for the given profile.
         /// </summary>
-        protected Func<ushort, Factor> GetGetFactor(Attributes.AttributesIndex edgeProfiles, Profile profile)
+        protected Func<ushort, Factor> GetGetFactor(Profile profile)
         {
             if (this.ProfileFactorCache != null && this.ProfileFactorCache.ContainsAll(profile))
             { // use cached version and don't consult profiles anymore.
@@ -411,7 +411,7 @@
             { // use the regular function, and consult profiles continuously.
                 return (p) =>
                 {
-                    return profile.Factor(edgeProfiles.Get(p));
+                    return profile.Factor(Db.EdgeProfiles.Get(p));
                 };
             }
         }


Disabling RepositoryTests as well

Disabling RepositoryTests as well


Fixed DllImport error with PrivateXX funcs

--- PInvoke/WinINet/WinINet.cs
+++ PInvoke/WinINet/WinINet.cs
@@ -7755,7 +7755,7 @@
 		/// </remarks>
 		// https://docs.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-privacygetzonepreferencew void PrivacyGetZonePreferenceW(
 		// DWORD dwZone, DWORD dwType, LPDWORD pdwTemplate, LPWSTR pszBuffer, LPDWORD pdwBufferLength );
-		[DllImport(Lib.WinInet, SetLastError = false, CharSet = CharSet.Unicode)]
+		[DllImport(Lib.WinInet, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
 		[PInvokeData("wininet.h", MSDNShortId = "530a86a0-bb67-406a-be83-5f2b463a1aa1")]
 		public static extern Win32Error PrivacyGetZonePreferenceW(URLZONE dwZone, PrivacyType dwType, out PrivacyTemplate pdwTemplate, StringBuilder pszBuffer, ref uint pdwBufferLength);

@@ -7854,7 +7854,7 @@
 		/// </remarks>
 		// https://docs.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-privacysetzonepreferencew void PrivacySetZonePreferenceW(
 		// DWORD dwZone, DWORD dwType, DWORD dwTemplate, LPCWSTR pszPreference );
-		[DllImport(Lib.WinInet, SetLastError = false, CharSet = CharSet.Unicode)]
+		[DllImport(Lib.WinInet, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
 		[PInvokeData("wininet.h", MSDNShortId = "29c8dbc0-052e-40f4-a036-cb647d920055")]
 		public static extern Win32Error PrivacySetZonePreferenceW(URLZONE dwZone, PrivacyType dwType, PrivacyTemplate dwTemplate, [Optional] string pszPreference);


CLI still a work in progress

CLI still a work in progress

--- profit/Program.cs
+++ profit/Program.cs
@@ -25,6 +25,9 @@
         static void Main(string[] args)
         {
             RegistrySettings rs = new RegistrySettings();
+            Profitability p = new Profitability();
+            CoinInformation ci = new CoinInformation();
+            ExchangeInformation ei = new ExchangeInformation();
             Getopt go = new Getopt("profit", args, "hlc:br:",
                 new LongOpt[]
                 {
@@ -58,7 +61,28 @@
                         Help();
                         return;
                 }
-
+            CoinInfo inf = rs.Coins[szSelectedCoin];
+            double diff = ci.GetDifficulty(inf.ExplorerType, inf.ExplorerBaseURL, inf.ExplorerChain);
+            decimal reward = ci.GetReward(inf.ExplorerType, inf.ExplorerBaseURL, inf.ExplorerChain);
+            decimal hashrate = 0;
+            switch (inf.DefaultHashRateUnit)
+            {
+                case "H/s":
+                    hashrate = Convert.ToDecimal(inf.DefaultHashRate);
+                    break;
+                case "kH/s":
+                    hashrate = Convert.ToDecimal(inf.DefaultHashRate) * 1000;
+                    break;
+                case "MH/s":
+                    hashrate = Convert.ToDecimal(inf.DefaultHashRate) * 1000000;
+                    break;
+                case "GH/s":
+                    hashrate = Convert.ToDecimal(inf.DefaultHashRate) * 100000000;
+                    break;
+                default:
+                    throw new ArgumentException("invalid hashrate unit");
+            }
+            Console.WriteLine(p.ProfitOnInterval(86400, hashrate, reward, (decimal)diff));
         }
     }
 }


Added RemoveTaxonomyFieldByInternalName and RemoveTaxonomyFieldById methods with comments.

--- OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/TaxonomyExtensions.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/TaxonomyExtensions.cs
@@ -1441,9 +1441,6 @@
             clientContext.ExecuteQueryRetry();
         }

-
-
-
         /// <summary>
         /// Can be used to create taxonomy field remotely to web.
         /// </summary>
@@ -1495,9 +1492,68 @@

         }

-
-
-
+        /// <summary>
+        /// Removes a taxonomy field (site column) and its associated hidden field by internal name
+        /// </summary>
+        /// <param name="web">Web object were the field (site column) exists</param>
+        /// <param name="internalName">Internal name of the taxonomy field (site column) to be removed</param>
+        public static void RemoveTaxonomyFieldByInternalName(this Web web, string internalName)
+        {
+            FieldCollection fields = web.Fields;
+            web.Context.Load(fields, fc => fc.Include(f => f.Id, f => f.InternalName));
+            web.Context.ExecuteQuery();
+
+            Field field = fields.FirstOrDefault(f => f.InternalName == internalName);
+
+            if (field != null)
+            {
+                field.DeleteObject();
+                web.Update();
+                web.Context.ExecuteQuery();
+
+                string id = field.Id.ToString();
+                string hiddenFieldName = id.ToLower().Replace("-", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Substring(1);
+                field = fields.FirstOrDefault(f => f.InternalName.EndsWith(hiddenFieldName));
+                if (field != null)
+                {
+                    field.DeleteObject();
+                    web.Update();
+                    web.Context.ExecuteQuery();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Removes a taxonomy field (site column) and its associated hidden field by id
+        /// </summary>
+        /// <param name="web">Web object were the field (site column) exists</param>
+        /// <param name="id">String representing the guid of the taxonomy field (site column) to be removed</param>
+        public static void RemoveTaxonomyFieldById(this Web web, string id)
+        {
+            FieldCollection fields = web.Fields;
+            web.Context.Load(fields, fc => fc.Include(f => f.Id));
+            web.Context.ExecuteQuery();
+
+            Guid fieldGuid = new Guid(id);
+
+            Field field = fields.FirstOrDefault(f => f.Id == fieldGuid);
+
+            if (field != null)
+            {
+                field.DeleteObject();
+                web.Update();
+                web.Context.ExecuteQuery();
+
+                string hiddenFieldName = id.ToLower().Replace("-", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Substring(1);
+                field = fields.FirstOrDefault(f => f.InternalName.EndsWith(hiddenFieldName));
+                if (field != null)
+                {
+                    field.DeleteObject();
+                    web.Update();
+                    web.Context.ExecuteQuery();
+                }
+            }
+        }

         /// <summary>
         /// Can be used to create taxonomy field remotely in a list.
@@ -1548,7 +1604,6 @@
                 throw;
             }
         }
-

         /// <summary>
         /// Wires up MMS field to the specified term set.


PhasorProtocolAdapters: Improved config change detection operations,

--- Source/Libraries/Adapters/PhasorProtocolAdapters/IeeeC37_118/Concentrator.cs
+++ Source/Libraries/Adapters/PhasorProtocolAdapters/IeeeC37_118/Concentrator.cs
@@ -223,7 +223,14 @@
             ConfigurationFrame3 configurationFrame3 = CreateConfigurationFrame3(baseConfigurationFrame, TimeBase, NominalFrequency, this);

             // After system has started any subsequent changes in configuration get indicated in the outgoing data stream
-            bool configurationChanged = !(m_configurationFrame2 is null);
+            bool configurationChanged = false;
+
+            if (!(m_configurationFrame2 is null))
+            {
+                // Get a clone of the current config frame and set its header match the cached config frame for a clean compare
+                ConfigurationFrame1 cacheMatch = configurationFrame2.Clone(m_configurationFrame2.CommonHeader);
+                configurationChanged = cacheMatch.Checksum != m_configurationFrame2.Checksum;
+            }

             // Apply tracked revision counts
             if (configurationChanged)


carousel tests

carousel tests

--- Source/Tests/JustOrderIt.Web.Public.Tests/Controllers/HomeControllerTests.cs
+++ Source/Tests/JustOrderIt.Web.Public.Tests/Controllers/HomeControllerTests.cs
@@ -17,7 +17,7 @@
     using Data.Models.Catalog;
     using Areas.Public.ViewModels.Products;
     using Common.GlobalConstants;
-
+    using Infrastructure.Extensions;
     [TestFixture]
     public class HomeControllerTests
     {
@@ -56,15 +56,7 @@
                 new Product() { Id = 5, Title = "jhsgdf", CategoryId = 2, QuantityInStock = 312, UnitPrice = 64.8m, SellerId = "jvui89u893fnh89hn49uj", CreatedOn = DateTime.Now },
             };

-            //var carouselData = dbProductsMock.AsQueryable().To<CarouselData>().ToList();
-            var carouselData = new List<CarouselData>()
-            {
-                new CarouselData() { Id = 1, Title = "jhsgdf" },
-                new CarouselData() { Id = 2, Title = "jhsgdf" },
-                new CarouselData() { Id = 3, Title = "jhsgdf" },
-                new CarouselData() { Id = 4, Title = "jhsgdf" },
-                new CarouselData() { Id = 5, Title = "jhsgdf" },
-            };
+            var carouselData = dbProductsMock.AsQueryable().To<CarouselData>().ToList();

             this.productsServiceMock.Setup(x => x.GetAll()).Returns(dbProductsMock as IQueryable<Product>);


Removed unnecessary list copy

Removed unnecessary list copy

--- Qualisys/QTM-Unity-Realtime-Streaming/Streaming/RTSkeleton.cs
+++ Qualisys/QTM-Unity-Realtime-Streaming/Streaming/RTSkeleton.cs
@@ -48,7 +48,7 @@

                 mQTmSegmentIdToGameObject = new Dictionary<uint, GameObject>(mQtmSkeletonCache.Segments.Count);

-                foreach (var segment in mQtmSkeletonCache.Segments.ToList())
+                foreach (var segment in mQtmSkeletonCache.Segments)
                 {
                     var gameObject = new GameObject(this.SkeletonName + "_" + segment.Value.Name);
                     gameObject.transform.parent = segment.Value.ParentId == 0 ? mStreamedRootObject.transform : mQTmSegmentIdToGameObject[segment.Value.ParentId].transform;
@@ -67,7 +67,7 @@
                 return;

             // Update all the game objects
-            foreach (var segment in mQtmSkeletonCache.Segments.ToList())
+            foreach (var segment in mQtmSkeletonCache.Segments)
             {
                 GameObject gameObject;
                 if (mQTmSegmentIdToGameObject.TryGetValue(segment.Key, out gameObject))


fix error message after rename Load -> Terminal

--- Signum.Engine.Extensions/UserAssets/QueryTokenSynchronizer.cs
+++ Signum.Engine.Extensions/UserAssets/QueryTokenSynchronizer.cs
@@ -404,7 +404,7 @@
             try
             {
                 if (Console.Out == null)
-                    throw new InvalidOperationException("Impossible to synchronize without interactive Console");
+                    throw new InvalidOperationException("Unable to ask for renames to synchronize query tokens without interactive Console. Please use your Terminal application.");

                 var subTokens = token.SubTokens(qd, options).OrderBy(a => a.Parent != null).ThenByDescending(a=>a.Priority).ThenBy(a => a.Key).ToList();


(TFS CS 6250)

(TFS CS 6250)

--- Signum.Engine/Linq/ExpressionVisitor/DbExpressionNominator.cs
+++ Signum.Engine/Linq/ExpressionVisitor/DbExpressionNominator.cs
@@ -368,10 +368,12 @@

         protected override Expression VisitUnary(UnaryExpression u)
         {
-            if (u.NodeType == ExpressionType.Convert && u.Type.IsNullable() && u.Type.UnNullify().IsEnum &&
-                u.Operand.NodeType == ExpressionType.Convert && u.Operand.Type.IsEnum)
-            {
-                u = Expression.Convert(Expression.Convert(((UnaryExpression)u.Operand).Operand, typeof(int?)), u.Type); //Expand nullability
+            if (u.NodeType == ExpressionType.Convert && u.Type.IsNullable() && u.Type.UnNullify().IsEnum)
+            {
+                if (u.Operand.NodeType == ExpressionType.Convert && u.Operand.Type.IsEnum)
+                    u = Expression.Convert(Expression.Convert(((UnaryExpression)u.Operand).Operand, typeof(int?)), u.Type); //Expand nullability
+                else if (u.Operand.Type == typeof(int))
+                    u = Expression.Convert(Expression.Convert(u.Operand, typeof(int?)), u.Type); //Expand nullability
             }

             Expression operand = this.Visit(u.Operand);


Support more property on creating ViewCube Texture

--- Source/HelixToolkit.Wpf.SharpDX/Extensions/BitmapExtension.cs
+++ Source/HelixToolkit.Wpf.SharpDX/Extensions/BitmapExtension.cs
@@ -68,15 +68,18 @@
         }

         public static BitmapSource CreateViewBoxBitmapSource(string front, string back, string left, string right, string top, string down, Media.Color frontColor,
-            Media.Color backColor, Media.Color leftColor, Media.Color rightColor, Media.Color topColor, Media.Color bottomColor)
+            Media.Color backColor, Media.Color leftColor, Media.Color rightColor, Media.Color topColor, Media.Color bottomColor, int fontSize = 64)
         {
             var family = new Media.FontFamily("Arial");
-            var bfront = GetFontBorderContainer(front, Media.Colors.White, frontColor, family, FontWeights.SemiBold);
-            var bback = GetFontBorderContainer(back, Media.Colors.White, backColor, family, FontWeights.SemiBold);
-            var bleft = GetFontBorderContainer(left, Media.Colors.White, leftColor, family, FontWeights.SemiBold);
-            var bright = GetFontBorderContainer(right, Media.Colors.White, rightColor, family, FontWeights.SemiBold);
-            var btop = GetFontBorderContainer(top, Media.Colors.White, topColor, family, FontWeights.SemiBold);
-            var bbottom = GetFontBorderContainer(down, Media.Colors.White, bottomColor, family, FontWeights.SemiBold);
+            int width = 100;
+            int height = 100;
+            int totalWidth = 100 * 6;
+            var bfront = GetFontBorderContainer(front, Media.Colors.White, frontColor, family, FontWeights.SemiBold, fontSize, width, height);
+            var bback = GetFontBorderContainer(back, Media.Colors.White, backColor, family, FontWeights.SemiBold, fontSize, width, height);
+            var bleft = GetFontBorderContainer(left, Media.Colors.White, leftColor, family, FontWeights.SemiBold, fontSize, width, height);
+            var bright = GetFontBorderContainer(right, Media.Colors.White, rightColor, family, FontWeights.SemiBold, fontSize, width, height);
+            var btop = GetFontBorderContainer(top, Media.Colors.White, topColor, family, FontWeights.SemiBold, fontSize, width, height);
+            var bbottom = GetFontBorderContainer(down, Media.Colors.White, bottomColor, family, FontWeights.SemiBold, fontSize, width, height);
             StackPanel panel = new StackPanel();
             panel.Orientation = Orientation.Horizontal;
             panel.Children.Add(bfront);
@@ -85,9 +88,9 @@
             panel.Children.Add(bright);
             panel.Children.Add(btop);
             panel.Children.Add(bbottom);
-            panel.Measure(new Size(100 * 6, 100));
-            panel.Arrange(new Rect(new Size(100 * 6, 100)));
-            return panel.ToBitmapSource(100 * 6, 100, true);
+            panel.Measure(new Size(totalWidth, height));
+            panel.Arrange(new Rect(new Size(totalWidth, height)));
+            return panel.ToBitmapSource(totalWidth, height, true);
         }

         public static BitmapSource ToBitmapSource(this Media.Visual element, int width, int height, bool freeze = true)


Fix exception that can occur when a PropertyEditor DLL no longer exists

--- Src/Census/UmbracoObjectRelations/DataTypeToPropertyEditor.cs
+++ Src/Census/UmbracoObjectRelations/DataTypeToPropertyEditor.cs
@@ -28,8 +28,11 @@
         public DataTable GetRelations(object id)
         {
             var dataType = DataTypeDefinition.GetDataTypeDefinition((int)id);
+            if (dataType == null || dataType.DataType == null)
+                return new DataTable(); // PropertyEditor DLL no longer exists
+
             var propertyEditorGuid = dataType.DataType.Id;
-            var usages = DataTypeDefinition.GetAll().Where(d => d.DataType.Id == propertyEditorGuid);
+            var usages = DataTypeDefinition.GetAll().Where(d => d.DataType != null && d.DataType.Id == propertyEditorGuid);

             return PropertyEditor.ToDataTable(usages);
         }


TSI-1638 Fixed DynamicNavigationProvider 2013SP1 build

--- Sdl.Web.Tridion/Navigation/DynamicNavigationProvider.cs
+++ Sdl.Web.Tridion/Navigation/DynamicNavigationProvider.cs
@@ -121,7 +121,7 @@
             // TODO: Tridion.ContentDelivery.Taxonomies.TaxonomyRelationManager is missing in CIL 8.2. See CRQ-2380.
 #if TRIDION_71
             global::Tridion.ContentDelivery.Taxonomies.TaxonomyRelationManager taxonomyRelationManager = new global::Tridion.ContentDelivery.Taxonomies.TaxonomyRelationManager();
-            return taxonomyRelationManager.GetTaxonomyKeywords(taxonomyUri, classifiedItemUri, null, new DepthFilter(depth, DepthFilter.FilterUp), (int) ItemType.Page);
+            return taxonomyRelationManager.GetTaxonomyKeywords(taxonomyUri, pageUri, null, new DepthFilter(depth, DepthFilter.FilterUp), (int) ItemType.Page);
 #else
             Sdl.Web.Delivery.Dynamic.Taxonomies.Filters.ITaxonomyFilter ancestorsFilter = new Sdl.Web.Delivery.Dynamic.Taxonomies.Filters.DepthFilter(depth, DepthFilter.FilterUp);
             Sdl.Web.Delivery.Dynamic.Taxonomies.TaxonomyRelationManager taxonomyRelationManager = new Sdl.Web.Delivery.Dynamic.Taxonomies.TaxonomyRelationManager();


TSI-1638 Improved tracing in DynamicNavigationProvider (TSI-1761)

--- Sdl.Web.Tridion/Navigation/DynamicNavigationProvider.cs
+++ Sdl.Web.Tridion/Navigation/DynamicNavigationProvider.cs
@@ -182,11 +182,11 @@
                     TaxonomyNode taxonomyRoot = null;
                     if (!string.IsNullOrEmpty(keywordId))
                     {
-                        taxonomyRoot = ExpandAncestorsForKeyword(taxonomyUri, keywordUri, filter, localization);
+                        taxonomyRoot = ExpandAncestorsForKeyword(keywordUri, taxonomyUri, filter, localization);
                     }
                     else if (!string.IsNullOrEmpty(pageId))
                     {
-                        taxonomyRoot = ExpandAncestorsForPage(taxonomyUri, pageUri, filter, localization);
+                        taxonomyRoot = ExpandAncestorsForPage(pageUri, taxonomyUri, filter, localization);
                     }

                     if (taxonomyRoot != null)
@@ -206,7 +206,7 @@
                 }
                 else if (filter.DescendantLevels != 0 && string.IsNullOrEmpty(pageId))
                 {
-                    result = ExpandDescendants(taxonomyUri, keywordUri, filter, localization);
+                    result = ExpandDescendants(keywordUri, taxonomyUri, filter, localization);
                 }

                 return result;
@@ -251,32 +251,35 @@

         private static void AddDescendants(TaxonomyNode taxonomyNode, NavigationFilter filter, Localization localization)
         {
-            // First recurse (depth-first)
-            IList<SitemapItem> children = taxonomyNode.Items;
-            foreach (TaxonomyNode childNode in children.OfType<TaxonomyNode>())
-            {
-                AddDescendants(childNode, filter, localization);
-            }
-
-            // Add descendants (on the way back)
-            string taxonomyId;
-            string keywordId;
-            string pageId;
-            ParseSitemapItemId(taxonomyNode.Id, out taxonomyId, out keywordId, out pageId);
-            string publicationId = localization.LocalizationId;
-            string taxonomyUri = string.Format("tcm:{0}-{1}-512", publicationId, taxonomyId);
-            string keywordUri = string.IsNullOrEmpty(keywordId) ? taxonomyUri : string.Format("tcm:{0}-{1}-1024", publicationId, keywordId);
-
-            IEnumerable<SitemapItem> additionalChildren = ExpandDescendants(taxonomyUri, keywordUri, filter, localization);
-            foreach (SitemapItem additionalChildItem in additionalChildren.Where(childItem => children.All(i => i.Id != childItem.Id)))
-            {
-                children.Add(additionalChildItem);
+            using (new Tracer(taxonomyNode, filter, localization))
+            {
+                // First recurse (depth-first)
+                IList<SitemapItem> children = taxonomyNode.Items;
+                foreach (TaxonomyNode childNode in children.OfType<TaxonomyNode>())
+                {
+                    AddDescendants(childNode, filter, localization);
+                }
+
+                // Add descendants (on the way back)
+                string taxonomyId;
+                string keywordId;
+                string pageId;
+                ParseSitemapItemId(taxonomyNode.Id, out taxonomyId, out keywordId, out pageId);
+                string publicationId = localization.LocalizationId;
+                string taxonomyUri = string.Format("tcm:{0}-{1}-512", publicationId, taxonomyId);
+                string keywordUri = string.IsNullOrEmpty(keywordId) ? taxonomyUri : string.Format("tcm:{0}-{1}-1024", publicationId, keywordId);
+
+                IEnumerable<SitemapItem> additionalChildren = ExpandDescendants(keywordUri, taxonomyUri, filter, localization);
+                foreach (SitemapItem additionalChildItem in additionalChildren.Where(childItem => children.All(i => i.Id != childItem.Id)))
+                {
+                    children.Add(additionalChildItem);
+                }
             }
         }

         private static IEnumerable<SitemapItem> ExpandTaxonomyRoots(NavigationFilter filter, Localization localization)
         {
-            using (new Tracer(localization))
+            using (new Tracer(filter, localization))
             {
                 TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
                 string[] taxonomyIds = taxonomyFactory.GetTaxonomies(GetPublicationTcmUri(localization));
@@ -289,9 +292,9 @@
             }
         }

-        private static IEnumerable<SitemapItem> ExpandDescendants(string taxonomyUri, string keywordUri, NavigationFilter filter, Localization localization)
-        {
-            using (new Tracer(taxonomyUri, keywordUri, filter, localization))
+        private static IEnumerable<SitemapItem> ExpandDescendants(string keywordUri, string taxonomyUri, NavigationFilter filter, Localization localization)
+        {
+            using (new Tracer(keywordUri, taxonomyUri, filter, localization))
             {
                 TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
                 TaxonomyFilter taxonomyFilter = new DepthFilter(filter.DescendantLevels, DepthFilter.FilterDown);
@@ -301,9 +304,9 @@
             }
         }

-        private static TaxonomyNode ExpandAncestorsForKeyword(string taxonomyUri, string keywordUri, NavigationFilter filter, Localization localization)
-        {
-            using (new Tracer(taxonomyUri, keywordUri, filter, localization))
+        private static TaxonomyNode ExpandAncestorsForKeyword(string keywordUri, string taxonomyUri, NavigationFilter filter, Localization localization)
+        {
+            using (new Tracer(keywordUri, taxonomyUri, filter, localization))
             {
                 TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
                 TaxonomyFilter taxonomyFilter = new DepthFilter(DepthFilter.UnlimitedDepth, DepthFilter.FilterUp);
@@ -312,9 +315,9 @@
             }
         }

-        private static TaxonomyNode ExpandAncestorsForPage(string taxonomyUri, string pageUri, NavigationFilter filter, Localization localization)
-        {
-            using (new Tracer(taxonomyUri, pageUri, filter, localization))
+        private static TaxonomyNode ExpandAncestorsForPage(string pageUri, string taxonomyUri, NavigationFilter filter, Localization localization)
+        {
+            using (new Tracer(pageUri, taxonomyUri, filter, localization))
             {
                 // Get TaxonomyKeywordsForPage may return multiple paths towards the (same) Taxonomy root.
                 Keyword[] taxonomyRoots = GetTaxonomyKeywordsForPage(pageUri, taxonomyUri);
@@ -430,16 +433,8 @@
                 if (classifiedItemsCount > 0 && filter.DescendantLevels != 0)
                 {
                     // Add child SitemapItems for classified Pages (ordered by title)
-                    PageMetaFactory pageMetaFactory = new PageMetaFactory(GetPublicationTcmUri(localization));
-                    IPageMeta[] classifiedPageMetas = pageMetaFactory.GetTaxonomyPages(keyword, includeBranchedFacets: false);
-                    IEnumerable<SitemapItem> pageSitemapItems = classifiedPageMetas.Select(pageMeta => CreateSitemapItem(pageMeta, taxonomyId)).OrderBy(i => i.Title).ToArray();
+                    SitemapItem[] pageSitemapItems = ExpandClassifiedPages(keyword, taxonomyId, localization);
                     childItems.AddRange(pageSitemapItems);
-
-                    // Supress sequence prefixes from titles
-                    foreach (SitemapItem pageSitemapItem in pageSitemapItems)
-                    {
-                        pageSitemapItem.Title = _pageTitleRegex.Match(pageSitemapItem.Title).Groups["title"].Value;
-                    }

                     // If the Taxonomy Node contains an Index Page (i.e. URL ending with "/index"), we put that URL on the Taxonomy Node.
                     SitemapItem indexPageSitemapItem = pageSitemapItems.FirstOrDefault(i => i.Url.EndsWith(IndexPageUrlSuffix));
@@ -481,7 +476,26 @@
         private static IDictionary<string, object> GetCustomMetadata(Keyword keyword)
         {
             throw new System.NotImplementedException(); // TODO
-        }
+        }
+
+        private static SitemapItem[] ExpandClassifiedPages(Keyword keyword, string taxonomyId, Localization localization)
+        {
+            using (new Tracer(keyword.KeywordUri, taxonomyId, localization))
+            {
+                // Return SitemapItems for all classified Pages (ordered by Page Title, including sequence prefix if any)
+                PageMetaFactory pageMetaFactory = new PageMetaFactory(GetPublicationTcmUri(localization));
+                IPageMeta[] classifiedPageMetas = pageMetaFactory.GetTaxonomyPages(keyword, includeBranchedFacets: false);
+                SitemapItem[] result = classifiedPageMetas.Select(pageMeta => CreateSitemapItem(pageMeta, taxonomyId)).OrderBy(i => i.Title).ToArray();
+
+                // Supress sequence prefixes from titles
+                foreach (SitemapItem sitemapItem in result)
+                {
+                    sitemapItem.Title = _pageTitleRegex.Match(sitemapItem.Title).Groups["title"].Value;
+                }
+
+                return result;
+            }
+        }

         private static SitemapItem CreateSitemapItem(IPageMeta pageMeta, string taxonomyId)
         {


TRIF-1226: IG Versioning issue after IG is edited

--- Trifolia.Web/Controllers/API/ImplementationGuideController.cs
+++ Trifolia.Web/Controllers/API/ImplementationGuideController.cs
@@ -981,6 +981,7 @@
                                 throw new Exception("An implementation guide with that name already exists!");

                             ig = new ImplementationGuide();
+                            ig.Version = 1;
                             auditedTdb.ImplementationGuides.Add(ig);
                         }
                         else
@@ -1010,20 +1011,16 @@
                         if (ig.PublishStatus == null)
                             ig.PublishStatus = PublishStatus.GetDraftStatus(auditedTdb);

-                        if (aModel.PreviousVersionId.HasValue && ig.PreviousVersionImplementationGuideId != aModel.PreviousVersionId)
+                        if (aModel.PreviousVersionId.HasValue)
                         {
                             ig.PreviousVersionImplementationGuideId = aModel.PreviousVersionId;
                             ImplementationGuide lPreviousVersion
                                 = auditedTdb.ImplementationGuides.Single(previousIg => previousIg.Id == aModel.PreviousVersionId.Value);

-                            if (lPreviousVersion.Version >= 1)
-                                ig.Version = lPreviousVersion.Version + 1;
-                            else
-                                ig.Version = 1;
-                        }
-                        else
-                        {
-                            ig.Version = 1;
+                            int nextVersion = (lPreviousVersion.Version != null ? lPreviousVersion.Version.Value : 1) + 1;
+
+                            if (ig.Version != nextVersion)
+                                ig.Version = nextVersion;
                         }

                         // Delete sections that don't exist in the model


Gates inside GatesList is not exposed anymore

--- Soomla/Assets/Plugins/Soomla/Levelup/gates/GatesList.cs
+++ Soomla/Assets/Plugins/Soomla/Levelup/gates/GatesList.cs
@@ -20,7 +20,7 @@
 {
 	public abstract class GatesList : Gate
 	{
-		public List<Gate> Gates = new List<Gate>();
+		protected List<Gate> Gates = new List<Gate>();
 		protected bool AutoOpenBehavior = false;

 		public GatesList(string gateId)


+ getting selected article with comments

--- Source/Daisy.Terminal/ViewModels/MainWindowViewModel.cs
+++ Source/Daisy.Terminal/ViewModels/MainWindowViewModel.cs
@@ -97,6 +97,7 @@

                 if (value != null)
                 {
+                    _selectedArticle = GetArticle(value);
                     SetSelectedArticleViewModel();
                 }

@@ -282,6 +283,16 @@
             }
         }

+        private Article GetArticle(Article article)
+        {
+            if (article is NewArticle)
+            {
+                return article;
+            }
+
+            var articleModel = _service.GetArticleById(article.Id.Value);
+            return TinyMapper.Map<Article>(articleModel);
+        }

         private void SetSelectedArticleViewModel()
         {


Implement the 'ViewportsCommand.SetTarget'-Command in Wpf.SharpDx.

--- Source/HelixToolkit.Wpf.SharpDX/Controls/Viewport3DX.cs
+++ Source/HelixToolkit.Wpf.SharpDX/Controls/Viewport3DX.cs
@@ -115,6 +115,11 @@
         private readonly RotateHandler rotateHandler;

         /// <summary>
+        /// The set target handler.
+        /// </summary>
+        private RotateHandler setTargetHandler;
+
+        /// <summary>
         /// The zoom handler
         /// </summary>
         private readonly ZoomHandler zoomHandler;
@@ -253,13 +258,14 @@
             //this.Children = new Element3DCollection();

             this.rotateHandler = new RotateHandler(this);
+            this.setTargetHandler = new RotateHandler(this, true);
             this.panHandler = new PanHandler(this);
             this.zoomHandler = new ZoomHandler(this);
             this.changeFieldOfViewHandler = new ZoomHandler(this, true);
             this.zoomRectangleHandler = new ZoomRectangleHandler(this);

             this.CommandBindings.Add(new CommandBinding(ViewportCommands.ZoomExtents, this.ZoomExtentsHandler));
-            this.CommandBindings.Add(new CommandBinding(ViewportCommands.SetTarget, this.SetTargetHandler));
+            this.CommandBindings.Add(new CommandBinding(ViewportCommands.SetTarget, this.setTargetHandler.Execute));
             this.CommandBindings.Add(new CommandBinding(ViewportCommands.Reset, this.ResetHandler));

             this.CommandBindings.Add(new CommandBinding(ViewportCommands.Zoom, this.zoomHandler.Execute));
@@ -1515,15 +1521,6 @@
         }

         /// <summary>
-        /// Handles the SetTarget command.
-        /// </summary>
-        /// <param name="sender">The sender.</param>
-        /// <param name="e">The <see cref="ExecutedRoutedEventArgs" /> instance containing the event data.</param>
-        private void SetTargetHandler(object sender, ExecutedRoutedEventArgs e)
-        {
-        }
-
-        /// <summary>
         /// The subscribe to rendering event.
         /// </summary>
         private void SubscribeToRenderingEvent()


FIXED: Unit Tests - Accessing an entity after is has been removed from the manager.

--- Source/Slash.GameBase.Tests/Source/EntityManagerTest.cs
+++ Source/Slash.GameBase.Tests/Source/EntityManagerTest.cs
@@ -83,6 +83,7 @@
         {
             this.testEntityId = this.entityManager.CreateEntity();
             this.entityManager.RemoveEntity(this.testEntityId);
+            this.entityManager.CleanUpEntities();
             this.entityManager.GetComponent(this.testEntityId, typeof(TestEntityComponent));
         }


update version

update version

--- Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
+++ Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
@@ -13,5 +13,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-[assembly: AssemblyVersion("5.5.3.0")]
-[assembly: AssemblyFileVersion("5.5.3")]+[assembly: AssemblyVersion("5.5.4.0")]
+[assembly: AssemblyFileVersion("5.5.4")]


added a comment to make explicit that NSubstitute can't setup methods from object

--- Src/AutoNSubstitute/NSubstituteVirtualMethodsCommand.cs
+++ Src/AutoNSubstitute/NSubstituteVirtualMethodsCommand.cs
@@ -28,6 +28,8 @@
     ///     parameters that this method could be called with.
     /// - Void methods are not set up due to a limitation in NSubstitute that When..Do setups can't be overriden
     /// - Calling a method more than once with the same parameters will always return the same value
+    /// - Methods inherited from <see cref="Object" /> are not set up due to a limitation in NSubstitute
+    ///     (http://stackoverflow.com/a/21787891)
     /// </remarks>
     public class NSubstituteVirtualMethodsCommand : ISpecimenCommand
     {


Add new sounds.

Add new sounds.


Delete Del.cs

Delete Del.cs

--- TextEditor/TestConsole/CommandProcessor/Commands/Del.cs
+++ TextEditor/TestConsole/CommandProcessor/Commands/Del.cs
@@ -1,45 +0,0 @@
-using System;
-using System.IO;
-
-namespace Kernel.CommandProcessor.Commands
-{
-    public class Del : BaseCommand
-    {
-        public Del()
-        {
-            name = "del";
-            description = "Delete file.";
-            parameterCount = 2;
-        }
-
-        public override void Do(params string[] args)
-        {
-            string file = args[1];
-            if (!file.Contains(Global.CurrentPath))
-                file = Global.CurrentPath + args[1];
-
-            if (!File.Exists(file))
-            {
-                CommandResult.AddErrorMessage("File does not exist.");
-            }
-            else
-            {
-                try
-                {
-                    File.Delete(file);
-                    CommandResult.AddSuccessMessage(file + " file deleted.");
-                }
-                catch (Exception ex)
-                {
-                    CommandResult.AddErrorMessage("Error creating file:" + ex.Message);
-                    CommandResult.Exception = ex;
-                }
-            }
-        }
-
-        public override BaseCommand Create()
-        {
-            return new Del();
-        }
-    }
-}


Fix type in example

Fix type in example

--- TimeLog.ApiConsoleApp/CreateProjectTransactionalApi2.cs
+++ TimeLog.ApiConsoleApp/CreateProjectTransactionalApi2.cs
@@ -55,7 +55,7 @@
                     CurrencyID = 0,
                     MainContractID =
                                               1, // ONLY FOR CREATION! TimeMaterial = 1, FixedPrice = 2, TimeMaterialAccountEndBalancing = 3, TimeMaterialAccountPeriodicBalancing = 4, PrepaidServices = 5, RevenueReqPerTask = 6, ContinuousService = 7, ContinuousItemInvoicing = 8
-                    DepartmentHandledByID = 8,
+                    DepartmentHandledByID = 0,
                     DepartmentOrderedByID = 0,
                     //Description = string.Empty,
                     EndDate = DateTime.Today.AddDays(30),
@@ -265,4 +265,4 @@
             }
         }
     }
-}+}


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -1832,6 +1832,15 @@
     public void TestMethod_IsPrime_1091()
     {
       const int source = 1091;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_1093()
+    {
+      const int source = 1093;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -481,6 +481,15 @@
     public void TestMethod_IsPrime_131()
     {
       const int source = 131;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_137()
+    {
+      const int source = 137;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -1012,6 +1012,15 @@
     public void TestMethod_IsPrime_467()
     {
       const int source = 467;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_479()
+    {
+      const int source = 479;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


Add one unit test

Add one unit test


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -1057,6 +1057,15 @@
     public void TestMethod_IsPrime_503()
     {
       const int source = 503;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_509()
+    {
+      const int source = 509;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


POI：Adjust handling of ByteBuffer some more

--- main/POIFS/NIO/FileBackedDataSource.cs
+++ main/POIFS/NIO/FileBackedDataSource.cs
@@ -126,29 +126,28 @@
             if (position >= Size)
                 throw new IndexOutOfRangeException("Position " + position + " past the end of the file");

-            // Do we read or map (for read/write?
+            // Do we read or map (for read/write)?
             ByteBuffer dst;
-            int worked = -1;
             if (writable)
             {
                 //dst = channel.map(FileChannel.MapMode.READ_WRITE, position, length);
                 dst = ByteBuffer.CreateBuffer(length);
-                worked = 0;
-                // remember the buffer for cleanup if necessary
+                // remember this buffer for cleanup
                 buffersToClean.Add(dst);
             }
             else
             {
-                // Read
+                // allocate the buffer on the heap if we cannot map the data in directly
                 fileStream.Position = position;
                 dst = ByteBuffer.CreateBuffer(length);

-                worked = IOUtils.ReadFully(fileStream, dst.Buffer);
-            }
-            // Check
-            if(worked == -1)
-                throw new IndexOutOfRangeException("Position " + position + " past the end of the file");
-
+                // Read the contents and check that we could read some data
+                int worked = IOUtils.ReadFully(fileStream, dst.Buffer);
+                // Check
+                if (worked == -1)
+                    throw new IndexOutOfRangeException("Position " + position + " past the end of the file");
+            }
+            // make it ready for reading
             dst.Position = 0;

             // All done


Prepare for new kv3 binary encoding

Prepare for new kv3 binary encoding

--- ValveResourceFormat/Resource/ResourceTypes/BinaryKV3.cs
+++ ValveResourceFormat/Resource/ResourceTypes/BinaryKV3.cs
@@ -1,16 +1,22 @@
 using System;
+using System.Collections;
 using System.IO;
 using System.Text;
 using ValveResourceFormat.Blocks;
 using ValveResourceFormat.KeyValues;
+using Decoder = SevenZip.Compression.LZMA.Decoder;

 namespace ValveResourceFormat.ResourceTypes
 {
     public class BinaryKV3 : ResourceData
     {
-        private static readonly byte[] ENCODING = { 0x46, 0x1A, 0x79, 0x95, 0xBC, 0x95, 0x6C, 0x4F, 0xA7, 0x0B, 0x05, 0xBC, 0xA1, 0xB7, 0xDF, 0xD2 };
-        private static readonly byte[] FORMAT = { 0x7C, 0x16, 0x12, 0x74, 0xE9, 0x06, 0x98, 0x46, 0xAF, 0xF2, 0xE6, 0x3E, 0xB5, 0x90, 0x37, 0xE7 };
+#pragma warning disable SA1310 // Field names should not contain underscore
+        private static readonly byte[] KV3_ENCODING_BINARY_BLOCK_COMPRESSED = { 0x46, 0x1A, 0x79, 0x95, 0xBC, 0x95, 0x6C, 0x4F, 0xA7, 0x0B, 0x05, 0xBC, 0xA1, 0xB7, 0xDF, 0xD2 };
+        private static readonly byte[] KV3_ENCODING_BINARY_UNCOMPRESSED = { 0x00, 0x05, 0x86, 0x1B, 0xD8, 0xF7, 0xC1, 0x40, 0xAD, 0x82, 0x75, 0xA4, 0x82, 0x67, 0xE7, 0x14 };
+        private static readonly byte[] KV3_ENCODING_BINARY_POSSIBLY_LZ4 = { 0x8A, 0x34, 0x47, 0x68, 0xA1, 0x63, 0x5C, 0x4F, 0xA1, 0x97, 0x53, 0x80, 0x6F, 0xD9, 0xB1, 0x19 };
+        private static readonly byte[] KV3_FORMAT_GENERIC = { 0x7C, 0x16, 0x12, 0x74, 0xE9, 0x06, 0x98, 0x46, 0xAF, 0xF2, 0xE6, 0x3E, 0xB5, 0x90, 0x37, 0xE7 };
         public const int MAGIC = 0x03564B56; // VKV3 (3 isn't ascii, its 0x03)
+#pragma warning restore SA1310

         public KVObject Data { get; private set; }
         private string[] stringArray;
@@ -27,26 +33,41 @@
                 throw new InvalidDataException("Invalid KV Signature");
             }

-            // outWrite.Write(sig);
             var encoding = reader.ReadBytes(16);
-            if (!ByteArrayCompare(encoding, ENCODING))
-            {
-                throw new InvalidDataException("Unrecognized KV3 Encoding");
-            }
-
-            // new encoding in dota: 8A 34 47 68 A1 63 5C 4F A1 97 53 80 6F D9 B1 19
-
-            // outWrite.Write(encoding);
             var format = reader.ReadBytes(16);
-            if (!ByteArrayCompare(format, FORMAT))
+
+            // Valve's implementation lives in LoadKV3Binary()
+            // KV3_ENCODING_BINARY_BLOCK_COMPRESSED calls CBlockCompress::FastDecompress()
+            // and then it proceeds to call LoadKV3BinaryUncompressed, which should be the same routine for KV3_ENCODING_BINARY_UNCOMPRESSED
+            // Old binary with debug symbols for ref: https://users.alliedmods.net/~asherkin/public/bins/dota_symbols/bin/osx64/libmeshsystem.dylib
+
+            if (StructuralComparisons.StructuralEqualityComparer.Equals(encoding, KV3_ENCODING_BINARY_BLOCK_COMPRESSED))
+            {
+                BlockDecompress(reader, outWrite, outRead);
+            }
+            else if (StructuralComparisons.StructuralEqualityComparer.Equals(encoding, KV3_ENCODING_BINARY_POSSIBLY_LZ4))
+            {
+                DecompressLZ4(reader, outWrite);
+            }
+            else if (StructuralComparisons.StructuralEqualityComparer.Equals(encoding, KV3_ENCODING_BINARY_UNCOMPRESSED))
+            {
+                // Nothing to do here
+            }
+            else
+            {
+                throw new InvalidDataException("Unrecognised KV3 Encoding");
+            }
+
+            if (!StructuralComparisons.StructuralEqualityComparer.Equals(format, KV3_FORMAT_GENERIC))
             {
                 throw new InvalidDataException("Unrecognised KV3 Format");
             }

-            // outWrite.Write(format);
-
-            // Ok we are 100% sure its now KV, good
-
+            Data = ParseBinaryKV3(outRead, null, true);
+        }
+
+        private void BlockDecompress(BinaryReader reader, BinaryWriter outWrite, BinaryReader outRead)
+        {
             // It is flags, right?
             var flags = reader.ReadBytes(4); // TODO: Figure out what this is

@@ -114,8 +135,13 @@
             {
                 stringArray[i] = outRead.ReadNullTermString(Encoding.UTF8);
             }
-
-            Data = ParseBinaryKV3(outRead, null, true);
+        }
+
+        private void DecompressLZ4(BinaryReader reader, BinaryWriter outWrite)
+        {
+            // TODO
+            var decoder = new Decoder();
+            decoder.Code(reader.BaseStream, outWrite.BaseStream, Size, reader.ReadUInt32(), null);
         }

         private KVObject ParseBinaryKV3(BinaryReader reader, KVObject parent, bool inArray = false)
@@ -202,10 +228,5 @@
         {
             Data.Serialize(writer);
         }
-
-        private static bool ByteArrayCompare(ReadOnlySpan<byte> a1, ReadOnlySpan<byte> a2)
-        {
-            return a1.SequenceEqual(a2);
-        }
     }
 }