Added more XMLvalid document tests

Added more XMLvalid document tests

--- UnitTests/Xml/XmlValidDocuments.cs
+++ UnitTests/Xml/XmlValidDocuments.cs
@@ -3060,5 +3060,600 @@
             Assert.IsNotNull(document);
             Assert.IsTrue(document.IsValid);
         }
+
+        ///
+        /// Tests element with EmptyElemTag and STag content Etag, also tests the VC: Element Valid
+        /// with elements that have children, Mixed and ANY contents There is an output test associated
+        /// with this input file. Here the section(s) 3 apply. This test is taken from the collection
+        /// IBM XML Conformance Test Suite - Production 39.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP39Ibm39v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (a,b)>
+  <!ELEMENT a EMPTY>
+  <!ELEMENT b (#PCDATA|c)* >
+  <!ELEMENT c ANY>
+  <!ELEMENT d ((e,e)|f)+ >
+  <!ELEMENT e ANY>
+  <!ELEMENT f EMPTY>
+]>
+<root>
+   <c></c>
+   content of b element
+   <c>
+      <d><e>no more children</e><e><f/></e><f/></d>
+   </c>
+</root>
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests STag with possible combinations of its fields, also tests WFC: Unique Att Spec.
+        /// There is an output test associated with this input file. Here the section(s) 3.1 apply.
+        /// This test is taken from the collection IBM XML Conformance Test Suite - Production 40.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP40Ibm40v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (#PCDATA|b)* >
+  <!ELEMENT b (#PCDATA) >
+  <!ATTLIST b attr1 CDATA #IMPLIED>
+  <!ATTLIST b attr2 CDATA #IMPLIED>
+  <!ATTLIST b attr3 CDATA #IMPLIED>
+]>
+<root>
+  without white space
+   with a white space
+  one attribute
+  one attribute
+</root>
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests Attribute with Name Eq AttValue and VC: Attribute Value Type There is an output
+        /// test associated with this input file. Here the section(s) 3.1 apply. This test is taken
+        /// from the collection IBM XML Conformance Test Suite - Production 41.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP41Ibm41v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (#PCDATA|b)* >
+  <!ELEMENT b (#PCDATA) >
+  <!ATTLIST b attr1 CDATA #REQUIRED>
+  <!ATTLIST b attr2 (abc|def) ""abc"">
+  <!ATTLIST b attr3 CDATA #FIXED ""fixed"">
+]>
+<root>
+  Name eq AttValue
+</root>
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests ETag with possible combinations of its fields There is an output test associated
+        /// with this input file. Here the section(s) 3.1 apply. This test is taken from the collection
+        /// IBM XML Conformance Test Suite - Production 42.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP42Ibm42v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (a,b)>
+  <!ELEMENT a EMPTY>
+  <!ELEMENT b (#PCDATA|c)* >
+  <!ELEMENT c ANY>
+]>
+<root>
+   <c></c > : End tag with a space inside
+   content of b element
+</root>
+
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests content with all possible constructs: element, CharData, Reference, CDSect, Comment.
+        /// There is an output test associated with this input file. Here the section(s) 3.1 apply. This test
+        /// is taken from the collection IBM XML Conformance Test Suite - Production 43.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP43Ibm43v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (a,b)>
+  <!ELEMENT a EMPTY>
+  <!ELEMENT b (#PCDATA|c)* >
+  <!ELEMENT c ANY>
+  <!ENTITY inContent ""General entity reference in element content"">
+]>
+
+<root>
+
+   <c></c>
+   CharData: content of b element
+   %paaa; : PE reference should not be recognized in element content
+   <c>
+<?PIcontent anyProcessingInstruction?>
+
+    &inContent;
+    Charater reference: A
+    CDSect in content: <![CDATA[ markupsHEADnothing ]]>
+   </c>
+
+</root>
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests EmptyElemTag with possible combinations of its fields There is an output test
+        /// associated with this input file. Here the section(s) 3.1 apply. This test is taken from
+        /// the collection IBM XML Conformance Test Suite - Production 44.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP44Ibm44v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (#PCDATA|b)* >
+  <!ELEMENT b EMPTY >
+  <!ATTLIST b attr1 CDATA #IMPLIED>
+  <!ATTLIST b attr2 CDATA #IMPLIED>
+  <!ATTLIST b attr3 CDATA #IMPLIED>
+]>
+<root>
+  without white space
+   with a white space
+
+
+</root>
+
+
+
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that whitespace is permitted after the tag name in a Start-tag. There
+        /// is an output test associated with this input file. Here the section(s) 3.1 [40] apply.
+        /// This test is taken from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa002()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc ></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates a valid attribute specification within a Start-tag that contains whitespace
+        /// on both sides of the equal sign. There is an output test associated with this input file. Here
+        /// the section(s) 3.1 [40] apply. This test is taken from the collection James Clark XMLTEST cases,
+        /// 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa005()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1 = ""v1""></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that whitespace is valid after the Attribute in a Start-tag. There is an output
+        /// test associated with this input file. Here the section(s) 3.1 [40] apply. This test is taken from the
+        /// collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa010()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1=""v1"" ></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates mutliple Attibutes within the Start-tag. There is an output test
+        /// associated with this input file. Here the section(s) 3.1 [40] apply. This test is taken
+        /// from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa011()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED a2 CDATA #IMPLIED>
+]>
+<doc a1=""v1"" a2=""v2""></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that extra whitespace within an Attribute of a Start-tag is normalized to
+        /// a single space character. There is an output test associated with this input file. Here the
+        /// section(s) 3.1 [40] apply. This test is taken from the collection James Clark XMLTEST cases,
+        /// 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa104()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a=""x	y""></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that extra whitespace within Start-tags and End-tags are nomalized into
+        /// single spaces. There is an output test associated with this input file. Here the section(s)
+        /// 3.1 [40] [42] apply. This test is taken from the collection James Clark XMLTEST cases,
+        /// 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa054()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+
+
+<doc
+></doc
+>
+
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates a valid attribute specification within a Start-tag. There is an output test
+        /// associated with this input file. Here the section(s) 3.1 [41] apply. This test is taken from
+        /// the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa004()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1=""v1""></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that the AttValue within a Start-tag can use a single quote as a delimter.
+        /// There is an output test associated with this input file. Here the section(s) 3.1 [41] apply.
+        /// This test is taken from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa006()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1='v1'></doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that whitespace is permitted after the tag name in an End-tag. There is an output
+        /// test associated with this input file. Here the section(s) 3.1 [42] apply. This test is taken from
+        /// the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa003()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc >
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that Entity References are valid element content. There is an output test associated
+        /// with this input file. Here the section(s) 3.1 [43] apply. This test is taken from the collection James
+        /// Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa023()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e """">
+]>
+<doc>&e;</doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that extra whitespace is normalized into single space character. There is an output test
+        /// associated with this input file. Here the section(s) 3.1 [43] apply. This test is taken from the collection
+        /// James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa047()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>X
+Y</doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Empty-element tag must be used for element which are declared EMPTY. Here the section(s) 3.1 [43] [44] apply.
+        /// This test is taken from the collection OASIS/NIST TESTS, 1-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidOP28pass1()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE
+
+doc
+
+[
+<!ELEMENT doc EMPTY>
+]>
+<doc/>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates the correct syntax for an Empty element tag. There is an output test associated with this
+        /// input file. Here the section(s) 3.1 [44] apply. This test is taken from the collection James Clark XMLTEST
+        /// cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa034()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc/>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that whitespace is permissible after the name in an Empty element tag. There is an output
+        /// test associated with this input file. Here the section(s) 3.1 [44] apply. This test is taken from the
+        /// collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa035()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc />
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that the empty-element tag must be use for an elements that are declared EMPTY.
+        /// There is an output test associated with this input file. Here the section(s) 3.1 [44] apply. This
+        /// test is taken from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa044()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (e*)>
+<!ELEMENT e EMPTY>
+<!ATTLIST e a1 CDATA ""v1"" a2 CDATA ""v2"" a3 CDATA #IMPLIED>
+]>
+<doc>
+<e a3=""v3""/>
+<e a1=""w1""/>
+<e a2=""w2"" a3=""v3""/>
+</doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates that Entity References are valid element content and also demonstrates a valid
+        /// Entity Declaration. There is an output test associated with this input file. Here the section(s)
+        /// 3.1 4.1 [43] [66] apply. This test is taken from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa024()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (foo)>
+<!ELEMENT foo (#PCDATA)>
+<!ENTITY e ""<foo></foo>"">
+]>
+<doc>&e;</doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Test demonstrates numeric character references can be used for element content. There is
+        /// an output test associated with this input file. Here the section(s) 3.1 4.6 [43] apply.
+        /// This test is taken from the collection James Clark XMLTEST cases, 18-Nov-1998.
+        ///
+        [TestMethod]
+        public void XmlValidSa007()
+        {
+            var document = DocumentBuilder.Xml(@"<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc> </doc>
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests both P45 elementDecl and P46 contentspec with possible combinations of their constructs.
+        /// There is an output test associated with this input file. Here the section(s) 3.2 apply. This
+        /// test is taken from the collection IBM XML Conformance Test Suite - Production 45.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP45Ibm45v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (#PCDATA|b)* >
+
+  <!ELEMENT b EMPTY>
+  <!ELEMENT unique ANY>
+  <!ELEMENT unique- ANY>
+  <!ELEMENT unique_ ANY>
+  <!ELEMENT unique. ANY>
+  <!ATTLIST b attr1 CDATA #IMPLIED>
+  <!ATTLIST b attr2 CDATA #IMPLIED>
+  <!ATTLIST b attr3 CDATA #IMPLIED>
+]>
+<root>
+  without white space
+   with a white space
+
+
+</root>
+
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
+
+        ///
+        /// Tests all possible children,cp,choice,seq patterns in P47,P48,P49,P50 There is an output test
+        /// associated with this input file. Here the section(s) 3.2.1 apply. This test is taken from the
+        /// collection IBM XML Conformance Test Suite - Production 47.
+        ///
+        [TestMethod]
+        public void XmlIbmValidP47Ibm47v01()
+        {
+            var document = DocumentBuilder.Xml(@"<?xml version=""1.0""?>
+<!DOCTYPE root [
+  <!ELEMENT root (a,b)>
+  <!ELEMENT a EMPTY>
+  <!ELEMENT b (#PCDATA|c)* >
+  <!ELEMENT c ANY>
+  <!ELEMENT d ANY>
+  <!ELEMENT e ANY>
+  <!ELEMENT f ANY>
+
+  <!ELEMENT child0 (a)>
+  <!ELEMENT child1 (a|b|c)>
+  <!ELEMENT child2 (a ,b,b?,a*,c,c,a,a,b+,c ) >
+  <!ELEMENT child3 (a+|b)? >
+  <!ELEMENT child4 (a, (b|c)+, (a|d)?, (e|f)* )?>
+  <!ELEMENT child5 ( (a,b) | c? | ((d|e),b,c) )* >
+  <!ELEMENT child5_1 ( (a,b)* | (c,b)? | (d,a)+ | ((e|f),b,c) )* >
+  <!ELEMENT child6 (a,b,c)*>
+  <!ELEMENT child7 ((a,b)|c*|((d|e),b,c) )+ >
+  <!ELEMENT child8 ( a, (b|c), (a|b), b)+>
+]>
+<root>
+   <c></c >
+   content of b element
+</root>
+
+
+", new DocumentOptions(validating: true));
+
+            Assert.IsNotNull(document);
+            Assert.IsTrue(document.IsValid);
+        }
     }
 }


Login.aspx.cs

Login.aspx.cs

--- WebAppBootStrap/Account/Login.aspx.cs
+++ WebAppBootStrap/Account/Login.aspx.cs
@@ -11,11 +11,11 @@
     public partial class Login : System.Web.UI.Page {
         protected void Page_Load(object sender, EventArgs e) {

-            bool success = User_Bll.CreateTable();
-            if (success) {
+            //bool success = User_Bll.CreateTable();
+            //if (success) {
                 int count = User_Bll.GetRecordCount();
                 Response.Write(count);
-            }
+            //}
             //test
             //if (LoginLogic.HasLogin) {
             //    Response.Redirect(LoginLogic.DefaultUrl);


csv export

csv export

--- Utility/GlobalUtilities_Utility.cs
+++ Utility/GlobalUtilities_Utility.cs
@@ -16,9 +16,11 @@
 using AgenaTrader.Plugins.MoneyHandler;
 using System.Threading;
 using System.Windows.Forms;
+using System.Data.SqlTypes;
+using System.Linq.Expressions;

 /// <summary>
-/// Version: 1.5.14
+/// Version: 1.5.15
 /// -------------------------------------------------------------------------
 /// Simon Pucher 2016
 /// Christian Kovar 2016
@@ -763,6 +765,31 @@

         #endregion

+
+        #region code utility
+
+        // <summary>
+        // Get the name of a static or instance property from a property access lambda.
+        // Taken from: http://stackoverflow.com/questions/2820660/get-name-of-property-as-a-string
+        // </summary>
+        // <typeparam name="T">Type of the property</typeparam>
+        // <param name="propertyLambda">lambda expression of the form: '() => Class.Property' or '() => object.Property'</param>
+        // <returns>The name of the property</returns>
+
+        public static string GetPropertyName<T>(Expression<Func<T>> propertyLambda)
+        {
+            var me = propertyLambda.Body as MemberExpression;
+
+            if (me == null)
+            {
+                throw new ArgumentException("You must pass a lambda of the form: '() => Class.Property' or '() => object.Property'");
+            }
+
+            return me.Member.Name;
+        }
+
+        #endregion
+
     }

     #endregion
@@ -844,7 +871,6 @@
             catch (Exception)
             {
                 //todo log it
-
             }
         }

@@ -1245,6 +1271,182 @@
     }

