Option changes now are committed only if the user clicks "Ok" in the VS settings dialog

--- SuperBookmarks/Options/OptionsPage.cs
+++ SuperBookmarks/Options/OptionsPage.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -12,7 +13,17 @@
     [Guid("BC1182FD-1E47-4616-BFC8-062683FB207A")]
     public class OptionsPage : DialogPage
     {
+        OptionsControl page;
+
         private bool deletingALineDeletesTheBookmark = true;
+        private bool optionsChanged = false;
+        private bool deletingALineDeletesTheBookmarkChanged = false;
+
+        public OptionsPage()
+        {
+            page = new OptionsControl();
+            page.Options = this;
+        }

         public bool DeletingALineDeletesTheBookmark
         {
@@ -23,23 +34,45 @@
             set
             {
                 deletingALineDeletesTheBookmark = value;
-                DeletingALineDeletesTheBookmarkChanged?.Invoke(this, EventArgs.Empty);
-                OptionsChanged?.Invoke(this, EventArgs.Empty);
+                deletingALineDeletesTheBookmarkChanged = true;
+                optionsChanged = true;
             }
         }

         public event EventHandler DeletingALineDeletesTheBookmarkChanged;
         public event EventHandler OptionsChanged;

-        protected override IWin32Window Window
+        protected override void OnApply(PageApplyEventArgs e)
         {
-            get
-            {
-                OptionsControl page = new OptionsControl();
-                page.Options = this;
-                page.Initialize();
-                return page;
-            }
+            if(deletingALineDeletesTheBookmarkChanged)
+                DeletingALineDeletesTheBookmarkChanged?.Invoke(this, EventArgs.Empty);
+
+            if(optionsChanged)
+                OptionsChanged?.Invoke(this, EventArgs.Empty);
+
+            SetAsUnchanged();
+            base.OnApply(e);
         }
+
+        protected override void OnActivate(CancelEventArgs e)
+        {
+            page.Initialize();
+            SetAsUnchanged();
+            base.OnActivate(e);
+        }
+
+        protected override void OnClosed(EventArgs e)
+        {
+            SetAsUnchanged();
+            base.OnClosed(e);
+        }
+
+        private void SetAsUnchanged()
+        {
+            optionsChanged = false;
+            deletingALineDeletesTheBookmarkChanged = false;
+        }
+
+        protected override IWin32Window Window => page;
     }
 }


Use expression body

Use expression body

--- SurveyMonkey/TolerantJsonConverter.cs
+++ SurveyMonkey/TolerantJsonConverter.cs
@@ -17,10 +17,7 @@
             return type.IsEnum || type.IsClass;
         }

-        public override bool CanWrite
-        {
-            get { return false; }
-        }
+        public override bool CanWrite => false;

         public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
         {


Array fix

Array fix

--- Sweet.BRE/ExpEval/Common/StmCommon.cs
+++ Sweet.BRE/ExpEval/Common/StmCommon.cs
@@ -246,7 +246,7 @@
                     // if o2 is array
                     if (o2.GetType().IsArray)
                     {
-                        object[] a2 = (object[])o2;
+                        Array a2 = (Array)o2;

                         foreach (object o3 in a2)
                         {
@@ -263,7 +263,7 @@
             // if o2 is array
             if (o2.GetType().IsArray)
             {
-                object[] a2 = (object[])o2;
+                Array a2 = (Array)o2;

                 // if o1 is not an array
                 if (!o1.GetType().IsArray)
@@ -280,7 +280,7 @@
                 }

                 // if both o1 and o2 is array
-                object[] a1 = (object[])o1;
+                Array a1 = (Array)o1;

                 foreach (object o3 in a1)
                 {


make branches readonly

make branches readonly

--- source/mtee/Model/Tree.cs
+++ source/mtee/Model/Tree.cs
@@ -4,6 +4,7 @@
 // to be bound by the terms of this license. You must not remove this notice, or any other, from this software.

 using System;
+using System.Collections;
 using System.Collections.Generic;

 namespace fitnesse.mtee.model {
@@ -13,11 +14,16 @@
         void WriteSuffix(Tree<T> tree);
     }

+    public interface ReadList<T>: IEnumerable<T> {
+        T this[int index] { get; }
+        int Count { get; }
+    }
+
     public abstract class Tree<T> {
         public abstract T Value { get; }

         public abstract bool IsLeaf { get; }
-        public abstract IList<Tree<T>> Branches { get; }
+        public abstract ReadList<Tree<T>> Branches { get; }

         public IEnumerable<T> Leaves {
             get {
@@ -39,7 +45,7 @@
     }

     public class TreeList<T>: Tree<T> {
-        private readonly List<Tree<T>> list = new List<Tree<T>>();
+        private readonly BranchList<T> list = new BranchList<T>();
         private readonly T aValue;
         public override T Value { get { return aValue; } }

@@ -49,26 +55,34 @@

         public override bool IsLeaf { get { return false; } }

-        public override IList<Tree<T>> Branches { get { return list; } }
+        public override ReadList<Tree<T>> Branches { get { return list; } }

         public TreeList<T> AddBranchValue(object value) {
-            Branches.Add(value as Tree<T> ?? new TreeLeaf<T>((T)value));
+            list.Add(value as Tree<T> ?? new TreeLeaf<T>((T)value));
             return this;
         }

         public TreeList<T> AddBranch(Tree<T> value) {
-            Branches.Add(value);
+            list.Add(value);
             return this;
         }
+
+    }
+
+    public class BranchList<T>: ReadList<Tree<T>> {
+        private readonly List<Tree<T>> branches = new List<Tree<T>>();
+        public void Add(Tree<T> item) { branches.Add(item); }
+        public IEnumerator<Tree<T>> GetEnumerator() { return branches.GetEnumerator(); }
+        IEnumerator IEnumerable.GetEnumerator() { return branches.GetEnumerator(); }
+        public Tree<T> this[int index] { get { return branches[index]; } }
+        public int Count { get { return branches.Count; } }
     }

     public class TreeLeaf<T>: Tree<T> {
         private readonly T aValue;
         public override T Value { get { return aValue; } }
         public TreeLeaf(T value) { aValue = value; }
-
         public override bool IsLeaf { get { return true; } }
-
-        public override IList<Tree<T>> Branches { get { throw new InvalidOperationException(); } }
+        public override ReadList<Tree<T>> Branches { get { throw new InvalidOperationException(); } }
     }
 }


Work on recovery.

Work on recovery.

--- N2.Visualizer/Recovery.cs
+++ N2.Visualizer/Recovery.cs
@@ -65,13 +65,17 @@

       FixAst(parser);

-      parser.MaxFailPos = _bestResult.EndPos; // HACK!!!
+      if (_bestResult != null)
+        parser.MaxFailPos = _bestResult.EndPos; // HACK!!!

       Reset();
     }

     private void FixAst(Parser parser)
     {
+      if (_bestResult == null)
+        return;
+
       var frame = _bestResult.Stack.Head;

       if (frame.AstStartPos < 0)
@@ -219,8 +223,8 @@

       //if (stack.Head.AstPtr == 0 && _bestResult.Stack.Head.AstPtr != 0) return;

-      if (stackLength > bestResultStackLength) goto good;
-      if (stackLength < bestResultStackLength)    return;
+      if (stackLength < bestResultStackLength) goto good;
+      if (stackLength > bestResultStackLength)    return;

       if (startState < _bestResult.StartState) goto good;
       if (startState > _bestResult.StartState) return;


Reduce the size of the file for ImageSharp.

--- NetCore/LoadResizeSave.cs
+++ NetCore/LoadResizeSave.cs
@@ -85,6 +85,9 @@
                             Mode = ResizeMode.Max
                         });

+                    // Reduce the size of the file
+                    image.ExifProfile = null;
+
                     // Save the results
                     image.Save(output);
                 }


bugfix: setter removed

bugfix: setter removed

--- Octokit/Http/RateLimit.cs
+++ Octokit/Http/RateLimit.cs
@@ -110,7 +110,7 @@
             {
                 Limit = this.Limit,
                 Remaining = this.Remaining,
-                ResetAsUtcEpochSeconds = this.ResetAsUtcEpochSeconds
+                Reset = this.Reset
             };
         }


#3

#3

CreateExtsTest

--- Dot.Net.DevFast/Dot.Net.DevFast.Tests/Extensions/CreateExtsTest.cs
+++ Dot.Net.DevFast/Dot.Net.DevFast.Tests/Extensions/CreateExtsTest.cs
@@ -155,7 +155,82 @@
         }

         [Test]
