Fix formatting

Fix formatting

--- src/Clients/Windows/AvatarConverter.cs
+++ src/Clients/Windows/AvatarConverter.cs
@@ -37,32 +37,31 @@
 using System;
 using System.Globalization;
 using System.IO;
-using System.Linq;
 using System.Threading.Tasks;
 using System.Windows.Data;
 using System.Windows.Media.Imaging;

 namespace Gablarski.Clients.Windows
 {
-    internal class AvatarConverter
-        : IValueConverter
-    {
-        public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            string uriOrEmail = value as string;
+	internal class AvatarConverter
+		: IValueConverter
+	{
+		public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			string uriOrEmail = value as string;

-	        Task<BitmapSource> task = AvatarCache.GetAvatarAsync (uriOrEmail).ContinueWith (t => {
-		        var stream = new MemoryStream (t.Result);
+			Task<BitmapSource> task = AvatarCache.GetAvatarAsync (uriOrEmail).ContinueWith (t => {
+				var stream = new MemoryStream (t.Result);
 				var decoder = BitmapDecoder.Create (stream, BitmapCreateOptions.None, BitmapCacheOption.None);
-		        return (BitmapSource)decoder.Frames[0];
-	        });
+				return (BitmapSource)decoder.Frames[0];
+			});

-	        return new AsyncValue<BitmapSource> (task, null);
-        }
+			return new AsyncValue<BitmapSource> (task, null);
+		}

-        public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw new NotImplementedException();
-        }
-    }
+		public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			throw new NotImplementedException();
+		}
+	}
 }


Fix error

Fix error

--- src/Core2D.FileWriter.Dxf/DxfWriter.cs
+++ src/Core2D.FileWriter.Dxf/DxfWriter.cs
@@ -1,5 +1,6 @@
 // Copyright (c) Wiesław Šoltés. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
+using System;
 using Core2D.Containers;
 using Core2D.Interfaces;
 using Core2D.Renderer;


Missing bracket

Missing bracket

--- src/DotVVM.Compiler/OwinInitializer.cs
+++ src/DotVVM.Compiler/OwinInitializer.cs
@@ -19,7 +19,7 @@
                 .Where(t => typeof(IDotvvmStartup).IsAssignableFrom(t) && t.GetConstructor(Type.EmptyTypes) != null).ToArray();

             if (dotvvmStartups.Length == 0) throw new Exception("Could not find any implementation of IDotvvmStartup.");