+
+
+    /// <summary>
+    /// Generic CSVExport (e.g. flat file for MatLab import)
+    /// GitHub Fork https://gist.github.com/simonpucher/80b5ed382432ec14bd13708a7b984564
+    /// </summary>
+    /// <example>
+    ///   CsvExport myExport = new CsvExport();
+    ///
+    ///   myExport.AddRow();
+    ///   myExport["Region"] = "New York, USA";
+    ///   myExport["Sales"] = 100000;
+    ///   myExport["Date Opened"] = new DateTime(2003, 12, 31);
+    ///
+    ///   myExport.AddRow();
+    ///   myExport["Region"] = "Sydney \"in\" Australia";
+    ///   myExport["Sales"] = 50000;
+    ///   myExport["Date Opened"] = new DateTime(2005, 1, 1, 9, 30, 0);
+    ///
+    /// Then you can do any of the following three output options:
+    ///   string myCsv = myExport.Export();
+    ///   myExport.ExportToFile("Somefile.csv");
+    ///   byte[] myCsvData = myExport.ExportToBytes();
+    /// </example>
+    public class CsvExport
+    {
+        /// <summary>
+        /// To keep the ordered list of column names
+        /// </summary>
+        List<string> fields = new List<string>();
+
+        /// <summary>
+        /// The list of rows
+        /// </summary>
+        List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
+
+        /// <summary>
+        /// The current row
+        /// </summary>
+        Dictionary<string, object> currentRow { get { return rows[rows.Count - 1]; } }
+
+        /// <summary>
+        /// Set a value on this column
+        /// </summary>
+        public object this[string field]
+        {
+            set
+            {
+                // Keep track of the field names, because the dictionary loses the ordering
+                if (!fields.Contains(field)) fields.Add(field);
+                currentRow[field] = value;
+            }
+        }
+
+        /// <summary>
+        /// Call this before setting any fields on a row
+        /// </summary>
+        public void AddRow()
+        {
+            rows.Add(new Dictionary<string, object>());
+        }
+
+        /// <summary>
+        /// This method add the basic data rows for matlab import.
+        /// </summary>
+        public void AddRowBasicData(IStrategy strategy, IInstrument instrument, ITimeFrame timeframe, IBar bar)
+        {
+            this["Strategy"] = strategy.DisplayName;
+            this["TimeFrame"] = timeframe.ToString();
+            this["Instrument"] = instrument.Name;
+            this[GlobalUtilities.GetPropertyName(() => instrument.MainSector)] = instrument.MainSector;
+            this[GlobalUtilities.GetPropertyName(() => instrument.DetailSector)] = instrument.DetailSector;
+            this[GlobalUtilities.GetPropertyName(() => instrument.Currency)] = instrument.Currency;
+            this[GlobalUtilities.GetPropertyName(() => bar.Time)] = bar.Time;
+
+            this[GlobalUtilities.GetPropertyName(() => bar.Open)] = bar.Open;
+            this[GlobalUtilities.GetPropertyName(() => bar.High)] = bar.High;
+            this[GlobalUtilities.GetPropertyName(() => bar.Low)] = bar.Low;
+            this[GlobalUtilities.GetPropertyName(() => bar.Close)] = bar.Close;
+
+            this[GlobalUtilities.GetPropertyName(() => bar.Range)] = bar.Range;
+
+            this[GlobalUtilities.GetPropertyName(() => bar.IsFalling)] = bar.IsFalling;
+            this[GlobalUtilities.GetPropertyName(() => bar.IsGrowing)] = bar.IsGrowing;
+            this[GlobalUtilities.GetPropertyName(() => bar.Volume)] = bar.Volume;
+
+        }
+
+        /// <summary>
+        /// Converts a value to how it should output in a csv file
+        /// If it has a comma, it needs surrounding with double quotes
+        /// Eg Sydney, Australia -> "Sydney, Australia"
+        /// Also if it contains any double quotes ("), then they need to be replaced with quad quotes[sic] ("")
+        /// Eg "Dangerous Dan" McGrew -> """Dangerous Dan"" McGrew"
+        /// </summary>
+        string MakeValueCsvFriendly(object value)
+        {
+            if (value == null) return "";
+            if (value is INullable && ((INullable)value).IsNull) return "";
+            if (value is DateTime)
+            {
+                if (((DateTime)value).TimeOfDay.TotalSeconds == 0)
+                    return ((DateTime)value).ToString("yyyy-MM-dd");
+                return ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss");
+            }
+            string output = value.ToString();
+            if (output.Contains(",") || output.Contains("\""))
+                output = '"' + output.Replace("\"", "\"\"") + '"';
+            return output;
+        }
+
+        /// <summary>
+        /// Output all rows as a CSV returning a string
+        /// </summary>
+        public string Export()
+        {
+            StringBuilder sb = new StringBuilder();
+
+            // The header
+            foreach (string field in fields)
+                sb.Append(field).Append(",");
+            sb.AppendLine();
+
+            // The rows
+            foreach (Dictionary<string, object> row in rows)
+            {
+                foreach (string field in fields)
+                    sb.Append(MakeValueCsvFriendly(row[field])).Append(",");
+                sb.AppendLine();
+            }
+
+            return sb.ToString();
+        }
+
+        /// <summary>
+        /// Copy the csv file into the clipboard
+        /// </summary>
+        public void CopyToClipboard()
+        {
+            try
+            {
+                string csvdata = this.Export();
+                if (!String.IsNullOrEmpty(csvdata))
+                {
+                    //Copy the csv data into clipboard
+                    Thread thread = new Thread(() => Clipboard.SetText(csvdata));
+                    //Set the thread to STA
+                    thread.SetApartmentState(ApartmentState.STA);
+                    thread.Start();
+                    thread.Join();
+                }
+            }
+            catch (Exception)
+            {
+                //todo log it
+            }
+        }
+
+        /// <summary>
+        /// Exports to a file
+        /// </summary>
+        public void ExportToFile(string path)
+        {
+            File.WriteAllText(path, Export());
+        }
+
+        /// <summary>
+        /// Exports as raw UTF8 bytes
+        /// </summary>
+        public byte[] ExportToBytes()
+        {
+            return Encoding.UTF8.GetBytes(Export());
+        }
+    }
+
+
     /// <summary>
     /// We use this class to compare two IBar if they are equal on time.
     /// true when the time of the IBar is the same on x as on y.


Fixed typo

Fixed typo

--- framework/csCommonSense/Plugins/DataServerPlugin/ViewModels/TabItemViewModel.cs
+++ framework/csCommonSense/Plugins/DataServerPlugin/ViewModels/TabItemViewModel.cs
@@ -1007,7 +1007,7 @@
                             break;
                         case DrawingModes.Polygon:
                             this.AddNotification(
-                                "Add polgygon",
+                                "Add polygon",
                                 "Click on map to select the polygon points, double click to end.");
                             break;
                         case DrawingModes.Polyline:


