Added Ignore method to ignore exception types

--- src/ProblemDetails/ProblemDetailsOptions.cs
+++ src/ProblemDetails/ProblemDetailsOptions.cs
@@ -121,6 +121,16 @@
         }

         /// <summary>
+        /// Configures the middleware to ignore any exception of the specified exception type <typeparamref name="TException"/>.
+        /// This will cause cause the exception to be rethrown to be handled upstream.
+        /// </summary>
+        /// <typeparam name="TException">The exception type to ignore.</typeparam>
+        public void Ignore<TException>() where TException : Exception
+        {
+            Map<TException>(_ => null);
+        }
+
+        /// <summary>
         /// Maps the specified exception type <typeparamref name="TException"/> to a <see cref="ProblemDetails"/> instance
         /// using the specified <paramref name="mapping"/> function.
         /// </summary>


Removed unused file

Removed unused file

--- src/resharper-preview-tab/LiveLoadingRestartRequired.cs
+++ src/resharper-preview-tab/LiveLoadingRestartRequired.cs
@@ -1,79 +0,0 @@
-using System;
-using System.Collections.Generic;
-using JetBrains.Application;
-using JetBrains.Application.Extensions;
-using JetBrains.IDE;
-using JetBrains.ProjectModel;
-using JetBrains.Util;
-
-namespace CitizenMatt.ReSharper.PreviewTab
-{
-    [ShellComponent]
-    public class LiveLoadingRestartRequired : IExtensionRepository
-    {
-        private readonly SolutionsManager solutionsManager;
-
-        public LiveLoadingRestartRequired(SolutionsManager solutionsManager)
-        {
-            this.solutionsManager = solutionsManager;
-        }
-
-        public bool CanUninstall(string id)
-        {
-            return false;
-        }
-
-        public void Uninstall(string id, bool removeDependencies, IEnumerable<string> dependencies, Action<LoggingLevel, string> logger)
-        {
-        }
-
-        public bool HasMissingExtensions()
-        {
-            return false;
-        }
-
-        public void RestoreMissingExtensions()
-        {
-        }
-
-        public IEnumerable<string> GetExtensionsRequiringRestart()
-        {
-            if (NeedsRestart())
-                yield return "PreviewTab";
-        }
-
-        // If the plugin is loaded at startup, the component model successfully resolves EditorManager
-        // to our derived type. If we're live loaded (i.e. just installed), then it's already got the
-        // default implementation of EditorManager, as well as our version. If we find more than one
-        // instance, report that we need a restart. On the plus side, EditorManager is a solution
-        // component, so we can be live loaded when a solution is closed and everything is good
-        private bool NeedsRestart()
-        {
-            var solution = solutionsManager.Solution;
-            if (solution != null)
-            {
-                // Annoyingly, the simple solution.GetComponents<EditorManager>().Count() > 1
-                // causes issues when using a checked build (e.g. EAP builds). Retrieving a
-                // component asserts the same cardinality as the first time it was fetched.
-                // In other words, the first time you call GetComponent or GetComponents you
-                // set the cardinality of that type to be single or multiple, respectively.
-                // Checked builds assert that you call it the same way on subsequent calls,
-                // so you don't mistakenly try to get many when there's only supposed to be
-                // one, and more importantly, vice versa. The assert (VerifyCardinality) is
-                // disabled in production builds (thanks to [Conditional("JET_MODE_ASSERT")])
-                // but it would be nice to have a safe GetAllComponents that wouldn't assert
-                // and just return 1 or more components.
-                try
-                {
-                    // TODO: It looks like you can use GetComponent<IEnumerable<EditorManager>>().Count() > 1
-                    solution.GetComponent<EditorManager>();
-                }
-                catch (Exception e)
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-    }
-}


Избыточная проверка на тип данных границы цикла fixes #283

--- src/ScriptEngine/Machine/MachineInstance.cs
+++ src/ScriptEngine/Machine/MachineInstance.cs
@@ -1106,9 +1106,6 @@
             var counter = _operationStack.Pop();
             var limit = _currentFrame.LocalFrameStack.Peek();

-            if(counter.DataType != DataType.Number || limit.DataType != DataType.Number)
-                throw new WrongStackConditionException();
-
             if (counter.CompareTo(limit) <= 0)
             {
                 NextInstruction();


docs(stringextensions)

docs(stringextensions)

add xml documentation to class

--- src/skadisteam.inventory/Extensions/StringExtensions.cs
+++ src/skadisteam.inventory/Extensions/StringExtensions.cs
@@ -1,12 +1,34 @@
 namespace skadisteam.inventory.Extensions
 {
+    /// <summary>
+    /// Class which provide extensions for the string class.
+    /// </summary>
     internal static class StringExtensions
     {
+        /// <summary>
+        /// Will add the tradable parameter to urls.
+        /// It will append to an existing parameter url.
+        /// </summary>
+        /// <param name="input">
+        /// String which should be extended.
+        /// </param>
+        /// <returns>
+        /// The string with extended trading parameter.
+        /// </returns>
         internal static string AddTradableItemParameter(this string input)
         {
             return input + "&trading=1";
         }

+        /// <summary>
+        /// Will add the tradable parameter to urls as first parameter.
+        /// </summary>
+        /// <param name="input">
+        /// String which should be extended.
+        /// </param>
+        /// <returns>
+        /// The String with extended trading parameter.
+        /// </returns>
         internal static string AddNewTradableItemParameter(this string input)
         {
             return input + "?trading=1";


Added CombineWith that can combine objects/ints/etc saving casting at callsites

--- src/ServiceStack.Common/StringExtensions.cs
+++ src/ServiceStack.Common/StringExtensions.cs
@@ -114,7 +114,14 @@
         public static string CombineWith(this string path, params string[] thesePaths)
         {
             if (thesePaths.Length == 1 && thesePaths[0] == null) return path;
-            return PathUtils.CombinePaths(new StringBuilder(path.TrimEnd('/','\\')), thesePaths);
+            return PathUtils.CombinePaths(new StringBuilder(path.TrimEnd('/', '\\')), thesePaths);
+        }
+
+        public static string CombineWith(this string path, params object[] thesePaths)
+        {
+            if (thesePaths.Length == 1 && thesePaths[0] == null) return path;
+            return PathUtils.CombinePaths(new StringBuilder(path.TrimEnd('/', '\\')),
+                thesePaths.SafeConvertAll(x => x.ToString()).ToArray());
         }

         public static string ToParentPath(this string path)


Conditional branching opcodes: allow different object types to be compared.

--- src/SharpLang.Compiler/Compiler.Function.cs
+++ src/SharpLang.Compiler/Compiler.Function.cs
@@ -1488,9 +1488,18 @@
                         || (operand1.StackType != StackValueType.NativeInt && operand2.StackType == StackValueType.NativeInt))
                         throw new NotImplementedException("Comparison between native int and int types.");

+                    // Different object types: cast everything to object
+                    if (operand1.StackType == StackValueType.Object
+                        && operand2.StackType == StackValueType.Object
+                        && operand1.Type != operand2.Type)
+                    {
+                        value1 = LLVM.BuildPointerCast(builder, value1, @object.DefaultType, string.Empty);
+                        value2 = LLVM.BuildPointerCast(builder, value2, @object.DefaultType, string.Empty);
+                    }
+
                     if (operand1.StackType != operand2.StackType
                         || LLVM.TypeOf(value1) != LLVM.TypeOf(value2))
-                        throw new InvalidOperationException("Comparison between operands of different types.");
+                        throw new InvalidOperationException(string.Format("Comparison between operands of different types, {0} and {1}.", operand1.Type, operand2.Type));

                     ValueRef compareResult;
                     if (operand1.StackType == StackValueType.Float)


Fix empty text render

Fix empty text render

--- src/Skia/Avalonia.Skia/FormattedTextImpl.cs
+++ src/Skia/Avalonia.Skia/FormattedTextImpl.cs
@@ -214,6 +214,11 @@

         private void DrawTextBlob(int start, int length, float x, float y, SKCanvas canvas, SKPaint paint)
         {
+            if(length == 0)
+            {
+                return;
+            }
+
             var glyphs = _glyphs.Buffer.Span.Slice(start, length);
             var advances = _advances.Buffer.Span.Slice(start, length);
             var builder = t_builder.Value;
@@ -235,7 +240,10 @@

             var blob = builder.Build();

-            canvas.DrawText(blob, x, y, paint);
+            if(blob != null)
+            {
+                canvas.DrawText(blob, x, y, paint);
+            }
         }

         internal void Draw(DrawingContextImpl context,


More fixes for skia backend

More fixes for skia backend

--- src/Skia/Perspex.Skia/DrawingContextImpl.cs
+++ src/Skia/Perspex.Skia/DrawingContextImpl.cs
@@ -89,16 +89,20 @@
             paint.IsStroke = false;

             // TODO: SkiaSharp does not contain alpha yet!
-            //double opacity = brush.Opacity * _currentOpacity;
+            double opacity = brush.Opacity * _currentOpacity;
             //paint.SetAlpha(paint.GetAlpha() * opacity);
             paint.IsAntialias = true;

+            SKColor color = new SKColor(255, 255, 255, 255);
+
             var solid = brush as SolidColorBrush;
             if (solid != null)
-            {
-                paint.Color = solid.Color.ToSKColor();
+                color = solid.Color.ToSKColor();
+
+            paint.Color = (new SKColor(color.Red, color.Green, color.Blue, (byte) (color.Alpha*opacity)));
+            if (solid != null)
                 return rv;
-            }
+

             var gradient = brush as GradientBrush;
             if (gradient != null)
@@ -116,6 +120,7 @@
                     // would be nice to cache these shaders possibly?
                     var shader = SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode);
                     paint.Shader = shader;
+                    shader.Dispose();
                 }
                 else
                 {
@@ -131,6 +136,7 @@
                         // would be nice to cache these shaders possibly?
                         var shader = SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode);
                         paint.Shader = shader;
+                        shader.Dispose();
                     }
                 }

@@ -160,29 +166,7 @@
                             ? SKShaderTileMode.Mirror
                             : SKShaderTileMode.Repeat;
                 paint.Shader = SKShader.CreateBitmap(bitmap.Bitmap, tileX, tileY, translation);
-
-                // TODO: Get Tile Brushes working!!!
-                //
-                //throw new NotImplementedException();
-
-                //	rv.Brush->Type = NativeBrushType.Image;
-                //	var helper = new TileBrushImplHelper(tileBrush, targetSize);
-                //	var bitmap = new BitmapImpl((int)helper.IntermediateSize.Width, (int)helper.IntermediateSize.Height);
-                //	rv.AddDisposable(bitmap);
-                //	using (var ctx = bitmap.CreateDrawingContext())
-                //		helper.DrawIntermediate(ctx);
-                //	rv.Brush->Bitmap = bitmap.Handle;
-                //	rv.Brush->BitmapTileMode = tileBrush.TileMode;
-                //	rv.Brush->BitmapTranslation = new SkiaPoint(-helper.DestinationRect.X, -helper.DestinationRect.Y);
-
-                //	SkMatrix matrix;
-                //	matrix.setTranslate(brush->BitmapTranslation);
-                //	SkShader::TileMode tileX = brush->BitmapTileMode == ptmNone ? SkShader::kClamp_TileMode
-                //		: (brush->BitmapTileMode == ptmFlipX || brush->BitmapTileMode == ptmFlipXY) ? SkShader::kMirror_TileMode : SkShader::kRepeat_TileMode;
-                //	SkShader::TileMode tileY = brush->BitmapTileMode == ptmNone ? SkShader::kClamp_TileMode
-                //		: (brush->BitmapTileMode == ptmFlipY || brush->BitmapTileMode == ptmFlipXY) ? SkShader::kMirror_TileMode : SkShader::kRepeat_TileMode;
-
-                //	paint.setShader(SkShader::CreateBitmapShader(brush->Bitmap->Bitmap, tileX, tileY, &matrix))->unref();
+                paint.Shader.Dispose();
             }

             return rv;


Introduced new "GetHtml" methods to the "GridControl" methods

Calling either of the two methods will render and return a partial view where the model will be an instance of "GridControlWrapper" with the generic types for the grid control (value and config).

--- src/Skybrud.Umbraco.GridData/GridControl.cs
+++ src/Skybrud.Umbraco.GridData/GridControl.cs
@@ -1,9 +1,13 @@
 using System;
+using System.Web;
+using System.Web.Mvc;
+using System.Web.Mvc.Html;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Skybrud.Umbraco.GridData.Extensions.Json;
 using Skybrud.Umbraco.GridData.Interfaces;
 using Skybrud.Umbraco.GridData.Json;
+using Skybrud.Umbraco.GridData.Rendering;
 using Umbraco.Core.Configuration;
 using Umbraco.Core.Logging;

@@ -73,6 +77,49 @@
         #region Member methods

         /// <summary>
+        /// Generates the HTML for the Grid control.
+        /// </summary>
+        /// <param name="helper">The <see cref="HtmlHelper"/> used for rendering the Grid control.</param>
+        /// <returns>Returns the Grid control as an instance of <see cref="HtmlString"/>.</returns>
+        public HtmlString GetHtml(HtmlHelper helper) {
+            return GetHtml(helper, Editor.Alias);
+        }
+
+        /// <summary>
+        /// Generates the HTML for the Grid control.
+        /// </summary>
+        /// <param name="helper">The <see cref="HtmlHelper"/> used for rendering the Grid control.</param>
+        /// <param name="partial">The alias or virtual path to the partial view for rendering the Grid control.</param>
+        /// <returns>Returns the Grid control as an instance of <see cref="HtmlString"/>.</returns>
+        public HtmlString GetHtml(HtmlHelper helper, string partial) {
+
+            // Some input validation
+            if (helper == null) throw new ArgumentNullException("helper");
+            if (String.IsNullOrWhiteSpace(partial)) throw new ArgumentNullException("partial");
+
+            // If the control isn't valid, we shouldn't render it
+            if (!IsValid) return new HtmlString("");
+
+            // Get a wrapper for the control
+            GridControlWrapper wrapper = GridContext.Current.GetControlWrapper(this);
+
+            // If the wrapper is NULL, we shouldn't render the control
+            if (wrapper == null) return new HtmlString("");
+
+            // Prepend the path to the "Controls" folder if not already specified
+            if (!partial.StartsWith("~/") && !partial.StartsWith("~/")) {
+                partial = "~/Views/Partials/TypedGrid/Controls/" + partial;
+            }
+
+            // Append the ".cshtml" extension if not already specified
+            if (!partial.EndsWith(".cshtml")) partial += ".cshtml";
+
+            // Render the partial view
+            return helper.Partial(partial, wrapper);
+
+        }
+
+        /// <summary>
         /// Gets the value of the control as a searchable text - eg. to be used in Examine.
         /// </summary>
         /// <returns>Returns an instance of <see cref="System.String"/> with the value as a searchable text.</returns>


Have shortcuts use static app.ico instead of that of the ephemeral exe

using the app.ico in the root folder fixes the problem of losing the shortcut icon when we upgrade, lose the original, and eventually the windows explorer cache loses it. There was another attempt at fixing this by finding all the shortcuts and updating them, but that didn't work in our testing and this seems simpler and more robust. There may be some other reason for the old approach of pointing at the icon of the app itself (e.g. could be a different icon)?

--- src/Squirrel/UpdateManager.ApplyReleases.cs
+++ src/Squirrel/UpdateManager.ApplyReleases.cs
@@ -154,7 +154,14 @@
                     thisRelease.Filename));

                 var exePath = Path.Combine(Utility.AppDirForRelease(rootAppDirectory, thisRelease), exeName);