-            if (dotvvmStartups.Length > 1) throw new Exception($"Found more than one implementation of IDotvvmStartup ({string.Join(", ", dotvvmStartups.Select(s => s.Name)) }).";
+            if (dotvvmStartups.Length > 1) throw new Exception($"Found more than one implementation of IDotvvmStartup ({string.Join(", ", dotvvmStartups.Select(s => s.Name)) }).");

             var startup = (IDotvvmStartup)Activator.CreateInstance(dotvvmStartups[0]);
             var config = OwinExtensions.CreateConfiguration(rootPath);


Update EditContainerView.cs

Update EditContainerView.cs

--- src/Draw2D/Editor/EditContainerView.cs
+++ src/Draw2D/Editor/EditContainerView.cs
@@ -730,6 +730,7 @@
         {
             var group = new GroupShape()
             {
+                Title = "Group",
                 Points = new ObservableCollection<PointShape>(),
                 Shapes = new ObservableCollection<BaseShape>()
             };


feat: Clear styles when pasting copied content to editor #155

--- src/Fan.Web/Pages/Admin/Compose.cshtml
+++ src/Fan.Web/Pages/Admin/Compose.cshtml
@@ -197,6 +197,24 @@
     <script src="~/lib/quill-image-resize-module/image-resize.min.js"></script>
     <script>
         let Delta = Quill.import('delta');
+        const Clipboard = Quill.import('modules/clipboard');
+        class PlainClipboard extends Clipboard {
+            onPaste(e) {
+                e.preventDefault()
+                const range = this.quill.getSelection()
+                const text = e.clipboardData.getData('text/plain')
+                const delta = new Delta()
+                    .retain(range.index)
+                    .delete(range.length)
+                    .insert(text)
+                const index = text.length + range.index
+                const length = 0
+                this.quill.updateContents(delta, 'silent')
+                this.quill.setSelection(index, length, 'silent')
+                this.quill.scrollIntoView()
+            }
+        }
+        Quill.register('modules/clipboard', PlainClipboard, true);

         var app = new Vue({
             el: '#app',


Add a DebuggerDisplay attribute to GrowableArray

--- src/FastSerialization/GrowableArray.cs
+++ src/FastSerialization/GrowableArray.cs
@@ -14,7 +14,8 @@
     /// an int which represents the logical charCount. It is a struct to avoid an extra pointer dereference, so this
     /// is really meant to be embedded in other structures.
     /// </summary>
-#if GROWABLEARRAY_PUBLIC
+    [DebuggerDisplay("Count = {Count}")]
+#if GROWABLEARRAY_PUBLIC
     public
 #endif
     struct GrowableArray<T>


Update AlainAssaf.cs

Update AlainAssaf.cs

--- src/Firehose.Web/Authors/AlainAssaf.cs
+++ src/Firehose.Web/Authors/AlainAssaf.cs
@@ -9,10 +9,10 @@
     public class AlainAssaf : IAmACommunityMember
     {
         public string FirstName => "Alain";
-        public string LastName => "Alain";
+        public string LastName => "Assaf";
         public string ShortBioOrTagLine => "EUC Engineer/Architect | Citrix CTA | CCE-V Certified | CUGC Leader | PowerShell Fanatic";
         public string StateOrRegion => "North Carolina, USA";
-        public string EmailAddress => "";
+        public string EmailAddress => "alainassaf@outlook.com";
         public string TwitterHandle => "alainassaf";
         public string GitHubHandle => "alainassaf";
         public string GravatarHash => "55e3ac1ac8ca9129cc9e138a158b07bb";


Added null-guard on `branch` in `FindCommitBranchWasBranchedFrom()`.

--- src/GitVersionCore/LibGitExtensions.cs
+++ src/GitVersionCore/LibGitExtensions.cs
@@ -6,6 +6,9 @@
     using System.Linq;
     using System.Text;
     using GitVersion.Helpers;
+
+    using JetBrains.Annotations;
+
     using LibGit2Sharp;

     static class LibGitExtensions
@@ -44,8 +47,14 @@
             .FirstOrDefault();
         }

-        public static Commit FindCommitBranchWasBranchedFrom(this Branch branch, IRepository repository, params Branch[] excludedBranches)
-        {
+
+        public static Commit FindCommitBranchWasBranchedFrom([NotNull] this Branch branch, IRepository repository, params Branch[] excludedBranches)
+        {
+            if (branch == null)
+            {
+                throw new ArgumentNullException("branch");
+            }
+
             using (Logger.IndentLog("Finding branch source"))
             {
                 var otherBranches = repository.Branches.Except(excludedBranches).Where(b => IsSameBranch(branch, b)).ToList();


C#: public fields with getters/setters cannot be marked readonly

MSVC would fail with the following error:
error CS0106: The modifier 'readonly' is not valid for this item

Reported-by: Raluca Chis <cb4a91cc582c251db05a6dd47f3fb924f14a5e47@analog.com>
Signed-off-by: Paul Cercueil <a027184a55211cd23e3f3094f1fdc728df5e0500@crapouillou.net>

--- bindings/csharp/Device.cs
+++ bindings/csharp/Device.cs
@@ -208,7 +208,7 @@
         public readonly string name;

         /// The label of this device.
-        public readonly string label { get; private set; }
+        public string label { get; private set; }

         /// A <c>list</c> of all the attributes that this device has.
         public readonly List<Attr> attrs;


Fixing warnings

Fixing warnings

--- GuiAutomation/AutomationRunner.cs
+++ GuiAutomation/AutomationRunner.cs
@@ -62,7 +62,12 @@

 		public static double UpDelaySeconds { get; set; } = .2;

-		public enum InputType { Native, Simulated, SimulatedDrawMouse };
+		public enum InputType
+		{
+			Native,
+			Simulated,
+			SimulatedDrawMouse
+		}

 		public static IInputMethod OverrideInputSystem = null;

@@ -70,7 +75,7 @@
 		public AutomationRunner(IInputMethod inputMethod, bool drawSimulatedMouse, string imageDirectory = "")
 		{
 #if !__ANDROID__
-			if(OverrideInputSystem != null)
+			if (OverrideInputSystem != null)
 			{
 				inputSystem = OverrideInputSystem;
 			}
@@ -78,7 +83,7 @@
 			{
 				inputSystem = new AggInputMethods(this, drawSimulatedMouse);
 				// TODO: Consider how to set this and if needed
-				//HookWindowsInputAndSendToWidget.EnableInputHook = false;
+				// HookWindowsInputAndSendToWidget.EnableInputHook = false;
 			}
 #else
 				inputSystem = new AggInputMethods(this, drawSimulatedMouse);
@@ -86,9 +91,19 @@
 			this.imageDirectory = imageDirectory;
 		}

-		public enum ClickOrigin { LowerLeft, Center };
-
-		public enum InterpolationType { LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT };
+		public enum ClickOrigin
+		{
+			LowerLeft,
+			Center
+		}
+
+		public enum InterpolationType
+		{
+			LINEAR,
+			EASE_IN,
+			EASE_OUT,
+			EASE_IN_OUT
+		}

 		public Point2D CurrentMousePosition()
 		{
@@ -143,7 +158,7 @@
 			return false;
 		}

-		int GetMouseDown(MouseButtons mouseButtons)
+		private int GetMouseDown(MouseButtons mouseButtons)
 		{
 			switch (mouseButtons)
 			{
@@ -164,7 +179,7 @@
 			}
 		}

-		int GetMouseUp(MouseButtons mouseButtons)
+		private int GetMouseUp(MouseButtons mouseButtons)
 		{
 			switch (mouseButtons)
 			{
@@ -573,7 +588,7 @@
 			return GetWidgetByName(widgetName, out containingWindow, out _, secondsToWait, searchRegion, onlyVisible);
 		}

-		GuiWidget lastWidget = null;
+		private GuiWidget lastWidget = null;

 		private void SetTarget(GuiWidget guiWidget)
 		{


Some bugfixes for null-values in HTTP requests

--- Hermod/HTTP/Server/JSONWrapper.cs
+++ Hermod/HTTP/Server/JSONWrapper.cs
@@ -266,23 +266,26 @@

             }

-            if (!Parser(JSONToken.ToString(), out Value))
-            {
-
-                HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                    HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                    Server          = DefaultServerName,
-                    Date            = DateTime.Now,
-                    ContentType     = HTTPContentType.JSON_UTF8,
-                    Content         = JSONObject.Create(
-                                          new JProperty("description", "Unknown " + PropertyDescription + "!")
-                                      ).ToUTF8Bytes()
-                };
-
-                Value = default(T);
-
-                return false;
-
+            if (JSONToken != null)
+            {
+                if (!Parser(JSONToken.ToString(), out Value))
+                {
+
+                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                        Server          = DefaultServerName,
+                        Date            = DateTime.Now,
+                        ContentType     = HTTPContentType.JSON_UTF8,
+                        Content         = JSONObject.Create(
+                                              new JProperty("description", "Unknown " + PropertyDescription + "!")
+                                          ).ToUTF8Bytes()
+                    };
+
+                    Value = default(T);
+
+                    return false;
+
+                }
             }

             HTTPResponse  = null;
@@ -326,23 +329,26 @@

             }

-            if (!Enum.TryParse<TEnum>(JSONToken.ToString(), true, out Value))
-            {
-
-                HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                    HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                    Server          = DefaultServerName,
-                    Date            = DateTime.Now,
-                    ContentType     = HTTPContentType.JSON_UTF8,
-                    Content         = JSONObject.Create(
-                                          new JProperty("description",  "Unknown " + PropertyDescription + "!")
-                                      ).ToUTF8Bytes()
-                };
-
-                Value = default(TEnum);
-
-                return false;
-
+            if (JSONToken != null)
+            {
+                if (!Enum.TryParse<TEnum>(JSONToken.ToString(), true, out Value))
+                {
+
+                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                        Server          = DefaultServerName,
+                        Date            = DateTime.Now,
+                        ContentType     = HTTPContentType.JSON_UTF8,
+                        Content         = JSONObject.Create(
+                                              new JProperty("description",  "Unknown " + PropertyDescription + "!")
+                                          ).ToUTF8Bytes()
+                    };
+
+                    Value = default(TEnum);
+
+                    return false;
+
+                }
             }

             HTTPResponse  = null;
@@ -366,23 +372,26 @@

             Object JSONToken = null;

-            if (!TryGetValue(PropertyName, out JSONToken))
-            {
-
-                HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                    HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                    Server          = DefaultServerName,
-                    Date            = DateTime.Now,
-                    ContentType     = HTTPContentType.JSON_UTF8,
-                    Content         = JSONObject.Create(
-                                          new JProperty("description",  "Missing JSON property '" + PropertyName + "'!")
-                                      ).ToUTF8Bytes()
-                };
-
-                Text = String.Empty;
-
-                return false;
-
+            if (JSONToken != null)
+            {
+                if (!TryGetValue(PropertyName, out JSONToken))
+                {
+
+                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                        Server          = DefaultServerName,
+                        Date            = DateTime.Now,
+                        ContentType     = HTTPContentType.JSON_UTF8,
+                        Content         = JSONObject.Create(
+                                              new JProperty("description",  "Missing JSON property '" + PropertyName + "'!")
+                                          ).ToUTF8Bytes()
+                    };
+
+                    Text = String.Empty;
+
+                    return false;
+
+                }
             }

             Text          = JSONToken.ToString();
@@ -431,7 +440,12 @@

             }

-            Text          = JSONToken.ToString();
+            if (JSONToken != null)
+                Text = JSONToken.ToString();
+
+            else
+                Text = String.Empty;
+
             HTTPResponse  = null;

             return true;
@@ -457,26 +471,31 @@
             if (TryGetValue(PropertyName, out JSONToken))
             {

-                try
-                {
-
-                    Timestamp = (DateTime) JSONToken;
-
-                }
-                catch (Exception)
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description", "Invalid timestamp '" + JSONToken.ToString() + "'!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    return false;
+                if (JSONToken != null)
+                {
+
+                    try
+                    {
+
+                        Timestamp = (DateTime) JSONToken;
+
+                    }
+                    catch (Exception)
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description", "Invalid timestamp '" + JSONToken.ToString() + "'!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        return false;
+
+                    }

                 }

@@ -528,26 +547,31 @@
             if (FirstMatchingPropertyName != null)
             {

-                try
-                {
-
-                    Timestamp = (DateTime) JSONToken;
-
-                }
-                catch (Exception)
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description", "Invalid timestamp '" + JSONToken.ToString() + "'!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    return false;
+                if (JSONToken != null)
+                {
+
+                    try
+                    {
+
+                        Timestamp = (DateTime) JSONToken;
+
+                    }
+                    catch (Exception)
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description", "Invalid timestamp '" + JSONToken.ToString() + "'!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        return false;
+
+                    }

                 }

@@ -595,23 +619,28 @@
             if (TryGetValue(PropertyName, out JSONToken))
             {

-                var JSONValue = JSONToken.ToString();
-
-                if (JSONValue != null && !Parser(JSONValue, out Value))
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description",  "Unknown " + PropertyDescription + "!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    Value = default(T);
-                    return false;
+                if (JSONToken != null)
+                {
+
+                    var JSONValue = JSONToken.ToString();
+
+                    if (JSONValue != null && !Parser(JSONValue, out Value))
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description",  "Unknown " + PropertyDescription + "!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        Value = default(T);
+                        return false;
+
+                    }

                 }

@@ -643,23 +672,28 @@
             if (TryGetValue(PropertyName, out JSONToken))
             {

-                var JSONValue = JSONToken.ToString();
-
-                if (JSONValue != null && !Enum.TryParse<TEnum>(JSONValue, true, out Value))
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description", "Unknown " + PropertyDescription + "!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    Value = default(TEnum);
-                    return false;
+                if (JSONToken != null)
+                {
+
+                    var JSONValue = JSONToken.ToString();
+
+                    if (JSONValue != null && !Enum.TryParse<TEnum>(JSONValue, true, out Value))
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description", "Unknown " + PropertyDescription + "!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        Value = default(TEnum);
+                        return false;
+
+                    }

                 }

@@ -688,7 +722,10 @@

             if (TryGetValue(PropertyName, out JSONToken))
             {
-                Text = JSONToken.ToString();
+                if (JSONToken != null)
+                {
+                    Text = JSONToken.ToString();
+                }
             }

             HTTPResponse  = null;
@@ -718,7 +755,10 @@

             if (FirstMatchingPropertyName != null)
             {
-                Text = JSONToken.ToString();
+                if (JSONToken != null)
+                {
+                    Text = JSONToken.ToString();
+                }
             }

             Text          = null;
@@ -745,30 +785,33 @@

             if (TryGetValue(PropertyName, out JSONToken))
             {
-
-                try
-                {
-
-                    Timestamp = (DateTime) JSONToken;
-
-                }
-                catch (Exception)
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description",  "Invalid timestamp '" + JSONToken.ToString() + "'!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    return false;
-
-                }
-
+                if (JSONToken != null)
+                {
+
+                    try
+                    {
+
+                        Timestamp = (DateTime) JSONToken;
+
+                    }
+                    catch (Exception)
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description",  "Invalid timestamp '" + JSONToken.ToString() + "'!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        return false;
+
+                    }
+
+                }
             }

             HTTPResponse  = null;
@@ -800,29 +843,33 @@
             if (FirstMatchingPropertyName != null)
             {

-                try
-                {
-
-                    Timestamp = (DateTime) JSONToken;
-
-                }
-                catch (Exception)
-                {
-
-                    HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
-                        HTTPStatusCode  = HTTPStatusCode.BadRequest,
-                        Server          = DefaultServerName,
-                        Date            = DateTime.Now,
-                        ContentType     = HTTPContentType.JSON_UTF8,
-                        Content         = JSONObject.Create(
-                                              new JProperty("description",  "Invalid timestamp '" + JSONToken.ToString() + "'!")
-                                          ).ToUTF8Bytes()
-                    };
-
-                    return false;
-
-                }
-
+                if (JSONToken != null)
+                {
+
+                    try
+                    {
+
+                        Timestamp = (DateTime) JSONToken;
+
+                    }
+                    catch (Exception)
+                    {
+
+                        HTTPResponse = new HTTPResponseBuilder(HTTPRequest) {
+                            HTTPStatusCode  = HTTPStatusCode.BadRequest,
+                            Server          = DefaultServerName,
+                            Date            = DateTime.Now,
+                            ContentType     = HTTPContentType.JSON_UTF8,
+                            Content         = JSONObject.Create(
+                                                  new JProperty("description",  "Invalid timestamp '" + JSONToken.ToString() + "'!")
+                                              ).ToUTF8Bytes()
+                        };
+
+                        return false;
+
+                    }
+
+                }
             }

             HTTPResponse  = null;
@@ -849,16 +896,26 @@

             }

-            if (!Double.TryParse(JSONToken.ToString(), NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out Value))
-            {
-
-                Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
-
-                Value     = DefaultValue;
-                HTTPResp  = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
-
+            if (JSONToken != null)
+            {
+                if (!Double.TryParse(JSONToken.ToString(), NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out Value))
+                {
+
+                    Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
+
+                    Value = DefaultValue;
+                    HTTPResp = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
+
+                    return false;
+
+                }
+            }
+
+            else
+            {
+                Value    = 0;
+                HTTPResp = null;
                 return false;
-
             }

             HTTPResp = null;
@@ -881,20 +938,30 @@

             }

-            try
-            {
-                Value = (DateTime)JSONToken;
-            }
-            catch (Exception)
-            {
-
-                Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
-
-                Value     = DefaultValue;
-                HTTPResp  = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
-
+            if (JSONToken != null)
+            {
+                try
+                {
+                    Value = (DateTime)JSONToken;
+                }
+                catch (Exception)
+                {
+
+                    Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
+
+                    Value = DefaultValue;
+                    HTTPResp = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
+
+                    return false;
+
+                }
+            }
+
+            else
+            {
+                Value = DateTime.Now;
+                HTTPResp = null;
                 return false;
-
             }

             HTTPResp = null;
@@ -917,15 +984,28 @@

             }