Update Browser.Async.cs (#952)

Update Browser.Async.cs (#952)

При каждой попытке авторизации нужно сбрасывать счётчик ошибок LoginPasswordError
Иначе в случае когда объект VkApi вызывает метод RefreshToken, в момент истечения срока жизни предыдущего токена, будет происходить ошибка throw new VkAuthorizationException("Неверный логин или пароль.");
Такой сценарий легко получить установив объект VkApi как синглтон в приложении и обновляя токен раз в сутки. (или просто вызвав метод RefreshToken на объекте VkApi уже прошедшем авторизацию)

Co-authored-by: alex2015 <ead499d8c3d114c2dc2114b1053f9a2ba50ca765@rambler.ru>

--- VkNet/Utils/Async/Browser.Async.cs
+++ VkNet/Utils/Async/Browser.Async.cs
@@ -17,6 +17,7 @@
 		/// <inheritdoc />
 		public async Task<AuthorizationResult> AuthorizeAsync()
 		{
+			LoginPasswordError = 0;
 			var authorizeUrlResult = await OpenAuthDialogAsync().ConfigureAwait(false);

 			return await NextStepAsync(authorizeUrlResult).ConfigureAwait(false);


Fix remaining usage of DI instead of direct `Create()` call

--- osu.Framework.Benchmarks/BenchmarkTabletDriver.cs
+++ osu.Framework.Benchmarks/BenchmarkTabletDriver.cs
@@ -3,8 +3,6 @@

 #if NET5_0
 using BenchmarkDotNet.Attributes;
-using Microsoft.Extensions.DependencyInjection;
-using OpenTabletDriver;
 using osu.Framework.Input.Handlers.Tablet;

 namespace osu.Framework.Benchmarks
@@ -15,12 +13,7 @@

         public override void SetUp()
         {
-            var collection = new DriverServiceCollection()
-                .AddTransient<TabletDriver>();
-
-            var serviceProvider = collection.BuildServiceProvider();
-
-            driver = serviceProvider.GetRequiredService<TabletDriver>();
+            driver = TabletDriver.Create();
         }

         [Benchmark]


Remove unused parameter

Remove unused parameter

--- osu.Framework/Graphics/Cursor/TooltipContainer.cs
+++ osu.Framework/Graphics/Cursor/TooltipContainer.cs
@@ -150,7 +150,7 @@

         protected override bool OnMouseMove(InputState state)
         {
-            updateTooltipVisibility(state);
+            updateTooltipVisibility();
             return base.OnMouseMove(state);
         }

@@ -167,7 +167,7 @@
         /// <returns>True if the currently visible tooltip should be hidden, false otherwise.</returns>
         protected virtual bool ShallHideTooltip(IHasTooltip tooltipTarget) => !tooltipTarget.IsHovered && !tooltipTarget.IsDragged;

-        private void updateTooltipVisibility(InputState state)
+        private void updateTooltipVisibility()
         {
             findTooltipTask?.Cancel();
             findTooltipTask = Scheduler.AddDelayed(delegate


Move current disabled early-return to top

--- osu.Framework/Graphics/UserInterface/SliderBar.cs
+++ osu.Framework/Graphics/UserInterface/SliderBar.cs
@@ -231,22 +231,22 @@

         private void handleMouseInput(MouseButtonEvent e)
         {
-            float localX = ToLocalSpace(e.ScreenSpaceMousePosition).X;
-
-            float newValue;
-
-            if (relativeValueAtMouseDown != null && e is DragEvent drag)
-            {
-                newValue = relativeValueAtMouseDown.Value + (localX - ToLocalSpace(drag.ScreenSpaceMouseDownPosition).X) / UsableWidth;
-            }
-            else
-            {
-                newValue = (localX - RangePadding) / UsableWidth;
-            }
-
             if (currentNumberInstantaneous.Disabled)
                 return;

+            float localX = ToLocalSpace(e.ScreenSpaceMousePosition).X;
+
+            float newValue;
+
+            if (relativeValueAtMouseDown != null && e is DragEvent drag)
+            {
+                newValue = relativeValueAtMouseDown.Value + (localX - ToLocalSpace(drag.ScreenSpaceMouseDownPosition).X) / UsableWidth;
+            }
+            else
+            {
+                newValue = (localX - RangePadding) / UsableWidth;
+            }
+
             currentNumberInstantaneous.SetProportional(newValue, e.ShiftPressed ? KeyboardStep : 0);
             onUserChange(currentNumberInstantaneous.Value);
         }


Always encode scroll speed as slider velocity in the legacy encoder

--- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
+++ osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
@@ -185,19 +185,12 @@
             SampleControlPoint lastRelevantSamplePoint = null;
             DifficultyControlPoint lastRelevantDifficultyPoint = null;

-            // In osu!taiko and osu!mania, a scroll speed is stored as "slider velocity" in legacy formats.
-            // In that case, a scrolling speed change is a global effect and per-hit object difficulty control points are ignored.
-            bool scrollSpeedEncodedAsSliderVelocity = onlineRulesetID == 1 || onlineRulesetID == 3;
-
             // iterate over hitobjects and pull out all required sample and difficulty changes
             extractDifficultyControlPoints(beatmap.HitObjects);
             extractSampleControlPoints(beatmap.HitObjects);

-            if (scrollSpeedEncodedAsSliderVelocity)
-            {
-                foreach (var point in legacyControlPoints.EffectPoints)
-                    legacyControlPoints.Add(point.Time, new DifficultyControlPoint { SliderVelocity = point.ScrollSpeed });
-            }
+            foreach (var point in legacyControlPoints.EffectPoints)
+                legacyControlPoints.Add(point.Time, new DifficultyControlPoint { SliderVelocity = point.ScrollSpeed });

             foreach (var group in legacyControlPoints.Groups)
             {
@@ -244,9 +237,6 @@

             IEnumerable<DifficultyControlPoint> collectDifficultyControlPoints(IEnumerable<HitObject> hitObjects)
             {
-                if (scrollSpeedEncodedAsSliderVelocity)
-                    yield break;
-
                 foreach (var hitObject in hitObjects)
                     yield return hitObject.DifficultyControlPoint;
             }


Fix hanging semicolon for per-node bank output

--- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
+++ osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
@@ -331,10 +331,11 @@
             StringBuilder sb = new StringBuilder();

             sb.Append(FormattableString.Invariant($"{(int)normalBank}:"));
-            sb.Append(FormattableString.Invariant($"{(int)addBank}:"));
+            sb.Append(FormattableString.Invariant($"{(int)addBank}"));

             if (!banksOnly)
             {
+                sb.Append(":");
                 sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
                 sb.Append(FormattableString.Invariant($"{volume}:"));
                 sb.Append(FormattableString.Invariant($"{sampleFilename}"));


Adjust table layout to match osu-web

Adjust table layout to match osu-web

--- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs
+++ osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs
@@ -1,4 +1,4 @@
-// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

 using osu.Framework.Graphics;
@@ -77,17 +77,20 @@
                 new TableColumn("rank", Anchor.CentreRight, new Dimension(GridSizeMode.AutoSize)),
                 new TableColumn("", Anchor.Centre, new Dimension(GridSizeMode.Absolute, 70)), // grade
                 new TableColumn("score", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)),
-                new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 60, maxSize: 70)),
-                new TableColumn("player", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 150)),
-                new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 110))
+                new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, minSize: 60, maxSize: 70)),
+                new TableColumn("", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 25)), // flag
+                new TableColumn("player", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 125)),
+                new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 120))
             };

-            foreach (var statistic in score.SortedStatistics)
-                columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 50, maxSize: 70)));
+            foreach (var statistic in score.SortedStatistics.Take(score.SortedStatistics.Count() - 1))
+                columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 35, maxSize: 60)));
+
+            columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95)));

             columns.AddRange(new[]
             {
-                new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 40, maxSize: 70)),
+                new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)),
                 new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)),
             });


Minor spacing / reformatting

Minor spacing / reformatting

--- osu.Game/Overlays/News/Displays/ArticleListing.cs
+++ osu.Game/Overlays/News/Displays/ArticleListing.cs
@@ -34,12 +34,14 @@
         {
             RelativeSizeAxes = Axes.X;
             AutoSizeAxes = Axes.Y;
+
             Padding = new MarginPadding
             {
                 Vertical = 20,
                 Left = 30,
                 Right = 50
             };
+
             InternalChild = new FillFlowContainer
             {
                 RelativeSizeAxes = Axes.X,
@@ -61,10 +63,7 @@
                     {
                         Anchor = Anchor.TopCentre,
                         Origin = Anchor.TopCentre,
-                        Margin = new MarginPadding
-                        {
-                            Top = 15
-                        },
+                        Margin = new MarginPadding { Top = 15 },
                         Action = RequestMorePosts,
                         Alpha = 0
                     }


Make DrawableRooms select when they are clicked.

--- osu.Game/Screens/Multi/Components/DrawableRoom.cs
+++ osu.Game/Screens/Multi/Components/DrawableRoom.cs
@@ -9,6 +9,7 @@
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Shapes;
+using osu.Framework.Input;
 using osu.Framework.Localisation;
 using osu.Game.Beatmaps;
 using osu.Game.Beatmaps.Drawables;
@@ -79,6 +80,8 @@
                 RelativeSizeAxes = Axes.Both,
                 Alpha = 0f,
             };
+
+            Action += () => State = SelectionState.Selected;
         }

         [BackgroundDependencyLoader]


Heldele forwardings updates

Heldele forwardings updates

--- Hermod/HTTP/Request/HTTPMethod.cs
+++ Hermod/HTTP/Request/HTTPMethod.cs
@@ -220,7 +220,7 @@

         #endregion

-        #region Constructor(s)
+        #region (private) Constructor(s)

         /// <summary>
         /// Creates a new HTTP method based on the given parameters.


Added logging to DMZ Sync

Added logging to DMZ Sync

--- Infrastructure.DmzSync/Program.cs
+++ Infrastructure.DmzSync/Program.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
@@ -28,6 +28,8 @@
         static void Main(string[] args)
         {

+            var logger = NinjectWebKernel.CreateKernel().Get<ILogger>();
+
             // hacks because of error with Entity Framework.
             // This forces the dmzconnection to use MySql.
             new DataContext();
@@ -45,32 +47,112 @@
             var rateSync = new RateSyncService(new GenericDmzRepository<Core.DmzModel.Rate>(new DmzContext()),
                 new GenericRepository<Rate>(new DataContext()));

-            Console.WriteLine("TokenSyncFromDmz");
-            tokenSync.SyncFromDmz();

-            Console.WriteLine("DriveReportsSyncFromDmz");
-            driveSync.SyncFromDmz();
+            try
+            {
+                Console.WriteLine("TokenSyncFromDmz");
+                tokenSync.SyncFromDmz();

-            Console.WriteLine("TokenClearDmz");
-            tokenSync.ClearDmz();
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to sync Tokens from DMZ", "dmz");
+                throw;
+            }

-            Console.WriteLine("DriveReportClearDmz");
-            driveSync.ClearDmz();
+            try
+            {
+                Console.WriteLine("DriveReportsSyncFromDmz");
+                driveSync.SyncFromDmz();
+
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to sync Drive Reports from DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("TokenClearDmz");
+                tokenSync.ClearDmz();
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to clear Tokens on DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("DriveReportClearDmz");
+                driveSync.ClearDmz();
+
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to clear Drive Reports on DMZ", "dmz");
+                throw;
+            }
+
+
+            try
+            {
+                Console.WriteLine("PersonClearDmz");
+                personSync.ClearDmz();
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to clear Persons on DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("RateClearDmz");
+                rateSync.ClearDmz();
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to clear Rates on DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("PersonSyncToDmz");
+                personSync.SyncToDmz();
+
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to sync Persons to DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("TokenSyncToDmz");
+                tokenSync.SyncToDmz();
+
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to sync Tokens to DMZ", "dmz");
+                throw;
+            }
+
+            try
+            {
+                Console.WriteLine("RateSyncToDmz");
+                rateSync.SyncToDmz();
+            }
+            catch (Exception)
+            {
+                logger.Log("Failed to sync Rates to DMZ", "dmz");
+                throw;
+            }

-            Console.WriteLine("PersonClearDmz");
-            personSync.ClearDmz();
-
-            Console.WriteLine("RateClearDmz");
-            rateSync.ClearDmz();
-
-            Console.WriteLine("PersonSyncToDmz");
-            personSync.SyncToDmz();
-
-            Console.WriteLine("TokenSyncToDmz");
-            tokenSync.SyncToDmz();
-
-            Console.WriteLine("RateSyncToDmz");
-            rateSync.SyncToDmz();

             Console.WriteLine("Done");


WpfUtility_Call: apply FontFamily to MainWindow

--- WpfUtility_Call/MainWindow.xaml.cs
+++ WpfUtility_Call/MainWindow.xaml.cs
@@ -322,7 +322,9 @@
             if (comboBox_FontFamilies.SelectedItem == null) {
                 return;
             }
-            _settings.FontFamily = ((FontFamilyPair)comboBox_FontFamilies.SelectedItem).GetDefaultFamilyName();
+            var fontFamilyPair = (FontFamilyPair)comboBox_FontFamilies.SelectedItem;
+            this.FontFamily = fontFamilyPair.Key;
+            _settings.FontFamily = fontFamilyPair.GetDefaultFamilyName();
             _settings.Save();
         }


