better description and more parameters

better description and more parameters

--- Indicator/DistributionDay_Indicator.cs
+++ Indicator/DistributionDay_Indicator.cs
@@ -14,12 +14,9 @@
 namespace AgenaTrader.UserCode
 {
 	/// <summary>
-/// Version: 1.0
+/// Version: 1.1
 /// -------------------------------------------------------------------------
 /// Simon Pucher 2016
-/// -------------------------------------------------------------------------
-/// https://www.youtube.com/watch?v=RpHOt08GRlE
-/// http://investdaily.custhelp.com/app/answers/detail/a_id/276/~/what-exactly-is-a-distribution-day-in-a-market-index%3F
 /// -------------------------------------------------------------------------
 /// ****** Important ******
 /// To compile this script without any error you also need access to the utility indicator to use these global source code elements.
@@ -27,15 +24,19 @@
 /// -------------------------------------------------------------------------
 /// Namespace holds all indicators and is required. Do not change it.
 /// </summary>
-    [Description("Enter the description for the new custom indicator here")]
+    [Description("Take your money and run when the smart money start the distribution.")]
 	public class DistributionDay_Indicator : UserIndicator
 	{
         private Queue<DateTime> _distributionlist = null;
+        private int _period = 25;
+        private double _percent = 0.2;
+

         protected override void OnInit()
 		{
-			Add(new Plot(Color.FromKnownColor(KnownColor.Orange), "MyPlot1"));
-			CalculateOnClosedBar = true;
+			//Add(new Plot(Color.FromKnownColor(KnownColor.Orange), "MyPlot1"));
+			CalculateOnClosedBar = false;
+            this.IsOverlay = true;
 		}

         protected override void OnCalculate()
@@ -49,43 +50,63 @@
             }

             //Delete all old
-            if (this._distributionlist.Count() > 0 && this._distributionlist.Peek() <= Time[0].AddDays(-25))
+            if (this._distributionlist.Count() > 0 && this._distributionlist.Peek() <= Time[0].AddDays(this.Period * (-1)))
             {
                 this._distributionlist.Dequeue();
             }

             //Draw Disrtibution Arrow.
-            if (Volume[0] > Volume[1] && ((Close[1] - Close[0]) / Close[1]) > 0.002)
-            {
-                AddChartArrowDown(ProcessingBarIndex.ToString(), true, 0, High[0] + 3 * TickSize, Color.Blue);
+            if (Volume[0] > Volume[1] && ((Close[1] - Close[0]) / Close[1]) > (this.Percent / 100.0))
+            {
+                Color colori = Color.LightPink;
                 this._distributionlist.Enqueue(Time[0]);
-
+
                 //Draw the indicator
                 if (this._distributionlist.Count > 4)
                 {
-                    MyPlot1.Set(1);
+                    //MyPlot1.Set(1);
+                    colori = Color.DeepPink;
                 }
-                else {
-                    MyPlot1.Set(0);
-                }
+                AddChartArrowDown(ProcessingBarIndex.ToString(), true, 0, High[0], colori);
             }
             else
             {
-                MyPlot1.Set(0);
+                //MyPlot1.Set(0);
             }
 		}

 		#region Properties

-		[Browsable(false)]
-		[XmlIgnore()]
-		public DataSeries MyPlot1
-		{
-			get { return Outputs[0]; }
-		}
-
-		#endregion
-	}
+		//[Browsable(false)]
+		//[XmlIgnore()]
+		//public DataSeries MyPlot1
+		//{
+		//	get { return Outputs[0]; }
+		//}
+
+        /// <summary>
+        /// </summary>
+        [Description("Period which will be used to count distribution days.")]
+        [Category("Parameters")]
+        [DisplayName("Period")]
+        public int Period
+        {
+            get { return _period; }
+            set { _period = value; }
+        }
+
+        [Description("Percent down to count as a distribution day.")]
+        [Category("Parameters")]
+        [DisplayName("Percent")]
+        public double Percent
+        {
+            get { return _percent; }
+            set { _percent = value; }
+        }
+
+
+        #endregion
+    }
 }
 #region AgenaTrader Automaticaly Generated Code. Do not change it manualy

@@ -96,19 +117,19 @@
 	public partial class UserIndicator
 	{
 		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator()
-        {
-			return DistributionDay_Indicator(InSeries);
-		}
-
-		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input)
-		{
-			var indicator = CachedCalculationUnits.GetCachedIndicator<DistributionDay_Indicator>(input);
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(System.Int32 period, System.Double percent)
+        {
+			return DistributionDay_Indicator(InSeries, period, percent);
+		}
+
+		/// <summary>
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input, System.Int32 period, System.Double percent)
+		{
+			var indicator = CachedCalculationUnits.GetCachedIndicator<DistributionDay_Indicator>(input, i => i.Period == period && Math.Abs(i.Percent - percent) <= Double.Epsilon);

 			if (indicator != null)
 				return indicator;
@@ -117,7 +138,9 @@
 						{
 							RequiredBarsCount = RequiredBarsCount,
 							CalculateOnClosedBar = CalculateOnClosedBar,
-							InSeries = input
+							InSeries = input,
+							Period = period,
+							Percent = percent
 						};
 			indicator.SetUp();

@@ -134,22 +157,22 @@
 	public partial class UserStrategy
 	{
 		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator()
-		{
-			return LeadIndicator.DistributionDay_Indicator(InSeries);
-		}
-
-		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input)
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(System.Int32 period, System.Double percent)
+		{
+			return LeadIndicator.DistributionDay_Indicator(InSeries, period, percent);
+		}
+
+		/// <summary>
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input, System.Int32 period, System.Double percent)
 		{
 			if (IsInInit && input == null)
-				throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
-
-			return LeadIndicator.DistributionDay_Indicator(input);
+				throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'OnInit()' method");
+
+			return LeadIndicator.DistributionDay_Indicator(input, period, percent);
 		}
 	}

@@ -160,19 +183,19 @@
 	public partial class UserColumn
 	{
 		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator()
-		{
-			return LeadIndicator.DistributionDay_Indicator(InSeries);
-		}
-
-		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input)
-		{
-			return LeadIndicator.DistributionDay_Indicator(input);
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(System.Int32 period, System.Double percent)
+		{
+			return LeadIndicator.DistributionDay_Indicator(InSeries, period, percent);
+		}
+
+		/// <summary>
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input, System.Int32 period, System.Double percent)
+		{
+			return LeadIndicator.DistributionDay_Indicator(input, period, percent);
 		}
 	}

@@ -183,19 +206,19 @@
 	public partial class UserScriptedCondition
 	{
 		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator()
-		{
-			return LeadIndicator.DistributionDay_Indicator(InSeries);
-		}
-
-		/// <summary>
-		/// Enter the description for the new custom indicator here
-		/// </summary>
-		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input)
-		{
-			return LeadIndicator.DistributionDay_Indicator(input);
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(System.Int32 period, System.Double percent)
+		{
+			return LeadIndicator.DistributionDay_Indicator(InSeries, period, percent);
+		}
+
+		/// <summary>
+		/// Take your money and run when the smart money start the distribution.
+		/// </summary>
+		public DistributionDay_Indicator DistributionDay_Indicator(IDataSeries input, System.Int32 period, System.Double percent)
+		{
+			return LeadIndicator.DistributionDay_Indicator(input, period, percent);
 		}
 	}


Added joystick search to Start()

Added joystick search to Start()

--- JoystickLibrary/JoystickQueryThread.cs
+++ JoystickLibrary/JoystickQueryThread.cs
@@ -55,6 +55,7 @@

         public void Start()
         {
+            LocateJoysticks();
             Thread thread = new Thread(QueryJoystick);
             thread.Start();
         }


Minor GUI Änderung

Minor GUI Änderung

--- KugelmatikControl/MainForm.Designer.cs
+++ KugelmatikControl/MainForm.Designer.cs
@@ -34,6 +34,7 @@
             this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.heightViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.viewOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.restartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -62,7 +63,7 @@
             this.networkStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
             this.choreographyStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
             this.clustersPanel = new KugelmatikControl.NoScrollingPanel();
-            this.viewOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
             this.menuStrip1.SuspendLayout();
             this.statusStrip.SuspendLayout();
             this.SuspendLayout();
@@ -115,6 +116,13 @@
             this.optionsToolStripMenuItem.Text = "Options";
             this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click);
             //
+            // viewOnlyToolStripMenuItem
+            //
+            this.viewOnlyToolStripMenuItem.Name = "viewOnlyToolStripMenuItem";
+            this.viewOnlyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.viewOnlyToolStripMenuItem.Text = "View only";
+            this.viewOnlyToolStripMenuItem.Click += new System.EventHandler(this.viewOnlyToolStripMenuItem_Click);
+            //
             // toolStripSeparator1
             //
             this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -144,6 +152,7 @@
             this.toolStripSeparator2,
             this.homeToolStripMenuItem,
             this.stopToolStripMenuItem1,
+            this.toolStripSeparator4,
             this.configToolStripMenuItem,
             this.resetRevisionToolStripMenuItem});
             this.sendToolStripMenuItem.Name = "sendToolStripMenuItem";
@@ -153,61 +162,61 @@
             // dataToolStripMenuItem
             //
             this.dataToolStripMenuItem.Name = "dataToolStripMenuItem";
-            this.dataToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
-            this.dataToolStripMenuItem.Text = "Data";
+            this.dataToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.dataToolStripMenuItem.Text = "Send data";
             this.dataToolStripMenuItem.Click += new System.EventHandler(this.dataToolStripMenuItem_Click);
             //
             // moveAllTo0ToolStripMenuItem
             //
             this.moveAllTo0ToolStripMenuItem.Name = "moveAllTo0ToolStripMenuItem";
-            this.moveAllTo0ToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.moveAllTo0ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.moveAllTo0ToolStripMenuItem.Text = "Move all to 0";
             this.moveAllTo0ToolStripMenuItem.Click += new System.EventHandler(this.moveAllTo0ToolStripMenuItem_Click);
             //
             // infoToolStripMenuItem
             //
             this.infoToolStripMenuItem.Name = "infoToolStripMenuItem";
-            this.infoToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.infoToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.infoToolStripMenuItem.Text = "Info";
             this.infoToolStripMenuItem.Click += new System.EventHandler(this.infoToolStripMenuItem_Click);
             //
             // getDataToolStripMenuItem
             //
             this.getDataToolStripMenuItem.Name = "getDataToolStripMenuItem";
-            this.getDataToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.getDataToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.getDataToolStripMenuItem.Text = "Get data";
             this.getDataToolStripMenuItem.Click += new System.EventHandler(this.getDataToolStripMenuItem_Click);
             //
             // toolStripSeparator2
             //
             this.toolStripSeparator2.Name = "toolStripSeparator2";
-            this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6);
+            this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
             //
             // homeToolStripMenuItem
             //
             this.homeToolStripMenuItem.Name = "homeToolStripMenuItem";