-        public void String_N_StringBuilder_Based_StringWriter_N_JsonTextWriter_Works_As_Expected()
+        public void StringBuilder_Based_StringWriter_N_JsonTextWriter_Works_As_Expected()
+        {
+            var sb = new StringBuilder();
+            using (var writer = sb.CreateWriter())
+            {
+                Assert.True(writer.Encoding.WebName.Equals(Encoding.Unicode.WebName));
+                Assert.True(ReferenceEquals(writer.GetStringBuilder(), sb));
+                writer.Write("testing");
+            }
+            Assert.True(sb.ToString().Equals("testing"));
+            sb.Clear();
+            using (var jsonWriter = sb.CreateJsonWriter())
+            {
+                Assert.True(ReferenceEquals(jsonWriter.Culture, CultureInfo.CurrentCulture));
+                Assert.True(jsonWriter.DateFormatHandling.Equals(DateFormatHandling.IsoDateFormat));
+                Assert.True(jsonWriter.DateFormatString.Equals("yyyy-MM-dd HH:mm:ss"));
+                Assert.True(jsonWriter.DateTimeZoneHandling.Equals(DateTimeZoneHandling.Utc));
+                Assert.True(jsonWriter.FloatFormatHandling.Equals(FloatFormatHandling.DefaultValue));
+                Assert.True(jsonWriter.Formatting.Equals(Formatting.None));
+                Assert.True(jsonWriter.StringEscapeHandling.Equals(StringEscapeHandling.Default));
+                Assert.True(jsonWriter.CloseOutput);
+                Assert.False(jsonWriter.Path.Equals(null));
+                jsonWriter.WriteStartArray();
+                jsonWriter.WriteEndArray();
+            }
+            Assert.True(sb.ToString().Equals("[]"));
+        }
+
+        [Test]
+        public void String_N_StringBuilder_Based_StringReader_N_JsonTextReader_Works_As_Expected()
+        {
+            var sb = new StringBuilder("testing");
+            using (var reader = sb.CreateReader())
+            {
+                Assert.True(reader.ReadToEnd().Equals("testing"));
+            }
+            using (var reader = sb.ToString().CreateReader())
+            {
+                Assert.True(reader.ReadToEnd().Equals("testing"));
+            }
+            sb.Clear();
+            sb.Append("[]");
+            using (var jsonReader = sb.CreateJsonReader())
+            {
+                Assert.True(ReferenceEquals(jsonReader.Culture, CultureInfo.CurrentCulture));
+                Assert.True(jsonReader.DateParseHandling.Equals(DateParseHandling.DateTime));
+                Assert.True(jsonReader.DateFormatString.Equals("yyyy-MM-dd HH:mm:ss"));
+                Assert.True(jsonReader.DateTimeZoneHandling.Equals(DateTimeZoneHandling.Utc));
+                Assert.True(jsonReader.FloatParseHandling.Equals(FloatParseHandling.Double));
+                Assert.True(jsonReader.MaxDepth.Equals(null));
+                Assert.True(jsonReader.CloseInput);
+                Assert.True(jsonReader.Read());
+                Assert.True(jsonReader.TokenType.Equals(JsonToken.StartArray));
+                Assert.True(jsonReader.Read());
+                Assert.True(jsonReader.TokenType.Equals(JsonToken.EndArray));
+                Assert.False(jsonReader.Read());
+            }
+            using (var jsonReader = sb.ToString().CreateJsonReader())
+            {
+                Assert.True(ReferenceEquals(jsonReader.Culture, CultureInfo.CurrentCulture));
+                Assert.True(jsonReader.DateParseHandling.Equals(DateParseHandling.DateTime));
+                Assert.True(jsonReader.DateFormatString.Equals("yyyy-MM-dd HH:mm:ss"));
+                Assert.True(jsonReader.DateTimeZoneHandling.Equals(DateTimeZoneHandling.Utc));
+                Assert.True(jsonReader.FloatParseHandling.Equals(FloatParseHandling.Double));
+                Assert.True(jsonReader.MaxDepth.Equals(null));
+                Assert.True(jsonReader.CloseInput);
+                Assert.True(jsonReader.Read());
+                Assert.True(jsonReader.TokenType.Equals(JsonToken.StartArray));
+                Assert.True(jsonReader.Read());
+                Assert.True(jsonReader.TokenType.Equals(JsonToken.EndArray));
+                Assert.False(jsonReader.Read());
+            }
+        }
+
+        [Test]
+        public void Stream_Based_CreateReader_CreateWriter_Works_As_Expected()
         {
             using (var writer = Stream.Null.CreateWriter(Encoding.UTF32))
             {
@@ -163,42 +238,39 @@
                 Assert.True(ReferenceEquals(writer.BaseStream, Stream.Null));
                 Assert.True(writer.AutoFlush);
             }
-        }
-
-        [Test]
-        public void Stream_Based_CreateWriter_Works_As_Expected()
-        {
-            using (var writer = Stream.Null.CreateWriter(Encoding.UTF32))
-            {
-                Assert.True(writer.Encoding.WebName.Equals(Encoding.UTF32.WebName));
-                Assert.True(ReferenceEquals(writer.BaseStream, Stream.Null));
-                Assert.True(writer.AutoFlush);
-            }
-        }
-
-        [Test]
-        public void CreateReader_Works_As_Expected()
-        {
-            using (var memStream = new MemoryStream())
-            {
-                using (var reader = memStream.CreateReader(Encoding.UTF32))
-                {
-                    Assert.True(ReferenceEquals(reader.BaseStream, memStream));
-                    Assert.True(reader.CurrentEncoding.WebName.Equals(Encoding.UTF32.WebName));
-                }
-            }
-        }
-
-        [Test]
-        public void StringBuilder_Based_CreateWriter_Works_As_Expected()
-        {
-            var val = "Ticks:" + DateTime.Now.Ticks;
-            var sb = new StringBuilder();
-            using (var writer = sb.CreateWriter())
-            {
-                writer.Write(val);
-            }
-            Assert.True(sb.ToString().Equals(val));
+            using (var reader = Stream.Null.CreateReader(Encoding.UTF32))
+            {
+                Assert.True(ReferenceEquals(reader.BaseStream, Stream.Null));
+                Assert.True(reader.CurrentEncoding.WebName.Equals(Encoding.UTF32.WebName));
+            }
+        }
+
+        [Test]
+        public void Stream_Based_CreateJsonReader_CreateJsonWriter_Works_As_Expected()
+        {
+            using (var jsonReader = Stream.Null.CreateJsonReader(Encoding.UTF32))
+            {
+                Assert.True(ReferenceEquals(jsonReader.Culture, CultureInfo.CurrentCulture));
+                Assert.True(jsonReader.DateParseHandling.Equals(DateParseHandling.DateTime));
+                Assert.True(jsonReader.DateFormatString.Equals("yyyy-MM-dd HH:mm:ss"));
+                Assert.True(jsonReader.DateTimeZoneHandling.Equals(DateTimeZoneHandling.Utc));
+                Assert.True(jsonReader.FloatParseHandling.Equals(FloatParseHandling.Double));
+                Assert.True(jsonReader.MaxDepth.Equals(null));
+                Assert.True(jsonReader.CloseInput);
+                Assert.False(jsonReader.Read());
+            }
+            using (var jsonWriter = Stream.Null.CreateJsonWriter(Encoding.UTF32))
+            {
+                Assert.True(ReferenceEquals(jsonWriter.Culture, CultureInfo.CurrentCulture));
+                Assert.True(jsonWriter.DateFormatHandling.Equals(DateFormatHandling.IsoDateFormat));
+                Assert.True(jsonWriter.DateFormatString.Equals("yyyy-MM-dd HH:mm:ss"));
+                Assert.True(jsonWriter.DateTimeZoneHandling.Equals(DateTimeZoneHandling.Utc));
+                Assert.True(jsonWriter.FloatFormatHandling.Equals(FloatFormatHandling.DefaultValue));
+                Assert.True(jsonWriter.Formatting.Equals(Formatting.None));
+                Assert.True(jsonWriter.StringEscapeHandling.Equals(StringEscapeHandling.Default));
+                Assert.True(jsonWriter.CloseOutput);
+                Assert.False(jsonWriter.Path.Equals(null));
+            }
         }

         [Test]


Updated version.

Updated version.

--- DataTables.Queryable/Properties/AssemblyInfo.cs
+++ DataTables.Queryable/Properties/AssemblyInfo.cs
@@ -28,6 +28,6 @@
 //      Minor Version
 //      Build Number

-[assembly: AssemblyVersion("1.2.0")]
-[assembly: AssemblyFileVersion("1.2.0")]
-[assembly: AssemblyInformationalVersion("1.2.0")]
+[assembly: AssemblyVersion("1.3.0")]
+[assembly: AssemblyFileVersion("1.3.0")]
+[assembly: AssemblyInformationalVersion("1.3.0")]


If the merged row is yielded and the caller immediately asks for another row, the enumerator is never advanced. Don't yield until the enumerator has been advanced.

--- Rhino.Etl.Core/Operations/SortMergeJoinOperation.cs
+++ Rhino.Etl.Core/Operations/SortMergeJoinOperation.cs
@@ -63,10 +63,11 @@
             while (leftRow != null && rightRow != null)
             {
                 var match = MatchJoinCondition(leftRow, rightRow);
+                Row mergedRow = null;

                 if (match == 0)
                 {
-                    yield return MergeRows(leftRow, rightRow);
+                    mergedRow = MergeRows(leftRow, rightRow);
                     leftRows.MoveNext();
                     leftRow = (Row)leftRows.Current;
                     rightRows.MoveNext();
@@ -75,7 +76,7 @@
                 else if (match < 0)
                 {
                     if ((JoinType & JoinType.Left) != 0)
-                        yield return MergeRows(leftRow, new Row());
+                        mergedRow = MergeRows(leftRow, new Row());
                     else
                         LeftOrphanRow(leftRow);

@@ -85,13 +86,16 @@
                 else if (match > 0)
                 {
                     if ((JoinType & JoinType.Right) != 0)
-                        yield return MergeRows(new Row(), rightRow);
+                        mergedRow = MergeRows(new Row(), rightRow);
                     else
                         RightOrphanRow(rightRow);

                     rightRows.MoveNext();
                     rightRow = (Row) rightRows.Current;
                 }
+
+                if (mergedRow != null)
+                    yield return mergedRow;
             }

             if (leftRow == null && rightRow != null && (JoinType & JoinType.Right) != 0)


refresh treeview

refresh treeview

--- Demos/CSharpGL.SceneEditor/FormMain.Designer.cs
+++ Demos/CSharpGL.SceneEditor/FormMain.Designer.cs
@@ -68,6 +68,7 @@
             this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
             this.关于AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+            this.lblTimerEnabled = new System.Windows.Forms.ToolStripStatusLabel();
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();
             this.splitContainer2 = new System.Windows.Forms.SplitContainer();
             this.treeView1 = new System.Windows.Forms.TreeView();
@@ -77,10 +78,10 @@
             this.addScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.deleteScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
+            this.glCanvas1 = new CSharpGL.GLCanvas();
             this.dlgSaveFile = new System.Windows.Forms.SaveFileDialog();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
-            this.glCanvas1 = new CSharpGL.GLCanvas();
-            this.lblTimerEnabled = new System.Windows.Forms.ToolStripStatusLabel();
+            this.refreshTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.menuStrip1.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -403,6 +404,12 @@
             this.statusStrip1.TabIndex = 1;
             this.statusStrip1.Text = "statusStrip1";
             //
+            // lblTimerEnabled
+            //
+            this.lblTimerEnabled.Name = "lblTimerEnabled";
+            this.lblTimerEnabled.Size = new System.Drawing.Size(15, 20);
+            this.lblTimerEnabled.Text = "-";
+            //
             // splitContainer1
             //
             this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -462,34 +469,35 @@
             this.addSceneObjectToolStripMenuItem,
             this.deleteToolStripMenuItem,
             this.addScriptToolStripMenuItem,
-            this.deleteScriptToolStripMenuItem});
+            this.deleteScriptToolStripMenuItem,
+            this.refreshTreeToolStripMenuItem});
             this.treeNodeContextMenu.Name = "treeNodeContextMenu";
-            this.treeNodeContextMenu.Size = new System.Drawing.Size(180, 108);
+            this.treeNodeContextMenu.Size = new System.Drawing.Size(182, 162);
             //
             // addSceneObjectToolStripMenuItem
             //
             this.addSceneObjectToolStripMenuItem.Name = "addSceneObjectToolStripMenuItem";
-            this.addSceneObjectToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.addSceneObjectToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.addSceneObjectToolStripMenuItem.Text = "3D Object";
             //
             // deleteToolStripMenuItem
             //
             this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
-            this.deleteToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.deleteToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.deleteToolStripMenuItem.Text = "Delete";
             this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
             //
             // addScriptToolStripMenuItem
             //
             this.addScriptToolStripMenuItem.Name = "addScriptToolStripMenuItem";
-            this.addScriptToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.addScriptToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.addScriptToolStripMenuItem.Text = "Add Script";
             this.addScriptToolStripMenuItem.Click += new System.EventHandler(this.addScriptToolStripMenuItem_Click);
             //
             // deleteScriptToolStripMenuItem
             //
             this.deleteScriptToolStripMenuItem.Name = "deleteScriptToolStripMenuItem";
-            this.deleteScriptToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.deleteScriptToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.deleteScriptToolStripMenuItem.Text = "Delete Script";
             this.deleteScriptToolStripMenuItem.Click += new System.EventHandler(this.deleteScriptToolStripMenuItem_Click);
             //
@@ -500,18 +508,6 @@
             this.propertyGrid1.Name = "propertyGrid1";
             this.propertyGrid1.Size = new System.Drawing.Size(420, 499);
             this.propertyGrid1.TabIndex = 0;
-            //
-            // dlgSaveFile
-            //
-            this.dlgSaveFile.DefaultExt = "png";
-            this.dlgSaveFile.FileName = "*.png";
-            this.dlgSaveFile.Filter = "(*.png)|*.png";
-            this.dlgSaveFile.RestoreDirectory = true;
-            //
-            // timer1
-            //
-            this.timer1.Interval = 40;
-            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
             //
             // glCanvas1
             //
