Fix build error in Debug mode

Fix build error in Debug mode

--- Source/DotSpatial.Symbology/LegendItem.cs
+++ Source/DotSpatial.Symbology/LegendItem.cs
@@ -217,13 +217,13 @@
                 if (_changeOccured)
                 {
 #if DEBUG
-                    var sw = new Stopwatch();
+                    var sw = new System.Diagnostics.Stopwatch();
                     sw.Start();
 #endif
                     OnItemChanged();
 #if DEBUG
                     sw.Stop();
-                    Debug.WriteLine("OnItemChanged time:" + sw.ElapsedMilliseconds);
+                    System.Diagnostics.Debug.WriteLine("OnItemChanged time:" + sw.ElapsedMilliseconds);
 #endif
                 }
             }


Checkpoint every 10%.

Checkpoint every 10%.

--- Assets/Scripts/Model.cs
+++ Assets/Scripts/Model.cs
@@ -47,6 +47,8 @@
 		internal float progressPositionTweened = 0.0f;
 		internal float wordPosition = 0.0f;
 		internal float wordPositionScaled = 0.0f;
+		internal float checkpoint = -1.0f;
+		internal float checkpointStep = 0.1f;
 		internal int points = 0;
 		internal int score = 0;
 		internal int tutorLevel = 0;
@@ -349,7 +351,8 @@
 			}
 			else {
 				float hintPerformanceMax = // 0.25f;
-											0.375f;
+											// 0.375f;
+											0.5f;
 				if (performance() <= hintPerformanceMax) {
 					isHintVisible = submitsUntilHintNow <= 0;
 				}
@@ -373,6 +376,7 @@
 		{
 			if (isNewGameVisible) {
 				Debug.Log("Model.newGame");
+				previousSessionLevel = 0;
 				trial(levels.parameters[0]);
 			}
 		}
@@ -426,6 +430,7 @@
 						{
 							completes = DataUtil.CloneList(word);
 							if (progress.level < tutorLevel) {
+								progress.level++;
 								trial(levels.up());
 							}
 							else {
@@ -470,11 +475,30 @@
 			return performanceNormal;
 		}

+		private bool updateCheckpoint()
+		{
+			if (checkpoint <= progress.normal) {
+				if (checkpointStep <= checkpoint) {
+					isGamePlaying = false;
+					isContinueVisible = true;
+					populateWord("");
+					Debug.Log("Model.updateCheckpoint: " + checkpoint + " progress " + progress.normal);
+					return true;
+				}
+				checkpoint = Mathf.Floor(progress.normal / checkpointStep + 1) * checkpointStep;
+			}
+			return false;
+		}
+
 		private void nextTrial()
 		{
-			isHudVisible = true;
-			Dictionary<string, dynamic> level = progress.Pop(levels.parameters, tutorLevel);
-			trial(level);
+			if (updateCheckpoint()) {
+			}
+			else {
+				isHudVisible = true;
+				Dictionary<string, dynamic> level = progress.Pop(levels.parameters, tutorLevel);
+				trial(level);
+			}
 		}

 		// Level up by response time and worst word position.


* stylecop warnings fro FacebookOAuthException

--- Source/Facebook/FacebookOAuthException.cs
+++ Source/Facebook/FacebookOAuthException.cs
@@ -10,8 +10,8 @@
 namespace Facebook
 {
     using System;
+    using System.Globalization;
     using System.Runtime.Serialization;
-using System.Globalization;

     /// <summary>
     /// Represents errors that occur as a result of problems with the OAuth access token.
@@ -25,7 +25,6 @@
         /// Initializes a new instance of the <see cref="FacebookOAuthException"/> class.
         /// </summary>
         public FacebookOAuthException()
-            : base()
         {
         }


Adding ignore for .NET Chrome drag tests now that W3C mode is default

--- dotnet/test/common/Interactions/DragAndDropTest.cs
+++ dotnet/test/common/Interactions/DragAndDropTest.cs
@@ -89,6 +89,8 @@
         }

         [Test]
+        [IgnoreBrowser(Browser.Chrome, "Moving outside of view port throws exception in spec-compliant driver")]
+        [IgnoreBrowser(Browser.Edge, "Moving outside of view port throws exception in spec-compliant driver")]
         [IgnoreBrowser(Browser.Firefox, "Moving outside of view port throws exception in spec-compliant driver")]
         [IgnoreBrowser(Browser.IE, "Moving outside of view port throws exception in spec-compliant driver")]
         public void DragAndDropElementWithOffsetInScrolledDiv()
@@ -134,6 +136,8 @@
         }

         [Test]
+        [IgnoreBrowser(Browser.Chrome, "Moving outside of view port throws exception in spec-compliant driver")]
+        [IgnoreBrowser(Browser.Edge, "Moving outside of view port throws exception in spec-compliant driver")]
         [IgnoreBrowser(Browser.Firefox, "Moving outside of view port throws exception in spec-compliant driver")]
         [IgnoreBrowser(Browser.IE, "Moving outside of view port throws exception in spec-compliant driver")]
         public void ShouldAllowUsersToDragAndDropToElementsOffTheCurrentViewPort()


Streamline Movie discovery to match TV discovery

--- TMDbLib/Objects/Discover/DiscoverMovie.cs
+++ TMDbLib/Objects/Discover/DiscoverMovie.cs
@@ -24,37 +24,12 @@
             Parameters.Remove("certification.lte");
         }

-        private void ClearPrimaryReleaseDate()
-        {
-            Parameters.Remove("primary_release_date.gte");
-            Parameters.Remove("primary_release_date.lte");
-        }
-
-        private void ClearReleaseDate()
-        {
-            Parameters.Remove("release_date.gte");
-            Parameters.Remove("release_date.lte");
-        }
-
-        private void ClearVoteAverage()
-        {
-            Parameters.Remove("vote_average.gte");
-            Parameters.Remove("vote_average.lte");
-        }
-
-        private void ClearVoteCount()
-        {
-            Parameters.Remove("vote_count.gte");
-            Parameters.Remove("vote_count.lte");
-        }
-
         /// <summary>
         /// Toggle the inclusion of adult titles. Expected value is a boolean, true or false. Default is false.
         /// </summary>
         public DiscoverMovie IncludeAdultMovies(bool include = true)
         {
             Parameters["include_adult"] = include.ToString();
-
             return this;
         }

@@ -64,7 +39,6 @@
         public DiscoverMovie IncludeVideoMovies(bool include = true)
         {
             Parameters["include_video"] = include.ToString();
-
             return this;
         }

@@ -345,8 +319,6 @@
         /// </summary>
         public DiscoverMovie WherePrimaryReleaseDateIsAfter(DateTime date)
         {
-            ClearPrimaryReleaseDate();
-
             Parameters["primary_release_date.gte"] = date.ToString("yyyy-MM-dd");
             return this;
         }
@@ -356,8 +328,6 @@
         /// </summary>
         public DiscoverMovie WherePrimaryReleaseDateIsBefore(DateTime date)
         {
-            ClearPrimaryReleaseDate();
-
             Parameters["primary_release_date.lte"] = date.ToString("yyyy-MM-dd");
             return this;
         }
@@ -376,8 +346,6 @@
         /// </summary>
         public DiscoverMovie WhereReleaseDateIsAfter(DateTime date)
         {
-            ClearReleaseDate();
-
             Parameters["release_date.gte"] = date.ToString("yyyy-MM-dd");
             return this;
         }
@@ -387,8 +355,6 @@
         /// </summary>
         public DiscoverMovie WhereReleaseDateIsBefore(DateTime date)
         {
-            ClearReleaseDate();
-
             Parameters["release_date.lte"] = date.ToString("yyyy-MM-dd");
             return this;
         }
@@ -398,8 +364,6 @@
         /// </summary>
         public DiscoverMovie WhereVoteAverageIsAtLeast(double score)
         {
-            ClearVoteAverage();
-
             // TODO: Apply culture to the ToString
             Parameters["vote_average.gte"] = score.ToString();
             return this;
@@ -410,8 +374,6 @@
         /// </summary>
         public DiscoverMovie WhereVoteAverageIsAtMost(double score)
         {
-            ClearVoteAverage();
-
             // TODO: Apply culture to the ToString
             Parameters["vote_average.lte"] = score.ToString();
             return this;
@@ -422,8 +384,6 @@
         /// </summary>
         public DiscoverMovie WhereVoteCountIsAtLeast(int count)
         {
-            ClearVoteCount();
-
             Parameters["vote_count.gte"] = count.ToString();
             return this;
         }
@@ -433,8 +393,6 @@
         /// </summary>
         public DiscoverMovie WhereVoteCountIsAtMost(int count)
         {
-            ClearVoteCount();
-
             Parameters["vote_count.lte"] = count.ToString();
             return this;
         }


pluralize

pluralize

--- Tests/MeteredSpaces/SerializationTests.cs
+++ Tests/MeteredSpaces/SerializationTests.cs
@@ -9,7 +9,7 @@
     public class SerializationTests
     {
         [Test]
-        [Category("MeteredSpace")]
+        [Category("MeteredSpaces")]
         public void Pole_Xml_Deserializes_To_ViewModel()
         {
             var serializer = new DataContractSerializer(typeof(MeteredSpacePOST));


- Add regions, remove unused code

- Add regions, remove unused code

--- TextEditorApp/CustomControl/TextEditor.cs
+++ TextEditorApp/CustomControl/TextEditor.cs
@@ -21,6 +21,8 @@
             InitializeComponent();
         }

+        #region Default implementation
+
         private void TextEditor_Load(object sender, EventArgs e)
         {
             //Init events
@@ -236,7 +238,12 @@
             bgWorker.RunWorkerAsync(fileName);
         }

+        #endregion Default implementation
+
         /* Interface implementation */
+
+        #region Public events
+
         public event DragEventHandler CustomDragEnter;

         public event DragEventHandler CustomDragDrop;
@@ -244,29 +251,15 @@
         public event EventHandler OpenButtonClick;

         public event EventHandler SaveButtonClick;
+
+        #endregion Public events
+
+        #region Public methods and properties

         public void UpdateProgress(int percentage, object additionalData = null)
         {
             prgBar.Value = percentage;
             lblResult.Text = percentage + "%";
-        }
-
-        public void SetResultText(string text)
-        {
-            lblResult.Text = text;
-        }
-
-        public void SetTextForEditor(string text)
-        {
-            if (String.IsNullOrEmpty(text))
-                rtbContent.Clear();
-            else
-                rtbContent.Text = text;
-        }
-
-        public string GetTextOfEditor()
-        {
-            return rtbContent.Text;
         }

         public void DisableControls()
@@ -366,5 +359,7 @@
                 rtbContent.Text = value;
             }
         }
+
+        #endregion Public methods and properties
     }
 }


ブロック判定をまとめた

ブロック判定をまとめた

--- BasicSample/Composer.cs
+++ BasicSample/Composer.cs
@@ -91,18 +91,17 @@
                 // ここから通常の合成
                 var ccc = GetCanonicalCombiningClass(c);

-                if (ccc != 0 && lastCcc == ccc)
+                if (ccc == 0 ? lastCcc != 0 : lastCcc >= ccc)
                 {
-                    // ブロック条件 "ccc(B) >= ccc(C)"
-                    // 分解で並べ替えられているので ccc(B) > ccc(C) になることはない
+                    // ccc が 0 のとき → lastCcc != 0 ならばブロックされている
+                    // ccc が 0 でないとき → lastCcc >= ccc ならばブロックされている
                     buffer[insertIndex++] = c;
                     lastChar = c;
                     continue;
                 }

                 uint composed;
