fix scale; use System.Numeric.Matrix3 instead, #48

--- src/Examples/Demos/HitTestByInverseTransform.cs
+++ src/Examples/Demos/HitTestByInverseTransform.cs
@@ -27,16 +27,22 @@
 using System.Drawing;
 using System.Windows.Forms;
 using unvell.D2DLib.WinForm;
+using System.Numerics;

 namespace unvell.D2DLib.Examples.Demos
 {
 	public partial class HitTestByInverseTransform : DemoForm
 	{
-    float angle = 45;
-		Matrix3 mat = new Matrix3();
-		Matrix3 matInv = new Matrix3();
-		Rect2D rect = new Rect2D(0, 0, 200, 100);
+    float angle = -10;
+    float scale = 1.0f;
+    Vector2 pos = new Vector2(300, 300);
+
+    Matrix3x2 mat = new Matrix3x2();
+    Matrix3x2 matInv;
+
+    Rect2D rect = new Rect2D(0, 0, 400, 100);
 		bool isHitted = false;
+    bool isMoved = false;

 		public HitTestByInverseTransform()
 		{
@@ -48,38 +54,57 @@
     void UpdateTransform()
     {
       // set the transform
-      mat.LoadIdentity();
-      mat.Translate(300, 300);
-      mat.Rotate(this.angle);
-      mat.Translate(-rect.Width * 0.5f, -rect.Height * 0.5f);
+      mat = Matrix3x2.Identity;
+      mat *= Matrix3x2.CreateTranslation(-rect.Width * 0.5f, -rect.Height * 0.5f);
+      mat *= Matrix3x2.CreateScale(this.scale, this.scale);
+      mat *= Matrix3x2.CreateRotation((float)(Math.PI * this.angle / 180f));
+      mat *= Matrix3x2.CreateTranslation(pos.X, pos.Y);

       // get the inversed matrix
-      matInv.CopyFrom(mat).Inverse();
+      Matrix3x2.Invert(mat, out matInv);
     }

 		protected override void OnRender(D2DGraphics g)
 		{
 			base.OnRender(g);

-			// set the transform before draw rect
-			g.SetTransform(mat.ToMatrix3x2());
+      // set the transform before draw rect
+      g.SetTransform(mat.toD2DMatrix3x2());

       g.FillRectangle(rect, isHitted ? D2DColor.LightYellow : D2DColor.LightGray);
 			g.DrawRectangle(rect, isHitted ? D2DColor.Red : D2DColor.Blue, 2);

-      g.DrawText("Click to rotate", D2DColor.Black, this.Font.Name, 14, rect,
+      g.DrawText("Drag to move / Click to rotate / Scroll to scale", D2DColor.Black, this.Font.Name, 14, rect,
         DWRITE_TEXT_ALIGNMENT.DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT.DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
-		}
+
+      g.ResetTransform();
+
+    }
+
+    private Point lastPoint;

 		protected override void OnMouseMove(MouseEventArgs e)
 		{
 			base.OnMouseMove(e);
-
-			// transformed point to the rect
-			var tp = matInv.TransformPoint(e.Location);

-      // calculate whether the point inside the rect
-      isHitted = rect.ContainsPoint(tp);
+      if (e.Button == MouseButtons.None)
+      {
+        // transformed point to the rect
+        var tp = Vector2.Transform(new Vector2(e.X, e.Y), matInv);
+
+        // calculate whether the point inside the rect
+        isHitted = rect.ContainsPoint(new PointF(tp.X, tp.Y));
+      }
+      else if (isHitted)
+      {
+        pos.X += e.X - lastPoint.X;
+        pos.Y += e.Y - lastPoint.Y;
+
+        lastPoint = e.Location;
+        isMoved = true;
+
+        UpdateTransform();
+      }

 			Invalidate();
 		}
@@ -88,15 +113,30 @@
     {
       base.OnMouseDown(e);

-      // transformed point to the rect
-      var tp = matInv.TransformPoint(e.Location);
+      lastPoint = e.Location;
+      isMoved = false;
+    }

-      if (rect.ContainsPoint(tp))
+    protected override void OnMouseUp(MouseEventArgs e)
+    {
+      base.OnMouseUp(e);
+
+      if (isHitted && !isMoved)
       {
-        this.angle += 10;
+        this.angle += 10f;
         UpdateTransform();
         Invalidate();
       }
+    }
+
+    protected override void OnMouseWheel(MouseEventArgs e)
+    {
+      base.OnMouseWheel(e);
+
+      scale += (float)e.Delta / 1000f;
+
+      UpdateTransform();
+      Invalidate();
     }
   }

@@ -131,175 +171,20 @@
   }
   #endregion /* Rect2D */

-  #region Matrix3
-  /// <summary>
-  /// Represents a left-handed 3x3 matrix.
-  /// </summary>
-  public class Matrix3
-	{
-		public float a1, b1, c1;
-		public float a2, b2, c2;
-		public float a3, b3, c3;
+  public static class NumericExtension
+  {
+    public static D2DMatrix3x2 toD2DMatrix3x2(this Matrix3x2 mat)
+    {
+      D2DMatrix3x2 d2dmat;

-		public static readonly Matrix3 Identify = new Matrix3()
-		{
-			a1 = 1,
-			b1 = 0,
-			c1 = 0,
-			a2 = 0,
-			b2 = 1,
-			c2 = 0,
-			a3 = 0,
-			b3 = 0,
-			c3 = 1,
-		};
+      d2dmat.a1 = mat.M11;
+      d2dmat.b1 = mat.M12;
+      d2dmat.a2 = mat.M21;
+      d2dmat.b2 = mat.M22;
+      d2dmat.a3 = mat.M31;
+      d2dmat.b3 = mat.M32;

-		public Matrix3()
-		{
-		}
-
-		public Matrix3(float a1, float b1, float c1,
-			float a2, float b2, float c2,
-			float a3, float b3, float c3)
-		{
-			this.a1 = a1; this.b1 = b1; this.c1 = c1;
-			this.a2 = a2; this.b2 = b2; this.c2 = c2;
-			this.a3 = a3; this.b3 = b3; this.c3 = c3;
-		}
-
-		public Matrix3(Matrix3 mat2)
-		{
-			this.CopyFrom(mat2);
-		}
-
-		public Matrix3 LoadIdentity()
-		{
-			return this.CopyFrom(Matrix3.Identify);
-		}
-
-		public Matrix3 CopyFrom(Matrix3 m2)
-		{
-			this.a1 = m2.a1; this.b1 = m2.b1; this.c1 = m2.c1;
-			this.a2 = m2.a2; this.b2 = m2.b2; this.c2 = m2.c2;
-			this.a3 = m2.a3; this.b3 = m2.b3; this.c3 = m2.c3;
-
-			return this;
-		}
-
-		public Matrix3 Clone()
-		{
-			return new Matrix3(this);
-		}
-
-		public Matrix3 Rotate(float angle)
-		{
-			float radians = (float)(angle / 180f * Math.PI);
-			float sin = (float)Math.Sin(radians);
-			float cos = (float)Math.Cos(radians);
-
-			float m2a1 = cos, m2b1 = sin;
-			float m2a2 = -sin, m2b2 = cos;
-
-			float a1 = this.a1 * m2a1 + this.a2 * m2b1;
-			float b1 = this.b1 * m2a1 + this.b2 * m2b1;
-			float a2 = this.a1 * m2a2 + this.a2 * m2b2;
-			float b2 = this.b1 * m2a2 + this.b2 * m2b2;
-
-			this.a1 = a1; this.b1 = b1;
-			this.a2 = a2; this.b2 = b2;
-
-			return this;
-		}
-
-		public void Scale(float x, float y)
-		{
-			this.a1 *= x; this.b1 *= x;
-			this.a2 *= y; this.b2 *= y;
-		}
-
-		public Matrix3 Translate(Point p)
-		{
-			Translate(p.X, p.Y);
-			return this;
-		}
-
-		public Matrix3 Translate(D2DPoint p)
-		{
-			Translate(p.x, p.y);
-			return this;
-		}
-
-		public Matrix3 Translate(float x, float y)
-		{
-			this.a3 += this.a1 * x + this.a2 * y;
-			this.b3 += this.b1 * x + this.b2 * y;
-
-			return this;
-		}
-
-		public PointF TransformPoint(PointF p)
-		{
-			return TransformPoint(p.X, p.Y);
-		}
-
-		public PointF TransformPoint(float x, float y)
-		{
-			return new PointF(x * a1 + y * a2 + a3, x * b1 + y * b2 + b3);
-		}
-
-		public static Matrix3 operator *(Matrix3 m1, Matrix3 m2)
-		{
-			return new Matrix3(
-				m1.a1 * m2.a1 + m1.b1 * m2.a2 + m1.c1 * m2.a3,
-				m1.a1 * m2.b1 + m1.b1 * m2.b2 + m1.c1 * m2.b3,
-				m1.a1 * m2.c1 + m1.b1 * m2.c2 + m1.c1 * m2.c3,
-
-				m1.a2 * m2.a1 + m1.b2 * m2.a2 + m1.c2 * m2.a3,
-				m1.a2 * m2.b1 + m1.b2 * m2.b2 + m1.c2 * m2.b3,
-				m1.a2 * m2.c1 + m1.b2 * m2.c2 + m1.c2 * m2.c3,
-
-				m1.a3 * m2.a1 + m1.b3 * m2.a2 + m1.c3 * m2.a3,
-				m1.a3 * m2.b1 + m1.b3 * m2.b2 + m1.c3 * m2.b3,
-				m1.a3 * m2.c1 + m1.b3 * m2.c2 + m1.c3 * m2.c3);
-		}
-
-		public Matrix3 CreateRotation(float angle)
-		{
-			return new Matrix3().LoadIdentity().Rotate(angle);
-		}
-
-		public Matrix3 Inverse()
-		{
-			float a = this.a1, b = this.b1, c = this.c1,
-				d = this.a2, e = this.b2, f = this.c2,
-				g = this.a3, h = this.b3, i = this.c3;
-
-			float det = a * e * i - a * f * h + b * f * g - b * d * i + c * d * h - c * e * g;
-			if (det == 0) return this;
-
-			det = 1.0f / det;
-
-			float m2a = det * e * i - f * h, m2b = det * c * h - b * i, m2c = det * b * f - c * e,
-				m2d = det * f * g - d * i, m2e = det * a * i - c * g, m2f = det * c * d - a * f,
-				m2g = det * d * h - e * g, m2h = det * b * g - a * h, m2i = det * a * e - b * d;
-
-			this.a1 = m2a; this.b1 = m2b; this.c1 = m2c;
-			this.a2 = m2d; this.b2 = m2e; this.c2 = m2f;
-			this.a3 = m2g; this.b3 = m2h; this.c3 = m2i;
-
-			return this;
-		}
-
-		public D2DMatrix3x2 ToMatrix3x2()
-		{
-			D2DMatrix3x2 mat;
-
-			mat.a1 = this.a1; mat.b1 = this.b1;
-			mat.a2 = this.a2; mat.b2 = this.b2;
-			mat.a3 = this.a3; mat.b3 = this.b3;
-
-			return mat;
-		}
-	}
-	#endregion // Matrix3
+      return d2dmat;
+    }
+  }
 }


improved IsMemberDeclaration method a little bit

--- src/Gipper/GipperClassifier/GipperClassifier.cs
+++ src/Gipper/GipperClassifier/GipperClassifier.cs
@@ -234,26 +234,31 @@
 		static private bool IsMemberDeclaration(ClassificationSpan classificationSpan, IList<ClassificationSpan> snapshotSpans)
 		{
 			// TODO: add way more criteria than simply checked the visiblity keyword
-			bool hasVisibilityKeyword = false;
-
-			string formattedClassificationType = Helper.FormatClassificationType(classificationSpan.ClassificationType);
-			if(formattedClassificationType == GipperConstants.FormatClassificationType_Identifier)
-			{
-				foreach(ClassificationSpan span in snapshotSpans)
-				{
-					if(Helper.FormatClassificationType(span.ClassificationType) == GipperConstants.FormatClassificationType_Keyword)
-					{
-						string text = span.Span.GetText();
-						if(text == "private" || text == "public" || text == "internal" || text == "function" || text == "void" || text == "event")
-						{
-							hasVisibilityKeyword = true;
-							break;
-						}
-					}
-				}
-			}
-
-			return hasVisibilityKeyword;
+
+			// all members seem to be classifed as Identifier
+			if(!(Helper.FormatClassificationType(classificationSpan.ClassificationType) == GipperConstants.FormatClassificationType_Identifier))
+				return false;
+
+			// member snapshot spans seem to have some kind of visibility keyword or void or event; otherwise regular lines of code will
+			// classify things as member declarations; however this misses things like methods on an interface
+			string[] magicKeywords = { "private", "public", "internal", "function", "void", "event" };
+			bool snapshotSpanContainMagicKeyword = snapshotSpans.Any(
+				span =>
+					magicKeywords.Contains(span.Span.GetText())
+			);
+			if(!snapshotSpanContainMagicKeyword)
+				return false;
+
+			// in methods, parameter types are also classified as Identifier, so ignore those
+			ClassificationSpan firstIdentifier = snapshotSpans.FirstOrDefault(
+				span =>
+					Helper.FormatClassificationType(span.ClassificationType) == GipperConstants.FormatClassificationType_Identifier
+			);
+			bool isFirstIdentifier = (firstIdentifier == classificationSpan);
+			if(!isFirstIdentifier)
+				return false;
+
+			return true;
 		}
 	}
 }