-            Value = JSONToken.ToString();
-            if (Value.IsNullOrEmpty())
-            {
-
-                Value     = DefaultValue;
-                HTTPResp  = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
-
+            if (JSONToken != null)
+            {
+
+                Value = JSONToken.ToString();
+
+                if (Value.IsNullOrEmpty())
+                {
+
+                    Value = DefaultValue;
+                    HTTPResp = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
+
+                    return false;
+
+                }
+
+            }
+
+            else
+            {
+                Value = DefaultValue;
+                HTTPResp = null;
                 return false;
-
             }

             HTTPResp = null;


Added button to refresh page in the modal

--- src/PQDashboard/Views/Main/Home.cshtml
+++ src/PQDashboard/Views/Main/Home.cshtml
@@ -261,6 +261,7 @@

+                    Settings are automatically udpated after a change is made.  To see results the browser must be refreshed. Click below to refresh immediately or not.

Tabs

@@ -275,7 +276,7 @@
                                                     @setting.Value

-                                                    <input id="tab@(setting.ID)" type="checkbox" @(setting.Enabled ? "checked='checked'" : "") />
+                                                    <input id="tab@(setting.ID)" type="checkbox" @(setting.Enabled ? "checked='checked'" : "")/>

                                         }
@@ -286,7 +287,7 @@

                         @foreach (DashSettings setting in dashSettings)
                         {
-                            if (setting.Name == "DashTab" && setting.Enabled && (new List<string>() { "#tabsOverviewToday", "#tabsOverviewYesterday", "#tabsTrendingData", "#tabsModbusData", "#tabsHistorianData" }).IndexOf(setting.Value) < 0)
+                            if (setting.Name == "DashTab" && setting.Enabled && (new List<string>() {"#tabsOverviewToday", "#tabsOverviewYesterday", "#tabsTrendingData", "#tabsModbusData", "#tabsHistorianData"}).IndexOf(setting.Value) < 0)
                             {

@@ -294,11 +295,11 @@

-

-                                                    Field
-                                                    Color
-                                                    Enabled
-

+

+                                                Field
+                                                Color
+                                                Enabled
+

                                             @foreach (DashSettings innerSetting in dashSettings)
                                             {
@@ -311,12 +312,12 @@

                                                             @{
                                                                 DashSettings color = dashSettings.Where(x => x.Name.Contains(setting.Value.Substring(5) + "ChartColors") && string.Compare(innerSetting.Value, x.Value.Split(',')[0]) == 0)?.FirstOrDefault();
-
+
                                                             }
                                                             <input id="color@(color.ID)"class="jscolor" value="@(color?.Value.Split(',')?[1] ?? "")"/>

-                                                            <input id="enable@(innerSetting.ID)"type="checkbox" @(innerSetting.Enabled ? "checked='checked'" : "") />
+                                                            <input id="enable@(innerSetting.ID)"type="checkbox" @(innerSetting.Enabled ? "checked='checked'" : "")/>

                                                 }
@@ -332,7 +333,7 @@

-                <button type="button" class="btn btn-primary" data-dismiss="modal">Save</button>
+                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="refresh()">Apply Now</button>
                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

@@ -994,6 +995,10 @@
         var popup = window.open("@Html.Raw(Url.Content("~/ChannelDataCompleteness.aspx"))?eventid=" + id, id + "ChannelDataCompleteness");
         return false;
     }
+
+    function refresh(){
+        location.reload();
+    }

     //////////////////////////////////////////////////////////////////////////////////////////////


Add image to Channel

Add image to Channel

--- src/Pioneer.Blog.Service/RssService.cs
+++ src/Pioneer.Blog.Service/RssService.cs
@@ -50,6 +50,12 @@
             channel.Add(new XElement("link", $"{_config.Value.SiteUrl}/rssfeed.xml"));
             channel.Add(new XElement("description", "Chad Ramos at Pioneer Code, a Chicago-based software developer with a strong passion for .NET, C#, The Web, Open Source, Programming and more."));
             channel.Add(new XElement("copyright", $"©{DateTime.Now.Year}  {_config.Value.SiteTitle}"));
+
+            var image = new XElement("image");
+            image.Add(new XElement("url", $"{_config.Value.SiteUrl}/images/icons/mstile-144x144.png"));
+            image.Add(new XElement("link", _config.Value.SiteUrl));
+
+            channel.Add(image);
             return channel;
         }


deposit tests

deposit tests

--- test/NxtTipbot.Tests/SlackHandlerTests.cs
+++ test/NxtTipbot.Tests/SlackHandlerTests.cs
@@ -59,5 +59,34 @@
             slackConnectorMock.Verify(c => c.SendMessage(instantMessage.Id,
                 It.Is<string>(input => input.StartsWith($"Your current balance is {expectedBalance} NXT")), true));
         }
+
+        [Theory]
+        [InlineData("deposit")]
+        [InlineData(" DEPOSIT ")]
+        [InlineData("dEpOsIt ")]
+        public async void DepositShouldCreateAccount(string command)
+        {
+            var account = new NxtAccount{SlackId = this.user.Id};
+            walletRepositoryMock.Setup(r => r.GetAccount(It.IsAny<string>())).ReturnsAsync(null);
+            nxtConnectorMock.Setup(c => c.CreateAccount(It.Is<string>(id => id == this.user.Id))).Returns(account);
+
+            await slackHandler.InstantMessageRecieved(command, user, instantMessage);
+
+            walletRepositoryMock.Verify(r => r.AddAccount(account));
+            slackConnectorMock.Verify(c => c.SendMessage(instantMessage.Id,
+                It.Is<string>(input => input.StartsWith("I have created account")), true));
+        }
+
+        [Fact]
+        public async void DepositShouldReturnAddress()
+        {
+            var account = new NxtAccount{NxtAccountRs = "NXT-123"};
+            walletRepositoryMock.Setup(r => r.GetAccount(It.IsAny<string>())).ReturnsAsync(account);
+
+            await slackHandler.InstantMessageRecieved("deposit", user, instantMessage);
+
+            slackConnectorMock.Verify(c => c.SendMessage(instantMessage.Id,
+                It.Is<string>(input => input.Equals($"You can deposit NXT here: {account.NxtAccountRs}")), true));
+        }
     }
 }


test for balance command

test for balance command

--- test/NxtTipbot.Tests/SlackHandlerTests.cs
+++ test/NxtTipbot.Tests/SlackHandlerTests.cs
@@ -6,24 +6,44 @@
 {
     public class SlackHandlerTests
     {
+        private readonly Mock<INxtConnector> nxtConnectorMock = new Mock<INxtConnector>();
+        private readonly Mock<IWalletRepository> walletRepositoryMock = new Mock<IWalletRepository>();
+        private readonly Mock<ILogger> loggerMock = new Mock<ILogger>();
+        private readonly Mock<ISlackConnector> slackConnectorMock = new Mock<ISlackConnector>();
+        private readonly SlackHandler slackHandler;
+        private readonly InstantMessage instantMessage = new InstantMessage { Id = "Id", UserId = "UserId" };
+        private readonly User user = new User { Id = "UserId", Name = "XunitBot" };
+
+        public SlackHandlerTests()
+        {
+            slackHandler = new SlackHandler(nxtConnectorMock.Object, walletRepositoryMock.Object, loggerMock.Object);
+            slackHandler.SlackConnector = slackConnectorMock.Object;
+        }
+
         [Theory]
         [InlineData("help")]
         [InlineData(" HELP ")]
         [InlineData("hElP ")]
-        public async void SendHelpText(string command)
+        public async void Help(string command)
         {
-            var nxtConnectorMock = new Mock<INxtConnector>();
-            var walletRepositoryMock = new Mock<IWalletRepository>();
-            var loggerMock = new Mock<ILogger>();
-            var slackConnectorMock = new Mock<ISlackConnector>();
-            var slackHandler = new SlackHandler(nxtConnectorMock.Object, walletRepositoryMock.Object, loggerMock.Object);
-            slackHandler.SlackConnector = slackConnectorMock.Object;
-            var instantMessage = new InstantMessage { Id = "Id", UserId = "UserId" };
-
-            await slackHandler.InstantMessageRecieved(command, null, instantMessage);
+            await slackHandler.InstantMessageRecieved(command, user, instantMessage);

             slackConnectorMock.Verify(c => c.SendMessage(instantMessage.Id,
                 It.Is<string>(input => input.StartsWith("*Direct Message Commands*")), true));
         }
+
+        [Theory]
+        [InlineData("balance")]
+        [InlineData(" BALANCE ")]
+        [InlineData("bAlAnCe ")]
+        public async void BalanceShouldReturnNoAccount(string command)
+        {
+            walletRepositoryMock.Setup(r => r.GetAccount(It.IsAny<string>())).ReturnsAsync(null);
+
+            await slackHandler.InstantMessageRecieved(command, user, instantMessage);
+
+            slackConnectorMock.Verify(c => c.SendMessage(instantMessage.Id,
+                It.Is<string>(input => input.StartsWith("You do currently not have an account")), true));
+        }
     }
 }


Fixed wrong sign in AccountState available balance

--- IronSmarkets/Data/AccountState.cs
+++ IronSmarkets/Data/AccountState.cs
@@ -39,7 +39,7 @@
         public decimal Cash { get { return _cash; } }
         public decimal Bonus { get { return _bonus; } }
         public decimal Exposure { get { return _exposure; } }
-        public decimal Available { get { return _cash - _exposure; } }
+        public decimal Available { get { return _cash + _exposure; } }

         private AccountState(
             Uid uid,


End turn on timeout, not on key-up

End turn on timeout, not on key-up

--- bees-in-the-trap/Assets/Scripts/GameController.cs
+++ bees-in-the-trap/Assets/Scripts/GameController.cs
@@ -45,12 +45,12 @@
 	}

 	// Update is called once per frame