-                if ((ccc != 0 || lastCcc == 0) // ブロック条件より CCC 0 の連続は合成できる
-                    && _compositionTable.TryGetValue(new CodePointPair(lastStarter, c), out composed))
+                if (_compositionTable.TryGetValue(new CodePointPair(lastStarter, c), out composed))
                 {
                     buffer[lastStarterIndex] = composed;
                     lastStarter = composed;


Replace normal list with concurrent collection

A sporadic test failure has been revealed in a CI build for PR #2915.
After inspecting the failing test the problem was determined to be
caused by scheduled adds to a non-thread-safe List<T>, which caused
waits for all three desired items to be added to it to time out. This
race condition could be reproduced by repeating any test in
ThreadCultureTest enough times.

Replace the List<T> with a ConcurrentBag<T> to prevent race conditions
from occurring. The change was tested by repeating all tests in the
ThreadCultureTest fixture 500 times - the failure could not be
reproduced after introducing it.

--- osu.Framework.Tests/Localisation/ThreadCultureTest.cs
+++ osu.Framework.Tests/Localisation/ThreadCultureTest.cs
@@ -1,8 +1,9 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

-using System.Collections.Generic;
+using System.Collections.Concurrent;
 using System.Globalization;
+using System.Linq;
 using System.Threading;
 using NUnit.Framework;
 using osu.Framework.Allocation;
@@ -60,7 +61,7 @@

         private void assertCulture(string name)
         {
-            var cultures = new List<CultureInfo>();
+            var cultures = new ConcurrentBag<CultureInfo>();

             AddStep("query cultures", () =>
             {
@@ -70,7 +71,7 @@
             });

             AddUntilStep("wait for query", () => cultures.Count == 3);
-            AddAssert($"culture is {name}", () => cultures.TrueForAll(c => c.Name == name));
+            AddAssert($"culture is {name}", () => cultures.All(c => c.Name == name));
         }

         private void assertThreadCulture(string name)


Balancing opacity and hidden bonus

Balancing opacity and hidden bonus

--- osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
+++ osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
@@ -33,7 +33,7 @@
         private double preemptTime;

         private const double max_opacity_bonus = 0.4;
-        private const double hidden_bonus = 0.3;
+        private const double hidden_bonus = 0.4;

         private double currentStrain;


Use ChildrenOfType instead

Use ChildrenOfType instead

--- osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs
@@ -2,10 +2,12 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
+using System.Linq;
 using NUnit.Framework;
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
+using osu.Framework.Testing;
 using osu.Game.Configuration;
 using osu.Game.Rulesets.Mods;
 using osu.Game.Screens.Play;
@@ -19,7 +21,7 @@

         // best way to check without exposing.
         private Drawable hideTarget => hudOverlay.KeyCounter;
-        private FillFlowContainer<KeyCounter> keyCounterFlow => (FillFlowContainer<KeyCounter>)hudOverlay.KeyCounter.Child.Parent;
+        private FillFlowContainer<KeyCounter> keyCounterFlow => hudOverlay.KeyCounter.ChildrenOfType<FillFlowContainer<KeyCounter>>().First();

         [Resolved]
         private OsuConfigManager config { get; set; }


Fix protection change

Fix protection change

--- osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
+++ osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
@@ -18,7 +18,7 @@
     {
         protected override Drawable GetDrawableCharacter(char c) => new PasswordMaskChar(CalculatedTextSize);

-        public override bool AllowClipboardExport => false;
+        protected override bool AllowClipboardExport => false;

         private readonly CapsWarning warning;


Update signatures

Update signatures

--- osu.Game/Overlays/Direct/DownloadTrackingComposite.cs
+++ osu.Game/Overlays/Direct/DownloadTrackingComposite.cs
@@ -90,7 +90,7 @@
             }
         }

-        private void onRequestSuccess(byte[] data)
+        private void onRequestSuccess(string data)
         {
             Schedule(() => State.Value = DownloadState.Downloaded);
             attachDownload(null);


Add usingRequired dictionary

Add usingRequired dictionary

--- CodeGeneration/Program.cs
+++ CodeGeneration/Program.cs
@@ -18,6 +18,7 @@
 SOFTWARE.
 */
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
 using System.Text;
@@ -32,6 +33,7 @@
       display("Generating code for Unit tests in a file");
       string fileName = "UnitTestFunctionsString2.cs";
       string carriageReturn = Environment.NewLine;
+      Dictionary<string, string> usingRequired = new Dictionary<string, string>();
       string usingToken = "using";
       string space = " ";
       string semiColon = ";";
@@ -70,12 +72,20 @@
       string ReferenceEqualsToken = "ReferenceEquals";
       string replaceNullCharsToken = "ReplaceNullChars";
       string publicClass = "public class UnitTestMethodsString";
+      usingRequired.Add(assertToken, "Microsoft.VisualStudio.TestTools.UnitTesting");
       StringBuilder code = new StringBuilder();
       code.Append(usingToken);
       code.Append(space);
       code.Append(systemtoken);
       code.Append(semiColon);
       code.Append(carriageReturn);
+
+      code.Append(usingToken);
+      code.Append(space);
+      code.Append(usingRequired[assertToken]);
+      code.Append(semiColon);
+      code.Append(carriageReturn);
+
       code.Append("namespace UnitTestUsefullFunctions" + carriageReturn);
       code.Append(openCurlyBrace + carriageReturn);
       code.Append(tabulation + testClass + carriageReturn);


CommandLine: Parameters class

CommandLine: Parameters class

--- CommandLine/Parameters.cs
+++ CommandLine/Parameters.cs
@@ -1,11 +1,73 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;

 namespace ArachNGIN.CommandLine
 {
     public class Parameters
     {
+        private readonly StringDictionary _dict = new StringDictionary();
+
+        public Parameters(IEnumerable<string> args)
+        {
+            var splitter = new Regex(@"^-{1,2}|^/|=|:", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            var remover = new Regex(@"^['""]?(.*?)['""]?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            string param = null;
+            foreach (var s in args)
+            {
+                var parts = splitter.Split(s, 3);
+                switch (parts.Length)
+                {
+                    case 1:
+                        if (param != null)
+                        {
+                            if (_dict.ContainsKey(param))
+                            {
+                                parts[0] = remover.Replace(parts[0], "$1");
+                                _dict.Add(param, parts[0]);
+                            }
+                            param = null;
+                        }
+                        break;
+
+                    case 2:
+                        if (param != null)
+                        {
+                            if (!_dict.ContainsKey(param)) _dict.Add(param, "true");
+                        }
+                        param = parts[1];
+                        break;
+
+                    case 3:
+                        if (param != null)
+                        {
+                            if (!_dict.ContainsKey(param)) _dict.Add(param, "true");
+                        }
+                        param = parts[1];
+                        if (!_dict.ContainsKey(param))
+                        {
+                            parts[2] = remover.Replace(parts[2], "$1");
+                            _dict.Add(param, parts[2]);
+                        }
+                        param = null;
+                        break;
+                }
+                if (param != null)
+                {
+                    if (!_dict.ContainsKey(param)) _dict.Add(param, "true");
+                }
+            }
+        }
+
+        public string this[string param]
+        {
+            get
+            {
+                return _dict[param];
+            }
+        }
     }
 }


Fixed compiling error

Fixed compiling error

Deleted Shroom() in WardTracker.cs

--- Components/WardTracker.cs
+++ Components/WardTracker.cs
@@ -31,8 +31,7 @@
             new BlueTrinket(),
             new SightWard(),
             new ControlWard(),
-            new YellowTrinket(),
-            new Shroom()
+            new YellowTrinket()
         };

         public Menu Menu { get; private set; }


Directory creation added.

Directory creation added.

--- BundleVersionChecker.cs
+++ BundleVersionChecker.cs
@@ -35,8 +35,9 @@
 	/// Class name to use when referencing from code.
 	/// </summary>
 	const string ClassName = "CurrentBundleVersion";
+	const string TargetDir = "Assets/Scripts/Config/BundleVersionCheck";

-	const string TargetCodeFile = "Assets/Scripts/Config/" + ClassName + ".cs";
+	const string TargetCodeFile = TargetDir + "/" + ClassName + ".cs";

 	static BundleVersionChecker () {
 		string bundleVersion = PlayerSettings.bundleVersion;
@@ -63,6 +64,17 @@
 	/// New bundle version to write into code.
 	/// </param>
 	static void CreateNewBuildVersionClassFile (string bundleVersion) {
+		if (File.Exists (TargetDir)) {
+			Debug.LogWarning (TargetDir + " is a file instead of a directory !");
+			return;
+		} else if (!Directory.Exists (TargetDir)) {
+			try {
+				Directory.CreateDirectory (TargetDir);
+			} catch (System.Exception ex) {
+				Debug.LogWarning (ex.Message);
+				throw ex;
+			}
+		}
 		using (StreamWriter writer = new StreamWriter (TargetCodeFile, false)) {
 			try {
 				string code = GenerateCode (bundleVersion);
@@ -70,7 +82,7 @@
 			} catch (System.Exception ex) {
 				string msg = " \n" + ex.ToString ();
 				Debug.LogError (msg);
-				EditorUtility.DisplayDialog ("Error when trying to regenerate class", msg, "OK");
+				EditorUtility.DisplayDialog ("Error when trying to regenerate file " + TargetCodeFile, msg, "OK");
 			}
 		}
 	}


CC.UI:TankControlsUI: update resource dropdown options only when needed

--- CC.UI/TankControlsUI.cs
+++ CC.UI/TankControlsUI.cs
@@ -34,11 +34,16 @@

         private ITankInfo tank;

+        private void updateResourcesDropdown() =>
+            resourceDropdown.options = UI_Utils.namesToOptions(tank.SupportedResources);
+
         public void SetTank(ITankInfo newTank)
         {
             tank = newTank;
             if(tank == null)
                 return;
+            tankTypeDropdown.options = UI_Utils.namesToOptions(tank.SupportedTypes);
+            updateResourcesDropdown();
             UpdateDisplay();
         }

@@ -60,12 +65,24 @@
                 resourceMass.gameObject.SetActive(false);
             }
             tankFullness.text = (tank.Amount / tank.MaxAmount).ToString("P1");
-            tankTypeDropdown.options = UI_Utils.namesToOptions(tank.SupportedTypes);
-            resourceDropdown.options = UI_Utils.namesToOptions(tank.SupportedResources);
-            if(!string.IsNullOrEmpty(tank.TankType))
+            var resourcesDropdownUpdated = false;
+            if(!string.IsNullOrEmpty(tank.TankType)
+               && (tankTypeDropdown.value >= tank.SupportedTypes.Count
+                   || tank.TankType != tank.SupportedTypes[tankTypeDropdown.value]))
+            {
                 tankTypeDropdown.SetValueWithoutNotify(tank.SupportedTypes.IndexOf(tank.TankType));
-            if(!string.IsNullOrEmpty(tank.CurrentResource))
+                updateResourcesDropdown();
+                resourcesDropdownUpdated = true;
+            }
+            // ReSharper disable once InvertIf
+            if(!string.IsNullOrEmpty(tank.CurrentResource)
+               && (resourceDropdown.value >= tank.SupportedResources.Count
+                   || tank.CurrentResource != tank.SupportedResources[resourceDropdown.value]))
+            {
+                if(!resourcesDropdownUpdated)
+                    updateResourcesDropdown();
                 resourceDropdown.SetValueWithoutNotify(tank.SupportedResources.IndexOf(tank.CurrentResource));
+            }
         }

         private void Awake()
@@ -202,6 +219,7 @@
             if(tank == null)
                 return;
             tank.ChangeTankType(tank.Manager.SupportedTypes[index]);
+            updateResourcesDropdown();
             UpdateDisplay();
         }


