A special-case feature for streams that get constantly evicted - mark them uncachable so we don't waste time caching, evicting, resolving conflicts, etc etc

--- src/Aggregates.NET.Domain/Internal/MemoryStreamCache.cs
+++ src/Aggregates.NET.Domain/Internal/MemoryStreamCache.cs
@@ -1,4 +1,5 @@
 using Aggregates.Contracts;
+using Aggregates.Extensions;
 using NServiceBus.Logging;
 using System;
 using System.Collections.Concurrent;
@@ -6,6 +7,7 @@
 using System.Linq;
 using System.Runtime.Caching;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;

 namespace Aggregates.Internal
@@ -14,13 +16,49 @@
     {
         private static readonly ILog Logger = LogManager.GetLogger(typeof(MemoryStreamCache));
         private readonly static MemoryCache _cache = new MemoryCache("Aggregates Cache", new System.Collections.Specialized.NameValueCollection { { "CacheMemoryLimitMegabytes", "500" } });
-
+        // For streams that are changing multiple times a second, no sense to cache them if they get immediately evicted
+        private readonly static HashSet<String> _uncachable = new HashSet<string>();
+        private readonly static HashSet<String> _levelOne = new HashSet<string>();
+        private static String _lastEvicted = "";
+        private static Timer _unachableEviction = new Timer((_) =>
+        {
+            Logger.Write(LogLevel.Debug, () => $"Clearing {_uncachable.Count} uncachable stream names");
+            _uncachable.Clear();
+        }, null, TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(10));
+
         public void Cache(String stream, object cached)
         {
-            _cache.Set(stream, cached, new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(5) });
+            if (_uncachable.Contains(stream) || _levelOne.Contains(stream))
+                return;
+
+            _cache.Set(stream, cached, new CacheItemPolicy { AbsoluteExpiration = DateTime.UtcNow + TimeSpan.FromMinutes(5) });
         }
         public void Evict(String stream)
         {
+            // Logic here:
+            // If a stream is getting evicted multiple times in a row, it would mean there are a lot of commands being processed that are changing the same stream
+            // What this will do is whenever a stream is evicted it will be first saved as the "lastEvicted"
+            // Next eviction if its the same stream, then it moves the stream to levelOne, kind of a buffer zone that will prevent the stream
+            // from being cached, but is also very temporary.  If the next eviction is not the same stream, then the previous stream is removed
+            // from level one.
+            // If it IS the same stream for a third time, then its moved into the _uncachable set where it won't be cached for as much as 10 minutes
+            // depending on the timer.
+            // So tldr, if a stream is evicted 3 times in a row its marked "uncachable" for up to 10 minutes
+            if (stream.Equals(_lastEvicted))
+            {
+                if (_levelOne.Contains(stream))
+                {
+                    Logger.Write(LogLevel.Info, () => $"Stream {stream} has been evicted 3 times in a row, marking uncachable for a few minutes");
+                    _uncachable.Add(stream);
+                }
+                else
+                    _levelOne.Add(stream);
+            }
+            else
+                _levelOne.Remove(_lastEvicted);
+
+
+            _lastEvicted = stream;
             _cache.Remove(stream);
         }
         public object Retreive(String stream)
@@ -36,7 +74,7 @@
             var cached = _cache.Get(stream);
             if (cached == null) return false;

-            if(cached is IEventStream && payload is IWritableEvent)
+            if (cached is IEventStream && payload is IWritableEvent)
             {
                 Logger.DebugFormat("Updating cached stream [{0}]", stream);
                 var real = (cached as IEventStream);


Calculate inventory weight changes when completing a trade

--- EOLib/PacketHandlers/Trade/TradeOfferUpdateHandler.cs
+++ EOLib/PacketHandlers/Trade/TradeOfferUpdateHandler.cs
@@ -3,6 +3,7 @@
 using EOLib.Domain.Login;
 using EOLib.Domain.Notifiers;
 using EOLib.Domain.Trade;
+using EOLib.IO.Repositories;
 using EOLib.Net;
 using EOLib.Net.Handlers;
 using Optional;
@@ -78,21 +79,24 @@
     /// </summary>
     public class TradeUseHandler : TradeOfferUpdateHandler
     {
-        private readonly ICharacterProvider _characterProvider;
+        private readonly ICharacterRepository _characterRepository;
         private readonly ICharacterInventoryRepository _characterInventoryRepository;
+        private readonly IEIFFileProvider _eifFileProvider;
         private readonly IEnumerable<ITradeEventNotifier> _tradeEventNotifiers;

         public override PacketAction Action => PacketAction.Use;

         public TradeUseHandler(IPlayerInfoProvider playerInfoProvider,
                                ITradeRepository tradeRepository,
-                               ICharacterProvider characterProvider,
+                               ICharacterRepository characterRepository,
                                ICharacterInventoryRepository characterInventoryRepository,
+                               IEIFFileProvider eifFileProvider,
                                IEnumerable<ITradeEventNotifier> tradeEventNotifiers)
             : base(playerInfoProvider, tradeRepository)
         {
-            _characterProvider = characterProvider;
+            _characterRepository = characterRepository;
             _characterInventoryRepository = characterInventoryRepository;
+            _eifFileProvider = eifFileProvider;
             _tradeEventNotifiers = tradeEventNotifiers;
         }

@@ -101,10 +105,11 @@
             base.HandlePacket(packet);

             var (removeItems, addItems) = _tradeRepository
-                .SomeWhen(x => x.PlayerOneOffer.PlayerID == _characterProvider.MainCharacter.ID)
+                .SomeWhen(x => x.PlayerOneOffer.PlayerID == _characterRepository.MainCharacter.ID)
                 .Match(some: x => (x.PlayerOneOffer.Items, x.PlayerTwoOffer.Items),
                        none: () => (_tradeRepository.PlayerTwoOffer.Items, _tradeRepository.PlayerOneOffer.Items));

+            var stats = _characterRepository.MainCharacter.Stats;
             foreach (var removedItem in removeItems)
             {
                 _characterInventoryRepository.ItemInventory.SingleOrNone(x => x.ItemID == removedItem.ItemID)
@@ -116,6 +121,8 @@
                             _characterInventoryRepository.ItemInventory.Add(x.WithAmount(x.Amount - removedItem.Amount));
                         }
                     });
+
+                stats = stats.WithNewStat(CharacterStat.Weight, stats[CharacterStat.Weight] - _eifFileProvider.EIFFile[removedItem.ItemID].Weight * removedItem.Amount);
             }

             foreach (var newItem in addItems)
@@ -130,7 +137,11 @@
                     {
                         _characterInventoryRepository.ItemInventory.Add(newItem);
                     });
+
+                stats = stats.WithNewStat(CharacterStat.Weight, stats[CharacterStat.Weight] + _eifFileProvider.EIFFile[newItem.ItemID].Weight * newItem.Amount);
             }
+
+            _characterRepository.MainCharacter = _characterRepository.MainCharacter.WithStats(stats);

             foreach (var notifier in _tradeEventNotifiers)
                 notifier.NotifyTradeClose(cancel: false);


fixed three unit tests

fixed three unit tests

--- Thrower.UnitTests/IfIsEmptyTests.cs
+++ Thrower.UnitTests/IfIsEmptyTests.cs
@@ -66,7 +66,7 @@
         }

         [Test]
-        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage)]
+        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage, MatchType = MessageMatch.StartsWith)]
         public void IfIsNullOrWhiteSpace_BlankString_WithMsg()
         {
             RaiseArgumentException.IfIsNullOrWhiteSpace(BlankString, nameof(TestMessage), TestMessage);
@@ -108,7 +108,7 @@
         }

         [Test]
-        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage)]
+        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage, MatchType = MessageMatch.StartsWith)]
         public void IfIsNullOrEmpty_EmptyString_WithMsg()
         {
             RaiseArgumentException.IfIsNullOrEmpty(string.Empty, nameof(TestMessage), TestMessage);
@@ -122,7 +122,7 @@
         }

         [Test]
