Fix held item not dissapearing if switching to empty slot

--- src/Alex/Entities/Entity.cs
+++ src/Alex/Entities/Entity.cs
@@ -109,7 +109,7 @@
 			var inHand = Inventory[Inventory.SelectedSlot];
 			//Log.Info($"Inventory slot changed.");

-			if (inHand == null && ItemRenderer != null)
+			if ((inHand == null || inHand.Count == 0 || inHand.Id <= 0) && ItemRenderer != null)
 			{
 				if (ModelRenderer.GetBone("rightItem", out EntityModelRenderer.ModelBone bone))
 				{


Delete LineList.cs

Delete LineList.cs

--- src/Collections/LineList.cs
+++ src/Collections/LineList.cs
@@ -1,62 +0,0 @@
-/****************************************************************************/
-/*                                                                          */
-/*    The Mondo Libraries  							                        */
-/*                                                                          */
-/*        Namespace: Mondo.Common							                */
-/*             File: LineList.cs										    */
-/*        Class(es): LineList										        */
-/*          Purpose: A list of lines in a text file                         */
-/*                                                                          */
-/*  Original Author: Jim Lightfoot                                          */
-/*    Creation Date: 2 Mar 2014                                             */
-/*                                                                          */
-/*   Copyright (c) 2014-2016 - Jim Lightfoot, All rights reserved           */
-/*                                                                          */
-/*  Licensed under the MIT license:                                         */
-/*    http://www.opensource.org/licenses/mit-license.php                    */
-/*                                                                          */
-/****************************************************************************/
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Xml;
-using System.Text;
-using Mondo.Xml;
-
-namespace Mondo.Common
-{
-    /****************************************************************************/
-    /****************************************************************************/
-    /// <summary>
-    /// A list of lines in a text file
-    /// </summary>
-    public class LineList : StringList
-    {
-        private const string kSeparator = "__H8KdWE*(LK@__";
-
-        public delegate string ProcessLine(string strLine);
-
-        /****************************************************************************/
-        public LineList(string strList)
-        {
-            string strFile = strList;
-
-            strFile = strFile.Replace("\r\n", kSeparator);
-            strFile = strFile.Replace("\r", kSeparator);
-            strFile = strFile.Replace("\n", kSeparator);
-
-            this.Parse(strFile, kSeparator, false, false);
-        }
-
-        /****************************************************************************/
-        public void Process(ProcessLine fncProcess)
-        {
-            foreach(string strLine in this)
-                fncProcess(strLine);
-
-            return;
-        }
-    }
-}


remove unused code

remove unused code

--- src/Contest.Core/Contest.cs
+++ src/Contest.Core/Contest.cs
@@ -89,7 +89,7 @@
                 foreach (var flag in Flags) {
                     foreach (var fi in GetTestCases(type, flag)) {
                         var del = (Delegate)fi.GetValue(inst);
-                        if (result.Cases.Any(tc => tc.Body.Method.MetadataToken == del.Method.MetadataToken))
+                        if (result.Cases.Any(tc => SameMetaToken(tc.Body, del.Body))
                             continue;

                         var tcfullname = string.Format("{0}.{1}", type.FullName, fi.Name);


rename inlinecase to isinlinecase

rename inlinecase to isinlinecase

--- src/Contest.Core/Contest.cs
+++ src/Contest.Core/Contest.cs
@@ -25,7 +25,7 @@
             Flags = new[] { INS_PUB, INS_PRI, STA_PUB, STA_PRI };
         }

-        static readonly Func<TestCase, bool> InlineCase = tcase => tcase.Body == null;
+        static readonly Func<TestCase, bool> IsInlineCase = tcase => tcase.Body == null;

         static readonly Func<Delegate, Delegate, bool> SameMetaToken =
             (left, right) =>
@@ -46,7 +46,7 @@
                 suite.Cases.AddRange(
                     from c in cases
                     where !suite.Cases.Any(
-                        c1 => InlineCase(c) || SameMetaToken(c1.Body, c.Body))
+                        c1 => IsInlineCase(c) || SameMetaToken(c1.Body, c.Body))
                     select c);

                 return suite;


Update XContext.cs

Update XContext.cs

[skip ci]

--- src/Core2D/Data/XContext.cs
+++ src/Core2D/Data/XContext.cs
@@ -18,11 +18,7 @@
         /// <summary>
         /// Initializes a new instance of the <see cref="XContext"/> class.
         /// </summary>
-        public XContext()
-            : base()
-        {
-            _properties = ImmutableArray.Create<XProperty>();
-        }
+        public XContext() : base() => _properties = ImmutableArray.Create<XProperty>();

         /// <summary>
         /// Gets or sets a collection <see cref="XProperty"/> that will be used during drawing.
@@ -30,8 +26,8 @@
         [Content]
         public ImmutableArray<XProperty> Properties
         {
-            get { return _properties; }
-            set { Update(ref _properties, value); }
+            get => _properties;
+            set => Update(ref _properties, value);
         }

         /// <summary>
@@ -39,8 +35,8 @@
         /// </summary>
         public XRecord Record
         {
-            get { return _record; }
-            set { Update(ref _record, value); }
+            get => _record;
+            set => Update(ref _record, value);
         }

         /// <summary>
@@ -84,22 +80,13 @@
         /// Creates a new <see cref="XContext"/> instance.
         /// </summary>
         /// <returns>The new instance of the <see cref="XContext"/> class.</returns>
-        public static XContext Create()
-        {
-            return new XContext();
-        }
+        public static XContext Create() => new XContext();

         /// <summary>
         /// Creates a new <see cref="XContext"/> instance.
         /// </summary>
         /// <param name="record">The record instance.</param>
         /// <returns>The new instance of the <see cref="XContext"/> class.</returns>
-        public static XContext Create(XRecord record)
-        {
-            return new XContext()
-            {
-                Record = record
-            };
-        }
+        public static XContext Create(XRecord record) => new XContext() { Record = record };
     }
 }


instantiating enumerables as new lists instead of empty enumerables because it was causing issues serializing into protobuff. It saw it as a fixed array. --Signed-off-by Kathleen Oneal <onealkathleena@johndeere.com>

--- source/ADAPT/ADM/Documents.cs
+++ source/ADAPT/ADM/Documents.cs
@@ -15,7 +15,6 @@
  *******************************************************************************/

 using System.Collections.Generic;
-using System.Linq;
 using AgGateway.ADAPT.ApplicationDataModel.Documents;
 using AgGateway.ADAPT.ApplicationDataModel.Guidance;

@@ -25,14 +24,14 @@
     {
         public Documents()
         {
-            WorkItems = Enumerable.Empty<WorkItem>();
-            WorkItemOperations = Enumerable.Empty<WorkItemOperation>();
-            LoggedData = Enumerable.Empty<LoggedData.LoggedData>();
-            Plans = Enumerable.Empty<Plan>();
-            WorkOrders = Enumerable.Empty<WorkOrder>();
-            Recommendations = Enumerable.Empty<Recommendation>();
-            GuidanceAllocations = Enumerable.Empty<GuidanceAllocation>();
-            Summaries = Enumerable.Empty<Summary>();
+            WorkItems = new List<WorkItem>();
+            WorkItemOperations = new List<WorkItemOperation>();
+            LoggedData = new List<LoggedData.LoggedData>();
+            Plans = new List<Plan>();
+            WorkOrders = new List<WorkOrder>();
+            Recommendations = new List<Recommendation>();
+            GuidanceAllocations = new List<GuidanceAllocation>();
+            Summaries = new List<Summary>();
         }

         public IEnumerable<WorkItem> WorkItems { get; set; }


logo transitions start with the second logo

--- Assets/Scripts/LevelTransition/LogoTransition.cs
+++ Assets/Scripts/LevelTransition/LogoTransition.cs
@@ -13,7 +13,7 @@
 	[SerializeField] private Sprite[] transitionLogos;
 	private Sprite currentLogo;
 	private new SpriteRenderer renderer;
-	private int nextTransition;
+	private int nextTransition = 1;

 	protected void Start()
 	{
@@ -22,16 +22,17 @@

 	public void ShowLogo()
 	{
-		currentLogo = transitionLogos[nextTransition];
 		if (renderer)
 		{
-			renderer.sprite = currentLogo;
 			nextTransition++;
 			if (nextTransition == transitionLogos.Length)
 			{
 				nextTransition = 0;
 			}
-			StartCoroutine(FadingIn());
+			currentLogo = transitionLogos[nextTransition];
+			renderer.sprite = currentLogo;
+
+			StartCoroutine (FadingIn());
 			Invoke("FadeOut", startFadingOutTime);
 		}
 	}


Gather extension config in diag. package

--- source/Playnite/Diagnostic.cs
+++ source/Playnite/Diagnostic.cs
@@ -44,6 +44,16 @@
                         archive.CreateEntryFromFile(PlaynitePaths.ConfigFilePath, Path.GetFileName(PlaynitePaths.ConfigFilePath));
                     }

+                    // Extension configs
+                    if (Directory.Exists(PlaynitePaths.ExtensionsDataPath))
+                    {
+                        foreach (var cfg in Directory.GetFiles(PlaynitePaths.ExtensionsDataPath, "config.json", SearchOption.AllDirectories))
+                        {
+                            var fileInfo = new FileInfo(cfg);
+                            archive.CreateEntryFromFile(cfg, Path.Combine("extensions", fileInfo.Directory.Name, fileInfo.Name));
+                        }
+                    }
+
                     // System Info
                     var infoPath = Path.Combine(diagTemp, "sysinfo.txt");
                     File.WriteAllText(infoPath, Serialization.ToYaml(Computer.GetSystemInfo()));


1.3.5.1

--- Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
+++ Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
@@ -39,7 +39,7 @@
 [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearchGeoJson")]
 [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearchGeoJson/blob/master/LICENSE")]
 [assembly: AssemblyVersion("1.3.5.*")]
-[assembly: AssemblyInformationalVersion("1.3.5")]
+[assembly: AssemblyInformationalVersion("1.3.5.1")]
 // The following attributes are used to specify the signing key for the assembly,
 // if desired. See the Mono documentation for more information about signing.
 //[assembly: AssemblyDelaySign(false)]


ready to pack 1.3.21

ready to pack 1.3.21

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@terradue.com>

--- Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
+++ Terradue.OpenSearch.GeoJson/Properties/AssemblyInfo.cs
@@ -7,7 +7,7 @@
 @{
     DotNetOpenSearchGeoJson Software Package

-    \xrefitem sw_version "Versions" "Software Package Version" 1.3.20
+    \xrefitem sw_version "Versions" "Software Package Version" 1.3.21

     \xrefitem sw_link "Links" "Software Package List" [DotNetOpenSearchGeoJson](https://github.com/Terradue/DotNetOpenSearchGeoJson)

@@ -38,8 +38,8 @@
 [assembly: AssemblyAuthors("Emmanuel Mathot")]
 [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearchGeoJson")]
 [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearchGeoJson/blob/master/LICENSE")]
-[assembly: AssemblyVersion("1.3.20.*")]
-[assembly: AssemblyInformationalVersion("1.3.20")]
+[assembly: AssemblyVersion("1.3.21.*")]
+[assembly: AssemblyInformationalVersion("1.3.21")]
 // The following attributes are used to specify the signing key for the assembly,
 // if desired. See the Mono documentation for more information about signing.
 //[assembly: AssemblyDelaySign(false)]


Breadcrumb ellipses.

Breadcrumb ellipses.

--- Augustus.Web.Portal/Views/Invoice/Details.cshtml
+++ Augustus.Web.Portal/Views/Invoice/Details.cshtml
@@ -7,7 +7,7 @@
 }

-
True Clarity

+
True Clarity...

@Html.ActionLink(account.Name, "Invoices", "Account", new { id = account.Id }, null)

@Html.ActionLink(opportunity.Name, "Invoices", "Opportunity", new { id = opportunity.Id }, null)


Backup previous items JSON file

Backup previous items JSON file

--- RuneScapeCacheTools/Utility/ItemDefinitionExtractor.cs
+++ RuneScapeCacheTools/Utility/ItemDefinitionExtractor.cs
@@ -71,6 +71,15 @@

         public void ExtractItemDefinitions(ReferenceTableCache cache, string jsonFilePath, bool skipUndecodableItems = false)
         {
+            // Courtesy backup.
+            if (System.IO.File.Exists(jsonFilePath))
+            {
+                var backupFilepath = jsonFilePath + ".bak";
+                System.IO.File.Delete(backupFilepath);
+                System.IO.File.Move(jsonFilePath, backupFilepath);
+            }
+
+
             // Write JSON to string before writing it to file to intercept partial output.
             using var streamWriter = new StreamWriter(System.IO.File.Open(jsonFilePath, FileMode.Create));
             using var jsonWriter = new JsonTextWriter(streamWriter)


hmmm

hmmm

Former-commit-id: e84b8da0b52e2fa7575b6f1907cd7de6c5ede89c

--- Samples/WebRequestReply/WebRequestReply.UI/Default.aspx.cs
+++ Samples/WebRequestReply/WebRequestReply.UI/Default.aspx.cs
@@ -33,7 +33,8 @@

         protected void Button1_Click(object sender, EventArgs e)
         {
-            this.RequestEntered(this, new EventArgs());
+            //this.RequestEntered(this, new EventArgs());
+            _controller.SendRequest();
         }

         protected void Button2_Click(object sender, EventArgs e)


建立GetDefaultDataBitsSetting方法

建立GetDefaultDataBitsSetting方法

建立GetDefaultDataBitsSetting方法

--- UartOscilloscope/CSharpFiles/UARTConnectionConstVal.cs
+++ UartOscilloscope/CSharpFiles/UARTConnectionConstVal.cs
@@ -19,11 +19,15 @@
 		private const int DefaultDataBitsSetting = 8;                           //	宣告DefaultDataBitsSetting(預設UART傳輸每組資料位元數)
 		public static int GetDefaultBaudRate()                                  //	GetDefaultBaudRate方法
 		{                                                                       //	進入GetDefaultBaudRate方法
-			return DefaultBaudRate;                                             //	回傳DefaultBaudRate變數
+			return DefaultBaudRate;                                             //	回傳DefaultBaudRate常數
 		}                                                                       //	結束GetDefaultBaudRate方法
 		public static Parity GetDefaultParitySetting()                          //	GetDefaultParitySetting方法
 		{                                                                       //	進入GetDefaultParitySetting方法
-			return DefaultParitySetting;                                        //	回傳DefaultParitySetting變數
+			return DefaultParitySetting;                                        //	回傳DefaultParitySetting常數
 		}                                                                       //	結束GetDefaultParitySetting方法
+		public static int GetDefaultDataBitsSetting()                           //	GetDefaultDataBitsSetting方法
+		{                                                                       //	進入GetDefaultDataBitsSetting方法
+			return DefaultDataBitsSetting;                                      //	回傳DefaultDataBitsSetting常數
+		}                                                                       //	結束GetDefaultDataBitsSetting方法
 	}                                                                           //	結束UARTConnectionConstVal類別
 }


fix Pop3ConfigurationLogic RemoveInvalidCharts

--- Signum.Engine.Extensions/Mailing/Pop3ConfigurationLogic.cs
+++ Signum.Engine.Extensions/Mailing/Pop3ConfigurationLogic.cs
@@ -394,7 +394,8 @@

         private static string GetName(ContentType ct)
         {
-            return ct.Name ?? ("unknown" + MimeType.GetDefaultExtension(ct.MediaType));
+            return ct.Name.TryCC(a => FileNameValidatorAttribute.RemoveInvalidCharts(a)) ??
+                ("unknown" + MimeType.GetDefaultExtension(ct.MediaType));
         }

         private static DateTime GetDate(MailMessage mm)


Added justification for suppression

Added justification for suppression

--- h-opc/Da/DaClient.cs
+++ h-opc/Da/DaClient.cs
@@ -43,7 +43,7 @@
     /// Initialize a new Data Access Client
     /// </summary>
     /// <param name="serverUrl">the url of the server to connect to</param>
-    [SuppressMessage("Microsoft.Design", "CA1057")]
+    [SuppressMessage("Microsoft.Design", "CA1057", Justification = "A Uri object incorrectly encodes spaces in Urls so a string must be used instead")]
     public DaClient(string serverUrl)
     {
       _url = new URL(serverUrl);


Use the correct type in Aborted

Use the correct type in Aborted

--- BaseThread.cs
+++ BaseThread.cs
@@ -21,7 +21,7 @@
             set
             {
                 aborted = value;
-                foreach (ScannerThread child in children)
+                foreach (BaseThread child in children)
                 {
                     child.Aborted = aborted;
                 }


Removed old code.

Removed old code.

--- WebApiTest/WebApiTest/Controllers/ProductController.cs
+++ WebApiTest/WebApiTest/Controllers/ProductController.cs
@@ -51,8 +51,6 @@
         {
             if (id < _products.Count)
             {
-                //return Request.CreateResponse(HttpStatusCode.OK, _products[id]);
-                //JToken json = JObject.Parse("{ 'firstname' : 'Jason', 'lastname' : 'Voorhees' }");
                 return new HttpResponseMessage()
                 {
                     Content = new JsonContent(new


cruft

cruft

--- CustomBadge.cs
+++ CustomBadge.cs
@@ -220,17 +220,6 @@
 			context.AddArc (minX + radius, minY + radius, radius, M_PI, M_PI + (M_PI / 2f), false);
 			context.ClosePath ();
 			context.StrokePath ();
-
-			/*
-
-        CGContextAddArc(context, maxX-radius, minY+radius, radius, M_PI+(M_PI/2), 0, 0);
-        CGContextAddArc(context, maxX-radius, maxY-radius, radius, 0, M_PI/2, 0);
-        CGContextAddArc(context, minX+radius, maxY-radius, radius, M_PI/2, M_PI, 0);
-        CGContextAddArc(context, minX+radius, minY+radius, radius, M_PI, M_PI+M_PI/2, 0);
-        CGContextClosePath(context);
-        CGContextStrokePath(context);
-
-			*/
 		}
 	}
 }


Fix the buffer size.

Fix the buffer size.

--- BodyWriter.cs
+++ BodyWriter.cs
@@ -29,7 +29,7 @@
                     log.debug(sbody);
                     if (sbody.Length > 0)
                     {
-                        var writer = new StreamWriter(outStream, Encoding.ASCII, 0);
+                        var writer = new StreamWriter(outStream, Encoding.ASCII);
                         writer.Write(sbody);
                         writer.Flush();
                     }


I can't find the right reg for CLS

I can't find the right reg for CLS

--- Battery-Commander.Web/Views/Units/Details.cshtml
+++ Battery-Commander.Web/Views/Units/Details.cshtml
@@ -200,6 +200,9 @@

@Html.DisplayNameFor(_ => Model.CLS) @Model.CLS.Count()

+
+            Requirements
+

                     @foreach (var soldier in Model.CLS)


Adjust column priority

Adjust column priority

--- Battery-Commander.Web/Views/Vehicles/List.cshtml
+++ Battery-Commander.Web/Views/Vehicles/List.cshtml
@@ -26,20 +26,20 @@

-                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Status)
+                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Status)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Unit)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Bumper)
-                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Type)
-                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Seats)
+                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Type)
+                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Seats)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().TotalCapacity)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Nomenclature)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Registration)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Serial)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().LIN)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Driver)
-                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().A_Driver)
+                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().A_Driver)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().HasJBCP)
-                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Location)
+                @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Location)
                 @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Notes)

                 Passengers