-                var fileVerInfo = FileVersionInfo.GetVersionInfo(exePath);
+
+				//Review: using the app.ico in the root folder fixes the problem of losing the shortcut icon when we
+				//upgrade, lose the original, and eventually the windows explorer cache loses it.
+				//There was another attempt at fixing this by finding all the shortcuts and updating them, but that didn't work in our testing and this seems simpler and more robust.
+				//There may be some other reason for the old approach of pointing at the icon of the app itself (e.g. could be a different icon)?
+				var iconPath = Path.Combine(Utility.AppDirForRelease(rootAppDirectory, thisRelease), "app.ico");
+
+				var fileVerInfo = FileVersionInfo.GetVersionInfo(exePath);

                 foreach (var f in (ShortcutLocation[]) Enum.GetValues(typeof(ShortcutLocation))) {
                     if (!locations.HasFlag(f)) continue;
@@ -179,7 +186,7 @@

                         sl = new ShellLink {
                             Target = updateExe,
-                            IconPath = exePath,
+                            IconPath = iconPath,
                             IconIndex = 0,
                             WorkingDirectory = Path.GetDirectoryName(exePath),
                             Description = zf.Description,


Don't start KeyframeMotion timers until all the regions are ready. This prevents problems in megaregions (prims that think they've crossed over to other regions).

--- OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -47,7 +47,7 @@
 {
     public class KeyframeTimer
     {
-        private static Dictionary<Scene, KeyframeTimer>m_timers =
+        private static Dictionary<Scene, KeyframeTimer> m_timers =
                 new Dictionary<Scene, KeyframeTimer>();

         private Timer m_timer;
@@ -67,8 +67,15 @@
             m_timer.Interval = TickDuration;
             m_timer.AutoReset = true;
             m_timer.Elapsed += OnTimer;
-
-            m_timer.Start();
+        }
+
+        public void Start()
+        {
+            lock (m_timer)
+            {
+                if (!m_timer.Enabled)
+                    m_timer.Start();
+            }
         }

         private void OnTimer(object sender, ElapsedEventArgs ea)
@@ -120,6 +127,25 @@
                 {
                     timer = new KeyframeTimer(motion.Scene);
                     m_timers[motion.Scene] = timer;
+
+                    if (!SceneManager.Instance.AllRegionsReady)
+                    {
+                        // Start the timers only once all the regions are ready. This is required
+                        // when using megaregions, because the megaregion is correctly configured
+                        // only after all the regions have been loaded. (If we don't do this then
+                        // when the prim moves it might think that it crossed into a region.)
+                        SceneManager.Instance.OnRegionsReadyStatusChange += delegate(SceneManager sm)
+                        {
+                            if (sm.AllRegionsReady)
+                                timer.Start();
+                        };
+                    }
+
+                    // Check again, in case the regions were started while we were adding the event handler
+                    if (SceneManager.Instance.AllRegionsReady)
+                    {
+                        timer.Start();
+                    }
                 }
             }


Add a frame based watchdog function to keyframed motion

--- OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -64,6 +64,10 @@

         [NonSerialized()]
         protected Timer m_timer = new Timer();
+        [NonSerialized()]
+        protected bool m_frameHooked;
+        [NonSerialized()]
+        protected int frameCount = 0;

         [NonSerialized()]
         private SceneObjectGroup m_group;
@@ -162,6 +166,22 @@
             if (m_keyframes.Length > 0)
                 m_timer.Start();
             m_running = true;
+            if (!m_frameHooked)
+            {
+                m_group.Scene.EventManager.OnFrame += OnFrame;
+                m_frameHooked = true;
+            }
+        }
+
+        private void OnFrame()
+        {
+            frameCount++;
+            if (frameCount >= 30)
+            {
+                frameCount = 0;
+                if (m_running)
+                    Start();
+            }
         }

         public void Stop()


Send all of the Urls properly to the client on teleports/crossings to neighbors. Fix enabling of child agents. This doesn't fix creating agents in remote regions when teleporting.

--- OpenSim/Services/CapsService/EventQueueService.cs
+++ OpenSim/Services/CapsService/EventQueueService.cs
@@ -516,9 +516,9 @@
         /// <param name="a"></param>
         /// <param name="regionHandle"></param>
         /// <param name="endPoint"></param>
-        private void InformClientOfNeighbour(AgentCircuitData a, GridRegion reg)
-        {
-            m_log.Info("[EventQueueService]: Starting to inform client about neighbour " + reg.RegionName);
+        private void InformClientOfNeighbour(AgentCircuitData circuitData, GridRegion neighbor)
+        {
+            m_log.Info("[EventQueueService]: Starting to inform client about neighbor " + neighbor.RegionName);

             //Notes on this method
             // 1) the SimulationService.CreateAgent MUST have a fixed CapsUrl for the region, so we have to create (if needed)
@@ -535,7 +535,7 @@
                 string newSeedCap = CapsUtil.GetCapsSeedPath(CapsUtil.GetRandomCapsObjectPath());
                 //Leave this blank so that we can check below so that we use the same Url if the client has already been to that region
                 string SimSeedCap = "";
-                IRegionClientCapsService otherRegionService = m_service.ClientCaps.GetOrCreateCapsService(reg.RegionHandle, newSeedCap, SimSeedCap);
+                IRegionClientCapsService otherRegionService = m_service.ClientCaps.GetOrCreateCapsService(neighbor.RegionHandle, newSeedCap, SimSeedCap);
                 bool newAgent = false;

                 //ONLY UPDATE THE SIM SEED HERE
@@ -547,18 +547,34 @@
                 {
                     CapsBase = CapsUtil.GetRandomCapsObjectPath();
                     //If the Url is "", then we havn't been here before, and we need to add a new Url for the client.
-                    SimSeedCap = CapsUtil.GetCapsSeedPath(CapsBase);
+                    SimSeedCap
+                        = "http://"
+                      + neighbor.ExternalHostName
+                      + ":"
+                      + neighbor.HttpPort
+                      + CapsUtil.GetCapsSeedPath(CapsBase);
                     otherRegionService.AddSEEDCap("", SimSeedCap);
                     //We had to make a new Url, its a new agent to this other region
                     newAgent = true;
                 }
                 else
-                    CapsBase = CapsUtil.GetCapsPathFromCapsSeed(otherRegionService.CapsPath);
+                {
+                    //The otherRegionService.UrlToInform is a full URL, not a CapsSeed, so we need to remove the http:// parts
+                    string CapsSeed = otherRegionService.UrlToInform;
+                    CapsSeed = CapsSeed.Split(new string[1]{"/CAPS/"}, StringSplitOptions.RemoveEmptyEntries)[1];
+                    //Readd the /CAPS/ so it is a CapsSeed again
+                    CapsSeed = "/CAPS/" + CapsSeed;
+                    //Now we can find the CapsBase
+                    CapsBase = CapsUtil.GetCapsPathFromCapsSeed(CapsSeed);
+                    //Remove the 0000 at the end
+                    CapsBase = CapsBase.Remove(CapsBase.Length - 4, 4);
+                    SimSeedCap = otherRegionService.UrlToInform;
+                }

                 //Fix the AgentCircuitData with the new CapsUrl
-                a.CapsPath = SimSeedCap;
-
-                bool regionAccepted = SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
+                circuitData.CapsPath = CapsBase;
+
+                bool regionAccepted = SimulationService.CreateAgent(neighbor, circuitData, (uint)TeleportFlags.Default, out reason);
                 if (regionAccepted && newAgent)
                 {
                     //m_log.DebugFormat("[EventQueueService]: {0} is sending {1} EnableSimulator for neighbor region {2} @ {3} " +
@@ -569,14 +585,14 @@
                     IEventQueueService EQService = m_service.Registry.RequestModuleInterface<IEventQueueService>();

                     //Only do this resolving once! It's heavy!
-                    IPEndPoint endPoint = reg.ExternalEndPoint;
-                    EQService.EnableSimulator(reg.RegionHandle, endPoint, m_service.AgentID, m_service.RegionHandle);
-                    EQService.EstablishAgentCommunication(m_service.AgentID, reg.RegionHandle, endPoint, SimSeedCap, m_service.RegionHandle);
-
-                    m_log.Info("[EntityTransferModule]: Completed inform client about neighbour " + reg.RegionName);
+                    IPEndPoint endPoint = neighbor.ExternalEndPoint;
+                    EQService.EnableSimulator(neighbor.RegionHandle, endPoint, m_service.AgentID, m_service.RegionHandle);
+                    EQService.EstablishAgentCommunication(m_service.AgentID, neighbor.RegionHandle, endPoint, otherRegionService.UrlToInform, m_service.RegionHandle);
+
+                    m_log.Info("[EventQueueService]: Completed inform client about neighbor " + neighbor.RegionName);
                 }
                 else if (!regionAccepted || reason != "")
-                    m_log.Info("[EntityTransferModule]: Failed to inform client about neighbour " + reg.RegionName + ", reason: " + reason);
+                    m_log.Info("[EventQueueService]: Failed to inform client about neighbor " + neighbor.RegionName + ", reason: " + reason);
             }
         }