Activate geolocator after camera setup is completed. Fix #47

--- Locana/Pages/ShootingPage.xaml.cs
+++ Locana/Pages/ShootingPage.xaml.cs
@@ -362,7 +362,7 @@
         {
             base.OnNavigatedTo(e);
             var target = e.Parameter as TargetDevice;
-            SetupScreen(target);
+            await SetupScreen(target);

             MediaDownloader.Instance.Fetched += OnFetchdImage;

@@ -423,7 +423,7 @@

         }

-        async void SetupScreen(TargetDevice target)
+        async Task SetupScreen(TargetDevice target)
         {
             try
             {


Improve room names comparison algorithm

Improve room names comparison algorithm

--- LocusPocusBot.Rooms/Department.cs
+++ LocusPocusBot.Rooms/Department.cs
@@ -214,14 +214,16 @@
         private int CompareNames(string x, string y)
         {
             // If one of the two strings is a single-digit number,
-            // add left padding with a zero
-
-            if (x.Length == 1 && x[0] >= '1' && x[0] <= '9')
+            // add left padding with a zero.
+            // Example: "1" is less than "12"
+            // Example: "1-2" is less than "3"
+
+            if ((x.Length == 1 || x[1] == '-') && x[0] >= '1' && x[0] <= '9')
             {
                 x = '0' + x;
             }

-            if (y.Length == 1 && y[0] >= '1' && y[0] <= '9')
+            if ((y.Length == 1 || y[1] == '-') && y[0] >= '1' && y[0] <= '9')
             {
                 y = '0' + y;
             }


Remove debugging code

Remove debugging code

--- HelloSign/HelloSign.cs
+++ HelloSign/HelloSign.cs
@@ -223,7 +223,6 @@

             var request = new RestRequest("account/create", Method.POST);
             request.AddParameter("email_address", emailAddress);
-            request.AddParameter("password", "trololo");
             request.RootElement = "account";
             return Execute<Account>(request);
         }


Use an array of lowest vertices when snapping to ground

Previously when snapping to ground an arbitrary vertex would be
chosen out of the set of lowest vertices. Now we use a list of
all lowest vertices (within an epsilon range) and take the smallest
distance.

--- UnityEditorToolkit/Editor/SnappingMenuItems.cs
+++ UnityEditorToolkit/Editor/SnappingMenuItems.cs
@@ -1,11 +1,20 @@
 using UnityEngine;
 using UnityEditor;
+using System.Collections.Generic;

 namespace UnityEditorToolkit {
 	public class SnappingMenuItems : Editor {
 		static readonly string SnapToOriginMessage = "Snap to Origin";
 		static readonly string SnapToGroundMessage = "Snap to Ground";
 		static readonly string SnapYToZeroMessage = "Snap Y to Zero";
+
+		// The maximum distance between "lowest" vertices
+		const float EPSILON = 0.0001f;
+
+		// TODO: Refactor into helper funtions class
+		static bool Approximately(float a, float b, float epsilon) {
+			return (a >= (b - epsilon)) && (a <= (b + epsilon));
+		}

 		[MenuItem(Constants.SnapToZeroItem, false, Constants.SnapToZeroPriority)]
 		static void SnapToOrigin() {
@@ -66,24 +75,41 @@

 			// Storage of mesh data
 			Vector3[] vertices = mesh.vertices;
-			Vector3 lowestVertex = snapTransform.TransformPoint(vertices[0]);
+			List<Vector3> lowestVertices = new List<Vector3>();
+			lowestVertices.Add(snapTransform.TransformPoint(vertices[0]));
 			int vertexCount = mesh.vertexCount;

-			// Find lowest vertex in world space
-			// TODO: Use array of all lowest vertices
+			// Find lowest vertices in world space
 			for(int i = 1; i < vertexCount; i++) {
 				Vector3 v = snapTransform.TransformPoint(vertices[i]);
-				if(v.y < lowestVertex.y) {
-					lowestVertex = v;
+				if(Approximately(v.y, lowestVertices[0].y, EPSILON)) {
+					lowestVertices.Add(v);
+				}
+				else if(v.y < lowestVertices[0].y) {
+					lowestVertices.Clear();
+					lowestVertices.Add(v);
 				}
 			}

-			// Cast a ray downwards then snap object to closest surface
+			// Cast ray(s) downwards then snap object to closest surface
 			RaycastHit hit;
-			if(Physics.Raycast(lowestVertex, Vector3.down, out hit)) {
-				float snapDistance = hit.point.y - lowestVertex.y;
+			float minSnapDistance = Mathf.Infinity;
+
+			// Ignore the current object when raycasting
+			int currentLayer = snapObject.layer;
+			snapObject.layer = LayerMask.NameToLayer("Ignore Raycast");
+
+			for(int i = 0; i < lowestVertices.Count; i++) {
+				if(Physics.Raycast(lowestVertices[i], Vector3.down, out hit)) {
+					minSnapDistance = Mathf.Min(hit.distance, minSnapDistance);
+				}
+			}
+
+			snapObject.layer = currentLayer;
+
+			if(minSnapDistance != Mathf.Infinity) {
 				Undo.RecordObject(snapTransform, SnapToGroundMessage);
-				snapTransform.Translate(0f, snapDistance, 0f, Space.World);
+				snapTransform.Translate(0f, -minSnapDistance, 0f, Space.World);
 			}
 			else {
 				Debug.Log("Cannot snap to ground because" +


Fixing typo in Soap.cs

Fixing typo in Soap.cs

--- UnityProject/Assets/Scripts/Items/Tool/Soap.cs
+++ UnityProject/Assets/Scripts/Items/Tool/Soap.cs
@@ -2,7 +2,7 @@
 using Objects.Construction;

 /// <summary>
-/// Main component for Mop. Allows mopping to be done on tiles.
+/// Main component for soap. Allows cleaning of tiles and gradual degradation of the soap as it is used.
 /// </summary>
 [RequireComponent(typeof(Pickupable))]
 public class Soap : MonoBehaviour, ICheckedInteractable<PositionalHandApply>, IExaminable, IServerSpawn


support for multi/single choice custom fields

Add support for multi/single choice custom fields.

--- VersionOne.JiraConnector/Rest/JiraRestProxy.cs
+++ VersionOne.JiraConnector/Rest/JiraRestProxy.cs
@@ -102,15 +102,39 @@
             dynamic body;
             if (type.ToString().Equals("array"))
             {
-                dynamic operation = new ExpandoObject();
-                ((IDictionary<string, object>)operation).Add(fieldName, new List<dynamic>
+                var custom = fieldMeta.schema["custom"];
+
+                if (custom != null && (custom.ToString().Equals("com.atlassian.jira.plugin.system.customfieldtypes:multiselect")))
                 {
-                    new
+                    dynamic operation = new ExpandoObject();
+                    ((IDictionary<string, object>)operation).Add(fieldName, new List<dynamic>
                     {
-                        set = new List<string> { fieldValue }
-                    }
-                });
-                body = new { update = operation };
+                        new
+                        {
+                            set = new List<object> { new { value = fieldValue} }
+                        }
+                    });
+                    body = new { update = operation };
+                }
+                else if (custom != null && (custom.ToString().Equals("com.atlassian.jira.plugin.system.customfieldtypes:select") ||
+                    custom.ToString().Equals("com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes")))
+                {
+                    dynamic field = new ExpandoObject();
+                    ((IDictionary<string, object>)field).Add(fieldName, new { value = fieldValue });
+                    body = new { fields = field };
+                }
+                else
+                {
+                    dynamic operation = new ExpandoObject();
+                    ((IDictionary<string, object>)operation).Add(fieldName, new List<dynamic>
+                    {
+                        new
+                        {
+                            set = new List<string> { fieldValue }
+                        }
+                    });
+                    body = new { update = operation };
+                }
             }
             else
             {


Attempting to figure out the issues with the spell checker.

--- yafsrc/YetAnotherForum.NET/Classes/YafAjax.cs
+++ yafsrc/YetAnotherForum.NET/Classes/YafAjax.cs
@@ -37,11 +37,13 @@

     using YAF.Classes.Data;
     using YAF.Core;
+    using YAF.Core.Model;
     using YAF.Core.Services;
     using YAF.Types;
     using YAF.Types.Constants;
     using YAF.Types.Extensions;
     using YAF.Types.Interfaces;
+    using YAF.Types.Models;

     #endregion

@@ -129,29 +131,37 @@
         /// Returns List of Suggest Words.
         /// </returns>
         [WebMethod(EnableSession = true)]
-        public string SpellCheck([NotNull]string text, [NotNull]string lang, string engine, string suggest)
-        {
-            if (suggest.Equals("undefined", StringComparison.OrdinalIgnoreCase))
-            {
-                suggest = string.Empty;
-            }
-
-            string xml;
-
-            List<string> result;
-
-            if (string.IsNullOrEmpty(suggest))
-            {
-                xml = GetSpellCheckRequest(text, lang);
-                result = GetListOfMisspelledWords(xml, text);
-            }
-            else
-            {
-                xml = GetSpellCheckRequest(suggest, lang);
-                result = GetListOfSuggestWords(xml, suggest);
-            }
-
-            return new JavaScriptSerializer().Serialize(result);
+        public string SpellCheck(string text, string lang, string engine, string suggest)
+        {
+            try
+            {
+                if (suggest.Equals("undefined", StringComparison.OrdinalIgnoreCase))
+                {
+                    suggest = string.Empty;
+                }
+
+                string xml;
+
+                List<string> result;
+
+                if (string.IsNullOrEmpty(suggest))
+                {
+                    xml = GetSpellCheckRequest(text, lang);
+                    result = GetListOfMisspelledWords(xml, text);
+                }
+                else
+                {
+                    xml = GetSpellCheckRequest(suggest, lang);
+                    result = GetListOfSuggestWords(xml, suggest);
+                }
+
+                return new JavaScriptSerializer().Serialize(result);
+            }
+            catch (Exception ex)
+            {
+                this.Get<ILogger>().Error(ex, "Error calling spell check text: {0} lang {1} engine {2} suggest {3}", text, lang, engine, suggest);
+                throw;
+            }
         }

         /// <summary>


should work now

should work now

--- yafsrc/YetAnotherForum.NET/Classes/YafAjax.cs
+++ yafsrc/YetAnotherForum.NET/Classes/YafAjax.cs
@@ -470,7 +470,7 @@
              // if the user is empty, return a null object...
              return username.IsNotSet()
                         ? null
-                        : this.Get<ThankYou>().CreateThankYou(
+                        : this.Get<IThankYou>().CreateThankYou(
                             new UnicodeEncoder().XSSEncode(username),
                             "BUTTON_THANKSDELETE",
                             "BUTTON_THANKSDELETE_TT",
@@ -497,7 +497,7 @@
                  messageID,
                  this.Get<YafBoardSettings>().EnableDisplayName);

-             return this.Get<ThankYou>().CreateThankYou(username, "BUTTON_THANKS", "BUTTON_THANKS_TT", messageID);
+             return this.Get<IThankYou>().CreateThankYou(username, "BUTTON_THANKS", "BUTTON_THANKS_TT", messageID);
          }

          #endregion


Updated query for enums to accept multiplle or values with commas.


add default values to TokenValidationParameters (#1767)


ComboBox items count.

ComboBox items count.

--- tungsten.sampletest/Features/ComboBoxTest.cs
+++ tungsten.sampletest/Features/ComboBoxTest.cs
@@ -14,6 +14,15 @@
     [TestFixture]
     public class ComboBoxTest : TestBase
     {
+        [Test]
+        public void ItemsCount()
+        {
+            var tab1 = MainWindow.MainTabControl.Tab1;
+            tab1.Click();
+            var comboBox = tab1.StuffControl.ShowErrorComboBox;
+            comboBox.AssertThat(x => x.AllItems<WpfComboBoxItem>().Count(), Is.EqualTo(29));
+        }
+
         [Test]
         public void CheckBoxContents()
         {


Fix priority inversion in caching scheduler

Consider the following scenario:
1. We queue up a bunch of low priority requests, the last of which is to
http://foo
2. We then queue up a super high priority request to http://foo

Under the previous code, we'd return the low prio request since its key
would match, and the high-prio request would be slow.

In this suboptimal yet way simpler fix, we consider the priority as part
of the inflight key, which means that the low priority request still has
to wait in line, but it's highly probable that this will be a cache hit.
This also has the possibility that we could make concurrent Gets to the
same resource. Unfortunate, but the alternate is real damn hard to fix.

--- Akavache.Http/HttpScheduler.cs
+++ Akavache.Http/HttpScheduler.cs
@@ -79,8 +79,8 @@
         readonly IBlobCache blobCache = null;
         readonly IHttpScheduler innerScheduler = null;

-        readonly ConcurrentDictionary<string, IObservable<Tuple<HttpResponseMessage, byte[]>>> inflightDictionary =
-            new ConcurrentDictionary<string, IObservable<Tuple<HttpResponseMessage, byte[]>>>();
+        readonly ConcurrentDictionary<Tuple<string, int>, IObservable<Tuple<HttpResponseMessage, byte[]>>> inflightDictionary =
+            new ConcurrentDictionary<Tuple<string, int>, IObservable<Tuple<HttpResponseMessage, byte[]>>>();

         public CachingHttpScheduler(IHttpScheduler innerScheduler = null, IBlobCache blobCache = null)
         {
@@ -106,7 +106,7 @@
             // Things that are tricky
             // - High prio rqs that satisfy a low prio pending request, we need
             //   to cancel / dequeue the low prio underlying one and return the high-prio
-            //   one. (i.e. priority inversion)
+            //   one. (i.e. priority inversion) (FIXED)
         }

         public HttpClient Client
@@ -125,7 +125,7 @@

         public IObservable<Tuple<HttpResponseMessage, byte[]>> Schedule(HttpRequestMessage request, int priority, Func<HttpResponseMessage, bool> shouldFetchContent)
         {
-            var key = UniqueKeyForRequest(request);
+            var key = Tuple.Create(UniqueKeyForRequest(request), priority);
             var cache = default(IObservable<Tuple<HttpResponseMessage, byte[]>>);

             if (inflightDictionary.TryGetValue(key, out cache))
@@ -144,7 +144,7 @@
                 return noCache;
             }

-            var ret = blobCache.GetObjectAsync<HttpCacheEntry>(key).Catch<HttpCacheEntry>(Observable.Return(default(HttpCacheEntry)))
+            var ret = blobCache.GetObjectAsync<HttpCacheEntry>(key.Item1).Catch<HttpCacheEntry>(Observable.Return(default(HttpCacheEntry)))
                 .SelectMany(async (cacheEntry, ct) =>
                 {
                     var cancelSignal = new AsyncSubject<Unit>();
@@ -194,7 +194,7 @@
                     var entry = HttpCacheEntry.FromResponse(respWithData.Item1, respWithData.Item2);
                     entry.ShouldCheckResponseHeaders = (expiryDate == null);

-                    await blobCache.InsertObject(key, entry, expiryDate);
+                    await blobCache.InsertObject(key.Item1, entry, expiryDate);
                     return respWithData;
                 })
                 .Finally(() => inflightDictionary.TryRemove(key, out cache))


Fixed ShellContextMenu build error due to change to AppendMenu

--- Windows.Shell/ShellObjects/ShellContextMenu.cs
+++ Windows.Shell/ShellObjects/ShellContextMenu.cs
@@ -394,7 +394,7 @@
 			{
 				cbSize = (uint)Marshal.SizeOf(typeof(MENUINFO)),
 				fMask = MenuInfoMember.MIM_MENUDATA,
-				dwMenuData = (UIntPtr)tag
+				dwMenuData = (IntPtr)tag
 			};

 			foreach (Menu item in menu.MenuItems)


EYE-5864. Support DataTemplates in ResourceDictionary

--- WpfDesign.XamlDom/Project/CollectionSupport.cs
+++ WpfDesign.XamlDom/Project/CollectionSupport.cs
@@ -89,7 +89,11 @@
 				if (key == null || (key as string) == "")
 				{
 					if (val is Style)
-						key = ((Style)val).TargetType;
+						key = ((Style)val).TargetType;
+
+					else if (val is DataTemplate)
+						key = ((DataTemplate)val).DataTemplateKey;
+
 				}
 				if (key == null || (key as string) == "")
 					key = val;


CP-18012: Fixed the Jenkins build, regenerated resources

Fixed test:
1) Test Failure : XenAdminTests.UnitTests.MiscTests.NamesAndMessagesTests.XapiFriendlyNameStaticMethodsReturnStrings
     Null value returned for get_SR_BACKEND_FAILURE_457
  Expected: not null
  But was:  null

Signed-off-by: Gabor Apati-Nagy <fea1aad7ceb67d3aeb88acb6b51e51467c21418e@citrix.com>

--- XenModel/XenAPI/FriendlyErrorNames.Designer.cs
+++ XenModel/XenAPI/FriendlyErrorNames.Designer.cs
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.18444
+//     Runtime Version:4.0.30319.34209
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -3666,15 +3666,6 @@
         }

         /// <summary>
-        ///   Looks up a localized string similar to Not enough space to enable LVHD thin provisioning..
-        /// </summary>
-        public static string SR_BACKEND_FAILURE_457 {
-            get {
-                return ResourceManager.GetString("SR_BACKEND_FAILURE_457", resourceCulture);
-            }
-        }
-
-        /// <summary>
         ///   Looks up a localized string similar to The VDI is not available.
         /// </summary>
         public static string SR_BACKEND_FAILURE_46 {
@@ -4755,6 +4746,15 @@
         }

         /// <summary>
+        ///   Looks up a localized string similar to Operation cannot be performed because this VLAN is already in use. Please check your network configuration..
+        /// </summary>
+        public static string VLAN_IN_USE {
+            get {
+                return ResourceManager.GetString("VLAN_IN_USE", resourceCulture);
+            }
+        }
+
+        /// <summary>
         ///   Looks up a localized string similar to You tried to create a VLAN, but the tag you gave ({0}) was invalid -- it must be between 0 and 4094..
         /// </summary>
         public static string VLAN_TAG_INVALID {
@@ -4949,6 +4949,15 @@
         public static string VM_INCOMPATIBLE_WITH_THIS_HOST {
             get {
                 return ResourceManager.GetString("VM_INCOMPATIBLE_WITH_THIS_HOST", resourceCulture);
+            }
+        }
+
+        /// <summary>
+        ///   Looks up a localized string similar to The VM is configured in a way that prevents it from being mobile..
+        /// </summary>
+        public static string VM_IS_IMMOBILE {
+            get {
+                return ResourceManager.GetString("VM_IS_IMMOBILE", resourceCulture);
             }
         }


re-create serializer options for each usage on test

--- test/Aqua.Tests/Serialization/SystemTextJsonSerializationHelper.cs
+++ test/Aqua.Tests/Serialization/SystemTextJsonSerializationHelper.cs
@@ -11,17 +11,15 @@

     public static class SystemTextJsonSerializationHelper
     {
-        private static readonly JsonSerializerOptions _serializerSettings = new JsonSerializerOptions { WriteIndented = true }
+        private static JsonSerializerOptions SerializerOptions => new JsonSerializerOptions { WriteIndented = true }
             .AddConverter(new TimeSpanConverter())
             .ConfigureAqua();

         [SuppressMessage("Major Code Smell", "S125:Sections of code should not be commented out", Justification = "Debugging purpose")]
         public static T Serialize<T>(this T graph)
         {
-            var json = JsonSerializer.Serialize(graph, _serializerSettings);
-
-            // File.AppendAllText($"Dump-{graph?.GetType().Name}-JsonConvert-{Guid.NewGuid()}.json", json);
-            return JsonSerializer.Deserialize<T>(json, _serializerSettings);
+            var json = JsonSerializer.Serialize(graph, SerializerOptions);
+            return JsonSerializer.Deserialize<T>(json, SerializerOptions);
         }

         public static void SkipUnsupportedDataType(Type type, object value)


Added unit test.

Added unit test.

--- test/Overflow.Test/Behaviors/CompensatingOperationBehaviorTests.cs
+++ test/Overflow.Test/Behaviors/CompensatingOperationBehaviorTests.cs
@@ -38,6 +38,19 @@
             ExecuteIgnoringErrors(sut.Execute);

             Assert.True(compensatingOperation.HasExecuted);
+        }
+
+        [Fact]
+        public void When_no_error_occurs_in_the_operation_the_compensating_operation_is_not_executed()
+        {
+            var operation = new FakeOperation();
+            var compensatingOperation = new FakeOperation();
+            var sut = new CompensatingOperationBehavior(compensatingOperation);
+            sut.AttachTo(operation);
+
+            sut.Execute();
+
+            Assert.False(compensatingOperation.HasExecuted);
         }

         [Fact]


Add XML comments to Account methods

Add XML comments to Account methods

--- LCAPI/LCAPI/Account.cs
+++ LCAPI/LCAPI/Account.cs
@@ -19,6 +19,10 @@

         protected string SummaryUrl => $"{Url}/summary";

+        /// <summary>
+        /// Provides a summary of the investor's account
+        /// </summary>
+        /// <returns>Summary of the investor's account</returns>
         public Task<AccountSummary> GetSummaryAsync()
         {
             return Client.GetAsync<AccountSummary>(SummaryUrl);
@@ -30,6 +34,10 @@

         protected string AvailableCashUrl => $"{Url}/availablecash";

+        /// <summary>
+        /// Provides the most up to date value of the cash available in the investor's account
+        /// </summary>
+        /// <returns>Value of the cash available in the investor's account</returns>
         public Task<AccountAvailableCash> GetAvailableCashAsync()
         {
             return Client.GetAsync<AccountAvailableCash>(AvailableCashUrl);
@@ -46,6 +54,12 @@
             return Client.PostAsync<AccountAddFunds, T>(AddFundsUrl, request);
         }

+        /// <summary>
+        /// Add funds to the investor's account once, immediately
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <remarks>For loading funds immediately and one time</remarks>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsNowAsync(decimal amount)
         {
             return AddFundsAsync(new
@@ -55,6 +69,13 @@
             });
         }

+        /// <summary>
+        /// Add funds to the investor's account once, scheduled for a future date
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <param name="startDate">Future transfer date</param>
+        /// <remarks>For loading funds one time scheduled for future date</remarks>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsScheduledAsync(decimal amount, DateTime startDate)
         {
             return AddFundsAsync(new
@@ -65,6 +86,14 @@
             });
         }

+        /// <summary>
+        /// Add funds to the investor's account, recurring weekly
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <param name="startDate">Recurring transfer start date</param>
+        /// <param name="endDate">Recurring transfer end date</param>
+        /// <remarks>For loading funds recurring weekly</remarks>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsRecurringWeeklyAsync(decimal amount, DateTime startDate,
             DateTime endDate)
         {
@@ -77,6 +106,14 @@
             });
         }

+        /// <summary>
+        /// Add funds to the investor's account, recurring bi-weekly
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <param name="startDate">Recurring transfer start date</param>
+        /// <param name="endDate">Recurring transfer end date</param>
+        /// <remarks>For loading funds recurring bi-weekly</remarks>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsRecurringBiWeeklyAsync(decimal amount, DateTime startDate,
             DateTime endDate)
         {
@@ -89,6 +126,13 @@
             });
         }

+        /// <summary>
+        /// Add funds to the investor's account, recurring bi-monthly on the 1st and 16th of every month
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <param name="startDate">Recurring transfer start date</param>
+        /// <param name="endDate">Recurring transfer end date</param>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsRecurringBiMonthlyAsync(decimal amount, DateTime startDate,
             DateTime endDate)
         {
@@ -101,6 +145,14 @@
             });
         }

+        /// <summary>
+        /// Add funds to the investor's account, recurring monthly
+        /// </summary>
+        /// <param name="amount">Amount of funds to add</param>
+        /// <param name="startDate">Recurring transfer start date</param>
+        /// <param name="endDate">Recurring transfer end date</param>
+        /// <remarks>For loading funds recurring monthly</remarks>
+        /// <returns>Details of a transaction to add funds</returns>
         public Task<AccountAddFunds> AddFundsRecurringMonthlyAsync(decimal amount, DateTime startDate,
             DateTime endDate)
         {
@@ -120,6 +172,11 @@
             return Client.PostAsync<AccountWithdrawFunds, T>(WithdrawFundsUrl, request);
         }

+        /// <summary>
+        /// Withdraw funds from the investor's account
+        /// </summary>
+        /// <param name="amount">Amount of funds to withdraw</param>
+        /// <returns>Details of a transaction to withdraw funds</returns>
         public Task<AccountWithdrawFunds> WithdrawFundsAsync(decimal amount)
         {
             return WithdrawFundsAsync(new { amount });


Next release is Gallai.

Next release is Gallai.

--- ksp_plugin_adapter/main_window.cs
+++ ksp_plugin_adapter/main_window.cs
@@ -5,10 +5,10 @@

 internal class MainWindow : VesselSupervisedWindowRenderer {
   // Update this section before each release.
-  private const string next_release_name_ = "Galileo";
-  private const int next_release_lunation_number_ = 253;
+  private const string next_release_name_ = "Gallai";
+  private const int next_release_lunation_number_ = 254;
   private readonly DateTimeOffset next_release_date_ =
-      new DateTimeOffset(2020, 06, 21, 06, 41, 00, TimeSpan.Zero);
+      new DateTimeOffset(2020, 07, 20, 17, 32, 00, TimeSpan.Zero);

   public MainWindow(PrincipiaPluginAdapter adapter,
                     FlightPlanner flight_planner,


Some changes to AStar

Some changes to AStar

--- AI_In_Robotics/AI_In_Robotics/Classes/AStar.cs
+++ AI_In_Robotics/AI_In_Robotics/Classes/AStar.cs
@@ -10,15 +10,21 @@
 {
     public class Astar
     {
-        public Node FindPath(char[,] matrix, int startX, int startY, int goalX, int goalY, int fieldsToApply = 0)
+        private readonly char[,] _worldMap;
+        public Astar(char[,] worldMap)
+        {
+            _worldMap = worldMap;
+        }
+
+        public Node FindPath(int startX, int startY, int goalX, int goalY, int fieldsToApply = 0)
         {
             //Find max Size of map
-            var maxX = matrix.GetLength(0);
+            var maxX = _worldMap.GetLength(0);
             if (maxX == 0)
                 return null;
-            var maxY = matrix.GetLength(1);
-
-            var enLargedObjectMatrix = EnLargeObjects(matrix, fieldsToApply);
+            var maxY = _worldMap.GetLength(1);
+
+            var enLargedObjectMatrix = EnLargeObjects(fieldsToApply);

             //the keys for open and closed are x.ToString() + y.ToString() of the Node
             var open = new Dictionary<string, Node>();
@@ -114,14 +120,14 @@
             return D*(dx + dy);
         }

-        public static char[,] EnLargeObjects(char[,] matrix, int fieldsToApply = 0)
-        {
-            var maxX = matrix.GetLength(0);
+        public char[,] EnLargeObjects(int fieldsToApply = 0)
+        {
+            var maxX = _worldMap.GetLength(0);
             if (maxX == 0)
                 return null;
-            var maxY = matrix.GetLength(1);
-
-            var enLargedMap = (char[,])matrix.Clone();
+            var maxY = _worldMap.GetLength(1);
+
+            var enLargedMap = (char[,])_worldMap.Clone();

             if (fieldsToApply == 0)
                 return enLargedMap;
@@ -130,42 +136,24 @@
             {
                 for (var yIndex = 0; yIndex < maxY; yIndex++)
                 {
-                    if (matrix[xIndex, yIndex] != 'X') continue;
-
-                    if (CheckIfItsInsideMap(xIndex + fieldsToApply, yIndex, maxX, maxY) && matrix[xIndex + fieldsToApply, yIndex] != 'X')
+                    if (_worldMap[xIndex, yIndex] != 'X') continue;
+
+                    if (CheckIfItsInsideMap(xIndex + fieldsToApply, yIndex, maxX, maxY) && _worldMap[xIndex + fieldsToApply, yIndex] != 'X')
                     {
                         enLargedMap[xIndex + fieldsToApply, yIndex] = 'X';
                     }
-                    if(CheckIfItsInsideMap(xIndex, yIndex + fieldsToApply, maxX, maxY) && matrix[xIndex, yIndex + fieldsToApply] != 'X' )
+                    if(CheckIfItsInsideMap(xIndex, yIndex + fieldsToApply, maxX, maxY) && _worldMap[xIndex, yIndex + fieldsToApply] != 'X' )
                     {
                         enLargedMap[xIndex, yIndex + fieldsToApply] = 'X';
                     }
-                    if (CheckIfItsInsideMap(xIndex - fieldsToApply, yIndex, maxX, maxY) && matrix[xIndex - fieldsToApply, yIndex] != 'X')
+                    if (CheckIfItsInsideMap(xIndex - fieldsToApply, yIndex, maxX, maxY) && _worldMap[xIndex - fieldsToApply, yIndex] != 'X')
                     {
                         enLargedMap[xIndex - fieldsToApply, yIndex] = 'X';
                     }
-                    if (CheckIfItsInsideMap(xIndex, yIndex - fieldsToApply, maxX, maxY) && matrix[xIndex, yIndex - fieldsToApply] != 'X')
+                    if (CheckIfItsInsideMap(xIndex, yIndex - fieldsToApply, maxX, maxY) && _worldMap[xIndex, yIndex - fieldsToApply] != 'X')
                     {
                         enLargedMap[xIndex, yIndex - fieldsToApply] = 'X';
                     }
-                    /*
-                    if (CheckIfItsInsideMap(xIndex + fieldsToApply, yIndex + fieldsToApply, maxX, maxY) && matrix[xIndex + fieldsToApply, yIndex + fieldsToApply] != 'X')
-                    {
-                        enLargedMap[xIndex + fieldsToApply, yIndex + fieldsToApply] = 'X';
-                    }
-                    if (CheckIfItsInsideMap(xIndex - fieldsToApply, yIndex - fieldsToApply, maxX, maxY) && matrix[xIndex - fieldsToApply, yIndex - fieldsToApply] != 'X')
-                    {
-                        enLargedMap[xIndex - fieldsToApply, yIndex - fieldsToApply] = 'X';
-                    }
-                    if (CheckIfItsInsideMap(xIndex - fieldsToApply, yIndex + fieldsToApply, maxX, maxY) && matrix[xIndex - fieldsToApply, yIndex + fieldsToApply] != 'X')
-                    {
-                        enLargedMap[xIndex - fieldsToApply, yIndex + fieldsToApply] = 'X';
-                    }
-                    if (CheckIfItsInsideMap(xIndex + fieldsToApply, yIndex - fieldsToApply, maxX, maxY) && matrix[xIndex + fieldsToApply, yIndex - fieldsToApply] != 'X')
-                    {
-                        enLargedMap[xIndex + fieldsToApply, yIndex - fieldsToApply] = 'X';
-                    }
-                    */
                 }
             }
             return enLargedMap;
@@ -220,7 +208,7 @@
             //looking for shortest path from 'S' at (0,1) to 'E' at (3,3)
             //obstacles marked by 'X'
             int fromX = 0, fromY = 1, toX = 3, toY = 3;
-            var endNode = new Astar().FindPath(matrix, fromX, fromY, toX, toY);
+            var endNode = new Astar(matrix).FindPath(fromX, fromY, toX, toY);

             //looping through the Parent nodes until we get to the start node
             var path = new Stack<Node>();


visual fix, controls in front of too long i18n.

--- ARKBreedingStats/CreatureInfoInput.Designer.cs
+++ ARKBreedingStats/CreatureInfoInput.Designer.cs
@@ -81,47 +81,47 @@
             //
             // gbCreatureInfo
             //
-            this.gbCreatureInfo.Controls.Add(this.lbNewMutations);
-            this.gbCreatureInfo.Controls.Add(this.lbArkIdIngame);
+            this.gbCreatureInfo.Controls.Add(this.btnGenerateUniqueName);
             this.gbCreatureInfo.Controls.Add(this.tbArkIdIngame);
-            this.gbCreatureInfo.Controls.Add(this.label1);
             this.gbCreatureInfo.Controls.Add(this.tbARKID);
-            this.gbCreatureInfo.Controls.Add(this.btClearColors);
-            this.gbCreatureInfo.Controls.Add(this.regionColorChooser1);
+            this.gbCreatureInfo.Controls.Add(this.cbServer);
+            this.gbCreatureInfo.Controls.Add(this.textBoxTribe);
+            this.gbCreatureInfo.Controls.Add(this.textBoxNote);
+            this.gbCreatureInfo.Controls.Add(this.parentComboBoxFather);
+            this.gbCreatureInfo.Controls.Add(this.parentComboBoxMother);
+            this.gbCreatureInfo.Controls.Add(this.textBoxOwner);
+            this.gbCreatureInfo.Controls.Add(this.textBoxName);
             this.gbCreatureInfo.Controls.Add(this.nudMutationsFather);
             this.gbCreatureInfo.Controls.Add(this.nudMutationsMother);
             this.gbCreatureInfo.Controls.Add(this.label12);
             this.gbCreatureInfo.Controls.Add(this.label11);
-            this.gbCreatureInfo.Controls.Add(this.cbServer);
+            this.gbCreatureInfo.Controls.Add(this.dhmsInputGrown);
+            this.gbCreatureInfo.Controls.Add(this.dhmsInputCooldown);
+            this.gbCreatureInfo.Controls.Add(this.nudMaturation);
+            this.gbCreatureInfo.Controls.Add(this.cbNeutered);
+            this.gbCreatureInfo.Controls.Add(this.dateTimePickerAdded);
+            this.gbCreatureInfo.Controls.Add(this.buttonStatus);
+            this.gbCreatureInfo.Controls.Add(this.buttonSex);
+            this.gbCreatureInfo.Controls.Add(this.lbNewMutations);
+            this.gbCreatureInfo.Controls.Add(this.lbArkIdIngame);
+            this.gbCreatureInfo.Controls.Add(this.label1);
+            this.gbCreatureInfo.Controls.Add(this.btClearColors);
+            this.gbCreatureInfo.Controls.Add(this.regionColorChooser1);
             this.gbCreatureInfo.Controls.Add(this.lbServer);
-            this.gbCreatureInfo.Controls.Add(this.btnGenerateUniqueName);
-            this.gbCreatureInfo.Controls.Add(this.textBoxTribe);
             this.gbCreatureInfo.Controls.Add(this.lbTribe);
             this.gbCreatureInfo.Controls.Add(this.lbStatus);
             this.gbCreatureInfo.Controls.Add(this.lbSex);
             this.gbCreatureInfo.Controls.Add(this.lbMutations);
-            this.gbCreatureInfo.Controls.Add(this.dhmsInputGrown);
-            this.gbCreatureInfo.Controls.Add(this.dhmsInputCooldown);
-            this.gbCreatureInfo.Controls.Add(this.nudMaturation);
             this.gbCreatureInfo.Controls.Add(this.label7);
             this.gbCreatureInfo.Controls.Add(this.lbMaturationPerc);
-            this.gbCreatureInfo.Controls.Add(this.cbNeutered);
-            this.gbCreatureInfo.Controls.Add(this.dateTimePickerAdded);
             this.gbCreatureInfo.Controls.Add(this.lbCooldown);
             this.gbCreatureInfo.Controls.Add(this.lbGrownIn);
             this.gbCreatureInfo.Controls.Add(this.btSaveChanges);
             this.gbCreatureInfo.Controls.Add(this.lbNote);
-            this.gbCreatureInfo.Controls.Add(this.textBoxNote);
-            this.gbCreatureInfo.Controls.Add(this.buttonStatus);
-            this.gbCreatureInfo.Controls.Add(this.parentComboBoxFather);
-            this.gbCreatureInfo.Controls.Add(this.parentComboBoxMother);
             this.gbCreatureInfo.Controls.Add(this.lbFather);
             this.gbCreatureInfo.Controls.Add(this.lbMother);
-            this.gbCreatureInfo.Controls.Add(this.buttonSex);
-            this.gbCreatureInfo.Controls.Add(this.textBoxOwner);
             this.gbCreatureInfo.Controls.Add(this.lbOwner);
             this.gbCreatureInfo.Controls.Add(this.lbName);
-            this.gbCreatureInfo.Controls.Add(this.textBoxName);
             this.gbCreatureInfo.Controls.Add(this.btAdd2Library);
             this.gbCreatureInfo.Dock = System.Windows.Forms.DockStyle.Fill;
             this.gbCreatureInfo.Location = new System.Drawing.Point(0, 0);


Display unknown axes before they are resolved.

--- AdvancedControlsMod/UI/ControllerAxisEditor.cs
+++ AdvancedControlsMod/UI/ControllerAxisEditor.cs
@@ -142,7 +142,6 @@
                 note = null;

                 controller = Controller.Get(Axis.GUID);
-                Axis.Axis %= controller.NumAxes;

                 // Graph rect
                 graphRect = new Rect(
@@ -219,6 +218,7 @@
                         1),
                     Color.gray);

+                if (Axis.Status == AxisStatus.OK)
                 Util.FillRect(new Rect(
                                   graphRect.x + graphRect.width / 2 + graphRect.width / 2 * Axis.InputValue,
                                   graphRect.y,
@@ -235,8 +235,7 @@
                     Axis.GUID = Controller.DeviceList[controller_index];
                 }

-                GUILayout.Label(controller != null ? controller.Name : "<color=#FF0000>Disconnected controller</color>",
-                    new GUIStyle(Elements.InputFields.Default) { alignment = TextAnchor.MiddleCenter });
+                GUILayout.Label(controller.Name, new GUIStyle(Elements.InputFields.Default) { alignment = TextAnchor.MiddleCenter });

                 if (GUILayout.Button(">", controller_index < Controller.NumDevices - 1 ? Elements.Buttons.Default : Elements.Buttons.Disabled, GUILayout.Width(30))
                     && controller_index < Controller.NumDevices - 1)
@@ -255,7 +254,7 @@
                     && Axis.Axis > 0)
                     Axis.Axis--;

-                GUILayout.Label(controller.AxisNames[Axis.Axis], new GUIStyle(Elements.InputFields.Default) { alignment = TextAnchor.MiddleCenter });
+                GUILayout.Label(controller.GetAxisName(Axis.Axis), new GUIStyle(Elements.InputFields.Default) { alignment = TextAnchor.MiddleCenter });

                 if (GUILayout.Button(">", Axis.Axis < Controller.Get(Axis.GUID).NumAxes - 1 ? Elements.Buttons.Default : Elements.Buttons.Disabled, GUILayout.Width(30))
                     && Axis.Axis < Controller.Get(Axis.GUID).NumAxes - 1)


Ignore section fixed

Ignore section fixed

--- AngleSharp/DTD/DtdTokenizer.cs
+++ AngleSharp/DTD/DtdTokenizer.cs
@@ -8,7 +8,7 @@
     /// <summary>
     /// The tokenizer class for Document Type Definitions.
     /// </summary>
-    [DebuggerStepThrough]
+    //[DebuggerStepThrough]
     sealed class DtdTokenizer : BaseTokenizer
     {
         #region Constants
@@ -251,7 +251,7 @@
                         if (lastThree[0] == Specification.LT && lastThree[1] == Specification.EM && lastThree[2] == Specification.SBO)
                             nesting++;
                     }
-                    while (nesting == 0 && lastThree[0] == Specification.SBC && lastThree[1] == Specification.SBC && lastThree[2] == Specification.GT);
+                    while (nesting != 0 || lastThree[0] != Specification.SBC || lastThree[1] != Specification.SBC || lastThree[2] != Specification.GT);

                     if (c == Specification.GT)
                         return GetElement(_stream.Next);


Add comment about custom SelectionHandler

--- osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineBlueprintContainer.cs
+++ osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineBlueprintContainer.cs
@@ -82,14 +82,15 @@

         protected override SelectionHandler CreateSelectionHandler() => new TimelineSelectionHandler();

-        internal class TimelineSelectionHandler : SelectionHandler
-        {
-            public override bool HandleMovement(MoveSelectionEvent moveEvent) => true;
-        }
-
         protected override SelectionBlueprint CreateBlueprintFor(HitObject hitObject) => new TimelineHitObjectBlueprint(hitObject);

         protected override DragBox CreateDragBox(Action<RectangleF> performSelect) => new TimelineDragBox(performSelect);
+
+        internal class TimelineSelectionHandler : SelectionHandler
+        {
+            // for now we always allow movement. snapping is provided by the Timeline's "distance" snap implementation
+            public override bool HandleMovement(MoveSelectionEvent moveEvent) => true;
+        }

         private class TimelineDragBox : DragBox
         {


Update colours once on `TimelineHitObjectBlueprint`

--- osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs
+++ osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs
@@ -123,12 +123,12 @@
                     indexInCurrentComboBindable.BindValueChanged(_ => updateComboIndex(), true);

                     comboIndexBindable = comboInfo.ComboIndexBindable.GetBoundCopy();
-                    comboIndexBindable.BindValueChanged(_ => updateColour(), true);
-
                     comboIndexWithOffsetsBindable = comboInfo.ComboIndexWithOffsetsBindable.GetBoundCopy();
-                    comboIndexWithOffsetsBindable.BindValueChanged(_ => updateColour(), true);
-
+
+                    comboIndexBindable.ValueChanged += _ => updateColour();
+                    comboIndexWithOffsetsBindable.ValueChanged += _ => updateColour();
                     skin.SourceChanged += updateColour;
+                    updateColour();
                     break;
             }
         }


More saving code

More saving code

--- Assets/Scripts/AncestryData.cs
+++ Assets/Scripts/AncestryData.cs
@@ -501,6 +501,46 @@
                 writer.Write(individual.Id);
                 individual.WriteToStream(writer);
             }
+
+            writer.Write(ancestorGameData.Values.Count);
+            foreach (IndividualSphereData individual in ancestorGameData.Values)
+            {
+                writer.Write(individual.Id);
+                individual.WriteToStream(writer);
+            }
+
+            writer.Write(descentMaleLineVectors.Count);
+            foreach (Vector3[] line in descentMaleLineVectors)
+            {
+                writer.Write(line[0].x);
+                writer.Write(line[0].y);
+                writer.Write(line[0].z);
+                writer.Write(line[1].x);
+                writer.Write(line[1].y);
+                writer.Write(line[1].z);
+            }
+
+            writer.Write(descentFemaleLineVectors.Count);
+            foreach (Vector3[] line in descentFemaleLineVectors)
+            {
+                writer.Write(line[0].x);
+                writer.Write(line[0].y);
+                writer.Write(line[0].z);
+                writer.Write(line[1].x);
+                writer.Write(line[1].y);
+                writer.Write(line[1].z);
+            }
+
+            writer.Write(marriageLineVectors.Count);
+            foreach (Vector3[] line in marriageLineVectors)
+            {
+                writer.Write(line[0].x);
+                writer.Write(line[0].y);
+                writer.Write(line[0].z);
+                writer.Write(line[1].x);
+                writer.Write(line[1].y);
+                writer.Write(line[1].z);
+            }
         }
     }


add get score trigger

add get score trigger

--- Assets/Scripts/Blocks/Block.cs
+++ Assets/Scripts/Blocks/Block.cs
@@ -178,7 +178,8 @@
 	{
 		killed = true;
 		TellNeighboursToFall();
-		EventManager.TriggerEvent("GetPoints" + points);
+		string pointsTrigger = "GetPoints" + points.ToString ();
+		EventManager.TriggerEvent(pointsTrigger);
 		KillGroup();
 	}


ARGH!: FixedUpdate -> Update (again again)

--- Assets/Scripts/FollowTarget.cs
+++ Assets/Scripts/FollowTarget.cs
@@ -22,7 +22,7 @@
         m_Transform = GetComponent<Transform>();
     }

-    void FixedUpdate()
+    void Update()
     {
         Vector2 currentPosition = new Vector2(m_Transform.position.x, m_Transform.position.y);
         Vector2 targetPosition = new Vector2(Target.position.x, Target.position.y);


InputManager - Only set icon active state if icon is set

--- Assets/Scripts/InputManager.cs
+++ Assets/Scripts/InputManager.cs
@@ -68,13 +68,36 @@
             return Mathf.Clamp(angle, min, max);
         }

+        private void SetObjectActive(GameObject objectToSet, bool active)
+        {
+            if (objectToSet != null)
+            {
+                objectToSet.SetActive(active);
+            }
+        }
+
+        private void SetMoveIconActive(bool active)
+        {
+            SetObjectActive(moveIcon, active);
+        }
+
+        private void SetAltitudeIconActive(bool active)
+        {
+            SetObjectActive(altitudeIcon, active);
+        }
+
+        private void SetOrbitIconActive(bool active)
+        {
+            SetObjectActive(orbitIcon, active);
+        }
+
         void Start()
         {
             //Cursor.visible = false;

-            moveIcon.SetActive(false);
-            orbitIcon.SetActive(false);
-            altitudeIcon.SetActive(false);
+            SetMoveIconActive(false);
+            SetOrbitIconActive(false);
+            SetAltitudeIconActive(false);

             enabled = false;
         }
@@ -121,8 +144,8 @@
         private void ProcessOrbitCameraInput()
         {

-            orbitIcon.SetActive(false);
-            moveIcon.SetActive(false);
+            SetOrbitIconActive(false);
+            SetMoveIconActive(false);

             float scrollWheelSpeed = Input.GetAxis("Mouse ScrollWheel");

@@ -134,7 +157,7 @@

             if (scrollWheelSpeed > 0.0f || scrollWheelSpeed < 0.0f)
             {
-                moveIcon.SetActive(true);
+                SetMoveIconActive(true);
             }

             if (Input.GetMouseButton(2))
@@ -148,7 +171,7 @@
                     desiredDistance -= Input.GetAxis("Mouse Y") * Time.deltaTime * zoomRate * 0.125f * Mathf.Abs(desiredDistance);
                 }

-                moveIcon.SetActive(true);
+                SetMoveIconActive(true);
             }
             else if(Input.GetMouseButton(0))
             {
@@ -163,7 +186,7 @@
                 rotation = Quaternion.Lerp(currentRotation, desiredRotation, Time.deltaTime * zoomDampening);
                 transform.rotation = rotation;

-                orbitIcon.SetActive(true);
+                SetOrbitIconActive(true);
             }
             else if (Input.GetMouseButton(1))
             {
@@ -190,7 +213,7 @@
                     target.Translate(forward * panSpeed, Space.World);
                 }

-                moveIcon.SetActive(true);
+                SetMoveIconActive(true);
             }

