Incorporated basic custom image rendering (currently not behaving as expected)

--- KSPCommEngr/FrequencyAllocation.cs
+++ KSPCommEngr/FrequencyAllocation.cs
@@ -27,19 +27,22 @@

 using UnityEngine;
 using System.Collections;
-using KSPCommSys.Extensions;
+using KSPCommEngr.Extensions;
 using KSP.IO;
+using System.Linq;

-namespace KSPCommSys
+namespace KSPCommEngr
 {
-    [KSPAddon(KSPAddon.Startup.TrackingStation, true)]
+    [KSPAddon(KSPAddon.Startup.TrackingStation, false)]
     public class FrequencyAllocation : MonoBehaviour
     {
         private static Rect windowPosition = new Rect();
         private GUIStyle windowStyle, labelStyle;
         private bool hasInitStyles = false;
+        public Texture2D image = new Texture2D(400, 100); //400 pixels wide by 100 pixels tall

-        public void Awake() {
+        public void Awake()
+        {
             CommEngrLog.Log("Frequency Allocation MonoBehaviour Activated");
         }

@@ -47,15 +50,17 @@
         {
             // Signal tests with sinusoid
             Signal q = new Signal(x => Mathf.Sin(x));
-            CommEngrLog.Log("Frequency Allocation - Sine Signal generated; displayed next:");
-            q.DisplaySignal();
+            CommEngrLog.Log("Frequency Allocation - Sine Signal generated.");
+            //q.DisplaySignal();

             // Test channel noise distortion
             q = Channel.AdditiveNoise(q);
-            CommEngrLog.Log("Frequency Allocation - Channel Noise added to Signal ; displayed next:");
-            q.DisplaySignal();
+            CommEngrLog.Log("Frequency Allocation - Channel Noise added to Signal.");
+            //q.DisplaySignal();

             if (!hasInitStyles) InitStyles();
+
+            drawImage();
             RenderingManager.AddToPostDrawQueue(0, OnDraw);
         }

@@ -66,7 +71,8 @@

         private void OnDraw()
         {
-            windowPosition = GUILayout.Window(10, windowPosition, OnWindow, "This is a title", windowStyle);
+
+            windowPosition = GUILayout.Window(10, windowPosition, OnWindow, "Frequency Allocation Chart", windowStyle);

             if (windowPosition.x == 0f && windowPosition.y == 0f)
                 windowPosition = windowPosition.CenterScreen();
@@ -74,9 +80,10 @@

         private void OnWindow(int windowId)
         {
-            GUILayout.BeginHorizontal();
-            GUILayout.Label("Frequency Allocation Chart", labelStyle);
-            GUILayout.EndHorizontal();
+            GUILayout.BeginVertical();
+                GUI.DrawTexture(new Rect(10f, 10f, 400f, 100f), image, ScaleMode.StretchToFill);
+                GUILayout.Label("Frequency in Hz", labelStyle);
+            GUILayout.EndVertical();

             GUI.DragWindow();
         }
@@ -84,12 +91,44 @@
         private void InitStyles()
         {
             windowStyle = new GUIStyle(HighLogic.Skin.window);
-            windowStyle.fixedWidth = 500f;
+            windowStyle.fixedWidth = 900f;
+            windowStyle.fixedHeight = 900f;

             labelStyle = new GUIStyle(HighLogic.Skin.label);
             labelStyle.stretchWidth = true;
+            //labelStyle.DrawCursor

             hasInitStyles = true;
         }
+
+        // Code provided from KSP Wiki @: http://wiki.kerbalspaceprogram.com/wiki/Module_code_examples
+        // Special thanks to the author of the "Drawing and displaying a 2D image" snippet
+        void drawImage()
+        {
+            // Set all the pixels to black
+            int size = image.height * image.width;
+
+            Color[] colors = Enumerable.Repeat(Color.black, size).ToArray();
+            image.SetPixels(colors);
+
+            int lineWidth = 3; //draw a curve 3 pixels wide
+            for (int x = 0; x < image.width; x++)
+            {
+                int fx = f(x);
+                for (int y = fx; y < fx + lineWidth; y++)
+                {
+                    image.SetPixel(x, y, Color.red);
+                    CommEngrLog.Log("drawImage() - (" + x.ToString() + ", " + y.ToString() + ")");
+                }
+            }
+
+            image.Apply();
+        }
+
+        //the function to plot:
+        int f(int x)
+        {
+            return 2 * x;
+        }
     }
 }


CLI: Make error handling a bit nicer.

CLI: Make error handling a bit nicer.

--- tooling/MonoBerry.cs
+++ tooling/MonoBerry.cs
@@ -91,7 +91,12 @@
 			}

 			app.RegisterCommands (Assembly.GetExecutingAssembly ());
-			app.Execute(cmd, parameters);
+			try {
+				app.Execute (cmd, parameters);
+			} catch (Command.Error e) {
+				Console.Error.WriteLine ("ERROR: {0}", e.Message);
+				Environment.Exit (1);
+			}
 		}

 		private static T ReadAttrib<T> ()


Added mono compiler check for unsupported property in smtpclient

--- LANSearch/Data/Mail/MailManager.cs
+++ LANSearch/Data/Mail/MailManager.cs
@@ -31,7 +31,9 @@
                 using (
                     var client = new SmtpClient
                     {
+#if !__MonoCS__
                         UseDefaultCredentials = false,
+#endif
                         DeliveryMethod = SmtpDeliveryMethod.Network,
                         Host = Ctx.Config.MailServer,
                         Port = Ctx.Config.MailPort,


Added the DefaultRedisClient.CreateRedisLogger() method

--- src/Kephas.Redis/DefaultRedisClient.cs
+++ src/Kephas.Redis/DefaultRedisClient.cs
@@ -11,6 +11,7 @@
 namespace Kephas.Redis
 {
     using System;
+    using System.IO;
     using System.Threading;
     using System.Threading.Tasks;

@@ -94,7 +95,7 @@
             try
             {
                 var settings = this.redisConfiguration.Settings;
-                this.connection = ConnectionMultiplexer.Connect(settings.ConnectionString, new RedisLogger(this.logManager));
+                this.connection = ConnectionMultiplexer.Connect(settings.ConnectionString, this.CreateRedisLogger(context));
                 this.initMonitor.Complete();

                 await this.eventHub.PublishAsync(new RedisClientStartedSignal(), context, cancellationToken).PreserveThreadContext();
@@ -146,5 +147,17 @@
                 this.initMonitor.Reset();
             }
         }
+
+        /// <summary>
+        /// Creates a Redis logger.
+        /// </summary>
+        /// <param name="context">An optional context for initialization.</param>
+        /// <returns>
+        /// The new Redis logger.
+        /// </returns>
+        protected virtual TextWriter CreateRedisLogger(IContext context)
+        {
+            return new RedisLogger(this.logManager);
+        }
     }
 }


Added keepAlive description to CLI

Added keepAlive description to CLI

--- Addons/Entitas.CodeGeneration.CodeGenerator.CLI/Program.cs
+++ Addons/Entitas.CodeGeneration.CodeGenerator.CLI/Program.cs
@@ -78,6 +78,7 @@

             commandList.Add("[-v]".PadRight(pad) + " - " + "verbose output");
             commandList.Add("[-s]".PadRight(pad) + " - " + "silent output (errors only)");
+            commandList.Add("[-a]".PadRight(pad) + " - " + "keep process alive (for faster re-generation)");

             Console.WriteLine("Entitas Code Generator version " + EntitasResources.GetVersion());
             Console.WriteLine("usage:\n{0}", string.Join("\n", commandList));


Updated version to 3.0.0.

Updated version to 3.0.0.

--- Library/Data/Objects/SystemInfo.cs
+++ Library/Data/Objects/SystemInfo.cs
@@ -29,13 +29,13 @@
 	{
 		public static DateTime ReleaseDate {
 			get {
-				return new DateTime(2013, 10, 20);
+				return new DateTime(2014, 12, 03);
 			}
 		}

 		public static string Version {
 			get {
-				return "2.1.369";
+				return "3.0.0. Build 397";
 			}
 		}
 	}


EFRepositoryBase.CommitChanges now uses Retry and RetryTask

--- Aspects/Model/EFRepository/EFRepositoryBase.IRepository.cs
+++ Aspects/Model/EFRepository/EFRepositoryBase.IRepository.cs
@@ -7,12 +7,14 @@

 namespace vm.Aspects.Model.EFRepository
 {
+    using Exceptions;
     using Facilities;
     using Microsoft.Practices.ServiceLocation;
     using Microsoft.Practices.Unity;
     using System.Data.Entity.Infrastructure;
     using System.Reflection;
     using System.Security;
+    using Threading;
     using EFEntityState = System.Data.Entity.EntityState;
     using EntityState = vm.Aspects.Model.Repository.EntityState;

@@ -486,86 +488,110 @@
         /// </returns>
         public IRepository CommitChanges()
         {
-            var succeeded = false;
-            var retries = 0;
-
-            while (!succeeded)
-                try
+            new Retry<bool>(
+                i =>
                 {
-                    SaveChanges();
-                    succeeded = true;
-                }
-                catch (Exception x)
+                    try
+                    {
+                        SaveChanges();
+                        return true;
+                    }
+                    catch (Exception exception)
+                    {
+                        Exception newException;
+                        var rethrow = Facility.ExceptionManager.HandleException(exception, OptimisticConcurrencyStrategy.ToString(), out newException);
+
+                        if (rethrow)
+                        {
+                            if (newException != null)
+                                throw newException;
+                            else
+                                throw;
+                        }
+
+                        if (i == MaxNumberOfRetries)
+                            throw new RepeatableOperationException(exception);
+
+                        var cx = exception as DbUpdateConcurrencyException;
+
+                        if (cx != null)
+                        {
+                            var entry = cx.Entries.Single();
+
+                            entry.OriginalValues.SetValues(
+                                entry.GetDatabaseValues());
+                        }
+
+                        return false;
+                    }
+                },
+                (r, i) => false,   // it never really fails - only throws exceptions
+                (r, i) => r)
+                .Start(
+                    MaxNumberOfRetries,
+                    MinWaitBeforeRetry,
+                    MaxWaitBeforeRetry);
+
+            return this;
+        }
+
+        /// <summary>
+        /// Saves the changes buffered in the repository's context asynchronously.
+        /// </summary>
+        /// <returns>
+        ///   <c>this</c>
+        /// </returns>
+        public async Task<IRepository> CommitChangesAsync()
+        {
+            await new RetryTasks<bool>(
+                async i =>
                 {
-                    Exception newException;
-                    var rethrow = Facility.ExceptionManager.HandleException(x, OptimisticConcurrencyStrategy.ToString(), out newException);
-
-                    if (rethrow)
+                    try
                     {
-                        if (newException != null)
-                            throw newException;
-                        else
-                            throw;
+                        await SaveChangesAsync();
+                        return true;
                     }
-
-                    if (retries++ >= MaxNumberOfRetries)
-                        throw;
-
-                    var ex = x as DbUpdateConcurrencyException;
-
-                    if (ex != null)
+                    catch (Exception exception)
                     {
-                        var entry = ex.Entries.Single();
-
-                        DelayBeforeRetryAsync().Wait();
-                        entry.OriginalValues.SetValues(entry.GetDatabaseValues());
+                        var ex = exception;
+                        var aex = ex as AggregateException;
+
+                        if (aex?.InnerExceptions.Count() == 1)
+                            ex = aex.InnerExceptions.First();
+
+                        Exception newException;
+                        var rethrow = Facility.ExceptionManager.HandleException(ex, OptimisticConcurrencyStrategy.ToString(), out newException);
+
+                        if (rethrow)
+                        {
+                            if (newException != null)
+                                throw newException;
+                            else
+                                throw;
+                        }
+
+                        if (i == MaxNumberOfRetries)
+                            throw new RepeatableOperationException(exception);
+
+                        var cx = exception as DbUpdateConcurrencyException;
+
+                        if (cx != null)
+                        {
+                            var entry = cx.Entries.Single();
+
+                            entry.OriginalValues.SetValues(
+                                await entry.GetDatabaseValuesAsync());
+                        }
+
+                        return false;
                     }
-                }
-
-            return this;
-        }
-
-        /// <summary>
-        /// Asynchronously saves the changes buffered in the repository's context.
-        /// </summary>
-        /// <returns><c>this</c></returns>
-        public async Task<IRepository> CommitChangesAsync()
-        {
-            var succeeded = false;
-            var retries = 0;
-
-            while (!succeeded)
-                try
-                {
-                    await SaveChangesAsync();
-                    succeeded = true;
-                }
-                catch (Exception x)
-                {
-                    Exception newException;
-                    var rethrow = Facility.ExceptionManager.HandleException(x, OptimisticConcurrencyStrategy.ToString(), out newException);
-
-                    if (rethrow)
-                    {
-                        if (newException != null)
-                            throw newException;
-                        else
-                            throw;
-                    }
-
-                    if (retries++ >= MaxNumberOfRetries)
-                        throw;
-
-                    var ex = x as DbUpdateConcurrencyException;
-
-                    if (ex != null)
-                    {
-                        var entry = ex.Entries.Single();
-
-                        await DelayBeforeRetryAsync();
-                        entry.OriginalValues.SetValues(entry.GetDatabaseValues());
-                    }
-                }
+                },
+                async (r, i) => false,   // it never really fails - only throws exceptions
+                async (r, i) => r)
+                .StartAsync(
+                    MaxNumberOfRetries,
+                    MinWaitBeforeRetry,
+                    MaxWaitBeforeRetry);

             return this;
         }