@@ -524,11 +520,24 @@
             this.glCanvas1.Size = new System.Drawing.Size(954, 823);
             this.glCanvas1.TabIndex = 0;
             //
-            // lblTimerEnabled
-            //
-            this.lblTimerEnabled.Name = "lblTimerEnabled";
-            this.lblTimerEnabled.Size = new System.Drawing.Size(15, 20);
-            this.lblTimerEnabled.Text = "-";
+            // dlgSaveFile
+            //
+            this.dlgSaveFile.DefaultExt = "png";
+            this.dlgSaveFile.FileName = "*.png";
+            this.dlgSaveFile.Filter = "(*.png)|*.png";
+            this.dlgSaveFile.RestoreDirectory = true;
+            //
+            // timer1
+            //
+            this.timer1.Interval = 40;
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+            //
+            // refreshTreeToolStripMenuItem
+            //
+            this.refreshTreeToolStripMenuItem.Name = "refreshTreeToolStripMenuItem";
+            this.refreshTreeToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
+            this.refreshTreeToolStripMenuItem.Text = "Refresh Tree";
+            this.refreshTreeToolStripMenuItem.Click += new System.EventHandler(this.refreshTreeToolStripMenuItem_Click);
             //
             // FormMain
             //
@@ -613,5 +622,6 @@
         private System.Windows.Forms.ToolStripMenuItem sceneObjectsMonitorToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem deleteScriptToolStripMenuItem;
         private System.Windows.Forms.ToolStripStatusLabel lblTimerEnabled;
+        private System.Windows.Forms.ToolStripMenuItem refreshTreeToolStripMenuItem;
     }
 }


Added new loading bar that Sam made.  Added temporary scene to delete the layout that's stored in player prefs

--- Scripts/DependencyInjection/Main/CompositionRoot.cs
+++ Scripts/DependencyInjection/Main/CompositionRoot.cs
@@ -101,11 +101,16 @@
         {
             InjectStartingMonoBehaviours();

-            _dependencyRoot = _container.Resolve<IDependencyRoot>();
+            _dependencyRoot = _container.TryResolve<IDependencyRoot>();

-            Assert.That(_dependencyRoot != null, "No dependency root found.");
-
-            _dependencyRoot.Start();
+            if (_dependencyRoot == null)
+            {
+                Log.Warn("No dependency root found");
+            }
+            else
+            {
+                _dependencyRoot.Start();
+            }
         }
     }
 }


艦隊：タブアイコンが艦隊状態と異なるものになる不具合を修正

艦隊：タブアイコンが艦隊状態と異なるものになる不具合を修正

--- ElectronicObserver/Window/Control/FleetState.cs
+++ ElectronicObserver/Window/Control/FleetState.cs
@@ -51,9 +51,13 @@
 				}
 			}

+			private bool _enabled;
 			public bool Enabled {
-				get { return Label.Visible; }
-				set { Label.Visible = value; }
+				get { return _enabled; }
+				set {
+					_enabled = value;
+					Label.Visible = value;
+				}
 			}

@@ -428,7 +432,8 @@
 		}

 		public int GetIconIndex() {
-			return StateLabels.OrderBy( s => s.State ).First().Label.ImageIndex;
+			var first = StateLabels.Where( s => s.Enabled ).OrderBy( s => s.State ).FirstOrDefault();
+			return first == null ? (int)ResourceManager.IconContent.FormFleet : first.Label.ImageIndex;
 		}

 	}


This is always supported now

This is always supported now

--- ExpressionToCodeTest/StringInterpolationTest.cs
+++ ExpressionToCodeTest/StringInterpolationTest.cs
@@ -1,5 +1,4 @@
-#if formattable_string
-using System;
+using System;
 using ExpressionToCodeLib;
 using System.Collections.Generic;
 using System.Linq;
@@ -163,4 +162,3 @@
         }
     }
 }
-#endif


Just some style changes.

Just some style changes.

--- ExtendedPublicTransportUI/UITransportLineRow.cs
+++ ExtendedPublicTransportUI/UITransportLineRow.cs
@@ -83,7 +83,7 @@
             base.Start();

             _checkBox.relativePosition = new Vector3(5, 0);
-            _color.relativePosition = new Vector3(22, -1.5f);
+            _color.relativePosition = new Vector3(22, 0);
             _name.relativePosition = new Vector3(43, 0);
             _stops.relativePosition = new Vector3(170, 0);
             _passengers.relativePosition = new Vector3(225, 0);
@@ -145,21 +145,20 @@
             _trips.textScale = 0.8f;
             _vehicles.textScale = 0.8f;

-			//zebra stripes background
-			this.backgroundSprite = "GenericPanelLight";
-			if(IsOdd) {
-				this.color = new Color32(150,150,150,255);
-			} else {
-				this.color = new Color32(130,130,130,255);
-			}
+			// zebra stripes background
+			backgroundSprite = "GenericPanelLight";
+            if (IsOdd)
+                color = new Color32(150, 150, 150, 255);
+            else
+                color = new Color32(130, 130, 130, 255);

-			//center elements in row
-			UIComponent[] children = this.GetComponentsInChildren<UIComponent>();
+            // center elements in row
+			UIComponent[] children = GetComponentsInChildren<UIComponent>();
 			foreach (UIComponent child in children) {
 				if(child == this) continue;

 				child.pivot = UIPivotPoint.MiddleLeft;
-				child.transformPosition = new Vector3(child.transformPosition.x, this.GetBounds().center.y,0);
+				child.transformPosition = new Vector3(child.transformPosition.x, GetBounds().center.y, 0);
 			}
         }


changed default to LZ4FrameBlockSize.Max1MB

--- lz4.AnyCpu.loader/LZ4Stream.cs
+++ lz4.AnyCpu.loader/LZ4Stream.cs
@@ -25,7 +25,7 @@

 		private LZ4Stream() { }

-		public static LZ4Stream CreateCompressor(Stream innerStream, LZ4StreamMode streamMode, LZ4FrameBlockMode blockMode = LZ4FrameBlockMode.Linked, LZ4FrameBlockSize blockSize = LZ4FrameBlockSize.Max64KB, LZ4FrameChecksumMode checksumMode = LZ4FrameChecksumMode.Content, long? maxFrameSize = null, bool leaveInnerStreamOpen = false) {
+		public static LZ4Stream CreateCompressor(Stream innerStream, LZ4StreamMode streamMode, LZ4FrameBlockMode blockMode = LZ4FrameBlockMode.Linked, LZ4FrameBlockSize blockSize = LZ4FrameBlockSize.Max1MB, LZ4FrameChecksumMode checksumMode = LZ4FrameChecksumMode.Content, long? maxFrameSize = null, bool leaveInnerStreamOpen = false) {
 			var s = LZ4Loader.CreateCompressor()(innerStream, streamMode, blockMode, blockSize, checksumMode, maxFrameSize, leaveInnerStreamOpen);
 			var r = new LZ4Stream();
 			r._innerStream = s;


fixed export auth rules path

fixed export auth rules path

--- Signum.Engine.Extensions/Authorization/AuthLogic.cs
+++ Signum.Engine.Extensions/Authorization/AuthLogic.cs
@@ -615,7 +615,7 @@
                 Console.WriteLine("Sucesfully exported to {0}".FormatWith(fileName));

                 if (SafeConsole.Ask("Publish to Load?"))
-                    File.Copy(fileName, "../../" + Path.GetFileName(fileName), overwrite: true);
+                    File.Copy(fileName, "../../../" + Path.GetFileName(fileName), overwrite: true);
             };

             syncRoles = () =>


Fix AuthManager IsAuthenticated restoration.

--- Phoebe/Net/AuthManager.cs
+++ Phoebe/Net/AuthManager.cs
@@ -20,6 +20,7 @@
             try {
                 UserId = credStore.UserId;
                 Token = credStore.ApiToken;
+                IsAuthenticated = !String.IsNullOrEmpty (Token);
             } catch (ArgumentException) {
                 // When data is corrupt and cannot find user
                 credStore.UserId = null;


remove unused field

remove unused field

--- Signum.Engine/Linq/ExpressionVisitor/QueryBinder.cs
+++ Signum.Engine/Linq/ExpressionVisitor/QueryBinder.cs
@@ -2375,11 +2375,10 @@
         ColumnGenerator columnGenerator = new ColumnGenerator();

         Dictionary<string, Dictionary<Type, Expression>> declarations = new Dictionary<string, Dictionary<Type, Expression>>();
-        private ImplementedByExpression ib;

         public UnionAllRequest(ImplementedByExpression ib)
         {
-          this.OriginalImplementedBy  = ib;
+            this.OriginalImplementedBy = ib;
         }

         public override string ToString()


Bugfix: Tap to Scroll, funzte nach start beim ersten Tag nicht

--- Pocal/ViewModel/MainVM.cs
+++ Pocal/ViewModel/MainVM.cs
@@ -45,7 +45,7 @@
             {
                 await createAllPocalApptointments();
                 createDays();
-                SingleDayViewModel.TappedDay = Days[0];
+                //SingleDayViewModel.TappedDay = Days[0]; Nur unkommentieren, wenn SDV beim start geöffnet wird. Sonst funzt tapAndScroll nicht.
             }

         }
@@ -250,7 +250,8 @@

-                SingleDayViewModel.TappedDay = Days[1];
+
+                SingleDayViewModel.TappedDay = Days[1];
                 CurrentTop = new Day { DT = dt.AddHours(24) };

             }


fix CustomToStr

fix CustomToStr

--- Signum.Engine/Linq/ExpressionVisitor/QueryBinder.cs
+++ Signum.Engine/Linq/ExpressionVisitor/QueryBinder.cs
@@ -1130,7 +1130,7 @@
                 {
                     LiteReferenceExpression lite = (LiteReferenceExpression)source;

-                    var toStr = BindMethodCall(Expression.Call(lite.Reference, EntityExpression.ToStringMethod));
+                    var toStr = lite.CustomToStr ?? BindMethodCall(Expression.Call(lite.Reference, EntityExpression.ToStringMethod));

                     return toStr;
                 }
@@ -1791,7 +1791,7 @@

                 Expression entity = EntityCasting(lite.Reference, Lite.Extract(uType));

-                return MakeLite(entity, null);
+                return MakeLite(entity, lite.CustomToStr);
             }

             return null;


Add support for custom, keyframed easing functions

--- PowerArgs/CLI/Animator.cs
+++ PowerArgs/CLI/Animator.cs
@@ -297,4 +297,31 @@
             }
         }
     }
+
+    public class CustomEase
+    {
+        private float[] keyFrames;
+        public CustomEase(float[] keyFrames)
+        {
+            this.keyFrames = keyFrames;
+        }
+
+        public float Ease(float percentage)
+        {
+            var rawIndex = (keyFrames.Length - 1) * percentage;
+            if (rawIndex == (int)rawIndex)
+            {
+                return keyFrames[(int)rawIndex];
+            }
+            else
+            {
+                var splitLocation = rawIndex - (int)rawIndex;
+                var previousKeyFrame = keyFrames[(int)rawIndex];
+                var nextKeyFrame = keyFrames[(int)rawIndex+1];
+                var nextFrameDelta = nextKeyFrame - previousKeyFrame;
+                var interpolationAmount = splitLocation * nextFrameDelta;
+                return previousKeyFrame + interpolationAmount;
+            }
+        }
+    }
 }


fix ToString(separator) with null element