-        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage)]
+        [ExpectedException(typeof(ArgumentException), ExpectedMessage = TestMessage, MatchType = MessageMatch.StartsWith)]
         public void IfIsNullOrWhiteSpace_EmptyString_WithMsg()
         {
             RaiseArgumentException.IfIsNullOrWhiteSpace(string.Empty, nameof(TestMessage), TestMessage);


Fix enumerator boxing case in visual hit testing.

--- src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs
+++ src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs
@@ -280,8 +280,13 @@
         /// <inheritdoc/>
         public bool HitTest(Point p)
         {
-            foreach (var operation in DrawOperations)
-            {
+            var drawOperations = DrawOperations;
+            var drawOperationsCount = drawOperations.Count;
+
+            for (var i = 0; i < drawOperationsCount; i++)
+            {
+                var operation = drawOperations[i];
+
                 if (operation?.Item?.HitTest(p) == true)
                 {
                     return true;


Excel's object model is insane.

Excel's object model is insane.

--- Parcel/ExcelIO/IO.cs
+++ Parcel/ExcelIO/IO.cs
@@ -41,19 +41,33 @@
                     Excel.Range ur = ws.UsedRange;
                     _rs.Add(ur);

-                    // array read formulas
-                    object[,] formulas = ur.Formula;
-
-                    // grab formula strings
-                    // danger: one-based array
-                    for (int i = 1; i <= formulas.GetLength(0); i++)
+                    // if a single cell
+                    if (ur.Columns.Count == 1 && ur.Rows.Count == 1)
                     {
-                        for (int j = 1; j <= formulas.GetLength(1); j++)
+                        String s = ur.Formula;
+                        if (!String.IsNullOrEmpty(s) && _formula_filter.IsMatch(s))
                         {
-                            String s = (String)formulas[i, j];
-                            if (!String.IsNullOrEmpty(s) && _formula_filter.IsMatch(s))
+                            fs.Add(s);
+                        }
+                    }
+                    // if an array
+                    else
+                    {
+
+                        // array read formulas
+                        object[,] formulas = ur.Formula;
+
+                        // grab formula strings
+                        // danger: one-based array
+                        for (int i = 1; i <= formulas.GetLength(0); i++)
+                        {
+                            for (int j = 1; j <= formulas.GetLength(1); j++)
                             {
-                                fs.Add(s);
+                                String s = (String)formulas[i, j];
+                                if (!String.IsNullOrEmpty(s) && _formula_filter.IsMatch(s))
+                                {
+                                    fs.Add(s);
+                                }
                             }
                         }
                     }


fix minor bug

fix minor bug

--- DBLike/ClientUI/Threads/FileSysWatchDog.cs
+++ DBLike/ClientUI/Threads/FileSysWatchDog.cs
@@ -39,4 +39,4 @@
         }
     }
     }
-}
+


Making remaining CommonController operations protected again.

--- DashServer/Controllers/CommonController.cs
+++ DashServer/Controllers/CommonController.cs
@@ -7,12 +7,12 @@
 {
     public class CommonController: ApiController
     {
-        public HttpResponseMessage CreateResponse<T>(T result)
+        protected HttpResponseMessage CreateResponse<T>(T result)
         {
             return CreateResponse(result, HttpStatusCode.OK);
         }

-        public HttpResponseMessage CreateResponse<T>(T result, HttpStatusCode status)
+        protected HttpResponseMessage CreateResponse<T>(T result, HttpStatusCode status)
         {
             var response = this.Request.CreateResponse(status, result, GlobalConfiguration.Configuration.Formatters.XmlFormatter, "application/xml");
             response.Headers.TryAddWithoutValidation("x-ms-version", "2014-02-14");


テスト一時除外

テスト一時除外

--- source/WinCap.Test/SettingsWindowTest.cs
+++ source/WinCap.Test/SettingsWindowTest.cs
@@ -66,7 +66,6 @@
         /// <summary>
         /// キャプチャ遅延時間のテスト。
         /// </summary>
-        [TestMethod]
         public void TestCaptureDelayTime()
         {
             var settingsWindow = App.ShowSettingsWindow();
@@ -95,7 +94,6 @@
         /// <summary>
         /// 全般タブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestGeneralError$",
@@ -130,7 +128,6 @@
         /// <summary>
         /// 出力タブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestOutputError$",
@@ -167,7 +164,6 @@
         /// <summary>
         /// ショートカットキータブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestShortcutKeyError$",


그래프의 좌표 값을 입력 받아서 눈금의 숫자로 출력하는 함수를 구현

그래프의 좌표 값을 입력 받아서 눈금의 숫자로 출력하는 함수를 구현

--- Transformation/LogTransformation.cs
+++ Transformation/LogTransformation.cs
@@ -350,24 +350,46 @@
             double power = 0; // 지수
             double MinLogValue = 0; // 최소값의 로그값
             double MaxLogValue = 0; // 최대값의 로그값
-
+            double CurrentPoint = 0; // 현재까지 이동한 좌표
+            double RulerCount = 0; // 눈금의 개수
+            double Gap = 0; // 눈금의 숫자 간격
+            int i = 0; // 반복제어변수
+            int j = 0;

             if(isX)
             {
                 if (Min >= 0 && Max > 0)
                 {
-                    // 최대값의 로그값을 구한다.
+                    Value = 0;
+
                     MaxLogValue = Math.Ceiling(Math.Log(Max, LogBase));
-                    // 지수를 구한다.
-                    power = MaxLogValue * ((PointValue - GraphZeroPoint.X) / GraphWidth);
-
-                    if (PointValue == GraphZeroPoint.X)
-                    {
-                        Value = 0;
-                    }
-                    else
-                    {
-                        Value = Math.Pow(LogBase, power);
+
+                    RulerCount = MaxLogValue + 1;
+
+                    CurrentPoint = 80 + GraphWidth / RulerCount; // x축 원점의 좌표
+
+                    if (PointValue != GraphZeroPoint.X)
+                    {
+                        // 눈금의 숫자값 초기화
+                        Value = 1;
+
+                        while (CurrentPoint < PointValue)
+                        {
+                            Gap = Math.Pow(LogBase, i + 1) - Math.Pow(LogBase, i);
+
+                            j = 0;
+
+                            while (j < Gap)
+                            {
+                                CurrentPoint += (GraphWidth / RulerCount) / Gap;
+
+                                Value += 1;
+
+                                j++;
+                            }
+
+                            i++;
+                        }
                     }
                 }
             }


cache SourcePos when backtracking is off

--- Pidgin/ParseState.cs
+++ Pidgin/ParseState.cs
@@ -28,7 +28,9 @@
         private int _bufferStartLocation;  // how many tokens had been consumed up to the start of the buffer?
         private int _currentIndex;
         private int _bufferedCount;
-        private SourcePos _bufferStartSourcePos;
+
+        private int _lastSourcePosLocation;
+        private SourcePos _lastSourcePos;

         // a monotonic stack of locations.
         // I know you'll forget this, so: you can't make this into a stack of _currentIndexes,
@@ -47,7 +49,9 @@
             _bufferStartLocation = 0;
             _currentIndex = 0;
             _bufferedCount = span.Length;
-            _bufferStartSourcePos = new SourcePos(1,1);
+
+            _lastSourcePosLocation = 0;
+            _lastSourcePos = new SourcePos(1,1);

             _eof = default;
             _unexpected = default;
@@ -69,7 +73,9 @@
             _bufferStartLocation = 0;
             _currentIndex = 0;
             _bufferedCount = 0;
-            _bufferStartSourcePos = new SourcePos(1,1);
+
+            _lastSourcePosLocation = 0;
+            _lastSourcePos = new SourcePos(1,1);

             _eof = default;
             _unexpected = default;
@@ -173,10 +179,7 @@
                 // newBufferLength |------------------|

-                for (var i = 0; i < keepFrom; i++)
-                {
-                    _bufferStartSourcePos = _posCalculator(_buffer![i], _bufferStartSourcePos);
-                }
+                UpdateLastSourcePos();

                 if (newBufferLength > _buffer!.Length)
                 {
@@ -228,7 +231,23 @@
         }

         public SourcePos ComputeSourcePos()
-            => ComputeSourcePosAt(Location);
+        {
+            UpdateLastSourcePos();
+            return ComputeSourcePosAt(Location);
+        }
+
+        private void UpdateLastSourcePos()
+        {
+            var location = _bookmarks.Count > 0
+                ? _bookmarks[0]
+                : Location;
+
+            for (var i = _lastSourcePosLocation - _bufferStartLocation; i < location - _bufferStartLocation; i++)
+            {
+                _lastSourcePos = _posCalculator(_span[i], _lastSourcePos);
+            }
+            _lastSourcePosLocation = location;
+        }

         private SourcePos ComputeSourcePosAt(int location)
         {
@@ -241,10 +260,10 @@
                 throw new ArgumentOutOfRangeException(nameof(location), location, "Tried to compute a SourcePos from too far in the future. Please report this as a bug in Pidgin!");
             }

-            var pos = _bufferStartSourcePos;
-            for (var i = 0; i < location - _bufferStartLocation; i++)
-            {
-                pos = _posCalculator(_span![i], pos);
+            var pos = _lastSourcePos;
+            for (var i = _lastSourcePosLocation - _bufferStartLocation; i < location - _bufferStartLocation; i++)
+            {
+                pos = _posCalculator(_span[i], pos);
             }
             return pos;
         }


UpdateQuantityAndPrice log added

UpdateQuantityAndPrice log added

--- src/ChannelAdvisorAccess/Services/Items/ItemsService.cs
+++ src/ChannelAdvisorAccess/Services/Items/ItemsService.cs
@@ -1488,24 +1488,58 @@
 				ChannelAdvisorLogger.LogTraceException( channelAdvisorException );
 				throw channelAdvisorException;
 			}
-		}
-
-		public void UpdateQuantityAndPrice( InventoryItemQuantityAndPrice itemQuantityAndPrice, Mark mark = null )
-		{
-			AP.Submit.Do( () =>
-			{
-				var resultOfBoolean = this._client.UpdateInventoryItemQuantityAndPrice( this._credentials, this.AccountId, itemQuantityAndPrice );
-				CheckCaSuccess( resultOfBoolean );
-			} );
-		}
-
-		public async Task UpdateQuantityAndPriceAsync( InventoryItemQuantityAndPrice itemQuantityAndPrice, Mark mark = null )
-		{
-			await AP.SubmitAsync.Do( async () =>
-			{
-				var resultOfBoolean = await this._client.UpdateInventoryItemQuantityAndPriceAsync( this._credentials, this.AccountId, itemQuantityAndPrice ).ConfigureAwait( false );
-				CheckCaSuccess( resultOfBoolean.UpdateInventoryItemQuantityAndPriceResult );
-			} ).ConfigureAwait( false );
+		}
+
+		public void UpdateQuantityAndPrice( InventoryItemQuantityAndPrice itemQuantityAndPrice, Mark mark = null )
+		{
+			if( mark.IsBlank() )
+				mark = Mark.CreateNew();
+
+			try
+			{
+				ChannelAdvisorLogger.LogTraceStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+
+				AP.Submit.Do( () =>
+				{
+					ChannelAdvisorLogger.LogTraceRetryStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+					var resultOfBoolean = this._client.UpdateInventoryItemQuantityAndPrice( this._credentials, this.AccountId, itemQuantityAndPrice );
+					CheckCaSuccess( resultOfBoolean );
+					ChannelAdvisorLogger.LogTraceRetryEnd( this.CreateMethodCallInfo( mark : mark, methodResult : resultOfBoolean.ToJson(), additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+				} );
+				ChannelAdvisorLogger.LogTraceEnd( this.CreateMethodCallInfo( mark : mark, methodResult : "void", additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+			}
+			catch( Exception exception )
+			{
+				var channelAdvisorException = new ChannelAdvisorException( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ), exception );
+				ChannelAdvisorLogger.LogTraceException( channelAdvisorException );
+				throw channelAdvisorException;
+			}
+		}
+
+		public async Task UpdateQuantityAndPriceAsync( InventoryItemQuantityAndPrice itemQuantityAndPrice, Mark mark = null )
+		{
+			if( mark.IsBlank() )
+				mark = Mark.CreateNew();
+
+			try
+			{
+				ChannelAdvisorLogger.LogTraceStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+
+				await AP.SubmitAsync.Do( async () =>
+				{
+					ChannelAdvisorLogger.LogTraceRetryStarted( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+					var resultOfBoolean = await this._client.UpdateInventoryItemQuantityAndPriceAsync( this._credentials, this.AccountId, itemQuantityAndPrice ).ConfigureAwait( false );
+					CheckCaSuccess( resultOfBoolean.UpdateInventoryItemQuantityAndPriceResult );
+					ChannelAdvisorLogger.LogTraceRetryEnd( this.CreateMethodCallInfo( mark : mark, methodResult : resultOfBoolean.ToJson(), additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+				} ).ConfigureAwait( false );
+				ChannelAdvisorLogger.LogTraceEnd( this.CreateMethodCallInfo( mark : mark, methodResult : "void", additionalInfo : this.AdditionalLogInfoString, methodParameters : itemQuantityAndPrice.ToJson() ) );
+			}
+			catch( Exception exception )
+			{
+				var channelAdvisorException = new ChannelAdvisorException( this.CreateMethodCallInfo( mark : mark, additionalInfo : this.AdditionalLogInfoString ), exception );
+				ChannelAdvisorLogger.LogTraceException( channelAdvisorException );
+				throw channelAdvisorException;
+			}
 		}

 		public void UpdateQuantityAndPrices( IEnumerable< InventoryItemQuantityAndPrice > itemQuantityAndPrices, Mark mark = null )


Added background image capabilities

Added background image capabilities

--- scripts/Conversation.cs
+++ scripts/Conversation.cs
@@ -17,6 +17,9 @@
     [Tooltip("The (Optional) Text where the conversation will be drawn.  If a custom Text is used, it must be a child of this GameObject.")]
     public Text Text;

+    [Tooltip("The (Optional) Image used as a background for the text.  If an image is used, it must be a child of this GameObject")]
+    public Image Image;
+
     private string input;
     private float timeDelay;
     private bool resetConversationAtEnd;
@@ -39,7 +42,7 @@
     private void Update()
     {
         UpdateConversation();
-        RotateTextIntoView();
+        RotateIntoView();
     }

     /// <summary>
@@ -75,6 +78,13 @@
         }
         this.Text = text;
         this.Text.enabled = false;
+        Image image = transform.GetComponentInChildren<Image>();
+        if (image)
+        {
+            this.Image = image;
+            this.Image.enabled = false;
+            image.transform.position = Vector3.Scale(transform.localScale, DEFAULT_OFFSET_BY_SCALE);
+        }
     }

     private void InitializeInputParameters(string input, float miliseconds, bool resetConversation, CanCyclePhraseDelegate CanCyclePhrase, GameObject audience)
@@ -99,6 +109,7 @@
     private void BeginConversation()
     {
         this.Text.enabled = true;
+        this.Image.enabled = true;
         CycleNextPhrase();
         if (timeDelay > 0)
         {
@@ -148,13 +159,17 @@
         }
     }

-    private void RotateTextIntoView()
+    private void RotateIntoView()
     {
         if (audience == null)
         {
             return;
         }
         Text.transform.forward = transform.position - audience.transform.position;
+        if (Image)
+        {
+            Image.transform.forward = transform.position - audience.transform.position;
+        }
     }

     private void CycleNextPhrase(bool automaticCycle = false)


path parsing is now culture invariant.

path parsing is now culture invariant.


fix sillyness with redirects

fix sillyness with redirects

--- src/CollectionsOnline.WebSite/Modules/RedirectModule.cs
+++ src/CollectionsOnline.WebSite/Modules/RedirectModule.cs
@@ -9,17 +9,17 @@
     {
         public RedirectModule()
         {
-            Get["/search.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/search.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);

-            Get["/browser.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/browser.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);

-            Get["/results.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/results.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);

-            Get["/resultsns.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/resultsns.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);

-            Get["/results-browse.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/results-browse.php"] = parameters => new RedirectResponse("/search", RedirectResponse.RedirectType.Permanent);

-            Get["/object.php"] = parameters =>
+            Get["{?collections}/object.php"] = parameters =>
             {
                 var irn = Request.Query["irn"];

@@ -29,25 +29,21 @@
                 return new RedirectResponse(string.Format("/specimens/{0}", irn), RedirectResponse.RedirectType.Permanent);
             };

-            Get["/imagedisplay.php"] = parameters => new RedirectResponse("/", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/imagedisplay.php"] = parameters => new RedirectResponse("/", RedirectResponse.RedirectType.Permanent);

-            Get["/webmedia.php"] = parameters => new RedirectResponse("/", RedirectResponse.RedirectType.Permanent);
-
-            #region temp redirects
-            // Handle canonical site redirect via episerver i.e. http://museumvictoria.com.au/collections => http://collections.museumvictoria.com.au
-            // All remaining redirects handled below temporarily until reverse proxy fixed.
+            Get["{?collections}/webmedia.php"] = parameters => new RedirectResponse("/", RedirectResponse.RedirectType.Permanent);

             // Phar lap
-            Get["/items/1499868/{name?}"] = parameters => new RedirectResponse("/specimens/139139", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/items/1499868/{name?}"] = parameters => new RedirectResponse("/specimens/139139", RedirectResponse.RedirectType.Permanent);
             // Sam the koala
-            Get["/items/1550331/{name?}"] = parameters => new RedirectResponse("/specimens/1487596", RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/items/1550331/{name?}"] = parameters => new RedirectResponse("/specimens/1487596", RedirectResponse.RedirectType.Permanent);

-            Get["/items/{id:int}/{name}"] = parameters => new RedirectResponse(string.Format("/items/{0}", parameters.id), RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/items/{id:int}/{name}"] = parameters => new RedirectResponse(string.Format("/items/{0}", parameters.id), RedirectResponse.RedirectType.Permanent);

-            Get["/themes/{id:int}/{name?}"] = parameters => new RedirectResponse(string.Format("/articles/{0}", parameters.id), RedirectResponse.RedirectType.Permanent);
+            Get["{?collections}/themes/{id:int}/{name?}"] = parameters => new RedirectResponse(string.Format("/articles/{0}", parameters.id), RedirectResponse.RedirectType.Permanent);

             //Images
-            Get["/itemimages/{id1:int}/{id2:int}/{filename}"] = parameters =>
+            Get["{?collections}/itemimages/{id1:int}/{id2:int}/{filename}"] = parameters =>
             {
                 int imageIrn = int.Parse(string.Format("{0}{1}", parameters.id1, parameters.id2));

@@ -66,8 +62,6 @@

                 return new RedirectResponse(location, RedirectResponse.RedirectType.Permanent);
             };
-
-            #endregion
         }
     }
 }


Fixed logger

Fixed logger

--- src/DDDSouthWest.Domain/Features/Public/Page/GetPage.cs
+++ src/DDDSouthWest.Domain/Features/Public/Page/GetPage.cs
@@ -19,7 +19,7 @@
             private readonly ClientConfigurationOptions _options;
             private readonly ILogger _logger;

-            public Handler(ClientConfigurationOptions options, ILogger logger)
+            public Handler(ClientConfigurationOptions options, ILogger<GetPage> logger)
             {
                 _options = options;
                 _logger = logger;


update

update

--- ExchangeMAPI/Source/MS-OXCROPS/Adapter/CaptureCode.cs
+++ ExchangeMAPI/Source/MS-OXCROPS/Adapter/CaptureCode.cs
@@ -583,7 +583,7 @@
                 Site.CaptureRequirementIfIsTrue(
                     isVerifyR106,
                     106,
-                    @"[In RopLogon ROP Success Response Buffer for Public Folders] ReplGuid (16 bytes): A GUID.");
+                    @"[In RopLogon ROP Success Response Buffer for Public Folders] ReplGuid (16 bytes): A GUID that specifies the replica GUID associated with the replica ID that is specified in the ReplId field.");

                 if (Common.IsRequirementEnabled(4720, this.Site))
                 {
@@ -632,7 +632,7 @@
                         isVerifyR214,
                         214,
                         @"[In Appendix B: Product Behavior] PerUserGuid (16 bytes): Implementation does set this field to an empty GUID (all zeroes). (Microsoft Exchange Server 2010 and above follow this behavior.)");
-                }
+                }
             }
         }

@@ -1363,7 +1363,7 @@
                 4,
                 Marshal.SizeOf(ropGetStoreStateResponse.StoreState.GetType()),
                 240,
-                @"[In RopGetStoreState ROP Success Response Buffer] StoreState (4 bytes): A flags structure.");
+                @"[In RopGetStoreState ROP Success Response Buffer] StoreState (4 bytes): A flags structure that contains flags that indicate the state of the mailbox for the logged on user.");

             // Add the debug information
             Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R241,StoreState:{0}", ropGetStoreStateResponse.StoreState);
@@ -9160,6 +9160,17 @@
                 isVerifyR2024,
                 2024,
                 @"[In RopSetMessageStatus ROP Success Response Buffer,MessageStatusFlags (4 bytes)]The possible values[zero, the value of msRemoteDownload is 0x00001000, the value of msInConflict is 0x00000800 and the value of msRemoteDelete is 0x00002000] are specified in [MS-OXCMSG] section 2.2.3.8.2.");
+
+            // Add the debug information
+            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R20004");
+
+            // Verify MS-OXCROPS requirement: MS-OXCROPS_R20004
+            this.Site.CaptureRequirementIfAreEqual<byte>(
+                0x20,
+                ropSetMessageStatusResponse.RopId,
+                20004,
+                @"[In RopGetMessageStatus ROP Response Buffers] The value of the RopId field for RopGetMessageStatus responses MUST be 0x20, which is the same as that for the RopSetMessageStatus responses.");
+
         }

         /// <summary>
@@ -17649,25 +17660,24 @@
         /// Verify RPC error when the pcbOut parameter of EcDoRpcExt2 is set to the maximum value.
         /// </summary>
         /// <param name="status">The status of the RPC operation.</param>
-        private void VerifyFailRPCForMaxPcbOut(uint status)
-        {
-            if (Common.IsRequirementEnabled(454509, this.Site)
-                && (this.oxcropsClient.MapiContext.TransportSequence.ToLower().Equals("ncacn_ip_tcp", StringComparison.InvariantCultureIgnoreCase)
-                || this.oxcropsClient.MapiContext.TransportSequence.ToLower().Equals("ncacn_http", StringComparison.InvariantCultureIgnoreCase)))
+        /// <param name="pcbOut">The size of required response buffer.</param>
+        private void VerifyFailRPCForMaxPcbOut(uint status, uint pcbOut)
+        {
+            if (Common.IsRequirementEnabled(454509, this.Site))
             {
+                bool isVerify454509 = status == OxcRpcErrorCode.ECResponseTooBig && pcbOut == MS_OXCROPSAdapter.MaxPcbOut;
+
                 // Add the debug information
                 Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R454509");

                 // Verify MS-OXCROPS requirement: MS-OXCROPS_R454509
-                Site.CaptureRequirementIfAreEqual<uint>(
-                    OxcRpcErrorCode.ECResponseTooBig,
-                    status,
+                Site.CaptureRequirementIfIsTrue(
+                    isVerify454509,
                     454509,
-                    @"[In Appendix B: Product Behavior] If one of the ROP responses will not fit in the ROP output buffer when either the pcbOut parameter of EcDoRpcExt2 response is set to the maximum value, then implementation does fail the EcDoRpcExt2 method with a return value of 0x0000047D. (Exchange 2010  and above follow this behavior.)");
+                    @"[In Appendix B: Product Behavior] If one of the ROP responses will not fit in the ROP output buffer when either the pcbOut parameter of EcDoRpcExt2 response is set to the maximum value, then implementation does fail the EcDoRpcExt2 method with a return value of 0x0000047D or fail the Execute request type with a value of 0x0000047D in the StatusCode field. (Exchange 2010  and above follow this behavior");
             }
-
             if (Common.IsRequirementEnabled(20009, this.Site)
-                && this.oxcropsClient.MapiContext.TransportSequence.ToLower().Equals("mapi_http", StringComparison.InvariantCultureIgnoreCase))
+               && this.oxcropsClient.MapiContext.TransportSequence.ToLower().Equals("mapi_http", StringComparison.InvariantCultureIgnoreCase))
             {
                 // Add the debug information
                 Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R20009");


Adding lua to coreconfig

Adding lua to coreconfig

Adding lua to coreconfig

--- Pluton/CoreConfig.cs
+++ Pluton/CoreConfig.cs
@@ -42,6 +42,9 @@

             ConfigFile.AddSetting("javascript", "enabled", "true");
             ConfigFile.AddSetting("javascript", "checkHash", "false");
+
+            ConfigFile.AddSetting("lua", "enabled", "true");
+            ConfigFile.AddSetting("lua", "checkHash", "false");
         }

         public string GetValue(string Section, string Setting)


add IsConnected to heartratemonitor

add IsConnected to heartratemonitor

--- WWSSI.Bluetooth/HeartRateMonitor.cs
+++ WWSSI.Bluetooth/HeartRateMonitor.cs
@@ -123,6 +123,17 @@
         }

         /// <summary>
+        /// Gets a value indicating whether this instance is connected.
+        /// </summary>
+        /// <value>
+        ///   <c>true</c> if this instance is connected; otherwise, <c>false</c>.
+        /// </value>
+        public bool IsConnected
+        {
+            get { return _heartRateDevice.IsConnected; }
+        }
+
+        /// <summary>
         /// Connects the first BLE heart rate device.
         /// </summary>
         public async Task<Schema.HeartRateDevice> ConnectAsync()
@@ -155,7 +166,7 @@
         /// <returns></returns>
         public async Task DisconnectAsync()
         {
-            if (_heartRateDevice != null && _heartRateDevice.ConnectionStatus== BluetoothConnectionStatus.Connected) await _heartRateDevice.Close();
+            if (_heartRateDevice != null && _heartRateDevice.ConnectionStatus == BluetoothConnectionStatus.Connected) await _heartRateDevice.Close();
         }

         /// <summary>


Refresh without stopping controller...

Refresh without stopping controller...

...when repository hasn't changed.

--- src/GitHub.VisualStudio/UI/Views/GitHubPaneViewModel.cs
+++ src/GitHub.VisualStudio/UI/Views/GitHubPaneViewModel.cs
@@ -356,11 +356,12 @@
             if (!initialized)
                 return;

-            if (!changed)
-                return;
-
-            Stop();
-            RepositoryOrigin = RepositoryOrigin.Unknown;
+            if (changed)
+            {
+                Stop();
+                RepositoryOrigin = RepositoryOrigin.Unknown;
+            }
+
             Refresh();
         }


Fixed file types

Fixed file types

--- wp6-virtualfolder/src/WP6Service2/WP6Service2/Services/Files/OnedataProvider.cs
+++ wp6-virtualfolder/src/WP6Service2/WP6Service2/Services/Files/OnedataProvider.cs
@@ -30,6 +30,7 @@
         private readonly string OD_ATTR_NAME = "name";
         private readonly string OD_ATTR_SIZE = "size";
         private readonly string OD_ATTR_TYPE = "type";
+        private readonly string OD_ATTR_MODE = "mode";

         /* JSON parameters from file API */
         private readonly string OD_FILE_PATH = "path";
@@ -100,17 +101,14 @@
                 {
                     var filePath = normPath == "" ? fItem : normPath + "/" + fItem;
                     var fileAttrs = (JObject) processRequest(attrAPIURL + "/" + filePath);
-                    bool isDir = (string) fileAttrs[OD_ATTR_TYPE] == "dir";
-                    var fType = isDir ? FileType.Directory : FileType.None;
-                    fType = fType | FileType.Read | FileType.Available;                        // TODO fix type

                     result.Add(new SBFile {
                         path=filePath,
                         name = (string) fileAttrs[OD_ATTR_NAME],
-                        attributes = isDir ? FileAttributes.Directory : FileAttributes.Normal, // TODO fix attributes
-                        size = isDir ? 0 : (ulong) fileAttrs[OD_ATTR_SIZE],
-                        date = new DateTime((long) fileAttrs[OD_ATTR_MTIME] * 10000),
-                        filetype = fType,
+                        attributes = calcFileAttrs(fileAttrs),
+                        size = (ulong) fileAttrs[OD_ATTR_SIZE],
+                        date = calcDate(pathAttrs),
+                        filetype = calcFileType(fileAttrs),
                         webdavuri = WEBDAVURL + filePath,
                         publicwebdavuri = PUBLICWEBDAVURL + "/" + filePath
                     });
@@ -121,10 +119,10 @@
                 result.Add(new SBFile {
                     path=normPath,
                     name = (string) pathAttrs[OD_ATTR_NAME],
-                    attributes = FileAttributes.Normal,                        // TODO fix attributes
+                    attributes = calcFileAttrs(pathAttrs),
                     size = (ulong) pathAttrs[OD_ATTR_SIZE],
-                    date = new DateTime((long) pathAttrs[OD_ATTR_MTIME] * 10000),
-                    filetype = FileType.Read | FileType.Available,             // TODO fix type
+                    date = calcDate(pathAttrs),
+                    filetype = calcFileType(pathAttrs),
                     webdavuri = WEBDAVURL + normPath,
                     publicwebdavuri = PUBLICWEBDAVURL + "/" + normPath
                 });
@@ -163,6 +161,32 @@
              */
             return true;
         }
+
+        private FileType calcFileType(JObject infos)
+        {
+            var type = (string) infos[OD_ATTR_TYPE];
+            var mode = (int) infos[OD_ATTR_MODE];
+
+            var result = FileType.Read | FileType.Available;
+            if (type == "dir") result |= FileType.Directory;
+            if ((((mode % 1000) / 100) & 2) > 0) result |= FileType.Write;
+
+            return result;
+        }
+
+        private FileAttributes calcFileAttrs(JObject infos)
+        {
+            var type = (string) infos[OD_ATTR_TYPE];
+            return type == "dir" ? FileAttributes.Directory : FileAttributes.Normal;
+        }
+
+        private DateTime calcDate(JObject infos)
+        {
+            double offset = (double) infos[OD_ATTR_MTIME];
+            DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
+            return origin.AddSeconds(offset);
+        }
+
     }

     public class OnedataClientException : Exception


Fix small bug in ObservableSelect

Fix small bug in ObservableSelect

--- Expressions/Expressions.Linq/Linq/ObservableSelect.cs
+++ Expressions/Expressions.Linq/Linq/ObservableSelect.cs
@@ -169,7 +169,7 @@
                 else
                 {
                     var itemChange = (ValueChangedNotificationResult<TResult>)change;
-                    if (source.Count() > 1)
+                    if (sources.Count > 1)
                     {
                         // if there are multiple changes, we need to check whether the change belongs to items
                         // we just added or removed


Add comments.

Add comments.

--- WalletWasabi/Crypto/GroupElement.cs
+++ WalletWasabi/Crypto/GroupElement.cs
@@ -101,10 +101,13 @@
 			return a + new GroupElement(b.Ge.Negate());
 		}

+		/// <param name="scalar">It's ok for the scalar to overflow.</param>
 		public static GroupElement operator *(Scalar scalar, GroupElement groupElement)
 		{
 			Guard.NotNull(nameof(GroupElement), groupElement);

+			// For some strange reason scalar * GE.Infinity isn't infinity. Let's fix it as it should be, since:
+			// 2 * GE.Infinity = GE.Infinity + GE.Infinity = GE.Infinity.
 			if (groupElement.IsInfinity)
 			{
 				return Infinity;
@@ -113,6 +116,7 @@
 			return new GroupElement(scalar * groupElement.Ge);
 		}

+		/// <param name="scalar">It's ok for the scalar to overflow.</param>
 		public static GroupElement operator *(GroupElement groupElement, Scalar scalar) => scalar * groupElement;

 		public GroupElement Negate() => new GroupElement(Ge.Negate());


support .NET Framework projects which import via PackageReferences

--- src/HtmlGenerator/Pass1-Generation/SolutionGenerator.cs
+++ src/HtmlGenerator/Pass1-Generation/SolutionGenerator.cs
@@ -5,6 +5,8 @@
 using System.Linq;
 using System.Reflection;
 using System.Text;
+using System.Xml;
+using System.Xml.Linq;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.MSBuild;
 using Microsoft.SourceBrowser.Common;
@@ -359,26 +361,39 @@

         private static bool IsTestProject(Project proj)
         {
-            return proj.MetadataReferences.Any(mdr =>
+            return
+                IsTestProject(proj, "xunit") ||
+                IsTestProject(proj, "nunit") ||
+                IsTestProject(proj, "MSTest.TestFramework") ||
+                proj.MetadataReferences.Any(mdr =>
             {
                 var peRef = mdr as PortableExecutableReference;
-                return IsXUnitTestProject(peRef) || IsNUnitTestProject(peRef) || IsMSTestProject(peRef);
+                return
+                    IsTestProject(peRef, "xunit.core.dll") ||
+                    IsTestProject(peRef, "nunit.framework.dll") ||
+                    IsTestProject(peRef, "Microsoft.VisualStudio.TestPlatform.TestFramework.dll");
             });
         }

-        private static bool IsXUnitTestProject(PortableExecutableReference peRef)
-        {
-            return peRef?.FilePath.EndsWith("xunit.core.dll", StringComparison.InvariantCultureIgnoreCase) ?? false;
-        }
-
-        private static bool IsNUnitTestProject(PortableExecutableReference peRef)
-        {
-            return peRef?.FilePath.EndsWith("nunit.framework.dll", StringComparison.InvariantCultureIgnoreCase) ?? false;
-        }
-
-        private static bool IsMSTestProject(PortableExecutableReference peRef)
-        {
-            return peRef?.FilePath.EndsWith("Microsoft.VisualStudio.TestPlatform.TestFramework.dll", StringComparison.InvariantCultureIgnoreCase) ?? false;
+        private static IEnumerable<string> GetPackageRefs(Project proj)
+        {
+            var projRoot = XElement.Load(proj.FilePath);
+            var packageRefs = projRoot.Elements()
+                .Where(elem => elem.Name.LocalName == "ItemGroup")
+                .SelectMany(elem => elem.Elements())
+                .Where(elem => elem.Name.LocalName == "PackageReference")
+                .Select(elem => (string)elem.Attribute("Include"));
+            return packageRefs;
+        }
+
+        private static bool IsTestProject(Project proj, string marker)
+        {
+            return GetPackageRefs(proj).Any(pr => string.Equals(pr, marker, StringComparison.InvariantCultureIgnoreCase));
+        }
+
+        private static bool IsTestProject(PortableExecutableReference peRef, string marker)
+        {
+            return peRef?.FilePath.EndsWith(marker, StringComparison.InvariantCultureIgnoreCase) ?? false;
         }

         private void SetFieldValue(object instance, string fieldName, object value)


Freakin Razor. How does it work?

Freakin Razor. How does it work?

--- Website/App_Code/ViewHelpers.cshtml
+++ Website/App_Code/ViewHelpers.cshtml
@@ -148,7 +148,7 @@

         @* A little quick-n-dirty code to display the current machine *@
         @* In Azure, we want the Instance ID. The Machine Name is total garbage *@
-        try {
+        @try {
             if(RoleEnvironment.IsAvailable) {
                 <text>You are on @RoleEnvironment.CurrentRoleInstance.Id.</text>
             } else {


Don't need to store as a field

Don't need to store as a field

--- Website/Modules/NetgearApiModule.cs
+++ Website/Modules/NetgearApiModule.cs
@@ -8,16 +8,12 @@
 {
     public sealed class NetgearApiModule : NancyModule
     {
-        private readonly AttachedDevicesParser attachedDevicesParser;
-
         public NetgearApiModule(AttachedDevicesParser attachedDevicesParser) : base("/netgear")
         {
             if (attachedDevicesParser == null)
             {
                 throw new ArgumentNullException(nameof(attachedDevicesParser));
             }
-
-            this.attachedDevicesParser = attachedDevicesParser;

             Post["/RecordAttachedDevices"] = _ =>
             {


CA-161001: Display Created field as DateTime on Docker General Tab.

Signed-off-by: Hui Zhang <1290dea41121f0a9caa715ba0808e38da438ab06@citrix.com>

--- XenAdmin/TabPages/GeneralTabPage.cs
+++ XenAdmin/TabPages/GeneralTabPage.cs
@@ -1357,7 +1357,15 @@
                 DockerContainer dockerContainer = (DockerContainer)xenObject;
                 s.AddEntry(Messages.NAME, dockerContainer.Name.Length != 0 ? dockerContainer.Name : Messages.NONE);
                 s.AddEntry(Messages.STATUS, dockerContainer.status.Length != 0 ? dockerContainer.status : Messages.NONE);
-                s.AddEntry(Messages.CONTAINER_CREATED, dockerContainer.created.Length != 0 ? dockerContainer.created : Messages.NONE);
+                try
+                {
+                    DateTime created = Util.FromUnixTime(double.Parse(dockerContainer.created)).ToLocalTime();
+                    s.AddEntry(Messages.CONTAINER_CREATED, HelpersGUI.DateTimeToString(created, Messages.DATEFORMAT_DMY_HMS, true));
+                }
+                catch
+                {
+                    s.AddEntry(Messages.CONTAINER_CREATED, dockerContainer.created.Length != 0 ? dockerContainer.created : Messages.NONE);
+                }
                 s.AddEntry(Messages.CONTAINER_IMAGE, dockerContainer.image.Length != 0 ? dockerContainer.image : Messages.NONE);
                 s.AddEntry(Messages.CONTAINER, dockerContainer.container.Length != 0 ? dockerContainer.container : Messages.NONE);
                 s.AddEntry(Messages.CONTAINER_COMMAND, dockerContainer.command.Length != 0 ? dockerContainer.command : Messages.NONE);


Increase race wait time to 30s

Increase race wait time to 30s

--- src/NadekoBot/Modules/Gambling/Commands/AnimalRacing.cs
+++ src/NadekoBot/Modules/Gambling/Commands/AnimalRacing.cs
@@ -90,8 +90,8 @@
                     {
                         try
                         {
-                            try { await raceChannel.SendConfirmAsync($"🏁`Race is starting in 20 seconds or when the room is full. Type {NadekoBot.ModulePrefixes[typeof(Gambling).Name]}jr to join the race.`"); } catch (Exception ex) { _log.Warn(ex); }
-                            var t = await Task.WhenAny(Task.Delay(20000, token), fullgame);
+                            try { await raceChannel.SendConfirmAsync($"🏁`Race is starting in 30 seconds or when the room is full. Type {NadekoBot.ModulePrefixes[typeof(Gambling).Name]}jr to join the race.`"); } catch (Exception ex) { _log.Warn(ex); }
+                            var t = await Task.WhenAny(Task.Delay(30000, token), fullgame);
                             Started = true;
                             cancelSource.Cancel();
                             if (t == fullgame)


Assigned value to ID property of user model

--- src/Nancy.Demo.Samples/Data/DefaultGitHubUserFactory.cs
+++ src/Nancy.Demo.Samples/Data/DefaultGitHubUserFactory.cs
@@ -39,6 +39,7 @@
                 null :
                 new ContributorModel
                 {
+                    Id = Guid.NewGuid().ToString(),
                     AvatarUrl = response.avatar_url,
                     Name = response.name,
                     Url = response.html_url,


Update AssemblyVersionInfo.cs

Update AssemblyVersionInfo.cs

Add GeneratedCodeAttribute to ThisAssembly

--- src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs
+++ src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs
@@ -431,6 +431,7 @@

             internal override void StartThisAssemblyClass()
             {
+                this.codeBuilder.AppendLine($"[System.CodeDom.Compiler.GeneratedCode(\"{ThisAssembly.AssemblyName}\",\"{ThisAssembly.AssemblyVersion}\")]");
                 this.codeBuilder.AppendLine("internal static partial class ThisAssembly {");
             }


Reindex: black list additional index settings that cannot be copied over

--- src/Nest/Document/Multiple/Reindex/ReindexObservable.cs
+++ src/Nest/Document/Multiple/Reindex/ReindexObservable.cs
@@ -104,6 +104,13 @@
 		{
 			var originalIndexSettings = this._client.GetIndex(resolvedFrom);
 			var originalIndexState = originalIndexSettings.Indices[resolvedFrom];
+
+			// Black list internal settings that cannot be copied over
+			// See https://github.com/elastic/elasticsearch/issues/21096
+			originalIndexState.Settings.Remove("index.provided_name");
+			originalIndexState.Settings.Remove("index.creation_date");
+			originalIndexState.Settings.Remove("index.version.created");
+
 			var createIndexRequest = this._reindexRequest.CreateIndexRequest ?? new CreateIndexRequest(resolvedTo, originalIndexState);
 			var createIndexResponse = this._client.CreateIndex(createIndexRequest);
 			if (!createIndexResponse.IsValid)


Removing specific TitlePart indexing, as already handled by ITitleAspect

--HG--
branch : 1.x

--- src/Orchard.Web/Core/Title/Handlers/TitlePartHandler.cs
+++ src/Orchard.Web/Core/Title/Handlers/TitlePartHandler.cs
@@ -7,8 +7,6 @@

         public TitlePartHandler(IRepository<TitlePartRecord> repository) {
             Filters.Add(StorageFilter.For(repository));
-
-            OnIndexing<TitlePart>((context, part) => context.DocumentIndex.Add("title", part.Record.Title).RemoveTags().Analyze());
         }
     }
 }


Update Distributed Tenants Description. (#9820)

--- src/OrchardCore.Modules/OrchardCore.Tenants/Manifest.cs
+++ src/OrchardCore.Modules/OrchardCore.Tenants/Manifest.cs
@@ -26,7 +26,7 @@
 [assembly: Feature(
     Id = "OrchardCore.Tenants.Distributed",
     Name = "Distributed Tenants",
-    Description = "Keeps in sync tenants states, needs a distributed cache e.g. 'Redis Cache'.",
+    Description = "Keeps in sync tenants states, needs a distributed cache e.g. 'Redis Cache' and a stateless configuration, see: https://docs.orchardcore.net/en/dev/docs/reference/core/Shells/index.html",
     Category = "Distributed",
     DefaultTenantOnly = true
 )]


Fix for inconsistent behavior when adding a string vs object to QueryStringBuilder

--- Geta.EPi.Extensions/QueryString/QueryStringBuilder.cs
+++ Geta.EPi.Extensions/QueryString/QueryStringBuilder.cs
@@ -86,7 +86,11 @@
         /// <returns>Instance of modified QueryStringBuilder.</returns>
         public QueryStringBuilder Add(string name, string value)
         {
-            UrlBuilder.QueryCollection[name] = HttpUtility.UrlEncode(value);
+            if (!string.IsNullOrEmpty(value))
+            {
+                UrlBuilder.QueryCollection[name] = HttpUtility.UrlEncode(value);
+            }
+
             return this;
         }

@@ -98,12 +102,7 @@
         /// <returns>Instance of modified QueryStringBuilder.</returns>
         public QueryStringBuilder Add(string name, object value)
         {
-            if (value != null)
-            {
-                return Add(name, value.ToString());
-            }
-
-            return this;
+            return Add(name, value.ToString());
         }

         /// <summary>


Amend

Amend

--- Gu.Wpf.Geometry.UiTests/AngularGradientWindowTests.cs
+++ Gu.Wpf.Geometry.UiTests/AngularGradientWindowTests.cs
@@ -1,6 +1,7 @@
 namespace Gu.Wpf.Geometry.UiTests
 {
     using Gu.Wpf.UiAutomation;
+
     using NUnit.Framework;

     public static class AngularGradientWindowTests
@@ -62,7 +63,7 @@
             window.FindSlider("StartAngle").Value = startAngle;
             window.FindSlider("CentralAngle").Value = centralAngle;
             var groupBox = window.FindGroupBox("Render");
-            TestImage.AreEqual("AngularGradientWindow",$"{startAngle} → {centralAngle}.png", groupBox);
+            TestImage.AreEqual("AngularGradientWindow", $"{startAngle} → {centralAngle}.png", groupBox);
         }
     }
 }


Cleanup

Cleanup

--- Query/ExpressionVisitors/Internal/InfoCarrierEntityQueryableExpressionVisitor.cs
+++ Query/ExpressionVisitors/Internal/InfoCarrierEntityQueryableExpressionVisitor.cs
@@ -27,8 +27,8 @@
             this.querySource = querySource;
         }

-        private new InfoCarrierQueryModelVisitor QueryModelVisitor
-            => (InfoCarrierQueryModelVisitor)base.QueryModelVisitor;
+        //private new InfoCarrierQueryModelVisitor QueryModelVisitor
+        //    => (InfoCarrierQueryModelVisitor)base.QueryModelVisitor;

         protected override Expression VisitEntityQueryable(Type elementType)
         {


Update to call the correct Update MP API

--- SignInCheckIn/MinistryPlatform.Translation/Repositories/ParticipantRepository.cs
+++ SignInCheckIn/MinistryPlatform.Translation/Repositories/ParticipantRepository.cs
@@ -130,7 +130,7 @@
                 "Call_Number"
             };

-            _ministryPlatformRestRepository.UsingAuthenticationToken(apiUserToken).Update<List<MpEventParticipantDto>>(mpEventParticipantDtos, columnList);
+            _ministryPlatformRestRepository.UsingAuthenticationToken(apiUserToken).Update<MpEventParticipantDto>(mpEventParticipantDtos, columnList);
         }
     }
 }


Updated jquery ajax calls to use "method" parameter instead of "type"

--- Source/Applications/openHistorian/openHistorian/wwwroot/TrendMeasurements.cshtml
+++ Source/Applications/openHistorian/openHistorian/wwwroot/TrendMeasurements.cshtml
@@ -1510,7 +1510,7 @@
             $.ajax({
                 cache: false,
                 url: "ExportDataHandler.ashx",
-                type: "post",
+                method: "post",
                 data: selectedPointIDs.join(),
                 dataType: "text",
                 success: function (cacheID) {


covered read model update

covered read model update

--- Tests.Integration.Presentation.Web/GDPR/DataProcessingAgreementReadModelsTest.cs
+++ Tests.Integration.Presentation.Web/GDPR/DataProcessingAgreementReadModelsTest.cs
@@ -45,6 +45,7 @@
         {
             //Arrange
             var name = A<string>();
+            var systemName = $"SYSTEM:{name}";
             var refName = $"REF:{name}";
             var refUserAssignedId = $"REF:{name}EXT_ID";
             var refUrl = $"https://www.test-rm{A<uint>()}.dk";
@@ -58,19 +59,31 @@
             var user = availableUsers.First();
             using var response = await DataProcessingAgreementHelper.SendAssignRoleRequestAsync(agreement.Id, role.Id, user.Id);
             await ReferencesHelper.CreateReferenceAsync(refName, refUserAssignedId, refUrl, refDisp, dto => dto.DataProcessingAgreement_Id = agreement.Id);
+            var itSystemDto = await ItSystemHelper.CreateItSystemInOrganizationAsync(systemName, organizationId, AccessModifier.Public);
+            await ItSystemHelper.TakeIntoUseAsync(itSystemDto.Id, organizationId);
+            using var assignSystemResponse = await DataProcessingAgreementHelper.SendAssignSystemRequestAsync(agreement.Id, itSystemDto.Id);

             //Wait for read model to rebuild
-            await Task.WhenAll(WaitForAsync(() =>
-            {
-                return Task.FromResult(
-                    DatabaseAccess.MapFromEntitySet<DataProcessingAgreementRoleAssignmentReadModel, bool>(x =>
-                        x.AsQueryable().Any(rm => rm.Parent.SourceEntityId == agreement.Id)));
-            }, TimeSpan.FromSeconds(10)), WaitForAsync(() =>
-            {
-                return Task.FromResult(
-                    DatabaseAccess.MapFromEntitySet<DataProcessingAgreementReadModel, bool>(x =>
-                        x.AsQueryable().Any(rm => rm.MainReferenceUrl == refUrl)));
-            }, TimeSpan.FromSeconds(10)));
+            await Task.WhenAll(
+                WaitForAsync(() =>
+                {
+                    return Task.FromResult(
+                        DatabaseAccess.MapFromEntitySet<DataProcessingAgreementRoleAssignmentReadModel, bool>(x =>
+                            x.AsQueryable().Any(rm => rm.Parent.SourceEntityId == agreement.Id)));
+                }, TimeSpan.FromSeconds(10)),
+                WaitForAsync(() =>
+                {
+                    return Task.FromResult(
+                        DatabaseAccess.MapFromEntitySet<DataProcessingAgreementReadModel, bool>(x =>
+                            x.AsQueryable().Any(rm => rm.MainReferenceUrl == refUrl)));
+                }, TimeSpan.FromSeconds(10)),
+                WaitForAsync(() =>
+                {
+                    return Task.FromResult(
+                        DatabaseAccess.MapFromEntitySet<DataProcessingAgreementReadModel, bool>(x =>
+                            x.AsQueryable().Any(rm => rm.SystemNamesAsCsv.Contains(systemName))));
+                }, TimeSpan.FromSeconds(10))
+            );

             //Act
             var result = (await DataProcessingAgreementHelper.QueryReadModelByNameContent(organizationId, name, 1, 0)).ToList();


update

update

--- Demos/FeasibilityTest/FormMain.Designer.cs
+++ Demos/FeasibilityTest/FormMain.Designer.cs
@@ -33,6 +33,8 @@
             this.btnSetColor = new System.Windows.Forms.Button();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.openFileDlg = new System.Windows.Forms.OpenFileDialog();
+            this.drvSimuCanvas1 = new DrvSimu.DrvSimuCanvas();
+            ((System.ComponentModel.ISupportInitialize)(this.drvSimuCanvas1)).BeginInit();
             this.SuspendLayout();
             //
             // btnAddPoint
@@ -57,15 +59,29 @@
             //
             this.openFileDlg.Filter = "*.txt|*.txt";
             //
+            // drvSimuCanvas1
+            //
+            this.drvSimuCanvas1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.drvSimuCanvas1.Location = new System.Drawing.Point(12, 42);
+            this.drvSimuCanvas1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.drvSimuCanvas1.Name = "drvSimuCanvas1";
+            this.drvSimuCanvas1.RenderTrigger = CSharpGL.RenderTrigger.TimerBased;
+            this.drvSimuCanvas1.Size = new System.Drawing.Size(713, 498);
+            this.drvSimuCanvas1.TabIndex = 2;
+            //
             // FormMain
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(738, 553);
+            this.Controls.Add(this.drvSimuCanvas1);
             this.Controls.Add(this.btnSetColor);
             this.Controls.Add(this.btnAddPoint);
             this.Name = "FormMain";
             this.Text = "FormMain";
+            ((System.ComponentModel.ISupportInitialize)(this.drvSimuCanvas1)).EndInit();
             this.ResumeLayout(false);

         }
@@ -76,6 +92,7 @@
         private System.Windows.Forms.Button btnSetColor;
         private System.Windows.Forms.Timer timer1;
         private System.Windows.Forms.OpenFileDialog openFileDlg;
+        private DrvSimu.DrvSimuCanvas drvSimuCanvas1;

     }
 }


looks like I forgot these, hummm how embarrassing ( remove the last double lock ) (#7977)

* yeah, Staging  fix a biilllion

* Remembberr to poool


temp checkin need to fix

temp checkin need to fix

--- Devedse.DeveImagePyramid/PyramidCreator.cs
+++ Devedse.DeveImagePyramid/PyramidCreator.cs
@@ -9,13 +9,18 @@
 {
     public static class PyramidCreator
     {
-        public static void MoveInputToOutputAndConvert(string inputFolder, string outputFolder, string desiredExtension, int deepestFolderNumber, bool useParallel)
+        public static int MoveInputToOutputAndConvert(string inputFolder, string outputFolder, string desiredExtension, bool useParallel)
         {
+            var filesInDirectory = Directory.GetFiles(inputFolder);
+
+            var foundExtension = filesInDirectory.Select(t => Path.GetExtension(t)).Distinct().SingleOrDefault();
+
+            var firstImageFileName = $"0_0{foundExtension}";
+            var firstImagePath = Path.Combine(inputFolder, firstImageFileName);
+            var firstImage = ImageReader.ReadImage(firstImagePath);
+
             var outputForThis = Path.Combine(outputFolder, deepestFolderNumber.ToString());
             Directory.CreateDirectory(outputForThis);
-
-            var filesInDirectory = Directory.GetFiles(inputFolder);
-
             var fileConversionAction = new Action<string>(filePath =>
             {
                 var extension = Path.GetExtension(filePath);
@@ -43,6 +48,8 @@
                     fileConversionAction(filePath);
                 }
             }
+
+            return deepestFolderNumber;
         }

         public static void CreatePyramid(string inputFolder, string outputFolder, string desiredExtension, bool useParallel)


git-svn-id: 21cdf44b51306c1f0753fc51e774ecf5fc1851ba@648 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Examples/Test_DataStream/Program.cs
+++ Dorian/Examples/Test_DataStream/Program.cs
@@ -20,8 +20,11 @@
 			public int color;
 			public int u;
 			public int v;
-			public float f;
-			public float g;
+
+			public override int GetHashCode()
+			{
+				return x.GetHashCode() ^ y.GetHashCode() ^ z.GetHashCode() ^ color.GetHashCode() ^ u.GetHashCode() ^ v.GetHashCode();
+			}

 			public override bool Equals(object obj)
 			{
@@ -83,8 +86,6 @@
 				testItem.color = _rnd.Next();
 				testItem.u = _rnd.Next();
 				testItem.v = _rnd.Next();
-				testItem.f = (float)_rnd.NextDouble();
-				testItem.g = (float)_rnd.NextDouble();

 				items[i] = testItem;
 				crc[i] = testItem;


Removed unnecessary usings from Character.

--- Drama.Shard.Grains/Characters/Character.cs
+++ Drama.Shard.Grains/Characters/Character.cs
@@ -19,7 +19,6 @@
 using Drama.Auth.Interfaces;
 using Drama.Core.Interfaces;
 using Drama.Core.Interfaces.Networking;
-using Drama.Core.Interfaces.Numerics;
 using Drama.Shard.Grains.Units;
 using Drama.Shard.Interfaces.Characters;
 using Drama.Shard.Interfaces.Maps;


rollback changes in TestContext

rollback changes in TestContext

--- EFCore.BulkExtensions.Tests/TestContext.cs
+++ EFCore.BulkExtensions.Tests/TestContext.cs
@@ -23,15 +23,7 @@

         public TestContext(DbContextOptions options) : base(options)
         {
-            try
-            {
-                Database.EnsureCreated();
-                //var x = new Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator();
-            }
-            catch (Exception e)
-            {
-                throw;
-            }
+            Database.EnsureCreated();
         }

         protected override void OnModelCreating(ModelBuilder modelBuilder)
@@ -57,7 +49,7 @@
         {
             var builder = new DbContextOptionsBuilder<TestContext>();
             var databaseName = nameof(EFCoreBulkTest);
-            var connectionString = $"Server=.\\SQLEXPRESS;Database={databaseName};Trusted_Connection=True;MultipleActiveResultSets=true";
+            var connectionString = $"Server=localhost;Database={databaseName};Trusted_Connection=True;MultipleActiveResultSets=true";
             builder.UseSqlServer(connectionString); // Can NOT Test with UseInMemoryDb (Exception: Relational-specific methods can only be used when the context is using a relational)
             return builder.Options;
         }


Gold Drop Protection

Gold Drop Protection

Player will be warned when dropping a large quantity of gold on the ground.

--- EndlessClient/EndlessClient/EOInventory.cs
+++ EndlessClient/EndlessClient/EOInventory.cs
@@ -47,6 +47,7 @@
 		private readonly Timer m_recentClickTimer;

 		private readonly PacketAPI m_api;
+		private static bool safetyCommentHasBeenShown;

 		public EOInventoryItem(PacketAPI api, int slot, ItemRecord itemData, InventoryItem itemInventoryInfo, EOInventory inventory)
 			: base(null, null, inventory)
@@ -144,7 +145,14 @@
 						dlg.DialogClosing += (sender, args) =>
 						{
 							if (args.Result == XNADialogResult.OK)
-								Handlers.Item.DropItem(m_inventory.id, dlg.SelectedAmount, (byte)loc.X, (byte)loc.Y);
+							{
+								//note: not sure of the actual limit. 10000 is arbitrary here
+								if (dlg.SelectedAmount > 10000 && m_inventory.id == 1 && !safetyCommentHasBeenShown)
+									EODialog.Show(DATCONST1.DROP_MANY_GOLD_ON_GROUND, XNADialogButtons.Ok, EODialogStyle.SmallDialogSmallHeader,
+										(o, e) => { safetyCommentHasBeenShown = true; });
+								else
+									Handlers.Item.DropItem(m_inventory.id, dlg.SelectedAmount, (byte) loc.X, (byte) loc.Y);
+							}
 						};
 					}
 					else if (inRange)


FIX THE PERFORMANCE ISSUE 🎉🎉🎉🎉🎉🎉🎉🎉🎉

FIX THE PERFORMANCE ISSUE 🎉🎉🎉🎉🎉🎉🎉🎉🎉

--- EndlessClient/GameExecution/EndlessGame.cs
+++ EndlessClient/GameExecution/EndlessGame.cs
@@ -38,7 +38,6 @@
         private readonly ILoggerProvider _loggerProvider;
         private readonly IChatBubbleTextureProvider _chatBubbleTextureProvider;
         private readonly IShaderRepository _shaderRepository;
-        private readonly ICharacterInfoPanelFactory _characterInfoPanelFactory;
         private readonly IConfigurationProvider _configurationProvider;
         private readonly IMfxPlayer _mfxPlayer;
         private readonly IXnaControlSoundMapper _soundMapper;
@@ -63,7 +62,6 @@
                            ILoggerProvider loggerProvider,
                            IChatBubbleTextureProvider chatBubbleTextureProvider,
                            IShaderRepository shaderRepository,
-                           ICharacterInfoPanelFactory characterInfoPanelFactory,
                            IConfigurationProvider configurationProvider,
                            IMfxPlayer mfxPlayer,
                            IXnaControlSoundMapper soundMapper)
@@ -78,7 +76,6 @@
             _loggerProvider = loggerProvider;
             _chatBubbleTextureProvider = chatBubbleTextureProvider;
             _shaderRepository = shaderRepository;
-            _characterInfoPanelFactory = characterInfoPanelFactory;
             _configurationProvider = configurationProvider;
             _mfxPlayer = mfxPlayer;
             _soundMapper = soundMapper;
@@ -116,8 +113,10 @@
             AttemptToLoadPubFiles();

             IsMouseVisible = true;
+            IsFixedTimeStep = false;
             _previousKeyState = Keyboard.GetState();

+            _graphicsDeviceManager.SynchronizeWithVerticalRetrace = false;
             _graphicsDeviceManager.IsFullScreen = false;
             _graphicsDeviceManager.PreferredBackBufferWidth = _windowSizeProvider.Width;
             _graphicsDeviceManager.PreferredBackBufferHeight = _windowSizeProvider.Height;
@@ -154,14 +153,6 @@
                 _shaderRepository.Shaders[ShaderRepository.HairClip] = new Effect(GraphicsDevice, shaderBytes);
             }

-            // for some reason initializing these and then killing them speeds up transition from Login -> LoggedIn state
-            // TODO: figure out why this happens????
-            foreach (var panel in _characterInfoPanelFactory.CreatePanels(Enumerable.Repeat(Character.Default, 3)))
-            {
-                panel.Initialize();
-                panel.Dispose();
-            }
-
             SetUpInitialControlSet();

             if (_configurationProvider.MusicEnabled)


Change to make hidden lines un-editable.  Based on the fact that TransportManager.Raycast (which is the method used to select which line the user is editing) doesn't take into account the TransportLine.Flags.Hidden, but DOES take into account TransportLine.Flags.Created.

--- ExtendedPublicTransportUI/TransportUtil.cs
+++ ExtendedPublicTransportUI/TransportUtil.cs
@@ -18,10 +18,12 @@
         public static void HideTransportLine(ushort lineID)
         {
             Tm.m_lines.m_buffer[lineID].m_flags |= TransportLine.Flags.Hidden;
+			Tm.m_lines.m_buffer[lineID].m_flags &= ~TransportLine.Flags.Created;
         }
         public static void ShowTransportLine(ushort lineID)
         {
             Tm.m_lines.m_buffer[lineID].m_flags &= ~TransportLine.Flags.Hidden;
+			Tm.m_lines.m_buffer[lineID].m_flags |= TransportLine.Flags.Created;
         }

         public static void SelectTransportLine(ushort lineID)


Fix for SOS2 calculator (for one element in array).

--- Implementation/CompositeConstraints/SOS2Calculator.cs
+++ Implementation/CompositeConstraints/SOS2Calculator.cs
@@ -14,6 +14,10 @@

             var nonZeroes = new [] {leftVariable}.Concat(rightVariable).Select(v => v.Operation(OperationType.IsNotEqual, zero)).ToArray();
             var nonZeroPairs = nonZeroes.Zip(nonZeroes.Skip(1), Tuple.Create).Select(pair => pair.Item1.Operation(OperationType.Conjunction, pair.Item2)).ToArray();
+            if (!nonZeroPairs.Any())
+            {
+                nonZeroPairs = new[] {milpManager.FromConstant(0)};
+            }
             var nonZeroesCount = milpManager.Operation(OperationType.Addition, nonZeroes);
             milpManager.Set(
                 ConstraintType.Equal,


Mappers Version Alignment with Content

Mappers Version Alignment with Content

Making Content Edition and the Mappers DLL have the same version (for a
starting point)

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


Allow Kudu PowerShell console to execute scripts

--- Kudu.Services/Commands/PersistentCommandController.cs
+++ Kudu.Services/Commands/PersistentCommandController.cs
@@ -109,7 +109,7 @@
             if (shell.Equals("powershell", StringComparison.OrdinalIgnoreCase))
             {
                 startInfo.FileName = System.Environment.ExpandEnvironmentVariables(@"%windir%\System32\WindowsPowerShell\v1.0\powershell.exe");
-                startInfo.Arguments = "-File -";
+                startInfo.Arguments = "-ExecutionPolicy RemoteSigned -File -";
             }
             else
             {


Выделил спец.теги для документации  #402

Выделил спец.теги для документации  #402

--- src/ScriptEngine.HostedScript/Library/ProcessContext.cs
+++ src/ScriptEngine.HostedScript/Library/ProcessContext.cs
@@ -116,7 +116,9 @@

         /// <summary>
         /// Флаг указывает, что процесс завершен (или нет)
+        /// </summary>
         ///
+        /// <example>
         /// Пример правильной обработки цикла ожидания завершения процесса:
         ///
         /// Пока НЕ Процесс.Завершен ИЛИ Процесс.ПотокВывода.ЕстьДанные ИЛИ Процесс.ПотокОшибок.ЕстьДанные Цикл
@@ -134,7 +136,7 @@
         /// 	    	Сообщить(ОчереднаяСтрокаОшибок, СтатусСообщения.Важное);
         /// 	    КонецЕсли;
         ///  КонецЦикла;
-        /// </summary>
+        /// </example>
         [ContextProperty("Завершен","HasExited")]
         public bool HasExited
         {


优化UserHelper

优化UserHelper

--- src/Senparc.Weixin/Senparc.Weixin/Helpers/UserHelper.cs
+++ src/Senparc.Weixin/Senparc.Weixin/Helpers/UserHelper.cs
@@ -34,6 +34,9 @@

 namespace Senparc.Weixin.Helpers
 {
+    /// <summary>
+    /// 用户帮助类
+    /// </summary>
     public static class UserHelper
     {
         /// <summary>
@@ -41,11 +44,26 @@
         /// </summary>
         public enum HeadImageSize
         {
-            _0 = 0,
-            _46 = 46,
-            _64 = 64,
-            _96 = 96,
-            _132 = 132,
+            /// <summary>
+            /// 640*640正方形头像
+            /// </summary>
+            x0 = 0,
+            /// <summary>
+            /// 46*46正方形头像
+            /// </summary>
+            x46 = 46,
+            /// <summary>
+            /// 64*64
+            /// </summary>
+            x64 = 64,
+            /// <summary>
+            /// 96*96正方形头像
+            /// </summary>
+            x96 = 96,
+            /// <summary>
+            /// 132*132正方形头像
+            /// </summary>
+            x132 = 132,
         }

         /// <summary>
@@ -54,7 +72,7 @@
         /// <param name="userInfo">IUserInfo，包括用户头像信息</param>
         /// <param name="headImageSize">代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像）</param>
         /// <returns></returns>
-        public static string GetHeadImageUrl(this IUserInfo userInfo, HeadImageSize headImageSize = HeadImageSize._0)
+        public static string GetHeadImageUrl(this IUserInfo userInfo, HeadImageSize headImageSize = HeadImageSize.x0)
         {
             return GetHeadImageUrl(userInfo.headimgurl, headImageSize);
         }
@@ -65,7 +83,7 @@
         /// <param name="headImgUrl">用户头像</param>
         /// <param name="headImageSize">代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像）</param>
         /// <returns></returns>
-        public static string GetHeadImageUrl(string headImgUrl, HeadImageSize headImageSize = HeadImageSize._0)
+        public static string GetHeadImageUrl(string headImgUrl, HeadImageSize headImageSize = HeadImageSize.x0)
         {
             if (headImgUrl == null)
                 return null;


Unquarantine WebHostTests.UseUrls_HelloWorld_ClientSuccess (#43535)

--- src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs
+++ src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs
@@ -21,7 +21,6 @@
 {
     [ConditionalFact]
     [MsQuicSupported]
-    [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/38954")]
     public async Task UseUrls_HelloWorld_ClientSuccess()
     {
         // Arrange


Fix System.Threading tests hang in uapaot (#21586)

--- src/System.Threading/tests/ReaderWriterLockSlimTests.cs
+++ src/System.Threading/tests/ReaderWriterLockSlimTests.cs
@@ -383,7 +383,7 @@

         [Fact]
         [OuterLoop]
-        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #3364 and #5839")] // Hangs in desktop
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework | TargetFrameworkMonikers.UapAot, "dotnet/corefx #3364, #5839 and #21585")] // Hangs in desktop and in UapAot
         public static void ReleaseReadersWhenWaitingWriterTimesOut()
         {
             using (var rwls = new ReaderWriterLockSlim())


Ajusts

Ajusts

--- src/TITcs.SharePoint.SSOM/ActiveDirectory/SearchUser.cs
+++ src/TITcs.SharePoint.SSOM/ActiveDirectory/SearchUser.cs
@@ -24,13 +24,13 @@

                     var principalSearcher = new PrincipalSearcher(userPrincipal);

-                    foreach (var result in principalSearcher.FindAll())
+                    foreach (var principal in principalSearcher.FindAll())
                     {
-                        if (result is UserPrincipal)
+                        if (principal is UserPrincipal)
                         {
-                            var foundUserPrincipal = (UserPrincipal) result;
+                            var userPrincipal1 = (UserPrincipal) principal;

-                            var user = bindUser(foundUserPrincipal);
+                            var user = bindUser(userPrincipal1);

                             return user;
                         }
@@ -51,13 +51,13 @@

                     var principalSearcher = new PrincipalSearcher(userPrincipal);

-                    foreach (var result in principalSearcher.FindAll())
+                    foreach (var principal in principalSearcher.FindAll())
                     {
-                        if (result is UserPrincipal)
+                        if (principal is UserPrincipal)
                         {
-                            var foundUserPrincipal = (UserPrincipal)result;
+                            var userPrincipal1 = (UserPrincipal)principal;

-                            var user = bindUser(foundUserPrincipal);
+                            var user = bindUser(userPrincipal1);

                             return user;
                         }
@@ -93,15 +93,15 @@
                 {
                     PrincipalSearcher principalSearcher = new PrincipalSearcher(groupPrincipal);

-                    var result = principalSearcher.FindAll().SingleOrDefault(i => i.Name == name);
+                    var principal = principalSearcher.FindAll().SingleOrDefault(i => i.Name == name);

-                    var foundGroupPrincipal = (GroupPrincipal) result;
+                    var groupPrincipal1 = (GroupPrincipal) principal;

                     var group = new Group()
                     {
-                        Id = foundGroupPrincipal.Guid.ToString(),
-                        Name = foundGroupPrincipal.Name,
-                        Users = getUsers(foundGroupPrincipal.Members)
+                        Id = groupPrincipal1.Guid.ToString(),
+                        Name = groupPrincipal1.Name,
+                        Users = getUsers(groupPrincipal1.Members)
                     };

                     return group;


temp save to track history since i need to roll this back

--- src/Umbraco.Web/Routing/RedirectTrackingEventHandler.cs
+++ src/Umbraco.Web/Routing/RedirectTrackingEventHandler.cs
@@ -9,6 +9,7 @@
 using Umbraco.Core.Models.PublishedContent;
 using Umbraco.Core.Publishing;
 using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
 using Umbraco.Core.Sync;
 using Umbraco.Web.Cache;
 using Umbraco.Web.PublishedCache;
@@ -25,9 +26,10 @@
     /// </remarks>
     public class RedirectTrackingEventHandler : ApplicationEventHandler
     {
-        private const string ContextKey1 = "Umbraco.Web.Routing.RedirectTrackingEventHandler.1";
-        private const string ContextKey2 = "Umbraco.Web.Routing.RedirectTrackingEventHandler.2";
-        private const string ContextKey3 = "Umbraco.Web.Routing.RedirectTrackingEventHandler.3";
+        private const string ContextKey1 = "RedirectTrackingEventHandler.1";
+        private const string ContextKey2 = "RedirectTrackingEventHandler.2";
+        //private const string ContextKey3 = "RedirectTrackingEventHandler.3";
+        private const string ContextKey4 = "RedirectTrackingEventHandler.4";

         /// <inheritdoc />
         protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
@@ -90,19 +92,79 @@
             // rolled back items have to be published, so publishing will take care of that
         }

-        /// <summary>
-        /// Tracks a documents URLs during publishing in the current request
-        /// </summary>
-        private static Dictionary<int, Tuple<Guid, string>> OldRoutes
+        ///// <summary>
+        ///// Tracks a documents URLs during publishing in the current request
+        ///// </summary>
+        //private static Dictionary<int, Tuple<Guid, string>> OldRoutes
+        //{
+        //    get
+        //    {
+        //        var oldRoutes = RequestCache.GetCacheItem<Dictionary<int, Tuple<Guid, string>>>(
+        //            ContextKey3,
+        //            () => new Dictionary<int, Tuple<Guid, string>>());
+        //        return oldRoutes;
+        //    }
+        //}
+
+        private class PrePublishedContentContext
+        {
+            public static PrePublishedContentContext Empty
+            {
+                get { return new PrePublishedContentContext(null, null, null, null); }
+            }
+            /// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
+            public PrePublishedContentContext(IContent entity, string urlSegment, ContextualPublishedContentCache contentCache, Func<IEnumerable<IPublishedContent>> descendentsDelegate)
+            {
+                if (entity == null) throw new ArgumentNullException("entity");
+                if (contentCache == null) throw new ArgumentNullException("contentCache");
+                if (descendentsDelegate == null) throw new ArgumentNullException("descendentsDelegate");
+                if (string.IsNullOrWhiteSpace(urlSegment)) throw new ArgumentException("Value cannot be null or whitespace.", "urlSegment");
+                Entity = entity;
+                UrlSegment = urlSegment;
+                ContentCache = contentCache;
+                DescendentsDelegate = descendentsDelegate;
+            }
+
+            public IContent Entity { get; set; }
+            public string UrlSegment { get; set; }
+            public Func<IEnumerable<IPublishedContent>> DescendentsDelegate { get; set; }
+            public ContextualPublishedContentCache ContentCache { get; set; }
+        }
+
+        /// <summary>
+        /// Tracks the current doc's entity, url segment and delegate to retrieve it's old descendents during publishing in the current request
+        /// </summary>
+        private static PrePublishedContentContext PrePublishedContent
         {
             get
             {
-                var oldRoutes = RequestCache.GetCacheItem<Dictionary<int, Tuple<Guid, string>>>(
-                    ContextKey3,
-                    () => new Dictionary<int, Tuple<Guid, string>>());
-                return oldRoutes;
-            }
-        }
+                //return the item in the cache - otherwise initialize it to an empty instance
+                return RequestCache.GetCacheItem<PrePublishedContentContext>(ContextKey4, () => PrePublishedContentContext.Empty);
+            }
+            set
+            {
+                //clear it
+                RequestCache.ClearCacheItem(ContextKey4);
+                //force it into the cache
+                RequestCache.GetCacheItem<PrePublishedContentContext>(ContextKey4, () => value);
+            }
+        }
+
+        //private static Func<IEnumerable<IPublishedContent>> DescendentsOrSelfDelegate
+        //{
+        //    get
+        //    {
+        //        //return the item in the cache - otherwise initialize it to an empty string
+        //        return RequestCache.GetCacheItem<Func<IEnumerable<IPublishedContent>>>(ContextKey4, () => (() => Enumerable.Empty<IPublishedContent>()));
+        //    }
+        //    set
+        //    {
+        //        //clear it
+        //        RequestCache.ClearCacheItem(ContextKey4);
+        //        //force it into the cache
+        //        RequestCache.GetCacheItem<Func<IEnumerable<IPublishedContent>>>(ContextKey4, () => value);
+        //    }
+        //}

         private static bool LockedEvents
         {
@@ -155,28 +217,26 @@
             if (contentCache == null) return;

             foreach (var entity in args.PublishedEntities)
-            {
-                //don't continue if this entity hasn't changed with regards to anything
-                // that might change it's URLs
-                if (entity.IsDirty() == false) continue;
-
-                if (entity.IsPropertyDirty("Name")
-                    || entity.IsPropertyDirty(Constants.Conventions.Content.UrlName)
-                    || entity.IsPropertyDirty(Constants.Conventions.Content.UrlAlias)
-                    || Moving)
-                {
-                    var entityContent = contentCache.GetById(entity.Id);
-                    if (entityContent == null) continue;
-                    foreach (var x in entityContent.DescendantsOrSelf())
-                    {
-                        var route = contentCache.GetRouteById(x.Id);
-                        if (IsNotRoute(route)) continue;
-                        var wk = UnwrapToKey(x);
-                        if (wk == null) continue;
-
-                        OldRoutes[x.Id] = Tuple.Create(wk.Key, route);
-                    }
-                }
+            {
+                var entityContent = contentCache.GetById(entity.Id);
+                if (entityContent == null) continue;
+
+                PrePublishedContent = new PrePublishedContentContext(entity, entity.GetUrlSegment(), contentCache, () => entityContent.Descendants());
+
+                //if (Moving)
+                //{
+                //    var entityContent = contentCache.GetById(entity.Id);
+                //    if (entityContent == null) continue;
+                //    foreach (var x in entityContent.Descendants())
+                //    {
+                //        var route = contentCache.GetRouteById(x.Id);
+                //        if (IsNotRoute(route)) continue;
+                //        var wk = UnwrapToKey(x);
+                //        if (wk == null) continue;
+
+                //        OldRoutes[x.Id] = Tuple.Create(wk.Key, route);
+                //    }
+                //}
             }

             LockedEvents = true; // we only want to see the "first batch"
@@ -208,23 +268,62 @@
             var serverRole = ApplicationContext.Current.GetCurrentServerRole();
             if (serverRole == ServerRole.Master || serverRole == ServerRole.Single)
             {
-                if (RequestCache.GetCacheItem(ContextKey3) == null)
-                    return;
-
+                //copy local
+                var prePublishedContext = PrePublishedContent;
+
+                //cannot continue if this is empty
+                if (prePublishedContext.Entity == null) return;
+
+                //cannot continue if there is no published cache
+                var contentCache = GetPublishedCache();
+                if (contentCache == null) return;
+
+                //get the entity id out of the event args to compare with the id stored during publishing
+                if (cacheRefresherEventArgs.MessageType != MessageType.RefreshById || cacheRefresherEventArgs.MessageType != MessageType.RefreshByInstance) return;
+
+                var refreshedEntityId = cacheRefresherEventArgs.MessageType == MessageType.RefreshByInstance
+                    ? ((IContent)cacheRefresherEventArgs.MessageObject).Id
+                    : (int) cacheRefresherEventArgs.MessageObject;
+
+                //if it's not the id that we're targeting, don't continue
+                if (refreshedEntityId != prePublishedContext.Entity.Id) return;
+
+                //cannot continue if the entity is not found
+                var entityContent = contentCache.GetById(prePublishedContext.Entity.Id);
+                if (entityContent == null) return;
+
+                //now we can check if the segment has changed
+                var newSegment = prePublishedContext.Entity.GetUrlSegment();
                 try
                 {
-                    foreach (var oldRoute in OldRoutes)
+                    if (Moving || newSegment != prePublishedContext.UrlSegment)
                     {
+                        //it's changed!
+
                         // assuming we cannot have 'CacheUpdated' for only part of the infos else we'd need
                         // to set a flag in 'Published' to indicate which entities have been refreshed ok
-                        CreateRedirect(oldRoute.Key, oldRoute.Value.Item1, oldRoute.Value.Item2);
+                        CreateRedirect(prePublishedContext.Entity.Id, prePublishedContext.Entity.Key, prePublishedContext.UrlSegment);
+
+                        //iterate the old descendents and get their old routes
+                        foreach (var x in prePublishedContext.DescendentsDelegate())
+                        {
+                            //get the old route from the old contextual cache
+                            var oldRoute = prePublishedContext.ContentCache.GetRouteById(x.Id);
+                            if (IsNotRoute(oldRoute)) continue;
+                            var wk = UnwrapToKey(x);
+                            if (wk == null) continue;
+
+                            CreateRedirect(wk.Id, wk.Key, oldRoute);
+                        }
                     }
                 }
                 finally
                 {
-                    OldRoutes.Clear();
-                    RequestCache.ClearCacheItem(ContextKey3);
-                }
+                    //set all refs to null
+                    prePublishedContext.Entity = null;
+                    prePublishedContext.ContentCache = null;
+                    prePublishedContext.DescendentsDelegate = null;
+                }
             }
         }