Fixed templateController test (Updated by TFS to TFS Connector, server: http://1x:8080/, id 6719. )

git-tfs-id: [https://tfs.caes.ucdavis.edu:8088/tfs/DefaultCollection]$/CRP/Trunk/CRP;C1213

--- CRP.Tests/Controllers/TemplateControllerTests.cs
+++ CRP.Tests/Controllers/TemplateControllerTests.cs
@@ -1,22 +1,11 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using CRP.Controllers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
+using System.Web.Mvc;
 using CRP.Controllers;
 using CRP.Controllers.Filter;
-using CRP.Controllers.ViewModels;
-using CRP.Core.Domain;
-using CRP.Tests.Core.Extensions;
-using CRP.Tests.Core.Helpers;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using MvcContrib.Attributes;
 using MvcContrib.TestHelper;
-using Rhino.Mocks;
-using UCDArch.Core.PersistanceSupport;
 using UCDArch.Testing;
 using UCDArch.Web.Attributes;

@@ -175,14 +164,12 @@
             var controllerMethod = controllerClass.GetMethods().Where(a => a.Name == "Edit");
             #endregion Arrange

-            #region Act
-            var expectedAttribute = controllerMethod.ElementAt(0).GetCustomAttributes(true).OfType<UserOnlyAttribute>();
+            #region Act
             var allAttributes = controllerMethod.ElementAt(0).GetCustomAttributes(true);
             #endregion Act

             #region Assert
-            Assert.AreEqual(1, expectedAttribute.Count(), "UserOnlyAttribute not found");
-            Assert.AreEqual(1, allAttributes.Count());
+            Assert.AreEqual(0, allAttributes.Count());
             #endregion Assert
         }

@@ -205,6 +192,26 @@
             #region Assert
             Assert.AreEqual(1, expectedAttribute.Count(), "AcceptPostAttribute not found");
             Assert.AreEqual(2, allAttributes.Count(), "More than expected custom attributes found.");
+            #endregion Assert
+        }
+
+        [TestMethod]
+        public void TestControllerMethodEditContainsExpectedAttributes3()
+        {
+            #region Arrange
+            var controllerClass = _controllerClass;
+            var controllerMethod = controllerClass.GetMethods().Where(a => a.Name == "Edit");
+            #endregion Arrange
+
+            #region Act
+            var expectedAttribute = controllerMethod.ElementAt(1).GetCustomAttributes(true).OfType<ValidateInputAttribute>();
+            var allAttributes = controllerMethod.ElementAt(1).GetCustomAttributes(true);
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(1, expectedAttribute.Count(), "ValidateInputAttribute not found");
+            Assert.IsFalse(expectedAttribute.ElementAt(0).EnableValidation, "ValidateInputAttribute Param should be false");
+            Assert.AreEqual(2, allAttributes.Count());
             #endregion Assert
         }
         #endregion Controller Method Tests


[Kate] Start back at level 1 instead of 2

--- CSharpWarrior.Web/Controllers/LevelController.cs
+++ CSharpWarrior.Web/Controllers/LevelController.cs
@@ -14,7 +14,7 @@
                 var compilerResults = compiler.Compile(codeToCompile);
                 using (var sandbox = new Sandbox())
                 {
-                    sandbox.ExecuteAssembly<LevelCrawlerAgent, Level>(compilerResults.PathToAssembly, new LevelFactory().MakeLevel2());
+                    sandbox.ExecuteAssembly<LevelCrawlerAgent, Level>(compilerResults.PathToAssembly, new LevelFactory().MakeLevel1());
                     return "Level complete!";
                 }
             }


simplify type name of double

simplify type name of double