Fixed (#183)

Fixed (#183)

--- BlogTemplate/Pages/Account/Manage/ChangePassword.cshtml.cs
+++ BlogTemplate/Pages/Account/Manage/ChangePassword.cshtml.cs
@@ -66,7 +66,7 @@
                 return RedirectToPage("./SetPassword");
             }

-            return Page();
+            return RedirectToPage("/Index");
         }

         public async Task<IActionResult> OnPostAsync()


fix bug.

fix bug.

--- CSharpGL.Objects/SceneElements/PointSpriteStringElement.cs
+++ CSharpGL.Objects/SceneElements/PointSpriteStringElement.cs
@@ -144,7 +144,7 @@
         public PointSpriteStringElement(
             string content, vec3 position, GLColor color = null, int fontSize = 32, int maxRowWidth = 256, FontResource fontResource = null)
         {
-            if (fontSize >= maxRowWidth) { throw new ArgumentException(); }
+            if (fontSize >= 256) { throw new ArgumentException(); }

             this.content = content;
             this.position = position;


Core - Update CefSharp.Core.RunTime Ref Assembly

The generated code keeps wanting to add a blank line

--- CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.cs
+++ CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.cs
@@ -364,3 +364,4 @@
     }
 }

+


JsonStoreWindow 수정

JsonStoreWindow 수정

* 에디터 스크롤이 윈도우를 벗어나는 문제 수정
* List<string> 도 JsonSotreRefer를 사용할 수 있도록 수정
* bool 형식도 사용할 수 있도록 수정

--- Assets/JsonStore/Editor/JsonStoreWindow.cs
+++ Assets/JsonStore/Editor/JsonStoreWindow.cs
@@ -478,8 +478,6 @@

         GUILayout.EndHorizontal();

-        GUILayout.Space(10);
-
         _itemScrollPos = EditorGUILayout.BeginScrollView(_itemScrollPos, GUILayout.Width (position.width - ListWidth), GUILayout.Height(position.height - 70));

         if (_data.Contains(_selectedKey) && _data[_selectedKey].AsDictonary != null)
@@ -503,8 +501,6 @@
                         _data[dataKey].AsDictonary[origPair.Key] = newDict[origPair.Key];
                     }
                 }
-
-                //_data[dataKey].AsDictonary[changedKey] = changedValue;
             }
         }

@@ -514,6 +510,11 @@

     private object OnObjectGUI(object obj)
     {
+        return OnObjectGUI(obj, null);
+    }
+
+    private object OnObjectGUI(object obj, string refName)
+    {
         if (obj == null)
             return null;

@@ -529,81 +530,21 @@
         }
         else if (type == typeof(string))
         {
-            obj = EditorGUILayout.TextField((string)obj);
-        }
-        else
-        {
-            var fields = type.GetFields();
-            foreach (var field in fields)
-            {
-                GUILayout.BeginHorizontal();
-                OnFieldGUI(obj, field);
-                GUILayout.EndHorizontal();
-            }
-        }
-        return obj;
-    }
-
-    private void OnFieldGUI(object obj, FieldInfo field)
-    {
-        var labelWidth = GUILayout.Width(100);
-        GUILayout.Label(field.Name, labelWidth);
-        if (typeof(IList).IsAssignableFrom(field.FieldType))
-        {
-            IList ilist = (IList)field.GetValue(obj);
-            if (ilist == null)
-                ilist = (IList)Activator.CreateInstance(field.FieldType);
-            field.SetValue(obj, ilist);
-
-            GUILayout.BeginVertical();
-            var count = EditorGUILayout.IntField("size", ilist.Count);
-            Type listType = ilist.GetType().GetGenericArguments()[0];
-            while (ilist.Count < count)
-            {
-                ilist.Add(Activator.CreateInstance(listType));
-            }
-            for (var i = 0; i < ilist.Count; ++i)
-            {
-                ilist[i] = OnObjectGUI(ilist[i]);
-            }
-            GUILayout.EndVertical();
-        }
-        else if (field.FieldType == typeof(int))
-        {
-            field.SetValue(obj, EditorGUILayout.IntField((int)field.GetValue(obj)));
-        }
-        else if (field.FieldType == typeof(float))
-        {
-            field.SetValue(obj, EditorGUILayout.FloatField((float)field.GetValue(obj)));
-        }
-        else if (field.FieldType == typeof(string))
-        {
-            string refName = null;
-            var attrs = field.GetCustomAttributes(true);
-            foreach (var a in attrs)
-            {
-                var r = a as JsonStoreRefer;
-                if (r != null)
-                    refName = r.Name;
-            }
-
-            var available = refName != null && _refers[refName].Contains((string)field.GetValue(obj));
+//            obj = EditorGUILayout.TextField((string)obj);
+            var available = refName != null && _refers[refName].Contains((string)obj);
             GUI.contentColor = available ? Color.green : Color.red;
             if (refName == null)
                 GUI.contentColor = Color.white;
-
-            var val = EditorGUILayout.TextField((string)field.GetValue(obj));
+
+            var val = EditorGUILayout.TextField((string)obj);
             if (val == null)
                 val = "";
-            field.SetValue(obj, val);
+            obj = val;
             GUI.contentColor = Color.white;
-
             if (refName != null)
             {
                 var refs = _refers[refName].ToArray();
-                GUILayout.EndHorizontal();
-                GUILayout.BeginHorizontal();
-                _useRefs = GUILayout.Toggle(_useRefs, string.Format("({0})", refName), labelWidth);
+                _useRefs = GUILayout.Toggle(_useRefs, string.Format("({0})", refName));
                 GUILayout.BeginVertical();
                 if (_useRefs)
                 {
@@ -618,9 +559,128 @@
                     GUI.contentColor = Color.white;
                 }
                 GUILayout.EndVertical();
+            }
+
+        }
+        else if (type == typeof(bool))
+        {
+            obj = EditorGUILayout.Toggle((bool)obj);
+        }
+        else
+        {
+            var fields = type.GetFields();
+            foreach (var field in fields)
+            {
+                GUILayout.BeginHorizontal();
+                OnFieldGUI(obj, field);
+                GUILayout.EndHorizontal();
+            }
+        }
+        return obj;
+    }
+
+    private void OnFieldGUI(object obj, FieldInfo field)
+    {
+        var labelWidth = GUILayout.Width(100);
+        GUILayout.Label(field.Name, labelWidth);
+        if (typeof(IList).IsAssignableFrom(field.FieldType))
+        {
+            IList ilist = (IList)field.GetValue(obj);
+            if (ilist == null)
+                ilist = (IList)Activator.CreateInstance(field.FieldType);
+            field.SetValue(obj, ilist);
+
+            GUILayout.BeginVertical();
+            var count = EditorGUILayout.IntField("size", ilist.Count);
+            Type listType = ilist.GetType().GetGenericArguments()[0];
+
+            string refName = null;
+            var attrs = field.GetCustomAttributes(true);
+            foreach (var a in attrs)
+            {
+                var r = a as JsonStoreRefer;
+                if (r != null)
+                    refName = r.Name;
+            }
+
+            while (ilist.Count < count)
+            {
+                if (listType == typeof(string))
+                {
+                    ilist.Add("");
+                }
+                else
+                    ilist.Add(Activator.CreateInstance(listType));
+            }
+            while (ilist.Count > count)
+            {
+                ilist.RemoveAt(ilist.Count - 1);
+            }
+            for (var i = 0; i < ilist.Count; ++i)
+            {
+                ilist[i] = OnObjectGUI(ilist[i], refName);
+            }
+            GUILayout.EndVertical();
+        }
+        else if (field.FieldType == typeof(int))
+        {
+            field.SetValue(obj, EditorGUILayout.IntField((int)field.GetValue(obj)));
+        }
+        else if (field.FieldType == typeof(float))
+        {
+            field.SetValue(obj, EditorGUILayout.FloatField((float)field.GetValue(obj)));
+        }
+        else if (field.FieldType == typeof(string))
+        {
+            string refName = null;
+            var attrs = field.GetCustomAttributes(true);
+            foreach (var a in attrs)
+            {
+                var r = a as JsonStoreRefer;
+                if (r != null)
+                    refName = r.Name;
+            }
+
+            var available = refName != null && _refers[refName].Contains((string)field.GetValue(obj));
+            GUI.contentColor = available ? Color.green : Color.red;
+            if (refName == null)
+                GUI.contentColor = Color.white;
+
+            var val = EditorGUILayout.TextField((string)field.GetValue(obj));
+            if (val == null)
+                val = "";
+            field.SetValue(obj, val);
+            GUI.contentColor = Color.white;
+
+            if (refName != null)
+            {
+                var refs = _refers[refName].ToArray();
                 GUILayout.EndHorizontal();
                 GUILayout.BeginHorizontal();
-            }
+                _useRefs = GUILayout.Toggle(_useRefs, string.Format("({0})", refName), labelWidth);
+                GUILayout.BeginVertical();
+                if (_useRefs)
+                {
+                    GUI.contentColor = Color.cyan;
+                    var refLen = refs.Length;
+                    for (var refIdx = 0; refIdx < refLen; ++refIdx)
+                    {
+                        var r = refs[refIdx];
+                        if (r.IndexOf(val) >= 0)
+                            GUILayout.Label(string.Format("{0}{1}", r, _refNames[refName][refIdx]));
+                    }
+                    GUI.contentColor = Color.white;
+                }
+                GUILayout.EndVertical();
+                GUILayout.EndHorizontal();
+                GUILayout.BeginHorizontal();
+            }
+        }
+        else if (field.FieldType == typeof(bool))
+        {
+            var val = (bool)field.GetValue(obj);
+            val = EditorGUILayout.Toggle(val);
+            field.SetValue(obj, val);
         }
         else if (field.FieldType.IsEnum)
         {


Fixed Indicator hiding issue.

Fixed Indicator hiding issue.

--- CitadelGUI/Te/Citadel/UI/Controls/TimeRestrictionSlider.cs
+++ CitadelGUI/Te/Citadel/UI/Controls/TimeRestrictionSlider.cs
@@ -616,7 +616,7 @@
         private RepeatButton _rightButton;
         private StackPanel _visualElementsContainer;
         private Thumb _indicator;
-        private Grid _indicatorContainer;
+        private Canvas _indicatorContainer;
         private FrameworkElement _container;
         private Double _movableWidth;
         private readonly DispatcherTimer _timer;
@@ -1143,7 +1143,7 @@
             this._centerThumb = this.GetTemplateChild("PART_MiddleThumb") as RepeatButton;
             this._leftButton = this.GetTemplateChild("PART_LeftEdge") as RepeatButton;
             this._rightButton = this.GetTemplateChild("PART_RightEdge") as RepeatButton;
-            this._indicatorContainer = this.GetTemplateChild("PART_IndicatorContainer") as Grid;
+            this._indicatorContainer = this.GetTemplateChild("PART_IndicatorContainer") as Canvas;
             this._indicator = this.GetTemplateChild("PART_Indicator") as Thumb;

             this.InitializeVisualElementsContainer();


Bring Tools.current hack back

Bring Tools.current hack back

--- Assets/RagePixel2/Editor/RagePixelState.cs
+++ Assets/RagePixel2/Editor/RagePixelState.cs
@@ -239,6 +239,12 @@
 			SceneView.RepaintAll ();
 		}