read all the files in .git/refs

read all the files in .git/refs

--- src/GitVersionCore/GitVersionCacheKeyFactory.cs
+++ src/GitVersionCore/GitVersionCacheKeyFactory.cs
@@ -104,7 +104,11 @@
                         // Perform whatever action is required in your scenario.
                         System.IO.FileInfo fi = new System.IO.FileInfo(file);
                         result.Add(fi.Name);
-                        Logger.WriteInfo(string.Format("{0}: {1}, {2}", fi.Name, fi.Length, fi.CreationTime));
+
+                        var reader = fi.OpenText();
+                        result.Add(reader.ReadToEnd());
+
+                        //Logger.WriteInfo(string.Format("{0}: {1}, {2}", fi.Name, fi.Length, fi.CreationTime));
                     }
                     catch (System.IO.FileNotFoundException e)
                     {


Fix bug in EnsureIndexesShouldDropAndRetry

Mongodb 3.2 / 3.0 returns a different error message than 3.4
when the test tries to create a new compound index with additional
options. Rather than testing on the actual error message, check the
return code instead - these have been stable for a very long time.

Error code 86 is the one we need. code includes link to all error codes
that are defined in mongodb.

--- src/Internal/MongoCommandExceptionExtensions.cs
+++ src/Internal/MongoCommandExceptionExtensions.cs
@@ -9,12 +9,14 @@
         {
             //
             // index already exists, but with different options
+            // Check using the error code - all error codes are defined here and have been stable over time, with only new codes added:
+            // https://github.com/mongodb/mongo/blob/v3.4/src/mongo/base/error_codes.err
             //
-            if (ex.Message.Equals($"Command createIndexes failed: Index with name: {index.Name} already exists with different options."))
+            if (ex.Code == 86)
             {
                 return true;
             }
-
+
             //
             // index already exists
             //


fix: Add named group for code snippet regex

--- src/Microsoft.DocAsCode.Dfm/DfmCodeExtractor.cs
+++ src/Microsoft.DocAsCode.Dfm/DfmCodeExtractor.cs
@@ -23,40 +23,40 @@
         private static readonly Regex CSharpCodeSnippetRegionEndLineRegex = new Regex(@"^\s*#\s*endregion\s*$", RegexOptions.Compiled);

         // VB code snippet comment block: ' <[/]snippetname>
-        private static readonly Regex VBCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\'\s*\<\s*\/?\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex VBCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\'\s*\<\s*\/?\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex VBCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\'\s*\<\s*\/?\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex VBCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\'\s*\<\s*\/?\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // VB code snippet Region block: start -> # Region "snippetname", end -> # End Region
         private static readonly Regex VBCodeSnippetRegionRegionStartLineRegex = new Regex(@"^\s*#\s*Region\s*(?<name>.+?)\s*$", RegexOptions.Compiled);
         private static readonly Regex VBCodeSnippetRegionRegionEndLineRegex = new Regex(@"^\s*#\s*End\s+Region\s*$", RegexOptions.Compiled);

         // C++ code snippet block: // <[/]snippetname>
-        private static readonly Regex CPlusPlusCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex CPlusPlusCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex CPlusPlusCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex CPlusPlusCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // F# code snippet block: // <[/]snippetname>
-        private static readonly Regex FSharpCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex FSharpCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex FSharpCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex FSharpCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // XML code snippet block: <!-- <[/]snippetname> -->
-        private static readonly Regex XmlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex XmlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex XmlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex XmlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // XAML code snippet block: <!-- <[/]snippetname> -->
-        private static readonly Regex XamlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex XamlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex XamlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex XamlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // HTML code snippet block: <!-- <[/]snippetname> -->
-        private static readonly Regex HtmlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex HtmlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex HtmlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex HtmlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\<\!\-{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*\-{2}\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // Sql code snippet block: -- <[/]snippetname>
-        private static readonly Regex SqlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\-{2}\s*\<\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex SqlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\-{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex SqlCodeSnippetCommentStartLineRegex = new Regex(@"^\s*\-{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex SqlCodeSnippetCommentEndLineRegex = new Regex(@"^\s*\-{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         // Javascript code snippet block: <!-- <[/]snippetname> -->
-        private static readonly Regex JavaScriptSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-        private static readonly Regex JavaScriptSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*([\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex JavaScriptSnippetCommentStartLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+        private static readonly Regex JavaScriptSnippetCommentEndLineRegex = new Regex(@"^\s*\/{2}\s*\<\s*\/\s*(?<name>[\w\.]+)\s*\>\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);

         private static readonly string RemoveIndentSpacesRegexString = @"^[ \t]{{1,{0}}}";


More minderfund stuff

More minderfund stuff

--- src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs
+++ src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs
@@ -527,14 +527,15 @@

     protected virtual Money CreateMinerFundOutputs(Transaction tx, Money reward)
     {
-        if (!string.IsNullOrEmpty(minerFundParameters.Addresses?.First()))
+        var payeeReward = minerFundParameters.MinimumValue;
+
+        if (!string.IsNullOrEmpty(minerFundParameters.Addresses?.FirstOrDefault()))
         {
             var payeeAddress = BitcoinUtils.AddressToDestination(minerFundParameters.Addresses[0], network);
-            var payeeReward = minerFundParameters.MinimumValue;
-
             tx.Outputs.Add(payeeReward, payeeAddress);
-            reward -= payeeReward;
-        }
+        }
+
+        reward -= payeeReward;

         return reward;
     }


Added additional test

Added additional test

svn path=/trunk/bitsharp/; revision=97820

--- src/MonoTorrent.Tests/LibtorrentMessageTests.cs
+++ src/MonoTorrent.Tests/LibtorrentMessageTests.cs
@@ -39,10 +39,12 @@
         public void HandshakeSupportsTest()
         {
             ExtendedHandshakeMessage m = new ExtendedHandshakeMessage();
+            byte[] encoded = m.Encode();

-            Assert.AreEqual(2, m.Supports.Count);
-            Assert.IsTrue(m.Supports.Exists(delegate(LTSupport s) { return s.Equals(LTChat.Support); }), "");
-            Assert.IsTrue(m.Supports.Exists(delegate(LTSupport s) { return s.Equals(LTMetadata.Support); }));
+            Assert.AreEqual(m.ByteLength, encoded.Length, "#1");
+            Assert.AreEqual(2, m.Supports.Count, "#2");
+            Assert.IsTrue(m.Supports.Exists(delegate(LTSupport s) { return s.Equals(LTChat.Support); }), "#3");
+            Assert.IsTrue(m.Supports.Exists(delegate(LTSupport s) { return s.Equals(LTMetadata.Support); }), "#4");
         }

         [Test]
@@ -52,6 +54,7 @@
             byte[] data = m.Encode();
             ExtendedHandshakeMessage decoded = (ExtendedHandshakeMessage)PeerMessage.DecodeMessage(data, 4, data.Length - 4, rig.Manager);

+            Assert.AreEqual(m.ByteLength, data.Length);
             Assert.AreEqual(m.ByteLength, decoded.ByteLength, "#1");
             Assert.AreEqual(m.LocalPort, decoded.LocalPort, "#2");
             Assert.AreEqual(m.MaxRequests, decoded.MaxRequests, "#3");


* MonoTorrent/MonoTorrent.Client/NetworkIO.cs: The loops need to
  increment their variable. Doh!

svn path=/trunk/bitsharp/; revision=155977

--- src/MonoTorrent/MonoTorrent.Client/NetworkIO.cs
+++ src/MonoTorrent/MonoTorrent.Client/NetworkIO.cs
@@ -76,13 +76,13 @@
                 lock (sendQueue)
                 {
                     int count = sendQueue.Count;
-                    for (int i = 0; i < count;)
+                    for (int i = 0; i < count; i++)
                          SendOrEnqueue (sendQueue.Dequeue ());
                 }
                 lock (receiveQueue)
                 {
                     int count = receiveQueue.Count;
-                    for (int i = 0; i < count;)
+                    for (int i = 0; i < count; i++)
                         ReceiveOrEnqueue (receiveQueue.Dequeue ());
                 }
                 return true;


Improve ${callsite} when filtering is used.

Filter Microsoft.Extensions.Logging.Filter if used

--- src/NLog.Extensions.Logging/AspNetExtensions.cs
+++ src/NLog.Extensions.Logging/AspNetExtensions.cs
@@ -1,3 +1,4 @@
+using System;
 using System.IO;
 using System.Reflection;
 using Microsoft.AspNetCore.Hosting;
@@ -22,6 +23,18 @@
             //ignore this
             LogManager.AddHiddenAssembly(Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging")));
             LogManager.AddHiddenAssembly(Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging.Abstractions")));
+
+            try
+            {
+                //try the Filter extensin
+                var filterAssembly = Assembly.Load(new AssemblyName("Microsoft.Extensions.Logging.Filter"));
+                LogManager.AddHiddenAssembly(filterAssembly);
+            }
+            catch (Exception)
+            {
+                //ignore
+            }
+
             LogManager.AddHiddenAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly);

             using (var provider = new NLogLoggerProvider())


Don't save settings if guild is not present when fetching current role.

--- src/NinjaCatDiscordBot/NinjaCatDiscordClient.cs
+++ src/NinjaCatDiscordBot/NinjaCatDiscordClient.cs
@@ -279,7 +279,9 @@
                 if (roles[guild.Id] == 0)
                     return null;
                 else
-                    role = guild.Roles.SingleOrDefault(g => g.Id == roles[guild.Id]) as IRole;
+                    role = guild.Roles.SingleOrDefault(g => g.Id == roles[guild.Id]);
+            } else {
+                return null;
             }

             // If the role is null, delete the entry from the dictionary and use the default one.


Fix #1342 by applying RequireRemoteHttps attribute to Register action

--- src/NuGetGallery/Controllers/UsersController.cs
+++ src/NuGetGallery/Controllers/UsersController.cs
@@ -103,6 +103,7 @@
             return View(profile);
         }

+        [RequireRemoteHttps(OnlyWhenAuthenticated = false)]
         public virtual ActionResult Register()
         {
             // We don't want Login to have us as a return URL.
@@ -113,6 +114,7 @@

         [HttpPost]
         [ValidateAntiForgeryToken]
+        [RequireRemoteHttps(OnlyWhenAuthenticated = false)]
         public virtual ActionResult Register(RegisterRequest request)
         {
             // If we have to render a view, we don't want Login to have us as a return URL


Only return included curated packages

Only return included curated packages

--- src/NuGetGallery/Services/CuratedFeedService.cs
+++ src/NuGetGallery/Services/CuratedFeedService.cs
@@ -158,7 +158,7 @@
         {
             var packages = CuratedFeedRepository.GetAll()
                 .Where(cf => cf.Name == curatedFeedName)
-                .SelectMany(cf => cf.Packages.SelectMany(cp => cp.PackageRegistration.Packages));
+                .SelectMany(cf => cf.Packages.Where(cp => cp.Included).SelectMany(cp => cp.CuratedPackages));

             return packages;
         }
@@ -167,7 +167,7 @@
         {
             var packageRegistrations = CuratedFeedRepository.GetAll()
                 .Where(cf => cf.Name == curatedFeedName)
-                .SelectMany(cf => cf.Packages.Select(cp => cp.PackageRegistration));
+                .SelectMany(cf => cf.Packages.Where(cp => cp.Included).Select(cp => cp.PackageRegistration));

             return packageRegistrations;
         }


#2197 What is IsLoadingFromStorage option

--- src/Package/Impl/Options/R/RToolsOptionsPage.cs
+++ src/Package/Impl/Options/R/RToolsOptionsPage.cs
@@ -27,6 +27,7 @@
             this.SettingsRegistryPath = @"UserSettings\R_Tools";
         }

+        [Browsable(false)]
         public bool IsLoadingFromStorage { get; private set; }

         [LocCategory("Settings_GeneralCategory")]


AML-2623-Pass-Invitation-Parameter-As-Hidden-Field

--- src/SFA.DAS.EAS.Web/Views/Invitation/All.cshtml
+++ src/SFA.DAS.EAS.Web/Views/Invitation/All.cshtml
@@ -18,8 +18,6 @@
         else
         {

-            <form method="post" action="@Url.Action("Accept","Invitation")">
-                @Html.AntiForgeryToken()

@@ -37,7 +35,7 @@

@invitation.AccountName

-                                    <input type="hidden" name="Invitations[@index].AccountName" value="@invitation.AccountName"/>
+                                    @*<input type="hidden" name="Invitations[@index].AccountName" value="@invitation.AccountName"/>*@

@@ -49,17 +47,21 @@

@invitation.ExpiryDays()

-

-                                        <input type="hidden" name="Invitations[@index].Id" value="@invitation.Id" />
-                                        <button type="submit" id="invitationId" value="@invitation.Id" name="invitation" class="link-button" title="Accept invite to @invitation.AccountName">Accept invite</button>
-

-
+                                    <form method="post" action="@Url.Action("Accept","Invitation")">
+                                        @Html.AntiForgeryToken()
+
+

+                                            <input type="hidden" name="Invitations[@index].AccountName" value="@invitation.AccountName"/>
+                                            <input type="hidden" name="Invitations[@index].Id" value="@invitation.Id" />
+                                            <input type="hidden" name="invitation" value="@invitation.Id" />
+                                            <button type="submit" id="invitationId" class="link-button" title="Accept invite to @invitation.AccountName">Accept invite</button>
+

+                                    </form>

                         }

-            </form>
         }


Small unimportant fix

Small unimportant fix

--- src/Sleddog.SemanticVersioning.Tests/ListExt.cs
+++ src/Sleddog.SemanticVersioning.Tests/ListExt.cs
@@ -23,7 +23,7 @@

 				n--;

-				T value = list[k];
+				var value = list[k];
 				list[k] = list[n];
 				list[n] = value;
 			}


Remove PreProcessing of Documents.

Remove PreProcessing of Documents.

--- src/SourceBrowser.Generator/SolutionAnalyzer.cs
+++ src/SourceBrowser.Generator/SolutionAnalyzer.cs
@@ -14,6 +14,7 @@
 using Newtonsoft.Json;
 using System.Reflection;
 using SourceBrowser.Generator.Extensions;
+using SourceBrowser.Generator.Model;

 namespace SourceBrowser.Generator
 {
@@ -21,11 +22,10 @@
     {
         MSBuildWorkspace _workspace;
         Solution _solution;
+        WorkspaceModel _workspaceModel;
         SolutionFolderAnalyzer _folderAnalyzer;
         private ReferencesourceLinkProvider _refsourceLinkProvider = new ReferencesourceLinkProvider();
         string _saveDirectory = string.Empty;
-        Dictionary<string, string> _typeLookup = new Dictionary<string, string>();
-        private ReferencesourceLinkProvider _refsourceLinkProvider = new ReferencesourceLinkProvider();
         const string solutionInfoFileName = "solutionInfo.json";

         public SolutionAnalayzer(string solutionPath)
@@ -34,7 +34,6 @@
             _workspace.WorkspaceFailed += _workspace_WorkspaceFailed;
             _solution = _workspace.OpenSolutionAsync(solutionPath).Result;
             _folderAnalyzer = new SolutionFolderAnalyzer(_solution);
-
             _refsourceLinkProvider.Init().Wait();
         }

@@ -74,11 +73,6 @@
             if (!Directory.Exists(_saveDirectory))
             {
                 Directory.CreateDirectory(_saveDirectory);
-            }
-
-            foreach (var doc in _solution.Projects.SelectMany(n => n.Documents))
-            {
-                preProcessDocument(doc);
             }

             //Generate solution/folder info
@@ -122,59 +116,12 @@
             string json = JsonConvert.SerializeObject(root, Formatting.Indented);
             return json;
         }
-        private void preProcessDocument(Document document)
-        {
-            string docName = document.GetRelativeFilePath();
-            var model = document.GetSemanticModelAsync().Result;
-            var compilation = model.Compilation;
-            var root = document.GetSyntaxRootAsync().Result;
-
-            var typeDeclarations = root.DescendantNodes()
-                .OfType<MemberDeclarationSyntax>();
-
-            var projectName = document.Project.Name;
-
-            foreach (var declaration in typeDeclarations)
-            {
-                if (declaration is FieldDeclarationSyntax)
-                {
-                    var fieldDeclaration = (FieldDeclarationSyntax)declaration;
-                    foreach (var variableDeclartion in fieldDeclaration.Declaration.Variables)
-                    {
-                        processDeclarationSyntax(document, variableDeclartion);
-                    }
-                }
-                else
-                {
-                    processDeclarationSyntax(document, declaration);
-                }
-            }
-        }
-
-        private void processDeclarationSyntax(Document document, SyntaxNode syntax)
-        {
-            var root = document.GetSyntaxRootAsync().Result;
-            var model = document.GetSemanticModelAsync().Result;
-            var symbol = model.GetDeclaredSymbol(syntax);
-
-            if (symbol == null)
-            {
-                // Ignore this.
-                return;
-            }
-
-            string fullName = symbol.ToString();
-            var lineNum = root.SyntaxTree.GetLineSpan(syntax.Span).StartLinePosition.Line + 1;
-            string pathToType = document.GetRelativeFilePath() + "#" + lineNum;
-            _typeLookup[fullName] = pathToType;
-        }

         private DocumentInfo buildDocumentInfo(Document document)
         {
-            var root = document.GetSyntaxRootAsync().Result;
-            var model = document.GetSemanticModelAsync().Result;
-            var docWalker = new DocumentWalker(model, document, _refsourceLinkProvider, _typeLookup);
-            docWalker.Visit(root);
+            //var root = document.GetSyntaxRootAsync().Result;
+            //var docWalker = new DocumentWalker(document, _refsourceLinkProvider);
+            //docWalker.Visit(root);

             return default(DocumentInfo);
         }


Fix DefaultWebProxy_VerifyDefaults_Success test

This test had an ordering constraint which was not enforced, but the
test case was getting lucky with the default sort used by xunit.

That default sort is a comparison of SHA of the test assembly name, type
name and method.  I previously changed the test assembly version which
caused this SHA to change and distrupted the order.

Fix the test to not depend on execution order.

--- src/System.Net.Requests/tests/WebRequestTest.cs
+++ src/System.Net.Requests/tests/WebRequestTest.cs
@@ -8,18 +8,25 @@
 {
     public class WebRequestTest
     {
+        static WebRequestTest()
+        {
+            // Capture the value of DefaultWebProxy before any tests run.
+            // This lets us test the default value without imposing test
+            // ordering constraints which aren't natively supported by xunit.
+            initialDefaultWebProxy = WebRequest.DefaultWebProxy;
+            initialDefaultWebProxyCredentials = initialDefaultWebProxy.Credentials;
+        }
+
         private readonly NetworkCredential _explicitCredentials = new NetworkCredential("user", "password", "domain");
+        private static IWebProxy initialDefaultWebProxy;
+        private static ICredentials initialDefaultWebProxyCredentials;

         [Fact]
         public void DefaultWebProxy_VerifyDefaults_Success()
         {
-            IWebProxy proxy = WebRequest.DefaultWebProxy;
-            Assert.NotNull(proxy);
+            Assert.NotNull(initialDefaultWebProxy);

-            // Since WebRequest.DefaultWebProxy is a static property, the initial default value for
-            // Credentials is only null iff. no other test method in the test process has changed
-            // the value in a prior test.
-            Assert.Null(proxy.Credentials);
+            Assert.Null(initialDefaultWebProxyCredentials);
         }

         [Fact]


Update Version comparison operator tests (#36799)

* Update Version comparison operator tests

Better validate the operators, and update the tests now that the operators won't throw for null.

* Address PR feedback

--- src/System.Runtime/tests/System/VersionTests.cs
+++ src/System.Runtime/tests/System/VersionTests.cs
@@ -92,61 +92,85 @@
             AssertExtensions.Throws<ArgumentOutOfRangeException>("revision", () => new Version(0, 0, 0, -1));
         }

-        public static IEnumerable<object[]> CompareTo_TestData()
-        {
-            yield return new object[] { new Version(1, 2), null, 1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 2), 0 };
-            yield return new object[] { new Version(1, 2), new Version(1, 3), -1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 1), 1 };
-            yield return new object[] { new Version(1, 2), new Version(2, 0), -1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 2, 1), -1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 2, 0, 1), -1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 0), 1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 0, 1), 1 };
-            yield return new object[] { new Version(1, 2), new Version(1, 0, 0, 1), 1 };
-
-            yield return new object[] { new Version(3, 2, 1), new Version(2, 2, 1), 1 };
-            yield return new object[] { new Version(3, 2, 1), new Version(3, 1, 1), 1 };
-            yield return new object[] { new Version(3, 2, 1), new Version(3, 2, 0), 1 };
-
-            yield return new object[] { new Version(1, 2, 3, 4), new Version(1, 2, 3, 4), 0 };
-            yield return new object[] { new Version(1, 2, 3, 4), new Version(1, 2, 3, 5), -1 };
-            yield return new object[] { new Version(1, 2, 3, 4), new Version(1, 2, 3, 3), 1 };
-
-            yield return new object[] { new Version(1, 2, 3, 4), null, 1 };
-        }
-
-        [Theory]
-        [MemberData(nameof(CompareTo_TestData))]
-        public void CompareTo_Other_ReturnsExpected(Version version1, object other, int expectedSign)
-        {
-            if (version1 != null && other is Version version2)
-            {
-                if (expectedSign >= 0)
-                {
-                    Assert.True(version1 >= version2);
-                    Assert.False(version1 < version2);
-                }
-                if (expectedSign > 0)
-                {
-                    Assert.True(version1 > version2);
-                    Assert.False(version1 <= version2);
-                }
-                if (expectedSign <= 0)
-                {
-                    Assert.True(version1 <= version2);
-                    Assert.False(version1 > version2);
-                }
-                if (expectedSign < 0)
-                {
-                    Assert.True(version1 < version2);
-                    Assert.False(version1 >= version2);
-                }
-            }
-
-            IComparable comparable = version1;
-            Assert.Equal(expectedSign, Math.Sign(comparable.CompareTo(other)));
-            Assert.Equal(expectedSign, Math.Sign(version1.CompareTo(other)));
+        public static IEnumerable<object[]> Comparison_TestData()
+        {
+            foreach (var input in new (Version v1, Version v2, int expectedSign)[]
+            {
+                (null, null, 0),
+
+                (new Version(1, 2), null, 1),
+                (new Version(1, 2), new Version(1, 2), 0),
+                (new Version(1, 2), new Version(1, 3), -1),
+                (new Version(1, 2), new Version(1, 1), 1),
+                (new Version(1, 2), new Version(2, 0), -1),
+                (new Version(1, 2), new Version(1, 2, 1), -1),
+                (new Version(1, 2), new Version(1, 2, 0, 1), -1),
+                (new Version(1, 2), new Version(1, 0), 1),
+                (new Version(1, 2), new Version(1, 0, 1), 1),
+                (new Version(1, 2), new Version(1, 0, 0, 1), 1),
+
+                (new Version(3, 2, 1), null, 1),
+                (new Version(3, 2, 1), new Version(2, 2, 1), 1),
+                (new Version(3, 2, 1), new Version(3, 1, 1), 1),
+                (new Version(3, 2, 1), new Version(3, 2, 0), 1),
+
+                (new Version(1, 2, 3, 4), null, 1),
+                (new Version(1, 2, 3, 4), new Version(1, 2, 3, 4), 0),
+                (new Version(1, 2, 3, 4), new Version(1, 2, 3, 5), -1),
+                (new Version(1, 2, 3, 4), new Version(1, 2, 3, 3), 1)
+            })
+            {
+                yield return new object[] { input.v1, input.v2, input.expectedSign };
+                yield return new object[] { input.v2, input.v1, input.expectedSign * -1 };
+            }
+        }
+
+        [Theory]
+        [MemberData(nameof(Comparison_TestData))]
+        public void CompareTo_ReturnsExpected(Version version1, Version version2, int expectedSign)
+        {
+            Assert.Equal(expectedSign, Comparer<Version>.Default.Compare(version1, version2));
+            if (version1 != null)
+            {
+                Assert.Equal(expectedSign, Math.Sign(((IComparable)version1).CompareTo(version2)));
+                Assert.Equal(expectedSign, Math.Sign(version1.CompareTo((object)version2)));
+                Assert.Equal(expectedSign, Math.Sign(version1.CompareTo(version2)));
+            }
+        }
+
+        [ActiveIssue("https://github.com/dotnet/coreclr/pull/23898")]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "https://github.com/dotnet/coreclr/pull/23898")]
+        [Theory]
+        [MemberData(nameof(Comparison_TestData))]
+        public void ComparisonOperators_ReturnExpected(Version version1, Version version2, int expectedSign)
+        {
+            if (expectedSign < 0)
+            {
+                Assert.True(version1 < version2);
+                Assert.True(version1 <= version2);
+                Assert.False(version1 == version2);
+                Assert.False(version1 >= version2);
+                Assert.False(version1 > version2);
+                Assert.True(version1 != version2);
+            }
+            else if (expectedSign == 0)
+            {
+                Assert.False(version1 < version2);
+                Assert.True(version1 <= version2);
+                Assert.True(version1 == version2);
+                Assert.True(version1 >= version2);
+                Assert.False(version1 > version2);
+                Assert.False(version1 != version2);
+            }
+            else
+            {
+                Assert.False(version1 < version2);
+                Assert.False(version1 <= version2);
+                Assert.False(version1 == version2);
+                Assert.True(version1 >= version2);
+                Assert.True(version1 > version2);
+                Assert.True(version1 != version2);
+            }
         }

         [Theory]
@@ -157,17 +181,6 @@
             var version = new Version(1, 1);
             AssertExtensions.Throws<ArgumentException>(null, () => version.CompareTo(other));
             AssertExtensions.Throws<ArgumentException>(null, () => ((IComparable)version).CompareTo(other));
-        }
-
-        [Fact]
-        public void Comparisons_NullArgument_ThrowsArgumentNullException()
-        {
-            Version nullVersion = null;
-            Version nonNullVersion = new Version(1, 2);
-            AssertExtensions.Throws<ArgumentNullException>("v1", () => nonNullVersion >= nullVersion);
-            AssertExtensions.Throws<ArgumentNullException>("v1", () => nonNullVersion > nullVersion);
-            AssertExtensions.Throws<ArgumentNullException>("v1", () => nullVersion < nonNullVersion);
-            AssertExtensions.Throws<ArgumentNullException>("v1", () => nullVersion <= nonNullVersion);
         }

         public static IEnumerable<object[]> Equals_TestData()