@@ -213,7 +236,7 @@
                 if (speed < 0.0f)
                 {
                     speed = 0.0f;
-                    moveIcon.SetActive(false);
+                    SetMoveIconActive(false);
                 }
             }

@@ -225,7 +248,7 @@
                 xAxis = (transform.right * -Input.GetAxis("Mouse X") * panSpeed);
                 yAxis = (transform.up * -Input.GetAxis("Mouse Y") * panSpeed);
                 speed = 0.0f;
-                moveIcon.SetActive(true);
+                SetMoveIconActive(true);
             }
             else
             {
@@ -248,7 +271,7 @@

                 if (speed > 0.0f)
                 {
-                    moveIcon.SetActive(true);
+                    SetMoveIconActive(true);
                 }
             }

@@ -276,9 +299,9 @@

                 if (orbitIcon != null)
                 {
-                    moveIcon.SetActive(true);
-                    orbitIcon.SetActive(false);
-                    altitudeIcon.SetActive(false);
+                    SetMoveIconActive(true);
+                    SetOrbitIconActive(false);
+                    SetAltitudeIconActive(false);
                 }
             }

@@ -289,9 +312,9 @@

                 if (orbitIcon != null)
                 {
-                    orbitIcon.SetActive(true);
-                    moveIcon.SetActive(false);
-                    altitudeIcon.SetActive(false);
+                    SetOrbitIconActive(true);
+                    SetMoveIconActive(false);
+                    SetAltitudeIconActive(false);
                 }
             }

