Do vphys loading hack without try/catch

Do vphys loading hack without try/catch

--- GUI/Types/Renderer/PhysSceneNode.cs
+++ GUI/Types/Renderer/PhysSceneNode.cs
@@ -6,6 +6,7 @@
 using ValveResourceFormat.Serialization;
 using System.Numerics;
 using System.Linq;
+using ValveResourceFormat.Serialization.NTRO;

 namespace GUI.Types.Renderer
 {
@@ -131,13 +132,13 @@

                     var vertOffset = verts.Count / 7;
                     Vector3[] vertices = null;
-                    try
+                    if (mesh is NTROStruct)
                     {
                         //NTRO has vertices as array of structs
                         var verticesArr = mesh.GetArray("m_Vertices");
                         vertices = verticesArr.Select(v => v.ToVector3()).ToArray();
                     }
-                    catch
+                    else
                     {
                         //KV3 has vertices as blob
                         var verticesBlob = mesh.GetArray<byte>("m_Vertices");
@@ -164,14 +165,14 @@
                     }

                     int[] triangles = null;
-                    try
+                    if (mesh is NTROStruct)
                     {
                         //NTRO and SOME KV3 has triangles as array of structs
                         var trianglesArr = mesh.GetArray("m_Triangles");
                         triangles = trianglesArr.SelectMany(t => t.GetArray<object>("m_nIndex").
                                                             Select(Convert.ToInt32)).ToArray();
                     }
-                    catch
+                    else
                     {
                         //some KV3 has triangles as blob
                         var trianglesBlob = mesh.GetArray<byte>("m_Triangles");


fix version

fix version

--- Generaid/Properties/AssemblyInfo.cs
+++ Generaid/Properties/AssemblyInfo.cs
@@ -14,6 +14,6 @@
 [assembly: ComVisible(false)]
 [assembly: Guid("7b227385-b83d-4e16-868e-e307967d0ee4")]

-[assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.1.*")]
+[assembly: AssemblyFileVersion("1.1.0.0")]
 [assembly: InternalsVisibleTo("Generaid.Tests")]


update version

update version

--- Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
+++ Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
@@ -13,5 +13,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-[assembly: AssemblyVersion("5.6.1.0")]
-[assembly: AssemblyFileVersion("5.6.1")]+[assembly: AssemblyVersion("5.6.2.0")]
+[assembly: AssemblyFileVersion("5.6.2")]


edit 'cashier' validation

edit 'cashier' validation

--- AirlineTicketOffice.Model/Models/CashierModel.cs
+++ AirlineTicketOffice.Model/Models/CashierModel.cs
@@ -59,7 +59,7 @@
                     case "FullName":
                         if (CheckBlankLine(this.FullName))
                             return "Please enter a Full Name";
-                        if (this.FullName.Length < 2 || this.FullName.Length > 50)
+                        if (this.FullName.Length < 3 || this.FullName.Length > 50)
                             return "You must specify the name of the country (Example: Finland)";
                         break;
                     default:
@@ -74,17 +74,12 @@

         private bool CheckOfficeNumber()
         {
-            Regex reg = new Regex(@"^\d{10}$");
-
+
             if (this.numberOfOffices < 0
                 || this.numberOfOffices > Int32.MaxValue)
             {
                 return false;
-            }
-            if (reg.IsMatch(this.numberOfOffices.ToString()))
-            {
-                return false;
-            }
+            }

             return true;
         }


Bumped version for Myre.Entities (added an extension method earlier)

Signed-off-by: Martin Evans <fbe68550a3878a44ead7fa06f7b29f9942900ad3@gmail.com>


Add RemovePrimaryActionStyle helper to theme, PopupMenuButton support

- Issue MatterHackers/MCCentral#3687
'Print" button location lost

--- ApplicationView/ThemeConfig.cs
+++ ApplicationView/ThemeConfig.cs
@@ -76,16 +76,36 @@

 		internal void ApplyPrimaryActionStyle(GuiWidget guiWidget)
 		{
-
 			guiWidget.BackgroundColor = this.AccentMimimalOverlay;

 			switch(guiWidget)
 			{
+				case PopupMenuButton menuButton:
+					menuButton.HoverColor = new Color(this.AccentMimimalOverlay, 60);
+					break;
 				case SimpleFlowButton flowButton:
 					flowButton.HoverColor = new Color(this.AccentMimimalOverlay, 60);
 					break;
 				case SimpleButton button:
 					button.HoverColor = new Color(this.AccentMimimalOverlay, 60);
+					break;
+			}
+		}
+
+		internal void RemovePrimaryActionStyle(GuiWidget guiWidget)
+		{
+			guiWidget.BackgroundColor = Color.Transparent;
+
+			switch (guiWidget)
+			{
+				case PopupMenuButton menuButton:
+					menuButton.HoverColor = Color.Transparent;
+					break;
+				case SimpleFlowButton flowButton:
+					flowButton.HoverColor = Color.Transparent;
+					break;
+				case SimpleButton button:
+					button.HoverColor = Color.Transparent;
 					break;
 			}
 		}


Add the Date Kind in string formatting

Add the Date Kind in string formatting

--- NFluent/Extensions/ExtensionsCommonHelpers.cs
+++ NFluent/Extensions/ExtensionsCommonHelpers.cs
@@ -55,7 +55,7 @@
         public static string ToStringProperlyFormated(this DateTime theDateTime)
         {
             // return a ISO-8601 Date format
-            return theDateTime.ToString("o", CultureInfo.InvariantCulture);
+            return string.Format(CultureInfo.InvariantCulture, "{0:o}, Kind = {1}", theDateTime, theDateTime.Kind);
         }

         /// <summary>


caused game over upon killing everything

--- Assets/Script/EnemyMovement.cs
+++ Assets/Script/EnemyMovement.cs
@@ -14,6 +14,7 @@

 	public int dir = 1; //changes direction of enemies
 	private float movementSpeed = 0.65f; //controls the speed of the enemies
+	private GameMgr gamemgr;

 	void EnemyMovementUpdate(){

@@ -26,11 +27,14 @@
 			dir = 1; //changes direction of enemies again based on pos of x, also moves enemies down towards player
 			transform.position = new Vector3 (transform.position.x, transform.position.y - 0.5f, transform.position.z);
 		}
+		if (gameObject.GetComponentsInChildren<IsACharacter> ().Length == 0 && gamemgr.State == GameMgr.GameState.IN_GAME) {
+			gamemgr.AdvanceState ();
+		}
 	}

 	// Use this for initialization
 	void Start () {
-
+		gamemgr = GameObject.Find ("GLOBAL").GetComponent<GameMgr> ();
 	}

 	// Update is called once per frame


Rename method

Rename method

--- Assets/Scripts/MapGenerator.cs
+++ Assets/Scripts/MapGenerator.cs
@@ -48,7 +48,7 @@
     Transform containerObject = new GameObject(containerName).transform;
     containerObject.parent = transform;

-    GenerateTiles(currentMap, containerObject);
+    CreateTiles(currentMap, containerObject);

     bool[,] obstacleMap = new bool[(int)mapSize.x, (int)mapSize.y];
     int obstacleCount = (int)(mapSize.x * mapSize.y * currentMap.obstaclePercent);
@@ -98,7 +98,7 @@
     navMeshFloor.localScale = new Vector3(maxMapSize.x, maxMapSize.y) * tileSize;
   }

-  void GenerateTiles(Map map, Transform containerObject) {
+  void CreateTiles(Map map, Transform containerObject) {
     for (int x = 0; x < map.size.x; x++) {
       for (int y = 0; y < map.size.y; y++) {
         Vector3 position;


Revert StageManager.cs

Revert StageManager.cs

--- Assets/HoloToolkit/Stage/Scripts/StageManager.cs
+++ Assets/HoloToolkit/Stage/Scripts/StageManager.cs
@@ -25,8 +25,10 @@
         [Tooltip("Material used to draw bounds for the stage. Leave empty if you have not setup your space or don't want to render bounds.")]
         public Material StageBoundsMaterial;

+        private bool updateStageBounds = true;
+
         public List<Vector3> EditorLines;
-        List<GameObject> boundingBoxLines = new List<GameObject>();
+        private List<GameObject> boundingBoxLines = new List<GameObject>();

         private bool renderStage = true;
         public bool RenderStage
@@ -72,6 +74,7 @@
 #if UNITY_EDITOR
                 // So the floor quad does not occlude in editor testing, draw it lower.
                 floorQuadInstance.transform.localPosition = new Vector3(0, -3, 0);
+                updateStageBounds = true;

                 UpdateStageBounds();
 #else
@@ -118,6 +121,7 @@
                         DrawLine(start, end);
                     }
                     DrawLine(bounds[0], bounds[bounds.Count - 1]);
+                    updateStageBounds = false;
                 }
             }
         }


Changed collection to inherit from Collection<string>

--- Octokit/Models/Request/SearchIssuesRequest.cs
+++ Octokit/Models/Request/SearchIssuesRequest.cs
@@ -2,7 +2,6 @@
 using System.Diagnostics;
 using Octokit.Internal;
 using System;
-using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Globalization;
@@ -337,72 +336,28 @@
         Issue
     }