+		private void OnUserToolChange ()
+		{
+			m_Mode = SceneMode.Default;
+			Repaint ();
+		}
+
 		public void ApplyColorReplace ()
 		{
 			replaceColorHandler.Apply (sprite);
@@ -259,7 +265,7 @@

 		private void UpdateToolsCurrent (SceneMode oldMode, SceneMode newMode)
 		{
-			if (newMode != SceneMode.Default && oldMode == SceneMode.Default)
+			if (newMode != SceneMode.Default)
 			{
 				Tools.current = Tool.None;
 			}
@@ -272,6 +278,9 @@

 		public void OnSceneGUI (SceneView sceneView)
 		{
+			if (Tools.current != Tool.None)
+				OnUserToolChange ();
+
 			if (sprite == null && mode != SceneMode.CreateSprite)
 				return;


added unit tests for StudentsController.Create()

--- ContosoUniversity.UnitTests/Web/StudentsControllerTests.cs
+++ ContosoUniversity.UnitTests/Web/StudentsControllerTests.cs
@@ -2,6 +2,7 @@
 using ContosoUniversity.Data.Entities;
 using ContosoUniversity.Data.Interfaces;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
 using Moq;
 using System;
 using System.Collections.Generic;
@@ -60,6 +61,54 @@
             Assert.Equal(404, ((NotFoundResult)result).StatusCode);
         }

+
+        [Fact]
+        public void Create_ReturnsAViewResult()
+        {
+            var result = sut.Create();
+
+            Assert.IsType(typeof(ViewResult), result);
+        }
+
+        [Fact]
+        public async Task CreatePost_ReturnsRedirectToActionResult_Index()
+        {
+            var result = await sut.Create(new Student());
+
+            Assert.IsType(typeof(RedirectToActionResult), result);
+            Assert.Equal("Index", ((RedirectToActionResult)result).ActionName);
+        }
+
+        [Fact]
+        public async Task CreatePost_ReturnsAViewResult_WithInvalidModel()
+        {
+            var student = new Student { ID = 9, FirstMidName = "John", LastName = "Wick", EnrollmentDate = DateTime.Parse("2005-09-01") };
+            sut.ModelState.AddModelError("myerror", "my error message");
+
+            var result = await sut.Create(student);
+
+            Assert.IsType(typeof(ViewResult), result);
+
+            var model = (Student)((ViewResult)result).Model;
+            Assert.Equal("Wick", model.LastName);
+        }
+
+        [Fact]
+        public async Task CreatePost_ReturnsAViewResult_WithInvalidModel_DbUpdateException()
+        {
+            var student = new Student { ID = 9, FirstMidName = "John", LastName = "Wick", EnrollmentDate = DateTime.Parse("2005-09-01") };
+            mockStudentRepo.Setup(m => m.SaveChangesAsync())
+                .Callback(() => throw new DbUpdateException("myexception", new Exception()))
+                .Returns(Task.FromResult(0));
+
+            var result = await sut.Create(student);
+
+            Assert.IsType(typeof(ViewResult), result);
+
+            var viewData = ((ViewResult)result).ViewData;
+            Assert.True(viewData.ModelState.Count > 0);
+        }
+
         private List<Student> Students()
         {
             return new List<Student>


mark game started

mark game started

--- Assets/Scenes/InGame/Scripts/GamePlayer.cs
+++ Assets/Scenes/InGame/Scripts/GamePlayer.cs
@@ -100,6 +100,7 @@
 }
 */
 		/*******/
+		PlayerPrefs.SetInt("GameStarted", 1);
 		enableSE = PlayerPrefs.GetInt ("enableSE") != 0;
 		enableBG = PlayerPrefs.GetInt ("enableBG") != 0;


change text selection shape rendering order

--- Assets/Scripts/Core/Text/InputTextField.cs
+++ Assets/Scripts/Core/Text/InputTextField.cs
@@ -842,8 +842,8 @@

             if (_editing)
             {
-                SetChildIndex(_selectionShape, this.numChildren - 1);
-                SetChildIndex(_caret, this.numChildren - 2);
+                SetChildIndex(_selectionShape, 0);
+                SetChildIndex(_caret, this.numChildren - 1);
             }

             int cnt = textField.charPositions.Count;
@@ -1042,7 +1042,7 @@
             AddChild(_caret);

             _selectionShape.Clear();
-            AddChild(_selectionShape);
+            AddChildAt(_selectionShape, 0);

             if (!textField.Redraw())
             {


fight dodge updated

fight dodge updated

--- MIMWebClient/Core/Events/Fight2.cs
+++ MIMWebClient/Core/Events/Fight2.cs
@@ -705,42 +705,47 @@

                             //Randomly pick to output dodge, parry, miss

-                            var rand = Helpers.Rand(1, 100);
+                            var rand = Helpers.Rand(1, 4);
                             var message = "misses";
-
-                            if (rand <= 33)
+                            var observerMessage = string.Empty;
+
+                            if (rand <= 1)
                             {
-                                message = "missess";
+                                message = "Your " + WeaponAttackName(attacker, skillUsed).Key +
+                                          " misses " +
+                                          Helpers.ReturnName(defender, attacker, null);
+
+                                observerMessage = Helpers.ReturnName(attacker, defender, null) + "'s " +
+                                                  WeaponAttackName(attacker, skillUsed).Key +
+                                                  "  " + message + " " +
+                                                  Helpers.ReturnName(defender, attacker, null);
                             }
-                            else if (rand > 33 && rand <= 66)
+                            else if (rand > 1 && rand <= 2)
                             {
-                                message = "dodges";
+                                message = Helpers.ReturnName(defender, attacker, null) + " dodges your " +
+                                          WeaponAttackName(attacker, skillUsed).Key;
+
+                                observerMessage = Helpers.ReturnName(defender, attacker, null) + " dodges" + Helpers.ReturnName(defender, attacker, null) + "'s" + WeaponAttackName(attacker, skillUsed).Key;
                             }
                             else
-                            {
-                                message = "parries";
+                            {
+                                message = Helpers.ReturnName(defender, attacker, null) + " parries your " +
+                                          WeaponAttackName(attacker, skillUsed).Key;
+
+                                observerMessage = Helpers.ReturnName(defender, attacker, null) + " parries" + Helpers.ReturnName(defender, attacker, null) + "'s" + WeaponAttackName(attacker, skillUsed).Key;
                             }

-                            HubContext.SendToClient(
-                                "Your " + WeaponAttackName(attacker, skillUsed).Key +
-                                "  " + message + " " +
-                                Helpers.ReturnName(defender, attacker, null), attacker.HubGuid);
-
-                            HubContext.SendToClient(
-                                Helpers.ReturnName(attacker, defender, null) + "'s " +
-                                WeaponAttackName(attacker, skillUsed).Key +
-                                "  " + message + " you ", defender.HubGuid);
+                            HubContext.SendToClient(message, attacker.HubGuid);
+
+

                             foreach (var player in room.players)
                             {
                                 if (player != attacker && player != defender)
                                 {
                                     HubContext.SendToClient(
-                                        Helpers.ReturnName(attacker, defender, null) + "'s " +
-                                        WeaponAttackName(attacker, skillUsed).Key +
-                                        "  " + message + " " +
-                                        Helpers.ReturnName(defender, attacker, null), player.HubGuid);
+                                      observerMessage, player.HubGuid);
                                 }
                             }


Change Threat level to High for osForceAttachToAvatar() and osForceDetachFromAvatar()

--- Aurora/AuroraDotNetEngine/APIs/OSSL_Api.cs
+++ Aurora/AuroraDotNetEngine/APIs/OSSL_Api.cs
@@ -506,14 +506,14 @@

         public void osForceAttachToAvatar(int attachmentPoint)
         {
-            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "osForceAttachToAvatar", m_host, "OSSL", m_itemID)) return;
+            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar", m_host, "OSSL", m_itemID)) return;
             InitLSL();
             ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint);
         }

         public void osForceDetachFromAvatar()
         {
-            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "osForceDetachFromAvatar", m_host, "OSSL", m_itemID)) return;
+            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar", m_host, "OSSL", m_itemID)) return;
             InitLSL();
             ((LSL_Api)m_LSL_Api).DetachFromAvatar();
         }


MINOR: Renamed WebApp.start return

MINOR: Renamed WebApp.start return

--- AzureCDNService/AzureCDNService/Program.cs
+++ AzureCDNService/AzureCDNService/Program.cs
@@ -16,7 +16,7 @@
             options.Urls.Add("http://localhost:1337");
             options.Urls.Add("http://127.0.0.1:1337");

-            var SleipnirWebApi = WebApp.Start<Startup>(options);
+            var AzureCDNWebApiService = WebApp.Start<Startup>(options);

             Console.WriteLine("Started Azure CDN Upload Server at " + options.Urls.Last());
             Console.WriteLine("Press Any Key To Exit");


Upload filesets last during a backup

Upload filesets last during a backup