--- Signum.Utilities/Extensions/EnumerableExtensions.cs
+++ Signum.Utilities/Extensions/EnumerableExtensions.cs
@@ -491,7 +491,7 @@
                 else
                     sb.Append(separator);

-                sb.Append(item!.ToString());
+                sb.Append(item?.ToString());
             }

             if (sb == null)


Adds AutoRotate property into PdfPrintDocument

--- Print/PdfPrintDocument.cs
+++ Print/PdfPrintDocument.cs
@@ -16,8 +16,14 @@
 		IntPtr _printHandle;
 		IntPtr _docForPrint;
 		bool _useDP;
-		bool _autoRotate = true;
 		#endregion;
+
+		#region Public properties
+		/// <summary>
+		/// Automatically rotate pages when printing
+		/// </summary>
+		public bool AutoRotate { get; set; }
+		#endregion

 		#region Constructors, destructors and initialization
 		/// <summary>
@@ -32,6 +38,7 @@

 			_pdfDoc = Document;
 			_useDP = (mode==1);
+			AutoRotate = true;

 			PrinterSettings.MinimumPage = 1;
 			PrinterSettings.MaximumPage = _pdfDoc.Pages.Count;
@@ -76,7 +83,6 @@
 			_pageForPrint = _useDP ? 0 : PrinterSettings.FromPage-1;
 		}

-
 		/// <summary>
 		/// Raises the System.Drawing.Printing.PrintDocument.EndPrint event. It is called
 		/// when the last page of the document has printed.
@@ -198,9 +204,9 @@
 			var rot = Pdfium.FPDFPage_GetRotation(currentPage);
 			bool isRotated = (rot == PageRotate.Rotate270 || rot == PageRotate.Rotate90);

-			if (_autoRotate && isRotated)
+			if (AutoRotate && isRotated)
 				fitSize = new SizeF(fitSize.Height, fitSize.Width);
-			else if (!_autoRotate && isLandscape)
+			else if (!AutoRotate && isLandscape)
 				fitSize = new SizeF(fitSize.Height, fitSize.Width);

 			var sz = GetRenderSize(pageSize, fitSize);
@@ -213,12 +219,12 @@
 			var rot = Pdfium.FPDFPage_GetRotation(currentPage);
 			bool isRotated = (rot == PageRotate.Rotate270 || rot == PageRotate.Rotate90);

-			if (_autoRotate && isRotated != isLandscape)
+			if (AutoRotate && isRotated != isLandscape)
 			{
 				double tmp = width;
 				width = height;
 				height = tmp;
-				return PageRotate.Rotate90;
+				return rot == PageRotate.Rotate270 ? PageRotate.Rotate90 : PageRotate.Rotate270;
 			}
 			return PageRotate.Normal;
 		}


don't add disposable to keep last selection

--- SolidworksAddinFramework/PropertyManagerPageBase.cs
+++ SolidworksAddinFramework/PropertyManagerPageBase.cs
@@ -619,7 +619,7 @@
                 .Select(p => p.value)
                 .Subscribe(onTargetChanged);

-            var disposable = new SerialDisposable();
+            var disposable = new SerialDisposable(); //don't add to CompositeDisposable because we want to keep the last selection
             var d1 = sourceObservable
                 .Subscribe(s =>
                 {
@@ -630,7 +630,7 @@
                         disposable.Disposable = onSourceChanged(s);
                     }
                 });
-            return new CompositeDisposable(canSetSelectionSubject, d0, d1, disposable);
+            return new CompositeDisposable(canSetSelectionSubject, d0, d1);
         }

         private void SetSelection<TModel>(IPropertyManagerPageSelectionbox box, swSelectType_e selectType, TModel model, Expression<Func<TModel, SelectionData>> propertyExpr)


(maint) Corrected whitespace

(maint) Corrected whitespace

--- Source/ChocolateyGui/Startup/ChocolateyGuiModule.cs
+++ Source/ChocolateyGui/Startup/ChocolateyGuiModule.cs
@@ -71,6 +71,7 @@
             {
                 config.CreateMap<IPackageViewModel, IPackageViewModel>()
                     .ForMember(vm => vm.IsInstalled, options => options.Ignore());
+
                 // TODO: config.CreateMap<Package, IPackageViewModel>().ConstructUsing(rc => container.Resolve<IPackageViewModel>());
                 config.CreateMap<IPackage, Package>();
                 config.CreateMap<ConfigFileFeatureSetting, ChocolateyFeature>();


Added test to check that importing a DLL twice works

--- Source/ReferenceTests/Commands/ImportModuleTests.cs
+++ Source/ReferenceTests/Commands/ImportModuleTests.cs
@@ -27,6 +27,17 @@
         {
             var cmd = "Import-Module '" + BinaryTestModule + "'; " + CmdletName(typeof(TestCommand));
             ExecuteAndCompareTypedResult(cmd, TestCommand.OutputString);
+        }
+
+        [Test]
+        public void ImportingAssemblyModuleTwiceDoesntThrow()
+        {
+            var cmd = NewlineJoin(
+                "$m1 = Import-Module '" + BinaryTestModule + "' -PassThru",
+                "$m2 = Import-Module '" + BinaryTestModule + "' -PassThru",
+                "[object]::ReferenceEquals($m1, $m2)"
+            );
+            ExecuteAndCompareTypedResult(cmd, true);
         }

         [Test]


Added file header.

Added file header.

Signed-off-by: Tim Shearouse <22770654cc090bbab2a95c165ccc489291293cdd@JohnDeere.com>

--- source/ADAPT/PluginProperties/LatencySettings.cs
+++ source/ADAPT/PluginProperties/LatencySettings.cs
@@ -1,4 +1,15 @@
-namespace AgGateway.ADAPT.ApplicationDataModel.PluginProperties
+/*******************************************************************************
+  * Copyright (C) 2015 AgGateway and ADAPT Contributors
+  * Copyright (C) 2015 Deere and Company
+  * All rights reserved. This program and the accompanying materials
+  * are made available under the terms of the Eclipse Public License v1.0
+  * which accompanies this distribution, and is available at
+  * http://www.eclipse.org/legal/epl-v10.html <http://www.eclipse.org/legal/epl-v10.html>
+  *
+  * Contributors:
+  *    Tim Shearouse - initial API and implementation
+  *******************************************************************************/
+namespace AgGateway.ADAPT.ApplicationDataModel.PluginProperties
 {
     public class LatencySettings
     {


Restored panel refresh.

Restored panel refresh.

--- JexusManager/MainForm.cs
+++ JexusManager/MainForm.cs
@@ -855,11 +855,8 @@

         private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
         {
-            if (treeView1.SelectedNode != e.Node)
-            {
-                treeView1.SelectedNode = null;
-                treeView1.SelectedNode = e.Node;
-            }
+            treeView1.SelectedNode = null;
+            treeView1.SelectedNode = e.Node;

             if (e.Node is HomePageTreeNode)
             {


update test

update test

--- Tests/Linq/UserTests/Issue825Tests.cs
+++ Tests/Linq/UserTests/Issue825Tests.cs
@@ -2,8 +2,10 @@
 using LinqToDB.Common;
 using LinqToDB.Data;
 using LinqToDB.Linq;
+using LinqToDB.Mapping;
 using NUnit.Framework;
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using Tests.Model;

@@ -12,25 +14,74 @@
 	[TestFixture]
 	public class Issue825Tests : TestBase
 	{
+		[Table(Name = "Child")]
+		public class Child825
+		{
+			[PrimaryKey, Identity, Column("ChildID")]
+			public int Id { get; set; }
+
+			[Column("ParentID"), NotNull]
+			public int ParentId { get; set; }
+
+			[Association(ThisKey = "ParentId", OtherKey = "Id", CanBeNull = false)]
+			public Parent825 Parent { get; set; }
+		}
+
+		[Table(Name = "Parent")]
+		public class Parent825
+		{
+			[PrimaryKey, Identity, Column("ParentID")]
+			public int Id { get; set; }
+
+			[Association(ThisKey = "Id", OtherKey = "ParentId", CanBeNull = true, IsBackReference = true)]
+			public IList<ParentPermission> ParentPermissions { get; set; }
+
+			[Association(ThisKey = "Id", OtherKey = "ParentId", CanBeNull = true, IsBackReference = true)]
+			public IList<Child825> Childs { get; set; }
+		}
+
+		[Table(Name = "GrandChild")]
+		public class ParentPermission
+		{
+			[PrimaryKey, Identity, Column("GrandChildID")]
+			public int Id { get; set; }
+
+			[Column("ParentID"), NotNull]
+			public int ParentId { get; set; }
+
+			[Column("ChildID"), NotNull]
+			public int UserId { get; set; }
+		}
+
 		[Test, DataContextSource]
-		public void TestCount(string context)
+		public void Test(string context)
 		{
 			using (var db = GetDataContext(context))
 			{
-				var grandChildId = 322;
+				var userId = 32;
 				var childId = 32;

-				var query = db.Parent
-					.Where(p => p.GrandChildren.Any(g => g.GrandChildID == grandChildId))
-					.SelectMany(parent => parent.Children)
-					.Where(child => child.ChildID == childId)
-					.Select(child => child.Parent);
+				var old = Configuration.Linq.AllowMultipleQuery;

-				var result = query.ToList();
+				try
+				{
+					Configuration.Linq.AllowMultipleQuery = true;

-				Assert.AreEqual(1, result.Count);
-				Assert.AreEqual(3, result[0].ParentID);
+					var query = db.GetTable<Parent825>()
+						.Where(p => p.ParentPermissions.Any(permission => permission.UserId == userId))
+						.SelectMany(parent => parent.Childs)
+						.Where(child => child.Id == childId)
+						.Select(child => child.Parent);

+					var result = query.ToList();
+
+					Assert.AreEqual(1, result.Count);
+					Assert.AreEqual(3, result[0].Id);
+				}
+				finally
+				{
+					Configuration.Linq.AllowMultipleQuery = old;
+				}
 			}
 		}
 	}


Fixed upload records having incorrect timestamp

--- HeroesParserData/ViewModels/ReplaysViewModel.cs
+++ HeroesParserData/ViewModels/ReplaysViewModel.cs
@@ -918,10 +918,11 @@
                         currentReplayFile.Status = SaveAllReplayData.SaveAllData(dequeuedItem.Item1, dequeuedItem.Item2.FileName, out replayTimeStamp, out replayId);

                         currentReplayFile.ReplayId = replayId;
+                        currentReplayFile.TimeStamp = replayTimeStamp;
+
                         if (currentReplayFile.Status == ReplayParseResult.Saved)
                         {
                             TotalSavedInDatabase++;
-                            currentReplayFile.TimeStamp = replayTimeStamp;
                             ReplaysLatestSaved = Query.Replay.ReadLatestReplayByDateTime();
                             ReplaysLastSaved = replayTimeStamp.ToLocalTime();
                         }
@@ -1027,10 +1028,10 @@
                             continue;
                         }

-                        if (currentReplayFile.ReplayId == 0)
-                        {
-                            WarningLog.Log(LogLevel.Info, "HOTS Logs Queue: A replayId of 0 was detected");
-
+                        if (currentReplayFile.ReplayId == 0 || currentReplayFile.TimeStamp == DateTime.Now)
+                        {
+                            if (currentReplayFile.ReplayId == 0) WarningLog.Log(LogLevel.Info, "HOTS Logs Queue: A ReplayId of 0 was detected");
+                            if (currentReplayFile.TimeStamp == DateTime.Now) WarningLog.Log(LogLevel.Info, "HOTS Logs Queue: A TimeStamp of 1/1/0001 was detected");
                             // remove it before we continue
                             ReplayHotsLogsUploadQueue.Dequeue();
                             continue;
@@ -1042,7 +1043,7 @@
                             Status = ReplayHotsLogStatus.Uploading
                         };

-                        // check if a record exists for the replay
+                        // check if an upload record exists for the replay
                         if (Query.HotsLogsUpload.IsExistingRecord(replayHotsLogsUpload))
                         {
                             var existingStatus = Query.HotsLogsUpload.ReadUploadStatus(replayHotsLogsUpload);


プラグインの呼出の実装をParallel.ForEachからTask+foreachに変更

--- Kbtter4/Models/Kbtter.cs
+++ Kbtter4/Models/Kbtter.cs
@@ -152,7 +152,7 @@
         ~Kbtter()
         {
             StopStreaming();
-            Parallel.ForEach(GlobalPlugins, p => p.Dispose());
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.Dispose(); });
             SaveLog();
             var misc = Setting.Miscellaneous;
             Setting = Kbtter4Extension.LoadJson<Kbtter4Setting>(ConfigurationFileName);
@@ -281,7 +281,7 @@
                 }
             ));
             StreamManager.Add(Streaming.Connect());
-            Parallel.ForEach(GlobalPlugins, p => p.OnStartStreaming());
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnStartStreaming(); });
         }

         public void RestartStreaming()