-    public class RepositoryCollection : IEnumerable<string>
-    {
-        readonly ICollection<string> _repositories = new List<string>();
-
-        public IEnumerator<string> GetEnumerator()
-        {
-            return _repositories.GetEnumerator();
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
+    public class RepositoryCollection : Collection<string>
+    {
         public void Add(string owner, string name)
+        {
+            Add(GetRepositoryName(owner, name));
+        }
+
+        public bool Contains(string owner, string name)
+        {
+            return Contains(GetRepositoryName(owner, name));
+        }
+
+        public bool Remove(string owner, string name)
+        {
+            return Remove(GetRepositoryName(owner, name));
+        }
+
+        private static string GetRepositoryName(string owner, string name)
         {
             Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
             Ensure.ArgumentNotNullOrEmptyString(name, "name");

-            _repositories.Add(GetRepositoryName(owner, name));
-        }
-
-        public void Add(string nameWithOwner)
-        {
-            Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
-
-            _repositories.Add(nameWithOwner);
-        }
-
-        public void Clear()
-        {
-            _repositories.Clear();
-        }
-
-        public bool Contains(string owner, string name)
-        {
-            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
-            Ensure.ArgumentNotNullOrEmptyString(name, "name");
-
-            return _repositories.Contains(GetRepositoryName(owner, name));
-        }
-
-        public bool Contains(string nameWithOwner)
-        {
-            Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
-
-            return _repositories.Contains(nameWithOwner);
-        }
-
-        public bool Remove(string owner, string name)
-        {
-            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
-            Ensure.ArgumentNotNullOrEmptyString(name, "name");
-
-            return _repositories.Remove(GetRepositoryName(owner, name));
-        }
-
-        public bool Remove(string nameWithOwner)
-        {
-            Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
-
-            return _repositories.Remove(nameWithOwner);
-        }
-
-        private static string GetRepositoryName(string owner, string name)
-        {
             return string.Format(CultureInfo.InvariantCulture, "{0}/{1}", owner, name);
         }
     }


Fix how params are added to querystring

Fix how params are added to querystring

--- Octokit/Models/Request/SearchIssuesRequest.cs
+++ Octokit/Models/Request/SearchIssuesRequest.cs
@@ -185,7 +185,7 @@
             {
                 parameters.Add(String.Format(CultureInfo.InvariantCulture, "repo:{0}", Repo));
             }
-
+
             return String.Join("+", parameters);
         }

@@ -199,7 +199,8 @@
                 d.Add("per_page", PerPage.ToString());
                 d.Add("sort", Sort.ToString());
                 d.Add("order", Order.ToString());
-                d.Add("q", Term + " " + MergeParameters());
+                var mergedParameters = MergeParameters();
+                d.Add("q", Term + (mergedParameters.IsNotBlank() ? "+" + mergedParameters : ""));
                 return d;
             }
         }


Fix a couple nullable warnings.

Fix a couple nullable warnings.

--- Pinta.Effects/Dialogs/Effects.LevelsDialog.cs
+++ Pinta.Effects/Dialogs/Effects.LevelsDialog.cs
@@ -383,7 +383,7 @@
 				UpdateLevels ();
 		}

-		private void HandleGradientInputValueChanged (object sender, IndexEventArgs e)
+		private void HandleGradientInputValueChanged (object? sender, IndexEventArgs e)
 		{
 			int val = gradientInput.GetValue (e.Index);

@@ -395,7 +395,7 @@
 			UpdateLevels ();
 		}

-		private void HandleGradientOutputValueChanged (object sender, IndexEventArgs e)
+		private void HandleGradientOutputValueChanged (object? sender, IndexEventArgs e)
 		{
 			if (gradientOutput.ValueIndex != -1 && gradientOutput.ValueIndex != e.Index)
 				return;


Working towards 0.4 release

Working towards 0.4 release

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


TrileInstance Phi fix via GitHub webpage - 3/3

--- PreParsedBases/XNAFEZ/TrileInstanceHandler.cs
+++ PreParsedBases/XNAFEZ/TrileInstanceHandler.cs
@@ -16,7 +16,7 @@
 			obj.TrileId = reader.ReadInt32();
 			byte pPhi = reader.ReadByte();
 			if (pPhi != 137) {
-			obj.SetPhiLight(reader.ReadByte());
+			obj.SetPhiLight(pPhi);
 			} else {
 			obj.Phi = reader.ReadSingle();
 			}


Checking CI server is failing when there are failing tests.

--- ProjectCreation/Tests/GenerateProjectTests.cs
+++ ProjectCreation/Tests/GenerateProjectTests.cs
@@ -1,8 +1,8 @@
-using FluentAssertions;
-using NUnit.Framework;
-using System;
+using System;
 using System.IO;
 using System.IO.Compression;
+using FluentAssertions;
+using NUnit.Framework;

 namespace Lucid.ProjectCreation.Tests
 {
@@ -14,6 +14,7 @@
         [Test]
         public void Execute()
         {
+            Assert.Fail("Testing CI server");
             var cmd = _validCommand();

             var bytes = cmd.Execute();


Adding bool to limit or not the view with the axis.

--- Proto/Assets/Scripts/Camera/CameraMovement.cs
+++ Proto/Assets/Scripts/Camera/CameraMovement.cs
@@ -8,6 +8,8 @@
     [SerializeField]float m_YMax = 50f;
     [SerializeField]float m_XMin;
     [SerializeField]float m_XMax;
+    [SerializeField]bool m_YLock = true;
+    [SerializeField]bool m_XLock = true;
     Vector2 m_Input;

     float m_CurrentX;
@@ -40,8 +42,15 @@
         m_CurrentX += m_Input.x;
         m_CurrentY += m_Input.y;

-        m_CurrentY = Mathf.Clamp(m_CurrentY, m_YMin, m_YMax);
-        m_CurrentX = Mathf.Clamp(m_CurrentX, m_XMin, m_XMax);
+        if (m_YLock)
+        {
+            m_CurrentY = Mathf.Clamp(m_CurrentY, m_YMin, m_YMax);
+        }
+
+        if(m_XLock)
+        {
+            m_CurrentX = Mathf.Clamp(m_CurrentX, m_XMin, m_XMax);
+        }
     }

     void UpdatePosition()


Corrected namespace

Corrected namespace


Undetected eye is now gray

Undetected eye is now gray


테스트라 카더라(1)

테스트라 카더라(1)

--- HelloWorld/HelloWorld/HelloWorld.cs
+++ HelloWorld/HelloWorld/HelloWorld.cs
@@ -10,7 +10,7 @@
 			if (result) {
 				Console.WriteLine("같습니다");
 			} else {
-				Console.WriteLine("틀립니다아아아");
+				Console.WriteLine("틀립니다");
 			}
 		}
 	}


Updates

Updates

--- Hermod/HTTP/Server/HTTPProcessor.cs
+++ Hermod/HTTP/Server/HTTPProcessor.cs
@@ -306,7 +306,8 @@
                                     #region Call RequestLog delegate

                                     var RequestLogLocal = RequestLog;
-                                    if (RequestLogLocal != null)
+                                    if (RequestLogLocal != null &&
+                                        HttpRequest     != null)
                                     {
                                         RequestLogLocal(this, RequestTimestamp, HttpRequest);
                                     }
@@ -318,7 +319,8 @@
                                     HTTPResponse _HTTPResponse = null;

                                     var OnNotificationLocal = OnNotification;
-                                    if (OnNotificationLocal != null)
+                                    if (OnNotificationLocal != null &&
+                                        HttpRequest         != null)
                                     {

                                         // ToDo: How to read request body by application code?!
@@ -348,7 +350,8 @@

                                     #region Call AccessLog delegate

-                                    if (_HTTPResponse != null)
+                                    if ( HttpRequest  != null &&
+                                        _HTTPResponse != null)
                                     {

                                         var AccessLogLocal = AccessLog;
@@ -364,7 +367,8 @@

                                     #region if HTTP Status Code == 4xx | 5xx => Call ErrorLog delegate

-                                    if (_HTTPResponse != null &&
+                                    if ( HttpRequest  != null &&
+                                        _HTTPResponse != null &&
                                         _HTTPResponse.HTTPStatusCode.Code >  400 &&
                                         _HTTPResponse.HTTPStatusCode.Code <= 599)
                                     {


Trade off, export readable rank versus logical sort

Fixes #270

--- Battery-Commander.Web/Views/Soldiers/List.cshtml
+++ Battery-Commander.Web/Views/Soldiers/List.cshtml
@@ -56,7 +56,7 @@

                         @Html.DisplayFor(s => soldier, "SoldierStatus")

-                    @Html.DisplayFor(s => soldier.RankHumanized)
+                    @Html.DisplayFor(s => soldier.RankHumanized)
                     @Html.RouteLink(soldier.LastName, "Soldier.Details", new { soldier.Id })
                     @Html.RouteLink(soldier.FirstName, "Soldier.Details", new { soldier.Id })
                     @Html.DisplayFor(s => soldier.Unit)


Move towbar and fuel card to front

Move towbar and fuel card to front

--- Battery-Commander.Web/Views/Vehicles/List.cshtml
+++ Battery-Commander.Web/Views/Vehicles/List.cshtml
@@ -26,8 +26,6 @@
             @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().LIN)
             @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Driver)
             @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().A_Driver)
-            @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().HasFuelCard)
-            @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().HasTowBar)
             @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().HasJBCP)
             @Html.DisplayNameFor(_ => _.Vehicles.FirstOrDefault().Notes)
             Edit