If parallel uploads are enabled it is possible for the fileset to be uploaded before all dblocks are uploaded.
When the fileset is placed in the queue to be uploaded place it in a separate list and only upload it after all dblocks have been uploaded.

Fixes #4341

--- Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
+++ Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
@@ -39,12 +39,12 @@
     {
         public Task<long> LastWriteSizeAsync { get { return m_tcs.Task; } }
         private readonly TaskCompletionSource<long> m_tcs = new TaskCompletionSource<long>();
-
+
         public void SetFlushed(long size)
         {
             m_tcs.TrySetResult(size);
         }
-
+
         public void TrySetCanceled()
         {
             m_tcs.TrySetCanceled();
@@ -108,7 +108,6 @@
         private readonly StatsCollector m_stats;
         private readonly ITaskReader m_taskReader;

-
         public BackendUploader(Func<IBackend> backendFactory, Options options, DatabaseCommon database, ITaskReader taskReader, StatsCollector stats)
         {
             m_backendFactory = backendFactory;
@@ -135,6 +134,7 @@
                 var uploadsInProgress = 0;
                 m_cancelTokenSource = new CancellationTokenSource();
                 m_progressUpdater.Run(m_cancelTokenSource.Token);
+                var filesetsToUpload = new List<FilesetUploadRequest>();

                 try
                 {
@@ -145,12 +145,7 @@
                         if (!await m_taskReader.ProgressAsync)
                             break;

-                        var worker = workers.FirstOrDefault(w => w.Task.IsCompleted && !w.Task.IsFaulted);
-                        if (worker == null)
-                        {
-                            worker = new Worker(m_backendFactory());
-                            workers.Add(worker);
-                        }
+                        Worker worker = GetWorker(workers);

                         if (req is VolumeUploadRequest volumeUpload)
                         {
@@ -164,8 +159,7 @@
                         }
                         else if (req is FilesetUploadRequest filesetUpload)
                         {
-                            worker.Task = Task.Run(() => UploadVolumeWriter(filesetUpload.Fileset, worker, m_cancelTokenSource.Token));
-                            uploadsInProgress++;
+                            filesetsToUpload.Add(filesetUpload);
                         }
                         else if (req is IndexVolumeUploadRequest indexUpload)
                         {
@@ -174,20 +168,10 @@
                         }
                         else if (req is FlushRequest flush)
                         {
-                            while (workers.Any())
-                            {
-                                Task finishedTask = await Task.WhenAny(workers.Select(w => w.Task)).ConfigureAwait(false);
-                                if (finishedTask.IsFaulted)
-                                {
-                                    flush.TrySetCanceled();
-                                    ExceptionDispatchInfo.Capture(finishedTask.Exception).Throw();
-                                }
-
-                                Worker finishedWorker = workers.Single(w => w.Task == finishedTask);
-                                workers.Remove(finishedWorker);
-                                finishedWorker.Dispose();
-                            }
-
+                            await WaitForWorkers(workers, flush).ConfigureAwait(false);
+                            UploadFilesets(workers, filesetsToUpload);
+                            await WaitForWorkers(workers, flush).ConfigureAwait(false);
+
                             flush.SetFlushed(lastSize);
                             uploadsInProgress = 0;
                             break;
@@ -240,6 +224,46 @@
             });
         }

+        private Worker GetWorker(List<Worker> workers)
+        {
+            var worker = workers.FirstOrDefault(w => w.Task.IsCompleted && !w.Task.IsFaulted);
+            if (worker == null)
+            {
+                worker = new Worker(m_backendFactory());
+                workers.Add(worker);
+            }
+
+            return worker;
+        }
+
+        private async Task WaitForWorkers(List<Worker> workers, FlushRequest flush)
+        {
+            while (workers.Any())
+            {
+                Task finishedTask = await Task.WhenAny(workers.Select(w => w.Task)).ConfigureAwait(false);
+                if (finishedTask.IsFaulted)
+                {
+                    flush.TrySetCanceled();
+                    ExceptionDispatchInfo.Capture(finishedTask.Exception).Throw();
+                }
+
+                Worker finishedWorker = workers.Single(w => w.Task == finishedTask);
+                workers.Remove(finishedWorker);
+                finishedWorker.Dispose();
+            }
+        }
+
+        private void UploadFilesets(List<Worker> workers, List<FilesetUploadRequest> filesets)
+        {
+            foreach (var fileset in filesets)
+            {
+                Worker worker = GetWorker(workers);
+                worker.Task = Task.Run(() => UploadVolumeWriter(fileset.Fileset, worker, m_cancelTokenSource.Token));
+            }
+
+            filesets.Clear();
+        }
+
         private static Exception GetInnerMostException(Exception ex)
         {
             while (ex.InnerException != null)
@@ -481,4 +505,4 @@
             }
         }
     }
-}
+}


Fix log message for retried upload operations.

The number of attempts is one (the first attempt) plus the number of
retries.

--- Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
+++ Duplicati/Library/Main/Operation/Backup/BackendUploader.cs
@@ -309,7 +309,7 @@
                 catch (Exception ex)
                 {
                     item.IsRetry = true;
-                    Logging.Log.WriteRetryMessage(LOGTAG, $"Retry{item.Operation}", ex, "Operation {0} with file {1} attempt {2} of {3} failed with message: {4}", item.Operation, item.RemoteFilename, retryCount + 1, m_options.NumberOfRetries, ex.Message);
+                    Logging.Log.WriteRetryMessage(LOGTAG, $"Retry{item.Operation}", ex, "Operation {0} with file {1} attempt {2} of {3} failed with message: {4}", item.Operation, item.RemoteFilename, retryCount + 1, m_options.NumberOfRetries + 1, ex.Message);
                     if (ex is ThreadAbortException || ex is OperationCanceledException)
                         break;


Fixing bug

Fixing bug

--- Source/Grace/DependencyInjection/Impl/ListExportStrategy.cs
+++ Source/Grace/DependencyInjection/Impl/ListExportStrategy.cs
@@ -20,7 +20,7 @@
 		/// <returns></returns>
 		public object Activate(IInjectionScope exportInjectionScope, IInjectionContext context, ExportStrategyFilter consider, object locateKey)
 		{
-			return exportInjectionScope.LocateAll<T>(injectionContext: context, consider: consider);
+			return exportInjectionScope.LocateAll<T>(context, consider, locateKey);
 		}

 		/// <summary>
@@ -206,4 +206,4 @@
 			return ActivationName.GetHashCode();
 		}
 	}
-}+}


Documented the IEnumerable extensions

Documented the IEnumerable extensions

--- Source/MoreDotNet/Extentions/Common/EnumerableExtentions.cs
+++ Source/MoreDotNet/Extentions/Common/EnumerableExtentions.cs
@@ -7,98 +7,132 @@

     public static class EnumerableExtentions
     {
-        public static void ForEach<T>(this IEnumerable<T> collection, Action<T> mapFunction)
+        /// <summary>
+        /// Executes an <see cref="Action{T}"/> on every element of the <paramref name="items"/>.
+        /// </summary>
+        /// <typeparam name="T">The item type of the <see cref="items"/>.</typeparam>
+        /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
+        /// <param name="mapFunction">The action to be executed.</param>
+        public static void ForEach<T>(this IEnumerable<T> items, Action<T> mapFunction)
         {
-            foreach (var item in collection)
+            foreach (var item in items)
             {
                 mapFunction(item);
             }
         }

         /// <summary>
-        /// Checks if the <see cref="IEnumerable{T}"/> is null or empty.
+        /// Returns and empty <see cref="IEnumerable{T}"/> collection if <paramref name="items"/> is null.
         /// </summary>
         /// <typeparam name="T">The item type of the <param name="items"></param> enumeration.</typeparam>
         /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
-        /// <returns>True of the <see cref="IEnumerable{T}"/> is null or empty. Otherwise - false.</returns>
+        /// <returns>The <paramref name="items"/> collection or an empty <see cref="IEnumerable{T}"/> collection.</returns>
         public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> items)
         {
             return items ?? Enumerable.Empty<T>();
         }

-        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source)
+        /// <summary>
+        /// Shuffles the elements of a <see cref="IEnumerable{T}"/> collection.
+        /// </summary>
+        /// <typeparam name="T">The item type of the <param name="items"></param> enumeration.</typeparam>
+        /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
+        /// <returns>A new collection with the snuffled elements from <paramref name="items"/>.</returns>
+        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> items)
         {
-            return source.Shuffle(new Random());
+            return items.Shuffle(new Random());
         }

-        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source, Random randomGenerator)
+        /// <summary>
+        /// Shuffles the elements of a <see cref="IEnumerable{T}"/> collection using a random generator.
+        /// </summary>
+        /// <typeparam name="T">The item type of the <param name="items"></param> enumeration.</typeparam>
+        /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
+        /// <param name="randomGenerator">А <see cref="Random"/> instance, used to shuffle the elements.</param>
+        /// <returns>A new collection with the snuffled elements from <paramref name="items"/>.</returns>
+        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> items, Random randomGenerator)
         {
-            source.ThrowIfArgumentIsNull("source");
+            items.ThrowIfArgumentIsNull("source");
             randomGenerator.ThrowIfArgumentIsNull("randomGenerator");

-            return source.ShuffleIterator(randomGenerator);
+            return items.ShuffleIterator(randomGenerator);
         }

-        public static string ToString<T>(this IEnumerable<T> collection, string separator)
+        /// <summary>
+        /// Generates a string from the elements of an <see cref="IEnumerable{T}"/> using a given separator.
+        /// </summary>
+        /// <typeparam name="T">The item type of the <param name="items"></param> enumeration.</typeparam>
+        /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
+        /// <param name="separator">The string separation used when generation the string.</param>
+        /// <returns>A string from the elements of an <see cref="IEnumerable{T}"/> using a given separator.</returns>
+        public static string ToString<T>(this IEnumerable<T> items, string separator)
         {
-            return ToString(collection, t => t.ToString(), separator);
+            return ToString(items, t => t.ToString(), separator);
         }

-        public static string ToString<T>(this IEnumerable<T> collection, Func<T, string> stringElement, string separator)
+        /// <summary>
+        /// Generates a string from the transformed elements of an <see cref="IEnumerable{T}"/> using a given separator.
+        /// </summary>
+        /// <typeparam name="T">The item type of the <param name="items"></param> enumeration.</typeparam>
+        /// <param name="items">The <see cref="IEnumerable{T}"/> instance on which the extension method is called.</param>
+        /// <param name="stringElement">The function used to transform the elements of the <see cref="IEnumerable{T}"/>.</param>
+        /// <param name="separator">The string separation used when generation the string.</param>
+        /// <returns></returns>
+        public static string ToString<T>(this IEnumerable<T> items, Func<T, string> stringElement, string separator)
         {
-            var sb = new StringBuilder();
-            foreach (var item in collection)
+            var output = new StringBuilder();
+            foreach (var item in items)
             {
-                sb.Append(stringElement(item));
-                sb.Append(separator);
+                output.Append(stringElement(item));
+                output.Append(separator);
             }

-            return sb.ToString(0, Math.Max(0, sb.Length - separator.Length));
+            return output.ToString(0, Math.Max(0, output.Length - separator.Length));
         }