--- src/Metrics.Kafka/Mapper.cs
+++ src/Metrics.Kafka/Mapper.cs
@@ -8,7 +8,7 @@
     {
         public IKafkaDocument Gauge(string name, DateTime timestamp, double value, Unit unit, MetricTags tags)
         {
-            if (!Double.IsNaN(value) && !Double.IsInfinity(value))
+            if (!double.IsNaN(value) && !double.IsInfinity(value))
             {
                 return new KafkaDocument<Gauge>
                 {


Removed unused and obsolete properties.

Removed unused and obsolete properties.

--- src/Micro+/Entity/Entity.cs
+++ src/Micro+/Entity/Entity.cs
@@ -2,11 +2,6 @@
 {
     public abstract class Entity
     {
-        internal EntityState EntityState { get; set; }
-        public bool Delete { get; set; }
-
-        public Entity()
-        {
-        }
+        public Entity() { }
     }
 }


add failing unit tests for cases.

add failing unit tests for cases.

--- tests/Avalonia.Controls.UnitTests/RelativePanelTests.cs
+++ tests/Avalonia.Controls.UnitTests/RelativePanelTests.cs
@@ -82,5 +82,55 @@
             Assert.Equal(new Rect(0, 0, 20, 20), target.Children[0].Bounds);
             Assert.Equal(new Rect(0, 20, 20, 20), target.Children[1].Bounds);
         }
+
+        [Fact]
+        public void LeftOf_Measures_Correctly()
+        {
+            var rect1 = new Rectangle { Height = 20, Width = 20 };
+            var rect2 = new Rectangle { Height = 20, Width = 20 };
+
+            var target = new RelativePanel
+            {
+                VerticalAlignment = Layout.VerticalAlignment.Center,
+                HorizontalAlignment = Layout.HorizontalAlignment.Center,
+                Children =
+                {
+                    rect1, rect2
+                }
+            };
+
+            RelativePanel.SetLeftOf(rect2, rect1);
+            target.Measure(new Size(400, 400));
+            target.Arrange(new Rect(target.DesiredSize));
+
+            Assert.Equal(new Size(20, 20), target.Bounds.Size);
+            Assert.Equal(new Rect(0, 0, 20, 20), target.Children[0].Bounds);
+            Assert.Equal(new Rect(-20, 0, 20, 20), target.Children[1].Bounds);
+        }
+
+        [Fact]
+        public void Above_Measures_Correctly()
+        {
+            var rect1 = new Rectangle { Height = 20, Width = 20 };
+            var rect2 = new Rectangle { Height = 20, Width = 20 };
+
+            var target = new RelativePanel
+            {
+                VerticalAlignment = Layout.VerticalAlignment.Center,
+                HorizontalAlignment = Layout.HorizontalAlignment.Center,
+                Children =
+                {
+                    rect1, rect2
+                }
+            };
+
+            RelativePanel.SetAbove(rect2, rect1);
+            target.Measure(new Size(400, 400));
+            target.Arrange(new Rect(target.DesiredSize));
+
+            Assert.Equal(new Size(20, 20), target.Bounds.Size);
+            Assert.Equal(new Rect(0, 0, 20, 20), target.Children[0].Bounds);
+            Assert.Equal(new Rect(0, -20, 20, 20), target.Children[1].Bounds);
+        }
     }
 }


Handle empty paths for unit tests to repair previous fix

--- src/BloomExe/Book/HtmlDom.cs
+++ src/BloomExe/Book/HtmlDom.cs
@@ -113,8 +113,16 @@
 		public void SetBaseForRelativePaths(string path)
 		{
 			var head = _dom.SelectSingleNodeHonoringDefaultNS("//head");
-			Guard.AgainstNull(head, "Expected the DOM to already have a head element in file: " + path + ". If possible, please send the entire folder '" + Path.GetDirectoryName(path) + "' to the developers. You may need to move this folder to another location or delete it in order to keep working.");
-
+			if (head == null)
+			{
+				var folder = "";
+				if (path.Length > 0) // not unit tests
+					folder = Path.GetDirectoryName(path);
+				Guard.AgainstNull(head,
+					"Expected the DOM to already have a head element in file: " + path +
+					". If possible, please send the entire folder '" + folder +
+					"' to the developers. You may need to move this folder to another location or delete it in order to keep working.");
+			}
 			foreach (XmlNode baseNode in head.SafeSelectNodes("base"))
 			{
 				head.RemoveChild(baseNode);


Changed from crypto hash to non-crypto hash.

--- src/Cuemon.Net/NetWatcher.cs
+++ src/Cuemon.Net/NetWatcher.cs
@@ -3,7 +3,7 @@
 using System.IO;
 using Cuemon.Net.Http;
 using Cuemon.Runtime;
-using Cuemon.Security.Cryptography;
+using Cuemon.Security;
 using Cuemon.Text;

 namespace Cuemon.Net
@@ -163,7 +163,7 @@
                 using (var stream = new FileStream(RequestUri.LocalPath, FileMode.Open, FileAccess.Read))
                 {
                     stream.Position = 0;
-                    currentSignature = HashFactory.CreateCryptoSha256().ComputeHash(stream).ToHexadecimalString();
+                    currentSignature = HashFactory.CreateFnv256().ComputeHash(stream).ToHexadecimalString();
                 }
             }
         }
@@ -180,7 +180,7 @@
                     {
                         case HttpMethods.Get:
                             var etag = response.Headers.ETag;
-                            currentSignature = string.IsNullOrEmpty(etag.Tag) ? HashFactory.CreateCryptoSha256().ComputeHash(response.Content.ReadAsByteArrayAsync().Result).ToHexadecimalString() : etag.Tag;
+                            currentSignature = string.IsNullOrEmpty(etag.Tag) ? HashFactory.CreateFnv256().ComputeHash(response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult()).ToHexadecimalString() : etag.Tag;
                             break;
                         case HttpMethods.Head:
                             utcLastModified = response.Content.Headers.LastModified?.UtcDateTime ?? DateTime.MaxValue;


Simplifying TransactionContext.Run

Simplifying TransactionContext.Run

1. Getting rid of Transaction previous
2. Replacing Transaction created with bool created
3. Disposing / nulling current if created == true

--- sodium/TransactionContext.cs
+++ sodium/TransactionContext.cs
@@ -30,13 +30,11 @@
                 // If we are already inside a transaction (which must be on the same
                 // thread otherwise we wouldn't have acquired transactionLock), then
                 // keep using that same transaction.
-                var previous = current;
-                Transaction created = null;
-
+                var created = false;
                 if (current == null)
                 {
-                    created = new Transaction();
-                    current = created;
+                    current = new Transaction();
+                    created = true;
                 }

                 try
@@ -45,10 +43,10 @@
                 }
                 finally
                 {
-                    if (created != null)
+                    if (created)
                     {
-                        created.Dispose();
-                        current = previous;
+                        current.Dispose();
+                        current = null;
                     }
                 }
             }


Fixed crashing caused my M's latest box fix

--- source/Indy.IL2CPU.IL.X86/Callvirt.cs
+++ source/Indy.IL2CPU.IL.X86/Callvirt.cs
@@ -98,7 +98,6 @@
                 new CPUx86.Pushd(CPUx86.Registers.AtEAX);
                 new CPUx86.Pushd("0" + mMethodIdentifier.ToString("X") + "h");
                 new CPUx86.Call(CPU.Label.GenerateLabelName(VTablesImplRefs.GetMethodAddressForTypeRef));