Cleaned up handler configuration API.

Cleaned up handler configuration API.

--- Piccolo/Configuration/HttpHandlerConfiguration.cs
+++ Piccolo/Configuration/HttpHandlerConfiguration.cs
@@ -9,7 +9,7 @@
 	{
 		public IRequestHandlerFactory RequestHandlerFactory { get; set; }
 		public IList<Type> RequestHandlers { get; internal set; }
-		public Dictionary<Type, IParameterBinder> RouteParameterBinders { get; internal set; }
+		public IDictionary<Type, IParameterBinder> RouteParameterBinders { get; internal set; }
 		public IRequestRouter Router { get; internal set; }
 		public Func<object, string> JsonSerialiser { get; set; }
 		public Func<Type, string, object> JsonDeserialiser { get; set; }


Tightened-up configuration API.

Tightened-up configuration API.

--- Piccolo/Configuration/HttpHandlerConfiguration.cs
+++ Piccolo/Configuration/HttpHandlerConfiguration.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using Piccolo.Request.ParameterBinders;
 using Piccolo.Routing;

@@ -9,9 +8,9 @@
 	public class HttpHandlerConfiguration
 	{
 		public IRequestHandlerFactory RequestHandlerFactory { get; set; }
-		public ReadOnlyCollection<Type> RequestHandlers { get; set; }
-		public Dictionary<Type, IParameterBinder> RouteParameterBinders { get; set; }
-		public IRequestRouter Router { get; set; }
+		public IList<Type> RequestHandlers { get; internal set; }
+		public Dictionary<Type, IParameterBinder> RouteParameterBinders { get; internal set; }
+		public IRequestRouter Router { get; internal set; }
 		public Func<object, string> JsonSerialiser { get; set; }
 		public Func<Type, string, object> JsonDeserialiser { get; set; }
 	}


Remove unnecessary codepath

Remove unnecessary codepath

--- Python/Product/Debugger/Debugger/PythonProcess.cs
+++ Python/Product/Debugger/Debugger/PythonProcess.cs
@@ -490,9 +490,6 @@

         internal SourceSpan GetStatementSpan(string filename, int line, int column = 0) {
             var ast = GetAst(filename);
-            if (ast == null) {
-                return new SourceSpan(new SourceLocation(line, 1), new SourceLocation(line, 1));
-            }
             int len = 0;
             if (ast != null) {
                 int start = ast.LocationToIndex(new SourceLocation(line, 1));
@@ -500,7 +497,7 @@
                 len = end - start;
             }

-            return new SourceSpan(new SourceLocation(line, 1), new SourceLocation(line, Math.Max(0, len)));
+            return new SourceSpan(new SourceLocation(line, 1), new SourceLocation(line, Math.Max(0, len) + 1));
         }

         internal IList<Tuple<int, int, IList<string>>> GetHandledExceptionRanges(string filename) {


377 dict members on Py3 include iter*() methods 	Need to aggressively dump all of our cached types and reload them when we get the update event from the interpreter

--- Release/Product/Python/Analysis/PythonAnalyzer.cs
+++ Release/Product/Python/Analysis/PythonAnalyzer.cs
@@ -34,15 +34,15 @@
         private readonly Dictionary<string, ModuleReference> _modules;
         private readonly Dictionary<string, ModuleInfo> _modulesByFilename;
         private readonly Dictionary<object, object> _itemCache;
-        private readonly BuiltinModule _builtinModule;
+        private BuiltinModule _builtinModule;
         private readonly Dictionary<string, XamlProjectEntry> _xamlByFilename = new Dictionary<string, XamlProjectEntry>();
-        internal readonly Namespace _propertyObj, _classmethodObj, _staticmethodObj, _typeObj, _rangeFunc, _frozensetType;
-        internal readonly ISet<Namespace> _objectSet;
-        internal readonly Namespace _functionType;
-        internal readonly BuiltinClassInfo _dictType, _listType, _tupleType, _generatorType, _intType, _stringType, _boolType, _setType, _objectType, _dictKeysType, _dictValuesType, _longType, _floatType;
-        internal readonly ConstantInfo _noneInst;
+        internal Namespace _propertyObj, _classmethodObj, _staticmethodObj, _typeObj, _rangeFunc, _frozensetType;
+        internal ISet<Namespace> _objectSet;
+        internal Namespace _functionType;
+        internal BuiltinClassInfo _dictType, _listType, _tupleType, _generatorType, _intType, _stringType, _boolType, _setType, _objectType, _dictKeysType, _dictValuesType, _longType, _floatType;
+        internal ConstantInfo _noneInst;
         private readonly Deque<AnalysisUnit> _queue;
-        private readonly KnownTypes _types;
+        private KnownTypes _types;
         internal readonly IModuleContext _defaultContext;
         private readonly PythonLanguageVersion _langVersion;
         private readonly HashSet<string> _analysisDirs = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
@@ -64,6 +64,16 @@
             InitializeBuiltinModules();
             pythonInterpreter.ModuleNamesChanged += new EventHandler(ModuleNamesChanged);

+            _queue = new Deque<AnalysisUnit>();
+
+            LoadKnownTypes();
+
+            pythonInterpreter.Initialize(this);
+
+            _defaultContext = pythonInterpreter.CreateModuleContext();
+        }
+
+        private void LoadKnownTypes() {
             _types = new KnownTypes(this);
             _builtinModule = (BuiltinModule)Modules["__builtin__"].Module;
             _propertyObj = GetBuiltin("property");
@@ -76,7 +86,6 @@
             _objectType = (BuiltinClassInfo)GetBuiltin("object");
             _objectSet = _objectType.SelfSet;

-
             _setType = (BuiltinClassInfo)GetNamespaceFromObjects(_interpreter.GetBuiltinType(BuiltinTypeId.Set));
             _rangeFunc = GetBuiltin("range");
             _frozensetType = GetBuiltin("frozenset");
@@ -94,22 +103,18 @@
             _dictKeysType = (BuiltinClassInfo)GetNamespaceFromObjects(_interpreter.GetBuiltinType(BuiltinTypeId.DictKeys));
             _dictValuesType = (BuiltinClassInfo)GetNamespaceFromObjects(_interpreter.GetBuiltinType(BuiltinTypeId.DictValues));

-            _queue = new Deque<AnalysisUnit>();
-
             SpecializeFunction("__builtin__", "range", (n, unit, args) => unit.DeclaringModule.GetOrMakeNodeVariable(n, (nn) => new RangeInfo(_types.List, unit.ProjectState).SelfSet));
             SpecializeFunction("__builtin__", "min", ReturnUnionOfInputs);
             SpecializeFunction("__builtin__", "max", ReturnUnionOfInputs);

-            pythonInterpreter.Initialize(this);
-
-            _defaultContext = pythonInterpreter.CreateModuleContext();
-
             // cached for quick checks to see if we're a call to clr.AddReference

             SpecializeFunction("wpf", "LoadComponent", LoadComponent);
         }

         void ModuleNamesChanged(object sender, EventArgs e) {
+            LoadKnownTypes();
+
             InitializeBuiltinModules();
         }


Quick fix for "installZipFileEntry"

Quick fix for "installZipFileEntry"

--- RelhaxModpack/RelhaxModpack/Utils/Translations.cs
+++ RelhaxModpack/RelhaxModpack/Utils/Translations.cs
@@ -2884,7 +2884,7 @@
             Polish.Add("installZipFileEntry", TranslationNeeded);
             French.Add("installZipFileEntry", TranslationNeeded);
             Spanish.Add("installZipFileEntry", "Entrada de archivo");
-            Russian.Add("installZipFileEntry", "Название файла");
+            Russian.Add("installZipFileEntry", "Файл");

             //Component: installExtractingCompletedThreads
             //
@@ -4450,4 +4450,4 @@
         }
         #endregion
     }
-}+}


scriptdtogenerator creates reference to row lookup data

--- Serenity.Web/CodeGeneration/ScriptDtoGenerator.cs
+++ Serenity.Web/CodeGeneration/ScriptDtoGenerator.cs
@@ -19,6 +19,7 @@
         private CodeWriter cw;
         private HashSet<Type> visited;
         private Queue<Type> generateQueue;
+        private List<Type> lookupScripts;

         public ScriptDtoGenerator(params Assembly[] assemblies)
         {
@@ -72,6 +73,7 @@
             this.cw = new CodeWriter(sb, 4);
             this.generateQueue = new Queue<Type>();
             this.visited = new HashSet<Type>();
+            this.lookupScripts = new List<Type>();

             foreach (var assembly in this.Assemblies)
             foreach (var fromType in assembly.GetTypes())
@@ -84,6 +86,11 @@
                     fromType.IsSubclassOf(typeof(Row)) ||
                     fromType.GetCustomAttribute<ScriptIncludeAttribute>() != null)
                     EnqueueType(fromType);
+                else
+                {
+                    if (fromType.GetCustomAttribute<LookupScriptAttribute>() != null)
+                        lookupScripts.Add(fromType);
+                }
             }

             Dictionary<Type, string> generatedCode = new Dictionary<Type, string>();
@@ -432,14 +439,32 @@
             }

             var attr = rowType.GetCustomAttribute<LookupScriptAttribute>();
+            if (attr == null)
+            {
+                var script = lookupScripts.FirstOrDefault(x =>
+                    x.BaseType != null &&
+                    x.BaseType.IsGenericType &&
+                    x.BaseType.GetGenericArguments().Any(z => z == rowType));
+
+                if (script != null)
+                    attr = script.GetCustomAttribute<LookupScriptAttribute>();
+            }
+
             if (attr != null)
             {
                 cw.Indented("[InlineConstant] public const string LookupKey = \"");
                 sb.Append(attr.Key);
                 sb.AppendLine("\";");
+
+                sb.AppendLine();
+                cw.Indented("public static Lookup<");
+                sb.Append(MakeFriendlyName(rowType));
+                sb.Append("> Lookup { [InlineCode(\"Q.getLookup('");
+                sb.Append(attr.Key);
+                sb.AppendLine("')\")] get { return null; } }");
+
                 anyMetadata = true;
             }
-

             if (anyMetadata)
                 sb.AppendLine();


fix tupple generation

fix tupple generation

--- SignalGo.Server/Helpers/ServiceReferenceHelper.cs
+++ SignalGo.Server/Helpers/ServiceReferenceHelper.cs
@@ -325,7 +325,8 @@
                 NameSpace = type.GetNamesapce()
             };
             Type baseEumType = Enum.GetUnderlyingType(type);