-            this.homeToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.homeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.homeToolStripMenuItem.Text = "Home";
             this.homeToolStripMenuItem.Click += new System.EventHandler(this.homeToolStripMenuItem_Click);
             //
             // stopToolStripMenuItem1
             //
             this.stopToolStripMenuItem1.Name = "stopToolStripMenuItem1";
-            this.stopToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
+            this.stopToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
             this.stopToolStripMenuItem1.Text = "Stop";
             this.stopToolStripMenuItem1.Click += new System.EventHandler(this.stopToolStripMenuItem1_Click);
             //
             // configToolStripMenuItem
             //
             this.configToolStripMenuItem.Name = "configToolStripMenuItem";
-            this.configToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.configToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.configToolStripMenuItem.Text = "Config";
             this.configToolStripMenuItem.Click += new System.EventHandler(this.configToolStripMenuItem_Click);
             //
             // resetRevisionToolStripMenuItem
             //
             this.resetRevisionToolStripMenuItem.Name = "resetRevisionToolStripMenuItem";
-            this.resetRevisionToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
+            this.resetRevisionToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.resetRevisionToolStripMenuItem.Text = "Reset revision";
             this.resetRevisionToolStripMenuItem.Click += new System.EventHandler(this.resetRevisionToolStripMenuItem_Click);
             //
@@ -229,46 +238,46 @@
             this.distanceToolStripMenuItem,
             this.rippleToolStripMenuItem});
             this.startToolStripMenuItem.Name = "startToolStripMenuItem";
-            this.startToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+            this.startToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.startToolStripMenuItem.Text = "Start";
             //
             // sineWaveToolStripMenuItem
             //
             this.sineWaveToolStripMenuItem.Name = "sineWaveToolStripMenuItem";
-            this.sineWaveToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
+            this.sineWaveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.sineWaveToolStripMenuItem.Text = "SineWave";
             this.sineWaveToolStripMenuItem.Click += new System.EventHandler(this.sineWaveToolStripMenuItem_Click);
             //
             // distanceToolStripMenuItem
             //
             this.distanceToolStripMenuItem.Name = "distanceToolStripMenuItem";
-            this.distanceToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
+            this.distanceToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.distanceToolStripMenuItem.Text = "Distance";
             this.distanceToolStripMenuItem.Click += new System.EventHandler(this.distanceToolStripMenuItem_Click);
             //
             // rippleToolStripMenuItem
             //
             this.rippleToolStripMenuItem.Name = "rippleToolStripMenuItem";
-            this.rippleToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
+            this.rippleToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.rippleToolStripMenuItem.Text = "Ripple";
             this.rippleToolStripMenuItem.Click += new System.EventHandler(this.rippleToolStripMenuItem_Click);
             //
             // stopToolStripMenuItem
             //
             this.stopToolStripMenuItem.Name = "stopToolStripMenuItem";
-            this.stopToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+            this.stopToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.stopToolStripMenuItem.Text = "Stop";
             this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click);
             //
             // toolStripSeparator3
             //
             this.toolStripSeparator3.Name = "toolStripSeparator3";
-            this.toolStripSeparator3.Size = new System.Drawing.Size(126, 6);
+            this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
             //
             // pingPongToolStripMenuItem
             //
             this.pingPongToolStripMenuItem.Name = "pingPongToolStripMenuItem";
-            this.pingPongToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+            this.pingPongToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.pingPongToolStripMenuItem.Text = "Ping pong";
             this.pingPongToolStripMenuItem.Click += new System.EventHandler(this.pingPongToolStripMenuItem_Click);
             //
@@ -283,7 +292,7 @@
             // aboutToolStripMenuItem
             //
             this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
-            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
+            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
             this.aboutToolStripMenuItem.Text = "About";
             this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
             //
@@ -325,12 +334,10 @@
             this.clustersPanel.Size = new System.Drawing.Size(621, 463);
             this.clustersPanel.TabIndex = 1;
             //
-            // viewOnlyToolStripMenuItem
-            //
-            this.viewOnlyToolStripMenuItem.Name = "viewOnlyToolStripMenuItem";
-            this.viewOnlyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-            this.viewOnlyToolStripMenuItem.Text = "View only";
-            this.viewOnlyToolStripMenuItem.Click += new System.EventHandler(this.viewOnlyToolStripMenuItem_Click);
+            // toolStripSeparator4
+            //
+            this.toolStripSeparator4.Name = "toolStripSeparator4";
+            this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6);
             //
             // MainForm
             //
@@ -388,6 +395,7 @@
         private NoScrollingPanel clustersPanel;
         private System.Windows.Forms.ToolStripMenuItem rippleToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem viewOnlyToolStripMenuItem;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
     }
 }


Added CoversDate to Calendar.

Added CoversDate to Calendar.

--- GTFS/Entities/Calendar.cs
+++ GTFS/Entities/Calendar.cs
@@ -100,5 +100,36 @@
         [Required]
         [FieldName("end_date")]
         public DateTime EndDate { get; set; }
+
+        /// <summary>
+        /// Returns true if this calendar covers the given date.
+        /// </summary>
+        /// <param name="date"></param>
+        /// <returns></returns>
+        public bool CoversDate(DateTime date)
+        {
+            date = date.Date;
+            if (this.StartDate <= date && this.EndDate >= date)
+            { // ok in range.
+                switch(date.DayOfWeek)
+                {
+                    case DayOfWeek.Monday:
+                        return this.Monday;
+                    case DayOfWeek.Tuesday:
+                        return this.Tuesday;
+                    case DayOfWeek.Wednesday:
+                        return this.Wednesday;
+                    case DayOfWeek.Thursday:
+                        return this.Thursday;
+                    case DayOfWeek.Friday:
+                        return this.Friday;
+                    case DayOfWeek.Saturday:
+                        return this.Saturday;
+                    case DayOfWeek.Sunday:
+                        return this.Sunday;
+                }
+            }
+            return false;
+        }
     }
 }


Fix to apply for library updates.

Fix to apply for library updates.

--- Libraries/Sources/Models/NotifyItem.cs
+++ Libraries/Sources/Models/NotifyItem.cs
@@ -346,7 +346,7 @@
         private readonly object _lock = new object();
         private readonly SortedDictionary<NotifyPriority, Queue<NotifyItem>> _inner =
             new SortedDictionary<NotifyPriority, Queue<NotifyItem>>(
-              new GenericComparer<NotifyPriority>((x, y) => y.CompareTo(x))
+              new LambdaComparer<NotifyPriority>((x, y) => y.CompareTo(x))
             );
         #endregion
     }


Fix audio underflow. This might occur once on startup still, but should be less frequent.

--- Lyon/Presenters/Impl/AudioPresenter.cs
+++ Lyon/Presenters/Impl/AudioPresenter.cs
@@ -34,9 +34,9 @@
         {
             lock (_bufferLock)
             {
-                if (_buffer.Count < e.Samples.Length)
+                if (_buffer.Count < e.Length)
                 {
-                    Debug.WriteLine($"Audio buffer underflow: need {e.Samples.Length}, got {_buffer.Count}");
+                    Debug.WriteLine($"Audio buffer underflow: need {e.Length}, got {_buffer.Count}");
                     return;
                 }


Notes are now sorted by Modified Date.

Notes are now sorted by Modified Date.

Currently this is hard-coded and the columns cannot change this.

--- Macboy/ControlCenterNotesDatasource.cs
+++ Macboy/ControlCenterNotesDatasource.cs
@@ -38,6 +38,8 @@
 	{
 		// should represent the Tomboy image, but this isn't loading correctly
 		private NSImage image = new NSImage ("Tomboy.tomboy.icns");
+		// Sorted list of the notes
+		List<KeyValuePair<string, Note>> orderedList = null;

 		ControlCenterController MyControlCenterController {
 			get;
@@ -53,6 +55,8 @@
 			if (controller == null)
 				throw new ArgumentNullException ("controller");
 			MyControlCenterController = controller;
+			// Sort the notes by Date
+			orderedList = MyControlCenterController.Notes.ToList ().OrderByDescending(x => x.Value.ChangeDate).ToList();
 		}

 		// This method will be called by the NSTableView control to learn the number of rows to display.
@@ -67,15 +71,15 @@
 		public NSObject ObjectValueForTableColumn(NSTableView table, NSTableColumn col, int row)
 		{
 			// Get the current row index
-			var note_at = MyControlCenterController.Notes.Keys.ElementAt (row);
 			var colKey = (NSString)col.Identifier.ToString ();
+			var note_at = orderedList.ElementAt (row).Value;
 			switch (colKey) {
 			case "_notesImageColumn":
 				return image; //FIXME: This is not working. An image is not being returned.
 			case "modifiedDate":
-				return (NSString)MyControlCenterController.Notes[note_at].ChangeDate.ToShortDateString ();
+				return (NSString)note_at.ChangeDate.ToShortDateString ();
 			case "title":
-				return (NSString)MyControlCenterController.Notes[note_at].Title;
+				return (NSString)note_at.Title;
 			default:
 				return null;
 			}


adds an index search

adds an index search

--- IFallen-8/IFallen8Read.cs
+++ IFallen-8/IFallen8Read.cs
@@ -57,6 +57,26 @@
 		/// Binary operator.
 		/// </param>
 		Boolean Search (out IEnumerable<IGraphElementModel> result, Int64 propertyId, IComparable literal, BinaryOperator binOp = BinaryOperator.Equals);
+
+		/// <summary>
+		/// Search for graph elements by a specified index identifiert, a literal and a binary operation
+		/// </summary>
+		/// <returns>
+		/// <c>true</c> if something was found; otherwise, <c>false</c>.
+		/// </returns>
+		/// <param name='result'>
+		/// Result.
+		/// </param>
+		/// <param name='indexId'>
+		/// Index identifier.
+		/// </param>
+		/// <param name='literal'>
+		/// Literal.
+		/// </param>
+		/// <param name='binOp'>
+		/// Binary operator.
+		/// </param>
+		Boolean Search (out IEnumerable<IGraphElementModel> result, Int64 indexId, IComparable literal, BinaryOperator binOp = BinaryOperator.Equals);

 		/// <summary>
 		/// Search for graph elements by a specified propertyName, literal and binary operation.


Made tags truly optional for SelfCancelRunningExecutionException

--- Naos.Database.Domain/Stream/Handling/Execution/SelfCancelRunningExecutionException.cs
+++ Naos.Database.Domain/Stream/Handling/Execution/SelfCancelRunningExecutionException.cs
@@ -27,7 +27,7 @@
         /// <param name="tags">The optional tags for the event produced.</param>
         public SelfCancelRunningExecutionException(
             string details,
-            IReadOnlyDictionary<string, string> tags)
+            IReadOnlyDictionary<string, string> tags = null)
         {
             details.MustForArg(nameof(details)).NotBeNullNorWhiteSpace();


Added FromTicket method.

Added FromTicket method.

--- NtApiDotNet/Win32/Security/Authentication/Kerberos/Client/KerberosLocalTicketCache.cs
+++ NtApiDotNet/Win32/Security/Authentication/Kerberos/Client/KerberosLocalTicketCache.cs
@@ -150,7 +150,7 @@
         }

         /// <summary>
-        /// Populate a local cache a list of tickets.
+        /// Populate a local cache from a list of tickets.
         /// </summary>
         /// <param name="tickets">The list of tickets.</param>
         /// <param name="create_client">True to create a KDC client based on the system's domain.</param>
@@ -172,6 +172,17 @@
                     KerberosKDCClient.CreateTCPClient(domain.PdcRoleOwner.IPAddress), domain.Name, tickets);
             }
             return new KerberosLocalTicketCache(tickets);
+        }
+
+        /// <summary>
+        /// Populate a local cache from a ticket.
+        /// </summary>
+        /// <param name="ticket">The ticket to add.</param>
+        /// <param name="create_client">True to create a KDC client based on the system's domain.</param>
+        /// <returns>The local ticket cache.</returns>
+        public static KerberosLocalTicketCache FromTicket(KerberosExternalTicket ticket, bool create_client = false)
+        {
+            return FromTickets(new[] { ticket }, create_client);
         }

         /// <summary>