-                new CPUx86.Pop("eax");
                 /*
                  * On the stack now:
                  * $esp                 Params


Enabled happy path test.

Enabled happy path test.

--- tests/OmniSharp.Roslyn.CSharp.Tests/DiagnosticsFacts.cs
+++ tests/OmniSharp.Roslyn.CSharp.Tests/DiagnosticsFacts.cs
@@ -46,7 +46,7 @@
         [InlineData(false)]
         public async Task CheckAllFiles(bool roslynAnalyzersEnabled)
         {
-            using(var host = GetHost(roslynAnalyzersEnabled))
+            using (var host = GetHost(roslynAnalyzersEnabled))
             {
                 host.AddFilesToWorkspace(
                     new TestFile("a.cs", "class C1 { int n = true; }"),
@@ -64,7 +64,7 @@
         [InlineData(false)]
         public async Task WhenFileIsDeletedFromWorkSpaceThenResultsAreNotReturnedAnyMore(bool roslynAnalyzersEnabled)
         {
-            using(var host = GetHost(roslynAnalyzersEnabled))
+            using (var host = GetHost(roslynAnalyzersEnabled))
             {
                 host.AddFilesToWorkspace(new TestFile("a.cs", "class C1 { int n = true; }"));
                 await host.RequestCodeCheckAsync();
@@ -84,7 +84,7 @@
         [Fact]
         public async Task AnalysisSupportBuiltInIDEAnalysers()
         {
-            using(var host = GetHost(roslynAnalyzersEnabled: true))
+            using (var host = GetHost(roslynAnalyzersEnabled: true))
             {
                 host.AddFilesToWorkspace(
                     new TestFile("a.cs", "class C1 { int n = true; }"));
@@ -97,40 +97,39 @@
         [Fact]
         public async Task WhenUnusedImportExistsWithoutAnalyzersEnabled_ThenReturnEmptyTags()
         {
-            SharedOmniSharpTestHost.AddFilesToWorkspace(
-                new TestFile("returnemptytags.cs", @"
+            using (var host = GetHost(roslynAnalyzersEnabled: false))
+            {
+                host.AddFilesToWorkspace(
+                    new TestFile("returnemptytags.cs", @"
                     using System.IO;
                 "));

-            var handler = GetRequestHandler(SharedOmniSharpTestHost);
-            var quickFixes = await handler.Handle(new CodeCheckRequest()
-            {
-                FileName = "returnemptytags.cs"
-            });
+                var quickFixResponse = await host.RequestCodeCheckAsync("returnemptytags.cs");

-            Assert.Empty(quickFixes.QuickFixes.OfType<DiagnosticLocation>().Single().Tags);
+                var allDiagnostics = quickFixResponse.QuickFixes.OfType<DiagnosticLocation>();
+
+                Assert.Empty(allDiagnostics.SelectMany(x => x.Tags));
+            }
         }

-        [Fact(Skip="Placeholder, requires analyzers to be implemented.")]
+        [Fact]
         public async Task WhenUnusedImportIsFoundAndAnalyzersEnabled_ThenReturnUnnecessaryTag()
         {
-            SharedOmniSharpTestHost.AddFilesToWorkspace(
-                new TestFile("returnidetags.cs", @"
-                    using System.IO;
-                "));
+            using (var host = GetHost(roslynAnalyzersEnabled: true))
+            {
+                host.AddFilesToWorkspace(
+                    new TestFile("returnidetags.cs", @"
+                        using System.IO;
+                    "));

-            // TODO: Enable analyzers for this test, should return IDE analyzer with Unnesessary tag.
-            var handler = GetRequestHandler(SharedOmniSharpTestHost);
-            var quickFixes = await handler.Handle(new CodeCheckRequest()
-            {
-                FileName = "returnidetags.cs"
-            });
+                var quickFixResponse = await host.RequestCodeCheckAsync("returnidetags.cs");

-            Assert.Contains("Unnecessary", quickFixes
-                .QuickFixes
-                .OfType<DiagnosticLocation>()
-                .Single(x => x.Id == "IDE0xxx")
-                .Tags);
+                Assert.Contains("Unnecessary", quickFixResponse
+                    .QuickFixes
+                    .OfType<DiagnosticLocation>()
+                    .Single(x => x.Id == "IDE0005")
+                    .Tags);
+            }
         }
     }
 }


Fix to take the _startKey from formated environment variable name

--- tests/Red-Folder.Tests.Acceptance/Helpers/WebCrawler.cs
+++ tests/Red-Folder.Tests.Acceptance/Helpers/WebCrawler.cs
@@ -18,7 +18,7 @@
         private const int SECONDS_TO_SLEEP_BETWEEN_RESULT_ATTEMPTS = 10 * 1000;     // 10 Seconds
         private const int RESULT_RETRIES = 10;

-        private string _startKey = Environment.GetEnvironmentVariable("Red-Folder.Tests.Acceptance.CrawlWrapper.StartKey");
+        private string _startKey = Environment.GetEnvironmentVariable("Red-Folder_Tests_Acceptance_CrawlWrapper_StartKey");

         private CrawlResults _results;


ftp_fput

ftp_fput

Problem with start pos. There is not support in FluentFTP library.

--- src/Peachpie.Library/Ftp.cs
+++ src/Peachpie.Library/Ftp.cs
@@ -671,6 +671,47 @@

             return false;
         }
+
+        /// <summary>
+        /// Uploads the data from a file pointer to a remote file on the FTP server.
+        /// </summary>
+        /// <param name="ftp_stream">The link identifier of the FTP connection.</param>
+        /// <param name="remote_file">The remote file path.</param>
+        /// <param name="handle">An open file pointer on the local file. Reading stops at end of file.</param>
+        /// <param name="mode">The transfer mode. Must be either FTP_ASCII or FTP_BINARY.</param>
+        /// <param name="startpos">The position in the remote file to start uploading to.</param>
+        /// <returns>Returns TRUE on success or FALSE on failure.</returns>
+        public static bool ftp_fput(PhpResource ftp_stream, string remote_file, PhpResource handle, int mode = FTP_IMAGE, int startpos = 0)
+        {
+            // Check file resource
+            var stream = PhpStream.GetValid(handle);
+            if (stream == null)
+            {
+                return false;
+            }
+            // Check ftp_stream resource
+            var resource = ValidateFtpResource(ftp_stream);
+            if (resource == null)
+                return false;
+
+            resource.Client.UploadDataType = (mode == 1) ? FtpDataType.ASCII : FtpDataType.Binary;
+
+            try
+            {
+                if (startpos !=0)
+                {
+                    // Not supported because ftp library does not support this option
+                    PhpException.Throw(PhpError.Warning, Resources.Resources.option_not_supported);
+                }
+
+                return resource.Client.Upload(stream.RawStream,remote_file,FtpExists.Overwrite);
+            }
+            catch (FtpException ex) { PhpException.Throw(PhpError.Warning, ex.InnerException.Message); }
+            catch (ArgumentException ex) { PhpException.Throw(PhpError.Warning, Resources.Resources.file_not_exists, ex.ParamName); }
+
+            return false;
+        }
+
         /// <summary>
         /// Sends a SITE command to the server
         /// </summary>


EventStreamSpec fix

EventStreamSpec fix

--- src/Pigeon/Event/Logging.cs
+++ src/Pigeon/Event/Logging.cs
@@ -85,8 +85,20 @@
         private async Task AddLogger(ActorSystem system, Type actorClass, LogLevel logLevel, string logName)
         {
             //TODO: remove the newguid stuff
-            var name = "log" + system.Name + "-" + SimpleName(actorClass) + Guid.NewGuid();
-            var actor = system.SystemGuardian.Cell.ActorOf(Props.Create(actorClass), name);
+            var name = "log" + system.Name + "-" + SimpleName(actorClass);
+            ActorRef actor = null;
+            try
+            {
+                actor = system.SystemGuardian.Cell.ActorOf(Props.Create(actorClass), name);
+            }
+            catch
+            {
+                //HACK: the EventStreamSpec tries to start up loggers for a new EventBus
+                //when doing so, this logger is already started and the name reserved.
+                //we need to examine how this is dealt with in akka.
+                name = name + Guid.NewGuid();
+                actor = system.SystemGuardian.Cell.ActorOf(Props.Create(actorClass), name);
+            }
             loggers.Add(actor);
             await actor.Ask(new InitializeLogger(this));
         }


JsxTransformer exception now includes whole inner exception, not only message

--- src/React/JsxTransformer.cs
+++ src/React/JsxTransformer.cs
@@ -140,7 +140,7 @@
 						"In file \"{0}\": {1}",
 						filename,
 						ex.Message
-					));
+					), ex);
 				}
 			}


Initial placeholder http context to be used in background tasks

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045949

--- src/Orchard/Mvc/MvcModule.cs
+++ src/Orchard/Mvc/MvcModule.cs
@@ -28,9 +28,32 @@

             moduleBuilder.RegisterModule(module);
             moduleBuilder
-                .Register(ctx => HttpContext.Current == null ? null : new HttpContextWrapper(HttpContext.Current))
+                .Register(ctx => HttpContext.Current == null ? (HttpContextBase)new HttpContextPlaceholder() : new HttpContextWrapper(HttpContext.Current))
                 .As<HttpContextBase>()
                 .FactoryScoped();
         }
+
+        /// <summary>
+        /// standin context for background tasks.
+        /// </summary>
+        class HttpContextPlaceholder : HttpContextBase {
+            public override HttpRequestBase Request {
+                get { return new HttpRequestPlaceholder(); }
+            }
+        }
+
+        /// <summary>
+        /// standin context for background tasks.
+        /// </summary>
+        class HttpRequestPlaceholder : HttpRequestBase {
+            /// <summary>
+            /// anonymous identity provided for background task.
+            /// </summary>
+            public override bool IsAuthenticated {
+                get { return false; }
+            }
+        }
     }
+
+
 }


React to DNX renames

React to DNX renames

--- src/PageGenerator/Program.cs
+++ src/PageGenerator/Program.cs
@@ -28,7 +28,7 @@
             {
                 throw new ArgumentException(string.Format("Requires {0} argument (Library Name), {1} given", NumArgs, args.Length));
             }
-            var diagnosticsLibInfo = _libraryManager.GetLibraryInformation(args[0]);
+            var diagnosticsLibInfo = _libraryManager.GetLibrary(args[0]);
             if (diagnosticsLibInfo == null)
             {
                 throw new ArgumentException(string.Format(


RELEASE 2.1.3.0

RELEASE 2.1.3.0

--- nspector/Properties/AssemblyInfo.cs
+++ nspector/Properties/AssemblyInfo.cs
@@ -32,7 +32,7 @@
 // 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("2.1.2.0")]
-[assembly: AssemblyFileVersion("2.1.2.0")]
+[assembly: AssemblyVersion("2.1.3.0")]
+[assembly: AssemblyFileVersion("2.1.3.0")]


1. Update : Print some log message information during training process.

--- txt2vec/Encoder.cs
+++ txt2vec/Encoder.cs
@@ -68,6 +68,7 @@

         void InitAccTermFreq()
         {
+            Console.WriteLine("Initializing acculumate term frequency...");
             accFreqTable = new int[vocab_size];
             accTotalFreq = 0;

@@ -82,6 +83,8 @@
                 accFreqTable[i] = accTotalFreq;
                 i++;
             }
+
+            Console.WriteLine("Acculumated total frequency : {0}", accTotalFreq);
         }

         int SearchAccTermTable(int freq)
@@ -295,6 +298,10 @@
                         }

                         train_words++;
+                        if (debug_mode > 0 && train_words % 1000000 == 0)
+                        {
+                            Console.Write("{0}M... ", train_words / 1000000);
+                        }
                     }
                 }
             }


Micro-optimization for iterating through image pixels

--- Source/Bindings/ZXing.SkiaSharp/SKBitmapLuminanceSource.cs
+++ Source/Bindings/ZXing.SkiaSharp/SKBitmapLuminanceSource.cs
@@ -74,10 +74,10 @@
                 // use the color table for indexed images
                 for (int row = 0; row < height; row++)
                 {
-                    for (int col = 0; col < width; col++)
+                    var index = width * row;
+                    for (int col = 0; col < width; col++, index++)
                     {
                         var pixel = src.GetIndex8Color(col, row);
-                        var index = width * row + col;

                         SetLuminance(index, pixel.Red, pixel.Green, pixel.Blue, pixel.Alpha);
                     }
@@ -97,9 +97,9 @@

                     for (int row = 0; row < height; row++)
                     {
-                        for (int col = 0; col < width; col++)
+                        var index = width * row;
+                        for (int col = 0; col < width; col++, index++)
                         {
-                            var index = width * row + col;
                             uint colorVal = *ptr++;

                             var alpha = (byte)((colorVal >> 24) & 0xff);


Fixed Whitespace

Fixed Whitespace

Co-authored-by: Stephen C. Wills <6e690a6576e01cdb9a9715cfd3e6df766c93f1c7@gridprotectionalliance.org>

--- Source/Libraries/GSF.Web/Security/AuthenticationHandler.cs
+++ Source/Libraries/GSF.Web/Security/AuthenticationHandler.cs
@@ -222,9 +222,6 @@
             if (Request.QueryString.HasValue && queryParameters.AllKeys.Contains("code"))
                 return false;

-
-
-
             // Abort pipeline with appropriate response
             if (Options.IsAuthFailureRedirectResource(urlPath) && !IsAjaxCall())
             {


ADDED: Game Objects - Getting the hierarchy root.

--- Source/UnityQuery/Assets/UnityQuery/Scripts/GameObjects.cs
+++ Source/UnityQuery/Assets/UnityQuery/Scripts/GameObjects.cs
@@ -183,6 +183,23 @@
         }

         /// <summary>
+        ///   Gets the hierarchy root of the game object.
+        /// </summary>
+        /// <param name="gameObject">Game object to get the root of.</param>
+        /// <returns>Root of the specified game object.</returns>
+        public static GameObject GetRoot(this GameObject gameObject)
+        {
+            var root = gameObject.transform;
+
+            while (root.parent != null)
+            {
+                root = root.parent;
+            }
+
+            return root.gameObject;
+        }
+
+        /// <summary>
         ///   Indicates whether the a game object is an ancestor of another one.
         /// </summary>
         /// <param name="gameObject">Possible ancestor.</param>


code cleanup a bit

code cleanup a bit

--- WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs
+++ WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs
@@ -30,12 +30,9 @@

         public Task<IStoreItem> GetItemAsync(WebDavUri uri, IHttpContext httpContext)
         {
-            //TODO: Refact
-
             var identity = (HttpListenerBasicIdentity)httpContext.Session.Principal.Identity;
             var path = uri.Path;

-            //TODO: clean this trash
             try
             {
                 var item = CloudManager.Instance(identity).GetItem(path).Result;
@@ -44,26 +41,6 @@
                     return item.IsFile
                         ? Task.FromResult<IStoreItem>(new MailruStoreItem(LockingManager, (File)item, IsWritable))
                         : Task.FromResult<IStoreItem>(new MailruStoreCollection(httpContext, LockingManager, (Folder)item, IsWritable));
-
-                    //if (item.FullPath == path)
-                    //{
-                    //    var dir = new Folder(item.NumberOfFolders, item.NumberOfFiles, item.Size, path);
-                    //    return Task.FromResult<IStoreItem>(new MailruStoreCollection(httpContext, LockingManager, dir, IsWritable));
-                    //}
-                    //var fa = item.Files.FirstOrDefault(k => k.FullPath == path);
-                    //if (fa != null)
-                    //    return Task.FromResult<IStoreItem>(new MailruStoreItem(LockingManager, fa, IsWritable));
-
-                    //string parentPath = WebDavPath.Parent(path);
-                    //item = Cloud.Instance(identity).GetItems(parentPath).Result;
-                    //if (item != null)
-                    //{
-                    //    var f = item.Files.FirstOrDefault(k => k.FullPath == path);
-                    //    return null != f
-                    //        ? Task.FromResult<IStoreItem>(new MailruStoreItem(LockingManager, f, IsWritable))
-                    //        : null;
-                    //}
-
                 }
             }
             catch (AggregateException e)


Fix a regression where unlisting a package which was not the latest version causes the package to be removed from search results.

--- Website/Infrastructure/Lucene/LuceneIndexingService.cs
+++ Website/Infrastructure/Lucene/LuceneIndexingService.cs
@@ -74,14 +74,27 @@

         public void UpdatePackage(Package package)
         {
+            var packageRegistrationKey = package.PackageRegistrationKey;
+            var updateTerm = new Term("PackageRegistrationKey", packageRegistrationKey.ToString(CultureInfo.InvariantCulture));
+
+            if (!package.IsLatest || package.IsLatestStable)
+            {
+                // Someone passed us in a version which was e.g. just unlisted? Or just not the latest version which is what we want to index. Doesn't really matter. We'll find one to index.
+                package = _packageRepository.GetAll()
+                .Where(p => (p.IsLatest || p.IsLatestStable) && p.PackageRegistrationKey == packageRegistrationKey)
+                .Include(p => p.PackageRegistration)
+                .Include(p => p.PackageRegistration.Owners)
+                .Include(p => p.SupportedFrameworks)
+                .FirstOrDefault();
+            }
+
             // Just update the provided package
             using (Trace.Activity(String.Format(CultureInfo.CurrentCulture, "Updating Lucene Index for: {0} {1} [PackageKey:{2}]", package.PackageRegistration.Id, package.Version, package.Key)))
             {
                 EnsureIndexWriter(creatingIndex: false);
-                var indexEntity = new PackageIndexEntity(package);
-                var updateTerm = new Term("PackageRegistrationKey", package.PackageRegistrationKey.ToString(CultureInfo.InvariantCulture));
-                if (package.Listed)
-                {
+                if (package != null)
+                {
+                    var indexEntity = new PackageIndexEntity(package);
                     Trace.Information(String.Format(CultureInfo.CurrentCulture, "Updating Document: {0}", updateTerm.ToString()));
                     _indexWriter.UpdateDocument(updateTerm, indexEntity.ToDocument());
                 }


Documented tracer interface

Documented tracer interface

--- SketchDataRetracer/SketchDataRetracer/MainPage.xaml.cs
+++ SketchDataRetracer/SketchDataRetracer/MainPage.xaml.cs
@@ -33,13 +33,14 @@

         public MainPage()
         {
-            this.InitializeComponent();
+            // initialize the components and ink canvas
+            InitializeComponent();
             InitializeInkCanvas();

-            //
+            // maximize the interface window
             ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

-            //
+            // initialize the stroke event handlers
             MyInkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;
             MyInkCanvas.InkPresenter.StrokeInput.StrokeContinued += StrokeInput_StrokeContinued;
             MyInkCanvas.InkPresenter.StrokeInput.StrokeEnded += StrokeInput_StrokeEnded;
@@ -47,6 +48,7 @@

         private void MyPage_Loaded(object sender, RoutedEventArgs e)
         {
+            // initialize the external timing data structure and offset
             myTimeCollection = new List<List<long>>();
             DateTimeOffset = 0;
         }
@@ -71,53 +73,82 @@

         private void MyClearButton_Click(object sender, RoutedEventArgs e)
         {
+            // clear the canvas
             MyInkCanvas.InkPresenter.StrokeContainer.Clear();
+
+            // clear the stroke and timing data
             myTimeCollection = new List<List<long>>();
             DateTimeOffset = 0;
+
+            // clear the tracers
             MyCanvas.Children.Clear();
         }

         private void MyUndoButton_Click(object sender, RoutedEventArgs e)
         {
-            //
+            // get the strokes
             IReadOnlyList<InkStroke> strokes = MyInkCanvas.InkPresenter.StrokeContainer.GetStrokes();

-            //
+            // reset the time offset and finish
             if (strokes.Count == 0)
             {
                 DateTimeOffset = 0;
                 return;
             }

-            //
+            // select the last stroke and delete it
             strokes[strokes.Count - 1].Selected = true;
             MyInkCanvas.InkPresenter.StrokeContainer.DeleteSelected();

-            //
+            // remove the last time
             myTimeCollection.RemoveAt(myTimeCollection.Count - 1);

-            //
-            MyCanvas.Children.Clear();
-        }
-
-        private void MyPlayButton_Click(object sender, RoutedEventArgs e)
-        {
-            if (MyInkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count == 0) { return; }
-
-            Play2();
-        }
-
-        private void Play2()
-        {
             // clear the canvas
             MyCanvas.Children.Clear();
-
-            //
+        }
+
+        private void MyPlayButton_Click(object sender, RoutedEventArgs e)
+        {
+            // do nothing if there are no strokes on the ink canvas
+            if (MyInkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count == 0) { return; }
+
+            // clear the canvas
+            MyCanvas.Children.Clear();
+
+            // retrace the strokes
+            Canvas canvas = MyCanvas;
             List<InkStroke> strokesCollection = MyInkCanvas.InkPresenter.StrokeContainer.GetStrokes().ToList();
-            List<List<long>> timesCollection = myTimeCollection;
-
-            //
-            long offsetTime = timesCollection[0][0];
+            Retrace(MyCanvas, strokesCollection, myTimeCollection);
+        }
+
+        private void Retrace(Canvas canvas, List<InkStroke> strokesCollection, List<List<long>> timesCollection)
+        {
+            // offset and shift the times
+            // that is, offset all the times so that the first time is zeroed
+            // and shift the times so that the delay between each stroke is one second
+            List<List<long>> originalTimesCollection = timesCollection;
+            timesCollection = new List<List<long>>();
+            long shift = 0;
+            long offset = myTimeCollection[0][0];
+            for (int i = 0; i < myTimeCollection.Count; ++i)
+            {
+                // begin shifting after the first stroke
+                if (i > 0)
+                {
+                    long previousLastTime = myTimeCollection[i-1][myTimeCollection[i-1].Count - 1];
+                    long currentFirstTime = myTimeCollection[i][0];
+                    shift += currentFirstTime - previousLastTime - 1000000;
+                }
+
+                // include the shift and offset values
+                List<long> times = new List<long>();
+                for (int j = 0; j < myTimeCollection[i].Count; ++j)
+                {
+                    long time = myTimeCollection[i][j] - shift - offset;
+                    times.Add(time);
+                }
+                timesCollection.Add(times);
+            }

             // iterate through each stroke
             for (int i = 0; i < strokesCollection.Count; ++i)
@@ -132,8 +163,8 @@
                 double startX = stroke.GetInkPoints()[0].Position.X;
                 double startY = stroke.GetInkPoints()[0].Position.Y;

-                // create the stroke's current tracer
-                Ellipse ellipse = new Ellipse()
+                // create the stroke's corresponding tracer
+                Ellipse tracer = new Ellipse()
                 {
                     Width = 30,
                     Height = 30,
@@ -141,24 +172,25 @@
                 };

                 // add the tracer to the canvas
-                Canvas.SetLeft(ellipse, -ellipse.Width / 2);
-                Canvas.SetTop(ellipse, -ellipse.Height / 2);
-                MyCanvas.Children.Add(ellipse);
-
-                // initialize the storyboard and animation
-                ellipse.RenderTransform = new CompositeTransform();
+                // note: the tracer is moved up and left its radius to center
+                Canvas.SetLeft(tracer, -tracer.Width / 2);
+                Canvas.SetTop(tracer, -tracer.Height / 2);
+                canvas.Children.Add(tracer);
+
+                // initialize the storyboard and animations
+                tracer.RenderTransform = new CompositeTransform();
                 Storyboard storyboard = new Storyboard();
                 DoubleAnimationUsingKeyFrames translateXAnimation = new DoubleAnimationUsingKeyFrames();
                 DoubleAnimationUsingKeyFrames translateYAnimation = new DoubleAnimationUsingKeyFrames();
                 DoubleAnimationUsingKeyFrames fadeAnimation = new DoubleAnimationUsingKeyFrames();

-                // create the tracer's translation animation
+                // create the tracer's translation animations
                 KeyTime keyTime;
                 EasingDoubleKeyFrame frameX, frameY;
                 double x, y;
                 for (int j = 0; j < count; ++j)
                 {
-                    keyTime = new TimeSpan(times[j] - offsetTime);
+                    keyTime = new TimeSpan(times[j]);
                     x = stroke.GetInkPoints()[j].Position.X;
                     y = stroke.GetInkPoints()[j].Position.Y;

@@ -169,11 +201,9 @@
                     translateYAnimation.KeyFrames.Add(frameY);
                 }

-                // update offset time to offset drawing break between current and previous stroke
-                long firstTime = times[0] - offsetTime;
-                long lastTime = times[times.Count - 1] - offsetTime;
-
-                //
+                // create the tracer's fade animations
+                long firstTime = times[0];
+                long lastTime = times[times.Count - 1];
                 fadeAnimation.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = new TimeSpan(0), Value = 1 });
                 fadeAnimation.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = new TimeSpan(0), Value = 0 });
                 fadeAnimation.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = new TimeSpan(firstTime), Value = 0 });
@@ -181,12 +211,12 @@
                 fadeAnimation.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = new TimeSpan(lastTime), Value = 1 });
                 fadeAnimation.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = new TimeSpan(lastTime), Value = 0 });

-                // assign the animations to their components
-                Storyboard.SetTarget(translateXAnimation, ellipse);
-                Storyboard.SetTarget(translateYAnimation, ellipse);
-                Storyboard.SetTarget(fadeAnimation, ellipse);
-
-                // assign the animation to their behavior
+                // assign the animations to the tracer
+                Storyboard.SetTarget(translateXAnimation, tracer);
+                Storyboard.SetTarget(translateYAnimation, tracer);
+                Storyboard.SetTarget(fadeAnimation, tracer);
+
+                // assign the animations to their behavior's properties
                 Storyboard.SetTargetProperty(translateXAnimation, "(UIElement.RenderTransform).(CompositeTransform.TranslateX)");
                 Storyboard.SetTargetProperty(translateYAnimation, "(UIElement.RenderTransform).(CompositeTransform.TranslateY)");
                 Storyboard.SetTargetProperty(fadeAnimation, "(UIElement.Opacity)");
@@ -201,97 +231,6 @@
             }
         }

-        private void Play()
-        {
-            // clear the canvas
-            MyCanvas.Children.Clear();
-
-            //
-            var strokesCollection = MyInkCanvas.InkPresenter.StrokeContainer.GetStrokes().ToList();
-            for (int i = 0; i < strokesCollection.Count; ++i)
-            {
-
-            }
-
-            // create the tracer
-            Ellipse ellipse = new Ellipse()
-            {
-                Width = 30,
-                Height = 30,
-                Fill = new SolidColorBrush(Colors.Red)
-            };
-            Canvas.SetLeft(ellipse, -ellipse.Width / 2);
-            Canvas.SetTop(ellipse, -ellipse.Height / 2);
-            MyCanvas.Children.Add(ellipse);
-
-            //
-            var stroke = strokesCollection[0];
-            var times = myTimeCollection[0];
-
-            //
-            int pointsCount = stroke.GetInkPoints().Count;
-            int count = pointsCount < times.Count ? pointsCount : times.Count;
-
-            //
-            double startX = stroke.GetInkPoints()[0].Position.X;
-            double startY = stroke.GetInkPoints()[0].Position.Y;
-
-            //
-            long initialTime = times[0];
-
-            //
-            ellipse.RenderTransform = new CompositeTransform();
-            Storyboard storyboard = new Storyboard();
-
-            //
-            DoubleAnimationUsingKeyFrames translateXAnimation = new DoubleAnimationUsingKeyFrames();
-            DoubleAnimationUsingKeyFrames translateYAnimation = new DoubleAnimationUsingKeyFrames();
-            DoubleAnimationUsingKeyFrames fadeoutAnimation = new DoubleAnimationUsingKeyFrames();
-
-            //
-            KeyTime keyTime;
-            EasingDoubleKeyFrame frameX, frameY;
-            double x, y;
-            for (int j = 0; j < count; ++j)
-            {
-                keyTime = new TimeSpan(times[j] - initialTime);
-                x = stroke.GetInkPoints()[j].Position.X;
-                y = stroke.GetInkPoints()[j].Position.Y;
-
-                frameX = new EasingDoubleKeyFrame() { KeyTime = keyTime, Value = x };
-                frameY = new EasingDoubleKeyFrame() { KeyTime = keyTime, Value = y };
-
-                translateXAnimation.KeyFrames.Add(frameX);
-                translateYAnimation.KeyFrames.Add(frameY);
-            }
-
-            //
-            long lastTime = times[times.Count - 1] - initialTime;
-            KeyTime visibleTime = new TimeSpan(lastTime);
-            KeyTime invisibleTime = new TimeSpan(lastTime + 100);
-            EasingDoubleKeyFrame visible = new EasingDoubleKeyFrame() { KeyTime = visibleTime, Value = 1 };
-            EasingDoubleKeyFrame invisible = new EasingDoubleKeyFrame() { KeyTime = invisibleTime, Value = 0 };
-            fadeoutAnimation.KeyFrames.Add(visible);
-            fadeoutAnimation.KeyFrames.Add(invisible);
-
-            //
-            Storyboard.SetTarget(translateXAnimation, ellipse);
-            Storyboard.SetTarget(translateYAnimation, ellipse);
-            Storyboard.SetTarget(fadeoutAnimation, ellipse);
-
-            //
-            Storyboard.SetTargetProperty(translateXAnimation, "(UIElement.RenderTransform).(CompositeTransform.TranslateX)");
-            Storyboard.SetTargetProperty(translateYAnimation, "(UIElement.RenderTransform).(CompositeTransform.TranslateY)");
-            Storyboard.SetTargetProperty(fadeoutAnimation, "(UIElement.Opacity)");
-
-            //
-            storyboard.Children.Add(translateXAnimation);
-            storyboard.Children.Add(translateYAnimation);
-            storyboard.Children.Add(fadeoutAnimation);
-
-            storyboard.Begin();
-        }
-
         #endregion

         #region Stroke Interactions


Fixed Streaming to Matlab

Fixed Streaming to Matlab

--- Source/Libraries/ECAClientUtilities/UnmappingHelper.cs
+++ Source/Libraries/ECAClientUtilities/UnmappingHelper.cs
@@ -18,11 +18,15 @@
 //  ----------------------------------------------------------------------------------------------------
 //  01/16/2017 - Stephen C. Wills
 //       Generated original version of source code.
+//  09/12/2019 - Christoph Lackner
+//       Added Methods from UnmapperBase for Matlab support.
 //
 //******************************************************************************************************

 using ECAClientFramework;
 using ECACommonUtilities;
+using ECACommonUtilities.Model;
+using GSF.TimeSeries;

 namespace ECAClientUtilities
 {
@@ -32,5 +36,28 @@
             : base(framework, mappingCompiler, SystemSettings.OutputMapping)
         {
         }
+
+        // Matlab doesn't see base class members, so we "re-expose" them here...
+
+        public new void BurnKeyIndex()
+        {
+            base.BurnKeyIndex();
+        }
+
+        public new MetaValues CreateMetaValues(FieldMapping fieldMapping)
+        {
+            return base.CreateMetaValues(fieldMapping);
+        }
+
+        public new void Reset()
+        {
+            base.Reset();
+        }
+
+        public new IMeasurement MakeMeasurement(MetaValues meta, double value)
+        {
+            return base.MakeMeasurement(meta, value);
+        }
+
     }
 }


Client side validation for cover photo type added.

--- Source/Web/SpeedHero.Web/Controllers/PostController.cs
+++ Source/Web/SpeedHero.Web/Controllers/PostController.cs
@@ -59,7 +59,12 @@
         [ValidateAntiForgeryToken]
         public ActionResult CreatePost(CreatePostViewModel inputPost)
         {
-            if (ModelState.IsValid && CheckIsFileAnImage(inputPost.File))
+            if (inputPost.File != null && !CheckIsFileAnImage(inputPost.File))
+            {
+                ModelState.AddModelError("Cover photo", "Cover photo must be of type \"jpeg\" or...");
+            }
+
+            if (ModelState.IsValid)
             {
                 // This is to remind me if I don't use kendo Editor and the content needs decoding/encoding before saving to DB.
                 // string content = HttpUtility.HtmlDecode(inputPost.Content);


Cleaned up logging statements.

Cleaned up logging statements.

--- CitadelService/Services/FilterServiceProvider.cs
+++ CitadelService/Services/FilterServiceProvider.cs
@@ -1624,7 +1624,6 @@

         private void OnHttpMessageBegin(Uri requestUrl, string headers, byte[] body, MessageType msgType, MessageDirection msgDirection, out ProxyNextAction nextAction, out string customBlockResponseContentType, out byte[] customBlockResponse)
         {
-
             nextAction = ProxyNextAction.AllowAndIgnoreContent;
             customBlockResponseContentType = null;
             customBlockResponse = null;
@@ -1783,8 +1782,6 @@

         private void OnHttpMessageEnd(Uri requestUrl, string headers, byte[] body, MessageType msgType, MessageDirection msgDirection, out bool shouldBlock, out string customBlockResponseContentType, out byte[] customBlockResponse)
         {
-            m_logger.Info("OnHttpMessageEnd Uri: {0}", requestUrl.ToString());
-
             shouldBlock = false;
             customBlockResponseContentType = null;
             customBlockResponse = null;
@@ -1806,21 +1803,18 @@

                 if((contentType = parsedHeaders["Content-Type"]) != null)
                 {
-                    m_logger.Info("Running content classifier on Content-Type: {0}", parsedHeaders["Content-Type"]);
-
                     contentType = contentType.ToLower();

                     BlockType blockType;
                     var contentClassResult = OnClassifyContent(body, contentType, out blockType);

-                    m_logger.Info("Content classified as {0}", contentClassResult);
-                    if(contentClassResult > 0)
+                    if (contentClassResult > 0)
                     {
                         shouldBlock = true;

                         UriInfo uriInfo = WebServiceUtil.Default.LookupUri(requestUrl, true);

-                        if(contentType.IndexOf("html") != -1 || contentType.IndexOf("json") != -1)
+                        if(contentType.IndexOf("html") != -1)
                         {
                             customBlockResponseContentType = "text/html";
                             customBlockResponse = getBlockPageWithResolvedTemplates(requestUrl, 0, uriInfo, blockType);
@@ -2017,8 +2011,6 @@
                             // dataToAnalyzeStr = ext.Extract(dataToAnalyzeStr.ToCharArray(), true);
                         }

-                        m_logger.Info("Analyzing: {0}", dataToAnalyzeStr);
-
                         short matchedCategory = -1;
                         string trigger = null;
                         var cfg = Config;
@@ -2034,10 +2026,6 @@
                                 blockedBecause = BlockType.TextTrigger;
                                 return mappedCategory.CategoryId;
                             }
-                        }
-                        else
-                        {
-                            m_logger.Info("Triggers not successfully run.");
                         }
                     }
                 }
@@ -2710,12 +2698,8 @@
                 {
                     if (entry is MappedBypassListCategoryModel)
                     {
-                        m_logger.Info("Setting entry {0} to false", entry.CategoryName);
                         m_categoryIndex.SetIsCategoryEnabled(((MappedBypassListCategoryModel)entry).CategoryId, false);
                         //m_categoryIndex.SetIsCategoryEnabled(((MappedBypassListCategoryModel)entry).CategoryIdAsWhitelist, true);
-                    } else
-                    {
-                        m_logger.Info("Entry is not bypassable {0}", entry.CategoryName);
                     }
                 }

@@ -2741,7 +2725,6 @@
                     {
                         if (entry is MappedBypassListCategoryModel)
                         {
-                            m_logger.Info("Setting entry {0} to false", entry.CategoryName);
                             m_categoryIndex.SetIsCategoryEnabled(((MappedBypassListCategoryModel)entry).CategoryId, false);
                         }
                     }


Added comments

Added comments

--- Src/AutoFixture.NUnit.UnitTest/AutoTestCaseProviderTest.cs
+++ Src/AutoFixture.NUnit.UnitTest/AutoTestCaseProviderTest.cs
@@ -16,19 +16,25 @@
         [Fact]
         public void HasTestCasesForAutoTestCaseTestCaseProvider()
         {
+            // Fixture setup
+            // Exercise system
             var sut = new AutoTestCaseProvider();
             var actual = sut.HasTestCasesFor(this.method);
-
+            // Verify outcome
             Assert.True(actual);
+            // Teardown
         }

         [Fact]
         public void GetTestCasesForAutoTestCaseTestCaseBuilderReturnsCorrectly()
         {
+            // Fixture setup
+            // Exercise system
             var sut = new AutoTestCaseProvider();
             var actual = sut.GetTestCasesFor(this.method);
-
+            // Verify outcome
             Assert.NotNull(actual);
+            // Teardown
         }
     }
 }


Update Delegate Reference

Update Delegate Reference

--- XPlat/Mapbox/iOS/source/MapboxSDK.iOS/ApiDefinition.cs
+++ XPlat/Mapbox/iOS/source/MapboxSDK.iOS/ApiDefinition.cs
@@ -211,16 +211,8 @@
         IntPtr Constructor (CGRect frame, [NullAllowed] NSUrl styleURL);

         //// @property (nonatomic, weak) id<MGLMapViewDelegate> _Nullable delegate __attribute__((iboutlet));
-        //[NullAllowed, Export("delegate", ArgumentSemantic.Weak)]
-        //IMapViewDelegate Delegate { get; set; }
-
-        [Wrap ("WeakDelegate")]
-        [NullAllowed]
-        MapViewDelegate Delegate { get; set; }
-
-        // @property (nonatomic, weak) id<MGLMapViewDelegate> _Nullable delegate __attribute__((iboutlet));
-        [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
-        NSObject WeakDelegate { get; set; }
+        [NullAllowed, Export("delegate", ArgumentSemantic.Weak)]
+        IMapViewDelegate Delegate { get; set; }

         // @property (readonly, nonatomic) MGLStyle * _Nullable style;
         [NullAllowed, Export ("style")]
@@ -1355,13 +1347,9 @@
         [Export ("sharedOfflineStorage")]
         OfflineStorage Shared { get; }

-        [Wrap ("WeakDelegate")]
-        [NullAllowed]
-        OfflineStorageDelegate Delegate { get; set; }
-
         // @property (nonatomic, weak) id<MGLOfflineStorageDelegate> _Nullable delegate __attribute__((iboutlet));
         [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
-        NSObject WeakDelegate { get; set; }
+		IOfflineStorageDelegate Delegate { get; set; }

         // @property (readonly, nonatomic, strong) NSArray<MGLOfflinePack *> * _Nullable packs;
         [NullAllowed, Export ("packs", ArgumentSemantic.Strong)]


Now we have a TokenClass.Unknown fix test parameter

--- ClassicBasic.Test/InterpreterTests/TokenTests.cs
+++ ClassicBasic.Test/InterpreterTests/TokenTests.cs
@@ -111,7 +111,7 @@
         [DataRow("F", TokenClass.String, "\"F\"")]
         [DataRow("G", TokenClass.Variable, "G")]
         [DataRow("H", TokenClass.Data, "H")]
-        [DataRow("I", TokenType.Unknown, "Unknown class Unknown")]
+        [DataRow("I", TokenClass.Unknown, "Unknown class Unknown")]
         public void TokenToStringTest(string text, TokenClass tokenClass, string textOut)
         {
             var token = new Token(text, tokenClass);


Compacted the code for readability (it was difficult to follow the build of the URIs).

Also, removed use of Helper.GetUuid to avoid the use of reflection. Minimised casts.

Signed-off-by: Konstantina Chremmou <a7d1f757a659045fb6db8c1e3849a1c8ad00b97a@citrix.com>

--- XenAdmin/Controls/CustomDataGraph/ArchiveMaintainer.cs
+++ XenAdmin/Controls/CustomDataGraph/ArchiveMaintainer.cs
@@ -47,20 +47,6 @@

     public class ArchiveMaintainer
     {
-        private delegate void ReaderDelegate(XmlReader reader, IXenObject xmo);
-        private delegate Uri URIDelegate(Session session, Host host, ArchiveInterval interval, IXenObject xmo);
-
-        internal const string RrdUpdatesPath = "rrd_updates";
-        private const string RrdHostPath = "host_rrds";
-        private const string RrdVmPath = "vm_rrds";
-        internal const string RrdCFAverage = "AVERAGE";
-
-        private const string RrdHostUpdatesQuery = "session_id={0}&start={1}&cf={2}&interval={3}&host=true&vm_uuid=";
-        internal const string RrdHostAndVmUpdatesQuery = "session_id={0}&start={1}&cf={2}&interval={3}&host=true";
-        private const string RrdVmUpdatesQuery = "session_id={0}&start={1}&cf={2}&interval={3}&vm_uuid={4}";
-        private const string RrdHostQuery = "session_id={0}";
-        private const string RrdVmQuery = "session_id={0}&uuid={1}";
-
         private const long TicksInOneSecond = 10000000;
         private const long TicksInFiveSeconds = 50000000;
         internal const long TicksInTenSeconds = 100000000;
@@ -177,7 +163,6 @@
             while (RunThread)
             {
                 IXenObject xenObject = XenObject;
-                Host Host = GetHost(xenObject);

                 DateTime ServerWas = ServerNow(); // get time before updating so we don't miss any 5 second updates if getting the past data

@@ -200,7 +185,7 @@

                     LoadingInitialData = true;
                     OnArchivesUpdated();
-                    Get(ArchiveInterval.None, RrdsUri, RRD_Full_InspectCurrentNode, Host, xenObject);
+                    Get(ArchiveInterval.None, RrdsUri, RRD_Full_InspectCurrentNode, xenObject);
                     LoadingInitialData = false;
                     OnArchivesUpdated();

@@ -213,25 +198,25 @@

                 if (ServerWas - LastFiveSecondCollection > FiveSeconds)
                 {
-                    GetUpdate(ArchiveInterval.FiveSecond, Host, xenObject);
+                    Get(ArchiveInterval.FiveSecond, UpdateUri, RRD_Update_InspectCurrentNode, xenObject);
                     LastFiveSecondCollection = ServerWas;
                     Archives[ArchiveInterval.FiveSecond].Load(SetsAdded);
                 }
                 if (ServerWas - LastOneMinuteCollection > OneMinute)
                 {
-                    GetUpdate(ArchiveInterval.OneMinute, Host, xenObject);
+                    Get(ArchiveInterval.OneMinute, UpdateUri, RRD_Update_InspectCurrentNode, xenObject);
                     LastOneMinuteCollection = ServerWas;
                     Archives[ArchiveInterval.OneMinute].Load(SetsAdded);
                 }
                 if (ServerWas - LastOneHourCollection > OneHour)
                 {
-                    GetUpdate(ArchiveInterval.OneHour, Host, xenObject);
+                    Get(ArchiveInterval.OneHour, UpdateUri, RRD_Update_InspectCurrentNode, xenObject);
                     LastOneHourCollection = ServerWas;
                     Archives[ArchiveInterval.OneHour].Load(SetsAdded);
                 }
                 if (ServerWas - LastOneDayCollection > OneDay)
                 {
-                    GetUpdate(ArchiveInterval.OneDay, Host, xenObject);
+                    Get(ArchiveInterval.OneDay, UpdateUri, RRD_Update_InspectCurrentNode, xenObject);
                     LastOneDayCollection = ServerWas;
                     Archives[ArchiveInterval.OneDay].Load(SetsAdded);
                 }
@@ -256,29 +241,16 @@
             return DateTime.UtcNow.Subtract(ClientServerOffset);
         }

-        /// <summary>
-        /// UpdaterThread Thread
-        /// </summary>
-        private void GetUpdate(ArchiveInterval interval, Host host, IXenObject xo)
-        {
-            Get(interval, UpdateUri, RRD_Update_InspectCurrentNode, host, xo);
-        }
-
-        /// <summary>
-        /// UpdaterThread Thread
-        /// </summary>
-        private void Get(ArchiveInterval interval, URIDelegate URI, ReaderDelegate Reader,
-            Host host, IXenObject xenObject)
-        {
-            if (host == null)
-                return;
-
+        private void Get(ArchiveInterval interval, Func<ArchiveInterval, IXenObject, Uri> uriBuilder,
+            Action<XmlReader, IXenObject>Reader, IXenObject xenObject)
+        {
             try
             {
-                Session session = xenObject.Connection.Session;
-                if (session == null)
+                var uri = uriBuilder(interval, xenObject);
+                if (uri == null)
                     return;
-                using (Stream httpstream = HTTPHelper.GET(URI(session, host, interval, xenObject), xenObject.Connection, true))
+
+                using (Stream httpstream = HTTPHelper.GET(uri, xenObject.Connection, true))
                 {
                     using (XmlReader reader = XmlReader.Create(httpstream))
                     {
@@ -299,39 +271,62 @@
             }
         }

-        /// <summary>
-        /// UpdaterThread Thread
-        /// </summary>
-        private Uri UpdateUri(Session session, Host host, ArchiveInterval interval, IXenObject xo)
-        {
-            string query =
-                xo is Host ?
-                    string.Format(RrdHostUpdatesQuery, Uri.EscapeDataString(session.opaque_ref), TimeFromInterval(interval), RrdCFAverage, ToSeconds(interval)) :
-                xo is VM ?
-                    string.Format(RrdVmUpdatesQuery, Uri.EscapeDataString(session.opaque_ref), TimeFromInterval(interval), RrdCFAverage, ToSeconds(interval), Helpers.GetUuid(xo)) :
-                    "";
-            return BuildUri(host, RrdUpdatesPath, query);
-        }
-
-        private static Uri RrdsUri(Session session, Host host, ArchiveInterval interval, IXenObject xo)
-        {
-            string query =
-                xo is Host ?
-                    string.Format(RrdHostQuery, Uri.EscapeDataString(session.opaque_ref)) :
-                xo is VM ?
-                    string.Format(RrdVmQuery, Uri.EscapeDataString(session.opaque_ref), Helpers.GetUuid(xo)) :
-                    "";
-            return BuildUri(host, xo is Host ? RrdHostPath : RrdVmPath, query);
+        private Uri UpdateUri(ArchiveInterval interval, IXenObject xo)
+        {
+            var sessionRef = xo?.Connection?.Session?.opaque_ref;
+            if (sessionRef == null)
+                return null;
+
+            var escapedRef = Uri.EscapeDataString(sessionRef);
+            var startTime = TimeFromInterval(interval);
+            var duration = ToSeconds(interval);
+
+            if (xo is Host host)
+            {
+                return BuildUri(host, "rrd_updates",
+                    $"session_id={escapedRef}&start={startTime}&cf=AVERAGE&interval={duration}&host=true");
+            }
+
+            if (xo is VM vm)
+            {
+                var vmHost = vm.Connection.Resolve(vm.resident_on) ?? Helpers.GetMaster(vm.Connection);
+                BuildUri(vmHost, "rrd_updates",
+                    $"session_id={escapedRef}&start={startTime}&cf=AVERAGE&interval={duration}&vm_uuid={vm.uuid}");
+            }
+
+            return null;
+        }
+
+        private static Uri RrdsUri(ArchiveInterval interval, IXenObject xo)
+        {
+            var sessionRef = xo.Connection.Session?.opaque_ref;
+            if (sessionRef == null)
+                return null;
+
+            var escapedRef = Uri.EscapeDataString(sessionRef);
+
+            if (xo is Host host)
+                return BuildUri(host, "host_rrds", $"session_id={escapedRef}");
+
+            if (xo is VM vm)
+            {
+                var vmHost = vm.Connection.Resolve(vm.resident_on) ?? Helpers.GetMaster(vm.Connection);
+                return BuildUri(vmHost, "vm_rrds", $"session_id={escapedRef}&uuid={vm.uuid}");
+            }
+
+            return null;
         }

         private static Uri BuildUri(Host host, string path, string query)
         {
-            UriBuilder builder = new UriBuilder();
-            builder.Scheme = host.Connection.UriScheme;
-            builder.Host = host.address;
-            builder.Port = host.Connection.Port;
-            builder.Path = path;
-            builder.Query = query;
+            UriBuilder builder = new UriBuilder
+            {
+                Scheme = host.Connection.UriScheme,
+                Host = host.address,
+                Port = host.Connection.Port,
+                Path = path,
+                Query = query
+            };
             return builder.Uri;
         }

@@ -472,7 +467,7 @@
             else if (LastNode == "cf")
             {
                 string str = reader.ReadContentAsString();
-                if (str != RrdCFAverage)
+                if (str != "AVERAGE")
                     BailOut = true;
             }
             else if (LastNode == "v")
@@ -617,25 +612,6 @@
             }
         }

-        private static Host GetHost(IXenObject xmo)
-        {
-            if (xmo is Host)
-            {
-                return (Host)xmo;
-            }
-            else if (xmo is VM)
-            {
-                VM vm = (VM)xmo;
-                return xmo.Connection.Resolve(vm.resident_on) ?? Helpers.GetMaster(xmo.Connection);
-            }
-            else
-            {
-                System.Diagnostics.Trace.Assert(false);
-                return null;
-            }
-        }
-
-
         private void OnArchivesUpdated()
         {
             if (ArchivesUpdated != null)


link search in default description

link search in default description

--- Terradue.OpenSearch/Terradue/OpenSearch/Result/AtomFeed.cs
+++ Terradue.OpenSearch/Terradue/OpenSearch/Result/AtomFeed.cs
@@ -219,12 +219,8 @@

         public string Identifier {
             get {
-                foreach (var ext in this.ElementExtensions) {
-                    XmlElement element = ext.GetObject<XmlElement>();
-                    if (element.LocalName == "identifier")
-                        return element.InnerText;
-                }
-                return HttpUtility.UrlEncode(base.Id);
+                var identifier = ElementExtensions.ReadElementExtensions<string>("identifier", "http://purl.org/dc/elements/1.1/");
+                return identifier.Count == 0 ? base.Id : identifier[0];
             }
             set {
                 foreach (var ext in this.ElementExtensions.ToArray()) {
@@ -283,6 +279,8 @@

             AtomItem item = new AtomItem();

+            item.ElementExtensions = new SyndicationElementExtensionCollection(result.ElementExtensions);
+
             item.Id = result.Id;
             item.Identifier = result.Identifier;
             if ( result.Date.Ticks != 0 )
@@ -291,7 +289,7 @@
             item.Title = result.Title;
             item.LastUpdatedTime = DateTime.UtcNow;

-            item.ElementExtensions = new SyndicationElementExtensionCollection(result.ElementExtensions);
+

             return item;
         }


Moved draw restore to the right place

Moved draw restore to the right place

--- ClickableLinksInChat.mod/ClickableLinksInChat.cs
+++ ClickableLinksInChat.mod/ClickableLinksInChat.cs
@@ -108,13 +108,12 @@
                             GUILayout.Label(current.text, chatLogStyle, new GUILayoutOption[] {
 				                GUILayout.Width(chatlogAreaInner.width - (float)Screen.height * 0.1f - 20f)});
                         }
-
-                        // restore old color. Should not be necessary, but it does not hurt to be paranoid
-                        GUI.color = oldColor;
                         GUILayout.EndHorizontal();
                     }
                     GUILayout.EndScrollView();
                     GUILayout.EndArea();
+                    // restore old color. Should not be necessary, but it does not hurt to be paranoid
+                    GUI.color = oldColor;
                 }
             }
         }


[GTK] Properly save/restore global alpha

--- Xwt.Gtk/Xwt.CairoBackend/CairoContextBackendHandler.cs
+++ Xwt.Gtk/Xwt.CairoBackend/CairoContextBackendHandler.cs
@@ -47,6 +47,7 @@

 		struct Data {
 			public double PatternAlpha;
+			public double GlobalAlpha;
 		}

 		public CairoContextBackend (double scaleFactor)
@@ -70,7 +71,8 @@
 		{
 			Context.Save ();
 			dataStack.Push (new Data () {
-				PatternAlpha = PatternAlpha
+				PatternAlpha = PatternAlpha,
+				GlobalAlpha = GlobalAlpha
 			});
 		}

@@ -79,6 +81,7 @@
 			Context.Restore ();
 			var d = dataStack.Pop ();
 			PatternAlpha = d.PatternAlpha;
+			GlobalAlpha = d.GlobalAlpha;
 		}
 	}


ujpdated trace messages

ujpdated trace messages

--- ClientDecisionService/DecisionServiceRecorder.cs
+++ ClientDecisionService/DecisionServiceRecorder.cs
@@ -139,7 +139,7 @@
                 }
                 else
                 {
-                    Trace.TraceInformation("Successfully uploaded batch {0} with {1} events.", batch.ID, batch.JsonEvents.Count);
+                    Trace.TraceInformation("Successfully uploaded batch with {0} events.", batch.JsonEvents.Count);
                 }
 #endif
             }


improve command suggestions

improve command suggestions

--- CompatBot/EventHandlers/UnknownCommandHandler.cs
+++ CompatBot/EventHandlers/UnknownCommandHandler.cs
@@ -138,24 +138,30 @@
             if (allKnownBotCommands != null)
                 return allKnownBotCommands;

-            static void dumpChildren(CommandGroup group, List<string> commandList)
+            static void dumpCmd(List<string> commandList, Command cmd, string qualifiedPrefix)
+            {
+                foreach (var alias in cmd.Aliases.Concat(new[] {cmd.Name}))
+                {
+                    var qualifiedAlias = qualifiedPrefix + alias;
+                    commandList.Add(qualifiedAlias);
+                    if (cmd is CommandGroup g)
+                        dumpChildren(g, commandList, qualifiedAlias + " ");
+                }
+            }
+
+            static void dumpChildren(CommandGroup group, List<string> commandList, string qualifiedPrefix)
             {
                 foreach (var cmd in group.Children)
-                {
-                    commandList.Add(cmd.QualifiedName);
-                    if (cmd is CommandGroup g)
-                        dumpChildren(g, commandList);
-                }
+                    dumpCmd(commandList, cmd, qualifiedPrefix);
             }

             var result = new List<string>();
             foreach (var cmd in ctx.CommandsNext.RegisteredCommands.Values)
-            {
-                result.Add(cmd.QualifiedName);
-                if (cmd is CommandGroup g)
-                    dumpChildren(g, result);
-            }
+                dumpCmd(result, cmd, "");
             allKnownBotCommands = result;
+#if DEBUG
+            Config.Log.Debug("Total command alias permutations: " + allKnownBotCommands.Count);
+#endif
             return allKnownBotCommands;
         }


Add check for number of function params in calls

--- compiler/frontend/Parser.cs
+++ compiler/frontend/Parser.cs
@@ -642,8 +642,6 @@
                     cfg.Root.Bb.AddInstruction(loadInst);
                     temp.Value = new Operand(loadInst);

-
-
                     var ssa = new SsaVariable(temp.UuId, loadInst, null, temp.Name);
                     ssa.Identity = parameter;
                     temp.Value.Inst = loadInst;
@@ -652,8 +650,6 @@
                     ssa.Value = new Operand(loadInst);

                     //loadInst.Arg1 = ssa.Value;
-
-

                     variables[parameter.Id] = ssa;
                     //arg = new Operand(ssa);
@@ -809,6 +805,17 @@
                 //TODO: jump to call
             }

+			foreach (var func in FunctionsCfgs)
+			{
+				if (func.Name == id.Name)
+				{
+					if (func.Parameters.Count != paramList.Count)
+					{
+						FatalError("Function '" + func.Name + "' takes " + func.Parameters.Count +" parameters, but " + paramList.Count+ " were provided.");
+					}
+				}
+			}
+
             foreach (ParseResult item in paramList)
             {
                 instructions.AddRange(item.Instructions);
@@ -818,7 +825,6 @@
             id = new Operand(call);

             instructions.Add(call);
-

             return new ParseResult(id, instructions, variables);
         }


Added more comments

Added more comments

--- ConsoleFx.ConsoleExtensions/ConsoleEx.WaitFor.cs
+++ ConsoleFx.ConsoleExtensions/ConsoleEx.WaitFor.cs
@@ -90,6 +90,13 @@
             return key;
         }

+        /// <summary>
+        /// <para>Repeatedly prompts the user for a key press, until any of the specified escape keys are pressed.</para>
+        /// <para>If the pressed key if available in the specified handlers, the corresponding handler is called. If not, it is ignored and the loop continues.</para>
+        /// </summary>
+        /// <param name="handlers">Collection of keys to handle and their handlers.</param>
+        /// <param name="postKeyPress">Optional action to run after any key press, not counting the ignored keys and escape keys.</param>
+        /// <param name="escapeKeys">The keys that will break the loop. If not specified, defaults to the escape key.</param>
         public static void WaitForKeysLoop(IEnumerable<KeyHandler> handlers,
             Action<ConsoleKey> postKeyPress = null, IEnumerable<ConsoleKey> escapeKeys = null)
         {
@@ -98,9 +105,11 @@
             if (!handlers.Any())
                 throw new ArgumentException("Specify at least one handler.", nameof(handlers));

+            // If the escapeKeys parameter is not specified, default it to the Escape key.
             if (escapeKeys == null)
                 escapeKeys = new[] {ConsoleKey.Escape};

+            // Ensure that none of the escape keys are specified in the handlers.
             if (handlers.Any(h => escapeKeys.Any(k => k == h.Key)))
                 throw new ArgumentException("Specified escape keys should not be specified in the handlers.", nameof(escapeKeys));


minimal changes with monodevelop.

minimal changes with monodevelop.

--- compiler/frontend/Parser.cs
+++ compiler/frontend/Parser.cs
@@ -12,6 +12,8 @@
 	{
 		public Token t;
 		public Lexer s;
+		string filename;
+

 		public void getExpected(Token expected)
 		{
@@ -19,8 +21,21 @@
 			{
 				next();
 			}
-			error();s
+			error();
 		}
+
+		public void error(string str)
+		{
+			//TODO: determine location in file
+			Console.WriteLine ("Error Parsing file: " + filename + ", " + str);
+			error_fatal();
+		}
+
+		public void error_fatal(){
+			//TODO: determine location in file
+			throw new Exception("Fatal Error Parsing file: " + filename + ". Unable to continue";
+		}
+

         public void next() {
             t = s.getNextToken();


Tweak the app-runner to try to force GC things

--- src/SampleServer/Program.cs
+++ src/SampleServer/Program.cs
@@ -24,19 +24,38 @@
             }
         }
         static bool logging = true;
-        public static void Main()
-        {
-            TaskScheduler.UnobservedTaskException += (sender, args) =>
-            {
-                args.SetObserved();
-                WriteError(args.Exception);
-            };
+        public static int Main()
+        {
+            try
+            {
+                TaskScheduler.UnobservedTaskException += (sender, args) =>
+                {
+                    Console.WriteLine($"{nameof(TaskScheduler)}.{nameof(TaskScheduler.UnobservedTaskException)}");
+                    args.SetObserved();
+                    WriteError(args.Exception);
+                };
 #if DNX451
-            AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
-            {
-                WriteError(args.ExceptionObject as Exception);
-            };
+                AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
+                {
+                    Console.WriteLine($"{nameof(AppDomain)}.{nameof(AppDomain.UnhandledException)}");
+                    WriteError(args.ExceptionObject as Exception);
+                };
 #endif
+                Run();
+                for(int i = 0; i < 5; i++) // try to force any finalizer bugs
+                {
+                    GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
+                    GC.WaitForPendingFinalizers();
+                }
+                return 0;
+            } catch(Exception ex)
+            {
+                WriteError(ex);
+                return -1;
+            }
+        }
+        public static void Run()
+        {
             using (var server = new MyServer())
             {
                 server.Start(IPAddress.Loopback, 5001);
@@ -177,10 +196,8 @@
                             break;
                     }
                 }
-                Console.WriteLine($"Press any key to exit");
-                Console.ReadKey();
-                cancel.Cancel();
                 Console.WriteLine("Shutting down...");
+                cancel.Cancel();
             }
         }
         private static void StartClients(CancellationToken cancel, int count = 1)


Added unknown option to formTypeEnum --Signed-off-by Kathleen Oneal <onealkathleena@johndeere.com>

--- source/ADAPT/FormTypeEnum.cs
+++ source/ADAPT/FormTypeEnum.cs
@@ -9,6 +9,7 @@
   * Contributors:
   *    Tarak Reddy, Tim Shearouse - initial API and implementation
   *    Joseph Ross - Renaming Enums to end in Enum
+  *    Kathleen Oneal - Adding Unknown to enum
   *******************************************************************************/

 namespace AgGateway.ADAPT.ApplicationDataModel