@@ -294,7 +294,7 @@
         {
             foreach (var i in StreamManager) i.Dispose();
             StreamManager.Clear();
-            Parallel.ForEach(GlobalPlugins, p => p.OnStopStreaming());
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnStopStreaming(); });
         }
         #endregion

@@ -347,7 +347,7 @@
                 UpdateHeadline("メンション : " + s.Status.Text.TrimLineFeeds(), s.Status.User.ProfileImageUrlHttps);
             }

-            Parallel.ForEach(GlobalPlugins, p => p.OnStatus(s.DeepCopy()));
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnStatus(s.DeepCopy()); });
         }

         private void Kbtter_OnEvent(object sender, Kbtter4MessageReceivedEventArgs<EventMessage> e)
@@ -405,7 +405,7 @@
                     tl.TryAddNotification(n);
                 }
             }
-            Parallel.ForEach(GlobalPlugins, p => p.OnEvent(s.DeepCopy()));
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnEvent(s.DeepCopy()); });
         }

         private void Kbtter_OnDirectMessage(object sender, Kbtter4MessageReceivedEventArgs<DirectMessageMessage> e)
@@ -423,7 +423,7 @@
             }
             DirectMessageTimelines.First(p => p.Party.Id == pu.Id).TryAddDirectMessage(dm.DirectMessage);

-            Parallel.ForEach(GlobalPlugins, p => p.OnDirectMessage(dm.DeepCopy()));
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnDirectMessage(dm.DeepCopy()); });
         }

         private void Kbtter_OnId(object sender, Kbtter4MessageReceivedEventArgs<DeleteMessage> e)
@@ -459,7 +459,7 @@
                     break;
             }

-            Parallel.ForEach(GlobalPlugins, p => p.OnDelete(mes.DeepCopy()));
+            Task.Run(() => { foreach (var i in GlobalPlugins) i.OnDelete(mes.DeepCopy()); });
         }
         #endregion

@@ -471,27 +471,29 @@

         public async Task<bool> RegisterAccount(OAuth.OAuthSession session, string pin)
         {
-            try
-            {
-                var t = await OAuth.GetTokensAsync(session, pin);
-                var ac = new Kbtter4Account();
-                ac.AccessToken = t.AccessToken;
-                ac.AccessTokenSecret = t.AccessTokenSecret;
-                ac.ScreenName = t.ScreenName;
-                ac.UserId = t.UserId;
-                ac.Timelines = new ObservableSynchronizedCollection<Kbtter4SettingStatusTimelineData>();
-                ac.Timelines.Add(new Kbtter4SettingStatusTimelineData { Name = "リプライ・メンション", Query = "Status.Text match /@" + ac.ScreenName + "/" });
-                Accounts.Add(ac);
-
-                Setting.Accounts.Add(ac);
-                SaveSetting();
-                return true;
-            }
-            catch
-            {
-                return false;
-            }
-
+            return await Task<bool>.Run(() =>
+            {
+                try
+                {
+                    var t = OAuth.GetTokens(session, pin);
+                    var ac = new Kbtter4Account();
+                    ac.AccessToken = t.AccessToken;
+                    ac.AccessTokenSecret = t.AccessTokenSecret;
+                    ac.ScreenName = t.ScreenName;
+                    ac.UserId = t.UserId;
+                    ac.Timelines = new ObservableSynchronizedCollection<Kbtter4SettingStatusTimelineData>();
+                    ac.Timelines.Add(new Kbtter4SettingStatusTimelineData { Name = "リプライ・メンション", Query = "Status.Text match /@" + ac.ScreenName + "/" });
+                    Accounts.Add(ac);
+
+                    Setting.Accounts.Add(ac);
+                    SaveSetting();
+                    return true;
+                }
+                catch
+                {
+                    return false;
+                }
+            });
         }

         public void RemoveAccount(Kbtter4Account ac)
@@ -503,20 +505,20 @@

         public Task<string> Authenticate(Kbtter4Account ac)
         {
-            return Task<string>.Run(async () =>
+            return Task<string>.Run(() =>
             {
                 StopStreaming();
                 ClearStock();
-                Parallel.ForEach(GlobalPlugins, p => p.OnLogout(AuthenticatedUser));
+                Task.Run(() => { foreach (var i in GlobalPlugins) i.OnLogout(AuthenticatedUser); });

                 Token = Tokens.Create(Setting.Consumer.Key, Setting.Consumer.Secret, ac.AccessToken, ac.AccessTokenSecret);
                 try
                 {
-                    var u = await Token.Users.ShowAsync(user_id => ac.UserId);
+                    var u = Token.Users.Show(user_id => ac.UserId);
                     AuthenticatedUser = u;
                     AuthenticatedUserCache = new Kbtter4Cache(CacheFolderName + "/" + AuthenticatedUser.ScreenName + CacheDatabaseFileNameSuffix);
                     AuthenticatedUserDrafts = new ObservableSynchronizedCollection<Kbtter4Draft>(ac.Drafts);
-                    Parallel.ForEach(GlobalPlugins, p => p.OnLogin(AuthenticatedUser));
+                    Task.Run(() => { foreach (var i in GlobalPlugins) i.OnLogin(AuthenticatedUser); });
                     InitializeUserCaches();
                     InitializeDirectMessages();
                     InitializeUserDefinitionTimelines();
@@ -739,7 +741,7 @@

         #endregion

-
+

         #region プラグイン

@@ -763,7 +765,7 @@
                     }
                 }
                 SaveLog();
-                Parallel.ForEach(GlobalPlugins, p => p.Initialize());
+                Task.Run(() => { foreach (var i in GlobalPlugins) i.Initialize(); });
             });
         }


Bug fixed: サマリ先のサイトが削除された際にnull参照違反が発生する問題を解消。