-            enumReferenceInfo.TypeName = GetFullNameOfType(baseEumType, true, null, null, out _);
+            int startIndexAt = 0;
+            enumReferenceInfo.TypeName = GetFullNameOfType(baseEumType, true, null, null, ref startIndexAt, out _);
             foreach (object name in Enum.GetValues(type))
             {
                 object res = Convert.ChangeType(name, baseEumType);
@@ -373,14 +374,15 @@

             Type baseType = type.GetBaseType();
             string genericParameterConstraints = null;
+            int startIndexAt = 0;
             if (baseType != typeof(object) && baseType != null)
             {
-                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, out _);
+                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, ref startIndexAt, out _);
             }
             else
-                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, out _);
-
-            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, out genericParameterConstraints);
+                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, ref startIndexAt, out _);
+
+            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, ref startIndexAt, out genericParameterConstraints);
             classReferenceInfo.GenericParameterConstraints = genericParameterConstraints;

             ModelsCodeGenerated.Add(type);
@@ -427,14 +429,15 @@
             };

             Type baseType = type.GetBaseType();
+            int startIndexAt = 0;
             if (baseType != typeof(object) && baseType != null)
             {
-                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, out _);
+                classReferenceInfo.BaseClassName = GetFullNameOfType(baseType, true, null, null, ref startIndexAt, out _);
             }
             else
-                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, out _);
-
-            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, out _);
+                classReferenceInfo.BaseClassName = GetFullNameOfType(typeof(NotifyPropertyChangedBase), true, null, null, ref startIndexAt, out _);
+
+            classReferenceInfo.Name = GetFullNameOfType(type, false, null, null, ref startIndexAt, out _);

             ModelsCodeGenerated.Add(type);

@@ -462,7 +465,10 @@
             AddToGenerate(methodInfo.ReturnType);
             string returnType = "void";
             if (methodInfo.ReturnType != typeof(void))
-                returnType = GetFullNameOfType(methodInfo.ReturnType, true, methodInfo, null, out _);
+            {
+                int startIndexAt = 0;
+                returnType = GetFullNameOfType(methodInfo.ReturnType, true, methodInfo, null, ref startIndexAt, out _);
+            }
             string methodName = methodInfo.Name;

             if (IsRenameDuplicateMethodNames)
@@ -491,10 +497,11 @@
             if (!propertyInfo.CanWrite || !propertyInfo.CanRead)
                 return;
             AddToGenerate(propertyInfo.PropertyType);
+            int startIndexAt = 0;
             PropertyReferenceInfo propertyReferenceInfo = new PropertyReferenceInfo
             {
                 Name = propertyInfo.Name,
-                ReturnTypeName = GetFullNameOfType(propertyInfo.PropertyType, true, null, propertyInfo, out _)
+                ReturnTypeName = GetFullNameOfType(propertyInfo.PropertyType, true, null, propertyInfo, ref startIndexAt, out _)
             };

             classReferenceInfo.Properties.Add(propertyReferenceInfo);
@@ -507,7 +514,8 @@
                 ParameterReferenceInfo parameterReferenceInfo = new ParameterReferenceInfo();
                 AddToGenerate(item.ParameterType);
                 parameterReferenceInfo.Name = item.Name;
-                parameterReferenceInfo.TypeName = GetFullNameOfType(item.ParameterType, true, methodInfo, null, out _);
+                int startIndexAt = 0;
+                parameterReferenceInfo.TypeName = GetFullNameOfType(item.ParameterType, true, methodInfo, null, ref startIndexAt, out _);
                 methodReferenceInfo.Parameters.Add(parameterReferenceInfo);
             }
         }
@@ -518,18 +526,18 @@
                 NamespaceReferenceInfo.Usings.Add(type.GetNamesapce());
         }

-        private string GetFullNameOfType(Type type, bool withNameSpace, MethodInfo method, PropertyInfo property, out string genericParameterConstraints)
+        private string GetFullNameOfType(Type type, bool withNameSpace, MethodInfo method, PropertyInfo property, ref int startIndexAt, out string genericParameterConstraints)
         {
             genericParameterConstraints = null;
             if (method != null)
             {
-                var result = GetTupleParameterNames(type, method);
+                var result = GetTupleParameterNames(type, method, ref startIndexAt);
                 if (result != "()" && result != ")")
                     return result;
             }
             if (property != null)
             {
-                var result = GetTupleParameterNames(type, property);
+                var result = GetTupleParameterNames(type, property, ref startIndexAt);
                 if (result != "()" && result != ")")
                     return result;
             }
@@ -567,11 +575,11 @@
             }
             else if (type.GetBaseType() == typeof(Task))
             {
-                return GetFullNameOfType(type.GetGenericArguments()[0], withNameSpace, method, property, out _);
+                return GetFullNameOfType(type.GetGenericArguments()[0], withNameSpace, method, property, ref startIndexAt, out _);
             }
             if (type.GetBaseType() == typeof(Array))
             {
-                return GetFullNameOfType(type.GetElementType(), withNameSpace, method, property, out _) + "[]";
+                return GetFullNameOfType(type.GetElementType(), withNameSpace, method, property, ref startIndexAt, out _) + "[]";
             }
             if (CannotGenerateAssemblyTypes(type))
                 AddUsingIfNotExist(type);
@@ -594,7 +602,6 @@
                     }
                 }
 #endif
-
                 foreach (Type item in type.GetListOfGenericArguments())
                 {
                     AddToGenerate(item);
@@ -604,7 +611,7 @@
                     {
                         generics += ", ";
                     }
-                    generics += GetFullNameOfType(item, true, method, property, out _);
+                    generics += GetFullNameOfType(item, true, method, property, ref startIndexAt, out _);
                 }
                 string name = "";
                 if (type.Name.IndexOf("`") != -1)
@@ -635,7 +642,7 @@
             }
         }

-        string GetTupleParameterNames(Type type, MethodInfo method)
+        string GetTupleParameterNames(Type type, MethodInfo method, ref int startIndexAt)
         {
             StringBuilder result = new StringBuilder();
             result.Append("(");
@@ -654,13 +661,19 @@
                             {
                                 var ng = ((System.Runtime.CompilerServices.TupleElementNamesAttribute)at).TransformNames;
                                 int index = 0;
-                                foreach (var ca in ng)
+                                var items = ng.Skip(startIndexAt).Take(tupleGenerics.Length).ToArray();
+                                foreach (var ca in items)
                                 {
-                                    result.Append($"{GetFullNameOfType(tupleGenerics[index], true, method, null, out _)} ");
+                                    int myStartIndexAt = tupleGenerics.Length;
+                                    result.Append($"{GetFullNameOfType(tupleGenerics[index], true, method, null, ref myStartIndexAt, out _)} ");
                                     result.Append($"{ca}");
                                     result.Append(", ");
                                     index++;
+                                    startIndexAt++;
                                 }
+                                if (result.Length > 2)
+                                    result = result[result.Length -1] == ',' ? result.Remove(result.Length - 1, 1) : result.Remove(result.Length - 2, 2);
+                                result.Append(")");
                             }
                         }
                     }
@@ -668,12 +681,12 @@
             }
 #endif
             if (result.Length > 2)
-                result = result.Remove(result.Length - 2, 2);
+                result = result[result.Length - 1] == ')' ? result.Remove(result.Length - 1, 1) : result.Remove(result.Length - 2, 2);
             result.Append(")");
             return result.ToString();
         }

-        string GetTupleParameterNames(Type type, PropertyInfo property)
+        string GetTupleParameterNames(Type type, PropertyInfo property, ref int startIndexAt)
         {
             StringBuilder result = new StringBuilder();
             result.Append("(");
@@ -696,7 +709,7 @@
                                     {
                                         foreach (var val in (IEnumerable<System.Reflection.CustomAttributeTypedArgument>)ca.Value)
                                         {
-                                            result.Append($"{GetFullNameOfType(tupleGenerics[index], true, null, property, out _)} ");
+                                            result.Append($"{GetFullNameOfType(tupleGenerics[index], true, null, property, ref startIndexAt, out _)} ");
                                             result.Append($"{val.Value}");
                                             result.Append(", ");
                                             index++;


help

help

(TFS CS 7063)

--- Signum.Engine/DynamicQuery/StaticColumnFactory.cs
+++ Signum.Engine/DynamicQuery/StaticColumnFactory.cs
@@ -73,7 +73,7 @@
             }
         }

-        protected string DisplayName()
+        public string DisplayName()
         {
             if (OverrideDisplayName != null)
                 return OverrideDisplayName();


Correct comment.

Correct comment.

--- PrivateObjectExtensions/PrivateObjectExtensions.cs
+++ PrivateObjectExtensions/PrivateObjectExtensions.cs
@@ -27,7 +27,7 @@
         }

         /// <summary>
-        /// Get from private (and any other) field/property with casting the return value.
+        /// Get from private (and any other) field/property.
         /// If the real type of specified object doesn't contain the specified field/property,
         /// it will be automatically search from base type.
         /// </summary>
@@ -63,7 +63,7 @@
         }

         /// <summary>
-        /// Get from private (and any other) field/property with assuming the specified object as specified type with casting the return value.
+        /// Get from private (and any other) field/property with assuming the specified object as specified type.
         /// If the specified type doesn't contain the specified field/property,
         /// it will be automatically search from base type.
         /// </summary>


Fixed test bug, everything appears to be working up to the limit of available analysis.

--- SolverPrototype/SolverPrototypeTests/BatchTests.cs
+++ SolverPrototype/SolverPrototypeTests/BatchTests.cs
@@ -14,7 +14,7 @@
         public static void Test()
         {
             Bodies bodies = new Bodies();
-            const int bodyCount = 4;
+            const int bodyCount = 256;
             var handleIndices = new int[bodyCount];
             //Body 0 is a stationary kinematic acting as the ground.
             {
@@ -23,7 +23,7 @@
                 handleIndices[0] = handleIndex;
             }

-            //The remaining bodies form an extremely tall stack with initial velocities set as if this is the first frame of impact.
+            //The remaining bodies form an extremely tall stack.
             for (int i = 1; i < bodyCount; ++i)
             {
                 var description = new BodyDescription
@@ -38,7 +38,6 @@
                         },
                         InverseMass = 1
                     },
-                    //Velocity = new BodyVelocity { Linear = new Vector3(0, -1, 0) }
                 };
                 var handleIndex = bodies.Add(ref description);
                 handleIndices[i] = handleIndex;
@@ -74,8 +73,8 @@

                 ref var prestep = ref constraintReference.TypeBatch.PrestepData[constraintBundleIndex];
                 GatherScatter.Get(ref prestep.SpringSettings.NaturalFrequency, constraintInnerIndex) = (float)(Math.PI * 2 * 60);
-                GatherScatter.Get(ref prestep.SpringSettings.DampingRatio, constraintInnerIndex) = 1;
-                GatherScatter.Get(ref prestep.SpringSettings.MaximumRecoveryVelocity, constraintInnerIndex) = 1;
+                GatherScatter.Get(ref prestep.SpringSettings.DampingRatio, constraintInnerIndex) = 100f;
+                GatherScatter.Get(ref prestep.SpringSettings.MaximumRecoveryVelocity, constraintInnerIndex) = 1f;

                 //Normal goes from B to A by convention.
                 GatherScatter.Get(ref prestep.Normal.Y, constraintInnerIndex) = -1;
@@ -89,8 +88,8 @@
             //By construction, none of the constraints share any bodies, so we can solve it all.
             const float inverseDt = 60f;
             const float dt = 1 / inverseDt;
-            const int iterationCount = 8192;
-            const int frameCount = 8192;
+            const int iterationCount = 32;
+            const int frameCount = 4096;
             solver.IterationCount = iterationCount;