Port to winRT

Port to winRT

--- cocos2d/CCDirector.cs
+++ cocos2d/CCDirector.cs
@@ -53,7 +53,7 @@
         internal CCSize m_obWinSizeInPixels;
         internal CCSize m_obWinSizeInPoints;

-#if !PSM
+#if !PSM &&!NETFX_CORE
         private CCAccelerometer m_pAccelerometer;
 #endif
 		private CCActionManager m_pActionManager;
@@ -458,7 +458,7 @@
             set { m_pKeypadDispatcher = value; }
         }

-#if !PSM
+#if !PSM &&!NETFX_CORE
 		public CCAccelerometer Accelerometer
         {
             get { return m_pAccelerometer; }
@@ -567,7 +567,7 @@
             m_pKeypadDispatcher = new CCKeypadDispatcher();

 			// Accelerometer
-#if !PSM
+#if !PSM &&!NETFX_CORE
             m_pAccelerometer = new CCAccelerometer();
 #endif
             // create autorelease pool


Updated BoundedPriorityQueue.cs to 4.0.2 compatibility.

--- src/BoboBrowse.Net/BoboBrowse.Net/Util/BoundedPriorityQueue.cs
+++ src/BoboBrowse.Net/BoboBrowse.Net/Util/BoundedPriorityQueue.cs
@@ -17,7 +17,7 @@
 //* See the License for the specific language governing permissions and
 //* limitations under the License.

-// Version compatibility level: 3.2.0
+// Version compatibility level: 4.0.2
 namespace BoboBrowse.Net.Util
 {
     using C5;


Update PowerpackInterface.cs

Update PowerpackInterface.cs

--- src/Plivo/Resource/Powerpack/PowerpackInterface.cs
+++ src/Plivo/Resource/Powerpack/PowerpackInterface.cs
@@ -234,9 +234,9 @@

 			return ExecuteWithExceptionUnwrap(() =>
 			{
-				var result = Task.Run(async () => await Client.Update<UpdateResponse<Powerpack>>(Uri, data).ConfigureAwait(false)).Result;
+				var result = Task.Run(async () => await Client.Update<UpdateResponse<Powerpack>>(Uri +"Powerpack/"+uuid, data).ConfigureAwait(false)).Result;
                 result.Object.StatusCode = result.StatusCode;
-				return result.Object;
+				return result.Object;
 			});
 		}
           /// <summary>
@@ -616,4 +616,4 @@
        #endregion
  }