--- Implem.Pleasanter/Models/Sites/SiteUtilities.cs
+++ Implem.Pleasanter/Models/Sites/SiteUtilities.cs
@@ -2399,12 +2399,14 @@
                     {
                         var dataRow = dataRows.FirstOrDefault(o =>
                             o["SiteId"].ToLong() == summary.SiteId);
-                        var destinationSs = dataRow?["SiteSettings"]
-                            .ToString()
-                            .Deserialize<SiteSettings>() ??
-                                SiteSettingsUtilities.Get(
-                                    dataRow["SiteId"].ToLong(),
-                                    dataRow["ReferenceType"].ToString());
+                        var destinationSs = dataRow != null
+                            ? dataRow["SiteSettings"]
+                                .ToString()
+                                .Deserialize<SiteSettings>() ??
+                                    SiteSettingsUtilities.Get(
+                                        dataRow["SiteId"].ToLong(),
+                                        dataRow["ReferenceType"].ToString())
+                            : null;
                         if (destinationSs != null)
                         {
                             hb.Tr(


More Parameters

More Parameters

--- Kinect/Kinect/Program.cs
+++ Kinect/Kinect/Program.cs
@@ -26,7 +26,7 @@
             sensor.Start();

             // Run until the user presses 'q' or 'Q' on the keyboard
-            while (Char.ToLowerInvariant(Console.ReadKey().KeyChar) != 'q') { }
+            //while (Char.ToLowerInvariant(Console.ReadKey().KeyChar) != 'q') { }

             // Stop the sensor
             sensor.Stop();
@@ -38,39 +38,63 @@
         int frame = 0;
         DateTime startTime;
         DateTime time;
-
+        DateTime terminateTime;
+        double timeInSecond = 0;
         bool testStart = false;

         //Gait Parameters
-        double cadence = 0;
-        double stepLength = 0;
-        double stepTime = 0;
-        double stepWidth = 0;
-        double stanceTime = 0;
-        double strideLength = 0;
-        double strideVelocity = 0;
-        double swingTime = 0;
+        double cadence = 0;             //What is this?
+        double stepLength = 0;          //Done
+        double stepTime = 0;            //Done
+        double stepWidth = 0;           //What is this?
+        double stepFrequency = 0;       //Done
+        double stanceTime = 0;          //Done
+        double strideLength = 0;        //Done
+        double strideVelocity = 0;      //Done (Edit)
+        double swingTime = 0;           //Done

         double totalDistance = 0;
+        double[] initialPoint = new double[3];
+        double[] currentPoint = new double[3];
+
         double totalTime = 0;
-
         double initialTime = 0;
         double currentTime = 0;

-        double[] initialPoint = new double[3];
-        double[] currentPoint = new double[3];
-
+        int stanceCounter = 0;
         double stanceTimeTotal = 0;
+        double initialStanceTime = 0;
+        double terminalStanceTime = 0;
+
+        int swingCounter = 0;
         double swingTimeTotal = 0;
-
+        double initialSwingTime = 0;
+        double terminalSwingTime = 0;
+
+        int stepCounter = 0;
+        bool stepProcessingLeft = false;
+        bool stepProcessingRight = false;
+        double stepTimeTotal = 0;
+        double initialStepTime = 0;
+        double terminalStepTime = 0;
+
+        double stepLengthTotal = 0;
+        double[,] initialStepPoint = new double[2,3];
+        double[,] terminalStepPoint = new double[2,3];
+
+        int strideCounter = 0;
+        bool strideProcessingLeft = false;
+        bool strideProcessingRight = false;
         double strideLengthTotal = 0;
-        double stepLengthTotal = 0;
-
-        double[] stepInitialPoint = new double[3];
-        double[] stepTerminalPoint = new double[3];
-
-        bool leftOnFloor = false;
-        bool rightOnFloor = false;
+        double[,] initialStridePoint = new double[2,3];
+        double[,] terminalStridePoint = new double[2,3];
+
+        bool leftOnFloor = true;
+        bool rightOnFloor = true;
+        double leftOnFloorTrue = 0;
+        double leftOnFloorFalse = 0;
+        double rightOnFloorTrue = 0;
+        double rightOnFloorFalse = 0;
         bool stance = false;

         private Skeleton[] skeletons = null;
@@ -78,37 +102,31 @@

         public Tracker(KinectSensor sensor)
         {
-            // Connect the skeleton frame handler and enable skeleton tracking
             sensor.SkeletonFrameReady += SensorSkeletonFrameReady;
             sensor.SkeletonStream.Enable();
             sensor.DepthStream.Enable();
+            //sensor.Stop();
         }

         private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
         {
-            // Access the skeleton frame
             using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
             {
                 floorPlane = skeletonFrame.FloorClipPlane;
+
                 if (skeletonFrame != null)
                 {
                     if (this.skeletons == null)
                     {
-                        // Allocate array of skeletons
                         this.skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];
                     }

-                    // Copy skeletons from this frame
                     skeletonFrame.CopySkeletonDataTo(this.skeletons);
-
-                    // Find first tracked skeleton, if any
                     Skeleton skeleton = this.skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault();
-
                     floorPlane = skeletonFrame.FloorClipPlane;

                     if (skeleton != null)
                     {
-                        // Obtain parameters; if tracked, print its position
                         Joint kneeLeft = skeleton.Joints[JointType.KneeLeft];
                         Joint kneeRight = skeleton.Joints[JointType.KneeRight];
                         Joint ankleLeft = skeleton.Joints[JointType.AnkleLeft];
@@ -116,139 +134,324 @@
                         Joint footLeft = skeleton.Joints[JointType.FootLeft];
                         Joint footRight = skeleton.Joints[JointType.FootRight];

-                        if ((ankleLeft.TrackingState == JointTrackingState.Tracked && ankleLeft.TrackingState == JointTrackingState.Tracked) &&
-                            (footLeft.TrackingState == JointTrackingState.Tracked && footLeft.TrackingState == JointTrackingState.Tracked) &&
-                            (kneeLeft.TrackingState == JointTrackingState.Tracked && kneeLeft.TrackingState == JointTrackingState.Tracked))
+                        if ((ankleLeft.TrackingState == JointTrackingState.Tracked && ankleLeft.TrackingState == JointTrackingState.Tracked) && (footLeft.TrackingState == JointTrackingState.Tracked && footLeft.TrackingState == JointTrackingState.Tracked) && (kneeLeft.TrackingState == JointTrackingState.Tracked && kneeLeft.TrackingState == JointTrackingState.Tracked))
                         {
                             time = DateTime.Now;
-
-                            float leftFootFloorDistance = (float)Math.Round(Math.Abs((floorPlane.Item1 * footLeft.Position.X) + (floorPlane.Item2 * footLeft.Position.Y) + (floorPlane.Item3 * footLeft.Position.Z) + floorPlane.Item4) /
-                                       Math.Sqrt(Math.Pow(footLeft.Position.X, 2) + Math.Pow(footLeft.Position.Y, 2) + Math.Pow(footLeft.Position.Z, 2)) * 1000, 2);
-
-                            float rightFootFloorDistance = (float)Math.Round(Math.Abs((floorPlane.Item1 * footRight.Position.X) + (floorPlane.Item2 * footRight.Position.Y) + (floorPlane.Item3 * footRight.Position.Z) + floorPlane.Item4) /
-                                       Math.Sqrt(Math.Pow(footRight.Position.X, 2) + Math.Pow(footRight.Position.Y, 2) + Math.Pow(footRight.Position.Z, 2)) * 1000, 2);
-
-                            leftOnFloor = leftFootFloorDistance < 25;
-                            rightOnFloor = rightFootFloorDistance < 25;
+                            timeInSecond = time.Minute * 60 + time.Second;
+
+                            float leftFootFloorDistance = (float)Math.Round(Math.Abs((floorPlane.Item1 * footLeft.Position.X) + (floorPlane.Item2 * footLeft.Position.Y) + (floorPlane.Item3 * footLeft.Position.Z) + floorPlane.Item4) / Math.Sqrt(Math.Pow(footLeft.Position.X, 2) + Math.Pow(footLeft.Position.Y, 2) + Math.Pow(footLeft.Position.Z, 2)) * 1000, 2);
+                            float rightFootFloorDistance = (float)Math.Round(Math.Abs((floorPlane.Item1 * footRight.Position.X) + (floorPlane.Item2 * footRight.Position.Y) + (floorPlane.Item3 * footRight.Position.Z) + floorPlane.Item4) / Math.Sqrt(Math.Pow(footRight.Position.X, 2) + Math.Pow(footRight.Position.Y, 2) + Math.Pow(footRight.Position.Z, 2)) * 1000, 2);
+
+                            //Improve Accuracy Calibration (Disregard bad skeletons)
+                            if(leftFootFloorDistance < 17)
+                            {
+                                if (leftOnFloorFalse < 5)
+                                    leftOnFloorFalse = 0;
+                                if (++leftOnFloorTrue == 7)
+                                {
+                                    leftOnFloor = true;
+                                    leftOnFloorTrue = 0;
+                                    leftOnFloorFalse = 0;
+                                }
+                            }
+                            else
+                            {
+                                if (leftOnFloorTrue < 5)
+                                    leftOnFloorTrue = 0;
+                                if (++leftOnFloorFalse == 7)
+                                {
+                                    leftOnFloor = false;
+                                    leftOnFloorTrue = 0;
+                                    leftOnFloorFalse = 0;
+                                }
+                            }
+
+                            if (rightFootFloorDistance < 17)
+                            {
+                                if (rightOnFloorFalse < 5)
+                                    rightOnFloorFalse = 0;
+                                if (++rightOnFloorTrue == 7)
+                                {
+                                    rightOnFloor = true;
+                                    rightOnFloorTrue = 0;
+                                    rightOnFloorFalse = 0;
+                                }
+                            }
+                            else
+                            {
+                                if (rightOnFloorTrue < 5)
+                                    rightOnFloorTrue = 0;
+                                if (++rightOnFloorFalse == 7)
+                                {
+                                    rightOnFloor = false;
+                                    rightOnFloorTrue = 0;
+                                    rightOnFloorFalse = 0;
+                                }
+                            }

                             stance = leftOnFloor && rightOnFloor;

                             if (stance)
                             {
-                                Console.Clear();
-                                Console.BackgroundColor = ConsoleColor.Red;
-                            }
-                            else
-                            {
-                                Console.Clear();
-                                Console.BackgroundColor = ConsoleColor.Blue;
-                            }
-
-                            //Stride Length
-                            if (ankleLeft.TrackingState == JointTrackingState.Tracked && ankleLeft.TrackingState == JointTrackingState.Tracked)
-                            {
-                                strideLengthTotal += Math.Round(Math.Sqrt(Math.Pow(ankleRight.Position.X - ankleLeft.Position.X, 2) +
-                                            Math.Pow(ankleRight.Position.Y - ankleLeft.Position.Y, 2) +
-                                            Math.Pow(ankleRight.Position.Z - ankleLeft.Position.Z, 2)) * 100, 2);
-                                strideLength = Math.Round(strideLengthTotal / frame, 2);
+                                //Console.Clear();
+                                Console.ForegroundColor = ConsoleColor.Red;
+                                //Console.BackgroundColor = ConsoleColor.Red;
+                            }
+                            else
+                            {
+                                //Console.Clear();
+                                if(!leftOnFloor && !rightOnFloor)
+                                    Console.ForegroundColor = ConsoleColor.White;
+                                else if(!leftOnFloor)
+                                    Console.ForegroundColor = ConsoleColor.Blue;
+                                else if (!rightOnFloor)
+                                    Console.ForegroundColor = ConsoleColor.Green;
+                                //Console.BackgroundColor = ConsoleColor.Green;
                             }

                             //Stride Velocity
-                            if (footLeft.TrackingState == JointTrackingState.Tracked)
-                            {
-                                if (initialPoint[0] == 0 && initialPoint[1] == 0 && initialPoint[2] == 0)
-                                {
-                                    initialPoint[0] = footLeft.Position.X;
-                                    initialPoint[1] = footLeft.Position.Y;
-                                    initialPoint[2] = footLeft.Position.Z;
-                                    initialTime = time.Hour * 3600 + time.Minute * 60 + time.Second;
-                                    startTime = DateTime.Now;
+                            if (initialPoint[0] == 0 && initialPoint[1] == 0 && initialPoint[2] == 0)
+                            {
+                                initialPoint[0] = footLeft.Position.X;
+                                initialPoint[1] = footLeft.Position.Y;
+                                initialPoint[2] = footLeft.Position.Z;
+                                initialTime = timeInSecond;
+                                startTime = DateTime.Now;
+                            }
+                            else
+                            {
+                                currentPoint[0] = footLeft.Position.X;
+                                currentPoint[1] = footLeft.Position.Y;
+                                currentPoint[2] = footLeft.Position.Z;
+                                currentTime = timeInSecond;
+
+                                totalDistance = Math.Round(Math.Sqrt(Math.Pow(initialPoint[0] - currentPoint[0], 2) + Math.Pow(initialPoint[0] - currentPoint[0], 2) + Math.Pow(initialPoint[0] - currentPoint[0], 2)) * 100, 2);
+                                totalTime = currentTime - initialTime;
+
+                                strideVelocity = Math.Round(totalDistance / totalTime, 2);
+                            }
+
+                            //Step Length and Step Frequency (Right Foot)
+
+                            if (!rightOnFloor)
+                            {
+                                if (!stepProcessingRight)
+                                {
+                                    stepProcessingRight = true;
+                                    initialStepPoint[1,0] = footRight.Position.X;
+                                    initialStepPoint[1, 1] = footRight.Position.Y;
+                                    initialStepPoint[1, 2] = footRight.Position.Z;
+                                    initialStepTime = timeInSecond;
                                 }
                                 else
                                 {
-                                    currentPoint[0] = footLeft.Position.X;
-                                    currentPoint[1] = footLeft.Position.Y;
-                                    currentPoint[2] = footLeft.Position.Z;
-                                    currentTime = time.Hour * 3600 + time.Minute * 60 + time.Second;
-
-                                    totalDistance = Math.Round(Math.Sqrt(Math.Pow(initialPoint[0] - currentPoint[0], 2) +
-                                                    Math.Pow(initialPoint[0] - currentPoint[0], 2) +
-                                                    Math.Pow(initialPoint[0] - currentPoint[0], 2)) * 100, 2);
-                                    totalTime = currentTime - initialTime;
-                                    strideVelocity = Math.Round(totalDistance / totalTime, 2);
-                                }
-                            }
-
-                            //Step Length
+                                    terminalStepPoint[1, 0] = footRight.Position.X;
+                                    terminalStepPoint[1, 1] = footRight.Position.Y;
+                                    terminalStepPoint[1, 2] = footRight.Position.Z;
+                                    terminalStepTime = timeInSecond;
+                                }
+                            }
+
+                            else
+                            {
+                                if (stepProcessingRight)
+                                {
+                                    stepProcessingRight = false;
+
+                                    ++stepCounter;
+                                    stepLengthTotal += Math.Round(Math.Sqrt(Math.Pow(initialStepPoint[1, 0] - terminalStepPoint[1, 0], 2) + Math.Pow(initialStepPoint[1, 1] - terminalStepPoint[1, 1], 2) + Math.Pow(initialStepPoint[1, 2] - terminalStepPoint[1, 2], 2)) * 100, 2);
+                                    stepLength = Math.Round(stepLengthTotal / stepCounter, 2);
+
+                                    stepTimeTotal += terminalStepTime - initialStepTime;
+                                    stepTime = Math.Round(stepTimeTotal / stepCounter, 2);
+
+                                    stepFrequency = Math.Round(stepCounter / (totalTime / 60), 2);
+
+                                    initialStepPoint[1, 0] = 0;
+                                    initialStepPoint[1, 1] = 0;
+                                    initialStepPoint[1, 2] = 0;
+                                    initialStepTime = 0;
+
+                                    terminalStepPoint[1, 0] = 0;
+                                    terminalStepPoint[1, 1] = 0;
+                                    terminalStepPoint[1, 2] = 0;
+                                    terminalStepTime = 0;
+                                }
+                            }
+
+                            //Step Length and Step Frequency (Left Foot)
                             if (!leftOnFloor)
                             {
-                                if (rightOnFloor)
-                                {
-                                    if (stepInitialPoint[0] == 0 && stepInitialPoint[1] == 0 && stepInitialPoint[2] == 0)
+                                if (!stepProcessingLeft)
+                                {
+                                    stepProcessingLeft = true;
+                                    initialStepPoint[0, 0] = footLeft.Position.X;
+                                    initialStepPoint[0, 1] = footLeft.Position.Y;
+                                    initialStepPoint[0, 2] = footLeft.Position.Z;
+                                    initialStepTime = timeInSecond;
+                                }
+                                else
+                                {
+                                    terminalStepPoint[0, 0] = footLeft.Position.X;
+                                    terminalStepPoint[0, 1] = footLeft.Position.Y;
+                                    terminalStepPoint[0, 2] = footLeft.Position.Z;
+                                    terminalStepTime = timeInSecond;
+                                }
+                            }
+
+                            else
+                            {
+                                if (stepProcessingLeft)
+                                {
+                                    stepProcessingLeft = false;
+
+                                    ++stepCounter;
+                                    stepLengthTotal += Math.Round(Math.Sqrt(Math.Pow(initialStepPoint[0, 0] - terminalStepPoint[0, 0], 2) + Math.Pow(initialStepPoint[0, 1] - terminalStepPoint[0, 1], 2) + Math.Pow(initialStepPoint[0, 2] - terminalStepPoint[0, 2], 2)) * 100, 2);
+                                    stepLength = Math.Round(stepLengthTotal / stepCounter, 2);
+
+                                    stepTimeTotal += terminalStepTime - initialStepTime;
+                                    stepTime = Math.Round(stepTimeTotal / stepCounter, 2);
+
+                                    stepFrequency = Math.Round(stepCounter / (totalTime / 60), 2);
+
+                                    initialStepPoint[0, 0] = 0;
+                                    initialStepPoint[0, 1] = 0;
+                                    initialStepPoint[0, 2] = 0;
+                                    initialStepTime = 0;
+
+                                    terminalStepPoint[0, 0] = 0;
+                                    terminalStepPoint[0, 1] = 0;
+                                    terminalStepPoint[0, 2] = 0;
+                                    terminalStepTime = 0;
+                                }
+                            }
+
+                            //Stride Length (Left Foot)
+                            if (stance && strideProcessingLeft)
+                            {
+                                strideProcessingLeft = false;
+                                initialStridePoint[1, 0] = footRight.Position.X;
+                                initialStridePoint[1, 1] = footRight.Position.Y;
+                                initialStridePoint[1, 2] = footRight.Position.Z;
+
+                                terminalStridePoint[1, 0] = footLeft.Position.X;
+                                terminalStridePoint[1, 1] = footLeft.Position.Y;
+                                terminalStridePoint[1, 2] = footLeft.Position.Z;
+
+                                ++strideCounter;
+                                strideLengthTotal += Math.Round(Math.Sqrt(Math.Pow(initialStridePoint[1, 0] - terminalStridePoint[1, 0], 2) + Math.Pow(initialStridePoint[1, 1] - terminalStridePoint[1, 1], 2) + Math.Pow(initialStridePoint[1, 2] - terminalStridePoint[1, 2], 2)) * 100, 2);
+                                strideLength = Math.Round(strideLengthTotal / strideCounter, 2);
+                            }
+
+                            //Stride Length (Right Foot)
+                            /*if (leftOnFloor)
+                            {
+                                if (!strideProcessingRight)
+                                {
+                                    strideProcessingRight = true;
+                                    initialStridePoint[0, 0] = footLeft.Position.X;
+                                    initialStridePoint[0, 1] = footLeft.Position.Y;
+                                    initialStridePoint[0, 2] = footLeft.Position.Z;
+                                }
+
+                                if (!rightOnFloor)
+                                {
+                                    terminalStridePoint[0, 0] = footRight.Position.X;
+                                    terminalStridePoint[0, 1] = footRight.Position.Y;
+                                    terminalStridePoint[0, 2] = footRight.Position.Z;
+
+                                }
+
+                                else
+                                {
+                                    if (strideProcessingRight)
                                     {
-                                        stepInitialPoint[0] = footLeft.Position.X;
-                                        stepInitialPoint[1] = footLeft.Position.Y;
-                                        stepInitialPoint[2] = footLeft.Position.Z;
+
+                                        strideProcessingRight = false;
+                                        ++strideCounter;
+                                        strideLengthTotal += Math.Round(Math.Sqrt(Math.Pow(initialStridePoint[0, 0] - terminalStridePoint[0, 0], 2) + Math.Pow(initialStridePoint[0, 1] - terminalStridePoint[0, 1], 2) + Math.Pow(initialStridePoint[0, 2] - terminalStridePoint[0, 2], 2)) * 100, 2);
+                                        strideLength = Math.Round(strideLengthTotal / strideCounter, 2);
+
+                                        initialStridePoint[0, 0] = 0;
+                                        initialStridePoint[0, 1] = 0;
+                                        initialStridePoint[0, 2] = 0;
+
+                                        terminalStridePoint[0, 0] = 0;
+                                        terminalStridePoint[0, 1] = 0;
+                                        terminalStridePoint[0, 2] = 0;
                                     }
-                                    else
-                                    {
-                                        stepTerminalPoint[0] = footLeft.Position.X;
-                                        stepTerminalPoint[1] = footLeft.Position.Y;
-                                        stepTerminalPoint[2] = footLeft.Position.Z;
-                                    }
-                                }
+                                }
+                            }*/
+
+                            //Stance Time and Swing Time
+                            if (stance)
+                            {
+                                if (!(initialSwingTime == 0))
+                                {
+                                    ++swingCounter;
+                                    swingTimeTotal += terminalSwingTime - initialSwingTime;
+                                    swingTime = Math.Round(swingTimeTotal / swingCounter);
+                                }
+
+                                if (initialStanceTime == 0)
+                                    initialStanceTime = timeInSecond;
                                 else
-                                {
-                                    if (!(stepInitialPoint[0] == 0 && stepInitialPoint[1] == 0 && stepInitialPoint[2] == 0))
-                                    {
-                                        stepLengthTotal += Math.Round(Math.Sqrt(Math.Pow(stepInitialPoint[0] - stepTerminalPoint[0], 2) +
-                                                    Math.Pow(stepInitialPoint[0] - stepTerminalPoint[0], 2) +
-                                                    Math.Pow(stepInitialPoint[0] - stepTerminalPoint[0], 2)) * 100, 2);
-                                        stepLength = Math.Round(stepLengthTotal / frame, 2);
-
-                                        stepInitialPoint[0] = 0;
-                                        stepInitialPoint[1] = 0;
-                                        stepInitialPoint[2] = 0;
-
-                                        stepTerminalPoint[0] = 0;
-                                        stepTerminalPoint[1] = 0;
-                                        stepTerminalPoint[2] = 0;
-                                    }
-                                }
-                            }
-
-                            //Stance Time
-                            if (stance) { }
-                            /*if (frame % 30 == 9)
+                                    terminalStanceTime = timeInSecond;
+                            }
+
+                            if (!stance)
+                            {
+                                strideProcessingLeft = true;
+                                if(!(initialStanceTime == 0))
+                                {
+                                    ++stanceCounter;
+                                    stanceTimeTotal += terminalStanceTime - initialStanceTime;
+                                    stanceTime = Math.Round(stanceTimeTotal / stanceCounter);
+                                }
+
+                                if (initialSwingTime == 0)
+                                    initialSwingTime = timeInSecond;
+                                else
+                                    terminalSwingTime = timeInSecond;
+                            }
+
+                            if (frame % 300 == 9)
                                 Console.Clear();

                             Console.WriteLine("Frame: " + ++frame);
                             Console.WriteLine();
                             Console.WriteLine("Gait Parameters");
                             Console.WriteLine("Step Length: " + stepLength + "cm");
+                            Console.WriteLine("Step Time: " + stepTime + "s");
+                            Console.WriteLine("Step Frequency: " + stepFrequency + " steps/min");
                             Console.WriteLine("Stride Length: " + strideLength + "cm");
                             Console.WriteLine("Stride Velocity: " + strideVelocity + "cm/s");
+                            Console.WriteLine("Stance Time: " + stanceTime + "s");
+                            Console.WriteLine("Swing Time: " + swingTime + "s");
+                            //Console.WriteLine();
+                            //Console.WriteLine("Step Counter: " + stepCounter + " step/s");
+                            //Console.WriteLine("Stride Counter: " + strideCounter + " step/s");
+                            /*Console.WriteLine("Left Foot distance from Floor: " + leftFootFloorDistance);
+                            Console.WriteLine("Right Foot distance from Floor: " + rightFootFloorDistance);
+                            Console.WriteLine("Stance Status: " + stance);*/
+                            //Console.WriteLine("Distance Traveled: " + totalDistance + "cm");
+                            //Console.WriteLine("Time Traveled: " + totalTime + "s");
+                            /*Console.WriteLine();
+                            Console.WriteLine("Start Time: " + startTime.Hour + ":" + startTime.Minute + ":" + startTime.Second);
+                            Console.WriteLine("Current Time: " + time.Hour + ":" + time.Minute + ":" + time.Second);*/
                             Console.WriteLine();
-                            Console.WriteLine("Left Foot distance from Floor: " + leftFootFloorDistance);
-                            Console.WriteLine("Right Foot distance from Floor: " + rightFootFloorDistance);
-                            Console.WriteLine("Stance Status: " + stance);
-                            Console.WriteLine("Distance Traveled: " + totalDistance + "cm");
-                            Console.WriteLine("Time Traveled: " + totalTime + "s");
-                            Console.WriteLine();
-                            Console.WriteLine("Start Time: " + startTime.Hour + ":" + startTime.Minute + ":" + startTime.Second);
-                            Console.WriteLine("Current Time: " + time.Hour + ":" + time.Minute + ":" + time.Second);
-                            Console.WriteLine();*/
+                        }
+
+                        else
+                        {
+                            terminateTime = DateTime.Now;
+                            if (timeInSecond + 5 == terminateTime.Minute * 60 + terminateTime.Second)
+                            {
+                                Console.Clear();
+                                return;
+                            }
                         }
                     }
-
-                    /*else if(testStart)
-                    {
-                        terminateTime = DateTime.Now;
-                        if(time.Hour * 3600 + time.Minute * 60 + time.Second + 5 == terminateTime.Hour * 3600 + terminateTime.Minute * 60 + terminateTime.Second)
-                        {
-                            System.exit;
-                        }
-                    }*/
                 }
             }
         }


Build fix

Build fix

--- InfinniPlatform.Core/IoC/CoreContainerModule.cs
+++ InfinniPlatform.Core/IoC/CoreContainerModule.cs
@@ -1,6 +1,7 @@
 using System.Text;

 using InfinniPlatform.Core.Compression;
+using InfinniPlatform.Core.Diagnostics;
 using InfinniPlatform.Core.Logging;
 using InfinniPlatform.Core.Metadata;
 using InfinniPlatform.Core.Settings;


"..." was never added to the end of a truncated string

--- Joinrpg/Models/TargetedSearchResultViewModel.cs
+++ Joinrpg/Models/TargetedSearchResultViewModel.cs
@@ -39,36 +39,37 @@
       {
         targetText = targetText.Substring(0, maxLength);
       }
+      if (stringToTruncate.Length <= maxLength)
+      {
+        return stringToTruncate;
+      }

-      if (stringToTruncate.Length > maxLength)
+      int startOfSearchedFragment = stringToTruncate.IndexOf(targetText, stringComparison);
+
+      //show the beginning of the string if target fragment is not found
+      startOfSearchedFragment = startOfSearchedFragment < 0 ? 0 : startOfSearchedFragment;
+
+      //Try to put the beginning of the searched fragment in the middle of the substring
+      int startOfSubtringToShow = startOfSearchedFragment > (maxLength / 2)
+        ? startOfSearchedFragment - (maxLength / 2)
+        : 0;
+
+      //Move substring to the left, if needed
+      startOfSubtringToShow = (startOfSubtringToShow + maxLength) > stringToTruncate.Length
+        ? stringToTruncate.Length - maxLength
+        : startOfSubtringToShow;
+
+      string truncatedString = stringToTruncate.Substring(startOfSubtringToShow, maxLength);
+
+      if (startOfSubtringToShow > 0)
       {
-        int startOfSearchedFragment = stringToTruncate.IndexOf(targetText, stringComparison);
-
-        //show the beginning of the string if target fragment is not found
-        startOfSearchedFragment = startOfSearchedFragment < 0 ? 0 : startOfSearchedFragment;
-
-        //Try to put the beginning of the searched fragment in the middle of the substring
-        int startOfSubtringToShow = startOfSearchedFragment > (maxLength / 2)
-            ? startOfSearchedFragment - (maxLength / 2)
-            : 0;
-
-        //Move substring to the left, if needed
-        startOfSubtringToShow = (startOfSubtringToShow + maxLength) > stringToTruncate.Length
-              ? stringToTruncate.Length - maxLength
-              : startOfSubtringToShow;
-
-        stringToTruncate = stringToTruncate.Substring(startOfSubtringToShow, maxLength);
-
-        if (startOfSubtringToShow > 0)
-        {
-          stringToTruncate = "..." + stringToTruncate;
-        }
-        if (startOfSubtringToShow + maxLength < stringToTruncate.Length)
-        {
-          stringToTruncate = stringToTruncate + "...";
-        }
+        truncatedString = "..." + truncatedString;
       }
-      return stringToTruncate;
+      if (startOfSubtringToShow + maxLength < stringToTruncate.Length)
+      {
+        truncatedString = truncatedString + "...";
+      }
+      return truncatedString;
     }

     public TargetedSearchResultViewModel(


comment

comment

--- King.Azure.BackgroundWorker/Data/Coordinator.cs
+++ King.Azure.BackgroundWorker/Data/Coordinator.cs
@@ -110,6 +110,13 @@
             return performTask;
         }

+        /// <summary>
+        /// Start
+        /// </summary>
+        /// <param name="type">Task Type</param>
+        /// <param name="identifier">Identifier</param>
+        /// <param name="start">Start</param>
+        /// <returns></returns>
         public async Task Start(Type type, Guid identifier, DateTime start)
         {
             if (null == type)
@@ -130,6 +137,15 @@
             await this.storage.InsertOrReplace(entry);
         }

+        /// <summary>
+        /// Complete
+        /// </summary>
+        /// <param name="type">Task Type</param>
+        /// <param name="identifier">Identifier</param>
+        /// <param name="start">Start</param>
+        /// <param name="end">End</param>
+        /// <param name="success">Success</param>
+        /// <returns></returns>
         public async Task Complete(Type type, Guid identifier, DateTime start, DateTime end, bool success)
         {
             if (null == type)


removes the database after the feature spec has finished

--- LatteDB.Tests/Features/Simple_object_feature.cs
+++ LatteDB.Tests/Features/Simple_object_feature.cs
@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using NUnit.Framework;

 namespace LatteDB.Tests
@@ -21,6 +22,8 @@
 				var retrievedCar = readDatabase.GetAll<Car>()[0];
 				Assert.AreEqual(savedCar.Brand, retrievedCar.Brand);
 			}
+
+			File.Delete(databaseName);
 		}
 	}