-	void Update () {
-		if (Input.GetKeyUp ("b")) {
+	public void Update () {
+		if (bPressTimeStamp > 0f) {
 			if (Time.time - bPressTimeStamp > 0.5f) {
 				EndTurn ();
 				bPressTimeStamp = 0f;
-			} else {
+			} else if ( Input.GetKeyUp("b") ) {
 				Buy ();
 				bPressTimeStamp = 0f;
 			}


#598 Add the Open Folder item to context menu for Sitecore members

--- src/SIM.Tool.Windows/MainWindowData.cs
+++ src/SIM.Tool.Windows/MainWindowData.cs
@@ -1144,7 +1144,7 @@
         new ButtonDefinition { Label = "Copy URL", Image = "/Images/$lg/astrologer.png, SIM.Tool.Windows", Handler = new LoginAdminButton("$(clipboard)") },
       }},
       new ButtonDefinition { Label = "Sitecore Admin", Image = "/Images/$lg/toolbox.png, SIM.Tool.Windows", Handler = new OpenToolboxButton() },
-      new ButtonDefinition { Label = "Open Folder", Image = "/Images/$sm/folder_open.png, SIM.Tool.Windows", Handler = new OpenFolderButton("$(website)") },
+      new ButtonDefinition { Label = "Open Folder", Image = "/Images/$sm/folder_open.png, SIM.Tool.Windows", Handler = new SitecoreMemberOpenFolderButton("$(website)") },
       new ButtonDefinition { Label = "Open Container Folder", Image = "/Images/$sm/folder_open.png, SIM.Tool.Windows", Handler = new OpenContainerFolderButton() },
       new ButtonDefinition { Label = "Open Visual Studio", Image = "/Images/$sm/vs.png, SIM.Tool.Windows", Handler = new OpenVisualStudioButton() },
       new ButtonDefinition { Handler = new OpenWebConfigButton() },


Oops, fix command count in unit-test

Oops, fix command count in unit-test

--- test/WinBeacon.Tests/LeControllerTests.cs
+++ test/WinBeacon.Tests/LeControllerTests.cs
@@ -77,7 +77,7 @@
                 Times.Exactly(1));
             transportMock.Verify(
                 transport => transport.Send(It.IsAny<byte[]>(), It.Is<DataType>(x => x == DataType.Command)),
-                Times.Exactly(6));
+                Times.Exactly(7));
         }

         [Test]


test for #95

test for #95

--- Jil/Serialize/InlineSerializer.cs
+++ Jil/Serialize/InlineSerializer.cs
@@ -3062,7 +3062,10 @@

             using (var enumLoc = Emit.DeclareLocal<ulong>())
             using (var notFirst = Emit.DeclareLocal<bool>())
-            {
+            {
+                Emit.LoadConstant(false);
+                Emit.StoreLocal(notFirst);
+
                 Emit.StoreLocal(enumLoc);       // TextWriter?
                 if (popTextWriter)
                 {


Fixes missing parameter comment

Fixes missing parameter comment

--- code/Scheduler.cs
+++ code/Scheduler.cs
@@ -116,7 +116,7 @@
 		/// <summary>
 		/// Removes a time slot from the list
 		/// </summary>
-		/// <param name="Day"></param>
+		/// <param name="Day">The day for which the time slot is defined</param>
 		public void RemoveTimeSlot(DayOfWeek Day) {
 			TimeSlot slot = GetTimeSlot(Day);


Small chnages in visual editor

Small chnages in visual editor

--- lab4_v2/lab4_v2/Forms/MainForm.Designer.cs
+++ lab4_v2/lab4_v2/Forms/MainForm.Designer.cs
@@ -31,25 +31,26 @@
             this.tabChooser = new System.Windows.Forms.TabControl();
             this.tabPageApps = new System.Windows.Forms.TabPage();
             this.tableLayoutPanelApps = new System.Windows.Forms.TableLayoutPanel();
-            this.listViewApps = new System.Windows.Forms.ListView();
             this.buttonAddApp = new System.Windows.Forms.Button();
             this.buttonEditApp = new System.Windows.Forms.Button();
             this.buttonRemoveApp = new System.Windows.Forms.Button();
             this.buttonRemoveAppApps = new System.Windows.Forms.Button();
             this.tabPageUsers = new System.Windows.Forms.TabPage();
-            this.statusStripSysInfo = new System.Windows.Forms.StatusStrip();
-            this.sysInfoLabel = new System.Windows.Forms.ToolStripStatusLabel();
             this.tableLayoutPanelUsers = new System.Windows.Forms.TableLayoutPanel();
             this.buttonAddUser = new System.Windows.Forms.Button();
             this.buttonEditUser = new System.Windows.Forms.Button();
             this.buttonRmUser = new System.Windows.Forms.Button();
             this.buttonRmAllUsers = new System.Windows.Forms.Button();
+            this.statusStripSysInfo = new System.Windows.Forms.StatusStrip();
+            this.sysInfoLabel = new System.Windows.Forms.ToolStripStatusLabel();
+            this.listBoxUsers = new System.Windows.Forms.ListBox();
+            this.listBoxApps = new System.Windows.Forms.ListBox();
             this.tabChooser.SuspendLayout();
             this.tabPageApps.SuspendLayout();
             this.tableLayoutPanelApps.SuspendLayout();
             this.tabPageUsers.SuspendLayout();
+            this.tableLayoutPanelUsers.SuspendLayout();
             this.statusStripSysInfo.SuspendLayout();
-            this.tableLayoutPanelUsers.SuspendLayout();
             this.SuspendLayout();
             //
             // tabChooser
@@ -59,6 +60,7 @@
             this.tabChooser.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tabChooser.Location = new System.Drawing.Point(0, 0);
             this.tabChooser.MinimumSize = new System.Drawing.Size(400, 150);
+            this.tabChooser.Multiline = true;
             this.tabChooser.Name = "tabChooser";
             this.tabChooser.SelectedIndex = 0;
             this.tabChooser.Size = new System.Drawing.Size(631, 311);
@@ -80,11 +82,11 @@
             this.tableLayoutPanelApps.ColumnCount = 2;
             this.tableLayoutPanelApps.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 118F));
             this.tableLayoutPanelApps.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanelApps.Controls.Add(this.listViewApps, 1, 0);
             this.tableLayoutPanelApps.Controls.Add(this.buttonAddApp, 0, 0);
             this.tableLayoutPanelApps.Controls.Add(this.buttonEditApp, 0, 1);
             this.tableLayoutPanelApps.Controls.Add(this.buttonRemoveApp, 0, 2);
             this.tableLayoutPanelApps.Controls.Add(this.buttonRemoveAppApps, 0, 3);
+            this.tableLayoutPanelApps.Controls.Add(this.listBoxApps, 1, 0);
             this.tableLayoutPanelApps.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tableLayoutPanelApps.Location = new System.Drawing.Point(3, 3);
             this.tableLayoutPanelApps.Name = "tableLayoutPanelApps";
@@ -96,16 +98,6 @@
             this.tableLayoutPanelApps.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
             this.tableLayoutPanelApps.Size = new System.Drawing.Size(617, 279);
             this.tableLayoutPanelApps.TabIndex = 0;
-            //
-            // listViewApps
-            //
-            this.listViewApps.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.listViewApps.Location = new System.Drawing.Point(121, 3);
-            this.listViewApps.Name = "listViewApps";
-            this.tableLayoutPanelApps.SetRowSpan(this.listViewApps, 5);
-            this.listViewApps.Size = new System.Drawing.Size(493, 273);
-            this.listViewApps.TabIndex = 0;
-            this.listViewApps.UseCompatibleStateImageBehavior = false;
             //
             // buttonAddApp
             //
@@ -158,6 +150,68 @@
             this.tabPageUsers.Text = "Users";
             this.tabPageUsers.UseVisualStyleBackColor = true;
             //
+            // tableLayoutPanelUsers
+            //
+            this.tableLayoutPanelUsers.ColumnCount = 2;
+            this.tableLayoutPanelUsers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 118F));
+            this.tableLayoutPanelUsers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanelUsers.Controls.Add(this.buttonAddUser, 0, 0);
+            this.tableLayoutPanelUsers.Controls.Add(this.buttonEditUser, 0, 1);
+            this.tableLayoutPanelUsers.Controls.Add(this.buttonRmUser, 0, 2);
+            this.tableLayoutPanelUsers.Controls.Add(this.buttonRmAllUsers, 0, 3);
+            this.tableLayoutPanelUsers.Controls.Add(this.listBoxUsers, 1, 0);
+            this.tableLayoutPanelUsers.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tableLayoutPanelUsers.Location = new System.Drawing.Point(3, 3);
+            this.tableLayoutPanelUsers.Name = "tableLayoutPanelUsers";
+            this.tableLayoutPanelUsers.RowCount = 5;
+            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
+            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
+            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
+            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
+            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
+            this.tableLayoutPanelUsers.Size = new System.Drawing.Size(617, 279);
+            this.tableLayoutPanelUsers.TabIndex = 0;
+            //
+            // buttonAddUser
+            //
+            this.buttonAddUser.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.buttonAddUser.Location = new System.Drawing.Point(3, 3);
+            this.buttonAddUser.Name = "buttonAddUser";
+            this.buttonAddUser.Size = new System.Drawing.Size(112, 24);
+            this.buttonAddUser.TabIndex = 0;
+            this.buttonAddUser.Text = "Add user";
+            this.buttonAddUser.UseVisualStyleBackColor = true;
+            //
+            // buttonEditUser
+            //
+            this.buttonEditUser.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.buttonEditUser.Location = new System.Drawing.Point(3, 33);
+            this.buttonEditUser.Name = "buttonEditUser";
+            this.buttonEditUser.Size = new System.Drawing.Size(112, 24);
+            this.buttonEditUser.TabIndex = 1;
+            this.buttonEditUser.Text = "Edit user";
+            this.buttonEditUser.UseVisualStyleBackColor = true;
+            //
+            // buttonRmUser
+            //
+            this.buttonRmUser.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.buttonRmUser.Location = new System.Drawing.Point(3, 63);
+            this.buttonRmUser.Name = "buttonRmUser";
+            this.buttonRmUser.Size = new System.Drawing.Size(112, 24);
+            this.buttonRmUser.TabIndex = 2;
+            this.buttonRmUser.Text = "Remove user";
+            this.buttonRmUser.UseVisualStyleBackColor = true;
+            //
+            // buttonRmAllUsers
+            //
+            this.buttonRmAllUsers.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.buttonRmAllUsers.Location = new System.Drawing.Point(3, 93);
+            this.buttonRmAllUsers.Name = "buttonRmAllUsers";
+            this.buttonRmAllUsers.Size = new System.Drawing.Size(112, 24);
+            this.buttonRmAllUsers.TabIndex = 3;
+            this.buttonRmAllUsers.Text = "Remove all users";
+            this.buttonRmAllUsers.UseVisualStyleBackColor = true;
+            //
             // statusStripSysInfo
             //
             this.statusStripSysInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -175,66 +229,25 @@
             this.sysInfoLabel.Size = new System.Drawing.Size(72, 17);
             this.sysInfoLabel.Text = "sysInfoLabel";
             //