-        public static T ObjectWithMin<T, TResult>(this IEnumerable<T> sequence, Func<T, TResult> predicate)
-            where T : class
-            where TResult : IComparable
+        ////public static T ObjectWithMin<T, TResult>(this IEnumerable<T> items, Func<T, TResult> predicate)
+        ////    where T : class
+        ////    where TResult : IComparable
+        ////{
+        ////    if (!items.Any())
+        ////    {
+        ////        return null;
+        ////    }
+
+        ////    // get the first object with its predicate value
+        ////    var seed = items.Select(x => new { Object = x, Value = predicate(x) }).FirstOrDefault();
+
+        ////    // compare against all others, replacing the accumulator with the lesser value
+        ////    // tie goes to first object found
+        ////    return items
+        ////        .Select(x => new { Object = x, Value = predicate(x) })
+        ////        .Aggregate(seed, (acc, x) => acc.Value.CompareTo(x.Value) <= 0 ? acc : x).Object;
+        ////}
+
+        ////public static T ObjectWithMax<T, TResult>(this IEnumerable<T> items, Func<T, TResult> predicate)
+        ////    where T : class
+        ////    where TResult : IComparable
+        ////{
+        ////    if (!items.Any())
+        ////    {
+        ////        return null;
+        ////    }
+
+        ////    // get the first object with its predicate value
+        ////    var seed = items
+        ////        .Select(x => new { Object = x, Value = predicate(x) })
+        ////        .FirstOrDefault();
+
+        ////    // compare against all others, replacing the accumulator with the greater value
+        ////    // tie goes to last object found
+        ////    return items
+        ////            .Select(x => new { Object = x, Value = predicate(x) })
+        ////            .Aggregate(seed, (acc, x) => acc.Value.CompareTo(x.Value) > 0 ? acc : x).Object;
+        ////}
+
+        private static IEnumerable<T> ShuffleIterator<T>(this IEnumerable<T> items, Random rng)
         {
-            if (!sequence.Any())
-            {
-                return null;
-            }
-
-            // get the first object with its predicate value
-            var seed = sequence.Select(x => new { Object = x, Value = predicate(x) }).FirstOrDefault();
-
-            // compare against all others, replacing the accumulator with the lesser value
-            // tie goes to first object found
-            return sequence
-                .Select(x => new { Object = x, Value = predicate(x) })
-                .Aggregate(seed, (acc, x) => acc.Value.CompareTo(x.Value) <= 0 ? acc : x).Object;
-        }
-
-        public static T ObjectWithMax<T, TResult>(this IEnumerable<T> sequence, Func<T, TResult> predicate)
-            where T : class
-            where TResult : IComparable
-        {
-            if (!sequence.Any())
-            {
-                return null;
-            }
-
-            // get the first object with its predicate value
-            var seed = sequence
-                .Select(x => new { Object = x, Value = predicate(x) })
-                .FirstOrDefault();
-
-            // compare against all others, replacing the accumulator with the greater value
-            // tie goes to last object found
-            return sequence
-                    .Select(x => new { Object = x, Value = predicate(x) })
-                    .Aggregate(seed, (acc, x) => acc.Value.CompareTo(x.Value) > 0 ? acc : x).Object;
-        }
-
-        private static IEnumerable<T> ShuffleIterator<T>(this IEnumerable<T> source, Random rng)
-        {
-            var buffer = source.ToList();
+            var buffer = items.ToList();
             for (int i = 0; i < buffer.Count; i++)
             {
                 int j = rng.Next(i, buffer.Count);


modified business rule for enviroment creation

--- Sources/Web/CommandHandlers/CreateEnviromentBusinessRule.cs
+++ Sources/Web/CommandHandlers/CreateEnviromentBusinessRule.cs
@@ -11,12 +11,6 @@

         public override IEnumerable<string> Validate(CreateEnviroment command)
         {
-            if (command.CurrentUserId == Guid.Empty)
-            {
-                yield return "Only authorized users can create an enviroment";
-                yield break;
-            }
-
             var user = ReadContext.Query<UserDto>().SingleOrDefault(x => x.Id == command.CurrentUserId.ToString());

             if (user == null)
@@ -27,7 +21,7 @@

             if (!user.Administrator)
             {
-                yield return "Only an administrator can create enviroments";
+                yield return "Only an administrator can create an enviroment";
                 yield break;
             }


Refactorización de InterstitialManager para evitar duplicidades.

--- EasyGoogleMobileAds/Scripts/Classes/InterstitialManager.cs
+++ EasyGoogleMobileAds/Scripts/Classes/InterstitialManager.cs
@@ -48,27 +48,20 @@
 		this.childDirectedTreatment = childDirectedTreatment;
 	}

-	private Interstitial CreateInterstitial(string adUnitID){
-		return new Interstitial (adUnitID, useEmulatorAsATestDevice, testDeviceIDs, keywords, gender, childDirectedTreatment);
-	}
-
 	public void PrepareInterstitial(string adUnitID){
-		if(!interstitials.ContainsKey(adUnitID)){
-			interstitials [adUnitID] = CreateInterstitial(adUnitID);
-			if(firstKey==null) firstKey = adUnitID;
-		}
+		PrepareInterstitial(adUnitID, adUnitID);
 	}

 	public void PrepareInterstitial(string adUnitID, object key){
 		if(!interstitials.ContainsKey(key)){
-			interstitials[key] = CreateInterstitial(adUnitID);
+			interstitials[key] = new Interstitial (adUnitID, useEmulatorAsATestDevice, testDeviceIDs, keywords, gender, childDirectedTreatment);
 			if(firstKey==null) firstKey = key;
 		}
 	}

 	public void ShowInterstitial(){
 		if (firstKey != null) {
-			interstitials[firstKey].Show();
+			ShowInterstitial(firstKey);
 		}
 	}


Conflict fix

Conflict fix

--- BeerViewer/Forms/Controls/ExpeditionBar.cs
+++ BeerViewer/Forms/Controls/ExpeditionBar.cs
@@ -62,7 +62,6 @@
 				var expedition = this.Fleet.Expedition;
 				var progress = expedition.Progress;

-<<<<<<< HEAD
 				if (expedition.IsInExecution && progress.Maximum > 0)
 				{
 					g.FillRectangle(Constants.brushActiveFace, this.ClientBound);
@@ -71,15 +70,6 @@
 						Constants.brushBlueAccent,
 						new Rectangle(0, 0, this.ClientBound.Width * progress.Current / progress.Maximum, this.ClientBound.Height)
 					);
-					/*
-					g.DrawString(
-						string.Format("[{0}] {1}", expedition.Id, expedition.RemainingText),
-						new Font(Constants.fontDefault.FontFamily, 8),
-						Brushes.White,
-						new Point(this.ClientBound.Width / 2, -1),
-						new StringFormat { Alignment = StringAlignment.Center }
-					);
-					*/
 					this.DrawBitmapNumber(
 						g,
 						string.Format("[{0}] {1}", expedition.Id, expedition.RemainingText),
@@ -90,24 +80,6 @@
 				else
 				{
 					g.FillRectangle(Constants.brushHoverFace, this.ClientBound);
-=======
-						g.FillRectangle(
-							Constants.brushBlueAccent,
-							new Rectangle(0, 0, this.ClientBound.Width * progress.Current / progress.Maximum, this.ClientBound.Height)
-						);
-						g.DrawString(
-							string.Format("[{0}] {1}", expedition.Id, expedition.RemainingText),
-							Constants.fontSmall,
-							Brushes.White,
-							new Point(this.ClientBound.Width / 2, -1),
-							new StringFormat { Alignment = StringAlignment.Center }
-						);
-					}
-					else
-					{
-						g.FillRectangle(Constants.brushHoverFace, this.ClientBound);
-					}
->>>>>>> f8ec3fc9bb783c87a2a6b44ffe6a028601d34eca
 				}
 			}
 		}


update

update

--- TaskCoordinatorTest/SharedTypes/Shared/DbConnectionScope.cs
+++ TaskCoordinatorTest/SharedTypes/Shared/DbConnectionScope.cs
@@ -54,12 +54,12 @@
 #if TEST
         //For Testing Purposes
         public static int GetScopeStoreCount() {
-            return _scopeStore.Count;
+            return __scopeStore.Count;
         }
 #endif

         #region class fields
-        private static ConcurrentDictionary<Guid, DbConnectionScope> _scopeStore = new ConcurrentDictionary<Guid, DbConnectionScope>();
+        private static ConcurrentDictionary<Guid, WeakReference<DbConnectionScope>> __scopeStore = new ConcurrentDictionary<Guid, WeakReference<DbConnectionScope>>();

         private static DbConnectionScope __currentScope
         {
@@ -69,9 +69,15 @@
                 if (res != null)
                 {
                     Guid scopeID = (Guid)res;
+                    WeakReference<DbConnectionScope> wref;
                     DbConnectionScope scope;
-                    if (_scopeStore.TryGetValue(scopeID, out scope))
-                        return scope;
+                    if (__scopeStore.TryGetValue(scopeID, out wref))
+                    {
+                        if (wref.TryGetTarget(out scope))
+                            return scope;
+                        else
+                            return null;
+                    }
                     else
                     {
                         return null;
@@ -141,8 +147,10 @@
                 //  __currentScope last, to make sure the thread static only holds validly set up objects
                 _outerScope = __currentScope;
                 __currentScope = this;
-                if (_scopeStore.TryAdd(this.UNIQUE_ID, this))
+                if (__scopeStore.TryAdd(this.UNIQUE_ID, new WeakReference<DbConnectionScope>(this)))
+                {
                     _isDisposed = false;
+                }
             }
         }

@@ -151,21 +159,12 @@
             Dispose(false);
         }

-        /// <summary>
-        /// Shut down this instance.  Disposes all connections it holds and restores the outer scope.
-        /// </summary>
         public void Dispose()
         {
             Dispose(true);
             GC.SuppressFinalize(this);
         }

-        /// <summary>
-        /// Get the connection associated with this key.
-        /// </summary>
-        /// <param name="connectionString">Key to use for lookup</param>
-        /// <param name="connection">Associated connection</param>
-        /// <returns>True if connection found, false otherwise</returns>
         public bool TryGetConnection(string connectionString, out DbConnection connection)
         {
             bool found = false;
@@ -202,14 +201,6 @@
             return result;
         }

-        /// <summary>
-        /// This method gets the connection using the connection string as a key.  If no connection is
-        /// associated with the string, the connection factory is used to create the connection.
-        /// Finally, if the resulting connection is in the closed state, it is opened.
-        /// </summary>
-        /// <param name="factory">Factory to use to create connection if it is not already present</param>
-        /// <param name="connectionString">Connection string to use</param>
-        /// <returns>Connection in open state</returns>
         public DbConnection GetOpenConnection(DbProviderFactory factory, string connectionString)
         {
             DbConnection result = this.GetConnection(factory, connectionString);
@@ -220,14 +211,6 @@
             return result;
         }

-        /// <summary>
-        /// This method gets the connection using the connection string as a key.  If no connection is
-        /// associated with the string, the connection factory is used to create the connection.
-        /// Finally, if the resulting connection is in the closed state, it is opened.
-        /// </summary>
-        /// <param name="factory">Factory to use to create connection if it is not already present</param>
-        /// <param name="connectionString">Connection string to use</param>
-        /// <returns>Connection in open state</returns>
         public async Task<DbConnection> GetOpenConnectionAsync(DbProviderFactory factory, string connectionString)
         {
             DbConnection result = this.GetConnection(factory, connectionString);
@@ -243,7 +226,6 @@
                 return _isDisposed;
             }
         }