-}+}


Remove assert

Remove assert

Now that tree edits are computed for statement syntax, there is no guarantee nodes will be labelled

--- src/Features/CSharp/Portable/EditAndContinue/SyntaxComparer.cs
+++ src/Features/CSharp/Portable/EditAndContinue/SyntaxComparer.cs
@@ -101,8 +101,6 @@

         protected internal override IEnumerable<SyntaxNode>? GetChildren(SyntaxNode node)
         {
-            Debug.Assert(HasLabel(node));
-
             if (node == _oldRoot)
             {
                 return _oldRootChildren;


Add XMLDoc to IFileStreamCaptureHandler.

--- src/MMALSharp.Processing/Handlers/IFileStreamCaptureHandler.cs
+++ src/MMALSharp.Processing/Handlers/IFileStreamCaptureHandler.cs
@@ -1,6 +1,13 @@
-
+// <copyright file="IFileStreamCaptureHandler.cs" company="Techyian">
+// Copyright (c) Ian Auty. All rights reserved.
+// Licensed under the MIT License. Please see LICENSE.txt for License info.
+// </copyright>
+
 namespace MMALSharp.Handlers
 {
+    /// <summary>
+    /// Represents a FileStreamCaptureHandler.
+    /// </summary>
     public interface IFileStreamCaptureHandler : IOutputCaptureHandler
     {
         /// <summary>


Fixed failing build

Fixed failing build

--- src/Marten.NodaTime.Testing/Acceptance/noda_time_acceptance.cs
+++ src/Marten.NodaTime.Testing/Acceptance/noda_time_acceptance.cs
@@ -20,7 +20,7 @@
                 _.Connection(ConnectionSource.ConnectionString);

                 // sets up NodaTime handling
-                _.UseNodaTime()
+                _.UseNodaTime();
             });
             // ENDSAMPLE
         }
@@ -35,7 +35,7 @@
                 _.Serializer<CustomJsonSerializer>();

                 // sets up NodaTime handling
-                _.UseNodaTime(shouldConfigureJsonNetSerializer: false)
+                _.UseNodaTime(shouldConfigureJsonNetSerializer: false);
             });
             // ENDSAMPLE
         }


Remove unused imports

Remove unused imports