testing

testing

--- CDLib/CompanyService.cs
+++ CDLib/CompanyService.cs
@@ -7,6 +7,8 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+
+//Erik is testing whether he's able to push to github

 namespace CDLib
 {


Cleanup

Cleanup

--- test/WebSites/AspNetCoreSubdomain.SubdomainsAreaWebSite/Startup.cs
+++ test/WebSites/AspNetCoreSubdomain.SubdomainsAreaWebSite/Startup.cs
@@ -13,16 +13,6 @@
 {
     public class Startup
     {
-        public Startup(IHostingEnvironment env)
-        {
-            // var builder = new ConfigurationBuilder()
-            //     .SetBasePath(env.ContentRootPath)
-            //     .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
-            //     .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
-            //     .AddEnvironmentVariables();
-            // Configuration = builder.Build();
-        }
-
         public IConfigurationRoot Configuration { get; }

         // This method gets called by the runtime. Use this method to add services to the container.


Implement remainder of matrix interpolation fallback test.

--- tests/Avalonia.Visuals.UnitTests/Media/TransformOperationsTests.cs
+++ tests/Avalonia.Visuals.UnitTests/Media/TransformOperationsTests.cs
@@ -115,7 +115,7 @@
         }

         [Fact]
-        public void Can_Interpolate_Matrix()
+        public void Interpolation_Fallback_To_Matrix()
         {
             double progress = 0.5d;

@@ -123,6 +123,11 @@
             var to = TransformOperations.Parse("translate(100px, 100px) rotate(1215deg)");

             var interpolated = TransformOperations.Interpolate(from, to, progress);
+
+            var operations = interpolated.Operations;
+
+            Assert.Single(operations);
+            Assert.Equal(TransformOperation.OperationType.Matrix, operations[0].Type);
         }
     }
 }


Added Github link

Added Github link

--- test/JValue/JValue.cs
+++ test/JValue/JValue.cs
@@ -8,6 +8,7 @@
     /// Super lightweight JSON Reader
     /// </summary>
     /// <seealso cref="http://www.json.org/"/>
+    /// <seealso cref="https://github.com/halak/jvalue/"/>
     public struct JValue : IComparable<JValue>, IEquatable<JValue>
     {
         #region TypeCode
@@ -365,7 +366,7 @@
             return sb.ToString();
         }

-        private int Hex(char c)
+        private static int Hex(char c)
         {
             return
                 ('0' <= c && c <= '9') ?


Support linear initial hashing using one thread and completion ports.

--- sources/Leak.Core/Repository/RepositoryTaskVerifyRange.cs
+++ sources/Leak.Core/Repository/RepositoryTaskVerifyRange.cs
@@ -1,10 +1,7 @@
 using Leak.Core.Common;
 using Leak.Core.Metadata;
 using System;
-using System.Collections.Generic;
 using System.Security.Cryptography;
-using System.Threading;
-using System.Threading.Tasks;

 namespace Leak.Core.Repository
 {
@@ -19,55 +16,24 @@

         public void Execute(RepositoryContext context, RepositoryTaskCallback onCompleted)
         {
-            FileHash hash = context.Metainfo.Hash;
-            Bitfield bitfield = context.Bitfile.Read();
-
             int length = context.Metainfo.Pieces.Length;
             int size = context.Metainfo.Properties.PieceSize;

+            Bitfield bitfield = context.Bitfile.Read();
             bitfield = bitfield ?? new Bitfield(length);

-            int count = Environment.ProcessorCount;
             Bitfield reduced = ReduceScope(bitfield);
-
-            TaskData data = new TaskData
-            {
-                Context = context,
-                Bitfield = bitfield,
-                Reading = new SemaphoreSlim(0, count),
-                Writing = new SemaphoreSlim(count, count),
-                Pieces = new Queue<PieceData>(),
-                Buffer = new RotatingBuffer(count, size),
-                //Left = reduced.Length - reduced.Completed,
-                Left = bitfield.Length,
-                Tasks = new List<Task>(),
-                Scope = reduced,
-            };
-
-            if (data.Left > 0)
-            {
-                AddWorker(data);
-                data.Tasks.Add(BufferPieces(data));
-
-                Task.WaitAll(data.Tasks.ToArray());
-                Task.WaitAll(data.Tasks.ToArray());
-            }
-
-            data.Context.Bitfile.Write(bitfield);
-
-            data.Reading.Dispose();
-            data.Writing.Dispose();
-
-            context.Callback.OnVerified(hash, bitfield);
+            context.Queue.Add(new Start(bitfield, 0));
         }

         public bool CanExecute(RepositoryTaskQueue queue)
         {
-            return true;
+            return queue.IsBlocked("all") == false;
         }

         public void Block(RepositoryTaskQueue queue)
         {
+            queue.Block("all");
         }

         public void Release(RepositoryTaskQueue queue)
@@ -88,179 +54,142 @@
             return reduced;
         }

-        private void AddWorker(TaskData data)
+        private class Start : RepositoryTask
         {
-            data.Tasks.Add(VerifyPieces(data));
+            private readonly HashAlgorithm algorithm;
+            private readonly Bitfield bitfield;
+            private readonly int piece;
+
+            public Start(Bitfield bitfield, int piece)
+            {
+                this.algorithm = SHA1.Create();
+                this.bitfield = bitfield;
+                this.piece = piece;
+            }
+
+            public bool CanExecute(RepositoryTaskQueue queue)
+            {
+                return true;
+            }
+
+            public void Execute(RepositoryContext context, RepositoryTaskCallback onCompleted)
+            {
+                context.View.Read(context.Buffer, piece, 0, args =>
+                {
+                    if (args.Count > 0 && context.View.Exists(args.Piece, args.Block + 1))
+                    {
+                        context.Queue.Add(new Continue(bitfield, algorithm, args));
+                    }
+                    else
+                    {
+                        context.Queue.Add(new Complete(bitfield, algorithm, args));
+                    }
+                });
+            }
+
+            public void Block(RepositoryTaskQueue queue)
+            {
+            }
+
+            public void Release(RepositoryTaskQueue queue)
+            {
+            }
         }

-        private Task BufferPieces(TaskData data)
+        private class Continue : RepositoryTask
         {
-            return Task.Run(() =>
+            private readonly Bitfield bitfield;
+            private readonly HashAlgorithm algorithm;
+            private readonly RepositoryViewRead read;
+
+            public Continue(Bitfield bitfield, HashAlgorithm algorithm, RepositoryViewRead read)
             {
-                int piece = 0;
-                MetainfoHash[] pieces = data.Context.Metainfo.Pieces;
+                this.bitfield = bitfield;
+                this.algorithm = algorithm;
+                this.read = read;
+            }

-                data.Writing.Wait();
-                RotatingEntry buffer = data.Buffer.Next();
-                RepositoryViewReadCallback callback = null;
+            public bool CanExecute(RepositoryTaskQueue queue)
+            {
+                return true;
+            }

-                callback = args =>
+            public void Execute(RepositoryContext context, RepositoryTaskCallback onCompleted)
+            {
+                algorithm.Push(read.Buffer.Data, read.Buffer.Offset, Math.Min(read.Buffer.Count, read.Count));
+
+                context.View.Read(context.Buffer, read.Piece, read.Block + 1, args =>
                 {
-                    lock (data.Pieces)
+                    if (args.Count > 0 && context.View.Exists(args.Piece, args.Block + 1))
                     {
-                        data.Pieces.Enqueue(new PieceData
-                        {
-                            Index = args.Piece,
-                            Hash = pieces[args.Piece],
-                            Data = buffer,
-                            Size = args.Count
-                        });
+                        context.Queue.Add(new Continue(bitfield, algorithm, args));
+                    }
+                    else
+                    {
+                        context.Queue.Add(new Complete(bitfield, algorithm, args));
+                    }
+                });
+            }

-                        if (data.Tasks.Count <= data.Pieces.Count)
-                        {
-                            AddWorker(data);
-                        }
-                    }
+            public void Block(RepositoryTaskQueue queue)
+            {
+            }

-                    piece = piece + 1;
-                    data.Reading.Release(1);
-
-                    if (pieces.Length > piece)
-                    {
-                        data.Writing.Wait();
-                        buffer = data.Buffer.Next();
-                        data.Context.View.Read(buffer.Bytes, piece, callback);
-                    }
-                };
-
-                data.Context.View.Read(buffer.Bytes, piece, callback);
-
-                //if (data.Scope[piece])
-                //{
-                //    seek = true;
-                //    piece++;
-                //}
-            });
+            public void Release(RepositoryTaskQueue queue)
+            {
+            }
         }

-        private Task VerifyPieces(TaskData data)
+        private class Complete : RepositoryTask
         {
-            return Task.Run(() =>
+            private readonly Bitfield bitfield;
+            private readonly HashAlgorithm algorithm;
+            private readonly RepositoryViewRead read;
+
+            public Complete(Bitfield bitfield, HashAlgorithm algorithm, RepositoryViewRead read)
             {
-                byte[] hash;
-                PieceData piece = null;
-                TimeSpan delay = TimeSpan.FromSeconds(2);
+                this.bitfield = bitfield;
+                this.algorithm = algorithm;
+                this.read = read;
+            }

-                do
+            public bool CanExecute(RepositoryTaskQueue queue)
+            {
+                return true;
+            }
+
+            public void Execute(RepositoryContext context, RepositoryTaskCallback onCompleted)
+            {
+                algorithm.Push(read.Buffer.Data, read.Buffer.Offset, Math.Min(read.Buffer.Count, read.Count));
+
+                Metainfo metainfo = context.Metainfo;
+                byte[] expected = metainfo.Pieces[read.Piece].ToBytes();
+
+                byte[] hash = algorithm.Complete();
+                bool result = Bytes.Equals(hash, expected);
+
+                bitfield[read.Piece] = result;
+                algorithm.Dispose();
+
+                if (context.View.Exists(read.Piece + 1, 0))
                 {
-                    if (data.Reading.Wait(delay))
-                    {
-                        lock (data.Pieces)
-                        {
-                            piece = data.Pieces.Dequeue();
-                        }
-
-                        using (HashAlgorithm algorithm = SHA1.Create())
-                        {
-                            algorithm.Push(piece.Data.Bytes, 0, piece.Size);
-                            hash = algorithm.Complete();
-                        }
-
-                        if (Bytes.Equals(hash, piece.Hash.ToBytes()))
-                        {
-                            lock (data.Bitfield)
-                            {
-                                data.Bitfield[piece.Index] = true;
-                            }
-                        }
-
-                        data.Buffer.Release(piece.Data);
-                        data.Writing.Release(1);
-
-                        lock (data)
-                        {
-                            data.Left--;
-                        }
-                    }
-                } while (data.Left > 0);
-            });
-        }
-
-        private class TaskData
-        {
-            public SemaphoreSlim Reading { get; set; }
-
-            public SemaphoreSlim Writing { get; set; }
-
-            public RepositoryContext Context { get; set; }
-
-            public Queue<PieceData> Pieces { get; set; }
-
-            public RotatingBuffer Buffer { get; set; }
-
-            public Bitfield Bitfield { get; set; }
-
-            public Bitfield Scope { get; set; }
-
-            public int Left { get; set; }
-
-            public List<Task> Tasks { get; set; }
-        }
-
-        private class PieceData
-        {
-            public int Index { get; set; }
-
-            public MetainfoHash Hash { get; set; }
-
-            public RotatingEntry Data { get; set; }
-
-            public int Size { get; set; }
-        }
-
-        private class RotatingBuffer
-        {
-            public readonly RotatingEntry[] entries;
-
-            public RotatingBuffer(int count, int size)
-            {
-                entries = new RotatingEntry[count];
-
-                for (int i = 0; i < count; i++)
+                    context.Queue.Add(new Start(bitfield, read.Piece + 1));
+                }
+                else
                 {
-                    entries[i] = new RotatingEntry
-                    {
-                        Available = true,
-                        Bytes = new byte[size]
-                    };
+                    onCompleted.Invoke(this);
+                    context.Callback.OnVerified(metainfo.Hash, bitfield);
                 }
             }