@@ -316,18 +339,18 @@

                 if (orbitIcon != null)
                 {
-                    altitudeIcon.SetActive(true);
-                    orbitIcon.SetActive(false);
-                    moveIcon.SetActive(false);
+                    SetAltitudeIconActive(true);
+                    SetOrbitIconActive(false);
+                    SetMoveIconActive(false);
                 }
             }

             if (Input.touchCount == 0 && orbitIcon != null)
             {

-                orbitIcon.SetActive(false);
-                moveIcon.SetActive(false);
-                altitudeIcon.SetActive(false);
+                SetOrbitIconActive(false);
+                SetMoveIconActive(false);
+                SetAltitudeIconActive(false);
             }

             // Limit movement


Made changes in SplitManager to accommodate future Splitting animation.

--- Assets/Scripts/SplitManager.cs
+++ Assets/Scripts/SplitManager.cs
@@ -7,21 +7,20 @@
 public struct SplitGroup {
 	public NetworkIdentity owner;
 	public NetworkIdentity split;
-	public NetworkConnection authorityOwner;
+	public GameUnit ownerUnit;
+	public GameUnit splitUnit;
 	public float elapsedTime;

-	public SplitGroup(NetworkIdentity owner, NetworkIdentity split, NetworkConnection clientAuthorityOwner) {
-		this.owner = owner;
-		this.split = split;
-		this.authorityOwner = clientAuthorityOwner;
+	public SplitGroup(GameUnit ownerUnit, GameUnit splitUnit) {
+		this.ownerUnit = ownerUnit;
+		this.splitUnit = splitUnit;
+		this.owner = ownerUnit.gameObject.GetComponent<NetworkIdentity>();
+		this.split = splitUnit.gameObject.GetComponent<NetworkIdentity>();
 		this.elapsedTime = 0f;
+	}

-		if (this.owner.clientAuthorityOwner != null) {
-			this.owner.RemoveClientAuthority(this.authorityOwner);
-		}
-		if (this.split.clientAuthorityOwner != null) {
-			this.split.RemoveClientAuthority(this.authorityOwner);
-		}
+	public void Update() {
+		Debug.Log("Updating... from Split Group ");
 	}

 	public override string ToString() {
@@ -59,6 +58,7 @@
 				SelectionManager select = manager.GetComponent<SelectionManager>();
 				if (select != null && select.hasAuthority) {
 					this.selectionManager = select;
+					break;
 				}
 			}
 			if (this.selectionManager == null) {
@@ -69,8 +69,9 @@
 			GameObject[] spawners = GameObject.FindGameObjectsWithTag("Spawner");
 			foreach (GameObject obj in spawners) {
 				Spawner spawner = obj.GetComponent<Spawner>();
-				if (spawner.hasAuthority) {
+				if (spawner != null && spawner.hasAuthority) {
 					this.spawner = spawner;
+					break;
 				}
 			}
 			if (this.spawner == null) {
@@ -110,6 +111,7 @@
 				}
 				else {
 					//Some weird C# language design...
+					group.Update();
 					group.elapsedTime += Time.deltaTime / 3f;
 					this.splitGroupList[i] = group;
 				}
@@ -118,7 +120,6 @@

 		if (this.removeList != null && this.removeList.Count > 0) {
 			foreach (SplitGroup group in this.removeList) {
-				Debug.Log("Removing group " + group.ToString());
 				this.splitGroupList.Remove(group);
 			}
 			this.removeList.Clear();
@@ -155,6 +156,7 @@
 		GameUnit original = obj.GetComponent<GameUnit>();
 		GameUnit copy = split.GetComponent<GameUnit>();
 		GameUnit.Copy(original, copy);
+		this.splitGroupList.Add(new SplitGroup(original, copy));
 		this.selectionManager.allObjects.Add(split);
 	}
 }


TestScript2 added

TestScript2 added