--- Mappy/Models/MainFormViewModel.cs
+++ Mappy/Models/MainFormViewModel.cs
@@ -1,12 +1,10 @@
 namespace Mappy.Models
 {
     using System;
-    using System.Collections.Generic;
     using System.Drawing;
     using System.Linq;
     using System.Reactive.Linq;

-    using Mappy.Data;
     using Mappy.Services;

     public class MainFormViewModel : IMainFormViewModel


break instead of return from buttonBenchStartAllmethods_Click method

--- MethodSpeedBenchmarks/FormMain.cs
+++ MethodSpeedBenchmarks/FormMain.cs
@@ -174,7 +174,7 @@
       {
         if (j < 1)
         {
-          return;
+          break;
         }

         textBoxBenchIteration.Text = j.ToString();


Fix locking pattern

Fix locking pattern

--- Mock4Net.Core/FluentMockServer.cs
+++ Mock4Net.Core/FluentMockServer.cs
@@ -21,6 +21,7 @@
         private readonly HttpListenerResponseMapper _responseMapper = new HttpListenerResponseMapper();
         private readonly int _port;
         private TimeSpan _requestProcessingDelay = TimeSpan.Zero;
+        private object _syncRoot = new object();

         private FluentMockServer(int port, bool ssl)
         {
@@ -68,7 +69,7 @@

         public void AddRequestProcessingDelay(TimeSpan delay)
         {
-            lock (this)
+            lock (_syncRoot)
             {
                 _requestProcessingDelay = delay;
             }
@@ -92,7 +93,7 @@

         private async void HandleRequest(HttpListenerContext ctx)
         {
-            lock (this)
+            lock (_syncRoot)
             {
                 Task.Delay(_requestProcessingDelay).Wait();
             }


Removes async from filestream instance

Removes async from filestream instance

--- src/Umbraco.Web/umbraco.presentation/content.cs
+++ src/Umbraco.Web/umbraco.presentation/content.cs
@@ -844,7 +844,7 @@
         internal void SaveXmlToFile()
         {
             LogHelper.Info<content>("Save Xml to file...");
-
+            //Thread.Sleep(30000);
             try
             {
                 var xml = _xmlContent; // capture (atomic + volatile), immutable anyway
@@ -861,7 +861,7 @@
                     Directory.CreateDirectory(directoryName);

                 // save
-                using (var fs = new FileStream(_xmlFileName, FileMode.Create, FileAccess.Write, FileShare.Read, bufferSize: 4096, useAsync: true))
+                using (var fs = new FileStream(_xmlFileName, FileMode.Create, FileAccess.Write, FileShare.Read))
                 {
                     SaveXmlToStream(xml, fs);
                 }


added a getter for transformation version - its useful to detect changes in node and implement stuff like octree etc.

--- MonoGameSceneGraph/Source/Node.cs
+++ MonoGameSceneGraph/Source/Node.cs
@@ -105,6 +105,12 @@
         public Node Parent { get { return _parent; } }

         /// <summary>
+        /// Transformation version is a special identifier that changes whenever the world transformations
+        /// of this node changes. Its not necessarily a sequence, but if you check this number for changes every
+        /// frame its a good indication of transformation change.
+        /// </summary>
+
+        /// <summary>
         /// Draw the node and its children.
         /// </summary>
         public virtual void Draw()


Test that RandomSubset returns original sequence elements

Merge of PR #483

--- MoreLinq.Test/RandomSubsetTest.cs
+++ MoreLinq.Test/RandomSubsetTest.cs
@@ -206,6 +206,23 @@
             Assert.That(sequence, Is.EqualTo(sequenceClone));
         }

+        /// <summary>
+        /// Verify that RandomSubset produces subset where all elements belongs to original sequence.
+        /// </summary>
+        [Test]
+        public void TestRandomSubsetReturnsOriginalSequenceElements()
+        {
+            const int count = 100;
+            var sequence = Enumerable.Range(1, count);
+            var result = sequence.RandomSubset(count, new Random(12345));
+
+            // we do not test overload without seed because it can return original sequence
+            Assert.That(sequence, Is.Not.EqualTo(result));
+
+            // ensure random subset returns exactly the same elements of original sequence
+            Assert.That(sequence, Is.EqualTo(result.OrderBy(x => x)));
+        }
+
         static double RelativeStandardDeviation(IEnumerable<double> values)
         {
             var average = values.Average();


bump 0.1.1 release

bump 0.1.1 release

--- src/RxFileSystemWatcher/Properties/AssemblyInfo.cs
+++ src/RxFileSystemWatcher/Properties/AssemblyInfo.cs
@@ -23,5 +23,5 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM

 [assembly: Guid("8ac26a3f-ea94-44ca-8131-e3a63ad35bfa")]
-[assembly: AssemblyVersion("0.1.0")]
-[assembly: AssemblyFileVersion("0.1.0")]+[assembly: AssemblyVersion("0.1.1")]
+[assembly: AssemblyFileVersion("0.1.1")]


List GitHub addins in GitHub actions section (#2264)

--- input/docs/integrations/build-systems/github-actions/index.cshtml
+++ input/docs/integrations/build-systems/github-actions/index.cshtml
@@ -31,7 +31,7 @@

Available 3rd party extensions

 @{
-    var keywords = new List<string> { "githubactions" };
+    var keywords = new List<string> { "githubactions", "github" };
     var extensions =
         Documents["Extensions"]
             .Where(x =>


Add ClientBounds transfer on initialisation.

--- osu.Framework/OS/BasicGameHost.cs
+++ osu.Framework/OS/BasicGameHost.cs
@@ -131,6 +131,7 @@
             updateScheduler = new Scheduler(updateThread);

             Window.ClientSizeChanged += window_ClientSizeChanged;
+            window_ClientSizeChanged(null, null);

             Exception error = null;


Add comment about the android ruleset situation.

--- osu.Game/Rulesets/RulesetStore.cs
+++ osu.Game/Rulesets/RulesetStore.cs
@@ -22,6 +22,8 @@
         {
             AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve;

+            // On android in release configuration the assemblies are loaded from the apk directly into memory.
+            // In this case there is no way to access the ruleset assemblies from the filesystem.
             addLoadedRulesets();

             try


Move local back in place

Move local back in place

--- osu.Game/Updater/UpdateManager.cs
+++ osu.Game/Updater/UpdateManager.cs
@@ -24,8 +24,6 @@
                                          // only implementations will actually check for updates.
                                          GetType() != typeof(UpdateManager);

-        private string lastVersion;
-
         [Resolved]
         private OsuConfigManager config { get; set; }

@@ -42,7 +40,7 @@
             Schedule(() => Task.Run(CheckForUpdateAsync));

             // Query last version only *once*, so the user can re-check for updates, in case they closed the notification or else.
-            lastVersion ??= config.Get<string>(OsuSetting.Version);
+            var lastVersion = config.Get<string>(OsuSetting.Version);

             var version = game.Version;


Made random locally scoped to GetNextWaitInterval method

--- src/SendGrid/Reliability/RetryDelegatingHandler.cs
+++ src/SendGrid/Reliability/RetryDelegatingHandler.cs
@@ -22,8 +22,6 @@
             };

         private readonly ReliabilitySettings settings;
-
-        private readonly Random random = new Random();

         /// <summary>
         /// Initializes a new instance of the <see cref="RetryDelegatingHandler"/> class.
@@ -107,8 +105,10 @@

         private TimeSpan GetNextWaitInterval(int numberOfAttempts)
         {
+            var random = new Random();
+
             var delta = (int)((Math.Pow(2.0, numberOfAttempts) - 1.0) *
-                               this.random.Next(
+                               random.Next(
                                    (int)(this.settings.DeltaBackOff.TotalMilliseconds * 0.8),
                                    (int)(this.settings.DeltaBackOff.TotalMilliseconds * 1.2)));


- Added logic to the SoundControl

- Added logic to the SoundControl

--- gamejamua14/Assets/Scripts/GlobalSoundControl.cs
+++ gamejamua14/Assets/Scripts/GlobalSoundControl.cs
@@ -1,15 +1,150 @@
 using UnityEngine;
 using System.Collections;

-public class GlobalSoundControl : MonoBehaviour {
+public class GlobalSoundControl : MonoBehaviour
+{
+		public AudioSource[] AudioSources;
+		public AudioClip[] AtmosphereClips;
+		public AudioClip[] SpiderClips;
+		public AudioClip[] PiranhasClips;
+		public AudioClip[] PanelsClips;
+		public AudioClip DieClips;
+		[Range(0.1f, 1f)]
+		public float
+				fadeSteps;
+		private int currentAudioSource;
+		private AudioClip[] CurrentTheme;
+		private bool switchingTheme;
+
+		void Start ()
+		{
+				currentAudioSource = 0;
+				switchingTheme = false;
+				CurrentTheme = AtmosphereClips;
+				PlayNextClip ();
+		}
+
+		void Update ()
+		{
+				if (switchingTheme == true) {
+						if (AudioSources [currentAudioSource].volume < 1) {
+								FadeIn ();
+						}
+						if (AudioSources [getSecondaryAudioSource ()].volume > 0.1) {
+								FadeOut ();
+						} else {
+								AudioSources [getSecondaryAudioSource ()].Stop ();
+								switchingTheme = false;
+								setDefaultVolumes ();
+						}
+				} else {
+						if (!AudioSources [currentAudioSource].isPlaying) {
+								SetCurrentAudioSource ();
+								PlayNextClip ();
+						}
+				}
+		}
+
+		public void PlayDeathSound ()
+		{
+				StartPlaying (DieClips);
+
+		}
+
+		public void StartPlaying (AudioClip a_audioClip, bool a_loop = false)
+		{
+				foreach (AudioSource a_source in AudioSources) {
+						if (!a_source.isPlaying) {
+								a_source.clip = a_audioClip;
+								a_source.loop = a_loop;
+								a_source.Play ();
+								return;
+						}
+				}
+		}
+
+		private void PlayNextClip ()
+		{
+				AudioSources [currentAudioSource].clip = CurrentTheme [Random.Range (0, CurrentTheme.Length)];
+				AudioSources [currentAudioSource].loop = false;
+				AudioSources [currentAudioSource].Play ();
+		}
+
+		private void PlayClip (int clip, AudioClip[] theme)
+		{
+				AudioSources [currentAudioSource].clip = theme [clip];
+				AudioSources [currentAudioSource].loop = false;
+				AudioSources [currentAudioSource].Play ();
+		}
+
+		private void SetCurrentAudioSource ()
+		{
+				if (currentAudioSource == 0) {
+						currentAudioSource = 1;
+				} else {
+						currentAudioSource = 0;
+				}
+		}
+
+		private int getSecondaryAudioSource ()
+		{
+				if (currentAudioSource == 0) {
+						return 1;
+				} else {
+						return 0;
+				}
+		}
+
+		private void setSwitchingVolumes ()
+		{
+				AudioSources [currentAudioSource].volume = (float)0.1;
+				AudioSources [getSecondaryAudioSource ()].volume = (float)1;
+		}
+
+		private void setDefaultVolumes ()
+		{
+				AudioSources [currentAudioSource].volume = (float)1;
+				AudioSources [getSecondaryAudioSource ()].volume = (float)1;
+		}
+
+		private void FadeIn ()
+		{
+				AudioSources [currentAudioSource].volume += ((float)fadeSteps) * Time.deltaTime;
+				print ("Fade in:" + AudioSources [currentAudioSource].volume);
+		}
+
+		private void FadeOut ()
+		{
+				AudioSources [getSecondaryAudioSource ()].volume -= ((float)fadeSteps) * Time.deltaTime;
+				print ("Fade out:" + AudioSources [getSecondaryAudioSource ()].volume);
+		}
+
+		private void ChangeAudioSource ()
+		{
+		}
+
+		private void changeTheme (AudioClip[] theme)
+		{
+				switchingTheme = true;
+				CurrentTheme = theme;
+				SetCurrentAudioSource ();
+				setSwitchingVolumes ();
+				PlayNextClip ();
+		}
+
+		public void ChangeToSpiders ()
+		{
+				changeTheme (SpiderClips);
+		}

-	// Use this for initialization
-	void Start () {
+		public void ChangeToPiranhas ()
+		{
+				changeTheme (SpiderClips);
+		}

-	}
+		public void ChangeToAtmosphere ()
+		{
+				changeTheme (AtmosphereClips);
+		}

-	// Update is called once per frame
-	void Update () {
-
-	}
 }


Swapped SSA assignment and constant folded so SSA -> const adds are folded

--- compiler/Compiler.cs
+++ compiler/Compiler.cs
@@ -208,17 +208,18 @@
         private bool TransformIr(ParseTree func, bool cleanSsa)
         {
             bool restart = false;
+
+            // replace ssa asignments with add instructions
+            if (cleanSsa)
+            {
+                CleanUpSsa.Clean(func.ControlFlowGraph.Root);
+            }
+
             // Copy propagation
             if (Opts.CopyProp)
             {
                 CopyPropagation.Propagate(func.ControlFlowGraph.Root);
                 CopyPropagation.ConstantFolding(func.ControlFlowGraph.Root);
-            }
-
-            // replace ssa asignments with add instructions
-            if (cleanSsa)
-            {
-                CleanUpSsa.Clean(func.ControlFlowGraph.Root);
             }

             //Common Sub Expression Elimination


remove headers from register

remove headers from register

--- examples/client/client.cs
+++ examples/client/client.cs
@@ -61,7 +61,6 @@

             eb.register(
                 "pcs.status",
-                h,
                 (new Handlers(
                     "pcs.status",
                     new Action<JObject>(


Updated ForumJump Control

Updated ForumJump Control

--- yafsrc/YAF.Web/Controls/ForumJump.cs
+++ yafsrc/YAF.Web/Controls/ForumJump.cs
@@ -32,7 +32,6 @@
     using System.Linq;
     using System.Web.UI;

-    using YAF.Configuration;
     using YAF.Core.BaseControls;
     using YAF.Core.Extensions;
     using YAF.Core.Model;
@@ -137,7 +136,10 @@
                 TimeSpan.FromMinutes(5));

             writer.WriteLine(
-                $@"<select name=""{this.UniqueID}"" onchange=""{this.Page.ClientScript.GetPostBackClientHyperlink(this, this.ID)}"" id=""{this.ClientID}"" class=""custom-select"">");
+                $@"<select name=""{this.UniqueID}""
+                             onchange=""{this.Page.ClientScript.GetPostBackClientHyperlink(this, this.ID)}""
+                             id=""{this.ClientID}""
+                             class=""select2-image-select"">");

             var forumId = this.PageContext.PageForumID;
             if (forumId <= 0)
@@ -148,13 +150,16 @@
             forumJump.Rows.Cast<DataRow>().ForEach(
                 row =>
                     {
+                        var title = this.HtmlEncode(row["Title"]);
+
                         writer.WriteLine(
-                            @"<option {2}value=""{0}"">  {1}</option>",
+                            @"<option {2}value=""{0}"" data-content=""{3}"">  {1}</option>",
                             row["ForumID"],
-                            this.HtmlEncode(row["Title"]),
-                            Convert.ToString(row["ForumID"]) == forumId.ToString()
+                            title,
+                            row["ForumID"].ToString() == forumId.ToString()
                                 ? @"selected=""selected"" "
-                                : string.Empty);
+                                : string.Empty,
+                            $" {title}");
                     });

             writer.WriteLine("</select>");


adding 'Version' to HostStatus

adding 'Version' to HostStatus

--- src/WebJobs.Script.WebHost/Models/HostStatus.cs
+++ src/WebJobs.Script.WebHost/Models/HostStatus.cs
@@ -2,6 +2,7 @@
 // Licensed under the MIT License. See License.txt in the project root for license information.

 using System.Collections.ObjectModel;
+using System.Reflection;
 using Newtonsoft.Json;

 namespace Microsoft.Azure.WebJobs.Script.WebHost.Models
@@ -9,9 +10,21 @@
     public class HostStatus
     {
         /// <summary>
+        /// Gets the host version.
+        /// </summary>
+        [JsonProperty(PropertyName = "version")]
+        public static readonly string Version = GetExecutingAssemblyFileVersion();
+
+        /// <summary>
         /// Gets or sets the collection of errors for the host.
         /// </summary>
         [JsonProperty(PropertyName = "errors", DefaultValueHandling = DefaultValueHandling.Ignore)]
         public Collection<string> Errors { get; set; }
+
+        private static string GetExecutingAssemblyFileVersion()
+        {
+            AssemblyFileVersionAttribute fileVersionAttr = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>();
+            return fileVersionAttr?.Version ?? "Unknown";
+        }
     }
 }


Sleep a bit after killing owned processes to prevent re-detection

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -5896,7 +5896,9 @@
             SetHasChangesLocally(false);

             //kill known owned processes to release inherited socket handles
-            KillOwnedProcesses();
+            if (KillOwnedProcesses())
+                //otherwise may still be prompted below by check for disowned miners
+                Thread.Sleep(500);

             //check for disowned miners before refreshing devices
             if (applicationConfiguration.DetectDisownedMiners)
@@ -6901,14 +6903,19 @@
             OwnedProcesses.SaveOwnedProcesses(miningEngine.MinerProcesses.Select(mp => mp.Process), GetOwnedProcessFilePath());
         }

-        private void KillOwnedProcesses()
-        {
+        private static bool KillOwnedProcesses()
+        {
+            bool processesKilled = false;
             string filePath = GetOwnedProcessFilePath();
             IEnumerable<Process> ownedProcesses = OwnedProcesses.GetOwnedProcesses(filePath);
             foreach (Process ownedProcess in ownedProcesses)
+            {
                 MinerProcess.KillProcess(ownedProcess);
+                processesKilled = true;
+            }
             if (File.Exists(filePath))
                 File.Delete(filePath);
+            return processesKilled;
         }
         #endregion


Add support for builtins directory from the assembly folder/_meta

--- src/Lunet/Core/MetaManager.cs
+++ src/Lunet/Core/MetaManager.cs
@@ -3,6 +3,8 @@
 // See the license.txt file in the project root for more information.

 using System.Collections.Generic;
+using System.IO;
+using System.Reflection;

 namespace Lunet.Core
 {
@@ -22,9 +24,13 @@
         {
             Directory = Site.BaseDirectory.GetSubFolder(MetaDirectoryName);
             PrivateDirectory = Site.PrivateBaseDirectory.GetSubFolder(MetaDirectoryName);
+            BuiltinDirectory = Path.GetDirectoryName(typeof(MetaManager).GetTypeInfo().Assembly.Location);
         }

         public FolderInfo Directory { get; }
+
+        public FolderInfo BuiltinDirectory { get; }
+

         public FolderInfo PrivateDirectory { get; }

@@ -38,6 +44,9 @@
                 {
                     yield return theme.Directory.GetSubFolder(MetaDirectoryName);
                 }
+
+                // Last one is the builtin directory
+                yield return new DirectoryInfo(Path.Combine(BuiltinDirectory, MetaDirectoryName));
             }
         }
     }


Rename private field

Rename private field

--- NCDK/IO/Setting/SettingManager.cs
+++ NCDK/IO/Setting/SettingManager.cs
@@ -52,7 +52,7 @@
         /// </summary>
         /// <seealso cref="MakeKey(ISetting)"/>
         /// <seealso cref="MakeKey(string)"/>
-        private static readonly Regex WHITE_SPACE = new Regex("\\s+", RegexOptions.Compiled);
+        private static readonly Regex regex_WhiteSpace = new Regex("\\s+", RegexOptions.Compiled);

         /// <summary>
         /// Settings are stored in a map of name -> instance.
@@ -68,7 +68,7 @@
         /// <returns>keyed setting name</returns>
         private static string MakeKey(string name)
         {
-            return WHITE_SPACE.Replace(name, ".").ToLowerInvariant();
+            return regex_WhiteSpace.Replace(name, ".").ToLowerInvariant();
         }

         /// <summary>


fixed test

fixed test

--- NSpecSpecs/describe_SpecFinder.cs
+++ NSpecSpecs/describe_SpecFinder.cs
@@ -138,9 +138,10 @@
             TheSpecClasses()
                 .should_contain(typeof(SomeClass))
                 .should_contain(typeof(SomeDerivedClass))
+                .should_contain(typeof(SomeDerivedDerivedClass))
                 .should_not_contain(typeof(SomeClassInOtherNameSpace));

-            TheSpecClasses().Count().should_be(2);
+            TheSpecClasses().Count().should_be(3);
         }

         [Test]


Added Data annotations to Country model

Added Data annotations to Country model

--- ATPTennisStat/ATPTennisStat.Models/Country.cs
+++ ATPTennisStat/ATPTennisStat.Models/Country.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;

 namespace ATPTennisStat.Models
 {
@@ -9,8 +10,11 @@
             Cities = new HashSet<City>();
         }

+        [Key]
         public int Id { get; set; }

+        [Required]
+        [StringLength(50)]
         public string Name { get; set; }

         public virtual ICollection<City> Cities { get; set; }


Removed extraneous curly brace.

Removed extraneous curly brace.

--- src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml
+++ src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml
@@ -10,15 +10,14 @@
     var unspecifiedCategoryRecipes = Model.Recipes.Where(x => String.IsNullOrWhiteSpace(x.Category)).ToList();
 }
 @helper RenderRecipeOptions(IEnumerable<Recipe> recipes) {
-        foreach (var recipe in recipes) {
-            var optionAttributes = new RouteValueDictionary {
-                    { "data-recipe-description", recipe.Description }
-                };
-            if (Model.Recipe == null && recipe.Name == "Default") {
-                optionAttributes["selected"] = "selected";
-            }
-            @Html.SelectOption(Model.Recipe, recipe.Name, recipe.Name, optionAttributes)
+    foreach (var recipe in recipes) {
+        var optionAttributes = new RouteValueDictionary {
+                { "data-recipe-description", recipe.Description }
+            };
+        if (Model.Recipe == null && recipe.Name == "Default") {
+            optionAttributes["selected"] = "selected";
         }
+        @Html.SelectOption(Model.Recipe, recipe.Name, recipe.Name, optionAttributes)
     }
 }
 <h1>@Html.TitleForPage(T("Get Started").ToString())</h1>


Fix image

Fix image

--- AcademyEF/AcademyEF/Views/Courses/List.cshtml
+++ AcademyEF/AcademyEF/Views/Courses/List.cshtml
@@ -21,7 +21,7 @@
     {

-
+

@Html.DisplayFor(modelItem => item.Name)

@Html.DisplayFor(modelItem => item.Description)


[Fixes #5492] Adding JavaScriptEncode token

--- src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs
+++ src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs
@@ -17,6 +17,7 @@
                 .Token("TrimEnd:*", T("TrimEnd:<chars|number>"), T("Trims the specified characters or number of them from the end of the string."))
                 .Token("UrlEncode", T("Url Encode"), T("Encodes a URL string."), "Text")
                 .Token("HtmlEncode", T("Html Encode"), T("Encodes an HTML string."), "Text")
+                .Token("JavaScriptEncode", T("JavaScript Encode"), T("Encodes a JavaScript string."), "Text")
                 .Token("LineEncode", T("Line Encode"), T("Replaces new lines with
 tags."), "Text")
                 ;
         }
@@ -41,6 +42,8 @@
                 .Chain("UrlEncode", "Text", HttpUtility.UrlEncode)
                 .Token("HtmlEncode", HttpUtility.HtmlEncode)
                 .Chain("HtmlEncode", "Text", HttpUtility.HtmlEncode)
+                .Token("JavaScriptEncode", HttpUtility.JavaScriptStringEncode)
+                .Chain("JavaScriptEncode", "Text", HttpUtility.JavaScriptStringEncode)
                 .Token("LineEncode", text => text.Replace(System.Environment.NewLine, "
"))
                 .Chain("LineEncode", "Text", text => text.Replace(System.Environment.NewLine, "
"))
                 ;


Fix bug 16637

Fix bug 16637

See http://orchard.codeplex.com/WorkItem/View.aspx?WorkItemId=16337

There were some breaking changes introduced in the Expression Trees in .NET 4.0.
Workaround these changes in a way compatible with .NET 3.5.

--HG--
branch : dev

--- src/Orchard/ContentManagement/Records/ContentItemAlteration.cs
+++ src/Orchard/ContentManagement/Records/ContentItemAlteration.cs
@@ -47,12 +47,18 @@
             void Override(AutoMapping<TItemRecord> mapping);
         }

+        /// <summary>
+        /// Add a "fake" column to the automapping record so that the column can be
+        /// referenced when building joins accross content item record tables.
+        /// <typeparam name="TItemRecord">Either ContentItemRecord or ContentItemVersionRecord</typeparam>
+        /// <typeparam name="TPartRecord">A part record (deriving from TItemRecord)</typeparam>
         class Alteration<TItemRecord, TPartRecord> : IAlteration<TItemRecord> {
             public void Override(AutoMapping<TItemRecord> mapping) {

                 // public TPartRecord TPartRecord {get;set;}
                 var name = typeof(TPartRecord).Name;
-                var syntheticMethod = new DynamicMethod(name, typeof(TPartRecord), null, typeof(TItemRecord));
+                var dynamicMethod = new DynamicMethod(name, typeof(TPartRecord), null, typeof(TItemRecord));
+                var syntheticMethod = new SyntheticMethodInfo(dynamicMethod, typeof(TItemRecord));
                 var syntheticProperty = new SyntheticPropertyInfo(syntheticMethod);

                 // record => record.TPartRecord
@@ -73,11 +79,85 @@
             }
         }

+        /// <summary>
+        /// Synthetic method around a dynamic method. We need this so that we can
+        /// override the "static" method attributes, and also return a valid "DeclaringType".
+        /// </summary>
+        private class SyntheticMethodInfo : MethodInfo {
+            private readonly DynamicMethod _dynamicMethod;
+            private readonly Type _declaringType;
+
+            public SyntheticMethodInfo(DynamicMethod dynamicMethod, Type declaringType) {
+                _dynamicMethod = dynamicMethod;
+                _declaringType = declaringType;
+            }
+
+            public override object[] GetCustomAttributes(bool inherit) {
+                return _dynamicMethod.GetCustomAttributes(inherit);
+            }
+
+            public override bool IsDefined(Type attributeType, bool inherit) {
+                return IsDefined(attributeType, inherit);
+            }
+
+            public override ParameterInfo[] GetParameters() {
+                return _dynamicMethod.GetParameters();
+            }
+
+            public override MethodImplAttributes GetMethodImplementationFlags() {
+                return _dynamicMethod.GetMethodImplementationFlags();
+            }
+
+            public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) {
+                return _dynamicMethod.Invoke(obj, invokeAttr, binder, parameters, culture);
+            }
+
+            public override MethodInfo GetBaseDefinition() {
+                return _dynamicMethod.GetBaseDefinition();
+            }
+
+            public override ICustomAttributeProvider ReturnTypeCustomAttributes {
+                get { return ReturnTypeCustomAttributes; }
+            }
+
+            public override string Name {
+                get { return _dynamicMethod.Name; }
+            }
+
+            public override Type DeclaringType {
+                get { return _declaringType; }
+            }
+
+            public override Type ReflectedType {
+                get { return _dynamicMethod.ReflectedType; }
+            }
+
+            public override RuntimeMethodHandle MethodHandle {
+                get { return _dynamicMethod.MethodHandle; }
+            }
+
+            public override MethodAttributes Attributes {
+                get { return _dynamicMethod.Attributes & ~MethodAttributes.Static; }
+            }
+
+            public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
+                return _dynamicMethod.GetCustomAttributes(attributeType, inherit);
+            }
+
+            public override Type ReturnType {
+                get { return _dynamicMethod.ReturnType; }
+            }
+        }
+
+        /// <summary>
+        /// Synthetic property around a method info (the "getter" method).
+        /// This is a minimal implementation enabling support for AutoMapping.References.
+        /// </summary>
         private class SyntheticPropertyInfo : PropertyInfo {
-            private readonly DynamicMethod _getMethod;
-
-            public SyntheticPropertyInfo(DynamicMethod dynamicMethod) {
-                _getMethod = dynamicMethod;
+            private readonly MethodInfo _getMethod;
+
+            public SyntheticPropertyInfo(MethodInfo getMethod) {
+                _getMethod = getMethod;
             }

             public override object[] GetCustomAttributes(bool inherit) {
@@ -117,11 +197,11 @@
             }

             public override Type DeclaringType {
-                get { throw new NotImplementedException(); }
+                get { return _getMethod.DeclaringType; }
             }

             public override Type ReflectedType {
-                get { throw new NotImplementedException(); }
+                get { return _getMethod.ReflectedType; }
             }

             public override Type PropertyType {


Store actions as their object representation

--- osu.Framework/Input/Bindings/KeyBinding.cs
+++ osu.Framework/Input/Bindings/KeyBinding.cs
@@ -15,9 +15,8 @@

         /// <summary>
         /// The resultant action which is triggered by this binding.
-        /// This is an <see cref="int"/> representation of an enum type.
         /// </summary>
-        public int Action;
+        public object Action;

         /// <summary>
         /// Construct a new instance.
@@ -27,7 +26,8 @@
         public KeyBinding(KeyCombination keys, object action)
         {
             KeyCombination = keys;
-            Action = (int)action;
+
+            Action = action;
         }

         /// <summary>
@@ -42,7 +42,7 @@
         /// </summary>
         /// <typeparam name="T">The enum type.</typeparam>
         /// <returns>A cast <see cref="T"/> representation of <see cref="Action"/>.</returns>
-        public virtual T GetAction<T>() => (T)(object)Action;
+        public virtual T GetAction<T>() => (T)Action;

         public override string ToString() => $"{KeyCombination}=>{Action}";
     }


was persuaded I changed the if statement...

--- osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs
@@ -33,7 +33,7 @@
             foreach (var d in drawables.OfType<DrawableOsuHitObject>())
             {
                 //Don't hide the first object if the increaseFirstObjectVisibility is true ("drawables" are in a reverse order -> Last() )
-                if (d == drawables.Last() && (increaseFirstObjectVisibility == null || increaseFirstObjectVisibility)) continue;
+                if (d == drawables.Last() && increaseFirstObjectVisibility) continue;
                 d.ApplyCustomUpdateState += ApplyHiddenState;

                 d.HitObject.TimeFadein = d.HitObject.TimePreempt * fade_in_duration_multiplier;


Rename variable

Rename variable

--- osu.Game.Rulesets.Osu/Mods/OsuModRandom.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModRandom.cs
@@ -146,19 +146,19 @@
         /// <returns>The deviation from the original randomised position in order to fit within the playfield.</returns>
         private Vector2 clampSliderToPlayfield(Slider slider, RandomObjectInfo objectInfo)
         {
-            var area = calculatePossibleMovementBounds(slider);
+            var possibleMovementBounds = calculatePossibleMovementBounds(slider);

             var previousPosition = objectInfo.PositionRandomised;

             // Clamp slider position to the placement area
             // If the slider is larger than the playfield, force it to stay at the original position
-            var newX = area.Width < 0
+            var newX = possibleMovementBounds.Width < 0
                 ? objectInfo.PositionOriginal.X
-                : Math.Clamp(previousPosition.X, area.Left, area.Right);
-
-            var newY = area.Height < 0
+                : Math.Clamp(previousPosition.X, possibleMovementBounds.Left, possibleMovementBounds.Right);
+
+            var newY = possibleMovementBounds.Height < 0
                 ? objectInfo.PositionOriginal.Y
-                : Math.Clamp(previousPosition.Y, area.Top, area.Bottom);
+                : Math.Clamp(previousPosition.Y, possibleMovementBounds.Top, possibleMovementBounds.Bottom);

             slider.Position = objectInfo.PositionRandomised = new Vector2(newX, newY);
             objectInfo.EndPositionRandomised = slider.EndPosition;


Add settings `AngleSharpness` and `Angle variety`

--- osu.Game.Rulesets.Osu/Mods/OsuModRandom.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModRandom.cs
@@ -4,9 +4,12 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using osu.Framework.Bindables;
 using osu.Framework.Localisation;
 using osu.Framework.Utils;
 using osu.Game.Beatmaps;
+using osu.Game.Configuration;
+using osu.Game.Overlays.Settings;
 using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Objects;
 using osu.Game.Rulesets.Osu.Beatmaps;
@@ -24,6 +27,26 @@
         public override LocalisableString Description => "It never gets boring!";

         public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModTarget)).ToArray();
+
+        [SettingSource("Angle sharpness", "How sharp angles should be", SettingControlType = typeof(SettingsSlider<float>))]
+        public BindableFloat AngleSharpness { get; } = new BindableFloat
+        {
+            Default = 7,
+            Value = 7,
+            MinValue = 1,
+            MaxValue = 10,
+            Precision = 0.1f
+        };
+
+        [SettingSource("Angle variety", "The amount of variety in how sharp angles are", SettingControlType = typeof(SettingsSlider<float>))]
+        public BindableFloat AngleVariety { get; } = new BindableFloat
+        {
+            Default = 3,
+            Value = 3,
+            MinValue = 0,
+            MaxValue = 10,
+            Precision = 0.1f
+        };

         private static readonly float playfield_diagonal = OsuPlayfield.BASE_SIZE.LengthFast;

@@ -50,7 +73,7 @@
             {
                 if (shouldStartNewSection(osuBeatmap, positionInfos, i))
                 {
-                    sectionOffset = OsuHitObjectGenerationUtils.RandomGaussian(random, 0, 0.0008f);
+                    sectionOffset = getRandomOffset(0.0008f);
                     flowDirection = !flowDirection;
                 }

@@ -65,11 +88,11 @@
                     float flowChangeOffset = 0;

                     // Offsets only the angle of the current hit object.
-                    float oneTimeOffset = OsuHitObjectGenerationUtils.RandomGaussian(random, 0, 0.002f);
+                    float oneTimeOffset = getRandomOffset(0.002f);

                     if (shouldApplyFlowChange(positionInfos, i))
                     {
-                        flowChangeOffset = OsuHitObjectGenerationUtils.RandomGaussian(random, 0, 0.002f);
+                        flowChangeOffset = getRandomOffset(0.002f);
                         flowDirection = !flowDirection;
                     }

@@ -86,13 +109,32 @@
             osuBeatmap.HitObjects = OsuHitObjectGenerationUtils.RepositionHitObjects(positionInfos);
         }

+        private float getRandomOffset(float stdDev)
+        {
+            float customMultiplier = AngleVariety.Value / AngleVariety.Default;
+            return OsuHitObjectGenerationUtils.RandomGaussian(random, 0, stdDev * customMultiplier);
+        }
+
         /// <param name="targetDistance">The target distance between the previous and the current <see cref="OsuHitObject"/>.</param>
         /// <param name="offset">The angle (in rad) by which the target angle should be offset.</param>
         /// <param name="flowDirection">Whether the relative angle should be positive or negative.</param>
-        private static float getRelativeTargetAngle(float targetDistance, float offset, bool flowDirection)
+        private float getRelativeTargetAngle(float targetDistance, float offset, bool flowDirection)
         {
-            float angle = (float)(2.16 / (1 + 200 * Math.Exp(0.036 * (targetDistance - 310))) + 0.5 + offset);
+            // Range 0..1
+            float angleSharpness = AngleSharpness.Value / AngleSharpness.MaxValue;
+            float angleWideness = 1 - angleSharpness;
+
+            // Range: -70..30
+            float customOffsetX = angleSharpness * 100 - 70;
+            // Range: -0.075..0.175
+            float customOffsetY = angleWideness * 0.25f - 0.075f;
+
+            targetDistance += customOffsetX;
+            float angle = (float)(2.16 / (1 + 200 * Math.Exp(0.036 * (targetDistance - 310 + customOffsetX))) + 0.5);
+            angle += offset + customOffsetY;
+
             float relativeAngle = (float)Math.PI - angle;
+
             return flowDirection ? -relativeAngle : relativeAngle;
         }


Fix bracket precedence

Fix bracket precedence

--- osu.Game/Graphics/Backgrounds/Triangles.cs
+++ osu.Game/Graphics/Backgrounds/Triangles.cs
@@ -214,7 +214,7 @@
             {
                 base.Draw(vertexAction);

-                if (vertexBatch == null || vertexBatch.Size != Source.AimCount && Source.AimCount > 0)
+                if (Source.AimCount > 0 && (vertexBatch == null || vertexBatch.Size != Source.AimCount))
                 {
                     vertexBatch?.Dispose();
                     vertexBatch = new TriangleBatch<TexturedVertex2D>(Source.AimCount, 1);


Fix cursor horizontal position.

Fix cursor horizontal position.

--- osu.Game/Graphics/UserInterface/TextBox.cs
+++ osu.Game/Graphics/UserInterface/TextBox.cs
@@ -107,7 +107,7 @@

                 float cursorPosEnd = getPositionAt(selectionEnd);

-                float cursorWidth = 1;
+                float cursorWidth = 2;

                 if (selectionLength > 0)
                     cursorWidth = getPositionAt(selectionRight) - cursorPos.X;
@@ -127,7 +127,7 @@
                 if (HasFocus)
                 {
                     cursor.ClearTransformations();
-                    cursor.MoveTo(cursorPos + new Vector2(2, 0), 60, EasingTypes.Out);
+                    cursor.MoveTo(cursorPos, 60, EasingTypes.Out);
                     cursor.ScaleTo(new Vector2(cursorWidth, 1), 60, EasingTypes.Out);

                     if (selectionLength > 0)


Adjust height transition

Adjust height transition

--- osu.Game/Overlays/BeatmapListingOverlay.cs
+++ osu.Game/Overlays/BeatmapListingOverlay.cs
@@ -125,8 +125,6 @@
                                             {
                                                 AutoSizeAxes = Axes.Y,
                                                 RelativeSizeAxes = Axes.X,
-                                                AutoSizeEasing = Easing.Out,
-                                                AutoSizeDuration = 200,
                                                 Padding = new MarginPadding { Horizontal = 20 },
                                             }
                                         }
@@ -231,7 +229,19 @@

         private void addContentToPlaceholder(Drawable content)
         {
-            currentContent?.FadeOut(100, Easing.OutQuint).Expire();
+            Drawable lastContent = currentContent;
+
+            if (lastContent != null)
+            {
+                lastContent.FadeOut(100, Easing.OutQuint).Expire();
+
+                // Consider the case when the new content is smaller than the last content.
+                // If the auto-size computation is delayed until fade out completes, the background remain high for too long making the resulting transition to the smaller height look weird.
+                // At the same time, if the last content's height is bypassed immediately, there is a period where the new content is at Alpha = 0 when the auto-sized height will be 0.
+                // To resolve both of these issues, the bypass is delayed until a point when the content transitions (fade-in and fade-out) overlap and it looks good to do so.
+                lastContent.Delay(25).Schedule(() => lastContent.BypassAutoSizeAxes = Axes.Y);
+            }
+
             panelsPlaceholder.Add(currentContent = content);
             currentContent.FadeIn(200, Easing.OutQuint);
         }


Fix incorrect vertical offsets when difficulties are filtered away

--- osu.Game/Screens/Select/BeatmapCarousel.cs
+++ osu.Game/Screens/Select/BeatmapCarousel.cs
@@ -723,6 +723,9 @@

                             foreach (var b in set.Beatmaps)
                             {
+                                if (!b.Visible)
+                                    continue;
+
                                 if (b.State.Value == CarouselItemState.Selected)
                                 {
                                     scrollTarget += b.TotalHeight / 2;


Use ContainsKey for Dictionaries. O(1)

Use ContainsKey for Dictionaries. O(1)

--- src/Umbraco.Core/Models/Entities/BeingDirtyBase.cs
+++ src/Umbraco.Core/Models/Entities/BeingDirtyBase.cs
@@ -29,7 +29,7 @@
         /// <inheritdoc />
         public virtual bool IsPropertyDirty(string propertyName)
         {
-            return _currentChanges != null && _currentChanges.Any(x => x.Key == propertyName);
+            return _currentChanges != null && _currentChanges.ContainsKey(propertyName);
         }

         /// <inheritdoc />
@@ -61,7 +61,7 @@
         /// <inheritdoc />
         public virtual bool WasPropertyDirty(string propertyName)
         {
-            return _savedChanges != null && _savedChanges.Any(x => x.Key == propertyName);
+            return _savedChanges != null && _savedChanges.ContainsKey(propertyName);
         }

         /// <inheritdoc />


Renamed SendingDashboardModelV2 to SendingDashboardSlimModel

--- src/Umbraco.Web/Editors/EditorModelEventManager.cs
+++ src/Umbraco.Web/Editors/EditorModelEventManager.cs
@@ -18,14 +18,14 @@
         public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<MemberDisplay>> SendingMemberModel;
         public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<UserDisplay>> SendingUserModel;

-        [Obsolete("Please Use SendingDashboardModelV2")]
+        [Obsolete("Please Use SendingDashboardSlimModel")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboard>>>> SendingDashboardModel;
-        public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>>> SendingDashboardModelV2;
+        public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>>> SendingDashboardSlimModel;

         private static void OnSendingDashboardModel(HttpActionExecutedContext sender, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>> e)
         {
-            var handler = SendingDashboardModelV2;
+            var handler = SendingDashboardSlimModel;
             handler?.Invoke(sender, e);
         }


Made tests into testcasesource

Made tests into testcasesource

--- src/Uncas.WebTester.NUnitRunner/NUnitLinkTester.cs
+++ src/Uncas.WebTester.NUnitRunner/NUnitLinkTester.cs
@@ -3,6 +3,10 @@
 //     Copyright (c) Ole Lynge Sørensen. All rights reserved.
 // </copyright>
 //-------------
+
+using System.Collections.Concurrent;
+using System.Threading;
+using System.Linq;

 namespace Uncas.WebTester.NUnitRunner
 {
@@ -31,11 +35,11 @@
         /// The object that locks things common for all tests.
         /// </summary>
         private readonly object lockObject = new object();
-
+
         /// <summary>
-        /// The failed links.
+        /// Contains all links
         /// </summary>
-        private IList<HyperLink> failedLinks = new List<HyperLink>();
+        private readonly ConcurrentStack<HyperLink> allLinks = new ConcurrentStack<HyperLink>();

         /// <summary>
         /// The crawler service.
@@ -45,7 +49,7 @@
         /// <summary>
         /// The text index.
         /// </summary>
-        private int testIndex;
+        private int testIndex;

         /// <summary>
         /// Initializes a new instance of the <see cref="NUnitLinkTester"/> class.
@@ -82,12 +86,14 @@
             }
         }

+
         /// <summary>
-        /// Checks the links.
+        /// Get links for check
         /// </summary>
-        [Test]
-        public void CheckLinks()
+        /// <returns></returns>
+        public IEnumerable<TestCaseData> GetLinks()
         {
+            //return new TestCaseData[]{ new TestCaseData(new HyperLink(new Uri("http://www.google.dk")))};
             var startUrls = this.GetBaseUrls();
             ICrawlConfiguration configuration =
                 new CrawlConfiguration(
@@ -95,14 +101,16 @@
                 this.MaxVisits);
             Console.WriteLine("Testing {0} pages on {1}:", this.MaxVisits, startUrls[0].AbsoluteUri);
             this.crawlerService.Crawl(configuration);
-            if (this.failedLinks.Count > 0)
-            {
-                this.WriteFailure();
-            }
-            else
-            {
-                Console.WriteLine("All pages were OK!");
-            }
+            return this.allLinks.Select(x => new TestCaseData(x));
+        }
+
+        /// <summary>
+        /// Checks the links.
+        /// </summary>
+        [TestCaseSource("GetLinks")]
+        public void CheckLinks(HyperLink link)
+        {
+            Assert.That(IsLinkOk(link), "{0}: {1}", link.StatusCode, link.Url.AbsoluteUri);
         }

         /// <summary>
@@ -111,15 +119,8 @@
         /// <param name="link">The hyper link.</param>
         public void ProcessResult(HyperLink link)
         {
-            lock (this.lockObject)
-            {
-                if (!this.IsLinkOk(link))
-                {
-                    this.failedLinks.Add(link);
-                }
-
-                this.testIndex++;
-            }
+            this.allLinks.Push(link);
+            Interlocked.Increment(ref this.testIndex);
         }

         /// <summary>
@@ -131,24 +132,6 @@
             "CA1024:UsePropertiesWhereAppropriate",
             Justification = "This might involve a database call or other long-running calls.")]
         protected abstract IList<Uri> GetBaseUrls();
-
-        /// <summary>
-        /// Writes the failure.
-        /// </summary>
-        private void WriteFailure()
-        {
-            var messageBuilder = new StringBuilder("There were failed pages:");
-            foreach (var page in this.failedLinks)
-            {
-                messageBuilder.AppendFormat(
-                    "{0}{1}: {2}",
-                    Environment.NewLine,
-                    page.StatusCode,
-                    page.Url.AbsoluteUri);
-            }
-
-            Assert.Fail(messageBuilder.ToString());
-        }

         /// <summary>
         /// Links the should be ok.


Set `Content-Length` in the `hello` sample

--- examples/hello/Startup.cs
+++ examples/hello/Startup.cs
@@ -18,6 +18,8 @@
                 {
                     env["owin.ResponseStatusCode"] = 200;
                     ((IDictionary<string, string[]>)env["owin.ResponseHeaders"]).Add(
+                        "Content-Length", new string[] { "53" });
+                    ((IDictionary<string, string[]>)env["owin.ResponseHeaders"]).Add(
                         "Content-Type", new string[] { "text/html" });
                     StreamWriter w = new StreamWriter((Stream)env["owin.ResponseBody"]);
                     w.Write("Hello, from C#. Time on server is " + DateTime.Now.ToString());


Актуализирован список записанных видео

Актуализирован список записанных видео


win: more robust parsing of SDK version

win: more robust parsing of SDK version

PR-URL: https://github.com/nodejs/node-gyp/pull/1198
Fixes: https://github.com/nodejs/node-gyp/issues/1179
Reviewed-By: Ben Noordhuis <59bd0a3ff43b32849b319e645d4798d8a5d1e889@bnoordhuis.nl>
Reviewed-By: João Reis <5095b819f0ac7660978fa44706cfa411a9116ec5@janeasystems.com>

--- lib/Find-VS2017.cs
+++ lib/Find-VS2017.cs
@@ -228,9 +228,12 @@
                     hasMSBuild = true;
                 else if (id == "Microsoft.VisualStudio.Component.VC.Tools.x86.x64")
                     hasVCTools = true;
-                else if (id.StartsWith(Win10SDKPrefix))
-                    Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(id.Substring(Win10SDKPrefix.Length)));
-                else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
+                else if (id.StartsWith(Win10SDKPrefix)) {
+                    string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.');
+                    if (parts.Length > 1 && parts[1] != "Desktop")
+                        continue;
+                    Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
+                } else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
                     hasWin8SDK = true;
                 else
                     continue;


[V2] Adding accessors to the C.V2.PreprocessorDefinitions class

--- packages/C/dev/Scripts/DefineCollection.cs
+++ packages/C/dev/Scripts/DefineCollection.cs
@@ -40,6 +40,22 @@
             get
             {
                 return this.Defines.Count;
+            }
+        }
+
+        public bool
+        Contains(
+            string key)
+        {
+            return this.Defines.ContainsKey(key);
+        }
+
+        public string
+        this[string key]
+        {
+            get
+            {
+                return this.Defines[key];
             }
         }


A bit of refactoring on StreamExtensions

--- OpenKh.Common/StreamExtensions.cs
+++ OpenKh.Common/StreamExtensions.cs
@@ -143,29 +143,15 @@
             return (int)stream.Position - oldPosition;
         }

-        public static void Write(this Stream stream, byte value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, char value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, short value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, ushort value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, int value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, uint value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, long value) =>
-            new BinaryWriter(stream).Write(value);
-
-        public static void Write(this Stream stream, ulong value) =>
-            new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, byte value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, sbyte value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, char value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, short value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, ushort value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, int value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, uint value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, long value) => new BinaryWriter(stream).Write(value);
+        public static void Write(this Stream stream, ulong value) => new BinaryWriter(stream).Write(value);

         public static void Copy(this Stream source, Stream destination, int length, int bufferSize = 65536)
         {