refactor CubeController, remove lots of code duplications

--- Scripts/CubeController.cs
+++ Scripts/CubeController.cs
@@ -97,31 +97,81 @@
 		}
 	}

-	// TODO: refactor code duplication
 	public void rotateRowToRight(int y) {
+		this.rotatePositive(this.getRowIdentifier(y), "y", y);
+	}
+
+	public void rotateRowToLeft(int y) {
+		this.rotateNegative(this.getRowIdentifier(y), "y", y);
+	}
+
+	public void rotateColumnUp(int x) {
+		this.rotateNegative(this.getColumnIdentifier(x), "x", x);
+	}
+
+	public void rotateColumnDown(int x) {
+		this.rotatePositive(this.getColumnIdentifier(x), "x", x);
+	}
+
+	public void rotateLayerToLeft(int z) {
+		this.rotateNegative(this.getLayerIdentifier(z), "z", z);
+	}
+
+	public void rotateLayerToRight(int z) {
+		this.rotatePositive(this.getLayerIdentifier(z), "z", z);
+	}
+
+	// TODO: refactor code duplication of rotatePositive and rotateNegative
+	private void rotatePositive(string[,] rowIdentifier, string axis, int axisValue) {
 		// TODO enable rotation with center axis
-		if(y == 1) {
+		if(axisValue == 1) {
 			return;
 		}
-
-		string[,] row = this.getRowIdentifier(y);
-
+
+		string[,] row = (string[,])rowIdentifier.Clone();
+
 		Transform[,] cubeTransforms = new Transform[3, 3];
-
-		string[,] tempRow = this.getRowIdentifier(y);
-
+
+		string[,] tempRow = (string[,])rowIdentifier.Clone ();
+
 		// set temp parent to center object
 		tempParent = this.findChild(row[1, 1]).gameObject;
-
+
 		// get transforms
-		for(int x = 0; x < 3; x++) {
-			for(int z = 0; z < 3; z++) {
-				cubeTransforms[x, z] = this.getCubeTransform(x, y, z);
-
-				cubeTransforms[x, z].parent = tempParent.transform;
-			}
-		}
-
+		for(int i = 0; i < 3; i++) {
+			for(int j = 0; j < 3; j++) {
+				int x = 0;
+				int y = 0;
+				int z = 0;
+
+				if(axis == "x") {
+					x = axisValue;
+					y = i;
+					z = j;
+
+					cubeTransforms[y, z] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[y, z].parent = tempParent.transform;
+				} else if(axis == "y") {
+					x = i;
+					y = axisValue;
+					z = j;
+
+					cubeTransforms[x, z] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[x, z].parent = tempParent.transform;
+				} else if(axis == "z") {
+					x = i;
+					y = j;
+					z = axisValue;
+
+					cubeTransforms[x, y] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[x, y].parent = tempParent.transform;
+				}
+			}
+		}
+
 		// rotate sides
 		row[0, 1] = tempRow[1, 0];
 		row[1, 2] = tempRow[0, 1];
@@ -133,43 +183,84 @@
 		row[0, 2] = tempRow[0, 0];
 		row[2, 2] = tempRow[0, 2];
 		row[2, 0] = tempRow[2, 2];
-
+
 		// rotate real cubes

+		string face = "???";
+
+		if (axis == "x") {
+			face = "left";
+		} else if (axis == "y") {
+			face = "top";
+		} else if (axis == "z") {
+			face = "front";
+		}
+
 		// find center
-		Vector3 center = this.findChild("top", tempParent.transform).renderer.bounds.center;
-
+		Vector3 center = this.findChild(face, tempParent.transform).renderer.bounds.center;
+
 		tempParent.transform.RotateAround(center, Vector3.up, 90f);
-
+
 		// put cubes back to good old object
 		this.setCubeTransformParent(cubeTransforms, this.transform);
-
+
 		// apply changes to data structure
-		this.setRowIdentifier(y, row);
-	}
-
-	// TODO: refactor code duplication
-	public void rotateRowToLeft(int y) {
+		if (axis == "x") {
+			this.setColumnIdentifier(axisValue, row);
+		} else if (axis == "y") {
+			this.setRowIdentifier(axisValue, row);
+		} else if (axis == "z") {
+			this.setLayerIdentifier(axisValue, row);
+		}
+	}
+
+	private void rotateNegative(string[,] rowIdentifier, string axis, int axisValue) {
 		// TODO enable rotation with center axis
-		if(y == 1) {
+		if(axisValue == 1) {
 			return;
 		}
-
-		string[,] row = this.getRowIdentifier(y);
+
+		string[,] row = (string[,])rowIdentifier.Clone();

 		Transform[,] cubeTransforms = new Transform[3, 3];

-		string[,] tempRow = this.getRowIdentifier(y);
+		string[,] tempRow = (string[,])rowIdentifier.Clone ();

 		// set temp parent to center object
 		tempParent = this.findChild(row[1, 1]).gameObject;

 		// get transforms
-		for(int x = 0; x < 3; x++) {
-			for(int z = 0; z < 3; z++) {
-				cubeTransforms[x, z] = this.getCubeTransform(x, y, z);
+		for(int i = 0; i < 3; i++) {
+			for(int j = 0; j < 3; j++) {
+				int x = 0;
+				int y = 0;
+				int z = 0;

-				cubeTransforms[x, z].parent = tempParent.transform;
+				if(axis == "x") {
+					x = axisValue;
+					y = i;
+					z = j;
+
+					cubeTransforms[y, z] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[y, z].parent = tempParent.transform;
+				} else if(axis == "y") {
+					x = i;
+					y = axisValue;
+					z = j;
+
+					cubeTransforms[x, z] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[x, z].parent = tempParent.transform;
+				} else if(axis == "z") {
+					x = i;
+					y = j;
+					z = axisValue;
+
+					cubeTransforms[x, y] = this.getCubeTransform(x, y, z);
+
+					cubeTransforms[x, y].parent = tempParent.transform;
+				}
 			}
 		}

@@ -187,220 +278,32 @@

 		// rotate real cubes

+		string face = "???";
+
+		if (axis == "x") {
+			face = "left";
+		} else if (axis == "y") {
+			face = "top";
+		} else if (axis == "z") {
+			face = "front";
+		}
+
 		// find center
-		Vector3 center = this.findChild("top", tempParent.transform).renderer.bounds.center;
+		Vector3 center = this.findChild(face, tempParent.transform).renderer.bounds.center;

 		tempParent.transform.RotateAround(center, Vector3.up, -90f);

 		// put cubes back to good old object
 		this.setCubeTransformParent(cubeTransforms, this.transform);
-
+
 		// apply changes to data structure
-		this.setRowIdentifier(y, row);
-	}
-
-	// TODO: refactor code duplication
-	public void rotateColumnUp(int x) {
-		// TODO enable rotation with center axis
-		if(x == 1) {
-			return;
-		}
-
-		string[,] row = this.getColumnIdentifier(x);
-
-		Transform[,] cubeTransforms = new Transform[3, 3];
-
-		string[,] tempRow = this.getColumnIdentifier(x);
-
-		// set temp parent to center object
-		tempParent = this.findChild(row[1, 1]).gameObject;
-
-		// get transforms
-		for(int y = 0; y < 3; y++) {
-			for(int z = 0; z < 3; z++) {
-				cubeTransforms[y, z] = this.getCubeTransform(x, y, z);
-
-				cubeTransforms[y, z].parent = tempParent.transform;
-			}
-		}
-
-		// rotate sides
-		row[0, 1] = tempRow[1, 2];
-		row[1, 2] = tempRow[2, 1];
-		row[2, 1] = tempRow[1, 0];
-		row[1, 0] = tempRow[0, 1];
-
-		// rotate diagonals
-		row[0, 0] = tempRow[0, 2];
-		row[0, 2] = tempRow[2, 2];
-		row[2, 2] = tempRow[2, 0];
-		row[2, 0] = tempRow[0, 0];
-
-		// rotate real cubes
-
-		// find center
-		Vector3 center = this.findChild("left", tempParent.transform).renderer.bounds.center;
-
-		tempParent.transform.RotateAround(center, Vector3.left, -90f);
-
-		// put cubes back to good old object
-		this.setCubeTransformParent(cubeTransforms, this.transform);
-
-		// apply changes to data structure
-		this.setColumnIdentifier(x, row);
-	}
-
-	// TODO: refactor code duplication
-	public void rotateColumnDown(int x) {
-		// TODO enable rotation with center axis
-		if(x == 1) {
-			return;
-		}
-
-		string[,] row = this.getColumnIdentifier(x);
-
-		Transform[,] cubeTransforms = new Transform[3, 3];
-
-		string[,] tempRow = this.getColumnIdentifier(x);
-
-		// set temp parent to center object
-		tempParent = this.findChild(row[1, 1]).gameObject;
-
-		// get transforms
-		for(int y = 0; y < 3; y++) {
-			for(int z = 0; z < 3; z++) {
-				cubeTransforms[y, z] = this.getCubeTransform(x, y, z);
-
-				cubeTransforms[y, z].parent = tempParent.transform;
-			}
-		}
-
-		// rotate sides
-		row[0, 1] = tempRow[1, 0];
-		row[1, 2] = tempRow[0, 1];
-		row[2, 1] = tempRow[1, 2];
-		row[1, 0] = tempRow[2, 1];
-
-		// rotate diagonals
-		row[0, 0] = tempRow[2, 0];
-		row[0, 2] = tempRow[0, 0];
-		row[2, 2] = tempRow[0, 2];
-		row[2, 0] = tempRow[2, 2];
-
-		// rotate real cubes
-
-		// find center
-		Vector3 center = this.findChild("left", tempParent.transform).renderer.bounds.center;
-
-		tempParent.transform.RotateAround(center, Vector3.left, -90f);
-
-		// put cubes back to good old object
-		this.setCubeTransformParent(cubeTransforms, this.transform);
-
-		// apply changes to data structure
-		this.setColumnIdentifier(x, row);
-	}
-
-	// TODO: refactor code duplication
-	public void rotateLayerToLeft(int z) {
-		// TODO enable rotation with center axis
-		if(z == 1) {
-			return;
-		}
-
-		string[,] row = this.getLayerIdentifier(z);
-
-		Transform[,] cubeTransforms = new Transform[3, 3];
-
-		string[,] tempRow = this.getLayerIdentifier(z);
-
-		// set temp parent to center object
-		tempParent = this.findChild(row[1, 1]).gameObject;
-
-		// get transforms
-		for(int x = 0; x < 3; x++) {
-			for(int y = 0; y < 3; y++) {
-				cubeTransforms[x, y] = this.getCubeTransform(x, y, z);
-
-				cubeTransforms[x, y].parent = tempParent.transform;
-			}
-		}
-
-		// rotate sides
-		row[0, 1] = tempRow[1, 2];
-		row[1, 2] = tempRow[2, 1];
-		row[2, 1] = tempRow[1, 0];
-		row[1, 0] = tempRow[0, 1];
-
-		// rotate diagonals
-		row[0, 0] = tempRow[0, 2];
-		row[0, 2] = tempRow[2, 2];
-		row[2, 2] = tempRow[2, 0];
-		row[2, 0] = tempRow[0, 0];
-
-		// rotate real cubes
-
-		// find center
-		Vector3 center = this.findChild("front", tempParent.transform).renderer.bounds.center;
-
-		tempParent.transform.RotateAround(center, Vector3.forward, -90f);
-
-		// put cubes back to good old object
-		this.setCubeTransformParent(cubeTransforms, this.transform);
-
-		// apply changes to data structure
-		this.setLayerIdentifier(z, row);
-	}
-
-	// TODO: refactor code duplication
-	public void rotateLayerToRight(int z) {
-		// TODO enable rotation with center axis
-		if(z == 1) {
-			return;
-		}
-
-		string[,] row = this.getLayerIdentifier(z);
-
-		Transform[,] cubeTransforms = new Transform[3, 3];
-
-		string[,] tempRow = this.getLayerIdentifier(z);
-
-		// set temp parent to center object
-		tempParent = this.findChild(row[1, 1]).gameObject;
-
-		// get transforms
-		for(int x = 0; x < 3; x++) {
-			for(int y = 0; y < 3; y++) {
-				cubeTransforms[x, y] = this.getCubeTransform(x, y, z);
-
-				cubeTransforms[x, y].parent = tempParent.transform;
-			}
-		}
-
-		// rotate sides
-		row[0, 1] = tempRow[1, 0];
-		row[1, 2] = tempRow[0, 1];
-		row[2, 1] = tempRow[1, 2];
-		row[1, 0] = tempRow[2, 1];
-
-		// rotate diagonals
-		row[0, 0] = tempRow[2, 0];
-		row[0, 2] = tempRow[0, 0];
-		row[2, 2] = tempRow[0, 2];
-		row[2, 0] = tempRow[2, 2];
-
-		// rotate real cubes
-
-		// find center
-		Vector3 center = this.findChild("front", tempParent.transform).renderer.bounds.center;
-
-		tempParent.transform.RotateAround(center, Vector3.forward, 90f);
-
-		// put cubes back to good old object
-		this.setCubeTransformParent(cubeTransforms, this.transform);
-
-		// apply changes to data structure
-		this.setLayerIdentifier(z, row);
+		if (axis == "x") {
+			this.setColumnIdentifier(axisValue, row);
+		} else if (axis == "y") {
+			this.setRowIdentifier(axisValue, row);
+		} else if (axis == "z") {
+			this.setLayerIdentifier(axisValue, row);
+		}
 	}

 	private void setCubeTransformParent(Transform[,] transforms, Transform parent) {


Made GC happen more often

Made GC happen more often

--- notTetris/notTetris/PuzzleGame.cs
+++ notTetris/notTetris/PuzzleGame.cs
@@ -218,6 +218,8 @@
                 UnloadContent();
                 Exit();
             }
+
+            GC.Collect();
         }
         #endregion


Adds summary for Generator constructor overload.

Former-commit-id: dd7e8ec58820a1f249ca84fc1e2f53aa9d96f923

--- Sharpy/Types/Generator.cs
+++ Sharpy/Types/Generator.cs
@@ -47,6 +47,12 @@
             PhoneNumberGenerator = new PhoneNumberGenerator(new CountryCode.CountryCode("UnitedStates", "+1"), Random, 5);
         }

+        /// <summary>
+        ///     Creates a Generator which you can use to create one instance or a collection of the given type
+        ///     The integer included will track iterations.
+        ///     For examples please visit https://github.com/inputfalken/Sharpy
+        /// </summary>
+        /// <param name="func"></param>
         public Generator(Func<IRandomizer, int, T> func) {
             FuncIterator = func;
             Randomizer = new Randomizer<T>(this);


Fix output path

Fix output path

--- MadCat/NutPacker/Packer.cs
+++ MadCat/NutPacker/Packer.cs
@@ -122,7 +122,7 @@
                       , "NutPackerLib.dll"
                       , "System.Drawing.dll"
                   }
-                , Path.Combine(output, String.Concat(output, ".dll"))
+                , Path.Combine(output, String.Concat(name, ".dll"))
                 , false
                 ) {
                     GenerateInMemory = false


Allow zip+4 lacking dashes.

Allow zip+4 lacking dashes.

--- Ctl.Core/Validation/ZipCodeAttribute.cs
+++ Ctl.Core/Validation/ZipCodeAttribute.cs
@@ -60,6 +60,6 @@
             return re.IsMatch(s);
         }

-        static readonly Regex re = new Regex(@"^\d{5}(?:(?:-|‒)\d{4})?$", RegexOptions.Compiled);
+        static readonly Regex re = new Regex(@"^\d{5}(?:(?:-|‒)?\d{4})?$", RegexOptions.Compiled);
     }
 }