@@ -117,9 +116,9 @@
                             ref bodies.VelocityBundles[GatherScatter.Get(ref bodyReferences.BundleIndexB, innerIndex)].LinearVelocity.Y,
                             GatherScatter.Get(ref bodyReferences.InnerIndexB, innerIndex));
                     ref var penetrationDepth = ref GatherScatter.Get(ref constraint.TypeBatch.PrestepData[bundleIndex].PenetrationDepth, innerIndex);
-                    penetrationDepth += velocityA - velocityB;
+                    penetrationDepth += dt * (velocityA - velocityB);
                     if (i == 0)
-                        Console.WriteLine($"contact[0] penetration: {penetrationDepth}, velocity: {velocityB}");
+                        Console.WriteLine($"contact[{i}] penetration: {penetrationDepth}, velocity: {velocityB}");

                 }


Enforce item wield requirements (#880)

Enforce item wield requirements (#880)

* Enforce item wield requirements

* Remove unused variable

--- Source/ACE.Server/WorldObjects/Player_Inventory.cs
+++ Source/ACE.Server/WorldObjects/Player_Inventory.cs
@@ -672,8 +672,31 @@
             {
                 var itemGuid = new ObjectGuid(itemId);

-                if (TryRemoveFromInventory(itemGuid, out WorldObject item))
-                {
+                var item = GetInventoryItem(itemGuid);
+                if (item != null)
+                {
+                    var itemSkillReq = (Skill)(item.GetProperty(PropertyInt.WieldSkilltype) ?? 0);
+
+                    if (itemSkillReq != Skill.None)
+                    {
+                        var playerSkill = GetCreatureSkill(itemSkillReq).Current;
+
+                        if (playerSkill < (uint)(item.GetProperty(PropertyInt.WieldDifficulty) ?? 0))
+                        {
+                            var containerId = (uint)item.ContainerId;
+                            var container = GetInventoryItem(new ObjectGuid(containerId));
+                            if (container == null)
+                            {
+                                container = this;
+                            }
+                            Session.Network.EnqueueSend(new GameEventInventoryServerSaveFailed(Session, errorType: WeenieError.SkillTooLow));
+                            Session.Network.EnqueueSend(new GameEventItemServerSaysContainId(Session, item, container));
+                            return;
+                        }
+                    }
+
+                    TryRemoveFromInventory(itemGuid, out item);
+
                     if (!TryEquipObject(item, wieldLocation))
                     {
                         log.Error("Player_Inventory HandleActionGetAndWieldItem TryEquipObject failed");


Added dataaggregator to reloadsystemsettings command

--- Source/Applications/openXDA/openXDA/ServiceHost.cs
+++ Source/Applications/openXDA/openXDA/ServiceHost.cs
@@ -633,6 +633,18 @@
                     m_dataPusherEngine.Start();
                 else
                     m_dataPusherEngine.Stop();
+
+                bool flag2 = bool.Parse(dataContext.Table<Setting>().QueryRecordWhere("Name = 'EnablePQMarkAggregator'")?.Value ?? "false");
+
+                if (m_dataAggregationEngine.Running && flag2)
+                    m_dataAggregationEngine.ReloadSystemSettings();
+                else if (!flag2)
+                    m_dataAggregationEngine.Stop();
+                else if (!m_dataPusherEngine.Running && flag2)
+                    m_dataAggregationEngine.Start();
+                else
+                    m_dataAggregationEngine.Stop();
+
             }

             LogStatusMessage("Reload system settings complete...");


Added code to Shell out noInetFixUtil with --checkall Flag in CSU

--- Source/Tools/ConfigurationSetupUtility/App.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/App.xaml.cs
@@ -101,6 +101,20 @@
             {
                 m_errorLogger.Log(new InvalidOperationException(string.Format("Warning: failed to create or validate the event log source for the openHistorian Manager: {0}", ex.Message), ex), false);
             }
+            try
+            {
+                using (Process util = new Process())
+                {
+                    util.StartInfo.FileName = "NoInetFixUtil.exe";
+                    util.StartInfo.Arguments = " --checkall";
+                    util.StartInfo.UseShellExecute = true;
+                    util.Start();
+                }
+            }
+            catch (Exception ex)
+            {
+                m_errorLogger.Log(new InvalidOperationException(string.Format("Warning: failed to run NoInetUtil: {0}", ex.Message), ex), false);
+            }
         }

         #endregion


Fixed a bug int test for long file path netcore.

--- test/DMLibTest/Framework/LongPathFileStreamExtension.cs
+++ test/DMLibTest/Framework/LongPathFileStreamExtension.cs
@@ -159,7 +159,7 @@
         public static string[] GetDirectories(string path, SearchOption searchOption = SearchOption.TopDirectoryOnly)
         {
 #if DOTNET5_4
-            return Directory.GetFiles(path);
+            return Directory.GetDirectories(path);
 #else
             return EnumerateFileSystemEntries(path, "*", searchOption, LongPathDirectory.FilesOrDirectory.Directory).ToArray();
 #endif


fix for incorrect parsing of hexadecimal values

--- Source/YetAnotherMimeMagic/MimeMagic.Initialize.cs
+++ Source/YetAnotherMimeMagic/MimeMagic.Initialize.cs
@@ -119,7 +119,14 @@
                         break;

                     case "byte":
-                        match.SearchPattern = ((char)int.Parse(match.Value)).ToString();
+                        if (match.Value.StartsWith("0x"))
+                        {
+                            match.SearchPattern = ((char)int.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString();
+                        }
+                        else
+                        {
+                            match.SearchPattern = ((char)int.Parse(match.Value)).ToString();
+                        }
                         result = true;
                         break;


Fixed a build issue.

Fixed a build issue.

--- Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs
+++ Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs
@@ -23,7 +23,6 @@
 // OTHER DEALINGS IN THE SOFTWARE.
 #endregion

-using System.Numerics;
 #if !PORTABLE40
 using System;
 using System.Collections.Generic;


small changes to function 1.3

small changes to function 1.3

--- functions/funktions-1/funktio-3/Program.cs
+++ functions/funktions-1/funktio-3/Program.cs
@@ -31,8 +31,8 @@
                 }
                 else
                 {
-
-                    isNumber = false;
+                        Console.WriteLine("Syöttämäsi luku ei ole alueella");
+                        isNumber = false;
                 }
             }
             while (isNumber == false);


don't overwrite project ID when saving

don't overwrite project ID when saving

--- TfsStandalone.UI/Controllers/SettingsController.cs
+++ TfsStandalone.UI/Controllers/SettingsController.cs
@@ -11,6 +11,10 @@
     {
         public void SaveSettings(string projectCollectionUrl, string username, string workspacePath, string developerCmdPath, string branchComparisons, string changesetsToIgnore)
         {
+            var currentProjectCollection = ConfigManager.ProjectCollection(0);
+            var currentProject = currentProjectCollection == null || currentProjectCollection.Projects == null ? null : currentProjectCollection.Projects.FirstOrDefault();
+            var projectId = currentProject == null || string.IsNullOrEmpty(currentProject.Id) ? Guid.NewGuid().ToString() : currentProject.Id;
+
             var projectCollection = new TfsProjectCollection
             {
                 Name = "project-colllection",
@@ -20,7 +24,7 @@
                 {
                     new TfsProject
                     {
-                        Id = Guid.NewGuid().ToString(),
+                        Id = projectId,
                         DeveloperCmdPath = developerCmdPath,
                         Name = "project",
                         WorkspacePath = workspacePath,


Changed method access level.

Changed method access level.

--- TinyReflectiveToolkit/RuntimeContractExtensions.cs
+++ TinyReflectiveToolkit/RuntimeContractExtensions.cs
@@ -59,7 +59,7 @@
             return CreateContractProxyFromObject<TContract>(obj);
         }

-        internal static TContract CreateContractProxyFromObject<TContract>(object mimicObject)
+        private static TContract CreateContractProxyFromObject<TContract>(object mimicObject)
             where TContract : class
         {
             var baseType = typeof(TContract);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
@@ -501,6 +501,15 @@
       Assert.AreEqual(result, expected);
     }

+    [TestMethod]
+    public void TestMethod_NTLM_z()
+    {
+      const string source = "z";
+      string expected = "0366F5C43990657D4AF37BC470E0EF97";
+      string result = CryptoFunc.Ntlm(source);
+      Assert.AreEqual(result, expected);
+    }
+
     #endregion

   }


Add one unit test

Add one unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsExcel.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsExcel.cs
@@ -201,5 +201,19 @@
       List<string> result = FunctionsExcel.AllColumnsNameUntil(source);
       CollectionAssert.AreEquivalent(result, expected);
     }
+
+    [TestMethod]
+    [TestCategory("Excel")]
+    public void TestMethod_AllColumnsUntil_37()
+    {
+      const int source = 37;
+      List<string> expected = new List<string>
+      {
+        "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK"
+      };
+
+      List<string> result = FunctionsExcel.AllColumnsNameUntil(source);
+      CollectionAssert.AreEquivalent(result, expected);
+    }
   }
 }


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsExcel.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsExcel.cs
@@ -537,5 +537,19 @@
       List<string> result = FunctionsExcel.AllColumnsNameUntil(source);
       CollectionAssert.AreEquivalent(result, expected);
     }
+
+    [TestMethod]
+    [TestCategory("Excel")]
+    public void TestMethod_AllColumnsUntil_61()
+    {
+      const int source = 61;
+      List<string> expected = new List<string>
+      {
+        "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AT", "AU", "AV", "AW", "AX", "AY", "AZ", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH"
+      };
+
+      List<string> result = FunctionsExcel.AllColumnsNameUntil(source);
+      CollectionAssert.AreEquivalent(result, expected);
+    }
   }
 }


GMTab only set targetGraphic if none is set

--- Unity/Assets/Scripts/UserInterface/Tabbar/GMTab.cs
+++ Unity/Assets/Scripts/UserInterface/Tabbar/GMTab.cs
@@ -52,7 +52,7 @@
             group = _tabbar;
             myTabBar = _tabbar;
             this.onValueChanged.AddListener(ToggleTab);
-            targetGraphic = GetComponent<Image>();
+            if (targetGraphic == null) targetGraphic = GetComponent<Image>();

             //Toggle tab correctly
             ToggleTab(isOn);


Update copyright

Update copyright

--- VS_Solution/HrmHaystack/Properties/AssemblyInfo.cs
+++ VS_Solution/HrmHaystack/Properties/AssemblyInfo.cs
@@ -11,7 +11,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("HrmHaystack")]
-[assembly: AssemblyCopyright("Copyright © 2013 hermes-jr, Aaron DeMarre")]
+[assembly: AssemblyCopyright("Copyright © 2013 hermes-jr, enamelizer")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Delete useless unit test

Delete useless unit test

--- WalletWasabi.Tests/UnitTests/CoinsRegistryTests.cs
+++ WalletWasabi.Tests/UnitTests/CoinsRegistryTests.cs
@@ -1,45 +0,0 @@
-using NBitcoin;
-using System;
-using System.IO;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using WalletWasabi.KeyManagement;
-using WalletWasabi.Models;
-using WalletWasabi.Services;
-using WalletWasabi.Transactions;
-using Xunit;
-
-namespace WalletWasabi.Tests.UnitTests
-{
-	public class CoinsRegistryTests
-	{
-		[Fact]
-		public void OnlyUnspentCoinsAreListed()
-		{
-			var registry = new CoinsRegistry();
-			var spentCoin = Coin(0.2m);
-			registry.TryAdd(Coin(0.1m));
-			registry.TryAdd(spentCoin);
-			registry.TryAdd(Coin(0.4m));
-
-			registry.Spend(spentCoin);
-
-			Assert.Equal(2, registry.Count());
-		}
-
-		private static SmartCoin Coin(decimal amount, bool confirmed = true, int anonymitySet = 1)
-		{
-			var randomIndex = new Func<int>(() => new Random().Next(0, 200));
-			var height = confirmed ? new Height(randomIndex()) : Height.Mempool;
-			var slabel = new SmartLabel("");
-			var spentOutput = new[]
-			{
-				new TxoRef(RandomUtils.GetUInt256(), (uint)randomIndex())
-			};
-			var pubKey = new HdPubKey(new Key().PubKey, KeyPath.Parse("m/84h/0h/0h/0/1"), slabel, KeyState.Used);
-			return new SmartCoin(RandomUtils.GetUInt256(), (uint)randomIndex(), pubKey.P2wpkhScript, Money.Coins(amount), spentOutput, height, false, anonymitySet, false, slabel, pubKey: pubKey);
-		}
-
-	}
-}


Split test: 1 for exception type, 1 for count

--- tests/Moq.Tests/Regressions/IssueReportsFixture.cs
+++ tests/Moq.Tests/Regressions/IssueReportsFixture.cs
@@ -2761,27 +2761,45 @@
 		public class Issue883
 		{
 			[Fact]
-			public async Task Verify_can_process_recorded_invocation_that_threw_exception()
+			public async Task Verify_produces_correct_exception_type_if_one_async_invocation_threw()
+			{
+				// This test is here because below code has been known to throw
+				// a `TargetInvocationException` instead of a `MockException`.
+				var ex = await GetVerificationErrorAsync();
+				var mex = Assert.IsAssignableFrom<MockException>(ex);
+				Assert.True(mex.IsVerificationError);
+			}
+
+			[Fact]
+			public async Task Verify_produces_correct_count_in_exception_message_if_one_async_invocation_threw()
+			{
+				var ex = await GetVerificationErrorAsync();
+				Assert.Contains("exactly 3 times, but was 2 times", ex.Message);
+			}
+
+			private async Task<Exception> GetVerificationErrorAsync()
 			{
 				var mock = new Mock<IFoo>();

 				// Setup one invocation to throw an exception:
 				mock.SetupSequence(m => m.DoAsync())
 					.Returns(Task.FromException(new InvalidOperationException()))
+					.Returns(Task.CompletedTask)
 					.Returns(Task.CompletedTask);

-				// Perform fewer calls (1) than will be expected by verification (2),
+				// Perform fewer calls (2) than will be expected by verification (3),
 				// while ignoring the exception (we only want Moq to record the invocation):
-				try
-				{
-					await mock.Object.DoAsync();
-				}
-				catch (InvalidOperationException) { }
+				for (int i = 0; i < 2; ++i)
+				{
+					try
+					{
+						await mock.Object.DoAsync();
+					}
+					catch (InvalidOperationException) { }
+				}

 				// Cause verification failure. We expect a regular verification exception.
-				// (This test is here because this code has been known to throw TargetInvocationException instead.)
-				var ex = Assert.Throws<MockException>(() => mock.Verify(m => m.DoAsync(), Times.AtLeast(3)));
-				Assert.True(ex.IsVerificationError);
+				return Record.Exception(() => mock.Verify(m => m.DoAsync(), Times.Exactly(3)));
 			}

 			public interface IFoo


Implement twitch channel repository to viewmodel

--- twitch-tv-viewer/ViewModels/MainWindowViewModel.cs
+++ twitch-tv-viewer/ViewModels/MainWindowViewModel.cs
@@ -4,6 +4,7 @@
 using System.Windows.Input;
 using GalaSoft.MvvmLight.CommandWpf;
 using twitch_tv_viewer.Models;
+using twitch_tv_viewer.Services;
 using twitch_tv_viewer.Views;

 namespace twitch_tv_viewer.ViewModels
@@ -13,38 +14,11 @@
         private ObservableCollection<TwitchChannel> _items;
         private string _notification;
         private TwitchChannel _selectedChannel;
+        private readonly TwitchChannelRepository _twitch = new TwitchChannelRepository();

         public MainWindowViewModel()
         {
-            Items = new ObservableCollection<TwitchChannel>
-            {
-                new TwitchChannel
-                {
-                    Game = "Dota 2",
-                    Name = "Arteezy",
-                    Status = "Playing games",
-                    Viewers = "19248"
-                },
-
-                new TwitchChannel
-                {
-                    Game = "League of Legends",
-                    Name = "Destiny",
-                    Status = "Watch me dive 1v4 and rage",
-                    Viewers = "200"
-                },
-
-                new TwitchChannel
-                {
-                    Game = "Banjo-Kazooie",
-                    Name = "Stivitybobo",
-                    Status = "I dont like this game anymore",
-                    Viewers = "852"
-                }
-            };
-
             Notification = "Notification text";
-
             WindowLoaded = new RelayCommand(OnLoaded);
             AddCommand = new RelayCommand(Add);
             EditCommand = new RelayCommand(Edit);
@@ -95,6 +69,7 @@

         private async void OnLoaded()
         {
+            Items = new ObservableCollection<TwitchChannel>(await _twitch.GetChannels());
         }

         private static void Add()


fixed spawn texture since unity 5.3

fixed spawn texture since unity 5.3

[git-p4: depot-paths = "//rpgcraft/": change = 65]

--- unity/Assets/Scripts/Game/Managers/SpawnManager.cs
+++ unity/Assets/Scripts/Game/Managers/SpawnManager.cs
@@ -29,7 +29,7 @@
             Texture tex = Resources.Load(tileResourceDef.Filename) as Texture;
             if (tex)
             {
-                mr.material.SetTexture(0, tex);
+                mr.material.mainTexture = tex;
                 mr.material.color = ItemInstance.GetColor32ForItem(item);

                 float scale = (float) (Screen.height / 2.0) / Camera.main.orthographicSize;


Disable broken test (was broken in the original project and seems to be part of unfinished/experimental stuff)

--- tests/ConnectionTrackingTest.cs
+++ tests/ConnectionTrackingTest.cs
@@ -6,6 +6,7 @@

 namespace SQLite.Net.Tests
 {
+    [NUnit.Framework.Ignore("This test class/file was not included in the original project and is broken")]
     [TestFixture]
     public class ConnectionTrackingTest
     {


Fix name handling

Fix name handling

--- iMobileDevice.Generator/NameConversions.cs
+++ iMobileDevice.Generator/NameConversions.cs
@@ -27,6 +27,7 @@
             patchedName = patchedName.Replace("SYSLOG_RELAY", "syslogrelay");
             patchedName = patchedName.Replace("FILE_RELAY", "filerelay");
             patchedName = patchedName.Replace("IDEVICE_ACTIVATION", "ideviceactivation");
+            patchedName = patchedName.Replace("COMPANION_PROXY", "companionproxy");
             patchedName = patchedName.Replace("libideviceactivation", "ideviceactivation");
             patchedName = patchedName.Replace("libirecovery", "irecv");


Added CommandTimeout.

Added CommandTimeout.

--- yafsrc/YAF.Classes/YAF.Classes.Data/YafDBAccess.cs
+++ yafsrc/YAF.Classes/YAF.Classes.Data/YafDBAccess.cs
@@ -28,6 +28,7 @@
   using System.Data.SqlClient;

   using YAF.Classes.Pattern;
+  using YAF.Classes.Utils;

   #endregion

@@ -173,6 +174,7 @@
       cmd.CommandType = CommandType.StoredProcedure;
       cmd.CommandText = GetObjectName(storedProcedure);
       cmd.Connection = connection;
+      cmd.CommandTimeout = 99999;

       return cmd;
     }
@@ -339,7 +341,7 @@
     /// </returns>
     public static string GetObjectName(string name)
     {
-      return String.Format("[{0}].[{1}{2}]", Config.DatabaseOwner, Config.DatabaseObjectQualifier, name);
+      return "[{0}].[{1}{2}]".FormatWith(Config.DatabaseOwner, Config.DatabaseObjectQualifier, name);
     }

     /// <summary>
@@ -433,8 +435,7 @@
     /// </param>
     public void ExecuteNonQuery(SqlCommand cmd, bool transaction)
     {
-      var qc = new QueryCounter(cmd.CommandText);
-      try
+      using (QueryCounter qc = new QueryCounter(cmd.CommandText))
       {
         using (YafDBConnManager connMan = this.GetConnectionManager())
         {
@@ -458,10 +459,6 @@
           }
         }
       }
-      finally
-      {
-        qc.Dispose();
-      }
     }

     /// <summary>
@@ -493,8 +490,7 @@
     /// </returns>
     public object ExecuteScalar(SqlCommand cmd, bool transaction)
     {
-      var qc = new QueryCounter(cmd.CommandText);
-      try
+      using (QueryCounter qc = new QueryCounter(cmd.CommandText))
       {
         using (YafDBConnManager connMan = this.GetConnectionManager())
         {
@@ -519,10 +515,6 @@
           }
         }
       }
-      finally
-      {
-        qc.Dispose();
-      }
     }

     /// <summary>
@@ -555,15 +547,9 @@
     /// </returns>
     public DataTable GetData(SqlCommand cmd, bool transaction)
     {
-      var qc = new QueryCounter(cmd.CommandText);
-
-      try
+      using (QueryCounter qc = new QueryCounter(cmd.CommandText))
       {
         return this.ProcessUsingResultFilters(this.GetDatasetBasic(cmd, transaction).Tables[0], cmd.CommandText);
-      }
-      finally
-      {
-        qc.Dispose();
       }
     }

@@ -597,8 +583,7 @@
     /// </returns>
     public DataTable GetData(string commandText, bool transaction)
     {
-      var qc = new QueryCounter(commandText);
-      try
+      using (QueryCounter qc = new QueryCounter(commandText))
       {
         using (var cmd = new SqlCommand())
         {
@@ -607,10 +592,6 @@
           return this.ProcessUsingResultFilters(this.GetDatasetBasic(cmd, transaction).Tables[0], commandText);
         }
       }
-      finally
-      {
-        qc.Dispose();
-      }
     }

     /// <summary>
@@ -643,15 +624,9 @@
     /// </returns>
     public DataSet GetDataset(SqlCommand cmd, bool transaction)
     {
-      var qc = new QueryCounter(cmd.CommandText);
-
-      try
+      using (QueryCounter qc = new QueryCounter(cmd.CommandText))
       {
         return this.GetDatasetBasic(cmd, transaction);
-      }
-      finally
-      {
-        qc.Dispose();
       }
     }

@@ -670,7 +645,7 @@
     private DataTable ProcessUsingResultFilters(DataTable dataTable, string sqlCommand)
     {
       string commandCleaned =
-        sqlCommand.Replace(String.Format("[{0}].[{1}", Config.DatabaseOwner, Config.DatabaseObjectQualifier), String.Empty);
+        sqlCommand.Replace("[{0}].[{1}".FormatWith(Config.DatabaseOwner, Config.DatabaseObjectQualifier), String.Empty);

       if (commandCleaned.EndsWith("]"))
       {


adding a test for issue #238

adding a test for issue #238

--- test/CacheCow.Client.Tests/CachingHandlerTests.cs
+++ test/CacheCow.Client.Tests/CachingHandlerTests.cs
@@ -15,9 +15,10 @@

 namespace CacheCow.Client.Tests
 {
-
+
 	public class CachingHandlerTests
 	{
+        const string CacheablePublicResource = "https://code.jquery.com/jquery-3.3.1.slim.min.js";
 		private const string DummyUrl = "http://myserver/api/dummy";
 		private const string ETagValue = "\"abcdef\"";
 		private HttpClient _client;
@@ -86,7 +87,7 @@
 		[Fact]
 		public void Get_OK_But_Not_In_Cache_To_Insert_In_Cache()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var response = GetOkMessage();
 			_messageHandler.Response = response;
@@ -100,7 +101,7 @@
 			var header = responseReturned.Headers.Single(x=>x.Key == CacheCowHeader.Name);
 			CacheCowHeader cacheCowHeader = null;
 			CacheCowHeader.TryParse(header.Value.First() , out cacheCowHeader);
-
+
             // verify
 			Assert.NotNull(cacheCowHeader);
 			Assert.Equal(true, cacheCowHeader.DidNotExist);
@@ -111,12 +112,12 @@
 		[Fact]
 		public void Get_Stale_And_In_Cache_To_Get_From_Cache()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var response = GetOkMessage();
 			_messageHandler.Response = response;
 			_cacheStore.Setup(x => x.GetValueAsync(It.IsAny<CacheKey>())).ReturnsAsync(response);
-
+

 			// run
 			var task = _client.SendAsync(request);
@@ -137,7 +138,7 @@
 		[Fact]
 		public void Get_Stale_ApplyValidation_NotModified()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var responseFromCache = GetOkMessage();
 		    var then = DateTimeOffset.UtcNow.AddMilliseconds(-1);
@@ -146,13 +147,13 @@
             responseFromCache.Content.Headers.LastModified = DateTimeOffset.Now.AddDays(-2);
 			var responseFromServer = GetOkMessage();
             responseFromServer.StatusCode = HttpStatusCode.NotModified;
-
+
 			_messageHandler.Response = responseFromServer;
             _cacheStore.Setup(x => x.GetValueAsync(It.IsAny<CacheKey>())).ReturnsAsync(responseFromCache);
             _cacheStore.Setup(x => x.AddOrUpdateAsync(It.IsAny<CacheKey>(), It.Is<HttpResponseMessage>(r => r == responseFromCache)))
                 .Returns(Task.FromResult(false));

-
+

 			// run
 			var task = _client.SendAsync(request);
@@ -173,7 +174,7 @@
 		[Fact]
 		public void Get_Must_Revalidate_Etag_NotModified()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var responseFromCache = GetOkMessage(true);
 			responseFromCache.Headers.ETag = new EntityTagHeaderValue(ETagValue);
@@ -202,7 +203,7 @@
 		[Fact]
 		public void Get_Must_Revalidate_Expires_NotModified()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
 			lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -216,7 +217,7 @@
 			_cacheStore.Setup(x => x.AddOrUpdateAsync(It.IsAny<CacheKey>(), It.IsAny<HttpResponseMessage>()))
                 .Returns(Task.FromResult(false));

-
+

 			// run
 			var task = _client.SendAsync(request);
@@ -236,7 +237,7 @@
 		[Fact]
 		public void Get_Must_Revalidate_Expires_Modified()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
 			var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
 			lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -268,7 +269,7 @@
         [Fact]
         public void Get_NoMustRevalidate_Expires_Modified()
         {
-            // setup
+            // setup
             var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
             var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
             lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -299,7 +300,7 @@
         [Fact]
         public void Get_NoCache_Expires_ResultsInValidation()
         {
-            // setup
+            // setup
             var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
             request.Headers.CacheControl = new CacheControlHeaderValue(){NoCache = true};
             var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
@@ -331,7 +332,7 @@
         [Fact]
         public void Get_NoMustRevalidate_NoMustRevalidateByDefault_Expires_GetFromCache()
         {
-            // setup
+            // setup
             var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
             var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
             lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -362,9 +363,9 @@
 		[Fact]
 		public void Get_NotModified_With_Stale_Client_Cache_Shall_Update_Date_Header()
 		{
-			// setup
-			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
-
+			// setup
+			var request = new HttpRequestMessage(HttpMethod.Get, DummyUrl);
+
 			var responseFromCache = GetOkMessage(false);
 			responseFromCache.Headers.Date = DateTimeOffset.UtcNow.AddHours(-1);
 			responseFromCache.Headers.CacheControl.MaxAge = TimeSpan.FromSeconds(10);
@@ -393,7 +394,7 @@
 		[Fact]
 		public void Put_Validate_Etag()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Put, DummyUrl);
 			var responseFromCache = GetOkMessage(true);
 			responseFromCache.Headers.ETag = new EntityTagHeaderValue(ETagValue);
@@ -414,7 +415,7 @@
 		[Fact]
 		public void Put_Validate_Expires()
 		{
-			// setup
+			// setup
 			var request = new HttpRequestMessage(HttpMethod.Put, DummyUrl);
 			var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
 			lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -424,7 +425,7 @@
 			_messageHandler.Response = responseFromServer;
             _cacheStore.Setup(x => x.GetValueAsync(It.IsAny<CacheKey>())).ReturnsAsync(responseFromCache);

-
+

 			// run
 			var task = _client.SendAsync(request);
@@ -439,7 +440,7 @@
         [Fact]
         public void Delete_Validate_Etag()
         {
-            // setup
+            // setup
             var request = new HttpRequestMessage(HttpMethod.Delete, DummyUrl);
             var responseFromCache = GetOkMessage(true);
             responseFromCache.Headers.ETag = new EntityTagHeaderValue(ETagValue);
@@ -460,7 +461,7 @@
         [Fact]
         public void Delete_Validate_Expires()
         {
-            // setup
+            // setup
             var request = new HttpRequestMessage(HttpMethod.Delete, DummyUrl);
             var lastModified = DateTimeOffset.UtcNow.AddHours(-1);
             lastModified = lastModified.AddMilliseconds(1000 - lastModified.Millisecond);
@@ -516,8 +517,27 @@
 			return response;
 		}

-
-	}
+#if NET452 || NETCOREAPP2_0
+        [Fact]
+        public async Task Issue238_It_cache_even_if_compression_is_on()
+        {
+            var compressionHandler = new HttpClientHandler();
+            if (compressionHandler.SupportsAutomaticDecompression) compressionHandler.AutomaticDecompression = DecompressionMethods.GZip;
+
+            var pipeline = new CachingHandler()
+            {
+                InnerHandler = compressionHandler
+            };
+
+            var client  = new HttpClient(pipeline);
+            var response = await client.GetAsync(CacheablePublicResource);
+            var responseFromCache = await client.GetAsync(CacheablePublicResource);
+
+            Assert.NotNull(responseFromCache.Headers.GetCacheCowHeader());
+            Assert.True(responseFromCache.Headers.GetCacheCowHeader().RetrievedFromCache);
+        }
+#endif
+    }

     public class FaultyCacheStore : ICacheStore
     {


Remove AddFront from performance benchmarks

--- tests/Deque.Tests/Benchmarks.cs
+++ tests/Deque.Tests/Benchmarks.cs
@@ -33,16 +33,6 @@
             for (int i = 0; i < loops; i++)
             {
                 d.Add(i);
-            }
-        }
-
-        [Test]
-        public void TestPerformanceDequeAddFront()
-        {
-            d = new Deque<int>(loops);
-            for (int i = 0; i < loops; i++)
-            {
-                d.AddFront(i);
             }
         }


fixed normal mode cd bar showing hidden skills

--- TCC.Core/ViewModels/CooldownBarWindowViewModel.cs
+++ TCC.Core/ViewModels/CooldownBarWindowViewModel.cs
@@ -73,9 +73,23 @@

         private void NormalMode_Update(Cooldown sk)
         {
-
-            if (Settings.Settings.ClassWindowSettings.Enabled && ClassManager.StartSpecialSkill(sk)) return;
-            if (!Settings.Settings.CooldownWindowSettings.Enabled) return;
+            if (Settings.Settings.ClassWindowSettings.Enabled && ClassManager.StartSpecialSkill(sk))
+            {
+                //todo: dispose?
+                return;
+            }
+            if (!Settings.Settings.CooldownWindowSettings.Enabled)
+            {
+                sk.Dispose();
+                return;
+            }
+            var hSkill = HiddenSkills.ToSyncArray().FirstOrDefault(x => x.Skill.IconName == sk.Skill.IconName);
+            if (hSkill != null)
+            {
+                sk.Dispose();
+
+                return;
+            }
             if (sk.CooldownType == CooldownType.Item)
             {
                 FindAndUpdate(ItemSkills, sk);
@@ -231,6 +245,7 @@
         {
             if (Settings.Settings.ClassWindowSettings.Enabled && ClassManager.StartSpecialSkill(sk))
             {
+                //todo: dispose?
                 return;
             }

@@ -254,7 +269,6 @@
             {
                 if (skill.Duration == sk.Duration && !skill.IsAvailable && sk.Mode == skill.Mode)
                 {
-                    //Log.All($"Discarded update for {sk.Skill.Name} [{sk.Skill.Id}]");
                     return;
                 }
                 skill.Start(sk);
@@ -265,7 +279,6 @@
             {
                 if (skill.Duration == sk.Duration && !skill.IsAvailable && sk.Mode == skill.Mode)
                 {
-                    //Log.All($"Discarded update for {sk.Skill.Name} [{sk.Skill.Id}]");
                     return;
                 }
                 skill.Start(sk);


Two minor name changes for advanced options

--- Duplicati/Library/Main/Options.cs
+++ Duplicati/Library/Main/Options.cs
@@ -399,8 +399,8 @@
                     new CommandLineArgument("deleted-files", CommandLineArgument.ArgumentType.Path, Strings.Options.DeletedfilesShort, string.Format(Strings.Options.DeletedfilesLong, "changed-files")),

                     new CommandLineArgument("max-wastesize", CommandLineArgument.ArgumentType.Size, Strings.Options.MaxwastesizeShort, Strings.Options.MaxwastesizeLong),
-                    new CommandLineArgument("no-indexfiles", CommandLineArgument.ArgumentType.Boolean, Strings.Options.NoindexfilesShort, Strings.Options.NoindexfilesLong, "false"),
-                    new CommandLineArgument("no-backendverification", CommandLineArgument.ArgumentType.Boolean, Strings.Options.NobackendverificationShort, Strings.Options.NobackendverificationLong, "false"),
+                    new CommandLineArgument("no-index-files", CommandLineArgument.ArgumentType.Boolean, Strings.Options.NoindexfilesShort, Strings.Options.NoindexfilesLong, "false"),
+                    new CommandLineArgument("no-backend-verification", CommandLineArgument.ArgumentType.Boolean, Strings.Options.NobackendverificationShort, Strings.Options.NobackendverificationLong, "false"),
                     new CommandLineArgument("dry-run", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DryrunShort, Strings.Options.DryrunLong, "false", new string[] { "dryrun" }),

                     new CommandLineArgument("block-hash-algorithm", CommandLineArgument.ArgumentType.Enumeration, Strings.Options.BlockhashalgorithmShort, Strings.Options.BlockhashalgorithmLong, DEFAULT_BLOCK_HASH_ALGORITHM, null, GetSupportedHashes()),
@@ -1330,7 +1330,7 @@
         /// </summary>
         public bool NoIndexfiles
         {
-            get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-indexfiles"); }
+            get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-index-files"); }
         }

         /// <summary>
@@ -1338,7 +1338,7 @@
         /// </summary>
         public bool NoBackendverification
         {
-            get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-backendverification"); }
+            get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-backend-verification"); }
         }

         /// <summary>


Removed unused code

Removed unused code

--- TableDependency.SqlClient/Base/TableDependency.cs
+++ TableDependency.SqlClient/Base/TableDependency.cs
@@ -225,7 +225,6 @@

             if (_task != null)
             {
-                Trace.TraceInformation("Already called Start() method.");
                 return;
             }


Remove failing test that is now logged as a bug. (#215)

--- EPPlusTest/ExcelWorksheetTests.cs
+++ EPPlusTest/ExcelWorksheetTests.cs
@@ -6053,25 +6053,6 @@
 				Assert.AreEqual("#REF!", sheet2.Names["s1Name4"].NameFormula);
 			}
 		}
-
-		[TestMethod]
-		public void DeleteWorksheetWithReference()
-		{
-			// This test is failing to represent a worksheet delete bug. See VSTS bug #1584.
-			using (ExcelPackage package = new ExcelPackage())
-			{
-				var ws1 = package.Workbook.Worksheets.Add("sheet1");
-				var ws2 = package.Workbook.Worksheets.Add("sheet2");
-				const string cellValue = "sdfsdf";
-				ws2.Cells["B2"].Value = cellValue;
-				ws1.Cells["C3"].Formula = "sheet2!B2";
-				ws1.Cells["C3"].Calculate();
-				package.Save();
-				Assert.AreEqual(cellValue, ws1.Cells["C3"].Value);
-				package.Workbook.Worksheets.Delete(ws2);
-				Assert.AreEqual("#REF!B2", ws1.Cells["C3"].Formula);
-			}
-		}
 		#endregion

 		#region PivotTable Tests


Process stuff is pain

Process stuff is pain

--- src/Tgstation.Server.Host/System/Process.cs
+++ src/Tgstation.Server.Host/System/Process.cs
@@ -1,4 +1,5 @@
 using Microsoft.Extensions.Logging;
+using Microsoft.Win32.SafeHandles;
 using System;
 using System.Diagnostics;
 using System.Text;
@@ -31,6 +32,8 @@
 		readonly ILogger<Process> logger;

 		readonly global::System.Diagnostics.Process handle;
+
+		readonly SafeProcessHandle safeHandle;

 		readonly Task<string> standardOutputTask;
 		readonly Task<string> standardErrorTask;
@@ -62,6 +65,9 @@
 			// Do this fast because the runtime will bitch if we try to access it after it ends
 			Id = handle.Id;

+			// https://stackoverflow.com/a/47656845
+			safeHandle = handle.SafeHandle;
+
 			this.processFeatures = processFeatures ?? throw new ArgumentNullException(nameof(processFeatures));

 			this.standardOutputTask = standardOutputTask;
@@ -98,7 +104,11 @@
 		}

 		/// <inheritdoc />
-		public void Dispose() => handle.Dispose();
+		public void Dispose()
+		{
+			safeHandle.Dispose();
+			handle.Dispose();
+		}

 		async Task<int> WrapLifetimeTask(Task<int> lifetimeTask)
 		{


Minor fix

Minor fix

--- EPlikt/Feed/ChalmersFeedSource.cs
+++ EPlikt/Feed/ChalmersFeedSource.cs
@@ -176,7 +176,7 @@
                                 }
                             }

-                            if (!String.IsNullOrEmpty(fulltext["CreatedDate"]))
+                            if (fulltext["CreatedDate"] != null)
                             {
                                 pdate = (String)fulltext["CreatedDate"];
                             }


[Fixes #1628] Avoid stomping on an existing FileProvider

Respects the existing one if it's there.

--- src/UI/IdentityDefaultUIConfigureOptions.cs
+++ src/UI/IdentityDefaultUIConfigureOptions.cs
@@ -59,7 +59,7 @@
                 throw new InvalidOperationException("Missing FileProvider.");
             }

-            options.FileProvider = Environment.WebRootFileProvider;
+            options.FileProvider = options.FileProvider ?? Environment.WebRootFileProvider;

             // Add our provider
             var filesProvider = new ManifestEmbeddedFileProvider(GetType().Assembly, "wwwroot");


U4-5167: Handle quoted searches in the backoffice correctly

--- src/Umbraco.Web/Editors/EntityController.cs
+++ src/Umbraco.Web/Editors/EntityController.cs
@@ -24,6 +24,7 @@
 using Examine.SearchCriteria;
 using Umbraco.Web.Dynamics;
 using umbraco;
+using System.Text.RegularExpressions;

 namespace Umbraco.Web.Editors
 {
@@ -289,45 +290,77 @@
             // the rest will be normal without wildcards
             var sb = new StringBuilder();

+            bool hasSingleQuotes = Regex.IsMatch(query, "\"[^\"]*");
+            if (hasSingleQuotes)
+            {
+                //we cannot search for single qoutes, so we ignore them
+                query = query.Replace("\"", "");
+            }
+
             var querywords = query.Split(' ');
-
-            //node name exactly boost x 10
-            sb.Append("+(__nodeName:");
-            sb.Append("\"");
-            sb.Append(query.ToLower());
-            sb.Append("\"");
-            sb.Append("^10.0 ");
-
-            //node name normally with wildcards
-            sb.Append(" __nodeName:");
-            sb.Append("(");
-            foreach (var w in querywords)
-            {
-                sb.Append(w.ToLower());
-                sb.Append("* ");
-            }
-            sb.Append(") ");
-
-
-            foreach (var f in fields)
-            {
-                //additional fields normally
-                sb.Append(f);
-                sb.Append(":");
+            bool hasDoubleQuotes = Regex.IsMatch(query, "\"[^\"]*\"");
+
+            if (string.IsNullOrWhiteSpace(query))
+            {
+                return new List<EntityBasic>();
+            }
+            if (hasDoubleQuotes)
+            {
+
+                //node name exactly boost x 10
+                sb.Append("+(__nodeName: (");
+                sb.Append(query.ToLower());
+                sb.Append(")^10.0 ");
+
+                foreach (var f in fields)
+                {
+                    //additional fields normally
+                    sb.Append(f);
+                    sb.Append(": (");
+                    sb.Append(query);
+                    sb.Append(") ");
+                }
+            }
+            else
+            {
+                //node name exactly boost x 10
+                sb.Append("+(__nodeName:");
+                sb.Append("\"");
+                sb.Append(query.ToLower());
+                sb.Append("\"");
+                sb.Append("^10.0 ");
+
+                //node name normally with wildcards
+                sb.Append(" __nodeName:");
                 sb.Append("(");
                 foreach (var w in querywords)
                 {
                     sb.Append(w.ToLower());
                     sb.Append("* ");
                 }
-                sb.Append(")");
-                sb.Append(" ");
+                sb.Append(") ");
+
+
+                foreach (var f in fields)
+                {
+                    //additional fields normally
+                    sb.Append(f);
+                    sb.Append(":");
+                    sb.Append("(");
+                    foreach (var w in querywords)
+                    {
+                        sb.Append(w.ToLower());
+                        sb.Append("* ");
+                    }
+                    sb.Append(")");
+                    sb.Append(" ");
+                }
             }

             //must match index type
             sb.Append(") +__IndexType:");
             sb.Append(type);
-
+
             var raw = internalSearcher.CreateSearchCriteria().RawQuery(sb.ToString());

             var result = internalSearcher.Search(raw);


AB3917 - Removes unused variable..

AB3917 - Removes unused variable..

--- src/Umbraco.Web/Editors/MemberController.cs
+++ src/Umbraco.Web/Editors/MemberController.cs
@@ -612,9 +612,7 @@
         [HttpPost]
         public HttpResponseMessage DeleteByKey(Guid key)
         {
-            IMember foundMember;
-            MembershipUser foundMembershipUser;
-            foundMember = Services.MemberService.GetByKey(key);
+            var foundMember = Services.MemberService.GetByKey(key);
             if (foundMember == null)
             {
                 return HandleContentNotFound(key, false);


Implemented WidgetBackend.SetSizeRequest

--- src/Xwt.Sdl/Xwt.SdlBackend/WidgetBackend.cs
+++ src/Xwt.Sdl/Xwt.SdlBackend/WidgetBackend.cs
@@ -395,10 +395,21 @@
 			minHeight = height;
 		}

-		public void SetSizeRequest (double width, double height)
-		{
-			this.width = minWidth > 0.0 && minWidth > width ? minWidth : width;
-			this.height = minHeight > 0.0 && minHeight > height ? minHeight : height;
+		public void SetSizeRequest (double w, double h)
+		{
+			if (w >= 0) {
+				this.width = Math.Max (w, minWidth);
+
+				if (currentWidthConstraint.IsConstrained && w > currentWidthConstraint.AvailableSize)
+					width = currentWidthConstraint.AvailableSize;
+			}
+
+			if (h >= 0) {
+				this.height = Math.Max (h, minHeight);
+
+				if (currentHeightConstraint.IsConstrained && h > currentHeightConstraint.AvailableSize)
+					width = currentHeightConstraint.AvailableSize;
+			}
 			OnWidgetResized ();
 		}


Remove another file duplicated by case

Remove another file duplicated by case

--- tests/OmniSharp.Tests/OmnisharpEnvironmentFacts.cs
+++ tests/OmniSharp.Tests/OmnisharpEnvironmentFacts.cs
@@ -1,38 +0,0 @@
-using Microsoft.Extensions.Logging;
-using OmniSharp.Services;
-using Xunit;
-
-namespace OmniSharp.Tests
-{
-    public class OmniSharpEnvironmentFacts
-    {
-
-        [Fact]
-        public void OmnisharpEnvironmentSetsSolutionPathCorrectly()
-        {
-            var environment = new OmniSharpEnvironment(@"foo.sln", 1000, -1, LogLevel.Information, TransportType.Http, null);
-            Assert.Equal(@"foo.sln", environment.SolutionFilePath);
-        }
-        [Fact]
-        public void OmnisharpEnvironmentSetsPathCorrectly()
-        {
-            var environment = new OmniSharpEnvironment(@"foo.sln", 1000, -1, LogLevel.Information, TransportType.Http, null);
-            Assert.Equal(@"", environment.Path);
-        }
-
-        [Fact]
-        public void OmnisharpEnvironmentSetsPortCorrectly()
-        {
-            var environment = new OmniSharpEnvironment(@"foo.sln", 1000, -1, LogLevel.Information, TransportType.Http, null);
-            Assert.Equal(1000, environment.Port);
-        }
-
-        [Fact]
-        public void OmnisharpEnvironmentHasNullSolutionFilePathIfDirectorySet()
-        {
-            var environment = new OmniSharpEnvironment(@"c:\foo\src\", 1000, -1, LogLevel.Information, TransportType.Http, null);
-
-            Assert.Null(environment.SolutionFilePath);
-        }
-    }
-}


Sanity check for nosso número

Sanity check for nosso número

--- src/Boleto.Net/Banco/Banco_Bansirul.cs
+++ src/Boleto.Net/Banco/Banco_Bansirul.cs
@@ -913,8 +913,11 @@
                 //
                 detalhe.NumeroDocumento = reg.SeuNumero;
                 detalhe.NossoNumeroComDV = reg.NossoNumero;
-                detalhe.NossoNumero = reg.NossoNumero.Substring(0, reg.NossoNumero.Length - 1); //Nosso Número sem o DV!
-                detalhe.DACNossoNumero = reg.NossoNumero.Substring(reg.NossoNumero.Length - 1); //DV
+
+                if (reg.NossoNumero != null && reg.NossoNumero.Length >= 2) {
+                    detalhe.NossoNumero = reg.NossoNumero.Substring(0, reg.NossoNumero.Length - 1); //Nosso Número sem o DV!
+                    detalhe.DACNossoNumero = reg.NossoNumero.Substring(reg.NossoNumero.Length - 1); //DV
+                }
                 //
                 int dataVencimento = Utils.ToInt32(reg.DataVencimentoTitulo);
                 detalhe.DataVencimento = Utils.ToDateTime(dataVencimento.ToString("##-##-##"));


alterando o método que calcula o digito verificador

--- src/Boleto.Net/Banco/Banco_Bradesco.cs
+++ src/Boleto.Net/Banco/Banco_Bradesco.cs
@@ -212,7 +212,8 @@

         public string CalculaDigitoVerificador(Boleto boleto)
         {
-            return boleto.DigitoNossoNumero;
+            return Mod11Bradesco(boleto.Carteira + boleto.NossoNumero, 7);
+            //return boleto.DigitoNossoNumero;
         }

         public override string GerarHeaderRemessa(string numeroConvenio, Cedente cedente, TipoArquivo tipoArquivo, int numeroArquivoRemessa, Boleto boletos)