-            // tableLayoutPanelUsers
-            //
-            this.tableLayoutPanelUsers.ColumnCount = 2;
-            this.tableLayoutPanelUsers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 118F));
-            this.tableLayoutPanelUsers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanelUsers.Controls.Add(this.buttonAddUser, 0, 0);
-            this.tableLayoutPanelUsers.Controls.Add(this.buttonEditUser, 0, 1);
-            this.tableLayoutPanelUsers.Controls.Add(this.buttonRmUser, 0, 2);
-            this.tableLayoutPanelUsers.Controls.Add(this.buttonRmAllUsers, 0, 3);
-            this.tableLayoutPanelUsers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanelUsers.Location = new System.Drawing.Point(3, 3);
-            this.tableLayoutPanelUsers.Name = "tableLayoutPanelUsers";
-            this.tableLayoutPanelUsers.RowCount = 5;
-            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
-            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
-            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
-            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
-            this.tableLayoutPanelUsers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
-            this.tableLayoutPanelUsers.Size = new System.Drawing.Size(617, 279);
-            this.tableLayoutPanelUsers.TabIndex = 0;
-            //
-            // buttonAddUser
-            //
-            this.buttonAddUser.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.buttonAddUser.Location = new System.Drawing.Point(3, 3);
-            this.buttonAddUser.Name = "buttonAddUser";
-            this.buttonAddUser.Size = new System.Drawing.Size(112, 24);
-            this.buttonAddUser.TabIndex = 0;
-            this.buttonAddUser.Text = "Add user";
-            this.buttonAddUser.UseVisualStyleBackColor = true;
-            //
-            // buttonEditUser
-            //
-            this.buttonEditUser.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.buttonEditUser.Location = new System.Drawing.Point(3, 33);
-            this.buttonEditUser.Name = "buttonEditUser";
-            this.buttonEditUser.Size = new System.Drawing.Size(112, 24);
-            this.buttonEditUser.TabIndex = 1;
-            this.buttonEditUser.Text = "Edit user";
-            this.buttonEditUser.UseVisualStyleBackColor = true;
-            //
-            // buttonRmUser
-            //
-            this.buttonRmUser.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.buttonRmUser.Location = new System.Drawing.Point(3, 63);
-            this.buttonRmUser.Name = "buttonRmUser";
-            this.buttonRmUser.Size = new System.Drawing.Size(112, 24);
-            this.buttonRmUser.TabIndex = 2;
-            this.buttonRmUser.Text = "Remove user";
-            this.buttonRmUser.UseVisualStyleBackColor = true;
-            //
-            // buttonRmAllUsers
-            //
-            this.buttonRmAllUsers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.buttonRmAllUsers.Location = new System.Drawing.Point(3, 93);
-            this.buttonRmAllUsers.Name = "buttonRmAllUsers";
-            this.buttonRmAllUsers.Size = new System.Drawing.Size(112, 24);
-            this.buttonRmAllUsers.TabIndex = 3;
-            this.buttonRmAllUsers.Text = "Remove all users";
-            this.buttonRmAllUsers.UseVisualStyleBackColor = true;
+            // listBoxUsers
+            //
+            this.listBoxUsers.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.listBoxUsers.FormattingEnabled = true;
+            this.listBoxUsers.Location = new System.Drawing.Point(121, 3);
+            this.listBoxUsers.Name = "listBoxUsers";
+            this.tableLayoutPanelUsers.SetRowSpan(this.listBoxUsers, 5);
+            this.listBoxUsers.Size = new System.Drawing.Size(493, 273);
+            this.listBoxUsers.TabIndex = 4;
+            //
+            // listBoxApps
+            //
+            this.listBoxApps.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.listBoxApps.FormattingEnabled = true;
+            this.listBoxApps.Location = new System.Drawing.Point(121, 3);
+            this.listBoxApps.Name = "listBoxApps";
+            this.tableLayoutPanelApps.SetRowSpan(this.listBoxApps, 5);
+            this.listBoxApps.Size = new System.Drawing.Size(493, 273);
+            this.listBoxApps.TabIndex = 5;
             //
             // MainForm
             //
@@ -249,9 +262,9 @@
             this.tabPageApps.ResumeLayout(false);
             this.tableLayoutPanelApps.ResumeLayout(false);
             this.tabPageUsers.ResumeLayout(false);
+            this.tableLayoutPanelUsers.ResumeLayout(false);
             this.statusStripSysInfo.ResumeLayout(false);
             this.statusStripSysInfo.PerformLayout();
-            this.tableLayoutPanelUsers.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();

@@ -265,7 +278,6 @@
         private System.Windows.Forms.StatusStrip statusStripSysInfo;
         private System.Windows.Forms.ToolStripStatusLabel sysInfoLabel;
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanelApps;
-        private System.Windows.Forms.ListView listViewApps;
         private System.Windows.Forms.Button buttonAddApp;
         private System.Windows.Forms.Button buttonEditApp;
         private System.Windows.Forms.Button buttonRemoveApp;
@@ -275,5 +287,7 @@
         private System.Windows.Forms.Button buttonEditUser;
         private System.Windows.Forms.Button buttonRmUser;
         private System.Windows.Forms.Button buttonRmAllUsers;
+        private System.Windows.Forms.ListBox listBoxApps;
+        private System.Windows.Forms.ListBox listBoxUsers;
     }
 }


skip code that depends on sqldbdiff

skip code that depends on sqldbdiff

--- test/DatabaseTester.cs
+++ test/DatabaseTester.cs
@@ -86,6 +86,8 @@
             Assert.IsFalse(source.Compare(copy).IsDiff);

             // get a second opinion
+			// if you ever find your license key
+			return;
             string cmd = string.Format("/c {0}\\SQLDBDiffConsole.exe {1} {2} {0}\\{3}",
                 ConfigHelper.SqlDbDiffPath,
                 "localhost\\SQLEXPRESS " + copy.Name + " NULL NULL Y",
@@ -103,6 +105,7 @@
         }

         [Test()]
+		[Ignore("test won't work without license key for sqldbdiff")]
         public void TestDiffScript() {
             TestHelper.DropDb("TEST_SOURCE");
             TestHelper.DropDb("TEST_COPY");


Additional screen message to show numbering

--- LaunchNumbering/LaunchNumberer.cs
+++ LaunchNumbering/LaunchNumberer.cs
@@ -31,6 +31,7 @@
 		private const string ShowBlocLabel = "bloc-shown";
 		private const string BlocRomanLabel = "bloc-roman";
 		private const string VesselRomanLabel = "vessel-roman";
+		private const float MessageDisplayLength = 5.0f;

 		public override void OnLoad(ConfigNode node)
 		{
@@ -113,7 +114,14 @@

 			if (!string.IsNullOrEmpty(addition))
 			{
-				v.vesselName += addition;
+				var oldName = v.vesselName;
+				var newName = oldName + addition;
+				v.vesselName += newName;
+				ScreenMessages.PostScreenMessage("Launch: " + newName, MessageDisplayLength, ScreenMessageStyle.UPPER_CENTER);
+			}
+			else
+			{
+				ScreenMessages.PostScreenMessage("Initial launch", MessageDisplayLength, ScreenMessageStyle.UPPER_CENTER);
 			}
 		}


(MP3): increased sync search threshold.

(MP3): increased sync search threshold.

--- ArcFormats/AudioMP3.cs
+++ ArcFormats/AudioMP3.cs
@@ -94,7 +94,7 @@
         public override uint     Signature { get { return 0; } }
         public override bool      CanWrite { get { return false; } }

-        const int SyncSearchThreshold = 0x280;
+        const int SyncSearchThreshold = 0x300;

         public override SoundInput TryOpen (IBinaryStream file)
         {


version: Increment patch -> 0.7.1

version: Increment patch -> 0.7.1

--- AssemblyInfo.shared.cs
+++ AssemblyInfo.shared.cs
@@ -9,4 +9,4 @@

 [assembly: AssemblyVersion("0.7.1.0")]
 [assembly: AssemblyFileVersion("0.7.1.0")]
-[assembly: AssemblyInformationalVersion("0.7.1-a")]
+[assembly: AssemblyInformationalVersion("0.7.1")]


Don't print post-archive bytes from the next ROM entry.

--- LibTextPet/IO/ROMEntriesWriter.cs
+++ LibTextPet/IO/ROMEntriesWriter.cs
@@ -122,15 +122,6 @@
 					}
 				}

-				if (this.IncludePostBytesComments && rom != null) {
-					// Write some post-ending bytes.
-					byte[] buffer = new byte[0x10];
-					rom.Position = entry.Offset + entry.Size;
-					int read = rom.Read(buffer, 0, buffer.Length);
-					this.TextWriter.Write("// post: ");
-					this.TextWriter.WriteLine(String.Join(" ", buffer.Take(read).Select(b => b.ToString("X2", CultureInfo.InvariantCulture))));
-				}
-
 				// Write the ROM entry.
 				this.TextWriter.Write("0x");
 				this.TextWriter.Write(entry.Offset.ToString("X6", CultureInfo.InvariantCulture));
@@ -145,6 +136,32 @@
 					this.TextWriter.Write(" // CHECK POINTERS!");
 				}
 				this.TextWriter.WriteLine();
+
+				if (this.IncludePostBytesComments && rom != null) {
+					int toPrint = 0x10;
+					if (i < sorted.Count - 1) {
+						ROMEntry next = sorted[i + 1];
+						int gap = next.Offset - (entry.Offset + entry.Size);
+						if (gap >= 0 && gap < toPrint) {
+							toPrint = gap;
+						}
+					}
+
+					// Write some post-ending bytes.
+					if (toPrint > 0) {
+						byte[] buffer = new byte[toPrint];
+						rom.Position = entry.Offset + entry.Size;
+
+						this.TextWriter.Write("// ");
+						this.TextWriter.Write(rom.Position.ToString("X8", CultureInfo.InvariantCulture));
+						this.TextWriter.Write(new string(' ', 8));
+
+						int read = rom.Read(buffer, 0, buffer.Length);
+						this.TextWriter.WriteLine(String.Join(" ", buffer.Take(read).Select(b => b.ToString("X2", CultureInfo.InvariantCulture))));
+					}
+
+					this.TextWriter.WriteLine();
+				}
 			}

 			this.TextWriter.Flush();