Adds initializer for test

Adds initializer for test

--- Ddd.Events/Ddd.Events.Tets/EventTest.cs
+++ Ddd.Events/Ddd.Events.Tets/EventTest.cs
@@ -8,6 +8,16 @@
     [TestClass]
     public class EventTest
     {
+        private SleepStartedEventHandler _sleepStartedEventHandler;
+        private WakeupStartedEventHandler _wakeupStartedEventHandler;
+
+        [TestInitialize]
+        public void Initialize()
+        {
+          _sleepStartedEventHandler = new SleepStartedEventHandler();
+          _wakeupStartedEventHandler = new WakeupStartedEventHandler();
+        }
+
         [TestMethod]
         public void ShowFlowsOfInitilializeFireAndCaptureDomainEvents()
         {
@@ -26,24 +36,25 @@
                 var listener = new EventListener();

             //Act
+                //When the process of the events are completed the
+                //listeners will recieved the domain on the specific events
+                //and dispacht events
+                //This is simulating that process of firing and listeing events.

                 bebe.GoToSleep(DateTime.Now);
+                listener.OnSleepStart(bebe);
+
                 mama.GoToSleep(DateTime.Now.AddMinutes(20));
+                listener.OnSleepStart(mama);
+
                 bebe.Wakeup(DateTime.Now.AddHours(2));
+                listener.OnWakeUpStart(bebe);
                 mama.Wakeup(DateTime.Now.AddHours(2));
-
-            //The process of the Event is complete and the
-            //listener recieved the domain on the specific event
-                listener.OnSleepStart(bebe);
-                listener.OnSleepStart(mama);
-                listener.OnWakeUpStart(bebe);
                 listener.OnWakeUpStart(mama);
-
+
             //Assert
-
-            //Events where processed.
             Assert.IsFalse(bebe.DomainEvents.Any());
-               Assert.IsFalse(mama.DomainEvents.Any());
+            Assert.IsFalse(mama.DomainEvents.Any());
         }
     }
 }


Version 0.17

Version 0.17

--- Dependinator/Properties/AssemblyInfo.cs
+++ Dependinator/Properties/AssemblyInfo.cs
@@ -33,11 +33,11 @@

 [assembly: ThemeInfo(
     ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
-    //(used if a resource is not found in the page,
-    // or application resource dictionaries)
+                                     //(used if a resource is not found in the page,
+                                     // or application resource dictionaries)
     ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
-    //(used if a resource is not found in the page,
-    // app, or any theme specific resource dictionaries)
+                                              //(used if a resource is not found in the page,
+                                              // app, or any theme specific resource dictionaries)
 )]

@@ -50,7 +50,7 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("0.16.*")]
+[assembly: AssemblyVersion("0.17.*")]

 [assembly: InternalsVisibleTo("DependinatorTest")]


IssueId #12820: Public Func<> types are the cause of conflicts in .NET 2.0

git-svn-id: 98f681d7a2907ee2a41df434552134740bcc8829@85159 81fbe566-5dc4-48c1-bdea-7421811ca204

--- Source/lib/net2.0/Func.cs
+++ Source/lib/net2.0/Func.cs
@@ -14,7 +14,7 @@
  * limitations under the License.
  */