Select an active monitor fix

Select an active monitor fix

--- Memoria.Launcher/Memoria/GameSettingsControl.cs
+++ Memoria.Launcher/Memoria/GameSettingsControl.cs
@@ -333,9 +333,8 @@
                 _resolution = value;

                 value = iniFile.ReadValue("Settings", nameof(ActiveMonitor));
-                if (String.IsNullOrEmpty(value))
-                    value = String.Empty;
-                _activeMonitor = value;
+                if (!String.IsNullOrEmpty(value))
+                    _activeMonitor = value;

                 value = iniFile.ReadValue("Settings", nameof(Windowed));
                 if (String.IsNullOrEmpty(value))


account controller

account controller

--- MiniTrello.Api/Controllers/AccountController.cs
+++ MiniTrello.Api/Controllers/AccountController.cs
@@ -6,7 +6,7 @@
 using MiniTrello.Domain.Entities;
 using MiniTrello.Domain.Services;
 using MiniTrello.Api.Controllers.Helpers;
-using MiniTrello.Api.CustomExceptions;
+//using MiniTrello.Api.CustomExceptions;
 namespace MiniTrello.Api.Controllers
 {
     public class AccountController : ApiController


Fixed bug when parsing an incorrect percentage

--- NBi.Core/ResultSet/Comparer/ToleranceFactory.cs
+++ NBi.Core/ResultSet/Comparer/ToleranceFactory.cs
@@ -93,12 +93,17 @@
                 var percentage = value.Replace(" ", "").Substring(0, value.Replace(" ", "").IndexOf('%'));
                 isBoundedPercentage = decimal.TryParse(percentage, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out tolerancePercentage);
                 var bound = value.Replace(" ", "").Substring(value.Replace(" ", "").IndexOf('%') + 1).Replace("(", "").Replace(")", "").Replace(":", "").Replace("=", "");
-                isBoundedPercentage = decimal.TryParse(bound.Substring(3), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out toleranceBound);
-                if (bound.Contains("min"))
-                    min = toleranceBound;
-                if (bound.Contains("max"))
-                    max = toleranceBound;
-                isBoundedPercentage = (min != max);
+
+                if (bound.Length>3 && (bound.Substring(0, 3) == "min" || bound.Substring(0, 3) == "max"))
+                {
+                    isBoundedPercentage = decimal.TryParse(bound.Substring(3), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out toleranceBound);
+                    if (bound.Contains("min"))
+                        min = toleranceBound;
+                    if (bound.Contains("max"))
+                        max = toleranceBound;
+                    isBoundedPercentage = (min != max);
+                }
+
             }
             if (isBoundedPercentage)
                 return new NumericBoundedPercentageTolerance(tolerancePercentage/100, min, max);