Changed implicit StringTranslation conversion to value, not key

--- Localization/StringTranslation.cs
+++ Localization/StringTranslation.cs
@@ -32,7 +32,7 @@

 		public override string ToString()
 		{
-			return Key;
+			return Value;
 		}

 		public static implicit operator string(StringTranslation st)


[Modify] 2018

[Modify] 2018

--- websocket-sharp/Net/WebSockets/WebSocketContext.cs
+++ websocket-sharp/Net/WebSockets/WebSocketContext.cs
@@ -4,7 +4,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2012-2016 sta.blockhead
+ * Copyright (c) 2012-2018 sta.blockhead
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal


Common: Add ThReplayData.Read(string) and Write(string)

--- Common/ThReplayData.cs
+++ Common/ThReplayData.cs
@@ -137,6 +137,18 @@
         }

         /// <summary>
+        /// Reads from the specified file path.
+        /// </summary>
+        /// <param name="path">A path string of the input file.</param>
+        public void Read(string path)
+        {
+            using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read))
+            {
+                this.Read(stream);
+            }
+        }
+
+        /// <summary>
         /// Writes to the specified stream.
         /// </summary>
         /// <param name="output">An output stream.</param>
@@ -147,6 +159,18 @@
             this.UserInfo0.WriteTo(writer);
             this.UserInfo1.WriteTo(writer);
             writer.Flush();
+        }
+
+        /// <summary>
+        /// Writes to the specified file path.
+        /// </summary>
+        /// <param name="path">A path string of the output file.</param>
+        public void Write(string path)
+        {
+            using (var stream = new FileStream(path, FileMode.Truncate, FileAccess.Write))
+            {
+                this.Write(stream);
+            }
         }

         /// <summary>


Removed duplicated code

Removed duplicated code

--- game/Game.cs
+++ game/Game.cs
@@ -271,28 +271,20 @@
                         this.LevelUpdated = false;
                     }

+                    if (collide.Type == CollideType.HitInPlayer || collide.Type == CollideType.Collide) {
+                        this.AddExplosion(this.Player);
+
+                        this.Player.AddHealth(-1);
+                        if (this.Player.GetHealth() < 1) {
+                            this.GameStatus = GameStatus.End;
+                        }
+                    }
+
                     if (collide.Type == CollideType.HitInPlayer) {
                         this.Bullets.Remove(collide.Bullet);
-                        this.AddExplosion(this.Player);
-
-                        this.Player.AddHealth(-1);
-                        this.Player.SetPosition(new Point(this.Scene.Size.Width / 2, this.Scene.Size.Height / 2));
-
-                        if (this.Player.GetHealth() < 1) {
-                            this.GameStatus = GameStatus.End;
-                        }
                     } else if (collide.Type == CollideType.Collide) {
                         this.AddExplosion(collide.Enemy);
-                        this.AddExplosion(this.Player);
-
                         this.Enemies.Remove(collide.Enemy);
-
-                        this.Player.AddHealth(-1);
-                        this.Player.SetPosition(new Point(this.Scene.Size.Width / 2, this.Scene.Size.Height / 2));
-
-                        if (this.Player.GetHealth() < 1) {
-                            this.GameStatus = GameStatus.End;
-                        }
                     }

                     this.LastTime = ticks;


fixed review comments

fixed review comments

--- tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
+++ tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
@@ -393,7 +393,7 @@
         }

         [Fact]
-        public void Style_Resources_Are_Build()
+        public void Style_Resources_Are_Built()
         {
             var xaml = @"
 <Style xmlns='https://github.com/avaloniaui'
@@ -421,7 +421,7 @@
         }

         [Fact]