-namespace System
+namespace ZXing
 {
 #if !WindowsCE
    /// <summary>


interpolate id

interpolate id

--- DotJEM.Json.Storage/Queries/Commands.cs
+++ DotJEM.Json.Storage/Queries/Commands.cs
@@ -114,6 +114,46 @@

             self.SelectSingle = vars.Format("SELECT * FROM {tableFullName} WHERE [{id}] = @{id} ORDER BY [{created}];");

+            /*
+            Table Spec:
+                Name:
+                  {tableName}
+
+                Columns:
+                  {id}] uniqueidentifier NOT NULL
+                  {ref}] bigint NOT NULL
+                  {version} int NOT NULL
+                  {type} varchar(256) NOT NULL
+                  {created} datetime NOT NULL
+                  {updated} datetime NOT NULL
+                  {data} varbinary(max) NOT NULL
+                  RV rowversion NOT NULL
+
+                Constraints:
+                  PK_{tableName} PRIMARY KEY CLUSTERED ( Id ASC )
+                    With:
+                      PAD_INDEX OFF
+                      STATISTICS_NORECOMPUTE = OFF
+                      IGNORE_DUP_KEY = OFF
+                      ALLOW_ROW_LOCKS = ON
+                      ALLOW_PAGE_LOCKS = ON
+
+            */
+
+            dynamic spec = null;// = new spec("");
+
+            spec
+                .Column("id", "uniqueidentifier", "not null")
+                .Column("ref", "uniqueidentifier", "not null")
+                .Column("version", "uniqueidentifier", "not null")
+                .Column("type", "uniqueidentifier", "not null")
+                .Column("updated", "uniqueidentifier", "not null")
+                .Column("data", "uniqueidentifier", "not null")
+                .Column("RV", "uniqueidentifier", "not null")
+                .Constraint()
+                .Index();
+
+
             self.CreateTable = vars.Format(
                 @"CREATE TABLE [dbo].[{tableName}] (
                           [{id}] [uniqueidentifier] NOT NULL,
@@ -125,7 +165,7 @@
                           [{data}] [varbinary](max) NOT NULL,
                           [RV] [rowversion] NOT NULL,
                           CONSTRAINT [PK_{tableName}] PRIMARY KEY CLUSTERED (
-                            [Id] ASC
+                            [{id}] ASC
                           ) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
                         ) ON [PRIMARY];


allow "null" context.

allow "null" context.

--- DotJEM.Json.Validation/JsonValidator.cs
+++ DotJEM.Json.Validation/JsonValidator.cs
@@ -185,11 +185,17 @@
         {
             this.context = context;
             this.root = root;
-            this.contextType = context.GetType();
+            this.contextType = context?.GetType();
         }

         public override bool TryConvert(ConvertBinder binder, out object result)
         {
+            if (context == null)
+            {
+                result = null;
+                return true;
+            }
+
             if (binder.Type.IsAssignableFrom(contextType))
             {
                 result = context;


Remove Maximize and Minimize buttons on About box

--- EDDiscovery/Forms/AboutForm.Designer.cs
+++ EDDiscovery/Forms/AboutForm.Designer.cs
@@ -185,6 +185,8 @@
             this.Controls.Add(this.textBox1);
             this.DoubleBuffered = true;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
             this.MinimumSize = new System.Drawing.Size(600, 420);
             this.Name = "AboutForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;


improvement api

improvement api

--- Sources/BrownSugar/Net.cs
+++ Sources/BrownSugar/Net.cs
@@ -11,162 +11,320 @@
  *
  */

-namespace BrownSugar.Net {
-
-    public static class NetSugar {
-
+namespace ThunderEgg.BrownSugar.Net {
+
+    public static class ByteOrder {
+
+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static short ToNetOrder(this short val) {
             return IPAddress.HostToNetworkOrder(val);
         }

+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static int ToNetOrder(this int val) {
             return IPAddress.HostToNetworkOrder(val);
         }

+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static long ToNetOrder(this long val) {
             return IPAddress.HostToNetworkOrder(val);
         }

+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static ushort ToNetOrder(this ushort val) {
-            return IPAddress.HostToNetworkOrder(val.UncheckedCast<short>()).
-                UncheckedCast<ushort>();
-        }
-
+            return unchecked((ushort)(IPAddress.HostToNetworkOrder(unchecked((short)val))));
+        }
+
+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static uint ToNetOrder(this uint val) {
-            return IPAddress.HostToNetworkOrder(val.UncheckedCast<int>()).
-                UncheckedCast<uint>();
-        }
-
+            return unchecked((uint)(IPAddress.HostToNetworkOrder(unchecked((int)val))));
+        }
+
+        /// <summary>
+        /// ホストオーダー値からネットオーダー値にする
+        /// </summary>
+        /// <param name="val">ホストオーダー値</param>
+        /// <returns>ネットオーダー値</returns>
         public static ulong ToNetOrder(this ulong val) {
-            return IPAddress.HostToNetworkOrder(val.UncheckedCast<long>()).
-                UncheckedCast<ulong>();
-        }
-
-        public static short ToHostOrder(this short val) {
-            return IPAddress.NetworkToHostOrder(val);
-        }
-
-        public static int ToHostOrder(this int val) {
-            return IPAddress.NetworkToHostOrder(val);
-        }
-
-        public static long ToHostOrder(this long val) {
-            return IPAddress.NetworkToHostOrder(val);
-        }
-
-        public static ushort ToHostOrder(this ushort val) {
-            return IPAddress.NetworkToHostOrder(val.UncheckedCast<short>()).
-                UncheckedCast<ushort>();
-        }
-
-        public static uint ToHostOrder(this uint val) {
-            return IPAddress.NetworkToHostOrder(val.UncheckedCast<int>()).
-                UncheckedCast<uint>();
-        }
-
-        public static ulong ToHostOrder(this ulong val) {
-            return IPAddress.NetworkToHostOrder(val.UncheckedCast<long>()).
-                UncheckedCast<ulong>();
+            return unchecked((ulong)(IPAddress.HostToNetworkOrder(unchecked((long)val))));
         }

         /*
          *
          */

-        public static short ToInt16(this byte[] net, int index) {
-            return BitConverter.ToInt16(net, index).ToHostOrder();
-        }
-
-        public static int ToInt32(this byte[] net, int index) {
-            return BitConverter.ToInt32(net, index).ToHostOrder();
-        }
-
-        public static long ToInt64(this byte[] net, int index) {
-            return BitConverter.ToInt64(net, index).ToHostOrder();
-        }
-
-        public static ushort ToUInt16(this byte[] net, int index) {
-            return BitConverter.ToUInt16(net, index).ToHostOrder();
-        }
-
-        public static uint ToUInt32(this byte[] net, int index) {
-            return BitConverter.ToUInt32(net, index).ToHostOrder();
-        }
-
-        public static ulong ToUInt64(this byte[] net, int index) {
-            return BitConverter.ToUInt64(net, index).ToHostOrder();
-        }
-
-        public class ToFloatTemp {
-            public byte[] Bytes = new byte[4];
-        };
-
-        static ThreadLocal<ToFloatTemp> ThreadLocalToFloatTemp =
-            new ThreadLocal<ToFloatTemp>();
-
-        public static float ToFloat(this byte[] net, int index) {
-            if (BitConverter.IsLittleEndian) {
-                var tmp = ThreadLocalToFloatTemp.Value.Bytes;
-                for (var i = 0; i < 4; ++i) {
-                    tmp[4 - i] = net[index + i];
-                }
-                return BitConverter.ToSingle(tmp, 0);
-            } else {
-                return BitConverter.ToSingle(net, index);
-            }
-        }
-
-        public static double ToDouble(this byte[] net, int index) {
-            return BitConverter.ToInt64(net, index).ToHostOrder().From64BitsToDouble();
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static short ToHostOrder(this short val) {
+            return IPAddress.NetworkToHostOrder(val);
+        }
+
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static int ToHostOrder(this int val) {
+            return IPAddress.NetworkToHostOrder(val);
+        }
+
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static long ToHostOrder(this long val) {
+            return IPAddress.NetworkToHostOrder(val);
+        }
+
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static ushort ToHostOrder(this ushort val) {
+            return unchecked((ushort)(IPAddress.NetworkToHostOrder(unchecked((short)val))));
+        }
+
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static uint ToHostOrder(this uint val) {
+            return unchecked((uint)(IPAddress.NetworkToHostOrder(unchecked((int)val))));
+        }
+
+        /// <summary>
+        /// ネットオーダー値からホストオーダー値にする
+        /// </summary>
+        /// <param name="val">ネットオーダー値</param>
+        /// <returns>ホストオーダー値</returns>
+        public static ulong ToHostOrder(this ulong val) {
+            return unchecked((ulong)(IPAddress.NetworkToHostOrder(unchecked((long)val))));
         }

         /*
          *
          */

-        public static void CopyTo(this short val, byte[] net, int index) {
-            var n = val.ToNetOrder();
-            var count = sizeof(short);
-            for(var i = 0; i < count; ++i) {
-                net[i] = n.UncheckedCast<byte>();
-                n >>= 8;
-            }
-        }
-
-        public static void CopyTo(this int val, byte[] net, int index) {
-            var n = val.ToNetOrder();
-            var count = sizeof(int);
-            for (var i = 0; i < count; ++i) {
-                net[i] = n.UncheckedCast<byte>();
-                n >>= 8;
-            }
-        }
-
-        public static void CopyTo(this long val, byte[] net, int index) {
-            var n = val.ToNetOrder();
-            var count = sizeof(long);
-            for (var i = 0; i < count; ++i) {
-                net[i] = n.UncheckedCast<byte>();
-                n >>= 8;
-            }
-        }
-
-        public static void CopyTo(this ushort val, byte[] net, int index) {
-            val.UncheckedCast<short>().CopyTo(net, index);
-        }
-
-        public static void CopyTo(this uint val, byte[] net, int index) {
-            val.UncheckedCast<int>().CopyTo(net, index);
-        }
-
-        public static void CopyTo(this ulong val, byte[] net, int index) {
-            val.UncheckedCast<long>().CopyTo(net, index);
-        }
-
-        public static void CopyTo(this double val, byte[] net, int index) {
-            val.To64Bits().CopyTo(net, index);
-        }
-
+        public static short ToHostInt16(byte[] net, int index) {
+            return BitConverter.ToInt16(net, index).ToHostOrder();
+        }
+
+        public static int ToHostInt32(byte[] net, int index) {
+            return BitConverter.ToInt32(net, index).ToHostOrder();
+        }
+
+        public static long ToHostInt64(byte[] net, int index) {
+            return BitConverter.ToInt64(net, index).ToHostOrder();
+        }
+
+        public static ushort ToHostUInt16(byte[] net, int index) {
+            return BitConverter.ToUInt16(net, index).ToHostOrder();
+        }
+
+        public static uint ToHostUInt32(byte[] net, int index) {
+            return BitConverter.ToUInt32(net, index).ToHostOrder();
+        }
+
+        public static ulong ToHostUInt64(byte[] net, int index) {
+            return BitConverter.ToUInt64(net, index).ToHostOrder();
+        }
+
+        public static double ToHostDouble(byte[] net, int index) {
+            var n = BitConverter.ToInt64(net, index).ToHostOrder();
+            return BitConverter.Int64BitsToDouble(n);
+        }
+
+        /*
+				 *
+				 */
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this short value, byte* p) {
+            var q = p + sizeof(short);
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value);
+            return q;
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this int value, byte* p) {
+            var q = p + sizeof(int);
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value);
+            return q;
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this long value, byte* p) {
+            var q = p + sizeof(long);
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value); value >>= 8;
+            *--p = unchecked((byte)value);
+            return q;
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this ushort value, byte* p) {
+            return CopyToNetOrder(unchecked((short)value), p);
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this uint value, byte* p) {
+            return CopyToNetOrder(unchecked((int)value), p);
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this ulong value, byte* p) {
+            return CopyToNetOrder(unchecked((long)value), p);
+        }
+
+        /// <summary>
+        /// 値をビッグエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="p">書き出し位置</param>
+        /// <returns>次の書き出し位置</returns>
+        public unsafe static byte* CopyToNetOrder(this double value, byte* p) {
+            var n = BitConverter.DoubleToInt64Bits(value);
+            return CopyToNetOrder(n, p);
+        }
+
+        /*
+         *
+         */
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this short value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this int value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this long value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this ushort value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this uint value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this ulong value, byte[] buffer, int index) {
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(value, fix); }
+        }
+
+        /// <summary>
+        /// 値をネットワークエンディアン順で書き出す
+        /// </summary>
+        /// <param name="value">値</param>
+        /// <param name="buffer">書き出しバッファ</param>
+        /// <param name="index">書き出しバッファ位置</param>
+        public static void CopyToNetOrder(this double value, byte[] buffer, int index) {
+            var n = BitConverter.DoubleToInt64Bits(value);
+            unsafe { fixed (byte* fix = &buffer[index]) CopyToNetOrder(n, fix); }
+        }
     }
-
 }


2.0.8

--- Emby.Theater/Properties/AssemblyInfo.cs
+++ Emby.Theater/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.7")]
+[assembly: AssemblyVersion("2.0.8")]


Adding a new command for inscription.

Adding a new command for inscription.

--- ExampleScripts/UOErebor/inscription.csx
+++ ExampleScripts/UOErebor/inscription.csx
@@ -107,4 +107,5 @@

 UO.RegisterCommand("inscription-gate", () => Inscription.Inscribe(InscriptionMenu.GateTravel));
 UO.RegisterCommand("inscription-recall", () => Inscription.Inscribe(InscriptionMenu.Recall));
-UO.RegisterCommand("inscription-mark", () => Inscription.Inscribe(InscriptionMenu.Mark));+UO.RegisterCommand("inscription-mark", () => Inscription.Inscribe(InscriptionMenu.Mark));
+UO.RegisterCommand("inscription-teleport", () => Inscription.Inscribe(InscriptionMenu.Teleport));


[Glue] Fixed a bug with Glue not displaying files in of Global Content when creating a Desktop GL primary project.

--- FRBDK/Glue/Glue/Managers/FindManager.cs
+++ FRBDK/Glue/Glue/Managers/FindManager.cs
@@ -24,7 +24,21 @@

                 if (ProjectManager.ContentProject != null)
                 {
-                    contentDirectory = ProjectManager.ContentProject.Directory + "GlobalContent/";
+                    if(ProjectManager.ContentProject == ProjectManager.ProjectBase && !string.IsNullOrEmpty(ProjectManager.ContentProject.ContentDirectory))
+                    {
+                        // It's the same project, so we need to append the content folder, since the project itself
+                        // doesn't have "content/"
+
+                        var contentProject = ProjectManager.ContentProject;
+
+                        contentDirectory = contentProject.Directory + contentProject.ContentDirectory + "GlobalContent/";
+                    }
+                    else
+                    {
+                        contentDirectory = ProjectManager.ContentProject.Directory + "GlobalContent/";
+                    }
+
+
                 }

                 string returnValue = contentDirectory;