-            public RotatingEntry Next()
+            public void Block(RepositoryTaskQueue queue)
             {
-                for (int i = 0; i < entries.Length; i++)
-                {
-                    if (entries[i].Available)
-                    {
-                        entries[i].Available = false;
-                        return entries[i];
-                    }
-                }
-
-                return null;
             }

-            public void Release(RotatingEntry entry)
+            public void Release(RepositoryTaskQueue queue)
             {
-                entry.Available = true;
+                queue.Release("all");
             }
-        }
-
-        private class RotatingEntry
-        {
-            public bool Available { get; set; }
-
-            public byte[] Bytes { get; set; }
         }
     }
 }


Revert "write lights at the end yeppers"

This reverts commit 334ce0de

--- DataTool/SaveLogic/Map.cs
+++ DataTool/SaveLogic/Map.cs
@@ -101,7 +101,7 @@
                     writer.Write((uint) (SingleModels.Header.PlaceableCount + Models.Header.PlaceableCount +
                                          entitiesWithModelCount)); // nr details

-                    writer.Write(0); // nr Lights
+                    writer.Write(Lights.Header.PlaceableCount); // nr Lights

                     foreach (IMapPlaceable mapPlaceable in ModelGroups.Placeables ?? Array.Empty<IMapPlaceable>()) {
                         teMapPlaceableModelGroup modelGroup = (teMapPlaceableModelGroup) mapPlaceable;
@@ -206,6 +206,25 @@
                         writer.Write(entity.Header.Rotation);
                     }

+                    // Extension 1.1 - Lights
+                    foreach (IMapPlaceable mapPlaceable in Lights.Placeables ?? Array.Empty<IMapPlaceable>()) {
+                        var light = (teMapPlaceableLight) mapPlaceable;
+
+                        writer.Write(light.Header.Translation);
+                        writer.Write(light.Header.Rotation);
+
+                        writer.Write((uint) light.Header.Type);
+                        writer.Write(light.Header.LightFOV);
+                        writer.Write(light.Header.Color);
+                        writer.Write(light.Header.IntensityGUESS);
+
+                        writer.Write(light.Header.ProjectionTexture1);
+                        writer.Write(light.Header.ProjectionTexture2);
+
+                        FindLogic.Combo.Find(Info, light.Header.ProjectionTexture1);
+                        FindLogic.Combo.Find(Info, light.Header.ProjectionTexture2);
+                    }
+
                     writer.Write(Sounds.Header.PlaceableCount); // nr Sounds

                     // Extension 1.2 - Sounds
@@ -224,27 +243,7 @@
                         }
                     }