-
 #endregion

 #region private methods and properties
@@ -271,26 +253,27 @@
                     {
                         outerScope = outerScope._outerScope;
                     }
+
                     try
                     {
-                        DbConnectionScope tmp;
-                        _scopeStore.TryRemove(this.UNIQUE_ID, out tmp);
+                        WeakReference<DbConnectionScope> tmp;
+                        __scopeStore.TryRemove(this.UNIQUE_ID, out tmp);
                         __currentScope = outerScope;
                     }
                     finally
                     {
                         _isDisposed = true;
-
-                        var connections = _connections.Values.ToArray();
-                        _connections.Clear();
-                        _connections = null;
-
-                        // Lastly, clean up the connections we own
-                        foreach (DbConnection connection in connections)
+                        if (_connections != null)
                         {
-                            if (connection.State != ConnectionState.Closed)
+                            var connections = _connections.Values.ToArray();
+                            _connections.Clear();
+                            _connections = null;
+                            foreach (DbConnection connection in connections)
                             {
-                                connection.Dispose();
+                                if (connection.State != ConnectionState.Closed)
+                                {
+                                    connection.Dispose();
+                                }
                             }
                         }
                     }
@@ -298,12 +281,11 @@
             }
             else
             {
-                DbConnectionScope tmp;
-                _scopeStore.TryRemove(this.UNIQUE_ID, out tmp);
+                WeakReference<DbConnectionScope> tmp;
+                __scopeStore.TryRemove(this.UNIQUE_ID, out tmp);
                 _isDisposed = true;
             }
         }
         #endregion
-
     }
 }


Fixed Dependency Resolver checks for new GenericServices signitures

--- Tests/UnitTests/Group03ServiceLayer/Test11AutoFacModules.cs
+++ Tests/UnitTests/Group03ServiceLayer/Test11AutoFacModules.cs
@@ -140,42 +140,8 @@
             //ATTEMPT & VERIFY
             using (var lifetimeScope = container.BeginLifetimeScope())
             {
-                var service = lifetimeScope.Resolve<IListService<Post>>();
-                var posts = service.GetList().ToList();
-                posts.Count.ShouldEqual(3);
-            }
-        }
-
-        [Test]
-        public void Test17SetupServiceLayerViaDtoGenericsOk()
-        {
-            //SETUP
-            var builder = new ContainerBuilder();
-            builder.RegisterModule(new ServiceLayerModule());
-            var container = builder.Build();
-
-            //ATTEMPT & VERIFY
-            using (var lifetimeScope = container.BeginLifetimeScope())
-            {
-                var instance = lifetimeScope.Resolve<IUpdateService<Post, DetailPostDto>>();
-                Assert.NotNull(instance);
-                (instance is UpdateService<Post, DetailPostDto>).ShouldEqual(true);
-            }
-        }
-
-        [Test]
-        public void Test18UseServiceLayerViaDtoGenerics()
-        {
-            //SETUP
-            var builder = new ContainerBuilder();
-            builder.RegisterModule(new ServiceLayerModule());
-            var container = builder.Build();
-
-            //ATTEMPT & VERIFY
-            using (var lifetimeScope = container.BeginLifetimeScope())
-            {
-                var service = lifetimeScope.Resolve<IListService<Post, DetailPostDto>>();
-                var posts = service.GetList().ToList();
+                var service = lifetimeScope.Resolve<IListService>();
+                var posts = service.GetList<Post>().ToList();
                 posts.Count.ShouldEqual(3);
             }
         }
@@ -229,11 +195,11 @@
                 (example1 is ScheduleSearcherAsync).ShouldEqual(true);

                 //ServiceLayer - complex
-                var service1 = lifetimeScope.Resolve<IListService<Post>>();
-                var service2 = lifetimeScope.Resolve<IListService<Post>>();
+                var service1 = lifetimeScope.Resolve<IListService>();
+                var service2 = lifetimeScope.Resolve<IListService>();
                 Assert.NotNull(service1);
                 Assert.AreNotSame(service1, service2);                       //check transient
-                (service1 is ListService<Post>).ShouldEqual(true);
+                (service1 is ListService).ShouldEqual(true);
             }
         }
     }


Adding thread-safe APIs for various GLTFProperty extension registration needs. (#308)

--- GLTFSerialization/GLTFSerialization/Schema/GLTFProperty.cs
+++ GLTFSerialization/GLTFSerialization/Schema/GLTFProperty.cs
@@ -8,15 +8,54 @@
 {
 	public class GLTFProperty
 	{
-		private static Dictionary<string, ExtensionFactory> _extensionRegistry = new Dictionary<string, ExtensionFactory>();
+		private static Dictionary<string, ExtensionFactory> _extensionRegistry = new Dictionary<string, ExtensionFactory>()
+		{
+			{ ExtTextureTransformExtensionFactory.EXTENSION_NAME, new ExtTextureTransformExtensionFactory() },
+			{ KHR_materials_pbrSpecularGlossinessExtensionFactory.EXTENSION_NAME, new KHR_materials_pbrSpecularGlossinessExtensionFactory() },
+      { MSFT_LODExtensionFactory.EXTENSION_NAME, new MSFT_LODExtensionFactory() }
+		};
 		private static DefaultExtensionFactory _defaultExtensionFactory = new DefaultExtensionFactory();
-		private static KHR_materials_pbrSpecularGlossinessExtensionFactory _KHRExtensionFactory = new KHR_materials_pbrSpecularGlossinessExtensionFactory();
-		private static ExtTextureTransformExtensionFactory _TexTransformFactory = new ExtTextureTransformExtensionFactory();
-		private static MSFT_LODExtensionFactory _LodFactory = new MSFT_LODExtensionFactory();
+
+		public static bool IsExtensionRegistered(string extensionName)
+		{
+			lock (_extensionRegistry)
+			{
+				return _extensionRegistry.ContainsKey(extensionName);
+			}
+		}

 		public static void RegisterExtension(ExtensionFactory extensionFactory)
 		{
-			_extensionRegistry.Add(extensionFactory.ExtensionName, extensionFactory);
+			lock (_extensionRegistry)
+			{
+				_extensionRegistry[extensionFactory.ExtensionName] = extensionFactory;
+			}
+		}
+
+		public static ExtensionFactory TryGetExtension(string extensionName)
+		{
+			lock (_extensionRegistry)
+			{
+				ExtensionFactory result;
+				if (_extensionRegistry.TryGetValue(extensionName, out result))
+				{
+					return result;
+				}
+				return null;
+			}
+		}
+
+		public static bool TryRegisterExtension(ExtensionFactory extensionFactory)
+		{
+			lock (_extensionRegistry)
+			{
+				if (_extensionRegistry.ContainsKey(extensionFactory.ExtensionName))
+				{
+					return false;
+				}
+				_extensionRegistry.Add(extensionFactory.ExtensionName, extensionFactory);
+				return true;
+			}
 		}

 		public Dictionary<string, IExtension> Extensions;
@@ -111,7 +150,7 @@
 				}
 			}
 		}
-
+
 		private Dictionary<string, IExtension> DeserializeExtensions(GLTFRoot root, JsonReader reader)
 		{
 			if (reader.Read() && reader.TokenType != JsonToken.StartObject)
@@ -121,38 +160,27 @@

 			JObject extensions = (JObject)JToken.ReadFrom(reader);
 			var extensionsCollection = new Dictionary<string, IExtension>();
-
-			foreach(JToken child in extensions.Children())
+
+			foreach (JToken child in extensions.Children())
 			{
 				if (child.Type != JTokenType.Property)
 				{
 					throw new GLTFParseException("Children token of extensions should be properties");
 				}

-				JProperty childAsJProperty = (JProperty) child;
+				JProperty childAsJProperty = (JProperty)child;
 				string extensionName = childAsJProperty.Name;
 				ExtensionFactory extensionFactory;
-
-				if (_extensionRegistry.TryGetValue(extensionName, out extensionFactory))
-				{
-					extensionsCollection.Add(extensionName, extensionFactory.Deserialize(root, childAsJProperty));
-				}
-				else if (extensionName.Equals(KHR_materials_pbrSpecularGlossinessExtensionFactory.EXTENSION_NAME))
-				{
-					extensionsCollection.Add(extensionName, _KHRExtensionFactory.Deserialize(root, childAsJProperty));
-				}
-				else if (extensionName.Equals(ExtTextureTransformExtensionFactory.EXTENSION_NAME))
-				{
-					extensionsCollection.Add(extensionName, _TexTransformFactory.Deserialize(root, childAsJProperty));
-				}
-				else if (extensionName.Equals(MSFT_LODExtensionFactory.EXTENSION_NAME))
-				{
-					extensionsCollection.Add(extensionName, _LodFactory.Deserialize(root, childAsJProperty));
-				}
-				else
-				{
-					extensionsCollection.Add(extensionName, _defaultExtensionFactory.Deserialize(root, childAsJProperty));
-				}
+
+				lock (_extensionRegistry)
+				{
+					if (!_extensionRegistry.TryGetValue(extensionName, out extensionFactory))
+					{
+						extensionFactory = _defaultExtensionFactory;
+					}
+				}
+
+				extensionsCollection.Add(extensionName, extensionFactory.Deserialize(root, childAsJProperty));
 			}

 			return extensionsCollection;
@@ -172,7 +200,7 @@
 				writer.WriteEndObject();
 			}

-			if(Extras != null)
+			if (Extras != null)
 			{
 				writer.WritePropertyName("extras");
 				Extras.WriteTo(writer);


improve test case of OnManaCostChanged

improve test case of OnManaCostChanged

--- HearthStone/HearthStone.Library.Test/CardRecordUnitTest.cs
+++ HearthStone/HearthStone.Library.Test/CardRecordUnitTest.cs
@@ -394,14 +394,16 @@
         [TestMethod]
         public void OnManaCostChangedTestMethod1()
         {
-            bool isManaCostChanged = false;
+            int manaCostChangedCount = 0;
             TestCardRecord test = new TestCardRecord();
             test.OnManaCostChanged += (CardRecord card) =>
             {
-                isManaCostChanged = true;
+                manaCostChangedCount++;
             };
             test.ManaCost = 1;
-            Assert.IsTrue(isManaCostChanged, "OnManaCostChanged is not invoked when ManaCost changed");
+            Assert.IsTrue(manaCostChangedCount == 1, "OnManaCostChanged is not invoked when ManaCost changed");
+            test.ManaCost = 0;
+            Assert.IsTrue(manaCostChangedCount == 2, "OnManaCostChanged is not invoked when ManaCost changed");
         }
     }
 }


Fix bug DNN-5157: use TryParse to get the current page param.

--- Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs
+++ Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs
@@ -572,9 +572,16 @@
             CurrentPage = 1;
             if (Request.QueryString["CurrentPage"] != null)
             {
-                CurrentPage = Convert.ToInt32(Request.QueryString["CurrentPage"]);
-                if (CurrentPage <= 0)
+                var currentPage = 0;
+                if (int.TryParse(Request.QueryString["CurrentPage"], out currentPage)
+                    && currentPage > 0)
+                {
+                    CurrentPage = currentPage;
+                }
+                else
+                {
                     CurrentPage = 1;
+                }
             }

             cboRoles.SelectedIndexChanged += cboRoles_SelectedIndexChanged;