Attempt to add async retry and exception handling

--- TMDbLib/TMDbRestClient.cs
+++ TMDbLib/TMDbRestClient.cs
@@ -86,10 +86,50 @@
             return response;
         }

-        public override Task<IRestResponse<T>> ExecuteTaskAsync<T>(IRestRequest request, CancellationToken token)
+        public override async Task<IRestResponse<T>> ExecuteTaskAsync<T>(IRestRequest request, CancellationToken token)
         {
-            // TODO: Implement error handling and retry-logic.
-            return base.ExecuteTaskAsync<T>(request, token);
+            IRestResponse<T> response = await base.ExecuteTaskAsync<T>(request, token).ConfigureAwait(false);
+
+            if (response.ErrorException != null)
+            {
+                if (MaxRetryCount >= request.Attempts && response.ErrorException.GetType() == typeof(WebException))
+                {
+                    WebException webException = (WebException)response.ErrorException;
+
+                    // Retry the call after waiting the configured ammount of time, it gets progressively longer every retry
+                    Thread.Sleep(request.Attempts * RetryWaitTimeInSeconds * 1000);
+                    return await ExecuteTaskAsync<T>(request, token).ConfigureAwait(false);
+                }
+
+                throw response.ErrorException;
+            }
+
+            if (response.StatusCode == HttpStatusCode.Unauthorized)
+            {
+                throw new UnauthorizedAccessException("Call to TMDb returned unauthorized. Most likely the provided API key is invalid.");
+            }
+
+            if (response.StatusCode == (HttpStatusCode)429)
+            {
+                if (!ThrowErrorOnExeedingMaxCalls)
+                {
+                    Parameter retryAfterParam = response.Headers.FirstOrDefault(header => header.Name.Equals("retry-after", StringComparison.OrdinalIgnoreCase));
+                    if (retryAfterParam != null)
+                    {
+                        int retryAfter;
+                        if (Int32.TryParse(retryAfterParam.Value.ToString().Trim(), out retryAfter))
+                        {
+                            Thread.Sleep(retryAfter * 1000);
+                            return await ExecuteTaskAsync<T>(request, token).ConfigureAwait(false);
+                        }
+                    }
+                }
+
+                // We don't wish to wait or no valid retry-after header was present
+                throw new RequestLimitExceededException();
+            }
+
+            return response;
         }

     }


Actually support labels in LLVMCodeGenerator

--- Flame.LLVM/Codegen/LLVMCodeGenerator.cs
+++ Flame.LLVM/Codegen/LLVMCodeGenerator.cs
@@ -1073,12 +1073,12 @@

         public ICodeBlock EmitMarkLabel(UniqueTag Label)
         {
-            throw new NotImplementedException();
+            return new MarkLabelBlock(this, Label);
         }

         public ICodeBlock EmitGotoLabel(UniqueTag Label, ICodeBlock Condition)
         {
-            throw new NotImplementedException();
+            return new BranchLabelBlock(this, Label);
         }

         #endregion


Update docs

Update docs

--- TPPCamComponent/TPPCam.cs
+++ TPPCamComponent/TPPCam.cs
@@ -21,7 +21,7 @@

         private float lerpPositionSpeed;

-        private Vector3 updatedLookAtPointOffset;
+        private Vector3 endLookAtPointOffset;

         private Vector3 endCameraOffset;

@@ -148,9 +148,14 @@
             set { lerpPositionSpeed = value; }
         }

-        private Vector3 UpdatedLookAtPointOffset {
-            get { return updatedLookAtPointOffset; }
-            set { updatedLookAtPointOffset = value; }
+        /// <summary>
+        /// Depending on whether the target transform is occluded or not,
+        /// this will be one of the two look at point offsets specified in the
+        /// inspector.
+        /// </summary>
+        private Vector3 EndLookAtPointOffset {
+            get { return endLookAtPointOffset; }
+            set { endLookAtPointOffset = value; }
         }

         /// <summary>
@@ -246,7 +251,7 @@

         private void CalculateEndRotation() {
             var dir1 = transform.position - TargetTransformPos;
-            var dir2 = (TargetTransformPos + UpdatedLookAtPointOffset + dir1)
+            var dir2 = (TargetTransformPos + EndLookAtPointOffset + dir1)
                 - transform.position;

             endRotation.SetLookRotation(
@@ -266,11 +271,11 @@

             EndCameraOffset = CameraOffset;

-            UpdatedLookAtPointOffset =
-            new Vector3(
-                LookAtPointOffset.x,
-                -LerpedCameraOffset.y,
-                LookAtPointOffset.y);
+            EndLookAtPointOffset =
+                new Vector3(
+                    LookAtPointOffset.x,
+                    -LerpedCameraOffset.y,
+                    LookAtPointOffset.y);
         }

         private void HandleTargetTransformNotVisible() {
@@ -278,7 +283,7 @@

             EndCameraOffset = OffsetWhenNotVisible;

-            UpdatedLookAtPointOffset = new Vector3(
+            EndLookAtPointOffset = new Vector3(
                 LookAtPointWhenNotVisible.x,
                 -LerpedCameraOffset.y,
                 LookAtPointWhenNotVisible.y);


Code-Style

Code-Style

--- Fluent.Ribbon/Adorners/KeyTipAdorner.cs
+++ Fluent.Ribbon/Adorners/KeyTipAdorner.cs
@@ -620,7 +620,7 @@
                 var associatedElementInVisualTree = VisualTreeHelper.GetParent(this.associatedElements[i]) != null;
                 this.keyTips[i].Visibility = associatedElementIsVisible && associatedElementInVisualTree ? Visibility.Visible : Visibility.Collapsed;

-                if (!KeyTip.GetAutoPlacement(this.associatedElements[i]))
+                if (KeyTip.GetAutoPlacement(this.associatedElements[i]) == false)
                 {
                     #region Custom Placement


lower case routes

lower case routes

--- TampaBayCoders/Startup.cs
+++ TampaBayCoders/Startup.cs
@@ -37,6 +37,7 @@

 			// Add Framework Services
 			services.AddMvc();
+			services.AddRouting(option => option.LowercaseUrls = true);

 			// Enable IOptions Injection (see Configure method)
 			services.AddOptions();
@@ -60,7 +61,7 @@
 			}
 			else
 			{
-				app.UseExceptionHandler("/Home/Error");
+				app.UseExceptionHandler("/home/error");
 			}

 			// Configure Static File Serving


Update FtpClient_HighLevel.cs

Update FtpClient_HighLevel.cs

--- FluentFTP/Client/FtpClient_HighLevel.cs
+++ FluentFTP/Client/FtpClient_HighLevel.cs
@@ -1181,6 +1181,11 @@
 				// listen for a success/failure reply
 				if (!EnableThreadSafeDataConnections) {
 					FtpReply status = GetReply();
+					if (status.Code != null && status.Code == "550")
+					{
+						//FIX: if server sends 550 the transfer was received but on could not be confirmed by the server when closing the stream.
+						return false;
+					}
 				}

 				return true;


Derp, Save it first, Idiot.

Derp, Save it first, Idiot.

--- Terraria_Server/Player.cs
+++ Terraria_Server/Player.cs
@@ -4279,8 +4279,8 @@
             int spawnTileY = Main.spawnTileY;

             //Set our new target position
-            Main.spawnTileX = (int)tileX;
-            Main.spawnTileY = (int)tileY;
+            Main.spawnTileX = ((int)tileX) / 16;
+            Main.spawnTileY = ((int)tileY) / 16;

             bool destroyed = false;
             if (Main.players[this.whoAmi].SpawnX >= 0 && Main.players[this.whoAmi].SpawnY >= 0) //Do they have a bed?


Also remove camera1 in GameState

Also remove camera1 in GameState

--- GLX/GameState.cs
+++ GLX/GameState.cs
@@ -12,15 +12,6 @@
         public string name;
         public List<GameTimeWrapper> gameTimes;
         public List<Action> drawMethods;
-
-        private Camera _camera1;
-        public Camera camera1
-        {
-            get
-            {
-                return _camera1;
-            }
-        }

         public GameState(string name, GraphicsDeviceManager graphics,
             VirtualResolutionRenderer virtualResolutionRenderer)


Password reset controller

Password reset controller

--- GameUi/Controllers/AccountController.cs
+++ GameUi/Controllers/AccountController.cs
@@ -376,6 +376,56 @@
             }
         }

+        /// <summary>
+        /// Activates new password with token.
+        /// If invalid token si given, than shows error message
+        /// </summary>
+        /// <returns></returns>
+        [AllowAnonymous]
+        public ActionResult ResetToken()
+        {
+            string[] tokens = Request.QueryString.GetValues("Token");
+            if (tokens != null && tokens.Length == 1)
+            {
+                string token = tokens[0];
+
+                if (GSClient.AccountService.AccountTokenExists(token))
+                {
+                    int id = GSClient.AccountService.GetAccountInfoByToken(token).PlayerId;
+                    Entities.Player player = GSClient.PlayerService.GetPlayer(id);
+
+                    if (!player.IsEmailConfirmed)
+                    {
+                        return RedirectToAction("LogOn", "Account").Warning("Účet není aktivován");
+                    }
+
+                    if ((DateTime.Now - player.PassChangeDate) > new TimeSpan(48, 0, 0))
+                    {
+                        return RedirectToAction("LogOn", "Account").Error("Vypršela platnost vygenerovaného hesla.");
+                    }
+
+                    player.PsswdHash = player.NewPsswdHash;
+                    player.PassChangeDate = DateTime.Now.AddDays(-3);
+
+                    if (GSClient.AccountService.UpdatePlayer(player))
+                    {
+                        return RedirectToAction("LogOn", "Account").Success("Nové heslo byl úspěšně aktivován.");
+                    }
+                    else
+                    {
+                        return RedirectToAction("LogOn", "Account").Error("Nastala neznámá chyba.");
+                    }
+                }
+                else
+                {
+                    return RedirectToAction("LogOn", "Account").Error("Nesprávný aktivační odkaz");
+                }
+            }
+            else
+            {
+                return RedirectToAction("LogOn", "Account").Error("Nesprávný aktivační odkaz");
+            }
+        }

         /// <summary>
         /// This is javascript workaround for ModelState.AddModelError.


state add

state add

--- Githubdemo/Githubdemo/Models/UserMvc.cs
+++ Githubdemo/Githubdemo/Models/UserMvc.cs
@@ -12,5 +12,6 @@
         public int age { get; set; }
         public string phone { get; set; }
         public string email { get; set; }
+        public string State { get; set; }
     }
 }


Get-GcbqTable cmdlet and ITests

Get-GcbqTable cmdlet and ITests