@@ -42,6 +40,14 @@

                         @Html.DisplayFor(_ => vehicle, "VehicleStatus")

+                    @if (vehicle.HasFuelCard)
+                    {
+                        Fuel Card
+                    }
+                    @if (vehicle.HasTowBar)
+                    {
+                        TowBar
+                    }

                 @Html.DisplayFor(_ => vehicle.Unit)
                 @Html.DisplayFor(_ => vehicle)
@@ -72,19 +78,7 @@
                     }

-                    @if(vehicle.HasFuelCard)
-                    {
-                        Fuel Card
-                    }
-
-
-                    @if(vehicle.HasTowBar)
-                    {
-                        TowBar
-                    }
-
-
-                    @if(vehicle.HasJBCP)
+                    @if (vehicle.HasJBCP)
                     {
                         JBC-P
                     }


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -382,6 +382,15 @@
     public void TestMethod_IsPrime_73()
     {
       const int source = 73;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_79()
+    {
+      const int source = 79;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


variable cleanup. refactored code in preparation for dynamic face mesh loading after 2d authentication happens.

--- Authentication/Overlay.xaml.cs
+++ Authentication/Overlay.xaml.cs
@@ -14,26 +14,28 @@
   public partial class Overlay : Window, INotifyPropertyChanged {
     // MainWindow Variables
     private KinectSensor kinectSensor = null;
-    private DepthFrameReader depthFrameReader = null;
     BodyFrameReader bodyFrameReader = null;
+    // Body Variables
     IList<Body> bodies = null;
     private Body currentTrackedBody = null;
     private ulong currentTrackingId = 0;
-    //HD variables
+    // HD variables
     private HighDefinitionFaceFrameSource highDefinitionFaceSource = null;
     private HighDefinitionFaceFrameReader highDefinitionFaceReader = null;
     private FaceAlignment highdefinitionFaceAlignment = null;
     private FaceModel highDefinitionFaceModel = null;
-    private List<System.Windows.Shapes.Ellipse> points = new List<System.Windows.Shapes.Ellipse>();
     private int checkPointMatches = 0;
     private IReadOnlyList<CameraSpacePoint> defaultVertices;
     private CameraSpacePoint tempVertice = new CameraSpacePoint();
     private float tollerance = 0.0015f;
-    //Face Frame Variables
+    // Saved HD Face Variables
+    private List<System.Windows.Shapes.Ellipse> savedDots = new List<System.Windows.Shapes.Ellipse>();
+    private CameraSpacePoint[] savedVertices = null;
+    // Face Frame Variables
     private FaceFrameSource faceFrameSource = null;
     private FaceFrameReader faceFrameReader = null;
-    private IReadOnlyDictionary<FacePointType, PointF> facePoints;
-    //Depth Variables
+    // Depth Variables
+    private DepthFrameReader depthFrameReader = null;
     private ushort minDepth = 500;
     private ushort maxDepth = 1000;
     private double multiplier;
@@ -43,14 +45,11 @@
     private CameraSpacePoint[] depthVertices = null;
     private int depthWidth;
     private int depthHeight;
-    //Mouse Variables
-    private Point origin;
-    private Point start;
-    //Property Variables
+    // Mouse Variables
+    private Point mouseOrigin;
+    private Point mouseStart;
+    // Property Variables
     public event PropertyChangedEventHandler PropertyChanged;
-
-    private List<System.Windows.Shapes.Ellipse> savedDots = new List<System.Windows.Shapes.Ellipse>();
-    private CameraSpacePoint[] savedVertices = null;

@@ -61,30 +60,27 @@

       // create the colorFrameDescription from the ColorFrameSource using Bgra format
       FrameDescription depthFrameDescription = this.kinectSensor.DepthFrameSource.FrameDescription;
-
-      // create the writeable bitmap to display our frames
       this.depthBitmap = new WriteableBitmap(depthFrameDescription.Width, depthFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
       depthVertices = new CameraSpacePoint[depthFrameDescription.Width * depthFrameDescription.Height];

+      // start with default alignment
+      this.highdefinitionFaceAlignment = new FaceAlignment();
+
+      // setup sources prior to opening readers
       this.faceFrameSource = new FaceFrameSource(this.kinectSensor, 0, FaceFrameFeatures.BoundingBoxInColorSpace);
-
       this.highDefinitionFaceModel = new FaceModel();
-      this.highdefinitionFaceAlignment = new FaceAlignment();
       this.highDefinitionFaceSource = new HighDefinitionFaceFrameSource(this.kinectSensor);
       this.highDefinitionFaceSource.TrackingQuality = FaceAlignmentQuality.High;
       this.highDefinitionFaceSource.FaceModel = this.highDefinitionFaceModel;
-      // Start capturing face model to use later
-
-
-      // open the reader for the face frames
+
+
+      // open readers for the face frames
       this.bodyFrameReader = this.kinectSensor.BodyFrameSource.OpenReader();
-      //this.depthFrameReader =  this.kinectSensor.DepthFrameSource.OpenReader();
       this.highDefinitionFaceReader = this.highDefinitionFaceSource.OpenReader();
       this.faceFrameReader = this.faceFrameSource.OpenReader();

       // wire handlers for frame arrivals
       this.bodyFrameReader.FrameArrived += this.BodyFrameReader_FrameArrived;
-      //this.depthFrameReader.FrameArrived += this.DepthFrameReader_FrameArrived;
       this.highDefinitionFaceReader.FrameArrived += this.HighDefinitionFaceFrameReader_FrameArrived;
       this.faceFrameReader.FrameArrived += this.FaceFrameReader_FrameArrived;

@@ -94,20 +90,27 @@
       // use the window object as the view model in this simple example
       this.DataContext = this;

+      multiplier = (255.0 / (this.maxDepth - this.minDepth));

       InitializeComponent();
-      //Pan + Zoom Variables
+
+      // Pan + Zoom event handlers
       WPFWindow.MouseWheel += Overlay_MouseWheel;
-
       canvas.MouseLeftButtonDown += canvas_MouseLeftButtonDown;
       canvas.MouseLeftButtonUp += canvas_MouseLeftButtonUp;
       canvas.MouseMove += canvas_MouseMove;
+
+      // add depth image to our canvas
       depthCanvasImage.Source = this.depthBitmap;
       canvas.Children.Add(depthCanvasImage);

+      LoadSavedFaceMesh(@"data\kirk.fml");
+    }
+
+    private void LoadSavedFaceMesh(string path) {
       // load in saved face mesh
       var jss = new JavaScriptSerializer();
-      using (var file = new System.IO.StreamReader(@"data\kirk.fml")) {
+      using (var file = new System.IO.StreamReader(path)) {
         var data = file.ReadLine();
         savedVertices = jss.Deserialize<CameraSpacePoint[]>(data);
       }
@@ -129,8 +132,8 @@
       foreach (System.Windows.Shapes.Ellipse ellipse in savedDots) {
         canvas.Children.Add(ellipse);
       }
-
-    }
+    }
+

@@ -172,7 +175,7 @@
     private void FaceFrameReader_FrameArrived(object sender, FaceFrameArrivedEventArgs e) {
       var frame = e.FrameReference.AcquireFrame();
       if (frame != null && frame.FaceFrameResult != null && frame.FaceFrameResult.FaceBoundingBoxInColorSpace != null) {
-        facePoints = frame.FaceFrameResult.FacePointsInColorSpace;
+        // Grab the person's face (padded a little) and use oxford to do the initial 2D recognition
       }
     }

@@ -194,8 +197,8 @@
       Point p = e.MouseDevice.GetPosition(border);

       Matrix m = canvas.RenderTransform.Value;
-      m.OffsetX = origin.X + (p.X - start.X);
-      m.OffsetY = origin.Y + (p.Y - start.Y);
+      m.OffsetX = mouseOrigin.X + (p.X - mouseStart.X);
+      m.OffsetY = mouseOrigin.Y + (p.Y - mouseStart.Y);

       canvas.RenderTransform = new MatrixTransform(m);
     }
@@ -203,9 +206,9 @@
     private void canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
       if (canvas.IsMouseCaptured) return;

-      start = e.GetPosition(border);
-      origin.X = canvas.RenderTransform.Value.OffsetX;
-      origin.Y = canvas.RenderTransform.Value.OffsetY;
+      mouseStart = e.GetPosition(border);
+      mouseOrigin.X = canvas.RenderTransform.Value.OffsetX;
+      mouseOrigin.Y = canvas.RenderTransform.Value.OffsetY;
       canvas.CaptureMouse();
     }

@@ -232,7 +235,6 @@
         depthData = new ushort[depthWidth * depthHeight];
         byte[] pixelData = new byte[depthWidth * depthHeight * (PixelFormats.Bgr32.BitsPerPixel + 7) / 8];
         int stride = depthWidth * PixelFormats.Bgr32.BitsPerPixel / 8;
-        multiplier = (255.0 / (this.maxDepth - this.minDepth));

         frame.CopyFrameDataToArray(depthData);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -1201,6 +1201,15 @@
     public void TestMethod_IsPrime_613()
     {
       const int source = 613;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_617()
+    {
+      const int source = 617;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


~4x performance improvement on spec.txt by removing autolink_uri Regex

scan_autolink_uri replaced with a custom implementation that does not
use Regular Expressions. By running against spec.txt the new average
time is 58-78ms vs ~250ms before the change.

--- CommonMark/Parser/Scanner.cs
+++ CommonMark/Parser/Scanner.cs
@@ -12,7 +12,7 @@
     {
         private const RegexOptions useCompilation = RegexOptions.None;

-        private const string scheme = "coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr";
+        private static readonly string[] schemeArray = new[] { "aaa", "aaas", "about", "acap", "adiumxtra", "afp", "afs", "aim", "apt", "attachment", "aw", "beshare", "bitcoin", "bolo", "callto", "cap", "chrome", "chrome-extension", "cid", "coap", "com-eventbrite-attendee", "content", "crid", "cvs", "data", "dav", "dict", "dlna-playcontainer", "dlna-playsingle", "dns", "doi", "dtn", "dvb", "ed2k", "facetime", "feed", "file", "finger", "fish", "ftp", "geo", "gg", "git", "gizmoproject", "go", "gopher", "gtalk", "h323", "hcp", "http", "https", "iax", "icap", "icon", "im", "imap", "info", "ipn", "ipp", "irc", "irc6", "ircs", "iris", "iris.beep", "iris.lwz", "iris.xpc", "iris.xpcs", "itms", "jar", "javascript", "jms", "keyparc", "lastfm", "ldap", "ldaps", "magnet", "mailto", "maps", "market", "message", "mid", "mms", "ms-help", "msnim", "msrp", "msrps", "mtqp", "mumble", "mupdate", "mvn", "news", "nfs", "ni", "nih", "nntp", "notes", "oid", "opaquelocktoken", "palm", "paparazzi", "platform", "pop", "pres", "proxy", "psyc", "query", "res", "resource", "rmi", "rsync", "rtmp", "rtsp", "secondlife", "service", "session", "sftp", "sgn", "shttp", "sieve", "sip", "sips", "skype", "smb", "sms", "snmp", "soap.beep", "soap.beeps", "soldat", "spotify", "ssh", "steam", "svn", "tag", "teamspeak", "tel", "telnet", "tftp", "things", "thismessage", "tip", "tn3270", "tv", "udp", "unreal", "urn", "ut2004", "vemmi", "ventrilo", "view-source", "webcal", "ws", "wss", "wtai", "wyciwyg", "xcon", "xcon-userid", "xfire", "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "xri", "ymsgr", "z39.50r", "z39.50s" };
         private const string blocktagname = "(article|header|aside|hgroup|iframe|blockquote|hr|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)";

         private const string escapable = "[!\"#$%&\'\\(\\)*+,.\\/:;<=>?@\\[\\\\\\]^_`{|}~-]";
@@ -36,7 +36,10 @@
         private const string declaration = "\\![A-Z]+\\s+[^>\\x00]*>";
         private const string htmltag = "(" + opentag + ")|(" + closetag + ")|(" + htmlcomment + ")|(" + processinginstruction + ")|(" + declaration + ")|(" + cdata + ")";

-        private static readonly Regex autolink_uri = new Regex("(" + scheme + "):[^<>\\x00-\\x20]*>", useCompilation | RegexOptions.IgnoreCase);
+        // this Regex had significant impact to performance for some typical documents so it was replaced with custom implementation
+        //private const string scheme = "coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr";
+        //private static readonly Regex autolink_uri = new Regex("(" + scheme + "):[^<>\\x00-\\x20]*>", useCompilation | RegexOptions.IgnoreCase);
+
         private static readonly Regex autolink_email = new Regex("[a-zA-Z0-9.!#$%&'\\*+/=?^_`{|}~-]+[@][a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?([.][a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*[>]", useCompilation);
         private static readonly Regex htmltagregex = new Regex(htmltag, useCompilation);
         private static readonly Regex html_block_tag1 = new Regex("</" + blocktagname + "(\\s|>)", useCompilation | RegexOptions.IgnoreCase);
@@ -81,7 +84,36 @@
               scheme [:]([^\x00-\x20<>\\]|escaped_char)*[>]  { return (p - start); }
               .? { return 0; }
             */
-            return MatchRegex(s, pos, autolink_uri);
+            // for now the tests do not include anything that would require the use of `escaped_char` part so it is ignored.
+
+            // 24 is the maximum length of a valid scheme
+            var checkLen = s.Length - pos;
+            if (checkLen > 24)
+                checkLen = 24;
+
+            // PERF: potential small improvement - instead of using IndexOf, check char-by-char and return as soon as an invalid character is found ([^a-z0-9\.])
+            // alternative approach (if we want to go crazy about performance - store the valid schemes as a prefix tree and lookup the valid scheme char by char and
+            // return as soon as the part does not match any prefix.
+            var colonpos = s.IndexOf(':', pos, checkLen);
+            if (colonpos == -1)
+                return 0;
+
+            var potentialScheme = s.Substring(pos, colonpos - pos).ToLowerInvariant();
+            if (Array.BinarySearch(schemeArray, potentialScheme) < -1)
+                return 0;
+
+            char c;
+            for (var i = colonpos + 1; i < s.Length; i++)
+            {
+                c = s[i];
+                if (c == '>')
+                    return i - pos + 1;
+
+                if (c == '<' || c <= 0x20)
+                    return 0;
+            }
+
+            return 0;
         }

         /// <summary>


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -1646,6 +1646,16 @@
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);
     }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_953()
+    {
+      const int source = 953;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+

     /*  Add unit test
     De 901 à 1000:


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -2574,7 +2574,7 @@
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);
     }
-
+
     [TestMethod]
     public void TestMethod_IsPrime_1699()
     {
@@ -2588,6 +2588,15 @@
     public void TestMethod_IsPrime_1709()
     {
       const int source = 1709;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_1721()
+    {
+      const int source = 1721;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);
@@ -2597,7 +2606,7 @@
     /*  Add unit test
      *
      *  TOUS LES NOMBRES PREMIERS DE 1001 À 2000
-     1 709 1 721 1 723 1 733 1 741 1 747 1 753 1 759 1 777 1 783 1 787 1 789 1 801 1 811 1 823 1 831 1 847 1 861 1 867 1 871 1 873 1 877 1 879 1 889 1 901 1 907 1 913 1 931 1 933 1 949 1 951 1 973 1 979 1 987 1 993 1 997 1 999
+     1 721 1 723 1 733 1 741 1 747 1 753 1 759 1 777 1 783 1 787 1 789 1 801 1 811 1 823 1 831 1 847 1 861 1 867 1 871 1 873 1 877 1 879 1 889 1 901 1 907 1 913 1 931 1 933 1 949 1 951 1 973 1 979 1 987 1 993 1 997 1 999

 TOUS LES NOMBRES PREMIERS DE 2001 À 3000


you guys i think i cracked the code

you guys i think i cracked the code

--- RelhaxModpack/RelhaxModpack/Utils/XMLUtils.cs
+++ RelhaxModpack/RelhaxModpack/Utils/XMLUtils.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.IO;
@@ -6,6 +7,8 @@
 using System.Xml.Linq;
 using System.Xml.XPath;
 using System.Windows;
+using System.Reflection;
+using System.ComponentModel;

 namespace RelhaxModpack
 {
@@ -258,16 +261,16 @@
             }
         }
         public static bool ParseDatabase1V1(XmlDocument rootDocument, List<DatabasePackage> globalDependencies,
-            List<Dependency> logicalDependencies, List<Category> parsedCategoryList, string location)
+            List<Dependency> logicalDependencies, List<Category> parsedCategoryList, string rootPath)
         {
             //load each document to make sure they all exist first
-            if(string.IsNullOrWhiteSpace(location))
+            if(string.IsNullOrWhiteSpace(rootPath))
             {
                 Logging.Error("location string is empty in ParseDatabase1V1");
                 return false;
             }
             //document for global dependencies
-            string completeFilepath = Path.Combine(location, GetXMLStringFromXPath(rootDocument, "/modInfoAlpha.xml/globalDependencies@file"));
+            string completeFilepath = Path.Combine(rootPath, GetXMLStringFromXPath(rootDocument, "/modInfoAlpha.xml/globalDependencies@file"));
             if (!File.Exists(completeFilepath))
             {
                 Logging.Error("{0} file does not exist at {1}", "Global Dependency", completeFilepath);
@@ -275,7 +278,7 @@
             }
             XDocument globalDepsDoc = LoadXDocument(completeFilepath, XmlLoadType.FromFile);
             //document for dependencies
-            completeFilepath = Path.Combine(location, GetXMLStringFromXPath(rootDocument, "/modInfoAlpha.xml/dependencies@file"));
+            completeFilepath = Path.Combine(rootPath, GetXMLStringFromXPath(rootDocument, "/modInfoAlpha.xml/dependencies@file"));
             if (!File.Exists(completeFilepath))
             {
                 Logging.Error("{0} file does not exist at {1}", "Dependency", completeFilepath);
@@ -286,7 +289,7 @@
             List<XDocument> categoryDocuments = new List<XDocument>();
             foreach(XmlNode categoryNode in GetXMLNodesFromXPath(rootDocument, "//modInfoAlpha.xml/categories/category"))
             {
-                completeFilepath = Path.Combine(location, categoryNode.Attributes["file"].Value);
+                completeFilepath = Path.Combine(rootPath, categoryNode.Attributes["file"].Value);
                 if (!File.Exists(completeFilepath))
                 {
                     Logging.Error("{0} file does not exist at {1}", "Category", completeFilepath);
@@ -297,359 +300,171 @@

             throw new BadMemeException("should probably finish this, don't you think?");
             //parsing the global dependencies
-            //bool globalParsed = ParseDatabaseV2GlobalDependencies(
-                //rootDocument.XPathSelectElements("/modInfoAlpha.xml/globaldependencies/globaldependency").ToList(), globalDependencies);
+            //bool globalParsed = ParseDatabase1V1Packages(
+            //rootDocument.XPathSelectElements("/modInfoAlpha.xml/globaldependencies/globaldependency").ToList(), globalDependencies);
             //parsing the logical dependnecies
-            //bool logicalDepParsed = ParseDatabaseV2Dependencies(rootDocument.XPathSelectElements(
-                //"/modInfoAlpha.xml/logicalDependencies/logicalDependency").ToList(), logicalDependencies);
+            //bool logicalDepParsed = ParseDatabase1V1Packages(rootDocument.XPathSelectElements(
+            //"/modInfoAlpha.xml/logicalDependencies/logicalDependency").ToList(), logicalDependencies);
             //parsing the categories
-            //bool categoriesParsed = ParseDatabaseV2Categories(rootDocument.XPathSelectElements(
-                //"/modInfoAlpha.xml/catagories/catagory").ToList(), parsedCategoryList);
+            //bool categoriesParsed = ParseDatabase1V1Packages(rootDocument.XPathSelectElements(
+            //"/modInfoAlpha.xml/catagories/catagory").ToList(), parsedCategoryList);
             //return (globalParsed && logicalDepParsed && categoriesParsed) ? true : false;
-        }
-        private static bool ParseDatabaseV2GlobalDependencies(List<XElement> packageNodeHolder, List<DatabasePackage> globalDependencies)
-        {
-            //first for loop is for each "dependency" object holder
-            foreach(XElement dependency in packageNodeHolder)
-            {
-                DatabasePackage globalDependency = new DatabasePackage();
-
+
+        }
+        private static bool ParseDatabase1V1Packages(List<XElement> xmlPackageNodesList, IList genericPackageList,
+            List<string> whiteListAttributes, List<string> whitelistNodes, Type packageType)
+        {
+            //make the refrence for the base type of package it could be
+            DatabasePackage packageOfAnyType;
+
+            //get all fields from the class
+            FieldInfo[] fieldsInClass = packageType.GetFields();
+
+            //for each xml globalDependency entry
+            foreach(XElement xmlPackageNode in xmlPackageNodesList)
+            {
+                //make the instance based on the custom class type
+                if (packageType.Equals(typeof(DatabasePackage)))
+                {
+                    packageOfAnyType = new DatabasePackage();
+                }
+                else if (packageType.Equals(typeof(Dependency)))
+                {
+                    packageOfAnyType = new Dependency();
+                }
+                else if (packageType.Equals(typeof(SelectablePackage)))
+                {
+                    packageOfAnyType = new SelectablePackage();
+                }
+                else
+                {
+                    throw new BadMemeException("fuck you");
+                }
+
+                //first deal with the xml attributes in the entry
+                List<string> unknownListAttributes = new List<string>();
+                foreach(XAttribute attribute in xmlPackageNode.Attributes())
+                {
+                    //get the fieldInfo object representing the same name corresponding field in the memory database entry
+                    FieldInfo packageField = fieldsInClass.Where(field => field.Name.Equals(attribute.Name)).ToArray()[0];
+                    //make sure it's a part of the whitelist of attributes we actually want to try to load
+                    if(whiteListAttributes.Contains(packageField.Name))
+                    {
+                        //remove the entry name cause it's loaded (or fail loading)
+                        whiteListAttributes.Remove(packageField.Name);
+                        //try to set it
+                        try
+                        {
+                            var converter = TypeDescriptor.GetConverter(packageField.FieldType);
+                            packageField.SetValue(packageOfAnyType, converter.ConvertFrom(attribute.Value));
+                        }
+                        catch (Exception ex)
+                        {
+                            //Logging.Error("An error occured while setting the ")
+                            continue;
+                        }
+                    }
+                    else
+                    {
+                        //unkonwn attribute, add it to the unknown list
+                        unknownListAttributes.Add(packageField.Name);
+                    }
+                }
+                //list any unknown attrubutes here
+                foreach(string unknownAttribute in unknownListAttributes)
+                {
+                    //log it here
+
+                }
+                //list any attributes not included here (error, should be included)
+                foreach(string notIncludedAttribute in whiteListAttributes)
+                {
+                    //log it here
+                }
+
+                //now deal with node values. no need to log what isn't set
+                List<string> unknownListNodes = new List<string>();
+                foreach(XElement element in xmlPackageNode.Elements())
+                {
+                    FieldInfo packageField = fieldsInClass.Where(field => field.Name.Equals(element.Name)).ToArray()[0];
+                    if (whitelistNodes.Contains(packageField.Name))
+                    {
+                        //HOWEVER, if the object is a list type, we need to parse the list
+                        //https://stackoverflow.com/questions/4115968/how-to-tell-whether-a-type-is-a-list-or-array-or-ienumerable-or
+                        if (typeof(IEnumerable).IsAssignableFrom(packageField.FieldType))
+                        {
+                            //BUT, if it's a package entry, we need to recursivly procsses it
+                            SelectablePackage throwAwayPackage = packageOfAnyType as SelectablePackage;
+                            if (throwAwayPackage != null)
+                            {
+                                if (element.Name.Equals(nameof(throwAwayPackage.Packages)))
+                                {
+                                    ParseDatabase1V1Packages(xmlPackageNode.Element(element.Name).Elements().ToList(), throwAwayPackage.Packages, null, null, packageType);
+                                }
+                            }
+                            //get a list type to add stuff to
+                            //https://stackoverflow.com/questions/25757121/c-sharp-how-to-set-propertyinfo-value-when-its-type-is-a-listt-and-i-have-a-li
+                            object obj = packageField.GetValue(packageOfAnyType);
+                            IList list = (IList)packageField.GetValue(obj);
+                            //we now have the empty list, now get type type of list it is
+                            //https://stackoverflow.com/questions/34211815/how-to-get-the-underlying-type-of-an-ilist-item
+                            Type listObjectType = list.GetType().GetInterfaces().Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1)
+                                .FirstOrDefault(i => i.GetGenericTypeDefinition() == typeof(IEnumerable<>)).GenericTypeArguments[0];
+                            //now for each xml element, get the value information and set it
+                            //if it originates from the
+                            foreach (XElement listElement in xmlPackageNode.Element(element.Name).Elements())
+                            {
+                                //2 types of options for what this list could be: single node values (string, just node value), node of many values (custon type, many values)
+                                if (listElement.Attributes().Count() > 0)//custom class type
+                                {
+                                    object listEntry = Activator.CreateInstance(listObjectType);
+                                    //get list of fields in this entry object
+                                    FieldInfo[] fieldsInObjectInstance = listObjectType.GetFields();
+                                    foreach (XAttribute listEntryAttribute in listElement.Attributes())
+                                    {
+                                        var converter = TypeDescriptor.GetConverter(packageField.FieldType);
+                                        FieldInfo listobjectField = fieldsInObjectInstance.Where(field => field.Name.Equals(listEntryAttribute.Name)).ToArray()[0];
+                                        listobjectField.SetValue(listEntry, converter.ConvertFrom(listEntryAttribute.Value));
+                                    }
+                                }
+                                else//single primitive entry type
+                                {
+                                    list.Add(listElement.Value);
+                                }
+                            }
+                        }
+                        try
+                        {
+                            whitelistNodes.Remove(packageField.Name);
+                            var converter = TypeDescriptor.GetConverter(packageField.FieldType);
+                            packageField.SetValue(packageOfAnyType, converter.ConvertFrom(element.Value));
+                        }
+                        catch (Exception ex)
+                        {
+                            //Logging.Error("An error occured while setting the ")
+                            continue;
+                        }
+                    }
+                    else
+                    {
+                        unknownListNodes.Add(packageField.Name);
+                    }
+                }
+                foreach (string unknownAttribute in unknownListNodes)
+                {
+                    //log it here
+
+                }
+                foreach (string notIncludedAttribute in whitelistNodes)
+                {
+                    //log it here
+
+                }
+                //oh yeah, add it to the internal memory list
+                //globalDependencies.Add(globalDependency);
+                genericPackageList.Add(packageOfAnyType);
             }
             return true;
-        }
-        private static bool ParseDatabaseV2Dependencies(List<XElement> packageNodeHolder, List<Dependency> logicalDependencies)
-        {
-            foreach (XElement dependency in packageNodeHolder)
-            {
-
-
-            }
-            return true;
-        }
-        private static bool ParseDatabaseV2Categories(List<XElement> packageNodeHolder, List<Category> categories)
-        {
-            //TODO
-            foreach (XElement dependency in packageNodeHolder)
-            {
-
-
-            }
-            return true;
-        }
-        #region Components of packages for database parsing V2
-        //for base package
-        public static readonly string[] BaseRequiredNodesV2 = new string[] { "PackageName" };
-        public static readonly string[] BaseOptionalNodesV2 = new string[] { "Version", "Timestamp", "ZipFile", "CRC", "StartAddress",
-            "EndAddress", "AppendExtraction", "LogAtInstall", "DevURL", "ExtractionLevel", "Enabled" };//all of these have defaults
-        //for dependency
-        //--nothing--
-        //for selectable package
-        public static readonly string[] SelectablePackageRequiredNodesV2 = new string[] { "Name", "Type" };
-        public static readonly string[] SelectablePackagOptionalNodesV2 = new string[] { "UserFiles", "Packages", "Medias",
-            "Visible", "Size", "UpdateComment", "Description" };
-        //for depdendency and selectable package
-        public static readonly string[] DependencySelectableOptionalNodesV2 = new string[] { "Dependencies" };
-        //for categories
-        public static readonly string[] CategoryRequiredNodesV2 = new string[] { "name", "dependencies" };
-        #endregion
-        private static void DynamicXMLDatabasePackageParse(XElement xmlPackage, ref DatabasePackage package)
-        {
-            //first treat it as regular package
-            //check for all fields in it
-            List<string> copyOfRequiredBaseNodes = new List<string>(BaseRequiredNodesV2.ToList());
-            List<string> unknownElements = new List<string>();
-            //start with databasePackage
-            foreach(XElement xmlPackageProperty in xmlPackage.Elements())//Properties of the package
-            {
-                string elementName = xmlPackageProperty.Name.LocalName;
-                if (copyOfRequiredBaseNodes.Contains(elementName))
-                {
-                    //switch
-                    switch (elementName)
-                    {
-                        case "PackageName":
-                            package.PackageName = xmlPackageProperty.Value.Trim();
-                            break;
-                    }
-                    copyOfRequiredBaseNodes.Remove(elementName);
-                }
-                else if (BaseOptionalNodesV2.Contains(elementName))
-                {
-                    //switch
-                    switch (elementName)
-                    {
-                        case "PackageName":
-                            package.PackageName = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "Version":
-                            package.Version = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "Timestamp"://long
-                            package.Timestamp = Utils.ParseLong(xmlPackageProperty.Value.Trim(),0);
-                            break;
-                        case "ZipFile":
-                            package.ZipFile = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "CRC":
-                            package.CRC = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "StartAddress":
-                            package.StartAddress = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "EndAddress":
-                            package.EndAddress = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "LogAtInstall"://bool
-                            package.LogAtInstall = Utils.ParseBool(xmlPackageProperty.Value.Trim(),false);
-                            break;
-                        case "DevURL":
-                            package.DevURL = xmlPackageProperty.Value.Trim();
-                            break;
-                        case "ExtractionLevel"://int
-                            package.InstallGroup = Utils.ParseInt(xmlPackageProperty.Value.Trim(),5);
-                            break;
-                        case "Enabled"://bool
-                            package.Enabled = Utils.ParseBool(xmlPackageProperty.Value.Trim(),false);
-                            break;
-                    }
-                }
-            }
-            //check for mising required nodes of databasePackage
-            if (copyOfRequiredBaseNodes.Count > 0)
-            {
-                foreach (string s in copyOfRequiredBaseNodes)
-                {
-                    //write it's missing
-                    string lineNumber = "" + ((IXmlLineInfo)xmlPackage).LineNumber;
-                    Logging.WriteToLog(string.Format("property name={0}, line number={1},", s, lineNumber),Logfiles.Application,LogLevel.Error);
-                }
-            }
-            //check if it's a dependency or package
-            if (package is Dependency dependency)
-            {
-                foreach (XElement xmlPackageProperty in xmlPackage.Elements())
-                {
-                    string elementName = xmlPackageProperty.Name.LocalName;
-                    //{ "Dependencies" }
-                    if (DependencySelectableOptionalNodesV2.Contains(elementName))
-                    {
-                        switch (elementName)
-                        {
-                            case "Dependencies":
-                                ProcessDependencies(xmlPackageProperty, dependency.Dependencies);
-                                break;
-                        }
-                    }
-                }
-                //no required dependency specific nodes...
-            }
-            else if (package is SelectablePackage selectablePackage)
-            {
-                List<string> copyOfRequiredSelectablePackages = new List<string>(SelectablePackageRequiredNodesV2.ToList());
-                foreach (XElement xmlPackageProperty in xmlPackage.Elements())
-                {
-                    string elementName = xmlPackageProperty.Name.LocalName;
-                    //{ "Name", "Type" }
-                    if (SelectablePackageRequiredNodesV2.Contains(elementName))
-                    {
-                        //switch
-                        switch (elementName)
-                        {
-                            case "name":
-                                selectablePackage.Name = xmlPackageProperty.Value.Trim();
-                                break;
-                            case "type":
-                                selectablePackage.Type = xmlPackageProperty.Value.Trim();
-                                break;
-                        }
-                        copyOfRequiredSelectablePackages.Remove(elementName);
-                    }
-                    //{ "UserFiles", "Packages", "Medias", "Visible", "Size", "UpdateComment", "Description" }
-                    else if (SelectablePackagOptionalNodesV2.Contains(elementName))
-                    {
-                        switch (elementName)
-                        {
-                            case "visible":
-                            case "visable":
-                                selectablePackage.Visible = Utils.ParseBool(xmlPackageProperty.Value.Trim(), false);
-                                break;
-                            case "size":
-                                selectablePackage.Size = Utils.ParseuLong(xmlPackageProperty.Value.Trim(), 0);
-                                break;
-                            case "updateComment"://TODO: need ot macro unescape text
-                                selectablePackage.UpdateComment = xmlPackageProperty.Value.Trim();
-                                break;
-                            case "description":
-                                selectablePackage.Description = xmlPackageProperty.Value.Trim();
-                                break;
-                                break;
-                            case "userFiles":
-                                ProcessUserFiles(xmlPackageProperty, selectablePackage.UserFiles);
-                                break;
-                            case "medias":
-                                ProcessMedias(xmlPackageProperty, selectablePackage.Medias);
-                                break;
-                            case "packages":
-                                throw new BadMemeException("THIS IS STILL TODO - RECURSIVE PACKAGE PROCESSING");
-                                break;
-                        }
-                    }
-                    //{ "Dependencies" }
-                    else if (DependencySelectableOptionalNodesV2.Contains(elementName))
-                    {
-                        switch (elementName)
-                        {
-                            case "Dependencies":
-                                ProcessDependencies(xmlPackageProperty, selectablePackage.Dependencies);
-                                break;
-                        }
-                    }
-                }
-                //check for missing required nodes of package
-                if (copyOfRequiredSelectablePackages.Count > 0)
-                {
-                    foreach (string s in copyOfRequiredSelectablePackages)
-                    {
-                        //write it's missing
-                        string lineNumber = "" + ((IXmlLineInfo)xmlPackage).LineNumber;
-                        Logging.WriteToLog(string.Format("property name={0}, line number={1},", s, lineNumber), Logfiles.Application, LogLevel.Error);
-                    }
-                }
-            }
-            //TODO: maybe put this in it's own method?
-            //process if any extra unknown nodes are left
-            List<string> allPossiblePackageNodes = new List<string>();
-            //BaseRequiredNodesV2
-            //BaseOptionalNodesV2
-            //SelectablePackageRequiredNodesV2
-            //SelectablePackagOptionalNodesV2
-            //DependencySelectableOptionalNodesV2
-            allPossiblePackageNodes.AddRange(BaseRequiredNodesV2);
-            allPossiblePackageNodes.AddRange(BaseOptionalNodesV2);
-            if (package is Dependency || package is SelectablePackage)
-            {
-                allPossiblePackageNodes.AddRange(DependencySelectableOptionalNodesV2);
-                if(package is SelectablePackage)
-                {
-                    allPossiblePackageNodes.AddRange(SelectablePackageRequiredNodesV2);
-                    allPossiblePackageNodes.AddRange(SelectablePackagOptionalNodesV2);
-                }
-            }
-            foreach (XElement xmlPackageProperty in xmlPackage.Elements())
-            {
-                string elementName = xmlPackageProperty.Name.LocalName;
-                string lineNumber = "" + ((IXmlLineInfo)xmlPackageProperty).LineNumber;
-                if (!allPossiblePackageNodes.Contains(elementName))
-                    unknownElements.Add(string.Format("node name={0}, line number={1}",elementName,lineNumber));
-            }
-            if(unknownElements.Count > 0)
-            {
-                foreach (string s in unknownElements)
-                    Logging.WriteToLog("Parsing database error," + s, Logfiles.Application, LogLevel.Error);
-            }
-        }
-
-        public static readonly string[] UserfilesRequiredNodesV2 = new string[] { "Pattern" };
-        private static void ProcessUserFiles(XElement userFilesHolder, List<UserFiles> userfiles)
-        {
-            //NOTE FOR ALL THESE: the holder is the holder, inside is each element
-            foreach(XElement userfileElement in userFilesHolder.Elements())
-            {
-                //inside element values is the actual userdata element
-                UserFiles files = new UserFiles
-                {
-                    Pattern = userfileElement.Value
-                };
-                //TODO: make into attributes?
-                userfiles.Add(files);
-            }
-        }
-        public static readonly string[] MediaRequiredNodesV2 = new string[] { "URL", "type" };
-        private static void ProcessMedias(XElement mediasHolder, List<Media> medias)
-        {
-            foreach(XElement mediaElement in mediasHolder.Elements())
-            {
-                Media media = new Media();
-                List<string> unknownElements = new List<string>();
-                List<string> copyOfMediaRequiredNodes = new List<string>(MediaRequiredNodesV2.ToList());
-                foreach(XElement mediaProperties in mediaElement.Elements())
-                {
-                    string elementName = mediaProperties.Name.LocalName;
-                    if (MediaRequiredNodesV2.Contains(elementName))
-                    {
-                        switch(elementName)
-                        {
-                            case "URL":
-                                media.URL = mediaProperties.Value.Trim();
-                                break;
-                            case "type":
-                                media.MediaType = (MediaType) Utils.ParseInt(mediaProperties.Value.Trim(),1);
-                                break;
-                        }
-                        copyOfMediaRequiredNodes.Remove(elementName);
-                    }
-                    else
-                        unknownElements.Add(elementName);
-                }
-                if (copyOfMediaRequiredNodes.Count > 0)
-                    ListNotUsedRequired(mediaElement, copyOfMediaRequiredNodes);
-                if (unknownElements.Count > 0)
-                    ListUnknown(mediaElement, unknownElements);
-                medias.Add(media);
-            }
-        }
-        public static readonly string[] DependnecyLogicRequiredNodesV2 = new string[] { "negateFlag", "packageName", "logicType" };
-        private static void ProcessDependencies(XElement logicsHodler, List<DatabaseLogic> logics)
-        {
-            foreach (XElement logicsElement in logicsHodler.Elements())
-            {
-                DatabaseLogic logic = new DatabaseLogic();
-                List<string> unknownElements = new List<string>();
-                List<string> copyOfDependencyLigicRequiredNodes = new List<string>(DependnecyLogicRequiredNodesV2.ToList());
-                foreach (XElement logicProperties in logicsElement.Elements())
-                {
-                    string elementName = logicProperties.Name.LocalName;
-                    if (DependnecyLogicRequiredNodesV2.Contains(elementName))
-                    {
-                        switch (elementName)
-                        {
-                            case "negateFlag":
-                                logic.NotFlag = Utils.ParseBool(logicProperties.Value.Trim(), false);
-                                break;
-                            case "packageName":
-                                logic.PackageName = logicProperties.Value.Trim();
-                                break;
-                            case "logicType":
-                                logic.Logic = (Logic)Utils.ParseInt(logicProperties.Value.Trim(), 0);
-                                break;
-                        }
-                        copyOfDependencyLigicRequiredNodes.Remove(elementName);
-                    }
-                    else
-                        unknownElements.Add(elementName);
-                }
-                if (copyOfDependencyLigicRequiredNodes.Count > 0)
-                    ListNotUsedRequired(logicsElement, copyOfDependencyLigicRequiredNodes);
-                if (unknownElements.Count > 0)
-                    ListUnknown(logicsElement, unknownElements);
-                logics.Add(logic);
-            }
-        }
-        private static void ListNotUsedRequired(XElement node, List<string> missingRequriedProperties)
-        {
-            foreach (string s in missingRequriedProperties)
-            {
-                Logging.WriteToLog(string.Format("missing required xml property: name={0}, value={1}, line={2}", node.Name.LocalName, node.Value,
-                    ((IXmlLineInfo)node).LineNumber), Logfiles.Application, LogLevel.Error);
-            }
-        }
-        private static void ListUnknown(XElement node, List<string> unknownElements)
-        {
-            foreach (string s in unknownElements)
-            {
-                Logging.WriteToLog(string.Format("unknown xml property: name={0}, value={1}, line={2}", node.Name.LocalName, node.Value,
-                    ((IXmlLineInfo)node).LineNumber), Logfiles.Application, LogLevel.Error);
-            }
         }
         #endregion


Optimize BinarySerializer (#2253)

Optimize BinarySerializer (#2253)

--- src/neo/SmartContract/BinarySerializer.cs
+++ src/neo/SmartContract/BinarySerializer.cs
@@ -143,7 +143,7 @@

         public static void Serialize(BinaryWriter writer, StackItem item, uint maxSize)
         {
-            List<CompoundType> serialized = new List<CompoundType>();
+            HashSet<CompoundType> serialized = new HashSet<CompoundType>(ReferenceEqualityComparer.Instance);
             Stack<StackItem> unserialized = new Stack<StackItem>();
             unserialized.Push(item);
             while (unserialized.Count > 0)
@@ -163,17 +163,15 @@
                         writer.WriteVarBytes(item.GetSpan());
                         break;
                     case Array array:
-                        if (serialized.Any(p => ReferenceEquals(p, array)))
+                        if (!serialized.Add(array))
                             throw new NotSupportedException();
-                        serialized.Add(array);
                         writer.WriteVarInt(array.Count);
                         for (int i = array.Count - 1; i >= 0; i--)
                             unserialized.Push(array[i]);
                         break;
                     case Map map:
-                        if (serialized.Any(p => ReferenceEquals(p, map)))
+                        if (!serialized.Add(map))
                             throw new NotSupportedException();
-                        serialized.Add(map);
                         writer.WriteVarInt(map.Count);
                         foreach (var pair in map.Reverse())
                         {


chore(api): remove unused usings

chore(api): remove unused usings

--- WebAPI.API/Controllers/API/Version1/SearchController.cs
+++ WebAPI.API/Controllers/API/Version1/SearchController.cs
@@ -8,9 +8,7 @@
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Web.Http;
-using GitHub;
 using NetTopologySuite.Geometries;
-using System.Text.Json;
 using Newtonsoft.Json.Linq;
 using Npgsql;
 using Serilog;


BREAKING CHANGE: Changed ShellItemPropertyStore.Descriptions to get a dictionary of PropertyDescription items rather than the PropertyDescriptionList that was already available from ShellItem. Added improved execption when IPropertyStore instance cannot be created due to a shell item with no r/w support.

--- Windows.Shell/ShellProperties/ShellItemPropertyStore.cs
+++ Windows.Shell/ShellProperties/ShellItemPropertyStore.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Runtime.InteropServices;
 using Vanara.Extensions;
+using Vanara.PInvoke;
 using static Vanara.PInvoke.Ole32;
 using static Vanara.PInvoke.PropSys;

@@ -27,10 +29,6 @@
 			if (propChangedHandler != null)
 				PropertyChanged += propChangedHandler;
 		}
-
-		/// Gets a property description list object containing descriptions of all properties.
-		/// <returns>A complete <see cref="PropertyDescriptionList"/> instance.</returns>
-		public PropertyDescriptionList Descriptions => shellItem.PropertyDescriptions;

 		/// Gets or sets a value indicating whether to include slow properties.
 		/// <value><c>true</c> if including slow properties; otherwise, <c>false</c>.</value>
@@ -112,7 +110,14 @@
 		{
 			if (shellItem is ShellLink lnk)
 				return (IPropertyStore)lnk.link;
-			return shellItem?.iShellItem2?.GetPropertyStore(flags, typeof(IPropertyStore).GUID);
+			try
+			{
+				return shellItem?.iShellItem2?.GetPropertyStore(flags, typeof(IPropertyStore).GUID);
+			}
+			catch (COMException comex) when (comex.ErrorCode == HRESULT.E_FAIL)
+			{
+				throw new InvalidOperationException($"The ShellItem does not support a property store with the flags: {flags}", comex);
+			}
 		}

 		/// Gets the CLSID of a supplied property key.


Added ShellItemPropertyStore.Dispose overload to null out use of ShellItem. May help with #242.

--- Windows.Shell/ShellProperties/ShellItemPropertyStore.cs
+++ Windows.Shell/ShellProperties/ShellItemPropertyStore.cs
@@ -98,7 +98,7 @@

 		///
 		/// Gets or sets a value indicating whether this <see cref="ShellItemPropertyStore"/> provides a writable store, with no initial
-		/// properties, that exists for the lifetime of the Shell item instance; basically, a property bag attached to the item instance..
+		/// properties, that exists for the lifetime of the Shell item instance; basically, a property bag attached to the item instance.
 		///
 		/// <value><c>true</c> if temporary; otherwise, <c>false</c>.</value>
 		[DefaultValue(false)]
@@ -119,6 +119,13 @@
 					flags = flags.SetFlags(GETPROPERTYSTOREFLAGS.GPS_TEMPORARY, false);
 				}
 			}
+		}
+
+		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+		public override void Dispose()
+		{
+			shellItem = null;
+			base.Dispose();
 		}

 		/// Gets the CLSID of a supplied property key.


[natvis] Don't fiddle with `XmlResolver`

`XmlResolver` is safe by default in .NET 4.7 and higher (and Core).
No need to mess with this field.

GitOrigin-RevId: 6aa367468c913d68728f57b38cf5f647d5c95d32

--- YetiVSI.Shared/DebugEngine/NatvisEngine/NatvisLoader.cs
+++ YetiVSI.Shared/DebugEngine/NatvisEngine/NatvisLoader.cs
@@ -330,12 +330,6 @@
             }
         }

-        [System.Diagnostics.CodeAnalysis.SuppressMessage(
-            "Microsoft.Security.Xml", "CA3053: UseSecureXmlResolver.",
-            Justification =
-                "Usage is secure -- XmlResolver property is set to 'null' in desktop " +
-                "CLR, and is always null in CoreCLR. But CodeAnalysis cannot understand the " +
-                "invocation since it happens through reflection.")]
         bool LoadFromStream(Stream stream, string filename,
                             ICollection<NatvisVisualizerScanner.FileInfo> typeVisualizers)
         {
@@ -344,16 +338,8 @@
             {
                 IgnoreComments = true,
                 IgnoreProcessingInstructions = true,
-                IgnoreWhitespace = true
+                IgnoreWhitespace = true,
             };
-
-            // set XmlResolver via reflection, if it exists. This is required for desktop CLR, as
-            // otherwise the XML reader may attempt to hit untrusted external resources.
-            PropertyInfo xmlResolverProperty = settings.GetType().GetProperty("XmlResolver",
-                                                                              BindingFlags.Public |
-                                                                              BindingFlags
-                                                                                .Instance);
-            xmlResolverProperty?.SetValue(settings, null);

             using (var reader = XmlReader.Create(stream, settings))
             {


Missing rename.

Missing rename.

--- ksp_plugin_adapter/reference_frame_selector.cs
+++ ksp_plugin_adapter/reference_frame_selector.cs
@@ -31,10 +31,10 @@
   public delegate void Callback(NavigationFrameParameters frame_parameters);

   public ReferenceFrameSelector(
-      ISupervisor manager,
+      ISupervisor supervisor,
       IntPtr plugin,
       Callback on_change,
-      string name) : base(manager) {
+      string name) : base(supervisor) {
     plugin_ = plugin;
     on_change_ = on_change;
     name_ = name;


green truck

green truck

--- SampleWebAPI/Controllers/ProductController.cs
+++ SampleWebAPI/Controllers/ProductController.cs
@@ -11,8 +11,8 @@
             new Product
             {
                 Id = 0,
-                Name = "Red Truck",
-                Description = "A red truck"
+                Name = "Green Truck",
+                Description = "A green truck"
             },
             new Product
             {


Deprecate GetAsync(string,string,string,string,int)

--- src/ZmopSharp.Score/Score.cs
+++ src/ZmopSharp.Score/Score.cs
@@ -9,7 +9,7 @@
 {
     public class Score
     {
-        private const string GetBriefMethod= "zhima.credit.score.brief.get";
+        private const string CheckMethod= "zhima.credit.score.brief.get";
         private const string GetMethod = "zhima.credit.score.get";
         private readonly Client _client;

@@ -43,8 +43,12 @@

             return string.Equals("N/A", result["biz_response"]["zmScore"].Value<string>()) ? 0 : result["biz_response"]["zmScore"].Value<int>();
         }
-
+
+        [Obsolete("GetAsync(string, string, string, string, int) is deprecated, please use CheckAsync instead.")]
         public async Task<bool> GetAsync(string transactionId, string certType, string certNo, string name, int admittanceScore)
+            => await CheckAsync(transactionId, certType, certNo, name, admittanceScore);
+
+        public async Task<bool> CheckAsync(string transactionId, string certType, string certNo, string name, int admittanceScore)
         {
             if (!string.Equals(Constants.Score.CertType.AlipayUserId, certType) &&
                 !string.Equals(Constants.Score.CertType.IdentityCard, certType) &&
@@ -55,7 +59,7 @@

             var result = await _client.SendAsync(new Request
             {
-                Method = GetBriefMethod,
+                Method = CheckMethod,
                 Params = new
                 {
                     transaction_id = transactionId,


Import has been fixed

Import has been fixed

--- ScadaAdmin/ScadaAdmin/AppCode/ImportExport.cs
+++ ScadaAdmin/ScadaAdmin/AppCode/ImportExport.cs
@@ -76,9 +76,23 @@
         private static void ImportTable(DataTable srcTable, Tables.TableInfo destTableInfo, int shiftID,
             StreamWriter writer, out int updRowCnt, out int errRowCnt, out string msg)
         {
-            // определение столбцов таблицы в формате SDF, в которую производится импорт
-            DataTable destTable = new DataTable(destTableInfo.Name);
-            Tables.FillTableSchema(destTable);
+            // определение режима импорта: только добавление строк или добавление/обновление
+            string idColName = destTableInfo.IDColName;
+            bool tryToUpdate = idColName != "" && srcTable.Columns.Contains(idColName);
+
+            // получение таблицы, в которую производится импорт
+            DataTable destTable;
+            if (tryToUpdate)
+            {
+                // заполение столбцов и данных таблицы
+                destTable = destTableInfo.GetTable();
+            }
+            else
+            {
+                // заполение столбцов таблицы
+                destTable = new DataTable(destTableInfo.Name);
+                Tables.FillTableSchema(destTable);
+            }

             // вывод заголовка и стобцов в журнал импорта
             if (writer != null)
@@ -92,21 +106,20 @@
             }

             // заполнение таблицы в формате SDF
-            string idColName = destTableInfo.IDColName;
-            bool tryToUpdate = idColName != "" && srcTable.Columns.Contains(idColName);
-
             foreach (DataRowView srcRowView in srcTable.DefaultView)
             {
                 DataRow srcRow = srcRowView.Row;
-                DataRow destRow;
+                DataRow destRow = null;

                 if (tryToUpdate)
                 {
                     int newID = (int)srcRow[idColName] + shiftID;
-                    int rowInd = srcTable.DefaultView.Find(newID); // таблица отсортирована по ключу
-                    destRow = rowInd < 0 ? destTable.NewRow() : srcTable.DefaultView[rowInd].Row;
-                }
-                else
+                    int rowInd = destTable.DefaultView.Find(newID); // таблица отсортирована по ключу
+                    if (rowInd >= 0)
+                        destRow = destTable.DefaultView[rowInd].Row;
+                }
+
+                if (destRow == null)
                 {
                     destRow = destTable.NewRow();
                     destTable.Rows.Add(destRow);


FileController updated.

FileController updated.

--- Scaffolder.API/Controllers/FilesController.cs
+++ Scaffolder.API/Controllers/FilesController.cs
@@ -10,7 +10,6 @@
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
-using Scaffolder.Core.Meta;

 namespace Scaffolder.API.Controllers
 {
@@ -23,21 +22,13 @@
         {
         }

-        [AllowAnonymous]
-        [HttpGet]
-        public IActionResult Get(string name, string configuration)
-        {
-	        var configurationPath = Path.Combine(Settings.WorkingDirectory, configuration, "configuration.json");
-	        var c = Configuration.Load(configurationPath);
-	        var link = c.StorageConfiguration.Url + name;
-
-            return Redirect(link);
-        }
-
         [HttpPost]
         public async Task<IActionResult> Post(ICollection<IFormFile> files)
         {
-            Storage storage = Storage.GetStorage(ApplicationContext.Configuration.StorageConfiguration.Type, ApplicationContext.Configuration.StorageConfiguration.Connection);
+            Storage storage = Storage.GetStorage(
+                ApplicationContext.Configuration.StorageConfiguration.Type,
+                ApplicationContext.Configuration.StorageConfiguration.Url,
+                ApplicationContext.Configuration.StorageConfiguration.Connection);

             var file = this.Request.Form.Files.FirstOrDefault();

@@ -55,7 +46,7 @@
                 var result = new
                 {
                     Name = fileName,
-                    Url = ApplicationContext.Configuration.StorageConfiguration.Url + fileName
+                    Url = storage.Url + fileName
                 };

                 return Ok(result);


Replaced a Console.WriteLine with writing to EventContext instead

--- ConsulRx/ObservableConsul.cs
+++ ConsulRx/ObservableConsul.cs
@@ -190,7 +190,7 @@
                     }
                     catch (Exception ex)
                     {
-                        Console.WriteLine(ex);
+                        eventContext.IncludeException(ex);
                         throw;
                     }
                     finally


Updating AssemblyInfo for v1.0.2 release

--- SSLLWrapper/Properties/AssemblyInfo.cs
+++ SSLLWrapper/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Ashley Poole")]
 [assembly: AssemblyProduct("SSLLWrapper")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyCopyright("Copyright ©  2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,6 +32,6 @@
 // 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("1.0.1")]
-[assembly: AssemblyFileVersion("1.0.1")]
-[assembly: InternalsVisibleTo("SSLLWrapper.Tests")]
+[assembly: AssemblyVersion("1.0.2")]
+[assembly: AssemblyFileVersion("1.0.2")]
+[assembly: InternalsVisibleTo("SSLLWrapper.Tests"), InternalsVisibleTo("DynamicProxyGenAssembly2")]


Started clearing out the current index value on an error when long polling. This helps the recovery time when consul has failed and come back online.

--- ConsulRx/ObservableConsul.cs
+++ ConsulRx/ObservableConsul.cs
@@ -255,6 +255,11 @@
                         {
                             if (successfullyContactedConsulAtLeastOnce)
                             {
+                                //if an error occurred, we reset the index so that we can start clean
+                                //this is necessary because if the consul cluster was restarted it won't recognize
+                                //the old index and will block until the longPollMaxWait expires
+                                index = default(ulong);
+
                                 //if we have been successful at contacting consul already, then we will retry under the assumption that
                                 //things will eventually get healthy again
                                 eventContext["SecondsUntilRetry"] = _retryDelay?.Seconds ?? 0;