UWP does noet like

UWP does noet like

--- src/HtmlLabel/UWP/HtmlTextBehavior.cs
+++ src/HtmlLabel/UWP/HtmlTextBehavior.cs
@@ -60,19 +60,19 @@
 		private void UpdateText()
 		{
 			if (AssociatedObject == null)
-            {
-                return;
-            }
-
-            if (string.IsNullOrEmpty(AssociatedObject.Text))
-            {
-                return;
-            }
-
-            var text = AssociatedObject.Text;
-
-            // Just incase we are not given text with elements.
-            var modifiedText = $"
{text}
";
+			{
+				return;
+			}
+
+			if (string.IsNullOrEmpty(AssociatedObject.Text))
+			{
+				return;
+			}
+
+			var text = AssociatedObject.Text;
+
+			// Just incase we are not given text with elements.
+			var modifiedText = $"
{text}
";

 			var linkRegex = new Regex(@"<a\s+href=""(.+?)\""");

@@ -91,31 +91,34 @@
 				System.Diagnostics.Debug.WriteLine(@$"ERROR: ${matches}");
 			}

-			modifiedText = Regex.Replace(modifiedText, "
", "

", RegexOptions.IgnoreCase);
+			modifiedText = Regex.Replace(modifiedText, "
", "

", RegexOptions.IgnoreCase)
+				.Replace("\n", String.Empty, StringComparison.OrdinalIgnoreCase)  // KWI-FIX Enters resulted in multiple lines
+				.Replace(" ", " ", StringComparison.OrdinalIgnoreCase); // KWI-FIX   is not supported by the UWP TextBlock
+
 			// reset the text because we will add to it.
 			AssociatedObject.Inlines.Clear();

-            var element = XElement.Parse(modifiedText);
-            ParseText(element, AssociatedObject.Inlines, _label);
-
-            AssociatedObject.LayoutUpdated -= OnAssociatedObjectLayoutUpdated;
+			var element = XElement.Parse(modifiedText);
+			ParseText(element, AssociatedObject.Inlines, _label);
+
+			AssociatedObject.LayoutUpdated -= OnAssociatedObjectLayoutUpdated;
 			AssociatedObject.Loaded -= OnAssociatedObjectLoaded;
 		}

 		private static void ParseText(XElement element, InlineCollection inlines, HtmlLabel label)
 		{
 			if (element == null)
-            {
-                return;
-            }
-
-            InlineCollection currentInlines = inlines;
+			{
+				return;
+			}
+
+			InlineCollection currentInlines = inlines;
 			var elementName = element.Name.ToString().ToUpperInvariant();
 			switch (elementName)
 			{
 				case _elementA:
 					var link = new Hyperlink();
-                    XAttribute href = element.Attribute("href");
+					XAttribute href = element.Attribute("href");
 					var unescapedUri = Uri.UnescapeDataString(href?.Value);
 					if (href != null)
 					{
@@ -137,7 +140,7 @@
 					if (!label.UnderlineText)
 					{
 						link.UnderlineStyle = UnderlineStyle.None;
-					}
+					}
 					inlines.Add(link);
 					currentInlines = link.Inlines;
 					break;
@@ -178,7 +181,7 @@
 					break;
 				case _elementUl:
 				case _elementDiv:
-                    _ = AddLineBreakIfNeeded(inlines);
+					_ = AddLineBreakIfNeeded(inlines);
 					var divSpan = new Span();
 					inlines.Add(divSpan);
 					currentInlines = divSpan.Inlines;
@@ -205,11 +208,11 @@
 		private static bool AddLineBreakIfNeeded(InlineCollection inlines)
 		{
 			if (inlines.Count <= 0)
-            {
-                return false;
-            }
-
-            Inline lastInline = inlines[inlines.Count - 1];
+			{
+				return false;
+			}
+
+			Inline lastInline = inlines[inlines.Count - 1];
 			while ((lastInline is Span))
 			{
 				var span = (Span)lastInline;
@@ -220,11 +223,11 @@
 			}

 			if (lastInline is LineBreak)
-            {
-                return false;
-            }
-
-            inlines.Add(new LineBreak());
+			{
+				return false;
+			}
+
+			inlines.Add(new LineBreak());
 			return true;
 		}
 	}


app exit, thread does not exit.

app exit, thread does not exit.

InputManager.Dispose is called, but windowThread is not over.

--- src/Pluralinput.Sdk/Pluralinput.Sdk/WindowCreator.cs
+++ src/Pluralinput.Sdk/Pluralinput.Sdk/WindowCreator.cs
@@ -101,7 +101,7 @@
                 UpdateWindow(hwnd);

                 MSG msg;
-                while (GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
+                while (!isDisposed && GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
                 {
                     TranslateMessage(ref msg);
                     DispatchMessage(ref msg);
@@ -140,6 +140,7 @@
                     DestroyWindow(windowHandle);
                     windowHandle = IntPtr.Zero;
                 }
+                isDisposed = true;
             }
         }
     }


Fix issue where Cors was not working

Fix issue where Cors was not working

--- src/Satrabel.OpenApp.Web/Startup/MvcModuleStartup.cs
+++ src/Satrabel.OpenApp.Web/Startup/MvcModuleStartup.cs
@@ -34,7 +34,7 @@
 {
     public class MvcModuleStartup<TModule> where TModule : AbpModule
     {
-        private const string DefaultCorsPolicyName = "localhost";
+        private const string DefaultCorsPolicyName = "DefaultPolicy";
         private readonly IConfigurationRoot _appConfiguration;
         private readonly bool CorsEnabled = false;
         private readonly bool SwaggerEnabled = false;
@@ -118,6 +118,9 @@
             migrationManager.HostingEnvironment = env;
             migrationManager.AppVersion = AppVersion;
             app.UseAbp(); //Initializes ABP framework.
+
+            app.UseCors(DefaultCorsPolicyName);
+
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();


Update `LoggerSinkConfiguration.Wrap()` to use `AggregateSink` Relates to #1441

--- src/Serilog/Configuration/LoggerSinkConfiguration.cs
+++ src/Serilog/Configuration/LoggerSinkConfiguration.cs
@@ -252,7 +252,7 @@

             var enclosed = sinksToWrap.Count == 1 ?
                 sinksToWrap.Single() :
-                new SafeAggregateSink(sinksToWrap);
+                new AggregateSink(sinksToWrap);

             var wrappedSink = wrapSink(enclosed);


get random photos from cache

get random photos from cache

--- src/Maw.Domain/Photos/PhotoService.cs
+++ src/Maw.Domain/Photos/PhotoService.cs
@@ -22,14 +22,19 @@
         _cache = cache ?? throw new ArgumentNullException(nameof(cache));
     }

-    public Task<Photo?> GetRandomAsync(string[] roles)
+    public async Task<Photo?> GetRandomAsync(string[] roles)
     {
-        return _repo.GetRandomAsync(roles);
+        var result = await GetRandomAsync(1, roles);
+
+        return result.Any() ? result.First() : null;
     }

     public async Task<IEnumerable<Photo>> GetRandomAsync(byte count, string[] roles)
     {
-        var photos = await _repo.GetRandomAsync(count, roles);
+        var photos = await GetCachedValueAsync(
+            () => _cache.GetRandomPhotosAsync(roles, count),
+            () => _repo.GetRandomAsync(count, roles)
+        );

         return photos ?? new List<Photo>();
     }


BL-10341 Hide image resolution message

BL-10341 Hide image resolution message

* in Collection tab book preview

--- src/BloomExe/Book/Book.cs
+++ src/BloomExe/Book/Book.cs
@@ -766,6 +766,7 @@

 			// Not needed for preview mode, so just remove them to reduce memory usage.
 			PreventVideoAutoLoad(previewDom);
+			RemoveImageResolutionMessage(previewDom);

 			_previewDom = previewDom;
 			return previewDom;
@@ -2533,7 +2534,7 @@
 		/// just clicking on a book, only if we really look through them.
 		/// </summary>
 		/// <param name="dom">The dom containing the video elements.</param>
-		private void PreventVideoAutoLoad(HtmlDom dom)
+		private static void PreventVideoAutoLoad(HtmlDom dom)
 		{

 			var videos = dom.SelectVideoSources();
@@ -2545,6 +2546,21 @@
 				videoTag?.SetAttribute("preload", "none");
 			}

+		}
+
+		/// <summary>
+		/// It's annoying to put your mouse in the preview pane in Collections tab and get a long image resolution
+		/// message popping up. So here we delete the title attribute from any image-container divs. (BL-10341)
+		/// This is only used in the preview.
+		/// Review: This works, but I'm not really "up" on the preview process. Should this go in bookPreview.ts?
+		/// </summary>
+		private static void RemoveImageResolutionMessage(HtmlDom dom)
+		{
+			var imageContainerList = dom.Body.SafeSelectNodes("//div[contains(@class,'bloom-imageContainer')]");
+			foreach (XmlElement imageContainer in imageContainerList)
+			{
+				imageContainer.RemoveAttribute("title");
+			}
 		}

 		public IEnumerable<IPage> GetPages()


Updates previous commit with missing using

--- src/SourceBrowser.Site/Models/GithubRepoStructure.cs
+++ src/SourceBrowser.Site/Models/GithubRepoStructure.cs
@@ -1,6 +1,7 @@
 namespace SourceBrowser.Site.Models
 {
     using SourceBrowser.SolutionRetriever;
+    using System;
     using System.Collections.Generic;

     [Serializable]


Use correct hostnames for each type of request.

--- src/Calculator/Program.cs
+++ src/Calculator/Program.cs
@@ -13,12 +13,13 @@
 {
 	class Program
 	{
-		private static string ETRADE_BASE_URL = "https://us.etrade.com/";
-
 		public static void Main (string[] args)
 		{
 			Can_Authenticate_With_OAuth();
 		}
+
+		private static string OAUTH_ENDPOINT = "https://etws.etrade.com/oauth";
+		//private static string OAUTH_ENDPOINT = "https://etwssandbox.etrade.com/oauth";

 		[JsonObject]
 		public class Secret
@@ -34,15 +35,14 @@
 			var secret = JsonConvert.DeserializeObject<Secret>(File.ReadAllText(Path.Combine("/home/warren/Desktop/git_repos/e-trade-calculator/secrets", "secrets.json")));
 			var consumerKey = secret.Key;
 			var consumerSecret = secret.ConsumerSecret;
-			var baseUrl = new Uri(ETRADE_BASE_URL);

-			var client = new RestClient(baseUrl);
-			client.Authenticator = OAuth1Authenticator.ForRequestToken(consumerKey, consumerSecret, "oob");
-			var request = new RestRequest("oauth/request_token", Method.POST);
+			var oauth_client = new RestClient(OAUTH_ENDPOINT);
+			oauth_client.Authenticator = OAuth1Authenticator.ForRequestToken(consumerKey, consumerSecret, "oob");
+			var request = new RestRequest("request_token", Method.POST);

 			request.AddHeader("Accept", "application/json");

-			var response = client.Execute(request);
+			var response = oauth_client.Execute(request);

 			if(response.StatusCode != HttpStatusCode.OK)
 			{
@@ -53,30 +53,36 @@
 			var oauth_token = qs["oauth_token"];
 			var oauth_token_secret = qs["oauth_token_secret"];

-			request = new RestRequest("e/t/etws/authorize"); //oauth/authorize");
+			var authorize_client = new RestClient("https://us.etrade.com/");
+			request = new RestRequest("e/t/etws/authorize");
 			request.AddParameter("token", oauth_token);
 			request.AddParameter("key", consumerKey);
-			var url = client.BuildUri(request).ToString();
+			var url = authorize_client.BuildUri(request).ToString();
 			Process.Start(url);
 			var verifier = "123456"; // <-- Breakpoint here (set verifier in debugger)
-			request = new RestRequest("oauth/access_token", Method.POST);
-			client.Authenticator = OAuth1Authenticator.ForAccessToken(
+			request = new RestRequest("access_token", Method.POST);
+			oauth_client.Authenticator = OAuth1Authenticator.ForAccessToken(
 				consumerKey, consumerSecret, oauth_token, oauth_token_secret, verifier
 			);
-			response = client.Execute(request);
+			response = oauth_client.Execute(request);
 			if(response.StatusCode != HttpStatusCode.OK)
 			{
 				Console.WriteLine("{0} {1}: {2}", response.StatusCode, response.StatusDescription, response.Content);
+				return;
 			}
 			qs = HttpUtility.ParseQueryString(response.Content);
 			oauth_token = qs["oauth_token"];
 			oauth_token_secret = qs["oauth_token_secret"];

-			request = new RestRequest("e/t/etws/authorize");
-			client.Authenticator = OAuth1Authenticator.ForProtectedResource(
+			var resource_client = new RestClient("https://etrade.com/market/rest/");
+			//var resource_client = new RestClient("https://etwssandbox.etrade.com/market/sandbox/rest/");
+			request = new RestRequest("quote/AAPL");
+			resource_client.Authenticator = OAuth1Authenticator.ForProtectedResource(
 				consumerKey, consumerSecret, oauth_token, oauth_token_secret
 			);
-			response = client.Execute(request);
+
+			request.AddHeader("Accept", "application/json");
+			response = resource_client.Execute(request);
 			if(response.StatusCode != HttpStatusCode.OK)
 			{
 				Console.WriteLine("{0} {1}: {2}", response.StatusCode, response.StatusDescription, response.Content);


game stage manager access from behavior

game stage manager access from behavior

--- src/Coldsteel/Behavior.cs
+++ src/Coldsteel/Behavior.cs
@@ -27,6 +27,11 @@
         /// Gets or sets the input provided to this Behavior for updates.
         /// </summary>
         public Input Input { get { return this.GameObject.Input; } }
+
+        /// <summary>
+        /// Gets the GameStageManager
+        /// </summary>
+        public GameStageManager GameStageManager { get { return GameObject.GameStage.GameStageManager; } }

         /// <summary>
         /// Adds a GameObject to the Stage without added it to the GameObject of this Behavior


set default receipt event

set default receipt event

--- src/Takenet.MessagingHub.Client/Host/Bootstrapper.cs
+++ src/Takenet.MessagingHub.Client/Host/Bootstrapper.cs
@@ -85,7 +85,10 @@
             if (application.Throughput != 0) builder = builder.WithThroughput(application.Throughput);
             if (application.DisableNotify) builder = builder.WithAutoNotify(false);
             if (application.ChannelCount.HasValue) builder = builder.WithChannelCount(application.ChannelCount.Value);
-            if (application.ReceiptEvents != null) builder = builder.WithReceiptEvents(application.ReceiptEvents);
+            if (application.ReceiptEvents != null)
+                builder = builder.WithReceiptEvents(application.ReceiptEvents);
+            else
+                builder = builder.WithReceiptEvents(new[] { Event.Failed });

             if (typeResolver == null) typeResolver = TypeResolver.Instance;


Bump version

Bump version

--- src/CommonAssemblyInfo.cs
+++ src/CommonAssemblyInfo.cs
@@ -28,7 +28,7 @@
 #if !PORTABLE
 [assembly : ComVisible(false)]
 #endif
-[assembly : AssemblyVersion("5.0.0.1")]
-[assembly : AssemblyFileVersion("5.0.0.1")]
+[assembly : AssemblyVersion("5.1.0.0")]
+[assembly : AssemblyFileVersion("5.1.0.0")]
 [assembly: CLSCompliant(true)]
 [assembly: System.Resources.NeutralResourcesLanguage("en")]


Uncomment and fix helper functions in StreamTestUtils.

--- src/TesterInternal/StreamingTests/StreamTestUtils.cs
+++ src/TesterInternal/StreamingTests/StreamTestUtils.cs
@@ -1,56 +1,61 @@
-using Orleans;
+using System;
+using System.Threading.Tasks;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Orleans;
+using Orleans.Runtime;
 using Orleans.Streams;
+using Orleans.TestingHost;

 namespace UnitTests.StreamingTests
 {
     internal class StreamTestUtils
     {
-        //not referenced current migrating.
-        //internal static void LogStartTest(string testName, Guid streamId, string streamProviderName, Logger logger)
-        //{
-        //    SiloAddress primSilo = UnitTestBase.Primary.Silo.SiloAddress;
-        //    SiloAddress secSilo = UnitTestBase.Secondary != null ? UnitTestBase.Secondary.Silo.SiloAddress : null;
-        //    logger.Info("\n\n**START********************** {0} ********************************* \n\n"
-        //                + "Running with initial silos Primary={1} Secondary={2} StreamId={3} StreamType={4} \n\n",
-        //        testName, primSilo, secSilo, streamId, streamProviderName);
-        //}
+        public const string AZURE_QUEUE_STREAM_PROVIDER_NAME = "AzureQueueProvider";

-        //internal static void LogEndTest(string testName, Logger logger)
-        //{
-        //    logger.Info("\n\n--END------------------------ {0} --------------------------------- \n\n", testName);
-        //}
+        internal static void LogStartTest(string testName, Guid streamId, string streamProviderName, Logger logger)
+        {
+            SiloAddress primSilo = TestingSiloHost.Primary.Silo.SiloAddress;
+            SiloAddress secSilo = TestingSiloHost.Secondary != null ? TestingSiloHost.Secondary.Silo.SiloAddress : null;
+            logger.Info("\n\n**START********************** {0} ********************************* \n\n"
+                        + "Running with initial silos Primary={1} Secondary={2} StreamId={3} StreamType={4} \n\n",
+                testName, primSilo, secSilo, streamId, streamProviderName);
+        }
+
+        internal static void LogEndTest(string testName, Logger logger)
+        {
+            logger.Info("\n\n--END------------------------ {0} --------------------------------- \n\n", testName);
+        }

         internal static IStreamPubSub GetStreamPubSub()
         {
             return GrainClient.CurrentStreamProviderRuntime.PubSub(StreamPubSubType.ExplicitGrainBasedAndImplicit);
         }

+        internal static async Task CheckPubSubCounts(string when, int expectedPublisherCount, int expectedConsumerCount, Guid streamId, string streamProviderName, string streamNamespace)
+        {
+            var pubSub = GetStreamPubSub();

-        //internal static async Task CheckPubSubCounts(string when, int expectedPublisherCount, int expectedConsumerCount, Guid streamId, string streamProviderName, string streamNamespace)
-        //{
-        //    var pubSub = GetStreamPubSub();
+            int consumerCount = await pubSub.ConsumerCount(streamId, streamProviderName, streamNamespace);

-        //    int consumerCount = await pubSub.ConsumerCount(streamId, streamProviderName, streamNamespace);
+            Assert_AreEqual(expectedConsumerCount, consumerCount, "{0} - ConsumerCount for stream {1} = {2}",
+                when, streamId, consumerCount);

-        //    Assert_AreEqual(expectedConsumerCount, consumerCount, "{0} - ConsumerCount for stream {1} = {2}",
-        //        when, streamId, consumerCount);
+            int publisherCount = await pubSub.ProducerCount(streamId, streamProviderName, streamNamespace);

-        //    int publisherCount = await pubSub.ProducerCount(streamId, streamProviderName, streamNamespace);
+            Assert_AreEqual(expectedPublisherCount, publisherCount, "{0} - PublisherCount for stream {1} = {2}",
+                when, streamId, publisherCount);
+        }

-        //    Assert_AreEqual(expectedPublisherCount, publisherCount, "{0} - PublisherCount for stream {1} = {2}",
-        //        when, streamId, publisherCount);
-        //}
-
-        //internal static void Assert_AreEqual(int expected, int actual, string msg, params object[] args)
-        //{
-        //    // expected == -1 means don't care / don't assert check value.
-        //    string prefix = expected == -1 ? "Not-checked" : actual == expected ? "True" : "FALSE";
-        //    string fmtMsg = String.Format("--> {0}: ", prefix) + String.Format(msg, args);
-        //    Console.WriteLine(fmtMsg);
-        //    if (expected != -1)
-        //    {
-        //        Assert.AreEqual(expected, actual, msg, args);
-        //    }
-        //}
+        internal static void Assert_AreEqual(int expected, int actual, string msg, params object[] args)
+        {
+            // expected == -1 means don't care / don't assert check value.
+            string prefix = expected == -1 ? "Not-checked" : actual == expected ? "True" : "FALSE";
+            string fmtMsg = String.Format("--> {0}: ", prefix) + String.Format(msg, args);
+            Console.WriteLine(fmtMsg);
+            if (expected != -1)
+            {
+                Assert.AreEqual(expected, actual, msg, args);
+            }
+        }
     }
 }


Truncate stream when writing sidecar XMP files.

--- src/Utils/SidecarXmpExtensions.cs
+++ src/Utils/SidecarXmpExtensions.cs
@@ -36,6 +36,7 @@
             var xmp = xmp_tag.Render ();

             using (var stream = resource.WriteStream) {
+                stream.SetLength (0);
                 using (var writer = new StreamWriter (stream)) {
                     writer.Write (xmp);
                 }


NH-3759 Replaced misspelled word "seperator" for "separator".

--- src/NHibernate/Id/UUIDHexGenerator.cs
+++ src/NHibernate/Id/UUIDHexGenerator.cs
@@ -17,17 +17,17 @@
 	///
 	///	<generator class="uuid.hex">
 	///		<param name="format">format_string</param>
-	///		<param name="seperator">seperator_string</param>
+	///		<param name="separator">separator_string</param>
 	///	</generator>
 	///
 	///

 	///

-	/// The <c>format</c> and <c>seperator</c> parameters are optional.
+	/// The <c>format</c> and <c>separator</c> parameters are optional.
 	///

 	///

 	/// The identifier string will consist of only hex digits.  Optionally, the identifier string
-	/// may be generated with enclosing characters and seperators between each component
-	/// of the UUID.  If there are seperators then the string length will be 36.  If a format
+	/// may be generated with enclosing characters and separators between each component
+	/// of the UUID.  If there are separators then the string length will be 36.  If a format
 	/// that has enclosing brackets is used, then the string length will be 38.
 	///

 	///

@@ -40,9 +40,9 @@
 	/// If no <c>format</c> is specified the default is "N".
 	///

 	///

-	/// <c>seperator</c> is the char that will replace the "-" if specified.  If no value is
-	/// configured then the default seperator for the format will be used.  If the format "D", "B", or
-	/// "P" is specified, then the seperator will replace the "-".  If the format is "N" then this
+	/// <c>separator</c> is the char that will replace the "-" if specified.  If no value is
+	/// configured then the default separator for the format will be used.  If the format "D", "B", or
+	/// "P" is specified, then the separator will replace the "-".  If the format is "N" then this
 	/// parameter will be ignored.
 	///

 	///

@@ -83,7 +83,7 @@

 		///
 		/// Configures the UUIDHexGenerator by reading the value of <c>format</c> and
-		/// <c>seperator</c> from the <c>parms</c> parameter.
+		/// <c>separator</c> from the <c>parms</c> parameter.
 		///
 		/// <param name="type">The <see cref="IType"/> the identifier should be.</param>
 		/// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param>
@@ -94,7 +94,7 @@

 			if (format != FormatWithDigitsOnly)
 			{
-				sep = PropertiesHelper.GetString("seperator", parms, null);
+				sep = PropertiesHelper.GetString("separator", parms, null);
 			}
 		}


Rename test case for consistency

Rename test case for consistency

--- src/NQuery.UnitTests/ComparerTests.cs
+++ src/NQuery.UnitTests/ComparerTests.cs
@@ -33,7 +33,7 @@
         }

         [TestMethod]
-        public void GroupBy_RequiresAllColumnsToBeComparable()
+        public void GroupByAndAggregation_RequiresAllColumnsToBeComparable()
         {
             var source = @"SELECT Data FROM Table GROUP BY Data";
             var syntaxTree = SyntaxTree.ParseQuery(source);


Added a Hello, World http endpoint to the sample app

--- src/ConsoleApp/Program.cs
+++ src/ConsoleApp/Program.cs
@@ -21,4 +21,12 @@
             Channels.ListenForMessagesFrom("jasper://localhost:2222/incoming");
         }
     }
+
+    public class HomeEndpoint
+    {
+        public string Get()
+        {
+            return "Hello, world.";
+        }
+    }
 }


grooming and fixed a test

grooming and fixed a test

--- src/Numerics.Tests/PolynomialTests.cs
+++ src/Numerics.Tests/PolynomialTests.cs
@@ -39,10 +39,14 @@

 namespace MathNet.Numerics.UnitTests
 {
+    /// <Note>
+    /// some of these tests were inspired by numpys tests in python for the Polynomial functions.
+    /// Thanks to the numpy contributers!
+    /// </Note>
     [TestFixture, Category("Calculus")]
     public class PolynomialTests
     {
-
+
         [TestCase(new double[] { 5, 4, 3, 0, 2 }, "5 + 4x^1 + 3x^2 + 0x^3 + 2x^4")]
         [TestCase(new double[0], "")]
         [TestCase(new double[] { 0, 4, 3, 0, 0 }, "0 + 4x^1 + 3x^2 + 0x^3 + 0x^4")]
@@ -233,7 +237,7 @@
         }

         [Test]
-        public void DivideLongTest()
+        public void DivideLongTestWrongInputs()
         {
             Assert.Throws(typeof(ArgumentOutOfRangeException), () =>
             {
@@ -259,6 +263,11 @@
                 var p2 = new Polynomial(0.0d);
                 var tpl = Polynomial.DivideLong(p1, p2);
             });
+        }
+
+        [Test]
+        public void DivideLongTest()
+        {

             var p11 = new Polynomial(2.0d);
             var p21 = new Polynomial(2.0d);
@@ -277,8 +286,8 @@
                 for (int j = 0; j < 5; j++)
                 {
                     var msg = String.Format("At i={0}, j={1}", i, j);
-                    var ci = new double[Math.Max(2, i+1)];
-                    var cj = new double[Math.Max(2, j+1)];
+                    var ci = new double[i + 2];
+                    var cj = new double[j + 2];
                     ci[ci.Length - 1] = 2;
                     ci[ci.Length - 2] = 1;
                     cj[cj.Length - 1] = 2;
@@ -291,12 +300,12 @@
                     var pquo = tpl3.Item1;
                     var prem = tpl3.Item2;
                     var pres = (pquo * pi) + prem;
+                    pres.Trim();
+
                     testEqual(pres, tgt, msg);
                 }
             }
         }
-
-

         [Test]
         public void GetRootsTest()


add constructors for value or state

add constructors for value or state

--- src/Odachi.Validation/ValueOrState.cs
+++ src/Odachi.Validation/ValueOrState.cs
@@ -5,17 +5,36 @@
 	/// </summary>
 	public struct ValueOrState<TValue>
 	{
+		public ValueOrState(TValue value)
+		{
+			Value = value;
+			State = null;
+		}
+		public ValueOrState(ValidationState state)
+		{
+			Value = default(TValue);
+			State = state;
+		}
+
 		public TValue Value { get; private set; }

 		public ValidationState State { get; private set; }

 		#region Static members
-
+
 		public static implicit operator ValueOrState<TValue>(Validator validator)
 		{
 			return new ValueOrState<TValue>()
 			{
 				State = validator.State,
+			};
+		}
+
+		public static implicit operator ValueOrState<TValue>(ValidationState state)
+		{
+			return new ValueOrState<TValue>()
+			{
+				State = state,
 			};
 		}


changed siganture for HmacAuthetnticationOptions

--- src/Owin/HmacAuthenticationOptions.cs
+++ src/Owin/HmacAuthenticationOptions.cs
@@ -5,9 +5,11 @@

     public class HmacAuthenticationOptions : AuthenticationOptions
     {
-        public HmacAuthenticationOptions()
+        public HmacAuthenticationOptions(ISigningAlgorithm algorithm, IAppSecretRepository appSecretRepository)
             : base(Schemas.HMAC)
         {
+            Algorithm = algorithm;
+            AppSecretRepository = appSecretRepository;
         }

         public ISigningAlgorithm Algorithm { get; set; }


Fixed bug with Angle calculation

Fixed bug with Angle calculation

--- src/Q42.HueApi/Models/Groups/Group.cs
+++ src/Q42.HueApi/Models/Groups/Group.cs
@@ -106,7 +106,7 @@
       var lengthX = this.X - x;
       var lengthY = this.Y - y;

-      return Math.Atan2(lengthY, lengthX) * (180 / Math.PI);
+      return (Math.Atan2(lengthY, lengthX) * (180 / Math.PI)) + 180;
     }


version bump to 0.0.2

version bump to 0.0.2

--- src/Quiche/Properties/AssemblyInfo.cs
+++ src/Quiche/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.1")]
-[assembly: AssemblyFileVersion("0.0.1")]
+[assembly: AssemblyVersion("0.0.2")]
+[assembly: AssemblyFileVersion("0.0.2")]


Update DynamicJson with patch from https://gist.github.com/3719610

--- src/ServiceStack.Razor/DynamicJson.cs
+++ src/ServiceStack.Razor/DynamicJson.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Dynamic;
+using System.Linq;
 using System.Text;
 using ServiceStack.Text;

@@ -7,7 +8,7 @@
 {
     public class DynamicJson : DynamicObject
     {
-        private readonly IDictionary<string, object> hash = new Dictionary<string, object>();
+        private readonly IDictionary<string, object> _hash = new Dictionary<string, object>();

         public static string Serialize(dynamic instance)
         {
@@ -17,24 +18,26 @@

         public static dynamic Deserialize(string json)
         {
-            var hash = JsonSerializer.DeserializeFromString<IDictionary<string, object>>(json);
+            // Support arbitrary nesting by using JsonObject
+            var deserialized = JsonSerializer.DeserializeFromString<JsonObject>(json);
+            var hash = deserialized.ToDictionary<KeyValuePair<string, string>, string, object>(entry => entry.Key, entry => entry.Value);
             return new DynamicJson(hash);
         }

         public DynamicJson(IEnumerable<KeyValuePair<string, object>> hash)
         {
-            this.hash.Clear();
+            _hash.Clear();
             foreach (var entry in hash)
             {
-                this.hash.Add(Underscored(entry.Key), entry.Value);
+                _hash.Add(Underscored(entry.Key), entry.Value);
             }
         }

         public override bool TrySetMember(SetMemberBinder binder, object value)
         {
             var name = Underscored(binder.Name);
-            hash[name] = value;
-            return hash[name] == value;
+            _hash[name] = value;
+            return _hash[name] == value;
         }

         public override bool TryGetMember(GetMemberBinder binder, out object result)
@@ -45,22 +48,21 @@

         public override string ToString()
         {
-            return JsonSerializer.SerializeToString(hash);
+            return JsonSerializer.SerializeToString(_hash);
         }

         private bool YieldMember(string name, out object result)
         {
-            if (hash.ContainsKey(name))
+            if (_hash.ContainsKey(name))
             {
-                var json = hash[name].ToString();
+                var json = _hash[name].ToString();
                 if (json.TrimStart(' ').StartsWith("{"))
                 {
-                    var nested = JsonSerializer.DeserializeFromString<IDictionary<string, object>>(json);
-                    result = new DynamicJson(nested);
+                    result = Deserialize(json);
                     return true;
                 }
                 result = json;
-                return hash[name] == result;
+                return _hash[name] == result;
             }
             result = null;
             return false;


set a sensible cache size for skia.. based on what flutter uses.

--- src/Skia/Avalonia.Skia/SkiaOptions.cs
+++ src/Skia/Avalonia.Skia/SkiaOptions.cs
@@ -16,6 +16,6 @@
         /// <summary>
         /// The maximum number of bytes for video memory to store textures and resources.
         /// </summary>
-        public long? MaxGpuResourceSizeBytes { get; set; }
+        public long? MaxGpuResourceSizeBytes { get; set; } = 1024 * 600 * 4 * 12; // ~28mb 12x 1024 x 600 textures.
     }
 }


Bumps version number and DLL meta data, preparing for a 2.1 release.

--- src/GlobalAssemblyInfo.cs
+++ src/GlobalAssemblyInfo.cs
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Joern Schou-Rode
+ * Copyright 2010-2011 Joern Schou-Rode
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
 using System.Reflection;

 [assembly: AssemblyProduct("NCron - .NET Scheduling Framework")]
-[assembly: AssemblyCopyright("Copyright 2008-2010 Joern Schou-Rode")]
+[assembly: AssemblyCopyright("Copyright 2008-2011 Joern Schou-Rode")]

 #if DEBUG
 [assembly: AssemblyConfiguration("Debug")]
@@ -25,4 +25,4 @@
 [assembly: AssemblyConfiguration("Release")]
 #endif

-[assembly: AssemblyVersion("2.0.*")]
+[assembly: AssemblyVersion("2.1.*")]


Add heuristic to improve SQL statement/expression detection when no semicolon is used.

--- src/SqlNotebookScript/ScriptParser.cs
+++ src/SqlNotebookScript/ScriptParser.cs
@@ -247,7 +247,7 @@

         private static Ast.Stmt ParseSqlStmt(TokenQueue q) {
             var n = q.Notebook;
-            var prefix = n.FindLongestValidStatementPrefix(q.ToString());
+            var prefix = TrimOurKeywordsFromEnd(n.FindLongestValidStatementPrefix(q.ToString()));

             if (prefix.Any()) {
                 // consume the corresponding valid tokens from the queue
@@ -294,8 +294,8 @@
         private static Ast.Expr ParseExpr(TokenQueue q) {
             var n = q.Notebook;
             var selectStr = "SELECT ( ";
-            var prefix = n.FindLongestValidStatementPrefix(selectStr + q.ToString());
-
+            var prefix = TrimOurKeywordsFromEnd(n.FindLongestValidStatementPrefix(selectStr + q.ToString()));
+
             if (prefix.Length > selectStr.Length) {
                 // consume the corresponding valid tokens from the queue
                 int len = selectStr.Length;
@@ -309,6 +309,16 @@
             }
         }

+        private static string TrimOurKeywordsFromEnd(string sql) {
+            var lcSql = sql.ToLower().Trim();
+            foreach (var x in new[] { "declare", "set", "if", "while", "break", "continue", "print", "exec", "execute", "return", "throw" }) {
+                if (lcSql.EndsWith($" {x}")) {
+                    return sql.Substring(0, lcSql.Length - x.Length - 1);
+                }
+            }
+            return sql;
+        }
+
         private static bool PeekExpr(TokenQueue q) {
             var n = q.Notebook;
             var selectStr = "SELECT ( ";


set dev to v4.0.0

set dev to v4.0.0

--- src/GlobalAssemblyInfo.cs
+++ src/GlobalAssemblyInfo.cs
@@ -18,8 +18,8 @@
 // Only increase AssemblyVersion for major releases.
 // Otherwise we get issues with nuget version ranges for dependent projects.
 // Especially dependent projects which use strong names get problems with changing version numbers.
-[assembly: AssemblyVersion("3.0.1.0")]
-[assembly: AssemblyFileVersion("3.0.1.0")]
+[assembly: AssemblyVersion("4.0.0")]
+[assembly: AssemblyFileVersion("4.0.0")]
 [assembly: AssemblyInformationalVersion("SRC")]

 [assembly: ComVisible(false)]


Fix the industry trend.

Fix the industry trend.

--- src/StephJob/Views/Home/Review.cshtml
+++ src/StephJob/Views/Home/Review.cshtml
@@ -331,7 +331,7 @@
                 console.info(data);

                 $('#industryName').text(data.industryName);
-                $('#IndustryProportion').text(data.industryProportion);
+                $('#industryProportion').text(data.industryProportion);
                 $('#earningByWeek').text(data.earningByWeek);
                 $('#greenGoodsAndServices').text(data.greenGoodsAndServices);
                 $('#unemploymentJobVacanciesRatio').text(data.unemploymentJobVacanciesRatio);


Fix race in GC KeepAlive test

Fix race in GC KeepAlive test

A few tests for GC.KeepAlive have a race condition where they use KeepAlive to prevent an object from being finalized and then assert that it hasn't.  But the object can get finalized after the call to KeepAlive and before the check, causing the test to randomly fail.

--- src/System.Runtime/tests/System/GC.cs
+++ src/System.Runtime/tests/System/GC.cs
@@ -91,19 +91,16 @@
     {
         public static void Run()
         {
-            RunWorker();
+            var keepAlive = new KeepAliveObject();
+
+            var doNotKeepAlive = new DoNotKeepAliveObject();
+            doNotKeepAlive = null;
+
+            GC.Collect();
+            GC.WaitForPendingFinalizers();
+
+            Assert.True(DoNotKeepAliveObject.Finalized);
             Assert.False(KeepAliveObject.Finalized);
-            Assert.True(DoNotKeepAliveObject.Finalized);
-        }
-
-        private static void RunWorker()
-        {
-            var keepAlive = new KeepAliveObject();
-            var doNotKeepAlive = new DoNotKeepAliveObject();
-
-            doNotKeepAlive = null;
-            GC.Collect();
-            GC.WaitForPendingFinalizers();

             GC.KeepAlive(keepAlive);
         }
@@ -170,12 +167,8 @@
     {
         public static void Run()
         {
-            var obj = new TestObject();
             int recursionCount = 0;
-
-            RunWorker(obj, ref recursionCount);
-
-            Assert.False(TestObject.Finalized);
+            RunWorker(new TestObject(), ref recursionCount);
         }

         private static void RunWorker(object obj, ref int recursionCount)
@@ -188,6 +181,7 @@

             RunWorker(obj, ref recursionCount);

+            Assert.False(TestObject.Finalized);
             GC.KeepAlive(obj);
         }


Add content.SetValue overload for posted files

--- src/Umbraco.Core/ContentExtensions.cs
+++ src/Umbraco.Core/ContentExtensions.cs
@@ -7,6 +7,7 @@
 using System.Xml.Linq;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
+using NPoco.Expressions;
 using Umbraco.Core.Composing;
 using Umbraco.Core.IO;
 using Umbraco.Core.Models;
@@ -52,8 +53,8 @@
             return ContentStatus.Unpublished;
         }

-
-
+
+
         #endregion

         /// <summary>
@@ -134,9 +135,14 @@
         /// <summary>
         /// Sets the posted file value of a property.
         /// </summary>
-        /// <remarks>This really is for FileUpload fields only, and should be obsoleted. For anything else,
-        /// you need to store the file by yourself using Store and then figure out
-        /// how to deal with auto-fill properties (if any) and thumbnails (if any) by yourself.</remarks>
+        public static void SetValue(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, string propertyTypeAlias, string filename, HttpPostedFileBase postedFile, string culture = null, string segment = null)
+        {
+            content.SetValue(contentTypeBaseServiceProvider, propertyTypeAlias, postedFile.FileName, postedFile.InputStream, culture, segment);
+        }
+
+        /// <summary>
+        /// Sets the posted file value of a property.
+        /// </summary>
         public static void SetValue(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, string propertyTypeAlias, string filename, Stream filestream, string culture = null, string segment = null)
         {
             if (filename == null || filestream == null) return;


Fix VerifyUploadFileAsync for long files. #79

--- src/VimeoDotNet/VimeoClient_Upload.cs
+++ src/VimeoDotNet/VimeoClient_Upload.cs
@@ -224,11 +224,7 @@
             return uploadRequest;
         }

-        /// <summary>
-        /// Verify upload file part asynchronously
-        /// </summary>
-        /// <param name="uploadRequest">UploadRequest</param>
-        /// <returns>Verification reponse</returns>
+        /// <inheritdoc />
         public async Task<VerifyUploadResponse> VerifyUploadFileAsync(IUploadRequest uploadRequest)
         {
             try
@@ -239,6 +235,7 @@
                 var verify = new VerifyUploadResponse();
                 CheckStatusCodeError(uploadRequest, response, "Error verifying file upload.", (HttpStatusCode)308);

+                // ReSharper disable once ConvertIfStatementToSwitchStatement
                 if (response.StatusCode == HttpStatusCode.OK)
                 {
                     verify.BytesWritten = uploadRequest.FileLength;
@@ -249,12 +246,11 @@
                     verify.Status = UploadStatusEnum.InProgress;
                     if (!response.Headers.Contains("Range"))
                         return verify;
-                    var startIndex = 0;
-                    var endIndex = 0;
                     var match = RangeRegex.Match(response.Headers.GetValues("Range").First());
+                    // ReSharper disable once InvertIf
                     if (match.Success
-                        && int.TryParse(match.Groups["start"].Value, out startIndex)
-                        && int.TryParse(match.Groups["end"].Value, out endIndex))
+                        && long.TryParse(match.Groups["start"].Value, out var startIndex)
+                        && long.TryParse(match.Groups["end"].Value, out var endIndex))
                     {
                         verify.BytesWritten = endIndex - startIndex;
                         if (verify.BytesWritten == uploadRequest.FileLength)


essage=Adding overload which accepts an already constructed container.

--- src/WebApi.StructureMap/Extensions.cs
+++ src/WebApi.StructureMap/Extensions.cs
@@ -14,7 +14,7 @@
     public static class Extensions
     {
         public static void UseStructureMap(
-            this HttpConfiguration config,
+            this HttpConfiguration config,
             Action<ConfigurationExpression> configuration)
         {
             config.DependencyResolver = new DependencyResolver(
@@ -42,6 +42,13 @@
             where T : Registry, new()
         {
             config.UseStructureMap(new T());
+        }
+
+        public static void UseStructureMap(
+                this HttpConfiguration config,
+                IContainer container)
+        {
+            config.DependencyResolver = new DependencyResolver(container);
         }

         public static T GetService<T>(this IDependencyScope scope)


feat: LiveNumber uses Numberof

feat: LiveNumber uses Numberof

--- src/Yaapii.Atoms/Number/LiveNumber.cs
+++ src/Yaapii.Atoms/Number/LiveNumber.cs
@@ -21,9 +21,7 @@
 // SOFTWARE.

 using System;
-using System.Globalization;
 using Yaapii.Atoms.Scalar;
-using Yaapii.Atoms.Texts;

 namespace Yaapii.Atoms.Number
 {
@@ -32,10 +30,7 @@
     /// </summary>
     public sealed class LiveNumber : INumber
     {
-        private readonly IScalar<long> _lng;
-        private readonly IScalar<float> _flt;
-        private readonly IScalar<int> _itg;
-        private readonly IScalar<double> _dbl;
+        private readonly IScalar<INumber> number;

         /// <summary>
         /// A <see cref="IText"/> as a <see cref="INumber"/>
@@ -44,34 +39,9 @@
         /// <param name="blockSeperator">seperator for blocks, for example 1.000</param>
         /// <param name="decimalSeperator">seperator for floating point numbers, for example 16,235 </param>
         public LiveNumber(Func<string> text, string decimalSeperator, string blockSeperator) : this(
-            new LiveScalar<long>(() => Convert.ToInt64(
-                text(),
-                new NumberFormatInfo()
-                {
-                    NumberDecimalSeparator = decimalSeperator,
-                    NumberGroupSeparator = blockSeperator
-                })),
-            new LiveScalar<int>(() => Convert.ToInt32(
-                text(),
-                new NumberFormatInfo()
-                {
-                    NumberDecimalSeparator = decimalSeperator,
-                    NumberGroupSeparator = blockSeperator
-                })),
-            new LiveScalar<float>(() => (float)Convert.ToDecimal(
-                text(),
-                new NumberFormatInfo()
-                {
-                    NumberDecimalSeparator = decimalSeperator,
-                    NumberGroupSeparator = blockSeperator
-                })),
-            new LiveScalar<double>(() => Convert.ToDouble(
-                text(),
-                new NumberFormatInfo()
-                {
-                    NumberDecimalSeparator = decimalSeperator,
-                    NumberGroupSeparator = blockSeperator
-                }))
+            new LiveScalar<INumber>(() =>
+                new NumberOf(text(), decimalSeperator, blockSeperator)
+            )
         )
         { }

@@ -79,7 +49,11 @@
         /// A <see cref="int"/> as a <see cref="INumber"/>
         /// </summary>
         /// <param name="str">The string</param>
-        public LiveNumber(Func<string> str) : this(str, new Sticky<IFormatProvider>(() => CultureInfo.InvariantCulture))
+        public LiveNumber(Func<string> str) : this(
+            new LiveScalar<INumber>(() =>
+                new NumberOf(str())
+            )
+        )
         { }

         /// <summary>
@@ -87,7 +61,11 @@
         /// </summary>
         /// <param name="str">The string</param>
         /// <param name="provider">a number format provider</param>
-        public LiveNumber(Func<string> str, IFormatProvider provider) : this(str, new Sticky<IFormatProvider>(provider))
+        public LiveNumber(Func<string> str, IFormatProvider provider) : this(
+            new LiveScalar<INumber>(() =>
+                new NumberOf(str(), provider)
+            )
+        )
         { }

         /// <summary>
@@ -96,55 +74,10 @@
         /// <param name="str">The string</param>
         /// <param name="provider">a number format provider</param>
         public LiveNumber(Func<string> str, IScalar<IFormatProvider> provider) : this(
-            new LiveScalar<long>(
-                () =>
-                {
-                    try
-                    {
-                        return Convert.ToInt64(str(), provider.Value());
-                    }
-                    catch (FormatException)
-                    {
-                        throw new ArgumentException(new Formatted("'{0}' is not a number.", str()).AsString());
-                    }
-                }),
-            new LiveScalar<int>(
-                () =>
-                {
-                    try
-                    {
-                        return Convert.ToInt32(str(), provider.Value());
-                    }
-                    catch (FormatException)
-                    {
-                        throw new ArgumentException(new Formatted("'{0}' is not a number.", str()).AsString());
-                    }
-                }),
-            new LiveScalar<float>(
-                () =>
-                {
-                    try
-                    {
-                        return Convert.ToSingle(str(), provider.Value());
-                    }
-                    catch (FormatException)
-                    {
-                        throw new ArgumentException(new Formatted("'{0}' is not a number.", str()).AsString());
-                    }
-                }),
-            new LiveScalar<double>(
-                () =>
-                {
-                    try
-                    {
-                        return Convert.ToDouble(str(), provider.Value());
-                    }
-                    catch (FormatException)
-                    {
-                        throw new ArgumentException(new Formatted("'{0}' is not a number.", str()).AsString());
-                    }
-                })
+           new LiveScalar<INumber>(() =>
+                new NumberOf(str(), provider)
             )
+        )
         { }

         /// <summary>
@@ -152,10 +85,9 @@
         /// </summary>
         /// <param name="integer">The integer</param>
         public LiveNumber(Func<int> integer) : this(
-            new LiveScalar<long>(() => Convert.ToInt64(integer())),
-            new LiveScalar<int>(integer),
-            new LiveScalar<float>(() => Convert.ToSingle(integer())),
-            new LiveScalar<double>(() => Convert.ToDouble(integer()))
+            new LiveScalar<INumber>(() =>
+                new NumberOf(integer())
+            )
         )
         { }

@@ -164,11 +96,10 @@
         /// </summary>
         /// <param name="dbl">The double</param>
         public LiveNumber(Func<double> dbl) : this(
-            new LiveScalar<long>(() => Convert.ToInt64(dbl())),
-            new LiveScalar<int>(() => Convert.ToInt32(dbl())),
-            new LiveScalar<float>(() => Convert.ToSingle(dbl())),
-            new LiveScalar<double>(dbl)
+            new LiveScalar<INumber>(() =>
+                new NumberOf(dbl())
             )
+        )
         { }

         /// <summary>
@@ -176,11 +107,10 @@
         /// </summary>
         /// <param name="lng">The long</param>
         public LiveNumber(Func<long> lng) : this(
-            new LiveScalar<long>(lng),
-            new LiveScalar<int>(() => Convert.ToInt32(lng())),
-            new LiveScalar<float>(() => Convert.ToSingle(lng())),
-            new LiveScalar<double>(() => Convert.ToDouble(lng()))
+            new LiveScalar<INumber>(() =>
+                new NumberOf(lng())
             )
+        )
         { }

         /// <summary>
@@ -188,11 +118,10 @@
         /// </summary>
         /// <param name="flt">The float</param>
         public LiveNumber(Func<float> flt) : this(
-            new LiveScalar<long>(() => Convert.ToInt64(flt())),
-            new LiveScalar<int>(() => Convert.ToInt32(flt())),
-            new LiveScalar<float>(flt),
-            new LiveScalar<double>(() => Convert.ToDouble(flt()))
+            new LiveScalar<INumber>(() =>
+                new NumberOf(flt())
             )
+        )
         { }

         /// <summary>
@@ -202,12 +131,16 @@
         /// <param name="itg"></param>
         /// <param name="flt"></param>
         /// <param name="dbl"></param>
-        public LiveNumber(IScalar<long> lng, IScalar<int> itg, IScalar<float> flt, IScalar<double> dbl)
+        public LiveNumber(IScalar<long> lng, IScalar<int> itg, IScalar<float> flt, IScalar<double> dbl) : this(
+            new LiveScalar<INumber>(() =>
+                new NumberOf(lng, itg, flt, dbl)
+            )
+        )
+        { }
+
+        private LiveNumber(IScalar<INumber> number)
         {
-            _lng = lng;
-            _itg = itg;
-            _flt = flt;
-            _dbl = dbl;
+            this.number = number;
         }

         /// <summary>
@@ -217,7 +150,7 @@
         /// <returns></returns>
         public double AsDouble()
         {
-            return _dbl.Value();
+            return this.number.Value().AsDouble();
         }

         /// <summary>
@@ -227,7 +160,7 @@
         /// <returns></returns>
         public float AsFloat()
         {
-            return _flt.Value();
+            return this.number.Value().AsFloat();
         }

         /// <summary>
@@ -237,7 +170,7 @@
         /// <returns></returns>
         public int AsInt()
         {
-            return _itg.Value();
+            return this.number.Value().AsInt();
         }

         /// <summary>
@@ -247,16 +180,7 @@
         /// <returns></returns>
         public long AsLong()
         {
-            return _lng.Value();
-        }
-
-        private ArgumentException ArgError(IText txt)
-        {
-            return
-                new ArgumentException(
-                    new Formatted("'{0}' is not a number.", txt.AsString()
-                ).AsString()
-            );
+            return this.number.Value().AsLong();
         }
     }
 }


Downgrade Cake.FileHelpers

Downgrade Cake.FileHelpers

Hopefully fixes TravisCI & AppVeyor crashes


Return Nancy version without JSON.Net

Return Nancy version without JSON.Net


Added NPM install to Cake script

Added NPM install to Cake script


Four4Sample - too many operands (+)

Four4Sample - too many operands (+)

--- projects/Four4Sample/Four4.Test/CalculatorTest.cs
+++ projects/Four4Sample/Four4.Test/CalculatorTest.cs
@@ -56,6 +56,7 @@
         [InlineData("4 44 + 4 +", "52")]
         [InlineData("4 4 4 - / 4 +", "NaN")]
         [InlineData("4 +", "NaN")]
+        [InlineData("4 4 4 +", "NaN")]
         public void Addition(string input, string result)
         {
             TestEval(input, result);


adde painting to the color editor

adde painting to the color editor

--- TileEngine/TileMapMaker/MainWindow.xaml.cs
+++ TileEngine/TileMapMaker/MainWindow.xaml.cs
@@ -76,9 +76,11 @@
             switch (comMode)
             {
                 case Commands.MapCommandMode.ChangeColor:
+                    ChangeColor(e);
                     break;

                 case Commands.MapCommandMode.ChangePosition:
+                    ChangePosition(e);
                     break;

                 case Commands.MapCommandMode.ChangeTexture:


Resolved bug when two nodes have the same span values.

--- TreeEdit/Spg.TreeEdit.Update/TreeUpdate.cs
+++ TreeEdit/Spg.TreeEdit.Update/TreeUpdate.cs
@@ -1,7 +1,9 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
+using TreeEdit.Spg.Print;
 using TreeEdit.Spg.Script;
 using TreeEdit.Spg.TreeEdit.Script;
 using Tutor.Spg.Node;
@@ -25,11 +27,9 @@
             CurrentTree = ConverterHelper.ConvertCSharpToTreeNode(tree);
         }

-        public TreeUpdate(){}
-
-        public void PreProcessTree(SyntaxNodeOrToken tree)
+        public TreeUpdate(ITreeNode<SyntaxNodeOrToken> tree)
         {
-            CurrentTree = ConverterHelper.ConvertCSharpToTreeNode(tree);
+            CurrentTree = tree;
         }

         /// <summary>
@@ -69,7 +69,11 @@

             if (editOperation is Delete<SyntaxNodeOrToken>)
             {
+                //Console.WriteLine("PREVIOUS TREE\n\n");
+                //PrintUtil<SyntaxNodeOrToken>.PrintPretty(CurrentTree, "", true);
                 RemoveNode(CurrentTree, editOperation.T1Node.Value);
+                //Console.WriteLine("UPDATED TREE\n\n");
+                //PrintUtil<SyntaxNodeOrToken>.PrintPretty(CurrentTree, "", true);
             }
         }

@@ -81,7 +85,7 @@
             bool found = false;
             foreach (var item in iTree.Children)
             {
-                if (oldNode.Span.Contains(item.Value.Span) && item.Value.Span.Contains(oldNode.Span))
+                if (oldNode.Span.Contains(item.Value.Span) && item.Value.Span.Contains(oldNode.Span) && oldNode.IsKind(item.Value.Kind()))
                 {
                     found = true;
                     break;


Change the way we update droid and touch versions

--- UpdateVersionInfo/UpdateVersionInfoImpl.cs
+++ UpdateVersionInfo/UpdateVersionInfoImpl.cs
@@ -10,11 +10,11 @@
 {
     internal class UpdateVersionInfoImpl
     {
-        static string AssemblyVersionExpression = @"^\s*\[assembly:\s*(?<attribute>(?:System\.)?(?:Reflection\.)?AssemblyVersion(?:Attribute)?\s*\(\s*""(?<version>[^""]+)""\s*\)\s*)\s*\]\s*$";
-        static string AssemblyFileVersionExpression = @"^\s*\[assembly:\s*(?<attribute>(?:System\.)?(?:Reflection\.)?AssemblyFileVersion(?:Attribute)?\s*\(\s*""(?<version>[^""]+)""\s*\)\s*)\s*\]\s*$";
+        private const string AssemblyVersionExpression = @"^\s*\[assembly:\s*(?<attribute>(?:System\.)?(?:Reflection\.)?AssemblyVersion(?:Attribute)?\s*\(\s*""(?<version>[^""]+)""\s*\)\s*)\s*\]\s*$";
+        private const string AssemblyFileVersionExpression = @"^\s*\[assembly:\s*(?<attribute>(?:System\.)?(?:Reflection\.)?AssemblyFileVersion(?:Attribute)?\s*\(\s*""(?<version>[^""]+)""\s*\)\s*)\s*\]\s*$";

-        static readonly Regex assemblyVersionRegEx = new Regex(AssemblyVersionExpression, RegexOptions.Multiline | RegexOptions.Compiled);
-        static readonly Regex assemblyFileVersionRegEx = new Regex(AssemblyFileVersionExpression, RegexOptions.Multiline | RegexOptions.Compiled);
+        private static readonly Regex AssemblyVersionRegEx = new Regex(AssemblyVersionExpression, RegexOptions.Multiline | RegexOptions.Compiled);
+        private static readonly Regex AssemblyFileVersionRegEx = new Regex(AssemblyFileVersionExpression, RegexOptions.Multiline | RegexOptions.Compiled);

         /// <summary>
         /// Shows help/usage information
@@ -31,32 +31,30 @@
         [Verb(IsDefault = true)]
         public static void Version(
             [DefaultValue(1), MoreOrEqualTo(0), Description("A numeric major version number greater than zero."), Aliases("v")]int major,
-            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric minor number greater than zero."), Aliases("m")]int minor,
-            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric build number greater than zero."), Aliases("b")]int build,
-            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric revision number greater than zero."), Aliases("r")]int revision,
+            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric minor number equal or greater than zero."), Aliases("m")]int minor,
+            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric build number equal or greater than zero."), Aliases("b")]int build,
+            [DefaultValue(0), MoreOrEqualTo(0), Description("A numeric revision number equal or greater than zero."), Aliases("r")]int revision,
             [Description("The path to a C# file to update with version information."), Aliases("p,path")]string versionCsPath,
             [Description("The path to an android manifest file to update with version information."), Aliases("a,androidManifest")]string androidManifestPath,
             [Description("The path to an iOS plist file to update with version information."), Aliases("t,touchPlist")]string touchPListPath)
         {
             try
             {
-                //ValidateCommandLine(commandLine);
-
-                Version version = new Version(
+                var version = new Version(
                     major,
                     minor,
                     build,
                     revision);

-                if (!string.IsNullOrEmpty(versionCsPath))
+                if (!string.IsNullOrEmpty(versionCsPath) && IsValidCSharpVersionFile(versionCsPath))
                 {
-                    UpdateCSVersionInfo(versionCsPath, version);
+                    UpdateCsVersionInfo(versionCsPath, version);
                 }
-                if (!string.IsNullOrEmpty(androidManifestPath))
+                if (!string.IsNullOrEmpty(androidManifestPath) && IsValidAndroidManifest(androidManifestPath))
                 {
                     UpdateAndroidVersionInfo(androidManifestPath, version);
                 }
-                if (!string.IsNullOrEmpty(touchPListPath))
+                if (!string.IsNullOrEmpty(touchPListPath) && IsValidTouchPList(touchPListPath))
                 {
                     UpdateTouchVersionInfo(touchPListPath, version);
                 }
@@ -66,19 +64,21 @@
                 Console.WriteLine("An unexpected error was encountered:" + e.Message);
             }
         }
-        private static void UpdateCSVersionInfo(string path, Version version)
+        private static void UpdateCsVersionInfo(string path, Version version)
         {
             string contents;
             using (var reader = new StreamReader(path))
             {
                 contents = reader.ReadToEnd();
             }
-            contents = assemblyVersionRegEx.Replace(contents, "[assembly: System.Reflection.AssemblyVersion(\"" + version.ToString() + "\")]");
-            if (assemblyFileVersionRegEx.IsMatch(contents))
+            contents = AssemblyVersionRegEx.Replace(contents,
+                $"[assembly: System.Reflection.AssemblyVersion(\"{version}\")]");
+            if (AssemblyFileVersionRegEx.IsMatch(contents))
             {
-                contents = assemblyFileVersionRegEx.Replace(contents, "[assembly: System.Reflection.AssemblyFileVersion(\"" + version.ToString() + "\")]");
+                contents = AssemblyFileVersionRegEx.Replace(contents,
+                    $"[assembly: System.Reflection.AssemblyFileVersion(\"{version}\")]");
             }
-            using (StreamWriter writer = new StreamWriter(path, false))
+            using (var writer = new StreamWriter(path, false))
             {
                 writer.Write(contents);
             }
@@ -86,24 +86,27 @@

         private static void UpdateAndroidVersionInfo(string path, Version version)
         {
-            const string androidNS = "http://schemas.android.com/apk/res/android";
-            XName versionCodeAttributeName = XName.Get("versionCode", androidNS);
-            XName versionNameAttributeName = XName.Get("versionName", androidNS);
-            XDocument doc = XDocument.Load(path);
+            const string androidNs = "http://schemas.android.com/apk/res/android";
+            var versionCodeAttributeName = XName.Get("versionCode", androidNs);
+            var versionNameAttributeName = XName.Get("versionName", androidNs);
+            var doc = XDocument.Load(path);
+            // ReSharper disable once PossibleNullReferenceException
             doc.Root.SetAttributeValue(versionCodeAttributeName, version.Build);
-            doc.Root.SetAttributeValue(versionNameAttributeName, version);
+            doc.Root.SetAttributeValue(versionNameAttributeName, $"{version.Major}.{version.Minor}");
             doc.Save(path);
         }

         private static void UpdateTouchVersionInfo(string path, Version version)
         {
-            XDocument doc = XDocument.Load(path);
+            var doc = XDocument.Load(path);

             var shortVersionElement = doc.XPathSelectElement("plist/dict/key[string()='CFBundleShortVersionString']").NextNode as XElement;
-            shortVersionElement.Value = version.Major + "." + version.Minor + "." + version.Build;
+            // ReSharper disable once PossibleNullReferenceException
+            shortVersionElement.Value = $"{version.Major}.{version.Minor}";

             var bundleVersionElement = doc.XPathSelectElement("plist/dict/key[string()='CFBundleVersion']").NextNode as XElement;
-            bundleVersionElement.Value = version.Build + "." + version.Revision;
+            // ReSharper disable once PossibleNullReferenceException
+            bundleVersionElement.Value = $"{version.Build}.{version.Revision}";

             doc.Save(path);
         }
@@ -121,7 +124,7 @@
                     contents = reader.ReadToEnd();
                 }

-                if (assemblyVersionRegEx.IsMatch(contents))
+                if (AssemblyVersionRegEx.IsMatch(contents))
                 {
                     return true;
                 }
@@ -142,8 +145,8 @@
             try
             {
                 // <manifest ...
-                XDocument doc = XDocument.Load(path);
-                var rootElement = doc.Root as XElement;
+                var doc = XDocument.Load(path);
+                var rootElement = doc.Root;
                 if (rootElement != null && rootElement.Name == "manifest") return true;
             }
             catch (Exception e)
@@ -161,15 +164,13 @@
             try
             {
                 //<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-                XDocument doc = XDocument.Load(path);
+                var doc = XDocument.Load(path);
+                // ReSharper disable once PossibleNullReferenceException
                 if (doc.DocumentType.Name == "plist")
                 {
                     var shortVersionElement = doc.XPathSelectElement("plist/dict/key[string()='CFBundleShortVersionString']");
-                    if (shortVersionElement != null)
-                    {
-                        var valueElement = shortVersionElement.NextNode as XElement;
-                        if (valueElement != null && valueElement.Name == "string") return true;
-                    }
+                    var valueElement = shortVersionElement?.NextNode as XElement;
+                    if (valueElement != null && valueElement.Name == "string") return true;
                 }
             }
             catch (Exception e)


visitor for VarLikeConstructUse

visitor for VarLikeConstructUse

git-tfs-id: [http://falcon:8080/tfs/Projects]$/Phalanger/Main;C5750

--- Source/Core.Parsers/TreeVisitor.cs
+++ Source/Core.Parsers/TreeVisitor.cs
@@ -439,7 +439,7 @@

         virtual public void VisitDirectVarUse(DirectVarUse x)
         {
-            //VisitVarLikeConstructUse(x);
+            VisitVarLikeConstructUse(x);
         }
         virtual public void VisitGlobalConstUse(GlobalConstUse x)
         {
@@ -455,7 +455,12 @@
         }
         virtual public void VisitIndirectVarUse(IndirectVarUse x)
         {
-            //VisitVarLikeConstructUse(x);
+            VisitVarLikeConstructUse(x);
+        }
+
+        virtual public void VisitVarLikeConstructUse(VarLikeConstructUse x)
+        {
+            VisitElement(x.IsMemberOf);
         }

         /// <summary>
@@ -532,7 +537,7 @@
             VisitElement(x.Index);
             VisitElement(x.Array);

-            //VisitVarLikeConstructUse(x);
+            VisitVarLikeConstructUse(x);
         }

         /// <summary>
@@ -550,6 +555,8 @@
         /// <param name="x"></param>
         virtual public void VisitFunctionCall(FunctionCall x)
         {
+            VisitVarLikeConstructUse(x);
+
             foreach (ActualParam p in x.CallSignature.Parameters)
                 VisitElement(p);
         }


Make Instruction.Code property public

Make Instruction.Code property public

--- src/NDis86/Instruction.cs
+++ src/NDis86/Instruction.cs
@@ -25,7 +25,7 @@
         }

         public ulong Offset { get; }
-        MnemonicCode Code { get; }
+        public MnemonicCode Code { get; }
         public string Hex { get; }
         public string Assembly { get; }
         public IReadOnlyList<Operand> Operands { get; }


Support for TerrainObject in UnityGraph

Support for TerrainObject in UnityGraph

--- src/Nuterra/UnityGraph.cs
+++ src/Nuterra/UnityGraph.cs
@@ -68,7 +68,19 @@
 				LogComponent_BoxCollider((BoxCollider)inst);
 				return;
 			}
+			if (inst is TerrainObject)
+			{
+				LogComponent_TerrainObject((TerrainObject)inst, prefix);
+				return;
+			}
 			Console.WriteLine();
+		}
+
+		private static void LogComponent_TerrainObject(TerrainObject obj, string prefix)
+		{
+			Console.WriteLine($"{{{obj.PrefabGUID}}} \"{obj.name}\"");
+			Console.WriteLine($"{prefix} pos:{obj.transform.position} rot:{obj.transform.rotation}");
+			//Console.WriteLine($"{prefix} sceneryType: {(SceneryTypes)obj.visible?.ItemType}");
 		}

 		public static void LogComponent_TankBlock(TankBlock tankBlock, string prefix)


Update EntitySet.cs

Update EntitySet.cs

--- src/RabbitDB/EntitySet.cs
+++ src/RabbitDB/EntitySet.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
 using RabbitDB.Query;

@@ -21,6 +22,11 @@
             return this;
         }

+        internal void ForEach(Action<T> action)
+        {
+            _list.ForEach(action);
+        }
+
         public T this[int index]
         {
             get { return _list[index]; }


Upping package version

Upping package version

--- src/SharedAssemblyInfo.cs
+++ src/SharedAssemblyInfo.cs
@@ -3,5 +3,5 @@
 [assembly: AssemblyProduct("Aggregates.NET")]
 [assembly: AssemblyDescription(".NET event sourced domain driven design model via NServicebus and EventStore")]
 [assembly: AssemblyCopyright("Copyright © Charles Solar 2015")]
-[assembly: AssemblyVersion("0.1.3.0")]
-[assembly: AssemblyFileVersion("0.1.3.0")]+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]


2.0-pre01

--- src/SharedAssemblyInfo.cs
+++ src/SharedAssemblyInfo.cs
@@ -5,7 +5,7 @@
 [assembly: AssemblyCompany("Connective DX")]
 [assembly: AssemblyProduct("Rainbow")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("1.4.1.0")]
-[assembly: AssemblyFileVersion("1.4.1.0")]
-[assembly: AssemblyInformationalVersion("1.4.1")]
+[assembly: AssemblyVersion("2.0.0.0")]
+[assembly: AssemblyFileVersion("2.0.0.0")]
+[assembly: AssemblyInformationalVersion("2.0.0-pre01")]
 [assembly: CLSCompliant(false)]


1.1.0-pre03 => 1.1.0-pre04

1.1.0-pre03 => 1.1.0-pre04

--- src/apps/Common/CommonAssemblyInfo.cs
+++ src/apps/Common/CommonAssemblyInfo.cs
@@ -12,4 +12,4 @@

 [assembly: AssemblyVersion("1.1.0.0")]
 [assembly: AssemblyFileVersion("1.1.0.0")]
-[assembly: AssemblyInformationalVersion("1.1.0-pre03")]+[assembly: AssemblyInformationalVersion("1.1.0-pre04")]


Use EntitySystem Dictionary

Use EntitySystem Dictionary

--- src/World/ChunkManager.cs
+++ src/World/ChunkManager.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using EntitySystem.Collections;
 using EntitySystem.Components.World;
 using EntitySystem.Utility;


Add in-memory log history

Add in-memory log history

May be used later for bug reports.

--- pass-winmenu/src/Logger.cs
+++ pass-winmenu/src/Logger.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
@@ -14,9 +15,16 @@
 		Error
 	}

+	internal class LogLine
+	{
+		public DateTime DateTime { get; set; }
+		public string Message { get; set; }
+	}
+
 	static class Log
 	{
 		private static StreamWriter writer;
+		public static List<LogLine> History { get; } = new List<LogLine>();

 		public static void Initialise()
 		{
@@ -84,7 +92,13 @@

 		private static void SendRaw(string message)
 		{
-			var line = $"[{DateTime.Now:HH:mm:ss.fff}] {message}";
+			var submissionTime = DateTime.Now;
+			var line = $"[{submissionTime:HH:mm:ss.fff}] {message}";
+			History.Add(new LogLine
+			{
+				DateTime = submissionTime,
+				Message = message
+			});
 			Console.WriteLine(line);
 			writer?.WriteLine(line);
 		}


Update Catalog.cs

Update Catalog.cs

--- source/ADAPT/ADM/Catalog.cs
+++ source/ADAPT/ADM/Catalog.cs
@@ -71,6 +71,12 @@
             Places = new List<Place>();
             ContainerModels = new List<ContainerModel>();
             PackagedProducts = new List<PackagedProduct>();
+            DeviceSeries = new List<DeviceSeries>();
+            EndgunConfigurations = new List<EndgunConfiguration>();
+            Facilities = new List<Facility>();
+            IrrSectionConfigurations = new List<IrrSectionConfiguration>();
+            IrrSystemConfigurations = new List<IrrSystemConfiguration>();
+            IrrSystemModels = new List<IrrSystemModel>()
         }

         public List<Brand> Brands { get; set; }


Fix assertion

Fix assertion

--- src/test/Test.FAKECore/FileHandling/GlobbingSpecs.cs
+++ src/test/Test.FAKECore/FileHandling/GlobbingSpecs.cs
@@ -67,6 +67,6 @@

         It should_not_find_fsx_file =
             () => Catch.Exception(() => FileSystemHelper.FindFirstMatchingFile("*.fsx", TestData.TestDir))
-                      .ShouldBeOfType<FileNotFoundException>();
+                      .ShouldBeAssignableTo<FileNotFoundException>();
     }
 }


Update samples/ControlCatalog/Pages/DataGridPage.xaml.cs

Co-authored-by: Dariusz Komosiński <f6e502f2f63a0818b65e0cddef2449013a1c4823@gmail.com>

--- samples/ControlCatalog/Pages/DataGridPage.xaml.cs
+++ samples/ControlCatalog/Pages/DataGridPage.xaml.cs
@@ -17,7 +17,7 @@
             this.InitializeComponent();

             var dataGridSortDescription = DataGridSortDescription.FromPath(nameof(Country.Region), ListSortDirection.Ascending, new ReversedStringComparer());
-            var colelctionView1 = new DataGridCollectionView(Countries.All);
+            var collectionView1 = new DataGridCollectionView(Countries.All);
             colelctionView1.SortDescriptions.Add(dataGridSortDescription);
             var dg1 = this.FindControl<DataGrid>("dataGrid1");
             dg1.IsReadOnly = true;


Fix `HSPAColour.ToColour` not being pure

--- osu.Game/Graphics/HSPAColour.cs
+++ osu.Game/Graphics/HSPAColour.cs
@@ -96,100 +96,101 @@
             float minOverMax = 1f - S;

             Color4 result = new Color4 { A = A };
+            float h = H;

             if (minOverMax > 0f)
             {
-                if (H < 1f / 6f)
-                {
-                    H = 6f * (H - 0f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                if (h < 1f / 6f)
+                {
+                    h = 6f * (h - 0f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.B = P / MathF.Sqrt(p_r / minOverMax / minOverMax + p_g * part * part + p_b);
                     result.R = result.B / minOverMax;
-                    result.G = result.B + H * (result.R - result.B);
-                }
-                else if (H < 2f / 6f)
-                {
-                    H = 6f * (-H + 2f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                    result.G = result.B + h * (result.R - result.B);
+                }
+                else if (h < 2f / 6f)
+                {
+                    h = 6f * (-h + 2f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.B = P / MathF.Sqrt(p_g / minOverMax / minOverMax + p_r * part * part + p_b);
                     result.G = result.B / minOverMax;
-                    result.R = result.B + H * (result.G - result.B);
-                }
-                else if (H < 3f / 6f)
-                {
-                    H = 6f * (H - 2f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                    result.R = result.B + h * (result.G - result.B);
+                }
+                else if (h < 3f / 6f)
+                {
+                    h = 6f * (h - 2f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.R = P / MathF.Sqrt(p_g / minOverMax / minOverMax + p_b * part * part + p_r);
                     result.G = result.R / minOverMax;
-                    result.B = result.R + H * (result.G - result.R);
-                }
-                else if (H < 4f / 6f)
-                {
-                    H = 6f * (-H + 4f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                    result.B = result.R + h * (result.G - result.R);
+                }
+                else if (h < 4f / 6f)
+                {
+                    h = 6f * (-h + 4f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.R = P / MathF.Sqrt(p_b / minOverMax / minOverMax + p_g * part * part + p_r);
                     result.B = result.R / minOverMax;
-                    result.G = result.R + H * (result.B - result.R);
-                }
-                else if (H < 5f / 6f)
-                {
-                    H = 6f * (H - 4f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                    result.G = result.R + h * (result.B - result.R);
+                }
+                else if (h < 5f / 6f)
+                {
+                    h = 6f * (h - 4f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.G = P / MathF.Sqrt(p_b / minOverMax / minOverMax + p_r * part * part + p_g);
                     result.B = result.G / minOverMax;
-                    result.R = result.G + H * (result.B - result.G);
-                }
-                else
-                {
-                    H = 6f * (-H + 6f / 6f);
-                    float part = 1f + H * (1f / minOverMax - 1f);
+                    result.R = result.G + h * (result.B - result.G);
+                }
+                else
+                {
+                    h = 6f * (-h + 6f / 6f);
+                    float part = 1f + h * (1f / minOverMax - 1f);
                     result.G = P / MathF.Sqrt(p_r / minOverMax / minOverMax + p_b * part * part + p_g);
                     result.R = result.G / minOverMax;
-                    result.B = result.G + H * (result.R - result.G);
+                    result.B = result.G + h * (result.R - result.G);
                 }
             }
             else
             {
-                if (H < 1f / 6f)
-                {
-                    H = 6f * (H - 0f / 6f);
-                    result.R = MathF.Sqrt(P * P / (p_r + p_g * H * H));
-                    result.G = result.R * H;
+                if (h < 1f / 6f)
+                {
+                    h = 6f * (h - 0f / 6f);
+                    result.R = MathF.Sqrt(P * P / (p_r + p_g * h * h));
+                    result.G = result.R * h;
                     result.B = 0f;
                 }
-                else if (H < 2f / 6f)
-                {
-                    H = 6f * (-H + 2f / 6f);
-                    result.G = MathF.Sqrt(P * P / (p_g + p_r * H * H));
-                    result.R = result.G * H;
+                else if (h < 2f / 6f)
+                {
+                    h = 6f * (-h + 2f / 6f);
+                    result.G = MathF.Sqrt(P * P / (p_g + p_r * h * h));
+                    result.R = result.G * h;
                     result.B = 0f;
                 }
-                else if (H < 3f / 6f)
-                {
-                    H = 6f * (H - 2f / 6f);
-                    result.G = MathF.Sqrt(P * P / (p_g + p_b * H * H));
-                    result.B = result.G * H;
+                else if (h < 3f / 6f)
+                {
+                    h = 6f * (h - 2f / 6f);
+                    result.G = MathF.Sqrt(P * P / (p_g + p_b * h * h));
+                    result.B = result.G * h;
                     result.R = 0f;
                 }
-                else if (H < 4f / 6f)
-                {
-                    H = 6f * (-H + 4f / 6f);
-                    result.B = MathF.Sqrt(P * P / (p_b + p_g * H * H));
-                    result.G = result.B * H;
+                else if (h < 4f / 6f)
+                {
+                    h = 6f * (-h + 4f / 6f);
+                    result.B = MathF.Sqrt(P * P / (p_b + p_g * h * h));
+                    result.G = result.B * h;
                     result.R = 0f;
                 }
-                else if (H < 5f / 6f)
-                {
-                    H = 6f * (H - 4f / 6f);
-                    result.B = MathF.Sqrt(P * P / (p_b + p_r * H * H));
-                    result.R = result.B * H;
+                else if (h < 5f / 6f)
+                {
+                    h = 6f * (h - 4f / 6f);
+                    result.B = MathF.Sqrt(P * P / (p_b + p_r * h * h));
+                    result.R = result.B * h;
                     result.G = 0f;
                 }
                 else
                 {
-                    H = 6f * (-H + 6f / 6f);
-                    result.R = MathF.Sqrt(P * P / (p_r + p_b * H * H));
-                    result.B = result.R * H;
+                    h = 6f * (-h + 6f / 6f);
+                    result.R = MathF.Sqrt(P * P / (p_r + p_b * h * h));
+                    result.B = result.R * h;
                     result.G = 0f;
                 }
             }


expose setter of Mod

expose setter of Mod

--- osu.Game/Rulesets/UI/ModIcon.cs
+++ osu.Game/Rulesets/UI/ModIcon.cs
@@ -34,7 +34,7 @@

         public virtual string TooltipText { get; }

-        protected Mod Mod { get; private set; }
+        protected Mod Mod { get; set; }

         public ModIcon(Mod mod)
         {


Remove local workarounds to attempt to avoid crashes on skin change

--- osu.Game/Skinning/LegacySkin.cs
+++ osu.Game/Skinning/LegacySkin.cs
@@ -7,7 +7,6 @@
 using System.IO;
 using System.Linq;
 using JetBrains.Annotations;
-using osu.Framework.Audio;
 using osu.Framework.Audio.Sample;
 using osu.Framework.Bindables;
 using osu.Framework.Graphics;
@@ -462,7 +461,7 @@
                 var sample = Samples?.Get(lookup);

                 if (sample != null)
-                    return new LegacySkinSample(sample, this);
+                    return sample;
             }

             return null;
@@ -505,78 +504,5 @@
             Textures?.Dispose();
             Samples?.Dispose();
         }
-
-        /// <summary>
-        /// A sample wrapper which keeps a reference to the contained skin to avoid finalizer garbage collection of the managing SampleStore.
-        /// </summary>
-        private class LegacySkinSample : ISample, IDisposable
-        {
-            private readonly Sample sample;
-
-            [UsedImplicitly]
-            private readonly LegacySkin skin;
-
-            public LegacySkinSample(Sample sample, LegacySkin skin)
-            {
-                this.sample = sample;
-                this.skin = skin;
-            }
-
-            public SampleChannel Play()
-            {
-                return sample.Play();
-            }
-
-            public SampleChannel GetChannel()
-            {
-                return sample.GetChannel();
-            }
-
-            public double Length => sample.Length;
-
-            public Bindable<int> PlaybackConcurrency => sample.PlaybackConcurrency;
-            public BindableNumber<double> Volume => sample.Volume;
-
-            public BindableNumber<double> Balance => sample.Balance;
-
-            public BindableNumber<double> Frequency => sample.Frequency;
-
-            public BindableNumber<double> Tempo => sample.Tempo;
-
-            public void BindAdjustments(IAggregateAudioAdjustment component)
-            {
-                sample.BindAdjustments(component);
-            }
-
-            public void UnbindAdjustments(IAggregateAudioAdjustment component)
-            {
-                sample.UnbindAdjustments(component);
-            }
-
-            public void AddAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
-            {
-                sample.AddAdjustment(type, adjustBindable);
-            }
-
-            public void RemoveAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
-            {
-                sample.RemoveAdjustment(type, adjustBindable);
-            }
-
-            public void RemoveAllAdjustments(AdjustableProperty type)
-            {
-                sample.RemoveAllAdjustments(type);
-            }
-
-            public IBindable<double> AggregateVolume => sample.AggregateVolume;
-
-            public IBindable<double> AggregateBalance => sample.AggregateBalance;
-
-            public IBindable<double> AggregateFrequency => sample.AggregateFrequency;
-
-            public IBindable<double> AggregateTempo => sample.AggregateTempo;
-
-            public void Dispose() => sample.Dispose();
-        }
     }
 }


Fix incorrect HUD component fallback

Fix incorrect HUD component fallback

Legacy skins should now always show the legacy hud components. The
conditional here is no longer valid as fallback lookups happen at a
*skin*-fallback level rather than internal *source*-fallback.

Put another way, `LegacyDefaultSkin` (with user customisations) should
still display the classic HUD components even if a font is not provided,
as that font will be available via the skin lookup hierarchy.

The TODO removed in this commit has been already resolved so this code
is no longer required.

--- osu.Game/Skinning/LegacySkin.cs
+++ osu.Game/Skinning/LegacySkin.cs
@@ -356,26 +356,15 @@
                                 }
                             })
                             {
-                                Children = this.HasFont(LegacyFont.Score)
-                                    ? new Drawable[]
-                                    {
-                                        new LegacyComboCounter(),
-                                        new LegacyScoreCounter(),
-                                        new LegacyAccuracyCounter(),
-                                        new LegacyHealthDisplay(),
-                                        new SongProgress(),
-                                        new BarHitErrorMeter(),
-                                    }
-                                    : new Drawable[]
-                                    {
-                                        // TODO: these should fallback to using osu!classic skin textures, rather than doing this.
-                                        new DefaultComboCounter(),
-                                        new DefaultScoreCounter(),
-                                        new DefaultAccuracyCounter(),
-                                        new DefaultHealthDisplay(),
-                                        new SongProgress(),
-                                        new BarHitErrorMeter(),
-                                    }
+                                Children = new Drawable[]
+                                {
+                                    new LegacyComboCounter(),
+                                    new LegacyScoreCounter(),
+                                    new LegacyAccuracyCounter(),
+                                    new LegacyHealthDisplay(),
+                                    new SongProgress(),
+                                    new BarHitErrorMeter(),
+                                }
                             };

                             return skinnableTargetWrapper;


Use the htdocs_location variable instead of the hardcoded /trac_common/ path.

git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@83 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/header.cs
+++ templates/header.cs
@@ -12,7 +12,7 @@

     <title>Edgewall Trac | <?cs var:title ?></title>
-    <link rel="stylesheet" type="text/css" href="/trac_common/trac.css" />
+    <link rel="stylesheet" type="text/css" href="<?cs var:htdocs_location?>trac.css" />

@@ -30,7 +30,7 @@
 	 <a href="<?cs var:trac.href.logout ?>"
             class="navbar-link-right"> logout
       <?cs /if ?>
-      <a href="<?cs var:trac.href.wiki ?>/TracGuide"
+      <a href="<?cs var:trac.href.wiki ?>TracGuide"
 	 class="navbar-link-right"> Help/Guide  |
       <a href="<?cs var:trac.href.about ?>"
 	 class="navbar-link-right"> About Trac


Passing in the contentProvider to the other constructor

--- src/dbup-core/Engine/LazySqlScript.cs
+++ src/dbup-core/Engine/LazySqlScript.cs
@@ -17,7 +17,7 @@
         /// <param name="name">The name.</param>
         /// <param name="contentProvider">The delegate which creates the content at execution time.</param>
         public LazySqlScript(string name, Func<string> contentProvider)
-            : this(name, new SqlScriptOptions(), null)
+            : this(name, new SqlScriptOptions(), contentProvider)
         {
         }


Fixed XHTML validity.

Fixed XHTML validity.

git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@105 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/report.cs
+++ templates/report.cs
@@ -20,12 +20,9 @@
   <a href="<?cs var:$trac.href.report ?>">Report Index

-
+

+

 <?cs if report.mode == "list" ?>
-
-

-

-

<?cs var:report.title ?>

@@ -36,9 +33,7 @@

     <?cs set idx = #0 ?>
-
     <?cs each row = report.items ?>
-
       <?cs if idx % #2 ?>

       <?cs else ?>
@@ -49,7 +44,7 @@
       <?cs each cell = row ?>

         <?cs if cell.type == "ticket" ?>
-          <a href="<?cs var:cell.ticket_href ?>" ?>#<?cs var: cell.value ?>
+          <a href="<?cs var:cell.ticket_href ?>">#<?cs var: cell.value ?>
         <?cs elif cell.type == "report" ?>
           <a href="<?cs var:cell.report_href ?>">{<?cs var: cell.value ?>}
         <?cs elif cell.type == "time" ?>
@@ -75,24 +70,28 @@

 <?cs elif report.mode == "editor" ?>

-  <form action="<?cs var:cgi_location ?>" method="POST">
-    <input type="hidden" name="mode" value="report">
-    <input type="hidden" name="id" value="<?cs var:report.id ?>">
-    <input type="hidden" name="action" value="<?cs var:report.action ?>">
-    title:
<input type="text" name="title" value="<?cs var:report.title ?>" size="50">
-
sql query:
-

-    <textarea name="sql" cols="70" rows="10"><?cs var:report.sql ?></textarea>
-

-    <input type="submit" value="commit">
-    <input type="reset" value="reset">
+
Create New Report

+
+  <form action="<?cs var:cgi_location ?>" method="post">
+

+      <input type="hidden" name="mode" value="report" />
+      <input type="hidden" name="id" value="<?cs var:report.id ?>" />
+      <input type="hidden" name="action" value="<?cs var:report.action ?>" />
+      Report Title:

+      <input type="text" name="title" value="<?cs var:report.title ?>"
+              size="50" />
+
SQL Query:

+      <textarea name="sql" cols="70" rows="10"><?cs var:report.sql ?></textarea>
+

+      <input type="submit" value="commit" />
+      <input type="reset" value="reset" />
+

   </form>

 <?cs /if?>

-
+

-

 <?cs include:"footer.cs"?>


Add test to assert projecting to structs works.

--- test/ExRam.Gremlinq.Core.Tests/QueryExecutionTest.cs
+++ test/ExRam.Gremlinq.Core.Tests/QueryExecutionTest.cs
@@ -48,6 +48,22 @@
             public object? Out { get; set; }
             public object? Count { get; set; }
             public object? Properties { get; set; }
+        }
+
+        private readonly struct ProjectRecordStruct
+        {
+            public ProjectRecordStruct(object? @in, object? @out, object? count, object? properties)
+            {
+                In = @in;
+                Out = @out;
+                Count = count;
+                Properties = properties;
+            }
+
+            public object? In { get; }
+            public object? Out { get;  }
+            public object? Count { get; }
+            public object? Properties { get;  }
         }

         protected readonly IGremlinQuerySource _g;
@@ -2654,6 +2670,23 @@
         }

         [Fact]
+        public virtual async Task Project_to_type_with_struct()
+        {
+            await _g
+                .V()
+                .Where(__ => __.In())
+                .Where(__ => __.Out())
+                .Where(__ => __.Properties())
+                .Project(_ => _
+                    .To<ProjectRecordStruct>()
+                    .By(x => x.In, __ => __.Constant("in_value"))
+                    .By(x => x.Out, __ => __.Constant("out_value"))
+                    .By(x => x.Count, __ => __.Constant("count_value"))
+                    .By(x => x.Properties, __ => __.Constant("properties_value")))
+                .Verify();
+        }
+
+        [Fact]
         public virtual async Task Project_to_type_with_select()
         {
             await _g


added multiple testing for the source file

This is mostly to test for -hd suffix content when it can not be loaded
automatically.

--- cocos2d/textures/CCTextureCache.cs
+++ cocos2d/textures/CCTextureCache.cs
@@ -121,13 +121,32 @@
                     }
                     catch (Exception)
                     {
+                    }
+                    if(textureXna == null)
+                    {
                         string srcfile = fileimage;
                         if (srcfile.IndexOf('.') > -1)
                         {
                             // Remove the extension
                             srcfile = srcfile.Substring(0, srcfile.LastIndexOf('.'));
                         }
-                        textureXna = CCApplication.SharedApplication.Content.Load<Texture2D>(srcfile);
+                        try {
+                            textureXna = CCApplication.SharedApplication.Content.Load<Texture2D>(srcfile);
+                        }
+                        catch(Exception) {
+                            if(!srcfile.EndsWith ("-hd")) {
+                                srcfile = srcfile + "-hd";
+                            try
+                            {
+                                textureXna = CCApplication.SharedApplication.Content.Load<Texture2D>(srcfile);
+                            }
+                            catch(Exception) {
+                            }
+                            }
+                        }
+                    }
+                    if(textureXna == null) {
+                        throw(new ArgumentException("Texture " + fileimage + " was not found."));
                     }
                     bool isInited = texture.InitWithTexture(textureXna);


Fix for the winrt/windows8 builds that do not have Thread support.

--- cocos2d/textures/CCTextureCache.cs
+++ cocos2d/textures/CCTextureCache.cs
@@ -3,7 +3,11 @@
 using System.Linq;
 using System.Diagnostics;
 using System.IO;
+#if !WINRT && !WINDOWS_PHONE8
 using System.Threading;
+#else
+using Windows.System.Threading;
+#endif
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;

@@ -17,7 +21,10 @@
             public Action<CCTexture2D> Action;
         };
         private List<AsyncStruct> _asyncLoadedImages = new List<AsyncStruct>();
+        private Action _ProcessingAction;
+#if !WINRT && !WINDOWS_PHONE8
         private Thread _thread;
+#endif

         private static CCTextureCache s_sharedTextureCache;

@@ -29,6 +36,49 @@
             Dispose();
         }

+        private CCTextureCache()
+        {
+            _ProcessingAction = new Action(
+            () =>
+            {
+
+                while (true)
+                {
+                    lock (_asyncLoadedImages)
+                    {
+                        if (_asyncLoadedImages.Count == 0)
+                        {
+                            return;
+                        }
+                    }
+
+                    try
+                    {
+                        var image = _asyncLoadedImages[0];
+                        var texture = AddImage(image.FileName);
+
+                        if (image.Action != null)
+                        {
+                            CCDirector.SharedDirector.Scheduler.ScheduleSelector(
+                               f => image.Action(texture), this, 0, 0, 0, false
+                               );
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        CCLog.Log("Failed to load image");
+                        CCLog.Log(ex.ToString());
+                    }
+
+                    lock (_asyncLoadedImages)
+                    {
+                        _asyncLoadedImages.RemoveAt(0);
+                    }
+                }
+            }
+                    );
+        }
+
         public void Update(float dt)
         {
         }
@@ -63,7 +113,16 @@
         {
             return m_pTextures.ContainsKey(assetFile);
         }
-
+#if WINRT || WINDOWS_PHONE8
+        /// <summary>
+        /// The asynchronous handler for the task.
+        /// </summary>
+        /// <param name="action"></param>
+        private void AddImageAsyncHandler(Windows.Foundation.IAsyncAction action)
+        {
+            _ProcessingAction();
+        }
+#endif
         public void AddImageAsync(string fileimage, Action<CCTexture2D> action)
         {
             Debug.Assert(!String.IsNullOrEmpty(fileimage), "TextureCache: fileimage MUST not be NULL");
@@ -73,52 +132,20 @@
                 _asyncLoadedImages.Add(new AsyncStruct() { FileName = fileimage, Action = action });
             }

+
+#if !WINRT && !WINDOWS_PHONE8
             if (_thread == null)
             {
-                _thread = new Thread(
-                    () =>
-                    {
-                        System.Threading.Thread.CurrentThread.Name = "TextureCacheAsync";
-
-                        while (true)
-                        {
-                            lock (_asyncLoadedImages)
-                            {
-                                if (_asyncLoadedImages.Count == 0)
-                                {
-                                    _thread = null;
-                                    return;
-                                }
-                            }
-
-                            try
-                            {
-                                var image = _asyncLoadedImages[0];
-                                var texture = AddImage(image.FileName);
-
-                                if (image.Action != null)
-                                {
-                                    CCDirector.SharedDirector.Scheduler.ScheduleSelector(
-                                       f => image.Action(texture), this, 0, 0, 0, false
-                                       );
-                                }
-                            }
-                            catch (Exception ex)
-                            {
-                                CCLog.Log("Failed to load image");
-                                CCLog.Log(ex.ToString());
-                            }
-
-                            lock (_asyncLoadedImages)
-                            {
-                                _asyncLoadedImages.RemoveAt(0);
-                            }
-                        }
-                    }
-                    );
-
+                _thread = new Thread(() => {
+                    System.Threading.Thread.CurrentThread.Name = "TextureCacheAsync";
+                    _ProcessingAction();
+                    _thread = null;
+                });
                 _thread.Start();
             }
+#else
+            ThreadPool.RunAsync(new WorkItemHandler(AddImageAsyncHandler));
+#endif
         }

         public CCTexture2D AddImage(string fileimage)