--- Google.PowerShell/BigQuery/GcbqTable.cs
+++ Google.PowerShell/BigQuery/GcbqTable.cs
@@ -40,7 +40,6 @@
     [Cmdlet(VerbsCommon.Get, "GcbqTable")]
     public class GetGcbqTable : GcbqCmdlet
     {
-        //TODO(ahandley): Find a way to set a default or "last accessed" dataset  (and update docs)
         /// <summary>
         /// <para type="description">
         /// The project to look for datasets in. If not set via PowerShell parameter processing, it will


inlined a function

inlined a function

--- Google.PowerShell/BigQuery/GcbqTable.cs
+++ Google.PowerShell/BigQuery/GcbqTable.cs
@@ -261,30 +261,25 @@

         public TablesResource.InsertRequest makeInsertReq()
         {
-            Table newTab;
-            newTab = new Table();
-            newTab.TableReference = getTableRef(Project, DatasetId, TableId);
-            newTab.FriendlyName = Name;
-            newTab.Description = Description;
+            Table newTable = new Table();
+            newTable.TableReference = new TableReference
+            {
+                ProjectId = Project,
+                DatasetId = DatasetId,
+                TableId = TableId
+            };
+            newTable.FriendlyName = Name;
+            newTable.Description = Description;
             if (Expiration != 0)
             {
                 long currentMillis = Convert.ToInt64(DateTime.Now.ToUniversalTime().Subtract(
                     new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
                     ).TotalMilliseconds);
-                newTab.ExpirationTime = (Expiration * 1000) + currentMillis;
+                newTable.ExpirationTime = (Expiration * 1000) + currentMillis;
                 // Note: The code below is a more elegant solution, but is not supported by the current version
-                //newTab.ExpirationTime = new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds();
-            }
-            return Service.Tables.Insert(newTab, Project, DatasetId);
-        }
-
-        public TableReference getTableRef(string p, string d, string t)
-        {
-            TableReference tr = new TableReference();
-            tr.ProjectId = p;
-            tr.DatasetId = d;
-            tr.TableId = t;
-            return tr;
+                //newTable.ExpirationTime = new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds();
+            }
+            return Service.Tables.Insert(newTable, Project, DatasetId);
         }
     }
 }


Fixed bug in RawTemplateInjector regarding TemplateNamer

--- HandlebarsHelper/RawTemplateInjector.cs
+++ HandlebarsHelper/RawTemplateInjector.cs
@@ -25,7 +25,7 @@
             templatePath = HttpContext.Current.Request.MapPath(templatePath);
             var files = FindFiles(templatePath, templatePath, templateExtensions);

-            return BuildTemplates(templatePath, files, new TemplateNamer());
+            return BuildTemplates(templatePath, files, templateNamer);
         }

         private static IHtmlString BuildTemplates(string templatePath, List<string> files, ITemplateNamer templateNamer)


remove unncessary null check

remove unncessary null check

--- Tiny/Tiny/KinectServer.cs
+++ Tiny/Tiny/KinectServer.cs
@@ -100,10 +100,6 @@
                     while (!clientStream.DataAvailable) ;

                     SerializableBodyFrame bodyFrame = BodyFrameSerializer.Deserialize(clientStream);
-                    if (bodyFrame == null)
-                    {
-                        Debug.WriteLine("body frame is null");
-                    }
                     this.userTracker.AddOrUpdateBodyFrame(clientIP, bodyFrame);
                     Thread visualUpdateThread = new Thread(new ThreadStart(this.StartVisualUpdateThread));
                     visualUpdateThread.Start();


Better error message for commands that need a git repo.

--- GitTfs/GitTfs.cs
+++ GitTfs/GitTfs.cs
@@ -94,12 +94,12 @@
             {
                 if (_globals.GitDirSetByUser)
                 {
-                    throw new Exception("GIT_DIR=" + _globals.GitDir + " explicitly set, but it is not a directory.");
+                    throw new Exception("This command must be run inside a git repository!\nGIT_DIR=" + _globals.GitDir + " explicitly set, but it is not a directory.");
                 }
                 var gitDir = _globals.GitDir;
                 _globals.GitDir = null;
                 string cdUp = null;
-                git.WrapGitCommandErrors("Already at toplevel, but " + gitDir + " not found.",
+                git.WrapGitCommandErrors("This command must be run inside a git repository!\nAlready at top level, but " + gitDir + " not found.",
                                          () =>
                                              {
                                                  cdUp = git.CommandOneline("rev-parse", "--show-cdup");
@@ -113,7 +113,7 @@
                 Environment.CurrentDirectory = cdUp;
                 if (!Directory.Exists(gitDir))
                 {
-                    throw new Exception(gitDir + " still not found after going to " + cdUp);
+                    throw new Exception("This command must be run inside a git repository!\n" + gitDir + " still not found after going to " + cdUp);
                 }
                 _globals.GitDir = gitDir;
             }


Bumped the version.

Bumped the version.

--- JexusManager/Properties/AssemblyInfo.cs
+++ JexusManager/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 + "190a69a439dbfb969ebad72a6f7e2e047907da4a7b9c08c6e98d5f1be8b8cafaf3eb978914059a"
 + "245d4bc1")]

-[assembly: AssemblyVersion("2.1.0.30")]
-[assembly: AssemblyFileVersion("2.1.0.30")]
+[assembly: AssemblyVersion("2.1.0.31")]
+[assembly: AssemblyFileVersion("2.1.0.31")]


fix catch mechanism

fix catch mechanism

--- WalletWasabi.Gui/Utils.cs
+++ WalletWasabi.Gui/Utils.cs
@@ -1,6 +1,7 @@
 using Avalonia.Threading;
 using System;
 using System.IO;
+using System.Threading.Tasks;

 namespace WalletWasabi.Gui
 {
@@ -19,16 +20,34 @@
 			throw new NotSupportedException("This is impossible.");
 		}

+		public static void PostLogException(this Dispatcher dispatcher, Func<Task> action, DispatcherPriority priority = DispatcherPriority.Normal)
+		{
+			dispatcher.Post(async () =>
+			{
+				try
+				{
+					await action();
+				}
+				catch (Exception ex)
+				{
+					Logging.Logger.LogDebug<Dispatcher>(ex);
+				}
+			}, priority);
+		}
+
 		public static void PostLogException(this Dispatcher dispatcher, Action action, DispatcherPriority priority = DispatcherPriority.Normal)
 		{
-			try
+			dispatcher.Post(() =>
 			{
-				dispatcher.Post(action, priority);
-			}
-			catch (Exception ex)
-			{
-				Logging.Logger.LogDebug<Dispatcher>(ex);
-			}
+				try
+				{
+					action();
+				}
+				catch (Exception ex)
+				{
+					Logging.Logger.LogDebug<Dispatcher>(ex);
+				}
+			}, priority);
 		}
 	}
 }


Changing 404 error page to return a 404 status code

--- Website/Errors/404.cshtml
+++ Website/Errors/404.cshtml
@@ -7,6 +7,7 @@
     }

     errorPath = Path.GetFileNameWithoutExtension(errorPath);
+    Response.StatusCode = 404;
 }

 <div class="error-page">


Renamed a few Range methods to make them more explicit.