-        public void StyleInclude_Is_Build()
+        public void StyleInclude_Is_Built()
         {
             using (UnitTestApplication.Start(TestServices.StyledWindow))
             {
@@ -590,7 +590,7 @@
         }

         [Fact]
-        public void Style_ControlTemplate_Is_Build()
+        public void Style_ControlTemplate_Is_Built()
         {
             var xaml = @"
 <Style xmlns='https://github.com/avaloniaui' Selector='ContentControl'>
@@ -645,7 +645,7 @@
 #else
         [Fact(Skip =
 @"Doesn't work with Portable.xaml, it's working in different creation order -
-Handled in test 'Control_Is_Added_To_Parent_Before_Final_EndEdit'
+Handled in test 'Control_Is_Added_To_Parent_Before_Final_EndInit'
 do we need it?")]
 #endif
         public void Control_Is_Added_To_Parent_Before_Properties_Are_Set()
@@ -672,7 +672,7 @@
         }

         [Fact]
-        public void Control_Is_Added_To_Parent_Before_Final_EndEdit()
+        public void Control_Is_Added_To_Parent_Before_Final_EndInit()
         {
             using (UnitTestApplication.Start(TestServices.StyledWindow))
             {
@@ -696,7 +696,7 @@
         }

         [Fact]
-        public void All_Properties_Are_Set_Before_Final_EndEdit()
+        public void All_Properties_Are_Set_Before_Final_EndInit()
         {
             using (UnitTestApplication.Start(TestServices.StyledWindow))
             {


Added autoconnect feature.

Added autoconnect feature.

--- TestCaseAutomator/Container/PresentationModule.cs
+++ TestCaseAutomator/Container/PresentationModule.cs
@@ -27,7 +27,12 @@
 			builder.RegisterType<MainViewModel>()
                    .ApplySettings((s, vm) => vm.ProjectName = s.TfsProjectName)
 			       .As<MainViewModel, IApplication>()
-				   .SingleInstance();
+				   .SingleInstance()
+                   .OnActivated(c =>
+                   {
+                       if (c.Context.Resolve<ISettings>().AutoConnectOnStartup && c.Instance.CanConnect)
+                           c.Instance.ConnectAsync();
+                   });

 		    builder.RegisterType<ServerManagementViewModel>()
 		           .WithParameter(c => c.Resolve<ISettings>().TfsServers as IEnumerable<Uri>)


byrja a testi

byrja a testi

--- TransApp.Tests/Controllers/VideoControllerTest.cs
+++ TransApp.Tests/Controllers/VideoControllerTest.cs
@@ -1,5 +1,8 @@
 using System;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using TransApp.Models;
+using System.Collections.Generic;
+using TransApp.Controllers;

 namespace TransApp.Tests.Controllers
 {
@@ -7,8 +10,22 @@
     public class UnitTest1
     {
         [TestMethod]
-        public void TestMethod1()
+        public void TestAddingNewVideoInEmptyTable()
         {
+            // Arrange:
+            List<Video> video = new List<Video>();
+            video.Add(new Video
+            {
+                vID = 1,
+                catID = 1,
+                videoName = "Kalli"
+            });
+
+            var mockRepo = new Mocks.MockVideoRepository(video);
+            var controller = new VideoController(mockRepo);
+            // Act:
+
+            // Assert:
         }
     }
 }


CA-184949: Add URL redirect support

CA-184949: Add URL redirect support

Signed-off-by: Cheng Zhang <f157832f2f1df5a7c962d3abb092f6b1ea020882@citrix.com>

--- src/xenguestlib/AutoUpdate.cs
+++ src/xenguestlib/AutoUpdate.cs
@@ -91,6 +91,26 @@

         XenStoreItem downloadURLKey;

+        string getFinalRedirectedUrl(string url)
+        {
+            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+            req.Method = "HEAD";
+            req.AllowAutoRedirect = false;
+            HttpWebResponse myResp = (HttpWebResponse)req.GetResponse();
+            switch (myResp.StatusCode)
+            {
+                case HttpStatusCode.Redirect:
+                case HttpStatusCode.MovedPermanently:
+                case HttpStatusCode.RedirectKeepVerb:
+                case HttpStatusCode.RedirectMethod:
+                    string urlNew = myResp.GetResponseHeader("Location");
+                    wmisession.Log("redirect url from: " + url + " to " + urlNew);
+                    return getFinalRedirectedUrl(urlNew);
+                default:
+                    return url;
+            }
+        }
+
         string getDownloadURL()
         {
             string downloadURL = MSI_URL;
@@ -104,6 +124,8 @@
             }
             catch
             {}
+
+            downloadURL = getFinalRedirectedUrl(downloadURL);
             if (!string.IsNullOrEmpty(downloadURL))
             {
                 if (downloadURL[downloadURL.Length - 1] != '/')
@@ -185,14 +207,14 @@
                 else
                     return null;
             }
-            catch (ArgumentException)
-            {
-                wmisession.Log("Image URL can not be an empty string");
+            catch (ArgumentException exp)
+            {
+                wmisession.Log("Image URL can not be an empty string" + exp.ToString());
                 return null;
             }
-            catch (WebException)
-            {
-                wmisession.Log("Image URL is invalid.");
+            catch (WebException exp)
+            {
+                wmisession.Log("Image URL is invalid." + exp.ToString());
                 return null;
             }
             catch (Exception e)


Fix "ZERO WIDTH NO-BREAK SPACE" issue from https://github.com/HTBox/allReady/pull/564#discussion_r53585841

--- AllReadyApp/Web-App/AllReady/Views/Shared/_Layout.cshtml
+++ AllReadyApp/Web-App/AllReady/Views/Shared/_Layout.cshtml
@@ -1,7 +1,7 @@
 @using AllReady.Controllers
 <!DOCTYPE html>
 <html lang="en">
-<head>
+<head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>@ViewData["Title"] - AllReady</title>
@@ -163,9 +163,9 @@
             tinymce.init({
                 selector: '.wysiwyg',
                 plugins: [
-							"advlist autolink lists link image charmap print preview anchor",
-							"searchreplace visualblocks code fullscreen",
-							"insertdatetime media table contextmenu paste imagetools"
+                            "advlist autolink lists link image charmap print preview anchor",
+                            "searchreplace visualblocks code fullscreen",
+                            "insertdatetime media table contextmenu paste imagetools"
                 ],
                 toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link image",
                 autosave_ask_before_unload: false


Update Program.cs

Update Program.cs

--- Core/Source/Zaibot.ThreadWatchdog.DemoConsole/Program.cs
+++ Core/Source/Zaibot.ThreadWatchdog.DemoConsole/Program.cs
@@ -1,27 +1,3 @@
-//
-// The MIT License (MIT)
-//
-// Copyright (c) 2015 Zaibot Programs
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-//
-
 using System;
 using Zaibot.ThreadWatchdog.Core;
 using Zaibot.ThreadWatchdog.Core.Reporters;
@@ -45,4 +21,4 @@
             }
         }
     }
-}+}


GameManager back to normal

GameManager back to normal

--- Documents/Unity3D/Catcheep/Assets/Scripts/gameManager.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/gameManager.cs
@@ -125,8 +125,7 @@

                 if (taux < 2) taux += 0.065f;
                 int i = Random.Range(-5, 11);
-
-                i = 0;
+
                 switch (i)
                 {
                     case -5:
@@ -207,7 +206,7 @@
     void oneSheepyRandom(int index)
     {
         float edges = edgeOfScreen.x - (sheeps[index].GetComponent<SpriteRenderer>().sprite.bounds.extents).x;
-        float xPosition = edges;//Random.Range(-edges, edges);
+        float xPosition = Random.Range(-edges, edges);
         Vector3 spawnPosition = new Vector3(xPosition, transform.position.y, transform.position.z);
         Instantiate(sheeps[index], spawnPosition, Quaternion.identity);
     }


fixed null ref issue in Command, package list clears when refreshed

--- ExtensionManager/ViewModels/ExtensionBrowserViewModel.cs
+++ ExtensionManager/ViewModels/ExtensionBrowserViewModel.cs
@@ -50,6 +50,7 @@
         public void RefreshPackageList()
         {
             var packages = repository.GetPackages().Where(x => x.Tags.Contains("extension")).ToList();
+            Extensions.Clear();
             Extensions.AddRange(packages);
         }

@@ -91,7 +92,8 @@
         }
         public bool CanExecute(object parameter)
         {
-            return repository.Exists(parameter as string);
+            var s = parameter as string;
+            return s != null && repository.Exists(s);
         }

         public void Execute(object parameter)


Build issue

Build issue

--- GPSLogger.Tests/Controllers/CredentialControllerClass.cs
+++ GPSLogger.Tests/Controllers/CredentialControllerClass.cs
@@ -128,7 +128,7 @@
             [TestMethod]
             public void WorksWithNullAndNopParameters()
             {
-                TestWithNullAndNopConstructorParameters(controller => controller.GetAsync(null).AsTask().Wait());
+                TestWithNullAndNopConstructorParameters(controller => controller.GetAsync(null).Wait());
             }
         }
     }


Don't check update when startup if EnableUpdateNotification is not enabled

--- Grabacr07.KanColleViewer/ViewModels/SettingsViewModel.cs
+++ Grabacr07.KanColleViewer/ViewModels/SettingsViewModel.cs
@@ -804,7 +804,10 @@
 			this._ViewRangeType1 = Settings.Current.KanColleClientSettings.ViewRangeCalcLogic == ViewRangeCalcLogic.Type1;
 			this._ViewRangeType2 = Settings.Current.KanColleClientSettings.ViewRangeCalcLogic == ViewRangeCalcLogic.Type2;

-			this.CheckForUpdates();
+			if (Settings.Current.EnableUpdateNotification)
+			{
+				this.CheckForUpdates();
+			}
 			this.ReloadPlugins();
 		}


Changes to account for slight API change to active directory helper.

--- Helpers.ActiveDirectoryHelpers/ActiveDirectoryHelpers.cs
+++ Helpers.ActiveDirectoryHelpers/ActiveDirectoryHelpers.cs
@@ -55,11 +55,12 @@
             return new List<string>();
         }

-        public static HashSet<DirectoryEntry> SearchForUser(string domain, string search)
+        public static List<DirectoryEntry> SearchForUser(string domain, string search)
         {
-            var tmp = new HashSet<DirectoryEntry>();
+            var tmp = new List<DirectoryEntry>();
             if (search != null)
             {
+                if (search.Substring(0, domain.Length) == domain) search = search.Substring(domain.Length + 1);
                 if (search.Length >= 3)
                 {
                     System.DirectoryServices.DirectoryEntry de = new System.DirectoryServices.DirectoryEntry("LDAP://" + domain);


Added helper to CryptoRandom

Added helper to CryptoRandom

--- IdentityModel/Thinktecture.IdentityModel/CryptoRandom.cs
+++ IdentityModel/Thinktecture.IdentityModel/CryptoRandom.cs
@@ -26,6 +26,14 @@
             new RNGCryptoServiceProvider().GetBytes(bytes);

             return bytes;
+        }
+
+        public static string CreateRandomKeyString(int length)
+        {
+            var bytes = new byte[length];
+            new RNGCryptoServiceProvider().GetBytes(bytes);
+
+            return Convert.ToBase64String(bytes);
         }

         /// <summary>


Use delayed close for settings row popovers

--- MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs
+++ MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs
@@ -39,6 +39,8 @@
 {
 	public class SliceSettingsRow : SettingsRow
 	{
+		private static Popover activePopover = null;
+
 		private SettingsContext settingsContext;

 		public string HelpText { get; }
@@ -243,6 +245,10 @@
 			// after a certain amount of time make the popover close (just like a tool tip)
 			double closeSeconds = Math.Max(1, (settingsRow.HelpText.Length / 50.0)) * 5;

+			activePopover?.Close();
+
+			activePopover = popover;
+
 			systemWindow.ShowPopover(
 				new MatePoint(settingsRow)
 				{
@@ -264,8 +270,25 @@

 		public override void OnMouseLeaveBounds(MouseEventArgs mouseEvent)
 		{
-			// Close any active popover bubble
-			popoverBubble?.Close();
+			if (popoverBubble != null)
+			{
+				// Allow a moment to elapse to determine if the mouse is withing the bubble or has returned to this control, close otherwise
+				UiThread.RunOnIdle(() =>
+				{
+					if (this.FirstWidgetUnderMouse)
+					{
+						// Often we get OnMouseLeaveBounds when the mouse is still within bounds (as child mouse events are processed)
+						// If the mouse is in bounds of this widget, abort the popover close below
+						return;
+					}
+
+					if (!popoverBubble.ContainsFirstUnderMouseRecursive())
+					{
+						// Close any active popover bubble
+						popoverBubble?.Close();
+					}
+				}, 1);
+			}

 			base.OnMouseLeaveBounds(mouseEvent);
 		}


Reset document on transform

Reset document on transform

--- Noodles.AspMvc/Infrastructure/ModifyDocumentAttribute.cs
+++ Noodles.AspMvc/Infrastructure/ModifyDocumentAttribute.cs
@@ -40,7 +40,7 @@
                     foreach (var transform in filterContext.HttpContext.Items.DocTransforms())
                     {
                         doc = transform(doc);
-                        doc = doc.Closest("html");
+                        doc = new CQ(doc.Document);
                     }
                     output.Write(doc.Render());
                 }


Fix usage of After constraint

Fix usage of After constraint

Change-Id: I11ffa33cb2a6640d4d7d91a23d604bc1ddd2aa5f

--- RabbitMQHare.UTest/RabbitPublisherWithAcknowledgement.cs
+++ RabbitMQHare.UTest/RabbitPublisherWithAcknowledgement.cs
@@ -71,7 +71,7 @@

                 context.Model.Raise(m => m.BasicAcks += null, context.Model.Object, new BasicAckEventArgs { DeliveryTag = 1, Multiple = false });

-                Assert.That(context.Publisher._unacked.Count, Is.EqualTo(0).After(5000, 50));
+                Assert.That(() => context.Publisher._unacked.Count, Is.EqualTo(0).After(5000, 50));
             }
         }

@@ -91,7 +91,7 @@

                 context.Model.Raise(m => m.BasicNacks += null, context.Model.Object, new BasicNackEventArgs { DeliveryTag = 1, Multiple = false });

-                Assert.That(context.Publisher._unacked.Count, Is.EqualTo(0).After(5000, 50));
+                Assert.That(() => context.Publisher._unacked.Count, Is.EqualTo(0).After(5000, 50));
                 Assert.IsTrue(called);
             }
         }
@@ -132,7 +132,7 @@
                 context.Model.Raise(m => m.BasicNacks += null, context.Model.Object, new BasicNackEventArgs { DeliveryTag = (ulong)currentSeqNumber, Multiple = ackMultiple });

                 Assert.IsTrue(mreForResendMessage.Wait(1000), "the Message should be resent after a short time, because the connection is still usable");
-                Assert.That(context.Publisher._unacked.Count, Is.EqualTo(1).After(5000, 50), "when a Message is on the wire, we should have an unacked Message");
+                Assert.That(() => context.Publisher._unacked.Count, Is.EqualTo(1).After(5000, 50), "when a Message is on the wire, we should have an unacked Message");
                 Assert.IsTrue(callbackCalled.Wait(1000), "the OnNAck callback should have been called");
             }
         }


ResetPassword fix

ResetPassword fix

--- Signum.Web.Extensions/Auth/Controllers/AuthController.cs
+++ Signum.Web.Extensions/Auth/Controllers/AuthController.cs
@@ -315,7 +315,10 @@

             using (AuthLogic.Disable())
             {
-                context.Value.Execute(UserOperation.Save);
+                using (OperationLogic.AllowSave<UserDN>())
+                {
+                    context.Value.Save();
+                }
                 //remove pending requests
                 Database.Query<ResetPasswordRequestDN>().Where(r => r.User.Email == user.Email && r.Code == request.Code).UnsafeDelete();
             }


Standardized return value for HTML helper functions in data context.