Inner while loop added to main method

Inner while loop added to main method

--- CerberusMinesweeper/CerberusMinesweeper.cs
+++ CerberusMinesweeper/CerberusMinesweeper.cs
@@ -4,7 +4,7 @@
 using Timer = System.Timers.Timer;

 class CerberusMinesweeper
-    {
+{
     /// <summary>
     /// Prints a message on a given position
     /// </summary>
@@ -231,7 +231,6 @@
         return count;
     }

-
     /// <summary>
     /// Fills the cells around the mines with the right numbers
     /// </summary>
@@ -278,7 +277,7 @@
         }

     static void Main()
-        {
+    {
         //// main loop - exit only after negative answer in AskForNewGame() method

         //// new game start
@@ -290,24 +289,26 @@
         Console.WriteLine("Random board:");
         DebugPrintBoard(board);

-        //// start of current game loop
-        //PrintBoard();
-        //PrintMinesLeft();
-        //PrintTimeElapsed();
-        Timer myTimer = new Timer();
-        myTimer.Elapsed += new ElapsedEventHandler(PrintTimeElapsed);
-        myTimer.Enabled = true;
-        myTimer.Interval = 1000;
-        myTimer.AutoReset = true;
         while (true)
         {
-            ;
-        }
-        // catch movement and clicks
-
-        //// game end
-        //WriteEndGameMessage();
-        //WriteHighScore();
-        //AskForNewGame();
-        }
-    }+            //PrintBoard();
+            //PrintMinesLeft();
+            //PrintTimeElapsed();
+            Timer myTimer = new Timer();
+            myTimer.Elapsed += new ElapsedEventHandler(PrintTimeElapsed);
+            myTimer.Enabled = true;
+            myTimer.Interval = 1000;
+            myTimer.AutoReset = true;
+            while (true)
+            {
+                ;
+            }
+            // catch movement and clicks
+
+            //// game end
+            //WriteEndGameMessage();
+            //WriteHighScore();
+            //AskForNewGame();
+        }
+    }
+}


Delete LoziAnimationCollection.cs

Delete LoziAnimationCollection.cs

--- LoziExporter/Exporter/Animation/LoziAnimationCollection.cs
+++ LoziExporter/Exporter/Animation/LoziAnimationCollection.cs
@@ -1,61 +0,0 @@
-using UnityEngine;
-using UnityEditor;
-using System.Collections;
-using System.Collections.Generic;
-using UniThreeD;
-
-namespace Lozi
-{
-	public class LoziAnimationCollection
-	{
-		private List<LoziAnimation> animationObjects;
-
-		public LoziAnimationCollection (GameObject obj)
-		{
-			animationObjects = new List<LoziAnimation>();
-
-			foreach(Animation animation in obj.GetComponentsInChildren<Animation>())
-			{
-				animationObjects.Add(new LoziAnimation(animation.gameObject));
-			}
-		}
-
-		public LoziAnimation getAnimationByGameObject(GameObject obj)
-		{
-			foreach(LoziAnimation animation in animationObjects)
-			{
-				if(animation.animationObject == obj)
-				{
-					return animation;
-				}
-			}
-			return null;
-		}
-		private bool canAddInArray(Mesh mesh)
-		{
-			foreach(LoziAnimation threeAnimation in animationObjects)
-			{
-				//if(threeAnimation.isSameMesh(mesh))
-				//{
-				//	return false;
-				//}
-			}
-			return true;
-		}
-
-		public List<Dictionary<string,object>> animationsDictionary
-		{
-			get
-			{
-				List<Dictionary<string,object>> arr = new List<Dictionary<string, object>>();
-				for(int num = 0; num < animationObjects.Count; num++)
-				{
-					Debug.Log(animationObjects[num].animationsDictionary);
-				}
-
-				return animationObjects[0].animationsDictionary;
-			}
-		}
-	}
-}
-


Add missing else qualifier

Add missing else qualifier

- Issue MatterHackers/MCCentral#5192
DetailedPrintState oscillates between modes
- Issue MatterHackers/MCCentral#5179
Many independent heating tasks started

--- MatterControlLib/PrinterCommunication/PrinterConnection.cs
+++ MatterControlLib/PrinterCommunication/PrinterConnection.cs
@@ -2354,7 +2354,7 @@
 				timeSinceStartedPrint.Stop();
 				DetailedPrintingState = DetailedPrintingState.HeatingT0;
 			}
-			if (waitForTempStream?.HeatingT1 ?? false)
+			else if (waitForTempStream?.HeatingT1 ?? false)
 			{
 				// don't time the heating extruder operation
 				timeSinceStartedPrint.Stop();


missing commit

missing commit

--- Commons/Collections/IReadOnlyProperties.cs
+++ Commons/Collections/IReadOnlyProperties.cs
@@ -98,6 +98,15 @@

         #endregion

+        #region LabelKey
+
+        /// <summary>
+        /// The property key of the label.
+        /// </summary>
+        TKey LabelKey { get; }
+
+        #endregion
+
         #region DescriptionKey

         /// <summary>


fix (?) potential exception when reporting the piracy to bot log

--- CompatBot/Utils/DiscordClientExtensions.cs
+++ CompatBot/Utils/DiscordClientExtensions.cs
@@ -134,12 +134,20 @@
             }
             if (string.IsNullOrEmpty(content))
                 content = "🤔 something fishy is going on here, there was no message or attachment";
-            var author = client.GetMember(message.Author);
+            DiscordMember author = null;
+            try
+            {
+                author = client.GetMember(message.Author);
+            }
+            catch (Exception e)
+            {
+                client.DebugLogger.LogMessage(LogLevel.Warning, "", $"Failed to get the member info for user {message.Author.Id} ({message.Author.Username}): {e}", DateTime.Now);
+            }
             var result = new DiscordEmbedBuilder
                 {
                     Title = infraction,
                     Color = GetColor(severity),
-                }.AddField("Violator", GetMentionWithNickname(author), true)
+                }.AddField("Violator", author == null ? message.Author.Mention : GetMentionWithNickname(author), true)
                 .AddField("Channel", message.Channel.Mention, true)
                 .AddField("Time (UTC)", message.CreationTimestamp.ToString("yyyy-MM-dd HH:mm:ss"), true)
                 .AddField("Content of the offending item", content);


Fix issue where ratio was always returning "1"

--- Components/TemplateHelpers/Images/Ratio.cs
+++ Components/TemplateHelpers/Images/Ratio.cs
@@ -10,7 +10,7 @@
         public int Height { get; private set; }
         public float AsFloat
         {
-            get { return (float)Width / (float)Height); }
+            get { return (float)Width / (float)Height; }
         }

         public Ratio(string ratioString)


Just some formatting.

Just some formatting.

--- backend/src/Squidex/Config/Web/WebExtensions.cs
+++ backend/src/Squidex/Config/Web/WebExtensions.cs
@@ -109,33 +109,35 @@

         public static void UseSquidexForwardingRules(this IApplicationBuilder app, IConfiguration config)
         {
+            app.UseForwardedHeaders(GetForwardingOptions(config));
+
+            app.UseMiddleware<EnforceHttpsMiddleware>();
+            app.UseMiddleware<CleanupHostMiddleware>();
+        }
+
+        private static ForwardedHeadersOptions GetForwardingOptions(IConfiguration config)
+        {
             var urlsOptions = config.GetSection("urls").Get<UrlsOptions>();
-            var forwardedHeadersOptions = new ForwardedHeadersOptions();

             if (!string.IsNullOrWhiteSpace(urlsOptions.BaseUrl) && urlsOptions.EnableXForwardedHost)
             {
-                forwardedHeadersOptions = new ForwardedHeadersOptions()
+                return new ForwardedHeadersOptions()
                 {
+                    AllowedHosts = new List<string> { new Uri(urlsOptions.BaseUrl).Host },
                     ForwardedHeaders = ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost,
-                    AllowedHosts = new List<string>() { new Uri(urlsOptions.BaseUrl).Host },
                     ForwardLimit = null,
                     RequireHeaderSymmetry = false
                 };
             }
             else
             {
-                forwardedHeadersOptions = new ForwardedHeadersOptions()
+                return new ForwardedHeadersOptions()
                 {
                     ForwardedHeaders = ForwardedHeaders.XForwardedProto,
                     ForwardLimit = null,
                     RequireHeaderSymmetry = false
                 };
             }
-
-            app.UseForwardedHeaders(forwardedHeadersOptions);
-
-            app.UseMiddleware<EnforceHttpsMiddleware>();
-            app.UseMiddleware<CleanupHostMiddleware>();
         }
     }
 }


Add simple AssetManager

Add simple AssetManager

--- DataConverters3D/Object3D/AssetObject3D.cs
+++ DataConverters3D/Object3D/AssetObject3D.cs
@@ -41,22 +41,13 @@
 		string AssetID { get; set; }

 		Task<Stream> LoadAsset(CancellationToken cancellationToken, Action<double, string> progress);
-
-		//Task StoreAsset(string filePath, CancellationToken cancellationToken, Action<double, string> progress);
-
-		//Task StoreAsset(Stream stream, CancellationToken cancellationToken, Action<double, string> progress);
 	}

 	public interface IAssetManager
 	{
-		//Task AcquireAsset(IAssetObject assetObject);
 		Task<Stream> LoadAsset(IAssetObject assetObject, CancellationToken cancellationToken, Action<double, string> progress);

 		Task AcquireAsset(string sha1PlusExtension, CancellationToken cancellationToken, Action<double, string> progress);
-
-		//Task StoreAsset(IAssetObject assetObject, Stream stream, CancellationToken cancellationToken, Action<double, string> progress);
-
-		//Task StoreAsset(IAssetObject assetObject, string filePath, CancellationToken cancellationToken, Action<double, string> progress);

 		Task StoreAsset(IAssetObject assetObject, CancellationToken cancellationToken, Action<double, string> progress);

@@ -91,15 +82,40 @@
 		{
 			return AssetManager.LoadAsset(this, cancellationToken, progress);
 		}
+	}

-		//public Task StoreAsset(string filePath, CancellationToken cancellationToken, Action<double, string> progress)
-		//{
-		//	return AssetManager.StoreAsset(this, filePath, cancellationToken, progress);
-		//}
+	public class MockAssetManager : IAssetManager
+	{
+		public Task AcquireAsset(string sha1PlusExtension, CancellationToken cancellationToken, Action<double, string> progress)
+		{
+			return Task.CompletedTask;
+		}

-		//public Task StoreAsset(Stream stream, CancellationToken cancellationToken, Action<double, string> progress)
-		//{
-		//	return AssetManager.StoreAsset(this, stream, cancellationToken, progress);
-		//}
+		public Task<Stream> LoadAsset(IAssetObject assetObject, CancellationToken cancellationToken, Action<double, string> progress)
+		{
+			return Task.FromResult<Stream>(null);
+		}
+
+		public Task StoreAsset(IAssetObject assetObject, CancellationToken cancellationToken, Action<double, string> progress)
+		{
+			return Task.CompletedTask;
+		}
+
+		public Task<string> StoreFile(string filePath, CancellationToken cancellationToken, Action<double, string> progress)
+		{
+			string sha1 = Object3D.ComputeSHA1(filePath);
+			string assetPath = Path.Combine(Object3D.AssetsPath, sha1 + ".stl");
+			if (!File.Exists(assetPath))
+			{
+				File.Copy(filePath, assetPath);
+			}
+
+			return Task.FromResult(Path.GetFileName(assetPath));
+		}
+
+		public Task<string> StoreMcx(IObject3D object3D)
+		{
+			return Task.FromResult<string>(null);
+		}
 	}
 }