--- WmcSoft.Business/Range.cs
+++ WmcSoft.Business/Range.cs
@@ -34,7 +34,7 @@
 {
     /// <summary>
     /// Stores a range of objects within a single object. This class is useful to use as the
-    /// T of a list.
+    /// <typeparamref name="T"/> of a list.
     /// </summary>
     /// <remarks>The default bounding strategy is <see cref="BoundStrategy{T}.UpperExclusive"/>.</remarks>
     /// <typeparam name="T">The type</typeparam>
@@ -92,20 +92,20 @@

         #region Methods

-        public bool IsLower(T value) {
+        public bool IsLowerThan(T value) {
             return value.CompareTo(Upper) > 0;
         }

-        public bool IsUpper(T value) {
+        public bool IsUpperthan(T value) {
             return value.CompareTo(Lower) < 0;
         }

-        public bool IsAdjacent(Range<T> other) {
+        public bool IsAdjacentTo(Range<T> other) {
             return Upper.CompareTo(other.Lower) == 0 || Lower.CompareTo(other.Upper) == 0;
         }

         public bool Includes(Range<T> other) {
-            return other.IsLower(Upper) && other.IsUpper(Lower);
+            return other.IsLowerThan(Upper) && other.IsUpperthan(Lower);
         }

         public bool Includes<TStrategy>(T value, TStrategy strategy) where TStrategy : IBoundStrategy<T> {
@@ -117,11 +117,11 @@
         }

         public bool Overlaps(Range<T> other) {
-            return IsLower(other.Upper) && Includes(other.Lower) || IsUpper(other.Lower) && Includes(other.Upper);
+            return IsLowerThan(other.Upper) && Includes(other.Lower) || IsUpperthan(other.Lower) && Includes(other.Upper);
         }

         public bool IsDistinct(Range<T> other) {
-            return other.IsLower(Lower) || other.IsUpper(Upper);
+            return other.IsLowerThan(Lower) || other.IsUpperthan(Upper);
         }

         public Range<T> GapBetween(Range<T> other) {
@@ -138,8 +138,8 @@
             return Merge(ranges);
         }

-        public static bool IsContiguous(IEnumerable<Range<T>> enumerable) {
-            var list = new List<Range<T>>(enumerable);
+        public static bool IsContiguous(IEnumerable<Range<T>> collection) {
+            var list = new List<Range<T>>(collection);
             list.Sort();
             return IsContiguous(list);
         }
@@ -147,7 +147,7 @@
         private static bool IsContiguous(IList<Range<T>> list) {
             // requires list is sorted
             for (int i = 1; i < list.Count; i++) {
-                if (!list[i - 1].IsAdjacent(list[i]))
+                if (!list[i - 1].IsAdjacentTo(list[i]))
                     return false;
             }
             return true;
@@ -272,8 +272,13 @@
         public static Range<T> Inflate<T, O>(this Range<T> range, int delta, O ordinal)
             where T : IComparable<T>
             where O : IOrdinal<T> {
-
             return new Range<T>(ordinal.Advance(range.Lower, -delta), ordinal.Advance(range.Upper, delta));
+        }
+
+        public static Range<T> Shift<T, O>(this Range<T> range, int delta, O ordinal)
+            where T : IComparable<T>
+            where O : IOrdinal<T> {
+            return new Range<T>(ordinal.Advance(range.Lower, delta), ordinal.Advance(range.Upper, delta));
         }
     }
 }


Add more NonNull check

Add more NonNull check

--- Wox.Infrastructure/Wox.cs
+++ Wox.Infrastructure/Wox.cs
@@ -11,14 +11,14 @@
         public const string Plugins = "Plugins";

         private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
-        public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location).ToString();
+        public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
         public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
         public static readonly string DataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
         public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
         public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
         public const string Repository = "https://github.com/Wox-launcher/Wox";
         public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
-        public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
+        public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;

         public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
         public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");


Fix socket closing. (#63)

Fix socket closing. (#63)

--- Wukong/Services/Socket.cs
+++ Wukong/Services/Socket.cs
@@ -105,13 +105,7 @@
                 {
                     var token = CancellationToken.None;
                     var buffer = new ArraySegment<Byte>(new Byte[4096]);
-                    var received = await socket.ReceiveAsync(buffer, token);
-                    switch (received.MessageType)
-                    {
-                        case WebSocketMessageType.Close:
-                            await socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "close", CancellationToken.None);
-                            throw new Exception("socket closed");
-                    }
+                    await socket.ReceiveAsync(buffer, token);
                 }
             }
             catch (Exception ex)


Add support for Java 9+

Add support for Java 9+

Java 9 and later only support 64-bit operating systems, and move the
registry keys:

> # Windows Registry Settings
>
> The installation program for the Microsoft Windows version of the Java
> SE Runtime Environment uses the registry to store path and version
> information.
>
> It creates the following registry keys:
>
> * HKEY_LOCAL_MACHINE\Software\JavaSoft\JRE
>
>   This key contains the string CurrentVersion, with a value that is the
>   highest installed version on the system.

[0] https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB
[1] https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB

--- MachineConfig.cs
+++ MachineConfig.cs
@@ -13,13 +13,16 @@
     public class MachineConfig {

         private static string JRERegistryKey = @"Software\\JavaSoft\\Java Runtime Environment";
+        private static string JRERegistryKey2 = @"Software\\JavaSoft\\JRE";
+        private static string[] JREKeys = {JRERegistryKey, JRERegistryKey2};

         private static bool Has64BitJRE {
             get {
                 RegistryKey local64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
-                RegistryKey jreKey64 = local64.OpenSubKey(JRERegistryKey);
-                if (jreKey64 != null) {
-                    return true;
+                foreach (var key in JREKeys)
+                {
+                    if (local64.OpenSubKey(key) != null)
+                        return true;
                 }
                 return false;
             }


Converted all the string conversion functions in AvatarManager to UTF8

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@871 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife-cs/AvatarManager.cs
+++ libsecondlife-cs/AvatarManager.cs
@@ -201,8 +201,8 @@

                 foreach (UUIDNameReplyPacket.UUIDNameBlockBlock block in reply.UUIDNameBlock)
                 {
-                    names[block.ID] = Helpers.FieldToString(block.FirstName) +
-                        " " + Helpers.FieldToString(block.LastName);
+                    names[block.ID] = Helpers.FieldToUTF8String(block.FirstName) +
+                        " " + Helpers.FieldToUTF8String(block.LastName);
                 }

                 OnAvatarNames(names);
@@ -247,7 +247,7 @@

                 foreach (AvatarStatisticsReplyPacket.StatisticsDataBlock b in asr.StatisticsData)
                 {
-                    string n = Helpers.FieldToString(b.Name);
+                    string n = Helpers.FieldToUTF8String(b.Name);

                     switch (n)
                     {
@@ -292,15 +292,15 @@
                 properties.ProfileImage = reply.PropertiesData.ImageID;
                 properties.FirstLifeImage = reply.PropertiesData.FLImageID;
                 properties.Partner = reply.PropertiesData.PartnerID;
-                properties.AboutText = Helpers.FieldToString(reply.PropertiesData.AboutText);
-                properties.FirstLifeText = Helpers.FieldToString(reply.PropertiesData.FLAboutText);
-                properties.BornOn = Helpers.FieldToString(reply.PropertiesData.BornOn);
-                properties.CharterMember = Helpers.FieldToString(reply.PropertiesData.CharterMember);
+                properties.AboutText = Helpers.FieldToUTF8String(reply.PropertiesData.AboutText);
+                properties.FirstLifeText = Helpers.FieldToUTF8String(reply.PropertiesData.FLAboutText);
+                properties.BornOn = Helpers.FieldToUTF8String(reply.PropertiesData.BornOn);
+                properties.CharterMember = Helpers.FieldToUTF8String(reply.PropertiesData.CharterMember);
                 properties.AllowPublish = reply.PropertiesData.AllowPublish;
                 properties.MaturePublish = reply.PropertiesData.MaturePublish;
                 properties.Identified = reply.PropertiesData.Identified;
                 properties.Transacted = reply.PropertiesData.Transacted;
-                properties.ProfileURL = Helpers.FieldToString(reply.PropertiesData.ProfileURL);
+                properties.ProfileURL = Helpers.FieldToUTF8String(reply.PropertiesData.ProfileURL);

                 OnAvatarProperties(reply.AgentData.AvatarID, properties);
             }
@@ -317,10 +317,10 @@
                 Avatar.Interests interests = new Avatar.Interests();

                 interests.WantToMask = airp.PropertiesData.WantToMask;
-                interests.WantToText = Helpers.FieldToString(airp.PropertiesData.WantToText);
+                interests.WantToText = Helpers.FieldToUTF8String(airp.PropertiesData.WantToText);
                 interests.SkillsMask = airp.PropertiesData.SkillsMask;
-                interests.SkillsText = Helpers.FieldToString(airp.PropertiesData.SkillsText);
-                interests.LanguagesText = Helpers.FieldToString(airp.PropertiesData.LanguagesText);
+                interests.SkillsText = Helpers.FieldToUTF8String(airp.PropertiesData.SkillsText);
+                interests.LanguagesText = Helpers.FieldToUTF8String(airp.PropertiesData.LanguagesText);

                 OnAvatarInterests(airp.AgentData.AvatarID, interests);
             }
@@ -347,8 +347,8 @@

                 foreach (AvatarPickerReplyPacket.DataBlock block in reply.Data)
                 {
-                    avatars[block.AvatarID] = Helpers.FieldToString(block.FirstName) +
-                        " " + Helpers.FieldToString(block.LastName);
+                    avatars[block.AvatarID] = Helpers.FieldToUTF8String(block.FirstName) +
+                        " " + Helpers.FieldToUTF8String(block.LastName);
                 }

                 OnAvatarNameSearch(reply.AgentData.QueryID, avatars);


Update AsyncSub.cs

Update AsyncSub.cs

--- NATS/AsyncSub.cs
+++ NATS/AsyncSub.cs
@@ -98,7 +98,7 @@
             if (conn == null)
                 throw new NATSBadSubscriptionException();

-            conn.sendSubscriptonMessage(this);
+            conn.sendSubscriptionMessage(this);
             enableAsyncProcessing();
         }

@@ -116,4 +116,4 @@
             base.AutoUnsubscribe(max);
         }
     }
-}+}


Make Score.cs immutable.

Make Score.cs immutable.

Call to default constructor no longer needed for C# versions below 6.0.

--- NDC2015/Score.cs
+++ NDC2015/Score.cs
@@ -5,16 +5,16 @@
     [Serializable]
     public struct Score
     {
-        public Score(TimeSpan elapsedTime, string contestantName, string phone) : this()
+        public Score(TimeSpan elapsedTime, string contestantName, string phone)
         {
             ElapsedTime = elapsedTime;
             ContestantName = contestantName;
             Phone = phone;
         }

-        public TimeSpan ElapsedTime { get; set; }
-        public string ContestantName { get; set; }
-        public string Phone;
+        public readonly TimeSpan ElapsedTime;
+        public readonly string ContestantName;
+        public readonly string Phone;

         public string FriendlyElapsedTime
         {


WriteObjFile is now public

WriteObjFile is now public

--- ObjParser/Obj.cs
+++ ObjParser/Obj.cs
@@ -38,7 +38,7 @@
 			updateSize();
 		}

-		private void WriteObjFile(string path)
+		public void WriteObjFile(string path)
 		{
 			using (var outStream = File.OpenWrite(path))
 			using (var writer = new StreamWriter(outStream))


Added file header

Added file header

--- ProteinDigest.cs
+++ ProteinDigest.cs
@@ -1,4 +1,9 @@
-using System;
+/*
+ * Copyright 2013 Olivier Caron-Lizotte
+ * olivierlizotte@gmail.com
+ * Licensed under the MIT license: <http://www.opensource.org/licenses/mit-license.php>
+ */
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +13,9 @@

 namespace Trinity_Gpu
 {
+    /// <summary>
+    /// Object returned with results
+    /// </summary>
     public class ProteinPrecursorMatch
     {
         public int proteinStartPos;
@@ -15,6 +23,11 @@
         public int firstQueryIndex;
     }

+    /// <summary>
+    /// This class is used to digest, inGraphico, a protein sequence (as a set of weights) into peptide sequences (as a starting point and a length)
+    /// Will only report peptides matching a list of given masses
+    /// TODO transform the protein mass array into a matrix to have the possibility of including variable modifications
+    /// </summary>
     public class ProteinDigest
     {
         private GPGPU gpu;


formatting

formatting

--- RECmd/Program.cs
+++ RECmd/Program.cs
@@ -322,8 +322,6 @@
                 reBatch = ValidateBatchFile();
             }

-
-

             if (_fluentCommandLineParser.Object.HiveFile?.Length > 0)
             {


mainline: added appendNewLineForResponse option for AppSession

--- mainline/SocketBase/AppSession.cs
+++ mainline/SocketBase/AppSession.cs
@@ -137,8 +137,25 @@
     public abstract class AppSession<TAppSession> : AppSession<TAppSession, StringCommandInfo>
         where TAppSession : IAppSession, IAppSession<TAppSession, StringCommandInfo>, new()
     {
+
+        private bool m_AppendNewLineForResponse = false;
+
+        public AppSession()
+            : this(true)
+        {
+
+        }
+
+        public AppSession(bool appendNewLineForResponse)
+        {
+            m_AppendNewLineForResponse = appendNewLineForResponse;
+        }
+
         protected virtual string ProcessSendingMessage(string rawMessage)
         {
+            if (!m_AppendNewLineForResponse)
+                return rawMessage;
+
             if (AppServer.Config.Mode == SocketMode.Udp)
                 return rawMessage;


Version 1.1.2

Version 1.1.2

Refactored time parsing and related code.

--- SchedShutdown.cs
+++ SchedShutdown.cs
@@ -35,20 +35,20 @@

 namespace Oxide.Plugins
 {
-    [Info("SchedShutdown", "db_arcane", "1.1.1")]
+    [Info("SchedShutdown", "db_arcane", "1.1.2")]
     public class SchedShutdown : RustPlugin
     {
         static List<Oxide.Core.Libraries.Timer.TimerInstance> Timers = new List<Oxide.Core.Libraries.Timer.TimerInstance>();
-        DateTime MainTime = new DateTime();
         Oxide.Core.Libraries.Timer MainTimer;
-        string ErrorStr = "error";
+        string TimeFormat = "HH:mm:ss";
+        string EnabledStr = "enabled";
+        string DisabledStr = "disabled";

         void Init()
         {
             LoadConfig();
             CleanupConfig();
             MainTimer = Interface.GetMod().GetLibrary<Oxide.Core.Libraries.Timer>("Timer");
-            MainTime = DateTime.UtcNow;
         }

         [ConsoleCommand("schedule.shutdown")]
@@ -69,52 +69,60 @@
                     return;
                 }

-                Config["Status"] = "enabled";
+                Config["Status"] = EnabledStr;
+                SaveConfig();
                 ResetShutdownTimer();
                 return;
             }

-            if (param == "disable")
-            {
-                Config["Status"] = "disabled";
+            if (param == DisabledStr)
+            {
+                Config["Status"] = DisabledStr;
+                SaveConfig();
                 ResetShutdownTimer();
                 return;
             }

-            string scheduleTime = ParseTimeSetting(param);
-			if (scheduleTime == ErrorStr)
-			{
-				this.Puts("The time entered was unreadable. No changes have been made. ");
+            if (!IsTimeValid(param))
+            {
+				this.Puts("The time entered was unreadable, must be in format like '01:30:00'. No changes have been made. ");
                 PrintShutdownStatus();
                 return;
-			}
-            Config["Status"] = "enabled";
-            Config["UTC_Time"] = scheduleTime;
+            }
+            Config["Status"] = EnabledStr;
+            Config["UTC_Time"] = param;
+            SaveConfig();
             ResetShutdownTimer();
         }
-

         [HookMethod("OnServerInitialized")]
         void myOnServerInitialized()
         {
-            if (Config["Status"].ToString() == "disabled") {
+            DateTime configTime;
+            DateTime mainTime = DateTime.UtcNow;
+
+            if (Config["Status"].ToString() == DisabledStr) {
                 PrintShutdownStatus();
 				return;
 			}

             // Set up timer for server save and shutdown
-            string shutdownSetting = Config["UTC_Time"].ToString();
-            string[] shutdownHour = shutdownSetting.Split(':');
-            Int32 hours = Convert.ToInt32(shutdownHour[0]);
-            Int32 mins = Convert.ToInt32(shutdownHour[1]);
-            Int32 secs = Convert.ToInt32(shutdownHour[2]);
-
-            DateTime shutdownTime = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, hours, mins, secs, DateTimeKind.Utc);
-            if (MainTime > shutdownTime)
+            try
+            {
+                configTime = DateTime.ParseExact(Config["UTC_Time"].ToString(), TimeFormat, null);
+            }
+            catch (Exception e)
+            {
+                PrintShutdownStatus();
+                return;
+            }
+
+            DateTime shutdownTime = new DateTime(mainTime.Year, mainTime.Month, mainTime.Day, configTime.Hour, configTime.Minute, configTime.Second, DateTimeKind.Utc);
+            if (mainTime > shutdownTime)
             {
                 shutdownTime = shutdownTime.AddDays(1);
             }
-            long shutdownInterval = Convert.ToInt64((shutdownTime - MainTime).TotalSeconds);
+            long shutdownInterval = Convert.ToInt64((shutdownTime - mainTime).TotalSeconds);

             // schedule the server save command.
             Oxide.Core.Libraries.Timer.TimerInstance newTimer = MainTimer.Once(shutdownInterval, () => ConsoleSystem.Run.Server.Normal("server.save"));
@@ -142,21 +150,20 @@
         [HookMethod("LoadDefaultConfig")]
         void myLoadDefaultConfig()
         {
-            Config["Status"] = "disabled";
+            Config["Status"] = DisabledStr;
             Config["UTC_Time"] = "";
             SaveConfig();
         }

         private void ResetShutdownTimer()
         {
-            SaveConfig();
             myUnload();
             myOnServerInitialized();
         }

         private void PrintShutdownStatus()
         {
-            string status = (Config["Status"].ToString() == "disabled") ? "DISABLED" : "ENABLED";
+            string status = (Config["Status"].ToString() == DisabledStr) ? "DISABLED" : "ENABLED";
             string schedTime = Config["UTC_Time"].ToString();
             schedTime = (schedTime == "") ? "blank" : schedTime + " UTC" ;

@@ -166,80 +173,29 @@
         private void CleanupConfig()
         {
             string status = Config["Status"].ToString().ToLower();
-            Config["Status"] = ((status != "enabled") && (status != "disabled")) ? "disabled" : status;
-
-            string schedTime = ParseTimeSetting(Config["UTC_Time"].ToString());
-            Config["UTC_Time"] = (schedTime == ErrorStr) ? "" : schedTime;
+            Config["Status"] = ((status != EnabledStr) && (status != DisabledStr)) ? DisabledStr : status;
+
+            if (!IsTimeValid(Config["UTC_Time"].ToString()))
+            {
+               Config["UTC_Time"] = "";
+               Config["Status"] = DisabledStr;
+            }
             SaveConfig();
         }

-        private string ParseTimeSetting(string str)
-        {
-            Int16 hr = 0;
-            Int16 min = 0;
-            Int16 sec = 0;
-
-            if (str == "") {
-                return ErrorStr;
-            }
-
-            string[] timeSet = str.Split(':');
-
-            if (timeSet.Length > 0)
-            {
-                try
-                {
-                    hr = Convert.ToInt16(timeSet[0]);
-                }
-                catch (FormatException e)
-                {
-                    return ErrorStr;
-                }
-                catch (OverflowException e)
-                {
-                    return ErrorStr;
-                }
-                if ((hr < 0) || (hr > 23))
-                {
-                    return ErrorStr;
-                }
-            }
-
-            if (timeSet.Length > 1)
-            {
-                try
-                {
-                    min = Convert.ToInt16(timeSet[1]);
-                }
-                catch (FormatException e)
-                {
-                    return ErrorStr;
-                }
-                catch (OverflowException e)
-                {
-                    return ErrorStr;
-                }
-                min = ((min < 0) || (min > 59)) ? (Int16)0 : min;
-            }
-
-            if (timeSet.Length > 2)
-            {
-                try
-                {
-                    sec = Convert.ToInt16(timeSet[2]);
-                }
-                catch (FormatException e)
-                {
-                    return ErrorStr;
-                }
-                catch (OverflowException e)
-                {
-                    return ErrorStr;
-                }
-                sec = ((sec < 0) || (sec > 59)) ? (Int16)0 : sec;
-            }
-
-            return (String.Format("{0:00}:{1:00}:{2:00}", hr, min, sec));
+        private bool IsTimeValid(string timeString)
+        {
+            DateTime temp;
+
+            try
+            {
+                temp = DateTime.ParseExact(timeString, TimeFormat, null);
+            }
+            catch (Exception e)
+            {
+                return false;
+            }
+            return true;
         }

     }


cdeclise all the things

cdeclise all the things

fml.

well at least it's stable now

--- kynnaugh/Plugin.cs
+++ kynnaugh/Plugin.cs
@@ -32,7 +32,7 @@
         /// Unique name identifying this plugin
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention=CallingConvention.Cdecl)]
         public static IntPtr ts3plugin_name()
         {
             return StringUtils.NativeUtf8FromString(PluginName);
@@ -42,7 +42,7 @@
         /// Plugin version
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static IntPtr ts3plugin_version()
         {
             return StringUtils.NativeUtf8FromString(PluginVersion);
@@ -52,7 +52,7 @@
         /// Plugin API version. Must be the same as the clients API major version, else the plugin fails to load.
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static int ts3plugin_apiVersion()
         {
             return PluginApiVersion;
@@ -62,7 +62,7 @@
         /// Plugin author
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static IntPtr ts3plugin_author()
         {
             return StringUtils.NativeUtf8FromString(PluginAuthor);
@@ -72,7 +72,7 @@
         /// Plugin description
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static IntPtr ts3plugin_description()
         {
             return StringUtils.NativeUtf8FromString(PluginDescription);
@@ -82,7 +82,7 @@
         /// Set TeamSpeak 3 callback functions
         /// </summary>
         /// <param name="funcs"></param>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static void ts3plugin_setFunctionPointers(TS3Functions funcs)
         {
             Console.WriteLine("Kynnaugh setFunctionPointers()");
@@ -96,7 +96,7 @@
         /// If the function returns 1 on failure, the plugin will be unloaded again.
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static int ts3plugin_init()
         {
             //Console.WriteLine("Kynnaugh init()");
@@ -106,19 +106,19 @@
         /// <summary>
         /// Custom code called right before the plugin is unloaded
         /// </summary>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static void ts3plugin_shutdown()
         {

         }
-        /*
+
         /// <summary>
         /// If the plugin wants to use error return codes, plugin commands, hotkeys or menu items, it needs to register a command ID. This function will be
         /// automatically called after the plugin was initialized.This function is optional.If you don't use these features, this function can be omitted.
         /// Note the passed pluginID parameter is no longer valid after calling this function, so you must copy it and store it in the plugin.
         /// </summary>
         /// <param name="id"></param>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static void ts3plugin_registerPluginID(IntPtr id)
         {
             PluginId = StringUtils.StringFromNativeUtf8(id);
@@ -129,7 +129,7 @@
         /// Required to release the memory for parameter "data" allocated in ts3plugin_infoData and ts3plugin_initMenus
         /// </summary>
         /// <param name="data"></param>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static void ts3plugin_freeMemory(IntPtr data)
         {
             Marshal.FreeHGlobal(data);
@@ -142,7 +142,7 @@
         /// This function is optional.If missing, no autoload is assumed.
         /// </summary>
         /// <returns></returns>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static int ts3plugin_requestAutoload()
         {
             return 1;  // 1 = request autoloaded, 0 = do not request autoload
@@ -156,12 +156,12 @@
         /// <param name="samples">short*</param>
         /// <param name="sampleCount"></param>
         /// <param name="channels"></param>
-        [DllExport]
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
         public static void ts3plugin_onEditPlaybackVoiceDataEvent(UInt64 serverConnectionHandlerID, anyId clientID, IntPtr samples,
                                                         int sampleCount, int channels)
         {
             short[] managedSamples = new short[sampleCount];
             Marshal.Copy(samples, managedSamples, 0, sampleCount);
-        }*/
+        }
     }
 }


Fix crash on invalid command from UI

Fix crash on invalid command from UI

--- Torch.Server/Views/ChatControl.xaml.cs
+++ Torch.Server/Views/ChatControl.xaml.cs
@@ -178,6 +178,12 @@
                 _server.Invoke(() =>
                 {
                     var responses = commands.HandleCommandFromServer(text);
+                    if (responses == null)
+                    {
+                        InsertMessage(new TorchChatMessage(TorchBase.Instance.Config.ChatName, "Invalid command.", TorchBase.Instance.Config.ChatColor));
+                        return;
+                    }
+
                     foreach (var response in responses)
                         InsertMessage(response);
                 });


Updated TouchDebugger.

Updated TouchDebugger.

--- TouchScript/Debugging/TouchDebugger.cs
+++ TouchScript/Debugging/TouchDebugger.cs
@@ -64,7 +64,6 @@
         private Dictionary<int, ITouch> dummies = new Dictionary<int, ITouch>(10);
         private float textureDPI, scale, dpi;
         private int width, height, halfWidth, halfHeight;
-        private GUIStyle style;

         #endregion


サイトメニューにスタイルとスクリプトを挿入する機能を追加。

サイトメニューにスタイルとスクリプトを挿入する機能を追加。


Simple workaround for Mono C# compiler

Simple workaround for Mono C# compiler


- Symbol finder tests

- Symbol finder tests

--- src/AnalyzeMe/AnalyzeMe.Design.Analyzers/xUnit/MemberDataParameterMismatchAnalyzer.cs
+++ src/AnalyzeMe/AnalyzeMe.Design.Analyzers/xUnit/MemberDataParameterMismatchAnalyzer.cs
@@ -1,11 +1,13 @@
 using System;
 using System.Collections.Immutable;
 using System.Linq;
+using System.Threading.Tasks;
 using AnalyzeMe.Design.Analyzers.Utils;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.FindSymbols;

 namespace AnalyzeMe.Design.Analyzers.xUnit
 {
@@ -55,10 +57,10 @@
 		                .Arguments
 		                .FirstOrDefault();

-		        if (memberNameParameter == null || memberNameParameter?.NameEquals != null || memberNameParameter?.NameColon.ToString() != "memberName")
-		        {
-		            continue;
-		        }
+		        //if (memberNameParameter == null || memberNameParameter.NameEquals != null || memberNameParameter.NameColon.ToString() != "memberName")
+		        //{
+		        //    continue;
+		        //}

 		        var memberTypeParameter =
                     memberDataAttribute
@@ -66,8 +68,32 @@
 		                .ArgumentList
 		                .Arguments
 		                .FirstOrDefault(x => x.NameEquals != null && x.NameEquals.Name.ToString() == "MemberType" && x.Expression != null);
+
+			    Workspace ws;
+			    ctx.Node.TryGetWorkspace(out ws);
+
+			    var testFixtureClass = memberTypeParameter == null
+				    ? ctx.SemanticModel.GetDeclaredSymbol((MethodDeclarationSyntax) ctx.Node)
+				    : FindClassDeclaration(ws, memberTypeParameter.ToFullString());
 		    }

 		}
+
+		private ISymbol FindClassDeclaration(Workspace workspace, string name)
+		{
+			var a = workspace
+				.CurrentSolution
+				.Projects
+				.Select(p => SymbolFinder.FindDeclarationsAsync(p, name, false))
+				.ToArray();
+			var res = Task
+				.WhenAll(a)
+				.ContinueWith(t => t.Result)
+				.Result
+				.SelectMany(x => x)
+				.ToArray();
+
+			return null;
+		}
 	}
 }


updated nav header layout so hamburger only shows when user logged in. Removed superfluous ul, and switched to nesting anchor in div to be valid html


Initialize Old List to prevent Crash

Initialize Old List to prevent Crash


Update src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs

Co-Authored-By: CyrusNajmabadi <726e0bc5de2519d72823786c7b6950f817ce3249@gmail.com>

--- src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs
+++ src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs
@@ -9,7 +9,7 @@

 namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.AddExplicitCast
 {
-    sealed class InheritanceDistanceComparer : IComparer<ITypeSymbol>
+    internal sealed class InheritanceDistanceComparer : IComparer<ITypeSymbol>
     {
         private readonly ITypeSymbol _baseType;
         private readonly SemanticModel _semanticModel;


Taking EntryAssembly on AddMonitoring

Taking EntryAssembly on AddMonitoring

--- src/Greentube.Monitoring/DependencyInjection/MonitoringServiceCollectionExtensions.cs
+++ src/Greentube.Monitoring/DependencyInjection/MonitoringServiceCollectionExtensions.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Linq;
+using System.Reflection;
 using Greentube.Monitoring;
+using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;

@@ -15,18 +17,25 @@
         /// <summary>
         /// Adds the monitoring services
         /// </summary>
+        /// <remarks>
+        /// The Assembly parameter is not needed when targeting netstandard1.5
+        /// When this package targets 1.5, we can delete this argument and call Assembly.GetEntryAssembly() instead
+        /// </remarks>
         /// <param name="services">The services.</param>
+        /// <param name="entryAssembly">Reference to the Entry Assembly (to take version from)</param>
         /// <param name="optionsAction">The options action.</param>
         /// <returns></returns>
         public static IServiceCollection AddMonitoring(
             this IServiceCollection services,
+            Assembly entryAssembly,
             Action<MonitoringOptions> optionsAction = null)
         {
             var options = new MonitoringOptions();
             optionsAction?.Invoke(options);

             return services
-                .AddSingleton<IVersionService, VersionService>()
+                .AddSingleton<IVersionService, VersionService>(
+                    provider => new VersionService(provider.GetRequiredService<IHostingEnvironment>(), entryAssembly))
                 .AddSingleton<IResourceMonitorConfiguration>(options)
                 .AddSingleton<IResourceStateCollector>(p =>
                 {


Add filter to skip registration of open generics with mismatched arity

--- src/MediatR.Extensions.Microsoft.DependencyInjection/Registration/ServiceRegistrar.cs
+++ src/MediatR.Extensions.Microsoft.DependencyInjection/Registration/ServiceRegistrar.cs
@@ -32,10 +32,13 @@

             foreach (var multiOpenInterface in multiOpenInterfaces)
             {
+                var arity = multiOpenInterface.GetGenericArguments().Length;
+
                 var concretions = assembliesToScan
                     .SelectMany(a => a.DefinedTypes)
                     .Where(type => type.FindInterfacesThatClose(multiOpenInterface).Any())
                     .Where(type => type.IsConcrete() && type.IsOpenGeneric())
+                    .Where(type => type.GetGenericArguments().Length == arity)
                     .ToList();

                 foreach (var type in concretions)


完善单元测试（通过）

完善单元测试（通过）

--- src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/MassApi/MassApiTests.cs
+++ src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/AdvancedAPIs/MassApi/MassApiTests.cs
@@ -25,7 +25,7 @@
             }
             catch (Senparc.Weixin.Exceptions.UnRegisterAppIdException e)
             {
-                Assert.Fail();//出现反馈问题中的“AppId未注册”错误
+                Assert.Fail(); //出现反馈问题中的“AppId未注册”错误
             }
             catch (Senparc.Weixin.Exceptions.ErrorJsonResultException e)
             {
@@ -34,7 +34,10 @@

                 //没有发生AppId未注册的错误
             }
-
+            catch (Exception e)
+            {
+                Assert.Fail();//其他错误
+            }
         }
     }
 }


Fix comment typo

Fix comment typo

--- src/SimpleInjector.Integration.Web.Mvc/SimpleInjectorFilterAttributeFilterProvider.cs
+++ src/SimpleInjector.Integration.Web.Mvc/SimpleInjectorFilterAttributeFilterProvider.cs
@@ -17,7 +17,7 @@
         private readonly Func<Type, Registration> registrationFactory;

         // Supply false for cacheAttributeInstances, because otherwise attributes become singletons and this
-        // has can cause all sorts of concurrency bugs, because attributes will becomes singletons.
+        // can cause all sorts of concurrency bugs, because attributes will become singletons.
         internal SimpleInjectorFilterAttributeFilterProvider(Container container)
             : base(cacheAttributeInstances: false)
         {
@@ -58,4 +58,4 @@
             registration.InitializeInstance(instance);
         }
     }
-}+}


fix - prova correzione coordinate su test

--- src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/GetComposizioneMezzi.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/Composizione/GetComposizioneMezzi.cs
@@ -99,6 +99,8 @@
                     m.PreAccoppiato = lstSqPreacc.Result?.Count > 0;
                     m.IdRichiesta = statiOperativiMezzi.FirstOrDefault(s => s.CodiceMezzo == m.Codice)?.CodiceRichiesta;

+                    var c1 = query.Richiesta.Localita.CoordinateString.Select(c => c.Replace('.', ',')).ToArray();
+
                     var mc = new ComposizioneMezzi()
                     {
                         //Id = m.Codice,
@@ -106,9 +108,9 @@
                         IndirizzoIntervento = m.Stato != Costanti.MezzoInSede ? query?.Richiesta?.Localita.Indirizzo : null,
                         SquadrePreaccoppiate = lstSqPreacc.Result,
                         ListaSquadre = lstSquadreInRientro.Result,
-                        //Km = (new GeoCoordinate(m.Coordinate.Latitudine, m.Coordinate.Longitudine)
-                        //    .GetDistanceTo(new GeoCoordinate(query.Richiesta.Localita.Coordinate.Latitudine, query.Richiesta.Localita.Coordinate.Longitudine))
-                        //    / 1000).ToString("N1"),
+                        Km = (new GeoCoordinate(m.Coordinate.Latitudine, m.Coordinate.Longitudine)
+                            .GetDistanceTo(new GeoCoordinate(double.Parse(c1[0]), double.Parse(c1[1])))
+                            / 1000).ToString("N1"),
                         TempoPercorrenza = null
                     };

@@ -122,10 +124,10 @@
                         {
                             case Costanti.MezzoInViaggio:
                                 mc.Mezzo.IdRichiesta = statoMezzo.CodiceRichiesta;
-                                //var c1 = query.Richiesta.Localita.Coordinate;
-                                //mc.Km = _geofleet.Get(mc.Mezzo.Codice).Result?.Localizzazione
-                                //    .GetDistanceTo(new Localizzazione(c1.Latitudine, c1.Longitudine))
-                                //    .ToString("N1");
+                                var c2 = query.Richiesta.Localita.CoordinateString.Select(c => c.Replace('.', ',')).ToArray();
+                                mc.Km = _geofleet.Get(mc.Mezzo.Codice).Result?.Localizzazione
+                                    .GetDistanceTo(new Localizzazione(double.Parse(c2[0]), double.Parse(c2[1])))
+                                    .ToString("N1");
                                 break;

                             case Costanti.MezzoSulPosto:


removed class type constraint from use methods

--- LanguageExt.Core/Prelude/Prelude_Use.cs
+++ LanguageExt.Core/Prelude/Prelude_Use.cs
@@ -9,28 +9,28 @@
         /// Use with Try monad in LINQ expressions to auto-clean up disposable items
         /// </summary>
         public static Try<B> use<A, B>(Try<A> computation, Func<A, B> map)
-            where A : class, IDisposable =>
+            where A : IDisposable =>
             computation.Use(map);

         /// <summary>
         /// Use with Try monad in LINQ expressions to auto-clean up disposable items
         /// </summary>
         public static Try<B> use<A, B>(Try<A> computation, Func<A, Try<B>> bind)
-            where A : class, IDisposable =>
+            where A : IDisposable =>
             computation.Use(bind);

         /// <summary>
         /// Use with Task in LINQ expressions to auto-clean up disposable items
         /// </summary>
         public static Task<B> use<A, B>(Task<A> computation, Func<A, B> map)
-            where A : class, IDisposable =>
+            where A : IDisposable =>
             computation.Map(d => use(d, map));

         /// <summary>
         /// Use with Task in LINQ expressions to auto-clean up disposable items
         /// </summary>
         public static async Task<B> use<A, B>(Task<A> computation, Func<A, Task<B>> bind)
-            where A : class, IDisposable
+            where A : IDisposable
         {
             var a = await computation;
             try
@@ -50,7 +50,7 @@
         /// <param name="f">Inner map function that uses the disposable value</param>
         /// <returns>Result of f(disposable)</returns>
         public static B use<A, B>(Func<A> generator, Func<A, B> f)
-            where A : class, IDisposable
+            where A : IDisposable
         {
             var value = generator();
             try


private setter for Id and JobId in MemoryStorageFetchedJob

--- MemoryStorageFetchedJob.cs
+++ MemoryStorageFetchedJob.cs
@@ -16,8 +16,8 @@
             JobId = queue.JobId;
         }

-        public int Id { get; }
-        public string JobId { get; }
+        public int Id { get; private set; }
+        public string JobId { get; private set; }

         public void RemoveFromQueue()
         {


code cleanup

code cleanup

--- MimeKit/Utils/MimeUtils.cs
+++ MimeKit/Utils/MimeUtils.cs
@@ -104,7 +104,7 @@
 		/// </exception>
 		public static IEnumerable<string> EnumerateReferences (byte[] buffer, int startIndex, int length)
 		{
-			byte[] sentinels = new byte[] { (byte) '>' };
+			byte[] sentinels = { (byte) '>' };
 			int endIndex = startIndex + length;
 			int index = startIndex;
 			InternetAddress addr;