--- Source/Applications/openMIC/openMIC/Model/DataContext.cs
+++ Source/Applications/openMIC/openMIC/Model/DataContext.cs
@@ -159,7 +159,6 @@
         /// <returns>Generated HTML for new text field based on modeled table field attributes.</returns>
         public string AddSelectField<T>(string fieldName, string fieldLabel = null, string selectLabel = null) where T : class, new()
         {
-            StringBuilder html = new StringBuilder();
             StringBuilder options = new StringBuilder();
             TableOperations<T> tableOperations = Table<T>();
             RequiredAttribute requiredAttribute;
@@ -173,7 +172,7 @@
             foreach (T record in QueryRecords<T>($"SELECT {fieldName}, {fieldLabel} FROM {typeof(T).Name} ORDER BY {fieldLabel}"))
                 options.AppendLine($"<option value=\"{tableOperations.GetFieldValue(record, fieldName)}\">{tableOperations.GetFieldValue(record, fieldLabel)}</option>");

-            html.AppendFormat(@"
+            return string.Format(@"

                         {1}:
                         <select class=""form-control"" id=""{0}"" data-bind=""value: {0}, optionsCaption: 'Select {1}...', valueAllowUnset: {2}"">
@@ -181,8 +180,6 @@
                         </select>

                     ", fieldName, selectLabel, required, options);
-
-            return html.ToString();
         }

         #endregion


Refactor bootstrapper, move uninstall into Apply stage

--- src/Shimmer.WiXUi/WixUiBootstrapper.cs
+++ src/Shimmer.WiXUi/WixUiBootstrapper.cs
@@ -86,18 +86,9 @@
                 }

                 if (wixEvents.Action == LaunchAction.Uninstall) {
-                    var updateManager = new UpdateManager("http://lol", BundledRelease.PackageName, FrameworkVersion.Net40);
-
-                    var updateLock = updateManager.AcquireUpdateLock();
-                    updateManager.FullUninstall()
-                        .ObserveOn(RxApp.DeferredScheduler)
-                        .Log(this, "Full uninstall")
-                        .Finally(updateLock.Dispose)
-                        .Subscribe(
-                            _ => wixEvents.Engine.Plan(LaunchAction.Uninstall),
-                            ex => UserError.Throw("Failed to uninstall application", ex),
-                            () => wixEvents.ShouldQuit());
-
+                    var uninstallVm = RxApp.GetService<IUninstallingViewModel>();
+                    Router.Navigate.Execute(uninstallVm);
+                    wixEvents.Engine.Plan(LaunchAction.Uninstall);
                     return;
                 }

@@ -113,7 +104,6 @@
                     var welcomeVm = RxApp.GetService<IWelcomeViewModel>();
                     welcomeVm.PackageMetadata = bundledPackageMetadata;
                     welcomeVm.ShouldProceed.Subscribe(_ => wixEvents.Engine.Plan(LaunchAction.Install));
-
                     Router.Navigate.Execute(welcomeVm);
                 }
             });
@@ -125,74 +115,16 @@
                     return;
                 }

-                if (wixEvents.Action != LaunchAction.Install) {
-                    wixEvents.Engine.Apply(wixEvents.MainWindowHwnd);
-                    return;
-                }
-
-                // NB: Create a dummy subject to receive progress if we're in silent mode
-                IObserver<int> progress = new Subject<int>();
-                if (wixEvents.DisplayMode == Display.Full) {
-                    var installingVm = RxApp.GetService<IInstallingViewModel>();
-                    progress = installingVm.ProgressValue;
-                    installingVm.PackageMetadata = bundledPackageMetadata;
-                    Router.Navigate.Execute(installingVm);
-                }
-
-                // NB: This bit of code is a bit clever. The binaries that WiX
-                // has installed *itself* meets the qualifications for being a
-                // Shimmer update directory (a RELEASES file and the corresponding
-                // NuGet packages).
-                //
-                // So, in order to reuse some code and not write the same things
-                // twice we're going to "Eigenupdate" from our own directory;
-                // UpdateManager will operate in bootstrap mode and create a
-                // local directory for us.
-                //
-                // Then, we create a *new* UpdateManager whose target is the normal
-                // update URL - we can then apply delta updates against the bundled
-                // NuGet package to get up to vCurrent. The reason we go through
-                // this rigamarole is so that developers don't have to rebuild the
-                // installer as often (never, technically).
-
-                var fxVersion = determineFxVersionFromPackage(bundledPackageMetadata);
-                var eigenUpdater = new UpdateManager(currentAssemblyDir, BundledRelease.PackageName, fxVersion);
-
-                var eigenLock = eigenUpdater.AcquireUpdateLock();
-
-                var eigenUpdateProgress = eigenUpdater.CheckForUpdate()
-                    .SelectMany(x => eigenUpdater.DownloadReleases(x.ReleasesToApply))
-                    .Finally(eigenLock.Dispose)
-                    .Select(x => x / 2)
-                    .Multicast(new Subject<int>());
-
-                eigenUpdateProgress.Subscribe(progress);
-                eigenUpdateProgress.Connect();
-
-                var realUpdateProgress = eigenUpdateProgress.TakeLast(1)
-                    .SelectMany(_ => {
-                        var realUpdateManager = new UpdateManager(bundledPackageMetadata.ProjectUrl.ToString(), BundledRelease.PackageName, fxVersion);
-
-                        return realUpdateManager.CheckForUpdate()
-                            .SelectMany(updateInfo => {
-                                return Observable.Concat(
-                                    realUpdateManager.DownloadReleases(updateInfo.ReleasesToApply).Select(x => x * 0.75),
-                                    realUpdateManager.ApplyReleases(updateInfo).Select(x => x * 0.25 + 75))
-                                        .Select(x => (int)x);
-                            }).LoggedCatch(this, Observable.Return(100), "Failed to update to latest remote version");
-                    })
-                    .Select(x => x / 2 + 50)
-                    .Multicast(new Subject<int>());
-
-                realUpdateProgress.Subscribe(progress);
-                realUpdateProgress.Connect();
-
-                realUpdateProgress
-                    .TakeLast(1)
-                    .ObserveOn(RxApp.DeferredScheduler)
-                    .Subscribe(
+                if (wixEvents.Action == LaunchAction.Uninstall) {
+                    executeUninstall(wixEvents).Subscribe(
                         _ => wixEvents.Engine.Apply(wixEvents.MainWindowHwnd),
-                        ex => UserError.Throw("Failed to install application", ex));
+                        ex => UserError.Throw(new UserError("Failed to uninstall", ex.Message, innerException: ex)));
+                    return;
+                }
+
+                executeInstall(wixEvents, currentAssemblyDir, bundledPackageMetadata).Subscribe(
+                    _ => wixEvents.Engine.Apply(wixEvents.MainWindowHwnd),
+                    ex => UserError.Throw("Failed to install application", ex));
             });

             wixEvents.ApplyCompleteObs.Subscribe(eventArgs => {
@@ -202,7 +134,7 @@
                     return;
                 }

-                if (wixEvents.DisplayMode != Display.Full) {
+                if (wixEvents.DisplayMode != Display.Full || wixEvents.Action != LaunchAction.Install) {
                     wixEvents.ShouldQuit();
                 }

@@ -210,6 +142,83 @@
             });

             wixEvents.ErrorObs.Subscribe(eventArgs => UserError.Throw("An installation error has occurred: " + eventArgs.ErrorMessage));
+        }
+
+        IObservable<Unit> executeInstall(IWiXEvents wixEvents, string currentAssemblyDir, IPackage bundledPackageMetadata)
+        {
+            // NB: Create a dummy subject to receive progress if we're in silent mode
+            IObserver<int> progress = new Subject<int>();
+
+            if (wixEvents.DisplayMode == Display.Full) {
+                var installingVm = RxApp.GetService<IInstallingViewModel>();
+                progress = installingVm.ProgressValue;
+                installingVm.PackageMetadata = bundledPackageMetadata;
+                Router.Navigate.Execute(installingVm);
+            }
+
+            // NB: This bit of code is a bit clever. The binaries that WiX
+            // has installed *itself* meets the qualifications for being a
+            // Shimmer update directory (a RELEASES file and the corresponding
+            // NuGet packages).
+            //
+            // So, in order to reuse some code and not write the same things
+            // twice we're going to "Eigenupdate" from our own directory;
+            // UpdateManager will operate in bootstrap mode and create a
+            // local directory for us.
+            //
+            // Then, we create a *new* UpdateManager whose target is the normal
+            // update URL - we can then apply delta updates against the bundled
+            // NuGet package to get up to vCurrent. The reason we go through
+            // this rigamarole is so that developers don't have to rebuild the
+            // installer as often (never, technically).
+
+            var fxVersion = determineFxVersionFromPackage(bundledPackageMetadata);
+            var eigenUpdater = new UpdateManager(currentAssemblyDir, BundledRelease.PackageName, fxVersion);
+
+            var eigenLock = eigenUpdater.AcquireUpdateLock();
+
+            var eigenUpdateProgress = eigenUpdater.CheckForUpdate()
+                .SelectMany(x => eigenUpdater.DownloadReleases(x.ReleasesToApply))
+                .Finally(eigenLock.Dispose)
+                .Select(x => x/2)
+                .Multicast(new Subject<int>());
+
+            eigenUpdateProgress.Subscribe(progress);
+            eigenUpdateProgress.Connect();
+
+            var realUpdateProgress = eigenUpdateProgress.TakeLast(1)
+                .SelectMany(_ => {
+                    var realUpdateManager = new UpdateManager(bundledPackageMetadata.ProjectUrl.ToString(),
+                        BundledRelease.PackageName, fxVersion);
+
+                    return realUpdateManager.CheckForUpdate()
+                        .SelectMany(updateInfo => {
+                            return Observable.Concat(
+                                realUpdateManager.DownloadReleases(updateInfo.ReleasesToApply).Select(x => x*0.75),
+                                realUpdateManager.ApplyReleases(updateInfo).Select(x => x*0.25 + 75))
+                                .Select(x => (int) x);
+                        }).LoggedCatch(this, Observable.Return(100), "Failed to update to latest remote version");
+                })
+                .Select(x => x/2 + 50)
+                .Multicast(new Subject<int>());
+
+            realUpdateProgress.Subscribe(progress);
+            realUpdateProgress.Connect();
+
+            return realUpdateProgress
+                .TakeLast(1).Select(_ => Unit.Default)
+                .ObserveOn(RxApp.DeferredScheduler);
+        }
+
+        IObservable<Unit> executeUninstall(IWiXEvents wixEvents)
+        {
+            var updateManager = new UpdateManager("http://lol", BundledRelease.PackageName, FrameworkVersion.Net40);
+
+            var updateLock = updateManager.AcquireUpdateLock();
+            return updateManager.FullUninstall()
+                .ObserveOn(RxApp.DeferredScheduler)
+                .Log(this, "Full uninstall")
+                .Finally(updateLock.Dispose);
         }

         UserError convertHResultToError(int status)