Fixed broken test.

Fixed broken test.

--- Naos.Deployment.Core.Test/PackageManagerTest.cs
+++ Naos.Deployment.Core.Test/PackageManagerTest.cs
@@ -83,6 +83,7 @@
 "<configuration>" + Environment.NewLine +
 "  <activePackageSource>" + Environment.NewLine +
 "    <add key=\"nuget.org\" value=\"https://www.nuget.org/api/v2/\" />" + Environment.NewLine +
+"    <add key=\"" + repoConfig.SourceName + "\" value=\"" + repoConfig.Source + "\" />" + Environment.NewLine +
 "  </activePackageSource>" + Environment.NewLine +
 "  <packageSources>" + Environment.NewLine +
 "    <add key=\"nuget.org\" value=\"https://www.nuget.org/api/v2/\" />" + Environment.NewLine +
@@ -91,7 +92,8 @@
 "  <packageSourceCredentials>" + Environment.NewLine +
 "    <" + repoConfig.SourceName + ">" + Environment.NewLine +
 "      <add key=\"Username\" value=\"" + repoConfig.Username + "\" />" + Environment.NewLine +
-"      <add key=\"Password\" value=\"" + repoConfig.ClearTextPassword + "\" />" + Environment.NewLine +
+"      <add key=\"ClearTextPassword\" value=\"" + repoConfig.ClearTextPassword + "\" />" + Environment.NewLine +
+"      <add key=\"Password\" value=\"\" />" + Environment.NewLine +
 "    </" + repoConfig.SourceName + ">" + Environment.NewLine +
 "  </packageSourceCredentials>" + Environment.NewLine +
 "</configuration>";


* Fixed a number of culture-variant bugs in lsl implicit type conversions.

--- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -27,7 +27,9 @@

 using System;
 using System.Collections;
+using System.Globalization;
 using System.Text.RegularExpressions;
+using OpenSim.Framework;

 namespace OpenSim.Region.ScriptEngine.Shared
 {
@@ -307,10 +309,10 @@
                     return;
                 }
                 bool res;
-                res = Double.TryParse(tmps[0], out x);
-                res = res & Double.TryParse(tmps[1], out y);
-                res = res & Double.TryParse(tmps[2], out z);
-                res = res & Double.TryParse(tmps[3], out s);
+                res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.FormatProvider, out x);
+                res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.FormatProvider, out y);
+                res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.FormatProvider, out z);
+                res = res & Double.TryParse(tmps[3], NumberStyles.Float, Culture.FormatProvider, out s);
                 if (x == 0 && y == 0 && z == 0 && s == 0)
                     s = 1;
             }
@@ -335,7 +337,7 @@

             public override string ToString()
             {
-                string st=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
+                string st=String.Format(Culture.FormatProvider, "<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
                 return st;
             }

@@ -1319,13 +1321,13 @@

             public LSLString(double d)
             {
-                string s=String.Format("{0:0.000000}", d);
+                string s=String.Format(Culture.FormatProvider, "{0:0.000000}", d);
                 m_string=s;
             }

             public LSLString(LSLFloat f)
             {
-                string s=String.Format("{0:0.000000}", f.value);
+                string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value);
                 m_string=s;
             }

@@ -1787,7 +1789,7 @@
                     else
                         if (v.EndsWith("."))
                             v = v + "0";
-                this.value = double.Parse(v, System.Globalization.NumberStyles.Float);
+                this.value = double.Parse(v, System.Globalization.NumberStyles.Float, Culture.FormatProvider);
             }

             #endregion
@@ -1932,7 +1934,7 @@

             public override string ToString()
             {
-                return String.Format("{0:0.000000}", this.value);
+                return String.Format(Culture.FormatProvider, "{0:0.000000}", this.value);
             }

             public override bool Equals(Object o)


Fix a possible nullref caused by accessing m_data rather than Data

--- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -764,10 +764,10 @@
             public void Add(object o)
             {
                 object[] tmp;
-                tmp = new object[m_data.Length + 1];
-                m_data.CopyTo(tmp, 0);
-                tmp[m_data.Length] = o;
-                m_data = tmp;
+                tmp = new object[Data.Length + 1];
+                Data.CopyTo(tmp, 0);
+                tmp[Data.Length] = o; // Since this is tmp.Length - 1
+                Data = tmp;
             }

             public bool Contains(object o)