-                    writer.Write(Lights.Header.PlaceableCount);
-
-                    // Extension 2.0 - Lights
-                    foreach (IMapPlaceable mapPlaceable in Lights.Placeables ?? Array.Empty<IMapPlaceable>()) {
-                        var light = (teMapPlaceableLight) mapPlaceable;
-
-                        writer.Write(light.Header.Translation);
-                        writer.Write(light.Header.Rotation);
-
-                        writer.Write((uint) light.Header.Type);
-                        writer.Write(light.Header.LightFOV);
-                        writer.Write(light.Header.Color);
-                        writer.Write(light.Header.IntensityGUESS);
-
-                        writer.Write(light.Header.ProjectionTexture1);
-                        writer.Write(light.Header.ProjectionTexture2);
-
-                        FindLogic.Combo.Find(Info, light.Header.ProjectionTexture1);
-                        FindLogic.Combo.Find(Info, light.Header.ProjectionTexture2);
-                    }
-
+                    // Extension 1.3 - Effects
                     foreach (IMapPlaceable mapPlaceable in Effects.Placeables ?? Array.Empty<IMapPlaceable>()) {
                         var effect = (teMapPlaceableEffect) mapPlaceable;
                         FindLogic.Combo.Find(Info, effect.Header.Effect);


Don't flip when saving raw pixel bytes to an image

For development and debugging, the saved image should represent the real
layout of pixels.

--- test/TestUtil/Util.cs
+++ test/TestUtil/Util.cs
@@ -166,7 +166,7 @@

         public static void ShowImage(byte[] imageRawBytes, int width, int height, string path)
         {
-            using var image = CreateImage(imageRawBytes, width, height, flip: true);
+            using var image = CreateImage(imageRawBytes, width, height, flip: false);
             SaveImage(image, (string)path);
             SelectFileInExplorer((string)path);
             OpenImage((string)path);
@@ -174,7 +174,7 @@

         internal static void ShowImageNotOpenFolder(byte[] imageRawBytes, int width, int height, string path)
         {
-            using var image = CreateImage(imageRawBytes, width, height, flip: true);
+            using var image = CreateImage(imageRawBytes, width, height, flip: false);
             Util.SaveImage(image, path);
             Util.OpenImage(path);
         }


Re-fixed RotBetween

Re-fixed RotBetween

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@636 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife-cs/Helpers.cs
+++ libsecondlife-cs/Helpers.cs
@@ -258,7 +258,7 @@
     /// </summary>
     /// <param name="a">Directional vector, such as 1,0,0 for the forward face</param>
     /// <param name="b">Target vector - normalize first with VecNorm</param>
-    public LLQuaternion RotBetween(LLVector3 a, LLVector3 b)
+    public static LLQuaternion RotBetween(LLVector3 a, LLVector3 b)
     {
         //A and B should both be normalized
         //dotProduct is 0 if a and b are perpendicular. I think that's normal?


Add PostGet to various properties to the new class + MountainLion attributes

--- src/foundation-desktop.cs
+++ src/foundation-desktop.cs
@@ -527,6 +527,7 @@
 		NSObject TransformedValue (NSObject value);
 	}

+	[MountainLion]
 	[BaseType (typeof (NSObject))]
 	public interface NSUserNotification
 	{
@@ -579,6 +580,7 @@
 		NSString NSUserNotificationDefaultSoundName { get; }
 	}

+	[MountainLion]
 	[BaseType (typeof (NSObject),
 	           Delegates=new string [] {"WeakDelegate"},
 	Events=new Type [] { typeof (NSUserNotificationCenterDelegate) })]
@@ -596,25 +598,26 @@
 		[Export ("scheduledNotifications")]
 		NSUserNotification [] ScheduledNotifications { get; set; }

-		[Export ("scheduleNotification:")]
+		[Export ("scheduleNotification:")][PostGet ("ScheduledNotifications")]
 		void ScheduleNotification (NSUserNotification notification);

-		[Export ("removeScheduledNotification:")]
+		[Export ("removeScheduledNotification:")][PostGet ("ScheduledNotifications")]
 		void RemoveScheduledNotification (NSUserNotification notification);

 		[Export ("deliveredNotifications")]
 		NSUserNotification [] DeliveredNotifications { get; }

-		[Export ("deliverNotification:")]
+		[Export ("deliverNotification:")][PostGet ("DeliveredNotifications")]
 		void DeliverNotification (NSUserNotification notification);

-		[Export ("removeDeliveredNotification:")]
+		[Export ("removeDeliveredNotification:")][PostGet ("DeliveredNotifications")]
 		void RemoveDeliveredNotification (NSUserNotification notification);

-		[Export ("removeAllDeliveredNotifications")]
+		[Export ("removeAllDeliveredNotifications")][PostGet ("DeliveredNotifications")]
 		void RemoveAllDeliveredNotifications ();
 	}

+	[MountainLion]
 	[BaseType (typeof (NSObject))]
 	[Model]
 	public interface NSUserNotificationCenterDelegate


Features/IFeatureDependencyContext.cs documentation changes

--- src/Abp/Application/Features/IFeatureDependencyContext.cs
+++ src/Abp/Application/Features/IFeatureDependencyContext.cs
@@ -3,12 +3,12 @@
 namespace Abp.Application.Features
 {
     /// <summary>
-    /// Used in <see cref="IFeatureDependency.IsSatisfiedAsync"/> method.
+    /// Used in the <see cref="IFeatureDependency.IsSatisfiedAsync"/> method.
     /// </summary>
     public interface IFeatureDependencyContext
     {
         /// <summary>
-        /// Tenant id which required the feature.
+        /// Tenant id which requires the feature.
         /// Null for current tenant.
         /// </summary>
         int? TenantId { get; }


Added TransitionThreshold and PowerFactor properties.

--- src/Avalonia.Controls.PanAndZoom/ZoomBorder.Properties.cs
+++ src/Avalonia.Controls.PanAndZoom/ZoomBorder.Properties.cs
@@ -30,6 +30,18 @@
         /// </summary>
         public static StyledProperty<double> ZoomSpeedProperty =
             AvaloniaProperty.Register<ZoomBorder, double>(nameof(ZoomSpeed), 1.2, false, BindingMode.TwoWay);
+
+        /// <summary>
+        /// Identifies the <seealso cref="PowerFactor"/> avalonia property.
+        /// </summary>
+        public static StyledProperty<double> PowerFactorProperty =
+            AvaloniaProperty.Register<ZoomBorder, double>(nameof(PowerFactor), 1, false, BindingMode.TwoWay);
+
+        /// <summary>
+        /// Identifies the <seealso cref="TransitionThreshold"/> avalonia property.
+        /// </summary>
+        public static StyledProperty<double> TransitionThresholdProperty =
+            AvaloniaProperty.Register<ZoomBorder, double>(nameof(TransitionThreshold), 0.5, false, BindingMode.TwoWay);

         /// <summary>
         /// Identifies the <seealso cref="Stretch"/> avalonia property.
@@ -204,6 +216,24 @@
         }

         /// <summary>
+        /// Gets or sets the power factor used to transform the mouse wheel delta value.
+        /// </summary>
+        public double PowerFactor
+        {
+            get => GetValue(PowerFactorProperty);
+            set => SetValue(PowerFactorProperty, value);
+        }
+
+        /// <summary>
+        /// Gets or sets the threshold below which zoom operations will skip all transitions.
+        /// </summary>
+        public double TransitionThreshold
+        {
+            get => GetValue(TransitionThresholdProperty);
+            set => SetValue(TransitionThresholdProperty, value);
+        }
+
+        /// <summary>
         /// Gets or sets stretch mode.
         /// </summary>
         public StretchMode Stretch


IEventAggregator Registration fixed

IEventAggregator Registration fixed

--- src/Backend.Fx.Bootstrapping/Modules/ApplicationModule.cs
+++ src/Backend.Fx.Bootstrapping/Modules/ApplicationModule.cs
@@ -22,7 +22,7 @@
     public abstract class ApplicationModule : SimpleInjectorModule
     {
         private readonly Assembly[] assemblies;
-        private EventAggregator eventAggregator;
+        private IEventAggregator eventAggregator;

         protected ApplicationModule(params Assembly[] domainAssemblies)
         {
@@ -54,7 +54,7 @@

             // domain event subsystem
             container.RegisterCollection(typeof(IDomainEventHandler<>), assemblies);
-            container.RegisterSingleton(eventAggregator);
+            container.RegisterSingleton<IEventAggregator>(eventAggregator);

             // initial data generation subsystem
             container.RegisterCollection<InitialDataGenerator>(assemblies);


method call no longer necessary

method call no longer necessary

git-svn-id: fcce7d6ce0ac15bf24f68871b5145d46fc068279@2551 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Steps/ExpandDuckTypedExpressions.cs
+++ src/Boo.Lang.Compiler/Steps/ExpandDuckTypedExpressions.cs
@@ -317,11 +317,8 @@
 			Visit(node.NamedArguments);

 			MemberReferenceExpression target = node.Target as MemberReferenceExpression;
-			if (target == null)
-			{
-				ExpandCallableInvocation(node);
-				return;
-			}
+			if (target == null) return;
+
 			ExpandMemberInvocation(node, target, runtimeInvoke);
 		}


added logic to delete and count posts

added logic to delete and count posts

--- WordPressAutomation/Pages/ListPostPage.cs
+++ WordPressAutomation/Pages/ListPostPage.cs
@@ -1,24 +1,38 @@
-using OpenQA.Selenium;
+using System;
+using OpenQA.Selenium;
+using System.Linq;
+using System.Collections.ObjectModel;
+using OpenQA.Selenium.Interactions;

 namespace WordPressAutomation
 {
     public static class ListPostPage
     {
+        // lists the posts'last count
+        private static int lastCount;
+
+        // lists previous post count
+        public static int PreviousPostCount { get { return lastCount; } }
+
+        // lists current post count
+        public static object CurrentPostCount { get { return GetPostCount(); } }
+
         /**
-         *
+         * Navigates to a post/page and show all posts
          */
         public static void GoTo(PostType postType)
         {
             switch (postType)
             {
                 case PostType.Page:
+                case PostType.Posts:
                     LeftNavigation.Pages.AllPages.Select();
                     break;
             }
         }
-
+
         /**
-         *
+         * Select the career post
          */
         public static void SelectPost(string title)
         {
@@ -26,10 +40,64 @@
             postLink.Click();
         }

-        //
+        // different post types
         public enum PostType
         {
-            Page
+            Page,
+            Posts
+        }
+
+        /*
+         * Checks if a post with a given title exists
+         */
+        public static bool DoesPostExistWithTitle(string title)
+        {
+            return Driver.Instance.FindElements(By.LinkText(title)).Any();
+        }
+
+        /**
+         * Delete a post given by the title
+         */
+        public static void DeletePost(string title)
+        {
+            // retrieve the table rows
+            var rows = Driver.Instance.FindElements(By.TagName("tr"));
+
+            // loop through all table rows
+            foreach(var row in rows)
+            {
+                ReadOnlyCollection<IWebElement> links = null;
+
+                // retrive the links that match the provided title
+                links = row.FindElements(By.LinkText(title));
+
+                if(links.Count > 0)
+                {
+                    // hover over the selected link and click trash to delete post
+                    Actions action = new Actions(Driver.Instance);
+                    action.MoveToElement(links[0]);
+                    action.Perform();
+                    row.FindElement(By.ClassName("submitdelete")).Click();
+                    return;
+                }
+            }
+        }
+
+        /**
+         * Keeps record of posts added
+         */
+        public static void StoreCount()
+        {
+            lastCount = GetPostCount();
+        }
+
+        /**
+         * Retrieves the count of added posts
+         */
+        public static int GetPostCount()
+        {
+            var countText = Driver.Instance.FindElement(By.ClassName("displaying-num")).Text;
+            return int.Parse(countText.Split(' ')[0]);
         }
     }
 }


Ignore unknown attributes

Ignore unknown attributes

--- Classes/RadiusServer.cs
+++ Classes/RadiusServer.cs
@@ -181,9 +181,15 @@
             packetbytes[0] = (Byte)packet.Code;
             packetbytes[1] = packet.Identifier;

-
             foreach (var attribute in packet.Attributes)
             {
+                var attributeType = _dictionary.Attributes.SingleOrDefault(o => o.Value.Name == attribute.Key);
+                if (!_dictionary.Attributes.ContainsValue(attributeType.Value))
+                {
+                    _log.WarnFormat("Ignoring unknown attribute {0}", attribute.Key);
+                    continue;
+                }
+
                 var contentBytes = new Byte[0];
                 if (attribute.Value.GetType() == typeof(String))
                 {
@@ -200,16 +206,10 @@
                 }

                 var attributeLength = (Byte)(2 + contentBytes.Length);
-
-                // try a normal attribute
-                var attributeType = _dictionary.Attributes.SingleOrDefault(o => o.Value.Name == attribute.Key);
-
                 var attributeBytes = new Byte[attributeLength];
                 attributeBytes[0] = attributeType.Value.Value;
                 attributeBytes[1] = attributeLength;
                 Buffer.BlockCopy(contentBytes, 0, attributeBytes, 2, contentBytes.Length);
-
-
                 Array.Resize(ref packetbytes, packetbytes.Length + attributeBytes.Length);
                 Buffer.BlockCopy(attributeBytes, 0, packetbytes, packetbytes.Length - attributeBytes.Length, attributeBytes.Length);
             }


Fix for sitemap url

Fix for sitemap url

--- CmsEngine.Ui/Startup.cs
+++ CmsEngine.Ui/Startup.cs
@@ -156,7 +156,7 @@

                 routes.MapRoute(
                     name: "sitemap",
-                    template: "{slug}",
+                    template: "sitemap",
                     defaults: new { controller = "Home", action = "Sitemap" });

                 routes.MapRoute(


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -320,14 +320,26 @@
     #region Public Properties

     /// <summary>
-    /// Gets or sets the compression method used to compress a message on
-    /// the WebSocket connection.
-    /// </summary>
+    /// Gets or sets the compression method used to compress a message.
+    /// </summary>
+    /// <remarks>
+    /// The set operation does nothing if the connection has already been
+    /// established or it is closing.
+    /// </remarks>
     /// <value>
-    /// One of the <see cref="CompressionMethod"/> enum values that specifies
-    /// the compression method used to compress a message. The default value is
-    /// <see cref="CompressionMethod.None"/>.
+    ///   <para>
+    ///   One of the <see cref="CompressionMethod"/> enum values.
+    ///   </para>
+    ///   <para>
+    ///   It represents the compression method used to compress a message.
+    ///   </para>
+    ///   <para>
+    ///   The default value is <see cref="CompressionMethod.None"/>.
+    ///   </para>
     /// </value>
+    /// <exception cref="InvalidOperationException">
+    /// The set operation cannot be used by servers.
+    /// </exception>
     public CompressionMethod Compression {
       get {
         return _compression;


Clean up PreparedQuery stack

Clean up PreparedQuery stack

--- Consul/PreparedQuery.cs
+++ Consul/PreparedQuery.cs
@@ -171,9 +171,9 @@
             _client = c;
         }

-        public async Task<WriteResult<string>> Create(PreparedQueryDefinition query)
-        {
-            return await Create(query, WriteOptions.Default).ConfigureAwait(false);
+        public Task<WriteResult<string>> Create(PreparedQueryDefinition query)
+        {
+            return Create(query, WriteOptions.Default);
         }

         public async Task<WriteResult<string>> Create(PreparedQueryDefinition query, WriteOptions q)
@@ -186,54 +186,58 @@
             };
         }

-        public async Task<WriteResult> Delete(string queryID)
-        {
-            return await Delete(queryID, WriteOptions.Default).ConfigureAwait(false);
+        public Task<WriteResult> Delete(string queryID)
+        {
+            return Delete(queryID, WriteOptions.Default);
         }

         public async Task<WriteResult> Delete(string queryID, WriteOptions q)
         {
-            return await _client.Delete<string>(string.Format("/v1/query/{0}", queryID), q).Execute().ConfigureAwait(false);
-        }
-
-        public async Task<QueryResult<PreparedQueryExecuteResponse>> Execute(string queryIDOrName)
-        {
-            return await Execute(queryIDOrName, QueryOptions.Default).ConfigureAwait(false);
-        }
-
-        public async Task<QueryResult<PreparedQueryExecuteResponse>> Execute(string queryIDOrName, QueryOptions q)
-        {
-            return await _client.Get<PreparedQueryExecuteResponse>(string.Format("/v1/query/{0}/execute", queryIDOrName), q).Execute().ConfigureAwait(false);
-        }
-
-        public async Task<QueryResult<PreparedQueryDefinition[]>> Get(string queryID)
-        {
-            return await Get(queryID, QueryOptions.Default).ConfigureAwait(false);
-        }
-
-        public async Task<QueryResult<PreparedQueryDefinition[]>> Get(string queryID, QueryOptions q)
-        {
-            return await _client.Get<PreparedQueryDefinition[]>(string.Format("/v1/query/{0}", queryID), q).Execute().ConfigureAwait(false);
-        }
-
-        public async Task<QueryResult<PreparedQueryDefinition[]>> List()
-        {
-            return await List(QueryOptions.Default);
-        }
-
-        public async Task<QueryResult<PreparedQueryDefinition[]>> List(QueryOptions q)
-        {
-            return await _client.Get<PreparedQueryDefinition[]>("/v1/query", q).Execute().ConfigureAwait(false);
-        }
-
-        public async Task<WriteResult> Update(PreparedQueryDefinition query)
-        {
-            return await Update(query, WriteOptions.Default);
-        }
-
-        public async Task<WriteResult> Update(PreparedQueryDefinition query, WriteOptions q)
-        {
-            return await _client.Put(string.Format("/v1/query/{0}", query.ID), query, q).Execute().ConfigureAwait(false);
+            var res = await _client.Delete<string>(string.Format("/v1/query/{0}", queryID), q).Execute();
+            return new WriteResult
+            {
+                RequestTime = res.RequestTime
+            };
+        }
+
+        public Task<QueryResult<PreparedQueryExecuteResponse>> Execute(string queryIDOrName)
+        {
+            return Execute(queryIDOrName, QueryOptions.Default);
+        }
+
+        public Task<QueryResult<PreparedQueryExecuteResponse>> Execute(string queryIDOrName, QueryOptions q)
+        {
+            return _client.Get<PreparedQueryExecuteResponse>(string.Format("/v1/query/{0}/execute", queryIDOrName), q).Execute();
+        }
+
+        public Task<QueryResult<PreparedQueryDefinition[]>> Get(string queryID)
+        {
+            return Get(queryID, QueryOptions.Default);
+        }
+
+        public Task<QueryResult<PreparedQueryDefinition[]>> Get(string queryID, QueryOptions q)
+        {
+            return _client.Get<PreparedQueryDefinition[]>(string.Format("/v1/query/{0}", queryID), q).Execute();
+        }
+
+        public Task<QueryResult<PreparedQueryDefinition[]>> List()
+        {
+            return List(QueryOptions.Default);
+        }
+
+        public Task<QueryResult<PreparedQueryDefinition[]>> List(QueryOptions q)
+        {
+            return _client.Get<PreparedQueryDefinition[]>("/v1/query", q).Execute();
+        }
+
+        public Task<WriteResult> Update(PreparedQueryDefinition query)
+        {
+            return Update(query, WriteOptions.Default);
+        }
+
+        public Task<WriteResult> Update(PreparedQueryDefinition query, WriteOptions q)
+        {
+            return _client.Put(string.Format("/v1/query/{0}", query.ID), query, q).Execute();
         }
     }


Add ability to set headers on client connection

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -37,6 +37,7 @@
  * Contributors:
  * - Frank Razenberg <frank@zzattack.org>
  * - David Wood <dpwood@gmail.com>
+ * - Rob Myers <developer@robandjen.com>
  */
 #endregion

@@ -105,6 +106,7 @@
     private Uri                     _uri;
     private const string            _version = "13";
     private TimeSpan                _waitTime;
+    private NameValueCollection     _extraClientHeaders;

     #endregion

@@ -535,7 +537,35 @@
         }
       }
     }
-
+
+      /// <summary>
+      /// Get or set headers sent on the initial connect to the server
+      /// </summary>
+      /// <value>A <see cref="NameValueCollection"> of header values that will be added
+	  /// on connection. These will be overridden by anything used by the Websocket protocol
+	  ///</value>
+    public NameValueCollection ExtraClientHeaders
+    {
+        get
+        {
+            return _extraClientHeaders;
+        }
+        set
+        {
+            lock (_forConn)
+            {
+                var msg = checkIfAvailable(false, false);
+                if (msg != null)
+                {
+                    _logger.Error(msg);
+                    error("An error has occurred setting extra client headers", null);
+                    return;
+                }
+
+                _extraClientHeaders = value;
+            }
+        }
+    }
     #endregion

     #region Public Events
@@ -820,6 +850,10 @@
       var req = HttpRequest.CreateWebSocketRequest (_uri);

       var headers = req.Headers;
+        if (_extraClientHeaders != null)
+        {
+            headers.Add(_extraClientHeaders);
+        }
       if (!_origin.IsNullOrEmpty ())
         headers["Origin"] = _origin;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -1833,6 +1833,7 @@
     {
       if (value == null) {
         _compression = CompressionMethod.None;
+
         return;
       }


Fix broken links in guide because Chromium is an idiot

--- Core/Other/FormGuide.cs
+++ Core/Other/FormGuide.cs
@@ -9,6 +9,7 @@
 using TweetDuck.Core.Other.Analytics;
 using TweetDuck.Core.Utils;
 using System.Text.RegularExpressions;
+using TweetDuck.Resources;

 namespace TweetDuck.Core.Other{
     sealed partial class FormGuide : Form{
@@ -73,6 +74,7 @@

             browser.LoadingStateChanged += browser_LoadingStateChanged;
             browser.FrameLoadStart += browser_FrameLoadStart;
+            browser.FrameLoadEnd += browser_FrameLoadEnd;

             browser.BrowserSettings.BackgroundColor = (uint)BackColor.ToArgb();
             browser.Dock = DockStyle.None;
@@ -110,6 +112,11 @@
             BrowserUtils.SetZoomLevel(browser.GetBrowser(), Program.UserConfig.ZoomLevel);
         }

+        private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
+            // idiot chromium
+            ScriptLoader.ExecuteScript(e.Frame, "Array.prototype.forEach.call(document.getElementsByTagName('A'), ele => ele.addEventListener('click', e => { e.preventDefault(); window.open(ele.getAttribute('href')); }))", "gen:links");
+        }
+
         private void Config_ZoomLevelChanged(object sender, EventArgs e){
             BrowserUtils.SetZoomLevel(browser.GetBrowser(), Program.UserConfig.ZoomLevel);
         }


Removed a constructor from the WebSocket class

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -105,26 +105,10 @@

     #endregion

-    #region Private Constructors
-
-    private WebSocket ()
-    {
-      _compression = CompressionMethod.NONE;
-      _cookies = new CookieCollection ();
-      _extensions = String.Empty;
-      _forClose = new object ();
-      _forSend = new object ();
-      _protocol = String.Empty;
-      _readyState = WebSocketState.CONNECTING;
-    }
-
-    #endregion
-
     #region Internal Constructors

     // As server
     internal WebSocket (HttpListenerWebSocketContext context, Logger logger)
-      : this ()
     {
       _context = context;
       _logger = logger;
@@ -133,11 +117,12 @@
       _secure = context.IsSecureConnection;
       _stream = context.Stream;
       _uri = context.RequestUri;
+
+      init ();
     }

     // As server
     internal WebSocket (TcpListenerWebSocketContext context, Logger logger)
-      : this ()
     {
       _context = context;
       _logger = logger;
@@ -146,6 +131,8 @@
       _secure = context.IsSecureConnection;
       _stream = context.Stream;
       _uri = context.RequestUri;
+
+      init ();
     }

     #endregion
@@ -170,7 +157,6 @@
     /// <paramref name="url"/> is <see langword="null"/>.
     /// </exception>
     public WebSocket (string url, params string [] protocols)
-      : this ()
     {
       if (url == null)
         throw new ArgumentNullException ("url");
@@ -185,6 +171,8 @@
       _client = true;
       _logger = new Logger ();
       _secure = _uri.Scheme == "wss";
+
+      init ();
     }

     #endregion
@@ -810,6 +798,17 @@
       OnError.Emit (this, new ErrorEventArgs (message));
     }

+    private void init ()
+    {
+      _compression = CompressionMethod.NONE;
+      _cookies = new CookieCollection ();
+      _extensions = String.Empty;
+      _forClose = new object ();
+      _forSend = new object ();
+      _protocol = String.Empty;
+      _readyState = WebSocketState.CONNECTING;
+    }
+
     private void open ()
     {
       _readyState = WebSocketState.OPEN;


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2833,19 +2833,29 @@
     }

     /// <summary>
-    /// Sends text <paramref name="data"/> asynchronously using the WebSocket connection.
+    /// Sends the specified <paramref name="data"/> asynchronously using
+    /// the WebSocket connection.
     /// </summary>
     /// <remarks>
-    /// This method doesn't wait for the send to be complete.
+    /// This method does not wait for the send to be complete.
     /// </remarks>
     /// <param name="data">
     /// A <see cref="string"/> that represents the text data to send.
     /// </param>
     /// <param name="completed">
-    /// An <c>Action<bool></c> delegate that references the method(s) called when
-    /// the send is complete. A <see cref="bool"/> passed to this delegate is <c>true</c>
-    /// if the send is complete successfully.
-    /// </param>
+    /// An <c>Action<bool></c> delegate that invokes the method called when
+    /// the send is complete. A <see cref="bool"/> passed to this delegate will be
+    /// <c>true</c> if the send has done with no error.
+    /// </param>
+    /// <exception cref="InvalidOperationException">
+    /// The current state of the connection is not Open.
+    /// </exception>
+    /// <exception cref="ArgumentNullException">
+    /// <paramref name="data"/> is <see langword="null"/>.
+    /// </exception>
+    /// <exception cref="ArgumentException">
+    /// <paramref name="data"/> cannot be UTF8 encoded.
+    /// </exception>
     public void SendAsync (string data, Action<bool> completed)
     {
       if (_readyState != WebSocketState.Open) {


[Modify] Throw exceptions

[Modify] Throw exceptions

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2893,15 +2893,19 @@
     /// </param>
     public void SendAsync (Stream stream, int length, Action<bool> completed)
     {
-      var msg = _readyState.CheckIfAvailable (false, true, false, false) ??
-                CheckSendParameters (stream, length);
-
-      if (msg != null) {
-        _logger.Error (msg);
-        error ("An error has occurred in sending data.", null);
-
-        return;
-      }
+      if (_readyState != WebSocketState.Open) {
+        var msg = "The current state of the connection is not Open.";
+        throw new InvalidOperationException (msg);
+      }
+
+      if (stream == null)
+        throw new ArgumentNullException ("stream");
+
+      if (!stream.CanRead)
+        throw new ArgumentException ("Cannot be read.", "stream");
+
+      if (length < 1)
+        throw new ArgumentException ("Less than 1.", "length");

       stream.ReadBytesAsync (
         length,


[Modify] Remove it

[Modify] Remove it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2151,12 +2151,6 @@
       return value != null && value == CreateResponseKey (_base64Key);
     }

-    // As server
-    private bool validateSecWebSocketExtensionsClientHeader (string value)
-    {
-      return value == null || value.Length > 0;
-    }
-
     // As client
     private bool validateSecWebSocketExtensionsServerHeader (string value)
     {


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2201,10 +2201,10 @@
     /// </summary>
     /// <remarks>
     ///   <para>
-    ///   This method doesn't wait for the accept to be complete.
+    ///   This method does not wait for the accept to be complete.
     ///   </para>
     ///   <para>
-    ///   This method isn't available in a client.
+    ///   This method is not available in a client.
     ///   </para>
     /// </remarks>
     public void AcceptAsync ()


Updated method name

Updated method name

--- Core2D/Editor/Editor.cs
+++ Core2D/Editor/Editor.cs
@@ -491,7 +491,7 @@
                     return;

                 var db = _csvReader.Read(path);
-                _project.ApplyDatabase(database, db);
+                _project.UpdateDatabase(database, db);
             }
             catch (Exception ex)
             {


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -669,7 +669,7 @@
         }

         if (!_secure) {
-          var msg = "The connection is not secure.";
+          var msg = "This instance does not use a secure connection.";
           throw new InvalidOperationException (msg);
         }


Correcoes na Classe Ambiente

Correcoes na Classe Ambiente

--- CoreBolinha/Ambiente.cs
+++ CoreBolinha/Ambiente.cs
@@ -18,18 +18,16 @@
             Repository.Clone(origemPath, path);
         }

-        private List<String> PegaNomeDosArquivos()
+        public List<String> PegaNomeDosArquivos()
         {
-
-            return Directory.GetDirectories(path).SelectMany((dd) => Directory.GetFiles(dd)).Concat(Directory.GetFiles(path)).ToList();
+            return PegaDiretoriosInfinitamente(path);
         }

-        public List<String> PegaDiretoriosInfinitamente(String path)
+        private List<String> PegaDiretoriosInfinitamente(String path)
         {
-            if (path == this.path)
-                return PegaNomeDosArquivos();
-
-            return Directory.GetDirectories(path).ToList().SelectMany(()=> PegaNomeDosArquivos()).ToList();
+            return Directory.GetDirectories(path).
+                SelectMany((e) => PegaDiretoriosInfinitamente(e)).
+                Concat(Directory.GetFiles(path)).Where((nome) => !nome.Contains(".git")).ToList();
         }
     }
 }


Fix a null reference exception in BasicFieldNameLookup

--- src/Common/src/System/Data/Common/BasicFieldNameLookup.cs
+++ src/Common/src/System/Data/Common/BasicFieldNameLookup.cs
@@ -107,8 +107,7 @@

         private int LinearIndexOf(string fieldName, CompareOptions compareOptions)
         {
-            CompareInfo compareInfo = _compareInfo;
-            if (null == compareInfo)
+            if (null == _compareInfo)
             {
                 _compareInfo = GetCompareInfo();
             }
@@ -116,7 +115,7 @@
             int length = _fieldNames.Length;
             for (int i = 0; i < length; ++i)
             {
-                if (0 == compareInfo.Compare(fieldName, _fieldNames[i], compareOptions))
+                if (0 == _compareInfo.Compare(fieldName, _fieldNames[i], compareOptions))
                 {
                     _fieldNameLookup[fieldName] = i; // add an exact match for the future
                     return i;


Fixed breaking change in namespace resolution

--- src/DotVVM.Framework/Compilation/CompiledAssemblyCache.cs
+++ src/DotVVM.Framework/Compilation/CompiledAssemblyCache.cs
@@ -138,7 +138,7 @@
         public bool IsAssemblyNamespace(string fullName) => cache_AllNamespaces.Value.Contains(fullName);

         private HashSet<string> GetAllNamespaces()
-            => new HashSet<string>(GetReferencedAssemblies()
+            => new HashSet<string>(GetAllAssemblies()
                 .SelectMany(a => a.GetLoadableTypes()
                     .Select(t => t.Namespace))
                 .Distinct(), StringComparer.Ordinal);


added a page count combinator

added a page count combinator

--- Dapper.Compose/Query.cs
+++ Dapper.Compose/Query.cs
@@ -116,7 +116,7 @@
         }

         /// <summary>
-        /// Generate a count sub-query from
+        /// Generate a count query.
         /// </summary>
         /// <typeparam name="T">The type of query results.</typeparam>
         /// <param name="query">The query whose results we wish to count.</param>
@@ -129,6 +129,23 @@
             // generate a query alias
             var r = "count_" + Math.Abs(query.Sql.GetHashCode()) + "_" + Math.Abs(query.Read.GetHashCode()) + "_" + Math.Abs(query.ReadAsync.GetHashCode());
             return Single<int>($"select count(*) from ({query.Sql}) {r}");
+        }
+
+        /// <summary>
+        /// Generate a page count query.
+        /// </summary>
+        /// <typeparam name="T">The type of query results.</typeparam>
+        /// <param name="query">The query whose results we wish to count.</param>
+        /// <param name="pageSizeVar">The variable specifying the size of the page.</param>
+        /// <returns>A query that counts the results of the given query.</returns>
+        /// <remarks>
+        /// This uses a simple and portable SQL subquery to count the result set in number of pages.
+        /// </remarks>
+        public static Query<int> PageCount<T>(this Query<List<T>> query, string pageSizeVar = "@pageSize")
+        {
+            // generate a pseudo-unique query alias
+            var r = "pagecount_" + Math.Abs(query.Sql.GetHashCode()) + "_" + Math.Abs(query.Read.GetHashCode()) + "_" + Math.Abs(query.ReadAsync.GetHashCode());
+            return Single<int>($"select 1 + count(*)/{pageSizeVar} from ({query.Sql}) {r}");
         }

         /// <summary>
@@ -145,7 +162,7 @@
         /// </remarks>
         public static Query<List<T>> Paged<T>(this Query<List<T>> query, string rowColumn = "row", string pageSizeVar = "@pageSize", string pageVar = "@page")
         {
-            // generate a query alias
+            // generate a pseudo-unique query alias
             var r = "_paged_" + Math.Abs(query.Sql.GetHashCode()) + "_" + Math.Abs(query.Read.GetHashCode()) + "_" + Math.Abs(query.ReadAsync.GetHashCode());
             return List<T>($@"
 select {r}.*


Commenting out event subscriptions

Commenting out event subscriptions

--- src/GitHub.UI/Controls/AutoCompleteBox/AutoCompleteBox.cs
+++ src/GitHub.UI/Controls/AutoCompleteBox/AutoCompleteBox.cs
@@ -632,7 +632,7 @@
             if (textInput != null)
             {
                 UnsubscribeToEvent("SelectionChanged");
-                UnsubscribeToEvent("OnTextBoxTextChanged");
+//                UnsubscribeToEvent("OnTextBoxTextChanged");
             }

             textInput = value;
@@ -646,18 +646,18 @@
                     supportsShortcutOriginalValue = shortcutContainer.SupportsKeyboardShortcuts;
                 }

-                SubscribeToEvent("OnTextBoxTextChanged", ObserveTextBoxChanges()
-                    .Subscribe(shouldPopulate =>
-                    {
-                        if (shouldPopulate)
-                        {
-                            PopulateDropDown();
-                        }
-                        else
-                        {
-                            DismissDropDown();
-                        }
-                    }));
+//                SubscribeToEvent("OnTextBoxTextChanged", ObserveTextBoxChanges()
+//                    .Subscribe(shouldPopulate =>
+//                    {
+//                        if (shouldPopulate)
+//                        {
+//                            PopulateDropDown();
+//                        }
+//                        else
+//                        {
+//                            DismissDropDown();
+//                        }
+//                    }));

                 if (Text != null)
                 {
@@ -777,7 +777,7 @@
         {
             if (TextBox != null)
             {
-                UnsubscribeToEvent("PreviewKeyDown");
+//                UnsubscribeToEvent("PreviewKeyDown");
             }

             if (DropDownPopup != null)
@@ -811,7 +811,7 @@

             if (TextBox != null)
             {
-                SubscribeToEvent("PreviewKeyDown", TextBox.PreviewKeyDown.Subscribe(OnTextBoxPreviewKeyDown));
+//                SubscribeToEvent("PreviewKeyDown", TextBox.PreviewKeyDown.Subscribe(OnTextBoxPreviewKeyDown));
             }

             Interaction.OnApplyTemplateBase();


[VS Addin] Fix error handling on webserver startup error

We were previously clearing the output page after the error
message was printed meaning that the error was not showing
up in Visual Studio.  This error occurs if python.exe is not
found in PATH.

TEST=local testing
R=binji@chromium.org

Review URL: https://codereview.chromium.org/955443003

git-svn-id: e22621a84199d42b34715cdc089545aeedbbf23f@1580 050acbb0-2703-11df-ab0a-9f3f633ae91d

--- visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/WebServer.cs
+++ visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/WebServer.cs
@@ -67,6 +67,10 @@
           httpd = Path.Combine(properties.SDKRootDirectory, "tools", "httpd.py");
       string webServerArguments = httpd + " --no_dir_check " + webServerPort;

+      webServerOutputPane_.Clear();
+      webServerOutputPane_.OutputString(Strings.WebServerStartMessage + "\n");
+      webServerOutputPane_.Activate();
+
       // Start the web server process.
       try
       {
@@ -88,12 +92,7 @@
       {
         webServerOutputPane_.OutputString(Strings.WebServerStartFail + "\n");
         webServerOutputPane_.OutputString("Exception: " + e.Message + "\n");
-        webServerOutputPane_.Activate();
       }
-
-      webServerOutputPane_.Clear();
-      webServerOutputPane_.OutputString(Strings.WebServerStartMessage + "\n");
-      webServerOutputPane_.Activate();
     }

     /// <summary>


Modify the Objects lock inside Object.GetObject as it was being held too much.


Fix multiple figure cairo path

Fix multiple figure cairo path

--- src/Gtk/Avalonia.Cairo/Media/StreamGeometryContextImpl.cs
+++ src/Gtk/Avalonia.Cairo/Media/StreamGeometryContextImpl.cs
@@ -91,9 +91,6 @@
 			{
 				if (isClosed)
 					_context.ClosePath ();
-
-				Path = _context.CopyPath ();
-				Bounds = _context.FillExtents ().ToAvalonia ();
 			}
         }

@@ -105,7 +102,13 @@

         public void Dispose()
         {
-			_context.Dispose ();
+            if (this.Path == null)
+            {
+                Path = _context.CopyPath();
+                Bounds = _context.FillExtents().ToAvalonia();
+            }
+
+            _context.Dispose ();
 			_surf.Dispose ();
         }
     }


Convert Shelve to NDesk.Options.

Convert Shelve to NDesk.Options.

--- GitTfs/Commands/Shelve.cs
+++ GitTfs/Commands/Shelve.cs
@@ -4,7 +4,6 @@
 using System.IO;
 using System.Linq;
 using NDesk.Options;
-using CommandLine.OptParse;
 using Sep.Git.Tfs.Core;
 using StructureMap;

@@ -19,12 +18,7 @@
         private readonly CheckinOptions _checkinOptions;
         private readonly TfsWriter _writer;

-        [OptDef(OptValType.Flag)]
-        [ShortOptionName('p')]
-        [LongOptionName("evaluate-policies")]
-        [UseNameAsLongOption(false)]
-        [Description("Evaluate checkin policies")]
-        public bool EvaluateCheckinPolicies { get; set; }
+        private bool EvaluateCheckinPolicies { get; set; }

         public Shelve(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer)
         {
@@ -35,10 +29,17 @@

         public OptionSet OptionSet
         {
-            get { return new OptionSet(); }
+            get
+            {
+                return new OptionSet
+                {
+                    { "p|evaluate-policies", "Evaluate checkin policies (default: false)",
+                        v => EvaluateCheckinPolicies = v != null },
+                }.Merge(_checkinOptions.OptionSet);
+            }
         }

-        public IEnumerable<IOptionResults> ExtraOptions
+        public IEnumerable<CommandLine.OptParse.IOptionResults> ExtraOptions
         {
             get { return this.MakeNestedOptionResults(_checkinOptions); }
         }


Removed duplicate dependencies

Removed duplicate dependencies

--- packages.cake
+++ packages.cake
@@ -468,10 +468,7 @@
                 Dependencies = new []
                 {
                     new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
-                    new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", Version = parameters.Version },
-                    //netstandard1.3
-                    new NuSpecDependency() { Id = "Avalonia", TargetFramework = "netstandard1.3", Version = parameters.Version },
-                    new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", TargetFramework = "netstandard1.3", Version = parameters.Version }
+                    new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", Version = parameters.Version }
                 },
                 Files = new []
                 {


Add convenience function CopyFields

Add convenience function CopyFields

--- Harmony/Tools/Traverse.cs
+++ Harmony/Tools/Traverse.cs
@@ -287,6 +287,8 @@
 			AccessTools.GetPropertyNames(source).ForEach(f => action(f, sourceTrv.Property(f), targetTrv.Property(f)));
 		}

+		public static Action<Traverse, Traverse> CopyFields = (from, to) => { to.SetValue(from.GetValue()); };
+
 		public override string ToString()
 		{
 			var value = _method ?? GetValue();


Unit test failure fixed (HW-2)

Unit test failure fixed (HW-2)

--- HelloWorld.Lib/Library.cs
+++ HelloWorld.Lib/Library.cs
@@ -9,7 +9,7 @@
     {
         public string GetGreetings()
         {
-            return string.Empty;
+            return "Hello";
         }
     }
 }


Exclude Cake files from line span mapping

--- src/OmniSharp.Roslyn.CSharp/Helpers/LocationExtensions.cs
+++ src/OmniSharp.Roslyn.CSharp/Helpers/LocationExtensions.cs
@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.CodeAnalysis;
@@ -13,7 +14,9 @@
             if (!location.IsInSource)
                 throw new Exception("Location is not in the source tree");

-            var lineSpan = location.GetMappedLineSpan();
+            var lineSpan = Path.GetExtension(location.SourceTree.FilePath).Equals(".cake", StringComparison.OrdinalIgnoreCase)
+                ? location.GetLineSpan()
+                : location.GetMappedLineSpan();
             var path = lineSpan.Path;
             var documents = workspace.GetDocuments(path);


Check that the JPEG thumbnail length does not exceed header length. Fixes #46.

--- ExifLibrary/JPEGFile.cs
+++ ExifLibrary/JPEGFile.cs
@@ -645,6 +645,8 @@
                 {
                     if (thumbtype == 0)
                     {
+                        // Ensure that the thumbnail length does not exceed header length
+                        thumblength = Math.Min(thumblength, header.Length - tiffoffset - thumboffset);
                         using (MemoryStream ts = new MemoryStream(header, tiffoffset + thumboffset, thumblength))
                         {
                             Thumbnail = ImageFile.FromStream(ts);


Expose DropDatabase function

Expose DropDatabase function

--- Exodus.Core/Migrator.cs
+++ Exodus.Core/Migrator.cs
@@ -37,6 +37,13 @@
             _directoryParser = directoryParser;
             _assemblyParser = assemblyParser;
             _pipeline = new Pipeline();
+        }
+
+        public Migrator DropDatabase()
+        {
+            _pipeline.Setup.Add(async () => Log($"Drop database: {_database.Name}"));
+            _pipeline.Setup.Add(() => _database.DropIfExists());
+            return this;
         }

         public Migrator DropCreateDatabase()


minor calculation error

minor calculation error

--- src/PhilipsHueDSB/AdapterLib/HueLightingServiceHandler.cs
+++ src/PhilipsHueDSB/AdapterLib/HueLightingServiceHandler.cs
@@ -156,7 +156,7 @@
             set
             {
                 var command = new LightCommand();
-                command.Hue = (int)(value / 365d * 65535);
+                command.Hue = (int)(value / 360d * 65535);
                 _client.SendCommandAsync(command, new[] { _light.Id });
                 _light.State.Hue = (int)value;
             }


PP9-9519: Filter directly in search

PP9-9519: Filter directly in search

--- src/Picturepark.SDK.V1.Tests/Clients/NotificationTests.cs
+++ src/Picturepark.SDK.V1.Tests/Clients/NotificationTests.cs
@@ -151,14 +151,22 @@
             var result = await _client.Notification.SearchAsync(
                 new NotificationSearchRequest
                 {
+                    Filter = new AndFilter
+                    {
+                        Filters = new List<FilterBase>
+                        {
+                            FilterBase.FromExpression<Notification>(n => n.ReferenceDocType, "ShareDoc"),
+                            FilterBase.FromExpression<Notification>(n => n.ReferenceId, shareId),
+                        }
+                    },
                     Sort = new List<SortInfo>
                     {
                         new SortInfo { Field = "audit.creationDate", Direction = SortDirection.Desc }
                     },
-                    Limit = 500
+                    Limit = 1
                 }).ConfigureAwait(false);

-            return result.Results.Single(r => r.ReferenceDocType == "ShareDoc" && r.ReferenceId == shareId).Id;
+            return result.Results.Single().Id;
         }

         private async Task<string> CreateShareForNotification()


Add IInAppBilling implementation for UWP

--- src/Plugin.InAppBilling.UWP/InAppBillingImplementation.cs
+++ src/Plugin.InAppBilling.UWP/InAppBillingImplementation.cs
@@ -1,7 +1,10 @@
 using Plugin.InAppBilling.Abstractions;
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
+using System.Xml;
+using Windows.ApplicationModel.Store;

 namespace Plugin.InAppBilling
 {
@@ -10,57 +13,128 @@
     /// </summary>
     public class InAppBillingImplementation : IInAppBilling
     {
+        private bool testWithSimulator;
+
+        /// <param name="testWithSimulator">UWP offers a way to test in-app purchases with the CurrentAppSimulator class instead of CurrentApp.</param>
+        public InAppBillingImplementation(bool testWithSimulator = false)
+        {
+            this.testWithSimulator = testWithSimulator;
+        }
+
+        /// <summary>
+        /// Validation public key from App Store
+        /// </summary>
+        public string ValidationPublicKey { get; set; }
+
         /// <summary>
         /// Connect to billing service
         /// </summary>
         /// <returns>If Success</returns>
-        public Task<bool> ConnectAsync()
-        {
-            throw new NotImplementedException();
-        }
+        public Task<bool> ConnectAsync() => Task.FromResult(true);

         /// <summary>
         /// Disconnect from the billing service
         /// </summary>
         /// <returns>Task to disconnect</returns>
-        public Task DisconnectAsync()
+        public Task DisconnectAsync() => Task.CompletedTask;
+
+        public async Task<IEnumerable<InAppBillingProduct>> GetProductInfoAsync(ItemType itemType, params string[] productIds)
         {
-            throw new NotImplementedException();
+            // Get list of products from store or simulator
+            var listingInformation = testWithSimulator ? await CurrentAppSimulator.LoadListingInformationAsync() : await CurrentApp.LoadListingInformationAsync();
+
+            var products = new List<InAppBillingProduct>();
+            foreach (var productId in productIds)
+            {
+                // Check if requested product exists
+                if (!listingInformation.ProductListings.ContainsKey(productId))
+                    continue;
+
+                // Get product and transform it to an InAppBillingProduct
+                var product = listingInformation.ProductListings[productId];
+                products.Add(new InAppBillingProduct
+                {
+                    Name = product.Name,
+                    Description = product.Description,
+                    ProductId = product.ProductId,
+                    LocalizedPrice = product.FormattedPrice,
+                    //CurrencyCode = product.CurrencyCode // Does not work at the moment, as UWP throws an InvalidCastException when getting CurrencyCode
+                });
+            }
+
+            return products;
         }

-        /// <summary>
-        /// Get product information of a specific product
-        /// </summary>
-        /// <param name="productId">Sku or Id of the product(s)</param>
-        /// <param name="itemType">Type of product offering</param>
-        /// <returns></returns>
-        public Task<InAppBillingProduct> GetProductInfoAsync(ItemType itemType, params string[] productIds)
+        public async Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsync(ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase = null)
         {
-            throw new NotImplementedException();
+            // Get list of product receipts from store or simulator
+            var xmlReceipt = testWithSimulator ? await CurrentAppSimulator.GetAppReceiptAsync() : await CurrentApp.GetAppReceiptAsync();
+
+            // Transform it to list of InAppBillingPurchase
+            return xmlReceipt.ToInAppBillingPurchase(ProductPurchaseStatus.AlreadyPurchased);
         }

+        public async Task<InAppBillingPurchase> PurchaseAsync(string productId, ItemType itemType, string payload, IInAppBillingVerifyPurchase verifyPurchase = null)
+        {
+            // Get purchase result from store or simulator
+            var purchaseResult = testWithSimulator ? await CurrentAppSimulator.RequestProductPurchaseAsync(productId) : await CurrentApp.RequestProductPurchaseAsync(productId);
+
+            // Transform it to InAppBillingPurchase
+            return purchaseResult.ReceiptXml.ToInAppBillingPurchase(purchaseResult.Status).FirstOrDefault();
+        }
+    }
+
+    static class InAppBillingHelperUwp
+    {
         /// <summary>
-        /// Get all current purhcase for a specifiy product type.
+        /// Read purchase data out of the UWP Receipt XML
         /// </summary>
-        /// <param name="itemType">Type of product</param>
-        /// <param name="verifyPurchase">Interface to verify purchase</param>
-        /// <returns>The current purchases</returns>
-        public Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsync(ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase = null)
+        /// <param name="xml">Receipt XML</param>
+        /// <param name="status">Status of the purchase</param>
+        /// <returns>A list of purchases, the user has done</returns>
+        public static IEnumerable<InAppBillingPurchase> ToInAppBillingPurchase(this string xml, ProductPurchaseStatus status)
         {
-            throw new NotImplementedException();
-        }
+            var purchases = new List<InAppBillingPurchase>();

-        /// <summary>
-        /// Purchase a specific product or subscription
-        /// </summary>
-        /// <param name="productId">Sku or ID of product</param>
-        /// <param name="itemType">Type of product being requested</param>
-        /// <param name="payload">Developer specific payload</param>
-        /// <param name="verifyPurchase">Interface to verify purchase</param>
-        /// <returns></returns>
-        public Task<InAppBillingPurchase> PurchaseAsync(string productId, ItemType itemType, string payload, IInAppBillingVerifyPurchase verifyPurchase = null)
-        {
-            throw new NotImplementedException();
+            var xmlDoc = new XmlDocument();
+            xmlDoc.LoadXml(xml);
+
+            // Iterate through all ProductReceipt elements
+            var xmlProductReceipts = xmlDoc.GetElementsByTagName("ProductReceipt");
+            for (var i = 0; i < xmlProductReceipts.Count; i++)
+            {
+                var xmlProductReceipt = xmlProductReceipts[i];
+
+                // Create new InAppBillingPurchase with values from the xml element
+                var purchase = new InAppBillingPurchase();
+                purchase.Id = xmlProductReceipt.Attributes["Id"].Value;
+                purchase.TransactionDateUtc = Convert.ToDateTime(xmlProductReceipt.Attributes["PurchaseDate"].Value);
+                purchase.ProductId = xmlProductReceipt.Attributes["ProductId"].Value;
+                purchase.AutoRenewing = false; // Not supported by UWP yet
+
+                // Map native UWP status to PurchaseState
+                switch (status)
+                {
+                    case ProductPurchaseStatus.AlreadyPurchased:
+                    case ProductPurchaseStatus.Succeeded:
+                        purchase.State = PurchaseState.Purchased;
+                        break;
+                    case ProductPurchaseStatus.NotFulfilled:
+                        purchase.State = PurchaseState.Deferred;
+                        break;
+                    case ProductPurchaseStatus.NotPurchased:
+                        purchase.State = PurchaseState.Canceled;
+                        break;
+                    default:
+                        purchase.State = PurchaseState.Unknown;
+                        break;
+                }
+
+                // Add to list of purchases
+                purchases.Add(purchase);
+            }
+
+            return purchases;
         }
     }
 }


DavidBurns: Added Mac to the platforms

DavidBurns: Added Mac to the platforms

git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@8337 07704840-8298-11de-bf8c-fd130f914ac9

--- common/src/csharp/webdriver-common/Platform.cs
+++ common/src/csharp/webdriver-common/Platform.cs
@@ -17,8 +17,6 @@
 */

 using System;
-using System.Collections.Generic;
-using System.Text;

 namespace OpenQA.Selenium
 {
@@ -103,9 +101,10 @@
                     {
                         platformTypeValue = PlatformType.Vista;
                     }
-
-                    break;
-
+
+                    break;
+
+                // Thanks to a bug in Mono Mac and Linux will be treated the same  https://bugzilla.novell.com/show_bug.cgi?id=515570 but adding this in case
                 case PlatformID.MacOSX:
                     platformTypeValue = PlatformType.MacOSX;
                     break;
@@ -182,6 +181,11 @@
                     platformIsType = platformTypeValue == PlatformType.Windows || platformTypeValue == PlatformType.XP;
                     break;

+                // Thanks to a bug in Mono Mac and Linux need to be treated the same  https://bugzilla.novell.com/show_bug.cgi?id=515570 but adding this in case
+                case PlatformType.MacOSX:
+                    platformIsType = platformTypeValue == PlatformType.MacOSX;
+                    break;
+
                 case PlatformType.Linux:
                     platformIsType = platformTypeValue == PlatformType.Linux || platformTypeValue == PlatformType.Unix;
                     break;


removed dumping data in general

removed dumping data in general

--- HiiPackage.cs
+++ HiiPackage.cs
@@ -58,6 +58,7 @@
         #endregion
     }

+    #region Definitions for Forms Package (Section 27.3.8)
     /// <summary>
     /// Hii package class for Forms
     /// </summary>
@@ -196,7 +197,7 @@
                     */
                     #endregion
                     default:
-                        raw_data.DumpToDebugConsole(ifr_hdr.OpCode.ToString());
+                        //raw_data.DumpToDebugConsole(ifr_hdr.OpCode.ToString());
                         PrintConsoleMsg(IfrErrorSeverity.UNIMPLEMENTED, ifr_hdr.OpCode.ToString());
                         hpk_element = new HiiIfrOpCode<EFI_IFR_OP_HEADER>(raw_data);
                         break;
@@ -286,4 +287,5 @@
             data_payload.IncreaseOffset(this._Header.GetPhysSize());
         }
     }
+    #endregion
 }


fix for route parameter mapping typo

fix for route parameter mapping typo

--- src/SFA.DAS.EAS.Api/Controllers/EmployerUserController.cs
+++ src/SFA.DAS.EAS.Api/Controllers/EmployerUserController.cs
@@ -6,7 +6,7 @@

 namespace SFA.DAS.EAS.Api.Controllers
 {
-    [RoutePrefix("api/user/{userId}")]
+    [RoutePrefix("api/user/{userRef}")]
     public class EmployerUserController : ApiController
     {
         private readonly UsersOrchestrator _orchestrator;


Add missing PlatformSpecific attribute to ProcessStart_OnLinux_UsesSpecifiedProgram test (#38228)

--- src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
+++ src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
@@ -301,6 +301,7 @@
         }

         [Fact]
+        [PlatformSpecific(TestPlatforms.Linux)]
         public void ProcessStart_OnLinux_UsesSpecifiedProgram()
         {
             const string Program = "sleep";