Randomize the test site collection name to work around too agressive throttling policies

--- OfficeDevPnP.Core/OfficeDevPnP.Core.Tests/AppModelExtensions/TenantExtensionsTests.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core.Tests/AppModelExtensions/TenantExtensionsTests.cs
@@ -15,12 +15,13 @@
     [TestClass()]
     public class TenantExtensionsTests
     {
-        private string sitecollectionName = "TestPnPSC_123456789";
+        private string sitecollectionName = "TestPnPSC_123456789_";

         #region Test initialize and cleanup
         [TestInitialize()]
         public void Initialize()
         {
+            sitecollectionName = sitecollectionName + (new Random().Next(0, 9)).ToString();
             using (var tenantContext = TestCommon.CreateTenantClientContext())
             {
                 //Ensure nothing was left behind before we run our tests


Type.Type is RuntimeType

Type.Type is RuntimeType

--- OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -163,7 +163,7 @@

         public void RegisterScriptInvocation(object target, MethodInfo mi)
         {
-            m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, target.GetType().Name);
+            m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name);

             Type delegateType;
             List<Type> typeArgs = mi.GetParameters()


Update category

Update category

--- MomWorld/Views/Categories/Index.cshtml
+++ MomWorld/Views/Categories/Index.cshtml
@@ -343,7 +343,7 @@
                     {
                         if (category.Articles.Count != 0 || User.Identity.Name.Equals("admin"))
                         {
-

+

@@ -358,7 +358,6 @@

                                                          Sửa danh mục

-

                                                          Xóa
                                                         danh mục
@@ -368,55 +367,41 @@

-

-

-

-
                                                 @foreach (var article in articles)
                                                 {
                                                     if (article.CategoryId.Equals(category.Id))
                                                     {

-

-

-

-

-

-

-

@article.Title

                                                                     @article.Content

-

                                                     }
                                                 }

-

-

                                                 <button type="button" class="btn prev">

@@ -425,16 +410,13 @@

                                                 </button>

-

-

-

-

+                            div class="separator">

                         }
                         count += 1;
@@ -561,95 +543,6 @@

-
-
-
-

-

-

-
-

-
-

-
-

-                                Mom's World
-

-

-

-
-
-

-
-

-
-

-                                Nhận bản tin
-

-

-                                Theo dõi bản tin của chúng tôi và luôn cập nhật các tin
-                                tức mới nhất !
-

-
-

-                                <input type="text" class="form-control"
-                                       placeholder="NHập địa chỉ email của bạn">
-                                    <button class="btn btn-theme" type="button">Đăng kí</button>
-
-

-
-

-
-

-
-
-

-

-

-                                Liên hệ với chúng tôi
-

-                            <address>
-                                Địa chỉ : FPT_University - Đà Nẵng

-                                    Điện
-                                    thoại :
-                                 +84 01655757445
 Email: exc-group@gmail.com

-                            </address>
-

-
-

-
-
-
-
-
-
-
-
-
-
-
-
-

-

-

-

-

-
-

-

-

-
-

-                        © Copyright 2014 by KhoaHN. All
-                        Rights Reserved.
-

-

-

-

-
-
-


Fix migration

Fix migration

--- VotingApplication/VotingApplication.Data/Migrations/201505151350009_OptionToChoice.cs
+++ VotingApplication/VotingApplication.Data/Migrations/201505151350009_OptionToChoice.cs
@@ -13,13 +13,13 @@
             CreateTable(
                 "dbo.Choices",
                 c => new
-                    {
-                        Id = c.Long(nullable: false, identity: true),
-                        Name = c.String(),
-                        Description = c.String(),
-                        PollChoiceNumber = c.Int(nullable: false),
-                        Poll_Id = c.Long(),
-                    })
+                {
+                    Id = c.Long(nullable: false, identity: true),
+                    Name = c.String(),
+                    Description = c.String(),
+                    PollChoiceNumber = c.Int(nullable: false),
+                    Poll_Id = c.Long(),
+                })
                 .PrimaryKey(t => t.Id)
                 .ForeignKey("dbo.Polls", t => t.Poll_Id)
                 .Index(t => t.Poll_Id);
@@ -29,15 +29,24 @@
             CreateIndex("dbo.Votes", "Choice_Id");
             AddForeignKey("dbo.Votes", "Choice_Id", "dbo.Choices", "Id");

-            Sql(@"INSERT INTO dbo.Choices (Name, Description, PollChoiceNumber, Poll_Id)
-                 SELECT Name, Description, PollOptionNumber, Poll_Id
-                 FROM dbo.Options");
+            Sql(@"
+                    ALTER TABLE dbo.Choices ADD OptionId BIGINT
+
+                    INSERT INTO dbo.Choices (Name, Description, PollChoiceNumber, Poll_Id, OptionId)
+                    SELECT Name, Description, PollOptionNumber, Poll_Id, Id
+                                 FROM dbo.Options
+
+                    UPDATE v
+                    SET v.Choice_Id = c.Id
+                    FROM dbo.Votes v
+                    JOIN dbo.Choices c ON c.OptionId = v.Option_Id
+
+                    ALTER TABLE dbo.Choices DROP COLUMN OptionId
+                ");

             Sql(@"UPDATE dbo.Polls
                   SET ChoiceAdding = OptionAdding");

-            Sql(@"UPDATE dbo.Votes
-                  SET Choice_Id = Option_Id");

             DropColumn("dbo.Votes", "Option_Id");
             DropColumn("dbo.Polls", "OptionAdding");
@@ -49,13 +58,13 @@
             CreateTable(
                 "dbo.Options",
                 c => new
-                    {
-                        Id = c.Long(nullable: false, identity: true),
-                        Name = c.String(),
-                        Description = c.String(),
-                        PollOptionNumber = c.Int(nullable: false),
-                        Poll_Id = c.Long(),
-                    })
+                {
+                    Id = c.Long(nullable: false, identity: true),
+                    Name = c.String(),
+                    Description = c.String(),
+                    PollOptionNumber = c.Int(nullable: false),
+                    Poll_Id = c.Long(),
+                })
                 .PrimaryKey(t => t.Id);

             AddColumn("dbo.Polls", "OptionAdding", c => c.Boolean(nullable: false));
@@ -70,15 +79,23 @@
             AddForeignKey("dbo.Options", "Poll_Id", "dbo.Polls", "Id");
             AddForeignKey("dbo.Votes", "Option_Id", "dbo.Options", "Id");

+            Sql(@"
+                    ALTER TABLE dbo.Options ADD ChoiceId BIGINT
+
+                    INSERT INTO dbo.Options (Name, Description, PollOptionNumber, Poll_Id, ChoiceId)
+                    SELECT Name, Description, PollChoiceNumber, Poll_Id, Id
+                                 FROM dbo.Choices
+
+                    UPDATE v
+                    SET v.Option_Id = o.Id
+                    FROM dbo.Votes v
+                    JOIN dbo.Options o ON c.ChoiceId = v.Choice_Id
+
+                    ALTER TABLE dbo.Options DROP COLUMN ChoiceId
+                ");
+
             Sql(@"UPDATE dbo.Polls
                   SET OptionAdding = ChoiceAdding");
-
-            Sql(@"UPDATE dbo.Votes
-                  SET Option_Id = Choice_Id");
-
-            Sql(@"INSERT INTO dbo.Options (Name, Description, PollOptionNumber, Poll_Id)
-                 SELECT Name, Description, PollChoiceNumber, Poll_Id
-                 FROM dbo.Choices");

             DropColumn("dbo.Polls", "ChoiceAdding");
             DropColumn("dbo.Votes", "Choice_Id");


Really fix cast

Really fix cast

--- Nodejs/Product/Npm/SPI/Dependencies.cs
+++ Nodejs/Product/Npm/SPI/Dependencies.cs
@@ -29,7 +29,9 @@
                 var dependencies = package[propertyName] as JObject;
                 if (dependencies != null) {
                     foreach (var property in dependencies.Properties()) {
-                        _dependencyProperties.Add(new Dependency(property.Name, property.Value.Value<string>()));
+                        if (property.Value.Type == JTokenType.String) {
+                            _dependencyProperties.Add(new Dependency(property.Name, property.Value.Value<string>()));
+                        }
                     }
                 }
             }


Bump version to 0.33.1

Bump version to 0.33.1

--- common/SolutionInfo.cs
+++ common/SolutionInfo.cs
@@ -31,6 +31,6 @@
 namespace System
 {
     internal static class AssemblyVersionInformation {
-        internal const string Version = "0.33.0";
+        internal const string Version = "0.33.1";
     }
 }


git-svn-id: http://svn.code.sf.net/p/openmcdf/code/branches/1.5.0@79 99b98b21-fab8-469c-bfc5-76399401e515

--- OLECompoundFileStorage/CompoundFile.cs
+++ OLECompoundFileStorage/CompoundFile.cs
@@ -320,7 +320,10 @@
         public void Commit()
         {
             if (_disposed)
-                throw new CFException("Compound File closed: cannot save data");
+                throw new CFException("Compound File closed: cannot commit data");
+
+            if (updateMode != UpdateMode.Transacted)
+                throw new CFException("Cannot update data in Read-Only update mode");

             FileStream fs = null;
             BinaryWriter bw = null;
@@ -347,13 +350,13 @@
                     bw.Write(s.Data);
                 }

-                // Seek to beginning position and save header (first 512 bytes)
+                // Seek to beginning position and save header (first 512 or 4096 bytes)
                 bw.BaseStream.Seek(0, SeekOrigin.Begin);
                 header.Write(bw);
             }
             catch (Exception ex)
             {
-                throw new CFException("Error saving file [" + fileName + "]", ex);
+                throw new CFException("Error updating file [" + fileName + "]", ex);
             }
             finally
             {


public variable Cards is now a property

public variable Cards is now a property

--- Assets/Scripts/Game/InPlay.cs
+++ Assets/Scripts/Game/InPlay.cs
@@ -9,7 +9,11 @@

 public class InPlay : MonoBehaviour {

-    public List<GenericCard> Cards;
+    public List<GenericCard> Cards {
+        get { return _Cards; }
+    }
+
+    private List<GenericCard> _Cards = new List<GenericCard>();

     public Player _Player;

@@ -21,14 +25,9 @@

     public float InPlayTweenTime;

-    public void Start()
-    {
-        Cards = new List<GenericCard>();
-    }
-
     public void Add(GenericCard card)
     {
-        Cards.Add(card);
+        _Cards.Add(card);
         card.transform.parent = transform;

         switch (card.CardType)
@@ -46,7 +45,7 @@

     public void Remove(GenericCard card)
     {
-        Cards.Remove(card);
+        _Cards.Remove(card);

         switch (card.CardType)
         {
@@ -63,12 +62,12 @@

     public List<GenericCard> GetCreaturesInPlay()
     {
-        return Cards.FindAll(c => c.CardType == CardTypes.CREATURE);
+        return _Cards.FindAll(c => c.CardType == CardTypes.CREATURE);
     }

     public List<GenericCard> GetLessonsInPlay()
     {
-        return Cards.FindAll(c => c.CardType == CardTypes.LESSON);
+        return _Cards.FindAll(c => c.CardType == CardTypes.LESSON);
     }

     private void AnimateCreatureToBoard(GenericCard card)
@@ -87,7 +86,7 @@

     private void RearrangeLessons()
     {
-        Cards.FindAll(card => card.CardType == CardTypes.LESSON).ForEach(card =>
+        _Cards.FindAll(card => card.CardType == CardTypes.LESSON).ForEach(card =>
         {
             Vector3 cardPosition = GetTargetPositionForCard(card);
             Helper.TweenCardToPosition(card, cardPosition, CardStates.IN_PLAY);
@@ -95,7 +94,7 @@
     }
     private void RearrangeCreatures()
     {
-        Cards.FindAll(card => card.CardType == CardTypes.CREATURE).ForEach(card =>
+        _Cards.FindAll(card => card.CardType == CardTypes.CREATURE).ForEach(card =>
         {
             Vector3 cardPosition = GetTargetPositionForCard(card);
             Helper.TweenCardToPosition(card, cardPosition, CardStates.IN_PLAY);
@@ -104,7 +103,7 @@

     private Vector3 GetTargetPositionForCard(GenericCard card)
     {
-        int position = Cards.FindAll(c => c.CardType == card.CardType).IndexOf(card);
+        int position = _Cards.FindAll(c => c.CardType == card.CardType).IndexOf(card);

         Vector3 cardPosition = new Vector3();


Faded buttons if not available

Faded buttons if not available

--- Assets/Scripts/SkillButton.cs
+++ Assets/Scripts/SkillButton.cs
@@ -27,7 +27,18 @@
 	// Update is called once per frame
 	void Update ()
     {
-
+        if( upgrade.isOwnedOrAvailableToUnlock() )
+        {
+            Color buttonColour = GetComponent<Image>().color;
+            buttonColour.a = 1.0f;
+            GetComponent<Image>().color = buttonColour;
+        }
+        else
+        {
+            Color buttonColour = GetComponent<Image>().color;
+            buttonColour.a = 0.2f;
+            GetComponent<Image>().color = buttonColour;
+        }
 	}

     public void OnClick()


Fixed #8, windows are now created in-place of the parent.

--- BZCLauncher/Forms/PageMain.cs
+++ BZCLauncher/Forms/PageMain.cs
@@ -26,7 +26,10 @@

 		private void ButtonAddons_Click(object sender, EventArgs e) {
 			this.Hide();
-			using (var pageAddons = new PageAddons(this)) {
+			using (var pageAddons = new PageAddons(this) {
+				StartPosition = FormStartPosition.Manual,
+				Location = this.Location,
+			}) {
 				pageAddons.ShowDialog();
 			}
 			this.Show();
@@ -38,7 +41,10 @@

 		private void ConfigButton_Click(object sender, EventArgs e) {
 			this.Hide();
-			using (var pageConfig = new PageConfig(this, Config)) {
+			using (var pageConfig = new PageConfig(this, Config) {
+				StartPosition = FormStartPosition.Manual,
+				Location = this.Location,
+			}) {
 				pageConfig.ShowDialog();
 			}
 			this.Show();


Updated formatting in Brandbank API

Updated formatting in Brandbank API

--- Brandbank.Api/BrandbankApi.cs
+++ Brandbank.Api/BrandbankApi.cs
@@ -29,6 +29,7 @@
         {
             GetUnsent(productProcessor, createLogger<IGetUnsentClient>());
         }
+
         public void GetUnsent(Func<MessageType, IBrandbankMessageSummary> productProcessor, ILogger<IGetUnsentClient> logger)
         {
             GetUnsent(productProcessor, logger, Path.Combine("Schemas", "BrandbankXML_v6.xsd"), string.Empty);


csv parser now reuses arrays

csv parser now reuses arrays

--- BrightData/Input/CsvParser.cs
+++ BrightData/Input/CsvParser.cs
@@ -13,6 +13,7 @@
         readonly char[] _buffer;
         readonly char _quote;
         readonly List<StringBuilder> _columns = new List<StringBuilder>();
+        readonly Dictionary<int, string[]> _stringBuffers = new Dictionary<int, string[]>();
         int _currIndex;
         bool _inQuote;

@@ -80,9 +81,8 @@

         string[] GetLine()
         {
-            var ret = new string[_columns.Count];
-            for (int i = 0, len = _columns.Count; i < len; i++)
-            {
+            var ret = GetBuffer(_columns.Count);
+            for (int i = 0, len = _columns.Count; i < len; i++) {
                 var sb = _columns[i];
                 ret[i] = sb.ToString();
                 sb.Clear();
@@ -90,5 +90,12 @@
             _currIndex = 0;
             return ret;
         }
+
+        string[] GetBuffer(int length)
+        {
+            if (!_stringBuffers.TryGetValue(length, out var ret))
+                _stringBuffers.Add(length, ret = new string[length]);
+            return ret;
+        }
     }
 }


Apply http://opensimulator.org/mantis/view.php?id=4504 Stop the REST console crashing when entering return on an empty line Thanks BlueWall

--- OpenSim/ConsoleClient/ConsoleClient.cs
+++ OpenSim/ConsoleClient/ConsoleClient.cs
@@ -82,9 +82,11 @@

         private static void SendCommand(string module, string[] cmd)
         {
-            string sendCmd = cmd[0];
+            string sendCmd = "";
             if (cmd.Length > 1)
             {
+                sendCmd = cmd[0];
+
                 Array.Copy(cmd, 1, cmd, 0, cmd.Length-1);
                 Array.Resize(ref cmd, cmd.Length-1);
                 sendCmd += "\"" + String.Join("\" \"", cmd) + "\"";


* Refactor: Creating grid login exceptions to try and break up a large method.   * This in preparation for further login validation to check that the region logging in is properly contactable. * Also increase verbosity of some error messages

--- OpenSim/Grid/GridServer/GridManager.cs
+++ OpenSim/Grid/GridServer/GridManager.cs
@@ -248,10 +248,18 @@
         /// </summary>
         /// <param name="sim"></param>
         /// <returns></returns>
-        protected virtual bool ValidateOverwrite(RegionProfileData sim, RegionProfileData existingSim)
+        protected virtual void ValidateOverwrite(RegionProfileData sim, RegionProfileData existingSim)
         {
-            return (existingSim.regionRecvKey == sim.regionRecvKey &&
-                    existingSim.regionSendKey == sim.regionSendKey);
+            if (!(existingSim.regionRecvKey == sim.regionRecvKey && existingSim.regionSendKey == sim.regionSendKey))
+            {
+                throw new LoginException(
+                    String.Format(
+                        "Authentication failed when trying to login existing region {0} at location {1} {2} currently occupied by {3}"
+                            + " with the region's send key {4} (expected {5}) and the region's receive key {6} (expected {7})",
+                            sim.regionName, sim.regionLocX, sim.regionLocY, existingSim.regionName,
+                            sim.regionSendKey, existingSim.regionSendKey, sim.regionRecvKey, existingSim.regionRecvKey),
+                    "The keys required to login your region did not match the grid server keys.  Please check your grid send and receive keys.");
+            }
         }

         /// <summary>
@@ -260,15 +268,30 @@
         /// Currently, this means checking that the keys passed in by the new region
         /// match those in the grid server's configuration.
         /// </summary>
+        ///
         /// <param name="sim"></param>
+        /// <exception cref="LoginException">Thrown if region login failed</exception>
+        protected virtual void ValidateNewRegion(RegionProfileData sim)
+        {
+            if (!(sim.regionRecvKey == Config.SimSendKey && sim.regionSendKey == Config.SimRecvKey))
+            {
+                throw new LoginException(
+                    String.Format(
+                        "Authentication failed when trying to login new region {0} at location {1} {2}"
+                            + " with the region's send key {3} (expected {4}) and the region's receive key {5} (expected {6})",
+                            sim.regionName, sim.regionLocX, sim.regionLocY,
+                            sim.regionSendKey, Config.SimRecvKey, sim.regionRecvKey, Config.SimSendKey),
+                    "The keys required to login your region did not match your existing region keys.  Please check your grid send and receive keys.");
+            }
+
+        }
+
+        /// <summary>
+        /// Construct an XMLRPC error response
+        /// </summary>
+        /// <param name="error"></param>
         /// <returns></returns>
-        protected virtual bool ValidateNewRegion(RegionProfileData sim)
-        {
-            return (sim.regionRecvKey == Config.SimSendKey &&
-                    sim.regionSendKey == Config.SimRecvKey);
-        }
-
-        private static XmlRpcResponse ErrorResponse(string error)
+        public static XmlRpcResponse ErrorResponse(string error)
         {
             XmlRpcResponse errorResponse = new XmlRpcResponse();
             Hashtable errorResponseData = new Hashtable();
@@ -280,7 +303,7 @@
         /// <summary>
         /// Performed when a region connects to the grid server initially.
         /// </summary>
-        /// <param name="request">The XMLRPC Request</param>
+        /// <param name="request">The XML RPC Request</param>
         /// <returns>Startup parameters</returns>
         public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request)
         {
@@ -310,86 +333,72 @@

             existingSim = GetRegion(sim.regionHandle);

+
             if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID)
             {
-                bool validated;
-
-                if (existingSim == null)
-                {
-                    validated = ValidateNewRegion(sim);
-                }
-                else
-                {
-                    validated = ValidateOverwrite(sim, existingSim);
-                }
-
-                if (validated)
-                {
-                    foreach (KeyValuePair<string, IGridData> kvp in _plugins)
-                    {
-                        try
+                try
+                {
+                    if (existingSim == null)
+                    {
+                        ValidateNewRegion(sim);
+                    }
+                    else
+                    {
+                        ValidateOverwrite(sim, existingSim);
+                    }
+                }
+                catch (LoginException e)
+                {
+                    m_log.WarnFormat("[LOGIN END]: {0}", e.Message);
+
+                    return e.XmlRpcErrorResponse;
+                }
+
+                foreach (KeyValuePair<string, IGridData> kvp in _plugins)
+                {
+                    try
+                    {
+                        DataResponse insertResponse;
+
+                        if( existingSim == null )
                         {
-                            DataResponse insertResponse;
-
-                            if( existingSim == null )
-                            {
-                                insertResponse = kvp.Value.AddProfile(sim);
-                            }
-                            else
-                            {
-                                insertResponse = kvp.Value.UpdateProfile(sim);
-                            }
-
-                            switch (insertResponse)
-                            {
-                                case DataResponse.RESPONSE_OK:
-                                    m_log.Info("[LOGIN END]: " + (existingSim == null ? "New" : "Existing") + " sim login successful: " + sim.regionName);
-                                    break;
-                                case DataResponse.RESPONSE_ERROR:
-                                    m_log.Warn("[LOGIN END]: Sim login failed (Error): " + sim.regionName);
-                                    break;
-                                case DataResponse.RESPONSE_INVALIDCREDENTIALS:
-                                    m_log.Warn("[LOGIN END]: " +
-                                                          "Sim login failed (Invalid Credentials): " + sim.regionName);
-                                    break;
-                                case DataResponse.RESPONSE_AUTHREQUIRED:
-                                    m_log.Warn("[LOGIN END]: " +
-                                                          "Sim login failed (Authentication Required): " +
-                                                          sim.regionName);
-                                    break;
-                            }
+                            insertResponse = kvp.Value.AddProfile(sim);
                         }
-                        catch (Exception e)
+                        else
                         {
-                            m_log.Warn("[LOGIN END]: " +
-                                                  "Unable to login region " + sim.UUID.ToString() + " via " + kvp.Key);
-                            m_log.Warn("[LOGIN END]: " + e.ToString());
+                            insertResponse = kvp.Value.UpdateProfile(sim);
                         }
-                    }
-
-                    XmlRpcResponse response = CreateLoginResponse(sim);
-
-                    return response;
-                }
-                else
-                {
-                    if (existingSim == null)
-                    {
-                        m_log.WarnFormat(
-                            "[LOGIN END]: Authentication failed when trying to login new region {0} at location {1} {2}"
-                                + " with TheSim.regionSendKey {3} (expected {4}) and TheSim.regionRecvKey {5} (expected {6})",
-                                sim.regionName, sim.regionLocX, sim.regionLocY,
-                                sim.regionSendKey, Config.SimRecvKey, sim.regionRecvKey, Config.SimSendKey);
-                    }
-                    else
-                    {
-                        m_log.Warn("[LOGIN END]: Authentication failed when trying to login region " + sim.regionName +
-                                   " at location " + sim.regionLocX +
-                                   " " + sim.regionLocY + " currently occupied by " + existingSim.regionName);
-                    }
-
-                    return ErrorResponse("The key required to login your region did not match. Please check your grid send and receive keys.");
-                }
+
+                        switch (insertResponse)
+                        {
+                            case DataResponse.RESPONSE_OK:
+                                m_log.Info("[LOGIN END]: " + (existingSim == null ? "New" : "Existing") + " sim login successful: " + sim.regionName);
+                                break;
+                            case DataResponse.RESPONSE_ERROR:
+                                m_log.Warn("[LOGIN END]: Sim login failed (Error): " + sim.regionName);
+                                break;
+                            case DataResponse.RESPONSE_INVALIDCREDENTIALS:
+                                m_log.Warn("[LOGIN END]: " +
+                                                      "Sim login failed (Invalid Credentials): " + sim.regionName);
+                                break;
+                            case DataResponse.RESPONSE_AUTHREQUIRED:
+                                m_log.Warn("[LOGIN END]: " +
+                                                      "Sim login failed (Authentication Required): " +
+                                                      sim.regionName);
+                                break;
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        m_log.Warn("[LOGIN END]: " +
+                                              "Unable to login region " + sim.UUID.ToString() + " via " + kvp.Key);
+                        m_log.Warn("[LOGIN END]: " + e.ToString());
+                    }
+                }
+
+                XmlRpcResponse response = CreateLoginResponse(sim);
+
+                return response;
             }
             else
             {
@@ -1065,4 +1074,33 @@
             return response;
         }
     }
+
+    /// <summary>
+    /// Exception generated when a simulator fails to login to the grid
+    /// </summary>
+    public class LoginException : Exception
+    {
+        /// <summary>
+        /// Return an XmlRpcResponse version of the exception message suitable for sending to a client
+        /// </summary>
+        /// <param name="message"></param>
+        /// <param name="xmlRpcMessage"></param>
+        public XmlRpcResponse XmlRpcErrorResponse
+        {
+            get { return m_xmlRpcErrorResponse; }
+        }
+        private XmlRpcResponse m_xmlRpcErrorResponse;
+
+        public LoginException(string message, string xmlRpcMessage) : base(message)
+        {
+            // FIXME: Might be neater to refactor and put the method inside here
+            m_xmlRpcErrorResponse = GridManager.ErrorResponse(xmlRpcMessage);
+        }
+
+        public LoginException(string message, string xmlRpcMessage, Exception e) : base(message, e)
+        {
+            // FIXME: Might be neater to refactor and put the method inside here
+            m_xmlRpcErrorResponse = GridManager.ErrorResponse(xmlRpcMessage);
+        }
+    }
 }


Modified Mesh object to allow alternative mesher interfacing

--- OpenSim/Region/Physics/Meshing/Mesh.cs
+++ OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -39,6 +39,7 @@
         public List<Triangle> triangles;
         GCHandle pinnedVirtexes;
         GCHandle pinnedIndex;
+        public PrimMesh primMesh = null;
         //public float[] normals;

         public Mesh()
@@ -155,29 +156,69 @@

         public float[] getVertexListAsFloatLocked()
         {
-            float[] result = new float[vertices.Count*3];
-            for (int i = 0; i < vertices.Count; i++)
-            {
-                Vertex v = vertices[i];
-                if (v == null)
-                    continue;
-                result[3*i + 0] = v.X;
-                result[3*i + 1] = v.Y;
-                result[3*i + 2] = v.Z;
-            }
-            pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
+            float[] result;
+
+            if (primMesh == null)
+            {
+                result = new float[vertices.Count * 3];
+                for (int i = 0; i < vertices.Count; i++)
+                {
+                    Vertex v = vertices[i];
+                    if (v == null)
+                        continue;
+                    result[3 * i + 0] = v.X;
+                    result[3 * i + 1] = v.Y;
+                    result[3 * i + 2] = v.Z;
+                }
+                pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
+            }
+            else
+            {
+                int count = primMesh.coords.Count;
+                result = new float[count * 3];
+                for (int i = 0; i < count; i++)
+                {
+                    Coord c = primMesh.coords[i];
+                    int resultIndex = 3 * i;
+                    result[resultIndex++] = c.X;
+                    result[resultIndex++] = c.Y;
+                    result[resultIndex] = c.Z;
+
+                }
+                primMesh.coords = null;
+                pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
+            }
             return result;
         }

         public int[] getIndexListAsInt()
         {
-            int[] result = new int[triangles.Count*3];
-            for (int i = 0; i < triangles.Count; i++)
-            {
-                Triangle t = triangles[i];
-                result[3*i + 0] = vertices.IndexOf(t.v1);
-                result[3*i + 1] = vertices.IndexOf(t.v2);
-                result[3*i + 2] = vertices.IndexOf(t.v3);
+            int[] result;
+
+            if (primMesh == null)
+            {
+                result = new int[triangles.Count * 3];
+                for (int i = 0; i < triangles.Count; i++)
+                {
+                    Triangle t = triangles[i];
+                    result[3 * i + 0] = vertices.IndexOf(t.v1);
+                    result[3 * i + 1] = vertices.IndexOf(t.v2);
+                    result[3 * i + 2] = vertices.IndexOf(t.v3);
+                }
+            }
+            else
+            {
+                int numFaces = primMesh.faces.Count;
+                result = new int[numFaces * 3];
+                for (int i = 0; i < numFaces; i++)
+                {
+                    Face f = primMesh.faces[i];
+                    int resultIndex = i * 3;
+                    result[resultIndex++] = f.v1;
+                    result[resultIndex++] = f.v2;
+                    result[resultIndex] = f.v3;
+                }
+                primMesh.faces = null;
             }
             return result;
         }
@@ -186,6 +227,9 @@
         {
             int[] result = getIndexListAsInt();
             pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned);
+            //triangles = null;
+            //vertices = null;
+            //primMesh = null;
             return result;
         }


PrefsList inherits IList now

PrefsList inherits IList now

--- Packages/PrefsGUI/Runtime/PrefsList.cs
+++ Packages/PrefsGUI/Runtime/PrefsList.cs
@@ -8,7 +8,7 @@
     /// List style PrefsGUI
     /// </summary>
     [Serializable]
-    public class PrefsList<T> : PrefsAny<List<T>>, IList<T>
+    public class PrefsList<T> : PrefsAny<List<T>>, IList<T>, IList
     {
         public PrefsList(string key, List<T> defaultValue = default) : base(key, defaultValue) { }

@@ -57,15 +57,15 @@
             }
         }

+
         #region IList<T>

         protected void UpdateValue(Action<List<T>> action) { var v = Get(); action(v); Set(v); }
-
         public int Count => Get()?.Count ?? 0;
         public bool IsReadOnly => false;
         public T this[int index] { get => Get()[index]; set { UpdateValue((v) => v[index] = value); } }
         public int IndexOf(T item) => Get().IndexOf(item);
-        public void Insert(int index, T item) => UpdateValue((v) => v.Insert(index, item));
+        public void Insert(int index, T item) => UpdateValue((v) => v.Insert(index, item));
         public void RemoveAt(int index) => UpdateValue((v) => v.RemoveAt(index));
         public void Add(T item) => UpdateValue((v) => v.Add(item));
         public void Clear() => UpdateValue((v) => v.Clear());
@@ -83,9 +83,43 @@

         #endregion

+
         #region List like
         public void RemoveAll(Predicate<T> predicate) => UpdateValue(v => v.RemoveAll(predicate));

         #endregion
+
+
+        #region IList
+        public void CopyTo(Array array, int index)
+        {
+            throw new NotImplementedException();
+        }
+
+        public bool IsSynchronized => false;
+        public object SyncRoot => this;
+
+        object IList.this[int index]
+        {
+            get => this[index];
+            set => this[index] = (T)value;
+        }
+
+        public void Remove(object value) => Remove((T) value);
+
+        public bool IsFixedSize => false;
+
+        public int Add(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public bool Contains(object value) => Contains((T) value);
+
+        public int IndexOf(object value) => IndexOf((T) value);
+
+        public void Insert(int index, object value) => Insert(index, (T) value);
+
+        #endregion
     }
 }


Added simple commands

Added simple commands

--- PollingEngine/PollingEngine/Program.cs
+++ PollingEngine/PollingEngine/Program.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using PollingEngine.Core;

 namespace PollingEngine
@@ -12,8 +13,8 @@

             var manager = new ProgramManager();
             var contexts = new List<PollingContext>();
-            //contexts.Add(new PollingContext(new SteamPoller.SteamPoller(), TimeSpan.FromSeconds(15)));
-            contexts.Add(new PollingContext(new XbmcPoller.XbmcPoller(), TimeSpan.FromSeconds(5)));
+            contexts.Add(new PollingContext(new SteamPoller.SteamPoller(), TimeSpan.FromSeconds(15)));
+            contexts.Add(new PollingContext(new XbmcPoller.XbmcPoller(), TimeSpan.FromSeconds(15)));

             manager.Load(contexts);
             manager.Start();
@@ -28,6 +29,64 @@
                     manager.Exit();
                 else if (input == "end")
                     break;
+                else if (input == "cls")
+                    Console.Clear();
+                else
+                {
+                    var parts = (input ?? "").Trim().Split(' ');
+                    if (parts.Length >= 3)
+                    {
+                        var verb = parts[0];
+                        var subject = parts[1];
+                        var value = parts[2];
+
+
+                        if (verb == "start")
+                        {
+                            if (subject == "program")
+                            {
+                                var ctx = contexts.FirstOrDefault(x => x.Program.GetType().Name == value);
+                                if (ctx != null)
+                                    ctx.State = State.Starting;
+                                else
+                                    Console.WriteLine("Context '{0}' not found", value);
+                            }
+                        }
+                        else if (verb == "stop")
+                        {
+                            if (subject == "program")
+                            {
+                                var ctx = contexts.FirstOrDefault(x => x.Program.GetType().Name == value);
+                                if (ctx != null)
+                                    ctx.State = State.Stopping;
+                                else
+                                    Console.WriteLine("Context '{0}' not found", value);
+                            }
+                        }
+                        else if (verb == "get")
+                        {
+                            if (subject == "program")
+                            {
+                                var ctx = contexts.FirstOrDefault(x => x.Program.GetType().Name.Equals(value, StringComparison.InvariantCultureIgnoreCase));
+                                if (ctx != null)
+                                {
+                                    Console.WriteLine();
+                                    Console.WriteLine("--Program info-- ");
+                                    Console.WriteLine("State: " + ctx.State);
+                                    Console.WriteLine("Interval: " + ctx.Interval);
+                                    Console.WriteLine("Program: " + ctx.Program);
+                                    Console.WriteLine("TimeStarted: " + ctx.TimeStarted);
+                                    Console.WriteLine("TimeStopped: " + ctx.TimeStopped);
+                                    Console.WriteLine();
+                                    Console.WriteLine();
+                                }
+                                else
+                                    Console.WriteLine("Context '{0}' not found", value);
+                            }
+                        }
+
+                    }
+                }
             }

             Console.WriteLine("Program will exit after [enter]");


exception stacktrace to console

exception stacktrace to console

--- Reinforced.Typings.Cli/Bootstrapper.cs
+++ Reinforced.Typings.Cli/Bootstrapper.cs
@@ -55,11 +55,13 @@
             {
                 var error = VisualStudioFriendlyErrorMessage.Create(rtException);
                 Console.WriteLine(error.ToString());
+                Console.WriteLine(rtException.StackTrace);
                 Environment.Exit(1);
             }
             catch (Exception ex)
             {
                 BuildError(ex.Message);
+                Console.WriteLine(ex.StackTrace);
                 Environment.Exit(1);
             }


encryption toggle

encryption toggle

--- RemoteTaskServer/TaskServer/Packets.cs
+++ RemoteTaskServer/TaskServer/Packets.cs
@@ -21,11 +21,15 @@
         public string endpoint;
         public PacketType packetType;
         public string syncKey;
+        private bool encryptionOff = false;

         public Packets(AuthClient client, string packetJson)
         {
+            if (encryptionOff)
+            {
+
             //An entire base64 string is an aes encrypted packet
-        /*    if (StringUtilities.IsBase64String(packetJson))
+            if (StringUtilities.IsBase64String(packetJson))
             {
                 try
                 {
@@ -66,8 +70,10 @@
                     packetType = PacketType.InvalidOrEmptyPacket;
                     return;
                 }
-            }*/
-            JsPacket deserializedPacket = null;
+            }
+            }
+
+        JsPacket deserializedPacket = null;
             try
             {
                 deserializedPacket = JsonConvert.DeserializeObject<JsPacket>(packetJson);


--- Chutzpah/Models/ChutzpahTestSettingsFile.cs
+++ Chutzpah/Models/ChutzpahTestSettingsFile.cs
@@ -358,6 +358,12 @@

             foreach (var browserArgument in parent.BrowserArguments)
             {
+                // We should only override the child if the child does not already define a value for a key
+                if (this.BrowserArguments.ContainsKey(browserArgument.Key))
+                {
+                    continue;
+                }
+
                 this.BrowserArguments[browserArgument.Key] = browserArgument.Value;
             }


Switching to develop-local branch.

Switching to develop-local branch.

--- CodeCakeBuilder/dotnet/Build.NuGetHelper.cs
+++ CodeCakeBuilder/dotnet/Build.NuGetHelper.cs
@@ -362,7 +362,7 @@
                     var updater = await _updater;
                     foreach( var p in pushes )
                     {
-                        string packageString = p.Name + "." + p.Version.ToNormalizedString();
+                        string packageString = p.Name + "." + p.Version.WithBuildMetaData( null ).ToNormalizedString();
                         var fullPath = ArtifactType.GlobalInfo.ReleasesFolder.AppendPart( packageString + ".nupkg" );
                         await updater.Push(
                             fullPath,


remove empty envs

remove empty envs

--- CodeTrip.Utils.ConfigFileChanger/Program.cs
+++ CodeTrip.Utils.ConfigFileChanger/Program.cs
@@ -95,7 +95,7 @@
             new OptionSet()
             {
                 {"A|AllInSameFile=", v => deployCmdLineArgs.AllInSameFile = v != null},
-                {"Env=", v => deployCmdLineArgs.Environments.AddRange(v.Split('.'))},
+                {"Env=", v => deployCmdLineArgs.Environments.AddRange(v.Split(new []{'.'}, StringSplitOptions.RemoveEmptyEntries))},
                 {"Inst=", v => deployCmdLineArgs.InstructionsFilesLocation = v},
                 {"Config=", v => deployCmdLineArgs.ConfigFilesLocation = v},
             }.Parse(args);


Update MappingDetailsControl.Designer.cs

--- EAMapping/MappingDetailsControl.Designer.cs
+++ EAMapping/MappingDetailsControl.Designer.cs
@@ -84,6 +84,7 @@
             this.mappingLogicTextBox.Location = new System.Drawing.Point(38, 57);
             this.mappingLogicTextBox.Multiline = true;
             this.mappingLogicTextBox.Name = "mappingLogicTextBox";
+            this.mappingLogicTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
             this.mappingLogicTextBox.Size = new System.Drawing.Size(177, 91);
             this.mappingLogicTextBox.TabIndex = 4;
             this.mappingLogicTextBox.TextChanged += new System.EventHandler(this.mappingLogicTextBox_TextChanged);


Removing an unused class Essence.Geometry.Maths.Integer.MathUitls

--- Essence.Geometry/Maths/Integer/MathUtils.cs
+++ Essence.Geometry/Maths/Integer/MathUtils.cs
@@ -1,24 +0,0 @@
-// Copyright 2017 Jose Luis Rovira Martin
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-namespace Essence.Maths.Integer
-{
-    public static class MathUtils
-    {
-        public static int Clamp(this int v, int a, int b)
-        {
-            return v <= a ? a : (v >= b ? b : v);
-        }
-    }
-}


Enable node launching in tests

Enable node launching in tests

--- HttpTwo.Tests/HttpTests.cs
+++ HttpTwo.Tests/HttpTests.cs
@@ -10,7 +10,7 @@
     [TestFixture]
     public class HttpTests
     {
-        const bool UseInternalHttpRunner = false;
+        const bool UseInternalHttpRunner = true;

         NodeHttp2Runner node;

@@ -26,7 +26,7 @@

                 node.StartServer ();
                 // Wait for the server to initialize
-                System.Threading.Thread.Sleep (2000);
+                Thread.Sleep (2000);
             }
         }


Add support for chained redirects

Add support for chained redirects

--- ILRepack/MappingHandler.cs
+++ ILRepack/MappingHandler.cs
@@ -92,10 +92,21 @@
             throw new Exception("Unsupported scope: "+ scope);
         }

-        public TypeReference GetExportedRemappedType(TypeReference type)
+        private TypeReference GetRootReference(TypeReference type)
         {
             TypeReference other;
             if (type.Scope != null && exportMappings.TryGetValue(GetTypeKey(type), out other))
+            {
+                var next = GetRootReference(other);
+                return next ?? other;
+            }
+            return null;
+        }
+
+        public TypeReference GetExportedRemappedType(TypeReference type)
+        {
+            TypeReference other = GetRootReference(type);
+            if (other != null)
             {
                 // ElementType is used when serializing the Assembly.
                 // It should match the actual type (e.g., Boolean for System.Boolean). But because of forwarded types, this is not known at read time, thus having to fix it here.


Pull default proxy assembly loading out into a static function

--- JSIL/AssemblyTranslator.cs
+++ JSIL/AssemblyTranslator.cs
@@ -87,39 +87,17 @@
                 if (configuration.Assemblies.Proxies.Count > 0)
                     throw new InvalidOperationException("Cannot reuse an existing type provider if explicitly loading proxies");
             } else {
-              _TypeInfoProvider = new JSIL.TypeInfoProvider();
-              OwnsTypeInfoProvider = true;
-
-              if (useDefaultProxies) {
-                  Assembly proxyAssembly = null;
-                  var myAssemblyPath = Util.GetPathOfAssembly(Assembly.GetExecutingAssembly());
-                  var proxyFolder = Path.GetDirectoryName(myAssemblyPath);
-                  string proxyPath = null;
-
-                  try {
-                      if (!configuration.FrameworkVersion.HasValue || configuration.FrameworkVersion == 4.0) {
-                          proxyPath = Path.Combine(proxyFolder, "JSIL.Proxies.4.0.dll");
-                      } else if (configuration.FrameworkVersion <= 3.5) {
-                          proxyPath = Path.Combine(proxyFolder, "JSIL.Proxies.3.5.dll");
-                      } else {
-                          throw new ArgumentOutOfRangeException(
-                              "FrameworkVersion",
-                              String.Format("Framework version '{0}' not supported", configuration.FrameworkVersion.Value)
-                          );
-                      }
-
-                      proxyAssembly = Assembly.LoadFile(proxyPath);
-                  } catch (FileNotFoundException fnf) {
-                      throw new FileNotFoundException(
-                          String.Format("Could not load the .NET proxies assembly from '{0}'.", proxyPath),
-                          fnf
-                      );
-                  }
-
-                  if (proxyAssembly == null)
-                      throw new InvalidOperationException("No core proxy assembly was loaded.");
-
-                  AddProxyAssembly(proxyAssembly);
+                _TypeInfoProvider = new JSIL.TypeInfoProvider();
+                OwnsTypeInfoProvider = true;
+
+                if (useDefaultProxies) {
+                    var defaultProxyAssembly =
+                        GetDefaultProxyAssembly(configuration.FrameworkVersion.GetValueOrDefault(4.0));
+
+                    if (defaultProxyAssembly == null)
+                        throw new InvalidOperationException("No default proxy assembly was loaded.");
+
+                    AddProxyAssembly(defaultProxyAssembly);
                 }

                 foreach (var fn in configuration.Assemblies.Proxies.Distinct())
@@ -133,6 +111,32 @@
                 AssemblyCache = new AssemblyCache();

             FunctionCache = new FunctionCache(_TypeInfoProvider);
+        }
+
+        public static Assembly GetDefaultProxyAssembly (double frameworkVersion) {
+            var myAssemblyPath = Util.GetPathOfAssembly(Assembly.GetExecutingAssembly());
+            var proxyFolder = Path.GetDirectoryName(myAssemblyPath);
+            string proxyPath = null;
+
+            try {
+                if (frameworkVersion == 4.0) {
+                    proxyPath = Path.Combine(proxyFolder, "JSIL.Proxies.4.0.dll");
+                } else if (frameworkVersion <= 3.5) {
+                    proxyPath = Path.Combine(proxyFolder, "JSIL.Proxies.3.5.dll");
+                } else {
+                    throw new ArgumentOutOfRangeException(
+                        "FrameworkVersion",
+                        String.Format("Framework version '{0}' not supported", frameworkVersion)
+                    );
+                }
+
+                return Assembly.LoadFile(proxyPath);
+            } catch (FileNotFoundException fnf) {
+                throw new FileNotFoundException(
+                    String.Format("Could not load the .NET proxies assembly from '{0}'.", proxyPath),
+                    fnf
+                );
+            }
         }

         internal void WarningFormat (string format, params object[] args) {


Allow useragents containing signalr and also useragents which do not include (or populate) the useragent header without checkinng CSRF.  This should maintain compatability with most pre-existing clients.

--- JabbR/Nancy/JabbRModule.cs
+++ JabbR/Nancy/JabbRModule.cs
@@ -38,6 +38,13 @@
         {
             get
             {
+                // if we have no useragent or signalr in the useragent, then we don't worry about CSRF because it's not a browser.
+                if (string.IsNullOrEmpty(Request.Headers.UserAgent)
+                    || Request.Headers.UserAgent.IndexOf("signalr", StringComparison.InvariantCultureIgnoreCase) >= 0)
+                {
+                    return true;
+                }
+
                 if (Request.Headers["sec-jabbr-client"].FirstOrDefault() != null)
                 {
                     return true;


Cleaned up the ProcessExtensions

Cleaned up the ProcessExtensions

--- ExecProcessRunnerTests/ProcessExtensions.cs
+++ ExecProcessRunnerTests/ProcessExtensions.cs
@@ -33,12 +33,8 @@
                         {
                             childProcess = Process.GetProcessById(childId);
                         }
-                        catch (ArgumentException)
-                        {
-
-                        }
-
-
+                        catch (ArgumentException) { }
+
                         // ensure the current process is still live
                         if (childProcess != null)
                             results.Add(childProcess);
@@ -47,25 +43,5 @@
             }
             return results;
         }
-        /// <summary>
-        /// Get the Parent Process ID for a given process
-        /// </summary>
-        /// <param name="process"></param>
-        /// <returns></returns>
-        public static int? GetParentId(this Process process)
-        {
-            // query the management system objects
-            string queryText = string.Format("select parentprocessid from win32_process where processid = {0}", process.Id);
-            using (var searcher = new ManagementObjectSearcher(queryText))
-            {
-                foreach (var obj in searcher.Get())
-                {
-                    object data = obj.Properties["parentprocessid"].Value;
-                    if (data != null)
-                        return Convert.ToInt32(data);
-                }
-            }
-            return null;
-        }
     }
 }


[publish] Update Cake dips

[publish] Update Cake dips

--- publish.cake
+++ publish.cake
@@ -1,7 +1,7 @@
-#addin "nuget:?package=Cake.Http&version=0.4.0"
-#addin "nuget:?package=Cake.Json&version=1.0.2.13"
-#addin "nuget:?package=Cake.Xamarin&version=1.3.0.15"
-#addin "nuget:?package=Cake.ExtendedNuGet&version=1.0.0.24"
+#addin "nuget:?package=Cake.Http&version=0.5.0"
+#addin "nuget:?package=Cake.Json&version=3.0.1"
+#addin "nuget:?package=Cake.Xamarin&version=3.0.0"
+#addin "nuget:?package=Cake.ExtendedNuGet&version=1.0.0.27"
 #addin "nuget:?package=NuGet.Core&version=2.14.0"

 var TARGET = Argument ("target", Argument ("t", "build"));


pass guild id to update.sh

pass guild id to update.sh

--- ModCore/Commands/Owner.cs
+++ ModCore/Commands/Owner.cs
@@ -77,7 +77,7 @@
                     StartInfo = new ProcessStartInfo
                     {
                         FileName = "nohup",
-                        Arguments = $"bash {file} {Process.GetCurrentProcess().Id} {ctx.Channel.Id}",
+                        Arguments = $"bash {file} {Process.GetCurrentProcess().Id} {ctx.Guild.Id} {ctx.Channel.Id}",
                         UseShellExecute = false,
                         RedirectStandardOutput = true,
                         CreateNoWindow = true


Add optional bool for checking dependencies

--- CefSharp/DependencyChecker.cs
+++ CefSharp/DependencyChecker.cs
@@ -47,7 +47,7 @@
             "pdf.dll",
             //FFmpeg audio and video support
             // Note: Without this component HTML5 audio and video will not function.
-            "ffmpegsumo.dll",
+            "ffmpegsumo.dll"
         };

         /// <summary>
@@ -65,10 +65,11 @@
         /// CheckDependencies iterates through the list of Cef and CefSharp dependencines
         /// relative to the path provided and returns a list of missing ones
         /// </summary>
+        /// <param name="checkOptional">check to see if optional dependencies are present</param>
         /// <param name="path">path to check for dependencies</param>
         /// <param name="localePackFile">The locale pack file e.g. locales\en-US.pak</param>
         /// <returns>List of missing dependencies, if all present an empty List will be returned</returns>
-        public static List<string> CheckDependencies(string path, string localePackFile)
+        public static List<string> CheckDependencies(bool checkOptional, string path, string localePackFile)
         {
             var missingDependencies = new List<string>();

@@ -83,14 +84,17 @@
                 }
             }

-            //Loop through Cef Optional dependencies and add to list if not found
-            foreach (var cefDependency in CefOptionalDependencies)
+            if (checkOptional)
             {
-                var dependencyPath = Path.Combine(path, cefDependency);
+                //Loop through Cef Optional dependencies and add to list if not found
+                foreach (var cefDependency in CefOptionalDependencies)
+                {
+                    var dependencyPath = Path.Combine(path, cefDependency);

-                if (!File.Exists(dependencyPath))
-                {
-                    missingDependencies.Add(cefDependency);
+                    if (!File.Exists(dependencyPath))
+                    {
+                        missingDependencies.Add(cefDependency);
+                    }
                 }
             }

@@ -129,7 +133,7 @@

             var path = Path.GetDirectoryName(executingAssembly.Location);

-            var missingDependencies = CheckDependencies(path, localePackPath);
+            var missingDependencies = CheckDependencies(true, path, localePackPath);

             if (missingDependencies.Count > 0)
             {


Fixed FlxU

Fixed FlxU

--- MonoFlixel/flixel/FlxU.cs
+++ MonoFlixel/flixel/FlxU.cs
@@ -27,7 +27,7 @@
         /// <param name="url">The address of the web page.</param>
         static public void openURL(string url)
         {
-            throw new NotSupportedException();
+			System.Diagnostics.Process.Start(url);
         }

         ///
@@ -37,8 +37,6 @@
         /// <returns>The absolute value of that number.</returns>
         public static float abs(float value)
         {
-            //return (value > 0) ? value : -value;
-
             return Math.Abs(value);
         }

@@ -49,9 +47,6 @@
         /// <returns>The rounded value of that number.</returns>
         public static float floor(float value)
         {
-            //float number = (int) value;
-            //return (value > 0) ? (number) : ((number != value) ? (number - 1) : (number));
-
             return (int) Math.Floor(value);
         }

@@ -62,9 +57,6 @@
         /// <returns>The rounded value of that number.</returns>
         public static float ceil(float value)
         {
-            //float number = (int) value;
-            //return (value > 0) ? ((number != value) ? (number + 1) : (number)) : (number);
-
             return (int) Math.Ceiling(value);
         }

@@ -87,8 +79,6 @@
         /// <returns>The smaller of the two numbers.</returns>
         public static float min(float number1, float number2)
         {
-            //return (Number1 <= Number2) ? Number1 : Number2;
-
             return Math.Min(number1, number2);
         }

@@ -100,8 +90,6 @@
         /// <returns>The larger of the two numbers.</returns>
         public static float max(float number1, float number2)
         {
-            //return (number1 >= number2) ? number1 : number2;
-
             return Math.Max(number1, number2);
         }

@@ -127,7 +115,7 @@
         /// <returns>A Number between 0 and 1.</returns>
         public static float srand(float seed)
 		{
-			return ((69621 * (seed * 0x7FFFFFFF)) % 0x7FFFFFFF) / 0x7FFFFFFF;
+			return FlxU.abs((float) ((69621 * (int) (seed * 0x7FFFFFFF)) % 0x7FFFFFFF) / 0x7FFFFFFF);
 		}

         ///
@@ -297,7 +285,39 @@
         /// <returns>An Array object containing the Red, Green, Blue and Alpha values of the given color.</returns>
         public static Array getHSB(uint color, Array result = null)
         {
-            throw new NotSupportedException("CurrentlyUnusedAndWillLaterBeReplacedBySomeXNAColorSpecificStuff");
+			if(result == null)
+				result = new float[4];
+
+			float red = (float) ((color >> 16) & 0xFF) / 255;
+			float green = (float) ((color >> 8) & 0xFF) / 255;
+			float blue = (float) ((color) & 0xFF) / 255;
+
+			float m = (red > green) ? red : green;
+			float dmax = (m > blue) ? m : blue;
+			m = (red > green) ? green : red;
+			float dmin = (m > blue) ? blue : m;
+			float range = dmax - dmin;
+
+			result[2] = dmax;
+			result[1] = 0;
+			result[0] = 0;
+
+			if(dmax != 0)
+				result[1] = range / dmax;
+			if(result[1] != 0)
+			{
+				if(red == dmax)
+					result[0] = (green - blue) / range;
+				else if(green == dmax)
+					result[0] = 2 + (blue - red) / range;
+				else if(blue == dmax)
+					result[0] = 4 + (red - green) / range;
+				result[0] *= 60;
+				if(result[0] < 0)
+					result[0] += 360;
+			}
+			result[3] = (float) ((color >> 24) & 0xFF) / 255;
+			return result;
         }

         ///
@@ -320,23 +340,6 @@
             if (string.IsNullOrEmpty(formatted)) formatted = "0 seconds";

             return formatted;
-
-            /*
-			var timeString:String = int(Seconds/60) + ":";
-			var timeStringHelper:int = int(Seconds)%60;
-			if(timeStringHelper < 10)
-				timeString += "0";
-			timeString += timeStringHelper;
-			if(ShowMS)
-			{
-				timeString += ".";
-				timeStringHelper = (Seconds-int(Seconds))*100;
-				if(timeStringHelper < 10)
-					timeString += "0";
-				timeString += timeStringHelper;
-			}
-			return timeString;
-            */
         }

         ///
@@ -376,44 +379,40 @@
         /// <returns>A nicely formatted String. Does not include a dollar sign or anything!</returns>
         public static string formatMoney(float amount, bool showDecimal = true, bool englishStyle = true)
         {
-            throw new NotImplementedException();
-
-            /*
-			var helper:int;
-			var amount:int = Amount;
-			var string:String = "";
-			var comma:String = "";
-			var zeroes:String = "";
+			int helper;
+			int Amount = (int) amount;
+			String str = "";
+			String comma = "";
+			String zeroes = "";
 			while(amount > 0)
 			{
-				if((string.length > 0) && comma.length <= 0)
+				if((str.length() > 0) && comma.length() <= 0)
 				{
-					if(EnglishStyle)
+					if(englishStyle)
 						comma = ",";
 					else
 						comma = ".";
 				}
 				zeroes = "";
-				helper = amount - int(amount/1000)*1000;
-				amount /= 1000;
-				if(amount > 0)
+				helper = Amount - (int) (Amount / 1000f) * 1000;
+				Amount /= 1000f;
+				if(Amount > 0)
 				{
 					if(helper < 100)
 						zeroes += "0";
 					if(helper < 10)
 						zeroes += "0";
 				}
-				string = zeroes + helper + comma + string;
+				str = zeroes + helper + comma + str;
 			}
-			if(ShowDecimal)
+			if(showDecimal)
 			{
-				amount = int(Amount*100)-(int(Amount)*100);
-				string += (EnglishStyle?".":",") + amount;
-				if(amount < 10)
-					string += "0";
+				Amount = (int) (amount * 100) - ((int) (amount) * 100);
+				str += (englishStyle ? "." : ",") + Amount;
+				if(Amount < 10)
+					str += "0";
 			}
-			return string;
-            */
+			return str;
         }

         ///
@@ -426,18 +425,10 @@
         {
             if (simple)
             {
-                throw new NotSupportedException();
+				return obj.GetType().Name
             }

             return obj.GetType().FullName;
-
-            /*
-			var string:String = getQualifiedClassName(Obj);
-			string = string.replace("::",".");
-			if(Simple)
-				string = string.substr(string.lastIndexOf(".")+1);
-			return string;
-            */
         }

         ///
@@ -447,12 +438,8 @@
         /// <param name="object2">The second object you want to check.</param>
         /// <returns>Whether they have the same class name or not.</returns>
         public static bool compareClassNames(object object1, object object2)
-        {
-            throw new NotImplementedException();
-
-            /*
-			return getQualifiedClassName(Object1) == getQualifiedClassName(Object2);
-            */
+        {
+			return getClassName(Object1) == getClassName(Object2);
         }

         ///
@@ -462,11 +449,7 @@
         /// <returns>A Class object.</returns>
         public static object getClass(string name)
         {
-            throw new NotImplementedException();
-
-            /*
-            return getDefinitionByName(Name) as Class;
-            */
+			return (object)Type.GetType(name);
         }

         ///


Test Scan being lazy

Test Scan being lazy

--- MoreLinq.Test/ScanTest.cs
+++ MoreLinq.Test/ScanTest.cs
@@ -38,5 +38,11 @@
             var gold = SampleData.Values.PreScan(SampleData.Plus, 0).ZipShortest(SampleData.Values, SampleData.Plus);
             result.AssertSequenceEqual(gold);
         }
+
+        [Test]
+        public void ScanIsLazy()
+        {
+            new BreakingSequence<object>().Scan<object>(delegate { throw new NotImplementedException(); });
+        }
     }
 }


RPCClient.Generate

RPCClient.Generate

--- NBitcoin/RPC/RPCClient.cs
+++ NBitcoin/RPC/RPCClient.cs
@@ -964,6 +964,19 @@
 		}

 		#endregion
+
+		public async Task<uint256[]> GenerateAsync(int nBlocks)
+		{
+			if(nBlocks < 0)
+				throw new ArgumentOutOfRangeException("nBlocks");
+			var result = (JArray)(await SendCommandAsync(RPCOperations.generate, nBlocks).ConfigureAwait(false)).Result;
+			return result.Select(r => new uint256(r.Value<string>())).ToArray();
+		}
+
+		public uint256[] Generate(int nBlocks)
+		{
+			return GenerateAsync(nBlocks).GetAwaiter().GetResult();
+		}
 	}

 #if !NOSOCKET


Fix not interpolate when deserialize on local client bugs, Improve rigidbody sync position

--- Scripts/GameApi/LiteNetLibTransform.cs
+++ Scripts/GameApi/LiteNetLibTransform.cs
@@ -134,7 +134,7 @@
         public override void OnDeserialize(NetDataReader reader)
         {
             // Update transform only non-owner client
-            if (IsLocalClient || IsServer)
+            if ((canClientSendResult && IsLocalClient) || IsServer)
                 return;
             var result = new TransformResult();
             result.position = new Vector3(
@@ -183,15 +183,8 @@

         private void Update()
         {
-            // Sending transform to all clients
-            if (IsServer)
-            {
-                // Interpolate transform that receives from clients
-                if (canClientSendResult && !IsLocalClient)
-                    Interpolate();
-            }
             // Sending client transform result to server
-            else if (canClientSendResult && IsLocalClient)
+            if (canClientSendResult && IsLocalClient)
             {
                 if (syncElapsed >= sendInterval)
                 {
@@ -202,12 +195,32 @@
                 }
                 syncElapsed += Time.deltaTime;
             }
+
+            if (CacheRigidbody3D == null && CacheRigidbody2D == null)
+                UpdateSync(false);
+        }
+
+        private void FixedUpdate()
+        {
+            if (CacheRigidbody3D != null || CacheRigidbody2D != null)
+                UpdateSync(false);
+        }
+
+        private void UpdateSync(bool isFixedUpdate)
+        {
+            // Sending transform to all clients
+            if (IsServer)
+            {
+                // Interpolate transform that receives from clients
+                if (canClientSendResult && !IsLocalClient)
+                    Interpolate(isFixedUpdate);
+            }
             // Interpolating results for non-owner client objects on clients
             else if (!canClientSendResult || !IsLocalClient)
-                Interpolate();
-        }
-
-        private void Interpolate()
+                Interpolate(isFixedUpdate);
+        }
+
+        private void Interpolate(bool isFixedUpdate)
         {
             // There should be at least two records in the results list to interpolate between them
             // And continue interpolating when there is one record left
@@ -243,7 +256,7 @@
                     else
                         InterpolateTransform();

-                    interpStep += step * Time.deltaTime;
+                    interpStep += step * (isFixedUpdate ? Time.fixedDeltaTime : Time.deltaTime);
                     if (interpStep >= 1)
                     {
                         interpStep = 0f;
@@ -264,9 +277,7 @@
         private bool ShouldSnap(Vector3 targetPosition)
         {
             var dist = 0f;
-            if (CacheRigidbody3D != null)
-                dist = (CacheRigidbody3D.position - targetPosition).magnitude;
-            else if (CacheRigidbody2D != null)
+            if (CacheRigidbody2D != null)
                 dist = (CacheRigidbody2D.position - new Vector2(targetPosition.x, targetPosition.y)).magnitude;
             else
                 dist = (CacheTransform.position - targetPosition).magnitude;
@@ -299,13 +310,13 @@

         private void InterpolateRigibody3D()
         {
-            CacheRigidbody3D.MovePosition(lastResult.position);
+            CacheRigidbody3D.velocity = (lastResult.position - CacheRigidbody3D.position) / sendInterval;
             CacheRigidbody3D.MoveRotation(lastResult.rotation);
         }

         private void InterpolateRigibody2D()
         {
-            CacheRigidbody2D.MovePosition(lastResult.position);
+            CacheRigidbody2D.velocity = ((Vector2)lastResult.position - CacheRigidbody2D.position) / sendInterval;
             CacheRigidbody2D.MoveRotation(lastResult.rotation.eulerAngles.z);
         }


Reset incremental value each time the view is initialized. Fixes #761.

--- Sensus.Shared/UI/Inputs/SliderInput.cs
+++ Sensus.Shared/UI/Inputs/SliderInput.cs
@@ -272,6 +272,7 @@
 #endif
                 };

+                _incrementalValue = double.NaN;  // need this to ensure that the initial value selected by the user registers as a change.
                 _incrementalValueHasChanged = false;

                 _sliderLabel = CreateLabel(index);
@@ -282,7 +283,12 @@

                 _slider.Minimum = _minimum;
                 _slider.Maximum = _maximum;
-                _slider.Value = _minimum;  // set to minimum so that the slider does not indicate an initial value (e.g., in the case of ranges with a negative minimum)
+
+                // set the initial value to the minimum so that the slider bar progress fill does not reflect an
+                // initial value of zero. the thumb has been hidden, but the fill will be rendered according to this
+                // value. this is needed with a slider range that has a negative minimum.
+                _slider.Value = _minimum;
+
                 _slider.ValueChanged += (sender, e) =>
                 {
                     double newIncrementalValue = GetIncrementalValue(e.NewValue);