@@ -18,5 +19,6 @@
         Gas,
         Liquid,
         Solid,
+        Unknown
     }
 }


Started working on Global api docs

Started working on Global api docs

--- source/Cosmos.Core/Global.cs
+++ source/Cosmos.Core/Global.cs
@@ -12,6 +12,9 @@
         // These are used by Bootstrap.. but also called to signal end of interrupt etc...
         // Need to chagne this.. I dont like how this is.. maybe isolate or split into to classes... one for boostrap one for
         // later user
+        /// <summary>
+        /// Get PIC.
+        /// </summary>
         static public PIC PIC
         {
             get
@@ -20,6 +23,9 @@
             }
         }

+        /// <summary>
+        /// Get CPU.
+        /// </summary>
         static public CPU CPU
         {
             get
@@ -28,6 +34,9 @@
             }
         }

+        /// <summary>
+        /// Init <see cref="Global"/> inctanse.
+        /// </summary>
         static public void Init()
         {
             // See note in Bootstrap about these


Updated SolutionAssemblyInfo

Updated SolutionAssemblyInfo

--- src/SolutionAssemblyInfo.cs
+++ src/SolutionAssemblyInfo.cs
@@ -7,6 +7,10 @@
 // </copyright>

 // --------------------------------------------------------------------------------------------------------------------
+
+
+
+#pragma warning disable 1699    // 1699 = Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile'

@@ -30,7 +34,7 @@

 [assembly: AssemblyCompany("Orcomp")]

-[assembly: AssemblyCopyright("Copyright  Orcomp 2013 - 2014")]
+[assembly: AssemblyCopyright("Copyright  Orcomp 2010 - 2014")]

 [assembly: AssemblyTrademark("")]

@@ -60,8 +64,6 @@

-[assembly: AssemblyVersion("1.1.3.0")]
+[assembly: AssemblyVersion("1.0")]

-[assembly: AssemblyFileVersion("1.1.3.0")]
-
-+[assembly: AssemblyInformationalVersion("1.0, manual release in Visual Studio")]


Cleanup.

Cleanup.

--- src/SparkPost/DataMapper.cs
+++ src/SparkPost/DataMapper.cs
@@ -1,9 +1,6 @@
 using System;
-using System.Collections;
 using System.Collections.Generic;
-using System.Globalization;
 using System.Linq;
-using System.Reflection;
 using System.Text.RegularExpressions;
 using SparkPost.ValueMappers;


configBuilder: refactor linq setup

configBuilder: refactor linq setup

--- src/Stronk/ConfigBuilder.cs
+++ src/Stronk/ConfigBuilder.cs
@@ -45,12 +45,11 @@
 				properties.Select(p => p.Name));

 			var values = properties
-				.Select(property => new ValueSelectorArgs(_options.Logger, configSource, property))
-				.Select(args => new
+				.Select(property => new
 				{
-					Property = args.Property,
-					Converters = GetValueConverters(availableConverters, args.Property),
-					Value = GetValueFromSource(valueSelectors, args)
+					Property = property,
+					Converters = GetValueConverters(availableConverters, property),
+					Value = GetValueFromSource(valueSelectors, new ValueSelectorArgs(_options.Logger, configSource, property))
 				})
 				.Where(descriptor =>
 				{