Added friendly message to install EqualizerAPO if it isn't installed already.

--- equalizerapo_and_zune/Program.cs
+++ equalizerapo_and_zune/Program.cs
@@ -15,7 +15,10 @@
         static void Main()
         {
             // check that the Equalizer APO program is installed
-            File.GetEqualizerAPOPath();
+            if (!VerifyRequisiteProgramsInstalled())
+            {
+                return;
+            }

             // reset the filter upon exiting the program
             Application.ApplicationExit += ApplicationEnd;
@@ -30,5 +33,29 @@
         {
             equalizerapo_api.UnsetEqualizer();
         }
+
+        private static bool VerifyRequisiteProgramsInstalled()
+        {
+            try
+            {
+                File.GetEqualizerAPOPath();
+            }
+            catch (System.IO.FileNotFoundException e)
+            {
+                string message = "The application can't be opened. Requisite applications must first be installed.\n\n" +
+                    "\"" + e.Message + "\"" +
+                    "\n\nWould you like to go to this website now?";
+                string caption = "Unable to start EqualizerAPO and Zune";
+                DialogResult result =
+                    MessageBox.Show(message, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
+                if (result == DialogResult.OK)
+                {
+                    System.Diagnostics.Process.Start(
+                        "http://sourceforge.net/projects/equalizerapo/");
+                }
+                return false;
+            }
+            return true;
+        }
     }
 }


Fixed a few bugs in Save tests

Fixed a few bugs in Save tests

--- DocCode/Client/DocCode.Client/SaveTests.cs
+++ DocCode/Client/DocCode.Client/SaveTests.cs
@@ -345,7 +345,8 @@
             * Concurrent save throws exceptions by default
             *********************************************************/
             var todo = entityManager.CreateEntity<TodoItem>();
-            todo.Description = "Todo Number 1";
+            var uniqueDescription1 = DateTime.Now.ToString();
+            todo.Description = uniqueDescription1;

             Task saveTask1 = null;
             Task saveTask2 = null;
@@ -355,7 +356,7 @@
             try {
                 saveTask1 = entityManager.SaveChanges();        // Shold succeed
                 saveTask2 = entityManager.SaveChanges();        // Should throw
-                //Assert.Fail("SaveChanges() call while another is pending should throw by default");
+                Assert.Fail("By default, SaveChanges() call while another is pending should throw");
             }
             catch (Exception e) {
                 var message = "Success: Second SaveChanges() threw exception: " + e.Message;
@@ -363,7 +364,7 @@
             }
             await Task.WhenAll(saveTask1, saveTask2);

-            var todos1 = await new EntityQuery<TodoItem>().Where(td => td.Description == "Todo Number 1").Execute(entityManager);
+            var todos1 = await new EntityQuery<TodoItem>().Where(td => td.Description == uniqueDescription1).Execute(entityManager);
             var count1 = todos1.Count();
             Assert.AreEqual(1, count1, "After disallowed concurrent save, there should be only one entity in databse");

@@ -374,7 +375,8 @@
             * DON'T USE THIS FEATURE UNLESS YOU KNOW WHY
             *********************************************************/
             var todo2 = entityManager.CreateEntity<TodoItem>();
-            todo2.Description = "Todo Number 2";
+            var uniqueDescription2 = DateTime.Now.ToString();
+            todo2.Description = uniqueDescription2;
             var options = new SaveOptions(null, null, true, null);

             try {
@@ -386,7 +388,7 @@
                 Assert.Fail(message);
             }
             await Task.WhenAll(saveTask1, saveTask2);
-            var todos2 = await new EntityQuery<TodoItem>().Where(td => td.Description == "Todo Number 2").Execute(entityManager);
+            var todos2 = await new EntityQuery<TodoItem>().Where(td => td.Description == uniqueDescription2).Execute(entityManager);
             var count2 = todos2.Count();
             Assert.AreEqual(2, count2, "After concurrent save, there should be two entities in databse");

@@ -396,11 +398,13 @@
             * as if two different users saved concurrently
             *********************************************************/
             var todo3 = entityManager.CreateEntity<TodoItem>();
-            todo.Description = "Todo Number 3";
+            var uniqueDescription3 = DateTime.Now.ToString();
+            todo3.Description = uniqueDescription3;

             var entityManager2 = await TestFns.NewEm(_todosServiceName);
             var todo4 = entityManager2.CreateEntity<TodoItem>();
-            todo.Description = "Todo Number 4";
+            var uniqueDescription4 = DateTime.Now.ToString();
+            todo4.Description = uniqueDescription4;

             try {
                 saveTask1 = entityManager.SaveChanges();        // Shold succeed
@@ -412,8 +416,8 @@
             }

             await Task.WhenAll(saveTask1, saveTask2);
-            var todos3 = await new EntityQuery<TodoItem>().Where(td => td.Description == "Todo Number 3").Execute(entityManager);
-            var todos4 = await new EntityQuery<TodoItem>().Where(td => td.Description == "Todo Number 4").Execute(entityManager);
+            var todos3 = await new EntityQuery<TodoItem>().Where(td => td.Description == uniqueDescription3).Execute(entityManager);
+            var todos4 = await new EntityQuery<TodoItem>().Where(td => td.Description == uniqueDescription4).Execute(entityManager);
             Assert.IsTrue(todos3.Count() == 1 && todos4.Count() == 1, "After concurrent save from separate entity managers, both entities should be in database");
         }

@@ -433,16 +437,16 @@

             try {
             var todo1 = entityManager.CreateEntity<TodoItem>();
-            todo1.Description = "Todo 1";
+            todo1.Description = DateTime.Now.ToString(); ;
             saveTask1 = entityManager.SaveChanges();

             var todo2 = entityManager.CreateEntity<TodoItem>();
-            todo2.Description = "Todo 2";
-            saveTask1 = entityManager.SaveChanges();
+            todo2.Description = DateTime.Now.ToString(); ;
+            saveTask2 = entityManager.SaveChanges();

             var todo3 = entityManager.CreateEntity<TodoItem>();
-            todo2.Description = "Todo 3";
-            saveTask1 = entityManager.SaveChanges();
+            todo3.Description = DateTime.Now.ToString(); ;
+            saveTask3 = entityManager.SaveChanges();
             } catch (Exception e) {
                 Assert.Fail("With save queueing enabled, concurrent SaveChanges() calls should not fail with message: " + e.Message);
             }


dated to track a change

dated to track a change

--- DotNetAppSqlDb/Views/Shared/_Layout.cshtml
+++ DotNetAppSqlDb/Views/Shared/_Layout.cshtml
@@ -16,7 +16,7 @@

                 </button>
-                @Html.ActionLink("My TodoList App update", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
+                @Html.ActionLink("My TodoList App 3:04 PM 3/24/2017", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })


adding snippet-start and end tags

adding snippet-start and end tags

--- dotnet/example_code/DirectoryService/DirectoryServicePortTest.cs
+++ dotnet/example_code/DirectoryService/DirectoryServicePortTest.cs
@@ -8,6 +8,7 @@
 //snippet-sourcetype:[full-example]
 //snippet-sourcedate:[]
 //snippet-sourceauthor:[AWS]
+//snippet-start:[directoryservice.java.directory_service_port_test.complete]
 /*
    Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -284,5 +285,5 @@
         }
     }
 }
-
-
+//snippet-end:[directoryservice.java.directory_service_port_test.complete]
+


Disable LiveTrading Stockplots

Disable LiveTrading Stockplots

- For performance and resource consumption, stockplots will only be
enabled for debug mode

--- Engine/Results/LiveTradingResultHandler.cs
+++ Engine/Results/LiveTradingResultHandler.cs
@@ -21,6 +21,7 @@
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using QuantConnect.Configuration;
 using QuantConnect.Data.Market;
 using QuantConnect.Interfaces;
 using QuantConnect.Lean.Engine.Alphas;
@@ -63,6 +64,7 @@
         private DateTime _nextSample;
         private IApi _api;
         private readonly CancellationTokenSource _cancellationTokenSource;
+        private readonly bool _debugMode;

         /// <summary>
         /// Live packet messaging queue. Queue the messages here and send when the result queue is ready.
@@ -112,6 +114,7 @@
             ResamplePeriod = TimeSpan.FromSeconds(2);
             NotificationPeriod = TimeSpan.FromSeconds(1);
             SetNextStatusUpdate();
+            _debugMode = Config.GetBool("debug-mode");
         }

         /// <summary>
@@ -668,7 +671,9 @@
         {
             // don't send stockplots for internal feeds
             Security security;
-            if (Algorithm.Securities.TryGetValue(symbol, out security) && !security.IsInternalFeed() && value > 0)
+            if (_debugMode
+                && Algorithm.Securities.TryGetValue(symbol, out security)
+                && !security.IsInternalFeed() && value > 0)
             {
                 var now = DateTime.UtcNow.ConvertFromUtc(security.Exchange.TimeZone);
                 if (security.Exchange.Hours.IsOpen(now, security.IsExtendedMarketHours))


deprecated scoped dependency resolver

deprecated scoped dependency resolver

--- Extensions/Mvc/ScopedDependencyResolver.cs
+++ Extensions/Mvc/ScopedDependencyResolver.cs
@@ -10,6 +10,7 @@
     /// <summary>
     /// Requires DotNetStarter.Web and Microsoft.AspNet.Mvc packages
     /// </summary>
+    [Obsolete("Please use NullableMvcDependencyResolver instead!")]
     public class ScopedDependencyResolver : IDependencyResolver
     {
         ILocator _Locator;


EngineVersion update

EngineVersion update

--- Ghpr.NUnit/Extensions/GhprEventListener.cs
+++ Ghpr.NUnit/Extensions/GhprEventListener.cs
@@ -6,7 +6,7 @@

 namespace Ghpr.NUnit.Extensions
 {
-    [Extension(Description = "Test Reporter Extension", EngineVersion = "3.4")]
+    [Extension(Description = "Test Reporter Extension", EngineVersion = "3.5")]
     public class GhprEventListener : ITestEventListener
     {
         public GhprEventListener()


Fixed crashing bug caused by clearing the rainbow matchup for a block that is not "relevant" according to the current filter.

--- Glyssen/Dialogs/BlockNavigatorViewModel.cs
+++ Glyssen/Dialogs/BlockNavigatorViewModel.cs
@@ -746,7 +746,10 @@
 			if (m_currentRefBlockMatchups == null)
 				return;
 			BlockGroupingStyle = BlockGroupingType.Quote;
+			var relevant = IsCurrentBlockRelevant;
 			m_currentRefBlockMatchups = null;
+			if (!relevant)
+				m_temporarilyIncludedBlock = GetCurrentBlockIndices();
 			if (CurrentBlockMatchupChanged != null)
 				CurrentBlockMatchupChanged(this, new EventArgs());
 		}